@moxxy/plugin-provider-codex-agent 0.0.0-stage → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/account-limit.d.ts +11 -0
- package/dist/account-limit.d.ts.map +1 -0
- package/dist/account-limit.js +24 -0
- package/dist/account-limit.js.map +1 -0
- package/dist/agent-provider.d.ts +62 -0
- package/dist/agent-provider.d.ts.map +1 -0
- package/dist/agent-provider.js +209 -0
- package/dist/agent-provider.js.map +1 -0
- package/dist/codex-session.d.ts +220 -0
- package/dist/codex-session.d.ts.map +1 -0
- package/dist/codex-session.js +1113 -0
- package/dist/codex-session.js.map +1 -0
- package/dist/constants.d.ts +15 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +15 -0
- package/dist/constants.js.map +1 -0
- package/dist/executable.d.ts +16 -0
- package/dist/executable.d.ts.map +1 -0
- package/dist/executable.js +43 -0
- package/dist/executable.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +79 -0
- package/dist/index.js.map +1 -0
- package/dist/login.d.ts +37 -0
- package/dist/login.d.ts.map +1 -0
- package/dist/login.js +127 -0
- package/dist/login.js.map +1 -0
- package/dist/offered-models.d.ts +12 -0
- package/dist/offered-models.d.ts.map +1 -0
- package/dist/offered-models.js +53 -0
- package/dist/offered-models.js.map +1 -0
- package/dist/own-settings.d.ts +9 -0
- package/dist/own-settings.d.ts.map +1 -0
- package/dist/own-settings.js +34 -0
- package/dist/own-settings.js.map +1 -0
- package/dist/protocol.d.ts +279 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +30 -0
- package/dist/protocol.js.map +1 -0
- package/dist/subagents.d.ts +20 -0
- package/dist/subagents.d.ts.map +1 -0
- package/dist/subagents.js +90 -0
- package/dist/subagents.js.map +1 -0
- package/dist/translate.d.ts +87 -0
- package/dist/translate.d.ts.map +1 -0
- package/dist/translate.js +334 -0
- package/dist/translate.js.map +1 -0
- package/dist/view-image.d.ts +4 -0
- package/dist/view-image.d.ts.map +1 -0
- package/dist/view-image.js +47 -0
- package/dist/view-image.js.map +1 -0
- package/package.json +82 -3
- package/src/account-limit.ts +25 -0
- package/src/agent-cli.test.ts +76 -0
- package/src/agent-provider.test.ts +1556 -0
- package/src/agent-provider.ts +234 -0
- package/src/codex-session.ts +1258 -0
- package/src/constants.ts +18 -0
- package/src/event-coverage.test.ts +200 -0
- package/src/executable.test.ts +53 -0
- package/src/executable.ts +49 -0
- package/src/fake-codex.testkit.ts +576 -0
- package/src/fixtures/codex-app-server-0.155.1.json +122 -0
- package/src/fixtures/codex-app-server-0.163.0.json +125 -0
- package/src/fixtures/codex-model-list-0.163.0.json +436 -0
- package/src/index.test.ts +45 -0
- package/src/index.ts +99 -0
- package/src/login.test.ts +93 -0
- package/src/login.ts +167 -0
- package/src/offered-models.test.ts +87 -0
- package/src/offered-models.ts +65 -0
- package/src/own-settings.test.ts +45 -0
- package/src/own-settings.ts +39 -0
- package/src/protocol.ts +256 -0
- package/src/subagents.test.ts +47 -0
- package/src/subagents.ts +98 -0
- package/src/translate.test.ts +160 -0
- package/src/translate.ts +362 -0
- package/src/view-image.test.ts +29 -0
- package/src/view-image.ts +47 -0
- package/README.md +0 -3
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the person's own Codex runs, read without starting a thread: a
|
|
3
|
+
* short-lived `codex app-server` answers `config/read` for the folder (the
|
|
4
|
+
* effective config, profiles and project config included) and is closed.
|
|
5
|
+
*/
|
|
6
|
+
import { JsonRpcLineClient } from '@moxxy/agent-connection-kit';
|
|
7
|
+
/** Codex answers in well under a second; one stuck on startup is not waited on longer. */
|
|
8
|
+
const OWN_SETTINGS_TIMEOUT_MS = 15_000;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the person's own Codex runs in `cwd` with no approvals and full
|
|
11
|
+
* access, as Moxxy's auto-approve does; `undefined` when Codex cannot say.
|
|
12
|
+
*/
|
|
13
|
+
export async function codexOwnAutoApprove(cwd, start, opts = {}) {
|
|
14
|
+
let connection;
|
|
15
|
+
let client;
|
|
16
|
+
const timer = setTimeout(() => client?.close(new Error('Codex did not answer in time.')), opts.timeoutMs ?? OWN_SETTINGS_TIMEOUT_MS);
|
|
17
|
+
try {
|
|
18
|
+
connection = await start({ cwd });
|
|
19
|
+
client = new JsonRpcLineClient({ readable: connection.readable, writable: connection.writable });
|
|
20
|
+
await client.request('initialize', { clientInfo: { name: 'moxxy', title: 'Moxxy', version: '1' }, capabilities: { experimentalApi: true } });
|
|
21
|
+
client.notify('initialized');
|
|
22
|
+
const { config } = await client.request('config/read', { cwd });
|
|
23
|
+
return config.approval_policy === 'never' && config.sandbox_mode === 'danger-full-access';
|
|
24
|
+
}
|
|
25
|
+
catch {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
finally {
|
|
29
|
+
clearTimeout(timer);
|
|
30
|
+
client?.close();
|
|
31
|
+
connection?.close();
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=own-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"own-settings.js","sourceRoot":"","sources":["../src/own-settings.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAIhE,0FAA0F;AAC1F,MAAM,uBAAuB,GAAG,MAAM,CAAC;AAEvC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,GAAW,EACX,KAA0B,EAC1B,OAAwC,EAAE;IAE1C,IAAI,UAAgE,CAAC;IACrE,IAAI,MAAqC,CAAC;IAC1C,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,IAAI,uBAAuB,CAAC,CAAC;IACrI,IAAI,CAAC;QACH,UAAU,GAAG,MAAM,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC;QAClC,MAAM,GAAG,IAAI,iBAAiB,CAAC,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC;QACjG,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,UAAU,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,YAAY,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC;QAC7I,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;QAC7B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,OAAO,CAAkB,aAAa,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;QACjF,OAAO,MAAM,CAAC,eAAe,KAAK,OAAO,IAAI,MAAM,CAAC,YAAY,KAAK,oBAAoB,CAAC;IAC5F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,SAAS,CAAC;IACnB,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACpB,MAAM,EAAE,KAAK,EAAE,CAAC;QAChB,UAAU,EAAE,KAAK,EAAE,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The part of the `codex app-server` protocol Moxxy speaks, written by hand
|
|
3
|
+
* from `codex app-server generate-ts` (0.155.1, checked against 0.163.0). Codex sends far more than
|
|
4
|
+
* this; anything not listed here is read as unknown and left alone.
|
|
5
|
+
*/
|
|
6
|
+
export type CodexApprovalPolicy = 'untrusted' | 'on-request' | 'never' | {
|
|
7
|
+
readonly granular: Readonly<Record<string, boolean>>;
|
|
8
|
+
};
|
|
9
|
+
export type CodexSandboxPolicy = {
|
|
10
|
+
readonly type: 'dangerFullAccess';
|
|
11
|
+
} | {
|
|
12
|
+
readonly type: 'readOnly';
|
|
13
|
+
readonly networkAccess?: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
readonly type: 'workspaceWrite';
|
|
16
|
+
readonly [key: string]: unknown;
|
|
17
|
+
} | {
|
|
18
|
+
readonly type: 'externalSandbox';
|
|
19
|
+
readonly [key: string]: unknown;
|
|
20
|
+
};
|
|
21
|
+
/** The thread's settings in `thread/settings/updated` (only what Moxxy reads). */
|
|
22
|
+
export interface CodexThreadSettingsReport {
|
|
23
|
+
readonly approvalPolicy: CodexApprovalPolicy;
|
|
24
|
+
readonly approvalsReviewer: CodexApprovalsReviewer;
|
|
25
|
+
readonly sandboxPolicy: CodexSandboxPolicy;
|
|
26
|
+
}
|
|
27
|
+
/** What `thread/start` and `thread/resume` answer: the thread as Codex really runs it. */
|
|
28
|
+
export interface CodexThreadResponse {
|
|
29
|
+
readonly thread: {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
};
|
|
32
|
+
readonly model: string;
|
|
33
|
+
readonly approvalPolicy: CodexApprovalPolicy;
|
|
34
|
+
readonly sandbox: CodexSandboxPolicy;
|
|
35
|
+
readonly approvalsReviewer?: CodexApprovalsReviewer;
|
|
36
|
+
readonly reasoningEffort: string | null;
|
|
37
|
+
readonly serviceTier?: string | null;
|
|
38
|
+
}
|
|
39
|
+
/** Who answers Codex's approvals: the person, or Codex's own reviewer. */
|
|
40
|
+
export type CodexApprovalsReviewer = 'user' | 'auto_review' | 'guardian_subagent';
|
|
41
|
+
/** What `config/read` answers: the person's effective Codex config, as far as Moxxy reads it. */
|
|
42
|
+
/** The person's Codex config as `config/read` reports it for the folder (only what Moxxy reads). */
|
|
43
|
+
/** `skills/list`: the skills Codex has where each folder asked for runs (generated `SkillsListResponse`, fields Moxxy reads). */
|
|
44
|
+
export interface CodexSkillsList {
|
|
45
|
+
readonly data: ReadonlyArray<{
|
|
46
|
+
readonly cwd: string;
|
|
47
|
+
readonly skills: ReadonlyArray<{
|
|
48
|
+
readonly name: string;
|
|
49
|
+
readonly description: string;
|
|
50
|
+
readonly enabled: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* `thread/backgroundTerminals/list` (experimental, 0.155.1 and later): the
|
|
56
|
+
* commands still running in a thread, by the item that started them. An
|
|
57
|
+
* interrupted turn's commands stay here until `terminate` ends them.
|
|
58
|
+
*/
|
|
59
|
+
export interface CodexBackgroundTerminals {
|
|
60
|
+
readonly data: ReadonlyArray<{
|
|
61
|
+
readonly itemId: string;
|
|
62
|
+
readonly processId: string;
|
|
63
|
+
}>;
|
|
64
|
+
readonly nextCursor: string | null;
|
|
65
|
+
}
|
|
66
|
+
export interface CodexConfigRead {
|
|
67
|
+
readonly config: {
|
|
68
|
+
readonly model_reasoning_summary?: string | null;
|
|
69
|
+
readonly approval_policy?: CodexApprovalPolicy | null;
|
|
70
|
+
readonly sandbox_mode?: 'read-only' | 'workspace-write' | 'danger-full-access' | null;
|
|
71
|
+
readonly sandbox_workspace_write?: {
|
|
72
|
+
readonly writable_roots: ReadonlyArray<string>;
|
|
73
|
+
readonly network_access: boolean;
|
|
74
|
+
readonly exclude_tmpdir_env_var: boolean;
|
|
75
|
+
readonly exclude_slash_tmp: boolean;
|
|
76
|
+
} | null;
|
|
77
|
+
readonly approvals_reviewer?: CodexApprovalsReviewer | null;
|
|
78
|
+
readonly tools?: {
|
|
79
|
+
readonly update_plan?: {
|
|
80
|
+
readonly enabled?: boolean;
|
|
81
|
+
} | null;
|
|
82
|
+
} | null;
|
|
83
|
+
/** The person's own MCP servers, by name. */
|
|
84
|
+
readonly mcp_servers?: Readonly<Record<string, {
|
|
85
|
+
readonly enabled?: boolean;
|
|
86
|
+
}>> | null;
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
/** `model/list`: one page of the models Codex offers the account (generated `ModelListResponse`, fields Moxxy reads). */
|
|
90
|
+
export interface CodexModelList {
|
|
91
|
+
readonly data: ReadonlyArray<{
|
|
92
|
+
readonly id: string;
|
|
93
|
+
readonly hidden?: boolean;
|
|
94
|
+
readonly inputModalities?: ReadonlyArray<string>;
|
|
95
|
+
readonly supportedReasoningEfforts?: ReadonlyArray<unknown>;
|
|
96
|
+
readonly additionalSpeedTiers?: ReadonlyArray<string>;
|
|
97
|
+
}>;
|
|
98
|
+
readonly nextCursor?: string | null;
|
|
99
|
+
}
|
|
100
|
+
export type CodexUserInput = {
|
|
101
|
+
readonly type: 'text';
|
|
102
|
+
readonly text: string;
|
|
103
|
+
readonly text_elements: ReadonlyArray<never>;
|
|
104
|
+
} | {
|
|
105
|
+
readonly type: 'image';
|
|
106
|
+
readonly url: string;
|
|
107
|
+
} | {
|
|
108
|
+
readonly type: 'localImage';
|
|
109
|
+
readonly path: string;
|
|
110
|
+
};
|
|
111
|
+
export type CodexCollaborationMode = {
|
|
112
|
+
readonly mode: 'plan' | 'default';
|
|
113
|
+
readonly settings: {
|
|
114
|
+
readonly model: string;
|
|
115
|
+
readonly reasoning_effort: string | null;
|
|
116
|
+
readonly developer_instructions: null;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
/** Fields of `thread/settings/update`; each applies to the thread's later turns. */
|
|
120
|
+
export interface CodexThreadSettings {
|
|
121
|
+
readonly approvalPolicy?: CodexApprovalPolicy;
|
|
122
|
+
readonly sandboxPolicy?: CodexSandboxPolicy;
|
|
123
|
+
readonly model?: string;
|
|
124
|
+
readonly effort?: string;
|
|
125
|
+
readonly collaborationMode?: CodexCollaborationMode;
|
|
126
|
+
}
|
|
127
|
+
export type CodexTurnStatus = 'completed' | 'interrupted' | 'failed' | 'inProgress';
|
|
128
|
+
export interface CodexTurn {
|
|
129
|
+
readonly id: string;
|
|
130
|
+
readonly status: CodexTurnStatus;
|
|
131
|
+
/** `codexErrorInfo` is Codex's code for the failure: a string (`usageLimitExceeded`) or an object for some. */
|
|
132
|
+
readonly error?: {
|
|
133
|
+
readonly message: string;
|
|
134
|
+
readonly codexErrorInfo?: unknown;
|
|
135
|
+
} | null;
|
|
136
|
+
}
|
|
137
|
+
/** `resetsAt` is in epoch seconds. */
|
|
138
|
+
export interface CodexRateLimitWindow {
|
|
139
|
+
readonly usedPercent: number;
|
|
140
|
+
readonly windowDurationMins: number | null;
|
|
141
|
+
readonly resetsAt: number | null;
|
|
142
|
+
}
|
|
143
|
+
/** `account/rateLimits/updated`: a sparse update, where a missing window keeps the one seen before. */
|
|
144
|
+
export interface CodexRateLimitSnapshot {
|
|
145
|
+
readonly primary?: CodexRateLimitWindow | null;
|
|
146
|
+
readonly secondary?: CodexRateLimitWindow | null;
|
|
147
|
+
readonly rateLimitReachedType?: string | null;
|
|
148
|
+
}
|
|
149
|
+
export type CodexGoalStatus = 'active' | 'paused' | 'blocked' | 'usageLimited' | 'budgetLimited' | 'complete';
|
|
150
|
+
export interface CodexGoal {
|
|
151
|
+
readonly objective: string;
|
|
152
|
+
readonly status: CodexGoalStatus;
|
|
153
|
+
}
|
|
154
|
+
/** A question Codex's plan mode asks inside its message (`delivery: 'async'`). */
|
|
155
|
+
export interface CodexAsyncQuestion {
|
|
156
|
+
readonly title: string;
|
|
157
|
+
readonly options: ReadonlyArray<string> | null;
|
|
158
|
+
}
|
|
159
|
+
export type CodexItem = {
|
|
160
|
+
readonly type: 'agentMessage';
|
|
161
|
+
readonly id: string;
|
|
162
|
+
readonly text: string;
|
|
163
|
+
readonly phase?: string | null;
|
|
164
|
+
readonly delivery?: 'async' | null;
|
|
165
|
+
readonly questions?: ReadonlyArray<CodexAsyncQuestion> | null;
|
|
166
|
+
} | {
|
|
167
|
+
readonly type: 'plan';
|
|
168
|
+
readonly id: string;
|
|
169
|
+
readonly text: string;
|
|
170
|
+
} | {
|
|
171
|
+
readonly type: 'reasoning';
|
|
172
|
+
readonly id: string;
|
|
173
|
+
readonly summary: ReadonlyArray<string>;
|
|
174
|
+
readonly content: ReadonlyArray<string>;
|
|
175
|
+
} | {
|
|
176
|
+
readonly type: 'commandExecution';
|
|
177
|
+
readonly id: string;
|
|
178
|
+
readonly command: string;
|
|
179
|
+
readonly cwd: string;
|
|
180
|
+
readonly status: string;
|
|
181
|
+
readonly aggregatedOutput: string | null;
|
|
182
|
+
readonly exitCode: number | null;
|
|
183
|
+
readonly commandActions?: ReadonlyArray<{
|
|
184
|
+
readonly command?: string;
|
|
185
|
+
}>;
|
|
186
|
+
} | {
|
|
187
|
+
readonly type: 'fileChange';
|
|
188
|
+
readonly id: string;
|
|
189
|
+
readonly status: string;
|
|
190
|
+
readonly changes: ReadonlyArray<CodexFileChange>;
|
|
191
|
+
} | {
|
|
192
|
+
readonly type: 'mcpToolCall';
|
|
193
|
+
readonly id: string;
|
|
194
|
+
readonly server: string;
|
|
195
|
+
readonly tool: string;
|
|
196
|
+
readonly status: string;
|
|
197
|
+
readonly arguments: unknown;
|
|
198
|
+
readonly result: unknown;
|
|
199
|
+
readonly error: {
|
|
200
|
+
readonly message: string;
|
|
201
|
+
} | null;
|
|
202
|
+
} | {
|
|
203
|
+
readonly type: 'webSearch';
|
|
204
|
+
readonly id: string;
|
|
205
|
+
readonly query: string;
|
|
206
|
+
readonly action?: CodexWebSearchAction | null;
|
|
207
|
+
} | {
|
|
208
|
+
readonly type: 'imageView';
|
|
209
|
+
readonly id: string;
|
|
210
|
+
readonly path: string;
|
|
211
|
+
} | {
|
|
212
|
+
readonly type: 'sleep';
|
|
213
|
+
readonly id: string;
|
|
214
|
+
readonly durationMs: number;
|
|
215
|
+
} | {
|
|
216
|
+
readonly type: 'imageGeneration';
|
|
217
|
+
readonly id: string;
|
|
218
|
+
readonly status: string;
|
|
219
|
+
readonly revisedPrompt: string | null;
|
|
220
|
+
/** The picture, base64. */
|
|
221
|
+
readonly result: string;
|
|
222
|
+
readonly failure: {
|
|
223
|
+
readonly type: string;
|
|
224
|
+
} | null;
|
|
225
|
+
readonly savedPath?: string;
|
|
226
|
+
};
|
|
227
|
+
export type CodexWebSearchAction = {
|
|
228
|
+
readonly type: 'search';
|
|
229
|
+
readonly query?: string;
|
|
230
|
+
readonly queries?: ReadonlyArray<string>;
|
|
231
|
+
} | {
|
|
232
|
+
readonly type: 'open_page';
|
|
233
|
+
readonly url?: string;
|
|
234
|
+
} | {
|
|
235
|
+
readonly type: 'find_in_page';
|
|
236
|
+
readonly url?: string;
|
|
237
|
+
readonly pattern?: string;
|
|
238
|
+
} | {
|
|
239
|
+
readonly type: 'other';
|
|
240
|
+
};
|
|
241
|
+
/** One file of a `fileChange`: for `add` the diff is the new content, for `update` a unified diff; `move_path` names where an update moved it. */
|
|
242
|
+
export interface CodexFileChange {
|
|
243
|
+
readonly path: string;
|
|
244
|
+
readonly kind: {
|
|
245
|
+
readonly type: string;
|
|
246
|
+
readonly move_path?: string | null;
|
|
247
|
+
};
|
|
248
|
+
readonly diff?: string;
|
|
249
|
+
}
|
|
250
|
+
/** Items Moxxy leaves out of the chat on purpose, and why. Every other kind shows: one Moxxy does not know, as a call named after it. */
|
|
251
|
+
export declare const CODEX_ITEMS_LEFT_OUT: Readonly<Record<string, string>>;
|
|
252
|
+
/** An item Moxxy reads, or `undefined` for one it shows as a plain call or leaves out. */
|
|
253
|
+
export declare function knownItem(value: unknown): CodexItem | undefined;
|
|
254
|
+
/** An item of a kind Moxxy neither reads nor leaves out: its fields, without the id, kind and status. */
|
|
255
|
+
export interface CodexOtherItem {
|
|
256
|
+
readonly type: string;
|
|
257
|
+
readonly id: string;
|
|
258
|
+
readonly status?: string;
|
|
259
|
+
readonly fields: Readonly<Record<string, unknown>>;
|
|
260
|
+
}
|
|
261
|
+
export declare function otherItem(value: unknown): CodexOtherItem | undefined;
|
|
262
|
+
export interface CodexTokenUsage {
|
|
263
|
+
readonly inputTokens: number;
|
|
264
|
+
readonly cachedInputTokens: number;
|
|
265
|
+
readonly outputTokens: number;
|
|
266
|
+
}
|
|
267
|
+
/** `item/tool/requestUserInput` (experimental): a blocking question with ids. */
|
|
268
|
+
export interface CodexUserInputQuestion {
|
|
269
|
+
readonly id: string;
|
|
270
|
+
readonly header: string;
|
|
271
|
+
readonly question: string;
|
|
272
|
+
readonly isOther: boolean;
|
|
273
|
+
readonly isSecret: boolean;
|
|
274
|
+
readonly options: ReadonlyArray<{
|
|
275
|
+
readonly label: string;
|
|
276
|
+
readonly description: string;
|
|
277
|
+
}> | null;
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=protocol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,mBAAmB,GAC3B,WAAW,GACX,YAAY,GACZ,OAAO,GACP;IAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAAE,CAAC;AAE7D,MAAM,MAAM,kBAAkB,GAC1B;IAAE,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GACrC;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/D;IAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;IAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GACpE;IAAE,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAC;IAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,CAAC;AAE1E,kFAAkF;AAClF,MAAM,WAAW,yBAAyB;IACxC,QAAQ,CAAC,cAAc,EAAE,mBAAmB,CAAC;IAC7C,QAAQ,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IACnD,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;CAC5C;AAED,0FAA0F;AAC1F,MAAM,WAAW,mBAAmB;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;IACzB,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAKpE;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,iFAAiF;AACjF,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,GAAG,IAAI,CAAC;CAClG"}
|
package/dist/protocol.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The part of the `codex app-server` protocol Moxxy speaks, written by hand
|
|
3
|
+
* from `codex app-server generate-ts` (0.155.1, checked against 0.163.0). Codex sends far more than
|
|
4
|
+
* this; anything not listed here is read as unknown and left alone.
|
|
5
|
+
*/
|
|
6
|
+
const KNOWN_ITEMS = new Set(['agentMessage', 'plan', 'reasoning', 'commandExecution', 'fileChange', 'mcpToolCall', 'webSearch', 'imageView', 'sleep', 'imageGeneration']);
|
|
7
|
+
/** Items Moxxy leaves out of the chat on purpose, and why. Every other kind shows: one Moxxy does not know, as a call named after it. */
|
|
8
|
+
export const CODEX_ITEMS_LEFT_OUT = {
|
|
9
|
+
userMessage: "the person's own message, which Moxxy already shows",
|
|
10
|
+
hookPrompt: "text the person's Codex hooks add to the prompt, not something Codex did",
|
|
11
|
+
contextCompaction: "Codex shortening its own context; Moxxy's record of the conversation stays whole",
|
|
12
|
+
collabAgentToolCall: "Codex starting, waiting on or messaging its subagents, which their own rows show",
|
|
13
|
+
subAgentActivity: 'shown as the subagent row, read before the turn items',
|
|
14
|
+
};
|
|
15
|
+
/** An item Moxxy reads, or `undefined` for one it shows as a plain call or leaves out. */
|
|
16
|
+
export function knownItem(value) {
|
|
17
|
+
if (typeof value !== 'object' || value === null)
|
|
18
|
+
return undefined;
|
|
19
|
+
const { type, id } = value;
|
|
20
|
+
return typeof type === 'string' && typeof id === 'string' && KNOWN_ITEMS.has(type) ? value : undefined;
|
|
21
|
+
}
|
|
22
|
+
export function otherItem(value) {
|
|
23
|
+
if (typeof value !== 'object' || value === null || knownItem(value))
|
|
24
|
+
return undefined;
|
|
25
|
+
const { type, id, status, ...fields } = value;
|
|
26
|
+
if (typeof type !== 'string' || typeof id !== 'string' || type in CODEX_ITEMS_LEFT_OUT)
|
|
27
|
+
return undefined;
|
|
28
|
+
return { type, id, ...(typeof status === 'string' ? { status } : {}), fields };
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA4MH,MAAM,WAAW,GAAG,IAAI,GAAG,CAAS,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAElL,yIAAyI;AACzI,MAAM,CAAC,MAAM,oBAAoB,GAAqC;IACpE,WAAW,EAAE,qDAAqD;IAClE,UAAU,EAAE,0EAA0E;IACtF,iBAAiB,EAAE,kFAAkF;IACrG,mBAAmB,EAAE,kFAAkF;IACvG,gBAAgB,EAAE,uDAAuD;CAC1E,CAAC;AAEF,0FAA0F;AAC1F,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,SAAS,CAAC;IAClE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,KAAyC,CAAC;IAC/D,OAAO,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAE,KAAmB,CAAC,CAAC,CAAC,SAAS,CAAC;AACxH,CAAC;AAUD,MAAM,UAAU,SAAS,CAAC,KAAc;IACtC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,SAAS,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACtF,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,KAAgC,CAAC;IACzE,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,IAAI,IAAI,IAAI,oBAAoB;QAAE,OAAO,SAAS,CAAC;IACzG,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,CAAC,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AACjF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AgentBackgroundWork, AgentStepEvent } from '@moxxy/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Codex's subagents. Codex announces one with a `subAgentActivity` item on the conversation's
|
|
4
|
+
* thread and runs it in a thread of its own; its tool calls and answer come from that thread.
|
|
5
|
+
* They outlive a Moxxy turn, so the session keeps them.
|
|
6
|
+
*/
|
|
7
|
+
export declare class CodexSubagents {
|
|
8
|
+
private readonly agents;
|
|
9
|
+
/** A `subAgentActivity` item on the conversation's thread. */
|
|
10
|
+
activity(item: unknown): AgentStepEvent[];
|
|
11
|
+
/** A notification from a thread other than the conversation's: a subagent's work, if it is one. */
|
|
12
|
+
fromThread(method: string, params: Record<string, unknown>): AgentStepEvent[];
|
|
13
|
+
/** The subagents still working, as background work. */
|
|
14
|
+
running(): AgentBackgroundWork[];
|
|
15
|
+
/** The turn running in a working subagent's thread, if any. */
|
|
16
|
+
turnOf(id: string): string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/** "/root/inspect_folder" → "inspect folder". */
|
|
19
|
+
export declare function labelOf(path: unknown): string;
|
|
20
|
+
//# sourceMappingURL=subagents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagents.d.ts","sourceRoot":"","sources":["../src/subagents.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAatE;;;;GAIG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IAErD,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,EAAE;IAezC,mGAAmG;IACnG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,EAAE;IAgC7E,uDAAuD;IACvD,OAAO,IAAI,mBAAmB,EAAE;IAIhC,+DAA+D;IAC/D,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAIvC;AAaD,iDAAiD;AACjD,wBAAgB,OAAO,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAG7C"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { toolCallOf } from './translate.js';
|
|
2
|
+
/**
|
|
3
|
+
* Codex's subagents. Codex announces one with a `subAgentActivity` item on the conversation's
|
|
4
|
+
* thread and runs it in a thread of its own; its tool calls and answer come from that thread.
|
|
5
|
+
* They outlive a Moxxy turn, so the session keeps them.
|
|
6
|
+
*/
|
|
7
|
+
export class CodexSubagents {
|
|
8
|
+
agents = new Map();
|
|
9
|
+
/** A `subAgentActivity` item on the conversation's thread. */
|
|
10
|
+
activity(item) {
|
|
11
|
+
const a = (item ?? {});
|
|
12
|
+
if (typeof a.agentThreadId !== 'string')
|
|
13
|
+
return [];
|
|
14
|
+
const id = a.agentThreadId;
|
|
15
|
+
const known = this.agents.get(id);
|
|
16
|
+
if (a.kind === 'started') {
|
|
17
|
+
if (known)
|
|
18
|
+
return [];
|
|
19
|
+
const label = labelOf(a.agentPath);
|
|
20
|
+
this.agents.set(id, { label, text: '', tokens: undefined, done: false });
|
|
21
|
+
return [{ type: 'subagent_started', id, label, agentType: 'default' }];
|
|
22
|
+
}
|
|
23
|
+
if ((a.kind !== 'completed' && a.kind !== 'interrupted') || !known || known.done)
|
|
24
|
+
return [];
|
|
25
|
+
return [end(id, known, a.kind === 'interrupted')];
|
|
26
|
+
}
|
|
27
|
+
/** A notification from a thread other than the conversation's: a subagent's work, if it is one. */
|
|
28
|
+
fromThread(method, params) {
|
|
29
|
+
const id = typeof params.threadId === 'string' ? params.threadId : '';
|
|
30
|
+
const agent = this.agents.get(id);
|
|
31
|
+
if (!agent || agent.done)
|
|
32
|
+
return [];
|
|
33
|
+
if (method === 'turn/started' || method === 'turn/completed') {
|
|
34
|
+
const turn = params.turn;
|
|
35
|
+
if (method === 'turn/started') {
|
|
36
|
+
if (typeof turn?.id === 'string')
|
|
37
|
+
agent.turn = turn.id;
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
delete agent.turn;
|
|
41
|
+
// Between the conversation's turns Codex reports a stopped subagent only here.
|
|
42
|
+
return turn?.status === 'interrupted' ? [end(id, agent, true)] : [];
|
|
43
|
+
}
|
|
44
|
+
if (method === 'thread/tokenUsage/updated') {
|
|
45
|
+
const total = params.tokenUsage?.total;
|
|
46
|
+
if (total && typeof total.totalTokens === 'number')
|
|
47
|
+
agent.tokens = total.totalTokens;
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
if (method !== 'item/completed')
|
|
51
|
+
return [];
|
|
52
|
+
const item = params.item;
|
|
53
|
+
if (!item)
|
|
54
|
+
return [];
|
|
55
|
+
if (item.type === 'agentMessage') {
|
|
56
|
+
if (!item.text)
|
|
57
|
+
return [];
|
|
58
|
+
agent.text = item.text;
|
|
59
|
+
// The final answer shows as the subagent's answer when it ends.
|
|
60
|
+
return item.phase === 'final_answer' ? [] : [{ type: 'subagent_message', id, text: item.text }];
|
|
61
|
+
}
|
|
62
|
+
const call = toolCallOf(item);
|
|
63
|
+
return call ? [{ type: 'subagent_tool_call', id, name: call.name, input: call.input }] : [];
|
|
64
|
+
}
|
|
65
|
+
/** The subagents still working, as background work. */
|
|
66
|
+
running() {
|
|
67
|
+
return [...this.agents].flatMap(([id, agent]) => (agent.done ? [] : [{ id, kind: 'agent', label: agent.label }]));
|
|
68
|
+
}
|
|
69
|
+
/** The turn running in a working subagent's thread, if any. */
|
|
70
|
+
turnOf(id) {
|
|
71
|
+
const agent = this.agents.get(id);
|
|
72
|
+
return agent && !agent.done ? agent.turn : undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function end(id, agent, stopped) {
|
|
76
|
+
agent.done = true;
|
|
77
|
+
return {
|
|
78
|
+
type: 'subagent_completed',
|
|
79
|
+
id,
|
|
80
|
+
text: agent.text,
|
|
81
|
+
...(agent.tokens !== undefined ? { tokensUsed: agent.tokens } : {}),
|
|
82
|
+
...(stopped ? { error: 'The subagent was stopped.', stopped: true } : {}),
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
/** "/root/inspect_folder" → "inspect folder". */
|
|
86
|
+
export function labelOf(path) {
|
|
87
|
+
const last = typeof path === 'string' ? path.split('/').filter(Boolean).pop() : undefined;
|
|
88
|
+
return last ? last.replace(/[_-]+/g, ' ') : 'subagent';
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=subagents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subagents.js","sourceRoot":"","sources":["../src/subagents.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAY5C;;;;GAIG;AACH,MAAM,OAAO,cAAc;IACR,MAAM,GAAG,IAAI,GAAG,EAAmB,CAAC;IAErD,8DAA8D;IAC9D,QAAQ,CAAC,IAAa;QACpB,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAqE,CAAC;QAC3F,IAAI,OAAO,CAAC,CAAC,aAAa,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAC;QACnD,MAAM,EAAE,GAAG,CAAC,CAAC,aAAa,CAAC;QAC3B,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClC,IAAI,CAAC,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;YACzB,IAAI,KAAK;gBAAE,OAAO,EAAE,CAAC;YACrB,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YACnC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACzE,OAAO,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,CAAC;QACzE,CAAC;QACD,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,IAAI,CAAC,CAAC,IAAI,KAAK,aAAa,CAAC,IAAI,CAAC,KAAK,IAAI,KAAK,CAAC,IAA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,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClC,OAAO,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;IACvD,CAAC;CACF;AAED,SAAS,GAAG,CAAC,EAAU,EAAE,KAAc,EAAE,OAAgB;IACvD,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,OAAO;QACL,IAAI,EAAE,oBAAoB;QAC1B,EAAE;QACF,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,GAAG,CAAC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnE,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,2BAA2B,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACnF,CAAC;AACJ,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,OAAO,CAAC,IAAa;IACnC,MAAM,IAAI,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1F,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { AgentStepEvent, ContentBlock, QuestionAnswers, QuestionItem, TokenUsage, ToolImage } from '@moxxy/sdk';
|
|
2
|
+
import { type CodexAsyncQuestion, type CodexItem, type CodexTokenUsage, type CodexUserInput, type CodexUserInputQuestion } from './protocol.js';
|
|
3
|
+
/** Questions Codex asked in its message `itemId`. */
|
|
4
|
+
export interface CodexAskedQuestions {
|
|
5
|
+
readonly itemId: string;
|
|
6
|
+
readonly questions: ReadonlyArray<CodexAsyncQuestion>;
|
|
7
|
+
}
|
|
8
|
+
/** A tool Codex runs itself, as Moxxy names it (`Bash` so Moxxy's shell rules and formatting apply). */
|
|
9
|
+
export interface CodexToolCall {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly input: unknown;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Codex's notifications for one Moxxy turn, as Moxxy agent events. Calls to
|
|
15
|
+
* Moxxy's own tools are left out: Moxxy records those when it runs them.
|
|
16
|
+
*/
|
|
17
|
+
export declare class TurnTranslator {
|
|
18
|
+
private readonly cwd;
|
|
19
|
+
private readonly readImage;
|
|
20
|
+
private readonly announced;
|
|
21
|
+
private readonly calls;
|
|
22
|
+
/** Items that started and have not ended yet. */
|
|
23
|
+
private readonly running;
|
|
24
|
+
/** Plan updates shown this turn; each is a call of its own. */
|
|
25
|
+
private plans;
|
|
26
|
+
/** Questions Codex just asked in a message, until the session takes them. */
|
|
27
|
+
private asked;
|
|
28
|
+
/** The item Codex is on: the last one it started or finished. */
|
|
29
|
+
private latestItem;
|
|
30
|
+
/** Codex's last message so far. */
|
|
31
|
+
private latestMessage;
|
|
32
|
+
/**
|
|
33
|
+
* `cwd`: the project folder, which the paths of file diffs are shown relative to.
|
|
34
|
+
* `readImage`: the picture at a path, for an image Codex viewed (it names only the file).
|
|
35
|
+
*/
|
|
36
|
+
constructor(cwd?: string, readImage?: (path: string) => ToolImage | undefined);
|
|
37
|
+
/** Show a call before Moxxy decides on it, unless it is already shown. */
|
|
38
|
+
announce(callId: string, call: CodexToolCall): AgentStepEvent[];
|
|
39
|
+
/**
|
|
40
|
+
* What Codex left running as its turn ended (a command in the background):
|
|
41
|
+
* shown as still running, and handed back so its end can be shown when it comes.
|
|
42
|
+
*/
|
|
43
|
+
leftRunning(): {
|
|
44
|
+
readonly events: AgentStepEvent[];
|
|
45
|
+
readonly calls: ReadonlyMap<string, CodexToolCall>;
|
|
46
|
+
};
|
|
47
|
+
/** The questions Codex just asked in a message (`delivery: 'async'`), handed out once. */
|
|
48
|
+
takeQuestions(): CodexAskedQuestions | undefined;
|
|
49
|
+
/** Codex started or finished another item since `itemId`: it works on without waiting. */
|
|
50
|
+
movedOnFrom(itemId: string): boolean;
|
|
51
|
+
/** Message `itemId` is the last thing Codex said. */
|
|
52
|
+
lastSaid(itemId: string): boolean;
|
|
53
|
+
/** The call shown for an item, for an approval that names only the item. */
|
|
54
|
+
callOf(callId: string): CodexToolCall | undefined;
|
|
55
|
+
translate(method: string, params: unknown): AgentStepEvent[];
|
|
56
|
+
private noteItem;
|
|
57
|
+
/**
|
|
58
|
+
* Codex's checklist (its `update_plan` tool) as it stands after a change.
|
|
59
|
+
* Codex reports it as a notification, not an item, so it is shown as a call
|
|
60
|
+
* of its own; the plan of plan mode is a `plan` item instead.
|
|
61
|
+
*/
|
|
62
|
+
private planUpdated;
|
|
63
|
+
/**
|
|
64
|
+
* An item of a kind Moxxy does not know (one a newer Codex added), shown as
|
|
65
|
+
* a call named after it: what Codex said as it started, and what it added by the end.
|
|
66
|
+
*/
|
|
67
|
+
private otherCompleted;
|
|
68
|
+
private completed;
|
|
69
|
+
}
|
|
70
|
+
export declare function toolCallOf(item: CodexItem): CodexToolCall | undefined;
|
|
71
|
+
/** The command as the person would type it: Codex wraps it in `<shell> -lc '…'`. */
|
|
72
|
+
export declare function shownCommand(command: string): string;
|
|
73
|
+
/** Codex counts cached prompt tokens inside `inputTokens`; Moxxy keeps them apart. */
|
|
74
|
+
export declare function toTokenUsage(usage: CodexTokenUsage): TokenUsage;
|
|
75
|
+
/** The person's message as Codex input: text as it is, images inline. */
|
|
76
|
+
export declare function toCodexInput(prompt: ReadonlyArray<ContentBlock>): CodexUserInput[];
|
|
77
|
+
export declare function promptText(prompt: ReadonlyArray<ContentBlock>): string;
|
|
78
|
+
/** Codex plan-mode questions as Moxxy Questions. Codex takes any text back, so an own answer always fits. */
|
|
79
|
+
export declare function fromAsyncQuestions(questions: ReadonlyArray<CodexAsyncQuestion>): QuestionItem[];
|
|
80
|
+
/** The answers as the next message Codex reads: one `question: answer` line each. */
|
|
81
|
+
export declare function answersMessage(items: ReadonlyArray<QuestionItem>, answers: QuestionAnswers): string;
|
|
82
|
+
/** `item/tool/requestUserInput` questions as Moxxy Questions. */
|
|
83
|
+
export declare function fromUserInputQuestions(questions: ReadonlyArray<CodexUserInputQuestion>): QuestionItem[];
|
|
84
|
+
export declare function toUserInputAnswers(items: ReadonlyArray<QuestionItem>, answers: QuestionAnswers): Record<string, {
|
|
85
|
+
answers: string[];
|
|
86
|
+
}>;
|
|
87
|
+
//# sourceMappingURL=translate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../src/translate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAmB,eAAe,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGtI,OAAO,EAGL,KAAK,kBAAkB,EAEvB,KAAK,SAAS,EAEd,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAE5B,MAAM,eAAe,CAAC;AAIvB,qDAAqD;AACrD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,kBAAkB,CAAC,CAAC;CACvD;AAED,wGAAwG;AACxG,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,cAAc;IAmBvB,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAnB5B,O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