@tangle-network/agent-runtime 0.225.6 → 0.226.0
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-CsfCkAdZ.d.ts → activation-Dv8TBXAS.d.ts} +2 -2
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/{delegate-Dpz_acWb.js → delegate-DHpAEq6-.js} +2 -2
- package/dist/{delegate-Dpz_acWb.js.map → delegate-DHpAEq6-.js.map} +1 -1
- package/dist/durable.d.ts +39 -3
- package/dist/durable.js +6 -4
- package/dist/durable.js.map +1 -1
- package/dist/{graph-1QPyAoyr.js → graph-BkeA7dEi.js} +2 -2
- package/dist/{graph-1QPyAoyr.js.map → graph-BkeA7dEi.js.map} +1 -1
- package/dist/{index-ClXIBpKe.d.ts → index-DAIij88v.d.ts} +10 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -3
- package/dist/intelligence.d.ts +2 -2
- package/dist/kernel.d.ts +3 -3
- package/dist/kernel.js +4 -4
- package/dist/{loop-runner-bin-BsgnB2h8.js → loop-runner-bin-B0nQvskW.js} +2 -2
- package/dist/{loop-runner-bin-BsgnB2h8.js.map → loop-runner-bin-B0nQvskW.js.map} +1 -1
- package/dist/{loop-runner-bin-BRfsk-9d.d.ts → loop-runner-bin-CN1rstwC.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 +2 -2
- package/dist/mcp/index.d.ts +2 -2
- package/dist/mcp/index.js +2 -2
- package/dist/{runtime-D7UefZ3u.js → runtime-Dqik43o3.js} +4 -4
- package/dist/{runtime-D7UefZ3u.js.map → runtime-Dqik43o3.js.map} +1 -1
- package/dist/{server-YytoZ1EN.js → server-C12kUoSM.js} +2 -2
- package/dist/{server-YytoZ1EN.js.map → server-C12kUoSM.js.map} +1 -1
- package/dist/{stream-agent-turn-wlsHQiUv.d.ts → stream-agent-turn-Dy-QleSb.d.ts} +22 -2
- package/dist/{supervise-CkqrhpOD.js → supervise-CtXJ-lWb.js} +179 -9
- package/dist/supervise-CtXJ-lWb.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +10 -10
- package/dist/tui/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/supervise-CkqrhpOD.js.map +0 -1
|
@@ -2754,6 +2754,20 @@ interface SupervisorOpts {
|
|
|
2754
2754
|
* Runtime records this only from a Runtime-owned provider/bridge receipt; an authored profile
|
|
2755
2755
|
* alias is never substituted when the provider omits the identity. */
|
|
2756
2756
|
type RootProviderModelEvidence = ProviderModelExecutionEvidence;
|
|
2757
|
+
/**
|
|
2758
|
+
* The root manager's retained provider stream: `<runDir>/root-stream.jsonl`, one line per
|
|
2759
|
+
* progress event the root's executor observed, referenced by the content address of the file's
|
|
2760
|
+
* bytes and its committed line count. Present exactly when the run had a run directory and a
|
|
2761
|
+
* Runtime-driven root that began at least one drive attempt; a caller-supplied harness leaves it
|
|
2762
|
+
* absent, never an empty receipt. Distinct from `outRef`, which on a `winner` names the SELECTED
|
|
2763
|
+
* CHILD's artifact.
|
|
2764
|
+
*/
|
|
2765
|
+
interface RootStreamReceipt {
|
|
2766
|
+
/** `sha256:<hex>` over the file's bytes as they were when the receipt was taken. */
|
|
2767
|
+
readonly ref: string;
|
|
2768
|
+
/** Committed lines in the file. `0` is a root that drove and produced no observable output. */
|
|
2769
|
+
readonly events: number;
|
|
2770
|
+
}
|
|
2757
2771
|
/** One provider/harness inference attempt. An empty observation list means the attempt started but
|
|
2758
2772
|
* no trusted served model identity arrived before it failed or ended, unless Router explicitly
|
|
2759
2773
|
* proves that admission rejected it before provider dispatch. */
|
|
@@ -2843,6 +2857,8 @@ type SupervisedResult<Out> = {
|
|
|
2843
2857
|
spentTotal: Spend;
|
|
2844
2858
|
/** Runtime-owned provider evidence for the root manager, when the root executed inference. */
|
|
2845
2859
|
readonly rootProviderModel?: RootProviderModelEvidence;
|
|
2860
|
+
/** The root manager's retained provider stream, when the run directory holds one. */
|
|
2861
|
+
readonly rootStream?: RootStreamReceipt;
|
|
2846
2862
|
/** Runtime-owned provider evidence reduced across the complete journal forest. */
|
|
2847
2863
|
readonly providerModel?: ProviderModelExecutionEvidence;
|
|
2848
2864
|
/** Settled children whose executor teardown was never acknowledged — the resources this run
|
|
@@ -2880,6 +2896,8 @@ type SupervisedResult<Out> = {
|
|
|
2880
2896
|
spentTotal: Spend;
|
|
2881
2897
|
/** Runtime-owned provider evidence for the root manager, when the root executed inference. */
|
|
2882
2898
|
readonly rootProviderModel?: RootProviderModelEvidence;
|
|
2899
|
+
/** The root manager's retained provider stream, when the run directory holds one. */
|
|
2900
|
+
readonly rootStream?: RootStreamReceipt;
|
|
2883
2901
|
/** Runtime-owned provider evidence reduced across the complete journal forest. */
|
|
2884
2902
|
readonly providerModel?: ProviderModelExecutionEvidence;
|
|
2885
2903
|
/** Settled children whose executor teardown was never acknowledged — the resources this run
|
|
@@ -2925,6 +2943,8 @@ type SupervisedResult<Out> = {
|
|
|
2925
2943
|
spentTotal: Spend;
|
|
2926
2944
|
/** Runtime-owned provider evidence for the root manager, when the root executed inference. */
|
|
2927
2945
|
readonly rootProviderModel?: RootProviderModelEvidence;
|
|
2946
|
+
/** The root manager's retained provider stream, when the run directory holds one. */
|
|
2947
|
+
readonly rootStream?: RootStreamReceipt;
|
|
2928
2948
|
/** Runtime-owned provider evidence reduced across the complete journal forest. */
|
|
2929
2949
|
readonly providerModel?: ProviderModelExecutionEvidence;
|
|
2930
2950
|
/** Settled children whose executor teardown was never acknowledged — the resources this run
|
|
@@ -5028,5 +5048,5 @@ declare function streamAgentTurn(backend: AgentTurnBackend, input: AgentTurnInpu
|
|
|
5028
5048
|
*/
|
|
5029
5049
|
declare function collectAgentTurn(stream: AsyncIterable<RuntimeStreamEvent>): Promise<CollectedAgentTurn>;
|
|
5030
5050
|
//#endregion
|
|
5031
|
-
export { decodeHarnessUsage as $,
|
|
5032
|
-
//# sourceMappingURL=stream-agent-turn-
|
|
5051
|
+
export { decodeHarnessUsage as $, RetainedInteractiveIntentAdmission as $a, RuntimeStreamEventCollector as $i, McpTransport as $n, SpawnPrior as $r, WorktreeCheckRunner as $t, createInbox as A, ActivityNote as Aa, EvalRunEvent as Ai, ToolLoopMessageRecord as An, NodeExecutionIdentity as Ar, CreateAgentEnvironmentInput$1 as At, secretEnvOfMcpServer as B, RetainedInteractiveEnvironmentInput as Ba, RuntimeEventOtelOptions as Bi, PeerMailReadout as Bn, ResumedKeyState as Br, ResourceRequest as Bt, SteerableSandboxArgs as C, SessionTraceBox as Ca, workerTraceHeaders as Ci, runLocalHarness as Cn, ReservationRejection as Co, ExecutorResult as Cr, AgentProfileRef$1 as Ct, Inbox as D, decodeToolPart as Da, mergeTraceEnv as Di, ToolLoopChat as Dn, spendFromUsageEvents as Do, MaterializedExecutionIdentity as Dr, AgentTurnResult$2 as Dt, AuthorityInboxMessage as E, createPushTraceSource as Ea, createPropagatingTraceEmitter as Ei, ToolLoopCallContext as En, createBudgetPool as Eo, Handle as Er, AgentSessionStatus$1 as Et, ResolvedMcpServerLaunch as F, createActivityLog as Fa, LoopSpanNode as Fi, PeerMailEnvelope as Fn, ProviderModelAttemptEvidence as Fr, PlacementInfo as Ft, CodexRolloutStoreRef as G, NativeContextContinuationHandle as Ga, createOtelExporter as Gi, claimsAuthority as Gn, RootSignal as Gr, providerAsSandboxClient as Gt, CodexRolloutIdentity as H, RetainedInteractiveStartMaterial as Ha, buildLoopSpanNodes as Hi, PeerMailSendInput as Hn, RootHandle as Hr, WorkspaceRequest as Ht, envKeyProvider as I, readWorkerProgress as Ia, OtelAttribute as Ii, PeerMailEvent as In, ProviderModelExecutionEvidence as Ir, ProviderAsSandboxClientOptions as It, addHarnessUsage as J, RecoverRetainedRunIntentOptions as Ja, loopEventToOtelSpan as Ji, peerMailTools as Jn, Scope as Jr, CreateTangleSandboxExactProcessProviderOptions as Jt, CodexRolloutTurn as K, NativeContextContinuationInput as Ka, exportEvalRuns as Ki, createPeerMailbox as Kn, RootStreamReceipt as Kr, resolveAgentEnvironmentProvider as Kt, mcpSecretEnvMetadataKey as L, ReconnectRetainedInteractiveRunOptions as La, OtelExportConfig as Li, PeerMailKind as Ln, ResourceLimit as Lr, ProviderExecutorOptions as Lt, BridgeModelCredential as M, ExecutorProgress as Ma, EvalRunsExportConfig as Mi, AUTHORITY_MARKERS as Mn, NodeSnapshot as Mr, ExecRequest as Mt, BridgeSeam as N, ScopeProgressInput as Na, EvalRunsExportResult as Ni, DEFAULT_PEER_MAIL_LIMITS as Nn, NodeStatus as Nr, ExecResult as Nt, InboxMessage as O, sandboxSessionTraceSource as Oa, readTraceContextFromEnv as Oi, ToolLoopCompaction as On, MaterializedModelIdentity as Or, CheckpointRef as Ot, KeyProvider as P, WorkerProgress as Pa, INTELLIGENCE_WIRE_VERSION as Pi, PEER_MAIL_WIRE_KEY as Pn, ProfileMaterializationReceipt as Pr, ForkRequest as Pt, HarnessUsage as Q, RetainedInteractiveEnvironmentAdmission as Qa, RuntimeEventCollector as Qi, McpToolDescriptor as Qn, SpawnOpts as Qr, InPlaceHarnessResult as Qt, resolveMcpServerLaunch as R, RecoverRetainedInteractiveRunOptions as Ra, OtelExporter as Ri, PeerMailLimits as Rn, ResourceSpend as Rr, ProviderLeafOut as Rt, SandboxSteeringOptions as S, SessionMessageLike as Sa, workerTraceEnv as Si, parseCodexTokenUsage as Sn, ReservationHolder as So, ExecutorRegistry as Sr, AgentEnvironmentSummary as St, createSteerableSandboxSession as T, TraceSource as Ta, TraceContext as Ti, ToolSpec as Tn, ReservationTicket as To, ExecutorToolCall as Tr, AgentSessionRef as Tt, CodexRolloutSession as U, StartRetainedInteractiveRunOptions as Ua, buildRuntimeEventOtelSpans as Ui, PeerMailbox as Un, RootMaterialization as Ur, createAgentEnvironmentProviderRegistry as Ut, CodexForkBoundary as V, RetainedInteractiveRunHandle as Va, buildLoopOtelSpans as Vi, PeerMailRefusal as Vn, ResumedWork as Vr, SandboxClientProviderOptions as Vt, CodexRolloutStoreReader as W, NativeContextContinuationExecution as Wa, createOpenInferenceFileExporter as Wi, PeerMailboxOptions as Wn, RootProviderModelEvidence as Wr, providerAsExecutor as Wt, harnessUsageIsEmpty as X, RecoverRetainedRunResult as Xa, padTraceId as Xi, JsonRpcMessage as Xn, SpawnEvent as Xr, createTangleSandboxExactProcessProvider as Xt, createCodexRolloutStoreReader as Y, RecoverRetainedRunOptions as Ya, padSpanId as Yi, peerMailVerbNames as Yn, Settled as Yr, SandboxControlClient as Yt, readCodexRolloutSession as Z, RetainedInteractiveAdmission as Za, toOtelAttributes as Zi, JsonRpcResponse as Zn, SpawnJournal as Zr, ProviderPlacement as Zt, cliInPlaceExecutor as _, isWaitOutcome as _a, WorkerTraceEvidence as _i, LocalHarness as _n, BudgetPool as _o, ExecutorExecutionBinding as _r, AgentEnvironmentProvider$1 as _t, StreamAgentTurnOptions as a, createRuntimeEventCollector as aa, SupervisedResult as ai, DiffResult as an, RetainedRunDispatchedAdmission as ao, AgentSpec as ar, assertSandboxServedModel as at, createExecutorRegistry as b, validateWaitSpec as ba, WorkerTraceSeamCarrier as bi, harnessSupportsReasoningEffort as bn, BudgetReconcileFault as bo, ExecutorNodeContext as br, AgentEnvironmentQuery as bt, CliInPlaceSeam as c, sanitizeKnowledgeReadinessReport as ca, TokenUsageProvenance as ci, WorktreeHandle as cn, RetainedRunEventOptions as co, BudgetViolation as cr, extractLlmCallEvent as ct, CliWorktreeSeam as d, WaitOutcome as da, UnknownMaterializationReason as di, removeWorktree as dn, RetainedRunReplayPoint as do, ExecutionBindingReceipt as dr, sandboxEventServedBackend as dt, RuntimeStreamEventSink as ea, SpawnRejection as ei, WorktreeCommandResult as en, RetainedInteractiveStartedAdmission as eo, Redactor as er, SandboxLeafOut as et, ExecutorConfig as f, WaitProbe as fa, UsageEvent as fi, CodexExecutionEvidence as fn, RetainedRunSnapshot as fo, Executor as fr, sandboxProgressEvents as ft, SandboxSeam as g, createWaitProbes as ga, WorkerInteractiveUnavailableReason as gi, LOCAL_HARNESSES as gn, StartRetainedRunOptions as go, ExecutorContext as gr, AgentEnvironmentEvent$1 as gt, RouterToolsSeam as h, WaitSpec as ha, WorkerInteractiveSession as hi, DEFAULT_LOCAL_HARNESS as hn, StartRetainedRunInEnvironmentOptions as ho, ExecutorCancellationRequest as hr, AgentEnvironmentCapabilities$1 as ht, CollectedAgentTurn as i, SanitizedKnowledgeRequirement as ia, SteerableRootHandle as ii, DiffOptions as in, RetainedRunCancellation as io, AgentExecutionRef as ir, SandboxUsageLedger as it, BridgeHarnessStore as j, DEFAULT_STALL_AFTER_MS as ja, EvalRunGeneration as ji, ToolLoopToolCall as jn, NodeId as jr, DEFAULT_SANDBOX_IDLE_TIMEOUT_SECONDS as jt, PeerInboxMessage as k, ActivityLog as ka, traceContextToEnv as ki, ToolLoopCompactionOptions as kn, NoWinnerError as kr, CheckpointRequest as kt, CliSeam as l, sanitizeRuntimeStreamEvent as la, TreeView as li, captureWorktreeDiff as ln, RetainedRunHandle as lo, DefaultVerdict as lr, mapSandboxEvent as lt, RouterSeam as m, WaitRejection as ma, WidenGate as mi, CodexTokenUsage as mn, RetainedRunTurnInput as mo, ExecutorCancellation as mr, AgentEnvironment$1 as mt, AgentTurnInput$1 as n, RuntimeTelemetryOptions as na, SpendChannel as ni, WorktreeProfileMaterializationReceipt as nn, RetainedRunAdmissionHook as no, resolveRedactor as nr, SandboxServedBackend as nt, collectAgentTurn as o, createRuntimeStreamEventCollector as oa, Supervisor as oi, GitRunner as on, RetainedRunEffect as oo, Budget as or, createSandboxToolPartState as ot, ProviderSeam as p, WaitProbeRegistry as pa, WaitOpts as pi, CodexExecutionPolicy as pn, RetainedRunStartMaterial as po, ExecutorAccounting as pr, sumSandboxUsage as pt, CodexStoreDelta as q, ReconnectRetainedRunOptions as qa, generateSpanId as qi, isPeerMailEnvelope as qn, Runtime as qr, sandboxClientAsProvider as qt, AgentTurnUsage as r, SanitizedKnowledgeReadinessReport as ra, SpendGap as ri, CreateWorktreeOptions as rn, RetainedRunCancelOptions as ro, Agent as rr, SandboxToolPartState as rt, streamAgentTurn as s, sanitizeAgentRuntimeEvent as sa, SupervisorOpts as si, RemoveWorktreeOptions as sn, RetainedRunEnvironmentAdmission as so, BudgetOverspend as sr, createSandboxUsageLedger as st, AgentTurnBackend as t, RuntimeStreamEventSummary as ta, Spend as ti, WorktreeHarnessResult as tn, RetainedRunAdmission as to, defaultRedactor as tr, SandboxOutputMarker as tt, CliWorktreeBridgeSeam as u, PendingWait as ua, UnconfirmedTeardown as ui, createWorktree as un, RetainedRunIntentAdmission as uo, EnvironmentTeardownReceipt as ur, mapSandboxToolEvent as ut, cliWorktreeExecutor as v, pollFor as va, WorkerTraceUnavailableReason as vi, LocalHarnessResult as vn, BudgetPoolRestore as vo, ExecutorFactory as vr, AgentEnvironmentProviderRef as vt, SteerableSandboxSession as w, ToolStepInput as wa, workerTraceSeamKey as wi, RouterTransportConfig as wn, ReservationStage as wo, ExecutorTeardownWarning as wr, AgentSession as wt, DEFAULT_SANDBOX_STEERING_MAX_TURNS as x, waitUntil as xa, readWorkerTraceContext as xi, localHarnessExecutable as xn, LeakedReservation as xo, ExecutorProgressEvent as xr, AgentEnvironmentStatus as xt, createExecutor as y, timerAt as ya, WorkerTraceResolver as yi, RunLocalHarnessOptions as yn, BudgetReadout as yo, ExecutorMaterialization as yr, AgentEnvironmentProviderRegistry as yt, resolveSecretEnv as z, RetainedInteractiveAdmissionHook as za, OtelSpan as zi, PeerMailOutcome as zn, ResultBlobStore as zr, ProviderPromptOptions as zt };
|
|
5052
|
+
//# sourceMappingURL=stream-agent-turn-Dy-QleSb.d.ts.map
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { $n as generateSpanId, $r as runtimeOwnedExecutorProviderEvidence, Ai as sleep, At as WORKER_TRACE_PROPAGATION, C as scopeOwnerExecutorNodeContext, Cr as defineProfileMaterializationContract, Dn as registerRetainedExecutorPreparation, Dr as promptModelProfileMaterialization, Dt as newUsageTotals, Er as promptControlProfileMaterialization, Et as meterUsageEvent, F as scopeRetainedOwnerResult, Fi as withTimeout, Fr as worktreeCliProfileMaterialization, Gi as teardownExecutor, Ii as zeroSpend, Jr as providerAttemptEvidence, Li as addResourceSpend, M as prepareScopeRetainedOwnerTask, Mn as runAbortable, N as scopeRetainedOwnerContext, Nr as unsupportedProfileDimensions, On as retainedExecutorSeamKey, P as scopeRetainedOwnerPriorSpend, Pi as unmeteredSpend, Q as captureReusableExecutorConfig, Qr as runtimeOwnedExecutorMaterialization, Ri as resourceTelemetry, S as restoreScopeOwnerAcceptedExecution, Si as addSpend, Sn as resolveAgentEnvironmentProvider, Sr as controlProfileMaterialization, St as contentAddress, Tr as profileMaterializationAxes$1, Ui as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Vr as attestRuntimeOwnedScopeOwner, Wr as inheritRuntimeOwnedExecutorAttestation, Xn as createOtelExporter, Xr as runtimeOwnedDriveHarnessProviderEvidence, Xt as bridgeAdmissionRefusal, Yr as recordRuntimeOwnedDriveHarnessProviderEvidence, Z as bindReusableExecutorExecutionId, Zr as runtimeOwnedExecutorExecutionBinding, Zt as bridgeModelRouteRefusal, b as meterRuntimeOwnedProviderAttempt, d as runDriverWithRetry, ei as runtimeOwnedPendingExecutorMaterialization, f as driverChild, g as beginScopeOwnerAttempt, j as consumeScopeRetainedOwnerResult, jr as renderUnsupported, kn as RunCancellationReason, kt as spendFromUsageTotals, m as isDriverSpec, mn as routerBrain, n as createSupervisor, nn as bridgeRuntimeAttachmentsKey, o as runFinalizer, p as driverExecutorFactory, r as bestDelivered, rn as bridgeStopSignalKey, rr as toOtelAttributes, rt as snapshotExecutorConfig, s as runTree, si as detachedSnapshot, t as createRootHandle, ti as runtimeOwnedScopeOwnerRuntime, tt as createExecutor, u as defaultUnmetContractSteer, v as deriveNodeExecutionIdentity, wr as fullProfileMaterialization, wt as assertValidBudget, x as recordScopeOwnerMaterialization, xr as assertProfileMaterialization, y as meterRuntimeOwnedAccounting, zi as withBudgetResources, zt as createInbox } from "./supervisor-DCQxXRR8.js";
|
|
1
|
+
import { $n as generateSpanId, $r as runtimeOwnedExecutorProviderEvidence, Ai as sleep, At as WORKER_TRACE_PROPAGATION, C as scopeOwnerExecutorNodeContext, Cr as defineProfileMaterializationContract, Dn as registerRetainedExecutorPreparation, Dr as promptModelProfileMaterialization, Dt as newUsageTotals, Er as promptControlProfileMaterialization, Et as meterUsageEvent, F as scopeRetainedOwnerResult, Fi as withTimeout, Fr as worktreeCliProfileMaterialization, Gi as teardownExecutor, Ii as zeroSpend, Ir as isNoEntError, Jr as providerAttemptEvidence, Li as addResourceSpend, Lr as parseCommittedJsonLines, M as prepareScopeRetainedOwnerTask, Mn as runAbortable, N as scopeRetainedOwnerContext, Nr as unsupportedProfileDimensions, On as retainedExecutorSeamKey, P as scopeRetainedOwnerPriorSpend, Pi as unmeteredSpend, Q as captureReusableExecutorConfig, Qr as runtimeOwnedExecutorMaterialization, Ri as resourceTelemetry, Rr as prepareJsonlAppend, S as restoreScopeOwnerAcceptedExecution, Si as addSpend, Sn as resolveAgentEnvironmentProvider, Sr as controlProfileMaterialization, St as contentAddress, Tr as profileMaterializationAxes$1, Ui as DEFAULT_SUCCESSFUL_SHUTDOWN_MS, Vr as attestRuntimeOwnedScopeOwner, Wr as inheritRuntimeOwnedExecutorAttestation, Xn as createOtelExporter, Xr as runtimeOwnedDriveHarnessProviderEvidence, Xt as bridgeAdmissionRefusal, Yr as recordRuntimeOwnedDriveHarnessProviderEvidence, Z as bindReusableExecutorExecutionId, Zr as runtimeOwnedExecutorExecutionBinding, Zt as bridgeModelRouteRefusal, b as meterRuntimeOwnedProviderAttempt, d as runDriverWithRetry, ei as runtimeOwnedPendingExecutorMaterialization, f as driverChild, g as beginScopeOwnerAttempt, j as consumeScopeRetainedOwnerResult, jr as renderUnsupported, kn as RunCancellationReason, kt as spendFromUsageTotals, m as isDriverSpec, mn as routerBrain, n as createSupervisor, nn as bridgeRuntimeAttachmentsKey, o as runFinalizer, p as driverExecutorFactory, r as bestDelivered, rn as bridgeStopSignalKey, rr as toOtelAttributes, rt as snapshotExecutorConfig, s as runTree, si as detachedSnapshot, t as createRootHandle, ti as runtimeOwnedScopeOwnerRuntime, tt as createExecutor, u as defaultUnmetContractSteer, v as deriveNodeExecutionIdentity, wr as fullProfileMaterialization, wt as assertValidBudget, x as recordScopeOwnerMaterialization, xr as assertProfileMaterialization, y as meterRuntimeOwnedAccounting, zi as withBudgetResources, zt as createInbox } from "./supervisor-DCQxXRR8.js";
|
|
2
2
|
import { i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
|
|
3
3
|
import { a as concreteProfileModel, c as profileModelExecutionSettings, d as agentHarness, f as harnessRunsAgent, n as assertModelAllowed, o as enforceTokenLimits, r as assertProfileModelsAllowed, s as profileBridgeWireModel, t as assertExecutableAgentProfile } from "./model-policy-BbSCSak0.js";
|
|
4
4
|
import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
|
|
5
|
+
import { n as assertNoSymlinkDescendant } from "./durable-file-D24y9zg7.js";
|
|
5
6
|
import { t as createStdioToolServer } from "./tool-server-BJbCPhoW.js";
|
|
6
7
|
import { D as coordinationVerbNames, O as createCoordinationTools, S as watchRunCancellation, c as createProgressTracker, d as progressStop, r as driverAgent, v as createFileRunContext, w as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, x as applyRunCancellation, y as createInMemoryRunContext } from "./coordination-driver-DxHQLK8i.js";
|
|
7
8
|
import { k as writeRunCancellation, o as readRunCancelRequest, s as readRunCancellation } from "./run-layout-hZREkcfu.js";
|
|
8
9
|
import { agentProfileSchema, canonicalAgentProfileDigest, canonicalCandidateDigest, canonicalCandidateJson, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
|
|
9
10
|
import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
|
|
11
|
+
import { closeSync, constants, fsyncSync, openSync, writeSync } from "node:fs";
|
|
10
12
|
import { resolve } from "node:path";
|
|
13
|
+
import { mkdir, readFile } from "node:fs/promises";
|
|
11
14
|
import { isMaterializerHarness } from "@tangle-network/agent-profile-materialize";
|
|
12
15
|
import { createServer } from "node:http";
|
|
13
16
|
//#region src/runtime/supervise/completion-gate.ts
|
|
@@ -1084,6 +1087,164 @@ function truncate(value) {
|
|
|
1084
1087
|
return value.length > MAX_DETAIL_CHARS ? `${value.slice(0, MAX_DETAIL_CHARS)}…` : value;
|
|
1085
1088
|
}
|
|
1086
1089
|
//#endregion
|
|
1090
|
+
//#region src/runtime/supervise/root-stream.ts
|
|
1091
|
+
/**
|
|
1092
|
+
* The root manager's own provider stream, retained where Runtime owns it.
|
|
1093
|
+
*
|
|
1094
|
+
* Measured motive (agent-runtime#1233, 2026-09-15): a CHILD's full event stream — reasoning, text,
|
|
1095
|
+
* and tool parts, 28k to 76k reasoning characters per child — is retained in the blob its
|
|
1096
|
+
* `settled` record names as `outRef`. The ROOT's stream reached nobody: `driveHarnessFromBackend`
|
|
1097
|
+
* drained the root executor for accounting and discarded every `progress` event, and on a
|
|
1098
|
+
* `winner` run `result.outRef` is the SELECTED CHILD's artifact, not the root's. A root that died
|
|
1099
|
+
* at its join barrier (fourier-e, 63 children) left a 607-byte `failure.json` and nothing it
|
|
1100
|
+
* thought; the Lab's only transcript of a root was a post-hoc scrape of the harness's own
|
|
1101
|
+
* database.
|
|
1102
|
+
*
|
|
1103
|
+
* `<runDir>/root-stream.jsonl` is the record: one JSONL line per `ExecutorProgressEvent`, written
|
|
1104
|
+
* AS IT ARRIVES, so a root whose process is killed mid-turn keeps every line already written. The
|
|
1105
|
+
* file itself is the evidence; the receipt (`ref`, the content address of the file's bytes, and
|
|
1106
|
+
* `events`, its committed line count) is what `result.json` and `failure.json` carry. The winner's
|
|
1107
|
+
* `outRef` keeps its meaning; this is a separate reference.
|
|
1108
|
+
*
|
|
1109
|
+
* Durability boundary: each line is written synchronously to an `O_APPEND` descriptor before the
|
|
1110
|
+
* next event is drained, and the file is fsynced at every drive-attempt boundary and at close, not
|
|
1111
|
+
* per line. Measured 2026-09-15 on this host's APFS: an fsync per line cost 7.1 ms per event over
|
|
1112
|
+
* 1,000 events and 8.1 ms over 5,000 (~80 s for a root emitting ten thousand text deltas, all of
|
|
1113
|
+
* it serialized inside the drain loop that also meters the budget); an async `FileHandle.write`
|
|
1114
|
+
* still cost 0.9 to 1.1 ms per line in the thread pool the children's journal writes share; a
|
|
1115
|
+
* `writeSync` costs 6 µs. A process kill loses nothing written; only a kernel crash or power
|
|
1116
|
+
* loss can drop lines written since the last fsync, and the reader's torn-tail rule keeps such a
|
|
1117
|
+
* file readable.
|
|
1118
|
+
*
|
|
1119
|
+
* The bridge wire carries text and tool calls only: cli-bridge's SSE frames decode
|
|
1120
|
+
* `delta.content` and `delta.tool_calls`, never a reasoning delta. A bridge-placed root's retained
|
|
1121
|
+
* stream is therefore text plus tool calls; reasoning arrives only on the provider/sandbox path,
|
|
1122
|
+
* which projects `message.part.updated` reasoning parts to `reasoning_delta`.
|
|
1123
|
+
*/
|
|
1124
|
+
/** The root stream: one JSONL line per progress event the root's executor observed. */
|
|
1125
|
+
const ROOT_STREAM_FILE = "root-stream.jsonl";
|
|
1126
|
+
/** Create the writer for `<runDir>/root-stream.jsonl`. Nothing touches disk until the first
|
|
1127
|
+
* `beginAttempt`, so a run whose root never drives leaves no file and no receipt. */
|
|
1128
|
+
function createRootStreamSink(runDir, now) {
|
|
1129
|
+
const dir = resolve(runDir);
|
|
1130
|
+
const path = resolve(dir, ROOT_STREAM_FILE);
|
|
1131
|
+
let fd;
|
|
1132
|
+
let attempt = 0;
|
|
1133
|
+
let seq = 0;
|
|
1134
|
+
let closed = false;
|
|
1135
|
+
const openOnce = async () => {
|
|
1136
|
+
if (fd !== void 0) return;
|
|
1137
|
+
await mkdir(dir, { recursive: true });
|
|
1138
|
+
assertNoSymlinkDescendant(dir, path, "root stream");
|
|
1139
|
+
const needsSeparator = await prepareJsonlAppend(path);
|
|
1140
|
+
seq = (await readRootStream(dir) ?? []).length;
|
|
1141
|
+
fd = openSync(path, constants.O_APPEND | constants.O_CREAT | constants.O_WRONLY | (typeof constants.O_NOFOLLOW === "number" ? constants.O_NOFOLLOW : 0), 384);
|
|
1142
|
+
if (needsSeparator) writeLine(fd, "");
|
|
1143
|
+
};
|
|
1144
|
+
return {
|
|
1145
|
+
async beginAttempt() {
|
|
1146
|
+
if (closed) throw new Error("root stream: beginAttempt after close");
|
|
1147
|
+
attempt += 1;
|
|
1148
|
+
if (fd !== void 0) fsyncSync(fd);
|
|
1149
|
+
await openOnce();
|
|
1150
|
+
},
|
|
1151
|
+
append(event) {
|
|
1152
|
+
if (closed) throw new Error("root stream: append after close");
|
|
1153
|
+
if (fd === void 0) throw new Error("root stream: append before beginAttempt");
|
|
1154
|
+
const at = new Date(now()).toISOString();
|
|
1155
|
+
const record = {
|
|
1156
|
+
seq: seq + 1,
|
|
1157
|
+
at,
|
|
1158
|
+
attempt,
|
|
1159
|
+
event
|
|
1160
|
+
};
|
|
1161
|
+
let line;
|
|
1162
|
+
try {
|
|
1163
|
+
line = JSON.stringify(record);
|
|
1164
|
+
} catch (error) {
|
|
1165
|
+
line = JSON.stringify({
|
|
1166
|
+
seq: seq + 1,
|
|
1167
|
+
at,
|
|
1168
|
+
attempt,
|
|
1169
|
+
dropped: {
|
|
1170
|
+
kind: event.kind,
|
|
1171
|
+
reason: errorMessage(error)
|
|
1172
|
+
}
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
if (line === void 0) line = JSON.stringify({
|
|
1176
|
+
seq: seq + 1,
|
|
1177
|
+
at,
|
|
1178
|
+
attempt,
|
|
1179
|
+
dropped: {
|
|
1180
|
+
kind: event.kind,
|
|
1181
|
+
reason: "event serialized to nothing"
|
|
1182
|
+
}
|
|
1183
|
+
});
|
|
1184
|
+
writeLine(fd, line);
|
|
1185
|
+
seq += 1;
|
|
1186
|
+
},
|
|
1187
|
+
async close() {
|
|
1188
|
+
if (closed) throw new Error("root stream: closed twice");
|
|
1189
|
+
closed = true;
|
|
1190
|
+
if (fd === void 0) return void 0;
|
|
1191
|
+
try {
|
|
1192
|
+
fsyncSync(fd);
|
|
1193
|
+
} finally {
|
|
1194
|
+
closeSync(fd);
|
|
1195
|
+
fd = void 0;
|
|
1196
|
+
}
|
|
1197
|
+
return readRootStreamReceipt(dir);
|
|
1198
|
+
}
|
|
1199
|
+
};
|
|
1200
|
+
}
|
|
1201
|
+
/** `writeSync` may legally make a short write; loop until the whole line and its newline land. */
|
|
1202
|
+
function writeLine(fd, line) {
|
|
1203
|
+
const bytes = Buffer.from(`${line}\n`, "utf8");
|
|
1204
|
+
let offset = 0;
|
|
1205
|
+
while (offset < bytes.byteLength) {
|
|
1206
|
+
const written = writeSync(fd, bytes, offset, bytes.byteLength - offset);
|
|
1207
|
+
if (written <= 0) throw new Error(`root stream: append made no progress at byte ${offset}`);
|
|
1208
|
+
offset += written;
|
|
1209
|
+
}
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* The receipt for the root stream a run directory holds, recomputed from the file's bytes, or
|
|
1213
|
+
* `undefined` when the directory holds none. This is what a run that never settled — a root that
|
|
1214
|
+
* died mid-turn — gets on its failure record, and it equals what `close()` returned for a run
|
|
1215
|
+
* that did.
|
|
1216
|
+
*/
|
|
1217
|
+
async function readRootStreamReceipt(runDir) {
|
|
1218
|
+
const path = resolve(runDir, ROOT_STREAM_FILE);
|
|
1219
|
+
let bytes;
|
|
1220
|
+
try {
|
|
1221
|
+
bytes = await readFile(path);
|
|
1222
|
+
} catch (error) {
|
|
1223
|
+
if (isNoEntError(error)) return void 0;
|
|
1224
|
+
throw error;
|
|
1225
|
+
}
|
|
1226
|
+
return Object.freeze({
|
|
1227
|
+
ref: `sha256:${createHash("sha256").update(bytes).digest("hex")}`,
|
|
1228
|
+
events: parseCommittedJsonLines(bytes.toString("utf8"), path).length
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
/** Every committed line of the root stream, in order, or `undefined` when there is no file. A
|
|
1232
|
+
* torn final line from a process that died mid-write is not a record and is left out. */
|
|
1233
|
+
async function readRootStream(runDir) {
|
|
1234
|
+
const path = resolve(runDir, ROOT_STREAM_FILE);
|
|
1235
|
+
let text;
|
|
1236
|
+
try {
|
|
1237
|
+
text = await readFile(path, "utf8");
|
|
1238
|
+
} catch (error) {
|
|
1239
|
+
if (isNoEntError(error)) return void 0;
|
|
1240
|
+
throw error;
|
|
1241
|
+
}
|
|
1242
|
+
return parseCommittedJsonLines(text, path);
|
|
1243
|
+
}
|
|
1244
|
+
function errorMessage(error) {
|
|
1245
|
+
return error instanceof Error ? error.message : String(error);
|
|
1246
|
+
}
|
|
1247
|
+
//#endregion
|
|
1087
1248
|
//#region src/runtime/supervise/supervisor-agent.ts
|
|
1088
1249
|
/**
|
|
1089
1250
|
* `supervisorAgent` — build a supervisor `Agent` FROM its profile. The brain is resolved from
|
|
@@ -2195,7 +2356,7 @@ async function providerAcceptsCoordinationAttachments(backend) {
|
|
|
2195
2356
|
/** Run a harness-brained manager through the same executor factory as its children. The manager's
|
|
2196
2357
|
* full profile is preserved, the live coordination server is added under one reserved alias, and
|
|
2197
2358
|
* every streamed turn is charged to the manager's scope before it may continue. */
|
|
2198
|
-
function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns) {
|
|
2359
|
+
function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns, rootStream) {
|
|
2199
2360
|
if (maxTurns !== void 0 && maxTurns < 0) throw new ValidationError("driveHarnessFromBackend: maxTurns must be >= 0 (0 lifts the turn cap; bounds become the conserved pool + deadline + abort)");
|
|
2200
2361
|
const turnCap = maxTurns ?? 0;
|
|
2201
2362
|
const boundBackend = bindReusableExecutorExecutionId(captureReusableExecutorConfig(backend, "driveHarnessFromBackend"), executionId);
|
|
@@ -2426,6 +2587,7 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns)
|
|
|
2426
2587
|
if (executor.budgetExempt) throw new ValidationError(`driveHarnessFromBackend: runtime ${JSON.stringify(executor.runtime)} does not report usage and cannot drive a budgeted supervisor`);
|
|
2427
2588
|
started = true;
|
|
2428
2589
|
if (retainedOwner?.admissions.length && !executor.recover) throw new ValidationError("retained owner executor does not support recovery");
|
|
2590
|
+
await rootStream?.beginAttempt();
|
|
2429
2591
|
const run = retainedOwner?.admissions.length ? executor.recover(originalTask, scope.signal) : executor.execute(originalTask, scope.signal);
|
|
2430
2592
|
if (isAsyncIterable(run)) {
|
|
2431
2593
|
let turns = 0;
|
|
@@ -2433,7 +2595,8 @@ function driveHarnessFromBackend(backend, executionId, now = Date.now, maxTurns)
|
|
|
2433
2595
|
await meterPending();
|
|
2434
2596
|
turns += 1;
|
|
2435
2597
|
if (turnStop !== void 0 && turns >= turnCap && !turnStop.signal.aborted) turnStop.abort(`supervise: maxTurns ${turnCap} reached`);
|
|
2436
|
-
} else if (event.kind
|
|
2598
|
+
} else if (event.kind === "progress") rootStream?.append(event.progress);
|
|
2599
|
+
else pendingUsage.push(event);
|
|
2437
2600
|
await meterPending();
|
|
2438
2601
|
const artifact = executor.resultArtifact();
|
|
2439
2602
|
const terminalResources = withBudgetResources({
|
|
@@ -3009,6 +3172,7 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3009
3172
|
const log = ctx.coordinationLog;
|
|
3010
3173
|
const rootOwnerId = rootCoordinationOwner(rootExecution.identity);
|
|
3011
3174
|
const rootProviderModels = [];
|
|
3175
|
+
const rootStreamSink = options.runDir === void 0 ? void 0 : createRootStreamSink(resolve(options.runDir), options.now ?? Date.now);
|
|
3012
3176
|
const observeNodeEvent = options.onCoordinationEvent ? async (context, event, record) => {
|
|
3013
3177
|
await options.onCoordinationEvent?.(context, coordinationEventId(context, event), record);
|
|
3014
3178
|
} : void 0;
|
|
@@ -3044,7 +3208,7 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3044
3208
|
return managerBackend && automaticDriverBackendSupported(managerBackend, options.coordination) ? driveHarnessFromBackend(managerBackend, externalExecutionId("supervised-manager", {
|
|
3045
3209
|
runNamespace,
|
|
3046
3210
|
ownerId: context.ownerId
|
|
3047
|
-
}), options.now ?? Date.now, options.maxTurns) : void 0;
|
|
3211
|
+
}), options.now ?? Date.now, options.maxTurns, context.depth === 0 ? rootStreamSink : void 0) : void 0;
|
|
3048
3212
|
};
|
|
3049
3213
|
const rootDriveHarness = isExternalSupervisor(canonicalProfile) ? driveHarnessForOwner(freezeDetached({
|
|
3050
3214
|
runId,
|
|
@@ -3329,17 +3493,23 @@ function superviseInternal(profile, task, opts, testBrain) {
|
|
|
3329
3493
|
});
|
|
3330
3494
|
const settle = async () => {
|
|
3331
3495
|
let result;
|
|
3496
|
+
let rootStream;
|
|
3332
3497
|
try {
|
|
3333
3498
|
result = await run;
|
|
3334
3499
|
} finally {
|
|
3335
|
-
|
|
3336
|
-
|
|
3500
|
+
try {
|
|
3501
|
+
rootStream = await rootStreamSink?.close();
|
|
3502
|
+
} finally {
|
|
3503
|
+
cancellation?.close();
|
|
3504
|
+
cancellation?.check();
|
|
3505
|
+
}
|
|
3337
3506
|
}
|
|
3338
3507
|
recordRunCancellationOutcome(options.runDir, result, now);
|
|
3339
3508
|
const rootProviderModel = ctx.resume === true ? rootProviderModelEvidence([]) : rootProviderModels.length > 0 ? rootProviderModelEvidence(rootProviderModels) : rootDriveHarness === void 0 ? rootProviderModelEvidence([]) : rootProviderModelEvidenceFromExecution(runtimeOwnedDriveHarnessProviderEvidence(rootDriveHarness));
|
|
3340
3509
|
return {
|
|
3341
3510
|
...result,
|
|
3342
|
-
rootProviderModel
|
|
3511
|
+
rootProviderModel,
|
|
3512
|
+
...rootStream === void 0 ? {} : { rootStream }
|
|
3343
3513
|
};
|
|
3344
3514
|
};
|
|
3345
3515
|
if (!recorder) return settle();
|
|
@@ -3386,6 +3556,6 @@ function rootProviderModelEvidenceFromExecution(evidence) {
|
|
|
3386
3556
|
return evidence ?? rootProviderModelEvidence([]);
|
|
3387
3557
|
}
|
|
3388
3558
|
//#endregion
|
|
3389
|
-
export {
|
|
3559
|
+
export { createSupervisorSpanRecorder as _, isPreSpawnExecutorFailure as a, mapExecutorResult as b, withWorkerSpawnRetry as c, resolveSupervisorProfile as d, supervisorAgent as f, readRootStreamReceipt as g, readRootStream as h, workerFromBackend as i, assertCoordinationBinding as l, ROOT_STREAM_FILE as m, supervise as n, resolveWorkerSpawnRetry as o, supervisorAgentWithTestBrain as p, superviseWithTestBrain as r, retryPreSpawnRefusals as s, DEFAULT_AUTHORED_PROFILE_SECURITY_POLICY as t, coordinationProfileToolPrefix as u, serveCoordinationMcp as v, gateOnDeliverable as y };
|
|
3390
3560
|
|
|
3391
|
-
//# sourceMappingURL=supervise-
|
|
3561
|
+
//# sourceMappingURL=supervise-CtXJ-lWb.js.map
|