openclaw/src/daemon/service-types.ts
Robin Waslander 841ee24340
fix(daemon): address clanker review findings for kickstart restart
Bug 1 (high): replace fixed sleep 1 with caller-PID polling in both
kickstart and start-after-exit handoff modes. The helper now waits until
kill -0 $caller_pid fails before issuing launchctl kickstart -k.

Bug 2 (medium): gate enable+bootstrap fallback on isLaunchctlNotLoaded().
Only attempt re-registration when kickstart -k fails because the job is
absent; all other kickstart failures now re-throw the original error.

Follows up on 3c0fd3dffe.
Fixes #43311, #43406, #43035, #43049
2026-03-12 02:16:24 +01:00

42 lines
1.0 KiB
TypeScript

export type GatewayServiceEnv = Record<string, string | undefined>;
export type GatewayServiceInstallArgs = {
env: GatewayServiceEnv;
stdout: NodeJS.WritableStream;
programArguments: string[];
workingDirectory?: string;
environment?: GatewayServiceEnv;
description?: string;
};
export type GatewayServiceManageArgs = {
env: GatewayServiceEnv;
stdout: NodeJS.WritableStream;
};
export type GatewayServiceControlArgs = {
stdout: NodeJS.WritableStream;
env?: GatewayServiceEnv;
};
export type GatewayServiceRestartResult = { outcome: "completed" } | { outcome: "scheduled" };
export type GatewayServiceEnvArgs = {
env?: GatewayServiceEnv;
};
export type GatewayServiceCommandConfig = {
programArguments: string[];
workingDirectory?: string;
environment?: Record<string, string>;
environmentValueSources?: Record<string, "inline" | "file">;
sourcePath?: string;
};
export type GatewayServiceRenderArgs = {
description?: string;
programArguments: string[];
workingDirectory?: string;
environment?: GatewayServiceEnv;
};