@ekairos/openai-reactor 1.22.37-beta.development.0 → 1.22.37
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/dist/codex.reactor.d.ts +8 -5
- package/dist/codex.reactor.d.ts.map +1 -1
- package/dist/codex.reactor.js +228 -51
- package/dist/codex.reactor.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/responses.reactor.d.ts +89 -0
- package/dist/responses.reactor.d.ts.map +1 -0
- package/dist/responses.reactor.js +1002 -0
- package/dist/responses.reactor.js.map +1 -0
- package/dist/responses.websocket.d.ts +52 -0
- package/dist/responses.websocket.d.ts.map +1 -0
- package/dist/responses.websocket.js +548 -0
- package/dist/responses.websocket.js.map +1 -0
- package/dist/shared.d.ts +12 -0
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +362 -67
- package/dist/shared.js.map +1 -1
- package/package.json +21 -6
package/dist/codex.reactor.d.ts
CHANGED
|
@@ -47,7 +47,6 @@ export type CodexTurnResult = {
|
|
|
47
47
|
usage?: Record<string, unknown>;
|
|
48
48
|
};
|
|
49
49
|
export type CodexExecuteTurnArgs<Context, Config extends CodexConfig = CodexConfig, Env extends ContextEnvironment = ContextEnvironment> = {
|
|
50
|
-
env: Env;
|
|
51
50
|
runtime?: unknown;
|
|
52
51
|
context: AnyRecord;
|
|
53
52
|
triggerEvent: ContextItem;
|
|
@@ -66,7 +65,6 @@ export type CodexExecuteTurnArgs<Context, Config extends CodexConfig = CodexConf
|
|
|
66
65
|
contextIdentifier?: unknown;
|
|
67
66
|
contextStepStream?: WritableStream<string>;
|
|
68
67
|
writable?: WritableStream<unknown>;
|
|
69
|
-
silent: boolean;
|
|
70
68
|
emitChunk: (providerChunk: unknown) => Promise<void>;
|
|
71
69
|
};
|
|
72
70
|
export type CodexAppServerTurnStepArgs<Config extends CodexConfig = CodexConfig> = {
|
|
@@ -87,11 +85,13 @@ export type CodexAppServerTurnStepArgs<Config extends CodexConfig = CodexConfig>
|
|
|
87
85
|
contextIdentifier?: unknown;
|
|
88
86
|
contextStepStream?: WritableStream<string>;
|
|
89
87
|
writable?: WritableStream<unknown>;
|
|
90
|
-
silent: boolean;
|
|
91
88
|
};
|
|
92
89
|
export type CodexChunkMappingResult = {
|
|
93
90
|
chunkType: ContextStreamChunkType;
|
|
94
91
|
providerChunkType?: string;
|
|
92
|
+
providerPartId?: string;
|
|
93
|
+
partType?: string;
|
|
94
|
+
partSlot?: string;
|
|
95
95
|
actionRef?: string;
|
|
96
96
|
data?: unknown;
|
|
97
97
|
raw?: unknown;
|
|
@@ -102,6 +102,10 @@ export type CodexMappedChunk = {
|
|
|
102
102
|
sequence: number;
|
|
103
103
|
chunkType: ContextStreamChunkType;
|
|
104
104
|
providerChunkType?: string;
|
|
105
|
+
providerPartId?: string;
|
|
106
|
+
partId?: string;
|
|
107
|
+
partType?: string;
|
|
108
|
+
partSlot?: string;
|
|
105
109
|
actionRef?: string;
|
|
106
110
|
data?: unknown;
|
|
107
111
|
raw?: unknown;
|
|
@@ -116,12 +120,11 @@ export type CreateCodexReactorOptions<Context, Config extends CodexConfig = Code
|
|
|
116
120
|
toolName?: string;
|
|
117
121
|
includeReasoningPart?: boolean;
|
|
118
122
|
buildInstruction?: (params: {
|
|
119
|
-
env: Env;
|
|
120
123
|
context: AnyRecord;
|
|
121
124
|
triggerEvent: ContextItem;
|
|
122
125
|
}) => string | Promise<string>;
|
|
123
126
|
resolveConfig: (params: {
|
|
124
|
-
|
|
127
|
+
runtime: ContextReactorParams<Context, Env>["runtime"];
|
|
125
128
|
context: AnyRecord;
|
|
126
129
|
triggerEvent: ContextItem;
|
|
127
130
|
contextId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codex.reactor.d.ts","sourceRoot":"","sources":["../src/codex.reactor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
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ACjD,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,IAAI,EAAE,0BAA0B,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,CAkRpE;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EACP,MAAM,SAAS,WAAW,GAAG,WAAW,EACxC,GAAG,SAAS,kBAAkB,GAAG,kBAAkB,EAEnD,OAAO,EAAE,yBAAyB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,GACvD,cAAc,CAAC,OAAO,EAAE,GAAG,CAAC,CA+X9B"}
|
package/dist/codex.reactor.js
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
-
import { OUTPUT_ITEM_TYPE, createContextStepStreamChunk, encodeContextStepStreamChunk, } from "@ekairos/events";
|
|
1
|
+
import { OUTPUT_ITEM_TYPE, createContextStepStreamChunk, encodeContextStepStreamChunk, resolveContextPartChunkDescriptor, resolveContextPartChunkIdentity, actionsToActionSpecs, } from "@ekairos/events";
|
|
2
|
+
import { SANDBOX_EXECUTE_COMMAND_ACTION_NAME } from "@ekairos/sandbox/contract";
|
|
2
3
|
import { randomUUID } from "node:crypto";
|
|
3
|
-
import { asRecord, asString, buildCodexParts, defaultInstructionFromTrigger } from "./shared.js";
|
|
4
|
+
import { asRecord, asString, buildCodexParts, defaultInstructionFromTrigger, readCodexDynamicActionDetails, } from "./shared.js";
|
|
5
|
+
function isCodexExecutableAction(value) {
|
|
6
|
+
return (typeof value === "object" &&
|
|
7
|
+
value !== null &&
|
|
8
|
+
"execute" in value &&
|
|
9
|
+
typeof value.execute === "function");
|
|
10
|
+
}
|
|
11
|
+
function isCodexSandboxRuntime(value) {
|
|
12
|
+
return (typeof value === "object" &&
|
|
13
|
+
value !== null &&
|
|
14
|
+
"use" in value &&
|
|
15
|
+
typeof value.use === "function");
|
|
16
|
+
}
|
|
17
|
+
function hasStreamCapableSandboxDb(value) {
|
|
18
|
+
const db = asRecord(value);
|
|
19
|
+
const streams = asRecord(db.streams);
|
|
20
|
+
const tx = asRecord(db.tx);
|
|
21
|
+
return (typeof db.transact === "function" &&
|
|
22
|
+
typeof streams.createWriteStream === "function" &&
|
|
23
|
+
typeof tx.sandbox_processes === "object" &&
|
|
24
|
+
tx.sandbox_processes !== null);
|
|
25
|
+
}
|
|
4
26
|
const PROVIDER_SCOPE_PREFIX = "context/";
|
|
5
27
|
const PROVIDER_STARTED = "context/started";
|
|
6
28
|
const PROVIDER_ARCHIVED = "context/archived";
|
|
@@ -15,6 +37,9 @@ function toJsonSafe(value) {
|
|
|
15
37
|
return undefined;
|
|
16
38
|
}
|
|
17
39
|
}
|
|
40
|
+
function cleanRecord(value) {
|
|
41
|
+
return Object.fromEntries(Object.entries(value).filter(([, entry]) => entry !== undefined));
|
|
42
|
+
}
|
|
18
43
|
export function mapCodexChunkType(providerChunkType) {
|
|
19
44
|
const value = providerChunkType.toLowerCase();
|
|
20
45
|
if (value.includes("start_step"))
|
|
@@ -31,22 +56,27 @@ export function mapCodexChunkType(providerChunkType) {
|
|
|
31
56
|
return "chunk.reasoning_delta";
|
|
32
57
|
if (value.includes("reasoning_end"))
|
|
33
58
|
return "chunk.reasoning_end";
|
|
34
|
-
if (value.includes("
|
|
35
|
-
return "chunk.
|
|
36
|
-
|
|
59
|
+
if (value.includes("action_started") || value.includes("tool_started"))
|
|
60
|
+
return "chunk.action_started";
|
|
61
|
+
if (value.includes("action_completed") || value.includes("tool_completed"))
|
|
62
|
+
return "chunk.action_completed";
|
|
63
|
+
if (value.includes("action_failed") || value.includes("tool_failed"))
|
|
64
|
+
return "chunk.action_failed";
|
|
65
|
+
if (value.includes("action_input_start") || value.includes("tool_input_start"))
|
|
66
|
+
return "chunk.action_started";
|
|
37
67
|
if (value.includes("action_input_delta") || value.includes("tool_input_delta")) {
|
|
38
68
|
return "chunk.action_input_delta";
|
|
39
69
|
}
|
|
40
70
|
if (value.includes("action_input_available") ||
|
|
41
71
|
value.includes("tool_input_available") ||
|
|
42
72
|
value.includes("action_call")) {
|
|
43
|
-
return "chunk.
|
|
73
|
+
return "chunk.action_started";
|
|
44
74
|
}
|
|
45
75
|
if (value.includes("action_output_available") || value.includes("tool_output_available")) {
|
|
46
|
-
return "chunk.
|
|
76
|
+
return "chunk.action_completed";
|
|
47
77
|
}
|
|
48
78
|
if (value.includes("action_output_error") || value.includes("tool_output_error")) {
|
|
49
|
-
return "chunk.
|
|
79
|
+
return "chunk.action_failed";
|
|
50
80
|
}
|
|
51
81
|
if (value.includes("message_metadata"))
|
|
52
82
|
return "chunk.message_metadata";
|
|
@@ -99,6 +129,51 @@ function resolveActionRef(params, item) {
|
|
|
99
129
|
return fromItem;
|
|
100
130
|
return undefined;
|
|
101
131
|
}
|
|
132
|
+
function resolveProviderPartId(params, item) {
|
|
133
|
+
const fromParams = asString(params.itemId) ||
|
|
134
|
+
asString(params.toolCallId) ||
|
|
135
|
+
asString(params.callId) ||
|
|
136
|
+
asString(params.id);
|
|
137
|
+
if (fromParams)
|
|
138
|
+
return fromParams;
|
|
139
|
+
const fromItem = asString(item.id) || asString(item.toolCallId);
|
|
140
|
+
if (fromItem)
|
|
141
|
+
return fromItem;
|
|
142
|
+
return undefined;
|
|
143
|
+
}
|
|
144
|
+
function withCodexPartDescriptor(chunkType, providerPartId) {
|
|
145
|
+
return resolveContextPartChunkDescriptor({
|
|
146
|
+
chunkType,
|
|
147
|
+
providerPartId,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
function completeCodexMappedChunkIdentity(mapped, stepId) {
|
|
151
|
+
const data = asRecord(mapped.data);
|
|
152
|
+
const providerPartId = asString(mapped.providerPartId) ||
|
|
153
|
+
(mapped.chunkType.startsWith("chunk.action_") ? asString(mapped.actionRef) : "") ||
|
|
154
|
+
asString(data.providerPartId) ||
|
|
155
|
+
asString(data.id) ||
|
|
156
|
+
asString(data.itemId) ||
|
|
157
|
+
asString(data.toolCallId) ||
|
|
158
|
+
asString(mapped.actionRef);
|
|
159
|
+
const identity = resolveContextPartChunkIdentity({
|
|
160
|
+
stepId,
|
|
161
|
+
provider: "codex",
|
|
162
|
+
providerPartId,
|
|
163
|
+
chunkType: mapped.chunkType,
|
|
164
|
+
partType: mapped.partType,
|
|
165
|
+
partSlot: mapped.partSlot,
|
|
166
|
+
});
|
|
167
|
+
return {
|
|
168
|
+
partId: identity?.partId,
|
|
169
|
+
providerPartId: identity?.providerPartId,
|
|
170
|
+
partType: identity?.partType,
|
|
171
|
+
partSlot: identity?.partSlot,
|
|
172
|
+
actionRef: mapped.chunkType.startsWith("chunk.action_")
|
|
173
|
+
? asString(mapped.actionRef) || identity?.providerPartId
|
|
174
|
+
: undefined,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
102
177
|
export function mapCodexAppServerNotification(providerChunk) {
|
|
103
178
|
const chunk = asRecord(providerChunk);
|
|
104
179
|
const method = asString(chunk.method).trim();
|
|
@@ -122,18 +197,73 @@ export function mapCodexAppServerNotification(providerChunk) {
|
|
|
122
197
|
const itemType = normalizeLower(item.type);
|
|
123
198
|
const itemStatus = normalizeLower(item.status);
|
|
124
199
|
const actionRef = resolveActionRef(params, item);
|
|
200
|
+
const providerPartId = resolveProviderPartId(params, item);
|
|
125
201
|
const hasItemError = Boolean(item.error);
|
|
126
|
-
const
|
|
202
|
+
const actionDetails = readCodexDynamicActionDetails(params);
|
|
203
|
+
const isCommandExecutionItem = itemType === "commandexecution";
|
|
204
|
+
const isCommandExecutionOutputDelta = method === "item/commandExecution/outputDelta";
|
|
205
|
+
const commandExecutionInput = isCommandExecutionItem
|
|
206
|
+
? cleanRecord({
|
|
207
|
+
command: asString(item.command),
|
|
208
|
+
args: [],
|
|
209
|
+
cwd: asString(item.cwd) || undefined,
|
|
210
|
+
kind: "command",
|
|
211
|
+
mode: "foreground",
|
|
212
|
+
metadata: cleanRecord({
|
|
213
|
+
source: "codex.commandExecution",
|
|
214
|
+
commandActions: Array.isArray(item.commandActions) ? item.commandActions : [],
|
|
215
|
+
}),
|
|
216
|
+
})
|
|
217
|
+
: undefined;
|
|
218
|
+
const commandExecutionOutput = isCommandExecutionItem
|
|
219
|
+
? cleanRecord({
|
|
220
|
+
success: itemStatus === "failed"
|
|
221
|
+
? false
|
|
222
|
+
: typeof item.exitCode === "number"
|
|
223
|
+
? item.exitCode === 0
|
|
224
|
+
: undefined,
|
|
225
|
+
exitCode: typeof item.exitCode === "number" ? item.exitCode : undefined,
|
|
226
|
+
output: asString(item.aggregatedOutput) || undefined,
|
|
227
|
+
error: asString(item.error || item.message) || undefined,
|
|
228
|
+
command: asString(item.command) || undefined,
|
|
229
|
+
durationMs: typeof item.durationMs === "number" ? item.durationMs : undefined,
|
|
230
|
+
status: itemStatus === "failed" || (typeof item.exitCode === "number" && item.exitCode !== 0)
|
|
231
|
+
? "failed"
|
|
232
|
+
: itemStatus === "completed"
|
|
233
|
+
? "exited"
|
|
234
|
+
: itemStatus || undefined,
|
|
235
|
+
})
|
|
236
|
+
: undefined;
|
|
237
|
+
const mappedData = toJsonSafe(cleanRecord({
|
|
127
238
|
method,
|
|
128
239
|
params,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
240
|
+
actionCallId: actionDetails.actionCallId,
|
|
241
|
+
actionName: actionDetails.actionName ||
|
|
242
|
+
(isCommandExecutionItem || isCommandExecutionOutputDelta
|
|
243
|
+
? SANDBOX_EXECUTE_COMMAND_ACTION_NAME
|
|
244
|
+
: undefined),
|
|
245
|
+
input: actionDetails.input ?? commandExecutionInput,
|
|
246
|
+
output: actionDetails.output ??
|
|
247
|
+
commandExecutionOutput ??
|
|
248
|
+
(isCommandExecutionOutputDelta
|
|
249
|
+
? cleanRecord({ output: asString(params.delta) || undefined })
|
|
250
|
+
: undefined),
|
|
251
|
+
success: actionDetails.success,
|
|
252
|
+
errorText: actionDetails.errorText,
|
|
253
|
+
}));
|
|
254
|
+
const map = (chunkType) => {
|
|
255
|
+
const descriptor = withCodexPartDescriptor(chunkType, providerPartId);
|
|
256
|
+
return {
|
|
257
|
+
chunkType,
|
|
258
|
+
providerChunkType: method,
|
|
259
|
+
providerPartId: descriptor?.providerPartId,
|
|
260
|
+
partType: descriptor?.partType,
|
|
261
|
+
partSlot: descriptor?.partSlot,
|
|
262
|
+
actionRef: chunkType.startsWith("chunk.action_") ? actionRef : undefined,
|
|
263
|
+
data: mappedData,
|
|
264
|
+
raw: toJsonSafe(providerChunk),
|
|
265
|
+
};
|
|
266
|
+
};
|
|
137
267
|
switch (method) {
|
|
138
268
|
case "turn/started":
|
|
139
269
|
return map("chunk.start");
|
|
@@ -170,14 +300,14 @@ export function mapCodexAppServerNotification(providerChunk) {
|
|
|
170
300
|
case "item/commandExecution/outputDelta":
|
|
171
301
|
case "item/fileChange/outputDelta":
|
|
172
302
|
case "item/mcpToolCall/progress":
|
|
173
|
-
return map("chunk.
|
|
303
|
+
return map("chunk.action_completed");
|
|
174
304
|
case "item/tool/call":
|
|
175
|
-
return map("chunk.
|
|
305
|
+
return map("chunk.action_started");
|
|
176
306
|
case "item/tool/result":
|
|
177
307
|
if (asRecord(params.result).success === false || asString(params.error)) {
|
|
178
|
-
return map("chunk.
|
|
308
|
+
return map("chunk.action_failed");
|
|
179
309
|
}
|
|
180
|
-
return map("chunk.
|
|
310
|
+
return map("chunk.action_completed");
|
|
181
311
|
case "item/started": {
|
|
182
312
|
if (itemType === "agentmessage")
|
|
183
313
|
return map("chunk.text_start");
|
|
@@ -186,7 +316,7 @@ export function mapCodexAppServerNotification(providerChunk) {
|
|
|
186
316
|
if (itemType === "usermessage")
|
|
187
317
|
return map("chunk.message_metadata");
|
|
188
318
|
if (isActionItemType(itemType))
|
|
189
|
-
return map("chunk.
|
|
319
|
+
return map("chunk.action_started");
|
|
190
320
|
return map("chunk.message_metadata");
|
|
191
321
|
}
|
|
192
322
|
case "item/completed": {
|
|
@@ -198,9 +328,9 @@ export function mapCodexAppServerNotification(providerChunk) {
|
|
|
198
328
|
return map("chunk.message_metadata");
|
|
199
329
|
if (isActionItemType(itemType)) {
|
|
200
330
|
if (hasItemError || itemStatus === "failed" || itemStatus === "declined") {
|
|
201
|
-
return map("chunk.
|
|
331
|
+
return map("chunk.action_failed");
|
|
202
332
|
}
|
|
203
|
-
return map("chunk.
|
|
333
|
+
return map("chunk.action_completed");
|
|
204
334
|
}
|
|
205
335
|
if (hasItemError || itemStatus === "failed" || itemStatus === "declined") {
|
|
206
336
|
return map("chunk.error");
|
|
@@ -227,12 +357,25 @@ export function defaultMapCodexChunk(providerChunk) {
|
|
|
227
357
|
const chunk = asRecord(providerChunk);
|
|
228
358
|
const providerChunkType = asString(chunk.type) || "unknown";
|
|
229
359
|
const actionRef = asString(chunk.actionRef) || asString(chunk.toolCallId) || asString(chunk.id) || undefined;
|
|
360
|
+
const providerPartId = asString(chunk.providerPartId) ||
|
|
361
|
+
asString(chunk.itemId) ||
|
|
362
|
+
asString(chunk.toolCallId) ||
|
|
363
|
+
asString(chunk.id) ||
|
|
364
|
+
asString(chunk.actionRef) ||
|
|
365
|
+
undefined;
|
|
366
|
+
const chunkType = mapCodexChunkType(providerChunkType);
|
|
367
|
+
const descriptor = withCodexPartDescriptor(chunkType, providerPartId);
|
|
230
368
|
return {
|
|
231
|
-
chunkType
|
|
369
|
+
chunkType,
|
|
232
370
|
providerChunkType,
|
|
371
|
+
providerPartId: descriptor?.providerPartId,
|
|
372
|
+
partType: descriptor?.partType,
|
|
373
|
+
partSlot: descriptor?.partSlot,
|
|
233
374
|
actionRef,
|
|
234
375
|
data: toJsonSafe({
|
|
235
376
|
id: chunk.id,
|
|
377
|
+
itemId: chunk.itemId,
|
|
378
|
+
providerPartId: descriptor?.providerPartId,
|
|
236
379
|
delta: chunk.delta,
|
|
237
380
|
text: chunk.text,
|
|
238
381
|
finishReason: chunk.finishReason,
|
|
@@ -397,11 +540,12 @@ function formatCodexToolOutput(value) {
|
|
|
397
540
|
}
|
|
398
541
|
}
|
|
399
542
|
async function executeCodexDynamicToolCall(args, params) {
|
|
400
|
-
const
|
|
401
|
-
const
|
|
543
|
+
const actionDetails = readCodexDynamicActionDetails(params);
|
|
544
|
+
const toolName = asString(actionDetails.actionName).trim();
|
|
545
|
+
const callId = asString(actionDetails.actionCallId).trim();
|
|
402
546
|
const action = toolName ? (args.actions ?? {})[toolName] : undefined;
|
|
403
|
-
const input =
|
|
404
|
-
if (!toolName || !action
|
|
547
|
+
const input = actionDetails.input ?? {};
|
|
548
|
+
if (!toolName || !isCodexExecutableAction(action)) {
|
|
405
549
|
const errorText = `codex_dynamic_tool_not_found:${toolName || "unknown"}`;
|
|
406
550
|
return {
|
|
407
551
|
success: false,
|
|
@@ -416,7 +560,6 @@ async function executeCodexDynamicToolCall(args, params) {
|
|
|
416
560
|
try {
|
|
417
561
|
const output = await action.execute(input, {
|
|
418
562
|
runtime: args.runtime,
|
|
419
|
-
env: args.env,
|
|
420
563
|
context: args.storedContext ?? args.context,
|
|
421
564
|
contextIdentifier: args.contextIdentifier,
|
|
422
565
|
toolCallId: callId || undefined,
|
|
@@ -674,18 +817,26 @@ function ensureOk(result, label) {
|
|
|
674
817
|
throw new Error(`${label}: ${result.error}`);
|
|
675
818
|
return result.data;
|
|
676
819
|
}
|
|
820
|
+
async function resolveCodexSandboxDomain(runtime) {
|
|
821
|
+
const rootDomain = runtime.meta?.().domain;
|
|
822
|
+
if (!rootDomain) {
|
|
823
|
+
throw new Error("codex_sandbox_domain_required");
|
|
824
|
+
}
|
|
825
|
+
const scoped = await runtime.use(rootDomain);
|
|
826
|
+
if (!scoped.actions) {
|
|
827
|
+
throw new Error("codex_sandbox_actions_required");
|
|
828
|
+
}
|
|
829
|
+
return scoped;
|
|
830
|
+
}
|
|
677
831
|
async function executeCodexSandboxTurn(args, helpers) {
|
|
678
832
|
const sandboxConfig = args.config.sandbox ?? {};
|
|
679
|
-
const runtime =
|
|
680
|
-
if (!runtime
|
|
833
|
+
const runtime = args.runtime;
|
|
834
|
+
if (!isCodexSandboxRuntime(runtime)) {
|
|
681
835
|
throw new Error("codex_sandbox_runtime_required");
|
|
682
836
|
}
|
|
683
|
-
const
|
|
684
|
-
const scoped = await runtime.use(sandboxDomain);
|
|
837
|
+
const scoped = await resolveCodexSandboxDomain(runtime);
|
|
685
838
|
const actions = scoped.actions;
|
|
686
839
|
const sandboxDb = scoped.db;
|
|
687
|
-
if (!actions)
|
|
688
|
-
throw new Error("codex_sandbox_actions_required");
|
|
689
840
|
const provider = sandboxConfig.provider ?? "sprites";
|
|
690
841
|
const homeDir = provider === "vercel" ? "/vercel/sandbox" : "/home/sprite";
|
|
691
842
|
const codexHome = String(sandboxConfig.codexHome ?? `${homeDir}/.codex`).trim() || `${homeDir}/.codex`;
|
|
@@ -700,6 +851,7 @@ async function executeCodexSandboxTurn(args, helpers) {
|
|
|
700
851
|
const instructionPath = `${workRoot}/instruction-${args.executionId}-${args.stepId}.txt`;
|
|
701
852
|
const checkpoints = [];
|
|
702
853
|
const observedCommandProcesses = new Map();
|
|
854
|
+
const observedCommandProcessResults = new Map();
|
|
703
855
|
let sandboxId = String(sandboxConfig.sandboxId ?? "").trim();
|
|
704
856
|
if (!sandboxId) {
|
|
705
857
|
const created = ensureOk(await actions.createSandbox({
|
|
@@ -737,7 +889,7 @@ async function executeCodexSandboxTurn(args, helpers) {
|
|
|
737
889
|
const codexItemId = asString(item.id);
|
|
738
890
|
if (!codexItemId || observedCommandProcesses.has(codexItemId))
|
|
739
891
|
return;
|
|
740
|
-
if (!sandboxDb
|
|
892
|
+
if (!hasStreamCapableSandboxDb(sandboxDb))
|
|
741
893
|
return;
|
|
742
894
|
const processId = randomUUID();
|
|
743
895
|
const streamClientId = `sandbox-process:${processId}`;
|
|
@@ -799,6 +951,11 @@ async function executeCodexSandboxTurn(args, helpers) {
|
|
|
799
951
|
writer,
|
|
800
952
|
seq: 1,
|
|
801
953
|
});
|
|
954
|
+
observedCommandProcessResults.set(codexItemId, {
|
|
955
|
+
processId,
|
|
956
|
+
streamId,
|
|
957
|
+
streamClientId,
|
|
958
|
+
});
|
|
802
959
|
return;
|
|
803
960
|
}
|
|
804
961
|
if (method === "item/commandExecution/outputDelta") {
|
|
@@ -981,18 +1138,18 @@ async function executeCodexSandboxTurn(args, helpers) {
|
|
|
981
1138
|
await runProcess("codex_sandbox_start_app", [
|
|
982
1139
|
"set -euo pipefail",
|
|
983
1140
|
`cd ${shellSingleQuote(repoPath)}`,
|
|
984
|
-
`if ! curl -fsS http://127.0.0.1:${appPort}/api/
|
|
1141
|
+
`if ! curl -fsS http://127.0.0.1:${appPort}/api/domain >/dev/null 2>&1; then`,
|
|
985
1142
|
` nohup npx -y pnpm@10.15.1 dev --hostname 0.0.0.0 --port ${appPort} > /tmp/ekairos-app-${appPort}.log 2>&1 &`,
|
|
986
1143
|
` echo $! > /tmp/ekairos-app-${appPort}.pid`,
|
|
987
1144
|
"fi",
|
|
988
|
-
`for i in $(seq 1 180); do curl -fsS http://127.0.0.1:${appPort}/api/
|
|
1145
|
+
`for i in $(seq 1 180); do curl -fsS http://127.0.0.1:${appPort}/api/domain >/dev/null 2>&1 && echo codex_sandbox_start_app_ok && exit 0; sleep 1; done`,
|
|
989
1146
|
`cat /tmp/ekairos-app-${appPort}.log || true`,
|
|
990
1147
|
"exit 1",
|
|
991
1148
|
].join("\n"), "dev-server", "codex_sandbox_start_app_ok");
|
|
992
1149
|
const portUrl = ensureOk(await actions.getPortUrl({ sandboxId, port: appPort }), "codex_sandbox_port_url");
|
|
993
1150
|
appBaseUrl = String(portUrl.url ?? "").replace(/\/+$/, "");
|
|
994
1151
|
if (appBaseUrl) {
|
|
995
|
-
const response = await fetch(`${appBaseUrl}/api/
|
|
1152
|
+
const response = await fetch(`${appBaseUrl}/api/domain`);
|
|
996
1153
|
if (!response.ok)
|
|
997
1154
|
throw new Error(`codex_sandbox_app_url_unavailable_${response.status}`);
|
|
998
1155
|
}
|
|
@@ -1049,6 +1206,7 @@ async function executeCodexSandboxTurn(args, helpers) {
|
|
|
1049
1206
|
processId: "",
|
|
1050
1207
|
streamId: "",
|
|
1051
1208
|
streamClientId: "",
|
|
1209
|
+
commandProcesses: Object.fromEntries(observedCommandProcessResults.entries()),
|
|
1052
1210
|
checkpoints,
|
|
1053
1211
|
},
|
|
1054
1212
|
providerResponse: asRecord(turn.metadata).providerResponse,
|
|
@@ -1272,12 +1430,17 @@ export async function executeCodexAppServerTurnStep(args) {
|
|
|
1272
1430
|
if (!mapped || mapped.skip)
|
|
1273
1431
|
return;
|
|
1274
1432
|
sequence += 1;
|
|
1433
|
+
const identity = completeCodexMappedChunkIdentity(mapped, args.stepId);
|
|
1275
1434
|
const mappedChunk = {
|
|
1276
1435
|
at: new Date().toISOString(),
|
|
1277
1436
|
sequence,
|
|
1278
1437
|
chunkType: mapped.chunkType,
|
|
1279
1438
|
providerChunkType: mapped.providerChunkType,
|
|
1280
|
-
|
|
1439
|
+
partId: identity.partId,
|
|
1440
|
+
providerPartId: identity.providerPartId,
|
|
1441
|
+
partType: identity.partType,
|
|
1442
|
+
partSlot: identity.partSlot,
|
|
1443
|
+
actionRef: identity.actionRef,
|
|
1281
1444
|
data: mapped.data,
|
|
1282
1445
|
raw: mapped.raw ?? toJsonSafe(providerChunk),
|
|
1283
1446
|
};
|
|
@@ -1291,11 +1454,18 @@ export async function executeCodexAppServerTurnStep(args) {
|
|
|
1291
1454
|
chunkType: mappedChunk.chunkType,
|
|
1292
1455
|
provider: "codex",
|
|
1293
1456
|
providerChunkType: mappedChunk.providerChunkType,
|
|
1457
|
+
partId: mappedChunk.partId,
|
|
1458
|
+
providerPartId: mappedChunk.providerPartId,
|
|
1459
|
+
partType: mappedChunk.partType,
|
|
1460
|
+
partSlot: mappedChunk.partSlot,
|
|
1294
1461
|
actionRef: mappedChunk.actionRef,
|
|
1295
1462
|
data: mappedChunk.data,
|
|
1296
1463
|
raw: mappedChunk.raw,
|
|
1297
1464
|
};
|
|
1298
|
-
await contextWriter?.write(encodeContextStepStreamChunk(createContextStepStreamChunk(
|
|
1465
|
+
await contextWriter?.write(encodeContextStepStreamChunk(createContextStepStreamChunk({
|
|
1466
|
+
...payload,
|
|
1467
|
+
stepId: args.stepId,
|
|
1468
|
+
})));
|
|
1299
1469
|
await workflowWriter?.write({
|
|
1300
1470
|
type: "data-chunk.emitted",
|
|
1301
1471
|
data: {
|
|
@@ -1528,13 +1698,12 @@ export function createCodexReactor(options) {
|
|
|
1528
1698
|
const context = asRecord(params.context.content);
|
|
1529
1699
|
const instruction = (options.buildInstruction
|
|
1530
1700
|
? await options.buildInstruction({
|
|
1531
|
-
env: params.env,
|
|
1532
1701
|
context,
|
|
1533
1702
|
triggerEvent: params.triggerEvent,
|
|
1534
1703
|
})
|
|
1535
1704
|
: defaultInstructionFromTrigger(params.triggerEvent)).trim();
|
|
1536
1705
|
const config = await options.resolveConfig({
|
|
1537
|
-
|
|
1706
|
+
runtime: params.runtime,
|
|
1538
1707
|
context,
|
|
1539
1708
|
triggerEvent: params.triggerEvent,
|
|
1540
1709
|
contextId: params.contextId,
|
|
@@ -1563,7 +1732,7 @@ export function createCodexReactor(options) {
|
|
|
1563
1732
|
config.repoPath = repoPath;
|
|
1564
1733
|
}
|
|
1565
1734
|
}
|
|
1566
|
-
const effectiveActionSpecs = toCodexActionSpecs(
|
|
1735
|
+
const effectiveActionSpecs = toCodexActionSpecs(actionsToActionSpecs(params.actions));
|
|
1567
1736
|
const startedAtMs = Date.now();
|
|
1568
1737
|
let streamedAssistantText = "";
|
|
1569
1738
|
let streamedReasoningText = "";
|
|
@@ -1625,12 +1794,17 @@ export function createCodexReactor(options) {
|
|
|
1625
1794
|
return;
|
|
1626
1795
|
const now = new Date().toISOString();
|
|
1627
1796
|
chunkSequence += 1;
|
|
1797
|
+
const identity = completeCodexMappedChunkIdentity(mapped, params.stepId);
|
|
1628
1798
|
const mappedChunk = {
|
|
1629
1799
|
at: now,
|
|
1630
1800
|
sequence: chunkSequence,
|
|
1631
1801
|
chunkType: mapped.chunkType,
|
|
1632
1802
|
providerChunkType: mapped.providerChunkType,
|
|
1633
|
-
|
|
1803
|
+
partId: identity.partId,
|
|
1804
|
+
providerPartId: identity.providerPartId,
|
|
1805
|
+
partType: identity.partType,
|
|
1806
|
+
partSlot: identity.partSlot,
|
|
1807
|
+
actionRef: identity.actionRef,
|
|
1634
1808
|
data: mapped.data,
|
|
1635
1809
|
raw: includeRawProviderChunksInOutput
|
|
1636
1810
|
? mapped.raw ?? toJsonSafe(providerChunk)
|
|
@@ -1692,6 +1866,10 @@ export function createCodexReactor(options) {
|
|
|
1692
1866
|
chunkType: mappedChunk.chunkType,
|
|
1693
1867
|
provider: "codex",
|
|
1694
1868
|
providerChunkType: mappedChunk.providerChunkType,
|
|
1869
|
+
partId: mappedChunk.partId,
|
|
1870
|
+
providerPartId: mappedChunk.providerPartId,
|
|
1871
|
+
partType: mappedChunk.partType,
|
|
1872
|
+
partSlot: mappedChunk.partSlot,
|
|
1695
1873
|
actionRef: mappedChunk.actionRef,
|
|
1696
1874
|
data: mappedChunk.data,
|
|
1697
1875
|
raw: mapped.raw ?? toJsonSafe(providerChunk),
|
|
@@ -1699,7 +1877,10 @@ export function createCodexReactor(options) {
|
|
|
1699
1877
|
if (params.contextStepStream) {
|
|
1700
1878
|
const writer = params.contextStepStream.getWriter();
|
|
1701
1879
|
try {
|
|
1702
|
-
await writer.write(encodeContextStepStreamChunk(createContextStepStreamChunk(
|
|
1880
|
+
await writer.write(encodeContextStepStreamChunk(createContextStepStreamChunk({
|
|
1881
|
+
...payload,
|
|
1882
|
+
stepId: params.stepId,
|
|
1883
|
+
})));
|
|
1703
1884
|
}
|
|
1704
1885
|
finally {
|
|
1705
1886
|
writer.releaseLock();
|
|
@@ -1727,7 +1908,6 @@ export function createCodexReactor(options) {
|
|
|
1727
1908
|
};
|
|
1728
1909
|
const turn = options.executeTurn
|
|
1729
1910
|
? await options.executeTurn({
|
|
1730
|
-
env: params.env,
|
|
1731
1911
|
runtime: params.runtime,
|
|
1732
1912
|
context,
|
|
1733
1913
|
triggerEvent: params.triggerEvent,
|
|
@@ -1745,12 +1925,10 @@ export function createCodexReactor(options) {
|
|
|
1745
1925
|
contextIdentifier: params.contextIdentifier,
|
|
1746
1926
|
contextStepStream: params.contextStepStream,
|
|
1747
1927
|
writable: params.writable,
|
|
1748
|
-
silent: params.silent,
|
|
1749
1928
|
emitChunk,
|
|
1750
1929
|
})
|
|
1751
1930
|
: await executeCodexAppServerTurnStep({
|
|
1752
1931
|
config,
|
|
1753
|
-
env: params.env,
|
|
1754
1932
|
runtime: params.runtime,
|
|
1755
1933
|
instruction,
|
|
1756
1934
|
systemPrompt: params.systemPrompt,
|
|
@@ -1766,7 +1944,6 @@ export function createCodexReactor(options) {
|
|
|
1766
1944
|
contextIdentifier: params.contextIdentifier,
|
|
1767
1945
|
contextStepStream: params.contextStepStream,
|
|
1768
1946
|
writable: params.writable,
|
|
1769
|
-
silent: params.silent,
|
|
1770
1947
|
});
|
|
1771
1948
|
const finishedAtMs = Date.now();
|
|
1772
1949
|
const returnedStreamTrace = asRecord(asRecord(turn.metadata).streamTrace);
|