@atolis-hq/wake 0.2.85 → 0.2.86
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.
|
@@ -5,8 +5,7 @@ import { writeRunnerTranscript } from '../runner/transcripts.js';
|
|
|
5
5
|
import { createAgentExecution } from '../../core/live-execution.js';
|
|
6
6
|
import { parseRunnerResult } from '../../domain/schema.js';
|
|
7
7
|
const CODEX_CLI_NAME = 'Codex';
|
|
8
|
-
|
|
9
|
-
const prompt = buildCodexPromptText(input);
|
|
8
|
+
function buildCodexExecPrefixArgs(input) {
|
|
10
9
|
return [
|
|
11
10
|
'--ask-for-approval',
|
|
12
11
|
'never',
|
|
@@ -22,16 +21,20 @@ export function buildCodexExecArgs(input) {
|
|
|
22
21
|
input.cwd,
|
|
23
22
|
'--model',
|
|
24
23
|
input.model,
|
|
25
|
-
prompt,
|
|
26
24
|
];
|
|
27
25
|
}
|
|
26
|
+
export function buildCodexExecArgs(input) {
|
|
27
|
+
const prompt = buildCodexPromptText(input);
|
|
28
|
+
return [...buildCodexExecPrefixArgs(input), prompt];
|
|
29
|
+
}
|
|
28
30
|
export function buildCodexPromptText(input) {
|
|
29
31
|
return input.harnessPrompt === undefined
|
|
30
32
|
? input.prompt
|
|
31
33
|
: `${input.harnessPrompt}\n\n${input.prompt}`;
|
|
32
34
|
}
|
|
33
35
|
export function buildCodexResumeArgs(input) {
|
|
34
|
-
|
|
36
|
+
const prompt = buildCodexPromptText(input);
|
|
37
|
+
return [...buildCodexExecPrefixArgs(input), 'resume', input.sessionId, prompt];
|
|
35
38
|
}
|
|
36
39
|
function compactLogValue(value) {
|
|
37
40
|
return value.replace(/\s+/g, ' ').trim();
|
|
@@ -204,7 +207,10 @@ export function createCodexRunner(options) {
|
|
|
204
207
|
return createAgentExecution(input, (liveInput) => runner.run(liveInput));
|
|
205
208
|
},
|
|
206
209
|
async run(input) {
|
|
207
|
-
const
|
|
210
|
+
const priorSessionId = input.projection.wake.sessionId;
|
|
211
|
+
const priorSessionCli = input.projection.wake.sessionCli;
|
|
212
|
+
const isResume = priorSessionId !== undefined && priorSessionCli === CODEX_CLI_NAME;
|
|
213
|
+
const runMode = isResume ? 'resume' : 'start';
|
|
208
214
|
const toolCapabilityNote = buildCodexToolCapabilityNote({
|
|
209
215
|
...(input.workspaceMode === undefined ? {} : { workspaceMode: input.workspaceMode }),
|
|
210
216
|
mode: runMode,
|
|
@@ -259,18 +265,30 @@ export function createCodexRunner(options) {
|
|
|
259
265
|
recentEventIds: input.recentEvents.map((event) => event.eventId),
|
|
260
266
|
model,
|
|
261
267
|
...(input.workspacePath === undefined ? {} : { workspacePath: input.workspacePath }),
|
|
268
|
+
...(isResume ? { sessionId: priorSessionId } : {}),
|
|
262
269
|
}));
|
|
263
270
|
const result = await runAgentCliCommand({
|
|
264
271
|
command: options.command,
|
|
265
|
-
args:
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
272
|
+
args: isResume
|
|
273
|
+
? buildCodexResumeArgs({
|
|
274
|
+
model,
|
|
275
|
+
prompt: promptText,
|
|
276
|
+
cwd,
|
|
277
|
+
sandboxMode,
|
|
278
|
+
sessionId: priorSessionId,
|
|
279
|
+
...(options.settings.reasoningEffort === undefined
|
|
280
|
+
? {}
|
|
281
|
+
: { reasoningEffort: options.settings.reasoningEffort }),
|
|
282
|
+
})
|
|
283
|
+
: buildCodexExecArgs({
|
|
284
|
+
model,
|
|
285
|
+
prompt: promptText,
|
|
286
|
+
cwd,
|
|
287
|
+
sandboxMode,
|
|
288
|
+
...(options.settings.reasoningEffort === undefined
|
|
289
|
+
? {}
|
|
290
|
+
: { reasoningEffort: options.settings.reasoningEffort }),
|
|
291
|
+
}),
|
|
274
292
|
cwd,
|
|
275
293
|
timeoutMs: options.settings.timeoutMs,
|
|
276
294
|
...(input.cancellationSignal === undefined
|
|
@@ -93,14 +93,14 @@ export function createRunnerCliAdapter(input) {
|
|
|
93
93
|
};
|
|
94
94
|
},
|
|
95
95
|
buildResumeCommand({ sessionId }) {
|
|
96
|
-
return ['codex', 'resume', sessionId];
|
|
96
|
+
return ['codex', 'exec', 'resume', sessionId];
|
|
97
97
|
},
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
export function buildResumeCommandForCli(input) {
|
|
101
101
|
const normalizedCli = input.cli.trim().toLowerCase();
|
|
102
102
|
if (normalizedCli === 'codex') {
|
|
103
|
-
return ['codex', 'resume', input.sessionId];
|
|
103
|
+
return ['codex', 'exec', 'resume', input.sessionId];
|
|
104
104
|
}
|
|
105
105
|
if (normalizedCli === 'claude') {
|
|
106
106
|
return ['claude', '--resume', input.sessionId];
|
package/dist/src/version.js
CHANGED