@namzu/cli 23.0.0 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/README.md +12 -0
  3. package/dist/cli.d.ts.map +1 -1
  4. package/dist/cli.js +17 -10
  5. package/dist/cli.js.map +1 -1
  6. package/dist/commands/resident-flags.d.ts +19 -0
  7. package/dist/commands/resident-flags.d.ts.map +1 -0
  8. package/dist/commands/resident-flags.js +153 -0
  9. package/dist/commands/resident-flags.js.map +1 -0
  10. package/dist/commands/resident.d.ts +20 -0
  11. package/dist/commands/resident.d.ts.map +1 -0
  12. package/dist/commands/resident.js +380 -0
  13. package/dist/commands/resident.js.map +1 -0
  14. package/dist/commands/upgrade.d.ts +1 -0
  15. package/dist/commands/upgrade.d.ts.map +1 -1
  16. package/dist/commands/upgrade.js +6 -3
  17. package/dist/commands/upgrade.js.map +1 -1
  18. package/dist/integrations/npm-invocation.d.ts +10 -0
  19. package/dist/integrations/npm-invocation.d.ts.map +1 -0
  20. package/dist/integrations/npm-invocation.js +23 -0
  21. package/dist/integrations/npm-invocation.js.map +1 -0
  22. package/dist/integrations/providers/credential-store.d.ts +8 -7
  23. package/dist/integrations/providers/credential-store.d.ts.map +1 -1
  24. package/dist/integrations/providers/credential-store.js +44 -17
  25. package/dist/integrations/providers/credential-store.js.map +1 -1
  26. package/dist/integrations/providers/discover.d.ts.map +1 -1
  27. package/dist/integrations/providers/discover.js +7 -2
  28. package/dist/integrations/providers/discover.js.map +1 -1
  29. package/dist/integrations/providers/harness-credentials.d.ts +2 -2
  30. package/dist/integrations/providers/harness-credentials.d.ts.map +1 -1
  31. package/dist/integrations/providers/harness-credentials.js +13 -8
  32. package/dist/integrations/providers/harness-credentials.js.map +1 -1
  33. package/dist/integrations/providers/setup.d.ts.map +1 -1
  34. package/dist/integrations/providers/setup.js +52 -5
  35. package/dist/integrations/providers/setup.js.map +1 -1
  36. package/dist/integrations/resident/foreground.d.ts +19 -0
  37. package/dist/integrations/resident/foreground.d.ts.map +1 -0
  38. package/dist/integrations/resident/foreground.js +95 -0
  39. package/dist/integrations/resident/foreground.js.map +1 -0
  40. package/dist/integrations/resident/lifecycle-errors.d.ts +9 -0
  41. package/dist/integrations/resident/lifecycle-errors.d.ts.map +1 -0
  42. package/dist/integrations/resident/lifecycle-errors.js +15 -0
  43. package/dist/integrations/resident/lifecycle-errors.js.map +1 -0
  44. package/dist/integrations/resident/owned-runner.d.ts +17 -0
  45. package/dist/integrations/resident/owned-runner.d.ts.map +1 -0
  46. package/dist/integrations/resident/owned-runner.js +91 -0
  47. package/dist/integrations/resident/owned-runner.js.map +1 -0
  48. package/dist/integrations/resident/runner-control.d.ts +47 -0
  49. package/dist/integrations/resident/runner-control.d.ts.map +1 -0
  50. package/dist/integrations/resident/runner-control.js +238 -0
  51. package/dist/integrations/resident/runner-control.js.map +1 -0
  52. package/dist/integrations/resident/runner-launch.d.ts +47 -0
  53. package/dist/integrations/resident/runner-launch.d.ts.map +1 -0
  54. package/dist/integrations/resident/runner-launch.js +140 -0
  55. package/dist/integrations/resident/runner-launch.js.map +1 -0
  56. package/dist/integrations/resident/runner-store.d.ts +44 -0
  57. package/dist/integrations/resident/runner-store.d.ts.map +1 -0
  58. package/dist/integrations/resident/runner-store.js +283 -0
  59. package/dist/integrations/resident/runner-store.js.map +1 -0
  60. package/dist/integrations/resident/runner-worker.d.ts +2 -0
  61. package/dist/integrations/resident/runner-worker.d.ts.map +1 -0
  62. package/dist/integrations/resident/runner-worker.js +143 -0
  63. package/dist/integrations/resident/runner-worker.js.map +1 -0
  64. package/dist/integrations/resident/session-step.d.ts +24 -0
  65. package/dist/integrations/resident/session-step.d.ts.map +1 -0
  66. package/dist/integrations/resident/session-step.js +366 -0
  67. package/dist/integrations/resident/session-step.js.map +1 -0
  68. package/dist/integrations/resident/storage.d.ts +17 -0
  69. package/dist/integrations/resident/storage.d.ts.map +1 -0
  70. package/dist/integrations/resident/storage.js +139 -0
  71. package/dist/integrations/resident/storage.js.map +1 -0
  72. package/dist/integrations/state/private-directory.d.ts +4 -2
  73. package/dist/integrations/state/private-directory.d.ts.map +1 -1
  74. package/dist/integrations/state/private-directory.js +6 -4
  75. package/dist/integrations/state/private-directory.js.map +1 -1
  76. package/dist/tui/agent.d.ts +10 -1
  77. package/dist/tui/agent.d.ts.map +1 -1
  78. package/dist/tui/agent.js +77 -18
  79. package/dist/tui/agent.js.map +1 -1
  80. package/dist/tui/exit-summary.d.ts +1 -1
  81. package/dist/tui/exit-summary.d.ts.map +1 -1
  82. package/dist/tui/exit-summary.js +17 -5
  83. package/dist/tui/exit-summary.js.map +1 -1
  84. package/package.json +5 -5
@@ -0,0 +1,95 @@
1
+ import { setTimeout as sleep } from 'node:timers/promises';
2
+ import { ResidentHost, } from '@namzu/sdk';
3
+ /** One explicitly authorized foreground invocation, with cross-process stop observation. */
4
+ export async function runResidentForeground(options) {
5
+ const { agenda } = options;
6
+ if (!agenda.executionAt)
7
+ throw new Error('Resident execution requires atomic admission.');
8
+ const interval = options.pollIntervalMs ?? 250;
9
+ if (!Number.isSafeInteger(interval) || interval < 1 || interval > 60_000)
10
+ throw new Error('Invalid resident control polling interval.');
11
+ options.signal.throwIfAborted();
12
+ const initial = await agenda.read();
13
+ if (!initial)
14
+ throw new Error('No resident agenda exists here.');
15
+ const generation = options.expectedPauseGeneration ?? initial.pauseGeneration ?? 0;
16
+ const controller = new AbortController();
17
+ const signal = AbortSignal.any([options.signal, controller.signal]);
18
+ const fence = (state) => {
19
+ if (!state)
20
+ throw new Error('Resident agenda disappeared during execution.');
21
+ if ((state.pauseGeneration ?? 0) !== generation)
22
+ controller.abort(new Error('A durable pause request ended this invocation.'));
23
+ return state;
24
+ };
25
+ const read = async () => {
26
+ await options.checkControl?.();
27
+ return fence(await agenda.read());
28
+ };
29
+ const guarded = {
30
+ read,
31
+ create: (...args) => agenda.create(...args),
32
+ add: (...args) => agenda.add(...args),
33
+ setPaused: (...args) => agenda.setPaused(...args),
34
+ wake: (...args) => agenda.wake(...args),
35
+ execution: (id) => agenda.execution(id),
36
+ executionAt: (id, expected) => {
37
+ const execution = agenda.executionAt?.(id, expected);
38
+ if (!execution)
39
+ throw new Error('Resident atomic admission was removed.');
40
+ return {
41
+ read: () => execution.read(),
42
+ claim: async (...args) => {
43
+ await read();
44
+ signal.throwIfAborted();
45
+ // Keep the exact learning/admission snapshot. Do not substitute the
46
+ // newer control read for the snapshot projected into this step.
47
+ return execution.claim(...args);
48
+ },
49
+ settle: (...args) => execution.settle(...args),
50
+ };
51
+ },
52
+ };
53
+ const host = new ResidentHost(guarded, async (...args) => {
54
+ await read();
55
+ signal.throwIfAborted();
56
+ return options.step(...args);
57
+ }, { learning: true });
58
+ const monitorStop = new AbortController();
59
+ let monitorFailure;
60
+ let lastRevision = initial.revision;
61
+ const monitor = (async () => {
62
+ try {
63
+ while (!monitorStop.signal.aborted) {
64
+ await sleep(interval, undefined, { signal: monitorStop.signal });
65
+ const state = await read();
66
+ if (state.revision !== lastRevision) {
67
+ lastRevision = state.revision;
68
+ host.notify();
69
+ }
70
+ }
71
+ }
72
+ catch (error) {
73
+ if (!monitorStop.signal.aborted) {
74
+ monitorFailure = error;
75
+ controller.abort(error);
76
+ }
77
+ }
78
+ })();
79
+ try {
80
+ const result = await host.run({
81
+ signal,
82
+ maxSteps: options.maxSteps,
83
+ ...(options.keepAlive !== undefined ? { keepAlive: options.keepAlive } : {}),
84
+ ...(options.maxIdleMs !== undefined ? { maxIdleMs: options.maxIdleMs } : {}),
85
+ });
86
+ if (monitorFailure)
87
+ throw monitorFailure;
88
+ return result;
89
+ }
90
+ finally {
91
+ monitorStop.abort();
92
+ await monitor;
93
+ }
94
+ }
95
+ //# sourceMappingURL=foreground.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreground.js","sourceRoot":"","sources":["../../../src/integrations/resident/foreground.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,I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AM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC;YAC7B,MAAM;YACN,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC5E,GAAG,CAAC,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC5E,CAAC,CAAA;QACF,IAAI,cAAc;YAAE,MAAM,cAAc,CAAA;QACxC,OAAO,MAAM,CAAA;IACd,CAAC;YAAS,CAAC;QACV,WAAW,CAAC,KAAK,EAAE,CAAA;QACnB,MAAM,OAAO,CAAA;IACd,CAAC;AACF,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * The callback has finished awaiting cleanup, but cannot certify that every
3
+ * owned resource drained. A managed runner must retain its ownership record.
4
+ * Latch this error at the step boundary: cancellation may hide it at the host.
5
+ */
6
+ export declare class ResidentCleanupUnconfirmedError extends AggregateError {
7
+ constructor(errors: readonly unknown[]);
8
+ }
9
+ //# sourceMappingURL=lifecycle-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-errors.d.ts","sourceRoot":"","sources":["../../../src/integrations/resident/lifecycle-errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,+BAAgC,SAAQ,cAAc;gBACtD,MAAM,EAAE,SAAS,OAAO,EAAE;CAYtC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The callback has finished awaiting cleanup, but cannot certify that every
3
+ * owned resource drained. A managed runner must retain its ownership record.
4
+ * Latch this error at the step boundary: cancellation may hide it at the host.
5
+ */
6
+ export class ResidentCleanupUnconfirmedError extends AggregateError {
7
+ constructor(errors) {
8
+ super(errors, [
9
+ 'Resident cleanup is unconfirmed; runner ownership must be retained.',
10
+ ...errors.map((error) => (error instanceof Error ? error.message : String(error)).slice(0, 4_000)),
11
+ ].join('\n'));
12
+ this.name = 'ResidentCleanupUnconfirmedError';
13
+ }
14
+ }
15
+ //# sourceMappingURL=lifecycle-errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-errors.js","sourceRoot":"","sources":["../../../src/integrations/resident/lifecycle-errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,+BAAgC,SAAQ,cAAc;IAClE,YAAY,MAA0B;QACrC,KAAK,CACJ,MAAM,EACN;YACC,qEAAqE;YACrE,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CACvB,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CACxE;SACD,CAAC,IAAI,CAAC,IAAI,CAAC,CACZ,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,iCAAiC,CAAA;IAC9C,CAAC;CACD"}
@@ -0,0 +1,17 @@
1
+ import type { ResidentContextualStep, ResidentHostResult } from '@namzu/sdk';
2
+ import { type RunnerRecord, publicRunner } from './runner-store.js';
3
+ import type { CliResident } from './storage.js';
4
+ export interface OwnedResidentOptions {
5
+ readonly resident: CliResident;
6
+ readonly owner: RunnerRecord;
7
+ readonly step: ResidentContextualStep;
8
+ readonly signal: AbortSignal;
9
+ readonly keepAlive: boolean;
10
+ readonly maxIdleMs: number;
11
+ /** Readiness means control and durable ownership are installed, not model availability. */
12
+ readonly ready?: (owner: ReturnType<typeof publicRunner>, signal: AbortSignal) => Promise<void>;
13
+ readonly pollIntervalMs?: number;
14
+ }
15
+ /** Keep ownership until the SDK invocation, callback cleanup and control server drain. */
16
+ export declare function runOwnedResident(options: OwnedResidentOptions): Promise<ResidentHostResult>;
17
+ //# sourceMappingURL=owned-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owned-runner.d.ts","sourceRoot":"","sources":["../../../src/integrations/resident/owned-runner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAI5E,OAAO,EACN,KAAK,YAAY,EAGjB,YAAY,EAEZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAA;IAC9B,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAA;IAC5B,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAA;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAA;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/F,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,0FAA0F;AAC1F,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA+EjG"}
@@ -0,0 +1,91 @@
1
+ import { runResidentForeground } from './foreground.js';
2
+ import { ResidentCleanupUnconfirmedError } from './lifecycle-errors.js';
3
+ import { createRunnerControlServer } from './runner-control.js';
4
+ import { attachRunning, finishRunner, publicRunner, readRunner, } from './runner-store.js';
5
+ /** Keep ownership until the SDK invocation, callback cleanup and control server drain. */
6
+ export async function runOwnedResident(options) {
7
+ const { resident } = options;
8
+ let owner = options.owner;
9
+ let phase = 'starting';
10
+ let stepsStarted = 0;
11
+ const controller = new AbortController();
12
+ const signal = AbortSignal.any([options.signal, controller.signal]);
13
+ const abort = () => {
14
+ phase = 'stopping';
15
+ controller.abort(new Error('Resident runner stop requested.'));
16
+ };
17
+ const checkControl = async () => {
18
+ const current = readRunner(resident);
19
+ if (current?.instanceId !== owner.instanceId || current.phase !== 'running')
20
+ throw new Error('Resident runner ownership changed; this invocation is fenced.');
21
+ };
22
+ let server;
23
+ let outcome = 'startup_failed';
24
+ let cleanupConfirmed = true;
25
+ try {
26
+ signal.throwIfAborted();
27
+ const state = await resident.agenda.read();
28
+ if (!state || state.paused || (state.pauseGeneration ?? 0) !== owner.pauseGeneration)
29
+ throw new Error('Resident admission changed before runner startup. Resume and start a new invocation.');
30
+ if (state.pursuits.some((p) => p.state.phase === 'running'))
31
+ throw new Error('Inspect and reconcile unresolved work before starting a runner.');
32
+ server = await createRunnerControlServer({
33
+ instanceId: owner.instanceId,
34
+ token: owner.token,
35
+ getStatus: () => ({
36
+ pid: process.pid,
37
+ phase: signal.aborted ? 'stopping' : phase,
38
+ stepsStarted,
39
+ }),
40
+ onStop: abort,
41
+ });
42
+ owner = attachRunning(resident, owner, { pid: process.pid, port: server.port });
43
+ await checkControl();
44
+ await options.ready?.(publicRunner(owner), signal);
45
+ signal.throwIfAborted();
46
+ phase = 'idle';
47
+ const result = await runResidentForeground({
48
+ agenda: resident.agenda,
49
+ step: async (...args) => {
50
+ phase = 'working';
51
+ stepsStarted++;
52
+ try {
53
+ return await options.step(...args);
54
+ }
55
+ catch (error) {
56
+ // The SDK host turns aborted callbacks into a cancelled result.
57
+ // Latch failed drainage before that conversion can hide it.
58
+ if (error instanceof ResidentCleanupUnconfirmedError)
59
+ cleanupConfirmed = false;
60
+ throw error;
61
+ }
62
+ finally {
63
+ phase = signal.aborted ? 'stopping' : 'idle';
64
+ }
65
+ },
66
+ signal,
67
+ maxSteps: owner.maxSteps,
68
+ maxIdleMs: options.maxIdleMs,
69
+ keepAlive: options.keepAlive,
70
+ expectedPauseGeneration: owner.pauseGeneration,
71
+ checkControl,
72
+ ...(options.pollIntervalMs ? { pollIntervalMs: options.pollIntervalMs } : {}),
73
+ });
74
+ outcome = result.status;
75
+ return result;
76
+ }
77
+ catch (error) {
78
+ if (error instanceof ResidentCleanupUnconfirmedError)
79
+ cleanupConfirmed = false;
80
+ outcome = signal.aborted ? 'cancelled' : 'failed';
81
+ throw error;
82
+ }
83
+ finally {
84
+ phase = 'stopping';
85
+ // A stopped receipt is a drainage acknowledgement, never a PID-liveness guess.
86
+ await server?.close();
87
+ if (cleanupConfirmed)
88
+ finishRunner(resident, owner, outcome);
89
+ }
90
+ }
91
+ //# sourceMappingURL=owned-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"owned-runner.js","sourceRoot":"","sources":["../../../src/integrations/resident/owned-runner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAEN,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,UAAU,GACV,MAAM,mBAAmB,CAAA;AAe1B,0FAA0F;AAC1F,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAA6B;IACnE,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAA;IAC5B,IAAI,KAAK,GAAG,OAAO,CAAC,KAAK,CAAA;IACzB,IAAI,KAAK,GAAiD,UAAU,CAAA;IACpE,IAAI,YAAY,GAAG,CAAC,CAAA;IACpB,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAA;IACxC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAA;IACnE,MAAM,KAAK,GAAG,GAAG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EAAE,cAAc,EAAE,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7E,CAAC,CAAA;QACF,OAAO,GAAG,MAAM,CAAC,MAAM,CAAA;QACvB,OAAO,MAAM,CAAA;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,KAAK,YAAY,+BAA+B;YAAE,gBAAgB,GAAG,KAAK,CAAA;QAC9E,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAA;QACjD,MAAM,KAAK,CAAA;IACZ,CAAC;YAAS,CAAC;QACV,KAAK,GAAG,UAAU,CAAA;QAClB,+EAA+E;QAC/E,MAAM,MAAM,EAAE,KAAK,EAAE,CAAA;QACrB,IAAI,gBAAgB;YAAE,YAAY,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAA;IAC7D,CAAC;AACF,CAAC"}
@@ -0,0 +1,47 @@
1
+ declare const PHASES: readonly ["starting", "idle", "working", "stopping"];
2
+ export type RunnerControlPhase = (typeof PHASES)[number];
3
+ export type RunnerControlAction = 'status' | 'stop';
4
+ export interface RunnerControlStatus {
5
+ readonly pid: number;
6
+ readonly phase: RunnerControlPhase;
7
+ /** Callback entries admitted by this runner, independent of final settlement. */
8
+ readonly stepsStarted: number;
9
+ }
10
+ export interface RunnerControlServerOptions {
11
+ readonly instanceId: string;
12
+ readonly token: string;
13
+ readonly getStatus: () => RunnerControlStatus;
14
+ /** Signal owned work once. A response acknowledges this request, not drainage. */
15
+ readonly onStop: () => void;
16
+ }
17
+ export interface RunnerControlServer {
18
+ readonly port: number;
19
+ /** Refuse new clients and destroy remaining sockets before resolving. */
20
+ close(): Promise<void>;
21
+ }
22
+ export interface RunnerControlRecord {
23
+ readonly instanceId: string;
24
+ readonly token: string;
25
+ readonly port: number | null;
26
+ readonly pid: number | null;
27
+ }
28
+ export type RunnerControlResult = ({
29
+ readonly kind: 'responsive';
30
+ readonly instanceId: string;
31
+ readonly stopRequested: boolean;
32
+ } & RunnerControlStatus) | {
33
+ readonly kind: 'unresponsive';
34
+ /** No observation here establishes that the process is dead. */
35
+ readonly reason: string;
36
+ };
37
+ /**
38
+ * One private, local control endpoint. Authentication is bound to an immutable
39
+ * runner instance, never to a PID alone. No request runs tools or shell commands.
40
+ */
41
+ export declare function createRunnerControlServer(options: RunnerControlServerOptions): Promise<RunnerControlServer>;
42
+ /** An authenticated response proves responsiveness; absence never proves death. */
43
+ export declare function queryRunner(record: RunnerControlRecord, action: RunnerControlAction, options?: {
44
+ readonly timeoutMs?: number;
45
+ }): Promise<RunnerControlResult>;
46
+ export {};
47
+ //# sourceMappingURL=runner-control.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-control.d.ts","sourceRoot":"","sources":["../../../src/integrations/resident/runner-control.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,MAAM,sDAAuD,CAAA;AAEnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,CAAA;AACxD,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,MAAM,CAAA;AAEnD,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,KAAK,EAAE,kBAAkB,CAAA;IAClC,iFAAiF;IACjF,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC7B;AAED,MAAM,WAAW,0BAA0B;IAC1C,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,SAAS,EAAE,MAAM,mBAAmB,CAAA;IAC7C,kFAAkF;IAClF,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAC3B;AAED,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,yEAAyE;IACzE,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CACtB;AAED,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED,MAAM,MAAM,mBAAmB,GAC5B,CAAC;IACD,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAA;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;CAC9B,GAAG,mBAAmB,CAAC,GACxB;IACA,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CACtB,CAAA;AA8BJ;;;GAGG;AACH,wBAAsB,yBAAyB,CAC9C,OAAO,EAAE,0BAA0B,GACjC,OAAO,CAAC,mBAAmB,CAAC,CAwH9B;AAED,mFAAmF;AACnF,wBAAgB,WAAW,CAC1B,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,mBAAmB,EAC3B,OAAO,GAAE;IAAE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3C,OAAO,CAAC,mBAAmB,CAAC,CAgF9B"}
@@ -0,0 +1,238 @@
1
+ import { timingSafeEqual } from 'node:crypto';
2
+ import { createConnection, createServer } from 'node:net';
3
+ const MAX_MESSAGE_BYTES = 4_096;
4
+ const MAX_OPEN_SOCKETS = 16;
5
+ const DEFAULT_TIMEOUT_MS = 1_500;
6
+ const PHASES = ['starting', 'idle', 'working', 'stopping'];
7
+ function object(value) {
8
+ return value !== null && typeof value === 'object' && !Array.isArray(value);
9
+ }
10
+ function exactKeys(value, keys) {
11
+ const actual = Object.keys(value);
12
+ return actual.length === keys.length && actual.every((key) => keys.includes(key));
13
+ }
14
+ function validIdentity(instanceId, token) {
15
+ return (instanceId.length > 0 && instanceId.length <= 256 && token.length > 0 && token.length <= 512);
16
+ }
17
+ function validStatus(value) {
18
+ return (typeof value.pid === 'number' &&
19
+ Number.isSafeInteger(value.pid) &&
20
+ value.pid > 0 &&
21
+ typeof value.phase === 'string' &&
22
+ PHASES.includes(value.phase) &&
23
+ typeof value.stepsStarted === 'number' &&
24
+ Number.isSafeInteger(value.stepsStarted) &&
25
+ value.stepsStarted >= 0);
26
+ }
27
+ /**
28
+ * One private, local control endpoint. Authentication is bound to an immutable
29
+ * runner instance, never to a PID alone. No request runs tools or shell commands.
30
+ */
31
+ export async function createRunnerControlServer(options) {
32
+ if (!validIdentity(options.instanceId, options.token))
33
+ throw new Error('Runner control requires a bounded instance identity and secret token.');
34
+ const expectedToken = Buffer.from(options.token);
35
+ const sockets = new Set();
36
+ let stopRequested = false;
37
+ let stopFailed = false;
38
+ let closing = false;
39
+ let closePromise;
40
+ const requestStop = () => {
41
+ if (stopRequested)
42
+ return;
43
+ stopRequested = true;
44
+ try {
45
+ options.onStop();
46
+ }
47
+ catch (error) {
48
+ stopFailed = true;
49
+ throw error;
50
+ }
51
+ };
52
+ const server = createServer((socket) => {
53
+ socket.on('error', () => { });
54
+ if (closing || sockets.size >= MAX_OPEN_SOCKETS) {
55
+ socket.destroy();
56
+ return;
57
+ }
58
+ sockets.add(socket);
59
+ socket.once('close', () => sockets.delete(socket));
60
+ // A total deadline, rather than an inactivity timeout a slow sender can reset.
61
+ const deadline = setTimeout(() => socket.destroy(), DEFAULT_TIMEOUT_MS);
62
+ socket.once('close', () => clearTimeout(deadline));
63
+ let buffered = Buffer.alloc(0);
64
+ let handled = false;
65
+ socket.on('data', (chunk) => {
66
+ if (handled || buffered.length + chunk.length > MAX_MESSAGE_BYTES) {
67
+ socket.destroy();
68
+ return;
69
+ }
70
+ buffered = Buffer.concat([buffered, chunk]);
71
+ const newline = buffered.indexOf(10);
72
+ if (newline < 0)
73
+ return;
74
+ handled = true;
75
+ if (newline !== buffered.length - 1) {
76
+ socket.destroy();
77
+ return;
78
+ }
79
+ try {
80
+ const request = JSON.parse(buffered.subarray(0, newline).toString('utf8'));
81
+ if (!object(request) ||
82
+ !exactKeys(request, ['version', 'instanceId', 'token', 'action']) ||
83
+ request.version !== 1 ||
84
+ request.instanceId !== options.instanceId ||
85
+ typeof request.token !== 'string' ||
86
+ (request.action !== 'status' && request.action !== 'stop')) {
87
+ socket.destroy();
88
+ return;
89
+ }
90
+ const token = Buffer.from(request.token);
91
+ if (token.length !== expectedToken.length || !timingSafeEqual(token, expectedToken)) {
92
+ socket.destroy();
93
+ return;
94
+ }
95
+ if (request.action === 'stop')
96
+ requestStop();
97
+ if (stopFailed)
98
+ throw new Error('Runner stop callback failed.');
99
+ const state = options.getStatus();
100
+ if (!object(state) || !validStatus(state))
101
+ throw new Error('Invalid runner state.');
102
+ socket.end(`${JSON.stringify({
103
+ version: 1,
104
+ instanceId: options.instanceId,
105
+ pid: state.pid,
106
+ phase: stopRequested ? 'stopping' : state.phase,
107
+ stepsStarted: state.stepsStarted,
108
+ stopRequested,
109
+ })}\n`);
110
+ }
111
+ catch {
112
+ // Request bytes and the secret never enter logs or error responses.
113
+ socket.destroy();
114
+ }
115
+ });
116
+ });
117
+ const close = () => {
118
+ if (closePromise)
119
+ return closePromise;
120
+ closing = true;
121
+ closePromise = new Promise((resolve, reject) => {
122
+ server.close((error) => {
123
+ if (error && error.code !== 'ERR_SERVER_NOT_RUNNING')
124
+ reject(error);
125
+ else
126
+ resolve();
127
+ });
128
+ for (const socket of sockets)
129
+ socket.destroy();
130
+ });
131
+ return closePromise;
132
+ };
133
+ await new Promise((resolve, reject) => {
134
+ const failed = (error) => reject(error);
135
+ server.once('error', failed);
136
+ server.listen({ host: '127.0.0.1', port: 0, exclusive: true }, () => {
137
+ server.removeListener('error', failed);
138
+ resolve();
139
+ });
140
+ });
141
+ // Losing the installed control endpoint stops admission through the same
142
+ // callback; it does not leave an uncontrolled runner claiming to be healthy.
143
+ server.on('error', () => {
144
+ try {
145
+ requestStop();
146
+ }
147
+ catch {
148
+ /* The owner is already being stopped. */
149
+ }
150
+ void close().catch(() => { });
151
+ });
152
+ const address = server.address();
153
+ if (address === null || typeof address === 'string') {
154
+ await close();
155
+ throw new Error('Runner control did not acquire a loopback port.');
156
+ }
157
+ return { port: address.port, close };
158
+ }
159
+ /** An authenticated response proves responsiveness; absence never proves death. */
160
+ export function queryRunner(record, action, options = {}) {
161
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
162
+ if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 60_000)
163
+ throw new Error('Runner control timeout must be a whole number from 1 to 60000 milliseconds.');
164
+ if (!validIdentity(record.instanceId, record.token) ||
165
+ !Number.isSafeInteger(record.port) ||
166
+ (record.port ?? 0) < 1 ||
167
+ (record.port ?? 0) > 65_535 ||
168
+ !Number.isSafeInteger(record.pid) ||
169
+ (record.pid ?? 0) < 1 ||
170
+ (action !== 'status' && action !== 'stop'))
171
+ return Promise.resolve({
172
+ kind: 'unresponsive',
173
+ reason: 'Runner control endpoint is unavailable.',
174
+ });
175
+ return new Promise((resolve) => {
176
+ const socket = createConnection({ host: '127.0.0.1', port: record.port });
177
+ let settled = false;
178
+ let buffered = Buffer.alloc(0);
179
+ const finish = (result) => {
180
+ if (settled)
181
+ return;
182
+ settled = true;
183
+ clearTimeout(deadline);
184
+ socket.destroy();
185
+ resolve(result);
186
+ };
187
+ const unresponsive = (reason) => finish({ kind: 'unresponsive', reason });
188
+ const deadline = setTimeout(() => unresponsive('Runner control response timed out.'), timeoutMs);
189
+ socket.once('error', () => unresponsive('Runner control connection failed.'));
190
+ socket.once('close', () => unresponsive('Runner control closed without a valid response.'));
191
+ socket.once('connect', () => {
192
+ socket.write(`${JSON.stringify({ version: 1, instanceId: record.instanceId, token: record.token, action })}\n`);
193
+ });
194
+ socket.on('data', (chunk) => {
195
+ if (buffered.length + chunk.length > MAX_MESSAGE_BYTES) {
196
+ unresponsive('Runner control response exceeded its size limit.');
197
+ return;
198
+ }
199
+ buffered = Buffer.concat([buffered, chunk]);
200
+ const newline = buffered.indexOf(10);
201
+ if (newline < 0)
202
+ return;
203
+ try {
204
+ const response = JSON.parse(buffered.subarray(0, newline).toString('utf8'));
205
+ if (newline !== buffered.length - 1 ||
206
+ !object(response) ||
207
+ !exactKeys(response, [
208
+ 'version',
209
+ 'instanceId',
210
+ 'pid',
211
+ 'phase',
212
+ 'stepsStarted',
213
+ 'stopRequested',
214
+ ]) ||
215
+ response.version !== 1 ||
216
+ response.instanceId !== record.instanceId ||
217
+ response.pid !== record.pid ||
218
+ !validStatus(response) ||
219
+ typeof response.stopRequested !== 'boolean' ||
220
+ (response.stopRequested && response.phase !== 'stopping') ||
221
+ (action === 'stop' && !response.stopRequested))
222
+ throw new Error('Invalid response.');
223
+ finish({
224
+ kind: 'responsive',
225
+ instanceId: record.instanceId,
226
+ pid: response.pid,
227
+ phase: response.phase,
228
+ stepsStarted: response.stepsStarted,
229
+ stopRequested: response.stopRequested,
230
+ });
231
+ }
232
+ catch {
233
+ unresponsive('Runner control returned an invalid response.');
234
+ }
235
+ });
236
+ });
237
+ }
238
+ //# sourceMappingURL=runner-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-control.js","sourceRoot":"","sources":["../../../src/integrations/resident/runner-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAe,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AAEtE,MAAM,iBAAiB,GAAG,KAAK,CAAA;AAC/B,MAAM,gBAAgB,GAAG,EAAE,CAAA;AAC3B,MAAM,kBAAkB,GAAG,KAAK,CAAA;AAChC,MAAM,MAAM,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,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B;oBAC7C,aAAa,EAAE,QAAQ,CAAC,aAAa;iBACrC,CAAC,CAAA;YACH,CAAC;YAAC,MAAM,CAAC;gBACR,YAAY,CAAC,8CAA8C,CAAC,CAAA;YAC7D,CAAC;QACF,CAAC,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;AACH,CAAC"}
@@ -0,0 +1,47 @@
1
+ import type { RunFlags } from '../../commands/run-flags.js';
2
+ import type { CommandContext } from '../../commands/types.js';
3
+ import { type RunnerRecord } from './runner-store.js';
4
+ import type { CliResident } from './storage.js';
5
+ export interface ResidentWorkerLaunch {
6
+ readonly version: 1;
7
+ readonly cwd: string;
8
+ readonly agentKey: string;
9
+ readonly instanceId: string;
10
+ readonly config: CommandContext['config'];
11
+ readonly flags: RunFlags;
12
+ readonly toolLoading?: 'eager' | 'deferred';
13
+ readonly contextProfile?: 'resident' | 'interactive';
14
+ readonly maxIdleMs: number;
15
+ }
16
+ /** Launch the same installation with no terminal streams or on-disk credentials/config. */
17
+ export declare function startResidentRunner(options: {
18
+ readonly resident: CliResident;
19
+ readonly ctx: CommandContext;
20
+ readonly flags: RunFlags;
21
+ readonly toolLoading?: 'eager' | 'deferred';
22
+ readonly contextProfile?: 'resident' | 'interactive';
23
+ readonly maxSteps: number;
24
+ readonly maxIdleMs: number;
25
+ }): Promise<Omit<RunnerRecord, "token">>;
26
+ export declare function residentRunnerStatus(resident: CliResident): Promise<{
27
+ owner: null;
28
+ live: null;
29
+ } | {
30
+ owner: Omit<RunnerRecord, "token">;
31
+ live: import("./runner-control.js").RunnerControlResult | null;
32
+ }>;
33
+ /** Caller durably closes admission first. No signals are sent to recorded PIDs. */
34
+ export declare function stopResidentRunner(resident: CliResident, options: {
35
+ readonly owner: RunnerRecord | null;
36
+ readonly waitMs?: number;
37
+ }): Promise<{
38
+ status: "absent";
39
+ owner: null;
40
+ } | {
41
+ status: "drained";
42
+ owner: Omit<RunnerRecord, "token">;
43
+ } | {
44
+ status: "unconfirmed";
45
+ owner: Omit<RunnerRecord, "token"> | null;
46
+ }>;
47
+ //# sourceMappingURL=runner-launch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runner-launch.d.ts","sourceRoot":"","sources":["../../../src/integrations/resident/runner-launch.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAE7D,OAAO,EACN,KAAK,YAAY,EAMjB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,MAAM,WAAW,oBAAoB;IACpC,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAA;IACnB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;IACzB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IACzC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,UAAU,CAAA;IAC3C,QAAQ,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,aAAa,CAAA;IACpD,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC1B;AAED,2FAA2F;AAC3F,wBAAsB,mBAAmB,CAAC,OAAO,EAAE;IAClD,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAA;IAC9B,QAAQ,CAAC,GAAG,EAAE,cAAc,CAAA;IAC5B,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAA;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,GAAG,UAAU,CAAA;IAC3C,QAAQ,CAAC,cAAc,CAAC,EAAE,UAAU,GAAG,aAAa,CAAA;IACpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAA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