@tangle-network/agent-runtime 6.0.7 → 6.0.8

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{activation-DPz8kGpT.d.ts → activation-CWx7I1PU.d.ts} +2 -2
  3. package/dist/{activation-Bb2ovvM5.js → activation-Cwy3_Qn_.js} +2 -2
  4. package/dist/{activation-Bb2ovvM5.js.map → activation-Cwy3_Qn_.js.map} +1 -1
  5. package/dist/agent.d.ts +1 -1
  6. package/dist/agent.js +3 -3
  7. package/dist/{coordination-manager-Cow3jgu1.js → coordination-manager-D9z7To7p.js} +4 -4
  8. package/dist/{coordination-manager-Cow3jgu1.js.map → coordination-manager-D9z7To7p.js.map} +1 -1
  9. package/dist/{delegate-zUOoWutU.js → delegate-ws-KBA2H.js} +2 -2
  10. package/dist/{delegate-zUOoWutU.js.map → delegate-ws-KBA2H.js.map} +1 -1
  11. package/dist/durable.d.ts +1 -1
  12. package/dist/durable.js +9 -9
  13. package/dist/{graph-BS9p0hHV.js → graph-2_nX4ib4.js} +6 -6
  14. package/dist/{graph-BS9p0hHV.js.map → graph-2_nX4ib4.js.map} +1 -1
  15. package/dist/{graph-registry-DbCwfHMY.js → graph-registry-7X2nrreR.js} +2 -2
  16. package/dist/{graph-registry-DbCwfHMY.js.map → graph-registry-7X2nrreR.js.map} +1 -1
  17. package/dist/{graph-registry-C4ASeL2P.js → graph-registry-gYbq4L5Z.js} +1 -1
  18. package/dist/{improve-Ca4PSA2z.js → improve-BxfqTsZy.js} +7 -7
  19. package/dist/{improve-Ca4PSA2z.js.map → improve-BxfqTsZy.js.map} +1 -1
  20. package/dist/index.d.ts +3 -3
  21. package/dist/index.js +9 -9
  22. package/dist/intelligence.d.ts +2 -2
  23. package/dist/intelligence.js +4 -4
  24. package/dist/{jsonl-file-BeUa5EDx.js → jsonl-file-DsxVI0E_.js} +5 -5
  25. package/dist/jsonl-file-DsxVI0E_.js.map +1 -0
  26. package/dist/kernel.d.ts +1 -1
  27. package/dist/kernel.js +13 -13
  28. package/dist/{loop-runner-B_K3oLGC.js → loop-runner-BmGZ4y1W.js} +2 -2
  29. package/dist/{loop-runner-B_K3oLGC.js.map → loop-runner-BmGZ4y1W.js.map} +1 -1
  30. package/dist/{loop-runner-9surW8mg.d.ts → loop-runner-CUMypgRw.d.ts} +2 -2
  31. package/dist/loop-runner-bin.d.ts +1 -1
  32. package/dist/loop-runner-bin.js +1 -1
  33. package/dist/mcp/bin.js +3 -3
  34. package/dist/mcp/index.d.ts +1 -1
  35. package/dist/mcp/index.js +5 -5
  36. package/dist/profiles.d.ts +1 -1
  37. package/dist/{provision-supervisor-ZG-ZxIe9.js → provision-supervisor-CeQTPHRr.js} +4 -4
  38. package/dist/{provision-supervisor-ZG-ZxIe9.js.map → provision-supervisor-CeQTPHRr.js.map} +1 -1
  39. package/dist/{run-cancellation-CqF01-zj.js → run-cancellation-D_4vJ522.js} +3 -3
  40. package/dist/{run-cancellation-CqF01-zj.js.map → run-cancellation-D_4vJ522.js.map} +1 -1
  41. package/dist/{run-state-CeMgqULw.js → run-state-CTZVngI_.js} +24 -18
  42. package/dist/run-state-CTZVngI_.js.map +1 -0
  43. package/dist/{runtime-CBt8PWn5.js → runtime-COm9uBBx.js} +16 -16
  44. package/dist/{runtime-CBt8PWn5.js.map → runtime-COm9uBBx.js.map} +1 -1
  45. package/dist/{scope-BF3RUg3U.js → scope-gIYQ5ZiL.js} +14 -9
  46. package/dist/{scope-BF3RUg3U.js.map → scope-gIYQ5ZiL.js.map} +1 -1
  47. package/dist/{search-executor-CoLgtigZ.js → search-executor-DTEIl58w.js} +3 -3
  48. package/dist/{search-executor-CoLgtigZ.js.map → search-executor-DTEIl58w.js.map} +1 -1
  49. package/dist/{server-Dv_wLT9_.js → server-zO9Nz9Nk.js} +3 -3
  50. package/dist/{server-Dv_wLT9_.js.map → server-zO9Nz9Nk.js.map} +1 -1
  51. package/dist/{settle-record-DTh0cvF-.js → settle-record-U7fkQEZa.js} +2 -2
  52. package/dist/{settle-record-DTh0cvF-.js.map → settle-record-U7fkQEZa.js.map} +1 -1
  53. package/dist/{structural-rollout-ccetqcnq.js → structural-rollout-BwTwTUXF.js} +3 -3
  54. package/dist/{structural-rollout-ccetqcnq.js.map → structural-rollout-BwTwTUXF.js.map} +1 -1
  55. package/dist/{supervise-BMqPWSv7.js → supervise-tmqDU6YT.js} +6 -6
  56. package/dist/{supervise-BMqPWSv7.js.map → supervise-tmqDU6YT.js.map} +1 -1
  57. package/dist/{supervision-discovery-mF3cWh36.js → supervision-discovery-CGbXayGv.js} +3 -3
  58. package/dist/{supervision-discovery-mF3cWh36.js.map → supervision-discovery-CGbXayGv.js.map} +1 -1
  59. package/dist/{supervisor-CigTbS9A.js → supervisor-1A27fE6k.js} +3 -3
  60. package/dist/{supervisor-CigTbS9A.js.map → supervisor-1A27fE6k.js.map} +1 -1
  61. package/dist/testing.d.ts +1 -1
  62. package/dist/testing.js +11 -11
  63. package/dist/{top-web-DBhkr1lN.js → top-web-CS4PD4ck.js} +6 -6
  64. package/dist/{top-web-DBhkr1lN.js.map → top-web-CS4PD4ck.js.map} +1 -1
  65. package/dist/tui/bin.js +3 -3
  66. package/dist/tui/index.d.ts +1 -1
  67. package/dist/tui/index.js +2 -2
  68. package/dist/{types-DmJTtmgm.d.ts → types-w3Oo1uRJ.d.ts} +4 -2
  69. package/package.json +1 -1
  70. package/dist/jsonl-file-BeUa5EDx.js.map +0 -1
  71. package/dist/run-state-CeMgqULw.js.map +0 -1
package/dist/tui/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { S as writeWorkerSteer, c as cancelWorker, v as supervisorRunsRoot } from "../scope-BF3RUg3U.js";
3
- import { n as cancelRun } from "../run-cancellation-CqF01-zj.js";
4
- import { c as numberValue, f as totalSpend, i as aggregateSnapshot, l as parseSpend, n as runTopWeb, s as loadTopSnapshot, u as parseTime } from "../top-web-DBhkr1lN.js";
2
+ import { S as writeWorkerSteer, c as cancelWorker, v as supervisorRunsRoot } from "../scope-gIYQ5ZiL.js";
3
+ import { n as cancelRun } from "../run-cancellation-D_4vJ522.js";
4
+ import { c as numberValue, f as totalSpend, i as aggregateSnapshot, l as parseSpend, n as runTopWeb, s as loadTopSnapshot, u as parseTime } from "../top-web-CS4PD4ck.js";
5
5
  import { randomUUID } from "node:crypto";
6
6
  import { resolve } from "node:path";
7
7
  import { hostname, userInfo } from "node:os";
@@ -1,4 +1,4 @@
1
- import { $b as NodeExecutionIdentity, Hx as HarnessTranscriptEvidence, Ky as Budget, Zy as Spend, _r as provisionSupervisor, eu as PursuitNodeProjection, ex as ProfileMaterializationReceipt, i_ as RouteFlowEvent, iu as PursuitRunProjection, qb as ExecutionBindingReceipt, ru as PursuitProjection, ry as ResultBlobStore, zx as HarnessTranscriptArtifact } from "../types-DmJTtmgm.js";
1
+ import { $b as NodeExecutionIdentity, Hx as HarnessTranscriptEvidence, Ky as Budget, Zy as Spend, _r as provisionSupervisor, eu as PursuitNodeProjection, ex as ProfileMaterializationReceipt, i_ as RouteFlowEvent, iu as PursuitRunProjection, qb as ExecutionBindingReceipt, ru as PursuitProjection, ry as ResultBlobStore, zx as HarnessTranscriptArtifact } from "../types-w3Oo1uRJ.js";
2
2
  import { c as AgentCandidateArtifactPort } from "../workspace-archive-DS9E9tUr.js";
3
3
  type BaselineAuthority = {
4
4
  readonly kind: 'retained-workspace' | 'git-object' | 'git-diff';
package/dist/tui/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as provisionSupervisor } from "../provision-supervisor-ZG-ZxIe9.js";
2
- import { _ as topAgentMetadata, a as buildSupervisorView, d as topSnapshot, g as readTopAgentInspection, h as readTopAgentHistory, m as harnessSessionRows, o as isSpawnEvent, p as createTopAgentStream, r as serveTopWeb, s as loadTopSnapshot, t as TOP_SNAPSHOT_RECONCILE_MS, v as topAgentWorker } from "../top-web-DBhkr1lN.js";
1
+ import { t as provisionSupervisor } from "../provision-supervisor-CeQTPHRr.js";
2
+ import { _ as topAgentMetadata, a as buildSupervisorView, d as topSnapshot, g as readTopAgentInspection, h as readTopAgentHistory, m as harnessSessionRows, o as isSpawnEvent, p as createTopAgentStream, r as serveTopWeb, s as loadTopSnapshot, t as TOP_SNAPSHOT_RECONCILE_MS, v as topAgentWorker } from "../top-web-CS4PD4ck.js";
3
3
  export { TOP_SNAPSHOT_RECONCILE_MS, createTopAgentStream, harnessSessionRows, isSpawnEvent as isTopJournalEvent, loadTopSnapshot, topSnapshot as projectTopSnapshot, buildSupervisorView as projectTopSupervisor, provisionSupervisor, readTopAgentHistory, readTopAgentInspection, serveTopWeb, topAgentMetadata, topAgentWorker };
@@ -5213,6 +5213,8 @@ type SpawnJournalReadRecord = {
5213
5213
  readonly event: SpawnEvent;
5214
5214
  };
5215
5215
  interface SpawnJournalReadOptions {
5216
+ /** Read-only projections may skip malformed physical rows; execution readers stay strict. */
5217
+ readonly invalid?: 'throw' | 'skip';
5216
5218
  readonly after?: SpawnJournalCursor;
5217
5219
  /** Initial opening-and-tail window, or an incremental page's byte budget. A crossing record
5218
5220
  * is read whole, so one large record can exceed this budget. Omit for complete history. */
@@ -5230,7 +5232,7 @@ interface SpawnJournalReadResult {
5230
5232
  readonly remainingBytes: number;
5231
5233
  }
5232
5234
  /** Read a fixed journal prefix, with historical envelopes and framing owned by Runtime.
5233
- * Missing journals return an empty page. Malformed committed records fail; incomplete final
5235
+ * Missing journals return an empty page. Malformed committed records fail by default; incomplete final
5234
5236
  * writes remain unread for the next call. Cursors detect replacement, truncation and edits at
5235
5237
  * their sampled opening/boundary; they are not integrity proofs against arbitrary file edits.
5236
5238
  */
@@ -19623,4 +19625,4 @@ interface KnowledgeReadinessDecision {
19623
19625
  nonBlockingGapIds: string[];
19624
19626
  }
19625
19627
  export { AgentEnvironmentStatus as $, startRuntimeRun as $S, McpToolAnnotations as $_, startRetainedRunInEnvironment as $a, NodeExecutionIdentity as $b, ShapeContext as $c, FinalizeContext as $d, CliWorktreeBridgeSeam as $f, DecideGate as $g, HarnessUsage as $h, StructuralRolloutResult as $i, PursuitNodePlatform as $l, DelegationResultPayload as $m, safeWorkerFile as $n, SuperviseOptionsForDispatch as $o, SandboxUsageLedger as $p, graphDigest as $r, HarvestFailure as $s, settledWorkerOut as $t, createInMemoryRunContext as $u, readRunCancelRequest as $v, HarnessFileBinding as $x, SpendGap as $y, DriverContinuationRecord as A, RetainedRunIntentAdmission as AC, LoopResult as AS, MapItemFailurePolicy as A_, Deliverable as Aa, BudgetPoolRestore as Ab, ScopeAnalyzeInput as Ac, SupervisorAgentDeps as Ad, ResolveSpawnResourcePathsResult as Af, bestSoFar as Ag, ExecutorResultMapping as Ah, ChatWorkerSeamOptions as Ai, IsolatedCheckOutputFailure as Al, runDetachedTurn as Am, SearchSpecOwnedOption as An, RegistryAnalyzeProjection as Ao, ProviderExecutorOptions as Ap, workerFromInteractiveProvider as Ar, StrategyShotResult as As, boxSurfaceReader as At, PursuitFork as Au, openSqlRunStore as Av, readWorkerProgress as Ax, RuntimeStreamEventSink as Ay, PeerAuditAccess as B, OutputAdapter as BS, PeerMailOutcome as B_, createSandboxLineage as Ba, createBudgetPool as Bb, WidenLineage as Bc, PlateauOptions as Bd, EventSubscription as Bf, WorktreeCheckRunner as Bg, sentinelCompletion as Bh, profileRichnessFinding as Bi, VersionJudge as Bl, SubmitOutput as Bm, TraceRootArtifact as Bn, BenchmarkCell as Bo, ResolvedMcpServerLaunch as Bp, LoadGraphFileOptions as Br, Strategy as Bs, WorktreePatchArtifact as Bt, SuperviseRegistry as Bu, FileResultBlobStore as Bv, HarnessTranscriptBinding as Bx, createWorkerSlots as By, RuntimeFailureCause as C, RetainedRunCancelOptions as CC, LoopEndedPayload as CS, ContinuationInstruction as C_, EvolutionStrategy as Ca, Scope as Cb, Panel as Cc, CoordinationToolFace as Cd, ContinuationProfile as Cf, renderLeaderboardSvg as Cg, FileDelegationStoreOptions as Ch, DelegateOptions as Ci, IsolatedCheckBox as Cl, FleetHandle as Cm, FencedSqlRunContext as Cn, loopUntil as Co, ROUTER_CLIENT_HEADER as Cp, profileRegistry as Cr, AgenticSurface as Cs, BoxSurfaceReaderOptions as Ct, TraversalContinuity as Cu, RunLocalHarnessOptions as Cv, ActivityNote as Cx, OtelExporter as Cy, RetainedPendingCause as D, RetainedRunEnvironmentAdmission as DC, LoopLineageOptions as DS, DownMessageDeliveryOutcome as D_, TournamentRow as Da, WorkerEventEntry as Db, PipelineStage as Dc, ObserveSupervisorNodeEvent as Dd, DriverContractState as Df, AnytimeTaskCurve as Dg, CheckVerdict as Dh, ChatSessionStore as Di, runIsolatedCheck as Dl, createSiblingSandboxExecutor as Dm, SEARCH_SPEC_CORRELATION_KEY as Dn, verify as Do, AgentEnvironmentProviderRegistry as Dp, InteractiveWorkerKeyInput as Dr, CorpusReadbackOptions as Ds, SurfaceReadOutcome as Dt, GraphFromStoredOptions as Du, CodexTokenUsage as Dv, TeamProgress as Dx, loopEventToOtelSpan as Dy, EvidencePendingEvent as E, RetainedRunEffect as EC, LoopIterationStartedPayload as ES, DownMessageDeliveryAttempt as E_, TournamentCell as Ea, WorkerEventCursor as Eb, PanelVerdict as Ec, DriveHarnessOwnerContext as Ed, admitContinuationPolicy as Ef, AnytimeStrategySummary as Eg, CheckUnavailableError as Eh, ChatCompletionsTransport as Ei, IsolatedCheckResult as El, createFleetWorkspaceExecutor as Em, CompiledSearchSpec as En, selectValidWinner as Eo, AgentEnvironmentProviderRef as Ep, InteractiveWorkerEnvironment as Er, ArtifactHandle as Es, SurfaceReadBox as Et, GraphCommandCheck as Eu, LocalHarness as Ev, ScopeProgressInput as Ex, createOtelExporter as Ey, CoordinationTools as F, StartRetainedRunInEnvironmentOptions as FC, LoopTraceEmitter as FS, DEFAULT_PEER_MAIL_LIMITS as F_, SandboxRunAbortError as Fa, ReservationRejection as Fb, TrajectoryReportOptions as Fc, SupervisorToolInvocationContext as Fd, environmentReader as Ff, WaterfallSpan as Fg, CompletionEvidence as Fh, ProfileRichness as Fi, NextPursuitVersionInput as Fl, DelegationResumeTick as Fm, settledToIteration as Fn, observationFromRegistry as Fo, ProviderPlacement as Fp, graphFromSessionFacts as Fr, runAgentic as Fs, failuresAnalyst as Ft, workerFromBackend as Fu, SpawnForestInDoubtNode as Fv, RetainedInteractiveRunHandle as Fx, createRuntimeEventCollector as Fy, SpawnRefusalCause as G, Validator as GS, PeerMailboxOptions as G_, S3PrivateCasStoreOptions as Ga, SpawnModelSubstitution as Gb, LoopShape as Gc, anyOf as Gd, DelegateHandlerOptions as Gf, AwaitWakeInput as Gg, CodexRolloutStoreReader as Gh, CheckRunContext as Gi, SupervisePursuitOptions as Gl, DelegateUiAuditArgs as Gm, WorkerSteerAcknowledgement as Gn, BenchmarkTaskRow as Go, secretEnvOfMcpServer as Gp, GraphRegistryDir as Gr, assertStrategyContract as Gs, attachWorker as Gt, SeatStage as Gu, SpawnJournalReadResult as Gv, HarnessTranscriptUnavailableReason as Gx, readRunParking as Gy, SpawnPreflight as H, SandboxClient as HS, PeerMailRefusal as H_, AcquireOptions as Ha, ExecutorContext as Hb, WinnerStrategy as Hc, StopDecision as Hd, McpEventRecord as Hf, WorktreeHarnessResult as Hg, CodexForkBoundary as Hh, RunCancellationReason as Hi, assertPursuitVersions as Hl, DelegateCodeConfig as Hm, RunTraceSources as Hn, BenchmarkLift as Ho, mcpSecretEnvMetadataKey as Hp, loadGraphFile as Hr, StrategyCtx as Hs, AttachWorkerOptions as Ht, SeatSegment as Hu, SpawnJournalCursor as Hv, HarnessTranscriptEvidence as Hx, RunParkedError as Hy, CoordinationToolsOptions as I, StartRetainedRunOptions as IC, LoopTraceEvent as IS, PEER_MAIL_WIRE_KEY as I_, TurnResult as Ia, ReservationShortfall as Ib, Verify as Ic, ManagerWakePolicy as Id, resolveSpawnResourcePaths as If, createWaterfallCollector as Ig, CompletionPolicy as Ih, ProfileRichnessThresholds as Ii, PursuitVersionChain as Il, DelegationRunContext as Im, createScope as In, McpEndpoint as Io, BridgeHarnessStore as Ip, graphFileSchema as Ir, sample as Is, AuthoredHarness as It, AuthorizedSpawn as Iu, SpawnForestMissingTree as Iv, RetainedInteractiveStartMaterial as Ix, createRuntimeStreamEventCollector as Iy, AgentEnvironment$1 as J, RuntimeRunHandle as JS, isPeerMailEnvelope as J_, PrivateCasNamespaceObject as Ja, ExecutorExecutionBinding as Jb, PersonaContext as Jc, ReentryContinuity as Jd, createExecutorRegistry as Jf, LeadMessage as Jg, CodexStoreDelta as Jh, CheckSourceCtx as Ji, supervisePursuit as Jl, DelegationError as Jm, cancelWorker as Jn, runBenchmark as Jo, SandboxToolPartState as Jp, GraphSelection as Jr, sampleThenRefine as Js, NOTE_MAX_CHARS as Jt, InMemoryRunContext as Ju, RunState as Jv, captureHarnessTranscript as Jx, BudgetViolation as Jy, SuperviseProfileEntry as K, RuntimeRunCompleteInput as KS, claimsAuthority as K_, createS3PrivateCasStore as Ka, AgentExecutionRef as Kb, Outcome as Kc, noProgressFor as Kd, DelegateResult as Kf, CoordinationEvent as Kg, CodexRolloutStoreRef as Kh, CheckRunner as Ki, SupervisedPursuitResult as Kl, DelegateUiAuditConfig as Km, WorkerSteerRequest as Kn, Environment as Ko, SandboxLeafOut as Kp, GraphRunQuery as Kr, authorStrategy as Ks, readWorkerInteractiveBinding as Kt, SelectSeat as Ku, readSpawnJournal as Kv, ReadableEnvironment as Kx, Budget as Ky, GraphSubtaskPreparation as L, LoopWinner as LS, PeerMailEnvelope as L_, openSandboxRun as La, ReservationStage as Lb, VerifySpec as Lc, SupervisorProfile as Ld, McpServer as Lf, RunAgentRoundsOptions as Lg, CompletionVerdict as Lh, asAuthoredProfile as Li, PursuitVersionStop as Ll, DelegationTaskQueue as Lm, ScopeArgs as Ln, McpEnvironmentOptions as Lo, BridgeModelCredential as Lp, graphRouteWhenSchema as Lr, AuthorStrategyOptions as Ls, WorktreeFanoutOptions as Lt, AuthorizedSpawnContext as Lu, SpawnForestNode as Lv, StartRetainedInteractiveRunOptions as Lx, sanitizeKnowledgeReadinessReport as Ly, DriverRepromptRefusal as M, RetainedRunSnapshot as MC, LoopStartedPayload as MS, MapSpawnMarker as M_, OpenSandboxRunOptions as Ma, LeakedReservation as Mb, SteerContext as Mc, SupervisorNodeContext as Md, SpawnResourceBytes as Mf, renderAnytimeTable as Mg, mapExecutorResult as Mh, chatWorkerSeam as Mi, validateIsolatedCheckOutputs as Ml, DelegationRecord as Mm, compileSearchSpec as Mn, buildSteerContext as Mo, ProviderPromptOptions as Mp, createInPlaceCliExecutor as Mr, breadthStrategy as Ms, harvestSurfaceDiffs as Mt, supervise as Mu, materializeTreeView as Mv, RecoverRetainedInteractiveRunOptions as Mx, RuntimeTelemetryOptions as My, BlockedToolReport as N, RetainedRunStartMaterial as NC, LoopTeardownFailedPayload as NS, MapTraversalEvent as N_, OpenSandboxRunPromptOptions as Na, ReservationFloor as Nb, TrajectoryNode as Nc, SupervisorNodeContextSeed as Nd, SpawnResourceRead as Nf, WaterfallCollector as Ng, verdictFromJudgeScore as Nh, createChatSessionStore as Ni, JudgedPursuitVersion as Nl, DelegationResumeContext as Nm, searchPresets as Nn, createScopeAnalyst as No, providerAsExecutor as Np, GraphSessionObservationOptions as Nr, depthStrategy as Ns, AnalystAuthoring as Nt, superviseFleetCapabilities as Nu, SpawnForest as Nv, RetainedInteractiveAdmissionHook as Nx, SanitizedKnowledgeReadinessReport as Ny, DriverAttemptRecord as O, RetainedRunEventOptions as OC, LoopPlanDescription as OS, DownMessageEvent as O_, runStrategyEvolution as Oa, WorkerEventPage as Ob, RenderCorpusToInstructionsOptions as Oc, ResolveDriveHarness as Od, DriverReentry as Of, anytimeReport as Og, CompletionCheckContext as Oh, ChatTransportExecutorOptions as Oi, IsolatedCheckOutputDeclaration as Ol, DetachedTurn as Om, SearchSpec as On, widen as Oo, createAgentEnvironmentProviderRegistry as Op, InteractiveWorkerOptions as Or, RunAgenticOptions as Os, SurfaceReader as Ot, defaultEdgeTraversalCap as Ou, CodexExecutionPolicy as Ov, WorkerProgress as Ox, RuntimeEventCollector as Oy, CoordinationStats as P, RetainedRunTurnInput as PC, LoopTokenUsage as PS, AUTHORITY_MARKERS as P_, SandboxRun as Pa, ReservationHolder as Pb, TrajectoryReport as Pc, SupervisorToolDescriptor as Pd, SpawnResourceReader as Pf, WaterfallReport as Pg, CompletionAnalyst as Ph, AuthoredProfile as Pi, NextPursuitVersion as Pl, DelegationResumeDriver as Pm, searchSpecDigest as Pn, registryScopeAnalyst as Po, UnavailablePausePolicy as Pp, ObservedSessionFacts as Pr, refine as Ps, analystsFromRegistry as Pt, superviseWithTestBrain as Pu, SpawnForestEvent as Pv, RetainedInteractiveEnvironmentInput as Px, SanitizedKnowledgeRequirement as Py, AgentEnvironmentQuery as Q, RuntimeRunStatus as QS, JsonRpcResponse as Q_, startRetainedRun as Qa, MaterializedModelIdentity as Qb, ShapeBudget as Qc, DeliveredOutput as Qd, CliSeam as Qf, WorkerWatchOptions as Qg, readCodexRolloutSession as Qh, StructuralRolloutPolicy as Qi, PursuitNodeCost as Ql, DelegationProgress as Qm, readWorkerSteerRequests as Qn, SuperviseDispatchOptions as Qo, SandboxServedBackend as Qp, graphCorpusSummary as Qr, HarvestError as Qs, composeWorkerEvidence as Qt, createFileRunContext as Qu, cancelRun as Qv, HARNESS_TRANSCRIPT_READ_LIMITS as Qx, SpendChannel as Qy, GraphSubtasks as R, MountManifestEntry as RS, PeerMailEvent as R_, SandboxLineage as Ra, ReservationTicket as Rb, Widen as Rc, AllWorkersStalledOptions as Rd, McpServerOptions as Rf, runAgentRounds as Rg, completionAuthorizes as Rh, assessAuthoredProfile as Ri, PursuitVersions as Rl, DelegationTaskQueueOptions as Rm, TRACE_ROOT_SCHEMA as Rn, createMcpEnvironment as Ro, BridgeSeam as Rp, GraphFileResolutionError as Rr, AuthoredStrategy as Rs, worktreeFanout as Rt, SuperviseOptions as Ru, SpawnForestTree as Rv, HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS as Rx, DeadlineCheckIn as Ry, RuntimeStreamEvent as S, RetainedRunAdmissionHook as SC, LoopDecisionPayload as SS, AuthorizedDownMessage as S_, EvolutionReport as Sa, ResumedWork as Sb, LoopUntilState as Sc, supervisorAgentWithTestBrain as Sd, ContinuationPolicy as Sf, renderLeaderboardMarkdown as Sg, FileDelegationStore as Sh, graphDesignerExtraTools as Si, readDeclaredCheck as Sl, DelegationExecutor as Sm, validateStoredGraph as Sn, flatWidenGate as So, sharedBoxPlacement as Sp, pickBestProfile as Sr, AgenticRunResult as Ss, createVerifierEnvironment as St, RunGraphTestOptions as Su, LocalHarnessResult as Sv, ActivityLog as Sx, OtelExportStats as Sy, RuntimeFailureOwner as T, RetainedRunDispatchedAdmission as TC, LoopIterationEndedPayload as TS, DownMessageAuthorizationInput as T_, StrategyTournament as Ta, WidenGate as Tb, PanelSpec as Tc, DriveHarness as Td, VerdictSummary as Tf, AnytimeReport as Tg, CoderTask as Th, delegate as Ti, IsolatedCheckOptions as Tl, SiblingSandboxExecutorOptions as Tm, createFencedSqlRunContext as Tn, pipeline as To, sharedWorkerClientName as Tp, recordProfileRun as Tr, AgenticTool as Ts, SurfaceDiff as Tt, runGraphWithTestBrain as Tu, LOCAL_HARNESSES as Tv, ExecutorProgress as Tx, buildLoopOtelSpans as Ty, SpawnPreflightContext as U, SelectionReceipt as US, PeerMailSendInput as U_, acquireSandbox as Ua, ExecutorFactory as Ub, DefinePersona as Uc, StopRule as Ud, McpEventSource as Uf, WorktreeProfileMaterializationReceipt as Ug, CodexRolloutIdentity as Uh, CheckExecChannel as Ui, SuperviseGraphPursuitOptions as Ul, DelegateResearchArgs as Um, runToolSpans as Un, BenchmarkReport as Uo, resolveMcpServerLaunch as Up, GraphCorpusGroup as Ur, StrategyResult as Us, WorkerInteractiveBinding as Ut, SeatSelection as Uu, SpawnJournalReadOptions as Uv, HarnessTranscriptFile as Ux, RunParkingPolicy as Uy, SettledWorker as V, RunProvenance as VS, PeerMailReadout as V_, SandboxEvidenceReceipt as Va, AgentSpec as Vb, WidenSpec as Vc, ProgressView as Vd, EventSubscriptionStore as Vf, WorktreeCommandResult as Vg, stopSentinel as Vh, supervisorInstructions as Vi, VersionVerdict as Vl, DelegateCodeArgs as Vm, TraceSummary as Vn, BenchmarkConfig as Vo, envKeyProvider as Vp, LoadedGraphFile as Vr, StrategyArtifacts as Vs, createWorktreeCliExecutor as Vt, SuperviseRegistryTable as Vu, replaySpawnTree as Vv, HarnessTranscriptCapture as Vx, ParkedRun as Vy, SpawnRefusal as W, ValidationCtx as WS, PeerMailbox as W_, S3PrivateCasStore as Wa, ExecutorRegistry as Wb, DefinePersonaInput as Wc, allWorkersStalled as Wd, DelegateError as Wf, GitRunner as Wg, CodexRolloutSession as Wh, CheckOutcome as Wi, SupervisePursuitError as Wl, DelegateResearchConfig as Wm, WorkerCancellation as Wn, BenchmarkStrategySummary as Wo, resolveSecretEnv as Wp, GraphCorpusSummary as Wr, adaptiveRefine as Ws, WorkerInteractiveProviderSource as Wt, SeatSelectionInput as Wu, SpawnJournalReadRecord as Wv, HarnessTranscriptUnavailable as Wx, RunParkingRecord as Wy, AgentEnvironmentEvent$1 as X, RuntimeRunPersistenceAdapter as XS, peerMailVerbNames as X_, reconnectRetainedRun as Xa, ExecutorNodeContext as Xb, RunPersonified as Xc, UNPROVEN_CONTINUITY as Xd, createExecutor as Xf, ManagerWake as Xg, createCodexRolloutStoreReader as Xh, StructuralRolloutConfig as Xi, PursuitObserverDelivery as Xl, DelegationHistoryArgs as Xm, readWorkerCancellation as Xn, LoopDispatchOptions as Xo, mapSandboxEvent as Xp, StoredGraphInput as Xr, strategyAuthorSystemPrompt as Xs, WorkerEvidenceInput as Xt, RunContext as Xu, RunCancelRequest as Xv, persistHarnessTranscript as Xx, ResourceSpend as Xy, AgentEnvironmentCapabilities$1 as Y, RuntimeRunOptions as YS, peerMailTools as Y_, PrivateCasNamespaceRetirement as Ya, ExecutorMaterialization as Yb, PersonaExecutors as Yc, ReentryTaskInput as Yd, ExecutorConfig as Yf, ManagerReentryState as Yg, addHarnessUsage as Yh, RepairStop as Yi, RunReopen as Yl, DelegationFeedbackSnapshot as Ym, legacySupervisorRunDir as Yn, LoopCampaignDispatchOptions as Yo, createSandboxToolPartState as Yp, StoredGraph as Yr, strategyAuthorContract as Ys, VERIFY_TAIL_CHARS as Yt, InMemoryRunContextOptions as Yu, readRunState as Yv, harnessTranscriptArtifact as Yx, ResourceLimit as Yy, AgentEnvironmentProvider$1 as Z, RuntimeRunRow as ZS, JsonRpcMessage as Z_, recoverRetainedRun as Za, MaterializedExecutionIdentity as Zb, RunPersonifiedOptions as Zc, composeReentryTask as Zd, CliInPlaceSeam as Zf, ToolOutcomeEvent as Zg, harnessUsageIsEmpty as Zh, StructuralRolloutMessage as Zi, PursuitCostProvenance as Zl, DelegationHistoryEntry as Zm, readWorkerSteerAcknowledgement as Zn, LoopOptionsForDispatch as Zo, mapSandboxToolEvent as Zp, digestOfGraph as Zr, HarvestCorpusOptions as Zs, closingWorkerNote as Zt, RunContextLease as Zu, RunCancellation as Zv, BoundHarnessSession as Zx, Spend as Zy, RunAgentTaskOptions as _, RetainedInteractiveAdmission as _C, AgentRunSpec as _S, QuestionPolicy as __, CollectedAgentTurn as _a, RootStreamReceipt as _b, EqualKVerdict as _c, createSupervisorSpanRecorder as _d, ContinuationAppend as _f, ProfileKeyOf as _g, researcherProfile as _h, queueOf as _i, assertDeclaredCheck as _l, DelegateRunCtx as _m, parseWorkerToolTraceArtifact as _n, runPersonified as _o, SharedBoxCloseReceipt as _p, provisionSupervisor as _r, StdioMcpConnection as _s, SandboxInstance$1 as _t, GraphEdgeCapError as _u, AnalyzeOnSettleRoute as _v, WorkerTraceUnavailableReason as _x, TraceContext as _y, AgentKnowledgeProvider as a, BackendTransportError as aC, readBoundHarnessSessions as aS, RouteGate as a_, defaultStructuralRolloutPolicy as aa, Settled as ab, ObserveInput as ac, createPromptRegistry as ad, CoordinationMcpHandle as af, CodeModeToolset as ag, UiAuditLensFilter as ah, lookupGraph as ai, LeaderboardBenchTask as al, ToolSpec as am, GitWorkspaceOptions as an, ResolveSandboxClientOptions as ao, DEFAULT_SANDBOX_STEERING_MAX_TURNS as ap, RemoteSupervisorCancelResult as ar, TerminalDecision as as, AgentTurnResult$2 as at, PursuitRunTotals as au, EventBus as av, ExecutorAccounting as ax, SpawnJournal as ay, RuntimeSession as b, RetainedInteractiveStartedAdmission as bC, ExecCtx as bS, questionEscalationTargets as b_, streamAgentTurn as ba, ReenteredWorkers as bb, FanoutWinnerSelector as bc, readRootStreamReceipt as bd, ContinuationPanelInput as bf, pairwiseSignificance as bg, DelegationPersistenceError as bh, DesignerToolsEnv as bi, declaredCheckDigest as bl, UiAuditorDelegate as bm, createRootHandle as bn, renderCorpusToInstructions as bo, SharedBoxStats as bp, bestProfileFor as br, materializeLocalMcp as bs, makeFinding$1 as bt, GraphTopology as bu, DefinedAnalystRecord as bv, TraceSource as bx, OtelAttribute as by, AgentTaskContext as c, NotFoundError as cC, ProviderWorkspaceAttemptProvenance as cS, ChildQuestionInbox as c_, officialChecksFromMeta as ca, SpawnRejection as cb, observe as cc, dumbContinuationPassPrompt as cd, CoordinationTransportOptions as cf, runCodeMode as cg, UiFindingScreenshot as ch, recordStoredGraphRun as ci, LeaderboardIterationInfo as cl, ToolLoopCompaction as cm, WorkspaceCommit as cn, profileOptimizerModelCall as co, SteerableSandboxSession as cp, RemoteSupervisorSteerResult as cr, InProcessOnPrompt as cs, CheckpointRequest as ct, FileObserverJournal as cu, WatchTraceOptions as cv, ExecutorResult as cx, RecursiveReservationPolicy as cy, AgentTaskStatus as d, NativeContextContinuationHandle as dC, ProviderWorkspaceCaptureResult as dS, QuestionDecision as d_, selectBestIndex as da, TreeView as db, CombinatorShape as dc, naiveContinuationPrompt as dd, CoordinationRejectReason as df, Interval as dg, KnowledgeItem as dh, GraphTriggerBinding as di, LeaderboardScore as dl, ToolLoopToolCall as dm, jjWorkspace as dn, PrivateCasOffloadReport as do, Inbox as dp, connectRemoteSupervisor as dr, inProcessSandboxClient as ds, ExecRequest as dt, ObserverRecordKind as du, AnalystAssignmentRecord as dv, HeldForContinuation as dx, RootSegmentEntry as dy, contentAddress as eC, HarnessTranscriptMetadata as eS, GateDecision as e_, VisibleCheck as ea, Handle as eb, HarvestReport as ec, withRunContext as ed, FinalizerSettled as ef, decodeHarnessUsage as eg, DelegationStatus as eh, graphFromStored as ei, ShapeRegistry as el, extractLlmCallEvent as em, spendFromUsageEvents as en, ClaimRetainedInteractiveControlOptions as eo, CliWorktreeSeam as ep, supervisorRunDir as er, loopCampaignDispatch as es, AgentEnvironmentSummary as et, PursuitNodeProjection as eu, McpToolDescriptor as ev, ProfileMaterializationReceipt as ex, readRunCancellation as ey, BackendErrorDetail as f, NativeContextContinuationInput as fC, ProviderWorkspaceEntryMetadata as fS, QuestionEscalationOutcome as f_, structuralRollout as fa, FleetYield as fb, Corpus as fc, promptHandle as fd, CoordinationDeliveryEvidence as ff, Leaderboard as fg, KnowledgeUpdate as fh, DispatchReport as fi, LeaderboardSpec as fl, FeedbackEvent as fm, localShell as fn, PrivateCasOptions as fo, InboxLease as fp, connectRemoteSupervisorControl as fr, HttpMcpServerSpec as fs, ExecResult as ft, observerRecordDigest as fu, AnalystFindingEvent as fv, HeldRelease as fx, RootSignal as fy, OpenAIChatToolChoice as g, RecoverRetainedRunResult as gC, UsageEvent as gS, QuestionOption as g_, AgentTurnUsage as ga, RootProviderModelEvidence as gb, EqualKOnCostOptions as gc, SupervisorSpanRecorder as gd, CheckRead as gf, PairwiseVerdict as gg, ResearcherProfileOptions as gh, freeSlots as gi, DeclaredCheckStateCapture as gl, CoderReviewer as gm, WorkerToolTraceArtifact as gn, definePersona as go, DEFAULT_SHARED_BOX_WORKERS as gp, SupervisorCleanupReceipt as gr, McpSpawnFault as gs, SandboxEvent$1 as gt, GraphEdge as gu, AnalystRunContext as gv, WorkerTraceEvidence as gx, WorkerTraceResolver as gy, OpenAIChatTool as h, RecoverRetainedRunOptions as hC, TokenUsageProvenance as hS, QuestionLevel as h_, AgentTurnInput$1 as ha, ProviderModelExecutionEvidence as hb, EqualKArm as hc, SupervisorSpanOutcome as hd, PriorCoordination as hf, PairwiseOptions as hg, ResearchTask as hh, RollingDispatchOptions as hi, DeclaredCheckPlacement as hl, CoderReview as hm, analyzeTrace as hn, trajectoryReport as ho, DEFAULT_SHARED_BOX_RESOURCES as hp, ProvisionedSupervisor as hr, McpListedTool as hs, ResourceRequest as ht, EdgeTraversal as hu, AnalystRegistry$1 as hv, WorkerInteractiveUnavailableReason as hx, SupervisorOpts as hy, AgentExecutionBackend as i, AgentEvalErrorCode as iC, RetainedHarnessTranscriptDescriptor as iS, RouteFlowEvent as i_, defaultExtractCandidate as ia, RetainedExecutionState as ib, ObservationError as ic, analyzesFindingsReportPrompt as id, CoordinationControlAccess as if, CodeModeToolsOptions as ig, ResearchOutputShape as ih, loadGraph as ii, LeaderboardBenchScore as il, RouterRouting as im, withUntrackedArtifacts as in, startRetainedInteractiveRun as io, SandboxSeam as ip, RemoteSupervisorAgent as ir, TERMINAL_DECISIONS as is, AgentSessionStatus$1 as it, PursuitRunProjection as iu, BusStats as iv, Executor as ix, SpawnEvent as iy, DriverFailureClass as j, RetainedRunReplayPoint as jC, LoopSandboxPlacement as jS, MapOnSettleRoute as j_, OpenSandboxRunBeforeStartContext as ja, BudgetReadout as jb, ScopeWidenGate as jc, SupervisorAgentTestDeps as jd, ResolvedSpawnResourcePath as jf, plateauLength as jg, gateOnDeliverable as jh, chatTransportExecutor as ji, IsolatedCheckOutputOptions as jl, DelegationArgs as jm, assertSearchSpec as jn, assertTraceDerivedFindings as jo, ProviderLeafOut as jp, InPlaceCliExecutorOptions as jr, SurfaceScore as js, fsSurfaceReader as jt, RUN_FORK_CORRELATION_KEYS as ju, SqlAdapter as jv, ReconnectRetainedInteractiveRunOptions as jx, RuntimeStreamEventSummary as jy, DriverAttemptStop as k, RetainedRunHandle as kC, LoopPlanPayload as kS, WorkerResumeContext as k_, strategyTournament as ka, BudgetPool as kb, ScopeAnalyst as kc, ResolveSupervisorTools as kd, DriverRetryPolicy as kf, areaUnderCurve as kg, DeliverableSpec as kh, ChatTransportTool as ki, IsolatedCheckOutputEvidence as kl, RunDetachedTurnOptions as km, SearchSpecInputs as kn, CreateScopeAnalystOptions as ko, resolveAgentEnvironmentProvider as kp, InteractiveWorkerResult as kr, StrategyMessage as ks, WatchedSurface as kt, GraphRouteError as ku, SqlRunOwnershipError as kv, createActivityLog as kx, RuntimeStreamEventCollector as ky, AgentTaskRunResult as l, ValidationError as lC, ProviderWorkspaceCaptureProvenance as lS, EscalateQuestion as l_, resolveEntrySymbol as la, SubtreeResult as lb, renderReport as lc, formatPromptHandle as ld, serveCoordinationMcp as lf, AxisScoresOf as lg, UiFindingSeverity as lh, storedGraphDigests as li, LeaderboardRunContext as ll, ToolLoopCompactionOptions as lm, WorkspaceRun as ln, PrivateCasArtifactPort as lo, createSteerableSandboxSession as lp, RemoteSupervisorTree as lr, InProcessPromptCtx as ls, CreateAgentEnvironmentInput$1 as lt, ObserverJournal as lu, defaultToolDetectors as lv, ExecutorTeardownWarning as lx, RootHandle as ly, OpenAIChatResponseFormat as m, RecoverRetainedRunIntentOptions as mC, ExecutorToolCall as mS, QuestionEscalationTarget as m_, AgentTurnBackend as ma, ProviderModelAttemptEvidence as mb, CorpusRecord as mc, SupervisorSpanOptions as md, FileCoordinationLog as mf, LeaderboardRow as mg, ResearchSource as mh, DispatchUnit as mi, DeclaredCheck as ml, CoderDelegate as mm, TrajectoryAnalysis as mn, equalKOnCost as mo, PeerInboxMessage as mp, ProvisionSupervisorRequest as mr, MaterializeLocalMcpOptions as ms, PlacementInfo as mt, EdgeDeliveryOutcome as mu, AnalystLensOutput as mv, WorkerInteractiveSession as mx, Supervisor as my, AgentBackendContext as n, defaultRedactor as nC, HarnessTranscriptReadOptions as nS, JsonScalar as n_, compareCheckOutcomes as na, NodeSnapshot as nb, Observation as nc, PromptRegistry as nd, bestDelivered as nf, CodeModeTool as ng, FeedbackRating as nh, graphRunsFor as ni, providerAsSandboxClient as nl, RouterResponseReceipt as nm, UntrackedCopyStats as nn, reconnectRetainedInteractiveRun as no, RouterSeam as np, workerInboxFileFromEventDir as nr, superviseDispatch as ns, AgentSession as nt, PursuitNodeUsage as nu, BusEvent as nv, UnknownMaterializationReason as nx, InMemorySpawnJournal as ny, AgentRuntimeEvent as o, ConfigError as oC, resolveHarnessTranscriptCapture as oS, RouteMatch as o_, filterAuthoredAsserts as oa, SpawnOpts as ob, ObserveOptions as oc, delegatesWorkerBriefPrompt as od, CoordinationPublicAddress as of, RunCodeModeOptions as og, UiAuditorDelegationOutput as oh, pickBestGraph as oi, LeaderboardBenchmarkAdapter as ol, ToolLoopCallContext as om, Shell as on, resolveSandboxClient as oo, SandboxSteeringOptions as op, RemoteSupervisorControl as or, defaultSelectWinner as os, AnalystFinding$1 as ot, PursuitStatus as ou, PublishOptions as ov, ExecutorCancellation as ox, TraceRootReceipt as oy, KnowledgeReadinessDecision as p, ReconnectRetainedRunOptions as pC, ExecutorProgressEvent as pS, QuestionEscalationRecord as p_, visibleCheckScore as pa, NoWinnerError as pb, CorpusFilter as pc, SupervisorSpanAttributes as pd, CoordinationLog as pf, LeaderboardOptions as pg, ResearchOutput as ph, DispatchStopReason as pi, defineLeaderboard as pl, FeedbackStore as pm, runInWorkspace as pn, createPrivateCasArtifactPort as po, InboxMessage as pp, ProvisionSupervisorConnection as pr, LocalMcpMaterialization as ps, ForkRequest as pt, AgentGraph as pu, AnalystKind as pv, Runtime as px, SteerableRootHandle as py, WorkerSpawnContext as q, RuntimeRunCost as qS, createPeerMailbox as q_, PrivateCasNamespaceInventory as qa, ExecutionBindingReceipt as qb, Persona as qc, plateau as qd, createDelegateHandler as qf, EventAcknowledgement as qg, CodexRolloutTurn as qh, CheckSource as qi, superviseGraphPursuit as ql, DelegateUiAuditRoute as qm, WriteWorkerSteerOptions as qn, printBenchmarkReport as qo, SandboxOutputMarker as qp, GraphRunRecord as qr, defineStrategy as qs, EVIDENCE_MAX_CHARS as qt, subscriptionUsageLimitSignal as qu, FileSpawnJournal as qv, captureBoundHarnessTranscript as qx, BudgetOverspend as qy, AgentBackendInput as r, AgentEvalError$1 as rC, RetainedHarnessTranscriptCapture as rS, RouteFlow as r_, composeCheckSources as ra, NodeStatus as rb, ObservationAnalysis as rc, RegisteredPrompt as rd, CoordinationAuthentication as rf, CodeModeToolContext as rg, FeedbackRefersTo as rh, listGraphRuns as ri, DefinedLeaderboard as rl, RouterTransportConfig as rm, copyUntrackedIntoClone as rn, recoverRetainedInteractiveRun as ro, RouterToolsSeam as rp, writeWorkerSteer as rr, LocalSandboxClientOptions as rs, AgentSessionRef as rt, PursuitProjection as ru, BusRecord as rv, EnvironmentTeardownReceipt as rx, ResultBlobStore as ry, AgentRuntimeEventSink as s, JudgeError as sC, retainHarnessTranscript as sS, RouteWhen as s_, modelAuthoredChecks as sa, SpawnPrior as sb, defaultAnalystInstruction as sc, dumbContinuationFailPrompt as sd, CoordinationReadAccess as sf, createCodeModeTools as sg, UiFinding as sh, recordGraphRun as si, LeaderboardFlagSpec as sl, ToolLoopChat as sm, Workspace as sn, profileChatClient as so, SteerableSandboxArgs as sp, RemoteSupervisorReader as sr, inlineSandboxClient as ss, CheckpointRef as st, projectPursuit as su, createEventBus as sv, ExecutorCancellationRequest as sx, WorkspaceCheckpointMarker as sy, AgentAdapter as t, Redactor as tC, HarnessTranscriptReadLimits as tS, GateRequest as t_, canDisplace as ta, NodeId as tb, harvestCorpus as tc, PromptHandle as td, SupervisorFinalizer as tf, CodeModeStore as tg, DelegationStatusResult as th, graphRegistry as ti, ProviderAsSandboxClientOptions as tl, sumSandboxUsage as tm, CopyOptions as tn, claimRetainedInteractiveControl as to, ProviderSeam as tp, supervisorRunsRoot as tr, loopDispatch as ts, AgentProfile$2 as tt, PursuitNodeTiming as tu, McpTransport as tv, RootMaterialization as tx, InMemoryResultBlobStore as ty, AgentTaskSpec as u, NativeContextContinuationExecution as uC, ProviderWorkspaceCaptureReceipt as uS, Question as u_, sandboxCheckRunner as ua, SubtreeSummary as ub, AssertTraceDerivedFindings as uc, kernelPromptRegistry as ud, CoordinationHttpAudit as uf, GroupOf as ug, UiLens as uh, taskShapeDigest as ui, LeaderboardScenario as ul, ToolLoopMessageRecord as um, gitWorkspace as un, PrivateCasDurableStore as uo, AuthorityInboxMessage as up, RemoteWorkerEvents as ur, InProcessSandboxClientOptions as us, CreateSandboxOptions$1 as ut, ObserverRecord as uu, watchTrace as uv, HeldEnvironment as ux, RootSegment as uy, RunAgentTaskStreamOptions as v, RetainedInteractiveEnvironmentAdmission as vC, DefaultVerdict$2 as vS, QuestionRecord as v_, StreamAgentTurnOptions as va, SupervisedResult as vb, FanoutOptions as vc, RootStreamRecord as vd, ContinuationEntry as vf, ScoreOf as vg, DelegationTraceSpan as vh, rollingDispatch as vi, checkProgramDigest as vl, DetachedSessionDelegateOptions as vm, DEFAULT_MAX_DEPTH as vn, FileCorpus as vo, SharedBoxPlacement as vp, ProfileRegistryDir as vr, StdioMcpServerSpec as vs, WorkspaceRequest as vt, GraphNode as vu, AuthoredAnalystDefinition as vv, SessionMessageLike as vx, createPropagatingTraceEmitter as vy, RuntimeFailureCode as w, RetainedRunCancellation as wC, LoopIterationDispatchPayload as wS, ContinuityMode as w_, StrategyEvolutionConfig as wa, UnconfirmedTeardown as wb, PanelJudge as wc, CoordinationVerbs as wd, PanelFinding as wf, renderPairwiseMarkdown as wg, CoderOutput as wh, defaultDelegateBudget as wi, IsolatedCheckBoxEvidence as wl, FleetWorkspaceExecutorOptions as wm, SqlRunContextOptions as wn, panel as wo, sharedBoxRefusal as wp, profileRunsForName as wr, AgenticTask as ws, HarvestSurfaceDiffsOptions as wt, runGraph as wu, runLocalHarness as wv, DEFAULT_STALL_AFTER_MS as wx, OtelSpan as wy, RuntimeSessionStore as x, RetainedRunAdmission as xC, Iteration as xS, AuthorizeDownMessage as x_, EvolutionAuthor as xa, ResumedKeyState as xb, LoopUntilSpec as xc, supervisorAgent as xd, ContinuationPanelResult as xf, renderLeaderboardHtml as xg, DelegationStore as xh, GraphDesignerExtraTools as xi, declaredCheckJudge as xl, detachedSessionDelegate as xm, ValidateStoredGraphOptions as xn, fanout as xo, SharedWorkerIdentity as xp, loadProfile as xr, AgenticOptions as xs, VerifierEnvironmentOptions as xt, RunGraphOptions as xu, CodexExecutionEvidence as xv, createPushTraceSource as xx, OtelExportConfig as xy, RuntimeCanonicalStreamEvent as y, RetainedInteractiveIntentAdmission as yC, Driver as yS, QuestionUrgency as y_, collectAgentTurn as ya, Agent as yb, FanoutSynthesis as yc, readRootStream as yd, ContinuationPanel as yf, leaderboard as yg, composeLoopTraceEmitters as yh, DesignerRunGraphEnv as yi, declaredCheckDeliverable as yl, DetachedWinnerSelection as ym, createSupervisor as yn, InMemoryCorpus as yo, SharedBoxPlacementOptions as yp, ProfileRunRecord as yr, connectStdioMcp as ys, computeFindingId$1 as yt, GraphResult as yu, AuthoredAnalystLimits as yv, ToolStepInput as yx, readTraceContextFromEnv as yy, MakeWorkerAgent as z, MountRecorder as zS, PeerMailLimits as z_, SandboxLineageHandle as za, ReserveOptions as zb, WidenDecision as zc, NoProgressForOptions as zd, createMcpServer as zf, InPlaceHarnessResult as zg, deterministicCompletion as zh, defaultProfileRichnessThresholds as zi, SettledPursuitVersion as zl, SubmitInput as zm, TRACE_SUMMARY_SCHEMA as zn, sanitizeMcpToolSchema as zo, KeyProvider as zp, GraphFileSeat as zr, ShotSpec as zs, WorktreeCliExecutorOptions as zt, SuperviseTestOptions as zu, loadSpawnForest as zv, HarnessTranscriptArtifact as zx, WorkerSlots as zy };
19626
- //# sourceMappingURL=types-DmJTtmgm.d.ts.map
19628
+ //# sourceMappingURL=types-w3Oo1uRJ.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-runtime",
3
- "version": "6.0.7",
3
+ "version": "6.0.8",
4
4
  "description": "Shared task-lifecycle skeleton for agents: a recursive loop kernel for chat turns, one-shot tasks, and multi-attempt loops, with trace capture and eval-gated self-improvement. Domain behavior lives in adapters; scoring and ship-gates in @tangle-network/agent-eval.",
5
5
  "homepage": "https://github.com/tangle-network/agent-runtime#readme",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"jsonl-file-BeUa5EDx.js","names":[],"sources":["../src/content-digest.ts","../src/durable/jsonl-append.ts","../src/durable/jsonl-file.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\n\nexport function sha256(value: string): string {\n return createHash('sha256').update(value).digest('hex')\n}\n","import {\n closeSync,\n fstatSync,\n fsync,\n fsyncSync,\n ftruncateSync,\n openSync,\n readSync,\n writeSync,\n} from 'node:fs'\nimport { promisify } from 'node:util'\nimport { fenceRunWrite } from './run-fence'\n\n/** Append one JSONL record under the caller's existing single-writer discipline.\n * The caller creates the parent directory. Recover only an uncommitted tail and handle short\n * writes under one generation fence; fsync after the fence, off the event loop (#2362), and\n * resolve only once the bytes are durable. An optional acknowledgement reads the same open\n * descriptor inside the fence (the spawn journal validates its file stamp here).\n * @internal\n */\nexport function appendCommittedJsonLine(path: string, record: unknown): Promise<void>\nexport function appendCommittedJsonLine<T>(\n path: string,\n record: unknown,\n acknowledge: (fd: number) => T,\n): Promise<T>\nexport async function appendCommittedJsonLine<T>(\n path: string,\n record: unknown,\n acknowledge?: (fd: number) => T,\n): Promise<T | undefined> {\n const encoded = JSON.stringify(record)\n if (encoded === undefined) throw new TypeError('JSONL records must be JSON serializable')\n let fd: number | undefined\n try {\n const acknowledged = fenceRunWrite(() => {\n const bytes = Buffer.from(`${prepareJsonlTail(path) ? '\\n' : ''}${encoded}\\n`)\n fd = openSync(path, 'a')\n let offset = 0\n while (offset < bytes.length) {\n const written = writeSync(fd, bytes, offset, bytes.length - offset)\n if (written <= 0)\n throw new Error(`append-only file write made no progress at byte ${offset}`)\n offset += written\n }\n return acknowledge?.(fd)\n })\n await promisify(fsync)(fd as number)\n return acknowledged\n } finally {\n if (fd !== undefined) closeSync(fd)\n }\n}\n\n/** Recover only an uncommitted tail. Caller holds the generation fence. @internal */\nexport function prepareJsonlTail(path: string): boolean {\n let fd: number\n try {\n fd = openSync(path, 'r+')\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code === 'ENOENT') return false\n throw error\n }\n try {\n const size = fstatSync(fd).size\n if (size === 0) return false\n const last = Buffer.allocUnsafe(1)\n readAt(fd, last, size - 1)\n if (last[0] === 0x0a) return false\n const chunks: Buffer[] = []\n let end = size\n let tailStart = 0\n while (end > 0) {\n const start = Math.max(0, end - 65_536)\n const chunk = Buffer.allocUnsafe(end - start)\n readAt(fd, chunk, start)\n const newline = chunk.lastIndexOf(0x0a)\n chunks.push(chunk.subarray(newline + 1))\n if (newline >= 0) {\n tailStart = start + newline + 1\n break\n }\n end = start\n }\n try {\n JSON.parse(Buffer.concat(chunks.reverse()).toString('utf8'))\n return true\n } catch (error) {\n if (!(error instanceof SyntaxError)) throw error\n ftruncateSync(fd, tailStart)\n fsyncSync(fd)\n return false\n }\n } finally {\n closeSync(fd)\n }\n}\n\nfunction readAt(fd: number, buffer: Buffer, position: number): void {\n let offset = 0\n while (offset < buffer.length) {\n const read = readSync(fd, buffer, offset, buffer.length - offset, position + offset)\n if (read === 0) throw new Error('journal changed while preparing its append tail')\n offset += read\n }\n}\n","import type { FileHandle } from 'node:fs/promises'\nimport { prepareJsonlTail } from './jsonl-append'\nimport { fenceRunWrite } from './run-fence'\n\n/** Parse in-memory evidence with the same commit boundary as streamed journal reads. */\nexport function parseCommittedJsonLines<T>(text: string, source: string): T[] {\n const lines = text.split('\\n')\n const records: T[] = []\n for (const [index, line] of lines.entries()) {\n const record = parseRecord<T>(line, source, index + 1, index < lines.length - 1)\n if (record !== undefined) records.push(record.value)\n }\n return records\n}\n\n/** Read a fixed file prefix one record at a time, never allocating the whole journal as a string.\n * A reader cannot chase concurrent appends forever. Missing files are empty only when requested;\n * corruption, short reads, and other I/O errors remain failures. Closing the iterator closes the fd. */\nexport async function* readCommittedJsonLines<T>(\n path: string,\n options: {\n allowMissing?: boolean\n allowWhitespaceLines?: boolean\n onBytes?: (bytes: Uint8Array) => void\n /** Internal fixed-prefix range. The caller supplies a record boundary and owns the handle. */\n handle?: FileHandle\n start?: number\n end?: number\n strictUtf8?: boolean\n onCommit?: (offset: number) => void\n } = {},\n): AsyncGenerator<T> {\n const fs = await import('node:fs/promises')\n let handle: FileHandle\n try {\n handle = options.handle ?? (await fs.open(path, 'r'))\n } catch (error) {\n if (options.allowMissing && isNoEntError(error)) return\n throw error\n }\n try {\n const start = options.start ?? 0\n const end = options.end ?? (await handle.stat()).size\n if (end <= start) return\n const fragments: Buffer[] = []\n let offset = start\n let lineNumber = 1\n const parse = (terminated: boolean): { value: T } | undefined => {\n const bytes = Buffer.concat(fragments)\n let line: string\n try {\n line = options.strictUtf8\n ? new TextDecoder('utf-8', { fatal: true }).decode(bytes)\n : bytes.toString('utf8')\n } catch (cause) {\n if (!terminated) return undefined\n throw new Error(`${path}: malformed UTF-8 at line ${lineNumber}`, { cause })\n }\n return parseRecord<T>(line, path, lineNumber++, terminated, options.allowWhitespaceLines)\n }\n let position = start\n while (position < end) {\n const buffer = Buffer.alloc(Math.min(65_536, end - position))\n const { bytesRead } = await handle.read(buffer, 0, buffer.length, position)\n if (bytesRead === 0) {\n throw new Error(`${path}: journal changed while reading its committed prefix`)\n }\n position += bytesRead\n const bytes = buffer.subarray(0, bytesRead)\n options.onBytes?.(bytes)\n let start = 0\n for (let end = bytes.indexOf(10); end !== -1; end = bytes.indexOf(10, start)) {\n fragments.push(bytes.subarray(start, end))\n const record = parse(true)\n offset += fragments.reduce((size, part) => size + part.length, 0) + 1\n fragments.length = 0\n options.onCommit?.(offset)\n if (record !== undefined) yield record.value\n start = end + 1\n }\n if (start < bytes.length) fragments.push(bytes.subarray(start))\n }\n const record = parse(false)\n if (record !== undefined) {\n options.onCommit?.(end)\n yield record.value\n }\n } finally {\n if (options.handle === undefined) await handle.close()\n }\n}\n\n/** An invalid unterminated tail may be a torn write; other parse failures are not evidence of one. */\nfunction parseRecord<T>(\n line: string,\n source: string,\n lineNumber: number,\n terminated: boolean,\n allowWhitespaceLines = false,\n): { value: T } | undefined {\n if (line.length === 0 || (allowWhitespaceLines && line.trim().length === 0)) return undefined\n try {\n return { value: JSON.parse(line) as T }\n } catch (cause) {\n if (!(cause instanceof SyntaxError)) throw cause\n if (!terminated) return undefined\n throw new Error(`${source}: malformed JSONL record at line ${lineNumber}`, { cause })\n }\n}\n\nexport { appendCommittedJsonLine } from './jsonl-append'\n\n/** Serialize JSONL file updates across processes and aliases using Eval's existing file lock.\n * The caller owns validation and the record format. The lock path names the canonical file,\n * including its first write, so two directory aliases cannot acquire different write heads.\n * @internal\n */\nexport async function withJsonlFileLock<T>(\n path: string,\n operation: (canonicalPath: string) => Promise<T>,\n): Promise<T> {\n const fs = await import('node:fs/promises')\n const { dirname } = await import('node:path')\n const { tryAcquireAtomicFileLock } = await import('@tangle-network/agent-eval/ledger-core')\n await fs.mkdir(dirname(path), { recursive: true })\n const file = await fs.open(path, 'a')\n await file.close()\n const canonicalPath = await fs.realpath(path)\n const deadline = Date.now() + 5000\n for (;;) {\n const acquisition = tryAcquireAtomicFileLock({ lockPath: `${canonicalPath}.lock` })\n if (!acquisition.acquired) {\n if (Date.now() >= deadline) {\n throw new Error(`journal file lock unavailable after 5000ms: ${canonicalPath}`)\n }\n await new Promise((resolve) => setTimeout(resolve, 25))\n continue\n }\n try {\n return await operation(canonicalPath)\n } finally {\n acquisition.lock.release()\n }\n }\n}\n\n/** Read one keyed registry snapshot without an extra whole-file text allocation.\n * Historical registry files allow whitespace-only separators; append journals remain strict.\n * @internal\n */\nexport async function readCommittedJsonFile<T>(path: string): Promise<T[]> {\n const records: T[] = []\n for await (const record of readCommittedJsonLines<T>(path, {\n allowMissing: true,\n allowWhitespaceLines: true,\n })) {\n records.push(record)\n }\n return records\n}\n\n/** Replace one keyed row and publish one durable snapshot. The caller holds the file lock.\n * Keep unrelated rows in order and put the replacement last. No revision archive is retained.\n * @internal\n */\nexport async function upsertCommittedJsonLine<T>(\n path: string,\n record: T,\n key: (record: T) => string,\n): Promise<void> {\n const encoded = JSON.stringify(record)\n if (encoded === undefined) throw new Error('JSONL records must be JSON serializable')\n const snapshot: T = JSON.parse(encoded)\n const id = key(snapshot)\n const updated: T[] = []\n for await (const prior of readCommittedJsonLines<T>(path, {\n allowMissing: true,\n allowWhitespaceLines: true,\n })) {\n if (key(prior) !== id) updated.push(prior)\n }\n updated.push(snapshot)\n // Reuse Runtime's file publication owner; this module owns JSONL framing, not another\n // durability implementation. Preserve the existing snapshot's permissions across rename.\n const { writeAtomicDurableFile } = await import('../runtime/supervise/durable-file')\n writeAtomicDurableFile(path, `${updated.map((row) => JSON.stringify(row)).join('\\n')}\\n`, {\n preserveMode: true,\n })\n}\n\n/** Recover a torn tail under the same generation fence as durable publications. @internal */\nexport async function prepareJsonlAppend(path: string): Promise<boolean> {\n return fenceRunWrite(() => prepareJsonlTail(path))\n}\n\n/** True for a filesystem error meaning \"the file is not there yet\" — the one condition an\n * append-only reader treats as an empty log rather than a fault. */\nexport function isNoEntError(error: unknown): boolean {\n return (\n typeof error === 'object' &&\n error !== null &&\n 'code' in error &&\n (error as { code: unknown }).code === 'ENOENT'\n )\n}\n"],"mappings":";;;;;AAEA,SAAgB,OAAO,OAAuB;CAC5C,OAAO,WAAW,QAAQ,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,OAAO,KAAK;AACxD;;ACsBA,eAAsB,wBACpB,MACA,QACA,aACwB;CACxB,MAAM,UAAU,KAAK,UAAU,MAAM;CACrC,IAAI,YAAY,KAAA,GAAW,MAAM,IAAI,UAAU,yCAAyC;CACxF,IAAI;CACJ,IAAI;EACF,MAAM,eAAe,oBAAoB;GACvC,MAAM,QAAQ,OAAO,KAAK,GAAG,iBAAiB,IAAI,IAAI,OAAO,KAAK,QAAQ,GAAG;GAC7E,KAAK,SAAS,MAAM,GAAG;GACvB,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,UAAU,MAAM;CACrC,IAAI,YAAY,KAAA,GAAW,MAAM,IAAI,MAAM,yCAAyC;CACpF,MAAM,WAAc,KAAK,MAAM,OAAO;CACtC,MAAM,KAAK,IAAI,QAAQ;CACvB,MAAM,UAAe,CAAC;CACtB,WAAW,MAAM,SAAS,uBAA0B,MAAM;EACxD,cAAc;EACd,sBAAsB;CACxB,CAAC,GACC,IAAI,IAAI,KAAK,MAAM,IAAI,QAAQ,KAAK,KAAK;CAE3C,QAAQ,KAAK,QAAQ;CAGrB,MAAM,EAAE,2BAA2B,MAAM,OAAO;CAChD,uBAAuB,MAAM,GAAG,QAAQ,KAAK,QAAQ,KAAK,UAAU,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,KAAK,EACxF,cAAc,KAChB,CAAC;AACH;;AAGA,eAAsB,mBAAmB,MAAgC;CACvE,OAAO,oBAAoB,iBAAiB,IAAI,CAAC;AACnD;;;AAIA,SAAgB,aAAa,OAAyB;CACpD,OACE,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACT,MAA4B,SAAS;AAE1C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"run-state-CeMgqULw.js","names":["delay"],"sources":["../src/durable/run-lock.ts","../src/durable/spawn-journal/read.ts","../src/durable/run-state.ts"],"sourcesContent":["import {\n closeSync,\n existsSync,\n fstatSync,\n mkdirSync,\n openSync,\n readFileSync,\n unlinkSync,\n} from 'node:fs'\nimport { resolve } from 'node:path'\nimport { setTimeout as delay } from 'node:timers/promises'\nimport {\n type LockHolderRecord,\n type LockIdentity,\n lockHolderVerdict,\n lockIdentity,\n parseLockHolderRecord,\n readLockHolderIdentity,\n} from '@tangle-network/agent-eval/lock-holder'\nimport {\n publishExclusiveDurableFile,\n writeAtomicDurableFile,\n} from '../runtime/supervise/durable-file'\nimport { isNoEntError } from './jsonl-file'\nimport { mutateRunClaim, runGenerationPath, runWithWriteClaim } from './run-fence'\n\n/*\n * Exclusive ownership of one durable run directory for the life of one `supervisePursuit` call.\n *\n * Measured motive (discovery-lab recursive smoke r1): the recovery protocol is\n * `SIGKILL` the runner while a child is live, then resume on the same directory. PID 1527 was\n * killed at 06:20:27Z and PID 2058 resumed at 06:24:59Z. Nothing refused a second process while\n * the first was still alive; two processes on one directory both append to `spawn-journal.jsonl`\n * and `observer.jsonl`, and the recorded assignment keys and settlements stop being one sequence.\n * The operator relied on timing. This lock makes the second process refuse and name the holder.\n *\n * The holder is identified by its pid and the OS's start token for that pid. r1 ran in a\n * container whose pids are small (1527, 2058) and restart from 1, so a pid alone names the wrong\n * process after enough spawns: a lock left by a killed run would then match an unrelated live\n * process and hold the directory until an operator removed the file. Whether a holder is dead is\n * agent-eval's one dead-owner rule (`@tangle-network/agent-eval/lock-holder`): the record carries\n * the start token, host, boot id, pid namespace and the lock file's own inode identity, and a\n * holder is reclaimed only when those prove it gone or its pid reused. A record that cannot prove\n * that, such as one written before these fields existed, is refused and is removed by hand.\n *\n * The lock is operational state, not evidence: replay, projection, and the settle record ignore\n * it. A holder whose process is gone is reclaimed through Eval's crash-recoverable mutation lock.\n */\n\n/** The lock file `supervisePursuit` holds inside a run directory for the life of one call. */\nexport const RUN_DIRECTORY_LOCK_FILE = 'supervise.lock'\n\n/** What the lock file records about its holder. */\nexport interface RunDirectoryLockHolder {\n readonly pid: number\n /** Monotonic acquisition generation; absent on legacy lock records. */\n readonly generation?: number\n /** ISO instant the holder took the lock. */\n readonly startedAt: string\n readonly runId: string\n /** The OS's start token for `pid` when the host reports one. A holder without one is never proved dead. */\n readonly processStart?: string\n /** Hostname of the holder. Records written before it existed are never proved dead. */\n readonly host?: string\n readonly bootId?: string\n readonly pidNamespace?: string\n /** Inode identity of the lock file this record was written into. */\n readonly lock?: LockIdentity\n}\n\n/** A held lock. `release()` removes the file; it is safe to call more than once. */\nexport interface RunDirectoryLock extends RunDirectoryLockHolder {\n readonly generation: number\n readonly path: string\n /** Bind durable writes to this acquisition, including work queued before release. */\n run<T>(operation: () => T): T\n release(): Promise<void>\n}\n\n/** The directory is held by a live process. `holder` is what that process recorded. */\nexport class RunDirectoryLockedError extends Error {\n readonly path: string\n readonly holder: RunDirectoryLockHolder\n\n constructor(path: string, holder: RunDirectoryLockHolder) {\n super(\n `supervisePursuit: ${path} is held by pid ${holder.pid} (run '${holder.runId}', since ${holder.startedAt}); one process drives a run directory at a time`,\n )\n this.name = 'RunDirectoryLockedError'\n this.path = path\n this.holder = holder\n }\n}\n\n/**\n * Take `runDir/supervise.lock`, or refuse.\n *\n * The file is published with its full content or not at all, so a contender never reads a\n * half-written holder. A lock whose holder is proved dead (its pid no longer exists, the pid now\n * belongs to a process with a different start token, or the host rebooted) is stale and is removed\n * under the mutation guard; a holder that is alive or cannot be proved dead refuses. An empty file\n * names no holder and is reclaimed. A file with unreadable content is left in place and refused:\n * reclaiming it could evict a live holder written by something other than this module.\n */\nexport async function acquireRunDirectoryLock(\n runDir: string,\n runId: string,\n now: () => number = Date.now,\n): Promise<RunDirectoryLock> {\n const dir = resolve(runDir)\n const path = resolve(dir, RUN_DIRECTORY_LOCK_FILE)\n mkdirSync(dir, { recursive: true })\n const { pid, ...identity } = readLockHolderIdentity(process.pid)\n const owner = { pid, startedAt: new Date(now()).toISOString(), runId, ...identity }\n return mutateRunClaim(path, () => {\n const existing = readLockFile(path)\n if (existing.state === 'holder' && !holderIsDead(existing)) {\n throw new RunDirectoryLockedError(path, existing.holder)\n }\n let previousGeneration = 0\n try {\n previousGeneration = Number(readFileSync(runGenerationPath(dir), 'utf8'))\n if (!Number.isSafeInteger(previousGeneration) || previousGeneration < 1) {\n throw new Error('invalid run directory generation counter')\n }\n } catch (error) {\n if (!isNoEntError(error)) throw error\n }\n const generation =\n Math.max(\n previousGeneration,\n existing.state === 'holder' ? (existing.holder.generation ?? 0) : 0,\n ) + 1\n if (!Number.isSafeInteger(generation)) throw new Error('run directory generation exhausted')\n writeAtomicDurableFile(runGenerationPath(dir), `${generation}\\n`)\n if (existing.state !== 'missing') removeIfPresent(path)\n const written: { holder?: RunDirectoryLockHolder } = {}\n // The lock file is a hard link of the temporary file, so the temporary file's inode identity\n // is the lock's, and a later verdict can prove this record was written for this very lock.\n const published = publishExclusiveDurableFile(path, (file) => {\n written.holder = Object.freeze({ ...owner, generation, lock: lockIdentity(file) })\n return `${JSON.stringify(written.holder)}\\n`\n })\n const holder = written.holder\n if (!published || holder === undefined) {\n throw new Error(`supervisePursuit: could not take ${path}`)\n }\n let released = false\n return Object.freeze({\n ...holder,\n generation,\n path,\n run: <T>(operation: () => T): T => {\n if (holder.lock === undefined) throw new Error('run lock has no inode identity')\n return runWithWriteClaim({ path, generation, lock: holder.lock }, operation)\n },\n release: async () => {\n if (released) return\n await releaseHolder(path, holder)\n released = true\n },\n })\n })\n}\n\n/** Read the holder a lock file names, or `undefined` when no lock file names one. */\nexport async function readRunDirectoryLock(\n runDir: string,\n): Promise<RunDirectoryLockHolder | undefined> {\n const existing = await readLockFile(resolve(runDir, RUN_DIRECTORY_LOCK_FILE))\n return existing.state === 'holder' ? existing.holder : undefined\n}\n\n/** What {@link runDirectoryHolderIsLive} proved about a run directory's recorded holder. */\nexport interface RunDirectoryHolderLiveness {\n /** False only when the holder that took the lock is proved dead; a holder that cannot be proved dead reads as live. */\n readonly live: boolean\n /** The holder could not be verified on this host. `live` stays conservative for exclusion. */\n readonly unknown?: true\n /** The holder the lock file names. Absent when no lock file names one, which reads as not live. */\n readonly holder?: RunDirectoryLockHolder\n}\n\n/**\n * Whether a run directory is still held by the live process that took its lock.\n *\n * The same rule `acquireRunDirectoryLock` applies to decide whether a lock is stale, exposed so a\n * caller — a supervisor picking up an abandoned directory, an operator tool listing runs — asks\n * the question instead of hand-rolling `process.kill(pid, 0)`. A bare signal probe cannot tell a\n * live holder from an unrelated process that later took the same pid, which is the failure this\n * lock's start token exists to prevent.\n *\n * The answer is ADVISORY: it is read outside the mutation guard `acquireRunDirectoryLock` holds,\n * so a `false` can be stale by the time the caller acts on it and a concurrent acquire can take\n * the directory in between. Reporting and listing are what this is for. A caller that intends to\n * TAKE the directory calls `acquireRunDirectoryLock`, which evaluates the same rule under the\n * guard and refuses atomically.\n */\nexport async function runDirectoryHolderIsLive(\n runDir: string,\n): Promise<RunDirectoryHolderLiveness> {\n const existing = await readLockFile(resolve(runDir, RUN_DIRECTORY_LOCK_FILE))\n if (existing.state !== 'holder') return { live: false }\n const verdict = lockHolderVerdict(existing.record, existing.current)\n return {\n live: verdict.liveness !== 'dead',\n holder: existing.holder,\n ...(verdict.liveness === 'unknown' ? { unknown: true as const } : {}),\n }\n}\n\ntype LockFileState =\n | { readonly state: 'missing' }\n | { readonly state: 'empty' }\n | {\n readonly state: 'holder'\n readonly holder: RunDirectoryLockHolder\n /** The holder as agent-eval's rule reads it; absent when the record names no host. */\n readonly record: LockHolderRecord | undefined\n /** Inode identity of the file the holder was read from. */\n readonly current: LockIdentity\n }\n\nfunction readLockFile(path: string): LockFileState {\n let text: string\n let current: LockIdentity\n try {\n const file = openSync(path, 'r')\n try {\n current = lockIdentity(fstatSync(file, { bigint: true }))\n text = readFileSync(file, 'utf8')\n } finally {\n closeSync(file)\n }\n } catch (error) {\n if (isNoEntError(error)) return { state: 'missing' }\n throw error\n }\n // This module publishes the file with its full content or not at all, so an empty file was\n // not left by a live holder.\n if (text.trim().length === 0) return { state: 'empty' }\n let parsed: unknown\n try {\n parsed = JSON.parse(text)\n } catch (cause) {\n throw new Error(`supervisePursuit: ${path} is not a readable lock file; remove it by hand`, {\n cause,\n })\n }\n const record = parsed as Partial<RunDirectoryLockHolder> | null\n if (\n typeof record !== 'object' ||\n record === null ||\n typeof record.pid !== 'number' ||\n !Number.isInteger(record.pid) ||\n record.pid <= 0 ||\n typeof record.startedAt !== 'string' ||\n typeof record.runId !== 'string' ||\n (record.processStart !== undefined && typeof record.processStart !== 'string') ||\n (record.generation !== undefined &&\n (!Number.isSafeInteger(record.generation) || record.generation < 1))\n ) {\n throw new Error(`supervisePursuit: ${path} is not a readable lock file; remove it by hand`)\n }\n const { pid, startedAt, runId, processStart } = record\n // A missing or malformed identity field is dropped, which leaves the holder never provably dead.\n const verdictRecord = parseLockHolderRecord(parsed)\n const { pid: _pid, ...identity } = verdictRecord ?? { pid }\n return {\n state: 'holder',\n holder: Object.freeze({\n pid,\n startedAt,\n runId,\n ...(record.generation === undefined ? {} : { generation: record.generation }),\n ...(processStart === undefined ? {} : { processStart }),\n ...identity,\n }),\n record: verdictRecord,\n current,\n }\n}\n\n/** agent-eval's dead-owner rule: only a holder proved dead is stale; alive or unknown stays held. */\nfunction holderIsDead(existing: Extract<LockFileState, { state: 'holder' }>): boolean {\n return lockHolderVerdict(existing.record, existing.current).liveness === 'dead'\n}\n\n/** Remove the lock only while it still names this holder; a reclaimed lock belongs to its new owner. */\nasync function releaseHolder(path: string, holder: RunDirectoryLockHolder): Promise<void> {\n const deadline = performance.now() + 1_000\n while (existsSync(`${path}.guard`) && performance.now() < deadline) await delay(10)\n mutateRunClaim(path, () => {\n const existing = readLockFile(path)\n if (existing.state !== 'holder') return\n if (\n existing.holder.pid !== holder.pid ||\n existing.holder.startedAt !== holder.startedAt ||\n existing.holder.runId !== holder.runId ||\n existing.holder.processStart !== holder.processStart ||\n existing.holder.generation !== holder.generation ||\n existing.holder.lock?.dev !== holder.lock?.dev ||\n existing.holder.lock?.ino !== holder.lock?.ino ||\n existing.holder.lock?.birthtimeNs !== holder.lock?.birthtimeNs\n )\n return\n removeIfPresent(path)\n })\n}\n\nfunction removeIfPresent(path: string): void {\n try {\n unlinkSync(path)\n } catch (error) {\n if (!isNoEntError(error)) throw error\n }\n}\n","import { createHash } from 'node:crypto'\nimport type { BigIntStats } from 'node:fs'\nimport { type FileHandle, open, stat } from 'node:fs/promises'\nimport { join } from 'node:path'\nimport { isRecord } from '@tangle-network/agent-core'\nimport type { NodeId, SpawnEvent } from '../../runtime/supervise/types'\nimport { isNoEntError, readCommittedJsonLines } from '../jsonl-file'\nimport { spawnJournalRecordEvents } from './record-events'\n\n/** Serializable checkpoint of a committed byte boundary, bound to one file and its bytes. */\nexport interface SpawnJournalCursor {\n readonly file: string\n readonly offset: number\n readonly boundary: string\n}\n\n/** Physical groups expand to event records; the owning tree is preserved for every event. */\nexport type SpawnJournalReadRecord =\n | { readonly kind: 'begin'; readonly root: NodeId; readonly at: string }\n | { readonly kind: 'event'; readonly root: NodeId; readonly event: SpawnEvent }\n\nexport interface SpawnJournalReadOptions {\n readonly after?: SpawnJournalCursor\n /** Initial opening-and-tail window, or an incremental page's byte budget. A crossing record\n * is read whole, so one large record can exceed this budget. Omit for complete history. */\n readonly tailBytes?: number\n}\n\nexport interface SpawnJournalReadResult {\n readonly records: ReadonlyArray<SpawnJournalReadRecord>\n /** Absent only when the journal does not exist. Treat as opaque and persist unchanged. */\n readonly cursor?: SpawnJournalCursor\n /** The supplied cursor no longer matches; this page starts over. */\n readonly reset: boolean\n /** An initial opening-and-tail window omitted records between its two windows. */\n readonly truncated: boolean\n /** Bytes after the committed cursor in this snapshot, including an incomplete final write. */\n readonly remainingBytes: number\n}\n\n/** Read a fixed journal prefix, with historical envelopes and framing owned by Runtime.\n * Missing journals return an empty page. Malformed committed records fail; incomplete final\n * writes remain unread for the next call. Cursors detect replacement, truncation and edits at\n * their sampled opening/boundary; they are not integrity proofs against arbitrary file edits.\n */\nexport async function readSpawnJournal(\n runDir: string,\n options: SpawnJournalReadOptions = {},\n): Promise<SpawnJournalReadResult> {\n const { after, tailBytes } = options\n if (tailBytes !== undefined && (!Number.isSafeInteger(tailBytes) || tailBytes < 1)) {\n throw new RangeError('readSpawnJournal: tailBytes must be a positive safe integer')\n }\n const path = join(runDir, 'spawn-journal.jsonl')\n let handle: FileHandle\n try {\n handle = await open(path, 'r')\n } catch (error) {\n if (isNoEntError(error)) {\n return { records: [], reset: after !== undefined, truncated: false, remainingBytes: 0 }\n }\n throw error\n }\n try {\n const snapshot = await handle.stat({ bigint: true })\n if (!snapshot.isFile()) throw new Error(`${path}: expected a regular file`)\n const size = Number(snapshot.size)\n const file = identity(snapshot)\n const resumed =\n after !== undefined &&\n after.file === file &&\n Number.isSafeInteger(after.offset) &&\n after.offset >= 0 &&\n after.offset <= size &&\n after.boundary === (await boundary(handle, after.offset))\n let offset = resumed ? after.offset : 0\n const records: SpawnJournalReadRecord[] = []\n const read = async (start: number, end: number, firstOnly = false): Promise<void> => {\n offset = start\n for await (const record of readCommittedJsonLines<unknown>(path, {\n handle,\n start,\n end,\n strictUtf8: true,\n onCommit: (committed) => {\n offset = committed\n },\n })) {\n if (!isRecord(record) || typeof record.root !== 'string') {\n throw new Error(`${path}: spawn journal record has no root`)\n }\n if (record.kind === 'begin') {\n if (typeof record.at !== 'string') throw new Error(`${path}: begin record has no at`)\n records.push({ kind: 'begin', root: record.root, at: record.at })\n } else {\n for (const event of spawnJournalRecordEvents(record)) {\n if (\n !isRecord(event) ||\n typeof event.kind !== 'string' ||\n typeof event.id !== 'string'\n ) {\n throw new Error(`${path}: spawn journal record has no event identity`)\n }\n records.push({ kind: 'event', root: record.root, event })\n }\n }\n if (firstOnly) break\n }\n }\n let truncated = false\n if (!resumed && tailBytes !== undefined && size > tailBytes) {\n await read(0, size, true)\n const openingEnd = offset\n const tailStart = await lineBoundary(handle, size - tailBytes, size, -1)\n truncated = tailStart > openingEnd\n await read(Math.max(openingEnd, tailStart), size)\n // A long torn tail must not hide the latest committed activity before it.\n if (offset === tailStart && tailStart > openingEnd) {\n const previous = await lineBoundary(handle, tailStart - 1, size, -1)\n truncated = previous > openingEnd\n await read(Math.max(openingEnd, previous), tailStart)\n }\n } else {\n const end =\n resumed && tailBytes !== undefined && size - offset > tailBytes\n ? await lineBoundary(handle, offset + tailBytes, size, 1)\n : size\n await read(offset, end)\n }\n if (identity(await stat(path, { bigint: true })) !== file || (await handle.stat()).size < size)\n throw new Error(`${path}: journal changed while reading its committed prefix`)\n return {\n records,\n cursor: { file, offset, boundary: await boundary(handle, offset) },\n reset: after !== undefined && !resumed,\n truncated,\n remainingBytes: size - offset,\n }\n } finally {\n await handle.close()\n }\n}\n\nfunction identity(info: BigIntStats): string {\n return `${info.dev}:${info.ino}:${info.birthtimeNs}`\n}\n\nasync function bytes(handle: FileHandle, start: number, length: number): Promise<Buffer> {\n const buffer = Buffer.alloc(length)\n const { bytesRead } = await handle.read(buffer, 0, length, start)\n if (bytesRead !== length) throw new Error('spawn journal changed while reading its boundary')\n return buffer\n}\n\nasync function boundary(handle: FileHandle, offset: number): Promise<string> {\n const length = Math.min(offset, 128)\n return createHash('sha256')\n .update(await bytes(handle, 0, length))\n .update(await bytes(handle, offset - length, length))\n .digest('hex')\n}\n\n/** Include the record crossing a tail window or incremental page boundary. */\nasync function lineBoundary(\n handle: FileHandle,\n position: number,\n size: number,\n direction: -1 | 1,\n): Promise<number> {\n while (position > 0 && position < size) {\n const start = direction === -1 ? Math.max(0, position - 65_536) : position\n const end = direction === -1 ? position : Math.min(size, position + 65_536)\n const part = await bytes(handle, start, end - start)\n const newline = direction === -1 ? part.lastIndexOf(10) : part.indexOf(10)\n if (newline !== -1) return start + newline + 1\n position = direction === -1 ? start : end\n }\n return position\n}\n","import type { RuntimeFailureCause } from '../runtime/failure-cause'\nimport { type RunCancelRequest, readRunCancelRequest } from '../runtime/supervise/run-cancellation'\nimport { readRunParking } from '../runtime/supervise/run-parking'\nimport type { SupervisedResult } from '../runtime/supervise/types'\nimport { runDirectoryHolderIsLive } from './run-lock'\nimport { readFailureRecord, readSettleRecord } from './settle-record'\nimport { readSpawnJournal } from './spawn-journal/read'\n\n/** Runtime evidence only. Product-specific launch, checks and trace completeness belong to callers. */\nexport interface RunState {\n /** Absent when a recorded holder cannot be verified on this host. */\n readonly phase?: 'running' | 'parked' | 'cancelling' | 'settled' | 'down'\n /** A persisted typed root failure; legacy failure messages do not establish a code. */\n readonly failureCode?: RuntimeFailureCause['code']\n readonly settle?: SupervisedResult<unknown>\n readonly cancelRequest?: RunCancelRequest\n /** Absent when holder liveness is unknown. This is advisory, never ownership authorization. */\n readonly holderLive?: boolean\n /** Latest explicit Runtime timestamp observed, as ISO UTC; never a filesystem mtime. */\n readonly lastActivityAt?: string\n}\n\n/** Compose maintained record readers. Terminal settlement outranks cancellation and parking;\n * a request remains cancelling until settlement. An unheld run with evidence is down.\n * No Runtime evidence (including a missing or empty directory) returns undefined. Reads are\n * advisory snapshots across independently published files, not a transaction or a resume gate.\n */\nexport async function readRunState(runDir: string): Promise<RunState | undefined> {\n const [settle, failure, parking, holder, journal] = await Promise.all([\n readSettleRecord(runDir),\n readFailureRecord(runDir),\n readRunParking(runDir),\n runDirectoryHolderIsLive(runDir),\n readSpawnJournal(runDir, { tailBytes: 65_536 }),\n ])\n const cancelRequest = readRunCancelRequest(runDir)\n if (\n !settle &&\n !failure &&\n !parking &&\n !holder.holder &&\n !cancelRequest &&\n journal.records.length === 0\n ) {\n return undefined\n }\n const holderLive = holder.unknown ? undefined : holder.live\n const phase = settle\n ? 'settled'\n : cancelRequest\n ? 'cancelling'\n : parking\n ? 'parked'\n : holderLive === true\n ? 'running'\n : holderLive === false\n ? 'down'\n : undefined\n const root = settle?.tree.nodes?.find((node) => node.id === settle.tree.root)\n const failureCode =\n (settle?.kind === 'no-winner' && settle.reason === 'driver-failed'\n ? settle.error?.failure?.code\n : undefined) ?? root?.failure?.code\n let latest: number | undefined\n const observe = (at: string | number | undefined): void => {\n const timestamp = at === undefined ? undefined : new Date(at).getTime()\n if (timestamp !== undefined && Number.isFinite(timestamp)) {\n latest = latest === undefined ? timestamp : Math.max(latest, timestamp)\n }\n }\n observe(failure?.at)\n observe(parking?.since)\n observe(cancelRequest?.at)\n observe(holder.holder?.startedAt)\n for (const record of journal.records)\n observe(record.kind === 'begin' ? record.at : record.event.at)\n for (const node of settle?.tree.nodes ?? []) {\n observe(node.spawnedAt)\n observe(node.settledAt)\n }\n const lastActivityAt = latest === undefined ? undefined : new Date(latest).toISOString()\n return {\n ...(phase === undefined ? {} : { phase }),\n ...(failureCode === undefined ? {} : { failureCode }),\n ...(settle === undefined ? {} : { settle }),\n ...(cancelRequest === undefined ? {} : { cancelRequest }),\n ...(holderLive === undefined ? {} : { holderLive }),\n ...(lastActivityAt === undefined ? {} : { lastActivityAt }),\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAkDA,MAAa,0BAA0B;;AA8BvC,IAAa,0BAAb,cAA6C,MAAM;CACjD;CACA;CAEA,YAAY,MAAc,QAAgC;EACxD,MACE,qBAAqB,KAAK,kBAAkB,OAAO,IAAI,SAAS,OAAO,MAAM,WAAW,OAAO,UAAU,gDAC3G;EACA,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,SAAS;CAChB;AACF;;;;;;;;;;;AAYA,eAAsB,wBACpB,QACA,OACA,MAAoB,KAAK,KACE;CAC3B,MAAM,MAAM,QAAQ,MAAM;CAC1B,MAAM,OAAO,QAAQ,KAAK,uBAAuB;CACjD,UAAU,KAAK,EAAE,WAAW,KAAK,CAAC;CAClC,MAAM,EAAE,KAAK,GAAG,aAAa,uBAAuB,QAAQ,GAAG;CAC/D,MAAM,QAAQ;EAAE;EAAK,WAAW,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,YAAY;EAAG;EAAO,GAAG;CAAS;CAClF,OAAO,eAAe,YAAY;EAChC,MAAM,WAAW,aAAa,IAAI;EAClC,IAAI,SAAS,UAAU,YAAY,CAAC,aAAa,QAAQ,GACvD,MAAM,IAAI,wBAAwB,MAAM,SAAS,MAAM;EAEzD,IAAI,qBAAqB;EACzB,IAAI;GACF,qBAAqB,OAAO,aAAa,kBAAkB,GAAG,GAAG,MAAM,CAAC;GACxE,IAAI,CAAC,OAAO,cAAc,kBAAkB,KAAK,qBAAqB,GACpE,MAAM,IAAI,MAAM,0CAA0C;EAE9D,SAAS,OAAO;GACd,IAAI,CAAC,aAAa,KAAK,GAAG,MAAM;EAClC;EACA,MAAM,aACJ,KAAK,IACH,oBACA,SAAS,UAAU,WAAY,SAAS,OAAO,cAAc,IAAK,CACpE,IAAI;EACN,IAAI,CAAC,OAAO,cAAc,UAAU,GAAG,MAAM,IAAI,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