@tangle-network/agent-runtime 0.289.1 → 0.290.1
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/{activation-LtjekQoy.js → activation-BdvuHbTG.js} +2 -2
- package/dist/{activation-LtjekQoy.js.map → activation-BdvuHbTG.js.map} +1 -1
- package/dist/{activation-BH2oPn09.d.ts → activation-qNAqp9BD.d.ts} +3 -3
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +2 -2
- package/dist/{coordination-driver-DyiP0EjT.js → coordination-driver-CTw92HIk.js} +2 -2
- package/dist/{coordination-driver-DyiP0EjT.js.map → coordination-driver-CTw92HIk.js.map} +1 -1
- package/dist/{delegate-DG4mL_CP.js → delegate-DhAvvPIP.js} +2 -2
- package/dist/{delegate-DG4mL_CP.js.map → delegate-DhAvvPIP.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +2 -2
- package/dist/{graph-C2s81zTq.js → graph-2Iea0PDT.js} +4 -4
- package/dist/{graph-C2s81zTq.js.map → graph-2Iea0PDT.js.map} +1 -1
- package/dist/{improvement-cycle-CQNxlLeK.js → improvement-cycle-CdT1IClg.js} +3 -3
- package/dist/{improvement-cycle-CQNxlLeK.js.map → improvement-cycle-CdT1IClg.js.map} +1 -1
- package/dist/{index-w7xjlAcL.d.ts → index-CNHHOhRS.d.ts} +8 -18
- package/dist/index.d.ts +7 -7
- package/dist/index.js +8 -8
- package/dist/intelligence.d.ts +3 -3
- package/dist/intelligence.js +4 -4
- package/dist/kernel.d.ts +4 -4
- package/dist/kernel.js +9 -9
- package/dist/{loop-runner-bin-UhqEBk50.js → loop-runner-bin-BuEFaR7Z.js} +3 -3
- package/dist/{loop-runner-bin-UhqEBk50.js.map → loop-runner-bin-BuEFaR7Z.js.map} +1 -1
- package/dist/{loop-runner-bin-DxZdgqD5.d.ts → loop-runner-bin-liVnm-Gi.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +5 -5
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-CWp4nc4r.d.ts → openai-tools-De6m7S4Y.d.ts} +2 -2
- package/dist/profiles.d.ts +2 -2
- package/dist/{provision-supervisor-DxylNO_M.js → provision-supervisor-Cm2-dL4F.js} +8 -25
- package/dist/provision-supervisor-Cm2-dL4F.js.map +1 -0
- package/dist/{runtime-CoIG3eqG.js → runtime-DJ_ISfL-.js} +8 -8
- package/dist/{runtime-CoIG3eqG.js.map → runtime-DJ_ISfL-.js.map} +1 -1
- package/dist/{search-method-a40Q47iV.js → search-method-Q7X92VD3.js} +86 -48
- package/dist/search-method-Q7X92VD3.js.map +1 -0
- package/dist/{server-CN3u3vEi.js → server-CRTAzqiD.js} +3 -3
- package/dist/{server-CN3u3vEi.js.map → server-CRTAzqiD.js.map} +1 -1
- package/dist/{stream-agent-turn-DJqcRoxP.d.ts → stream-agent-turn-kseOD-Ma.d.ts} +5 -48
- package/dist/{substrate-C9cGwDJ5.d.ts → substrate-DFWtsdNI.d.ts} +2 -2
- package/dist/{supervise-BnFVp7W-.js → supervise-CClk-m6Y.js} +3 -3
- package/dist/{supervise-BnFVp7W-.js.map → supervise-CClk-m6Y.js.map} +1 -1
- package/dist/{supervisor-CSLiRg5R.js → supervisor-CQFcQhlo.js} +46 -544
- package/dist/supervisor-CQFcQhlo.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-BPO06pPv.d.ts → types-BFcLI8Ge.d.ts} +5 -1
- package/package.json +1 -1
- package/dist/provision-supervisor-DxylNO_M.js.map +0 -1
- package/dist/search-method-a40Q47iV.js.map +0 -1
- package/dist/supervisor-CSLiRg5R.js.map +0 -1
|
@@ -3,7 +3,7 @@ import { a as concreteProfileModel, c as profileModelExecutionSettings, d as age
|
|
|
3
3
|
import { S as verifyWorkspaceSnapshotArtifacts, i as verifyAgentCandidateWorkspaceArchive } from "./workspace-archive-MhowMCmp.js";
|
|
4
4
|
import { n as assertNoSymlinkDescendant, r as publishExclusiveDurableFile } from "./durable-file-DWQA4ooo.js";
|
|
5
5
|
import { i as notifyRuntimeHookEvent } from "./runtime-hooks-tXpAarhW.js";
|
|
6
|
-
import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema,
|
|
6
|
+
import { AGENT_PROFILE_MATERIALIZATION_AXES, AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentInteractiveSessionControlClaimAcknowledgementSchema, AgentInteractiveSessionControlClaimSchema, AgentInteractiveSessionPromptAcknowledgementSchema, AgentInteractiveSessionRefSchema, AgentInteractiveSessionStatusSchema, AgentInteractiveSessionStopAcknowledgementSchema, AgentNativeContextContinuationResultSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnInputSchema, AgentTurnResultSchema, CanonicalStreamEventSchema, ContextTransferRequestSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, REASONING_EFFORTS, RuntimeEventEnvelopeSchema, TerminalReplayWindowSchema, TerminalSessionRefSchema, agentCandidateWorkspaceSnapshotEvidenceSchema, agentInteractiveSessionControlClaimAcknowledgementMatchesRequest, agentInteractiveSessionControlClaimMatchesRef, agentInteractiveSessionPromptAcknowledgementMatchesCommand, agentInteractiveSessionRefMatchesStart, agentInteractiveSessionRunRef, agentInteractiveSessionStatusMatchesRef, agentInteractiveSessionStopAcknowledgementMatchesCommand, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalWorkspaceCwd, exactAgentInteractiveSessionStart, harnessTypeSchema, nativeContextContinuationTurnDigest, nativeReasoningControl, profileMaterializationAxes, profileMaterializationAxes as profileMaterializationAxes$1, renderInputPartsAsText, sha256DigestSchema, workspaceCheckpointRequestDigest, workspaceCheckpointResultMatchesRequest, workspaceCleanupAcknowledgementMatches, workspaceCleanupRequestDigest } from "@tangle-network/agent-interface";
|
|
7
7
|
import { estimateCost, isModelPriced, isToolSpan, toolSpansToTraceAnalysisStore } from "@tangle-network/agent-eval";
|
|
8
8
|
import { createAgentRunOutcomeTracker } from "@tangle-network/sandbox/runtime";
|
|
9
9
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
@@ -16,6 +16,7 @@ import { homedir, hostname, tmpdir } from "node:os";
|
|
|
16
16
|
import { stripVTControlCharacters } from "node:util";
|
|
17
17
|
import { ATTR, deriveHexId, isW3CSpanId, isW3CTraceId } from "@tangle-network/agent-trace-contract";
|
|
18
18
|
import { REDACTION_VERSION as REDACTION_VERSION$1, redact } from "@tangle-network/agent-eval/traces";
|
|
19
|
+
import { z } from "zod";
|
|
19
20
|
import { SDKError, generateIdempotencyKey, withRetry } from "@tangle-network/agent-core";
|
|
20
21
|
import { collectAgentFinalMessageText, collectAgentResponseText } from "@tangle-network/sandbox";
|
|
21
22
|
import { request } from "node:http";
|
|
@@ -8578,7 +8579,10 @@ function describeLeakedReservation(leak) {
|
|
|
8578
8579
|
const outcomeSchema = AgentTurnResultSchema.pick({
|
|
8579
8580
|
success: true,
|
|
8580
8581
|
error: true
|
|
8581
|
-
}).extend({
|
|
8582
|
+
}).extend({
|
|
8583
|
+
errorCode: AgentTurnResultSchema.shape.error,
|
|
8584
|
+
statusCode: z.number().int().min(400).max(599).optional()
|
|
8585
|
+
}).strict();
|
|
8582
8586
|
/** Read only the executor envelope; application output and grades are not execution status. */
|
|
8583
8587
|
function executorFailure(result) {
|
|
8584
8588
|
if (result.outcome === void 0) return void 0;
|
|
@@ -8586,7 +8590,8 @@ function executorFailure(result) {
|
|
|
8586
8590
|
if (outcome.success) return void 0;
|
|
8587
8591
|
return {
|
|
8588
8592
|
error: outcome.error ?? "Agent execution failed",
|
|
8589
|
-
...outcome.errorCode === void 0 ? {} : { errorCode: outcome.errorCode }
|
|
8593
|
+
...outcome.errorCode === void 0 ? {} : { errorCode: outcome.errorCode },
|
|
8594
|
+
...outcome.statusCode === void 0 ? {} : { statusCode: outcome.statusCode }
|
|
8590
8595
|
};
|
|
8591
8596
|
}
|
|
8592
8597
|
/** The failure text alone, for callers that record a settlement reason. */
|
|
@@ -10271,11 +10276,12 @@ function unavailableSignalInText(text) {
|
|
|
10271
10276
|
/**
|
|
10272
10277
|
* The code or status that marks a failed turn outcome as an upstream capacity refusal, or
|
|
10273
10278
|
* `undefined`. The outcome's own `errorCode` decides first; the failure text is read only when no
|
|
10274
|
-
* code decided, because a harness CLI
|
|
10279
|
+
* code or numeric status decided, because a harness CLI can report the router's refusal as text.
|
|
10275
10280
|
*/
|
|
10276
10281
|
function unavailableSignalOfFailure(failure) {
|
|
10277
10282
|
const code = failure.errorCode?.toLowerCase();
|
|
10278
10283
|
if (code !== void 0 && UNAVAILABLE_CODES.has(code)) return code;
|
|
10284
|
+
if (failure.statusCode !== void 0) return UNAVAILABLE_STATUSES.has(failure.statusCode) ? `http-${failure.statusCode}` : void 0;
|
|
10279
10285
|
return unavailableSignalInText(failure.error);
|
|
10280
10286
|
}
|
|
10281
10287
|
const DEFAULT_UNAVAILABLE_PAUSE_MS = 15e3;
|
|
@@ -10425,75 +10431,6 @@ function providerAsSandboxClient(provider, options = {}) {
|
|
|
10425
10431
|
});
|
|
10426
10432
|
} };
|
|
10427
10433
|
}
|
|
10428
|
-
/**
|
|
10429
|
-
* The idle timeout this adapter sends when nothing else names one: 1,800 seconds.
|
|
10430
|
-
*
|
|
10431
|
-
* Sandbox substitutes no value of its own: an omitted field falls back to the platform's global
|
|
10432
|
-
* idle timeout, documented as 30 minutes unless an operator changed it, and Runtime sent none. Idle
|
|
10433
|
-
* means inactivity to Sandbox, which suspends the sandbox (the container stops; the workspace is
|
|
10434
|
-
* kept) rather than deleting it. The SDK does not define inactivity further. A request in flight
|
|
10435
|
-
* counts as activity: a Discovery Lab seat created with `idleTimeoutSeconds: 1800` ran one request
|
|
10436
|
-
* to 2,252 seconds, ended by a per-request cap, not by idling (fleet-launch-2026-08-22).
|
|
10437
|
-
*
|
|
10438
|
-
* The value restates the documented default, so it can tighten a longer operator setting but never
|
|
10439
|
-
* loosen the default. It is 3.8 times the longest gap between frames recorded across a healthy
|
|
10440
|
-
* fleet run (469 seconds, same report), and a supervised provider child is observed through an open
|
|
10441
|
-
* stream for its whole turn. It is a backstop for a process that dies holding an environment; the
|
|
10442
|
-
* settlement barrier releases retained environments itself (`Executor.releaseRetained`). It does
|
|
10443
|
-
* nothing on a driver with a create/delete-only lifecycle, which the SDK says skips suspension.
|
|
10444
|
-
*/
|
|
10445
|
-
const DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS = 1800;
|
|
10446
|
-
function sandboxIdleTimeoutSeconds(value) {
|
|
10447
|
-
if (value === void 0) return DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS;
|
|
10448
|
-
if (!Number.isSafeInteger(value) || value <= 0) throw new ValidationError(`sandboxClientAsProvider: idleTimeoutSeconds must be a positive whole number of seconds, got ${String(value)}`);
|
|
10449
|
-
return value;
|
|
10450
|
-
}
|
|
10451
|
-
/**
|
|
10452
|
-
* Adapt a `SandboxClient` into the shared `AgentEnvironmentProvider` contract.
|
|
10453
|
-
* The provider declares the public SDK contract before it creates an environment.
|
|
10454
|
-
* Each environment exposes interactive methods only when its deployment declares every required capability.
|
|
10455
|
-
* @experimental */
|
|
10456
|
-
function sandboxClientAsProvider(client, options = {}) {
|
|
10457
|
-
const providerName = options.name ?? "tangle-sandbox";
|
|
10458
|
-
const idleTimeoutSeconds = sandboxIdleTimeoutSeconds(options.idleTimeoutSeconds);
|
|
10459
|
-
const providerCapabilities = async () => {
|
|
10460
|
-
const resolved = await (options.capabilities ? typeof options.capabilities === "function" ? options.capabilities() : options.capabilities : defaultTangleSandboxCapabilities({
|
|
10461
|
-
namedProfiles: options.resolveProfile !== void 0,
|
|
10462
|
-
rediscover: hasGet(client)
|
|
10463
|
-
}));
|
|
10464
|
-
if (hasGet(client)) return resolved;
|
|
10465
|
-
const { interactiveAgent: _interactiveAgent, ...withoutInteractive } = resolved;
|
|
10466
|
-
return withoutInteractive;
|
|
10467
|
-
};
|
|
10468
|
-
return {
|
|
10469
|
-
name: providerName,
|
|
10470
|
-
capabilities: providerCapabilities,
|
|
10471
|
-
...options.validateProfile ? { validateProfile: options.validateProfile } : {},
|
|
10472
|
-
async create(input) {
|
|
10473
|
-
const custom = options.mapCreateInput?.(input);
|
|
10474
|
-
const createOptions = custom === void 0 ? await sandboxOptionsFromCreateInput(input, options.defaultBackend ?? "opencode", options.resolveProfile, providerName, idleTimeoutSeconds) : {
|
|
10475
|
-
...custom,
|
|
10476
|
-
idleTimeoutSeconds: custom.idleTimeoutSeconds ?? idleTimeoutSeconds
|
|
10477
|
-
};
|
|
10478
|
-
const capabilities = await providerCapabilities();
|
|
10479
|
-
return sandboxInstanceAsEnvironment(await client.create(createOptions, input.signal === void 0 ? void 0 : { signal: input.signal }), providerName, client, capabilities, idleTimeoutSeconds);
|
|
10480
|
-
},
|
|
10481
|
-
...hasGet(client) ? { async get(id) {
|
|
10482
|
-
const capabilities = await providerCapabilities();
|
|
10483
|
-
const box = await client.get(id);
|
|
10484
|
-
return box ? sandboxInstanceAsEnvironment(box, providerName, client, capabilities, idleTimeoutSeconds) : null;
|
|
10485
|
-
} } : {},
|
|
10486
|
-
...hasList(client) ? { async list(query) {
|
|
10487
|
-
return (await client.list(query?.providerOptions)).map((box) => ({
|
|
10488
|
-
id: String(box.id),
|
|
10489
|
-
provider: providerName,
|
|
10490
|
-
name: typeof box.name === "string" ? box.name : void 0,
|
|
10491
|
-
status: statusFromUnknown(readBoxStatus(box)),
|
|
10492
|
-
metadata: readBoxMetadata(box)
|
|
10493
|
-
}));
|
|
10494
|
-
} } : {}
|
|
10495
|
-
};
|
|
10496
|
-
}
|
|
10497
10434
|
/** Only a verified, single-session capture may supply a scalar session identity. */
|
|
10498
10435
|
function capturedSessionIdentity(provenance, coverageComplete, executionId, providerSessionId) {
|
|
10499
10436
|
const unknown = {
|
|
@@ -11177,7 +11114,8 @@ async function* streamProviderExecutor(args) {
|
|
|
11177
11114
|
...result.outcome?.status === "failed" ? { outcome: {
|
|
11178
11115
|
success: false,
|
|
11179
11116
|
...result.outcome.error ? { error: result.outcome.error } : {},
|
|
11180
|
-
...result.outcome.errorCode ? { errorCode: result.outcome.errorCode } : {}
|
|
11117
|
+
...result.outcome.errorCode ? { errorCode: result.outcome.errorCode } : {},
|
|
11118
|
+
...failureStatusCode(result.outcome) === void 0 ? {} : { statusCode: failureStatusCode(result.outcome) }
|
|
11181
11119
|
} } : {},
|
|
11182
11120
|
outRef: contentRef(`provider:${args.provider.name}`, settledResult),
|
|
11183
11121
|
out: settledResult,
|
|
@@ -11186,7 +11124,8 @@ async function* streamProviderExecutor(args) {
|
|
|
11186
11124
|
};
|
|
11187
11125
|
const refusal = args.mayContinue && source.retained && result.outcome?.status === "failed" ? unavailableSignalOfFailure({
|
|
11188
11126
|
error: result.outcome.error ?? "",
|
|
11189
|
-
...result.outcome.errorCode ? { errorCode: result.outcome.errorCode } : {}
|
|
11127
|
+
...result.outcome.errorCode ? { errorCode: result.outcome.errorCode } : {},
|
|
11128
|
+
...failureStatusCode(result.outcome) === void 0 ? {} : { statusCode: failureStatusCode(result.outcome) }
|
|
11190
11129
|
}) : void 0;
|
|
11191
11130
|
if (refusal !== void 0) unavailable = {
|
|
11192
11131
|
signal: refusal,
|
|
@@ -11567,52 +11506,6 @@ function createInputFromSandboxOptions(options) {
|
|
|
11567
11506
|
providerOptions: { sandboxCreateOptions: options ?? {} }
|
|
11568
11507
|
};
|
|
11569
11508
|
}
|
|
11570
|
-
async function sandboxOptionsFromCreateInput(input, defaultBackend, resolveProfile, providerName = "tangle-sandbox", idleTimeoutSeconds = DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS) {
|
|
11571
|
-
if (input.runtimeAttachments !== void 0) throw new ValidationError("Tangle Sandbox runtimeAttachments require an explicit mapCreateInput mapper; the maintained Sandbox SDK create contract does not transport them");
|
|
11572
|
-
const backendType = input.backend ?? defaultBackend;
|
|
11573
|
-
const workspace = WorkspaceRequestSchema.parse(input.workspace ?? {});
|
|
11574
|
-
const environment = sandboxEnvironmentFromWorkspace(workspace);
|
|
11575
|
-
const cwd = workspaceCwdPathForBase(workspace.cwd, "repository", providerName);
|
|
11576
|
-
const providerOptions = input.providerOptions?.sandboxCreateOptions;
|
|
11577
|
-
const base = providerOptions && typeof providerOptions === "object" ? { ...providerOptions } : {};
|
|
11578
|
-
assertSandboxSecretNames(input.secrets);
|
|
11579
|
-
assertSandboxSecretNames(base.secrets);
|
|
11580
|
-
const profile = await sandboxProfileFromReference(input.profile, resolveProfile);
|
|
11581
|
-
const { profile: _baseProfile, ...baseBackend } = base.backend ?? {};
|
|
11582
|
-
return {
|
|
11583
|
-
...base,
|
|
11584
|
-
idleTimeoutSeconds: base.idleTimeoutSeconds ?? idleTimeoutSeconds,
|
|
11585
|
-
...environment ? { environment } : {},
|
|
11586
|
-
...workspace.repoUrl ? { git: {
|
|
11587
|
-
url: workspace.repoUrl,
|
|
11588
|
-
ref: workspace.gitRef
|
|
11589
|
-
} } : {},
|
|
11590
|
-
...cwd === void 0 ? {} : { cwd },
|
|
11591
|
-
...input.resources ? { resources: input.resources } : {},
|
|
11592
|
-
...input.env ? { env: input.env } : {},
|
|
11593
|
-
...Array.isArray(input.secrets) ? { secrets: input.secrets } : {},
|
|
11594
|
-
...input.metadata ? { metadata: input.metadata } : {},
|
|
11595
|
-
...input.name ? { name: input.name } : {},
|
|
11596
|
-
...input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {},
|
|
11597
|
-
backend: {
|
|
11598
|
-
...baseBackend,
|
|
11599
|
-
type: backendType,
|
|
11600
|
-
profile
|
|
11601
|
-
}
|
|
11602
|
-
};
|
|
11603
|
-
}
|
|
11604
|
-
function assertSandboxSecretNames(secrets) {
|
|
11605
|
-
if (secrets !== void 0 && secrets !== "all" && (!Array.isArray(secrets) || secrets.some((secret) => typeof secret !== "string" || secret.trim().length === 0))) throw new ValidationError("Tangle Sandbox secret names must be non-empty strings; secret values are unsupported");
|
|
11606
|
-
}
|
|
11607
|
-
function sandboxEnvironmentFromWorkspace(workspace) {
|
|
11608
|
-
if (workspace.environment !== void 0 && workspace.image !== void 0 && workspace.environment !== workspace.image) throw new ValidationError("Tangle Sandbox accepts one environment value; workspace.environment and workspace.image must match");
|
|
11609
|
-
return workspace.environment ?? workspace.image;
|
|
11610
|
-
}
|
|
11611
|
-
async function sandboxProfileFromReference(profile, resolveProfile) {
|
|
11612
|
-
if (typeof profile !== "string") return profile;
|
|
11613
|
-
if (!resolveProfile) throw new ValidationError(`Tangle Sandbox requires an inline AgentProfile; named profile "${profile}" needs SandboxClientProviderOptions.resolveProfile`);
|
|
11614
|
-
return resolveProfile(profile);
|
|
11615
|
-
}
|
|
11616
11509
|
function environmentAsSandboxInstance(environment, options) {
|
|
11617
11510
|
let providerSessionId = null;
|
|
11618
11511
|
let controlRef;
|
|
@@ -11784,147 +11677,6 @@ function environmentAsSandboxInstance(environment, options) {
|
|
|
11784
11677
|
}
|
|
11785
11678
|
};
|
|
11786
11679
|
}
|
|
11787
|
-
async function sandboxInstanceAsEnvironment(box, providerName, client, providerCapabilities, idleTimeoutSeconds) {
|
|
11788
|
-
const capabilities = await sandboxEnvironmentCapabilities(box, providerCapabilities);
|
|
11789
|
-
const interactiveAgent = capabilities.interactiveAgent;
|
|
11790
|
-
return {
|
|
11791
|
-
id: String(box.id),
|
|
11792
|
-
provider: providerName,
|
|
11793
|
-
capabilities,
|
|
11794
|
-
...typeof box.name === "string" ? { name: box.name } : {},
|
|
11795
|
-
...readBoxMetadata(box) ? { metadata: readBoxMetadata(box) } : {},
|
|
11796
|
-
async status() {
|
|
11797
|
-
await maybeRefresh(box);
|
|
11798
|
-
return statusFromUnknown(readBoxStatus(box));
|
|
11799
|
-
},
|
|
11800
|
-
async *stream(input) {
|
|
11801
|
-
for await (const event of box.streamPrompt(promptFromAgentTurnInput(input), promptOptionsFromAgentTurnInput(input))) yield environmentEventFromSandboxEvent(event);
|
|
11802
|
-
},
|
|
11803
|
-
...hasDispatchPrompt(box) ? { async dispatch(input) {
|
|
11804
|
-
return sessionRefFromSandboxDispatch(await box.dispatchPrompt(promptFromAgentTurnInput(input), promptOptionsFromAgentTurnInput(input)), providerName);
|
|
11805
|
-
} } : {},
|
|
11806
|
-
...hasSession(box) ? {
|
|
11807
|
-
session(id, sessionOptions) {
|
|
11808
|
-
return sandboxSessionAsAgentSession(box.session(id), sessionOptions?.controlRef);
|
|
11809
|
-
},
|
|
11810
|
-
async respondToInteraction(command, options) {
|
|
11811
|
-
return (await box.session(command.binding.sessionId).respondToInteraction(command, options)).acknowledgement;
|
|
11812
|
-
}
|
|
11813
|
-
} : {},
|
|
11814
|
-
...interactiveAgent ? {
|
|
11815
|
-
async startInteractive(request, options) {
|
|
11816
|
-
const exactRequest = AgentInteractiveSessionStartSchema.parse(request);
|
|
11817
|
-
assertSandboxInteractiveBinding(exactRequest.run, box, providerName);
|
|
11818
|
-
const result = await box.session(exactRequest.run.sessionId).interactive().start(exactRequest, options);
|
|
11819
|
-
if (result.state !== "running") throw new ValidationError("sandbox interactive process settled before attachment");
|
|
11820
|
-
const ref = detachedSnapshot(AgentInteractiveSessionRefSchema.parse(result.ref), "sandbox interactive start reference");
|
|
11821
|
-
if (!agentInteractiveSessionRefMatchesStart(exactRequest, ref)) throw new ValidationError("sandbox interactive start returned a different exact process");
|
|
11822
|
-
return ref;
|
|
11823
|
-
},
|
|
11824
|
-
interactive(ref) {
|
|
11825
|
-
const exactRef = detachedSnapshot(AgentInteractiveSessionRefSchema.parse(ref), "sandbox interactive reference");
|
|
11826
|
-
assertSandboxInteractiveBinding(exactRef.run, box, providerName);
|
|
11827
|
-
const session = box.session(exactRef.run.sessionId).interactive({ ref: exactRef });
|
|
11828
|
-
const controlledSessions = /* @__PURE__ */ new Map();
|
|
11829
|
-
const controlledSession = (control) => {
|
|
11830
|
-
const key = canonicalCandidateDigest(control);
|
|
11831
|
-
const existing = controlledSessions.get(key);
|
|
11832
|
-
if (existing) return existing;
|
|
11833
|
-
const created = box.session(exactRef.run.sessionId).interactive({
|
|
11834
|
-
ref: exactRef,
|
|
11835
|
-
control
|
|
11836
|
-
});
|
|
11837
|
-
controlledSessions.set(key, created);
|
|
11838
|
-
return created;
|
|
11839
|
-
};
|
|
11840
|
-
return {
|
|
11841
|
-
ref: exactRef,
|
|
11842
|
-
claimControl: (request, options) => session.claimControl(request, options),
|
|
11843
|
-
async status(options) {
|
|
11844
|
-
const status = await session.status(options);
|
|
11845
|
-
if (status === null) throw new ValidationError(`sandbox interactive session "${exactRef.run.sessionId}" is unavailable`);
|
|
11846
|
-
return status;
|
|
11847
|
-
},
|
|
11848
|
-
attach: (request, options) => {
|
|
11849
|
-
const controlled = controlledSession(request.control);
|
|
11850
|
-
if (typeof controlled.attachAgentTerminal !== "function") return Promise.reject(new ValidationError("sandbox interactive session does not expose the exact terminal adapter"));
|
|
11851
|
-
return controlled.attachAgentTerminal(request, options);
|
|
11852
|
-
},
|
|
11853
|
-
sendPrompt: (command, options) => controlledSession(command.control).sendPrompt(command, options),
|
|
11854
|
-
stop: (command, options) => controlledSession(command.control).stop(command, options)
|
|
11855
|
-
};
|
|
11856
|
-
}
|
|
11857
|
-
} : {},
|
|
11858
|
-
...hasRead(box) ? { read: box.read.bind(box) } : {},
|
|
11859
|
-
...hasWrite(box) ? { write: box.write.bind(box) } : {},
|
|
11860
|
-
...hasExec(box) ? { async exec(command, options) {
|
|
11861
|
-
return execResultFromSandboxExecResult(await box.exec(command, options));
|
|
11862
|
-
} } : {},
|
|
11863
|
-
async checkpoint(options) {
|
|
11864
|
-
return {
|
|
11865
|
-
id: (await box.snapshot({ ...options?.name ? { tags: [options.name] } : {} })).snapshotId,
|
|
11866
|
-
provider: providerName,
|
|
11867
|
-
...options?.metadata ? { metadata: options.metadata } : {}
|
|
11868
|
-
};
|
|
11869
|
-
},
|
|
11870
|
-
async fork(checkpoint, options) {
|
|
11871
|
-
return sandboxInstanceAsEnvironment(await client.create({
|
|
11872
|
-
fromSnapshot: checkpoint.id,
|
|
11873
|
-
fromSandboxId: String(box.id),
|
|
11874
|
-
idleTimeoutSeconds,
|
|
11875
|
-
...options?.name ? { name: options.name } : {},
|
|
11876
|
-
...options?.metadata ? { metadata: options.metadata } : {}
|
|
11877
|
-
}), providerName, client, providerCapabilities, idleTimeoutSeconds);
|
|
11878
|
-
},
|
|
11879
|
-
async placement() {
|
|
11880
|
-
return placementInfoFromLoopPlacement(client.describePlacement?.(box), box);
|
|
11881
|
-
},
|
|
11882
|
-
async refresh() {
|
|
11883
|
-
await maybeRefresh(box);
|
|
11884
|
-
},
|
|
11885
|
-
async destroy() {
|
|
11886
|
-
await destroyBox(box);
|
|
11887
|
-
}
|
|
11888
|
-
};
|
|
11889
|
-
}
|
|
11890
|
-
function sandboxSessionAsAgentSession(session, expectedControlRef) {
|
|
11891
|
-
const controlRef = resolveSessionControlRef(session.controlRef, expectedControlRef, { allowExpectedWhenActualAbsent: true });
|
|
11892
|
-
return {
|
|
11893
|
-
id: session.id,
|
|
11894
|
-
...controlRef === void 0 ? {} : { controlRef },
|
|
11895
|
-
async status() {
|
|
11896
|
-
const status = await session.status();
|
|
11897
|
-
if (!status) return null;
|
|
11898
|
-
assertSandboxStatusBinding(status, controlRef);
|
|
11899
|
-
return sessionStatusFromUnknown(status.status);
|
|
11900
|
-
},
|
|
11901
|
-
async *events(options) {
|
|
11902
|
-
const executionId = scopedExecutionId(controlRef, options?.executionId);
|
|
11903
|
-
for await (const event of session.events({
|
|
11904
|
-
...options?.since === void 0 ? {} : { since: options.since },
|
|
11905
|
-
...executionId === void 0 ? {} : { executionId },
|
|
11906
|
-
...options?.signal === void 0 ? {} : { signal: options.signal }
|
|
11907
|
-
})) yield environmentEventFromSandboxEvent(event);
|
|
11908
|
-
},
|
|
11909
|
-
async result(options) {
|
|
11910
|
-
return agentTurnResultFromPromptResult(await awaitAbortable$1(Promise.resolve().then(() => session.result({ ...controlRef?.executionId === void 0 ? {} : { executionId: controlRef.executionId } })), options?.signal));
|
|
11911
|
-
},
|
|
11912
|
-
async prompt(input) {
|
|
11913
|
-
return agentTurnResultFromPromptResult(await session.prompt(promptFromAgentTurnInput(input), promptOptionsFromAgentTurnInput(input)));
|
|
11914
|
-
},
|
|
11915
|
-
...session.respondToInteraction ? { async respondToInteraction(command, options) {
|
|
11916
|
-
assertInteractionCommandScope(command, controlRef);
|
|
11917
|
-
return (await session.respondToInteraction(command, options)).acknowledgement;
|
|
11918
|
-
} } : {},
|
|
11919
|
-
...session.cancelRun ? { async cancelRun(request, options) {
|
|
11920
|
-
assertCancellationScope(request, controlRef);
|
|
11921
|
-
return session.cancelRun(request, options);
|
|
11922
|
-
} } : {},
|
|
11923
|
-
cancel() {
|
|
11924
|
-
return session.interrupt(controlRef?.executionId === void 0 ? void 0 : { executionId: controlRef.executionId }).then(() => void 0);
|
|
11925
|
-
}
|
|
11926
|
-
};
|
|
11927
|
-
}
|
|
11928
11680
|
function sandboxSessionFromAgentSession(session, expectedControlRef) {
|
|
11929
11681
|
if (!session) throw new ValidationError("providerAsSandboxClient: session is unavailable");
|
|
11930
11682
|
const controlRef = resolveSessionControlRef(session.controlRef, expectedControlRef);
|
|
@@ -11998,20 +11750,6 @@ function promptResultFromAgentTurnResult(result) {
|
|
|
11998
11750
|
} : {}
|
|
11999
11751
|
};
|
|
12000
11752
|
}
|
|
12001
|
-
function environmentEventFromSandboxEvent(event) {
|
|
12002
|
-
const data = event.data && typeof event.data === "object" ? event.data : {};
|
|
12003
|
-
const normalized = canonicalStreamEventFromSandboxEvent(event);
|
|
12004
|
-
const usage = tokenUsageFromData(data);
|
|
12005
|
-
const receipt = tokenUsageReceipt(tokenUsageRecord(data));
|
|
12006
|
-
return {
|
|
12007
|
-
type: String(event.type),
|
|
12008
|
-
data,
|
|
12009
|
-
...event.id ? { id: event.id } : {},
|
|
12010
|
-
...normalized ? { normalized } : {},
|
|
12011
|
-
...usage && receipt.complete ? { usage } : {},
|
|
12012
|
-
providerEvent: event
|
|
12013
|
-
};
|
|
12014
|
-
}
|
|
12015
11753
|
function sandboxEventFromEnvironmentEvent(event) {
|
|
12016
11754
|
const normalized = event.normalized;
|
|
12017
11755
|
const type = normalized?.type ?? event.type;
|
|
@@ -12073,12 +11811,14 @@ function providerFailureEvent(event, sandboxEvent) {
|
|
|
12073
11811
|
if (!failedStatus && !failedTerminal) return void 0;
|
|
12074
11812
|
const detail = failureDetail(sandboxEvent.data) ?? failureDetail(outcome) ?? failureDetail(result) ?? (normalized?.type === "status" ? normalized.detail : void 0);
|
|
12075
11813
|
const errorCode = failureCode(sandboxEvent.data) ?? failureCode(outcome) ?? failureCode(result);
|
|
11814
|
+
const statusCode = failureStatusCode(sandboxEvent.data) ?? failureStatusCode(outcome) ?? failureStatusCode(result);
|
|
12076
11815
|
return {
|
|
12077
11816
|
type: "result",
|
|
12078
11817
|
data: {
|
|
12079
11818
|
status: "failed",
|
|
12080
11819
|
...detail ? { error: detail } : {},
|
|
12081
|
-
...errorCode ? { errorCode } : {}
|
|
11820
|
+
...errorCode ? { errorCode } : {},
|
|
11821
|
+
...statusCode === void 0 ? {} : { statusCode }
|
|
12082
11822
|
}
|
|
12083
11823
|
};
|
|
12084
11824
|
}
|
|
@@ -12167,6 +11907,11 @@ function failureDetail(value) {
|
|
|
12167
11907
|
if (typeof value.message === "string") return value.message;
|
|
12168
11908
|
return typeof value.detail === "string" ? value.detail : void 0;
|
|
12169
11909
|
}
|
|
11910
|
+
/** Preserve the Sandbox outcome's numeric HTTP metadata across the provider adapter. */
|
|
11911
|
+
function failureStatusCode(value) {
|
|
11912
|
+
const statusCode = recordValue(value)?.statusCode;
|
|
11913
|
+
return typeof statusCode === "number" && Number.isInteger(statusCode) && statusCode >= 400 && statusCode <= 599 ? statusCode : void 0;
|
|
11914
|
+
}
|
|
12170
11915
|
function failureCode(value) {
|
|
12171
11916
|
if (!value) return void 0;
|
|
12172
11917
|
const error = recordValue(value.error);
|
|
@@ -12238,17 +11983,6 @@ function resolveSessionControlRef(actual, expected, options = {}) {
|
|
|
12238
11983
|
if (!sameControlCoordinates(actualExact.data, expectedExact)) throw new ValidationError("provider session returned a different exact run control reference");
|
|
12239
11984
|
return actualExact.data;
|
|
12240
11985
|
}
|
|
12241
|
-
function assertSandboxStatusBinding(status, controlRef) {
|
|
12242
|
-
if (!status || typeof status !== "object" || controlRef === void 0) return;
|
|
12243
|
-
const record = status;
|
|
12244
|
-
if (record.runControlRef !== void 0) {
|
|
12245
|
-
if (!sameControlCoordinates(AgentExactRunControlRefSchema.parse(record.runControlRef), controlRef)) throw new ValidationError("sandbox status returned a different exact run control reference");
|
|
12246
|
-
}
|
|
12247
|
-
for (const key of ["activeExecutionId", "latestExecutionId"]) {
|
|
12248
|
-
const executionId = record[key];
|
|
12249
|
-
if (executionId !== void 0 && executionId !== controlRef.executionId) throw new ValidationError("sandbox status returned a different execution");
|
|
12250
|
-
}
|
|
12251
|
-
}
|
|
12252
11986
|
function assertInteractionCommandScope(command, controlRef) {
|
|
12253
11987
|
if (controlRef === void 0) return;
|
|
12254
11988
|
if (command.binding.runId !== controlRef.runId || command.binding.environmentId !== controlRef.environmentId || command.binding.sessionId !== controlRef.sessionId || command.binding.executionId !== controlRef.executionId) throw new ValidationError("interaction response targeted a different execution");
|
|
@@ -12386,50 +12120,6 @@ function isUsageType(type) {
|
|
|
12386
12120
|
function isNestedUsageType(type) {
|
|
12387
12121
|
return isSandboxTerminalEvent(type) && sandboxTerminalUsageField(type) === "usage";
|
|
12388
12122
|
}
|
|
12389
|
-
function tokenUsageFromData(data) {
|
|
12390
|
-
const usageRecord = tokenUsageRecord(data);
|
|
12391
|
-
const inputTokens = inputTokensFromUsage(usageRecord);
|
|
12392
|
-
const outputTokens = outputTokensFromUsage(usageRecord);
|
|
12393
|
-
const totalTokens = finiteNumber(usageRecord.totalTokens);
|
|
12394
|
-
const cacheReadInputTokens = finiteNumber(usageRecord.cacheReadInputTokens);
|
|
12395
|
-
const cacheCreationInputTokens = finiteNumber(usageRecord.cacheCreationInputTokens);
|
|
12396
|
-
const reasoningTokens = finiteNumber(usageRecord.reasoningTokens);
|
|
12397
|
-
const cost = finiteNumber(usageRecord.cost) ?? finiteNumber(usageRecord.costUsd) ?? finiteNumber(usageRecord.totalCostUsd) ?? finiteNumber(data.costUsd) ?? finiteNumber(data.totalCostUsd);
|
|
12398
|
-
if (inputTokens === void 0 && outputTokens === void 0 && totalTokens === void 0 && cacheReadInputTokens === void 0 && cacheCreationInputTokens === void 0 && reasoningTokens === void 0 && cost === void 0) return void 0;
|
|
12399
|
-
return {
|
|
12400
|
-
inputTokens: inputTokens ?? 0,
|
|
12401
|
-
outputTokens: outputTokens ?? 0,
|
|
12402
|
-
...totalTokens !== void 0 ? { totalTokens } : {},
|
|
12403
|
-
...cacheReadInputTokens !== void 0 ? { cacheReadInputTokens } : {},
|
|
12404
|
-
...cacheCreationInputTokens !== void 0 ? { cacheCreationInputTokens } : {},
|
|
12405
|
-
...reasoningTokens !== void 0 ? { reasoningTokens } : {},
|
|
12406
|
-
...cost !== void 0 ? { cost } : {}
|
|
12407
|
-
};
|
|
12408
|
-
}
|
|
12409
|
-
function tokenUsageRecord(data) {
|
|
12410
|
-
return recordValue(data.usage) ?? recordValue(data.tokenUsage) ?? data;
|
|
12411
|
-
}
|
|
12412
|
-
function inputTokensFromUsage(value) {
|
|
12413
|
-
const usage = recordValue(value);
|
|
12414
|
-
if (!usage) return void 0;
|
|
12415
|
-
return finiteNumber(usage.inputTokens) ?? finiteNumber(usage.tokensIn) ?? finiteNumber(usage.prompt_tokens);
|
|
12416
|
-
}
|
|
12417
|
-
function outputTokensFromUsage(value) {
|
|
12418
|
-
const usage = recordValue(value);
|
|
12419
|
-
if (!usage) return void 0;
|
|
12420
|
-
return finiteNumber(usage.outputTokens) ?? finiteNumber(usage.tokensOut) ?? finiteNumber(usage.completion_tokens);
|
|
12421
|
-
}
|
|
12422
|
-
function tokenUsageReceipt(value) {
|
|
12423
|
-
const usage = recordValue(value);
|
|
12424
|
-
const hasInput = inputTokensFromUsage(usage) !== void 0;
|
|
12425
|
-
const hasOutput = outputTokensFromUsage(usage) !== void 0;
|
|
12426
|
-
return {
|
|
12427
|
-
hasInput,
|
|
12428
|
-
hasOutput,
|
|
12429
|
-
hasTokens: hasInput || hasOutput || finiteNumber(usage?.totalTokens) !== void 0 || finiteNumber(usage?.cacheReadInputTokens) !== void 0 || finiteNumber(usage?.cacheCreationInputTokens) !== void 0 || finiteNumber(usage?.reasoningTokens) !== void 0,
|
|
12430
|
-
complete: hasInput && hasOutput
|
|
12431
|
-
};
|
|
12432
|
-
}
|
|
12433
12123
|
function mergeTokenUsage(left, right) {
|
|
12434
12124
|
if (!left) return right;
|
|
12435
12125
|
if (!right) return left;
|
|
@@ -12443,21 +12133,9 @@ function mergeTokenUsage(left, right) {
|
|
|
12443
12133
|
...left.cost !== void 0 || right.cost !== void 0 ? { cost: (left.cost ?? 0) + (right.cost ?? 0) } : {}
|
|
12444
12134
|
};
|
|
12445
12135
|
}
|
|
12446
|
-
function finiteNumber(value) {
|
|
12447
|
-
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
12448
|
-
}
|
|
12449
12136
|
function stringValue(value) {
|
|
12450
12137
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
12451
12138
|
}
|
|
12452
|
-
function agentTurnResultFromPromptResult(result) {
|
|
12453
|
-
const record = result;
|
|
12454
|
-
return {
|
|
12455
|
-
text: typeof record.response === "string" ? record.response : typeof record.text === "string" ? record.text : typeof record.finalText === "string" ? record.finalText : "",
|
|
12456
|
-
success: typeof record.success === "boolean" ? record.success : true,
|
|
12457
|
-
...typeof record.error === "string" ? { error: record.error } : {},
|
|
12458
|
-
usage: tokenUsageFromData(record)
|
|
12459
|
-
};
|
|
12460
|
-
}
|
|
12461
12139
|
function sandboxDispatchResultFromSessionRef(session) {
|
|
12462
12140
|
const controlRef = session.controlRef === void 0 ? void 0 : AgentExactRunControlRefSchema.parse(session.controlRef);
|
|
12463
12141
|
const metadataExecutionId = optionalDispatchIdentity(session.metadata?.executionId, "executionId");
|
|
@@ -12478,50 +12156,11 @@ function sandboxDispatchResultFromSessionRef(session) {
|
|
|
12478
12156
|
}
|
|
12479
12157
|
};
|
|
12480
12158
|
}
|
|
12481
|
-
function sessionRefFromSandboxDispatch(dispatched, providerName) {
|
|
12482
|
-
const record = dispatched && typeof dispatched === "object" ? dispatched : void 0;
|
|
12483
|
-
const id = record?.sessionId ?? record?.id;
|
|
12484
|
-
if (typeof id !== "string" || id.length === 0) throw new ValidationError("sandboxClientAsProvider: dispatch returned no session id");
|
|
12485
|
-
if (!record) throw new ValidationError("sandboxClientAsProvider: dispatch returned no session record");
|
|
12486
|
-
const executionId = optionalDispatchIdentity(record.executionId, "executionId");
|
|
12487
|
-
const controlRef = record.runControlRef === void 0 ? void 0 : AgentExactRunControlRefSchema.parse(record.runControlRef);
|
|
12488
|
-
if (controlRef !== void 0) {
|
|
12489
|
-
if (controlRef.sessionId !== id || controlRef.provider !== providerName) throw new ValidationError("sandbox dispatch returned a control reference for another session");
|
|
12490
|
-
if (executionId !== void 0 && controlRef.executionId !== executionId) throw new ValidationError("sandbox dispatch returned conflicting execution identities");
|
|
12491
|
-
}
|
|
12492
|
-
if (record.alreadyExisted !== void 0 && typeof record.alreadyExisted !== "boolean") throw new ValidationError("sandbox dispatch returned an invalid alreadyExisted flag");
|
|
12493
|
-
if (record.dispatched !== void 0 && typeof record.dispatched !== "boolean") throw new ValidationError("sandbox dispatch returned an invalid dispatched flag");
|
|
12494
|
-
if (record.status !== void 0 && !isSandboxSessionStatus(record.status)) throw new ValidationError("sandbox dispatch returned an invalid session status");
|
|
12495
|
-
return {
|
|
12496
|
-
id,
|
|
12497
|
-
provider: providerName,
|
|
12498
|
-
...controlRef === void 0 ? {} : { controlRef },
|
|
12499
|
-
metadata: {
|
|
12500
|
-
...record.status ? { status: record.status } : {},
|
|
12501
|
-
...executionId === void 0 ? {} : { executionId },
|
|
12502
|
-
...record.alreadyExisted !== void 0 ? { alreadyExisted: record.alreadyExisted } : {},
|
|
12503
|
-
...record.dispatched !== void 0 ? { dispatched: record.dispatched } : {}
|
|
12504
|
-
}
|
|
12505
|
-
};
|
|
12506
|
-
}
|
|
12507
12159
|
function optionalDispatchIdentity(value, label) {
|
|
12508
12160
|
if (value === void 0) return void 0;
|
|
12509
12161
|
if (typeof value !== "string" || value.length === 0) throw new ValidationError(`sandbox dispatch returned an invalid ${label}`);
|
|
12510
12162
|
return value;
|
|
12511
12163
|
}
|
|
12512
|
-
function isSandboxSessionStatus(value) {
|
|
12513
|
-
return value === "queued" || value === "running" || value === "completed" || value === "failed" || value === "cancelled";
|
|
12514
|
-
}
|
|
12515
|
-
function execResultFromSandboxExecResult(result) {
|
|
12516
|
-
const record = result;
|
|
12517
|
-
const exitCode = finiteNumber(record.exitCode) ?? finiteNumber(record.code);
|
|
12518
|
-
if (exitCode === void 0) throw new ValidationError("sandboxClientAsProvider: exec returned no exit code");
|
|
12519
|
-
return {
|
|
12520
|
-
exitCode,
|
|
12521
|
-
stdout: typeof record.stdout === "string" ? record.stdout : "",
|
|
12522
|
-
stderr: typeof record.stderr === "string" ? record.stderr : ""
|
|
12523
|
-
};
|
|
12524
|
-
}
|
|
12525
12164
|
function statusFromUnknown(status) {
|
|
12526
12165
|
if (status === "pending" || status === "provisioning" || status === "running") return status;
|
|
12527
12166
|
if (status === "stopped" || status === "failed" || status === "expired") return status;
|
|
@@ -12533,133 +12172,6 @@ function sessionStatusFromUnknown(status) {
|
|
|
12533
12172
|
if (status === "completed" || status === "cancelled") return status;
|
|
12534
12173
|
return statusFromUnknown(status);
|
|
12535
12174
|
}
|
|
12536
|
-
function readBoxStatus(box) {
|
|
12537
|
-
return box.status;
|
|
12538
|
-
}
|
|
12539
|
-
function readBoxMetadata(box) {
|
|
12540
|
-
const metadata = box.metadata;
|
|
12541
|
-
return metadata && typeof metadata === "object" ? metadata : void 0;
|
|
12542
|
-
}
|
|
12543
|
-
async function maybeRefresh(box) {
|
|
12544
|
-
const refresh = box.refresh;
|
|
12545
|
-
if (typeof refresh === "function") await refresh.call(box);
|
|
12546
|
-
}
|
|
12547
|
-
async function destroyBox(box) {
|
|
12548
|
-
const deleteBox = box.delete;
|
|
12549
|
-
if (typeof deleteBox === "function") await deleteBox.call(box);
|
|
12550
|
-
}
|
|
12551
|
-
function placementInfoFromLoopPlacement(placement, box) {
|
|
12552
|
-
if (!placement) return {
|
|
12553
|
-
kind: "sandbox",
|
|
12554
|
-
sandboxId: String(box.id)
|
|
12555
|
-
};
|
|
12556
|
-
return {
|
|
12557
|
-
kind: placement.kind === "fleet" ? "fleet" : placement.kind === "in-process" ? "local" : "sandbox",
|
|
12558
|
-
...placement.sandboxId ? { sandboxId: placement.sandboxId } : { sandboxId: String(box.id) },
|
|
12559
|
-
...placement.fleetId ? { fleetId: placement.fleetId } : {},
|
|
12560
|
-
...placement.machineId ? { machineId: placement.machineId } : {}
|
|
12561
|
-
};
|
|
12562
|
-
}
|
|
12563
|
-
const completeInteractiveAgentCapabilities = {
|
|
12564
|
-
start: true,
|
|
12565
|
-
control: true,
|
|
12566
|
-
status: true,
|
|
12567
|
-
attach: true,
|
|
12568
|
-
reattach: true,
|
|
12569
|
-
sendPrompt: true,
|
|
12570
|
-
input: true,
|
|
12571
|
-
resize: true,
|
|
12572
|
-
stop: true
|
|
12573
|
-
};
|
|
12574
|
-
async function sandboxEnvironmentCapabilities(box, providerCapabilities) {
|
|
12575
|
-
const { interactiveAgent: providerInteractive, ...baseCapabilities } = providerCapabilities;
|
|
12576
|
-
if (!hasCompleteInteractiveAgentCapabilities(providerInteractive)) return baseCapabilities;
|
|
12577
|
-
let deployed;
|
|
12578
|
-
try {
|
|
12579
|
-
deployed = await box.capabilities();
|
|
12580
|
-
} catch {
|
|
12581
|
-
return baseCapabilities;
|
|
12582
|
-
}
|
|
12583
|
-
if (!hasCompleteInteractiveAgentCapabilities(deployed?.interactiveAgent)) return baseCapabilities;
|
|
12584
|
-
if (!hasExactInteractiveTerminalAdapter(box)) return baseCapabilities;
|
|
12585
|
-
return {
|
|
12586
|
-
...baseCapabilities,
|
|
12587
|
-
interactiveAgent: { ...completeInteractiveAgentCapabilities }
|
|
12588
|
-
};
|
|
12589
|
-
}
|
|
12590
|
-
function hasExactInteractiveTerminalAdapter(box) {
|
|
12591
|
-
if (!hasSession(box)) return false;
|
|
12592
|
-
try {
|
|
12593
|
-
const session = box.session("__runtime-capability-probe__");
|
|
12594
|
-
const interactive = session.interactive;
|
|
12595
|
-
if (typeof interactive !== "function") return false;
|
|
12596
|
-
return typeof interactive.call(session).attachAgentTerminal === "function";
|
|
12597
|
-
} catch {
|
|
12598
|
-
return false;
|
|
12599
|
-
}
|
|
12600
|
-
}
|
|
12601
|
-
function hasCompleteInteractiveAgentCapabilities(value) {
|
|
12602
|
-
return value?.start === true && value.control === true && value.status === true && value.attach === true && value.reattach === true && value.sendPrompt === true && value.input === true && value.resize === true && value.stop === true;
|
|
12603
|
-
}
|
|
12604
|
-
function assertSandboxInteractiveBinding(run, box, providerName) {
|
|
12605
|
-
if (run.provider !== providerName || run.environmentId !== String(box.id)) throw new ValidationError("sandbox interactive request targets another environment");
|
|
12606
|
-
}
|
|
12607
|
-
function defaultTangleSandboxCapabilities(options) {
|
|
12608
|
-
return {
|
|
12609
|
-
profile: {
|
|
12610
|
-
namedProfiles: options.namedProfiles,
|
|
12611
|
-
systemPrompt: { ...harnessSystemPromptIntents(void 0) },
|
|
12612
|
-
instructions: true,
|
|
12613
|
-
tools: true,
|
|
12614
|
-
permissions: true,
|
|
12615
|
-
mcp: true,
|
|
12616
|
-
subagents: true,
|
|
12617
|
-
resources: {
|
|
12618
|
-
files: true,
|
|
12619
|
-
instructions: true,
|
|
12620
|
-
tools: true,
|
|
12621
|
-
skills: true,
|
|
12622
|
-
agents: true,
|
|
12623
|
-
commands: true
|
|
12624
|
-
},
|
|
12625
|
-
hooks: true,
|
|
12626
|
-
modes: true,
|
|
12627
|
-
runtimeUpdate: true,
|
|
12628
|
-
validation: true
|
|
12629
|
-
},
|
|
12630
|
-
streaming: {
|
|
12631
|
-
live: true,
|
|
12632
|
-
replay: true,
|
|
12633
|
-
detach: true,
|
|
12634
|
-
turnIdempotency: true
|
|
12635
|
-
},
|
|
12636
|
-
sessions: {
|
|
12637
|
-
continue: true,
|
|
12638
|
-
list: true,
|
|
12639
|
-
messages: true
|
|
12640
|
-
},
|
|
12641
|
-
workspace: {
|
|
12642
|
-
read: true,
|
|
12643
|
-
write: true,
|
|
12644
|
-
exec: true,
|
|
12645
|
-
git: true,
|
|
12646
|
-
upload: true,
|
|
12647
|
-
download: true,
|
|
12648
|
-
cwdBases: {
|
|
12649
|
-
repository: true,
|
|
12650
|
-
host: false
|
|
12651
|
-
}
|
|
12652
|
-
},
|
|
12653
|
-
branching: {
|
|
12654
|
-
checkpoint: false,
|
|
12655
|
-
fork: false
|
|
12656
|
-
},
|
|
12657
|
-
...options.rediscover ? { interactiveAgent: { ...completeInteractiveAgentCapabilities } } : {},
|
|
12658
|
-
placement: true,
|
|
12659
|
-
usage: true,
|
|
12660
|
-
confidential: false
|
|
12661
|
-
};
|
|
12662
|
-
}
|
|
12663
12175
|
function contentRef(prefix, value) {
|
|
12664
12176
|
let str;
|
|
12665
12177
|
try {
|
|
@@ -12674,27 +12186,6 @@ function contentRef(prefix, value) {
|
|
|
12674
12186
|
}
|
|
12675
12187
|
return `${prefix}:${(hash >>> 0).toString(16).padStart(8, "0")}`;
|
|
12676
12188
|
}
|
|
12677
|
-
function hasGet(client) {
|
|
12678
|
-
return typeof client.get === "function";
|
|
12679
|
-
}
|
|
12680
|
-
function hasList(client) {
|
|
12681
|
-
return typeof client.list === "function";
|
|
12682
|
-
}
|
|
12683
|
-
function hasDispatchPrompt(box) {
|
|
12684
|
-
return typeof box.dispatchPrompt === "function";
|
|
12685
|
-
}
|
|
12686
|
-
function hasSession(box) {
|
|
12687
|
-
return typeof box.session === "function";
|
|
12688
|
-
}
|
|
12689
|
-
function hasRead(box) {
|
|
12690
|
-
return typeof box.read === "function";
|
|
12691
|
-
}
|
|
12692
|
-
function hasWrite(box) {
|
|
12693
|
-
return typeof box.write === "function";
|
|
12694
|
-
}
|
|
12695
|
-
function hasExec(box) {
|
|
12696
|
-
return typeof box.exec === "function";
|
|
12697
|
-
}
|
|
12698
12189
|
//#endregion
|
|
12699
12190
|
//#region src/runtime/model-identity.ts
|
|
12700
12191
|
const SNAPSHOT_TOKEN = /^[A-Za-z0-9._-]+$/u;
|
|
@@ -23259,21 +22750,22 @@ async function ownerWorkspaceRetentionFailures(events, nodeId, blobs) {
|
|
|
23259
22750
|
if (event.kind === "execution-input") {
|
|
23260
22751
|
flush();
|
|
23261
22752
|
current = {
|
|
22753
|
+
executionId: `${nodeId}:input:${event.seq}`,
|
|
23262
22754
|
environmentIds: /* @__PURE__ */ new Set(),
|
|
23263
|
-
|
|
22755
|
+
controlByEnvironment: /* @__PURE__ */ new Map()
|
|
23264
22756
|
};
|
|
23265
22757
|
} else if (event.kind === "execution-admitted" && event.admission.phase === "environment") {
|
|
23266
22758
|
if (current?.result !== void 0) flush();
|
|
23267
22759
|
current ??= {
|
|
23268
22760
|
environmentIds: /* @__PURE__ */ new Set(),
|
|
23269
|
-
|
|
22761
|
+
controlByEnvironment: /* @__PURE__ */ new Map()
|
|
23270
22762
|
};
|
|
23271
22763
|
current.environmentIds.add(event.admission.environmentId);
|
|
23272
|
-
|
|
23273
|
-
|
|
22764
|
+
} else if (event.kind === "execution-admitted" && event.admission.phase === "dispatched") current?.controlByEnvironment.set(event.admission.controlRef.environmentId, event.admission.controlRef);
|
|
22765
|
+
else if (event.kind === "execution-result") {
|
|
23274
22766
|
current ??= {
|
|
23275
22767
|
environmentIds: /* @__PURE__ */ new Set(),
|
|
23276
|
-
|
|
22768
|
+
controlByEnvironment: /* @__PURE__ */ new Map()
|
|
23277
22769
|
};
|
|
23278
22770
|
current.result = event;
|
|
23279
22771
|
}
|
|
@@ -23300,20 +22792,21 @@ async function ownerWorkspaceRetentionFailures(events, nodeId, blobs) {
|
|
|
23300
22792
|
}
|
|
23301
22793
|
const snapshot = output !== null && typeof output === "object" ? output.workspaceSnapshot : void 0;
|
|
23302
22794
|
const environmentId = [...attempt.environmentIds][0];
|
|
23303
|
-
const
|
|
23304
|
-
if (!hasDurableWorkspaceCapture(output, snapshot, environmentId, executionId)) failures.add(environmentId);
|
|
22795
|
+
const controlRef = attempt.controlByEnvironment.get(environmentId);
|
|
22796
|
+
if (!hasDurableWorkspaceCapture(output, snapshot, environmentId, attempt.executionId, controlRef)) failures.add(environmentId);
|
|
23305
22797
|
}
|
|
23306
22798
|
return failures;
|
|
23307
22799
|
}
|
|
23308
22800
|
/** A stored result authorizes cleanup only for the exact source and complete capture. */
|
|
23309
|
-
function hasDurableWorkspaceCapture(output, snapshot, environmentId, executionId) {
|
|
22801
|
+
function hasDurableWorkspaceCapture(output, snapshot, environmentId, executionId, controlRef) {
|
|
23310
22802
|
const parsed = agentCandidateWorkspaceSnapshotEvidenceSchema.safeParse(snapshot);
|
|
23311
22803
|
if (!parsed.success || !("locator" in parsed.data.manifest) || !("locator" in parsed.data.archive)) return false;
|
|
23312
22804
|
if (output === null || typeof output !== "object") return false;
|
|
23313
22805
|
const capture = output.workspaceCapture;
|
|
23314
22806
|
if (capture === null || typeof capture !== "object") return false;
|
|
23315
22807
|
const receipt = capture;
|
|
23316
|
-
|
|
22808
|
+
const capturedControl = AgentExactRunControlRefSchema.safeParse(receipt.controlRef);
|
|
22809
|
+
if (executionId === void 0 || controlRef === void 0 || !capturedControl.success || !sameControlCoordinates(capturedControl.data, controlRef) || receipt.environmentId !== environmentId || receipt.executionId !== executionId || receipt.coverageComplete !== true) return false;
|
|
23317
22810
|
const linked = agentCandidateWorkspaceSnapshotEvidenceSchema.safeParse(receipt.snapshot);
|
|
23318
22811
|
return linked.success && linked.data.digest === parsed.data.digest && JSON.stringify(linked.data.manifest) === JSON.stringify(parsed.data.manifest) && JSON.stringify(linked.data.archive) === JSON.stringify(parsed.data.archive);
|
|
23319
22812
|
}
|
|
@@ -27455,11 +26948,18 @@ const DETERMINISTIC_BRIDGE_CODES = /* @__PURE__ */ new Set([
|
|
|
27455
26948
|
var HarnessTurnFailedError = class extends Error {
|
|
27456
26949
|
runtime;
|
|
27457
26950
|
errorCode;
|
|
26951
|
+
statusCode;
|
|
26952
|
+
/** The shared HTTP error reader also uses this status for persisted diagnostics. */
|
|
26953
|
+
status;
|
|
27458
26954
|
constructor(runtime, failure) {
|
|
27459
26955
|
super(`${runtime} harness turn ended with a failed outcome` + (failure.errorCode === void 0 ? "" : ` (${failure.errorCode})`) + `: ${failure.error}`);
|
|
27460
26956
|
this.name = "HarnessTurnFailedError";
|
|
27461
26957
|
this.runtime = runtime;
|
|
27462
26958
|
if (failure.errorCode !== void 0) this.errorCode = failure.errorCode;
|
|
26959
|
+
if (failure.statusCode !== void 0) {
|
|
26960
|
+
this.statusCode = failure.statusCode;
|
|
26961
|
+
this.status = failure.statusCode;
|
|
26962
|
+
}
|
|
27463
26963
|
}
|
|
27464
26964
|
};
|
|
27465
26965
|
/**
|
|
@@ -27476,7 +26976,8 @@ function upstreamUnavailableSignal(error) {
|
|
|
27476
26976
|
if (error instanceof CheckUnavailableError) return "check-unavailable";
|
|
27477
26977
|
if (error instanceof HarnessTurnFailedError) return unavailableSignalOfFailure({
|
|
27478
26978
|
error: error.message,
|
|
27479
|
-
...error.errorCode === void 0 ? {} : { errorCode: error.errorCode }
|
|
26979
|
+
...error.errorCode === void 0 ? {} : { errorCode: error.errorCode },
|
|
26980
|
+
...error.statusCode === void 0 ? {} : { statusCode: error.statusCode }
|
|
27480
26981
|
});
|
|
27481
26982
|
if (error instanceof BackendTransportError) {
|
|
27482
26983
|
const code = error.upstreamCode?.toLowerCase();
|
|
@@ -27508,7 +27009,8 @@ function classifyDriverFailure(error, signal) {
|
|
|
27508
27009
|
if (error instanceof Error && errorProperty(error, "name") === "AbortError") return "terminal";
|
|
27509
27010
|
if (error instanceof HarnessTurnFailedError) {
|
|
27510
27011
|
if (error.errorCode !== void 0 && DETERMINISTIC_BRIDGE_CODES.has(error.errorCode)) return "terminal";
|
|
27511
|
-
|
|
27012
|
+
if (isUpstreamUnavailable(error)) return "unavailable";
|
|
27013
|
+
return foreignHttpStatusVerdict(error) ?? "transient";
|
|
27512
27014
|
}
|
|
27513
27015
|
if (error instanceof BackendTransportError) {
|
|
27514
27016
|
if (error.upstreamCode !== void 0 && DETERMINISTIC_BRIDGE_CODES.has(error.upstreamCode)) return "terminal";
|
|
@@ -28920,6 +28422,6 @@ function isNonEmptySpend(s) {
|
|
|
28920
28422
|
return s.iterations > 0 || s.tokens.input > 0 || s.tokens.output > 0 || s.usd > 0 || s.ms > 0 || s.tokensKnown === false || s.usdKnown === false || Object.values(s.resources ?? {}).some((resource) => resource.amount > 0 || !resource.known);
|
|
28921
28423
|
}
|
|
28922
28424
|
//#endregion
|
|
28923
|
-
export { waitUntil as $,
|
|
28425
|
+
export { waitUntil as $, detachedFrozen as $i, replaySpawnTree as $n, sanitizeRuntimeStreamEvent as $r, claimsAuthority as $t, driverExecutorFactory as A, addResourceSpend as Aa, prepareJsonlAppend as Ai, LEAF_CONTINUATION_TASK as An, contentAddress as Ar, cliInPlaceExecutor as At, recordScopeOwnerDriverAttempt as B, promptFromAgentTurnInput as Ba, newExecutionAttemptId as Bi, registerRetainedExecutorPreparation as Bn, buildRuntimeEventOtelSpans as Br, WORKER_TRACE_PROPAGATION as Bt, createContinuationKeeper as C, sleep as Ca, renderProfileMaterializationIssues as Ci, captureBeforeDestroy as Cn, abortError as Cr, recoverRetainedInteractiveRun as Ct, passedItems as D, unmeteredSpend as Da, validateProfileMaterialization as Di, runBrainLoop as Dn, harnessTranscriptArtifact as Dr, rollingDispatch as Dt, failedItems as E, throwIfAborted as Ea, unsupportedProfileDimensions as Ei, routerBrain as En, captureHarnessTranscript as Er, queueOf as Et, beginScopeOwnerAttempt as F, awaitAbortable$1 as Fa, authoredProfileDigest as Fi, unavailablePauseMs as Fn, defaultRedactor as Fr, createWorktreeCliExecutor as Ft, settledToIteration as G, runtimeOwnedExecutorMaterialization as Gi, InMemorySpawnJournal as Gn, loopEventToOtelSpan as Gr, taskToPrompt as Gt, recordScopeOwnerPause as H, providerMessageText as Ha, recordRuntimeOwnedDriveHarnessProviderEvidence as Hi, FileResultBlobStore as Hn, createOtelExporter as Hr, workerTraceEnv as Ht, createScope as I, DEFAULT_SUCCESSFUL_SHUTDOWN_MS as Ia, finalizeRuntimeOwnedPendingExecutor as Ii, unavailableSignalOfFailure as In, defaultRedactorIdentityMaterial as Ir, DEFAULT_SANDBOX_STEERING_MAX_TURNS as It, createWaitProbes as J, runtimeOwnedScopeOwnerRuntime as Ji, encodeResultBlob as Jn, toOtelAttributes as Jr, readWorkerProgress as Jt, createWorkerSlots as K, runtimeOwnedExecutorProviderEvidence as Ki, SpawnEventIndex as Kn, padSpanId as Kr, DEFAULT_STALL_AFTER_MS as Kt, deriveNodeExecutionIdentity as L, armDeadlineTimer as La, inheritRuntimeOwnedExecutorAttestation as Li, createPushTraceSource as Ln, resolveRedactor as Lr, createSteerableSandboxSession as Lt, withDriverExecutor as M, withBudgetResources as Ma, writeAllBytes as Mi, providerAsExecutor as Mn, mergeTraceEnv as Mr, createExecutor as Mt, SUBTREE_RESULT_LIMIT as N, decodeHarnessUsage as Na, attestRuntimeOwnedPendingExecutor as Ni, providerAsSandboxClient as Nn, readTraceContextFromEnv as Nr, createExecutorRegistry as Nt, verdictFromJudgeScore as O, withTimeout as Oa, worktreeCliProfileMaterialization as Oi, canonicalObservedModelParts as On, persistHarnessTranscript as Or, bindReusableExecutorExecutionId as Ot, assertRecursiveReservationPolicy as P, abortError$2 as Pa, attestRuntimeOwnedScopeOwner as Pi, resolveAgentEnvironmentProvider as Pn, traceContextToEnv as Pr, snapshotExecutorConfig as Pt, validateWaitSpec as Q, executableAgentSpecSnapshot as Qi, pendingWaits as Qn, sanitizeKnowledgeReadinessReport as Qr, PEER_MAIL_WIRE_KEY as Qt, meterRuntimeOwnedAccounting as R, teardownExecutor as Ra, knownExecutionBindingReceipt as Ri, decodeToolPart as Rn, buildLoopOtelSpans as Rr, createRouterTranscript as Rt, composeContinuationNote as S, randomSuffix as Sa, promptResourceProfileMaterialization as Si, SandboxEvidenceRetentionError as Sn, RunCancellationReason as Sr, reconnectRetainedInteractiveRun as St, expandQuestions as T, throwAbort as Ta, sandboxActProfileMaterialization as Ti, readPromptOptions as Tn, runAbortable as Tr, freeSlots as Tt, restoreScopeOwnerAcceptedExecution as U, runtimeOwnedDriveHarnessProviderEvidence as Ui, FileSpawnJournal as Un, flatOtelSpan as Ur, workerTraceHeaders as Ut, recordScopeOwnerMaterialization as V, promptOptionsFromAgentTurnInput as Va, providerAttemptEvidence as Vi, retainedExecutorSeamKey as Vn, createOpenInferenceFileExporter as Vr, readWorkerTraceContext as Vt, scopeOwnerExecutorNodeContext as W, runtimeOwnedExecutorExecutionBinding as Wi, InMemoryResultBlobStore as Wn, generateSpanId as Wr, workerTraceSeamKey as Wt, pollFor as X, unknownMaterializationReceipt as Xi, loadSpawnForest as Xn, createRuntimeStreamEventCollector as Xr, AUTHORITY_MARKERS as Xt, isWaitOutcome as Y, unknownExecutionBindingReceipt as Yi, insideCursorNamespace as Yn, createRuntimeEventCollector as Yr, createInbox as Yt, timerAt as Z, executableAgentProfileSnapshot as Zi, materializeTreeView as Zn, sanitizeAgentRuntimeEvent as Zr, DEFAULT_PEER_MAIL_LIMITS as Zt, CheckUnavailableError as _, cloneSpend as _a, fullProfileMaterialization as _i, isTerminalDecision as _n, startRetainedRun as _r, workerInteractiveAdmissionFile as _t, collectDelivered as a, createSandboxToolPartState as aa, DEFAULT_LOCAL_HARNESS as ai, isTerminalNodeStatus as an, executorFailure as ar, reconcileScopeRetainedOwnerEnvironment as at, bestComposite as b, isAbortError$2 as ba, promptModelProfileMaterialization as bi, probeSandboxCapabilities as bn, destroyInteractiveEnvironment as br, workerInteractiveBindingFile as bt, runTree as c, isSandboxTerminalEvent as ca, harnessSupportsReasoningEffort as ci, addHarnessUsage as cn, assertValidBudget as cr, scopeRetainedOwnerResourceReader as ct, classifyDriverFailure as d, notifySandboxEventObserver as da, CodexExecutionDiagnosticError as di, readCodexRolloutSession as dn, newUsageTotals as dr, SPAWN_RESOURCE_PATH_MAX_BYTES as dt, detachedSnapshot as ea, runSettledCommand as ei, createPeerMailbox as en, WORKER_TOOL_TRACE_SCHEMA_VERSION as er, bindScopeRetainedOwnerEnvironmentId as et, runDriverWithRetry as f, sandboxEventServedBackend as fa, terminateProcessTreeAndConfirm as fi, bridgeRuntimeAttachmentsKey as fn, spendFromUsageEvents as fr, environmentReader as ft, CONTINUATION_FACTS as g, chargedTokens as ga, defineProfileMaterializationContract as gi, defaultSelectWinner as gn, recoverRetainedRun as gr, readWorkerInteractiveAdmissions as gt, CONTINUATIONS_DIR as h, addSpend as ha, controlProfileMaterialization as hi, createSandboxForSpec as hn, reconnectRetainedRun as hr, interactiveAdmissionSeamKey as ht, bestDelivered as i, canonicalStreamEventFromSandboxEvent as ia, removeWorktree as ii, isLiveNodeStatus as in, workerTraceAnalysisStore as ir, prepareScopeRetainedOwnerTask as it, isDriverSpec as j, resourceTelemetry as ja, readCommittedJsonLines as ji, createAgentEnvironmentProviderRegistry as jn, createPropagatingTraceEmitter as jr, cliWorktreeExecutor as jt, driverChild as k, zeroSpend as ka, isNoEntError as ki, observedModelMatchesDeclared as kn, readHarnessTranscript as kr, captureReusableExecutorConfig as kt, DriverAttemptsExhaustedError as l, mapSandboxEvent as la, localHarnessExecutable as li, createCodexRolloutStoreReader as ln, createBudgetPool as lr, scopeRetainedOwnerRestorePoint as lt, upstreamUnavailableSignal as m, sumSandboxUsage as ma, assertProfileMaterialization as mi, TERMINAL_DECISIONS as mn, errMessage as mr, resolveSpawnResourcePaths as mt, createRootHandle as n, readSandboxOutcome as na, captureWorktreeDiff as ni, peerMailTools as nn, isTraceAnalysisStore as nr, consumeScopeRetainedOwnerResult as nt, pickBestDelivered as o, createSandboxUsageLedger as oa, LOCAL_HARNESSES as oi, bridgeAdmissionRefusal as on, BudgetReconcileFault as or, scopeRetainedOwnerContext as ot, summarizeDriverAttempts as p, sandboxProgressEvents as pa, AGENT_PROFILE_MATERIALIZATION_AXES as pi, bridgeStopSignalKey as pn, spendFromUsageTotals as pr, hostDirectoryReader as pt, openSlotGroup as q, runtimeOwnedPendingExecutorMaterialization as qi, assertContentAddress as qn, padTraceId as qr, createActivityLog as qt, createSupervisor as r, assertSandboxServedModel as ra, createWorktree as ri, peerMailVerbNames as rn, parseWorkerToolTraceArtifact as rr, noteScopeRetainedOwnerCoordination as rt, runFinalizer as s, extractLlmCallEvent as sa, harnessInvocation as si, bridgeModelRouteRefusal as sn, ReservationWaitRefused as sr, scopeRetainedOwnerPriorSpend as st, DEFAULT_MAX_DEPTH as t, projectSandboxOutcome as ta, runWorktreeHarness as ti, isPeerMailEnvelope as tn, captureWorkerTraceEvidence as tr, bindScopeRetainedOwnerProvider as tt, HarnessTurnFailedError as u, mapSandboxToolEvent as ua, parseCodexTokenUsage as ui, harnessUsageIsEmpty as un, meterUsageEvent as ur, scopeRetainedOwnerResult as ut, admitContinuationPolicy as v, deleteBoxSafe as va, profileMaterializationAxes$1 as vi, runAgentRounds as vn, startRetainedRunInEnvironment as vr, attachWorker as vt, distillFindings as w, stringifySafe as wa, renderUnsupported as wi, assertBoxlessPromptOptions as wn, linkAbort as wr, startRetainedInteractiveRun as wt, checkVerdictOf as x, promptCacheTokenClasses as xa, promptOnlyProfileMaterialization as xi, acquireSandbox as xn, environmentGone as xr, workerInteractiveBindingsDir as xt, admitFinding as y, hasCompleteCacheBreakdown as ya, promptControlProfileMaterialization as yi, createSandboxLineage as yn, retainedCreateMaterial as yr, readWorkerInteractiveBinding as yt, meterRuntimeOwnedProviderAttempt as z, teardownSurfaces as za, knownMaterializationReceipt as zi, sandboxSessionTraceSource as zn, buildLoopSpanNodes as zr, createInPlaceCliExecutor as zt };
|
|
28924
28426
|
|
|
28925
|
-
//# sourceMappingURL=supervisor-
|
|
28427
|
+
//# sourceMappingURL=supervisor-CQFcQhlo.js.map
|