@tangle-network/agent-runtime 0.289.2 → 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-ClgRxMQ9.js → activation-BdvuHbTG.js} +2 -2
- package/dist/{activation-ClgRxMQ9.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-CrsMoYmK.js → coordination-driver-CTw92HIk.js} +2 -2
- package/dist/{coordination-driver-CrsMoYmK.js.map → coordination-driver-CTw92HIk.js.map} +1 -1
- package/dist/{delegate-BtA5G0Zi.js → delegate-DhAvvPIP.js} +2 -2
- package/dist/{delegate-BtA5G0Zi.js.map → delegate-DhAvvPIP.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +2 -2
- package/dist/{graph-9xDBu--o.js → graph-2Iea0PDT.js} +4 -4
- package/dist/{graph-9xDBu--o.js.map → graph-2Iea0PDT.js.map} +1 -1
- package/dist/{improvement-cycle-Rq1wYTxJ.js → improvement-cycle-CdT1IClg.js} +3 -3
- package/dist/{improvement-cycle-Rq1wYTxJ.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-D6vu3zKo.js → loop-runner-bin-BuEFaR7Z.js} +3 -3
- package/dist/{loop-runner-bin-D6vu3zKo.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-43_bsO7n.js → provision-supervisor-Cm2-dL4F.js} +8 -25
- package/dist/provision-supervisor-Cm2-dL4F.js.map +1 -0
- package/dist/{runtime-Coi8gH_G.js → runtime-DJ_ISfL-.js} +8 -8
- package/dist/{runtime-Coi8gH_G.js.map → runtime-DJ_ISfL-.js.map} +1 -1
- package/dist/{search-method-Dooo6JxE.js → search-method-Q7X92VD3.js} +86 -48
- package/dist/search-method-Q7X92VD3.js.map +1 -0
- package/dist/{server-xIUtcV4x.js → server-CRTAzqiD.js} +3 -3
- package/dist/{server-xIUtcV4x.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-B_GnmIw0.js → supervise-CClk-m6Y.js} +3 -3
- package/dist/{supervise-B_GnmIw0.js.map → supervise-CClk-m6Y.js.map} +1 -1
- package/dist/{supervisor-CDsr_sZD.js → supervisor-CQFcQhlo.js} +47 -546
- 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-43_bsO7n.js.map +0 -1
- package/dist/search-method-Dooo6JxE.js.map +0 -1
- package/dist/supervisor-CDsr_sZD.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";
|
|
@@ -5308,7 +5309,7 @@ function createOtelExporter(config) {
|
|
|
5308
5309
|
body: JSON.stringify(body),
|
|
5309
5310
|
signal: AbortSignal.timeout(timeoutMs)
|
|
5310
5311
|
});
|
|
5311
|
-
const text = await response.text();
|
|
5312
|
+
const text = await response.text().catch(() => "");
|
|
5312
5313
|
if (!response.ok) {
|
|
5313
5314
|
const detail = text ? `: ${text.slice(0, 200)}` : "";
|
|
5314
5315
|
drop(batch.length, `HTTP ${response.status} from ${url}${detail}`);
|
|
@@ -5323,7 +5324,6 @@ function createOtelExporter(config) {
|
|
|
5323
5324
|
}
|
|
5324
5325
|
/** The single sender: it drains the queue batch by batch until the queue is empty. */
|
|
5325
5326
|
function drain() {
|
|
5326
|
-
if (sending === void 0 && queue.length === 0) return Promise.resolve();
|
|
5327
5327
|
sending ??= (async () => {
|
|
5328
5328
|
try {
|
|
5329
5329
|
while (queue.length > 0) {
|
|
@@ -8579,7 +8579,10 @@ function describeLeakedReservation(leak) {
|
|
|
8579
8579
|
const outcomeSchema = AgentTurnResultSchema.pick({
|
|
8580
8580
|
success: true,
|
|
8581
8581
|
error: true
|
|
8582
|
-
}).extend({
|
|
8582
|
+
}).extend({
|
|
8583
|
+
errorCode: AgentTurnResultSchema.shape.error,
|
|
8584
|
+
statusCode: z.number().int().min(400).max(599).optional()
|
|
8585
|
+
}).strict();
|
|
8583
8586
|
/** Read only the executor envelope; application output and grades are not execution status. */
|
|
8584
8587
|
function executorFailure(result) {
|
|
8585
8588
|
if (result.outcome === void 0) return void 0;
|
|
@@ -8587,7 +8590,8 @@ function executorFailure(result) {
|
|
|
8587
8590
|
if (outcome.success) return void 0;
|
|
8588
8591
|
return {
|
|
8589
8592
|
error: outcome.error ?? "Agent execution failed",
|
|
8590
|
-
...outcome.errorCode === void 0 ? {} : { errorCode: outcome.errorCode }
|
|
8593
|
+
...outcome.errorCode === void 0 ? {} : { errorCode: outcome.errorCode },
|
|
8594
|
+
...outcome.statusCode === void 0 ? {} : { statusCode: outcome.statusCode }
|
|
8591
8595
|
};
|
|
8592
8596
|
}
|
|
8593
8597
|
/** The failure text alone, for callers that record a settlement reason. */
|
|
@@ -10272,11 +10276,12 @@ function unavailableSignalInText(text) {
|
|
|
10272
10276
|
/**
|
|
10273
10277
|
* The code or status that marks a failed turn outcome as an upstream capacity refusal, or
|
|
10274
10278
|
* `undefined`. The outcome's own `errorCode` decides first; the failure text is read only when no
|
|
10275
|
-
* code decided, because a harness CLI
|
|
10279
|
+
* code or numeric status decided, because a harness CLI can report the router's refusal as text.
|
|
10276
10280
|
*/
|
|
10277
10281
|
function unavailableSignalOfFailure(failure) {
|
|
10278
10282
|
const code = failure.errorCode?.toLowerCase();
|
|
10279
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;
|
|
10280
10285
|
return unavailableSignalInText(failure.error);
|
|
10281
10286
|
}
|
|
10282
10287
|
const DEFAULT_UNAVAILABLE_PAUSE_MS = 15e3;
|
|
@@ -10426,75 +10431,6 @@ function providerAsSandboxClient(provider, options = {}) {
|
|
|
10426
10431
|
});
|
|
10427
10432
|
} };
|
|
10428
10433
|
}
|
|
10429
|
-
/**
|
|
10430
|
-
* The idle timeout this adapter sends when nothing else names one: 1,800 seconds.
|
|
10431
|
-
*
|
|
10432
|
-
* Sandbox substitutes no value of its own: an omitted field falls back to the platform's global
|
|
10433
|
-
* idle timeout, documented as 30 minutes unless an operator changed it, and Runtime sent none. Idle
|
|
10434
|
-
* means inactivity to Sandbox, which suspends the sandbox (the container stops; the workspace is
|
|
10435
|
-
* kept) rather than deleting it. The SDK does not define inactivity further. A request in flight
|
|
10436
|
-
* counts as activity: a Discovery Lab seat created with `idleTimeoutSeconds: 1800` ran one request
|
|
10437
|
-
* to 2,252 seconds, ended by a per-request cap, not by idling (fleet-launch-2026-08-22).
|
|
10438
|
-
*
|
|
10439
|
-
* The value restates the documented default, so it can tighten a longer operator setting but never
|
|
10440
|
-
* loosen the default. It is 3.8 times the longest gap between frames recorded across a healthy
|
|
10441
|
-
* fleet run (469 seconds, same report), and a supervised provider child is observed through an open
|
|
10442
|
-
* stream for its whole turn. It is a backstop for a process that dies holding an environment; the
|
|
10443
|
-
* settlement barrier releases retained environments itself (`Executor.releaseRetained`). It does
|
|
10444
|
-
* nothing on a driver with a create/delete-only lifecycle, which the SDK says skips suspension.
|
|
10445
|
-
*/
|
|
10446
|
-
const DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS = 1800;
|
|
10447
|
-
function sandboxIdleTimeoutSeconds(value) {
|
|
10448
|
-
if (value === void 0) return DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS;
|
|
10449
|
-
if (!Number.isSafeInteger(value) || value <= 0) throw new ValidationError(`sandboxClientAsProvider: idleTimeoutSeconds must be a positive whole number of seconds, got ${String(value)}`);
|
|
10450
|
-
return value;
|
|
10451
|
-
}
|
|
10452
|
-
/**
|
|
10453
|
-
* Adapt a `SandboxClient` into the shared `AgentEnvironmentProvider` contract.
|
|
10454
|
-
* The provider declares the public SDK contract before it creates an environment.
|
|
10455
|
-
* Each environment exposes interactive methods only when its deployment declares every required capability.
|
|
10456
|
-
* @experimental */
|
|
10457
|
-
function sandboxClientAsProvider(client, options = {}) {
|
|
10458
|
-
const providerName = options.name ?? "tangle-sandbox";
|
|
10459
|
-
const idleTimeoutSeconds = sandboxIdleTimeoutSeconds(options.idleTimeoutSeconds);
|
|
10460
|
-
const providerCapabilities = async () => {
|
|
10461
|
-
const resolved = await (options.capabilities ? typeof options.capabilities === "function" ? options.capabilities() : options.capabilities : defaultTangleSandboxCapabilities({
|
|
10462
|
-
namedProfiles: options.resolveProfile !== void 0,
|
|
10463
|
-
rediscover: hasGet(client)
|
|
10464
|
-
}));
|
|
10465
|
-
if (hasGet(client)) return resolved;
|
|
10466
|
-
const { interactiveAgent: _interactiveAgent, ...withoutInteractive } = resolved;
|
|
10467
|
-
return withoutInteractive;
|
|
10468
|
-
};
|
|
10469
|
-
return {
|
|
10470
|
-
name: providerName,
|
|
10471
|
-
capabilities: providerCapabilities,
|
|
10472
|
-
...options.validateProfile ? { validateProfile: options.validateProfile } : {},
|
|
10473
|
-
async create(input) {
|
|
10474
|
-
const custom = options.mapCreateInput?.(input);
|
|
10475
|
-
const createOptions = custom === void 0 ? await sandboxOptionsFromCreateInput(input, options.defaultBackend ?? "opencode", options.resolveProfile, providerName, idleTimeoutSeconds) : {
|
|
10476
|
-
...custom,
|
|
10477
|
-
idleTimeoutSeconds: custom.idleTimeoutSeconds ?? idleTimeoutSeconds
|
|
10478
|
-
};
|
|
10479
|
-
const capabilities = await providerCapabilities();
|
|
10480
|
-
return sandboxInstanceAsEnvironment(await client.create(createOptions, input.signal === void 0 ? void 0 : { signal: input.signal }), providerName, client, capabilities, idleTimeoutSeconds);
|
|
10481
|
-
},
|
|
10482
|
-
...hasGet(client) ? { async get(id) {
|
|
10483
|
-
const capabilities = await providerCapabilities();
|
|
10484
|
-
const box = await client.get(id);
|
|
10485
|
-
return box ? sandboxInstanceAsEnvironment(box, providerName, client, capabilities, idleTimeoutSeconds) : null;
|
|
10486
|
-
} } : {},
|
|
10487
|
-
...hasList(client) ? { async list(query) {
|
|
10488
|
-
return (await client.list(query?.providerOptions)).map((box) => ({
|
|
10489
|
-
id: String(box.id),
|
|
10490
|
-
provider: providerName,
|
|
10491
|
-
name: typeof box.name === "string" ? box.name : void 0,
|
|
10492
|
-
status: statusFromUnknown(readBoxStatus(box)),
|
|
10493
|
-
metadata: readBoxMetadata(box)
|
|
10494
|
-
}));
|
|
10495
|
-
} } : {}
|
|
10496
|
-
};
|
|
10497
|
-
}
|
|
10498
10434
|
/** Only a verified, single-session capture may supply a scalar session identity. */
|
|
10499
10435
|
function capturedSessionIdentity(provenance, coverageComplete, executionId, providerSessionId) {
|
|
10500
10436
|
const unknown = {
|
|
@@ -11178,7 +11114,8 @@ async function* streamProviderExecutor(args) {
|
|
|
11178
11114
|
...result.outcome?.status === "failed" ? { outcome: {
|
|
11179
11115
|
success: false,
|
|
11180
11116
|
...result.outcome.error ? { error: result.outcome.error } : {},
|
|
11181
|
-
...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) }
|
|
11182
11119
|
} } : {},
|
|
11183
11120
|
outRef: contentRef(`provider:${args.provider.name}`, settledResult),
|
|
11184
11121
|
out: settledResult,
|
|
@@ -11187,7 +11124,8 @@ async function* streamProviderExecutor(args) {
|
|
|
11187
11124
|
};
|
|
11188
11125
|
const refusal = args.mayContinue && source.retained && result.outcome?.status === "failed" ? unavailableSignalOfFailure({
|
|
11189
11126
|
error: result.outcome.error ?? "",
|
|
11190
|
-
...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) }
|
|
11191
11129
|
}) : void 0;
|
|
11192
11130
|
if (refusal !== void 0) unavailable = {
|
|
11193
11131
|
signal: refusal,
|
|
@@ -11568,52 +11506,6 @@ function createInputFromSandboxOptions(options) {
|
|
|
11568
11506
|
providerOptions: { sandboxCreateOptions: options ?? {} }
|
|
11569
11507
|
};
|
|
11570
11508
|
}
|
|
11571
|
-
async function sandboxOptionsFromCreateInput(input, defaultBackend, resolveProfile, providerName = "tangle-sandbox", idleTimeoutSeconds = DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS) {
|
|
11572
|
-
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");
|
|
11573
|
-
const backendType = input.backend ?? defaultBackend;
|
|
11574
|
-
const workspace = WorkspaceRequestSchema.parse(input.workspace ?? {});
|
|
11575
|
-
const environment = sandboxEnvironmentFromWorkspace(workspace);
|
|
11576
|
-
const cwd = workspaceCwdPathForBase(workspace.cwd, "repository", providerName);
|
|
11577
|
-
const providerOptions = input.providerOptions?.sandboxCreateOptions;
|
|
11578
|
-
const base = providerOptions && typeof providerOptions === "object" ? { ...providerOptions } : {};
|
|
11579
|
-
assertSandboxSecretNames(input.secrets);
|
|
11580
|
-
assertSandboxSecretNames(base.secrets);
|
|
11581
|
-
const profile = await sandboxProfileFromReference(input.profile, resolveProfile);
|
|
11582
|
-
const { profile: _baseProfile, ...baseBackend } = base.backend ?? {};
|
|
11583
|
-
return {
|
|
11584
|
-
...base,
|
|
11585
|
-
idleTimeoutSeconds: base.idleTimeoutSeconds ?? idleTimeoutSeconds,
|
|
11586
|
-
...environment ? { environment } : {},
|
|
11587
|
-
...workspace.repoUrl ? { git: {
|
|
11588
|
-
url: workspace.repoUrl,
|
|
11589
|
-
ref: workspace.gitRef
|
|
11590
|
-
} } : {},
|
|
11591
|
-
...cwd === void 0 ? {} : { cwd },
|
|
11592
|
-
...input.resources ? { resources: input.resources } : {},
|
|
11593
|
-
...input.env ? { env: input.env } : {},
|
|
11594
|
-
...Array.isArray(input.secrets) ? { secrets: input.secrets } : {},
|
|
11595
|
-
...input.metadata ? { metadata: input.metadata } : {},
|
|
11596
|
-
...input.name ? { name: input.name } : {},
|
|
11597
|
-
...input.idempotencyKey ? { idempotencyKey: input.idempotencyKey } : {},
|
|
11598
|
-
backend: {
|
|
11599
|
-
...baseBackend,
|
|
11600
|
-
type: backendType,
|
|
11601
|
-
profile
|
|
11602
|
-
}
|
|
11603
|
-
};
|
|
11604
|
-
}
|
|
11605
|
-
function assertSandboxSecretNames(secrets) {
|
|
11606
|
-
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");
|
|
11607
|
-
}
|
|
11608
|
-
function sandboxEnvironmentFromWorkspace(workspace) {
|
|
11609
|
-
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");
|
|
11610
|
-
return workspace.environment ?? workspace.image;
|
|
11611
|
-
}
|
|
11612
|
-
async function sandboxProfileFromReference(profile, resolveProfile) {
|
|
11613
|
-
if (typeof profile !== "string") return profile;
|
|
11614
|
-
if (!resolveProfile) throw new ValidationError(`Tangle Sandbox requires an inline AgentProfile; named profile "${profile}" needs SandboxClientProviderOptions.resolveProfile`);
|
|
11615
|
-
return resolveProfile(profile);
|
|
11616
|
-
}
|
|
11617
11509
|
function environmentAsSandboxInstance(environment, options) {
|
|
11618
11510
|
let providerSessionId = null;
|
|
11619
11511
|
let controlRef;
|
|
@@ -11785,147 +11677,6 @@ function environmentAsSandboxInstance(environment, options) {
|
|
|
11785
11677
|
}
|
|
11786
11678
|
};
|
|
11787
11679
|
}
|
|
11788
|
-
async function sandboxInstanceAsEnvironment(box, providerName, client, providerCapabilities, idleTimeoutSeconds) {
|
|
11789
|
-
const capabilities = await sandboxEnvironmentCapabilities(box, providerCapabilities);
|
|
11790
|
-
const interactiveAgent = capabilities.interactiveAgent;
|
|
11791
|
-
return {
|
|
11792
|
-
id: String(box.id),
|
|
11793
|
-
provider: providerName,
|
|
11794
|
-
capabilities,
|
|
11795
|
-
...typeof box.name === "string" ? { name: box.name } : {},
|
|
11796
|
-
...readBoxMetadata(box) ? { metadata: readBoxMetadata(box) } : {},
|
|
11797
|
-
async status() {
|
|
11798
|
-
await maybeRefresh(box);
|
|
11799
|
-
return statusFromUnknown(readBoxStatus(box));
|
|
11800
|
-
},
|
|
11801
|
-
async *stream(input) {
|
|
11802
|
-
for await (const event of box.streamPrompt(promptFromAgentTurnInput(input), promptOptionsFromAgentTurnInput(input))) yield environmentEventFromSandboxEvent(event);
|
|
11803
|
-
},
|
|
11804
|
-
...hasDispatchPrompt(box) ? { async dispatch(input) {
|
|
11805
|
-
return sessionRefFromSandboxDispatch(await box.dispatchPrompt(promptFromAgentTurnInput(input), promptOptionsFromAgentTurnInput(input)), providerName);
|
|
11806
|
-
} } : {},
|
|
11807
|
-
...hasSession(box) ? {
|
|
11808
|
-
session(id, sessionOptions) {
|
|
11809
|
-
return sandboxSessionAsAgentSession(box.session(id), sessionOptions?.controlRef);
|
|
11810
|
-
},
|
|
11811
|
-
async respondToInteraction(command, options) {
|
|
11812
|
-
return (await box.session(command.binding.sessionId).respondToInteraction(command, options)).acknowledgement;
|
|
11813
|
-
}
|
|
11814
|
-
} : {},
|
|
11815
|
-
...interactiveAgent ? {
|
|
11816
|
-
async startInteractive(request, options) {
|
|
11817
|
-
const exactRequest = AgentInteractiveSessionStartSchema.parse(request);
|
|
11818
|
-
assertSandboxInteractiveBinding(exactRequest.run, box, providerName);
|
|
11819
|
-
const result = await box.session(exactRequest.run.sessionId).interactive().start(exactRequest, options);
|
|
11820
|
-
if (result.state !== "running") throw new ValidationError("sandbox interactive process settled before attachment");
|
|
11821
|
-
const ref = detachedSnapshot(AgentInteractiveSessionRefSchema.parse(result.ref), "sandbox interactive start reference");
|
|
11822
|
-
if (!agentInteractiveSessionRefMatchesStart(exactRequest, ref)) throw new ValidationError("sandbox interactive start returned a different exact process");
|
|
11823
|
-
return ref;
|
|
11824
|
-
},
|
|
11825
|
-
interactive(ref) {
|
|
11826
|
-
const exactRef = detachedSnapshot(AgentInteractiveSessionRefSchema.parse(ref), "sandbox interactive reference");
|
|
11827
|
-
assertSandboxInteractiveBinding(exactRef.run, box, providerName);
|
|
11828
|
-
const session = box.session(exactRef.run.sessionId).interactive({ ref: exactRef });
|
|
11829
|
-
const controlledSessions = /* @__PURE__ */ new Map();
|
|
11830
|
-
const controlledSession = (control) => {
|
|
11831
|
-
const key = canonicalCandidateDigest(control);
|
|
11832
|
-
const existing = controlledSessions.get(key);
|
|
11833
|
-
if (existing) return existing;
|
|
11834
|
-
const created = box.session(exactRef.run.sessionId).interactive({
|
|
11835
|
-
ref: exactRef,
|
|
11836
|
-
control
|
|
11837
|
-
});
|
|
11838
|
-
controlledSessions.set(key, created);
|
|
11839
|
-
return created;
|
|
11840
|
-
};
|
|
11841
|
-
return {
|
|
11842
|
-
ref: exactRef,
|
|
11843
|
-
claimControl: (request, options) => session.claimControl(request, options),
|
|
11844
|
-
async status(options) {
|
|
11845
|
-
const status = await session.status(options);
|
|
11846
|
-
if (status === null) throw new ValidationError(`sandbox interactive session "${exactRef.run.sessionId}" is unavailable`);
|
|
11847
|
-
return status;
|
|
11848
|
-
},
|
|
11849
|
-
attach: (request, options) => {
|
|
11850
|
-
const controlled = controlledSession(request.control);
|
|
11851
|
-
if (typeof controlled.attachAgentTerminal !== "function") return Promise.reject(new ValidationError("sandbox interactive session does not expose the exact terminal adapter"));
|
|
11852
|
-
return controlled.attachAgentTerminal(request, options);
|
|
11853
|
-
},
|
|
11854
|
-
sendPrompt: (command, options) => controlledSession(command.control).sendPrompt(command, options),
|
|
11855
|
-
stop: (command, options) => controlledSession(command.control).stop(command, options)
|
|
11856
|
-
};
|
|
11857
|
-
}
|
|
11858
|
-
} : {},
|
|
11859
|
-
...hasRead(box) ? { read: box.read.bind(box) } : {},
|
|
11860
|
-
...hasWrite(box) ? { write: box.write.bind(box) } : {},
|
|
11861
|
-
...hasExec(box) ? { async exec(command, options) {
|
|
11862
|
-
return execResultFromSandboxExecResult(await box.exec(command, options));
|
|
11863
|
-
} } : {},
|
|
11864
|
-
async checkpoint(options) {
|
|
11865
|
-
return {
|
|
11866
|
-
id: (await box.snapshot({ ...options?.name ? { tags: [options.name] } : {} })).snapshotId,
|
|
11867
|
-
provider: providerName,
|
|
11868
|
-
...options?.metadata ? { metadata: options.metadata } : {}
|
|
11869
|
-
};
|
|
11870
|
-
},
|
|
11871
|
-
async fork(checkpoint, options) {
|
|
11872
|
-
return sandboxInstanceAsEnvironment(await client.create({
|
|
11873
|
-
fromSnapshot: checkpoint.id,
|
|
11874
|
-
fromSandboxId: String(box.id),
|
|
11875
|
-
idleTimeoutSeconds,
|
|
11876
|
-
...options?.name ? { name: options.name } : {},
|
|
11877
|
-
...options?.metadata ? { metadata: options.metadata } : {}
|
|
11878
|
-
}), providerName, client, providerCapabilities, idleTimeoutSeconds);
|
|
11879
|
-
},
|
|
11880
|
-
async placement() {
|
|
11881
|
-
return placementInfoFromLoopPlacement(client.describePlacement?.(box), box);
|
|
11882
|
-
},
|
|
11883
|
-
async refresh() {
|
|
11884
|
-
await maybeRefresh(box);
|
|
11885
|
-
},
|
|
11886
|
-
async destroy() {
|
|
11887
|
-
await destroyBox(box);
|
|
11888
|
-
}
|
|
11889
|
-
};
|
|
11890
|
-
}
|
|
11891
|
-
function sandboxSessionAsAgentSession(session, expectedControlRef) {
|
|
11892
|
-
const controlRef = resolveSessionControlRef(session.controlRef, expectedControlRef, { allowExpectedWhenActualAbsent: true });
|
|
11893
|
-
return {
|
|
11894
|
-
id: session.id,
|
|
11895
|
-
...controlRef === void 0 ? {} : { controlRef },
|
|
11896
|
-
async status() {
|
|
11897
|
-
const status = await session.status();
|
|
11898
|
-
if (!status) return null;
|
|
11899
|
-
assertSandboxStatusBinding(status, controlRef);
|
|
11900
|
-
return sessionStatusFromUnknown(status.status);
|
|
11901
|
-
},
|
|
11902
|
-
async *events(options) {
|
|
11903
|
-
const executionId = scopedExecutionId(controlRef, options?.executionId);
|
|
11904
|
-
for await (const event of session.events({
|
|
11905
|
-
...options?.since === void 0 ? {} : { since: options.since },
|
|
11906
|
-
...executionId === void 0 ? {} : { executionId },
|
|
11907
|
-
...options?.signal === void 0 ? {} : { signal: options.signal }
|
|
11908
|
-
})) yield environmentEventFromSandboxEvent(event);
|
|
11909
|
-
},
|
|
11910
|
-
async result(options) {
|
|
11911
|
-
return agentTurnResultFromPromptResult(await awaitAbortable$1(Promise.resolve().then(() => session.result({ ...controlRef?.executionId === void 0 ? {} : { executionId: controlRef.executionId } })), options?.signal));
|
|
11912
|
-
},
|
|
11913
|
-
async prompt(input) {
|
|
11914
|
-
return agentTurnResultFromPromptResult(await session.prompt(promptFromAgentTurnInput(input), promptOptionsFromAgentTurnInput(input)));
|
|
11915
|
-
},
|
|
11916
|
-
...session.respondToInteraction ? { async respondToInteraction(command, options) {
|
|
11917
|
-
assertInteractionCommandScope(command, controlRef);
|
|
11918
|
-
return (await session.respondToInteraction(command, options)).acknowledgement;
|
|
11919
|
-
} } : {},
|
|
11920
|
-
...session.cancelRun ? { async cancelRun(request, options) {
|
|
11921
|
-
assertCancellationScope(request, controlRef);
|
|
11922
|
-
return session.cancelRun(request, options);
|
|
11923
|
-
} } : {},
|
|
11924
|
-
cancel() {
|
|
11925
|
-
return session.interrupt(controlRef?.executionId === void 0 ? void 0 : { executionId: controlRef.executionId }).then(() => void 0);
|
|
11926
|
-
}
|
|
11927
|
-
};
|
|
11928
|
-
}
|
|
11929
11680
|
function sandboxSessionFromAgentSession(session, expectedControlRef) {
|
|
11930
11681
|
if (!session) throw new ValidationError("providerAsSandboxClient: session is unavailable");
|
|
11931
11682
|
const controlRef = resolveSessionControlRef(session.controlRef, expectedControlRef);
|
|
@@ -11999,20 +11750,6 @@ function promptResultFromAgentTurnResult(result) {
|
|
|
11999
11750
|
} : {}
|
|
12000
11751
|
};
|
|
12001
11752
|
}
|
|
12002
|
-
function environmentEventFromSandboxEvent(event) {
|
|
12003
|
-
const data = event.data && typeof event.data === "object" ? event.data : {};
|
|
12004
|
-
const normalized = canonicalStreamEventFromSandboxEvent(event);
|
|
12005
|
-
const usage = tokenUsageFromData(data);
|
|
12006
|
-
const receipt = tokenUsageReceipt(tokenUsageRecord(data));
|
|
12007
|
-
return {
|
|
12008
|
-
type: String(event.type),
|
|
12009
|
-
data,
|
|
12010
|
-
...event.id ? { id: event.id } : {},
|
|
12011
|
-
...normalized ? { normalized } : {},
|
|
12012
|
-
...usage && receipt.complete ? { usage } : {},
|
|
12013
|
-
providerEvent: event
|
|
12014
|
-
};
|
|
12015
|
-
}
|
|
12016
11753
|
function sandboxEventFromEnvironmentEvent(event) {
|
|
12017
11754
|
const normalized = event.normalized;
|
|
12018
11755
|
const type = normalized?.type ?? event.type;
|
|
@@ -12074,12 +11811,14 @@ function providerFailureEvent(event, sandboxEvent) {
|
|
|
12074
11811
|
if (!failedStatus && !failedTerminal) return void 0;
|
|
12075
11812
|
const detail = failureDetail(sandboxEvent.data) ?? failureDetail(outcome) ?? failureDetail(result) ?? (normalized?.type === "status" ? normalized.detail : void 0);
|
|
12076
11813
|
const errorCode = failureCode(sandboxEvent.data) ?? failureCode(outcome) ?? failureCode(result);
|
|
11814
|
+
const statusCode = failureStatusCode(sandboxEvent.data) ?? failureStatusCode(outcome) ?? failureStatusCode(result);
|
|
12077
11815
|
return {
|
|
12078
11816
|
type: "result",
|
|
12079
11817
|
data: {
|
|
12080
11818
|
status: "failed",
|
|
12081
11819
|
...detail ? { error: detail } : {},
|
|
12082
|
-
...errorCode ? { errorCode } : {}
|
|
11820
|
+
...errorCode ? { errorCode } : {},
|
|
11821
|
+
...statusCode === void 0 ? {} : { statusCode }
|
|
12083
11822
|
}
|
|
12084
11823
|
};
|
|
12085
11824
|
}
|
|
@@ -12168,6 +11907,11 @@ function failureDetail(value) {
|
|
|
12168
11907
|
if (typeof value.message === "string") return value.message;
|
|
12169
11908
|
return typeof value.detail === "string" ? value.detail : void 0;
|
|
12170
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
|
+
}
|
|
12171
11915
|
function failureCode(value) {
|
|
12172
11916
|
if (!value) return void 0;
|
|
12173
11917
|
const error = recordValue(value.error);
|
|
@@ -12239,17 +11983,6 @@ function resolveSessionControlRef(actual, expected, options = {}) {
|
|
|
12239
11983
|
if (!sameControlCoordinates(actualExact.data, expectedExact)) throw new ValidationError("provider session returned a different exact run control reference");
|
|
12240
11984
|
return actualExact.data;
|
|
12241
11985
|
}
|
|
12242
|
-
function assertSandboxStatusBinding(status, controlRef) {
|
|
12243
|
-
if (!status || typeof status !== "object" || controlRef === void 0) return;
|
|
12244
|
-
const record = status;
|
|
12245
|
-
if (record.runControlRef !== void 0) {
|
|
12246
|
-
if (!sameControlCoordinates(AgentExactRunControlRefSchema.parse(record.runControlRef), controlRef)) throw new ValidationError("sandbox status returned a different exact run control reference");
|
|
12247
|
-
}
|
|
12248
|
-
for (const key of ["activeExecutionId", "latestExecutionId"]) {
|
|
12249
|
-
const executionId = record[key];
|
|
12250
|
-
if (executionId !== void 0 && executionId !== controlRef.executionId) throw new ValidationError("sandbox status returned a different execution");
|
|
12251
|
-
}
|
|
12252
|
-
}
|
|
12253
11986
|
function assertInteractionCommandScope(command, controlRef) {
|
|
12254
11987
|
if (controlRef === void 0) return;
|
|
12255
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");
|
|
@@ -12387,50 +12120,6 @@ function isUsageType(type) {
|
|
|
12387
12120
|
function isNestedUsageType(type) {
|
|
12388
12121
|
return isSandboxTerminalEvent(type) && sandboxTerminalUsageField(type) === "usage";
|
|
12389
12122
|
}
|
|
12390
|
-
function tokenUsageFromData(data) {
|
|
12391
|
-
const usageRecord = tokenUsageRecord(data);
|
|
12392
|
-
const inputTokens = inputTokensFromUsage(usageRecord);
|
|
12393
|
-
const outputTokens = outputTokensFromUsage(usageRecord);
|
|
12394
|
-
const totalTokens = finiteNumber(usageRecord.totalTokens);
|
|
12395
|
-
const cacheReadInputTokens = finiteNumber(usageRecord.cacheReadInputTokens);
|
|
12396
|
-
const cacheCreationInputTokens = finiteNumber(usageRecord.cacheCreationInputTokens);
|
|
12397
|
-
const reasoningTokens = finiteNumber(usageRecord.reasoningTokens);
|
|
12398
|
-
const cost = finiteNumber(usageRecord.cost) ?? finiteNumber(usageRecord.costUsd) ?? finiteNumber(usageRecord.totalCostUsd) ?? finiteNumber(data.costUsd) ?? finiteNumber(data.totalCostUsd);
|
|
12399
|
-
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;
|
|
12400
|
-
return {
|
|
12401
|
-
inputTokens: inputTokens ?? 0,
|
|
12402
|
-
outputTokens: outputTokens ?? 0,
|
|
12403
|
-
...totalTokens !== void 0 ? { totalTokens } : {},
|
|
12404
|
-
...cacheReadInputTokens !== void 0 ? { cacheReadInputTokens } : {},
|
|
12405
|
-
...cacheCreationInputTokens !== void 0 ? { cacheCreationInputTokens } : {},
|
|
12406
|
-
...reasoningTokens !== void 0 ? { reasoningTokens } : {},
|
|
12407
|
-
...cost !== void 0 ? { cost } : {}
|
|
12408
|
-
};
|
|
12409
|
-
}
|
|
12410
|
-
function tokenUsageRecord(data) {
|
|
12411
|
-
return recordValue(data.usage) ?? recordValue(data.tokenUsage) ?? data;
|
|
12412
|
-
}
|
|
12413
|
-
function inputTokensFromUsage(value) {
|
|
12414
|
-
const usage = recordValue(value);
|
|
12415
|
-
if (!usage) return void 0;
|
|
12416
|
-
return finiteNumber(usage.inputTokens) ?? finiteNumber(usage.tokensIn) ?? finiteNumber(usage.prompt_tokens);
|
|
12417
|
-
}
|
|
12418
|
-
function outputTokensFromUsage(value) {
|
|
12419
|
-
const usage = recordValue(value);
|
|
12420
|
-
if (!usage) return void 0;
|
|
12421
|
-
return finiteNumber(usage.outputTokens) ?? finiteNumber(usage.tokensOut) ?? finiteNumber(usage.completion_tokens);
|
|
12422
|
-
}
|
|
12423
|
-
function tokenUsageReceipt(value) {
|
|
12424
|
-
const usage = recordValue(value);
|
|
12425
|
-
const hasInput = inputTokensFromUsage(usage) !== void 0;
|
|
12426
|
-
const hasOutput = outputTokensFromUsage(usage) !== void 0;
|
|
12427
|
-
return {
|
|
12428
|
-
hasInput,
|
|
12429
|
-
hasOutput,
|
|
12430
|
-
hasTokens: hasInput || hasOutput || finiteNumber(usage?.totalTokens) !== void 0 || finiteNumber(usage?.cacheReadInputTokens) !== void 0 || finiteNumber(usage?.cacheCreationInputTokens) !== void 0 || finiteNumber(usage?.reasoningTokens) !== void 0,
|
|
12431
|
-
complete: hasInput && hasOutput
|
|
12432
|
-
};
|
|
12433
|
-
}
|
|
12434
12123
|
function mergeTokenUsage(left, right) {
|
|
12435
12124
|
if (!left) return right;
|
|
12436
12125
|
if (!right) return left;
|
|
@@ -12444,21 +12133,9 @@ function mergeTokenUsage(left, right) {
|
|
|
12444
12133
|
...left.cost !== void 0 || right.cost !== void 0 ? { cost: (left.cost ?? 0) + (right.cost ?? 0) } : {}
|
|
12445
12134
|
};
|
|
12446
12135
|
}
|
|
12447
|
-
function finiteNumber(value) {
|
|
12448
|
-
return typeof value === "number" && Number.isFinite(value) ? value : void 0;
|
|
12449
|
-
}
|
|
12450
12136
|
function stringValue(value) {
|
|
12451
12137
|
return typeof value === "string" && value.length > 0 ? value : void 0;
|
|
12452
12138
|
}
|
|
12453
|
-
function agentTurnResultFromPromptResult(result) {
|
|
12454
|
-
const record = result;
|
|
12455
|
-
return {
|
|
12456
|
-
text: typeof record.response === "string" ? record.response : typeof record.text === "string" ? record.text : typeof record.finalText === "string" ? record.finalText : "",
|
|
12457
|
-
success: typeof record.success === "boolean" ? record.success : true,
|
|
12458
|
-
...typeof record.error === "string" ? { error: record.error } : {},
|
|
12459
|
-
usage: tokenUsageFromData(record)
|
|
12460
|
-
};
|
|
12461
|
-
}
|
|
12462
12139
|
function sandboxDispatchResultFromSessionRef(session) {
|
|
12463
12140
|
const controlRef = session.controlRef === void 0 ? void 0 : AgentExactRunControlRefSchema.parse(session.controlRef);
|
|
12464
12141
|
const metadataExecutionId = optionalDispatchIdentity(session.metadata?.executionId, "executionId");
|
|
@@ -12479,50 +12156,11 @@ function sandboxDispatchResultFromSessionRef(session) {
|
|
|
12479
12156
|
}
|
|
12480
12157
|
};
|
|
12481
12158
|
}
|
|
12482
|
-
function sessionRefFromSandboxDispatch(dispatched, providerName) {
|
|
12483
|
-
const record = dispatched && typeof dispatched === "object" ? dispatched : void 0;
|
|
12484
|
-
const id = record?.sessionId ?? record?.id;
|
|
12485
|
-
if (typeof id !== "string" || id.length === 0) throw new ValidationError("sandboxClientAsProvider: dispatch returned no session id");
|
|
12486
|
-
if (!record) throw new ValidationError("sandboxClientAsProvider: dispatch returned no session record");
|
|
12487
|
-
const executionId = optionalDispatchIdentity(record.executionId, "executionId");
|
|
12488
|
-
const controlRef = record.runControlRef === void 0 ? void 0 : AgentExactRunControlRefSchema.parse(record.runControlRef);
|
|
12489
|
-
if (controlRef !== void 0) {
|
|
12490
|
-
if (controlRef.sessionId !== id || controlRef.provider !== providerName) throw new ValidationError("sandbox dispatch returned a control reference for another session");
|
|
12491
|
-
if (executionId !== void 0 && controlRef.executionId !== executionId) throw new ValidationError("sandbox dispatch returned conflicting execution identities");
|
|
12492
|
-
}
|
|
12493
|
-
if (record.alreadyExisted !== void 0 && typeof record.alreadyExisted !== "boolean") throw new ValidationError("sandbox dispatch returned an invalid alreadyExisted flag");
|
|
12494
|
-
if (record.dispatched !== void 0 && typeof record.dispatched !== "boolean") throw new ValidationError("sandbox dispatch returned an invalid dispatched flag");
|
|
12495
|
-
if (record.status !== void 0 && !isSandboxSessionStatus(record.status)) throw new ValidationError("sandbox dispatch returned an invalid session status");
|
|
12496
|
-
return {
|
|
12497
|
-
id,
|
|
12498
|
-
provider: providerName,
|
|
12499
|
-
...controlRef === void 0 ? {} : { controlRef },
|
|
12500
|
-
metadata: {
|
|
12501
|
-
...record.status ? { status: record.status } : {},
|
|
12502
|
-
...executionId === void 0 ? {} : { executionId },
|
|
12503
|
-
...record.alreadyExisted !== void 0 ? { alreadyExisted: record.alreadyExisted } : {},
|
|
12504
|
-
...record.dispatched !== void 0 ? { dispatched: record.dispatched } : {}
|
|
12505
|
-
}
|
|
12506
|
-
};
|
|
12507
|
-
}
|
|
12508
12159
|
function optionalDispatchIdentity(value, label) {
|
|
12509
12160
|
if (value === void 0) return void 0;
|
|
12510
12161
|
if (typeof value !== "string" || value.length === 0) throw new ValidationError(`sandbox dispatch returned an invalid ${label}`);
|
|
12511
12162
|
return value;
|
|
12512
12163
|
}
|
|
12513
|
-
function isSandboxSessionStatus(value) {
|
|
12514
|
-
return value === "queued" || value === "running" || value === "completed" || value === "failed" || value === "cancelled";
|
|
12515
|
-
}
|
|
12516
|
-
function execResultFromSandboxExecResult(result) {
|
|
12517
|
-
const record = result;
|
|
12518
|
-
const exitCode = finiteNumber(record.exitCode) ?? finiteNumber(record.code);
|
|
12519
|
-
if (exitCode === void 0) throw new ValidationError("sandboxClientAsProvider: exec returned no exit code");
|
|
12520
|
-
return {
|
|
12521
|
-
exitCode,
|
|
12522
|
-
stdout: typeof record.stdout === "string" ? record.stdout : "",
|
|
12523
|
-
stderr: typeof record.stderr === "string" ? record.stderr : ""
|
|
12524
|
-
};
|
|
12525
|
-
}
|
|
12526
12164
|
function statusFromUnknown(status) {
|
|
12527
12165
|
if (status === "pending" || status === "provisioning" || status === "running") return status;
|
|
12528
12166
|
if (status === "stopped" || status === "failed" || status === "expired") return status;
|
|
@@ -12534,133 +12172,6 @@ function sessionStatusFromUnknown(status) {
|
|
|
12534
12172
|
if (status === "completed" || status === "cancelled") return status;
|
|
12535
12173
|
return statusFromUnknown(status);
|
|
12536
12174
|
}
|
|
12537
|
-
function readBoxStatus(box) {
|
|
12538
|
-
return box.status;
|
|
12539
|
-
}
|
|
12540
|
-
function readBoxMetadata(box) {
|
|
12541
|
-
const metadata = box.metadata;
|
|
12542
|
-
return metadata && typeof metadata === "object" ? metadata : void 0;
|
|
12543
|
-
}
|
|
12544
|
-
async function maybeRefresh(box) {
|
|
12545
|
-
const refresh = box.refresh;
|
|
12546
|
-
if (typeof refresh === "function") await refresh.call(box);
|
|
12547
|
-
}
|
|
12548
|
-
async function destroyBox(box) {
|
|
12549
|
-
const deleteBox = box.delete;
|
|
12550
|
-
if (typeof deleteBox === "function") await deleteBox.call(box);
|
|
12551
|
-
}
|
|
12552
|
-
function placementInfoFromLoopPlacement(placement, box) {
|
|
12553
|
-
if (!placement) return {
|
|
12554
|
-
kind: "sandbox",
|
|
12555
|
-
sandboxId: String(box.id)
|
|
12556
|
-
};
|
|
12557
|
-
return {
|
|
12558
|
-
kind: placement.kind === "fleet" ? "fleet" : placement.kind === "in-process" ? "local" : "sandbox",
|
|
12559
|
-
...placement.sandboxId ? { sandboxId: placement.sandboxId } : { sandboxId: String(box.id) },
|
|
12560
|
-
...placement.fleetId ? { fleetId: placement.fleetId } : {},
|
|
12561
|
-
...placement.machineId ? { machineId: placement.machineId } : {}
|
|
12562
|
-
};
|
|
12563
|
-
}
|
|
12564
|
-
const completeInteractiveAgentCapabilities = {
|
|
12565
|
-
start: true,
|
|
12566
|
-
control: true,
|
|
12567
|
-
status: true,
|
|
12568
|
-
attach: true,
|
|
12569
|
-
reattach: true,
|
|
12570
|
-
sendPrompt: true,
|
|
12571
|
-
input: true,
|
|
12572
|
-
resize: true,
|
|
12573
|
-
stop: true
|
|
12574
|
-
};
|
|
12575
|
-
async function sandboxEnvironmentCapabilities(box, providerCapabilities) {
|
|
12576
|
-
const { interactiveAgent: providerInteractive, ...baseCapabilities } = providerCapabilities;
|
|
12577
|
-
if (!hasCompleteInteractiveAgentCapabilities(providerInteractive)) return baseCapabilities;
|
|
12578
|
-
let deployed;
|
|
12579
|
-
try {
|
|
12580
|
-
deployed = await box.capabilities();
|
|
12581
|
-
} catch {
|
|
12582
|
-
return baseCapabilities;
|
|
12583
|
-
}
|
|
12584
|
-
if (!hasCompleteInteractiveAgentCapabilities(deployed?.interactiveAgent)) return baseCapabilities;
|
|
12585
|
-
if (!hasExactInteractiveTerminalAdapter(box)) return baseCapabilities;
|
|
12586
|
-
return {
|
|
12587
|
-
...baseCapabilities,
|
|
12588
|
-
interactiveAgent: { ...completeInteractiveAgentCapabilities }
|
|
12589
|
-
};
|
|
12590
|
-
}
|
|
12591
|
-
function hasExactInteractiveTerminalAdapter(box) {
|
|
12592
|
-
if (!hasSession(box)) return false;
|
|
12593
|
-
try {
|
|
12594
|
-
const session = box.session("__runtime-capability-probe__");
|
|
12595
|
-
const interactive = session.interactive;
|
|
12596
|
-
if (typeof interactive !== "function") return false;
|
|
12597
|
-
return typeof interactive.call(session).attachAgentTerminal === "function";
|
|
12598
|
-
} catch {
|
|
12599
|
-
return false;
|
|
12600
|
-
}
|
|
12601
|
-
}
|
|
12602
|
-
function hasCompleteInteractiveAgentCapabilities(value) {
|
|
12603
|
-
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;
|
|
12604
|
-
}
|
|
12605
|
-
function assertSandboxInteractiveBinding(run, box, providerName) {
|
|
12606
|
-
if (run.provider !== providerName || run.environmentId !== String(box.id)) throw new ValidationError("sandbox interactive request targets another environment");
|
|
12607
|
-
}
|
|
12608
|
-
function defaultTangleSandboxCapabilities(options) {
|
|
12609
|
-
return {
|
|
12610
|
-
profile: {
|
|
12611
|
-
namedProfiles: options.namedProfiles,
|
|
12612
|
-
systemPrompt: { ...harnessSystemPromptIntents(void 0) },
|
|
12613
|
-
instructions: true,
|
|
12614
|
-
tools: true,
|
|
12615
|
-
permissions: true,
|
|
12616
|
-
mcp: true,
|
|
12617
|
-
subagents: true,
|
|
12618
|
-
resources: {
|
|
12619
|
-
files: true,
|
|
12620
|
-
instructions: true,
|
|
12621
|
-
tools: true,
|
|
12622
|
-
skills: true,
|
|
12623
|
-
agents: true,
|
|
12624
|
-
commands: true
|
|
12625
|
-
},
|
|
12626
|
-
hooks: true,
|
|
12627
|
-
modes: true,
|
|
12628
|
-
runtimeUpdate: true,
|
|
12629
|
-
validation: true
|
|
12630
|
-
},
|
|
12631
|
-
streaming: {
|
|
12632
|
-
live: true,
|
|
12633
|
-
replay: true,
|
|
12634
|
-
detach: true,
|
|
12635
|
-
turnIdempotency: true
|
|
12636
|
-
},
|
|
12637
|
-
sessions: {
|
|
12638
|
-
continue: true,
|
|
12639
|
-
list: true,
|
|
12640
|
-
messages: true
|
|
12641
|
-
},
|
|
12642
|
-
workspace: {
|
|
12643
|
-
read: true,
|
|
12644
|
-
write: true,
|
|
12645
|
-
exec: true,
|
|
12646
|
-
git: true,
|
|
12647
|
-
upload: true,
|
|
12648
|
-
download: true,
|
|
12649
|
-
cwdBases: {
|
|
12650
|
-
repository: true,
|
|
12651
|
-
host: false
|
|
12652
|
-
}
|
|
12653
|
-
},
|
|
12654
|
-
branching: {
|
|
12655
|
-
checkpoint: false,
|
|
12656
|
-
fork: false
|
|
12657
|
-
},
|
|
12658
|
-
...options.rediscover ? { interactiveAgent: { ...completeInteractiveAgentCapabilities } } : {},
|
|
12659
|
-
placement: true,
|
|
12660
|
-
usage: true,
|
|
12661
|
-
confidential: false
|
|
12662
|
-
};
|
|
12663
|
-
}
|
|
12664
12175
|
function contentRef(prefix, value) {
|
|
12665
12176
|
let str;
|
|
12666
12177
|
try {
|
|
@@ -12675,27 +12186,6 @@ function contentRef(prefix, value) {
|
|
|
12675
12186
|
}
|
|
12676
12187
|
return `${prefix}:${(hash >>> 0).toString(16).padStart(8, "0")}`;
|
|
12677
12188
|
}
|
|
12678
|
-
function hasGet(client) {
|
|
12679
|
-
return typeof client.get === "function";
|
|
12680
|
-
}
|
|
12681
|
-
function hasList(client) {
|
|
12682
|
-
return typeof client.list === "function";
|
|
12683
|
-
}
|
|
12684
|
-
function hasDispatchPrompt(box) {
|
|
12685
|
-
return typeof box.dispatchPrompt === "function";
|
|
12686
|
-
}
|
|
12687
|
-
function hasSession(box) {
|
|
12688
|
-
return typeof box.session === "function";
|
|
12689
|
-
}
|
|
12690
|
-
function hasRead(box) {
|
|
12691
|
-
return typeof box.read === "function";
|
|
12692
|
-
}
|
|
12693
|
-
function hasWrite(box) {
|
|
12694
|
-
return typeof box.write === "function";
|
|
12695
|
-
}
|
|
12696
|
-
function hasExec(box) {
|
|
12697
|
-
return typeof box.exec === "function";
|
|
12698
|
-
}
|
|
12699
12189
|
//#endregion
|
|
12700
12190
|
//#region src/runtime/model-identity.ts
|
|
12701
12191
|
const SNAPSHOT_TOKEN = /^[A-Za-z0-9._-]+$/u;
|
|
@@ -23260,21 +22750,22 @@ async function ownerWorkspaceRetentionFailures(events, nodeId, blobs) {
|
|
|
23260
22750
|
if (event.kind === "execution-input") {
|
|
23261
22751
|
flush();
|
|
23262
22752
|
current = {
|
|
22753
|
+
executionId: `${nodeId}:input:${event.seq}`,
|
|
23263
22754
|
environmentIds: /* @__PURE__ */ new Set(),
|
|
23264
|
-
|
|
22755
|
+
controlByEnvironment: /* @__PURE__ */ new Map()
|
|
23265
22756
|
};
|
|
23266
22757
|
} else if (event.kind === "execution-admitted" && event.admission.phase === "environment") {
|
|
23267
22758
|
if (current?.result !== void 0) flush();
|
|
23268
22759
|
current ??= {
|
|
23269
22760
|
environmentIds: /* @__PURE__ */ new Set(),
|
|
23270
|
-
|
|
22761
|
+
controlByEnvironment: /* @__PURE__ */ new Map()
|
|
23271
22762
|
};
|
|
23272
22763
|
current.environmentIds.add(event.admission.environmentId);
|
|
23273
|
-
|
|
23274
|
-
|
|
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") {
|
|
23275
22766
|
current ??= {
|
|
23276
22767
|
environmentIds: /* @__PURE__ */ new Set(),
|
|
23277
|
-
|
|
22768
|
+
controlByEnvironment: /* @__PURE__ */ new Map()
|
|
23278
22769
|
};
|
|
23279
22770
|
current.result = event;
|
|
23280
22771
|
}
|
|
@@ -23301,20 +22792,21 @@ async function ownerWorkspaceRetentionFailures(events, nodeId, blobs) {
|
|
|
23301
22792
|
}
|
|
23302
22793
|
const snapshot = output !== null && typeof output === "object" ? output.workspaceSnapshot : void 0;
|
|
23303
22794
|
const environmentId = [...attempt.environmentIds][0];
|
|
23304
|
-
const
|
|
23305
|
-
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);
|
|
23306
22797
|
}
|
|
23307
22798
|
return failures;
|
|
23308
22799
|
}
|
|
23309
22800
|
/** A stored result authorizes cleanup only for the exact source and complete capture. */
|
|
23310
|
-
function hasDurableWorkspaceCapture(output, snapshot, environmentId, executionId) {
|
|
22801
|
+
function hasDurableWorkspaceCapture(output, snapshot, environmentId, executionId, controlRef) {
|
|
23311
22802
|
const parsed = agentCandidateWorkspaceSnapshotEvidenceSchema.safeParse(snapshot);
|
|
23312
22803
|
if (!parsed.success || !("locator" in parsed.data.manifest) || !("locator" in parsed.data.archive)) return false;
|
|
23313
22804
|
if (output === null || typeof output !== "object") return false;
|
|
23314
22805
|
const capture = output.workspaceCapture;
|
|
23315
22806
|
if (capture === null || typeof capture !== "object") return false;
|
|
23316
22807
|
const receipt = capture;
|
|
23317
|
-
|
|
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;
|
|
23318
22810
|
const linked = agentCandidateWorkspaceSnapshotEvidenceSchema.safeParse(receipt.snapshot);
|
|
23319
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);
|
|
23320
22812
|
}
|
|
@@ -27456,11 +26948,18 @@ const DETERMINISTIC_BRIDGE_CODES = /* @__PURE__ */ new Set([
|
|
|
27456
26948
|
var HarnessTurnFailedError = class extends Error {
|
|
27457
26949
|
runtime;
|
|
27458
26950
|
errorCode;
|
|
26951
|
+
statusCode;
|
|
26952
|
+
/** The shared HTTP error reader also uses this status for persisted diagnostics. */
|
|
26953
|
+
status;
|
|
27459
26954
|
constructor(runtime, failure) {
|
|
27460
26955
|
super(`${runtime} harness turn ended with a failed outcome` + (failure.errorCode === void 0 ? "" : ` (${failure.errorCode})`) + `: ${failure.error}`);
|
|
27461
26956
|
this.name = "HarnessTurnFailedError";
|
|
27462
26957
|
this.runtime = runtime;
|
|
27463
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
|
+
}
|
|
27464
26963
|
}
|
|
27465
26964
|
};
|
|
27466
26965
|
/**
|
|
@@ -27477,7 +26976,8 @@ function upstreamUnavailableSignal(error) {
|
|
|
27477
26976
|
if (error instanceof CheckUnavailableError) return "check-unavailable";
|
|
27478
26977
|
if (error instanceof HarnessTurnFailedError) return unavailableSignalOfFailure({
|
|
27479
26978
|
error: error.message,
|
|
27480
|
-
...error.errorCode === void 0 ? {} : { errorCode: error.errorCode }
|
|
26979
|
+
...error.errorCode === void 0 ? {} : { errorCode: error.errorCode },
|
|
26980
|
+
...error.statusCode === void 0 ? {} : { statusCode: error.statusCode }
|
|
27481
26981
|
});
|
|
27482
26982
|
if (error instanceof BackendTransportError) {
|
|
27483
26983
|
const code = error.upstreamCode?.toLowerCase();
|
|
@@ -27509,7 +27009,8 @@ function classifyDriverFailure(error, signal) {
|
|
|
27509
27009
|
if (error instanceof Error && errorProperty(error, "name") === "AbortError") return "terminal";
|
|
27510
27010
|
if (error instanceof HarnessTurnFailedError) {
|
|
27511
27011
|
if (error.errorCode !== void 0 && DETERMINISTIC_BRIDGE_CODES.has(error.errorCode)) return "terminal";
|
|
27512
|
-
|
|
27012
|
+
if (isUpstreamUnavailable(error)) return "unavailable";
|
|
27013
|
+
return foreignHttpStatusVerdict(error) ?? "transient";
|
|
27513
27014
|
}
|
|
27514
27015
|
if (error instanceof BackendTransportError) {
|
|
27515
27016
|
if (error.upstreamCode !== void 0 && DETERMINISTIC_BRIDGE_CODES.has(error.upstreamCode)) return "terminal";
|
|
@@ -28921,6 +28422,6 @@ function isNonEmptySpend(s) {
|
|
|
28921
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);
|
|
28922
28423
|
}
|
|
28923
28424
|
//#endregion
|
|
28924
|
-
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 };
|
|
28925
28426
|
|
|
28926
|
-
//# sourceMappingURL=supervisor-
|
|
28427
|
+
//# sourceMappingURL=supervisor-CQFcQhlo.js.map
|