@moxt-ai/mobius 0.0.71 → 0.0.72

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 (80) hide show
  1. package/dist/acp/acp-error.d.ts +17 -0
  2. package/dist/acp/acp-error.d.ts.map +1 -0
  3. package/dist/acp/acp-error.js +28 -0
  4. package/dist/acp/acp-error.js.map +1 -0
  5. package/dist/acp/codex/agent.d.ts +26 -0
  6. package/dist/acp/codex/agent.d.ts.map +1 -0
  7. package/dist/acp/codex/agent.js +397 -0
  8. package/dist/acp/codex/agent.js.map +1 -0
  9. package/dist/acp/codex/app-server-client.d.ts +45 -0
  10. package/dist/acp/codex/app-server-client.d.ts.map +1 -0
  11. package/dist/acp/codex/app-server-client.js +195 -0
  12. package/dist/acp/codex/app-server-client.js.map +1 -0
  13. package/dist/acp/codex/app-server-protocol.d.ts +191 -0
  14. package/dist/acp/codex/app-server-protocol.d.ts.map +1 -0
  15. package/dist/acp/codex/app-server-protocol.js +172 -0
  16. package/dist/acp/codex/app-server-protocol.js.map +1 -0
  17. package/dist/acp/codex/items.d.ts +17 -0
  18. package/dist/acp/codex/items.d.ts.map +1 -0
  19. package/dist/acp/codex/items.js +141 -0
  20. package/dist/acp/codex/items.js.map +1 -0
  21. package/dist/acp/in-process/acp-endpoint.d.ts +33 -0
  22. package/dist/acp/in-process/acp-endpoint.d.ts.map +1 -0
  23. package/dist/acp/in-process/acp-endpoint.js +2 -0
  24. package/dist/acp/in-process/acp-endpoint.js.map +1 -0
  25. package/dist/acp/session-manager.d.ts +4 -15
  26. package/dist/acp/session-manager.d.ts.map +1 -1
  27. package/dist/acp/session-manager.js +49 -35
  28. package/dist/acp/session-manager.js.map +1 -1
  29. package/dist/agent-catalog/acp-readiness-probe.d.ts +2 -2
  30. package/dist/agent-catalog/acp-readiness-probe.d.ts.map +1 -1
  31. package/dist/agent-catalog/acp-readiness-probe.js +55 -0
  32. package/dist/agent-catalog/acp-readiness-probe.js.map +1 -1
  33. package/dist/agent-catalog/agent-diagnostics.d.ts.map +1 -1
  34. package/dist/agent-catalog/agent-diagnostics.js +4 -1
  35. package/dist/agent-catalog/agent-diagnostics.js.map +1 -1
  36. package/dist/agent-catalog/agent-discovery.d.ts +4 -4
  37. package/dist/agent-catalog/agent-discovery.d.ts.map +1 -1
  38. package/dist/agent-catalog/agent-discovery.js.map +1 -1
  39. package/dist/agent-catalog/agent-settings-adapter.d.ts +8 -8
  40. package/dist/agent-catalog/agent-settings-adapter.d.ts.map +1 -1
  41. package/dist/agent-catalog/agent-settings-adapter.js.map +1 -1
  42. package/dist/agent-catalog/agent-specification.d.ts +21 -0
  43. package/dist/agent-catalog/agent-specification.d.ts.map +1 -1
  44. package/dist/agent-catalog/agent-specification.js +25 -0
  45. package/dist/agent-catalog/agent-specification.js.map +1 -1
  46. package/dist/agent-catalog/agents/codex-agent.d.ts +5 -9
  47. package/dist/agent-catalog/agents/codex-agent.d.ts.map +1 -1
  48. package/dist/agent-catalog/agents/codex-agent.js +9 -18
  49. package/dist/agent-catalog/agents/codex-agent.js.map +1 -1
  50. package/dist/agent-catalog/discover-agent.d.ts.map +1 -1
  51. package/dist/agent-catalog/discover-agent.js +11 -6
  52. package/dist/agent-catalog/discover-agent.js.map +1 -1
  53. package/dist/agent-catalog/executable-discovery.d.ts.map +1 -1
  54. package/dist/agent-catalog/executable-discovery.js +2 -2
  55. package/dist/agent-catalog/executable-discovery.js.map +1 -1
  56. package/dist/agent-catalog/local-agent.d.ts +25 -11
  57. package/dist/agent-catalog/local-agent.d.ts.map +1 -1
  58. package/dist/agent-catalog/local-agent.js +32 -12
  59. package/dist/agent-catalog/local-agent.js.map +1 -1
  60. package/dist/agent-installation/fixed-installation-executor.d.ts.map +1 -1
  61. package/dist/agent-installation/fixed-installation-executor.js +3 -1
  62. package/dist/agent-installation/fixed-installation-executor.js.map +1 -1
  63. package/dist/cli.js +5065 -4061
  64. package/dist/cli.js.map +4 -4
  65. package/dist/config.d.ts +5 -4
  66. package/dist/config.d.ts.map +1 -1
  67. package/dist/config.js.map +1 -1
  68. package/dist/index.js +1109 -105
  69. package/dist/index.js.map +4 -4
  70. package/dist/native-sessions/codex-history.d.ts +3 -3
  71. package/dist/native-sessions/codex-history.d.ts.map +1 -1
  72. package/dist/native-sessions/codex-history.js +1 -1
  73. package/dist/native-sessions/codex-history.js.map +1 -1
  74. package/dist/pairing/pair-local-machine.d.ts.map +1 -1
  75. package/dist/pairing/pair-local-machine.js.map +1 -1
  76. package/dist/run-daemon.js +1 -1
  77. package/dist/run-daemon.js.map +1 -1
  78. package/dist/runtime.js +8965 -7961
  79. package/dist/runtime.js.map +4 -4
  80. package/package.json +1 -1
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The typed error contract for the ACP execution boundary. It lives apart from the session manager so
3
+ * that endpoint implementations can report failures without depending on the manager that drives
4
+ * them.
5
+ */
6
+ export declare class AcpExecutionError extends Error {
7
+ readonly code: string;
8
+ constructor(message: string, options?: ErrorOptions, code?: string);
9
+ }
10
+ export declare class AcpConfigurationValueUnavailableError extends AcpExecutionError {
11
+ readonly configId: string;
12
+ readonly offeredValueCount: number;
13
+ readonly offeredValues: readonly string[];
14
+ readonly requestedValue: string;
15
+ constructor(configId: string, requestedValue: string, offeredValues: readonly string[]);
16
+ }
17
+ //# sourceMappingURL=acp-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-error.d.ts","sourceRoot":"","sources":["../../src/acp/acp-error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,YAAiB,EAAE,IAAI,SAAyB,EAIrF;CACJ;AAED,qBAAa,qCAAsC,SAAQ,iBAAiB;IACxE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAEhC,YAAY,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,MAAM,EAAE,EAOrF;CACJ"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The typed error contract for the ACP execution boundary. It lives apart from the session manager so
3
+ * that endpoint implementations can report failures without depending on the manager that drives
4
+ * them.
5
+ */
6
+ export class AcpExecutionError extends Error {
7
+ code;
8
+ constructor(message, options = {}, code = "acp_execution_failed") {
9
+ super(message, options);
10
+ this.code = code;
11
+ this.name = "AcpExecutionError";
12
+ }
13
+ }
14
+ export class AcpConfigurationValueUnavailableError extends AcpExecutionError {
15
+ configId;
16
+ offeredValueCount;
17
+ offeredValues;
18
+ requestedValue;
19
+ constructor(configId, requestedValue, offeredValues) {
20
+ super("The requested ACP configuration value is unavailable", {}, "invalid_session_configuration");
21
+ this.name = "AcpConfigurationValueUnavailableError";
22
+ this.configId = configId.slice(0, 128);
23
+ this.requestedValue = requestedValue.slice(0, 128);
24
+ this.offeredValueCount = offeredValues.length;
25
+ this.offeredValues = Object.freeze(offeredValues.slice(0, 32).map((value) => value.slice(0, 128)));
26
+ }
27
+ }
28
+ //# sourceMappingURL=acp-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acp-error.js","sourceRoot":"","sources":["../../src/acp/acp-error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;IAC/B,IAAI,CAAS;IAEtB,YAAY,OAAe,EAAE,OAAO,GAAiB,EAAE,EAAE,IAAI,GAAG,sBAAsB;QAClF,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IACpC,CAAC;CACJ;AAED,MAAM,OAAO,qCAAsC,SAAQ,iBAAiB;IAC/D,QAAQ,CAAS;IACjB,iBAAiB,CAAS;IAC1B,aAAa,CAAoB;IACjC,cAAc,CAAS;IAEhC,YAAY,QAAgB,EAAE,cAAsB,EAAE,aAAgC;QAClF,KAAK,CAAC,sDAAsD,EAAE,EAAE,EAAE,+BAA+B,CAAC,CAAC;QACnG,IAAI,CAAC,IAAI,GAAG,uCAAuC,CAAC;QACpD,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACvC,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACnD,IAAI,CAAC,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC;QAC9C,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;IACvG,CAAC;CACJ"}
@@ -0,0 +1,26 @@
1
+ import { type AgentApp } from "@agentclientprotocol/sdk";
2
+ import type { InProcessAcpEndpoint, InProcessAcpEndpointOptions } from "../in-process/acp-endpoint.ts";
3
+ /**
4
+ * One in-process Codex ACP agent: an ACP `AgentApp` bound to one `codex app-server` child process.
5
+ * Mobius connects its normal ACP client to this app in-process, so every ACP behavior the daemon
6
+ * relies on is produced here instead of by an adapter child process.
7
+ *
8
+ * Turn lifecycle: `session/prompt` maps to `turn/start`, whose response arrives before the turn
9
+ * finishes. Completion is therefore captured from the `turn/completed` notification, and `session/
10
+ * cancel` resolves the same completion with `stopReason: "cancelled"` so a cancelled turn never
11
+ * waits on a notification that may not arrive.
12
+ */
13
+ export declare class CodexAcpAgent implements InProcessAcpEndpoint {
14
+ #private;
15
+ constructor(options: InProcessAcpEndpointOptions);
16
+ /** The ACP agent app Mobius connects its own ACP client to, in-process. */
17
+ readonly app: () => AgentApp;
18
+ /** Starts the app-server and performs its handshake. */
19
+ readonly initialize: (signal: AbortSignal) => Promise<void>;
20
+ /**
21
+ * Releases the app-server and every process it started. Mirrors the adapter path's teardown so a
22
+ * cancelled or closed session cannot leak the tool subprocesses running under the app-server.
23
+ */
24
+ readonly close: () => Promise<void>;
25
+ }
26
+ //# sourceMappingURL=agent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/acp/codex/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,QAAQ,EAShB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,KAAK,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAyFvG;;;;;;;;;GASG;AACH,qBAAa,aAAc,YAAW,oBAAoB;;IAQtD,YAAY,OAAO,EAAE,2BAA2B,EAsD/C;IAED,2EAA2E;IAC3E,QAAQ,CAAC,GAAG,QAAO,QAAQ,CAAc;IAEzC,wDAAwD;IACxD,QAAQ,CAAC,UAAU,WAAkB,WAAW,KAAG,OAAO,CAAC,IAAI,CAAC,CAE9D;IAEF;;;OAGG;IACH,QAAQ,CAAC,KAAK,QAAa,OAAO,CAAC,IAAI,CAAC,CAKtC;CA2SL"}
@@ -0,0 +1,397 @@
1
+ import { agent as createAgentApp, methods, PROTOCOL_VERSION, } from "@agentclientprotocol/sdk";
2
+ import { captureProcessTree, stopProcessTree } from "../../process/executable.js";
3
+ import { AcpExecutionError } from "../acp-error.js";
4
+ import { CodexAppServerClient } from "./app-server-client.js";
5
+ import { commandApprovalParamsSchema, fileChangeApprovalParamsSchema, mcpElicitationParamsSchema, requestUserInputParamsSchema, threadStartResponseSchema, turnNotificationSchema, turnSchema, } from "./app-server-protocol.js";
6
+ import { agentMessageMeta, decodeThreadItem, toolCallUpdate } from "./items.js";
7
+ const APPROVAL_REASON_CHARACTER_LIMIT = 500;
8
+ const APPROVAL_TIMEOUT_MILLISECONDS = 3_600_000;
9
+ const CODEX_AGENT_VERSION = "0.154.0";
10
+ /** The choices Mobius offers when the app-server asks it to approve a local side effect. */
11
+ const APPROVAL_OPTIONS = Object.freeze([
12
+ { kind: "allow_once", name: "Allow once", optionId: "accept" },
13
+ { kind: "allow_always", name: "Allow for this session", optionId: "acceptForSession" },
14
+ { kind: "reject_once", name: "Deny", optionId: "decline" },
15
+ ]);
16
+ function permissionDecision(optionId) {
17
+ if (optionId === "accept" || optionId === "acceptForSession" || optionId === "decline") {
18
+ return optionId;
19
+ }
20
+ return "cancel";
21
+ }
22
+ /** Converts ACP prompt content into the app-server's `UserInput` list. */
23
+ function promptInput(prompt) {
24
+ const input = [];
25
+ for (const block of prompt) {
26
+ if (block.type === "text") {
27
+ input.push({ text: block.text, text_elements: [], type: "text" });
28
+ continue;
29
+ }
30
+ if (block.type === "image") {
31
+ input.push({ type: "image", url: `data:${block.mimeType};base64,${block.data}` });
32
+ continue;
33
+ }
34
+ if (block.type === "resource") {
35
+ const resource = block.resource;
36
+ input.push({
37
+ text: "text" in resource ? (resource.text ?? "") : "",
38
+ text_elements: [],
39
+ type: "text",
40
+ });
41
+ continue;
42
+ }
43
+ if (block.type === "resource_link") {
44
+ input.push({ text: `Resource: ${block.uri}`, text_elements: [], type: "text" });
45
+ }
46
+ }
47
+ return input;
48
+ }
49
+ function userInputSchema(questions) {
50
+ const properties = {};
51
+ const required = [];
52
+ for (const question of questions) {
53
+ required.push(question.id);
54
+ properties[question.id] = {
55
+ description: question.question,
56
+ title: question.header,
57
+ type: "string",
58
+ ...(question.options == null || question.options.length === 0
59
+ ? {}
60
+ : {
61
+ oneOf: question.options.map((option) => ({
62
+ const: option.label,
63
+ description: option.description,
64
+ title: option.label,
65
+ })),
66
+ }),
67
+ };
68
+ }
69
+ return { properties, required, type: "object" };
70
+ }
71
+ /**
72
+ * One in-process Codex ACP agent: an ACP `AgentApp` bound to one `codex app-server` child process.
73
+ * Mobius connects its normal ACP client to this app in-process, so every ACP behavior the daemon
74
+ * relies on is produced here instead of by an adapter child process.
75
+ *
76
+ * Turn lifecycle: `session/prompt` maps to `turn/start`, whose response arrives before the turn
77
+ * finishes. Completion is therefore captured from the `turn/completed` notification, and `session/
78
+ * cancel` resolves the same completion with `stopReason: "cancelled"` so a cancelled turn never
79
+ * waits on a notification that may not arrive.
80
+ */
81
+ export class CodexAcpAgent {
82
+ #app;
83
+ #appServer;
84
+ #connection = null;
85
+ #nativeSessionId = "";
86
+ #turn = null;
87
+ #updateTail = Promise.resolve();
88
+ constructor(options) {
89
+ this.#appServer = new CodexAppServerClient({
90
+ command: options.command,
91
+ cwd: options.cwd,
92
+ environment: options.environment,
93
+ handlers: {
94
+ onNotification: async (method, params) => {
95
+ await this.#onNotification(method, params);
96
+ },
97
+ onServerRequest: async (request) => {
98
+ await this.#onServerRequest(request);
99
+ },
100
+ },
101
+ });
102
+ this.#app = createAgentApp({ name: "mobius-codex" })
103
+ .onConnect((connection) => {
104
+ this.#connection = connection;
105
+ })
106
+ // Declare only what this Agent actually serves. Mobius gates every request on these bits,
107
+ // so an optimistic bit here becomes an unsupported ACP call at the far end. Session
108
+ // restore, listing, forking, and steering stay undeclared until they are implemented;
109
+ // the daemon's existing degradation paths handle their absence.
110
+ .onRequest(methods.agent.initialize, async () => ({
111
+ agentCapabilities: {
112
+ loadSession: false,
113
+ promptCapabilities: { embeddedContext: true, image: true },
114
+ sessionCapabilities: { close: {} },
115
+ },
116
+ agentInfo: { name: "Codex", version: CODEX_AGENT_VERSION },
117
+ authMethods: [],
118
+ protocolVersion: PROTOCOL_VERSION,
119
+ }))
120
+ .onRequest(methods.agent.session.new, async (context) => {
121
+ // Sandbox and approval policy stay with Codex's own configuration. Mobius reports the
122
+ // session it was given instead of imposing policy the user did not ask for.
123
+ const created = threadStartResponseSchema.parse(await this.#appServer.request("thread/start", { cwd: context.params.cwd }, AbortSignal.any([context.signal, AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS)])));
124
+ this.#nativeSessionId = created.thread.id;
125
+ return { sessionId: created.thread.id };
126
+ })
127
+ .onRequest(methods.agent.session.prompt, async (context) => {
128
+ return await this.#runTurn(promptInput(context.params.prompt), context.signal);
129
+ })
130
+ .onRequest(methods.agent.session.close, async () => {
131
+ await this.#interruptTurn();
132
+ })
133
+ .onNotification(methods.agent.session.cancel, async () => {
134
+ await this.#interruptTurn();
135
+ });
136
+ }
137
+ /** The ACP agent app Mobius connects its own ACP client to, in-process. */
138
+ app = () => this.#app;
139
+ /** Starts the app-server and performs its handshake. */
140
+ initialize = async (signal) => {
141
+ await this.#appServer.initialize(signal);
142
+ };
143
+ /**
144
+ * Releases the app-server and every process it started. Mirrors the adapter path's teardown so a
145
+ * cancelled or closed session cannot leak the tool subprocesses running under the app-server.
146
+ */
147
+ close = async () => {
148
+ const child = this.#appServer.child();
149
+ const captured = await captureProcessTree(child);
150
+ this.#appServer.detach();
151
+ await stopProcessTree(child, captured);
152
+ };
153
+ #emit = async (update) => {
154
+ const connection = this.#connection;
155
+ if (connection === null || this.#nativeSessionId.length === 0) {
156
+ return;
157
+ }
158
+ await connection.client.notify(methods.client.session.update, {
159
+ sessionId: this.#nativeSessionId,
160
+ update,
161
+ });
162
+ };
163
+ // Notifications are serialized so two app-server items cannot interleave into one ACP update
164
+ // stream, and the caller awaits the result: `turn/completed` must not resolve the prompt before
165
+ // the updates it precedes have reached the client.
166
+ #enqueue = async (operation) => {
167
+ const pending = this.#updateTail.then(operation, operation);
168
+ this.#updateTail = pending;
169
+ await pending;
170
+ };
171
+ #onNotification = async (method, params) => {
172
+ if (method === "turn/started") {
173
+ const decoded = turnNotificationSchema.safeParse(params);
174
+ if (decoded.success && decoded.data.threadId === this.#nativeSessionId && this.#turn !== null) {
175
+ this.#turn = { completion: this.#turn.completion, turn: { id: decoded.data.turn.id } };
176
+ }
177
+ return;
178
+ }
179
+ if (method === "turn/completed") {
180
+ const decoded = turnNotificationSchema.safeParse(params);
181
+ if (decoded.success && decoded.data.threadId === this.#nativeSessionId) {
182
+ await this.#completeTurn(decoded.data.turn);
183
+ }
184
+ return;
185
+ }
186
+ if (method === "thread/name/updated") {
187
+ const threadName = params.threadName;
188
+ if (typeof threadName === "string" && threadName.length > 0) {
189
+ await this.#enqueue(async () => {
190
+ await this.#emit({ sessionUpdate: "session_info_update", title: threadName });
191
+ });
192
+ }
193
+ return;
194
+ }
195
+ if (method === "turn/plan/updated") {
196
+ const plan = params.plan;
197
+ if (Array.isArray(plan) && params.threadId === this.#nativeSessionId) {
198
+ const entries = plan.map((step) => ({
199
+ content: typeof step === "object" && step !== null && "step" in step
200
+ ? String(Reflect.get(step, "step"))
201
+ : "",
202
+ priority: "medium",
203
+ status: "in_progress",
204
+ }));
205
+ await this.#enqueue(async () => {
206
+ await this.#emit({ entries, sessionUpdate: "plan" });
207
+ });
208
+ }
209
+ return;
210
+ }
211
+ if (method !== "item/started" && method !== "item/completed") {
212
+ return;
213
+ }
214
+ const item = decodeThreadItem(params.item);
215
+ if (item === null) {
216
+ return;
217
+ }
218
+ if (item.type === "agentMessage") {
219
+ // An item/completed agent message carries the whole text and would duplicate the deltas
220
+ // already streamed for the same item.
221
+ if (method === "item/started") {
222
+ return;
223
+ }
224
+ await this.#enqueue(async () => {
225
+ await this.#emit({
226
+ _meta: agentMessageMeta(item.phase),
227
+ content: { text: item.text, type: "text" },
228
+ messageId: item.id,
229
+ sessionUpdate: "agent_message_chunk",
230
+ });
231
+ });
232
+ return;
233
+ }
234
+ const update = toolCallUpdate(item);
235
+ if (update !== null) {
236
+ await this.#enqueue(async () => {
237
+ await this.#emit({ ...update, sessionUpdate: "tool_call_update" });
238
+ });
239
+ }
240
+ };
241
+ #onServerRequest = async (request) => {
242
+ if (request.method === "item/commandExecution/requestApproval" ||
243
+ request.method === "item/fileChange/requestApproval") {
244
+ await this.#requestApproval(request);
245
+ return;
246
+ }
247
+ if (request.method === "item/tool/requestUserInput") {
248
+ await this.#requestUserInput(request);
249
+ return;
250
+ }
251
+ if (request.method === "mcpServer/elicitation/request") {
252
+ await this.#requestMcpElicitation(request);
253
+ return;
254
+ }
255
+ // Mobius did not opt into these capabilities. Answering an error keeps the conversation
256
+ // honest instead of letting the app-server wait on a request nobody will handle.
257
+ this.#appServer.respondWithError(request.id, -32_601, `Mobius does not support ${request.method}`);
258
+ };
259
+ #askPermission = async (title, toolCallId, signal) => {
260
+ const connection = this.#connection;
261
+ if (connection === null) {
262
+ return "cancel";
263
+ }
264
+ const response = await connection.client.request(methods.client.session.requestPermission, {
265
+ options: [...APPROVAL_OPTIONS],
266
+ sessionId: this.#nativeSessionId,
267
+ toolCall: { title, toolCallId },
268
+ }, { cancellationSignal: signal });
269
+ return response.outcome.outcome === "selected" ? permissionDecision(response.outcome.optionId) : "cancel";
270
+ };
271
+ #requestApproval = async (request) => {
272
+ const decoded = request.method === "item/commandExecution/requestApproval"
273
+ ? commandApprovalParamsSchema.safeParse(request.params)
274
+ : fileChangeApprovalParamsSchema.safeParse(request.params);
275
+ if (!decoded.success) {
276
+ this.#appServer.respondWithError(request.id, -32_602, "Mobius could not read the approval request");
277
+ return;
278
+ }
279
+ const params = decoded.data;
280
+ const command = "command" in params ? params.command : undefined;
281
+ const title = (command ?? params.reason ?? "Approve a local change").slice(0, APPROVAL_REASON_CHARACTER_LIMIT);
282
+ const turn = this.#turn;
283
+ const decision = await this.#askPermission(title, params.itemId, AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS));
284
+ void turn;
285
+ this.#appServer.respond(request.id, { decision });
286
+ };
287
+ #requestUserInput = async (request) => {
288
+ const decoded = requestUserInputParamsSchema.safeParse(request.params);
289
+ const connection = this.#connection;
290
+ if (!decoded.success || connection === null) {
291
+ this.#appServer.respond(request.id, { answers: {} });
292
+ return;
293
+ }
294
+ const questions = decoded.data.questions;
295
+ const response = await connection.client.request(methods.client.elicitation.create, {
296
+ message: questions
297
+ .map((question) => question.question)
298
+ .join("\n\n")
299
+ .slice(0, 2_000),
300
+ mode: "form",
301
+ requestedSchema: userInputSchema(questions),
302
+ sessionId: this.#nativeSessionId,
303
+ ...(decoded.data.itemId == null ? {} : { toolCallId: decoded.data.itemId }),
304
+ }, { cancellationSignal: AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS) });
305
+ const content = response.action === "accept" ? Reflect.get(response, "content") : undefined;
306
+ const answers = {};
307
+ for (const question of questions) {
308
+ const value = typeof content === "object" && content !== null ? Reflect.get(content, question.id) : undefined;
309
+ answers[question.id] = { answers: typeof value === "string" && value.length > 0 ? [value] : [] };
310
+ }
311
+ this.#appServer.respond(request.id, { answers });
312
+ };
313
+ #requestMcpElicitation = async (request) => {
314
+ const decoded = mcpElicitationParamsSchema.safeParse(request.params);
315
+ const connection = this.#connection;
316
+ if (!decoded.success || connection === null) {
317
+ this.#appServer.respondWithError(request.id, -32_602, "Mobius could not read the elicitation request");
318
+ return;
319
+ }
320
+ const params = decoded.data;
321
+ const signal = AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS);
322
+ if (params.mode === "url" && params.url !== undefined) {
323
+ const response = await connection.client.request(methods.client.elicitation.create, {
324
+ elicitationId: `${this.#nativeSessionId}-${String(request.id)}`,
325
+ message: params.message,
326
+ mode: "url",
327
+ sessionId: this.#nativeSessionId,
328
+ url: params.url,
329
+ }, { cancellationSignal: signal });
330
+ this.#appServer.respond(request.id, { action: response.action });
331
+ return;
332
+ }
333
+ const response = await connection.client.request(methods.client.elicitation.create, {
334
+ message: params.message,
335
+ mode: "form",
336
+ requestedSchema: params.requestedSchema ?? { properties: {}, required: [], type: "object" },
337
+ sessionId: this.#nativeSessionId,
338
+ }, { cancellationSignal: signal });
339
+ const content = response.action === "accept" ? (Reflect.get(response, "content") ?? null) : null;
340
+ this.#appServer.respond(request.id, { action: response.action, content });
341
+ };
342
+ #runTurn = async (input, signal) => {
343
+ if (this.#turn !== null) {
344
+ throw new AcpExecutionError("Another prompt is already running in this conversation", {}, "session_busy");
345
+ }
346
+ const completion = Promise.withResolvers();
347
+ // The turn is armed before `turn/start` is sent: a short turn can complete before its own
348
+ // response arrives, and a completion for an unarmed turn would be lost.
349
+ const turn = { completion, turn: { id: "" } };
350
+ this.#turn = turn;
351
+ try {
352
+ const started = turnSchema.parse((await this.#appServer.request("turn/start", { input, threadId: this.#nativeSessionId }, signal)).turn);
353
+ if (this.#turn === turn) {
354
+ turn.turn.id = started.id;
355
+ }
356
+ return await completion.promise;
357
+ }
358
+ finally {
359
+ if (this.#turn === turn) {
360
+ this.#turn = null;
361
+ }
362
+ }
363
+ };
364
+ #interruptTurn = async () => {
365
+ const turn = this.#turn;
366
+ if (turn === null) {
367
+ return;
368
+ }
369
+ this.#turn = null;
370
+ if (turn.turn.id.length > 0) {
371
+ try {
372
+ await this.#appServer.request("turn/interrupt", { threadId: this.#nativeSessionId, turnId: turn.turn.id }, AbortSignal.timeout(APPROVAL_TIMEOUT_MILLISECONDS));
373
+ }
374
+ catch {
375
+ // Turn completion below remains authoritative.
376
+ }
377
+ }
378
+ turn.completion.resolve({ stopReason: "cancelled" });
379
+ };
380
+ #completeTurn = async (turn) => {
381
+ const active = this.#turn;
382
+ if (active === null) {
383
+ return;
384
+ }
385
+ this.#turn = null;
386
+ // The app-server dispatches notifications concurrently, so an item update can still be in
387
+ // flight when the turn completes. Drain it: a client must never see the turn finish before
388
+ // the activity that belongs to it.
389
+ await this.#updateTail;
390
+ if (turn.status === "failed") {
391
+ active.completion.reject(new AcpExecutionError(turn.error?.message ?? "The Codex turn failed", {}, "codex_turn_failed"));
392
+ return;
393
+ }
394
+ active.completion.resolve({ stopReason: turn.status === "interrupted" ? "cancelled" : "end_turn" });
395
+ };
396
+ }
397
+ //# sourceMappingURL=agent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../src/acp/codex/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,KAAK,IAA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,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,IAAI,CAAC;gBACD,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CACzB,gBAAgB,EAChB,EAAE,QAAQ,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,EACzD,WAAW,CAAC,OAAO,CAAC,6BAA6B,CAAC,CACrD,CAAC;YACN,CAAC;YAAC,MAAM,CAAC;gBACL,+CAA+C;YACnD,CAAC;QACL,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC,CAAC;IACzD,CAAC,CAAC;IAEO,aAAa,GAAG,KAAK,EAAE,IAG/B,EAAiB,EAAE;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;QAC1B,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO;QACX,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,0FAA0F;QAC1F,2FAA2F;QAC3F,mCAAmC;QACnC,MAAM,IAAI,CAAC,WAAW,CAAC;QACvB,IAAI,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC3B,MAAM,CAAC,UAAU,CAAC,MAAM,CACpB,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,IAAI,uBAAuB,EAAE,EAAE,EAAE,mBAAmB,CAAC,CACjG,CAAC;YACF,OAAO;QACX,CAAC;QACD,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,KAAK,aAAa,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC;IACxG,CAAC,CAAC;CACL"}
@@ -0,0 +1,45 @@
1
+ import { type ChildProcess } from "node:child_process";
2
+ /** A failure in the Codex app-server boundary, reported with a stable code. */
3
+ export declare class CodexAppServerError extends Error {
4
+ readonly code: string;
5
+ constructor(code: string, message: string, options?: ErrorOptions);
6
+ }
7
+ /** A request the app-server addressed to Mobius, which Mobius must answer by id. */
8
+ export interface CodexAppServerServerRequest {
9
+ readonly id: number | string;
10
+ readonly method: string;
11
+ readonly params: unknown;
12
+ }
13
+ export interface CodexAppServerHandlers {
14
+ readonly onNotification: (method: string, params: unknown) => Promise<void>;
15
+ readonly onServerRequest: (request: CodexAppServerServerRequest) => Promise<void>;
16
+ }
17
+ export interface CodexAppServerOptions {
18
+ readonly command: string;
19
+ readonly cwd: string;
20
+ readonly environment: Readonly<Record<string, string>>;
21
+ readonly handlers: CodexAppServerHandlers;
22
+ }
23
+ /**
24
+ * Owns one `codex app-server` child process and the newline-delimited JSON-RPC conversation over its
25
+ * stdio. The app-server omits the `jsonrpc` field on the wire in both directions.
26
+ */
27
+ export declare class CodexAppServerClient {
28
+ #private;
29
+ constructor(options: CodexAppServerOptions);
30
+ readonly child: () => ChildProcess;
31
+ /** Sends a request and waits for its response, bounded by the caller's cancellation signal. */
32
+ readonly request: (method: string, params: unknown, signal: AbortSignal) => Promise<unknown>;
33
+ readonly notify: (method: string, params: unknown) => void;
34
+ readonly respond: (id: number | string, result: unknown) => void;
35
+ readonly respondWithError: (id: number | string, code: number, message: string) => void;
36
+ /** Performs the `initialize` / `initialized` handshake. */
37
+ readonly initialize: (signal: AbortSignal) => Promise<void>;
38
+ /**
39
+ * Rejects every in-flight request and marks the conversation closed without waiting on the
40
+ * process. Process teardown stays with the caller, which owns the process tree: it stops the
41
+ * app-server and every tool subprocess it started.
42
+ */
43
+ readonly detach: () => void;
44
+ }
45
+ //# sourceMappingURL=app-server-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-server-client.d.ts","sourceRoot":"","sources":["../../../src/acp/codex/app-server-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAS,MAAM,oBAAoB,CAAC;AAO9D,+EAA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