agentbox-sdk 0.1.511 → 0.1.513
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/README.md +40 -28
- package/dist/agents/index.d.ts +2 -2
- package/dist/agents/index.js +1 -1
- package/dist/{chunk-G3VEVR6Y.js → chunk-XJWZR2NR.js} +116 -125
- package/dist/events/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{types-B4yy80AJ.d.ts → types-NhKw_6mW.d.ts} +16 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,33 +130,31 @@ default 30 minutes, `0` settles at the first turn end as before, `Infinity`
|
|
|
130
130
|
waits forever. On expiry the tasks are stopped best-effort and the run
|
|
131
131
|
completes with the last turn's text.
|
|
132
132
|
|
|
133
|
-
Codex
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
the
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
the
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
originating run observes as an interrupted turn and reports as `run.cancelled`;
|
|
159
|
-
the leftover processes are then terminated.
|
|
133
|
+
Codex owns command polling (`write_stdin`), yielded code-mode waits (`wait`),
|
|
134
|
+
and subagent waits (`wait_agent`). AgentBox finishes an ordinary Codex run on
|
|
135
|
+
its root `turn/completed`, regardless of shell processes still running. It does
|
|
136
|
+
not classify commands, wait for their exit, or inject synthetic follow-up turns.
|
|
137
|
+
Raw tool events remain available. A command ending after the final turn does
|
|
138
|
+
not restart the model. Remote cleanup disconnects from the shared app-server;
|
|
139
|
+
local cleanup shuts down the app-server it owns.
|
|
140
|
+
|
|
141
|
+
Native Codex goals are a separate lifecycle: an active root-thread goal keeps
|
|
142
|
+
the run open between turns so Codex can continue on its own. AgentBox reports
|
|
143
|
+
these gaps with `background.tasks { tasks: [], waiting: true }` and clears the
|
|
144
|
+
wait when the next native turn starts. A root goal becoming `complete` or
|
|
145
|
+
`blocked` ends the run after its final turn; a goal cleared or made inactive
|
|
146
|
+
while idle settles immediately. Child-thread and stale-turn goal updates do
|
|
147
|
+
not end the root run. `blocked` preserves the final answer without implying
|
|
148
|
+
that the objective was achieved.
|
|
149
|
+
|
|
150
|
+
Only these native goal waits use `backgroundTaskTimeoutMs` for Codex. The
|
|
151
|
+
15-second idle grace and total wait ceiling bound the gap between native turns;
|
|
152
|
+
`0` settles at the first turn. Expiry settles with the last answer without
|
|
153
|
+
terminating remote shell processes. A user message can resume an idle goal
|
|
154
|
+
wait. Stateless cancellation (`Agent.attach(...).abort()`) interrupts an active
|
|
155
|
+
turn, or starts a turn only to interrupt it if the thread is idle, then stops
|
|
156
|
+
the idle thread's leftover terminals. Claude Code and OpenCode retain their own
|
|
157
|
+
background-work handling described above and below.
|
|
160
158
|
|
|
161
159
|
OpenCode has no background shells, monitors, or wake-ups; its only work that
|
|
162
160
|
outlives a turn is `task {background: true}`, which the server accepts only when
|
|
@@ -204,13 +202,15 @@ Pass an optional `reasoning` level alongside `model` on any run. It maps to each
|
|
|
204
202
|
```ts
|
|
205
203
|
await agent.run({
|
|
206
204
|
model: "sonnet",
|
|
207
|
-
reasoning: "high", // "low" | "medium" | "high" | "xhigh"
|
|
205
|
+
reasoning: "high", // "low" | "medium" | "high" | "xhigh" | "max" | "ultra"
|
|
208
206
|
input: "Refactor this module and explain your reasoning.",
|
|
209
207
|
});
|
|
210
208
|
```
|
|
211
209
|
|
|
212
210
|
`xhigh` requires a model that supports it (e.g. Claude Opus 4.7+, Codex `gpt-5.4`).
|
|
213
211
|
|
|
212
|
+
Codex also supports `max` (maximum reasoning) and `ultra` (maximum reasoning with automatic task delegation). Astra, GPT-5.6 Sol, and GPT-5.6 Terra support both; GPT-5.6 Luna supports `max`. Check the runtime's `model/list` → `supportedReasoningEfforts` for model availability. Both values are forwarded unchanged to `turn/start.effort`, including resumed and plan-mode turns; other AgentBox providers reject them.
|
|
213
|
+
|
|
214
214
|
### Open-source & custom models (OpenRouter, OSS)
|
|
215
215
|
|
|
216
216
|
Codex isn't limited to OpenAI models — it can route through any
|
|
@@ -648,3 +648,15 @@ CLIs and SDK mocks; live tests remain opt-in.
|
|
|
648
648
|
## License
|
|
649
649
|
|
|
650
650
|
MIT
|
|
651
|
+
|
|
652
|
+
For native speed selection, use `provider: { serviceTier: "fast" }` with Codex (or `"default"` for standard speed), and `provider: { fastMode: true }` with Claude Code. Omit these options to inherit harness settings. Availability and usage charges are enforced by the harness.
|
|
653
|
+
|
|
654
|
+
### Preparing local Codex before a prompt
|
|
655
|
+
|
|
656
|
+
For an interactive host, `provider: { prewarm: true }` makes `await agent.setup()`
|
|
657
|
+
start and initialize the next Codex app-server. It does not create a thread, send
|
|
658
|
+
a prompt, or run tools. The next `stream()`/`run()` consumes that prepared process
|
|
659
|
+
and stops it normally when the run ends; abort still stops the owned process.
|
|
660
|
+
A prepared process that exited while idle is replaced before execution. Call
|
|
661
|
+
`await agent.killServer()` to dispose an unused prepared process. Prewarming is
|
|
662
|
+
host-only and opt-in. Use a new Agent for a changed cwd, environment, or policy.
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, a9 as RawAgentEvent, b as AgentAttachRequest, B as AttachedRun, ag as SetupLayout, am as UserContent } from '../types-
|
|
2
|
-
export { a as AgentApprovalMode, c as AgentCommandConfig, d as AgentCostData, e as AgentExecutionRequest, f as AgentLocalMcpConfig, g as AgentMcpConfig, i as AgentOptionsBase, j as AgentOptionsMap, k as AgentPermissionDecision, l as AgentPermissionKind, m as AgentPermissionResponse, n as AgentProviderAdapter, p as AgentReasoningEffort, q as AgentRemoteMcpConfig, u as AgentRunSink, v as AgentSetupRequest, w as AgentSkillConfig, x as AgentSubAgentConfig, y as AgentUserAnswer, z as AgentUserQuestion, E as ClaudeCodeAgentOptions, F as ClaudeCodeHookConfig, G as ClaudeCodeHookEvent, H as ClaudeCodeHookHandler, I as ClaudeCodeHookMatcherGroup, J as ClaudeCodeHooksConfig, K as ClaudeCodeProviderOptions, L as CodexAgentOptions, M as CodexCommandHook, N as CodexHookEvent, O as CodexHookMatcherGroup, P as CodexHooksConfig, Q as CodexModelProviderConfig, R as CodexProviderOptions, S as DataContent, T as EmbeddedSkillConfig, U as FilePart, V as ImagePart, a1 as OpenCodeAgentOptions, a2 as OpenCodePluginConfig, a3 as OpenCodePluginEvent, a4 as OpenCodePluginHookConfig, a5 as OpenCodeProviderOptions, a6 as OpenRouterPlugin, ab as RepoSkillConfig, ai as TextPart, an as UserContentPart } from '../types-
|
|
1
|
+
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, a9 as RawAgentEvent, b as AgentAttachRequest, B as AttachedRun, ag as SetupLayout, am as UserContent } from '../types-NhKw_6mW.js';
|
|
2
|
+
export { a as AgentApprovalMode, c as AgentCommandConfig, d as AgentCostData, e as AgentExecutionRequest, f as AgentLocalMcpConfig, g as AgentMcpConfig, i as AgentOptionsBase, j as AgentOptionsMap, k as AgentPermissionDecision, l as AgentPermissionKind, m as AgentPermissionResponse, n as AgentProviderAdapter, p as AgentReasoningEffort, q as AgentRemoteMcpConfig, u as AgentRunSink, v as AgentSetupRequest, w as AgentSkillConfig, x as AgentSubAgentConfig, y as AgentUserAnswer, z as AgentUserQuestion, E as ClaudeCodeAgentOptions, F as ClaudeCodeHookConfig, G as ClaudeCodeHookEvent, H as ClaudeCodeHookHandler, I as ClaudeCodeHookMatcherGroup, J as ClaudeCodeHooksConfig, K as ClaudeCodeProviderOptions, L as CodexAgentOptions, M as CodexCommandHook, N as CodexHookEvent, O as CodexHookMatcherGroup, P as CodexHooksConfig, Q as CodexModelProviderConfig, R as CodexProviderOptions, S as DataContent, T as EmbeddedSkillConfig, U as FilePart, V as ImagePart, a1 as OpenCodeAgentOptions, a2 as OpenCodePluginConfig, a3 as OpenCodePluginEvent, a4 as OpenCodePluginHookConfig, a5 as OpenCodeProviderOptions, a6 as OpenRouterPlugin, ab as RepoSkillConfig, ai as TextPart, an as UserContentPart } from '../types-NhKw_6mW.js';
|
|
3
3
|
import { S as Sandbox } from '../Sandbox-DcKAU-E3.js';
|
|
4
4
|
export { AgentProvider } from '../enums.js';
|
|
5
5
|
import 'e2b';
|
package/dist/agents/index.js
CHANGED
|
@@ -2051,12 +2051,16 @@ function buildClaudeQueryOptions(params) {
|
|
|
2051
2051
|
extraArgs["append-system-prompt"] = run.systemPrompt;
|
|
2052
2052
|
}
|
|
2053
2053
|
const includeHookEvents = provider?.includeHookEvents ?? false;
|
|
2054
|
+
if (run.reasoning === "max" || run.reasoning === "ultra") {
|
|
2055
|
+
throw new Error(`Reasoning effort "${run.reasoning}" is only supported by Codex.`);
|
|
2056
|
+
}
|
|
2054
2057
|
const effort = provider?.ultracode ? "xhigh" : run.reasoning;
|
|
2055
2058
|
return {
|
|
2056
2059
|
cwd: params.cwd ?? params.request.options.cwd,
|
|
2057
2060
|
env: params.env,
|
|
2058
2061
|
pathToClaudeCodeExecutable: provider?.binary ?? "claude",
|
|
2059
2062
|
...params.settingsPath ? { settings: params.settingsPath } : {},
|
|
2063
|
+
...params.request.options.configuration === "native" && provider?.fastMode !== void 0 ? { settings: { fastMode: provider.fastMode } } : {},
|
|
2060
2064
|
...params.request.options.configuration === "native" ? {
|
|
2061
2065
|
settingSources: ["user", "project", "local"],
|
|
2062
2066
|
systemPrompt: { type: "preset", preset: "claude_code" }
|
|
@@ -2704,7 +2708,11 @@ var ClaudeCodeAgentAdapter = class {
|
|
|
2704
2708
|
const workflowSettings = buildClaudeWorkflowSettings(
|
|
2705
2709
|
options.provider?.ultracode
|
|
2706
2710
|
);
|
|
2707
|
-
const claudeSettings = {
|
|
2711
|
+
const claudeSettings = {
|
|
2712
|
+
...hookSettings,
|
|
2713
|
+
...workflowSettings,
|
|
2714
|
+
...options.provider?.fastMode !== void 0 ? { fastMode: options.provider.fastMode } : {}
|
|
2715
|
+
};
|
|
2708
2716
|
const mcpConfigJson = buildClaudeMcpConfig(options.mcps) ?? JSON.stringify({ mcpServers: {} }, null, 2);
|
|
2709
2717
|
const artifacts = [
|
|
2710
2718
|
...!sandbox ? [{ path: path8.join(target.layout.claudeDir, ".claude-plugin", "plugin.json"), content: JSON.stringify({ name: "agentbox", version: "1.0.0" }) }] : [],
|
|
@@ -3642,6 +3650,7 @@ function buildThreadParams(cwd, options, request) {
|
|
|
3642
3650
|
return {
|
|
3643
3651
|
cwd,
|
|
3644
3652
|
model: request.run.model ?? null,
|
|
3653
|
+
...request.options.provider?.serviceTier !== void 0 ? { serviceTier: request.options.provider.serviceTier } : {},
|
|
3645
3654
|
...options.provider?.approvalPolicy ? { approvalPolicy: options.provider.approvalPolicy } : options.configuration === "native" && !options.fullAccess ? {} : { approvalPolicy: !options.fullAccess && isInteractiveApproval(options) ? "untrusted" : "never" },
|
|
3646
3655
|
sandbox: buildCodexSandboxMode(options),
|
|
3647
3656
|
serviceName: "agentbox",
|
|
@@ -3657,6 +3666,7 @@ function buildResumeParams(cwd, options, request) {
|
|
|
3657
3666
|
threadId: request.run.resumeSessionId,
|
|
3658
3667
|
cwd,
|
|
3659
3668
|
model: request.run.model ?? null,
|
|
3669
|
+
...request.options.provider?.serviceTier !== void 0 ? { serviceTier: request.options.provider.serviceTier } : {},
|
|
3660
3670
|
...options.provider?.approvalPolicy ? { approvalPolicy: options.provider.approvalPolicy } : options.configuration === "native" && !options.fullAccess ? {} : { approvalPolicy: !options.fullAccess && isInteractiveApproval(options) ? "untrusted" : "never" },
|
|
3661
3671
|
sandbox: buildCodexSandboxMode(options),
|
|
3662
3672
|
...request.run.systemPrompt ? { developerInstructions: request.run.systemPrompt } : options.configuration === "native" ? {} : { developerInstructions: null },
|
|
@@ -3673,6 +3683,7 @@ function buildForkParams(cwd, options, request) {
|
|
|
3673
3683
|
lastTurnId: request.run.forkAtMessageId ?? null,
|
|
3674
3684
|
cwd,
|
|
3675
3685
|
model: request.run.model ?? null,
|
|
3686
|
+
...request.options.provider?.serviceTier !== void 0 ? { serviceTier: request.options.provider.serviceTier } : {},
|
|
3676
3687
|
...options.provider?.approvalPolicy ? { approvalPolicy: options.provider.approvalPolicy } : options.configuration === "native" && !options.fullAccess ? {} : { approvalPolicy: !options.fullAccess && isInteractiveApproval(options) ? "untrusted" : "never" },
|
|
3677
3688
|
sandbox: buildCodexSandboxMode(options),
|
|
3678
3689
|
...request.run.systemPrompt ? { developerInstructions: request.run.systemPrompt } : options.configuration === "native" ? {} : { developerInstructions: null },
|
|
@@ -3712,6 +3723,7 @@ function buildCodexTurnStartParams(params) {
|
|
|
3712
3723
|
},
|
|
3713
3724
|
...sandboxPolicy ? { sandboxPolicy } : {},
|
|
3714
3725
|
model: request.run.model ?? null,
|
|
3726
|
+
...request.options.provider?.serviceTier !== void 0 ? { serviceTier: request.options.provider.serviceTier } : {},
|
|
3715
3727
|
effort: request.run.reasoning ?? null,
|
|
3716
3728
|
...request.run.mode ? { collaborationMode: {
|
|
3717
3729
|
mode: request.run.mode,
|
|
@@ -3720,23 +3732,6 @@ function buildCodexTurnStartParams(params) {
|
|
|
3720
3732
|
outputSchema: null
|
|
3721
3733
|
};
|
|
3722
3734
|
}
|
|
3723
|
-
var BACKGROUND_OUTPUT_TAIL_CHARS = 4e3;
|
|
3724
|
-
function buildCodexBackgroundFollowUp(items) {
|
|
3725
|
-
const reports = items.map((item) => {
|
|
3726
|
-
const tail = (item.aggregatedOutput ?? "").slice(-BACKGROUND_OUTPUT_TAIL_CHARS).trimEnd();
|
|
3727
|
-
const duration = item.durationMs === void 0 ? "an unknown time" : `${Math.round(item.durationMs / 1e3)}s`;
|
|
3728
|
-
return `\`${item.command}\` exited with code ${item.exitCode ?? "unknown"} after ${duration}.
|
|
3729
|
-
Output (last ${BACKGROUND_OUTPUT_TAIL_CHARS} chars):
|
|
3730
|
-
\`\`\`
|
|
3731
|
-
${tail || "(no output)"}
|
|
3732
|
-
\`\`\`
|
|
3733
|
-
`;
|
|
3734
|
-
});
|
|
3735
|
-
return `Background command finished while you were idle.
|
|
3736
|
-
|
|
3737
|
-
${reports.join("")}
|
|
3738
|
-
Continue from here: verify the outcome and finish the task. Do not restart the command.`;
|
|
3739
|
-
}
|
|
3740
3735
|
var CODEX_CANCEL_TURN_TEXT = "Run cancelled by the host.";
|
|
3741
3736
|
async function terminateBackgroundTerminals(client, threadId) {
|
|
3742
3737
|
await withTimeout((async () => {
|
|
@@ -4430,6 +4425,7 @@ async function createRuntime(request, inputParts) {
|
|
|
4430
4425
|
cleanup: async () => {
|
|
4431
4426
|
await processHandle.kill();
|
|
4432
4427
|
},
|
|
4428
|
+
isAlive: () => processHandle.child.exitCode === null && processHandle.child.signalCode === null && !processHandle.child.killed,
|
|
4433
4429
|
raw: { processHandle, codexDir },
|
|
4434
4430
|
inputItems
|
|
4435
4431
|
};
|
|
@@ -4477,11 +4473,47 @@ async function killCodexAppServer(request) {
|
|
|
4477
4473
|
{ cwd: options.cwd, timeoutMs: 1e4 }
|
|
4478
4474
|
).catch(() => void 0);
|
|
4479
4475
|
}
|
|
4476
|
+
async function initializeCodexClient(client) {
|
|
4477
|
+
await client.request("initialize", {
|
|
4478
|
+
clientInfo: { title: "AgentBox", name: "AgentBox", version: "0.1.0" },
|
|
4479
|
+
capabilities: { experimentalApi: true }
|
|
4480
|
+
});
|
|
4481
|
+
await client.notify("initialized", {});
|
|
4482
|
+
}
|
|
4480
4483
|
var CodexAgentAdapter = class {
|
|
4484
|
+
prepared;
|
|
4485
|
+
preparationGeneration = 0;
|
|
4481
4486
|
async setup(request) {
|
|
4487
|
+
const generation = this.preparationGeneration;
|
|
4488
|
+
if (request.options.provider?.prewarm && request.options.sandbox) {
|
|
4489
|
+
throw new Error("Codex prewarm is only supported for host execution.");
|
|
4490
|
+
}
|
|
4482
4491
|
await setupCodex(request);
|
|
4492
|
+
if (!request.options.provider?.prewarm || this.prepared?.isAlive?.()) return;
|
|
4493
|
+
await this.prepared?.cleanup();
|
|
4494
|
+
if (generation !== this.preparationGeneration) throw new Error("Codex preparation was cancelled.");
|
|
4495
|
+
const runtime = await createRuntime(request, []);
|
|
4496
|
+
if (generation !== this.preparationGeneration) {
|
|
4497
|
+
await runtime.cleanup();
|
|
4498
|
+
throw new Error("Codex preparation was cancelled.");
|
|
4499
|
+
}
|
|
4500
|
+
const client = new JsonRpcLineClient(runtime.source, runtime.writeLine);
|
|
4501
|
+
const prepared = { ...runtime, client };
|
|
4502
|
+
this.prepared = prepared;
|
|
4503
|
+
try {
|
|
4504
|
+
await withTimeout(initializeCodexClient(client), 1e4);
|
|
4505
|
+
if (this.prepared !== prepared) throw new Error("Codex preparation was cancelled.");
|
|
4506
|
+
} catch (error) {
|
|
4507
|
+
if (this.prepared === prepared) this.prepared = void 0;
|
|
4508
|
+
await runtime.cleanup();
|
|
4509
|
+
throw error;
|
|
4510
|
+
}
|
|
4483
4511
|
}
|
|
4484
4512
|
async killServer(request) {
|
|
4513
|
+
this.preparationGeneration++;
|
|
4514
|
+
const prepared = this.prepared;
|
|
4515
|
+
this.prepared = void 0;
|
|
4516
|
+
await prepared?.cleanup();
|
|
4485
4517
|
await killCodexAppServer(request);
|
|
4486
4518
|
}
|
|
4487
4519
|
async execute(request, sink) {
|
|
@@ -4492,11 +4524,20 @@ var CodexAgentAdapter = class {
|
|
|
4492
4524
|
"validateProviderUserInput",
|
|
4493
4525
|
() => validateProviderUserInput(request.provider, request.run.input)
|
|
4494
4526
|
);
|
|
4495
|
-
const
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4527
|
+
const prepared = this.prepared;
|
|
4528
|
+
this.prepared = void 0;
|
|
4529
|
+
let runtime;
|
|
4530
|
+
if (prepared?.isAlive?.()) {
|
|
4531
|
+
try {
|
|
4532
|
+
runtime = { ...prepared, inputItems: await buildCodexInputItems(request.options, inputParts) };
|
|
4533
|
+
} catch (error) {
|
|
4534
|
+
await prepared.cleanup();
|
|
4535
|
+
throw error;
|
|
4536
|
+
}
|
|
4537
|
+
} else {
|
|
4538
|
+
await prepared?.cleanup();
|
|
4539
|
+
runtime = await time(debugCodex, "createRuntime", () => createRuntime(request, inputParts));
|
|
4540
|
+
}
|
|
4500
4541
|
sink.setRaw(runtime.raw);
|
|
4501
4542
|
sink.emitEvent(
|
|
4502
4543
|
createNormalizedEvent("run.started", {
|
|
@@ -4511,7 +4552,6 @@ var CodexAgentAdapter = class {
|
|
|
4511
4552
|
const interactiveApproval = isInteractiveApproval(request.options);
|
|
4512
4553
|
let rootThreadId;
|
|
4513
4554
|
let turnId;
|
|
4514
|
-
let pendingTurns = 1;
|
|
4515
4555
|
let abortInvoked = false;
|
|
4516
4556
|
sink.setAbort(async () => {
|
|
4517
4557
|
abortInvoked = true;
|
|
@@ -4565,61 +4605,33 @@ var CodexAgentAdapter = class {
|
|
|
4565
4605
|
let streamedText = "";
|
|
4566
4606
|
const timeoutMs = resolveBackgroundTaskTimeoutMs(request.options.backgroundTaskTimeoutMs);
|
|
4567
4607
|
const isRootThread = (params) => !params?.threadId || params.threadId === rootThreadId;
|
|
4568
|
-
|
|
4569
|
-
const finished = [];
|
|
4608
|
+
let goalStatus = request.run.goal ? "active" : void 0;
|
|
4570
4609
|
let pendingWait;
|
|
4571
4610
|
let waitedMs = 0;
|
|
4572
|
-
let followUpSent = false;
|
|
4573
4611
|
let turnMessageText = "";
|
|
4574
4612
|
let lastTurn;
|
|
4575
|
-
let
|
|
4576
|
-
const
|
|
4577
|
-
|
|
4578
|
-
|
|
4579
|
-
|
|
4580
|
-
lastTasksKey = key;
|
|
4581
|
-
sink.emitEvent(createNormalizedEvent("background.tasks", { provider: request.provider, runId: request.runId }, { tasks, waiting }));
|
|
4613
|
+
let goalWaiting = false;
|
|
4614
|
+
const emitGoalWaiting = (waiting) => {
|
|
4615
|
+
if (waiting === goalWaiting) return;
|
|
4616
|
+
goalWaiting = waiting;
|
|
4617
|
+
sink.emitEvent(createNormalizedEvent("background.tasks", { provider: request.provider, runId: request.runId }, { tasks: [], waiting }));
|
|
4582
4618
|
};
|
|
4583
4619
|
const endWait = () => {
|
|
4584
4620
|
if (!pendingWait) return;
|
|
4585
4621
|
waitedMs += pendingWait.elapsedMs();
|
|
4586
4622
|
pendingWait.clear();
|
|
4587
4623
|
pendingWait = void 0;
|
|
4588
|
-
|
|
4589
|
-
};
|
|
4590
|
-
const sendBackgroundFollowUp = async () => {
|
|
4591
|
-
if (!rootThreadId || !pendingWait || followUpSent || finished.length === 0 || abortInvoked) return;
|
|
4592
|
-
if (timeoutMs - waitedMs - pendingWait.elapsedMs() <= 0) return;
|
|
4593
|
-
followUpSent = true;
|
|
4594
|
-
const text2 = buildCodexBackgroundFollowUp(finished.splice(0));
|
|
4595
|
-
try {
|
|
4596
|
-
const response = await client.request(
|
|
4597
|
-
"turn/start",
|
|
4598
|
-
buildCodexTurnStartParams({
|
|
4599
|
-
threadId: rootThreadId,
|
|
4600
|
-
inputItems: [{ type: "text", text: text2, text_elements: [] }],
|
|
4601
|
-
request
|
|
4602
|
-
})
|
|
4603
|
-
);
|
|
4604
|
-
endWait();
|
|
4605
|
-
sink.emitEvent(createNormalizedEvent("message.injected", { provider: request.provider, runId: request.runId }, {
|
|
4606
|
-
content: text2,
|
|
4607
|
-
...typeof response?.turn?.id === "string" ? { messageId: response.turn.id } : {}
|
|
4608
|
-
}));
|
|
4609
|
-
} catch (error) {
|
|
4610
|
-
debugCodex("background follow-up turn/start failed: %o", error);
|
|
4611
|
-
}
|
|
4624
|
+
emitGoalWaiting(false);
|
|
4612
4625
|
};
|
|
4613
4626
|
const completion = new Promise((resolve, reject) => {
|
|
4614
4627
|
const settle = () => {
|
|
4615
4628
|
endWait();
|
|
4616
|
-
emitTasks([], false);
|
|
4617
4629
|
sink.emitEvent(createNormalizedEvent("run.completed", { provider: request.provider, runId: request.runId }, { text: lastTurn?.messageText || void 0 }));
|
|
4618
4630
|
resolve({ text: lastTurn?.text ?? streamedText, turnId, threadId: rootThreadId, interrupted: false });
|
|
4619
4631
|
};
|
|
4620
4632
|
const settleOnFailure = (error) => {
|
|
4621
4633
|
if (!pendingWait || !lastTurn || abortInvoked) return false;
|
|
4622
|
-
debugCodex("\u2605 transport failed during
|
|
4634
|
+
debugCodex("\u2605 transport failed during goal wait; settling on the last turn: %o", error);
|
|
4623
4635
|
settle();
|
|
4624
4636
|
return true;
|
|
4625
4637
|
};
|
|
@@ -4639,8 +4651,7 @@ var CodexAgentAdapter = class {
|
|
|
4639
4651
|
}
|
|
4640
4652
|
if ("reason" in step) {
|
|
4641
4653
|
if (!abortInvoked) {
|
|
4642
|
-
debugCodex("\u2605
|
|
4643
|
-
if (step.reason === "ceiling" && rootThreadId) await terminateBackgroundTerminals(client, rootThreadId);
|
|
4654
|
+
debugCodex("\u2605 native goal wait over (%s)", step.reason);
|
|
4644
4655
|
settle();
|
|
4645
4656
|
return;
|
|
4646
4657
|
}
|
|
@@ -4724,11 +4735,29 @@ var CodexAgentAdapter = class {
|
|
|
4724
4735
|
sink.emitEvent(createNormalizedEvent("plan.completed", { provider: request.provider, runId: request.runId }, { text: item2.text }));
|
|
4725
4736
|
}
|
|
4726
4737
|
}
|
|
4738
|
+
if (rootThreadId && message.params && message.params.threadId === rootThreadId) {
|
|
4739
|
+
if (message.method === "thread/goal/updated") {
|
|
4740
|
+
const goal = message.params.goal;
|
|
4741
|
+
if (!message.params.turnId || message.params.turnId === turnId) {
|
|
4742
|
+
goalStatus = typeof goal?.status === "string" ? goal.status : void 0;
|
|
4743
|
+
if (goalStatus !== "active" && pendingWait && !abortInvoked) {
|
|
4744
|
+
settle();
|
|
4745
|
+
return;
|
|
4746
|
+
}
|
|
4747
|
+
}
|
|
4748
|
+
} else if (message.method === "thread/goal/cleared") {
|
|
4749
|
+
goalStatus = void 0;
|
|
4750
|
+
if (pendingWait && !abortInvoked) {
|
|
4751
|
+
settle();
|
|
4752
|
+
return;
|
|
4753
|
+
}
|
|
4754
|
+
}
|
|
4755
|
+
}
|
|
4727
4756
|
const turn = message.params?.turn;
|
|
4728
4757
|
const rootTurnCompleted = message.method === "turn/completed" && isRootThread(message.params);
|
|
4729
|
-
const waitAfterTurn = rootTurnCompleted &&
|
|
4758
|
+
const waitAfterTurn = rootTurnCompleted && timeoutMs !== 0 && !abortInvoked && turn?.status === "completed" && goalStatus === "active";
|
|
4730
4759
|
for (const event of toNormalizedCodexEvents(request.runId, message)) {
|
|
4731
|
-
if (event.type === "run.completed" && (waitAfterTurn || turn?.status === "interrupted")) continue;
|
|
4760
|
+
if (event.type === "run.completed" && (!rootTurnCompleted || waitAfterTurn || turn?.status === "interrupted")) continue;
|
|
4732
4761
|
sink.emitEvent(event);
|
|
4733
4762
|
if (event.type === "text.delta") {
|
|
4734
4763
|
streamedText += event.delta;
|
|
@@ -4740,61 +4769,31 @@ var CodexAgentAdapter = class {
|
|
|
4740
4769
|
rootThreadId = message.params?.thread?.id ?? rootThreadId;
|
|
4741
4770
|
}
|
|
4742
4771
|
if (message.method === "turn/started") {
|
|
4743
|
-
turnId = turn?.id ?? turnId;
|
|
4744
4772
|
if (isRootThread(message.params)) {
|
|
4773
|
+
turnId = turn?.id ?? turnId;
|
|
4745
4774
|
streamedText = "";
|
|
4746
4775
|
turnMessageText = "";
|
|
4747
|
-
if (pendingWait) debugCodex("\u2605 follow-up turn started;
|
|
4776
|
+
if (pendingWait) debugCodex("\u2605 follow-up turn started; native goal wait over");
|
|
4748
4777
|
endWait();
|
|
4749
|
-
emitTasks(liveTasks(), false);
|
|
4750
|
-
}
|
|
4751
|
-
}
|
|
4752
|
-
if (item?.type === "commandExecution" && typeof item.id === "string" && isRootThread(message.params)) {
|
|
4753
|
-
if (message.method === "item/started") {
|
|
4754
|
-
inFlight.set(item.id, {
|
|
4755
|
-
id: item.id,
|
|
4756
|
-
command: String(item.command ?? ""),
|
|
4757
|
-
processId: typeof item.processId === "string" ? item.processId : void 0,
|
|
4758
|
-
outlived: false
|
|
4759
|
-
});
|
|
4760
|
-
} else if (message.method === "item/completed") {
|
|
4761
|
-
const tracked = inFlight.get(item.id);
|
|
4762
|
-
inFlight.delete(item.id);
|
|
4763
|
-
if (tracked?.outlived && pendingWait) {
|
|
4764
|
-
finished.push({
|
|
4765
|
-
...tracked,
|
|
4766
|
-
aggregatedOutput: typeof item.aggregatedOutput === "string" ? item.aggregatedOutput : void 0,
|
|
4767
|
-
exitCode: typeof item.exitCode === "number" ? item.exitCode : void 0,
|
|
4768
|
-
durationMs: typeof item.durationMs === "number" ? item.durationMs : void 0
|
|
4769
|
-
});
|
|
4770
|
-
}
|
|
4771
|
-
emitTasks(liveTasks(), pendingWait !== void 0);
|
|
4772
|
-
pendingWait?.setIdle(inFlight.size === 0);
|
|
4773
|
-
if (pendingWait && inFlight.size === 0) await sendBackgroundFollowUp();
|
|
4774
4778
|
}
|
|
4775
4779
|
}
|
|
4776
4780
|
if (rootTurnCompleted) {
|
|
4777
|
-
|
|
4778
|
-
|
|
4779
|
-
|
|
4780
|
-
|
|
4781
|
-
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
|
|
4785
|
-
|
|
4786
|
-
|
|
4787
|
-
});
|
|
4788
|
-
return;
|
|
4789
|
-
}
|
|
4790
|
-
for (const tracked of inFlight.values()) tracked.outlived = true;
|
|
4791
|
-
debugCodex("\u2605 turn ended with %d command(s) in flight; waiting", inFlight.size);
|
|
4792
|
-
endWait();
|
|
4793
|
-
pendingWait = new BackgroundWait(BACKGROUND_TASK_GRACE_MS, Math.max(0, timeoutMs - waitedMs));
|
|
4794
|
-
pendingWait.setIdle(inFlight.size === 0);
|
|
4795
|
-
emitTasks(liveTasks(), true);
|
|
4796
|
-
if (inFlight.size === 0) await sendBackgroundFollowUp();
|
|
4781
|
+
const previousText = lastTurn?.text;
|
|
4782
|
+
lastTurn = { text: streamedText, messageText: turnMessageText };
|
|
4783
|
+
if (!waitAfterTurn) {
|
|
4784
|
+
resolve({
|
|
4785
|
+
text: streamedText || previousText,
|
|
4786
|
+
turnId,
|
|
4787
|
+
threadId: rootThreadId,
|
|
4788
|
+
interrupted: turn?.status === "interrupted"
|
|
4789
|
+
});
|
|
4790
|
+
return;
|
|
4797
4791
|
}
|
|
4792
|
+
debugCodex("\u2605 turn ended with an active goal; waiting for native continuation");
|
|
4793
|
+
endWait();
|
|
4794
|
+
pendingWait = new BackgroundWait(BACKGROUND_TASK_GRACE_MS, Math.max(0, timeoutMs - waitedMs));
|
|
4795
|
+
pendingWait.setIdle(true);
|
|
4796
|
+
emitGoalWaiting(true);
|
|
4798
4797
|
}
|
|
4799
4798
|
if (message.method === "error" && !shouldIgnoreCodexError(message)) {
|
|
4800
4799
|
reject(message);
|
|
@@ -4807,17 +4806,7 @@ var CodexAgentAdapter = class {
|
|
|
4807
4806
|
});
|
|
4808
4807
|
try {
|
|
4809
4808
|
if (!runtime.client) {
|
|
4810
|
-
await client
|
|
4811
|
-
clientInfo: {
|
|
4812
|
-
title: "AgentBox",
|
|
4813
|
-
name: "AgentBox",
|
|
4814
|
-
version: "0.1.0"
|
|
4815
|
-
},
|
|
4816
|
-
capabilities: {
|
|
4817
|
-
experimentalApi: true
|
|
4818
|
-
}
|
|
4819
|
-
});
|
|
4820
|
-
await client.notify("initialized", {});
|
|
4809
|
+
await initializeCodexClient(client);
|
|
4821
4810
|
}
|
|
4822
4811
|
const cwd = request.options.cwd ?? process.cwd();
|
|
4823
4812
|
let threadResponse;
|
|
@@ -4873,7 +4862,6 @@ var CodexAgentAdapter = class {
|
|
|
4873
4862
|
completionError = err;
|
|
4874
4863
|
}
|
|
4875
4864
|
endWait();
|
|
4876
|
-
emitTasks([], false);
|
|
4877
4865
|
if (completionError !== void 0) {
|
|
4878
4866
|
if (abortInvoked) {
|
|
4879
4867
|
debugCodex(
|
|
@@ -4919,8 +4907,8 @@ var CodexAgentAdapter = class {
|
|
|
4919
4907
|
* driven by the normalized `message.started` event whose
|
|
4920
4908
|
* `messageId` IS the codex turnId).
|
|
4921
4909
|
*
|
|
4922
|
-
* When that interrupt is rejected — the thread is
|
|
4923
|
-
*
|
|
4910
|
+
* When that interrupt is rejected — the thread is between native goal
|
|
4911
|
+
* turns, or the turn id is stale or missing — a turn is started only to be
|
|
4924
4912
|
* interrupted, so the originating run still observes an interrupted turn
|
|
4925
4913
|
* and cancels; the model's leftover processes are then terminated.
|
|
4926
4914
|
* Without `sessionId` the call is a no-op.
|
|
@@ -6830,6 +6818,9 @@ var Agent = class {
|
|
|
6830
6818
|
this.setupPromise = void 0;
|
|
6831
6819
|
}
|
|
6832
6820
|
stream(runConfig) {
|
|
6821
|
+
if (this.provider !== AgentProvider.Codex && (runConfig.reasoning === "max" || runConfig.reasoning === "ultra")) {
|
|
6822
|
+
throw new Error(`Reasoning effort "${runConfig.reasoning}" is only supported by Codex.`);
|
|
6823
|
+
}
|
|
6833
6824
|
if (runConfig.resumeSessionId && runConfig.forkSessionId) {
|
|
6834
6825
|
throw new Error(
|
|
6835
6826
|
"AgentRunConfig.resumeSessionId and forkSessionId are mutually exclusive."
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AISDKEvent, C as BackgroundTask, D as BackgroundTasksEvent, W as MessageCompletedEvent, X as MessageInjectedEvent, Y as MessageStartedEvent, Z as NativePlanEvent, _ as NormalizedAgentEvent, $ as NormalizedAgentEventBase, a0 as NormalizedAgentEventType, a7 as PermissionRequestedEvent, a8 as PermissionResolvedEvent, a9 as RawAgentEvent, aa as ReasoningDeltaEvent, ac as RunCancelledEvent, ad as RunCompletedEvent, ae as RunErrorEvent, af as RunStartedEvent, ah as TextDeltaEvent, aj as ToolCallCompletedEvent, ak as ToolCallDeltaEvent, al as ToolCallStartedEvent, ao as createNormalizedEvent, ap as normalizeRawAgentEvent, aq as toAISDKEvent, ar as toAISDKStream } from '../types-
|
|
1
|
+
export { A as AISDKEvent, C as BackgroundTask, D as BackgroundTasksEvent, W as MessageCompletedEvent, X as MessageInjectedEvent, Y as MessageStartedEvent, Z as NativePlanEvent, _ as NormalizedAgentEvent, $ as NormalizedAgentEventBase, a0 as NormalizedAgentEventType, a7 as PermissionRequestedEvent, a8 as PermissionResolvedEvent, a9 as RawAgentEvent, aa as ReasoningDeltaEvent, ac as RunCancelledEvent, ad as RunCompletedEvent, ae as RunErrorEvent, af as RunStartedEvent, ah as TextDeltaEvent, aj as ToolCallCompletedEvent, ak as ToolCallDeltaEvent, al as ToolCallStartedEvent, ao as createNormalizedEvent, ap as normalizeRawAgentEvent, aq as toAISDKEvent, ar as toAISDKStream } from '../types-NhKw_6mW.js';
|
|
2
2
|
import { AgentProvider } from '../enums.js';
|
|
3
3
|
import '../Sandbox-DcKAU-E3.js';
|
|
4
4
|
import 'e2b';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AISDKEvent, a as AgentApprovalMode, b as AgentAttachRequest, c as AgentCommandConfig, d as AgentCostData, e as AgentExecutionRequest, f as AgentLocalMcpConfig, g as AgentMcpConfig, h as AgentOptions, i as AgentOptionsBase, j as AgentOptionsMap, k as AgentPermissionDecision, l as AgentPermissionKind, m as AgentPermissionResponse, n as AgentProviderAdapter, o as AgentProviderName, p as AgentReasoningEffort, q as AgentRemoteMcpConfig, r as AgentResult, s as AgentRun, t as AgentRunConfig, u as AgentRunSink, v as AgentSetupRequest, w as AgentSkillConfig, x as AgentSubAgentConfig, y as AgentUserAnswer, z as AgentUserQuestion, B as AttachedRun, C as BackgroundTask, D as BackgroundTasksEvent, E as ClaudeCodeAgentOptions, F as ClaudeCodeHookConfig, G as ClaudeCodeHookEvent, H as ClaudeCodeHookHandler, I as ClaudeCodeHookMatcherGroup, J as ClaudeCodeHooksConfig, K as ClaudeCodeProviderOptions, L as CodexAgentOptions, M as CodexCommandHook, N as CodexHookEvent, O as CodexHookMatcherGroup, P as CodexHooksConfig, Q as CodexModelProviderConfig, R as CodexProviderOptions, S as DataContent, T as EmbeddedSkillConfig, U as FilePart, V as ImagePart, W as MessageCompletedEvent, X as MessageInjectedEvent, Y as MessageStartedEvent, Z as NativePlanEvent, _ as NormalizedAgentEvent, $ as NormalizedAgentEventBase, a0 as NormalizedAgentEventType, a1 as OpenCodeAgentOptions, a2 as OpenCodePluginConfig, a3 as OpenCodePluginEvent, a4 as OpenCodePluginHookConfig, a5 as OpenCodeProviderOptions, a6 as OpenRouterPlugin, a7 as PermissionRequestedEvent, a8 as PermissionResolvedEvent, a9 as RawAgentEvent, aa as ReasoningDeltaEvent, ab as RepoSkillConfig, ac as RunCancelledEvent, ad as RunCompletedEvent, ae as RunErrorEvent, af as RunStartedEvent, ag as SetupLayout, ah as TextDeltaEvent, ai as TextPart, aj as ToolCallCompletedEvent, ak as ToolCallDeltaEvent, al as ToolCallStartedEvent, am as UserContent, an as UserContentPart, ao as createNormalizedEvent, ap as normalizeRawAgentEvent, aq as toAISDKEvent, ar as toAISDKStream } from './types-
|
|
1
|
+
export { A as AISDKEvent, a as AgentApprovalMode, b as AgentAttachRequest, c as AgentCommandConfig, d as AgentCostData, e as AgentExecutionRequest, f as AgentLocalMcpConfig, g as AgentMcpConfig, h as AgentOptions, i as AgentOptionsBase, j as AgentOptionsMap, k as AgentPermissionDecision, l as AgentPermissionKind, m as AgentPermissionResponse, n as AgentProviderAdapter, o as AgentProviderName, p as AgentReasoningEffort, q as AgentRemoteMcpConfig, r as AgentResult, s as AgentRun, t as AgentRunConfig, u as AgentRunSink, v as AgentSetupRequest, w as AgentSkillConfig, x as AgentSubAgentConfig, y as AgentUserAnswer, z as AgentUserQuestion, B as AttachedRun, C as BackgroundTask, D as BackgroundTasksEvent, E as ClaudeCodeAgentOptions, F as ClaudeCodeHookConfig, G as ClaudeCodeHookEvent, H as ClaudeCodeHookHandler, I as ClaudeCodeHookMatcherGroup, J as ClaudeCodeHooksConfig, K as ClaudeCodeProviderOptions, L as CodexAgentOptions, M as CodexCommandHook, N as CodexHookEvent, O as CodexHookMatcherGroup, P as CodexHooksConfig, Q as CodexModelProviderConfig, R as CodexProviderOptions, S as DataContent, T as EmbeddedSkillConfig, U as FilePart, V as ImagePart, W as MessageCompletedEvent, X as MessageInjectedEvent, Y as MessageStartedEvent, Z as NativePlanEvent, _ as NormalizedAgentEvent, $ as NormalizedAgentEventBase, a0 as NormalizedAgentEventType, a1 as OpenCodeAgentOptions, a2 as OpenCodePluginConfig, a3 as OpenCodePluginEvent, a4 as OpenCodePluginHookConfig, a5 as OpenCodeProviderOptions, a6 as OpenRouterPlugin, a7 as PermissionRequestedEvent, a8 as PermissionResolvedEvent, a9 as RawAgentEvent, aa as ReasoningDeltaEvent, ab as RepoSkillConfig, ac as RunCancelledEvent, ad as RunCompletedEvent, ae as RunErrorEvent, af as RunStartedEvent, ag as SetupLayout, ah as TextDeltaEvent, ai as TextPart, aj as ToolCallCompletedEvent, ak as ToolCallDeltaEvent, al as ToolCallStartedEvent, am as UserContent, an as UserContentPart, ao as createNormalizedEvent, ap as normalizeRawAgentEvent, aq as toAISDKEvent, ar as toAISDKStream } from './types-NhKw_6mW.js';
|
|
2
2
|
export { AGENT_RESERVED_PORTS, Agent, HarnessCapabilities, HarnessCommand, agentboxRoot, collectAllAgentReservedPorts, getAgentLayout, harnessCapabilities, resolveHarnessCommand } from './agents/index.js';
|
|
3
3
|
export { A as AsyncCommandHandle, C as CommandEvent, a as CommandOptions, b as CommandResult, D as DaytonaProviderOptions, c as DaytonaSandboxOptions, E as E2bProviderOptions, d as E2bSandboxOptions, G as GitCloneOptions, L as LocalDockerProviderOptions, e as LocalDockerSandboxOptions, M as ModalProviderOptions, f as ModalSandboxOptions, S as Sandbox, g as SandboxDescriptor, h as SandboxListOptions, i as SandboxOptions, j as SandboxOptionsBase, k as SandboxOptionsMap, l as SandboxProviderName, m as SandboxRaw, n as SandboxRawMap, o as SandboxResourceSpec, T as TarballEntry, V as VercelGitSource, p as VercelProviderOptions, q as VercelSandboxOptions } from './Sandbox-DcKAU-E3.js';
|
|
4
4
|
export { SandboxAdapter, buildGitCloneCommand } from './sandboxes/index.js';
|
package/dist/index.js
CHANGED
|
@@ -377,7 +377,8 @@ interface FilePart {
|
|
|
377
377
|
}
|
|
378
378
|
type UserContentPart = TextPart | ImagePart | FilePart;
|
|
379
379
|
type UserContent = string | UserContentPart[];
|
|
380
|
-
|
|
380
|
+
/** `max` and `ultra` are Codex-only and require a supporting model/runtime. */
|
|
381
|
+
type AgentReasoningEffort = "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
381
382
|
interface AgentRunConfig {
|
|
382
383
|
input: UserContent;
|
|
383
384
|
runId?: string;
|
|
@@ -492,6 +493,12 @@ interface AgentOptionsBase {
|
|
|
492
493
|
* work); `Infinity` waits forever. On expiry the tasks are stopped
|
|
493
494
|
* best-effort and the run completes with the last turn's text. Progress
|
|
494
495
|
* is reported through `background.tasks` events.
|
|
496
|
+
* For Codex, only gaps between active native goal turns use this budget
|
|
497
|
+
* (also bounded by the idle grace). Ordinary turns finish on turn/completed,
|
|
498
|
+
* regardless of live shell processes. No synthetic command-result turn is
|
|
499
|
+
* injected, and goal-wait expiry does not terminate remote shell processes.
|
|
500
|
+
* Inactive goals settle after their final turn; clearing a goal while idle
|
|
501
|
+
* settles immediately.
|
|
495
502
|
*/
|
|
496
503
|
backgroundTaskTimeoutMs?: number;
|
|
497
504
|
approvalMode?: AgentApprovalMode;
|
|
@@ -505,6 +512,12 @@ interface AgentOptionsBase {
|
|
|
505
512
|
commands?: AgentCommandConfig[];
|
|
506
513
|
}
|
|
507
514
|
interface CodexProviderOptions {
|
|
515
|
+
/** Prepare the next host app-server during setup(), before a prompt arrives.
|
|
516
|
+
* No thread or turn is started. Each execution still owns and stops its
|
|
517
|
+
* process; killServer() also disposes an unused prepared process. */
|
|
518
|
+
prewarm?: boolean;
|
|
519
|
+
/** Native service tier; "default" explicitly selects standard speed. */
|
|
520
|
+
serviceTier?: string;
|
|
508
521
|
/** Explicit policy for new, resumed, and forked native sessions. */
|
|
509
522
|
approvalPolicy?: "untrusted" | "on-request" | "never";
|
|
510
523
|
/** Managed host execution defaults to read-only; native configuration uses the CLI's settings. */
|
|
@@ -564,6 +577,8 @@ interface OpenCodeProviderOptions {
|
|
|
564
577
|
plugins?: OpenCodePluginConfig[];
|
|
565
578
|
}
|
|
566
579
|
interface ClaudeCodeProviderOptions {
|
|
580
|
+
/** Request fast mode explicitly; false overrides inherited fast settings. */
|
|
581
|
+
fastMode?: boolean;
|
|
567
582
|
binary?: string;
|
|
568
583
|
args?: string[];
|
|
569
584
|
hooks?: ClaudeCodeHooksConfig;
|