acpx 0.18.0 → 0.19.1

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 (41) hide show
  1. package/dist/{agent-registry-DdKB-zia.js → agent-registry-DWlx5BQ4.js} +5 -3
  2. package/dist/agent-registry-DWlx5BQ4.js.map +1 -0
  3. package/dist/agent-registry.js +1 -1
  4. package/dist/{cli-8mVHeUXh.js → cli-BerngYEz.js} +5 -5
  5. package/dist/{cli-8mVHeUXh.js.map → cli-BerngYEz.js.map} +1 -1
  6. package/dist/cli.js +77 -53
  7. package/dist/cli.js.map +1 -1
  8. package/dist/{client-DeNKZZcu.d.ts → client-BchvQRpz.d.ts} +17 -4
  9. package/dist/client-BchvQRpz.d.ts.map +1 -0
  10. package/dist/{flows-WOQNzCMC.js → flows-DimX0it5.js} +693 -475
  11. package/dist/flows-DimX0it5.js.map +1 -0
  12. package/dist/flows.d.ts +20 -7
  13. package/dist/flows.d.ts.map +1 -1
  14. package/dist/flows.js +1 -1
  15. package/dist/{invocation-options-B6d7TI-y.js → invocation-options-vobVApfO.js} +32 -11
  16. package/dist/invocation-options-vobVApfO.js.map +1 -0
  17. package/dist/{ipc-BJrvfNXr.js → ipc-DAApJ5mi.js} +1041 -263
  18. package/dist/ipc-DAApJ5mi.js.map +1 -0
  19. package/dist/{output-CL18YmsG.js → output-Cnuji8Bo.js} +41 -20
  20. package/dist/output-Cnuji8Bo.js.map +1 -0
  21. package/dist/{queue-owner-runtime-Cr0dWJuL.js → queue-owner-runtime-C4OOosbo.js} +732 -507
  22. package/dist/queue-owner-runtime-C4OOosbo.js.map +1 -0
  23. package/dist/runtime.d.ts +19 -1
  24. package/dist/runtime.d.ts.map +1 -1
  25. package/dist/runtime.js +48 -29
  26. package/dist/runtime.js.map +1 -1
  27. package/dist/session-options-Dp6mzNSy.d.ts.map +1 -1
  28. package/dist/{session-watch-B8Q_TsGf.js → session-watch-Bj9LoYUq.js} +5 -5
  29. package/dist/session-watch-Bj9LoYUq.js.map +1 -0
  30. package/dist/{watch-Dp73ph8h.js → watch-Cz6jbrRs.js} +2 -2
  31. package/dist/{watch-Dp73ph8h.js.map → watch-Cz6jbrRs.js.map} +1 -1
  32. package/package.json +1 -1
  33. package/skills/acpx/SKILL.md +45 -23
  34. package/dist/agent-registry-DdKB-zia.js.map +0 -1
  35. package/dist/client-DeNKZZcu.d.ts.map +0 -1
  36. package/dist/flows-WOQNzCMC.js.map +0 -1
  37. package/dist/invocation-options-B6d7TI-y.js.map +0 -1
  38. package/dist/ipc-BJrvfNXr.js.map +0 -1
  39. package/dist/output-CL18YmsG.js.map +0 -1
  40. package/dist/queue-owner-runtime-Cr0dWJuL.js.map +0 -1
  41. package/dist/session-watch-B8Q_TsGf.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"session-options-Dp6mzNSy.d.ts","names":[],"sources":["../src/prompt-content.ts","../src/types.ts","../src/runtime/engine/session-options.ts"],"mappings":";;KAEY,cAAc;;;KCgBd;EACV;EACA,KAAK;EACL,cAAc;;KAGJ;EACN;;EACA;;EACA;;EACA;;EACA;;KAEM,wBACV,SAAS,sBACT;EAAW,QAAQ;MAChB,QAAQ;cAEA;KACD,6BAA6B;KAC7B,wBAAwB;KAExB;;EAEV,WAAW;;EAEX,QAAQ;;KAGL;EACH,QAAQ;;KAGE;EAEN;EACA,UAAU,eAAe;IACvB;EACD;IAAsB;EACtB;IAAqB;KAEhB,yBACV,SAAS,uBACT,SAAS,0BACN,QAAQ;cAiBA;KACD,yBAAyB;cAExB;KACD,qBAAqB;cAEpB;KACD,yCAAyC;cAExC;KACD,iCAAiC;KAEjC;EACV;EACA;EACA;EACA,gBAAgB;;KAGN;EACV;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;EACA;;KAQU,oBAAoB;KACpB;KAwCA;EACV;EACA;EACA;EACA;;KAGU;KAUA;KAEA;EACV,QAAQ;EACR,QAAQ;EACR;EACA;EACA;;KAGU;EACV;E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;EACA,wBAAwB;EACxB;EACA,qBAAqB;EACrB,iBAAiB;EACjB;IACE;IACA;IACA;IACA;MAA2B;;IAC3B,MAAM;;;KAIE;EACV;EACA;EACA;EACA;;KAGU;EACV,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB,OAAO;EAC7B;EACA;EACA;EACA,oBAAoB;EACpB;EACA,UAAU;EACV;EACA,wBAAwB;EACxB,kBAAkB;EAClB,qBAAqB,eAAe;EACpC,OAAO;EACP,eAAe;;;;KClfL;EAAgC;;KAEhC;EACV;EACA;EACA;EACA,eAAe;;;;;;;;;;EAUf,MAAM"}
1
+ {"version":3,"file":"session-options-Dp6mzNSy.d.ts","names":[],"sources":["../src/prompt-content.ts","../src/types.ts","../src/runtime/engine/session-options.ts"],"mappings":";;KAEY,cAAc;;;KCgBd;EACV;EACA,KAAK;EACL,cAAc;;KAGJ;EACN;;EACA;;EACA;;EACA;;EACA;;KAEM,wBACV,SAAS,sBACT;EAAW,QAAQ;MAChB,QAAQ;cAEA;KACD,6BAA6B;KAC7B,wBAAwB;KAExB;;EAEV,WAAW;;EAEX,QAAQ;;KAGL;EACH,QAAQ;;KAGE;EAEN;EACA,UAAU,eAAe;IACvB;EACD;IAAsB;EACtB;IAAqB;KAEhB,yBACV,SAAS,uBACT,SAAS,0BACN,QAAQ;cAiBA;KACD,yBAAyB;cAExB;KACD,qBAAqB;cAEpB;KACD,yCAAyC;cAExC;KACD,iCAAiC;KAEjC;EACV;EACA;EACA;EACA,gBAAgB;;KAGN;EACV;EACA;EACA;EACA;EACA;EACA;EACA,WAAW;EACX;EACA;EACA;EACA;;KAQU,oBAAoB;KACpB;KAyCA;EACV;EACA;EACA;EACA;;KAGU;KAUA;KAEA;EACV,QAAQ;EACR,QAAQ;EACR;EACA;EACA;;KAGU;EACV;EACA;EACA;EACA;EACA;EACA;;KAgDU,wBACR;EAAW;KAC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B;EACjB;IACE;IACA;IACA;IACA;MAA2B;;IAC3B,MAAM;;;KAIE;EACV;EACA;EACA;EACA;;KAGU;EACV,eAAe;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,UAAU;EACV;EACA;EACA;EACA;EACA;EACA;EACA,sBAAsB,OAAO;EAC7B;EACA;EACA;EACA,oBAAoB;EACpB;EACA,UAAU;EACV;EACA,wBAAwB;EACxB,kBAAkB;EAClB,qBAAqB,eAAe;EACpC,OAAO;EACP,eAAe;;;;KCnfL;EAAgC;;KAEhC;EACV;EACA;EACA;EACA,eAAe;;;;;;;;;;EAUf,MAAM"}
@@ -1,6 +1,6 @@
1
- import { i as JsonMessageSanitizer, t as createOutputFormatter } from "./output-CL18YmsG.js";
2
- import { nt as isAcpJsonRpcMessage, st as parsePromptStopReason } from "./ipc-BJrvfNXr.js";
3
- import { t as watchSession } from "./watch-Dp73ph8h.js";
1
+ import { i as JsonMessageSanitizer, t as createOutputFormatter } from "./output-Cnuji8Bo.js";
2
+ import { at as isAcpJsonRpcMessage, ut as parsePromptStopReason } from "./ipc-DAApJ5mi.js";
3
+ import { t as watchSession } from "./watch-Cz6jbrRs.js";
4
4
  import { once } from "node:events";
5
5
  //#region src/cli/session-watch.ts
6
6
  function watchRenderer(policy) {
@@ -22,7 +22,7 @@ function watchRenderer(policy) {
22
22
  } : event) + "\n");
23
23
  else if (event.type === "message") renderWatchMessage(event, sanitizer, formatter, policy.format === "quiet");
24
24
  else {
25
- formatter.flush();
25
+ if (event.type === "turn_result") formatter.flush();
26
26
  if (policy.format !== "quiet") chunks.push(watchLifecycleLine(event));
27
27
  }
28
28
  return chunks;
@@ -73,4 +73,4 @@ async function runSessionWatch(record, options) {
73
73
  //#endregion
74
74
  export { runSessionWatch };
75
75
 
76
- //# sourceMappingURL=session-watch-B8Q_TsGf.js.map
76
+ //# sourceMappingURL=session-watch-Bj9LoYUq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-watch-Bj9LoYUq.js","names":[],"sources":["../src/cli/session-watch.ts"],"sourcesContent":["import { once } from \"node:events\";\nimport { isAcpJsonRpcMessage, parsePromptStopReason } from \"../acp/jsonrpc.js\";\nimport type { SessionWatchEvent } from \"../session/journal.js\";\nimport { watchSession } from \"../session/watch.js\";\nimport type { OutputFormatter, OutputPolicy, SessionRecord } from \"../types.js\";\nimport { JsonMessageSanitizer } from \"./output/json-formatter.js\";\nimport { createOutputFormatter } from \"./output/output.js\";\n\nfunction watchRenderer(policy: OutputPolicy): (event: SessionWatchEvent) => string[] {\n const chunks: string[] = [];\n const stdout = {\n write: (chunk: string) => {\n chunks.push(chunk);\n },\n };\n let sanitizer = new JsonMessageSanitizer(policy.suppressReads, true);\n let formatter = createOutputFormatter(policy.format, { stdout });\n return (event) => {\n chunks.length = 0;\n if (event.type === \"turn_started\") {\n sanitizer = new JsonMessageSanitizer(policy.suppressReads, true);\n formatter = createOutputFormatter(policy.format, { stdout });\n }\n if (policy.format === \"json\") {\n chunks.push(\n JSON.stringify(\n event.type === \"message\"\n ? { ...event, message: sanitizer.sanitize(event.message) }\n : event,\n ) + \"\\n\",\n );\n } else if (event.type === \"message\") {\n renderWatchMessage(event, sanitizer, formatter, policy.format === \"quiet\");\n } else {\n if (event.type === \"turn_result\") {\n formatter.flush();\n }\n if (policy.format !== \"quiet\") {\n chunks.push(watchLifecycleLine(event));\n }\n }\n return chunks;\n };\n}\n\nfunction renderWatchMessage(\n event: Extract<SessionWatchEvent, { type: \"message\" }>,\n sanitizer: JsonMessageSanitizer,\n formatter: OutputFormatter,\n quiet: boolean,\n): void {\n const message = sanitizer.sanitize(event.message);\n if (!isAcpJsonRpcMessage(message)) {\n throw new Error(\"Invalid sanitized session message\");\n }\n if (quiet || parsePromptStopReason(message) === undefined) {\n formatter.onAcpMessage(message);\n }\n}\n\nfunction watchLifecycleLine(event: Exclude<SessionWatchEvent, { type: \"message\" }>): string {\n if (event.type === \"turn_started\") {\n return `\\n[${event.requestId}] started cursor=${event.cursor}\\n`;\n }\n const detail =\n event.result.status === \"failed\" ? event.result.error.message : event.result.stopReason;\n return `\\n[${event.requestId}] ${event.result.status}${detail ? `: ${detail}` : \"\"} cursor=${event.cursor}\\n`;\n}\n\nexport async function runSessionWatch(\n record: SessionRecord,\n options: { cursor?: string; policy: OutputPolicy },\n): Promise<void> {\n const stopped = new AbortController();\n let outputError: Error | undefined;\n const stop = () => stopped.abort();\n const onOutputError = (error: Error) => {\n if ((error as NodeJS.ErrnoException).code !== \"EPIPE\") {\n outputError = error;\n }\n stop();\n };\n const render = watchRenderer(options.policy);\n process.on(\"SIGINT\", stop);\n process.on(\"SIGTERM\", stop);\n process.on(\"SIGHUP\", stop);\n process.stdout.on(\"error\", onOutputError);\n try {\n for await (const event of watchSession({\n record,\n cursor: options.cursor,\n signal: stopped.signal,\n })) {\n for (const chunk of render(event)) {\n if (stopped.signal.aborted) {\n break;\n }\n if (!process.stdout.write(chunk)) {\n await once(process.stdout, \"drain\", { signal: stopped.signal });\n }\n }\n }\n } catch (error) {\n if (!stopped.signal.aborted) {\n throw error;\n }\n } finally {\n process.off(\"SIGINT\", stop);\n process.off(\"SIGTERM\", stop);\n process.off(\"SIGHUP\", stop);\n process.stdout.off(\"error\", onOutputError);\n }\n if (outputError) {\n throw outputError;\n }\n}\n"],"mappings":";;;;;AAQA,SAAS,cAAc,QAA8D;CACnF,MAAM,SAAmB,CAAC;CAC1B,MAAM,SAAS,EACb,QAAQ,UAAkB;EACxB,OAAO,KAAK,KAAK;CACnB,EACF;CACA,IAAI,YAAY,IAAI,qBAAqB,OAAO,eAAe,IAAI;CACnE,IAAI,YAAY,sBAAsB,OAAO,QAAQ,EAAE,OAAO,CAAC;CAC/D,QAAQ,UAAU;EAChB,OAAO,SAAS;EAChB,IAAI,MAAM,SAAS,gBAAgB;GACjC,YAAY,IAAI,qBAAqB,OAAO,eAAe,IAAI;GAC/D,YAAY,sBAAsB,OAAO,QAAQ,EAAE,OAAO,CAAC;EAC7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AI;EACF,WAAW,MAAM,SAAS,aAAa;GACrC;GACA,QAAQ,QAAQ;GAChB,QAAQ,QAAQ;EAClB,CAAC,GACC,KAAK,MAAM,SAAS,OAAO,KAAK,GAAG;GACjC,IAAI,QAAQ,OAAO,SACjB;GAEF,IAAI,CAAC,QAAQ,OAAO,MAAM,KAAK,GAC7B,MAAM,KAAK,QAAQ,QAAQ,SAAS,EAAE,QAAQ,QAAQ,OAAO,CAAC;EAElE;CAEJ,SAAS,OAAO;EACd,IAAI,CAAC,QAAQ,OAAO,SAClB,MAAM;CAEV,UAAU;EACR,QAAQ,IAAI,UAAU,IAAI;EAC1B,QAAQ,IAAI,WAAW,IAAI;EAC3B,QAAQ,IAAI,UAAU,IAAI;EAC1B,QAAQ,OAAO,IAAI,SAAS,aAAa;CAC3C;CACA,IAAI,aACF,MAAM;AAEV"}
@@ -1,4 +1,4 @@
1
- import { F as readSessionRecord, G as SessionWatchError, K as watchSession$1, Wt as SessionNotFoundError, d as readQueueOwnerRecord, gt as isProcessAlive } from "./ipc-BJrvfNXr.js";
1
+ import { J as SessionWatchError, Kt as SessionNotFoundError, R as readSessionRecord, Y as watchSession$1, d as readQueueOwnerRecord, yt as isProcessAlive } from "./ipc-DAApJ5mi.js";
2
2
  //#region src/session/watch.ts
3
3
  async function continueWatching(recordId, pendingRequestId, observation) {
4
4
  const owner = await readQueueOwnerRecord(recordId);
@@ -29,4 +29,4 @@ function watchSession(options) {
29
29
  //#endregion
30
30
  export { watchSession as t };
31
31
 
32
- //# sourceMappingURL=watch-Dp73ph8h.js.map
32
+ //# sourceMappingURL=watch-Cz6jbrRs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"watch-Dp73ph8h.js","names":["watchJournal"],"sources":["../src/session/watch.ts"],"sourcesContent":["import { SessionNotFoundError } from \"../errors.js\";\nimport { isProcessAlive } from \"../process-liveness.js\";\nimport type { SessionRecord } from \"../types.js\";\nimport {\n SessionWatchError,\n watchSession as watchJournal,\n type SessionWatchEvent,\n} from \"./journal.js\";\nimport { readSessionRecord } from \"./persistence.js\";\nimport { readQueueOwnerRecord } from \"./queue/lease-store.js\";\n\nasync function continueWatching(\n recordId: string,\n pendingRequestId: string | null,\n observation: { missingRequest: string | null },\n): Promise<boolean> {\n const owner = await readQueueOwnerRecord(recordId);\n if (owner && isProcessAlive(owner.pid)) {\n if (!owner.sessionWatch) {\n throw new SessionWatchError(\n \"WATCH_OWNER_UNSUPPORTED\",\n \"This running session owner predates passive watching. Let it expire when idle or explicitly close the session before starting new work.\",\n );\n }\n observation.missingRequest = null;\n return true;\n }\n if (pendingRequestId && pendingRequestId === observation.missingRequest) {\n throw new SessionWatchError(\n \"WATCH_OUTCOME_UNKNOWN\",\n `Session owner ended without a settled result for request ${pendingRequestId}; its outcome is unknown. Resume watching from the last cursor after recovery, and do not automatically replay the prompt.`,\n );\n }\n observation.missingRequest = pendingRequestId;\n if (pendingRequestId) {\n return true;\n }\n return await isSessionOpen(recordId);\n}\n\nasync function isSessionOpen(recordId: string): Promise<boolean> {\n const record = await readSessionRecord(recordId);\n if (!record || record.acpxRecordId !== recordId) {\n throw new SessionNotFoundError(recordId);\n }\n return record.closed !== true;\n}\n\nexport function watchSession(options: {\n record: SessionRecord | Promise<SessionRecord>;\n cursor?: string;\n signal?: AbortSignal;\n}): AsyncIterable<SessionWatchEvent> {\n return {\n [Symbol.asyncIterator]() {\n const observation: { missingRequest: string | null } = { missingRequest: null };\n return watchJournal({\n ...options,\n continueWatching: (record, requestId) =>\n continueWatching(record.acpxRecordId, requestId, observation),\n })[Symbol.asyncIterator]();\n },\n };\n}\n"],"mappings":";;AAWA,eAAe,iBACb,UACA,kBACA,aACkB;CAClB,MAAM,QAAQ,MAAM,qBAAqB,QAAQ;CACjD,IAAI,SAAS,eAAe,MAAM,GAAG,GAAG;EACtC,IAAI,CAAC,MAAM,cACT,MAAM,IAAI,kBACR,2BACA,yIACF;EAEF,YAAY,iBAAiB;EAC7B,OAAO;CACT;CACA,IAAI,oBAAoB,qBAAqB,YAAY,gBACvD,MAAM,IAAI,kBACR,yBACA,4DAA4D,iBAAiB,2HAC/E;CAEF,YAAY,iBAAiB;CAC7B,IAAI,kBACF,OAAO;CAET,OAAO,MAAM,cAAc,QAAQ;AACrC;AAEA,eAAe,cAAc,UAAoC;CAC/D,MAAM,SAAS,MAAM,kBAAkB,QAAQ;CAC/C,IAAI,CAAC,UAAU,OAAO,iBAAiB,UACrC,MAAM,IAAI,qBAAqB,QAAQ;CAEzC,OAAO,OAAO,WAAW;AAC3B;AAEA,SAAgB,aAAa,SAIQ;CACnC,OAAO,EACL,CAAC,OAAO,iBAAiB;EACvB,MAAM,cAAiD,EAAE,gBAAgB,KAAK;EAC9E,OAAOA,eAAa;GAClB,GAAG;GACH,mBAAmB,QAAQ,cACzB,iBAAiB,OAAO,cAAc,WAAW,WAAW;EAChE,CAAC,CAAC,CAAC,OAAO,cAAc,CAAC;CAC3B,EACF;AACF"}
1
+ {"version":3,"file":"watch-Cz6jbrRs.js","names":["watchJournal"],"sources":["../src/session/watch.ts"],"sourcesContent":["import { SessionNotFoundError } from \"../errors.js\";\nimport { isProcessAlive } from \"../process-liveness.js\";\nimport type { SessionRecord } from \"../types.js\";\nimport {\n SessionWatchError,\n watchSession as watchJournal,\n type SessionWatchEvent,\n} from \"./journal.js\";\nimport { readSessionRecord } from \"./persistence.js\";\nimport { readQueueOwnerRecord } from \"./queue/lease-store.js\";\n\nasync function continueWatching(\n recordId: string,\n pendingRequestId: string | null,\n observation: { missingRequest: string | null },\n): Promise<boolean> {\n const owner = await readQueueOwnerRecord(recordId);\n if (owner && isProcessAlive(owner.pid)) {\n if (!owner.sessionWatch) {\n throw new SessionWatchError(\n \"WATCH_OWNER_UNSUPPORTED\",\n \"This running session owner predates passive watching. Let it expire when idle or explicitly close the session before starting new work.\",\n );\n }\n observation.missingRequest = null;\n return true;\n }\n if (pendingRequestId && pendingRequestId === observation.missingRequest) {\n throw new SessionWatchError(\n \"WATCH_OUTCOME_UNKNOWN\",\n `Session owner ended without a settled result for request ${pendingRequestId}; its outcome is unknown. Resume watching from the last cursor after recovery, and do not automatically replay the prompt.`,\n );\n }\n observation.missingRequest = pendingRequestId;\n if (pendingRequestId) {\n return true;\n }\n return await isSessionOpen(recordId);\n}\n\nasync function isSessionOpen(recordId: string): Promise<boolean> {\n const record = await readSessionRecord(recordId);\n if (!record || record.acpxRecordId !== recordId) {\n throw new SessionNotFoundError(recordId);\n }\n return record.closed !== true;\n}\n\nexport function watchSession(options: {\n record: SessionRecord | Promise<SessionRecord>;\n cursor?: string;\n signal?: AbortSignal;\n}): AsyncIterable<SessionWatchEvent> {\n return {\n [Symbol.asyncIterator]() {\n const observation: { missingRequest: string | null } = { missingRequest: null };\n return watchJournal({\n ...options,\n continueWatching: (record, requestId) =>\n continueWatching(record.acpxRecordId, requestId, observation),\n })[Symbol.asyncIterator]();\n },\n };\n}\n"],"mappings":";;AAWA,eAAe,iBACb,UACA,kBACA,aACkB;CAClB,MAAM,QAAQ,MAAM,qBAAqB,QAAQ;CACjD,IAAI,SAAS,eAAe,MAAM,GAAG,GAAG;EACtC,IAAI,CAAC,MAAM,cACT,MAAM,IAAI,kBACR,2BACA,yIACF;EAEF,YAAY,iBAAiB;EAC7B,OAAO;CACT;CACA,IAAI,oBAAoB,qBAAqB,YAAY,gBACvD,MAAM,IAAI,kBACR,yBACA,4DAA4D,iBAAiB,2HAC/E;CAEF,YAAY,iBAAiB;CAC7B,IAAI,kBACF,OAAO;CAET,OAAO,MAAM,cAAc,QAAQ;AACrC;AAEA,eAAe,cAAc,UAAoC;CAC/D,MAAM,SAAS,MAAM,kBAAkB,QAAQ;CAC/C,IAAI,CAAC,UAAU,OAAO,iBAAiB,UACrC,MAAM,IAAI,qBAAqB,QAAQ;CAEzC,OAAO,OAAO,WAAW;AAC3B;AAEA,SAAgB,aAAa,SAIQ;CACnC,OAAO,EACL,CAAC,OAAO,iBAAiB;EACvB,MAAM,cAAiD,EAAE,gBAAgB,KAAK;EAC9E,OAAOA,eAAa;GAClB,GAAG;GACH,mBAAmB,QAAQ,cACzB,iBAAiB,OAAO,cAAc,WAAW,WAAW;EAChE,CAAC,CAAC,CAAC,OAAO,cAAc,CAAC;CAC3B,EACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "acpx",
3
- "version": "0.18.0",
3
+ "version": "0.19.1",
4
4
  "description": "Headless CLI client for the Agent Client Protocol (ACP) — talk to coding agents from the command line",
5
5
  "keywords": [
6
6
  "acp",
@@ -84,7 +84,7 @@ If prompt text is omitted and stdin is piped, `acpx` reads prompt text from stdi
84
84
  Friendly agent names resolve to commands:
85
85
 
86
86
  - `pi` -> `npx pi-acp` (ACPX-owned package range; see `agents/Pi.md`)
87
- - `openclaw` -> `openclaw acp`
87
+ - `openclaw` -> `openclaw acp` (see the [OpenClaw guide](https://github.com/openclaw/acpx/blob/main/agents/OpenClaw.md))
88
88
  - `codex` -> `npx -y @agentclientprotocol/codex-acp` (ACPX-owned package range)
89
89
  - `claude` -> `npx -y @agentclientprotocol/claude-agent-acp` (ACPX-owned package range; see `agents/Claude.md`)
90
90
  - `gemini` -> `gemini --acp`
@@ -117,6 +117,8 @@ Rules:
117
117
  - Unknown positional agent tokens are treated as raw agent commands.
118
118
  - `--agent <command>` explicitly sets a raw ACP adapter command.
119
119
  - Do not combine a positional agent and `--agent` in the same command.
120
+ - Gemini version checks, Copilot ACP support checks, and their startup diagnostics use the selected agent's working directory and child environment, including session environment and embedded runtime overrides.
121
+ - Embedded host lifecycle admission also covers compatibility and diagnostic invocations. Correlate their events by `launchId`; one session can produce several adapter processes. Checks retire their owned processes and output pipes before settling.
120
122
 
121
123
  ## Embedded hosts
122
124
 
@@ -211,11 +213,14 @@ Behavior:
211
213
  - `cancel`: sends cooperative `session/cancel` through queue-owner IPC.
212
214
  - `set-mode`: calls ACP `session/set_mode`.
213
215
  - `set-mode` mode ids are adapter-defined; unsupported values are rejected by the adapter (often `Invalid params`).
216
+ - On allowed fresh fallback, `set-mode` replaces the old saved mode without replaying it. Other saved settings restore first; the new mode preference is saved only after acceptance.
217
+ - Prompt reconnect uses model metadata received while restoring a saved mode before replaying the selected model, and retains changed or removed model support in the final session metadata.
214
218
  - `set`: calls ACP `session/set_config_option`.
219
+ - A config key named `mode` keeps config-option transport; explicit `set-mode` uses the separate `session/set_mode` control.
215
220
  - Current codex-acp releases expose `model` and `reasoning_effort` as separate config options.
216
221
  - `--model <id>`: Claude-compatible adapters may consume session creation metadata; other agents must advertise a model config option or legacy `models` metadata.
217
222
  - `set model <id>`: validates against the connected session's advertised models, uses `session/set_config_option` for model config options, and preserves `session/set_model` for explicitly advertised legacy models. Claude Code still accepts or rejects selectors absent from its advertised list.
218
- - Model switches can change or remove reasoning-effort controls. ACPX reconciles saved non-mode selections with the accepted response; select a supported effort again if needed.
223
+ - Model switches can change or remove reasoning-effort controls. ACPX reconciles saved config selections with the accepted response; select a supported effort again if needed.
219
224
  - After reconnect, ACPX restores the saved model when advertised and replays saved config selections before prompting. A replay failure is reported instead of silently using defaults.
220
225
  - `set-mode`/`set` route through queue-owner IPC when active, otherwise reconnect directly.
221
226
 
@@ -284,11 +289,11 @@ Behavior:
284
289
 
285
290
  - `--agent <command>`: raw ACP agent command (escape hatch)
286
291
  - `--cwd <dir>`: working directory for session scope (default: current directory)
287
- - `--approve-all`: auto-approve all permission requests
288
- - `--approve-reads`: auto-approve reads/searches, prompt for writes (default mode)
289
- - `--deny-all`: deny all permission requests
290
- - `--non-interactive-permissions <policy>`: when prompting is unavailable, choose `deny` or `fail`
291
- - `--permission-policy <json-or-file>` / `--policy`: per-tool ACP permission rules (`autoApprove`, `autoDeny`, `escalate`, `defaultAction`)
292
+ - `--approve-all`: approve tool permission requests not resolved by a per-tool policy
293
+ - `--approve-reads`: approve remaining read/search requests and prompt for other tools (default mode)
294
+ - `--deny-all`: deny tool permission requests not resolved by a per-tool policy
295
+ - `--non-interactive-permissions <policy>`: choose `deny` or `fail` when the permission mode requires a prompt but stdin or stderr is not a TTY
296
+ - `--permission-policy <json-or-file>` / `--policy`: per-tool ACP permission rules that take precedence over the permission mode
292
297
  - `--format <fmt>`: output format (`text`, `json`, `quiet`)
293
298
  - `--json-strict`: strict JSON mode; requires `--format json` and suppresses non-JSON stderr output
294
299
  - `--suppress-reads`: suppress raw read-file contents while preserving the selected format
@@ -300,8 +305,8 @@ Behavior:
300
305
  - `--allowed-tools <list>`: comma-separated tool whitelist (use `""` for no tools)
301
306
  - `--max-turns <count>`: cap session turn count
302
307
  - `--prompt-retries <count>`: retry failed prompt turns on transient errors (default `0`); cancelling a queued turn stops remaining attempts, while already-received final responses keep their outcome
303
- - `--no-fs`: advertise both ACP filesystem capabilities as disabled so compatible agents use their native file operations
304
- - `--no-terminal`: do not advertise the ACP terminal capability — useful for review-only or sandboxed agent invocations
308
+ - `--no-fs`: disable ACP filesystem callbacks so compatible agents use their native file operations. This is a protocol callback policy, not an OS sandbox for the agent's own filesystem access.
309
+ - `--no-terminal`: disable the ACP terminal callback. This is a protocol callback policy, not an OS sandbox for the agent's own process access.
305
310
  - `--verbose`: verbose ACP/debug logs to stderr
306
311
 
307
312
  Cursor may advertise bracketed model IDs such as `composer-2.5[fast=false]`. An exact
@@ -317,13 +322,19 @@ Permission flags are mutually exclusive.
317
322
  `--system-prompt` and `--append-system-prompt` let you specialize a Claude session without leaving lingering one-off state, while still benefiting from persistent session reuse.
318
323
 
319
324
  ```bash
320
- # Replace the system prompt for a named session, persisted across reuse
321
- acpx --system-prompt "You are a code reviewer who challenges every implicit assumption." claude -s review
322
-
323
- # Append a guideline on top of the default system prompt
324
- acpx --append-system-prompt "Always explain trade-offs before recommending a fix." claude -s impl
325
+ # Create a named session with a replacement system prompt.
326
+ acpx --system-prompt "You are a code reviewer who challenges every implicit assumption." \
327
+ claude sessions new --name review
328
+ acpx claude -s review 'review the current diff'
329
+
330
+ # Create a named session with an appended guideline.
331
+ acpx --append-system-prompt "Always explain trade-offs before recommending a fix." \
332
+ claude sessions new --name impl
333
+ acpx claude -s impl 'implement the requested change'
325
334
  ```
326
335
 
336
+ Run the creation command once, then select the session with `-s` for later prompts. Running `sessions new` again in the same scope closes the prior local record and creates a fresh session.
337
+
327
338
  The override is forwarded via ACP `_meta.systemPrompt` (or `_meta.systemPrompt.append`) on `session/new` and stored in `session_options.system_prompt`. Subsequent `prompt`/`ensure` calls in the same scope keep the override unless you explicitly create a new session. Non-Claude adapters ignore the field, so the same flag is safe inside cross-agent scripts.
328
339
 
329
340
  ## Claude settings isolation
@@ -399,7 +410,7 @@ Persistent prompt sessions are scoped by:
399
410
  Persistence:
400
411
 
401
412
  - Session records are stored in `~/.acpx/sessions/*.json`.
402
- - `-s/--session` creates parallel named conversations in the same repo.
413
+ - `-s/--session` selects a named conversation; create it with `sessions new --name <name>` or `sessions ensure --name <name>` before prompting.
403
414
  - Changing `--cwd` changes scope and therefore session lookup.
404
415
  - closed sessions are retained on disk with `closed: true` and `closedAt` until pruned.
405
416
  - auto-resume by scope skips closed sessions.
@@ -418,8 +429,8 @@ Queueing is per persistent session.
418
429
 
419
430
  - The active `acpx` process for a running prompt becomes the queue owner.
420
431
  - Other invocations submit prompts over local IPC.
421
- - On Unix-like systems, queue IPC uses a Unix socket under `~/.acpx/queues/<hash>.sock`.
422
- - Ownership is coordinated with a lock file under `~/.acpx/queues/<hash>.lock`.
432
+ - On Unix-like systems, queue IPC uses `/tmp/acpx-<home-hash>/<session-hash>.sock`.
433
+ - Ownership is coordinated with a lease file at `~/.acpx/queues/<session-hash>.lock`.
423
434
  - Persistent turns retain a separate filesystem guard through checkpoint and cleanup. Waiting can be cancelled; admitted ownership ends only after cleanup. Live guards never expire by age, and ambiguous guard state is preserved. See [session ownership](../../docs/sessions.md#queue-ownership).
424
435
  - On Windows, named pipes are used instead of Unix sockets.
425
436
  - after the queue drains, owner shutdown is governed by TTL (default 300s, configurable with `--ttl`).
@@ -453,11 +464,17 @@ acpx --format json codex exec 'review changed files' \
453
464
 
454
465
  ## Permission modes
455
466
 
456
- - `--approve-all`: no interactive permission prompts
457
- - `--approve-reads` (default): approve reads/searches, prompt for writes
458
- - `--deny-all`: deny all permission requests
459
- - `--non-interactive-permissions <deny|fail>`: chosen behavior when no TTY is available to prompt
460
- - `--policy <json-or-file>`: match ACP permission requests by tool kind/title; non-interactive escalations add ACP response metadata
467
+ For ACP tool permission requests, per-tool policy takes precedence over the permission mode. Rules are evaluated in this order: `autoDeny`, `autoApprove`, `escalate`, then `defaultAction`. The selected mode applies only when the policy does not resolve the request.
468
+
469
+ - `--approve-all`: approve remaining tool permission requests without prompting
470
+ - `--approve-reads` (default): approve remaining read/search requests and prompt for other tools
471
+ - `--deny-all`: deny remaining tool permission requests
472
+ - `--non-interactive-permissions <deny|fail>`: choose what happens when the mode requires a prompt but stdin or stderr is not a TTY
473
+ - `--policy <json-or-file>`: match ACP tool permission requests by kind, title, title head, or raw input tool name
474
+
475
+ An `autoApprove` rule can approve a tool request under `--deny-all`. An `escalate` rule can prompt under `--approve-all` when stdin and stderr are TTYs. Without both TTYs, escalation denies or cancels the current request and adds `_meta.acpx.permissionEscalation` to the ACP response, even when `--non-interactive-permissions fail` is selected.
476
+
477
+ Per-tool policies govern `session/request_permission`. ACP filesystem and terminal operations use the client's permission mode separately; a tool approval does not bypass those operation checks.
461
478
 
462
479
  If every permission request is denied/cancelled and none approved, `acpx` exits with permission-denied status.
463
480
 
@@ -485,6 +502,8 @@ acpx flow run ./my-flow.flow.ts --default-agent claude
485
502
 
486
503
  Run artifacts persist under `~/.acpx/flows/runs/<runId>/`. Default per-step timeout is 15 minutes when `--timeout` is unset; flows that declare permission requirements fail fast before starting.
487
504
 
505
+ Each attempt has one deadline across preparation, execution, and parsing. Callbacks receive `context.signal`; function actions also receive `context.runShell` to run commands whose processes and output streams the runner owns. A command's own timeout returns partial output with `timedOut: true`; enclosing node cancellation rejects after cleanup and prevents later managed commands. Admitted runtime writes finish before routing or final publication. Check the signal around custom asynchronous side effects: arbitrary JavaScript cannot be forcibly stopped, and completed effects are not rolled back. Persistent reconnects must load the same backend session or fail. See `docs/flows.md` for the command result and cancellation contracts.
506
+
488
507
  ### Authoring a flow
489
508
 
490
509
  The authoring surface lives in `acpx/flows`. The minimal example:
@@ -580,6 +599,8 @@ See `examples/flows/` in the repo for working samples (`branch.flow.ts`, `pr-tri
580
599
 
581
600
  ## Practical workflows
582
601
 
602
+ For explicit `prompt` and `exec`, an agent-level `--file` is inherited unless the subcommand supplies its own file. Agent-level `--no-wait` also applies to `prompt`. Session-list options work on `sessions` or `list`, with explicit child values taking precedence. Watch inherits the agent's session selector unless `watch --name`/`-s` overrides it; its `--cursor` stays local to watch and never inherits the list pagination cursor.
603
+
583
604
  Persistent repo assistant:
584
605
 
585
606
  ```bash
@@ -597,7 +618,8 @@ acpx codex -s docs 'draft changelog entry for release'
597
618
  Specialized Claude reviewer that survives session reuse:
598
619
 
599
620
  ```bash
600
- acpx --system-prompt "You are a reviewer who refuses to approve untested changes." claude -s reviewer
621
+ acpx --system-prompt "You are a reviewer who refuses to approve untested changes." \
622
+ claude sessions new --name reviewer
601
623
  acpx claude -s reviewer 'review the diff in src/auth/'
602
624
  ```
603
625
 
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent-registry-DdKB-zia.js","names":[],"sources":["../src/acp/client-process.ts","../src/spawn-command-options.ts","../src/agent-registry.ts"],"sourcesContent":["import { execFile, type ChildProcess, type ChildProcessByStdio } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\nimport { Readable, Writable } from \"node:stream\";\n\nexport const PROCESS_HELPER_TIMEOUT_MS = 8_000;\nexport const PROCESS_HELPER_MAX_BUFFER_BYTES = 32 * 1024 * 1024;\n\nexport async function runTimedExecFile(\n command: string,\n args: readonly string[],\n options: {\n timeoutMs?: number;\n maxBufferBytes?: number;\n windowsHide?: boolean;\n } = {},\n): Promise<string> {\n const timeoutMs = Math.max(1, Math.round(options.timeoutMs ?? PROCESS_HELPER_TIMEOUT_MS));\n return await new Promise<string>((resolve, reject) => {\n let settled = false;\n let timer: ReturnType<typeof setTimeout> | undefined;\n const child = execFile(\n command,\n [...args],\n {\n encoding: \"utf8\",\n maxBuffer: options.maxBufferBytes ?? PROCESS_HELPER_MAX_BUFFER_BYTES,\n killSignal: \"SIGKILL\",\n windowsHide: options.windowsHide,\n },\n (error, stdout) => {\n if (settled) {\n return;\n }\n settled = true;\n if (timer) {\n clearTimeout(timer);\n }\n if (error) {\n reject(error);\n return;\n }\n resolve(stdout);\n },\n );\n\n timer = setTimeout(() => {\n if (settled) {\n return;\n }\n settled = true;\n const killed = child.kill(\"SIGKILL\");\n child.stdout?.destroy();\n child.stderr?.destroy();\n child.unref();\n reject(\n Object.assign(new Error(`${command} timed out after ${timeoutMs}ms`), {\n code: \"ETIMEDOUT\",\n killed,\n signal: \"SIGKILL\" as const,\n }),\n );\n }, timeoutMs);\n });\n}\n\nexport type CommandParts = {\n command: string;\n args: string[];\n};\n\nexport function normalizeAgentCommandInput(value: string | readonly string[]): {\n agentCommand: string;\n agentArgv?: string[];\n} {\n if (typeof value === \"string\") {\n return { agentCommand: value };\n }\n const parts = toCommandParts([...value]);\n const argv = [parts.command, ...parts.args];\n return {\n agentCommand: renderArgvIdentity(argv),\n agentArgv: argv,\n };\n}\n\nconst IDENTITY_SAFE_ARG_RE = /^[A-Za-z0-9_@%+=:,./^~-]+$/u;\n\nexport function renderArgvIdentity(argv: readonly string[]): string {\n return argv.map((arg) => (IDENTITY_SAFE_ARG_RE.test(arg) ? arg : JSON.stringify(arg))).join(\" \");\n}\n\ntype ResolveSessionCwdOptions = {\n platform?: NodeJS.Platform;\n existsSync?: (filePath: string) => boolean;\n runWslpath?: (cwd: string) => Promise<string>;\n};\n\nexport function isoNow(): string {\n return new Date().toISOString();\n}\n\nexport function waitForSpawn(child: ChildProcess): Promise<void> {\n return new Promise((resolve, reject) => {\n const onSpawn = () => {\n child.off(\"error\", onError);\n resolve();\n };\n const onError = (error: Error) => {\n child.off(\"spawn\", onSpawn);\n reject(error);\n };\n\n child.once(\"spawn\", onSpawn);\n child.once(\"error\", onError);\n });\n}\n\nexport function isChildProcessRunning(child: ChildProcess): boolean {\n return child.exitCode == null && child.signalCode == null;\n}\n\nexport function requireAgentStdio(\n child: ChildProcess,\n): ChildProcessByStdio<Writable, Readable, Readable> {\n if (!child.stdin || !child.stdout || !child.stderr) {\n throw new Error(\"ACP agent must be spawned with piped stdin/stdout/stderr\");\n }\n return child as ChildProcessByStdio<Writable, Readable, Readable>;\n}\n\nexport function waitForChildExit(\n child: ChildProcessByStdio<Writable, Readable, Readable>,\n timeoutMs: number,\n): Promise<boolean> {\n if (!isChildProcessRunning(child)) {\n return Promise.resolve(true);\n }\n\n return new Promise<boolean>((resolve) => {\n let settled = false;\n const timer = setTimeout(\n () => {\n finish(false);\n },\n Math.max(0, timeoutMs),\n );\n\n const finish = (value: boolean) => {\n if (settled) {\n return;\n }\n settled = true;\n child.off(\"close\", onExitLike);\n child.off(\"exit\", onExitLike);\n clearTimeout(timer);\n resolve(value);\n };\n\n const onExitLike = () => {\n finish(true);\n };\n\n child.once(\"close\", onExitLike);\n child.once(\"exit\", onExitLike);\n });\n}\n\nexport function resolveAgentCommandParts(\n value: string,\n argv: readonly string[] | undefined,\n platform: NodeJS.Platform = process.platform,\n): CommandParts {\n if (argv) {\n const parts = toCommandParts([...argv]);\n assertWindowsLaunchableCommand(parts.command, platform);\n return parts;\n }\n if (platform === \"win32\") {\n throw new Error(\n 'Raw agent command strings are not supported on Windows. Configure the agent with an argv array, for example: \"argv\": [\"agent.exe\", \"--acp\"]. Legacy agents.<name>.args arrays are migrated automatically. Existing sessions without saved argv must be closed and recreated.',\n );\n }\n return splitCommandLine(value);\n}\n\nfunction assertWindowsLaunchableCommand(command: string, platform: NodeJS.Platform): void {\n if (platform === \"win32\" && path.extname(command).toLowerCase() === \".sh\") {\n throw new Error(\n `Windows cannot launch shell script executable \"${command}\" directly. Configure an explicit interpreter argv, for example: \"argv\": [\"bash\", \"${command}\"]. acpx does not infer interpreters.`,\n );\n }\n}\n\ntype CommandLineState = {\n current: string;\n quote: \"'\" | '\"' | null;\n escaping: boolean;\n parts: string[];\n hasPart: boolean;\n};\n\nexport function splitCommandLine(value: string): CommandParts {\n const state: CommandLineState = {\n current: \"\",\n quote: null,\n escaping: false,\n parts: [],\n hasPart: false,\n };\n for (const ch of value) {\n readCommandLineChar(state, ch);\n }\n\n if (state.escaping) {\n state.current += \"\\\\\";\n state.hasPart = true;\n }\n if (state.quote) {\n throw new Error(\"Invalid --agent command: unterminated quote\");\n }\n flushCommandLinePart(state);\n return toCommandParts(state.parts);\n}\n\nfunction toCommandParts(parts: string[]): CommandParts {\n if (parts.length === 0 || parts[0] === \"\") {\n throw new Error(\"Invalid --agent command: empty command\");\n }\n return {\n command: parts[0],\n args: parts.slice(1),\n };\n}\n\nfunction readCommandLineChar(state: CommandLineState, ch: string): void {\n if (state.escaping) {\n state.current += ch;\n state.escaping = false;\n state.hasPart = true;\n } else if (ch === \"\\\\\" && state.quote !== \"'\") {\n state.escaping = true;\n } else if (state.quote) {\n if (ch === state.quote) {\n state.quote = null;\n } else {\n state.current += ch;\n }\n state.hasPart = true;\n } else {\n readUnquotedCommandLineChar(state, ch);\n }\n}\n\nfunction readUnquotedCommandLineChar(state: CommandLineState, ch: string): void {\n if (ch === \"'\" || ch === '\"') {\n state.quote = ch;\n state.hasPart = true;\n } else if (/\\s/.test(ch)) {\n flushCommandLinePart(state);\n } else {\n state.current += ch;\n state.hasPart = true;\n }\n}\n\nfunction flushCommandLinePart(state: CommandLineState): void {\n if (state.hasPart) {\n state.parts.push(state.current);\n state.current = \"\";\n state.hasPart = false;\n }\n}\n\nexport function asAbsoluteCwd(cwd: string): string {\n return path.resolve(cwd);\n}\n\nexport async function resolveAgentSessionCwd(\n cwd: string,\n agentCommand: string,\n options: ResolveSessionCwdOptions = {},\n): Promise<string> {\n const resolved = asAbsoluteCwd(cwd);\n if (!shouldTranslateWslWindowsCwd(agentCommand, options)) {\n return resolved;\n }\n\n const translated = (await (options.runWslpath ?? runWslpath)(resolved)).trim();\n if (!translated) {\n throw new Error(`wslpath returned an empty Windows path for cwd: ${resolved}`);\n }\n return translated;\n}\n\nfunction shouldTranslateWslWindowsCwd(\n agentCommand: string,\n options: ResolveSessionCwdOptions,\n): boolean {\n if (!isWsl(options)) {\n return false;\n }\n\n try {\n const { command } = splitCommandLine(agentCommand);\n return isWindowsExecutableCommand(command);\n } catch {\n return false;\n }\n}\n\nfunction isWsl(options: ResolveSessionCwdOptions): boolean {\n const platform = options.platform ?? process.platform;\n if (platform !== \"linux\") {\n return false;\n }\n\n const existsSync = options.existsSync ?? fs.existsSync;\n return existsSync(\"/proc/sys/fs/binfmt_misc/WSLInterop\");\n}\n\nconst WINDOWS_EXECUTABLE_EXTENSION_RE = /\\.(?:exe|cmd|bat)$/u;\n\nfunction isWindowsExecutableCommand(command: string): boolean {\n const normalized = command.toLowerCase();\n return WINDOWS_EXECUTABLE_EXTENSION_RE.test(normalized);\n}\n\nasync function runWslpath(cwd: string): Promise<string> {\n return await runTimedExecFile(\"wslpath\", [\"-w\", cwd]);\n}\n\nexport function basenameToken(value: string): string {\n return path\n .basename(value)\n .toLowerCase()\n .replace(/\\.(cmd|exe|bat)$/u, \"\");\n}\n","import { spawn } from \"node:child_process\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nexport function readWindowsEnvValue(env: NodeJS.ProcessEnv, key: string): string | undefined {\n const matchedKey = Object.keys(env).find((entry) => entry.toUpperCase() === key);\n return matchedKey ? env[matchedKey] : undefined;\n}\n\nfunction windowsExecutableExtensions(env: NodeJS.ProcessEnv): string[] {\n return (readWindowsEnvValue(env, \"PATHEXT\") ?? \".COM;.EXE;.BAT;.CMD\")\n .split(\";\")\n .map((value) => value.trim().toLowerCase())\n .filter((value) => value.length > 0);\n}\n\nfunction commandCandidates(command: string, env: NodeJS.ProcessEnv): string[] {\n const commandExtension = path.extname(command);\n if (commandExtension.length > 0) {\n return [command];\n }\n return windowsExecutableExtensions(env).map((extension) => `${command}${extension}`);\n}\n\nfunction commandHasPath(command: string): boolean {\n return command.includes(\"/\") || command.includes(\"\\\\\") || path.isAbsolute(command);\n}\n\nfunction resolveWindowsPathCommand(command: string, env: NodeJS.ProcessEnv): string | undefined {\n const candidates = commandCandidates(command, env);\n const pathValue = readWindowsEnvValue(env, \"PATH\");\n if (!pathValue) {\n return undefined;\n }\n\n for (const directory of pathValue.split(\";\")) {\n const resolved = findExistingCommandInDirectory(directory, candidates);\n if (resolved) {\n return resolved;\n }\n }\n\n return undefined;\n}\n\nfunction findExistingCommandInDirectory(\n directory: string,\n candidates: string[],\n): string | undefined {\n const trimmedDirectory = directory.trim();\n if (trimmedDirectory.length === 0) {\n return undefined;\n }\n\n return candidates\n .map((candidate) => path.join(trimmedDirectory, candidate))\n .find((resolved) => fs.existsSync(resolved));\n}\n\nfunction resolveWindowsWrapperToken(token: string, wrapperPath: string): string | undefined {\n const relative = token.match(/%~?dp0%?\\s*[\\\\/]*(.*)$/i)?.[1]?.trim();\n if (!relative) {\n return undefined;\n }\n const candidate = path.resolve(\n path.dirname(wrapperPath),\n relative.replace(/[\\\\/]+/g, path.sep).replace(/^[\\\\/]+/, \"\"),\n );\n return path.extname(candidate).toLowerCase() === \".exe\" && fs.existsSync(candidate)\n ? candidate\n : undefined;\n}\n\nfunction resolveWindowsWrapperExecutable(wrapperPath: string): string | undefined {\n if (!fs.existsSync(wrapperPath)) {\n return undefined;\n }\n\n try {\n const content = fs.readFileSync(wrapperPath, \"utf8\");\n return [...content.matchAll(/\"([^\"\\r\\n]*)\"/g)]\n .map((match) => resolveWindowsWrapperToken(match[1] ?? \"\", wrapperPath))\n .find((candidate): candidate is string => candidate !== undefined);\n } catch {\n // Ignore unreadable wrapper scripts and let callers use their fallback.\n return undefined;\n }\n}\n\nexport function resolveWindowsCommand(\n command: string,\n env: NodeJS.ProcessEnv = process.env,\n): string | undefined {\n const candidates = commandCandidates(command, env);\n\n if (commandHasPath(command)) {\n return candidates.find((candidate) => fs.existsSync(candidate));\n }\n\n return resolveWindowsPathCommand(command, env);\n}\n\n/**\n * Resolve a Windows command to a native executable suitable for direct spawn.\n *\n * Batch and PowerShell shims are intentionally rejected unless they point at a\n * real `.exe` entrypoint. Callers that need shell execution should use the\n * command-specific shell policy instead.\n */\nexport function resolveWindowsExecutablePath(\n command: string,\n env: NodeJS.ProcessEnv = process.env,\n): string | undefined {\n const resolved = resolveWindowsCommand(command, env);\n if (!resolved) {\n return undefined;\n }\n\n const absolute = path.resolve(resolved);\n const extension = path.extname(absolute).toLowerCase();\n if (extension === \".exe\") {\n return absolute;\n }\n if (extension !== \".cmd\" && extension !== \".bat\" && extension !== \".ps1\") {\n return undefined;\n }\n\n const siblingExecutable = `${absolute.slice(0, -extension.length)}.exe`;\n return fs.existsSync(siblingExecutable)\n ? siblingExecutable\n : resolveWindowsWrapperExecutable(absolute);\n}\n\nfunction shouldUseWindowsBatchShell(\n command: string,\n platform: NodeJS.Platform = process.platform,\n env: NodeJS.ProcessEnv = process.env,\n): boolean {\n if (platform !== \"win32\") {\n return false;\n }\n const resolvedCommand = resolveWindowsCommand(command, env) ?? command;\n const ext = path.extname(resolvedCommand).toLowerCase();\n return ext === \".cmd\" || ext === \".bat\";\n}\n\nexport type AgentSpawnCommand = {\n command: string;\n args: string[];\n windowsVerbatimArguments?: boolean;\n};\n\nconst CMD_META_CHAR_RE = /([()\\][%!^\"`<>&|;, *?])/gu;\nconst CMD_BACKSLASH_QUOTE_RE = /(?=(\\\\+?)?)\\1\"/gu;\nconst CMD_TRAILING_BACKSLASH_RE = /(?=(\\\\+?)?)\\1$/gu;\nconst CMD_SHIM_RE = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/iu;\n\nfunction escapeCmdCommand(value: string): string {\n return value.replace(CMD_META_CHAR_RE, \"^$1\");\n}\n\nfunction escapeCmdArgument(value: string, doubleEscapeMeta: boolean): string {\n const quoted = `\"${value\n .replace(CMD_BACKSLASH_QUOTE_RE, '$1$1\\\\\"')\n .replace(CMD_TRAILING_BACKSLASH_RE, \"$1$1\")}\"`;\n const escaped = quoted.replace(CMD_META_CHAR_RE, \"^$1\");\n return doubleEscapeMeta ? escaped.replace(CMD_META_CHAR_RE, \"^$1\") : escaped;\n}\n\nexport function buildAgentSpawnCommand(\n command: string,\n args: readonly string[],\n platform: NodeJS.Platform = process.platform,\n env: NodeJS.ProcessEnv = process.env,\n): AgentSpawnCommand {\n if (!shouldUseWindowsBatchShell(command, platform, env)) {\n return { command, args: [...args] };\n }\n const resolvedCommand = path.win32.normalize(resolveWindowsCommand(command, env) ?? command);\n const doubleEscapeMeta = CMD_SHIM_RE.test(resolvedCommand);\n const shellCommand = [\n escapeCmdCommand(resolvedCommand),\n ...args.map((arg) => escapeCmdArgument(arg, doubleEscapeMeta)),\n ].join(\" \");\n return {\n command: readWindowsEnvValue(env, \"COMSPEC\") ?? \"cmd.exe\",\n args: [\"/d\", \"/s\", \"/c\", `\"${shellCommand}\"`],\n windowsVerbatimArguments: true,\n };\n}\n\nexport function buildSpawnCommandOptions(\n command: string,\n options: Parameters<typeof spawn>[2],\n platform: NodeJS.Platform = process.platform,\n env: NodeJS.ProcessEnv = process.env,\n): Parameters<typeof spawn>[2] {\n if (!shouldUseWindowsBatchShell(command, platform, env)) {\n return options;\n }\n return {\n ...options,\n shell: true,\n };\n}\n\nexport type TerminalSpawnCommand = {\n command: string;\n args: string[];\n killProcessGroup: boolean;\n};\n\nexport function buildTerminalSpawnCommand(\n command: string,\n args: string[] | undefined,\n): TerminalSpawnCommand {\n return { command, args: args ?? [], killProcessGroup: false };\n}\n\nexport function buildTerminalShellSpawnCommand(\n command: string,\n platform: NodeJS.Platform = process.platform,\n): TerminalSpawnCommand {\n if (platform === \"win32\") {\n return { command: \"cmd.exe\", args: [\"/d\", \"/s\", \"/c\", command], killProcessGroup: true };\n }\n return { command: \"/bin/sh\", args: [\"-c\", command], killProcessGroup: true };\n}\n\n/** Finds an installed entrypoint without executing it. */\nexport function resolveInstalledExecutable(command: string): string | undefined {\n if (process.platform === \"win32\") {\n const resolved = resolveWindowsCommand(command);\n return resolved && fs.statSync(resolved, { throwIfNoEntry: false })?.isFile()\n ? path.resolve(resolved)\n : undefined;\n }\n const candidates = command.includes(\"/\")\n ? [path.resolve(command)]\n : (process.env.PATH ?? \"\")\n .split(path.delimiter)\n .map((directory) => path.resolve(directory, command));\n return candidates.find((candidate) => {\n try {\n fs.accessSync(candidate, fs.constants.X_OK);\n return fs.statSync(candidate).isFile();\n } catch {\n return false;\n }\n });\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { splitCommandLine } from \"./acp/client-process.js\";\nimport { resolveInstalledExecutable } from \"./spawn-command-options.js\";\n\nconst ACP_ADAPTER_PACKAGE_RANGES = {\n pi: \"^0.0.33\",\n codex: \"^1.1.5\",\n claude: \"^0.76.0\",\n mux: \"^0.28.0\",\n} as const;\n\ntype BuiltInAgentPackageSpec = {\n packageName: string;\n packageRange: string;\n preferredBinName: string;\n fallbackCommand: string;\n legacyFallbackCommands?: string[];\n};\n\ntype BuiltInAgentLaunch = {\n source: \"installed\" | \"package-exec\";\n command: string;\n args: string[];\n packageName: string;\n packageRange: string;\n packageVersion?: string;\n binPath?: string;\n npmCliPath?: string;\n};\n\ntype BuiltInLaunchResolverOptions = {\n existsSync?: (path: string) => boolean;\n readFileSync?: typeof fs.readFileSync;\n resolvePackageRoot?: (packageName: string) => string | undefined;\n execPath?: string;\n resolveNpmCliPath?: (execPath: string) => string;\n};\n\ntype AgentDefinition = {\n name: string;\n argv: string[];\n installedArgv?: string[];\n requiredCommands?: string[];\n package?: Omit<BuiltInAgentPackageSpec, \"fallbackCommand\">;\n packageExecFallback?: boolean;\n};\n\nconst AGENT_DEFINITIONS: Record<string, AgentDefinition> = {\n pi: {\n name: \"Pi\",\n argv: [\"npx\", `pi-acp@${ACP_ADAPTER_PACKAGE_RANGES.pi}`],\n installedArgv: [\"pi-acp\"],\n requiredCommands: [\"pi\"],\n package: {\n packageName: \"pi-acp\",\n packageRange: ACP_ADAPTER_PACKAGE_RANGES.pi,\n preferredBinName: \"pi-acp\",\n },\n },\n openclaw: { name: \"OpenClaw\", argv: [\"openclaw\", \"acp\"] },\n codex: {\n name: \"Codex\",\n argv: [\"npx\", \"-y\", `@agentclientprotocol/codex-acp@${ACP_ADAPTER_PACKAGE_RANGES.codex}`],\n installedArgv: [\"codex-acp\"],\n package: {\n packageName: \"@agentclientprotocol/codex-acp\",\n packageRange: ACP_ADAPTER_PACKAGE_RANGES.codex,\n preferredBinName: \"codex-acp\",\n legacyFallbackCommands: [],\n },\n packageExecFallback: true,\n },\n claude: {\n name: \"Claude Code\",\n argv: [\n \"npx\",\n \"-y\",\n `@agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`,\n ],\n installedArgv: [\"claude-agent-acp\"],\n package: {\n packageName: \"@agentclientprotocol/claude-agent-acp\",\n packageRange: ACP_ADAPTER_PACKAGE_RANGES.claude,\n preferredBinName: \"claude-agent-acp\",\n legacyFallbackCommands: [\n `npm exec @agentclientprotocol/claude-agent-acp@${ACP_ADAPTER_PACKAGE_RANGES.claude}`,\n ],\n },\n packageExecFallback: true,\n },\n gemini: { name: \"Gemini CLI\", argv: [\"gemini\", \"--acp\"] },\n cursor: { name: \"Cursor\", argv: [\"cursor-agent\", \"acp\"] },\n copilot: { name: \"GitHub Copilot\", argv: [\"copilot\", \"--acp\", \"--stdio\"] },\n antigravity: {\n name: \"Google Antigravity\",\n argv:\n process.platform === \"win32\"\n ? [\"agy_acp_server.exe\"]\n : [\"agy_acp_server.par\", ...(process.platform === \"linux\" ? [\"--uid=\"] : [])],\n },\n devin: { name: \"Devin\", argv: [\"devin\", \"acp\"] },\n droid: { name: \"Factory Droid\", argv: [\"droid\", \"exec\", \"--output-format\", \"acp\"] },\n \"fast-agent\": { name: \"Fast Agent\", argv: [\"uvx\", \"fast-agent-mcp\", \"acp\"] },\n fx: { name: \"fx\", argv: [\"fx\", \"acp\"] },\n \"grok-build\": { name: \"Grok Build\", argv: [\"grok\", \"agent\", \"stdio\"] },\n iflow: { name: \"iFlow\", argv: [\"iflow\", \"--experimental-acp\"] },\n junie: { name: \"Junie\", argv: [\"junie\", \"--acp=true\"] },\n kilocode: {\n name: \"Kilo Code\",\n argv: [\"npx\", \"-y\", \"@kilocode/cli\", \"acp\"],\n installedArgv: [\"kilo\", \"acp\"],\n },\n kimi: { name: \"Kimi Code\", argv: [\"kimi\", \"acp\"] },\n kiro: { name: \"Kiro\", argv: [\"kiro-cli-chat\", \"acp\"] },\n mcode: { name: \"MCode\", argv: [\"mcode\", \"acp\"] },\n mux: { name: \"Mux\", argv: [\"npx\", \"-y\", `mux@${ACP_ADAPTER_PACKAGE_RANGES.mux}`, \"acp\"] },\n opencode: {\n name: \"OpenCode\",\n argv: [\"npx\", \"-y\", \"opencode-ai\", \"acp\"],\n installedArgv: [\"opencode\", \"acp\"],\n },\n pool: { name: \"Poolside\", argv: [\"pool\", \"acp\"] },\n qoder: { name: \"Qoder\", argv: [\"qodercli\", \"--acp\"] },\n qwen: { name: \"Qwen Code\", argv: [\"qwen\", \"--acp\"] },\n trae: { name: \"Trae\", argv: [\"traecli\", \"acp\", \"serve\"] },\n zeroclaw: { name: \"ZeroClaw\", argv: [\"zeroclaw\", \"acp\"] },\n};\n\nexport const AGENT_ARGV_REGISTRY: Record<string, string[]> = Object.fromEntries(\n Object.entries(AGENT_DEFINITIONS).map(([id, definition]) => [id, [...definition.argv]]),\n);\nexport const AGENT_REGISTRY: Record<string, string> = Object.fromEntries(\n Object.entries(AGENT_DEFINITIONS).map(([id, definition]) => [id, definition.argv.join(\" \")]),\n);\nexport const BUILT_IN_AGENT_PACKAGES: Record<string, BuiltInAgentPackageSpec> = Object.fromEntries(\n Object.entries(AGENT_DEFINITIONS).flatMap(([id, definition]) =>\n definition.packageExecFallback && definition.package\n ? [[id, { ...definition.package, fallbackCommand: definition.argv.join(\" \") }]]\n : [],\n ),\n);\n\nexport type AcpAgentInspection = {\n id: string;\n name: string;\n launch:\n | { kind: \"installed\"; argv: string[] }\n | { kind: \"missing\"; requirements: Array<{ kind: \"command\" | \"package\"; name: string }> };\n};\n\nexport type AcpAgentInspectionOptions = {\n resolveExecutable?: (command: string) => string | undefined;\n resolvePackageRoot?: (packageName: string) => string | undefined;\n};\n\nfunction isPackageExecution(argv: string[]): boolean {\n const command = path.win32\n .basename(argv[0])\n .toLowerCase()\n .replace(/\\.(cmd|exe|bat)$/, \"\");\n if ([\"npx\", \"uvx\", \"npm\", \"pnpm\", \"bunx\"].includes(command)) {\n return true;\n }\n switch (command) {\n case \"bun\":\n return argv[1] === \"x\";\n case \"uv\":\n return argv[1] === \"tool\" && argv[2] === \"run\";\n case \"node\":\n return /(?:npm|npx)-cli\\.js$/u.test(argv[1] ?? \"\");\n default:\n return false;\n }\n}\n\nfunction inspectionDefinition(\n id: string,\n override: string | string[] | undefined,\n): AgentDefinition | undefined {\n const definition = Object.hasOwn(AGENT_DEFINITIONS, id) ? AGENT_DEFINITIONS[id] : undefined;\n if (!override) {\n return definition;\n }\n let argv = override;\n if (typeof argv === \"string\") {\n const parsed = splitCommandLine(argv);\n argv = [parsed.command, ...parsed.args];\n }\n return { name: definition?.name ?? id, argv };\n}\n\nfunction inspectAgent(\n agentId: string,\n override: string | string[] | undefined,\n options: AcpAgentInspectionOptions = {},\n): AcpAgentInspection | undefined {\n const id = resolveCanonicalAgentName(agentId);\n const definition = inspectionDefinition(id, override);\n if (!definition) {\n return undefined;\n }\n const argv = definition.installedArgv ?? definition.argv;\n if (isPackageExecution(argv)) {\n return undefined;\n }\n const spec = definition.package\n ? { ...definition.package, fallbackCommand: definition.argv.join(\" \") }\n : undefined;\n const launch = inspectLaunch(argv, spec, options);\n return {\n id,\n name: definition.name,\n launch: inspectPrerequisites(launch, definition.requiredCommands ?? [], options),\n };\n}\n\nfunction inspectPrerequisites(\n launch: AcpAgentInspection[\"launch\"],\n requiredCommands: string[],\n options: AcpAgentInspectionOptions,\n): AcpAgentInspection[\"launch\"] {\n const resolveExecutable = options.resolveExecutable ?? resolveInstalledExecutable;\n const missingCommands = requiredCommands\n .filter((command) => !resolveExecutable(command))\n .map((name) => ({ kind: \"command\" as const, name }));\n if (missingCommands.length === 0) {\n return launch;\n }\n return {\n kind: \"missing\",\n requirements: [...(launch.kind === \"missing\" ? launch.requirements : []), ...missingCommands],\n };\n}\n\nfunction inspectLaunch(\n argv: string[],\n spec: BuiltInAgentPackageSpec | undefined,\n options: AcpAgentInspectionOptions,\n): AcpAgentInspection[\"launch\"] {\n const command = (options.resolveExecutable ?? resolveInstalledExecutable)(argv[0]);\n if (command) {\n return { kind: \"installed\", argv: [command, ...argv.slice(1)] };\n }\n if (!spec) {\n return { kind: \"missing\", requirements: [{ kind: \"command\", name: argv[0] }] };\n }\n const installed = resolveInstalledBuiltInAgentLaunchForSpec(spec, options);\n return installed\n ? { kind: \"installed\", argv: [installed.command, ...installed.args] }\n : { kind: \"missing\", requirements: [{ kind: \"package\", name: spec.packageName }] };\n}\n\nconst AGENT_ALIASES: Record<string, string> = {\n \"factory-droid\": \"droid\",\n factorydroid: \"droid\",\n};\n\nexport const DEFAULT_AGENT_NAME = \"codex\";\n\nexport function normalizeAgentName(value: string): string {\n return value.trim().toLowerCase();\n}\n\nexport function resolveCanonicalAgentName(value: string): string {\n const normalized = normalizeAgentName(value);\n return Object.hasOwn(AGENT_ALIASES, normalized) ? AGENT_ALIASES[normalized] : normalized;\n}\n\nfunction findAgentEntry<T>(registry: Record<string, T>, agentName: string): T | undefined {\n const normalized = normalizeAgentName(agentName);\n const canonical = resolveCanonicalAgentName(agentName);\n return Object.hasOwn(registry, normalized)\n ? registry[normalized]\n : Object.hasOwn(registry, canonical)\n ? registry[canonical]\n : undefined;\n}\n\nexport function mergeAgentRegistry(overrides?: Record<string, string>): Record<string, string> {\n if (!overrides) {\n return { ...AGENT_REGISTRY };\n }\n\n const entries = Object.entries(AGENT_REGISTRY);\n for (const [name, command] of Object.entries(overrides)) {\n const normalized = normalizeAgentName(name);\n if (!normalized || !command.trim()) {\n continue;\n }\n entries.push([normalized, command.trim()]);\n }\n return Object.fromEntries(entries);\n}\n\nexport function resolveAgentCommand(agentName: string, overrides?: Record<string, string>): string {\n return findAgentEntry(mergeAgentRegistry(overrides), agentName) ?? agentName;\n}\n\nexport function resolveAgentArgv(agentName: string): string[] | undefined {\n const argv = findAgentEntry(AGENT_ARGV_REGISTRY, agentName);\n return argv ? [...argv] : undefined;\n}\n\nexport function findBuiltInAgentPackage(agentCommand: string): BuiltInAgentPackageSpec | undefined {\n const normalized = agentCommand.trim();\n const builtInAgentPackages = Object.values(BUILT_IN_AGENT_PACKAGES);\n return builtInAgentPackages.find(\n (spec) =>\n spec.fallbackCommand === normalized || spec.legacyFallbackCommands?.includes(normalized),\n );\n}\n\nfunction defaultResolvePackageRoot(packageName: string): string {\n const segments = packageName.split(\"/\");\n let cursor = path.dirname(fileURLToPath(import.meta.url));\n\n while (true) {\n const candidateRoot = path.join(cursor, \"node_modules\", ...segments);\n const manifestPath = path.join(candidateRoot, \"package.json\");\n if (fs.existsSync(manifestPath)) {\n try {\n const parsed = JSON.parse(fs.readFileSync(manifestPath, \"utf8\")) as {\n name?: string;\n };\n if (parsed.name === packageName) {\n return candidateRoot;\n }\n } catch {\n // best effort; keep walking upward\n }\n }\n\n const parent = path.dirname(cursor);\n if (parent === cursor) {\n throw new Error(`Built-in agent package not found: ${packageName}`);\n }\n cursor = parent;\n }\n}\n\nfunction resolvePackageBin(\n spec: BuiltInAgentPackageSpec,\n manifest: {\n bin?: string | Record<string, string>;\n },\n): string | undefined {\n if (typeof manifest.bin === \"string\") {\n return manifest.bin;\n }\n if (!manifest.bin || typeof manifest.bin !== \"object\") {\n return undefined;\n }\n return (\n manifest.bin[spec.preferredBinName] ??\n (Object.keys(manifest.bin).length === 1 ? Object.values(manifest.bin)[0] : undefined)\n );\n}\n\nfunction defaultResolveNpmCliPath(execPath: string): string {\n const candidate = path.resolve(\n path.dirname(execPath),\n \"..\",\n \"lib\",\n \"node_modules\",\n \"npm\",\n \"bin\",\n \"npm-cli.js\",\n );\n if (!fs.existsSync(candidate)) {\n throw new Error(`npm CLI not found for execPath: ${execPath}`);\n }\n return candidate;\n}\n\nexport function resolveInstalledBuiltInAgentLaunch(\n agentCommand: string,\n options: BuiltInLaunchResolverOptions = {},\n): BuiltInAgentLaunch | undefined {\n const spec = findBuiltInAgentPackage(agentCommand);\n if (!spec) {\n return undefined;\n }\n\n return resolveInstalledBuiltInAgentLaunchForSpec(spec, options);\n}\n\nfunction resolveInstalledBuiltInAgentLaunchForSpec(\n spec: BuiltInAgentPackageSpec,\n options: BuiltInLaunchResolverOptions,\n): BuiltInAgentLaunch | undefined {\n const readFileSync = options.readFileSync ?? fs.readFileSync;\n const existsSync = options.existsSync ?? fs.existsSync;\n const resolvePackageRoot = options.resolvePackageRoot ?? defaultResolvePackageRoot;\n\n try {\n const resolved = resolveInstalledBuiltInAgentPackage(spec, {\n readFileSync,\n existsSync,\n resolvePackageRoot,\n });\n if (!resolved) {\n return undefined;\n }\n\n return {\n source: \"installed\",\n command: process.execPath,\n args: [resolved.binPath],\n packageName: spec.packageName,\n packageRange: spec.packageRange,\n packageVersion: resolved.packageVersion,\n binPath: resolved.binPath,\n };\n } catch {\n return undefined;\n }\n}\n\nfunction resolveInstalledBuiltInAgentPackage(\n spec: BuiltInAgentPackageSpec,\n options: Required<\n Pick<BuiltInLaunchResolverOptions, \"readFileSync\" | \"existsSync\" | \"resolvePackageRoot\">\n >,\n): { packageVersion?: string; binPath: string } | undefined {\n const packageRoot = options.resolvePackageRoot(spec.packageName);\n if (!packageRoot) {\n return undefined;\n }\n const manifest = JSON.parse(\n options.readFileSync(path.join(packageRoot, \"package.json\"), \"utf8\"),\n ) as {\n name?: string;\n version?: string;\n bin?: string | Record<string, string>;\n };\n if (manifest.name !== spec.packageName) {\n return undefined;\n }\n\n const relativeBinPath = resolvePackageBin(spec, manifest);\n if (!relativeBinPath) {\n return undefined;\n }\n\n const binPath = path.resolve(packageRoot, relativeBinPath);\n return options.existsSync(binPath) ? { packageVersion: manifest.version, binPath } : undefined;\n}\n\nexport function resolvePackageExecBuiltInAgentLaunch(\n agentCommand: string,\n options: BuiltInLaunchResolverOptions = {},\n): BuiltInAgentLaunch | undefined {\n const spec = findBuiltInAgentPackage(agentCommand);\n if (!spec) {\n return undefined;\n }\n\n const existsSync = options.existsSync ?? fs.existsSync;\n const execPath = options.execPath ?? process.execPath;\n const resolveNpmCliPath = options.resolveNpmCliPath ?? defaultResolveNpmCliPath;\n\n try {\n const npmCliPath = resolveNpmCliPath(execPath);\n if (!existsSync(npmCliPath)) {\n return undefined;\n }\n\n return {\n source: \"package-exec\",\n command: execPath,\n args: [\n npmCliPath,\n \"exec\",\n \"--yes\",\n `--package=${spec.packageName}@${spec.packageRange}`,\n \"--\",\n spec.preferredBinName,\n ],\n packageName: spec.packageName,\n packageRange: spec.packageRange,\n npmCliPath,\n };\n } catch {\n return undefined;\n }\n}\n\nexport function resolveBuiltInAgentLaunch(\n agentCommand: string,\n options: BuiltInLaunchResolverOptions = {},\n): BuiltInAgentLaunch | undefined {\n return (\n resolveInstalledBuiltInAgentLaunch(agentCommand, options) ??\n resolvePackageExecBuiltInAgentLaunch(agentCommand, options)\n );\n}\n\nexport function listBuiltInAgents(overrides?: Record<string, unknown>): string[] {\n return [...new Set([...Object.keys(AGENT_REGISTRY), ...Object.keys(overrides ?? {})])];\n}\n\nexport interface AcpAgentRegistry {\n resolve(agentName: string): string | string[];\n list(): string[];\n}\n\nexport type AcpInspectableAgentRegistry = AcpAgentRegistry & {\n inspect(agentId: string): AcpAgentInspection | undefined;\n};\n\nexport function createAgentRegistry(\n params?: {\n overrides?: Record<string, string | string[]>;\n } & AcpAgentInspectionOptions,\n): AcpInspectableAgentRegistry {\n const overrides = normalizeRegistryOverrides(params?.overrides);\n return {\n resolve(agentName: string) {\n const override = findAgentEntry(overrides, agentName);\n return override ?? resolveAgentArgv(agentName) ?? resolveAgentCommand(agentName);\n },\n list() {\n return listBuiltInAgents(overrides);\n },\n inspect(agentId) {\n const override = findAgentEntry(overrides, agentId);\n return inspectAgent(agentId, override, params);\n },\n };\n}\n\nfunction normalizeRegistryOverrides(\n values: Record<string, string | string[]> | undefined,\n): Record<string, string | string[]> {\n const entries: Array<[string, string | string[]]> = [];\n for (const [name, value] of Object.entries(values ?? {})) {\n const normalizedName = normalizeAgentName(name);\n if (!normalizedName) {\n continue;\n }\n const normalizedValue = normalizeRegistryOverride(value);\n if (normalizedValue) {\n entries.push([normalizedName, normalizedValue]);\n }\n }\n return Object.fromEntries(entries);\n}\n\nfunction normalizeRegistryOverride(value: string | string[]): string | string[] | undefined {\n if (typeof value === \"string\") {\n return value.trim() || undefined;\n }\n return value.length > 0 && value[0]?.length ? [...value] : undefined;\n}\n"],"mappings":";;;;;AAKA,MAAa,4BAA4B;AAGzC,eAAsB,iBACpB,SACA,MACA,UAII,CAAC,GACY;CACjB,MAAM,YAAY,KAAK,IAAI,GAAG,KAAK,MAAM,QAAQ,aAAA,GAAsC,CAAC;CACxF,OAAO,MAAM,IAAI,SAAiB,SAAS,WAAW;EACpD,IAAI,UAAU;EACd,IAAI;EACJ,MAAM,QAAQ,SACZ,SACA,CAAC,GAAG,IAAI,GACR;GACE,UAAU;GACV,WAAW,QAAQ,kBAAA;GACnB,YAAY;GACZ,aAAa,QAAQ;EACvB,IACC,OAAO,WAAW;GACjB,IAAI,SACF;GAEF,UAAU;GACV,IAAI,OACF,aAAa,KAAK;GAEpB,IAAI,OAAO;IACT,OAAO,KAAK;IACZ;GACF;GACA,QAAQ,MAAM;EAChB,CACF;EAEA,QAAQ,iBAAiB;GACvB,IAAI,SACF;GAEF,UAAU;GACV,MAAM,SAAS,MAAM,KAAK,SAAS;GACnC,MAAM,QAAQ,QAAQ;GACtB,MAAM,QAAQ,QAAQ;GACtB,MAAM,MAAM;GACZ,OACE,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S,CAAC,GAAG,KAAK,IAAI,KAAA;AAC7D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-DeNKZZcu.d.ts","names":[],"sources":["../src/async-control.ts","../src/acp/model-support.ts","../src/acp/client.ts"],"mappings":";;;KAcY;EACV,SAAS;EACT;;;;KCbU;EACV;EACA;EACA,iBAAiB;IACf;IACA;;;cAaS;KAED,4CAA4C;cAE3C;KAKD,0CAA0C;cAEzC,uCAAuC;WACzC;WACA,QAAQ;WACR;EAGP,YAAA,iBACA,QAAQ,iCACR;IAAY;;;iBAoBA,iCACd,iBACC,SAAS;;;KCmJP;EACH;EACA;EACA;;KAGU;EACV;EACA;EACA,gBAAgB;EAChB,SAAS;EACT;EACA;;KAGU;EACV;EACA,gBAAgB;EAChB,SAAS;EACT;EACA;;KAGU,sBAAsB;KA8B7B;KAqFO;EACV;EACA,QAAQ,OAAO;EACf;EACA,QAAQ;EACR;;KAGU;EACV;EACA;EACA;EACA,WAAW;;cA0CA;UACH;UACA;UACA;mBACS;mBACA;UACT;UACA;UACA;mBAQS;mBAMA;mBACA;UACT;UACA;UACA;UACA;UACA;UACA;mBACS;mBACA;mBACA;UACT;UAEA;UACA;UACA;UACA;mBACS;mBACA;EAEL,YAAA,SAAS;MAmCjB,oBAAoB;EAIxB;EAIA,sBAAsB;EAItB,6BAA6B;EAW7B;EAIA;EAIA;EAIA;EAIA,iBACE,UAAU,KACR;EAWJ;EAIA,qBAAqB;IACnB,iBAAiB;IACjB,4BAA4B;IAC5B,mBAAmB;IACnB;IACA;IACA;IACA;;UAuBM;UASA;UAcA;EASR,mBAAmB;EAInB,gBAAgB;EAUhB;UAIQ;EAWF,SAAS;UAwFD;UA6BN;UAiBM;UAcA;UAsDA;UAmBN;UAgEM;UAwBA;UAoBA;UA4BN;EAgBF,cAAc,eAAyB,QAAQ;EA8C/C,YAAY,mBAAmB,eAAyB,QAAQ;EAKhE,uBACJ,mBACA,cACA,UAAS,qBACR,QAAQ;EAgCL,cAAc,mBAAm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