feat: improve gateway services and auto-reply commands
This commit is contained in:
@@ -52,7 +52,7 @@ import {
|
||||
resolveGatewayPort,
|
||||
writeConfigFile,
|
||||
} from "../config/config.js";
|
||||
import { GATEWAY_LAUNCH_AGENT_LABEL } from "../daemon/constants.js";
|
||||
import { resolveGatewayLaunchAgentLabel } from "../daemon/constants.js";
|
||||
import { resolveGatewayProgramArguments } from "../daemon/program-args.js";
|
||||
import { resolvePreferredNodePath } from "../daemon/runtime-paths.js";
|
||||
import { resolveGatewayService } from "../daemon/service.js";
|
||||
@@ -627,7 +627,9 @@ export async function runOnboardingWizard(
|
||||
);
|
||||
}
|
||||
const service = resolveGatewayService();
|
||||
const loaded = await service.isLoaded({ env: process.env });
|
||||
const loaded = await service.isLoaded({
|
||||
profile: process.env.CLAWDBOT_PROFILE,
|
||||
});
|
||||
if (loaded) {
|
||||
const action = (await prompter.select({
|
||||
message: "Gateway service already installed",
|
||||
@@ -638,7 +640,10 @@ export async function runOnboardingWizard(
|
||||
],
|
||||
})) as "restart" | "reinstall" | "skip";
|
||||
if (action === "restart") {
|
||||
await service.restart({ stdout: process.stdout });
|
||||
await service.restart({
|
||||
profile: process.env.CLAWDBOT_PROFILE,
|
||||
stdout: process.stdout,
|
||||
});
|
||||
} else if (action === "reinstall") {
|
||||
await service.uninstall({ env: process.env, stdout: process.stdout });
|
||||
}
|
||||
@@ -646,7 +651,9 @@ export async function runOnboardingWizard(
|
||||
|
||||
if (
|
||||
!loaded ||
|
||||
(loaded && (await service.isLoaded({ env: process.env })) === false)
|
||||
(loaded &&
|
||||
(await service.isLoaded({ profile: process.env.CLAWDBOT_PROFILE })) ===
|
||||
false)
|
||||
) {
|
||||
const devMode =
|
||||
process.argv[1]?.includes(`${path.sep}src${path.sep}`) &&
|
||||
@@ -668,7 +675,7 @@ export async function runOnboardingWizard(
|
||||
token: gatewayToken,
|
||||
launchdLabel:
|
||||
process.platform === "darwin"
|
||||
? GATEWAY_LAUNCH_AGENT_LABEL
|
||||
? resolveGatewayLaunchAgentLabel(process.env.CLAWDBOT_PROFILE)
|
||||
: undefined,
|
||||
});
|
||||
await service.install({
|
||||
|
||||
Reference in New Issue
Block a user