@a5c-ai/agent-launch-mux 5.0.1-staging.6ab464ce4307

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.
package/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # @a5c-ai/agent-launch-mux
2
+
3
+ Agent launch mux — spawn/lifecycle orchestration, PTY bridge, signal handling, and completion engine for the agent-mux ecosystem.
4
+
5
+ Extracted from `@a5c-ai/agent-mux-cli` as part of the agent-mux decomposition (#211).
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Bridge hook emulation for non-interactive mode.
3
+ *
4
+ * When --bridge-hooks is set, emulates lifecycle hooks (session-start, stop
5
+ * with block-continue, session-end) that the underlying CLI harness may not
6
+ * support natively. The emulator shells out to the babysitter CLI to trigger
7
+ * hook handling and run-status queries.
8
+ */
9
+ export interface BridgeHookContext {
10
+ harness: string;
11
+ cwd: string;
12
+ env: Record<string, string>;
13
+ sessionId?: string;
14
+ runsDir?: string;
15
+ verbose?: boolean;
16
+ }
17
+ export interface SessionStartResult {
18
+ runId?: string;
19
+ emulated: boolean;
20
+ }
21
+ export interface StopResult {
22
+ shouldContinue: boolean;
23
+ resumeId?: string;
24
+ emulated: boolean;
25
+ }
26
+ export declare class BridgeHookEmulator {
27
+ private readonly ctx;
28
+ private readonly bin;
29
+ private runId;
30
+ constructor(ctx: BridgeHookContext);
31
+ /**
32
+ * Emulate the session-start lifecycle hook.
33
+ *
34
+ * If the harness supports session-start natively, this is a no-op.
35
+ * If emulated, it invokes `babysitter hook:run --hook-type session-start`
36
+ * which creates a bare run and initializes session state.
37
+ */
38
+ emulateSessionStart(): Promise<SessionStartResult>;
39
+ /**
40
+ * Emulate the stop lifecycle hook.
41
+ *
42
+ * If the harness supports stop natively, this is a no-op.
43
+ * If emulated:
44
+ * 1. Queries `babysitter run:status <runDir> --json` to check run state
45
+ * 2. If run has pending effects or is not completed: shouldContinue=true
46
+ * 3. If run is completed: shouldContinue=false
47
+ * 4. Returns a resumeId for session resume if continuing
48
+ */
49
+ emulateStop(runId?: string): Promise<StopResult>;
50
+ /**
51
+ * Emulate the session-end lifecycle hook.
52
+ *
53
+ * If the harness supports session-end natively, this is a no-op.
54
+ * If emulated, invokes `babysitter hook:run --hook-type session-end`.
55
+ */
56
+ emulateSessionEnd(): Promise<void>;
57
+ /** Return the current run ID, if one was created during session-start. */
58
+ getRunId(): string | undefined;
59
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-hooks.d.ts","sourceRoot":"","sources":["../src/bridge-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAQH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAgED,qBAAa,kBAAkB;IAIjB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAHhC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAS;IAC7B,OAAO,CAAC,KAAK,CAAqB;gBAEL,GAAG,EAAE,iBAAiB;IAInD;;;;;;OAMG;IACG,mBAAmB,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAiDxD;;;;;;;;;OASG;IACG,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;IAwEtD;;;;;OAKG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAuCxC,0EAA0E;IAC1E,QAAQ,IAAI,MAAM,GAAG,SAAS;CAG/B"}
@@ -0,0 +1,222 @@
1
+ /**
2
+ * Bridge hook emulation for non-interactive mode.
3
+ *
4
+ * When --bridge-hooks is set, emulates lifecycle hooks (session-start, stop
5
+ * with block-continue, session-end) that the underlying CLI harness may not
6
+ * support natively. The emulator shells out to the babysitter CLI to trigger
7
+ * hook handling and run-status queries.
8
+ */
9
+ import { getHookSupport } from '@a5c-ai/agent-catalog';
10
+ // ---------------------------------------------------------------------------
11
+ // Internal helpers
12
+ // ---------------------------------------------------------------------------
13
+ /** Resolve the babysitter CLI binary path from env or default. */
14
+ function resolveBabysitterBin(env) {
15
+ return env['BABYSITTER_BIN'] || 'babysitter';
16
+ }
17
+ /** Run a babysitter CLI command and return stdout. Throws on non-zero exit. */
18
+ async function execBabysitterCommand(bin, args, options) {
19
+ const { execFileSync } = await import('node:child_process');
20
+ const mergedEnv = { ...process.env, ...options.env };
21
+ if (options.verbose) {
22
+ console.error(`[bridge-hooks] exec: ${bin} ${args.join(' ')}`);
23
+ }
24
+ const result = execFileSync(bin, args, {
25
+ cwd: options.cwd,
26
+ env: mergedEnv,
27
+ encoding: 'utf-8',
28
+ timeout: 30_000,
29
+ stdio: ['pipe', 'pipe', 'pipe'],
30
+ });
31
+ return result;
32
+ }
33
+ /**
34
+ * Query the agent-catalog for hook support in non-interactive mode.
35
+ * Returns the support level for a given hook, or undefined if the catalog
36
+ * is not available.
37
+ */
38
+ async function getHookSupportLevel(harness, hookName) {
39
+ const support = getHookSupport(harness, 'nonInteractive');
40
+ return support?.[hookName];
41
+ }
42
+ /**
43
+ * Parse JSON output from a babysitter CLI command, returning null on failure.
44
+ */
45
+ function parseJsonOutput(output) {
46
+ try {
47
+ return JSON.parse(output.trim());
48
+ }
49
+ catch {
50
+ return null;
51
+ }
52
+ }
53
+ // ---------------------------------------------------------------------------
54
+ // BridgeHookEmulator
55
+ // ---------------------------------------------------------------------------
56
+ export class BridgeHookEmulator {
57
+ ctx;
58
+ bin;
59
+ runId;
60
+ constructor(ctx) {
61
+ this.ctx = ctx;
62
+ this.bin = resolveBabysitterBin(ctx.env);
63
+ }
64
+ /**
65
+ * Emulate the session-start lifecycle hook.
66
+ *
67
+ * If the harness supports session-start natively, this is a no-op.
68
+ * If emulated, it invokes `babysitter hook:run --hook-type session-start`
69
+ * which creates a bare run and initializes session state.
70
+ */
71
+ async emulateSessionStart() {
72
+ const level = await getHookSupportLevel(this.ctx.harness, 'sessionStart');
73
+ if (level === 'native') {
74
+ return { emulated: false };
75
+ }
76
+ if (level === 'unsupported' || level === 'emulated' || level === undefined) {
77
+ try {
78
+ const args = [
79
+ 'hook:run',
80
+ '--hook-type', 'session-start',
81
+ '--harness', this.ctx.harness,
82
+ '--json',
83
+ ];
84
+ if (this.ctx.runsDir) {
85
+ args.push('--runs-dir', this.ctx.runsDir);
86
+ }
87
+ const output = await execBabysitterCommand(this.bin, args, {
88
+ cwd: this.ctx.cwd,
89
+ env: this.ctx.env,
90
+ verbose: this.ctx.verbose,
91
+ });
92
+ const result = parseJsonOutput(output);
93
+ if (result?.runId) {
94
+ this.runId = result.runId;
95
+ }
96
+ if (this.ctx.verbose) {
97
+ console.error(`[bridge-hooks] session-start emulated, runId=${this.runId ?? 'none'}`);
98
+ }
99
+ return { runId: this.runId, emulated: true };
100
+ }
101
+ catch (err) {
102
+ if (this.ctx.verbose) {
103
+ const msg = err instanceof Error ? err.message : String(err);
104
+ console.error(`[bridge-hooks] session-start emulation failed: ${msg}`);
105
+ }
106
+ // Non-fatal: continue without a run ID
107
+ return { emulated: true };
108
+ }
109
+ }
110
+ return { emulated: false };
111
+ }
112
+ /**
113
+ * Emulate the stop lifecycle hook.
114
+ *
115
+ * If the harness supports stop natively, this is a no-op.
116
+ * If emulated:
117
+ * 1. Queries `babysitter run:status <runDir> --json` to check run state
118
+ * 2. If run has pending effects or is not completed: shouldContinue=true
119
+ * 3. If run is completed: shouldContinue=false
120
+ * 4. Returns a resumeId for session resume if continuing
121
+ */
122
+ async emulateStop(runId) {
123
+ const effectiveRunId = runId ?? this.runId;
124
+ const level = await getHookSupportLevel(this.ctx.harness, 'stop');
125
+ if (level === 'native') {
126
+ return { shouldContinue: false, emulated: false };
127
+ }
128
+ if (!effectiveRunId) {
129
+ if (this.ctx.verbose) {
130
+ console.error('[bridge-hooks] stop: no runId available, cannot check run state');
131
+ }
132
+ return { shouldContinue: false, emulated: true };
133
+ }
134
+ if (level === 'unsupported' || level === 'emulated' || level === undefined) {
135
+ try {
136
+ const runDir = this.ctx.runsDir
137
+ ? `${this.ctx.runsDir}/${effectiveRunId}`
138
+ : effectiveRunId;
139
+ const args = ['run:status', runDir, '--json'];
140
+ const output = await execBabysitterCommand(this.bin, args, {
141
+ cwd: this.ctx.cwd,
142
+ env: this.ctx.env,
143
+ verbose: this.ctx.verbose,
144
+ });
145
+ const status = parseJsonOutput(output);
146
+ if (!status) {
147
+ if (this.ctx.verbose) {
148
+ console.error('[bridge-hooks] stop: failed to parse run:status output');
149
+ }
150
+ return { shouldContinue: false, emulated: true };
151
+ }
152
+ const isCompleted = status.state === 'completed';
153
+ const hasPending = (status.pendingEffectsSummary?.totalPending ?? 0) > 0;
154
+ const needsMore = status.needsMoreIterations === true;
155
+ const shouldContinue = !isCompleted && (hasPending || needsMore);
156
+ if (this.ctx.verbose) {
157
+ console.error(`[bridge-hooks] stop: state=${status.state}, pending=${hasPending}, ` +
158
+ `needsMore=${needsMore}, shouldContinue=${shouldContinue}`);
159
+ }
160
+ return {
161
+ shouldContinue,
162
+ resumeId: shouldContinue ? this.ctx.sessionId : undefined,
163
+ emulated: true,
164
+ };
165
+ }
166
+ catch (err) {
167
+ if (this.ctx.verbose) {
168
+ const msg = err instanceof Error ? err.message : String(err);
169
+ console.error(`[bridge-hooks] stop emulation failed: ${msg}`);
170
+ }
171
+ // On error, don't continue — safer default
172
+ return { shouldContinue: false, emulated: true };
173
+ }
174
+ }
175
+ return { shouldContinue: false, emulated: false };
176
+ }
177
+ /**
178
+ * Emulate the session-end lifecycle hook.
179
+ *
180
+ * If the harness supports session-end natively, this is a no-op.
181
+ * If emulated, invokes `babysitter hook:run --hook-type session-end`.
182
+ */
183
+ async emulateSessionEnd() {
184
+ const level = await getHookSupportLevel(this.ctx.harness, 'sessionEnd');
185
+ if (level === 'native') {
186
+ return;
187
+ }
188
+ if (level === 'unsupported' || level === 'emulated' || level === undefined) {
189
+ try {
190
+ const args = [
191
+ 'hook:run',
192
+ '--hook-type', 'session-end',
193
+ '--harness', this.ctx.harness,
194
+ '--json',
195
+ ];
196
+ if (this.ctx.runsDir) {
197
+ args.push('--runs-dir', this.ctx.runsDir);
198
+ }
199
+ await execBabysitterCommand(this.bin, args, {
200
+ cwd: this.ctx.cwd,
201
+ env: this.ctx.env,
202
+ verbose: this.ctx.verbose,
203
+ });
204
+ if (this.ctx.verbose) {
205
+ console.error('[bridge-hooks] session-end emulated');
206
+ }
207
+ }
208
+ catch (err) {
209
+ if (this.ctx.verbose) {
210
+ const msg = err instanceof Error ? err.message : String(err);
211
+ console.error(`[bridge-hooks] session-end emulation failed: ${msg}`);
212
+ }
213
+ // Non-fatal: swallow errors on session-end
214
+ }
215
+ }
216
+ }
217
+ /** Return the current run ID, if one was created during session-start. */
218
+ getRunId() {
219
+ return this.runId;
220
+ }
221
+ }
222
+ //# sourceMappingURL=bridge-hooks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bridge-hooks.js","sourceRoot":"","sources":["../src/bridge-hooks.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AA0B9E,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,kEAAkE;AAClE,SAAS,oBAAoB,CAAC,GAA2B;IACvD,OAAO,GAAG,CAAC,gBAAgB,CAAC,IAAI,YAAY,CAAC;AAC/C,CAAC;AAED,+EAA+E;AAC/E,KAAK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;iBACT,CAAC;gBAEF,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;oBACrB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBAC5C,CAAC;gBAED,MAAM,qBAAqB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,EAAE;oBAC1C,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG;oBACjB,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG;oBACjB,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO;iBAC1B,CAAC,CAAC;gBAEH,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;oBACrB,OAAO,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;oBACrB,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBAC7D,OAAO,CAAC,KAAK,CAAC,gDAAgD,GAAG,EAAE,CAAC,CAAC;gBACvE,CAAC;gBACD,2CAA2C;YAC7C,CAAC;QACH,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,QAAQ;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Lightweight CLI helper utilities extracted from agent-mux-cli.
3
+ *
4
+ * These are self-contained copies of the flag-parsing helpers, exit codes,
5
+ * and output helpers that the launch module needs, avoiding a circular
6
+ * dependency back to the CLI package.
7
+ */
8
+ export type { ParsedArgs, FlagDef } from './types.js';
9
+ /** CLI exit code constants. */
10
+ export declare const ExitCode: {
11
+ readonly SUCCESS: 0;
12
+ readonly GENERAL_ERROR: 1;
13
+ readonly USAGE_ERROR: 2;
14
+ readonly AGENT_NOT_FOUND: 3;
15
+ readonly AGENT_NOT_INSTALLED: 4;
16
+ readonly AUTH_ERROR: 5;
17
+ readonly CAPABILITY_ERROR: 6;
18
+ readonly CONFIG_ERROR: 7;
19
+ readonly SESSION_NOT_FOUND: 8;
20
+ readonly PROFILE_NOT_FOUND: 9;
21
+ readonly PLUGIN_ERROR: 10;
22
+ readonly TIMEOUT: 11;
23
+ readonly AGENT_CRASHED: 12;
24
+ readonly ABORTED: 13;
25
+ readonly RATE_LIMITED: 14;
26
+ readonly CONTEXT_EXCEEDED: 15;
27
+ };
28
+ export type ExitCodeValue = (typeof ExitCode)[keyof typeof ExitCode];
29
+ /**
30
+ * Get a flag value as a string, or undefined.
31
+ */
32
+ export declare function flagStr(flags: Record<string, string | boolean | string[]>, name: string): string | undefined;
33
+ /**
34
+ * Get a flag value as a number, or undefined.
35
+ */
36
+ export declare function flagNum(flags: Record<string, string | boolean | string[]>, name: string): number | undefined;
37
+ /**
38
+ * Get a flag value as a boolean.
39
+ */
40
+ export declare function flagBool(flags: Record<string, string | boolean | string[]>, name: string): boolean | undefined;
41
+ /**
42
+ * Get a flag value as a string array (for repeatable flags).
43
+ */
44
+ export declare function flagArr(flags: Record<string, string | boolean | string[]>, name: string): string[];
45
+ /**
46
+ * Print a JSON-wrapped error response to stdout.
47
+ */
48
+ export declare function printJsonError(code: string, message: string, recoverable?: boolean): void;
49
+ /**
50
+ * Print an error message to stderr.
51
+ */
52
+ export declare function printError(message: string): void;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-helpers.d.ts","sourceRoot":"","sources":["../src/cli-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAMtD,+BAA+B;AAC/B,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;CAiBX,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,QAAQ,CAAC,CAAC,MAAM,OAAO,QAAQ,CAAC,CAAC;AAMrE;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAK5G;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAM5G;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAM9G;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKlG;AAMD;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,GAAE,OAAe,GAAG,IAAI,CAEhG;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEhD"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Lightweight CLI helper utilities extracted from agent-mux-cli.
3
+ *
4
+ * These are self-contained copies of the flag-parsing helpers, exit codes,
5
+ * and output helpers that the launch module needs, avoiding a circular
6
+ * dependency back to the CLI package.
7
+ */
8
+ // ---------------------------------------------------------------------------
9
+ // Exit codes
10
+ // ---------------------------------------------------------------------------
11
+ /** CLI exit code constants. */
12
+ export const ExitCode = {
13
+ SUCCESS: 0,
14
+ GENERAL_ERROR: 1,
15
+ USAGE_ERROR: 2,
16
+ AGENT_NOT_FOUND: 3,
17
+ AGENT_NOT_INSTALLED: 4,
18
+ AUTH_ERROR: 5,
19
+ CAPABILITY_ERROR: 6,
20
+ CONFIG_ERROR: 7,
21
+ SESSION_NOT_FOUND: 8,
22
+ PROFILE_NOT_FOUND: 9,
23
+ PLUGIN_ERROR: 10,
24
+ TIMEOUT: 11,
25
+ AGENT_CRASHED: 12,
26
+ ABORTED: 13,
27
+ RATE_LIMITED: 14,
28
+ CONTEXT_EXCEEDED: 15,
29
+ };
30
+ // ---------------------------------------------------------------------------
31
+ // Flag helpers
32
+ // ---------------------------------------------------------------------------
33
+ /**
34
+ * Get a flag value as a string, or undefined.
35
+ */
36
+ export function flagStr(flags, name) {
37
+ const val = flags[name];
38
+ if (typeof val === 'string')
39
+ return val;
40
+ if (Array.isArray(val) && val.length > 0)
41
+ return val[val.length - 1];
42
+ return undefined;
43
+ }
44
+ /**
45
+ * Get a flag value as a number, or undefined.
46
+ */
47
+ export function flagNum(flags, name) {
48
+ const s = flagStr(flags, name);
49
+ if (s === undefined)
50
+ return undefined;
51
+ const n = Number(s);
52
+ if (Number.isNaN(n))
53
+ return undefined;
54
+ return n;
55
+ }
56
+ /**
57
+ * Get a flag value as a boolean.
58
+ */
59
+ export function flagBool(flags, name) {
60
+ const val = flags[name];
61
+ if (typeof val === 'boolean')
62
+ return val;
63
+ if (val === 'true')
64
+ return true;
65
+ if (val === 'false')
66
+ return false;
67
+ return undefined;
68
+ }
69
+ /**
70
+ * Get a flag value as a string array (for repeatable flags).
71
+ */
72
+ export function flagArr(flags, name) {
73
+ const val = flags[name];
74
+ if (Array.isArray(val))
75
+ return val;
76
+ if (typeof val === 'string')
77
+ return [val];
78
+ return [];
79
+ }
80
+ // ---------------------------------------------------------------------------
81
+ // Output helpers
82
+ // ---------------------------------------------------------------------------
83
+ /**
84
+ * Print a JSON-wrapped error response to stdout.
85
+ */
86
+ export function printJsonError(code, message, recoverable = false) {
87
+ process.stdout.write(JSON.stringify({ ok: false, error: { code, message, recoverable } }, null, 2) + '\n');
88
+ }
89
+ /**
90
+ * Print an error message to stderr.
91
+ */
92
+ export function printError(message) {
93
+ process.stderr.write('Error: ' + message + '\n');
94
+ }
95
+ //# sourceMappingURL=cli-helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-helpers.js","sourceRoot":"","sources":["../src/cli-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E,+BAA+B;AAC/B,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,CAAC;IACV,aAAa,EAAE,CAAC;IAChB,WAAW,EAAE,CAAC;IACd,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,CAAC;IACtB,UAAU,EAAE,CAAC;IACb,gBAAgB,EAAE,CAAC;IACnB,YAAY,EAAE,CAAC;IACf,iBAAiB,EAAE,CAAC;IACpB,iBAAiB,EAAE,CAAC;IACpB,YAAY,EAAE,EAAE;IAChB,OAAO,EAAE,EAAE;IACX,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,EAAE;IACX,YAAY,EAAE,EAAE;IAChB,gBAAgB,EAAE,EAAE;CACZ,CAAC;AAIX,8EAA8E;AAC9E,eAAe;AACf,8EAA8E;AAE9E;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,KAAkD,EAAE,IAAY;IACtF,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IACxB,IAAI,OAAO,GAAG,KAAK,QAAQ;QAAE,OAAO,GAAG,CAAC;IACxC,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrE,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;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E,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAC7G,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,GAAG,OAAO,GAAG,IAAI,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Backward-compatibility re-exports.
3
+ *
4
+ * The completion engine implementations now live in @a5c-ai/transport-mux.
5
+ * This module re-exports them so existing import paths continue to work.
6
+ */
7
+ export { createOpenAICompletionEngine, createGoogleCompletionEngine, createAnthropicCompletionEngine } from '@a5c-ai/transport-mux';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion-engine.d.ts","sourceRoot":"","sources":["../src/completion-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Backward-compatibility re-exports.
3
+ *
4
+ * The completion engine implementations now live in @a5c-ai/transport-mux.
5
+ * This module re-exports them so existing import paths continue to work.
6
+ */
7
+ export { createOpenAICompletionEngine, createGoogleCompletionEngine, createAnthropicCompletionEngine } from '@a5c-ai/transport-mux';
8
+ //# sourceMappingURL=completion-engine.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"completion-engine.js","sourceRoot":"","sources":["../src/completion-engine.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,+BAA+B,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @a5c-ai/agent-launch-mux
3
+ *
4
+ * Launch orchestration for agent-mux: plan resolution, proxy setup,
5
+ * harness spawning, bridge hooks, and completion engines.
6
+ */
7
+ export { launchCommand, resolveLaunchPlan, LAUNCH_FLAGS, } from './launch.js';
8
+ export type { LaunchPlanInput, ProxyPlan, LaunchPlan, } from './launch.js';
9
+ export { BridgeHookEmulator, } from './bridge-hooks.js';
10
+ export type { BridgeHookContext, SessionStartResult, StopResult, } from './bridge-hooks.js';
11
+ export { createOpenAICompletionEngine, createGoogleCompletionEngine, } from './completion-engine.js';
12
+ export { ExitCode, flagStr, flagNum, flagBool, flagArr, printError, printJsonError, } from './cli-helpers.js';
13
+ export type { ExitCodeValue, } from './cli-helpers.js';
14
+ export type { FlagDef, ParsedArgs, SessionArgs, } from './types.js';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,eAAe,EACf,SAAS,EACT,UAAU,GACX,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,iBAAiB,EACjB,kBAAkB,EAClB,UAAU,GACX,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC;AAE1B,YAAY,EACV,aAAa,GACd,MAAM,kBAAkB,CAAC;AAG1B,YAAY,EACV,OAAO,EACP,UAAU,EACV,WAAW,GACZ,MAAM,YAAY,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @a5c-ai/agent-launch-mux
3
+ *
4
+ * Launch orchestration for agent-mux: plan resolution, proxy setup,
5
+ * harness spawning, bridge hooks, and completion engines.
6
+ */
7
+ // Core launch command and plan resolution
8
+ export { launchCommand, resolveLaunchPlan, LAUNCH_FLAGS, } from './launch.js';
9
+ // Bridge hook emulation
10
+ export { BridgeHookEmulator, } from './bridge-hooks.js';
11
+ // Completion engine re-exports
12
+ export { createOpenAICompletionEngine, createGoogleCompletionEngine, } from './completion-engine.js';
13
+ // CLI helpers (exit codes, flag utilities)
14
+ export { ExitCode, flagStr, flagNum, flagBool, flagArr, printError, printJsonError, } from './cli-helpers.js';
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,0CAA0C;AAC1C,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,YAAY,GACb,MAAM,aAAa,CAAC;AASrB,wBAAwB;AACxB,OAAO,EACL,kBAAkB,GACnB,MAAM,mBAAmB,CAAC;AAQ3B,+BAA+B;AAC/B,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,wBAAwB,CAAC;AAEhC,2CAA2C;AAC3C,OAAO,EACL,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,OAAO,EACP,UAAU,EACV,cAAc,GACf,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * `amux launch` command implementation.
3
+ *
4
+ * Resolves a launch plan for a given harness+provider combination,
5
+ * optionally starts the transport-mux runtime, then exec-forks the harness with
6
+ * stdin/stdout passthrough and proper signal forwarding.
7
+ */
8
+ import type { AgentMuxClient } from '@a5c-ai/agent-comm-mux';
9
+ import type { TransportId } from '@a5c-ai/agent-comm-mux';
10
+ import type { ParsedArgs, FlagDef } from './cli-helpers.js';
11
+ /** Launch-specific flag definitions (global flags like model/json/debug are excluded). */
12
+ export declare const LAUNCH_FLAGS: Record<string, FlagDef>;
13
+ export interface LaunchPlanInput {
14
+ harness: string;
15
+ provider?: string;
16
+ model?: string;
17
+ transport?: string;
18
+ apiKey?: string;
19
+ apiBase?: string;
20
+ region?: string;
21
+ project?: string;
22
+ resourceGroup?: string;
23
+ endpointName?: string;
24
+ authCommand?: string;
25
+ profile?: string;
26
+ proxyMode: 'always' | 'if-needed' | 'never';
27
+ proxyPort?: number;
28
+ adapter?: {
29
+ translateProvider?(config: Record<string, unknown>): any;
30
+ };
31
+ providerArgs?: Record<string, unknown>;
32
+ }
33
+ export interface ProxyPlan {
34
+ targetProvider: string;
35
+ targetModel: string;
36
+ exposedTransport: TransportId;
37
+ port: number;
38
+ apiBase?: string;
39
+ apiKey?: string;
40
+ project?: string;
41
+ location?: string;
42
+ useVertexAi?: boolean;
43
+ }
44
+ export interface LaunchPlan {
45
+ harness: string;
46
+ provider: string;
47
+ transport: string;
48
+ model: string;
49
+ proxyNeeded: boolean;
50
+ proxyReason: string;
51
+ proxy?: ProxyPlan;
52
+ command: string;
53
+ args: string[];
54
+ env: Record<string, string>;
55
+ }
56
+ export declare function resolveLaunchPlan(input: LaunchPlanInput): LaunchPlan;
57
+ export declare function launchCommand(client: AgentMuxClient, args: ParsedArgs): Promise<number>;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"launch.d.ts","sourceRoot":"","sources":["../src/launch.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAM7D,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAUtE,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAM5D,0FAA0F;AAC1F,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAgChD,CAAC;AAMF,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB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