@tangle-network/agent-runtime 10.0.14 → 10.0.16

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 (101) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{activation-BmdINnh5.d.ts → activation-BJK66rbO.d.ts} +2 -2
  3. package/dist/{activation-D36iRata.js → activation-Lp7hDvJr.js} +2 -2
  4. package/dist/{activation-D36iRata.js.map → activation-Lp7hDvJr.js.map} +1 -1
  5. package/dist/agent.d.ts +1 -1
  6. package/dist/agent.js +4 -4
  7. package/dist/{continuation-Bccak14N.js → continuation-CDdjAkpk.js} +2 -2
  8. package/dist/{continuation-Bccak14N.js.map → continuation-CDdjAkpk.js.map} +1 -1
  9. package/dist/{coordination-map-routing-XZXTlCmn.js → coordination-map-routing-DovTCk1Y.js} +2 -2
  10. package/dist/{coordination-map-routing-XZXTlCmn.js.map → coordination-map-routing-DovTCk1Y.js.map} +1 -1
  11. package/dist/{delegate-BCilDCSO.js → delegate-BGsCSjPF.js} +2 -2
  12. package/dist/{delegate-BCilDCSO.js.map → delegate-BGsCSjPF.js.map} +1 -1
  13. package/dist/{driver-control-acknowledgers-DwvOv6Hy.js → driver-control-acknowledgers-DOORX1XQ.js} +10 -10
  14. package/dist/{driver-control-acknowledgers-DwvOv6Hy.js.map → driver-control-acknowledgers-DOORX1XQ.js.map} +1 -1
  15. package/dist/durable-writer-thread.js +4 -4
  16. package/dist/durable.d.ts +2 -1
  17. package/dist/durable.js +18 -16
  18. package/dist/durable.js.map +1 -1
  19. package/dist/{failure-cause-B2TBXIu-.js → failure-cause-DTXwfv7t.js} +12 -4
  20. package/dist/{failure-cause-B2TBXIu-.js.map → failure-cause-DTXwfv7t.js.map} +1 -1
  21. package/dist/{graph-CDegLFf5.js → graph-3l4oJsP4.js} +10 -10
  22. package/dist/{graph-CDegLFf5.js.map → graph-3l4oJsP4.js.map} +1 -1
  23. package/dist/{graph-registry-BmghD_VO.js → graph-registry-SgsCxCTZ.js} +5 -5
  24. package/dist/{graph-registry-BmghD_VO.js.map → graph-registry-SgsCxCTZ.js.map} +1 -1
  25. package/dist/{graph-registry-DQ2-dA0X.js → graph-registry-aMRd94PD.js} +1 -1
  26. package/dist/{improve-CWX6gC3Y.js → improve-BC13IKeQ.js} +8 -8
  27. package/dist/{improve-CWX6gC3Y.js.map → improve-BC13IKeQ.js.map} +1 -1
  28. package/dist/index.d.ts +3 -3
  29. package/dist/index.js +12 -12
  30. package/dist/intelligence.d.ts +2 -2
  31. package/dist/intelligence.js +5 -5
  32. package/dist/{jsonl-file-vE9H9UXa.js → jsonl-file-B8xfYz9M.js} +14 -3
  33. package/dist/{jsonl-file-vE9H9UXa.js.map → jsonl-file-B8xfYz9M.js.map} +1 -1
  34. package/dist/kernel.d.ts +1 -1
  35. package/dist/kernel.js +19 -19
  36. package/dist/{loop-runner-D1JzSiLo.js → loop-runner-CeOM1ppe.js} +2 -2
  37. package/dist/{loop-runner-D1JzSiLo.js.map → loop-runner-CeOM1ppe.js.map} +1 -1
  38. package/dist/loop-runner-bin.d.ts +1 -1
  39. package/dist/loop-runner-bin.js +1 -1
  40. package/dist/{loop-runner-AQcWx9uu.d.ts → loop-runner-qtiWaXdo.d.ts} +2 -2
  41. package/dist/mcp/bin.js +3 -3
  42. package/dist/mcp/index.d.ts +1 -1
  43. package/dist/mcp/index.js +7 -7
  44. package/dist/mcp/memory-bin.js +1 -1
  45. package/dist/{model-policy-DTbTFyOG.js → model-policy-DFuhCC0-.js} +27 -2
  46. package/dist/model-policy-DFuhCC0-.js.map +1 -0
  47. package/dist/profiles.d.ts +1 -1
  48. package/dist/profiles.js +1 -1
  49. package/dist/{provision-supervisor-DyrYiZOg.js → provision-supervisor-BbJEoPmX.js} +8 -8
  50. package/dist/{provision-supervisor-DyrYiZOg.js.map → provision-supervisor-BbJEoPmX.js.map} +1 -1
  51. package/dist/{result-blob-store-nBpCKwFg.js → result-blob-store-CyfreDyt.js} +4 -4
  52. package/dist/{result-blob-store-nBpCKwFg.js.map → result-blob-store-CyfreDyt.js.map} +1 -1
  53. package/dist/{run-cancellation-D2fq7jx6.js → run-cancellation-CtDpDxro.js} +2 -2
  54. package/dist/{run-cancellation-D2fq7jx6.js.map → run-cancellation-CtDpDxro.js.map} +1 -1
  55. package/dist/{run-lock-Ckakh1Uq.js → run-lock-BOg7BaXF.js} +2 -2
  56. package/dist/{run-lock-Ckakh1Uq.js.map → run-lock-BOg7BaXF.js.map} +1 -1
  57. package/dist/{run-reopen-CHIodC9G.js → run-reopen-DUdBD2Pc.js} +6 -6
  58. package/dist/{run-reopen-CHIodC9G.js.map → run-reopen-DUdBD2Pc.js.map} +1 -1
  59. package/dist/{run-state-D-rOe5N8.js → run-state-CiBZNBWb.js} +7 -7
  60. package/dist/{run-state-D-rOe5N8.js.map → run-state-CiBZNBWb.js.map} +1 -1
  61. package/dist/{runtime-_AK9P7qx.js → runtime-B0TvwqD7.js} +45 -22
  62. package/dist/{runtime-_AK9P7qx.js.map → runtime-B0TvwqD7.js.map} +1 -1
  63. package/dist/{search-executor-B0NdgH8a.js → search-executor-Bj6UWrEt.js} +5 -5
  64. package/dist/{search-executor-B0NdgH8a.js.map → search-executor-Bj6UWrEt.js.map} +1 -1
  65. package/dist/{server-C4IwVj_Z.js → server-N0qXiAuK.js} +4 -4
  66. package/dist/{server-C4IwVj_Z.js.map → server-N0qXiAuK.js.map} +1 -1
  67. package/dist/{settle-record-zm4ZDjhu.js → settle-record-DpNzbua7.js} +5 -4
  68. package/dist/{settle-record-zm4ZDjhu.js.map → settle-record-DpNzbua7.js.map} +1 -1
  69. package/dist/{snapshot-BKI_w3JD.js → snapshot-BKLziJ5K.js} +12 -4
  70. package/dist/snapshot-BKLziJ5K.js.map +1 -0
  71. package/dist/{structural-rollout-uN5x6ioB.js → structural-rollout-QbwCbL0d.js} +5 -5
  72. package/dist/{structural-rollout-uN5x6ioB.js.map → structural-rollout-QbwCbL0d.js.map} +1 -1
  73. package/dist/{supervise-CJLO16hM.js → supervise-CP4Vx2s5.js} +72 -37
  74. package/dist/supervise-CP4Vx2s5.js.map +1 -0
  75. package/dist/{supervise-identity-OkAQ-Ekg.js → supervise-identity-Cub-gKEi.js} +4 -4
  76. package/dist/{supervise-identity-OkAQ-Ekg.js.map → supervise-identity-Cub-gKEi.js.map} +1 -1
  77. package/dist/{supervision-discovery-CDpfasyS.js → supervision-discovery-C633ZhS0.js} +4 -4
  78. package/dist/{supervision-discovery-CDpfasyS.js.map → supervision-discovery-C633ZhS0.js.map} +1 -1
  79. package/dist/{supervisor-D88YZZKa.js → supervisor-CYm4Nj9s.js} +14 -11
  80. package/dist/supervisor-CYm4Nj9s.js.map +1 -0
  81. package/dist/{supervisor-accounting-Bnp1WYTX.js → supervisor-accounting-BeQ8kv9H.js} +23 -10
  82. package/dist/supervisor-accounting-BeQ8kv9H.js.map +1 -0
  83. package/dist/{supervisor-root-contract-C6FYJprY.js → supervisor-root-contract-DKIxXap1.js} +3 -3
  84. package/dist/{supervisor-root-contract-C6FYJprY.js.map → supervisor-root-contract-DKIxXap1.js.map} +1 -1
  85. package/dist/testing.d.ts +1 -1
  86. package/dist/testing.js +11 -11
  87. package/dist/{tool-server-B_cNseNf.js → tool-server-B4TikIBL.js} +2 -2
  88. package/dist/{tool-server-B_cNseNf.js.map → tool-server-B4TikIBL.js.map} +1 -1
  89. package/dist/{top-web-C8MkFqf4.js → top-web-D57bqE7a.js} +29 -22
  90. package/dist/top-web-D57bqE7a.js.map +1 -0
  91. package/dist/tui/bin.js +3 -3
  92. package/dist/tui/index.d.ts +3 -2
  93. package/dist/tui/index.js +2 -2
  94. package/dist/{types-Br9sWTWk.d.ts → types-CbvBgzJB.d.ts} +17 -10
  95. package/package.json +3 -2
  96. package/dist/model-policy-DTbTFyOG.js.map +0 -1
  97. package/dist/snapshot-BKI_w3JD.js.map +0 -1
  98. package/dist/supervise-CJLO16hM.js.map +0 -1
  99. package/dist/supervisor-D88YZZKa.js.map +0 -1
  100. package/dist/supervisor-accounting-Bnp1WYTX.js.map +0 -1
  101. package/dist/top-web-C8MkFqf4.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"top-web-D57bqE7a.js","names":[],"sources":["../src/tui/top-transcript.ts","../src/tui/workflow-journal.ts","../src/tui/top-snapshot.ts","../src/tui/top-web-agent.ts","../src/tui/top-web.ts"],"sourcesContent":["import { createHash } from 'node:crypto'\nimport { closeSync, existsSync, fstatSync, openSync, readdirSync, readSync } from 'node:fs'\nimport { join } from 'node:path'\nimport { StringDecoder } from 'node:string_decoder'\nimport { AgentExactRunControlRefSchema } from '@tangle-network/agent-interface'\nimport type { AgentCandidateArtifactPort } from '../candidate-execution/types'\nimport type { PursuitNodeProjection } from '../durable/observer-projection'\nimport { FileResultBlobStore } from '../durable/spawn-journal/result-blob-store'\nimport { recordValue } from '../record-value'\nimport {\n type HarnessTranscriptArtifact,\n type HarnessTranscriptMetadata,\n harnessTranscriptArtifact,\n} from '../runtime/harness-transcript'\nimport { ROOT_STREAM_FILE } from '../runtime/supervise/root-stream'\nimport type { ResultBlobStore } from '../runtime/supervise/types'\nimport type { SupervisorView, TopSnapshotDiagnostic, WorkerView } from './top-snapshot'\n\nexport type BaselineAuthority = {\n readonly kind: 'retained-workspace' | 'git-object' | 'git-diff'\n readonly ref: string\n}\nexport type FileIdentity = { readonly sha256: string; readonly byteLength: number }\nexport interface TopInspection {\n readonly coverage: {\n readonly status: 'complete' | 'partial' | 'missing'\n readonly source: string\n readonly reason?: string\n readonly code?: 'source-mismatch' | 'source-unbound'\n readonly ref?: string\n }\n readonly rows?: readonly (TopTranscriptRow & {\n readonly id: string\n readonly sessionId: string\n readonly part: number\n })[]\n readonly context?: readonly TopTranscriptRow[]\n readonly files?: {\n readonly scope: 'workspace' | 'none'\n readonly complete: boolean\n readonly reason?: string\n readonly entries: readonly (FileIdentity & {\n readonly path: string\n readonly before?: FileIdentity & { readonly source: BaselineAuthority }\n })[]\n }\n readonly file?: FileIdentity & {\n readonly path: string\n readonly content: string\n readonly before?: FileIdentity & {\n readonly content: string\n readonly source: BaselineAuthority\n }\n }\n}\n\nexport interface TopTranscriptRow {\n at: string\n event: {\n kind: string\n text?: string\n provenance?: string\n source?: string\n actor?: string\n toolCallId?: string\n toolName?: string\n args?: unknown\n result?: unknown\n }\n}\nexport type TopSessionReader = (\n artifact: HarnessTranscriptArtifact,\n signal?: AbortSignal,\n) => Promise<readonly HarnessRowsSession[]>\n\n/** Read selected history on demand, leaving the live topology snapshot bounded and fast. */\nexport async function transcriptHistory(\n worker: WorkerView,\n runDir?: string,\n node?: PursuitNodeProjection,\n) {\n return readTopAgentHistory(\n worker,\n runDir ? new FileResultBlobStore(join(runDir, 'blobs')) : undefined,\n node,\n )\n}\n\n/** Task, result and progress use the same projection for file-backed and SQL-backed runs. */\nexport async function readTopAgentHistory(\n worker: WorkerView,\n blobs?: Pick<ResultBlobStore, 'get'>,\n node?: PursuitNodeProjection,\n) {\n const rows: TopTranscriptRow[] = []\n const identity = recordValue(node?.identity ?? worker.identity)\n if (blobs && typeof identity?.taskDigest === 'string' && worker.startedAt) {\n const task = await blobs.get(identity.taskDigest)\n if (task !== undefined)\n rows.push({\n at: worker.startedAt,\n event: {\n kind: 'notice',\n provenance: 'delegated-input',\n source: `parent ${worker.parent ?? node?.parentId ?? 'run caller'}; task ${identity.taskDigest}; profile ${identity.profileDigest}`,\n text: `Request from ${worker.parent ?? node?.parentId ?? 'run caller'}\\n${typeof task === 'string' ? task : JSON.stringify(task, null, 2)}`,\n },\n })\n }\n const progress = transcriptTail(worker)\n if (worker.startedAt)\n rows.push({\n at: worker.startedAt,\n event: {\n kind: 'notice',\n provenance: 'capture-unavailable',\n text: 'Full conversation capture has not been verified in this progress tail.',\n source: 'Runtime progress evidence',\n },\n })\n const outRef = node?.outRef ?? worker.outRef\n const result = blobs && outRef && worker.endedAt ? await blobs.get(outRef) : undefined\n if (result !== undefined)\n progress.push({\n at: worker.endedAt!,\n event: {\n kind: 'notice',\n provenance: 'recorded-result',\n source: `result ${outRef}; Runtime ResultBlobStore`,\n text: typeof result === 'string' ? result : JSON.stringify(result, null, 2),\n },\n })\n return [...rows, ...progress]\n}\n\n/** Resolve ordinary Runtime transcript evidence, never a product-specific capture registry. */\nexport async function readTopAgentInspection({\n worker,\n runId,\n blobs,\n readSessions,\n artifacts,\n signal,\n}: {\n worker: WorkerView\n runId: string\n blobs: Pick<ResultBlobStore, 'get'>\n readSessions: TopSessionReader\n artifacts?: AgentCandidateArtifactPort\n signal?: AbortSignal\n}): Promise<TopInspection> {\n const evidence = worker.harnessTranscript\n const files = {\n scope: 'none' as const,\n complete: true,\n reason: 'Transcript evidence does not include a workspace inventory',\n entries: [],\n }\n if (!evidence || evidence.status !== 'available')\n return {\n coverage: {\n status: 'missing',\n source: 'Runtime transcript receipt',\n reason: evidence?.reason ?? 'No transcript receipt was recorded',\n },\n files,\n }\n const metadata = await harnessTranscriptArtifact(evidence, blobs, { content: false, signal })\n if (!metadata) throw new Error('Available transcript receipt has no metadata')\n const binding = inspectionBinding(metadata, worker, runId)\n if (binding.mismatch.length)\n return {\n coverage: {\n status: 'missing',\n source: 'Runtime transcript receipt',\n code: 'source-mismatch',\n reason: binding.mismatch.join('; '),\n },\n files,\n }\n const artifact = await harnessTranscriptArtifact(evidence, blobs, { artifacts, signal })\n if (!artifact) throw new Error('Available transcript receipt has no artifact')\n const projection = harnessSessionRows(await readSessions(artifact, signal))\n const reasons = [\n ...binding.missing,\n ...(evidence.missing ?? []),\n ...artifact.skipped.map((file) => `${file.path}: ${file.reason}`),\n ...projection.gaps.map((gap) => `${gap.sessionId}/${gap.recordId}: ${gap.reason}`),\n ]\n const complete =\n evidence.coverageComplete === true && reasons.length === 0 && projection.rows.length > 0\n return {\n coverage: {\n status: complete ? 'complete' : 'partial',\n source: `${artifact.harness} Runtime transcript`,\n ref: `urn:${evidence.transcriptRef}`,\n ...(binding.missing.length ? { code: 'source-unbound' as const } : {}),\n ...(!complete\n ? { reason: reasons.join('; ') || 'Source completeness was not attested' }\n : {}),\n },\n rows: projection.rows,\n files,\n }\n}\n\n/** Verify the receipt belongs to the selected node before resolving any native/archive bytes. */\nfunction inspectionBinding(metadata: HarnessTranscriptMetadata, worker: WorkerView, runId: string) {\n const mismatch: string[] = [],\n missing: string[] = []\n if (metadata.binding !== undefined && !recordValue(metadata.binding))\n mismatch.push('Capture binding is malformed')\n if (metadata.source && metadata.binding) mismatch.push('Capture has conflicting source bindings')\n const source = metadata.source ?? metadata.binding\n if (!source) return { mismatch, missing: ['Capture has no recorded node binding'] }\n const node = recordValue(source.node)\n if (!node) {\n if (source.node !== undefined) mismatch.push('Capture node binding is malformed')\n else missing.push('Capture has no recorded node identity')\n } else {\n for (const [key, expected] of [\n ['rootId', runId],\n ['nodeId', worker.id],\n ['parentId', worker.parent],\n ] as const) {\n if (expected !== undefined && node[key] !== expected)\n mismatch.push(`Capture ${key} does not match selected node`)\n }\n const attempt = worker.executionBindings?.at(-1)?.attemptId\n if (typeof node.attemptId !== 'string' || !node.attemptId)\n mismatch.push('Capture attempt identity is malformed')\n else if (attempt && node.attemptId !== attempt)\n mismatch.push('Capture attempt does not match selected node')\n else if (!attempt) missing.push('Selected node has no recorded execution attempt')\n const identity = recordValue(node.identity)\n for (const key of ['profileDigest', 'taskDigest'] as const) {\n const expected = worker.identity?.[key]\n if (expected && identity?.[key] === undefined) missing.push(`Capture has no recorded ${key}`)\n else if (expected && identity?.[key] !== expected)\n mismatch.push(`Capture ${key} does not match selected node`)\n }\n }\n const materialization = worker.materialization\n if (materialization?.status !== 'known')\n missing.push('Selected node has no known materialization')\n else {\n if (source.profileDigest !== materialization.effectiveProfileDigest)\n mismatch.push('Capture profile does not match selected materialization')\n const execution = materialization.execution\n const provider = metadata.binding?.kind === 'provider'\n const kind = metadata.source || provider ? 'environment' : 'session'\n const id =\n metadata.source?.environmentId ??\n (provider\n ? recordValue(metadata.binding?.controlRef)?.environmentId\n : metadata.binding?.sessionId)\n if (execution.kind !== kind || execution.id !== id)\n mismatch.push('Capture execution does not match selected materialization')\n }\n if (\n metadata.binding &&\n (!metadata.binding.nativeSessionId ||\n !metadata.binding.sessionId ||\n (metadata.binding.kind !== 'bridge' &&\n (metadata.binding.kind !== 'provider' ||\n AgentExactRunControlRefSchema.safeParse(metadata.binding.controlRef).data?.sessionId !==\n metadata.binding.sessionId)))\n )\n mismatch.push('Capture binding is malformed')\n return { mismatch, missing }\n}\n\n/** One selected-agent mapping for filesystem and API transports; no execution or I/O. */\nexport function topAgentWorker(run: SupervisorView, workerId: string): WorkerView | undefined {\n const child = run.workers.find((worker) => worker.id === workerId)\n if (child || run.id !== workerId) return child\n return {\n id: run.id,\n label: 'root',\n status:\n run.status === 'cancelled'\n ? 'cancelled'\n : ['done', 'succeeded'].includes(run.status)\n ? 'done'\n : ['down', 'failed'].includes(run.status)\n ? 'down'\n : 'running',\n startedAt: run.startedAt,\n endedAt: run.completedAt,\n latencyMs: run.totals.latencyMs,\n spend: run.driverSpend,\n metered: { iterations: 0, tokensInput: 0, tokensOutput: 0, usd: 0, ms: 0 },\n liveTail: run.progressTail,\n }\n}\n\nexport type TopAgentMetadata = Omit<TopInspection, 'rows' | 'context'> & {\n readonly context: readonly TopTranscriptRow[]\n}\n\n/** Metadata keeps full recorded context while the conversation can show compact attribution. */\nexport function topAgentMetadata(\n inspection: TopInspection | undefined,\n recorded: readonly TopTranscriptRow[],\n): TopAgentMetadata {\n const { rows, ...metadata }: TopInspection = inspection ?? {\n coverage: {\n status: 'missing' as const,\n source: 'Runtime',\n reason: 'Verified conversation inspection was not provided',\n },\n }\n return {\n ...metadata,\n context: [\n ...(metadata.context ?? []),\n ...recorded.filter((row) => row.event.provenance === 'delegated-input'),\n ...(rows ?? []).filter((row) => row.event.provenance === 'system-instructions'),\n ],\n }\n}\n\nexport interface TopAgentRowsFrame {\n readonly generation: number\n readonly events: readonly (TopTranscriptRow & { readonly seq: number })[]\n readonly lastSeq: number\n readonly alive: boolean\n readonly window: 'verified-native' | 'recorded-tail'\n readonly coverage?: TopInspection['coverage']\n}\n\n/** Both HTTP transports share conversation selection, stable identity, sequence and batching. */\nexport type TopAgentStreamFrame =\n | { readonly event: 'reset'; readonly data: { readonly generation: number } }\n | { readonly event: 'rows'; readonly data: TopAgentRowsFrame }\n\n/** Project selected conversation rows into ordered reset and row frames. */\nexport function createTopAgentStream(generation: number) {\n let representation: string | undefined\n let initiatingInput: TopTranscriptRow | undefined\n const seen = new Set<string>()\n let lastSeq = 0\n return {\n reset: { generation },\n frame({\n recorded,\n inspection,\n alive,\n includeContext,\n }: {\n recorded: readonly TopTranscriptRow[]\n inspection?: TopInspection\n alive: boolean\n includeContext?: boolean\n }): readonly TopAgentStreamFrame[] {\n initiatingInput =\n recorded.find((row) => row.event.provenance === 'delegated-input') ?? initiatingInput\n const input = initiatingInput?.event.text\n const task = input?.includes('\\n') ? input.slice(input.indexOf('\\n') + 1) : undefined\n const hasNativePrompt =\n !!task &&\n !!inspection?.rows?.some(\n (row) =>\n row.event.kind === 'user' && row.event.actor !== 'injected' && row.event.text === task,\n )\n const shownInput =\n initiatingInput && hasNativePrompt && !includeContext\n ? {\n ...initiatingInput,\n event: {\n ...initiatingInput.event,\n text: input!.slice(0, input!.indexOf('\\n')),\n provenance: 'recorded-sender',\n },\n }\n : initiatingInput\n const next = inspection?.rows?.length\n ? `capture:${inspection.coverage.ref ?? inspection.coverage.source}:${hasNativePrompt}`\n : 'progress'\n const frames: TopAgentStreamFrame[] = []\n if (representation !== undefined && representation !== next) {\n seen.clear()\n lastSeq = 0\n generation += 1\n frames.push({ event: 'reset', data: { generation } })\n }\n representation = next\n const rows = inspection?.rows?.length\n ? [\n ...(shownInput ? [shownInput] : []),\n ...recorded.filter(\n (row) =>\n inspection.coverage.status !== 'complete' &&\n row.event.provenance === 'recorded-result',\n ),\n ...inspection.rows.filter(\n (row) => includeContext || row.event.provenance !== 'system-instructions',\n ),\n ]\n : recorded\n const events = rows.flatMap((row) => {\n const key =\n 'id' in row && typeof row.id === 'string'\n ? row.id\n : createHash('sha256').update(JSON.stringify(row)).digest('hex')\n if (seen.has(key)) return []\n seen.add(key)\n if (next === 'progress' && seen.size > 2000) seen.delete(seen.values().next().value!)\n return [{ ...row, seq: ++lastSeq }]\n })\n for (let offset = 0; offset < Math.max(events.length, 1); offset += 100) {\n const batch = events.slice(offset, offset + 100)\n frames.push({\n event: 'rows',\n data: {\n generation,\n events: batch,\n lastSeq: batch.at(-1)?.seq ?? lastSeq,\n alive,\n window:\n inspection?.coverage.status === 'complete' ? 'verified-native' : 'recorded-tail',\n ...(inspection ? { coverage: inspection.coverage } : {}),\n },\n })\n }\n return frames\n },\n }\n}\n\n/** Router records are Runtime's canonical ToolLoopMessageRecord, not a native file heuristic. */\nexport async function retainedRouterInspection(worker: WorkerView, runDir?: string) {\n const evidence = worker.harnessTranscript\n if (\n !runDir ||\n evidence?.status !== 'available' ||\n evidence.harness !== 'router' ||\n !worker.endedAt\n )\n return undefined\n const artifact = await harnessTranscriptArtifact(\n evidence,\n new FileResultBlobStore(join(runDir, 'blobs')),\n )\n if (!artifact || !('files' in artifact)) return undefined\n const records = artifact.files.flatMap((file) =>\n 'content' in file\n ? file.content\n .split('\\n')\n .filter(Boolean)\n .map((line) => recordValue(JSON.parse(line)))\n .filter((row) => row && typeof row.role === 'string')\n : [],\n )\n const rows = records.flatMap((message, index) =>\n transcriptRows({ liveTail: [JSON.stringify({ at: worker.endedAt, message })] }).map(\n (row, part) => ({\n ...row,\n id: JSON.stringify([evidence.transcriptRef, index, part]),\n sessionId: `router:${worker.id}`,\n part,\n event: {\n ...row.event,\n provenance: 'router-transcript',\n source: 'Message time unknown; shown at captured settlement time',\n },\n }),\n ),\n )\n return {\n coverage: {\n status: 'partial' as const,\n source: 'Runtime Router conversation, displayed at recorded settlement time',\n reason: 'Per-message times were not captured',\n ref: `urn:${evidence.transcriptRef}`,\n },\n rows,\n files: {\n scope: 'none' as const,\n complete: true,\n reason: 'This in-process conversation has no sandbox workspace inventory',\n entries: [],\n },\n }\n}\n\n/** Present the recorded tail through sandbox-ui's existing agent-stream contract. */\nexport function transcriptRows(worker: Pick<WorkerView, 'liveTail'>) {\n const rows: TopTranscriptRow[] = []\n for (const line of worker.liveTail) {\n let value: Record<string, unknown> | undefined\n try {\n value = recordValue(JSON.parse(line))\n } catch {\n continue\n }\n const timestamp = value?.timestamp ?? value?.at\n const time = typeof timestamp === 'string' ? Date.parse(timestamp) : timestamp\n if (typeof time !== 'number' || !Number.isFinite(new Date(time).getTime())) continue\n const at = new Date(time).toISOString()\n const push = (event: (typeof rows)[number]['event']) => rows.push({ at, event })\n const event = recordValue(value?.event)\n if (typeof event?.kind === 'string') {\n const kind =\n (\n {\n text_delta: 'text',\n reasoning_delta: 'reasoning',\n tool_call: 'tool-call',\n tool_result: 'tool-result',\n } as Record<string, string>\n )[event.kind] ?? event.kind\n push({ ...event, kind })\n }\n if (event?.kind) continue\n const legacy = (event: (typeof rows)[number]['event']) =>\n push({\n ...event,\n provenance: 'unverified-progress',\n source: 'Legacy progress only; full capture is unverified',\n })\n const message = recordValue(value?.message)\n if (!message) continue\n if (message.role === 'tool') {\n legacy({\n kind: 'tool-result',\n toolCallId: String(message.tool_call_id),\n result: message.content,\n })\n continue\n }\n for (const item of Array.isArray(message.tool_calls) ? message.tool_calls : []) {\n const call = recordValue(item),\n fn = recordValue(call?.function)\n if (call && fn)\n legacy({\n kind: 'tool-call',\n toolCallId: String(call.id),\n toolName: String(fn.name),\n args: fn.arguments,\n })\n }\n const parts =\n typeof message.content === 'string'\n ? [{ type: 'text', text: message.content }]\n : Array.isArray(message.content)\n ? message.content\n : []\n for (const part of parts) {\n if (!recordValue(part)) continue\n if (part.type === 'text' && typeof part.text === 'string' && part.text.length > 0)\n legacy({ kind: message.role === 'user' ? 'user' : 'text', text: part.text })\n else if (part.type === 'thinking' && typeof part.thinking === 'string')\n legacy({ kind: 'reasoning', text: part.thinking })\n else if (part.type === 'tool_use')\n legacy({\n kind: 'tool-call',\n toolCallId: String(part.id),\n toolName: String(part.name),\n args: part.input,\n })\n else if (part.type === 'tool_result')\n legacy({ kind: 'tool-result', toolCallId: String(part.tool_use_id), result: part.content })\n }\n }\n return rows\n}\n\n/** The bounded native/normalized tail shared by snapshot adapters and selected streams. */\nexport function readTranscriptTail(file: string) {\n return readRecordedEvents(file, 200).lines\n}\n\nexport function transcriptTail(worker: WorkerView) {\n return transcriptRows(\n worker.eventFile ? { ...worker, liveTail: readTranscriptTail(worker.eventFile) } : worker,\n )\n}\n\n/** Actual recorded event time and cadence; absence means no event evidence, never file mtime. */\nexport interface RecordedActivity {\n readonly lastActivityAt?: number\n readonly medianEventGapMs?: number\n}\n\nexport interface RecordedEvents {\n readonly file: string\n readonly lines: string[]\n readonly activity: RecordedActivity\n readonly firstActivityAt?: number\n}\n\ninterface Cursor {\n dev: number\n ino: number\n offset: number\n pending: string\n decoder: StringDecoder\n times: number[]\n lines: string[]\n result: RecordedEvents\n}\n\nconst cursors = new Map<string, Cursor>()\nconst activityKinds = new Set([\n 'text',\n 'reasoning',\n 'user',\n 'tool-call',\n 'tool-result',\n 'interaction',\n 'child_task',\n])\n\nfunction recordedActivity(line: string) {\n return transcriptRows({ liveTail: [line] }).find((row) => activityKinds.has(row.event.kind))\n}\n\n/** Read appended UTF-8 bytes once; complete EOF JSON follows the durable reader contract. */\nexport function readRecordedEvents(file: string, maxLines = 8): RecordedEvents {\n const fd = openSync(file, 'r')\n try {\n const stat = fstatSync(fd)\n let cursor = cursors.get(file)\n if (\n !cursor ||\n cursor.dev !== stat.dev ||\n cursor.ino !== stat.ino ||\n stat.size < cursor.offset\n ) {\n cursor = {\n dev: stat.dev,\n ino: stat.ino,\n offset: 0,\n pending: '',\n decoder: new StringDecoder('utf8'),\n times: [],\n lines: [],\n result: { file, lines: [], activity: {} },\n }\n cursors.set(file, cursor)\n }\n if (stat.size === cursor.offset)\n return { ...cursor.result, lines: cursor.result.lines.slice(-maxLines) }\n const lines = [...cursor.lines]\n const buffer = Buffer.alloc(Math.min(65_536, stat.size - cursor.offset))\n while (cursor.offset < stat.size) {\n const bytes = readSync(\n fd,\n buffer,\n 0,\n Math.min(buffer.length, stat.size - cursor.offset),\n cursor.offset,\n )\n if (!bytes) break\n cursor.offset += bytes\n const rows = (cursor.pending + cursor.decoder.write(buffer.subarray(0, bytes))).split('\\n')\n cursor.pending = rows.pop()!\n for (const line of rows) {\n if (!line.trim()) continue\n lines.push(line)\n if (lines.length > 200) lines.shift()\n // One source row is one instant even when a native message contains several parts.\n const activity = recordedActivity(line)\n if (activity) cursor.times.push(Date.parse(activity.at))\n }\n }\n cursor.lines = lines\n // A complete EOF row is valid durable JSONL. Keep it separate until its newline arrives.\n let pending: string[] = []\n if (cursor.pending.trim()) {\n try {\n JSON.parse(cursor.pending)\n pending = [cursor.pending]\n } catch {\n // A torn row is still private to its writer.\n }\n }\n const final = pending.length ? recordedActivity(pending[0]!) : undefined\n const times = (final ? [...cursor.times, Date.parse(final.at)] : cursor.times).sort(\n (a, b) => a - b,\n )\n const gaps = times\n .slice(1)\n .map((at, i) => at - times[i]!)\n .sort((a, b) => a - b)\n const mid = Math.floor(gaps.length / 2)\n cursor.result = {\n file,\n lines: [...lines, ...pending].slice(-200),\n ...(times.length ? { firstActivityAt: times[0]! } : {}),\n activity: {\n ...(times.length ? { lastActivityAt: times.at(-1)! } : {}),\n ...(gaps.length\n ? { medianEventGapMs: (gaps[Math.floor((gaps.length - 1) / 2)]! + gaps[mid]!) / 2 }\n : {}),\n },\n }\n return { ...cursor.result, lines: cursor.result.lines.slice(-maxLines) }\n } catch (error) {\n cursors.delete(file)\n throw error\n } finally {\n closeSync(fd)\n }\n}\n\n/** Read native progress files with bounded, path-only diagnostics. */\nexport function readWorkerEventTails(dir: string) {\n const out = new Map<string, RecordedEvents>()\n const diagnostics: TopSnapshotDiagnostic[] = []\n const read = (path: string, key = join(dir, path)) => {\n try {\n if (existsSync(join(dir, path))) out.set(key, readRecordedEvents(join(dir, path)))\n } catch {\n diagnostics.push({ source: 'worker-tail', path, reason: 'unreadable' })\n }\n }\n read(ROOT_STREAM_FILE)\n for (const folder of ['workers', 'streams']) {\n if (!existsSync(join(dir, folder))) continue\n try {\n for (const entry of readdirSync(join(dir, folder))) {\n // Inbox steer requests are not evidence that the executor emitted progress.\n if (folder === 'workers' && entry.endsWith('.ndjson') && !entry.endsWith('.inbox.ndjson'))\n read(join(folder, entry), entry.slice(0, -'.ndjson'.length))\n else if (folder === 'streams' && entry.endsWith('.jsonl')) read(join(folder, entry))\n }\n } catch {\n diagnostics.push({ source: 'worker-tail', path: folder, reason: 'unreadable' })\n }\n }\n return { value: out, diagnostics }\n}\n\n/** The normalized subset consumed here; native decoding stays with harness-sessions. */\nexport interface HarnessRowsSession {\n readonly nativeSessionId: string\n readonly messages: readonly {\n readonly id: string\n readonly at?: string | null\n readonly role: string\n readonly actor?: string\n readonly parts: readonly {\n readonly type: string\n readonly text?: string\n readonly toolCallId?: string\n }[]\n }[]\n readonly toolCalls: readonly {\n readonly id: string\n readonly name: string\n readonly startedAt?: string | null\n readonly endedAt?: string | null\n readonly input?: unknown\n readonly inputText?: string | null\n readonly result?: { readonly output?: unknown; readonly text?: string | null } | null\n }[]\n}\nexport type HarnessRowsGap = {\n readonly sessionId: string\n readonly recordId: string\n readonly reason: string\n}\nexport type HarnessSessionRow = TopTranscriptRow & {\n readonly id: string\n readonly sessionId: string\n readonly part: number\n}\n\n/** One ordered projection for every strict native reader, with explicit unrenderable evidence. */\nexport function harnessSessionRows(sessions: readonly HarnessRowsSession[]) {\n const rows: HarnessSessionRow[] = []\n const gaps: HarnessRowsGap[] = []\n for (const session of sessions) {\n const emitted = new Set<string>()\n const push = (\n recordId: string,\n part: number,\n value: string | null | undefined,\n event: HarnessSessionRow['event'],\n ) => {\n if (!value || !Number.isFinite(Date.parse(value))) {\n gaps.push({\n sessionId: session.nativeSessionId,\n recordId,\n reason: 'Native record has no valid recorded time',\n })\n return\n }\n rows.push({\n id: JSON.stringify([session.nativeSessionId, event.kind, recordId, part]),\n sessionId: session.nativeSessionId,\n part,\n at: new Date(value).toISOString(),\n event: event.actor === 'injected' ? { ...event, provenance: 'system-instructions' } : event,\n })\n }\n const tool = (\n id: string,\n result: boolean,\n at?: string | null,\n recordId = id,\n part = 0,\n actor?: string,\n ) => {\n const call = session.toolCalls.find((item) => item.id === id)\n if (!call || (result && !call.result)) {\n gaps.push({\n sessionId: session.nativeSessionId,\n recordId: id,\n reason: 'Referenced tool evidence is missing',\n })\n return\n }\n const key = `${result ? 'result' : 'call'}:${id}`\n if (emitted.has(key)) return\n emitted.add(key)\n const toolCallId = `${session.nativeSessionId}:${id}`\n push(\n recordId,\n part,\n at ?? (result ? call.endedAt : call.startedAt),\n result\n ? {\n kind: 'tool-result',\n toolCallId,\n result: call.result?.output ?? call.result?.text,\n actor,\n ...(actor ? { source: `Native actor ${actor}` } : {}),\n }\n : {\n kind: 'tool-call',\n toolCallId,\n toolName: call.name,\n args: call.input ?? call.inputText,\n actor,\n ...(actor ? { source: `Native actor ${actor}` } : {}),\n },\n )\n }\n for (const message of session.messages)\n for (const [part, value] of message.parts.entries()) {\n if (value.type === 'tool-call' || value.type === 'tool-result')\n tool(\n value.toolCallId ?? '',\n value.type === 'tool-result',\n message.at,\n message.id,\n part,\n message.actor,\n )\n else if ((value.type === 'text' || value.type === 'reasoning') && value.text)\n push(message.id, part, message.at, {\n kind:\n value.type === 'reasoning'\n ? 'reasoning'\n : message.role === 'user'\n ? 'user'\n : message.role === 'assistant'\n ? 'text'\n : 'notice',\n text: value.text,\n actor: message.actor,\n ...(message.actor ? { source: `Native actor ${message.actor}` } : {}),\n ...(!['user', 'assistant', 'tool'].includes(message.role)\n ? { provenance: 'system-instructions', source: message.role }\n : {}),\n })\n else if (value.type !== 'text' && value.type !== 'reasoning')\n gaps.push({\n sessionId: session.nativeSessionId,\n recordId: message.id,\n reason: `Native ${value.type} content is retained but not projected inline`,\n })\n }\n for (const call of session.toolCalls) {\n if (!emitted.has(`call:${call.id}`)) {\n gaps.push({\n sessionId: session.nativeSessionId,\n recordId: call.id,\n reason: 'Tool call has no ordered message-part reference',\n })\n tool(call.id, false)\n }\n if (call.result && !emitted.has(`result:${call.id}`)) {\n gaps.push({\n sessionId: session.nativeSessionId,\n recordId: call.id,\n reason: 'Tool result has no ordered message-part reference',\n })\n tool(call.id, true)\n }\n }\n }\n // Stable sort preserves the recorded session/message/part order when clocks are equal.\n return { rows: rows.sort((a, b) => a.at.localeCompare(b.at)), gaps }\n}\n","import { basename, join } from 'node:path'\nimport { parseCommittedJsonLines } from '../durable/jsonl-file'\nimport type { TopJournalEvent } from './top-snapshot'\nimport { type RecordedEvents, readRecordedEvents } from './top-transcript'\n\n/** Native workflows have no Runtime accounting. Translate recorded lifecycle only. */\nexport function workflowJournal(runDir: string, text: string) {\n const rows = parseCommittedJsonLines<Record<string, unknown>>(text, 'journal.jsonl')\n const events: TopJournalEvent[] = []\n const tails = new Map<string, RecordedEvents>()\n let first: string | undefined\n for (const row of rows) {\n if (typeof row.agentId !== 'string' || !/^[\\w-]+$/.test(row.agentId)) continue\n const id = row.agentId\n if (row.type === 'started') {\n const file = join(runDir, `agent-${id}.jsonl`)\n let start: string | undefined\n try {\n const recorded = readRecordedEvents(file)\n tails.set(id, recorded)\n if (recorded.firstActivityAt !== undefined)\n start = new Date(recorded.firstActivityAt).toISOString()\n } catch (error) {\n if ((error as NodeJS.ErrnoException).code !== 'ENOENT') throw error\n }\n if (start && (!first || start < first)) first = start\n events.push({\n kind: 'spawned',\n id,\n label: typeof row.label === 'string' ? row.label : id,\n runtime: 'claude-code',\n ...(start ? { at: start } : {}),\n })\n events.push({ kind: 'metered', id, spend: { usdKnown: false, tokensKnown: false } })\n } else if (row.type === 'result' || row.type === 'error' || row.type === 'cancelled') {\n const activity = tails.get(id)?.activity.lastActivityAt\n const at = activity === undefined ? undefined : new Date(activity).toISOString()\n const reason = typeof row.reason === 'string' ? { reason: row.reason } : {}\n events.push(\n row.type === 'cancelled'\n ? { kind: 'cancelled', id, ...(at ? { at } : {}), ...reason }\n : {\n kind: 'settled',\n id,\n status: row.type === 'error' ? 'down' : 'done',\n ...(at ? { at } : {}),\n spent: { usdKnown: false, tokensKnown: false },\n ...reason,\n },\n )\n }\n }\n return { id: basename(runDir), events, tails, first }\n}\n","/** Read-only topology, activity and accounting over writer-owned workspace and durable journals.\n * ANSI presentation lives in `./top-frame`.\n * @experimental\n */\n\nimport { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'\nimport { join, resolve } from 'node:path'\nimport { isRecord } from '@tangle-network/agent-core'\nimport { FileObserverJournal, type ObserverRecord } from '../durable/observer-journal'\nimport {\n type PursuitProjection,\n type PursuitRunProjection,\n projectPursuit,\n} from '../durable/observer-projection'\nimport { readFailureRecord, readSettleRecord } from '../durable/settle-record'\nimport { FileSpawnJournal } from '../durable/spawn-journal/journal-store'\nimport { spawnJournalRecordEvents } from '../durable/spawn-journal/record-events'\nimport { discoverDurableSupervisionRun } from '../durable/supervision-discovery'\nimport { FileCoordinationLog } from '../runtime/supervise/coordination-log'\nimport { nodeStreamFile, ROOT_STREAM_FILE } from '../runtime/supervise/root-stream'\nimport {\n legacySupervisorRunsRoot,\n safeWorkerFile,\n supervisorRunsRoot,\n} from '../runtime/supervise/run-layout'\nimport { rootCoordinationOwner } from '../runtime/supervise/supervise-identity'\nimport type { Spend, SpendChannel, SupervisedResult } from '../runtime/supervise/types'\nimport { type RecordedEvents, readWorkerEventTails } from './top-transcript'\nimport type {\n BudgetStats,\n Distribution,\n SpendStats,\n SupervisorState,\n SupervisorTotals,\n SupervisorView,\n TopJournalEvent,\n TopSnapshot,\n TopSnapshotDiagnostic,\n TopSnapshotDiagnosticReason,\n TopSnapshotDiagnosticSource,\n WorkerView,\n} from './top-types'\nimport { workflowJournal } from './workflow-journal'\n\nexport type {\n BudgetStats,\n Distribution,\n SpendStats,\n SupervisorState,\n SupervisorTotals,\n SupervisorView,\n TopJournalEvent,\n TopSnapshot,\n TopSnapshotCompleteness,\n TopSnapshotDiagnostic,\n TopSnapshotDiagnosticReason,\n TopSnapshotDiagnosticSource,\n WorkerView,\n} from './top-types'\n\ntype MutableWorker = {\n -readonly [Key in keyof Omit<WorkerView, 'latencyMs'>]: WorkerView[Key]\n}\n\n/** A recovered value and bounded, run-relative read diagnostics. */\ninterface SourceRead<T> {\n readonly value: T\n readonly diagnostics: readonly TopSnapshotDiagnostic[]\n}\n\nconst emptySpend: SpendStats = { iterations: 0, tokensInput: 0, tokensOutput: 0, usd: 0, ms: 0 }\n\n/** Read a point-in-time view without writing to the run. Missing or partial sources report\n * bounded diagnostics, and live event readers cache append offsets. `now` controls elapsed time.\n */\nexport function loadTopSnapshot(rootDir: string, now?: number): TopSnapshot\nexport function loadTopSnapshot(\n rootDir: string,\n options: { runDir: string; now?: number; format?: 'workflow' | 'journal' },\n): Promise<TopSnapshot>\nexport function loadTopSnapshot(\n rootDir: string,\n input: number | { runDir: string; now?: number; format?: 'workflow' | 'journal' } = Date.now(),\n): TopSnapshot | Promise<TopSnapshot> {\n if (typeof input !== 'number' && input.format === 'journal')\n return loadDurableTopSnapshot(rootDir, input.runDir, input.now ?? Date.now(), false)\n if (typeof input !== 'number' && input.format === 'workflow') {\n const root = resolve(rootDir),\n dir = resolve(input.runDir),\n now = input.now ?? Date.now()\n const read = readSourceFile(join(dir, 'journal.jsonl'), 'journal', 'journal.jsonl')\n if (read.value === undefined)\n return Promise.resolve(\n topSnapshot(\n root,\n now,\n [],\n read.diagnostics.length\n ? [...read.diagnostics]\n : [{ source: 'journal', path: 'journal.jsonl', reason: 'missing' }],\n ),\n )\n try {\n const journal = workflowJournal(dir, read.value)\n const supervisor = buildSupervisorView(\n {\n id: journal.id,\n task: journal.id,\n status: 'unobserved',\n workspaceDir: root,\n budget: 0,\n budgetKnown: false,\n ...(journal.first ? { startedAt: journal.first } : {}),\n },\n dir,\n journal.events,\n [],\n now,\n journal.tails,\n )\n return Promise.resolve(\n topSnapshot(root, now, [\n {\n ...supervisor,\n driverSpend: { ...supervisor.driverSpend, usdKnown: false, tokensKnown: false },\n totals: { ...supervisor.totals, usdKnown: false, tokensKnown: false },\n },\n ]),\n )\n } catch {\n return Promise.resolve(\n topSnapshot(\n root,\n now,\n [],\n [{ source: 'journal', path: 'journal.jsonl', reason: 'invalid-state' }],\n ),\n )\n }\n }\n if (typeof input !== 'number')\n return loadDurableTopSnapshot(rootDir, input.runDir, input.now ?? Date.now())\n const now = input\n const root = resolve(rootDir)\n const supervisors: SupervisorView[] = []\n const diagnostics: TopSnapshotDiagnostic[] = []\n let discovered = 0\n const report = (runId: string, sources: readonly TopSnapshotDiagnostic[]): void => {\n for (const source of sources) diagnostics.push({ ...source, runId })\n }\n // `.loops` is the pre-rename state dir; runs already on disk there stay visible.\n for (const runsRoot of [supervisorRunsRoot(root), legacySupervisorRunsRoot(root)]) {\n if (!existsSync(runsRoot)) continue\n for (const entry of readdirSync(runsRoot)) {\n const dir = join(runsRoot, entry)\n if (!isDirectory(dir)) continue\n discovered += 1\n const state = readSupervisorState(dir)\n report(entry, state.diagnostics)\n if (!state.value) continue\n const journal = readJournal(dir)\n const progress = readSourceFile(join(dir, 'progress.ndjson'), 'progress', 'progress.ndjson')\n const workerEvents = readWorkerEventTails(dir)\n report(entry, [...journal.diagnostics, ...progress.diagnostics, ...workerEvents.diagnostics])\n supervisors.push(\n buildSupervisorView(\n state.value,\n dir,\n journal.value,\n tailLines(progress.value, 8),\n now,\n workerEvents.value,\n ),\n )\n }\n }\n supervisors.sort((a, b) => String(b.startedAt ?? '').localeCompare(String(a.startedAt ?? '')))\n return topSnapshot(root, now, supervisors, diagnostics, discovered)\n}\n\n/** Combine supervisor projections and source diagnostics into one snapshot. */\nexport function topSnapshot(\n root: string,\n now: number,\n supervisors: SupervisorView[],\n diagnostics: TopSnapshotDiagnostic[] = [],\n discovered = 1,\n pursuit?: PursuitProjection,\n): TopSnapshot {\n return {\n root,\n generatedAt: now,\n supervisors,\n completeness: diagnostics.length ? 'partial' : 'complete',\n diagnostics,\n discovered,\n loaded: supervisors.length,\n ...(pursuit ? { pursuit } : {}),\n }\n}\n\n/** Observer-backed and older spawn-only runs share topology; missing accounting stays unknown. */\nasync function loadDurableTopSnapshot(\n rootDir: string,\n runDir: string,\n now: number,\n observed = true,\n): Promise<TopSnapshot> {\n const root = resolve(rootDir)\n let pursuit: PursuitProjection | undefined\n let observations: readonly ObserverRecord[] = []\n let source: TopSnapshotDiagnosticSource = observed ? 'observer-journal' : 'journal'\n let path = observed ? 'observer.jsonl' : 'spawn-journal.jsonl'\n try {\n if (typeof runDir !== 'string' || !runDir.trim())\n throw new TypeError('runDir must be non-empty')\n if (observed) {\n const journal = await FileObserverJournal.open(join(resolve(runDir), path))\n if (!journal) return topSnapshot(root, now, [], [{ source, path, reason: 'missing' }])\n observations = await journal.read()\n pursuit = projectPursuit(observations)\n }\n source = 'journal'\n path = '.'\n const discovery = await discoverDurableSupervisionRun(runDir)\n path = 'spawn-journal.jsonl'\n const journal = new FileSpawnJournal(discovery.spawnJournalPath)\n const latest = new Map(pursuit?.runs.map((run) => [run.runId, run]))\n // A child's metered turns already belong to its spawn tree, not another supervisor row.\n const ids = pursuit\n ? [...latest.keys()].filter(\n (id) => !discovery.roots.some((parent) => id.startsWith(`${parent}/`)),\n )\n : discovery.roots\n path = 'result.json'\n const settled = await readSettleRecord(discovery.runDir)\n if (settled && !ids.includes(settled.tree.root))\n throw new Error('settle root is not discovered')\n path = 'failure.json'\n const failure = await readFailureRecord(discovery.runDir)\n const tails = readWorkerEventTails(discovery.runDir)\n const log = new FileCoordinationLog(discovery.coordinationLogPath)\n path = 'coordination-log.jsonl'\n const supervisors = await Promise.all(\n ids.map(async (id) => {\n const accounting = latest.get(id)\n const binding = discovery.roots.indexOf(id)\n // Retained admissions can predate the spawn journal. An existing journal must bind the root.\n if (binding < 0 && existsSync(discovery.spawnJournalPath))\n throw new Error('observer run has no discovered spawn root')\n const events = binding < 0 ? [] : ((await journal.loadTree(id)) ?? [])\n const spawn = events.find((event) => event.kind === 'spawned' && event.id === id)\n const reopen = events\n .filter(\n (event) => event.kind === 'reopened' && event.id === id && event.budget !== undefined,\n )\n .at(-1)\n const budget =\n reopen?.kind === 'reopened' && reopen.budget\n ? reopen.budget.maxTokens\n : spawn?.kind === 'spawned'\n ? spawn.budget?.maxTokens\n : undefined\n const boundary = observations.find(\n (record) => record.sequence === accounting?.firstSequence,\n )?.event?.payload\n const coordinationOffset = isRecord(boundary) ? boundary.coordinationOffset : undefined\n\n const outcome: SupervisorView['outcome'] =\n settled?.tree.root === id\n ? settled.kind === 'winner'\n ? { kind: 'winner' }\n : {\n kind: 'no-winner',\n reason: settled.reason,\n ...(settled.reason === 'driver-failed' &&\n settled.error.failure?.providerTraceId !== undefined\n ? { providerTraceId: settled.error.failure.providerTraceId }\n : {}),\n }\n : failure?.runId === id && accounting?.status === 'down'\n ? {\n kind: 'failed',\n reason: failure.error.message,\n ...(failure.error.providerTraceId === undefined\n ? {}\n : { providerTraceId: failure.error.providerTraceId }),\n }\n : undefined\n const prior =\n spawn?.kind === 'spawned' && spawn.identity\n ? await log.load(id, rootCoordinationOwner(spawn.identity))\n : undefined\n let lastRoute: SupervisorView['lastRoute']\n const records = prior?.records ?? []\n if (\n coordinationOffset !== undefined &&\n (typeof coordinationOffset !== 'number' ||\n !Number.isSafeInteger(coordinationOffset) ||\n coordinationOffset < 0 ||\n coordinationOffset > records.length)\n )\n throw new Error('invalid attempt coordination offset')\n const offset =\n typeof coordinationOffset === 'number'\n ? coordinationOffset\n : accounting?.attemptIndex === 0\n ? 0\n : records.length\n for (const { event } of records.slice(offset)) {\n if (\n event.type === 'route' &&\n (event.route.kind === 'stopped' || event.route.kind === 'unrouted')\n )\n lastRoute = event.route\n }\n const startedAt = accounting\n ? new Date(accounting.firstObservedAt).toISOString()\n : discovery.rootsBegunAt[binding]\n const view = buildSupervisorView(\n {\n id,\n task: id,\n workspaceDir: root,\n status: accounting?.status ?? 'running',\n budget: budget ?? 0,\n budgetKnown: budget !== undefined,\n ...(startedAt == null ? {} : { startedAt }),\n ...(accounting?.settledAt === undefined\n ? {}\n : { completedAt: new Date(accounting.settledAt).toISOString() }),\n },\n discovery.runDir,\n events.filter(isSpawnEvent),\n accounting?.error ? [accounting.error] : [],\n now,\n tails.value,\n accounting,\n settled?.tree.root === id ? settled : undefined,\n )\n if (!accounting && !(settled?.tree.root === id && settled.spentTotal))\n Object.assign(view.totals, { usdKnown: false, tokensKnown: false })\n if (outcome)\n Object.assign(view, {\n outcome,\n status: outcome.kind === 'winner' ? 'done' : outcome.kind,\n })\n if (lastRoute)\n Object.assign(view, {\n lastRoute,\n reason: lastRoute.kind === 'stopped' ? lastRoute.reason : lastRoute.detail,\n })\n else if (outcome && 'reason' in outcome) Object.assign(view, { reason: outcome.reason })\n return view\n }),\n )\n return topSnapshot(\n root,\n now,\n supervisors,\n [\n ...(!observed\n ? [\n {\n source: 'observer-journal' as const,\n path: 'observer.jsonl',\n reason: 'missing' as const,\n },\n ]\n : []),\n ...tails.diagnostics,\n ],\n observed ? 1 : ids.length,\n pursuit,\n )\n } catch (error) {\n const reason =\n isRecord(error) && typeof error.code === 'string' ? 'unreadable' : 'invalid-state'\n return topSnapshot(root, now, [], [{ source, path, reason }], 1, pursuit)\n }\n}\n\nfunction observerSpend(spend: Spend | undefined, gaps: readonly SpendChannel[] = []): SpendStats {\n const parsed = parseSpend(spend)\n return {\n ...parsed,\n usdKnown: spend !== undefined && parsed.usdKnown !== false && !gaps.includes('usd'),\n tokensKnown: spend !== undefined && parsed.tokensKnown !== false && !gaps.includes('tokens'),\n }\n}\n\n/** Current writer-owned journal first; retain the retired name for recorded runs. */\nfunction readJournal(eventDir: string): SourceRead<TopJournalEvent[]> {\n const path = ['spawn-journal.jsonl', 'journal.jsonl'].find((candidate) =>\n existsSync(join(eventDir, candidate)),\n )\n if (!path) return { value: [], diagnostics: [] }\n const read = readSourceFile(join(eventDir, path), 'journal', path)\n if (read.value === undefined) return { value: [], diagnostics: read.diagnostics }\n const out: TopJournalEvent[] = []\n let partial = false\n for (const line of read.value.split('\\n')) {\n const trimmed = line.trim()\n if (!trimmed) continue\n try {\n const parsed = JSON.parse(trimmed) as Record<string, unknown>\n const events =\n parsed.kind === 'event' || parsed.kind === 'events'\n ? spawnJournalRecordEvents(parsed)\n : [parsed]\n for (const event of events) if (isSpawnEvent(event)) out.push(event)\n } catch {\n // A corrupt line is expected while the writer is mid-append; keep the lines that parsed.\n partial = true\n }\n }\n return {\n value: out,\n diagnostics: partial ? [{ source: 'journal', path, reason: 'partial-json' }] : [],\n }\n}\n\n/** The settled spawn event's retained-conversation receipt, read without widening the public\n * `TopJournalEvent` type; the spawn journal already validated the record. */\nfunction retainedTranscript(event: object): { ref: string; harness: string } | undefined {\n const retained = (event as { harnessTranscript?: unknown }).harnessTranscript\n if (typeof retained !== 'object' || retained === null) return undefined\n const { status, transcriptRef, harness } = retained as Record<string, unknown>\n return status === 'available' && typeof transcriptRef === 'string' && typeof harness === 'string'\n ? { ref: transcriptRef, harness }\n : undefined\n}\n\n/** The canonical spawn receipt owns the cause; the public journal view stays compatible. */\nfunction recordedReason(event?: object): string | undefined {\n return isRecord(event) && typeof event.reason === 'string' ? event.reason : undefined\n}\n\n/** Project committed lifecycle and spend evidence into one supervisor view. */\nexport function buildSupervisorView(\n state: SupervisorState,\n stateDir: string,\n events: readonly TopJournalEvent[],\n progressTail: readonly string[],\n now: number,\n workerEventTails = new Map<string, RecordedEvents>(),\n accounting?: PursuitRunProjection,\n settled?: SupervisedResult<unknown>,\n): SupervisorView {\n const workers = new Map<string, MutableWorker>()\n let driverSpend = emptySpend\n // State and journal have different producers and root ids. Exclude both, or the journal's\n // root becomes a phantom running worker that captures steer and cancel operations.\n const journalRootId = events.find(\n (event) => event.kind === 'spawned' && !event.parent && event.label === 'root',\n )?.id\n const isRoot = (id: string): boolean => id === state.id || id === journalRootId\n const terminal = accounting\n ? undefined\n : events\n .filter(\n (event) => isRoot(event.id) && (event.kind === 'settled' || event.kind === 'cancelled'),\n )\n .at(-1)\n const rootReason = recordedReason(terminal) ?? state.reason\n\n for (const event of events) {\n if (isRoot(event.id) || (event.kind === 'spawned' && !event.parent && event.label === 'root')) {\n if (event.kind === 'metered' && event.accountingOnly !== true) {\n driverSpend = addSpend(driverSpend, parseSpend(event.spend))\n }\n continue\n }\n const worker = ensureWorker(workers, event.id)\n if (event.kind === 'spawned') {\n for (const key of [\n 'endedAt',\n 'outRef',\n 'harnessTranscript',\n 'transcript',\n 'reason',\n 'infra',\n 'verdict',\n ] as const)\n delete worker[key]\n worker.label = event.label ?? worker.label\n if (event.identity) worker.identity = event.identity\n if (event.parent) worker.parent = event.parent\n if (event.runtime) worker.runtime = event.runtime\n worker.status = 'running'\n if (event.at) worker.startedAt = event.at\n const budget = parseBudget(event.budget)\n if (budget) worker.budget = budget\n } else if (event.kind === 'materialized' || event.kind === 'seat-materialized') {\n worker.materialization = event.receipt\n } else if (event.kind === 'execution-bound') {\n worker.executionBindings = [...(worker.executionBindings ?? []), event.binding]\n } else if (event.kind === 'settled' || event.kind === 'cancelled') {\n if (event.at) worker.endedAt = event.at\n const reason = recordedReason(event)\n if (reason !== undefined) worker.reason = reason\n if (event.kind === 'settled') {\n worker.status = event.status === 'down' ? 'down' : 'done'\n if (event.outRef) worker.outRef = event.outRef\n if (event.harnessTranscript) worker.harnessTranscript = event.harnessTranscript\n const transcript = retainedTranscript(event)\n if (transcript) worker.transcript = transcript\n if (event.infra !== undefined) worker.infra = event.infra\n const verdict = describeVerdict(event.verdict)\n if (verdict) worker.verdict = verdict\n } else {\n worker.status = 'cancelled'\n }\n if (event.kind === 'settled' || event.spent !== undefined) {\n worker.spend = addSpend(worker.spend, parseSpend(event.spent))\n // Live progress is cumulative; terminal spend replaces it rather than counting it twice.\n worker.metered = emptySpend\n }\n } else if (event.kind === 'progress') {\n worker.metered = parseSpend(event.spend)\n } else if (event.kind === 'metered' && event.accountingOnly !== true) {\n worker.metered = addSpend(worker.metered, parseSpend(event.spend))\n }\n }\n\n const gaps = settled?.spentTotal ? settled.spendGaps : accounting?.spendGaps\n if (accounting || settled?.spentTotal) {\n driverSpend = observerSpend(\n settled?.spentSplit?.root ?? accounting?.totals.exclusiveByNode[state.id],\n )\n const sealedNodes = new Map(settled?.tree.nodes?.map((node) => [node.id, node]))\n for (const worker of workers.values()) {\n worker.spend = observerSpend(\n sealedNodes.get(worker.id)?.ownSpent ?? accounting?.totals.exclusiveByNode[worker.id],\n gaps?.find((gap) => gap.id === worker.id)?.channels,\n )\n worker.metered = emptySpend\n }\n }\n const workerViews = [...workers.values()]\n .map((worker) => {\n // Tails are keyed by file stem, which the writer put through `safeWorkerFile`; a label\n // carrying characters that stem strips would otherwise never find its own events.\n const tail =\n workerEventTails.get(join(stateDir, nodeStreamFile(worker.id))) ??\n workerEventTails.get(worker.label) ??\n workerEventTails.get(safeWorkerFile(worker.label)) ??\n workerEventTails.get(safeWorkerFile(worker.id)) ??\n workerEventTails.get(worker.id)\n worker.liveTail = tail?.lines ?? []\n if (tail) {\n worker.eventFile = tail.file\n Object.assign(worker, tail.activity)\n }\n return finalizeWorker(worker, now)\n })\n .sort((a, b) => compareWorker(a, b))\n\n const totals = supervisorTotals(state, workerViews, driverSpend, now)\n // A sealed result reconciles all owned trees, including turns recorded under a nested driver run.\n const rootSpend = settled?.spentTotal ?? accounting?.totals.inclusive\n if (rootSpend) {\n const spend = observerSpend(\n rootSpend,\n gaps?.flatMap((gap) => gap.channels),\n )\n Object.assign(totals, spend, { tokensTotal: spend.tokensInput + spend.tokensOutput })\n }\n return {\n id: state.id,\n stateDir,\n ...(rootReason === undefined ? {} : { reason: rootReason }),\n ...workerEventTails.get(join(stateDir, ROOT_STREAM_FILE))?.activity,\n status:\n accounting?.status ??\n (terminal?.kind === 'settled'\n ? (terminal.status ?? state.status)\n : terminal\n ? 'cancelled'\n : state.status),\n task: state.task,\n workspaceDir: state.workspaceDir,\n budget: state.budget,\n ...(state.budgetKnown === undefined ? {} : { budgetKnown: state.budgetKnown }),\n ...selectFields(\n state,\n [\n 'verifyCmd',\n 'workerModel',\n 'driverModel',\n 'verdict',\n 'progress',\n 'startedAt',\n 'completedAt',\n ],\n Boolean,\n ),\n ...selectFields(\n state,\n ['maxSandboxes', 'maxLifetimeSeconds', 'idleTimeoutSeconds', 'maxUsd', 'maxDepth'],\n (value) => value !== undefined,\n ),\n ...(state.result?.spentUsd !== undefined ? { resultSpentUsd: state.result.spentUsd } : {}),\n ...(state.result?.spentTokens !== undefined\n ? { resultSpentTokens: state.result.spentTokens }\n : {}),\n ...(!state.completedAt && terminal?.at ? { completedAt: terminal.at } : {}),\n workers: workerViews,\n progressTail: [...progressTail],\n journalTail: events.slice(-12),\n driverSpend,\n totals,\n }\n}\n\nfunction selectFields<T, K extends keyof T>(\n value: T,\n keys: readonly K[],\n include: (value: T[K]) => boolean,\n): Partial<Pick<T, K>> {\n const selected: Partial<Pick<T, K>> = {}\n for (const key of keys) if (include(value[key])) selected[key] = value[key]\n return selected\n}\n\nfunction ensureWorker(workers: Map<string, MutableWorker>, id: string): MutableWorker {\n const existing = workers.get(id)\n if (existing) return existing\n const created: MutableWorker = {\n id,\n label: id,\n status: 'running',\n spend: emptySpend,\n metered: emptySpend,\n liveTail: [],\n }\n workers.set(id, created)\n return created\n}\n\nfunction finalizeWorker(worker: MutableWorker, now: number): WorkerView {\n const startMs = parseTime(worker.startedAt)\n const endMs = parseTime(worker.endedAt) ?? (worker.status === 'running' ? now : startMs)\n const latencyMs = startMs !== undefined && endMs !== undefined ? Math.max(0, endMs - startMs) : 0\n return { ...worker, latencyMs }\n}\n\nfunction supervisorTotals(\n state: SupervisorState,\n workers: readonly WorkerView[],\n driverSpend: SpendStats,\n now: number,\n): SupervisorTotals {\n const spend = workers.map(totalSpend).reduce(addSpend, driverSpend)\n const counts = { running: 0, done: 0, down: 0, cancelled: 0 }\n for (const worker of workers) counts[worker.status] += 1\n const started = parseTime(state.startedAt)\n const completed = parseTime(state.completedAt)\n const latencyMs = started !== undefined ? Math.max(0, (completed ?? now) - started) : 0\n const latencies = workers.map((worker) => worker.latencyMs).filter((ms) => ms > 0)\n return {\n workers: workers.length,\n ...counts,\n ...(spend.usdKnown === false ? { usdKnown: false } : {}),\n ...(spend.tokensKnown === false ? { tokensKnown: false } : {}),\n inFlight: counts.running,\n settled: workers.length - counts.running,\n tokensInput: spend.tokensInput,\n tokensOutput: spend.tokensOutput,\n tokensTotal: spend.tokensInput + spend.tokensOutput,\n usd: spend.usd > 0 ? spend.usd : (state.result?.spentUsd ?? 0),\n latencyMs,\n workerLatency: distribution(latencies),\n }\n}\n\nexport function aggregateSnapshot(snapshot: TopSnapshot) {\n const complete = snapshot.completeness === 'complete'\n return {\n usdKnown: complete && snapshot.supervisors.every((row) => row.totals.usdKnown !== false),\n tokensKnown: complete && snapshot.supervisors.every((row) => row.totals.tokensKnown !== false),\n supervisors: snapshot.supervisors.length,\n workers: sum(snapshot.supervisors.map((supervisor) => supervisor.totals.workers)),\n running: sum(snapshot.supervisors.map((supervisor) => supervisor.totals.running)),\n done: sum(snapshot.supervisors.map((supervisor) => supervisor.totals.done)),\n down: sum(snapshot.supervisors.map((supervisor) => supervisor.totals.down)),\n usd: sum(snapshot.supervisors.map((supervisor) => supervisor.totals.usd)),\n tokensInput: sum(snapshot.supervisors.map((supervisor) => supervisor.totals.tokensInput)),\n tokensOutput: sum(snapshot.supervisors.map((supervisor) => supervisor.totals.tokensOutput)),\n }\n}\n\nfunction compareWorker(a: WorkerView, b: WorkerView): number {\n const aStart = parseTime(a.startedAt) ?? 0\n const bStart = parseTime(b.startedAt) ?? 0\n if (a.status === 'running' && b.status !== 'running') return -1\n if (b.status === 'running' && a.status !== 'running') return 1\n return aStart - bStart || a.label.localeCompare(b.label)\n}\n\nexport function totalSpend(worker: WorkerView): SpendStats {\n return addSpend(worker.spend, worker.metered)\n}\n\nfunction addSpend(a: SpendStats, b: SpendStats): SpendStats {\n return {\n iterations: a.iterations + b.iterations,\n tokensInput: a.tokensInput + b.tokensInput,\n tokensOutput: a.tokensOutput + b.tokensOutput,\n usd: a.usd + b.usd,\n ms: a.ms + b.ms,\n ...(a.usdKnown === false || b.usdKnown === false ? { usdKnown: false } : {}),\n ...(a.tokensKnown === false || b.tokensKnown === false ? { tokensKnown: false } : {}),\n }\n}\n\nexport function parseSpend(value: unknown): SpendStats {\n if (!isRecord(value)) return emptySpend\n const tokens = isRecord(value.tokens) ? value.tokens : {}\n return {\n ...(value.usdKnown === false ? { usdKnown: false } : {}),\n ...(value.tokensKnown === false || tokens.tokensKnown === false ? { tokensKnown: false } : {}),\n iterations: numberValue(value.iterations),\n tokensInput: numberValue(tokens.input),\n tokensOutput: numberValue(tokens.output),\n usd: numberValue(value.usd),\n ms: numberValue(value.ms),\n }\n}\n\nfunction parseBudget(value: unknown): BudgetStats | undefined {\n if (!isRecord(value)) return undefined\n const budget = selectFields(\n value,\n ['maxIterations', 'maxTokens', 'maxUsd'],\n (entry) => typeof entry === 'number',\n ) as BudgetStats\n return Object.keys(budget).length ? budget : undefined\n}\n\nfunction describeVerdict(value: unknown): string | undefined {\n if (!isRecord(value)) return undefined\n if (typeof value.valid === 'boolean') return value.valid ? 'valid' : 'invalid'\n if (typeof value.score === 'number') return `score ${value.score.toFixed(2)}`\n return undefined\n}\n\nfunction distribution(values: readonly number[]): Distribution {\n const sorted = [...values].sort((a, b) => a - b)\n return {\n n: sorted.length,\n min: sorted[0] ?? 0,\n median: percentile(sorted, 0.5),\n p90: percentile(sorted, 0.9),\n max: sorted[sorted.length - 1] ?? 0,\n }\n}\n\nfunction percentile(sorted: readonly number[], p: number): number {\n if (sorted.length === 0) return 0\n const idx = Math.min(sorted.length - 1, Math.max(0, Math.ceil(sorted.length * p) - 1))\n return sorted[idx] ?? 0\n}\n\n/** Missing files can predate their writer; failed reads report a path-only diagnostic. */\nfunction readSourceFile(\n file: string,\n source: TopSnapshotDiagnosticSource,\n path: string,\n): SourceRead<string | undefined> {\n if (!existsSync(file)) return { value: undefined, diagnostics: [] }\n try {\n return { value: readFileSync(file, 'utf8'), diagnostics: [] }\n } catch {\n return { value: undefined, diagnostics: [{ source, path, reason: 'unreadable' }] }\n }\n}\n\nfunction tailLines(raw: string | undefined, maxLines: number): string[] {\n return raw?.trim().split('\\n').filter(Boolean).slice(-maxLines) ?? []\n}\n\nfunction readSupervisorState(dir: string): SourceRead<SupervisorState | undefined> {\n const path = 'state.json'\n const read = readSourceFile(join(dir, path), 'supervisor-state', path)\n if (read.diagnostics.length > 0) return { value: undefined, diagnostics: read.diagnostics }\n const failed = (reason: TopSnapshotDiagnosticReason): SourceRead<undefined> => ({\n value: undefined,\n diagnostics: [{ source: 'supervisor-state', path, reason }],\n })\n if (read.value === undefined) return failed('missing')\n try {\n const parsed: unknown = JSON.parse(read.value)\n return isSupervisorState(parsed) ? { value: parsed, diagnostics: [] } : failed('invalid-state')\n } catch {\n return failed('partial-json')\n }\n}\n\nfunction isSupervisorState(value: unknown): value is SupervisorState {\n return (\n isRecord(value) &&\n ['id', 'status', 'task', 'workspaceDir'].every((key) => typeof value[key] === 'string') &&\n typeof value.budget === 'number'\n )\n}\n\n/** Validate supported journal lifecycle and accounting event shapes. */\nexport function isSpawnEvent<T>(value: T): value is T & TopJournalEvent {\n return (\n isRecord(value) &&\n typeof value.id === 'string' &&\n typeof value.kind === 'string' &&\n [\n 'spawned',\n 'settled',\n 'cancelled',\n 'metered',\n 'progress',\n 'materialized',\n 'seat-materialized',\n 'execution-bound',\n ].includes(value.kind)\n )\n}\n\nfunction isDirectory(path: string): boolean {\n try {\n return statSync(path).isDirectory()\n } catch {\n return false\n }\n}\n\nexport function numberValue(value: unknown): number {\n return typeof value === 'number' && Number.isFinite(value) ? value : 0\n}\n\nexport function parseTime(value: string | undefined): number | undefined {\n if (!value) return undefined\n const parsed = Date.parse(value)\n return Number.isFinite(parsed) ? parsed : undefined\n}\n\nfunction sum(values: readonly number[]): number {\n return values.reduce((total, value) => total + value, 0)\n}\n","import { once } from 'node:events'\nimport { existsSync } from 'node:fs'\nimport type { IncomingMessage, ServerResponse } from 'node:http'\nimport { join, resolve } from 'node:path'\nimport { FileResultBlobStore } from '../durable/spawn-journal/result-blob-store'\nimport { linkAbort, runAbortable } from '../runtime/supervise/abortable'\nimport { loadTopSnapshot, type TopSnapshot, type WorkerView } from './top-snapshot'\nimport {\n createTopAgentStream,\n readTopAgentInspection,\n retainedRouterInspection,\n type TopInspection,\n type TopSessionReader,\n topAgentMetadata,\n topAgentWorker,\n transcriptHistory,\n type transcriptRows,\n transcriptTail,\n} from './top-transcript'\n\nexport type { TopInspection } from './top-transcript'\n\nconst SOURCE_READ_TIMEOUT_MS = 30_000\nexport type TopInspectionSource = (request: {\n readonly root: string\n readonly runId: string\n readonly workerId: string\n readonly signal?: AbortSignal\n}) => Promise<TopInspection>\n\n/** Selected reads share the web server's origin, method and lifecycle boundary. */\nexport async function serveTopAgent({\n request,\n response,\n path,\n base,\n roots,\n snapshots,\n transcripts,\n source,\n readSessions,\n}: {\n request: IncomingMessage\n response: ServerResponse\n path: string\n base: string\n roots: readonly string[]\n snapshots: ReadonlyMap<string, TopSnapshot>\n transcripts: Set<(changedRoots: ReadonlySet<string>) => void>\n source?: TopInspectionSource\n readSessions?: TopSessionReader\n}) {\n const [, , , , rootIndex, runId, workerId] = path.split('/').map(decodeURIComponent)\n const root = roots[Number(rootIndex)]\n const run = root && snapshots.get(root)?.supervisors.find((entry) => entry.id === runId)\n const safeId = (id: string | undefined) =>\n !!id && /^[a-z0-9_.:-]+$/i.test(id) && id !== '.' && id !== '..'\n if (\n !safeId(runId) ||\n !safeId(workerId) ||\n !run ||\n (!run.workers.some((entry) => entry.id === workerId) && run.id !== workerId)\n ) {\n response.writeHead(404).end()\n return\n }\n // A runs root keeps each run's journals, blobs and root stream in `<root>/<runId>`.\n const own =\n root && existsSync(resolve(root, runId!, 'observer.jsonl')) ? resolve(root, runId!) : undefined\n const runDir = own ?? root\n const pursuit = own\n ? (await loadTopSnapshot(root!, { runDir: own })).pursuit\n : root\n ? snapshots.get(root)?.pursuit\n : undefined\n const worker = (): WorkerView | undefined => {\n const run = root ? snapshots.get(root)?.supervisors.find((run) => run.id === runId) : undefined\n const node = run && topAgentWorker(run, workerId!)\n return node && node.id === run?.id && existsSync(resolve(runDir!, 'root-stream.jsonl'))\n ? { ...node, eventFile: resolve(runDir!, 'root-stream.jsonl') }\n : node\n }\n\n if (!worker()) {\n response.writeHead(404).end()\n return\n }\n const controller = new AbortController()\n response.on('close', () => controller.abort())\n const readSource = async () => {\n const deadline = new AbortController()\n const linked = linkAbort(controller.signal, deadline.signal)\n const timer = setTimeout(\n () => deadline.abort('Inspection source read exceeded its deadline'),\n SOURCE_READ_TIMEOUT_MS,\n )\n timer.unref()\n try {\n const result = await runAbortable(\n () =>\n source\n ? source({\n root: runDir!,\n runId: runId!,\n workerId: workerId!,\n signal: linked.signal,\n })\n : readSessions\n ? readTopAgentInspection({\n worker: worker()!,\n runId: runId!,\n blobs: new FileResultBlobStore(join(runDir!, 'blobs')),\n readSessions,\n signal: linked.signal,\n })\n : retainedRouterInspection(worker()!, runDir),\n linked.signal,\n 'Inspection read stopped',\n )\n return result?.coverage.status === 'complete' && !result.rows?.length\n ? {\n ...result,\n coverage: {\n ...result.coverage,\n status: 'partial' as const,\n reason: 'No verified native conversation rows were supplied',\n },\n }\n : result\n } finally {\n clearTimeout(timer)\n linked.release()\n }\n }\n let history: ReturnType<typeof transcriptRows> | undefined = await transcriptHistory(\n worker()!,\n runDir,\n pursuit?.nodes.find((node) => node.runId === runId && node.id === workerId),\n )\n if (!path.endsWith('/stream')) {\n const inspection = await readSource()\n response.writeHead(200, { 'Content-Type': 'application/json' })\n response.end(\n request.method === 'HEAD'\n ? undefined\n : JSON.stringify(topAgentMetadata(inspection, history ?? [])),\n )\n return\n }\n response.writeHead(200, { 'Content-Type': 'text/event-stream', 'X-Accel-Buffering': 'no' })\n response.flushHeaders()\n if (request.method === 'HEAD') {\n response.end()\n return\n }\n const stream = createTopAgentStream(Date.now())\n response.write(`event: reset\\ndata: ${JSON.stringify(stream.reset)}\\n\\n`)\n let updating = false\n let finalizing = false\n const update = (changedRoots: ReadonlySet<string>) => {\n // Only this agent's own root wakes it (#2355); the close path below forces one final pass naming its root.\n if (!finalizing && !changedRoots.has(root!)) return\n if (updating || response.destroyed || response.writableEnded) return\n updating = true\n void (async () => {\n const node = worker()\n if (!node || response.writableLength > 1024 * 1024) {\n response.destroy()\n return\n }\n const inspection = await readSource()\n const recorded = history ?? transcriptTail(node)\n history = undefined\n const alive = node.status === 'running'\n const frames = stream.frame({\n recorded,\n inspection,\n alive,\n includeContext: new URL(request.url ?? '/', base).searchParams.get('context') === '1',\n })\n for (const frame of frames) {\n if (!response.write(`event: ${frame.event}\\ndata: ${JSON.stringify(frame.data)}\\n\\n`))\n await once(response, 'drain', { signal: controller.signal })\n }\n if (!alive) {\n response.write('event: end\\ndata: {}\\n\\n')\n response.end()\n }\n })()\n .catch(() => {\n if (!response.destroyed) response.end('event: unavailable\\ndata: {}\\n\\n')\n })\n .finally(() => {\n updating = false\n })\n }\n transcripts.add(update)\n response.on('close', () => {\n finalizing = true\n transcripts.delete(update)\n // The run may be over for this viewer: one last read so a terminal record appended just before close reaches it.\n update(new Set([root!]))\n })\n update(new Set([root!]))\n}\n","import { createHash } from 'node:crypto'\nimport { existsSync, type FSWatcher, readdirSync, watch } from 'node:fs'\nimport { readFile, realpath, stat } from 'node:fs/promises'\nimport { createServer, type ServerResponse } from 'node:http'\nimport { createRequire } from 'node:module'\nimport { dirname, extname, resolve, sep } from 'node:path'\nimport { loadTopSnapshot, type TopSnapshot } from './top-snapshot'\nimport type { TopSessionReader } from './top-transcript'\nimport { serveTopAgent, type TopInspectionSource } from './top-web-agent'\n\nexport type { TopInspection, TopInspectionSource } from './top-web-agent'\n\n/** Interval for reconciling missed filesystem notifications in the live viewer. */\nexport const TOP_SNAPSHOT_RECONCILE_MS = 500\nconst JOURNALS = ['observer.jsonl', 'spawn-journal.jsonl', 'journal.jsonl']\nconst stampOf = (info: { size: number; mtimeMs: number }) => `${info.size}:${info.mtimeMs}`\n\n/** A reconnect always receives current truth; deltas replace changed roots atomically. */\nexport interface TopSnapshotFrame {\n readonly sequence: number\n readonly observedAt: number\n readonly reset: boolean\n readonly snapshots: readonly TopSnapshot[]\n}\n\nexport interface TopWebOptions {\n readonly roots: readonly string[]\n /** Defaults to the packaged Sandbox UI browser assets. */\n readonly assets?: string\n readonly host?: string\n readonly port?: number\n /** Product-owned verified conversation reads; no execution or credential access. */\n readonly source?: TopInspectionSource\n /** Canonical native decoding for ordinary Runtime transcript receipts. */\n readonly readSessions?: TopSessionReader\n}\n\n/** Read-only web transport over the same snapshots as the terminal. No execution or writes. */\nexport async function serveTopWeb(options: TopWebOptions) {\n if (!options.roots.length) throw new Error('At least one --root is required')\n const roots = [...new Set(await Promise.all(options.roots.map((root) => realpath(root))))]\n const require = createRequire(import.meta.url)\n // The build copies sandbox-ui's viewer into dist/viewer. An unbuilt checkout (gates test without building) has no\n // dist, so it falls back to the installed sandbox-ui's own dist: the same bytes (#2368).\n const packagedViewer = () => {\n try {\n return resolve(require.resolve('@tangle-network/agent-runtime/tui'), '../../viewer')\n } catch {\n return dirname(require.resolve('@tangle-network/sandbox-ui/workspace-viewer.js'))\n }\n }\n const assets = await realpath(options.assets ?? packagedViewer())\n for (const file of ['workspace-viewer.js', 'styles.css']) await stat(resolve(assets, file))\n const host = options.host ?? '127.0.0.1'\n const clients = new Set<ServerResponse>()\n // Each agent stream registers with its root, so a read wakes only the streams of the roots it changed (#2355).\n const transcripts = new Set<(changedRoots: ReadonlySet<string>) => void>()\n const snapshots = new Map<string, TopSnapshot>()\n const digests = new Map<string, string>()\n const touched = new Set<string>()\n const lastStamps = new Map<string, string>()\n const watchers: FSWatcher[] = []\n let sequence = 0\n let reading = false\n let dirty = true\n let closed = false\n let scheduled: NodeJS.Timeout | undefined\n const send = (client: ServerResponse, frame: TopSnapshotFrame) => {\n if (client.writableLength > 1024 * 1024) return client.destroy()\n client.write(`id: ${frame.sequence}\\nevent: snapshot\\ndata: ${JSON.stringify(frame)}\\n\\n`)\n }\n let inFlight: Promise<void> = Promise.resolve()\n const read = async () => {\n reading = true\n dirty = false\n // Take the marks before reading: a worker-stream append never moves the journal stamp, so a mark cleared after a\n // slow read would drop an event that landed during it, and every reconcile would then skip that root.\n const marked = new Set(touched)\n touched.clear()\n try {\n const changed: TopSnapshot[] = []\n for (const root of roots) {\n // A root unmarked since its last parse, whose journal file did not move, keeps its snapshot (#2355).\n const marker = JOURNALS.map((name) => resolve(root, name)).find((path) => existsSync(path))\n const stamp = marker ? await stat(marker).then(stampOf, () => 'none') : 'runs-root'\n if (!marked.has(root) && snapshots.has(root) && lastStamps.get(root) === stamp) continue\n lastStamps.set(root, stamp)\n const snapshot = marker?.endsWith('observer.jsonl')\n ? await loadTopSnapshot(root, { runDir: root })\n : marker?.endsWith('spawn-journal.jsonl')\n ? await loadTopSnapshot(root, { runDir: root, format: 'journal' })\n : marker?.endsWith('journal.jsonl')\n ? await loadTopSnapshot(root, { runDir: root, format: 'workflow' })\n : await loadRunsRoot(root)\n const digest = createHash('sha256')\n .update(\n JSON.stringify(snapshot, (key, value) =>\n key === 'generatedAt' || key === 'latencyMs' ? undefined : value,\n ),\n )\n .digest('hex')\n snapshots.set(root, snapshot)\n if (digests.get(root) !== digest) {\n changed.push(snapshot)\n digests.set(root, digest)\n }\n }\n if (changed.length) {\n const frame = {\n sequence: ++sequence,\n observedAt: Date.now(),\n reset: false,\n snapshots: changed,\n }\n for (const client of clients) send(client, frame)\n }\n for (const update of transcripts) update(new Set([...changed.map((s) => s.root), ...marked]))\n } catch (error) {\n for (const root of marked) touched.add(root)\n throw error\n } finally {\n reading = false\n if (dirty && !closed) schedule()\n }\n }\n const refresh = (): Promise<void> => {\n if (reading || closed) return inFlight\n inFlight = read()\n return inFlight\n }\n const schedule = () => {\n dirty = true\n if (!scheduled && !closed)\n scheduled = setTimeout(() => {\n scheduled = undefined\n void refresh().catch((error: unknown) => {\n for (const client of clients)\n client.write(\n `event: unavailable\\ndata: ${JSON.stringify({ message: String(error) })}\\n\\n`,\n )\n })\n }, 16)\n }\n await refresh()\n // A root's watcher marks only that root, so a transcript write (no digest covers it) wakes its streams (#2355).\n const mark = (root: string) => () => {\n touched.add(root)\n schedule()\n }\n // A watch only wakes the reconcile below, which reads without one: a host out of inotify watches\n // (ENOSPC) or a file removed mid-registration must not end the run it views. Watches may also be lost.\n for (const root of roots)\n try {\n watchers.push(watch(root, { recursive: true }, mark(root)).on('error', () => undefined))\n } catch {}\n const reconcile = setInterval(schedule, TOP_SNAPSHOT_RECONCILE_MS)\n const heartbeat = setInterval(() => {\n for (const client of clients) client.write(': alive\\n\\n')\n }, 15_000)\n const server = createServer((request, response) => {\n void (async () => {\n const base = `http://${request.headers.host}`\n const incomingHost = new URL(base).hostname.replace(/^\\[|\\]$/g, '')\n if (\n !request.headers.host ||\n ![host, '127.0.0.1', 'localhost', '::1'].includes(incomingHost) ||\n (request.headers.origin && request.headers.origin !== base)\n ) {\n response.writeHead(403).end()\n return\n }\n if (request.method !== 'GET' && request.method !== 'HEAD') {\n response.writeHead(405, { Allow: 'GET, HEAD' }).end()\n return\n }\n const path = new URL(request.url ?? '/', base).pathname\n response.setHeader('Cache-Control', 'no-store')\n response.setHeader('X-Content-Type-Options', 'nosniff')\n if (path === '/api/top/events') {\n if (request.method === 'HEAD') {\n response.writeHead(200, { 'Content-Type': 'text/event-stream' }).end()\n return\n }\n response.writeHead(200, { 'Content-Type': 'text/event-stream', 'X-Accel-Buffering': 'no' })\n response.flushHeaders()\n clients.add(response)\n send(response, {\n sequence,\n observedAt: Date.now(),\n reset: true,\n snapshots: [...snapshots.values()],\n })\n response.on('close', () => clients.delete(response))\n } else if (/^\\/api\\/top\\/agents\\/\\d+\\/[^/]+\\/[^/]+(?:\\/stream)?$/.test(path)) {\n await serveTopAgent({\n request,\n response,\n path,\n base,\n roots,\n snapshots,\n transcripts,\n source: options.source,\n readSessions: options.readSessions,\n })\n } else if (path === '/api/top') {\n response.writeHead(200, { 'Content-Type': 'application/json' })\n response.end(\n JSON.stringify({\n sequence,\n observedAt: Date.now(),\n reset: true,\n snapshots: [...snapshots.values()],\n }),\n )\n } else if (path === '/') {\n response.writeHead(200, { 'Content-Type': 'text/html; charset=utf-8' })\n response.end(\n '<!doctype html><html><head><meta name=\"viewport\" content=\"width=device-width,initial-scale=1\"><title>Live agents</title><link rel=\"stylesheet\" href=\"/assets/styles.css\"></head><body><div id=\"agent-workspace\" data-mode=\"live\" data-api=\"/api/top\" data-theme=\"dark\"></div><script type=\"module\" src=\"/assets/workspace-viewer.js\"></script></body></html>',\n )\n } else if (path.startsWith('/assets/')) {\n const file = await realpath(resolve(assets, decodeURIComponent(path.slice(8))))\n if (!file.startsWith(assets + sep)) {\n response.writeHead(403).end()\n return\n }\n const kind = { '.js': 'text/javascript', '.css': 'text/css', '.woff2': 'font/woff2' }[\n extname(file)\n ]\n if (!kind) {\n response.writeHead(404).end()\n return\n }\n response.writeHead(200, { 'Content-Type': kind })\n response.end(request.method === 'HEAD' ? undefined : await readFile(file))\n } else response.writeHead(404).end()\n })().catch((error: unknown) => {\n if (!response.headersSent) response.writeHead(500, { 'Content-Type': 'application/json' })\n response.end(JSON.stringify({ error: String(error) }))\n })\n })\n let closing: Promise<void> | undefined\n const close = () =>\n (closing ??= (async () => {\n clearInterval(reconcile)\n clearInterval(heartbeat)\n for (const watcher of watchers) watcher.close()\n // On close, finish a read in flight and read once more, so a record appended at settle reaches clients.\n await inFlight.catch(() => undefined)\n await refresh().catch(() => undefined)\n closed = true\n if (scheduled) clearTimeout(scheduled)\n // The run is over for this viewer: say so, so a client stops instead of reconnecting.\n for (const client of clients) client.end('event: end\\ndata: {}\\n\\n')\n transcripts.clear()\n server.closeAllConnections()\n await new Promise<void>((done, reject) =>\n server.close((error) =>\n error && (!('code' in error) || error.code !== 'ERR_SERVER_NOT_RUNNING')\n ? reject(error)\n : done(),\n ),\n )\n })())\n try {\n await new Promise<void>((done, reject) => {\n server.once('error', reject)\n server.listen(options.port ?? 0, host, done)\n })\n } catch (error) {\n await close()\n throw error\n }\n const address = server.address()\n if (!address || typeof address === 'string') throw new Error('Web server has no TCP address')\n return { url: `http://${host.includes(':') ? `[${host}]` : host}:${address.port}/`, close }\n}\n\n/** CLI options stay on agent-runtime-top; the renderer is supplied by its installed owner. */\nexport async function runTopWeb(argv: readonly string[]) {\n const values = (flag: string) =>\n argv.flatMap((arg, i) => (arg === flag ? [argv[i + 1] ?? ''] : []))\n const roots = values('--root')\n const port = Number(values('--port')[0] ?? 0)\n if (!Number.isInteger(port) || port < 0 || port > 65535) throw new Error('Invalid --port')\n const web = await serveTopWeb({\n roots: roots.length ? roots : [process.cwd()],\n ...(values('--assets')[0] ? { assets: values('--assets')[0] } : {}),\n port,\n ...(values('--host')[0] ? { host: values('--host')[0] } : {}),\n })\n process.stdout.write(`${JSON.stringify({ event: 'ready', url: web.url, pid: process.pid })}\\n`)\n const stop = () => {\n void web.close().catch((error: unknown) => {\n process.stderr.write(`${String(error)}\\n`)\n process.exitCode = 1\n })\n }\n process.once('SIGINT', stop)\n process.once('SIGTERM', stop)\n return web\n}\n\n/** A journal root holds one `<runId>/observer.jsonl` per retained run beside any workspace runs. */\nasync function loadRunsRoot(root: string): Promise<TopSnapshot> {\n const workspace = loadTopSnapshot(root)\n // A run writes its spawn journal at begin and its observer journal after turn one; either makes it a card.\n const has = (runId: string, file: string) => existsSync(resolve(root, runId, file))\n const runIds = readdirSync(root, { withFileTypes: true })\n .filter(\n (entry) =>\n entry.isDirectory() &&\n (has(entry.name, 'observer.jsonl') || has(entry.name, 'spawn-journal.jsonl')),\n )\n .map((entry) => entry.name)\n if (!runIds.length) return workspace\n const runs = await Promise.all(\n runIds.map((runId) =>\n loadTopSnapshot(root, {\n runDir: resolve(root, runId),\n ...(has(runId, 'observer.jsonl') ? {} : { format: 'journal' as const }),\n }),\n ),\n )\n const diagnostics = [\n ...workspace.diagnostics,\n ...runs.flatMap((run, i) => run.diagnostics.map((d) => ({ ...d, runId: runIds[i] }))),\n ]\n const supervisors = [...workspace.supervisors, ...runs.flatMap((run) => run.supervisors)]\n return {\n ...workspace,\n supervisors,\n diagnostics,\n completeness: diagnostics.length ? 'partial' : 'complete',\n discovered: workspace.discovered + runIds.length,\n loaded: supervisors.length,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA4EA,eAAsB,kBACpB,QACA,QACA,MACA;CACA,OAAO,oBACL,QACA,SAAS,IAAI,oBAAoB,KAAK,QAAQ,OAAO,CAAC,IAAI,KAAA,GAC1D,IACF;AACF;;AAGA,eAAsB,oBACpB,QACA,OACA,MACA;CACA,MAAM,OAA2B,CAAC;CAClC,MAAM,WAAW,YAAY,MAAM,YAAY,OAAO,QAAQ;CAC9D,IAAI,SAAS,OAAO,UAAU,eAAe,YAAY,OAAO,WAAW;EACzE,MAAM,OAAO,MAAM,MAAM,IAAI,SAAS,UAAU;EAChD,IAAI,SAAS,KAAA,GACX,KAAK,KAAK;GACR,IAAI,OAAO;GACX,OAAO;IACL,MAAM;IACN,YAAY;IACZ,QAAQ,UAAU,OAAO,UAAU,MAAM,YAAY,aAAa,SAAS,SAAS,WAAW,YAAY,SAAS;IACpH,MAAM,gBAAgB,OAAO,UAAU,MAAM,YAAY,aAAa,IAAI,OAAO,SAAS,WAAW,OAAO,KAAK,UAAU,MAAM,MAAM,CAAC;GAC1I;EACF,CAAC;CACL;CACA,MAAM,WAAW,eAAe,MAAM;CACtC,IAAI,OAAO,WACT,KAAK,KAAK;EACR,IAAI,OAAO;EACX,OAAO;GACL,MAAM;GACN,YAAY;GACZ,MAAM;GACN,QAAQ;EACV;CACF,CAAC;CACH,MAAM,SAAS,MAAM,UAAU,OAAO;CACtC,MAAM,SAAS,SAAS,UAAU,OAAO,UAAU,MAAM,MAAM,IAAI,MAAM,IAAI,KAAA;CAC7E,IAAI,WAAW,KAAA,GACb,SAAS,KAAK;EACZ,IAAI,OAAO;EACX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G,KAAK,SAAS,KAAK,MAAM,IAAI,YAAY,KAAK,OAAO;EAAE,GAAG;EAAG,OAAO,OAAO;CAAG,EAAE,CAAC,CACtF;CACA,MAAM,cAAc,CAAC,GAAG,UAAU,aAAa,GAAG,KAAK,SAAS,QAAQ,IAAI,WAAW,CAAC;CACxF,OAAO;EACL,GAAG;EACH;EACA;EACA,cAAc,YAAY,SAAS,YAAY;EAC/C,YAAY,UAAU,aAAa,OAAO;EAC1C,QAAQ,YAAY;CACtB;AACF"}
package/dist/tui/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
- import { r as cancelRun } from "../run-cancellation-D2fq7jx6.js";
3
- import { E as supervisorRunsRoot, M as writeWorkerSteer, h as cancelWorker } from "../supervisor-accounting-Bnp1WYTX.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-C8MkFqf4.js";
2
+ import { r as cancelRun } from "../run-cancellation-CtDpDxro.js";
3
+ import { E as supervisorRunsRoot, M as writeWorkerSteer, h as cancelWorker } from "../supervisor-accounting-BeQ8kv9H.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-D57bqE7a.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 { $d as PursuitProjection, E as Budget, Ga as NodeExecutionIdentity, Ka as ProfileMaterializationReceipt, Ra as ExecutionBindingReceipt, Sb as RouteFlowEvent, Xd as PursuitNodeProjection, aa as ResultBlobStore, dC as HarnessTranscriptArtifact, ef as PursuitRunProjection, j as Spend, mC as HarnessTranscriptEvidence, zr as provisionSupervisor } from "../types-Br9sWTWk.js";
1
+ import { $d as PursuitProjection, E as Budget, Ga as NodeExecutionIdentity, Ka as ProfileMaterializationReceipt, Ra as ExecutionBindingReceipt, Sb as RouteFlowEvent, Xd as PursuitNodeProjection, aa as ResultBlobStore, dC as HarnessTranscriptArtifact, ef as PursuitRunProjection, j as Spend, mC as HarnessTranscriptEvidence, wa as SupervisedResult, zr as provisionSupervisor } from "../types-CbvBgzJB.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';
@@ -216,6 +216,7 @@ interface SupervisorView extends SupervisorBase {
216
216
  } | {
217
217
  readonly kind: 'no-winner' | 'failed';
218
218
  readonly reason: string;
219
+ readonly providerTraceId?: string;
219
220
  };
220
221
  readonly lastRoute?: Extract<RouteFlowEvent, {
221
222
  kind: 'stopped' | 'unrouted';
@@ -346,7 +347,7 @@ export declare function loadTopSnapshot(rootDir: string, options: {
346
347
  /** Combine supervisor projections and source diagnostics into one snapshot. */
347
348
  declare function topSnapshot(root: string, now: number, supervisors: SupervisorView[], diagnostics?: TopSnapshotDiagnostic[], discovered?: number, pursuit?: PursuitProjection): TopSnapshot;
348
349
  /** Project committed lifecycle and spend evidence into one supervisor view. */
349
- declare function buildSupervisorView(state: SupervisorState, stateDir: string, events: readonly TopJournalEvent[], progressTail: readonly string[], now: number, workerEventTails?: Map<string, RecordedEvents>, accounting?: PursuitRunProjection): SupervisorView;
350
+ declare function buildSupervisorView(state: SupervisorState, stateDir: string, events: readonly TopJournalEvent[], progressTail: readonly string[], now: number, workerEventTails?: Map<string, RecordedEvents>, accounting?: PursuitRunProjection, settled?: SupervisedResult<unknown>): SupervisorView;
350
351
  /** Validate supported journal lifecycle and accounting event shapes. */
351
352
  declare function isSpawnEvent<T>(value: T): value is T & TopJournalEvent;
352
353
  type TopInspectionSource = (request: {
package/dist/tui/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import { t as provisionSupervisor } from "../provision-supervisor-DyrYiZOg.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-C8MkFqf4.js";
1
+ import { t as provisionSupervisor } from "../provision-supervisor-BbJEoPmX.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-D57bqE7a.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 };
@@ -9943,15 +9943,19 @@ interface SuperviseTestOptions extends SuperviseOptions {
9943
9943
  * `supervise()` gives a traced run's workers their trace context without ordering the span recorder
9944
9944
  * ahead of the worker seam.
9945
9945
  *
9946
- * Continuity: the `bridge` backend honors `continuity: 'resume'` by session re-attachment. A
9947
- * bridge session id IS the harness conversation key (cli-bridge maps it to the CLI's own resume —
9948
- * opencode `-s <id>`, claude `--resume`), so this seam records the session id each supervised
9949
- * spawn was bound to, keyed by the worker id the Scope assigned, and a resume spawn binds the
9950
- * prior worker's recorded session id instead of deriving a fresh one. The record is process-local
9951
- * by construction, which matches the kernel's resume boundary (a prior process's workers are not
9952
- * resume targets). Every other backend keeps failing loud: their executors have no re-attachable
9953
- * session, and accepting the spawn would ledger `continuity: 'resume'` over a brand-new session —
9954
- * a stamp asserting something that never happened.
9946
+ * Continuity: the `bridge` and `provider` backends honor `continuity: 'resume'` by session
9947
+ * re-attachment. A bridge session id IS the harness conversation key (cli-bridge maps it to the
9948
+ * CLI's own resume — opencode `-s <id>`, claude `--resume`, codex `exec resume`), and a retained
9949
+ * provider session is that same key one layer up, so this seam records the session each supervised
9950
+ * spawn was bound to, keyed by the worker id the Scope assigned, and a resume spawn binds the prior
9951
+ * worker's recorded session instead of deriving a fresh one. A provider worker's session is the
9952
+ * one its retained environment admission names; the resumed worker gets a new environment, since
9953
+ * the earlier one is torn down when its node settles, and dispatches its first turn into that
9954
+ * session. The record is process-local by construction, which matches the kernel's resume boundary
9955
+ * (a prior process's workers are not resume targets). Every other backend keeps failing loud: their
9956
+ * executors have no re-attachable session, and accepting the spawn would ledger
9957
+ * `continuity: 'resume'` over a brand-new session — a stamp asserting something that never
9958
+ * happened.
9955
9959
  */
9956
9960
  declare function workerFromBackend(backend: ExecutorConfig, deliverable?: DeliverableSpec<unknown>, seams?: () => Readonly<Record<string, unknown>>): MakeWorkerAgent;
9957
9961
  /** Capabilities a data-only consumer may require before building an opted-in run. `graphTools`:
@@ -18674,6 +18678,8 @@ interface DriverAttemptRecord {
18674
18678
  /** With `error`: the deepest cause's stack, redacted and bounded, so a failure the message
18675
18679
  * alone cannot place still names its throw site (#2347). */
18676
18680
  readonly errorStack?: string;
18681
+ /** The upstream request's trace ID, when the provider supplied one for this attempt. */
18682
+ readonly providerTraceId?: string;
18677
18683
  /** Validated producer attribution, including its reset hint when supplied. */
18678
18684
  readonly failure?: AgentTurnFailure;
18679
18685
  readonly classification?: DriverFailureClass;
@@ -19266,6 +19272,7 @@ declare const runtimeFailureCauseSchema: z.ZodReadonly<z.ZodObject<{
19266
19272
  }>;
19267
19273
  cause: z.ZodString;
19268
19274
  providerCode: z.ZodOptional<z.ZodString>;
19275
+ providerTraceId: z.ZodOptional<z.ZodString>;
19269
19276
  providerStatus: z.ZodOptional<z.ZodNumber>;
19270
19277
  retryAfterMs: z.ZodOptional<z.ZodNumber>;
19271
19278
  remediation: z.ZodOptional<z.ZodReadonly<z.ZodObject<{
@@ -19827,4 +19834,4 @@ interface KnowledgeReadinessDecision {
19827
19834
  nonBlockingGapIds: string[];
19828
19835
  }
19829
19836
  export { BlockedToolReport as $, LoopLineageOptions as $C, RetainedRunEffect as $S, FeedbackRating as $_, ExecutorCancellationRequest as $a, DEFAULT_PEER_MAIL_LIMITS as $b, LoopCampaignDispatchOptions as $c, PursuitProjection as $d, IsolatedCheckOutputEvidence as $f, RouterResponseReceipt as $g, Inbox as $h, DesignerToolsEnv as $i, strategyAuthorContract as $l, CoordinationRejectReason as $m, searchPresets as $n, structuralRollout as $o, ReservationRejection as $p, workerFromInteractiveProvider as $r, ResolveSandboxClientOptions as $s, AnalystAuthoring as $t, PersonaExecutors as $u, HarnessUsage as $v, SqlAdapter as $x, SanitizedKnowledgeRequirement as $y, ResourceSpend as A, RetainedHarnessTranscriptDescriptor as AC, AgentEvalError$1 as AS, DelegationResumeContext as A_, Agent as Aa, QuestionEscalationOutcome as Ab, PairedCommandInput as Ac, NextPursuitVersion as Ad, EdgeDeliveryOutcome as Af, WorkerProgress as Ag, McpEventRecord as Ah, graphFromStored as Ai, ArtifactHandle as Al, StopDecision as Am, gitWorkspace as An, CheckExecChannel as Ao, dumbContinuationPassPrompt as Ap, RemoteSupervisorSteerResult as Ar, acquireSandbox as As, CreateSandboxOptions$1 as At, PanelVerdict as Au, ExecutorResultMapping as Av, ToolStepInput as Ax, bestSoFar as Ay, SpawnOpts as B, ExecutorToolCall as BC, ReconnectRetainedRunOptions as BS, DelegateResearchArgs as B_, ExecutorMaterialization as Ba, AuthorizedDownMessage as Bb, McpEndpoint as Bc, SupervisePursuitError as Bd, runGraph as Bf, resolveMcpServerLaunch as Bg, CliSeam as Bh, taskShapeDigest as Bi, sample as Bl, DeliveredOutput as Bm, createRootHandle as Bn, StructuralRolloutResult as Bo, WorkerTraceResolver as Bp, ProfileRegistryDir as Br, startRetainedRunInEnvironment as Bs, makeFinding$1 as Bt, Verify as Bu, sentinelCompletion as Bv, AuthoredAnalystDefinition as Bx, OtelExportConfig as By, RuntimeFailureCause as C, BoundHarnessSession as CC, readRunCancelRequest as CS, createFleetWorkspaceExecutor as C_, RootStreamReceipt as Ca, RouteGate as Cb, CreateScopeAnalystOptions as Cc, assertDeclaredCheck as Cd, GraphCheckNode as Cf, ProviderPlacement as Cg, environmentReader as Ch, GraphRunRecord as Ci, connectStdioMcp as Cl, SupervisorToolInvocationContext as Cm, copyUntrackedIntoClone as Cn, ProfileRichnessThresholds as Co, PromptHandle as Cp, workerInboxFileFromEventDir as Cr, TurnResult as Cs, AgentSessionRef as Ct, FanoutSynthesis as Cu, FileDelegationStoreOptions as Cv, RuntimeRunRow as Cw, EventBus as Cx, renderLeaderboardSvg as Cy, BudgetOverspend as D, HarnessTranscriptReadLimits as DC, contentAddress as DS, runDetachedTurn as D_, ExecutorFactory as Da, EscalateQuestion as Db, createScopeAnalyst as Dc, declaredCheckJudge as Dd, GraphCommandCheck as Df, ExecutorProgress as Dg, createMcpServer as Dh, digestOfGraph as Di, AgenticSurface as Dl, NoProgressForOptions as Dm, Workspace as Dn, profileRichnessFinding as Do, createPromptRegistry as Dp, RemoteSupervisorCancelResult as Dr, createSandboxLineage as Ds, CheckpointRef as Dt, Panel as Du, CheckVerdict as Dv, defaultToolDetectors as Dx, AnytimeTaskCurve as Dy, Budget as E, HarnessTranscriptMetadata as EC, InMemorySpawnJournal as ES, RunDetachedTurnOptions as E_, ExecutorContext as Ea, ChildQuestionInbox as Eb, buildSteerContext as Ec, declaredCheckDigest as Ed, GraphCheckPlacement as Ef, DEFAULT_STALL_AFTER_MS as Eg, McpServerOptions as Eh, StoredGraphInput as Ei, AgenticRunResult as El, AllWorkersStalledOptions as Em, Shell as En, defaultProfileRichnessThresholds as Eo, analyzesFindingsReportPrompt as Ep, RemoteSupervisorAgent as Er, SandboxLineageHandle as Es, AnalystFinding$1 as Et, LoopUntilState as Eu, CheckUnavailableError as Ev, WatchTraceOptions as Ex, AnytimeStrategySummary as Ey, NodeId as F, ProviderWorkspaceCaptureProvenance as FC, NotFoundError as FS, DelegationTaskQueueOptions as F_, UnconfirmedTeardown as Fa, QuestionPolicy as Fb, CanonicalObservedModelParts as Fc, SettledPursuitVersion as Fd, GraphResult as Ff, BridgeSeam as Fg, createDelegateHandler as Fh, lookupGraph as Fi, SurfaceScore as Fl, plateau as Fm, analyzeTrace as Fn, CheckSourceCtx as Fo, SupervisorSpanAttributes as Fp, ProvisionSupervisorConnection as Fr, PrivateCasNamespaceObject as Fs, ResourceRequest$1 as Ft, ScopeWidenGate as Fu, CompletionEvidence as Fv, AnalystKind as Fx, WaterfallSpan as Fy, TreeView as G, Driver as GC, RetainedInteractiveEnvironmentAdmission as GS, DelegationError as G_, NodeExecutionIdentity as Ga, DownMessageDeliveryOutcome as Gb, BenchmarkConfig as Gc, RunReopen as Gd, portableContinuationPolicySchema as Gf, SandboxToolPartState as Gg, RouterToolsSeam as Gh, DispatchReport as Gi, StrategyArtifacts as Gl, CoordinationAuthentication as Gm, createFencedSqlRunContext as Gn, defaultExtractCandidate as Go, RunParkingRecord as Gp, profileRegistry as Gr, startRetainedInteractiveRun as Gs, SurfaceDiff as Gt, WidenSpec as Gu, CodexRolloutStoreReader as Gv, RunLocalHarnessOptions as Gx, createOtelExporter as Gy, SpawnRejection as H, UsageEvent as HC, RecoverRetainedRunOptions as HS, DelegateUiAuditArgs as H_, MaterializedExecutionIdentity as Ha, ContinuityMode as Hb, createMcpEnvironment as Hc, SupervisedPursuitResult as Hd, defaultEdgeTraversalCap as Hf, secretEnvOfMcpServer as Hg, CliWorktreeSeam as Hh, graphFileNeedSchema as Hi, AuthoredStrategy as Hl, FinalizerSettled as Hm, validateStoredGraph as Hn, canDisplace as Ho, ParkedRun as Hp, bestProfileFor as Hr, claimRetainedInteractiveControl as Hs, createVerifierEnvironment as Ht, Widen as Hu, CodexForkBoundary as Hv, DefinedAnalystRecord as Hx, OtelExporter as Hy, NodeSnapshot as I, ProviderWorkspaceCaptureReceipt as IC, ValidationError as IS, SubmitInput as I_, WidenGate as Ia, QuestionRecord as Ib, SnapshotKind as Ic, VersionJudge as Id, GraphTopology as If, KeyProvider as Ig, createExecutorRegistry as Ih, pickBestGraph as Ii, breadthStrategy as Il, ReentryContinuity as Im, WorkerToolTraceArtifact as In, RepairStop as Io, SupervisorSpanOptions as Ip, ProvisionSupervisorRequest as Ir, PrivateCasNamespaceRetirement as Is, SandboxEvent$1 as It, SteerContext as Iu, CompletionPolicy as Iv, AnalystLensOutput as Ix, createWaterfallCollector as Iy, DriverAttemptRecord as J, LoopDecisionPayload as JC, RetainedRunAdmission as JS, DelegationHistoryEntry as J_, UnknownMaterializationReason as Ja, MapItemFailurePolicy as Jb, BenchmarkStrategySummary as Jc, PursuitNodeCost as Jd, IsolatedCheckCommandEvidence as Jf, mapSandboxToolEvent as Jg, SandboxSteeringOptions as Jh, RollingDispatchOptions as Ji, adaptiveRefine as Jl, CoordinationPublicAddress as Jm, SearchSpec as Jn, modelAuthoredChecks as Jo, BudgetPoolRestore as Jp, profileBridgeWireModel as Jr, RetainedInteractiveAdmissionHook as Js, SurfaceReader as Jt, DefinePersonaInput as Ju, CodexStoreDelta as Jv, LocalHarness as Jx, RuntimeStreamEventCollector as Jy, EvidencePendingEvent as K, ExecCtx as KC, RetainedInteractiveIntentAdmission as KS, DelegationFeedbackSnapshot as K_, ProfileMaterializationReceipt as Ka, DownMessageEvent as Kb, BenchmarkLift as Kc, PursuitObserverDelivery as Kd, IsolatedCheckBox as Kf, createSandboxToolPartState as Kg, SandboxSeam as Kh, DispatchStopReason as Ki, StrategyCtx as Kl, CoordinationControlAccess as Km, CompiledSearchSpec as Kn, defaultStructuralRolloutPolicy as Ko, readRunParking as Kp, profileRunsForName as Kr, ReconnectRetainedInteractiveRunOptions as Ks, SurfaceReadBox as Kt, WinnerStrategy as Ku, CodexRolloutStoreRef as Kv, runLocalHarness as Kx, loopEventToOtelSpan as Ky, NodeStatus as L, ProviderWorkspaceCaptureResult as LC, NativeContextContinuationExecution as LS, SubmitOutput as L_, AgentExecutionRef as La, QuestionUrgency as Lb, canonicalObservedModelParts as Lc, VersionVerdict as Ld, RunGraphOptions as Lf, ResolvedMcpServerLaunch as Lg, ExecutorConfig as Lh, recordGraphRun as Li, depthStrategy as Ll, ReentryTaskInput as Lm, parseWorkerToolTraceArtifact as Ln, StructuralRolloutConfig as Lo, SupervisorSpanOutcome as Lp, ProvisionedSupervisor as Lr, reconnectRetainedRun as Ls, SandboxInstance$1 as Lt, TrajectoryNode as Lu, CompletionVerdict as Lv, AnalystRegistry$1 as Lx, RunAgentRoundsOptions as Ly, SpendChannel as M, resolveHarnessTranscriptCapture as MC, BackendTransportError as MS, DelegationResumeTick as M_, ResumedKeyState as Ma, QuestionEscalationTarget as Mb, PairedCommandOptions as Mc, PursuitVersionChain as Md, GraphEdge as Mf, readWorkerProgress as Mg, DelegateError as Mh, graphRunsFor as Mi, RunAgenticOptions as Ml, allWorkersStalled as Mm, localShell as Mn, CheckRunContext as Mo, kernelPromptRegistry as Mp, RemoteWorkerEvents as Mr, S3PrivateCasStoreOptions as Ms, ExecResult as Mt, RenderCorpusToInstructionsOptions as Mu, mapExecutorResult as Mv, createPushTraceSource as Mx, renderAnytimeTable as My, SpendGap as N, retainHarnessTranscript as NC, ConfigError as NS, DelegationRunContext as N_, ResumedWork as Na, QuestionLevel as Nb, measurePairedCommands as Nc, PursuitVersionStop as Nd, GraphEdgeCapError as Nf, BridgeHarnessStore as Ng, DelegateHandlerOptions as Nh, listGraphRuns as Ni, StrategyMessage as Nl, anyOf as Nm, runInWorkspace as Nn, CheckRunner as No, naiveContinuationPrompt as Np, connectRemoteSupervisor as Nr, createS3PrivateCasStore as Ns, ForkRequest as Nt, ScopeAnalyst as Nu, verdictFromJudgeScore as Nv, AnalystAssignmentRecord as Nx, WaterfallCollector as Ny, BudgetViolation as O, HarnessTranscriptReadOptions as OC, Redactor as OS, DelegationArgs as O_, ExecutorRegistry as Oa, Question as Ob, registryScopeAnalyst as Oc, readDeclaredCheck as Od, GraphFromStoredOptions as Of, ScopeProgressInput as Og, EventSubscription as Oh, graphCorpusSummary as Oi, AgenticTask as Ol, PlateauOptions as Om, WorkspaceCommit as On, supervisorInstructions as Oo, delegatesWorkerBriefPrompt as Op, RemoteSupervisorControl as Or, SandboxEvidenceReceipt as Os, CheckpointRequest as Ot, PanelJudge as Ou, CompletionCheckContext as Ov, watchTrace as Ox, anytimeReport as Oy, Handle as P, ProviderWorkspaceAttemptProvenance as PC, JudgeError as PS, DelegationTaskQueue as P_, Scope as Pa, QuestionOption as Pb, observationFromRegistry as Pc, PursuitVersions as Pd, GraphNode as Pf, BridgeModelCredential as Pg, DelegateResult as Ph, loadGraph as Pi, StrategyShotResult as Pl, noProgressFor as Pm, TrajectoryAnalysis as Pn, CheckSource as Po, promptHandle as Pp, connectRemoteSupervisorControl as Pr, PrivateCasNamespaceInventory as Ps, PlacementInfo as Pt, ScopeAnalyzeInput as Pu, CompletionAnalyst as Pv, AnalystFindingEvent as Px, WaterfallReport as Py, DriverRepromptRefusal as Q, LoopIterationStartedPayload as QC, RetainedRunDispatchedAdmission as QS, DelegationStatusResult as Q_, ExecutorCancellation as Qa, AUTHORITY_MARKERS as Qb, runBenchmark as Qc, PursuitNodeUsage as Qd, IsolatedCheckOutputDeclaration as Qf, sumSandboxUsage as Qg, AuthorityInboxMessage as Qh, DesignerRunGraphEnv as Qi, sampleThenRefine as Ql, CoordinationHttpAudit as Qm, compileSearchSpec as Qn, selectBestIndex as Qo, ReservationHolder as Qp, InteractiveWorkerResult as Qr, StartRetainedInteractiveRunOptions as Qs, harvestSurfaceDiffs as Qt, PersonaContext as Qu, readCodexRolloutSession as Qv, openSqlRunStore as Qx, SanitizedKnowledgeReadinessReport as Qy, RetainedExecutionState as R, ProviderWorkspaceEntryMetadata as RC, NativeContextContinuationHandle as RS, DelegateCodeArgs as R_, ExecutionBindingReceipt as Ra, questionEscalationTargets as Rb, observedModelHasSnapshot as Rc, assertPursuitVersions as Rd, RunGraphTestOptions as Rf, envKeyProvider as Rg, createExecutor as Rh, recordStoredGraphRun as Ri, refine as Rl, UNPROVEN_CONTINUITY as Rm, DEFAULT_MAX_DEPTH as Rn, StructuralRolloutMessage as Ro, SupervisorSpanRecorder as Rp, SupervisorCleanupReceipt as Rr, recoverRetainedRun as Rs, WorkspaceRequest as Rt, TrajectoryReport as Ru, completionAuthorizes as Rv, AnalystRunContext as Rx, runAgentRounds as Ry, RuntimeStreamEvent as S, persistHarnessTranscript as SC, cancelRunAsync as SS, SiblingSandboxExecutorOptions as S_, RootProviderModelEvidence as Sa, RouteFlowEvent as Sb, widen as Sc, DeclaredCheckStateCapture as Sd, SuperviseRegistryTable as Sf, UnavailablePausePolicy as Sg, SpawnResourceReader as Sh, GraphRunQuery as Si, StdioMcpServerSpec as Sl, SupervisorToolDescriptor as Sm, UntrackedCopyStats as Sn, ProfileRichness as So, withRunContext as Sp, supervisorRunsRoot as Sr, SandboxRunAbortError as Ss, AgentSession as St, FanoutOptions as Su, FileDelegationStore as Sv, RuntimeRunPersistenceAdapter as Sw, BusStats as Sx, renderLeaderboardMarkdown as Sy, RuntimeFailureOwner as T, HarnessFileBinding as TC, InMemoryResultBlobStore as TS, DetachedTurn as T_, AgentSpec as Ta, RouteWhen as Tb, assertTraceDerivedFindings as Tc, declaredCheckDeliverable as Td, GraphCheckOutput as Tf, ActivityNote as Tg, McpServer as Th, StoredGraph as Ti, AgenticOptions as Tl, SupervisorProfile as Tm, GitWorkspaceOptions as Tn, assessAuthoredProfile as To, RegisteredPrompt as Tp, writeWorkerSteerAsync as Tr, SandboxLineage as Ts, AgentTurnResult$2 as Tt, LoopUntilSpec as Tu, CoderTask as Tv, startRuntimeRun as Tw, createEventBus as Tx, AnytimeReport as Ty, SubtreeResult as U, AgentRunSpec as UC, RecoverRetainedRunResult as US, DelegateUiAuditConfig as U_, MaterializedModelIdentity as Ua, DownMessageAuthorizationInput as Ub, sanitizeMcpToolSchema as Uc, superviseGraphPursuit as Ud, GraphRouteError as Uf, SandboxLeafOut as Ug, ProviderSeam as Uh, graphFileSchema as Ui, ShotSpec as Ul, SupervisorFinalizer as Um, FencedSqlRunContext as Un, compareCheckOutcomes as Uo, RunParkedError as Up, loadProfile as Ur, reconnectRetainedInteractiveRun as Us, BoxSurfaceReaderOptions as Ut, WidenDecision as Uu, CodexRolloutIdentity as Uv, CodexExecutionEvidence as Ux, OtelSpan as Uy, SpawnPrior as V, TokenUsageProvenance as VC, RecoverRetainedRunIntentOptions as VS, DelegateResearchConfig as V_, ExecutorNodeContext as Va, ContinuationInstruction as Vb, McpEnvironmentOptions as Vc, SupervisePursuitOptions as Vd, runGraphWithTestBrain as Vf, resolveSecretEnv as Vg, CliWorktreeBridgeSeam as Vh, GraphTriggerBinding as Vi, AuthorStrategyOptions as Vl, FinalizeContext as Vm, ValidateStoredGraphOptions as Vn, VisibleCheck as Vo, DeadlineCheckIn as Vp, ProfileRunRecord as Vr, ClaimRetainedInteractiveControlOptions as Vs, VerifierEnvironmentOptions as Vt, VerifySpec as Vu, stopSentinel as Vv, AuthoredAnalystLimits as Vx, OtelExportStats as Vy, SubtreeSummary as W, DefaultVerdict$2 as WC, RetainedInteractiveAdmission as WS, DelegateUiAuditRoute as W_, MaterializedResources as Wa, DownMessageDeliveryAttempt as Wb, BenchmarkCell as Wc, supervisePursuit as Wd, PortableContinuationPolicy as Wf, SandboxOutputMarker as Wg, RouterSeam as Wh, graphRouteWhenSchema as Wi, Strategy as Wl, bestDelivered as Wm, SqlRunContextOptions as Wn, composeCheckSources as Wo, RunParkingPolicy as Wp, pickBestProfile as Wr, recoverRetainedInteractiveRun as Ws, HarvestSurfaceDiffsOptions as Wt, WidenLineage as Wu, CodexRolloutSession as Wv, LocalHarnessResult as Wx, buildLoopOtelSpans as Wy, DriverContinuationRecord as X, LoopIterationDispatchPayload as XC, RetainedRunCancelOptions as XS, DelegationResultPayload as X_, Executor as Xa, MapSpawnMarker as Xb, Environment as Xc, PursuitNodeProjection as Xd, IsolatedCheckResult as Xf, SandboxUsageLedger as Xg, SteerableSandboxSession as Xh, queueOf as Xi, authorStrategy as Xl, CoordinationTransportOptions as Xm, SearchSpecOwnedOption as Xn, resolveEntrySymbol as Xo, LeakedReservation as Xp, InteractiveWorkerKeyInput as Xr, RetainedInteractiveRunHandle as Xs, boxSurfaceReader as Xt, Outcome as Xu, createCodexRolloutStoreReader as Xv, CodexExecutionPolicy as Xx, RuntimeStreamEventSummary as Xy, DriverAttemptStop as Y, LoopEndedPayload as YC, RetainedRunAdmissionHook as YS, DelegationProgress as Y_, EnvironmentTeardownReceipt as Ya, MapOnSettleRoute as Yb, BenchmarkTaskRow as Yc, PursuitNodePlatform as Yd, IsolatedCheckOptions as Yf, SandboxServedBackend as Yg, SteerableSandboxArgs as Yh, freeSlots as Yi, assertStrategyContract as Yl, CoordinationReadAccess as Ym, SearchSpecInputs as Yn, officialChecksFromMeta as Yo, BudgetReadout as Yp, InteractiveWorkerEnvironment as Yr, RetainedInteractiveEnvironmentInput as Ys, WatchedSurface as Yt, LoopShape as Yu, addHarnessUsage as Yv, CodexTokenUsage as Yx, RuntimeStreamEventSink as Yy, DriverFailureClass as Z, LoopIterationEndedPayload as ZC, RetainedRunCancellation as ZS, DelegationStatus as Z_, ExecutorAccounting as Za, MapTraversalEvent as Zb, printBenchmarkReport as Zc, PursuitNodeTiming as Zd, runIsolatedCheck as Zf, extractLlmCallEvent as Zg, createSteerableSandboxSession as Zh, rollingDispatch as Zi, defineStrategy as Zl, serveCoordinationMcp as Zm, assertSearchSpec as Zn, sandboxCheckRunner as Zo, ReservationFloor as Zp, InteractiveWorkerOptions as Zr, RetainedInteractiveStartMaterial as Zs, fsSurfaceReader as Zt, Persona as Zu, harnessUsageIsEmpty as Zv, SqlRunOwnershipError as Zx, RuntimeTelemetryOptions as Zy, RunAgentTaskOptions as _, HarnessTranscriptUnavailableReason as _C, readRunState as _S, UiAuditorDelegate as __, SupervisorOpts as _a, DecideGate as _b, loopUntil as _c, LeaderboardScore as _d, SuperviseOptions as _f, resolveAgentEnvironmentProvider as _g, DriverRetryPolicy as _h, graphWorkspace as _i, LocalMcpMaterialization as _l, ResolveSupervisorTools as _m, closingWorkerNote as _n, ChatWorkerSeamOptions as _o, InMemoryRunContextOptions as _p, readWorkerCancellation as _r, Deliverable as _s, AgentEnvironmentProvider$1 as _t, CorpusFilter as _u, readTraceContextFromEnv as _v, Validator as _w, McpToolAnnotations as _x, ProfileKeyOf as _y, AgentKnowledgeProvider as a, RetainedRunSnapshot as aC, SpawnForestNode as aS, ToolLoopCompaction as a_, ResultBlobStore as aa, WorktreeCommandResult as ab, PrivateCasOffloadReport as ac, readHarnessTranscriptSessions as ad, ObserverJournal as af, SharedBoxCloseReceipt as ag, ContinuationAppend as ah, setGraphStrings as ai, loopDispatch as al, RootStreamRecord as am, WorktreeCliExecutorOptions as an, Runtime as ao, IsolatedCheckCpuIdentity as ap, TRACE_SUMMARY_SCHEMA as ar, StreamAgentTurnOptions as as, MakeWorkerAgent as at, harvestCorpus as au, UiFindingScreenshot as av, LoopTeardownFailedPayload as aw, PeerMailReadout as ax, CodeModeToolset as ay, RuntimeSession as b, captureHarnessTranscript as bC, RunCancellation as bS, FleetHandle as b_, ProviderModelAttemptEvidence as ba, JsonScalar as bb, selectValidWinner as bc, DeclaredCheck as bd, createWorkerSlots as bf, ProviderPromptOptions as bg, SpawnResourceBytes as bh, GraphCorpusSummary as bi, McpSpawnFault as bl, SupervisorNodeContext as bm, spendFromUsageEvents as bn, createChatSessionStore as bo, createFileRunContext as bp, safeWorkerFile as br, OpenSandboxRunPromptOptions as bs, AgentEnvironmentSummary as bt, EqualKOnCostOptions as bu, DelegationPersistenceError as bv, RuntimeRunHandle as bw, BusEvent as bx, pairwiseSignificance as by, AgentTaskContext as c, StartRetainedRunInEnvironmentOptions as cC, FileResultBlobStore as cS, ToolLoopToolCall as c_, TraceRootReceipt as ca, GitRunner as cb, equalKOnCost as cc, RetainedFileOutput as cd, observerRecordDigest as cf, SharedBoxStats as cg, ContinuationPanelInput as ch, GraphSessionObservationOptions as ci, TERMINAL_DECISIONS as cl, SettledUsage as cm, AttachWorkerOptions as cn, WorkerTraceEvidence as co, IsolatedCheckCpuSessionResult as cp, RunTraceSources as cr, EvolutionAuthor as cs, SpawnPreflight as ct, ObservationError as cu, KnowledgeItem as cv, LoopTraceEvent as cw, PeerMailbox as cx, runCodeMode as cy, AgentTaskStatus as d, HarnessTranscriptArtifact as dC, SpawnJournalReadOptions as dS, CoderDelegate as d_, RootHandle as da, EventAcknowledgement as db, runPersonified as dc, LeaderboardBenchTask as dd, supervise as df, ROUTER_CLIENT_HEADER as dg, ContinuationProfile as dh, graphFlowSpawnProfile as di, inlineSandboxClient as dl, CoordinationToolFace as dm, attachWorker as dn, WorkerEventEntry as do, SeatSelection as dp, WorkerSteerAcknowledgement as dr, StrategyEvolutionConfig as ds, SpawnRefusalCause as dt, defaultAnalystInstruction as du, ResearchSource as dv, MountRecorder as dw, createPeerMailbox as dx, Interval as dy, RetainedRunEnvironmentAdmission as eC, materializeTreeView as eS, RouterTransportConfig as e_, GraphDesignerExtraTools as ea, createRuntimeEventCollector as eb, resolveSandboxClient as ec, RunPersonified as ed, PursuitRunProjection as ef, InboxLease as eg, CoordinationDeliveryEvidence as eh, InPlaceCliExecutorOptions as ei, LoopDispatchOptions as el, ReservationShortfall as em, analystsFromRegistry as en, ExecutorResult as eo, IsolatedCheckOutputFailure as ep, searchSpecDigest as er, visibleCheckScore as es, CoordinationStats as et, strategyAuthorSystemPrompt as eu, FeedbackRefersTo as ev, LoopPlanDescription as ew, PEER_MAIL_WIRE_KEY as ex, decodeHarnessUsage as ey, BackendErrorDetail as f, HarnessTranscriptBinding as fC, SpawnJournalReadRecord as fS, CoderReview as f_, RootSegment as fa, LeadMessage as fb, FileCorpus as fc, LeaderboardBenchmarkAdapter as fd, superviseFleetCapabilities as ff, sharedBoxRefusal as fg, PanelFinding as fh, GraphFileNeed as fi, InProcessOnPrompt as fl, CoordinationVerbs as fm, readWorkerInteractiveBinding as fn, WorkerEventPage as fo, SeatSelectionInput as fp, WorkerSteerRequest as fr, StrategyTournament as fs, SuperviseProfileEntry as ft, observe as fu, ResearchTask as fv, OutputAdapter as fw, isPeerMailEnvelope as fx, Leaderboard as fy, OpenAIChatToolChoice as g, HarnessTranscriptUnavailable as gC, RunState as gS, DetachedWinnerSelection as g_, Supervisor as ga, WorkerWatchOptions as gb, flatWidenGate as gc, LeaderboardScenario as gd, AuthorizedSpawnContext as gf, createAgentEnvironmentProviderRegistry as gg, DriverReentry as gh, LoadedGraphFile as gi, HttpMcpServerSpec as gl, ResolveDriveHarness as gm, WorkerEvidenceInput as gn, ChatTransportTool as go, InMemoryRunContext as gp, legacySupervisorRunDir as gr, strategyTournament as gs, AgentEnvironmentEvent$1 as gt, Corpus as gu, createPropagatingTraceEmitter as gv, ValidationCtx as gw, JsonRpcResponse as gx, PairwiseVerdict as gy, OpenAIChatTool as h, HarnessTranscriptFile as hC, FileSpawnJournal as hS, DetachedSessionDelegateOptions as h_, SteerableRootHandle as ha, ToolOutcomeEvent as hb, fanout as hc, LeaderboardRunContext as hd, AuthorizedSpawn as hf, AgentEnvironmentProviderRegistry as hg, DriverContractState as hh, LoadGraphFileOptions as hi, inProcessSandboxClient as hl, ObserveSupervisorNodeEvent as hm, VERIFY_TAIL_CHARS as hn, ChatTransportExecutorOptions as ho, subscriptionUsageLimitSignal as hp, fileEscalateQuestion as hr, runStrategyEvolution as hs, AgentEnvironmentCapabilities$1 as ht, CombinatorShape as hu, TraceContext as hv, SelectionReceipt as hw, JsonRpcMessage as hx, PairwiseOptions as hy, AgentExecutionBackend as i, RetainedRunReplayPoint as iC, SpawnForestMissingTree as iS, ToolLoopChat as i_, delegate as ia, WorktreeCheckRunner as ib, PrivateCasDurableStore as ic, ShapeRegistry as id, FileObserverJournal as if, DEFAULT_SHARED_BOX_WORKERS as ig, CheckRead as ih, setGraphProfile as ii, loopCampaignDispatch as il, createBudgetPool as im, worktreeFanout as in, HeldRelease as io, IsolatedCheckCpuEvidence as ip, TRACE_ROOT_SCHEMA as ir, CollectedAgentTurn as is, GraphSubtasks as it, HarvestReport as iu, UiFinding as iv, LoopStartedPayload as iw, PeerMailOutcome as ix, CodeModeToolsOptions as iy, Spend as j, readBoundHarnessSessions$1 as jC, AgentEvalErrorCode as jS, DelegationResumeDriver as j_, ReenteredWorkers as ja, QuestionEscalationRecord as jb, PairedCommandMeasurement as jc, NextPursuitVersionInput as jd, EdgeTraversal as jf, createActivityLog as jg, McpEventSource as jh, graphRegistry as ji, CorpusReadbackOptions as jl, StopRule as jm, jjWorkspace as jn, CheckOutcome as jo, formatPromptHandle as jp, RemoteSupervisorTree as jr, S3PrivateCasStore as js, ExecRequest as jt, PipelineStage as ju, gateOnDeliverable as jv, TraceSource as jx, plateauLength as jy, ResourceLimit as k, RetainedHarnessTranscriptCapture as kC, defaultRedactor as kS, DelegationRecord as k_, SpawnModelSubstitution as ka, QuestionDecision as kb, PairedCommandCall as kc, JudgedPursuitVersion as kd, AgentGraph as kf, TeamProgress as kg, EventSubscriptionStore as kh, graphDigest as ki, AgenticTool as kl, ProgressView as km, WorkspaceRun as kn, RunCancellationReason as ko, dumbContinuationFailPrompt as kp, RemoteSupervisorReader as kr, AcquireOptions as ks, CreateAgentEnvironmentInput$1 as kt, PanelSpec as ku, DeliverableSpec as kv, SessionMessageLike as kx, areaUnderCurve as ky, AgentTaskRunResult as l, StartRetainedRunOptions as lC, replaySpawnTree as lS, FeedbackEvent as l_, WorkspaceCheckpointMarker as la, AwaitWakeInput as lb, trajectoryReport as lc, DefinedLeaderboard as ld, PursuitFork as lf, SharedWorkerIdentity as lg, ContinuationPanelResult as lh, ObservedSessionFacts as li, TerminalDecision as ll, supervisorAgent as lm, WorkerInteractiveBinding as ln, WorkerTraceUnavailableReason as lo, createIsolatedCheckCpuSession as lp, runToolSpans as lr, EvolutionReport as ls, SpawnPreflightContext as lt, ObserveInput as lu, KnowledgeUpdate as lv, LoopWinner as lw, PeerMailboxOptions as lx, AxisScoresOf as ly, OpenAIChatResponseFormat as m, HarnessTranscriptEvidence as mC, readSpawnJournal as mS, DelegateRunCtx as m_, RootSignal as ma, ManagerWake as mb, renderCorpusToInstructions as mc, LeaderboardIterationInfo as md, workerFromBackend as mf, AgentEnvironmentProviderRef as mg, admitContinuationPolicy as mh, GraphFileSeat as mi, InProcessSandboxClientOptions as ml, DriveHarnessOwnerContext as mm, NOTE_MAX_CHARS as mn, ChatSessionStore as mo, SelectSeat as mp, cancelWorker as mr, TournamentRow as ms, AgentEnvironment$1 as mt, AssertTraceDerivedFindings as mu, researcherProfile as mv, SandboxClient as mw, peerMailVerbNames as mx, LeaderboardRow as my, AgentBackendContext as n, RetainedRunHandle as nC, SpawnForestEvent as nS, ToolSpec as n_, DelegateOptions as na, sanitizeKnowledgeReadinessReport as nb, profileOptimizerModelCall as nc, ShapeBudget as nd, PursuitStatus as nf, PeerInboxMessage as ng, FileCoordinationLog as nh, readGraphProfile as ni, SuperviseDispatchOptions as nl, ReservationTicket as nm, AuthoredHarness as nn, HeldEnvironment as no, validateIsolatedCheckOutputs as np, createScope as nr, AgentTurnInput$1 as ns, CoordinationToolsOptions as nt, HarvestError as nu, UiAuditLensFilter as nv, LoopResult as nw, PeerMailEvent as nx, CodeModeTool as ny, AgentRuntimeEvent as o, RetainedRunStartMaterial as oC, SpawnForestTree as oS, ToolLoopCompactionOptions as o_, SpawnEvent as oa, WorktreeHarnessResult as ob, PrivateCasOptions as oc, ProviderAsSandboxClientOptions as od, ObserverRecord as of, SharedBoxPlacement as og, ContinuationEntry as oh, DeepReadonly as oi, superviseDispatch as ol, readRootStream as om, WorktreePatchArtifact as on, WorkerInteractiveSession as oo, IsolatedCheckCpuResources as op, TraceRootArtifact as or, collectAgentTurn as os, PeerAuditAccess as ot, Observation as ou, UiFindingSeverity as ov, LoopTokenUsage as ow, PeerMailRefusal as ox, RunCodeModeOptions as oy, KnowledgeReadinessDecision as p, HarnessTranscriptCapture as pC, SpawnJournalReadResult as pS, CoderReviewer as p_, RootSegmentEntry as pa, ManagerReentryState as pb, InMemoryCorpus as pc, LeaderboardFlagSpec as pd, superviseWithTestBrain as pf, sharedWorkerClientName as pg, VerdictSummary as ph, GraphFileResolutionError as pi, InProcessPromptCtx as pl, DriveHarness as pm, EVIDENCE_MAX_CHARS as pn, ChatCompletionsTransport as po, SeatStage as pp, WriteWorkerSteerOptions as pr, TournamentCell as ps, WorkerSpawnContext as pt, renderReport as pu, ResearcherProfileOptions as pv, RunProvenance as pw, peerMailTools as px, LeaderboardOptions as py, RetainedPendingCause as q, Iteration as qC, RetainedInteractiveStartedAdmission as qS, DelegationHistoryArgs as q_, RootMaterialization as qa, WorkerResumeContext as qb, BenchmarkReport as qc, PursuitCostProvenance as qd, IsolatedCheckBoxEvidence as qf, mapSandboxEvent as qg, DEFAULT_SANDBOX_STEERING_MAX_TURNS as qh, DispatchUnit as qi, StrategyResult as ql, CoordinationMcpHandle as qm, SEARCH_SPEC_CORRELATION_KEY as qn, filterAuthoredAsserts as qo, BudgetPool as qp, recordProfileRun as qr, RecoverRetainedInteractiveRunOptions as qs, SurfaceReadOutcome as qt, DefinePersona as qu, CodexRolloutTurn as qv, LOCAL_HARNESSES as qx, RuntimeEventCollector as qy, AgentBackendInput as r, RetainedRunIntentAdmission as rC, SpawnForestInDoubtNode as rS, ToolLoopCallContext as r_, defaultDelegateBudget as ra, InPlaceHarnessResult as rb, PrivateCasArtifactPort as rc, ShapeContext as rd, projectPursuit as rf, DEFAULT_SHARED_BOX_RESOURCES as rg, PriorCoordination as rh, readGraphStrings as ri, SuperviseOptionsForDispatch as rl, ReserveOptions as rm, WorktreeFanoutOptions as rn, HeldForContinuation as ro, IsolatedCheckCpuCounters as rp, ScopeArgs as rr, AgentTurnUsage as rs, GraphSubtaskPreparation as rt, HarvestFailure as ru, UiAuditorDelegationOutput as rv, LoopSandboxPlacement as rw, PeerMailLimits as rx, CodeModeToolContext as ry, AgentRuntimeEventSink as s, RetainedRunTurnInput as sC, loadSpawnForest as sS, ToolLoopMessageRecord as s_, SpawnJournal as sa, WorktreeProfileMaterializationReceipt as sb, createPrivateCasArtifactPort as sc, providerAsSandboxClient as sd, ObserverRecordKind as sf, SharedBoxPlacementOptions as sg, ContinuationPanel as sh, ReadonlyAgentProfile as si, LocalSandboxClientOptions as sl, readRootStreamReceipt as sm, createWorktreeCliExecutor as sn, WorkerInteractiveUnavailableReason as so, IsolatedCheckCpuSession as sp, TraceSummary as sr, streamAgentTurn as ss, SettledWorker as st, ObservationAnalysis as su, UiLens as sv, LoopTraceEmitter as sw, PeerMailSendInput as sx, createCodeModeTools as sy, AgentAdapter as t, RetainedRunEventOptions as tC, SpawnForest as tS, RouterRouting as t_, graphDesignerExtraTools as ta, createRuntimeStreamEventCollector as tb, profileChatClient as tc, RunPersonifiedOptions as td, PursuitRunTotals as tf, InboxMessage as tg, CoordinationLog as th, createInPlaceCliExecutor as ti, LoopOptionsForDispatch as tl, ReservationStage as tm, failuresAnalyst as tn, ExecutorTeardownWarning as to, IsolatedCheckOutputOptions as tp, settledToIteration as tr, AgentTurnBackend as ts, CoordinationTools as tt, HarvestCorpusOptions as tu, ResearchOutputShape as tv, LoopPlanPayload as tw, PeerMailEnvelope as tx, CodeModeStore as ty, AgentTaskSpec as u, HARNESS_TRANSCRIPT_SETTLE_TIMEOUT_MS as uC, SpawnJournalCursor as uS, FeedbackStore as u_, RecursiveReservationPolicy as ua, CoordinationEvent as ub, definePersona as uc, LeaderboardBenchScore as ud, RUN_FORK_CORRELATION_KEYS as uf, sharedBoxPlacement as ug, ContinuationPolicy as uh, graphFromSessionFacts as ui, defaultSelectWinner as ul, supervisorAgentWithTestBrain as um, WorkerInteractiveProviderSource as un, WorkerEventCursor as uo, SeatSegment as up, WorkerCancellation as ur, EvolutionStrategy as us, SpawnRefusal as ut, ObserveOptions as uu, ResearchOutput as uv, MountManifestEntry as uw, claimsAuthority as ux, GroupOf as uy, RunAgentTaskStreamOptions as v, ReadableEnvironment as vC, CancelRunOptions as vS, detachedSessionDelegate as v_, FleetYield as va, GateDecision as vb, panel as vc, LeaderboardSpec as vd, SuperviseTestOptions as vf, ProviderExecutorOptions as vg, ResolveSpawnResourcePathsResult as vh, loadGraphFile as vi, MaterializeLocalMcpOptions as vl, SupervisorAgentDeps as vm, composeWorkerEvidence as vn, chatTransportExecutor as vo, RunContext as vp, readWorkerSteerAcknowledgement as vr, OpenSandboxRunBeforeStartContext as vs, AgentEnvironmentQuery as vt, CorpusRecord as vu, DelegationTraceSpan as vv, RuntimeRunCompleteInput as vw, McpToolDescriptor as vx, ScoreOf as vy, RuntimeFailureCode as w, HARNESS_TRANSCRIPT_READ_LIMITS as wC, readRunCancellation as wS, createSiblingSandboxExecutor as w_, SupervisedResult as wa, RouteMatch as wb, RegistryAnalyzeProjection as wc, checkProgramDigest as wd, GraphCheckNodes as wf, ActivityLog as wg, resolveSpawnResourcePaths as wh, GraphSelection as wi, materializeLocalMcp as wl, ManagerWakePolicy as wm, withUntrackedArtifacts as wn, asAuthoredProfile as wo, PromptRegistry as wp, writeWorkerSteer as wr, openSandboxRun as ws, AgentSessionStatus$1 as wt, FanoutWinnerSelector as wu, CoderOutput as wv, RuntimeRunStatus as ww, PublishOptions as wx, renderPairwiseMarkdown as wy, RuntimeSessionStore as x, harnessTranscriptArtifact as xC, cancelRun as xS, FleetWorkspaceExecutorOptions as x_, ProviderModelExecutionEvidence as xa, RouteFlow as xb, verify as xc, DeclaredCheckPlacement as xd, SuperviseRegistry as xf, providerAsExecutor as xg, SpawnResourceRead as xh, GraphRegistryDir as xi, StdioMcpConnection as xl, SupervisorNodeContextSeed as xm, CopyOptions as xn, AuthoredProfile as xo, createInMemoryRunContext as xp, supervisorRunDir as xr, SandboxRun as xs, AgentProfile$2 as xt, EqualKVerdict as xu, DelegationStore as xv, RuntimeRunOptions as xw, BusRecord as xx, renderLeaderboardHtml as xy, RuntimeCanonicalStreamEvent as y, captureBoundHarnessTranscript as yC, RunCancelRequest as yS, DelegationExecutor as y_, NoWinnerError as ya, GateRequest as yb, pipeline as yc, defineLeaderboard as yd, WorkerSlots as yf, ProviderLeafOut as yg, ResolvedSpawnResourcePath as yh, GraphCorpusGroup as yi, McpListedTool as yl, SupervisorAgentTestDeps as ym, settledWorkerOut as yn, chatWorkerSeam as yo, RunContextLease as yp, readWorkerSteerRequests as yr, OpenSandboxRunOptions as ys, AgentEnvironmentStatus as yt, EqualKArm as yu, composeLoopTraceEmitters as yv, RuntimeRunCost as yw, McpTransport as yx, leaderboard as yy, Settled as z, ExecutorProgressEvent as zC, NativeContextContinuationInput as zS, DelegateCodeConfig as z_, ExecutorExecutionBinding as za, AuthorizeDownMessage as zb, observedModelMatchesDeclared as zc, SuperviseGraphPursuitOptions as zd, TraversalContinuity as zf, mcpSecretEnvMetadataKey as zg, CliInPlaceSeam as zh, storedGraphDigests as zi, runAgentic as zl, composeReentryTask as zm, createSupervisor as zn, StructuralRolloutPolicy as zo, createSupervisorSpanRecorder as zp, provisionSupervisor as zr, startRetainedRun as zs, computeFindingId$1 as zt, TrajectoryReportOptions as zu, deterministicCompletion as zv, AnalyzeOnSettleRoute as zx, OtelAttribute as zy };
19830
- //# sourceMappingURL=types-Br9sWTWk.d.ts.map
19837
+ //# sourceMappingURL=types-CbvBgzJB.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tangle-network/agent-runtime",
3
- "version": "10.0.14",
3
+ "version": "10.0.16",
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": {
@@ -126,6 +126,7 @@
126
126
  "@tangle-network/agent-provider-e2b": "0.7.0",
127
127
  "@tangle-network/agent-provider-tangle": "5.0.16",
128
128
  "@tangle-network/sandbox": "1.0.395",
129
+ "sandbox-trace-test": "npm:@tangle-network/sandbox@1.0.575",
129
130
  "@tangle-network/sandbox-ui": "7.0.9",
130
131
  "@types/node": "26.6.6",
131
132
  "@types/tar-stream": "3.1.5",
@@ -181,7 +182,7 @@
181
182
  "check:version-bump": "node scripts/check-version-bump.mjs",
182
183
  "check:release-notes": "node scripts/release-notes.mjs",
183
184
  "check:api-surface": "node scripts/check-api-surface.mjs",
184
- "release:check": "pnpm run check:publish-workflow && node --test scripts/release-publication.integration.mjs && RUNTIME_FULL_PLACEMENT_WINDOWS=1 pnpm run test && pnpm run verify:package:static && node scripts/check-api-surface.mjs --record && rm -rf .release-admission && pnpm pack --pack-destination .release-admission >/dev/null && node scripts/check-release-archive.mjs .release-admission && node scripts/check-version-bump.mjs --archive .release-admission/*.tgz --consumer 'its CHANGELOG' && node scripts/verify-package-exports.mjs .release-admission/*.tgz && pnpm run verify:official-optimizers && pnpm run verify:bench",
185
+ "release:check": "pnpm run check:publish-workflow && node --test scripts/release-publication.integration.mjs && node scripts/check-release-version-free.mjs && pnpm run verify:package:static && node scripts/check-api-surface.mjs --record && rm -rf .release-admission && pnpm pack --pack-destination .release-admission >/dev/null && node scripts/check-release-archive.mjs .release-admission && node scripts/check-version-bump.mjs --archive .release-admission/*.tgz --consumer 'its CHANGELOG' && node scripts/verify-package-exports.mjs .release-admission/*.tgz && pnpm run verify:official-optimizers && pnpm run verify:bench && RUNTIME_FULL_PLACEMENT_WINDOWS=1 pnpm run test && node scripts/check-release-version-free.mjs",
185
186
  "api:surface": "node scripts/check-api-surface.mjs --write",
186
187
  "release:prepare": "node scripts/prepare-release.mjs",
187
188
  "release:cohort": "node scripts/verify-release-cohort.mjs",