agentbox-sdk 0.1.601 → 0.1.602
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/agents/index.d.ts +2 -2
- package/dist/agents/index.js +1 -1
- package/dist/{chunk-ZITMGTVR.js → chunk-UE4LQEL5.js} +112 -31
- package/dist/events/index.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{types-ChkpU7Lf.d.ts → types-B_oR4A4a.d.ts} +11 -0
- package/package.json +1 -1
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, al as RawAgentEvent, b as AgentAttachRequest, B as AttachedRun, as as SetupLayout, ay 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 CodexSkillEntry, T as DataContent, U as EmbeddedSkillConfig, V as FilePart, W as HarnessCommandDescriptor, X as HarnessCommandInvocation, Y as HarnessCommandSource, _ as ImagePart, $ as MAX_HARNESS_COMMANDS, a0 as MAX_HARNESS_COMMAND_ARGUMENT_HINT, a1 as MAX_HARNESS_COMMAND_DESCRIPTION, a2 as MAX_HARNESS_COMMAND_NAME, a6 as NativeParkBackgroundWork, ab as OpenCodeAgentOptions, ac as OpenCodeCommandEntry, ad as OpenCodePluginConfig, ae as OpenCodePluginEvent, af as OpenCodePluginHookConfig, ag as OpenCodeProviderOptions, ah as OpenCodeSkillEntry, ai as OpenRouterPlugin, an as RepoSkillConfig, au as TextPart, az as UserContentPart, aA as builtinHarnessCommands, aB as claudeHarnessCommands, aC as codexHarnessCommands, aD as codexSkillMention, aG as openCodeHarnessCommands, aH as parseHarnessCommandInvocation, aI as skillDirective } from '../types-
|
|
1
|
+
import { o as AgentProviderName, h as AgentOptions, t as AgentRunConfig, s as AgentRun, r as AgentResult, al as RawAgentEvent, b as AgentAttachRequest, B as AttachedRun, as as SetupLayout, ay as UserContent } from '../types-B_oR4A4a.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 CodexSkillEntry, T as DataContent, U as EmbeddedSkillConfig, V as FilePart, W as HarnessCommandDescriptor, X as HarnessCommandInvocation, Y as HarnessCommandSource, _ as ImagePart, $ as MAX_HARNESS_COMMANDS, a0 as MAX_HARNESS_COMMAND_ARGUMENT_HINT, a1 as MAX_HARNESS_COMMAND_DESCRIPTION, a2 as MAX_HARNESS_COMMAND_NAME, a6 as NativeParkBackgroundWork, ab as OpenCodeAgentOptions, ac as OpenCodeCommandEntry, ad as OpenCodePluginConfig, ae as OpenCodePluginEvent, af as OpenCodePluginHookConfig, ag as OpenCodeProviderOptions, ah as OpenCodeSkillEntry, ai as OpenRouterPlugin, an as RepoSkillConfig, au as TextPart, az as UserContentPart, aA as builtinHarnessCommands, aB as claudeHarnessCommands, aC as codexHarnessCommands, aD as codexSkillMention, aG as openCodeHarnessCommands, aH as parseHarnessCommandInvocation, aI as skillDirective } from '../types-B_oR4A4a.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
|
@@ -2193,6 +2193,11 @@ function asArray(value) {
|
|
|
2193
2193
|
}
|
|
2194
2194
|
var SCHEDULE_TOOLS = /* @__PURE__ */ new Set(["CronCreate", "ScheduleWakeup"]);
|
|
2195
2195
|
var DONE_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "killed"]);
|
|
2196
|
+
var SUBAGENT_TASK_TYPES = /* @__PURE__ */ new Set(["local_agent", "local_workflow", "subagent"]);
|
|
2197
|
+
var SUBAGENT_RESULT_GRACE_MS = 6e4;
|
|
2198
|
+
function holdsBackgroundCeiling(tasks, exemptSubagents) {
|
|
2199
|
+
return exemptSubagents === true && tasks.some((task) => SUBAGENT_TASK_TYPES.has(task.type));
|
|
2200
|
+
}
|
|
2196
2201
|
var BackgroundTaskTracker = class {
|
|
2197
2202
|
tasks = /* @__PURE__ */ new Map();
|
|
2198
2203
|
wakeups = /* @__PURE__ */ new Map();
|
|
@@ -2371,21 +2376,42 @@ function withTimeout(promise, ms) {
|
|
|
2371
2376
|
return Promise.race([promise, timeout]).finally(() => clearTimeout(timer));
|
|
2372
2377
|
}
|
|
2373
2378
|
var BackgroundWait = class {
|
|
2374
|
-
constructor(graceMs, ceilingMs) {
|
|
2379
|
+
constructor(graceMs, ceilingMs, held = false) {
|
|
2375
2380
|
this.graceMs = graceMs;
|
|
2381
|
+
this.ceilingMs = ceilingMs;
|
|
2376
2382
|
this.expired = new Promise((resolve) => {
|
|
2377
2383
|
this.expire = resolve;
|
|
2378
2384
|
});
|
|
2379
|
-
if (
|
|
2380
|
-
|
|
2381
|
-
}
|
|
2385
|
+
if (held) this.heldSince = this.startedAt;
|
|
2386
|
+
else this.armCeiling();
|
|
2382
2387
|
}
|
|
2383
2388
|
graceMs;
|
|
2389
|
+
ceilingMs;
|
|
2384
2390
|
expired;
|
|
2385
2391
|
expire;
|
|
2386
2392
|
grace;
|
|
2387
2393
|
ceiling;
|
|
2388
2394
|
startedAt = Date.now();
|
|
2395
|
+
heldMs = 0;
|
|
2396
|
+
heldSince;
|
|
2397
|
+
/** Stop the ceiling while a subagent is live; resume it with what is left once none is. */
|
|
2398
|
+
hold(held) {
|
|
2399
|
+
if (held === (this.heldSince !== void 0)) return;
|
|
2400
|
+
if (held) {
|
|
2401
|
+
clearTimeout(this.ceiling);
|
|
2402
|
+
this.ceiling = void 0;
|
|
2403
|
+
this.heldSince = Date.now();
|
|
2404
|
+
return;
|
|
2405
|
+
}
|
|
2406
|
+
this.heldMs += Date.now() - this.heldSince;
|
|
2407
|
+
this.heldSince = void 0;
|
|
2408
|
+
this.armCeiling(SUBAGENT_RESULT_GRACE_MS);
|
|
2409
|
+
}
|
|
2410
|
+
armCeiling(floorMs = 0) {
|
|
2411
|
+
if (!Number.isFinite(this.ceilingMs)) return;
|
|
2412
|
+
const leftMs = Math.max(floorMs, this.ceilingMs - this.elapsedMs());
|
|
2413
|
+
this.ceiling = setTimeout(() => this.expire("ceiling"), Math.min(leftMs, MAX_TIMER_MS));
|
|
2414
|
+
}
|
|
2389
2415
|
/** Arm the grace timer while nothing is live; disarm it once a task appears. */
|
|
2390
2416
|
setIdle(idle) {
|
|
2391
2417
|
if (!idle) {
|
|
@@ -2399,8 +2425,11 @@ var BackgroundWait = class {
|
|
|
2399
2425
|
finish() {
|
|
2400
2426
|
this.expire("finished");
|
|
2401
2427
|
}
|
|
2428
|
+
/** Time counted against the budget: held time excluded. */
|
|
2402
2429
|
elapsedMs() {
|
|
2403
|
-
|
|
2430
|
+
const now = Date.now();
|
|
2431
|
+
const held = this.heldMs + (this.heldSince === void 0 ? 0 : now - this.heldSince);
|
|
2432
|
+
return now - this.startedAt - held;
|
|
2404
2433
|
}
|
|
2405
2434
|
clear() {
|
|
2406
2435
|
clearTimeout(this.grace);
|
|
@@ -2453,9 +2482,14 @@ var NativeClaudeSession = class {
|
|
|
2453
2482
|
iterator;
|
|
2454
2483
|
handlers;
|
|
2455
2484
|
parked;
|
|
2456
|
-
//
|
|
2457
|
-
//
|
|
2458
|
-
|
|
2485
|
+
// The background budget, carried across parks so a CLI that is adopted and
|
|
2486
|
+
// parked again cannot extend its own ceiling: what was left of it at
|
|
2487
|
+
// `budgetSince`, and it runs from then on. Unset while a subagent holds it.
|
|
2488
|
+
budgetLeftMs = Infinity;
|
|
2489
|
+
budgetSince = Date.now();
|
|
2490
|
+
exemptSubagents = false;
|
|
2491
|
+
// What is live in the CLI, from every message it produces.
|
|
2492
|
+
tasks = new BackgroundTaskTracker();
|
|
2459
2493
|
buffer = [];
|
|
2460
2494
|
bufferedBytes = 0;
|
|
2461
2495
|
bufferedResults = 0;
|
|
@@ -2503,30 +2537,59 @@ var NativeClaudeSession = class {
|
|
|
2503
2537
|
* Keep the CLI after the attached run settles. `inflight` is a read that
|
|
2504
2538
|
* run started but never consumed; its message is buffered, not lost.
|
|
2505
2539
|
*/
|
|
2506
|
-
park(tasks, ttlMs, parking, inflight) {
|
|
2540
|
+
park(tasks, ttlMs, parking, inflight, options = {}) {
|
|
2507
2541
|
if (this.ending || !this.iterator) return false;
|
|
2508
2542
|
this.handlers = void 0;
|
|
2509
|
-
this.
|
|
2510
|
-
this.
|
|
2511
|
-
Number.isFinite(ttlMs) ?
|
|
2543
|
+
this.budgetLeftMs = Math.min(
|
|
2544
|
+
this.budgetLeft(),
|
|
2545
|
+
Number.isFinite(ttlMs) ? Math.max(0, ttlMs) : Infinity
|
|
2512
2546
|
);
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
() => {
|
|
2517
|
-
if (this.parked !== parked) return;
|
|
2518
|
-
debugClaude("\u2605 parked CLI ran out of background budget; ending it");
|
|
2519
|
-
void this.end();
|
|
2520
|
-
},
|
|
2521
|
-
Math.min(Math.max(0, this.parkDeadline - Date.now()), 2147483647)
|
|
2522
|
-
);
|
|
2523
|
-
parked.timer.unref?.();
|
|
2524
|
-
}
|
|
2525
|
-
this.parked = parked;
|
|
2547
|
+
if (this.budgetSince !== void 0) this.budgetSince = Date.now();
|
|
2548
|
+
this.exemptSubagents = options.exemptSubagents === true;
|
|
2549
|
+
this.parked = { tasks, parking, waking: false, wokeAt: 0 };
|
|
2526
2550
|
parkedSessions.set(this.sessionId, this);
|
|
2551
|
+
this.updateBudget();
|
|
2552
|
+
this.armBudget();
|
|
2527
2553
|
void this.pump(inflight);
|
|
2528
2554
|
return true;
|
|
2529
2555
|
}
|
|
2556
|
+
budgetLeft() {
|
|
2557
|
+
return this.budgetSince === void 0 ? this.budgetLeftMs : this.budgetLeftMs - (Date.now() - this.budgetSince);
|
|
2558
|
+
}
|
|
2559
|
+
/** Hold the budget while an exempt subagent is live. True when that changed. */
|
|
2560
|
+
updateBudget() {
|
|
2561
|
+
const held = holdsBackgroundCeiling(
|
|
2562
|
+
this.tasks.liveTasks(),
|
|
2563
|
+
this.exemptSubagents
|
|
2564
|
+
);
|
|
2565
|
+
if (held === (this.budgetSince === void 0)) return false;
|
|
2566
|
+
if (held) {
|
|
2567
|
+
this.budgetLeftMs = this.budgetLeft();
|
|
2568
|
+
this.budgetSince = void 0;
|
|
2569
|
+
} else {
|
|
2570
|
+
this.budgetLeftMs = Math.max(this.budgetLeftMs, SUBAGENT_RESULT_GRACE_MS);
|
|
2571
|
+
this.budgetSince = Date.now();
|
|
2572
|
+
}
|
|
2573
|
+
return true;
|
|
2574
|
+
}
|
|
2575
|
+
/** While parked, end the CLI once a running budget is spent. */
|
|
2576
|
+
armBudget() {
|
|
2577
|
+
const parked = this.parked;
|
|
2578
|
+
if (!parked) return;
|
|
2579
|
+
clearTimeout(parked.timer);
|
|
2580
|
+
parked.timer = void 0;
|
|
2581
|
+
if (this.budgetSince === void 0 || !Number.isFinite(this.budgetLeftMs))
|
|
2582
|
+
return;
|
|
2583
|
+
parked.timer = setTimeout(
|
|
2584
|
+
() => {
|
|
2585
|
+
if (this.parked !== parked) return;
|
|
2586
|
+
debugClaude("\u2605 parked CLI ran out of background budget; ending it");
|
|
2587
|
+
void this.end();
|
|
2588
|
+
},
|
|
2589
|
+
Math.min(Math.max(0, this.budgetLeft()), MAX_TIMER_MS)
|
|
2590
|
+
);
|
|
2591
|
+
parked.timer.unref?.();
|
|
2592
|
+
}
|
|
2530
2593
|
/**
|
|
2531
2594
|
* A later run takes the parked CLI over: it learns what was live and how
|
|
2532
2595
|
* many results precede its own turn, then reads what was buffered. An
|
|
@@ -2540,7 +2603,8 @@ var NativeClaudeSession = class {
|
|
|
2540
2603
|
clearTimeout(parked.timer);
|
|
2541
2604
|
this.parked = void 0;
|
|
2542
2605
|
parkedSessions.delete(this.sessionId);
|
|
2543
|
-
const
|
|
2606
|
+
const left = this.budgetLeft();
|
|
2607
|
+
const budgetLeftMs = Number.isFinite(left) ? Math.max(0, left) : null;
|
|
2544
2608
|
const preamble = [
|
|
2545
2609
|
{ _parked: { tasks: parked.tasks, turns, budgetLeftMs } },
|
|
2546
2610
|
...this.buffer
|
|
@@ -2575,6 +2639,8 @@ var NativeClaudeSession = class {
|
|
|
2575
2639
|
const { started, ended } = turnEdges(result.value);
|
|
2576
2640
|
if (started) this.turnActive = true;
|
|
2577
2641
|
if (ended) this.turnActive = false;
|
|
2642
|
+
this.tasks.ingest(result.value);
|
|
2643
|
+
if (this.updateBudget()) this.armBudget();
|
|
2578
2644
|
}
|
|
2579
2645
|
return result;
|
|
2580
2646
|
});
|
|
@@ -4045,6 +4111,10 @@ async function consumeClaudeMessages(request, sink, messages, executeStartedAt,
|
|
|
4045
4111
|
const timeoutMs = resolveBackgroundTaskTimeoutMs(
|
|
4046
4112
|
request.options.backgroundTaskTimeoutMs
|
|
4047
4113
|
);
|
|
4114
|
+
const holdsCeiling = (live) => holdsBackgroundCeiling(
|
|
4115
|
+
live,
|
|
4116
|
+
request.options.exemptSubagentsFromBackgroundTimeout
|
|
4117
|
+
);
|
|
4048
4118
|
const graceMs = wait.graceMs ?? BACKGROUND_TASK_GRACE_MS;
|
|
4049
4119
|
let pendingWait;
|
|
4050
4120
|
let waitedMs = 0;
|
|
@@ -4077,8 +4147,9 @@ async function consumeClaudeMessages(request, sink, messages, executeStartedAt,
|
|
|
4077
4147
|
const tryPark = async (inflight) => {
|
|
4078
4148
|
const live = tracker.liveTasks();
|
|
4079
4149
|
const ttlMs = budgetLeftMs();
|
|
4080
|
-
|
|
4081
|
-
|
|
4150
|
+
const held = holdsCeiling(live);
|
|
4151
|
+
if (!wait.park || live.length === 0 || isAborted()) return false;
|
|
4152
|
+
if (held ? !wait.parkHoldsSubagents : ttlMs <= 0) return false;
|
|
4082
4153
|
parked = await wait.park(live, ttlMs, inflight).catch(() => false);
|
|
4083
4154
|
if (parked)
|
|
4084
4155
|
debugClaude(
|
|
@@ -4174,6 +4245,7 @@ async function consumeClaudeMessages(request, sink, messages, executeStartedAt,
|
|
|
4174
4245
|
endWait();
|
|
4175
4246
|
}
|
|
4176
4247
|
emitTasks(tracker.liveTasks(), pendingWait !== void 0);
|
|
4248
|
+
pendingWait?.hold(holdsCeiling(tracker.liveTasks()));
|
|
4177
4249
|
const sessionState = message.type === "system" && message.subtype === "session_state_changed" ? message.state : void 0;
|
|
4178
4250
|
if (sessionState) sawSessionState = true;
|
|
4179
4251
|
pendingWait?.setIdle(
|
|
@@ -4342,7 +4414,11 @@ async function consumeClaudeMessages(request, sink, messages, executeStartedAt,
|
|
|
4342
4414
|
);
|
|
4343
4415
|
endWait();
|
|
4344
4416
|
pendingWait = finishWait.watch(
|
|
4345
|
-
new BackgroundWait(
|
|
4417
|
+
new BackgroundWait(
|
|
4418
|
+
graceMs,
|
|
4419
|
+
Math.max(0, timeoutMs - waitedMs),
|
|
4420
|
+
holdsCeiling(live)
|
|
4421
|
+
)
|
|
4346
4422
|
);
|
|
4347
4423
|
pendingWait.setIdle(!sawSessionState && live.length === 0);
|
|
4348
4424
|
emitTasks(live, true);
|
|
@@ -4667,7 +4743,10 @@ async function executeNativeClaude(request, sink, wait = {}) {
|
|
|
4667
4743
|
);
|
|
4668
4744
|
},
|
|
4669
4745
|
...parking && owned ? {
|
|
4670
|
-
park: async (tasks, ttlMs, inflight) => parked = owned.park(tasks, ttlMs, parking, inflight
|
|
4746
|
+
park: async (tasks, ttlMs, inflight) => parked = owned.park(tasks, ttlMs, parking, inflight, {
|
|
4747
|
+
exemptSubagents: request.options.exemptSubagentsFromBackgroundTimeout
|
|
4748
|
+
}),
|
|
4749
|
+
parkHoldsSubagents: true,
|
|
4671
4750
|
// The CLI lives on in the session; nothing to let go of.
|
|
4672
4751
|
detach: async () => void 0
|
|
4673
4752
|
} : {}
|
|
@@ -7197,7 +7276,9 @@ var OpenCodeAgentAdapter = class {
|
|
|
7197
7276
|
);
|
|
7198
7277
|
const wait = new BackgroundWait(
|
|
7199
7278
|
BACKGROUND_TASK_GRACE_MS,
|
|
7200
|
-
Math.max(0, backgroundTimeoutMs - waitedMs)
|
|
7279
|
+
Math.max(0, backgroundTimeoutMs - waitedMs),
|
|
7280
|
+
// Every child waited on here is a subagent.
|
|
7281
|
+
request.options.exemptSubagentsFromBackgroundTimeout === true
|
|
7201
7282
|
);
|
|
7202
7283
|
pendingWait = wait;
|
|
7203
7284
|
void wait.expired.then((reason) => {
|
package/dist/events/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { A as AISDKEvent, C as BackgroundTask, D as BackgroundTasksEvent, Z as HarnessCommandsEvent, a3 as MessageCompletedEvent, a4 as MessageInjectedEvent, a5 as MessageStartedEvent, a7 as NativePlanEvent, a8 as NormalizedAgentEvent, a9 as NormalizedAgentEventBase, aa as NormalizedAgentEventType, aj as PermissionRequestedEvent, ak as PermissionResolvedEvent, al as RawAgentEvent, am as ReasoningDeltaEvent, ao as RunCancelledEvent, ap as RunCompletedEvent, aq as RunErrorEvent, ar as RunStartedEvent, at as TextDeltaEvent, av as ToolCallCompletedEvent, aw as ToolCallDeltaEvent, ax as ToolCallStartedEvent, aE as createNormalizedEvent, aF as normalizeRawAgentEvent, aJ as toAISDKEvent, aK as toAISDKStream } from '../types-
|
|
1
|
+
export { A as AISDKEvent, C as BackgroundTask, D as BackgroundTasksEvent, Z as HarnessCommandsEvent, a3 as MessageCompletedEvent, a4 as MessageInjectedEvent, a5 as MessageStartedEvent, a7 as NativePlanEvent, a8 as NormalizedAgentEvent, a9 as NormalizedAgentEventBase, aa as NormalizedAgentEventType, aj as PermissionRequestedEvent, ak as PermissionResolvedEvent, al as RawAgentEvent, am as ReasoningDeltaEvent, ao as RunCancelledEvent, ap as RunCompletedEvent, aq as RunErrorEvent, ar as RunStartedEvent, at as TextDeltaEvent, av as ToolCallCompletedEvent, aw as ToolCallDeltaEvent, ax as ToolCallStartedEvent, aE as createNormalizedEvent, aF as normalizeRawAgentEvent, aJ as toAISDKEvent, aK as toAISDKStream } from '../types-B_oR4A4a.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 CodexSkillEntry, T as DataContent, U as EmbeddedSkillConfig, V as FilePart, W as HarnessCommandDescriptor, X as HarnessCommandInvocation, Y as HarnessCommandSource, Z as HarnessCommandsEvent, _ as ImagePart, $ as MAX_HARNESS_COMMANDS, a0 as MAX_HARNESS_COMMAND_ARGUMENT_HINT, a1 as MAX_HARNESS_COMMAND_DESCRIPTION, a2 as MAX_HARNESS_COMMAND_NAME, a3 as MessageCompletedEvent, a4 as MessageInjectedEvent, a5 as MessageStartedEvent, a6 as NativeParkBackgroundWork, a7 as NativePlanEvent, a8 as NormalizedAgentEvent, a9 as NormalizedAgentEventBase, aa as NormalizedAgentEventType, ab as OpenCodeAgentOptions, ac as OpenCodeCommandEntry, ad as OpenCodePluginConfig, ae as OpenCodePluginEvent, af as OpenCodePluginHookConfig, ag as OpenCodeProviderOptions, ah as OpenCodeSkillEntry, ai as OpenRouterPlugin, aj as PermissionRequestedEvent, ak as PermissionResolvedEvent, al as RawAgentEvent, am as ReasoningDeltaEvent, an as RepoSkillConfig, ao as RunCancelledEvent, ap as RunCompletedEvent, aq as RunErrorEvent, ar as RunStartedEvent, as as SetupLayout, at as TextDeltaEvent, au as TextPart, av as ToolCallCompletedEvent, aw as ToolCallDeltaEvent, ax as ToolCallStartedEvent, ay as UserContent, az as UserContentPart, aA as builtinHarnessCommands, aB as claudeHarnessCommands, aC as codexHarnessCommands, aD as codexSkillMention, aE as createNormalizedEvent, aF as normalizeRawAgentEvent, aG as openCodeHarnessCommands, aH as parseHarnessCommandInvocation, aI as skillDirective, aJ as toAISDKEvent, aK 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 CodexSkillEntry, T as DataContent, U as EmbeddedSkillConfig, V as FilePart, W as HarnessCommandDescriptor, X as HarnessCommandInvocation, Y as HarnessCommandSource, Z as HarnessCommandsEvent, _ as ImagePart, $ as MAX_HARNESS_COMMANDS, a0 as MAX_HARNESS_COMMAND_ARGUMENT_HINT, a1 as MAX_HARNESS_COMMAND_DESCRIPTION, a2 as MAX_HARNESS_COMMAND_NAME, a3 as MessageCompletedEvent, a4 as MessageInjectedEvent, a5 as MessageStartedEvent, a6 as NativeParkBackgroundWork, a7 as NativePlanEvent, a8 as NormalizedAgentEvent, a9 as NormalizedAgentEventBase, aa as NormalizedAgentEventType, ab as OpenCodeAgentOptions, ac as OpenCodeCommandEntry, ad as OpenCodePluginConfig, ae as OpenCodePluginEvent, af as OpenCodePluginHookConfig, ag as OpenCodeProviderOptions, ah as OpenCodeSkillEntry, ai as OpenRouterPlugin, aj as PermissionRequestedEvent, ak as PermissionResolvedEvent, al as RawAgentEvent, am as ReasoningDeltaEvent, an as RepoSkillConfig, ao as RunCancelledEvent, ap as RunCompletedEvent, aq as RunErrorEvent, ar as RunStartedEvent, as as SetupLayout, at as TextDeltaEvent, au as TextPart, av as ToolCallCompletedEvent, aw as ToolCallDeltaEvent, ax as ToolCallStartedEvent, ay as UserContent, az as UserContentPart, aA as builtinHarnessCommands, aB as claudeHarnessCommands, aC as codexHarnessCommands, aD as codexSkillMention, aE as createNormalizedEvent, aF as normalizeRawAgentEvent, aG as openCodeHarnessCommands, aH as parseHarnessCommandInvocation, aI as skillDirective, aJ as toAISDKEvent, aK as toAISDKStream } from './types-B_oR4A4a.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
|
@@ -625,6 +625,17 @@ interface AgentOptionsBase {
|
|
|
625
625
|
* settles immediately.
|
|
626
626
|
*/
|
|
627
627
|
backgroundTaskTimeoutMs?: number;
|
|
628
|
+
/**
|
|
629
|
+
* Leave background subagents out of {@link backgroundTaskTimeoutMs}: while
|
|
630
|
+
* one is live (Claude Code background agents and workflows, OpenCode
|
|
631
|
+
* background children) the budget does not run, so the ceiling never stops
|
|
632
|
+
* a working subagent. Shells, monitors and scheduled wakeups are still
|
|
633
|
+
* bounded once no subagent is live. Covers the run's own waits and native
|
|
634
|
+
* Claude Code parks; a sandbox run keeps waiting instead of parking while a
|
|
635
|
+
* subagent is live, since the daemon's park TTL cannot be held. Default
|
|
636
|
+
* `false`. `backgroundTaskTimeoutMs: 0` still abandons everything.
|
|
637
|
+
*/
|
|
638
|
+
exemptSubagentsFromBackgroundTimeout?: boolean;
|
|
628
639
|
/**
|
|
629
640
|
* Keep every normalized and raw event in memory for the life of the run so
|
|
630
641
|
* {@link AgentResult.events} / {@link AgentResult.rawEvents} can replay it
|