@tangle-network/agent-runtime 0.128.0 → 0.131.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +70 -20
  2. package/dist/{activation-DhWJ3p8N.js → activation-BCzMOTaV.js} +3 -3
  3. package/dist/{activation-DhWJ3p8N.js.map → activation-BCzMOTaV.js.map} +1 -1
  4. package/dist/agent.d.ts +2 -3
  5. package/dist/agent.js +4 -5
  6. package/dist/agent.js.map +1 -1
  7. package/dist/{analyst-loop-DvSciOfB.js → analyst-loop-BE8cDs5Q.js} +2 -2
  8. package/dist/{analyst-loop-DvSciOfB.js.map → analyst-loop-BE8cDs5Q.js.map} +1 -1
  9. package/dist/analyst-loop.d.ts +1 -1
  10. package/dist/analyst-loop.js +1 -1
  11. package/dist/authoring-Dv3t6SXe.js +163 -0
  12. package/dist/authoring-Dv3t6SXe.js.map +1 -0
  13. package/dist/candidate-execution/index.js +4 -4
  14. package/dist/{candidate-execution-BFpq-Xi6.js → candidate-execution-BNxKr-Bu.js} +5 -5
  15. package/dist/{candidate-execution-BFpq-Xi6.js.map → candidate-execution-BNxKr-Bu.js.map} +1 -1
  16. package/dist/{conversation-BpLQZGPH.js → conversation-DNtxaJ1Z.js} +113 -31
  17. package/dist/conversation-DNtxaJ1Z.js.map +1 -0
  18. package/dist/conversation.d.ts +2 -2
  19. package/dist/conversation.js +2 -2
  20. package/dist/environment-provider-CxvSd1W6.d.ts +86 -0
  21. package/dist/{environment-provider-DqFS6FSZ.js → environment-provider-Dyg8DtLK.js} +8 -4
  22. package/dist/environment-provider-Dyg8DtLK.js.map +1 -0
  23. package/dist/environment-provider.d.ts +1 -1
  24. package/dist/environment-provider.js +1 -1
  25. package/dist/graph-xWdv53Le.js +471 -0
  26. package/dist/graph-xWdv53Le.js.map +1 -0
  27. package/dist/{improvement-cycle-IJgCbKWQ.js → improvement-cycle-Csp38cWg.js} +133 -224
  28. package/dist/improvement-cycle-Csp38cWg.js.map +1 -0
  29. package/dist/{index-BhZhQw77.d.ts → index-CoO7atyo.d.ts} +556 -1278
  30. package/dist/{index-BhuzfG2r.d.ts → index-DwGtu9nc.d.ts} +7 -9
  31. package/dist/{index-Efjb3nrQ.d.ts → index-qYHpsmG2.d.ts} +36 -18
  32. package/dist/index.d.ts +353 -11
  33. package/dist/index.js +111 -354
  34. package/dist/index.js.map +1 -1
  35. package/dist/intelligence.d.ts +6 -6
  36. package/dist/intelligence.js +9 -8
  37. package/dist/intelligence.js.map +1 -1
  38. package/dist/kernel.d.ts +7 -5
  39. package/dist/kernel.js +13 -9
  40. package/dist/{knowledge-DF63xPr4.js → knowledge-DPEu4f-0.js} +19 -17
  41. package/dist/knowledge-DPEu4f-0.js.map +1 -0
  42. package/dist/knowledge.d.ts +1 -1
  43. package/dist/knowledge.js +1 -1
  44. package/dist/{loop-runner-bin-Ckp_9tmD.d.ts → loop-runner-bin-BwgZ8m_7.d.ts} +6 -3
  45. package/dist/{loop-runner-bin-CWqOpCEw.js → loop-runner-bin-dg6li2-b.js} +5 -27
  46. package/dist/loop-runner-bin-dg6li2-b.js.map +1 -0
  47. package/dist/loop-runner-bin.d.ts +1 -1
  48. package/dist/loop-runner-bin.js +1 -1
  49. package/dist/materialization-COJ1UYQ-.js +272 -0
  50. package/dist/materialization-COJ1UYQ-.js.map +1 -0
  51. package/dist/mcp/bin.js +39 -47
  52. package/dist/mcp/bin.js.map +1 -1
  53. package/dist/mcp/index.d.ts +24 -26
  54. package/dist/mcp/index.js +67 -84
  55. package/dist/mcp/index.js.map +1 -1
  56. package/dist/mcp/memory-bin.js +1 -1
  57. package/dist/{memory-server-DL6cE2Ag.js → memory-server-eD2baiRO.js} +3 -3
  58. package/dist/{memory-server-DL6cE2Ag.js.map → memory-server-eD2baiRO.js.map} +1 -1
  59. package/dist/model-policy-CqziaqS1.js +232 -0
  60. package/dist/model-policy-CqziaqS1.js.map +1 -0
  61. package/dist/{openai-tools-B68JaOCx.d.ts → openai-tools-D3oMyVGl.d.ts} +2 -2
  62. package/dist/{openai-tools-D3XfrrQ6.js → openai-tools-zRphjXS4.js} +2 -2
  63. package/dist/openai-tools-zRphjXS4.js.map +1 -0
  64. package/dist/{prepare--8EvLqCr.js → prepare-DYWjVcPx.js} +169 -153
  65. package/dist/prepare-DYWjVcPx.js.map +1 -0
  66. package/dist/primeintellect/index.d.ts +7 -6
  67. package/dist/primeintellect/index.js +9 -11
  68. package/dist/primeintellect/index.js.map +1 -1
  69. package/dist/profiles.d.ts +21 -174
  70. package/dist/profiles.js +67 -276
  71. package/dist/profiles.js.map +1 -1
  72. package/dist/{protected-model-port-CXVfOUu_.js → protected-model-port-48ALLGxT.js} +2 -2
  73. package/dist/{protected-model-port-CXVfOUu_.js.map → protected-model-port-48ALLGxT.js.map} +1 -1
  74. package/dist/{redact-PQzmE1Jn.d.ts → redact-9_Gf-8m3.d.ts} +58 -69
  75. package/dist/{researcher-CoVqNhfI.js → researcher-Skz5-Uc8.js} +50 -26
  76. package/dist/researcher-Skz5-Uc8.js.map +1 -0
  77. package/dist/{run-layout-C2FGmZ3v.js → run-layout-CeJsEAom.js} +2 -2
  78. package/dist/{run-layout-C2FGmZ3v.js.map → run-layout-CeJsEAom.js.map} +1 -1
  79. package/dist/runtime-D-QfLbSd.d.ts +893 -0
  80. package/dist/{runtime-5uDVVfER.js → runtime-cOzDOOHr.js} +315 -1191
  81. package/dist/runtime-cOzDOOHr.js.map +1 -0
  82. package/dist/{sandbox-events-Yhd1GYWl.js → sandbox-events-CRDwc5WN.js} +42 -5
  83. package/dist/sandbox-events-CRDwc5WN.js.map +1 -0
  84. package/dist/snapshot-CXiiuHhL.js +21 -0
  85. package/dist/snapshot-CXiiuHhL.js.map +1 -0
  86. package/dist/{spawn-journal-DsZKDqeh.js → spawn-journal-saHQzqYi.js} +15 -21
  87. package/dist/spawn-journal-saHQzqYi.js.map +1 -0
  88. package/dist/stream-agent-turn-C852AgMT.d.ts +128 -0
  89. package/dist/stream-agent-turn-rYgaOLO0.js +910 -0
  90. package/dist/stream-agent-turn-rYgaOLO0.js.map +1 -0
  91. package/dist/{structural-rollout-zY0oqQzO.js → structural-rollout-3uxVGcg2.js} +459 -235
  92. package/dist/structural-rollout-3uxVGcg2.js.map +1 -0
  93. package/dist/{supervise-CsTKbH9R.js → supervise-DHYX8gO2.js} +867 -4788
  94. package/dist/supervise-DHYX8gO2.js.map +1 -0
  95. package/dist/{supervisor-DpjO0Gmy.js → supervisor-CV6Jh28D.js} +7439 -2897
  96. package/dist/supervisor-CV6Jh28D.js.map +1 -0
  97. package/dist/testing.d.ts +3 -1
  98. package/dist/testing.js +271 -221
  99. package/dist/testing.js.map +1 -1
  100. package/dist/{tool-server-RcWgLIsL.js → tool-server-Gs3VvfSK.js} +22 -9
  101. package/dist/tool-server-Gs3VvfSK.js.map +1 -0
  102. package/dist/{top-app-5unxqovu.js → top-app-G4M18b6i.js} +3 -3
  103. package/dist/{top-app-5unxqovu.js.map → top-app-G4M18b6i.js.map} +1 -1
  104. package/dist/tui/bin.js +1 -1
  105. package/dist/tui/index.js +1 -1
  106. package/dist/{environment-provider-CUFsyymu.d.ts → types-C6Q-J0Dt.d.ts} +51 -114
  107. package/dist/{types-DnNGJ5Gz.d.ts → types-ebIY0dMG.d.ts} +556 -30
  108. package/dist/{util-MVgdwuIS.js → util-Bw6srryQ.js} +3 -2
  109. package/dist/{util-MVgdwuIS.js.map → util-Bw6srryQ.js.map} +1 -1
  110. package/dist/{workspace-archive-BQxvkypI.js → workspace-archive-aOfJ47ms.js} +3 -3
  111. package/dist/{workspace-archive-BQxvkypI.js.map → workspace-archive-aOfJ47ms.js.map} +1 -1
  112. package/package.json +13 -15
  113. package/skills/agent-graphs/IMPROVE.md +3 -3
  114. package/skills/agent-graphs/SKILL.md +4 -5
  115. package/skills/agent-graphs/cases/review-pipeline.json +1 -2
  116. package/skills/agent-graphs/cases/unmeasured-harness.json +2 -4
  117. package/dist/backends-CiOCyRHb.js +0 -743
  118. package/dist/backends-CiOCyRHb.js.map +0 -1
  119. package/dist/conversation-BpLQZGPH.js.map +0 -1
  120. package/dist/environment-provider-DqFS6FSZ.js.map +0 -1
  121. package/dist/improvement-cycle-IJgCbKWQ.js.map +0 -1
  122. package/dist/index-DLM0W1h1.d.ts +0 -545
  123. package/dist/knowledge-DF63xPr4.js.map +0 -1
  124. package/dist/local-harness-BIajef4A.d.ts +0 -465
  125. package/dist/loop-runner-bin-CWqOpCEw.js.map +0 -1
  126. package/dist/model-resolution-Btd9iIKV.js +0 -98
  127. package/dist/model-resolution-Btd9iIKV.js.map +0 -1
  128. package/dist/openai-tools-D3XfrrQ6.js.map +0 -1
  129. package/dist/prepare--8EvLqCr.js.map +0 -1
  130. package/dist/researcher-CoVqNhfI.js.map +0 -1
  131. package/dist/runtime-5uDVVfER.js.map +0 -1
  132. package/dist/sandbox-events-Yhd1GYWl.js.map +0 -1
  133. package/dist/spawn-journal-DsZKDqeh.js.map +0 -1
  134. package/dist/structural-rollout-zY0oqQzO.js.map +0 -1
  135. package/dist/supervise-CsTKbH9R.js.map +0 -1
  136. package/dist/supervisor-DpjO0Gmy.js.map +0 -1
  137. package/dist/tool-server-RcWgLIsL.js.map +0 -1
  138. package/dist/types-C9j4qg6l.d.ts +0 -500
  139. package/skills/agent-graphs/cases/floor-trap-pi.json +0 -11
@@ -1,10 +1,10 @@
1
- import { $d as capDelegationTrace, $u as DriveTurnTick, Ad as DelegationFeedbackSnapshot, Al as createCoordinationTools, Au as InMemoryFeedbackStore, Bd as FeedbackRating, Bl as DelegateError, Bu as coderTaskFromArgs, Cd as DelegateResearchConfig, Cl as QuestionRecord, Cu as removeWorktree, Dd as DelegateUiAuditResult, Dl as WorkerSpawnContext, Du as McpTransport, Ed as DelegateUiAuditConfig, Eu as McpToolDescriptor, Fd as DelegationProgress, Fl as createMcpServer, Fu as DelegateRunCtx, Gd as UiAuditorDelegationOutput, Gu as FleetWorkspaceExecutorOptions, Hd as ResearchOutputShape, Hl as DelegateResult, Hu as settleDetachedCoderTurn, Id as DelegationResultPayload, Il as DELEGATE_DESCRIPTION, Iu as DetachedSessionDelegateOptions, Jd as DELEGATION_TRACE_MAX_SPANS, Ju as createSiblingSandboxExecutor, Kd as CappedDelegationTrace, Ku as SiblingSandboxExecutorOptions, Ld as DelegationStatus, Ll as DELEGATE_INPUT_SCHEMA, Lu as DetachedWinnerSelection, Md as DelegationHistoryEntry, Ml as McpServer, Mu as CoderDelegate, Nd as DelegationHistoryResult, Nl as McpServerOptions, Nu as CoderReview, Od as DelegateUiAuditRoute, Ol as WorkerWatchOptions, Ou as FeedbackEvent, Pd as DelegationProfile, Pl as createInProcessTransport, Pu as CoderReviewer, Qd as buildDelegationTraceSpans, Qu as DriveTurnCapableBox, Rd as DelegationStatusArgs, Rl as DELEGATE_TOOL_NAME, Ru as SettleDetachedCoderTurnOptions, Sd as DelegateResearchArgs, Sl as QuestionPolicy, Su as createWorktree, Td as DelegateUiAuditArgs, Tl as SettledWorker, Tu as JsonRpcResponse, Ud as ResearchSource, Ul as createDelegateHandler, Uu as DelegationExecutor, Vd as FeedbackRefersTo, Vl as DelegateHandlerOptions, Vu as detachedSessionDelegate, Wd as UiAuditLensFilter, Wl as validateDelegateArgs, Wu as FleetHandle, Xd as DelegationTraceCollector, Xu as DetachedTurn, Yd as DelegationTraceCaps, Yu as DetachedSessionRefParts, Zd as DelegationTraceSpan, Zu as DetachedTurnResumeDriverOptions, _d as DelegateCodeArgs, _f as CoderOutput, _l as MakeWorkerAgent, _u as DiffResult, ad as runDetachedTurn, af as FileDelegationStore, al as AuthorizeDownMessage, bd as DelegateFeedbackArgs, bl as QuestionLevel, bu as WorktreeHandle, cd as DelegationResumeContext, dd as DelegationRunContext, dl as CoordinationToolsOptions, ed as RunDetachedTurnOptions, ef as composeLoopTraceEmitters, fd as DelegationTaskQueue, fl as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, gd as hashIdempotencyInput, gl as DownMessageEvent, gu as DiffOptions, hd as SubmitOutput, hl as DownMessageDeliveryOutcome, hu as CreateWorktreeOptions, id as parseDetachedSessionRef, if as DelegationStore, jd as DelegationHistoryArgs, ju as eventToSnapshot, kd as DelegationError, ku as FeedbackStore, ld as DelegationResumeDriver, ll as CoordinationEvent, md as SubmitInput, ml as DownMessageDeliveryAttempt, nd as detachedTurnEvents, nf as DelegationPersistenceError, nl as AnalystFindingEvent, od as DelegationArgs, of as FileDelegationStoreOptions, ol as AuthorizedDownMessage, pd as DelegationTaskQueueOptions, pl as DownMessageAuthorizationInput, qd as DELEGATION_TRACE_MAX_BYTES, qu as createFleetWorkspaceExecutor, rd as formatDetachedSessionRef, rf as DelegationStateCorruptError, rl as AnalystRegistry, sd as DelegationRecord, sf as InMemoryDelegationStore, sl as ContinuationInstruction, td as createDetachedTurnResumeDriver, tf as createDelegationTraceCollector, ud as DelegationResumeTick, ul as CoordinationTools, vd as DelegateCodeConfig, vl as Question, vu as GitRunner, wd as DelegateResearchResult, wl as QuestionUrgency, wu as JsonRpcMessage, xd as DelegateFeedbackResult, xl as QuestionOption, xu as captureWorktreeDiff, yd as DelegateCodeResult, yl as QuestionDecision, yu as RemoveWorktreeOptions, zd as DelegationStatusResult, zl as DelegateArgs, zu as UiAuditorDelegate } from "../index-BhZhQw77.js";
2
- import { E as SandboxClient, h as LoopSandboxPlacement } from "../types-DnNGJ5Gz.js";
3
- import { Bt as mergeTraceEnv, Ht as traceContextToEnv, Rt as TraceContext, Vt as readTraceContextFromEnv, zt as createPropagatingTraceEmitter } from "../environment-provider-CUFsyymu.js";
1
+ import { E as SandboxClient, h as LoopSandboxPlacement } from "../types-ebIY0dMG.js";
2
+ import { $l as McpTransport, $u as DelegateUiAuditResult, Ad as DelegationStore, Al as SettledWorker, Au as parseDetachedSessionRef, Bl as createMcpServer, Bu as SubmitInput, Cd as DelegationTraceSpan, Cl as Question, Cu as DetachedTurnResumeDriverOptions, Dd as createDelegationTraceCollector, Dl as QuestionPolicy, Du as createDetachedTurnResumeDriver, Ed as composeLoopTraceEmitters, El as QuestionOption, Eu as RunDetachedTurnOptions, Fl as createCoordinationTools, Fu as DelegationResumeDriver, Gl as DelegateError, Gu as DelegateCodeResult, Hl as DELEGATE_INPUT_SCHEMA, Hu as hashIdempotencyInput, Iu as DelegationResumeTick, Jl as createDelegateHandler, Ju as DelegateResearchArgs, Kl as DelegateHandlerOptions, Ku as DelegateFeedbackArgs, Ll as McpServer, Lu as DelegationRunContext, Md as FileDelegationStoreOptions, Ml as WorkerSpawnContext, Mu as DelegationArgs, Nd as InMemoryDelegationStore, Nl as WorkerWatchOptions, Nu as DelegationRecord, Od as DelegationPersistenceError, Ol as QuestionRecord, Ou as detachedTurnEvents, Pu as DelegationResumeContext, Ql as McpToolDescriptor, Qu as DelegateUiAuditConfig, Rl as McpServerOptions, Ru as DelegationTaskQueue, Sd as DelegationTraceCollector, Sl as MakeWorkerAgent, Su as DetachedTurn, Td as capDelegationTrace, Tl as QuestionLevel, Tu as DriveTurnTick, Ud as CoderOutput, Ul as DELEGATE_TOOL_NAME, Uu as DelegateCodeArgs, Vl as DELEGATE_DESCRIPTION, Vu as SubmitOutput, Wl as DelegateArgs, Wu as DelegateCodeConfig, Xl as JsonRpcMessage, Xu as DelegateResearchResult, Yl as validateDelegateArgs, Yu as DelegateResearchConfig, Zl as JsonRpcResponse, Zu as DelegateUiAuditArgs, _d as UiAuditorDelegationOutput, _l as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, _u as FleetWorkspaceExecutorOptions, ad as DelegationHistoryResult, au as CoderReview, bd as DELEGATION_TRACE_MAX_SPANS, bl as DownMessageDeliveryOutcome, bu as createSiblingSandboxExecutor, cd as DelegationResultPayload, cl as AnalystRegistry, cu as DetachedSessionDelegateOptions, dd as DelegationStatusResult, dl as AuthorizedDownMessage, du as UiAuditorDelegate, ed as DelegateUiAuditRoute, eu as FeedbackEvent, fd as FeedbackRating, fl as ContinuationInstruction, fu as coderTaskFromArgs, gd as UiAuditLensFilter, gl as CoordinationToolsOptions, gu as FleetHandle, hd as ResearchSource, hl as CoordinationTools, hu as DelegationExecutor, id as DelegationHistoryEntry, iu as CoderDelegate, jd as FileDelegationStore, ju as runDetachedTurn, kd as DelegationStateCorruptError, kl as QuestionUrgency, ku as formatDetachedSessionRef, ld as DelegationStatus, lu as DetachedWinnerSelection, md as ResearchOutputShape, ml as CoordinationEvent, mu as settleDetachedCoderTurn, nd as DelegationFeedbackSnapshot, nu as InMemoryFeedbackStore, od as DelegationProfile, ou as CoderReviewer, pd as FeedbackRefersTo, pu as detachedSessionDelegate, ql as DelegateResult, qu as DelegateFeedbackResult, rd as DelegationHistoryArgs, ru as eventToSnapshot, sd as DelegationProgress, sl as AnalystFindingEvent, su as DelegateRunCtx, td as DelegationError, tu as FeedbackStore, ud as DelegationStatusArgs, ul as AuthorizeDownMessage, uu as SettleDetachedCoderTurnOptions, vd as CappedDelegationTrace, vl as DownMessageAuthorizationInput, vu as SiblingSandboxExecutorOptions, wd as buildDelegationTraceSpans, wl as QuestionDecision, wu as DriveTurnCapableBox, xd as DelegationTraceCaps, xl as DownMessageEvent, xu as DetachedSessionRefParts, yd as DELEGATION_TRACE_MAX_BYTES, yl as DownMessageDeliveryAttempt, yu as createFleetWorkspaceExecutor, zl as createInProcessTransport, zu as DelegationTaskQueueOptions } from "../index-CoO7atyo.js";
3
+ import { at as mergeTraceEnv, it as createPropagatingTraceEmitter, ot as readTraceContextFromEnv, rt as TraceContext, st as traceContextToEnv } from "../types-C6Q-J0Dt.js";
4
4
  import { o as UiLens } from "../substrate-BcnuSHXm.js";
5
- import { a as LOCAL_HARNESSES, c as RunLocalHarnessOptions, d as parseCodexTokenUsage, f as runLocalHarness, i as DEFAULT_LOCAL_HARNESS, l as harnessSupportsReasoningEffort, n as CodexExecutionPolicy, o as LocalHarness, r as CodexTokenUsage, s as LocalHarnessResult, t as CodexExecutionEvidence, u as localHarnessExecutable } from "../local-harness-BIajef4A.js";
5
+ import { A as LocalHarness, B as GitRunner, D as CodexTokenUsage, E as CodexExecutionPolicy, F as parseCodexTokenUsage, G as removeWorktree, H as WorktreeHandle, I as runLocalHarness, L as CreateWorktreeOptions, M as RunLocalHarnessOptions, N as harnessSupportsReasoningEffort, O as DEFAULT_LOCAL_HARNESS, P as localHarnessExecutable, R as DiffOptions, T as CodexExecutionEvidence, U as captureWorktreeDiff, V as RemoveWorktreeOptions, W as createWorktree, j as LocalHarnessResult, k as LOCAL_HARNESSES, z as DiffResult } from "../runtime-D-QfLbSd.js";
6
6
  import { a as KbGateResult, i as FactJudgeVerdict, n as FactCandidate, o as createKbGate, r as FactJudge, t as CreateKbGateOptions } from "../kb-gate-C8z2juK8.js";
7
- import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-B68JaOCx.js";
7
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-D3oMyVGl.js";
8
8
  import { AgentProfileMcpServer } from "@tangle-network/agent-interface";
9
9
  //#region src/mcp/codex-diagnostics.d.ts
10
10
  /** Bounded, credential-redacted process context attached when reproducible Codex output fails
@@ -62,8 +62,6 @@ declare function detectExecutor(args: DetectExecutorArgs): Promise<DelegationExe
62
62
  interface InProcessExecutorOptions {
63
63
  /** Absolute path to the git repo (the workspace). Worktrees go under `<repoRoot>/.agent-worktrees/`. */
64
64
  repoRoot: string;
65
- /** Harnesses to round-robin across `create()` calls. One entry = no fanout. Default `['claude-code']`. */
66
- harnesses?: ReadonlyArray<LocalHarness>;
67
65
  /** Optional per-delegation test command run in the worktree after the harness exits. */
68
66
  testCmd?: string;
69
67
  /** Optional per-delegation typecheck command. Same shape as `testCmd`. */
@@ -207,11 +205,11 @@ interface ResolvedMemoryEnv {
207
205
  declare function resolveMemoryFromEnv(env: Record<string, string | undefined>): ResolvedMemoryEnv;
208
206
  //#endregion
209
207
  //#region src/mcp/tools/delegate-feedback.d.ts
210
- /** MCP tool name for the `delegate_feedback` feedback-recording tool. @experimental */
208
+ /** MCP tool name for the `delegate_feedback` feedback-recording tool. @stable */
211
209
  declare const DELEGATE_FEEDBACK_TOOL_NAME = "delegate_feedback";
212
- /** Human-readable description of the `delegate_feedback` MCP tool, injected into the tool manifest. @experimental */
210
+ /** Human-readable description of the `delegate_feedback` MCP tool, injected into the tool manifest. @stable */
213
211
  declare const DELEGATE_FEEDBACK_DESCRIPTION: string;
214
- /** JSON Schema for `delegate_feedback` tool arguments (`refersTo`, `rating`, `by`, optional fields). @experimental */
212
+ /** JSON Schema for `delegate_feedback` tool arguments (`refersTo`, `rating`, `by`, optional fields). @stable */
215
213
  declare const DELEGATE_FEEDBACK_INPUT_SCHEMA: {
216
214
  readonly type: "object";
217
215
  readonly properties: {
@@ -262,16 +260,16 @@ declare const DELEGATE_FEEDBACK_INPUT_SCHEMA: {
262
260
  readonly required: readonly ["refersTo", "rating", "by"];
263
261
  readonly additionalProperties: false;
264
262
  };
265
- /** Parse and validate raw MCP tool input into typed `DelegateFeedbackArgs`; throws `TypeError` on bad input. @experimental */
263
+ /** Parse and validate raw MCP tool input into typed `DelegateFeedbackArgs`; throws `TypeError` on bad input. @stable */
266
264
  declare function validateDelegateFeedbackArgs(raw: unknown): DelegateFeedbackArgs;
267
- /** @experimental */
265
+ /** @stable */
268
266
  interface DelegateFeedbackHandlerOptions {
269
267
  queue: DelegationTaskQueue;
270
268
  store: FeedbackStore;
271
269
  generateId?: () => string;
272
270
  now?: () => string;
273
271
  }
274
- /** Build the MCP tool handler that persists feedback events and attaches them to delegation records. @experimental */
272
+ /** Build the MCP tool handler that persists feedback events and attaches them to delegation records. @stable */
275
273
  declare function createDelegateFeedbackHandler(options: DelegateFeedbackHandlerOptions): (raw: unknown) => Promise<DelegateFeedbackResult>;
276
274
  //#endregion
277
275
  //#region src/mcp/tools/delegate-ui-audit.d.ts
@@ -377,11 +375,11 @@ interface DelegateUiAuditHandlerOptions {
377
375
  declare function createDelegateUiAuditHandler(options: DelegateUiAuditHandlerOptions): (raw: unknown) => Promise<DelegateUiAuditResult>;
378
376
  //#endregion
379
377
  //#region src/mcp/tools/delegation-history.d.ts
380
- /** MCP tool name for the `delegation_history` read-past-delegations tool. @experimental */
378
+ /** MCP tool name for the `delegation_history` read-past-delegations tool. @stable */
381
379
  declare const DELEGATION_HISTORY_TOOL_NAME = "delegation_history";
382
- /** Human-readable description of the `delegation_history` MCP tool, injected into the tool manifest. @experimental */
380
+ /** Human-readable description of the `delegation_history` MCP tool, injected into the tool manifest. @stable */
383
381
  declare const DELEGATION_HISTORY_DESCRIPTION: string;
384
- /** JSON Schema for `delegation_history` tool arguments (optional `namespace`, `profile`, `since`, `limit`). @experimental */
382
+ /** JSON Schema for `delegation_history` tool arguments (optional `namespace`, `profile`, `since`, `limit`). @stable */
385
383
  declare const DELEGATION_HISTORY_INPUT_SCHEMA: {
386
384
  readonly type: "object";
387
385
  readonly properties: {
@@ -404,21 +402,21 @@ declare const DELEGATION_HISTORY_INPUT_SCHEMA: {
404
402
  };
405
403
  readonly additionalProperties: false;
406
404
  };
407
- /** Parse and validate raw MCP tool input into typed `DelegationHistoryArgs`; throws `TypeError` on bad input. @experimental */
405
+ /** Parse and validate raw MCP tool input into typed `DelegationHistoryArgs`; throws `TypeError` on bad input. @stable */
408
406
  declare function validateDelegationHistoryArgs(raw: unknown): DelegationHistoryArgs;
409
- /** @experimental */
407
+ /** @stable */
410
408
  interface DelegationHistoryHandlerOptions {
411
409
  queue: DelegationTaskQueue;
412
410
  }
413
- /** Build the MCP tool handler that reads filtered past delegations from a `DelegationTaskQueue`. @experimental */
411
+ /** Build the MCP tool handler that reads filtered past delegations from a `DelegationTaskQueue`. @stable */
414
412
  declare function createDelegationHistoryHandler(options: DelegationHistoryHandlerOptions): (raw: unknown) => Promise<DelegationHistoryResult>;
415
413
  //#endregion
416
414
  //#region src/mcp/tools/delegation-status.d.ts
417
- /** MCP tool name for the `delegation_status` synchronous-poll tool. @experimental */
415
+ /** MCP tool name for the `delegation_status` synchronous-poll tool. @stable */
418
416
  declare const DELEGATION_STATUS_TOOL_NAME = "delegation_status";
419
- /** Human-readable description of the `delegation_status` MCP tool, injected into the tool manifest. @experimental */
417
+ /** Human-readable description of the `delegation_status` MCP tool, injected into the tool manifest. @stable */
420
418
  declare const DELEGATION_STATUS_DESCRIPTION: string;
421
- /** JSON Schema for `delegation_status` tool arguments (`taskId` + optional `includeTrace`). @experimental */
419
+ /** JSON Schema for `delegation_status` tool arguments (`taskId` + optional `includeTrace`). @stable */
422
420
  declare const DELEGATION_STATUS_INPUT_SCHEMA: {
423
421
  readonly type: "object";
424
422
  readonly properties: {
@@ -434,14 +432,14 @@ declare const DELEGATION_STATUS_INPUT_SCHEMA: {
434
432
  readonly required: readonly ["taskId"];
435
433
  readonly additionalProperties: false;
436
434
  };
437
- /** Parse and validate raw MCP tool input into typed `DelegationStatusArgs`; throws `TypeError` on bad input. @experimental */
435
+ /** Parse and validate raw MCP tool input into typed `DelegationStatusArgs`; throws `TypeError` on bad input. @stable */
438
436
  declare function validateDelegationStatusArgs(raw: unknown): DelegationStatusArgs;
439
- /** @experimental */
437
+ /** @stable */
440
438
  interface DelegationStatusHandlerOptions {
441
439
  queue: DelegationTaskQueue;
442
440
  }
443
- /** Build the MCP tool handler that polls a `DelegationTaskQueue` for task status. @experimental */
441
+ /** Build the MCP tool handler that polls a `DelegationTaskQueue` for task status. @stable */
444
442
  declare function createDelegationStatusHandler(options: DelegationStatusHandlerOptions): (raw: unknown) => Promise<DelegationStatusResult>;
445
443
  //#endregion
446
- export { type AgentMemorySpec, type AnalystFindingEvent, type AnalystRegistry, type AuthorizeDownMessage, type AuthorizedDownMessage, type CappedDelegationTrace, type CoderDelegate, type CoderOutput, type CoderReview, type CoderReviewer, CodexExecutionDiagnosticError, type CodexExecutionEvidence, type CodexExecutionFailureDiagnostic, type CodexExecutionPolicy, type CodexTokenUsage, type ContinuationInstruction, type CoordinationEvent, type CoordinationTools, type CoordinationToolsOptions, type CreateKbGateOptions, type CreateMemoryToolServerOptions, type CreateWorktreeOptions, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_LOCAL_HARNESS, DELEGATE_DESCRIPTION, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_INPUT_SCHEMA, DELEGATE_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DELEGATION_TRACE_MAX_BYTES, DELEGATION_TRACE_MAX_SPANS, type DelegateArgs, type DelegateCodeArgs, type DelegateCodeConfig, type DelegateCodeResult, type DelegateError, type DelegateFeedbackArgs, type DelegateFeedbackHandlerOptions, type DelegateFeedbackResult, type DelegateHandlerOptions, type DelegateResearchArgs, type DelegateResearchConfig, type DelegateResearchResult, type DelegateResult, type DelegateRunCtx, type DelegateUiAuditArgs, type DelegateUiAuditConfig, type DelegateUiAuditHandlerOptions, type DelegateUiAuditResult, type DelegateUiAuditRoute, type DelegationArgs, type DelegationError, type DelegationExecutor, type DelegationFeedbackSnapshot, type DelegationHistoryArgs, type DelegationHistoryEntry, type DelegationHistoryHandlerOptions, type DelegationHistoryResult, DelegationPersistenceError, type DelegationProfile, type DelegationProgress, type DelegationRecord, type DelegationResultPayload, type DelegationResumeContext, type DelegationResumeDriver, type DelegationResumeTick, type DelegationRunContext, DelegationStateCorruptError, type DelegationStatus, type DelegationStatusArgs, type DelegationStatusHandlerOptions, type DelegationStatusResult, type DelegationStore, DelegationTaskQueue, type DelegationTaskQueueOptions, type DelegationTraceCaps, type DelegationTraceCollector, type DelegationTraceSpan, type DetachedSessionDelegateOptions, type DetachedSessionRefParts, type DetachedTurn, type DetachedTurnResumeDriverOptions, type DetachedWinnerSelection, type DetectExecutorArgs, type DiffOptions, type DiffResult, type DownMessageAuthorizationInput, type DownMessageDeliveryAttempt, type DownMessageDeliveryOutcome, type DownMessageEvent, type DriveTurnCapableBox, type DriveTurnTick, type FactCandidate, type FactJudge, type FactJudgeVerdict, type FeedbackEvent, type FeedbackRating, type FeedbackRefersTo, type FeedbackStore, FileDelegationStore, type FileDelegationStoreOptions, type FleetHandle, type FleetWorkspaceExecutorOptions, type GitRunner, InMemoryDelegationStore, InMemoryFeedbackStore, type InProcessExecutorDescribePlacement, type InProcessExecutorOptions, type JsonRpcMessage, type JsonRpcResponse, type KbGateResult, LOCAL_HARNESSES, type LocalHarness, type LocalHarnessResult, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, type MakeWorkerAgent, type McpServer, type McpServerOptions, type McpToolDescriptor, type McpTransport, type MemoryItem, type Question, type QuestionDecision, type QuestionLevel, type QuestionOption, type QuestionPolicy, type QuestionRecord, type QuestionUrgency, type RemoveWorktreeOptions, type ResearchOutputShape, type ResearchSource, type ResolvedMemoryEnv, type RunDetachedTurnOptions, type RunLocalHarnessOptions, type SettleDetachedCoderTurnOptions, type SettledWorker, type SiblingSandboxExecutorOptions, type StdioToolServer, type StdioToolServerOptions, type SubmitInput, type SubmitOutput, type TraceContext, type UiAuditLensFilter, type UiAuditorDelegate, type UiAuditorDelegationOutput, type WorkerSpawnContext, type WorkerWatchOptions, type WorktreeHandle, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, detachedSessionDelegate, detachedTurnEvents, detectExecutor, eventToSnapshot, formatDetachedSessionRef, harnessSupportsReasoningEffort, hashIdempotencyInput, localHarnessExecutable, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, mergeTraceEnv, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, resolveMemoryFromEnv, runDetachedTurn, runLocalHarness, settleDetachedCoderTurn, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
444
+ export { type AgentMemorySpec, type AnalystFindingEvent, type AnalystRegistry, type AuthorizeDownMessage, type AuthorizedDownMessage, type CappedDelegationTrace, type CoderDelegate, type CoderOutput, type CoderReview, type CoderReviewer, CodexExecutionDiagnosticError, type CodexExecutionEvidence, type CodexExecutionFailureDiagnostic, type CodexExecutionPolicy, type CodexTokenUsage, type ContinuationInstruction, type CoordinationEvent, type CoordinationTools, type CoordinationToolsOptions, type CreateKbGateOptions, type CreateMemoryToolServerOptions, type CreateWorktreeOptions, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_LOCAL_HARNESS, DELEGATE_DESCRIPTION, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_INPUT_SCHEMA, DELEGATE_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DELEGATION_TRACE_MAX_BYTES, DELEGATION_TRACE_MAX_SPANS, type DelegateArgs, type DelegateCodeArgs, type DelegateCodeConfig, type DelegateCodeResult, type DelegateError, type DelegateFeedbackArgs, type DelegateFeedbackHandlerOptions, type DelegateFeedbackResult, type DelegateHandlerOptions, type DelegateResearchArgs, type DelegateResearchConfig, type DelegateResearchResult, type DelegateResult, type DelegateRunCtx, type DelegateUiAuditArgs, type DelegateUiAuditConfig, type DelegateUiAuditHandlerOptions, type DelegateUiAuditResult, type DelegateUiAuditRoute, type DelegationArgs, type DelegationError, type DelegationExecutor, type DelegationFeedbackSnapshot, type DelegationHistoryArgs, type DelegationHistoryEntry, type DelegationHistoryHandlerOptions, type DelegationHistoryResult, DelegationPersistenceError, type DelegationProfile, type DelegationProgress, type DelegationRecord, type DelegationResultPayload, type DelegationResumeContext, type DelegationResumeDriver, type DelegationResumeTick, type DelegationRunContext, DelegationStateCorruptError, type DelegationStatus, type DelegationStatusArgs, type DelegationStatusHandlerOptions, type DelegationStatusResult, type DelegationStore, DelegationTaskQueue, type DelegationTaskQueueOptions, type DelegationTraceCaps, type DelegationTraceCollector, type DelegationTraceSpan, type DetachedSessionDelegateOptions, type DetachedSessionRefParts, type DetachedTurn, type DetachedTurnResumeDriverOptions, type DetachedWinnerSelection, type DetectExecutorArgs, type DiffOptions, type DiffResult, type DownMessageAuthorizationInput, type DownMessageDeliveryAttempt, type DownMessageDeliveryOutcome, type DownMessageEvent, type DriveTurnCapableBox, type DriveTurnTick, type FactCandidate, type FactJudge, type FactJudgeVerdict, type FeedbackEvent, type FeedbackRating, type FeedbackRefersTo, type FeedbackStore, FileDelegationStore, type FileDelegationStoreOptions, type FleetHandle, type FleetWorkspaceExecutorOptions, type GitRunner, InMemoryDelegationStore, InMemoryFeedbackStore, type InProcessExecutorDescribePlacement, type InProcessExecutorOptions, type JsonRpcMessage, type JsonRpcResponse, type KbGateResult, LOCAL_HARNESSES, type LocalHarness, type LocalHarnessResult, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, type MakeWorkerAgent, type McpServer, type McpServerOptions, type McpToolDescriptor, type McpTransport, type MemoryItem, type Question, type QuestionDecision, type QuestionLevel, type QuestionOption, type QuestionPolicy, type QuestionRecord, type QuestionUrgency, type RemoveWorktreeOptions, type ResearchOutputShape, type ResearchSource, type ResolvedMemoryEnv, type RunDetachedTurnOptions, type RunLocalHarnessOptions, type SettleDetachedCoderTurnOptions, type SettledWorker, type SiblingSandboxExecutorOptions, type StdioToolServer, type StdioToolServerOptions, type SubmitInput, type SubmitOutput, type TraceContext, type UiAuditLensFilter, type UiAuditorDelegate, type UiAuditorDelegationOutput, type WorkerSpawnContext, type WorkerWatchOptions, type WorktreeHandle, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, detachedSessionDelegate, detachedTurnEvents, detectExecutor, eventToSnapshot, formatDetachedSessionRef, harnessSupportsReasoningEffort, hashIdempotencyInput, localHarnessExecutable, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, mergeTraceEnv, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, resolveMemoryFromEnv, runDetachedTurn, settleDetachedCoderTurn, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
447
445
  //# sourceMappingURL=index.d.ts.map
package/dist/mcp/index.js CHANGED
@@ -1,13 +1,15 @@
1
- import { u as ValidationError } from "../errors-DEAvWQPy.js";
2
- import { l as throwAbort, n as deleteBoxSafe, s as sleep, u as throwIfAborted } from "../util-MVgdwuIS.js";
3
- import { Ct as runWorktreeHarness, Dt as removeWorktree, Et as createWorktree, Gt as harnessSupportsReasoningEffort, Ht as DEFAULT_LOCAL_HARNESS, Jt as runLocalHarness, Kt as localHarnessExecutable, S as traceContextToEnv, Tt as captureWorktreeDiff, Ut as LOCAL_HARNESSES, Yt as CodexExecutionDiagnosticError, b as mergeTraceEnv, qt as parseCodexTokenUsage, x as readTraceContextFromEnv, y as createPropagatingTraceEmitter } from "../supervisor-DpjO0Gmy.js";
4
- import { S as runCoderChecks, at as selectValidWinner } from "../runtime-5uDVVfER.js";
5
- import { A as DELEGATE_DESCRIPTION, B as DELEGATION_TRACE_MAX_SPANS, C as createDelegateUiAuditHandler, D as DELEGATE_FEEDBACK_TOOL_NAME, E as DELEGATE_FEEDBACK_INPUT_SCHEMA, G as DelegationPersistenceError, H as capDelegationTrace, J as InMemoryDelegationStore, K as DelegationStateCorruptError, L as DelegationTaskQueue, M as DELEGATE_TOOL_NAME, Mt as createSandboxForSpec, N as createDelegateHandler, O as createDelegateFeedbackHandler, P as validateDelegateArgs, Pt as runAgentRounds, R as hashIdempotencyInput, S as DELEGATE_UI_AUDIT_TOOL_NAME, T as DELEGATE_FEEDBACK_DESCRIPTION, U as composeLoopTraceEmitters, V as buildDelegationTraceSpans, W as createDelegationTraceCollector, X as eventToSnapshot, Y as InMemoryFeedbackStore, _ as DELEGATION_HISTORY_TOOL_NAME, b as DELEGATE_UI_AUDIT_DESCRIPTION, c as createInProcessTransport, d as DELEGATION_STATUS_INPUT_SCHEMA, dt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, f as DELEGATION_STATUS_TOOL_NAME, g as DELEGATION_HISTORY_INPUT_SCHEMA, h as DELEGATION_HISTORY_DESCRIPTION, j as DELEGATE_INPUT_SCHEMA, k as validateDelegateFeedbackArgs, l as createMcpServer, m as validateDelegationStatusArgs, p as createDelegationStatusHandler, pt as createCoordinationTools, q as FileDelegationStore, u as DELEGATION_STATUS_DESCRIPTION, v as createDelegationHistoryHandler, w as validateDelegateUiAuditArgs, x as DELEGATE_UI_AUDIT_INPUT_SCHEMA, y as validateDelegationHistoryArgs, z as DELEGATION_TRACE_MAX_BYTES } from "../supervise-CsTKbH9R.js";
6
- import { t as createStdioToolServer } from "../tool-server-RcWgLIsL.js";
1
+ import { i as ConfigError, u as ValidationError } from "../errors-DEAvWQPy.js";
2
+ import { l as throwAbort, n as deleteBoxSafe, s as sleep, u as throwIfAborted } from "../util-Bw6srryQ.js";
3
+ import { t as assertExecutableAgentProfile } from "../model-policy-CqziaqS1.js";
4
+ import { At as removeWorktree, Dt as runWorktreeHarness, Ft as parseCodexTokenUsage, It as CodexExecutionDiagnosticError, Mt as LOCAL_HARNESSES, Nt as harnessSupportsReasoningEffort, Ot as captureWorktreeDiff, Pt as localHarnessExecutable, Q as runAgentRounds, X as createSandboxForSpec, at as mergeTraceEnv, it as createPropagatingTraceEmitter, jt as DEFAULT_LOCAL_HARNESS, kt as createWorktree, ot as readTraceContextFromEnv, st as traceContextToEnv } from "../supervisor-CV6Jh28D.js";
5
+ import { S as runCoderChecks, et as selectValidWinner } from "../runtime-cOzDOOHr.js";
6
+ import { $ as DELEGATION_TRACE_MAX_BYTES, A as DELEGATION_HISTORY_INPUT_SCHEMA, B as DELEGATE_FEEDBACK_INPUT_SCHEMA, C as createMcpServer, D as createDelegationStatusHandler, Dt as createCoordinationTools, E as DELEGATION_STATUS_TOOL_NAME, F as DELEGATE_UI_AUDIT_INPUT_SCHEMA, G as DELEGATE_INPUT_SCHEMA, H as createDelegateFeedbackHandler, I as DELEGATE_UI_AUDIT_TOOL_NAME, J as validateDelegateArgs, K as DELEGATE_TOOL_NAME, L as createDelegateUiAuditHandler, M as createDelegationHistoryHandler, N as validateDelegationHistoryArgs, O as validateDelegationStatusArgs, P as DELEGATE_UI_AUDIT_DESCRIPTION, Q as hashIdempotencyInput, R as validateDelegateUiAuditArgs, S as createInProcessTransport, T as DELEGATION_STATUS_INPUT_SCHEMA, Tt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, U as validateDelegateFeedbackArgs, V as DELEGATE_FEEDBACK_TOOL_NAME, W as DELEGATE_DESCRIPTION, Z as DelegationTaskQueue, at as DelegationPersistenceError, ct as InMemoryDelegationStore, et as DELEGATION_TRACE_MAX_SPANS, it as createDelegationTraceCollector, j as DELEGATION_HISTORY_TOOL_NAME, k as DELEGATION_HISTORY_DESCRIPTION, lt as InMemoryFeedbackStore, nt as capDelegationTrace, ot as DelegationStateCorruptError, q as createDelegateHandler, rt as composeLoopTraceEmitters, st as FileDelegationStore, tt as buildDelegationTraceSpans, ut as eventToSnapshot, w as DELEGATION_STATUS_DESCRIPTION, z as DELEGATE_FEEDBACK_DESCRIPTION } from "../supervise-DHYX8gO2.js";
7
+ import { t as createStdioToolServer } from "../tool-server-Gs3VvfSK.js";
7
8
  import { t as createKbGate } from "../kb-gate-DpaSwXVx.js";
8
- import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-D3XfrrQ6.js";
9
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-zRphjXS4.js";
9
10
  import { t as coderTaskToPrompt } from "../coder-yhVWbdWc.js";
10
- import { a as createMemoryToolServer, c as resolveMemoryFromEnv, i as MEMORY_NAME_ENV, n as MEMORY_ITEMS_ENV, o as parseMemoryItems, r as MEMORY_LOG_ENV, s as readMemoryItemsFile, t as MEMORY_FILE_ENV } from "../memory-server-DL6cE2Ag.js";
11
+ import { a as createMemoryToolServer, c as resolveMemoryFromEnv, i as MEMORY_NAME_ENV, n as MEMORY_ITEMS_ENV, o as parseMemoryItems, r as MEMORY_LOG_ENV, s as readMemoryItemsFile, t as MEMORY_FILE_ENV } from "../memory-server-eD2baiRO.js";
12
+ import { agentProfileSchema } from "@tangle-network/agent-interface";
11
13
  import { randomUUID } from "node:crypto";
12
14
  //#region src/mcp/executor.ts
13
15
  /**
@@ -99,7 +101,7 @@ function readId(box) {
99
101
  * carries the local coding-harness CLIs (claude / codex / opencode), delegations spawn the harness
100
102
  * AS A SUBPROCESS against a git worktree on the SAME filesystem instead of provisioning a sibling
101
103
  * sandbox. Zero provisioning latency; worker diffs land in-place; multi-harness fanout = N parallel
102
- * subprocesses in N parallel worktrees (round-robin `harnesses`).
104
+ * subprocesses in N parallel worktrees. Each authored profile selects its own harness.
103
105
  *
104
106
  * This is a THIN adapter over `runWorktreeHarness` (`./worktree-harness`) — the SAME core the
105
107
  * `Scope` leaf `createWorktreeCliExecutor` uses. It only adapts the core to the `SandboxClient`
@@ -123,7 +125,6 @@ const DEFAULT_POSTCHECK_TIMEOUT_MS = 120 * 1e3;
123
125
  * @experimental
124
126
  */
125
127
  function createInProcessExecutor(options) {
126
- const harnesses = options.harnesses && options.harnesses.length > 0 ? [...options.harnesses] : [DEFAULT_LOCAL_HARNESS];
127
128
  const runPostCheck = options.runPostCheck ?? defaultRunPostCheck;
128
129
  const runCommand = async ({ command, cwd, signal }) => {
129
130
  try {
@@ -139,26 +140,30 @@ function createInProcessExecutor(options) {
139
140
  };
140
141
  }
141
142
  };
142
- let callIndex = 0;
143
143
  return {
144
144
  client: {
145
145
  async create(opts) {
146
+ const rawProfile = (opts?.backend)?.profile;
147
+ if (rawProfile === void 0) throw new ConfigError("in-process executor: backend.profile is required and must select the exact harness, provider, and model");
148
+ const profile = agentProfileSchema.parse(rawProfile);
149
+ assertExecutableAgentProfile(profile, "in-process executor");
150
+ const harness = profile.harness;
151
+ if (!LOCAL_HARNESSES.includes(harness)) throw new ConfigError(`in-process executor: AgentProfile.harness ${JSON.stringify(harness)} is not a local harness; expected ${LOCAL_HARNESSES.join(", ")}`);
152
+ if (opts?.backend?.type !== void 0 && opts.backend.type !== harness) throw new ConfigError(`in-process executor: backend.type ${JSON.stringify(opts.backend.type)} conflicts with AgentProfile.harness ${JSON.stringify(harness)}`);
153
+ const localHarness = harness;
146
154
  const runId = randomUUID();
147
- const harness = harnesses[callIndex % harnesses.length];
148
- callIndex += 1;
149
- const profile = (opts?.backend)?.profile ?? { name: `in-process-${harness}` };
150
155
  return {
151
156
  id: `in-process-${runId}`,
152
157
  __inProcess: {
153
158
  runId,
154
- harness
159
+ harness: localHarness
155
160
  },
156
161
  async *streamPrompt(message, promptOpts) {
157
162
  const taskPrompt = typeof message === "string" ? message : message.map((p) => typeof p === "object" && p && "text" in p ? String(p.text) : "").join("\n");
158
163
  const run = await runWorktreeHarness({
159
164
  repoRoot: options.repoRoot,
160
165
  profile,
161
- harness,
166
+ harness: localHarness,
162
167
  taskPrompt,
163
168
  runId,
164
169
  harnessTimeoutMs: options.harnessTimeoutMs ?? DEFAULT_HARNESS_TIMEOUT_MS,
@@ -176,9 +181,9 @@ function createInProcessExecutor(options) {
176
181
  type: "in_process.harness.started",
177
182
  data: {
178
183
  runId,
179
- harness,
184
+ harness: localHarness,
180
185
  worktreePath: run.worktree.path,
181
- command: harness
186
+ command: localHarness
182
187
  }
183
188
  };
184
189
  const h = run.result.harness;
@@ -199,7 +204,7 @@ function createInProcessExecutor(options) {
199
204
  data: {
200
205
  result: run.result,
201
206
  source: "in-process-executor",
202
- harness,
207
+ harness: localHarness,
203
208
  runId
204
209
  }
205
210
  };
@@ -222,7 +227,7 @@ function createInProcessExecutor(options) {
222
227
  },
223
228
  placement: "in-process",
224
229
  describe() {
225
- return `in-process (repoRoot=${options.repoRoot}, harnesses=[${harnesses.join(",")}]${options.testCmd ? `, testCmd="${options.testCmd}"` : ""}${options.typecheckCmd ? `, typecheckCmd="${options.typecheckCmd}"` : ""})`;
230
+ return `in-process (repoRoot=${options.repoRoot}, harness=profile-selected${options.testCmd ? `, testCmd="${options.testCmd}"` : ""}${options.typecheckCmd ? `, typecheckCmd="${options.typecheckCmd}"` : ""})`;
226
231
  }
227
232
  };
228
233
  }
@@ -289,7 +294,6 @@ async function detectExecutor(args) {
289
294
  if (!repoRoot) throw new Error("agent-runtime-mcp: AGENT_RUNTIME_IN_SANDBOX=1 requires AGENT_RUNTIME_REPO_ROOT to point at the workspace root");
290
295
  return createInProcessExecutor({
291
296
  repoRoot,
292
- harnesses: parseHarnesses(env.AGENT_RUNTIME_LOCAL_HARNESSES),
293
297
  testCmd: env.AGENT_RUNTIME_TEST_CMD?.trim() || void 0,
294
298
  typecheckCmd: env.AGENT_RUNTIME_TYPECHECK_CMD?.trim() || void 0
295
299
  });
@@ -301,13 +305,6 @@ async function detectExecutor(args) {
301
305
  excludeMachineIds: parseList(env.TANGLE_FLEET_EXCLUDE_MACHINES)
302
306
  });
303
307
  }
304
- function parseHarnesses(raw) {
305
- if (!raw) return void 0;
306
- const parts = raw.split(",").map((s) => s.trim()).filter(Boolean);
307
- if (parts.length === 0) return void 0;
308
- for (const part of parts) if (!LOCAL_HARNESSES.includes(part)) throw new Error(`agent-runtime-mcp: AGENT_RUNTIME_LOCAL_HARNESSES contains unknown harness "${part}". Expected: ${LOCAL_HARNESSES.join(", ")}.`);
309
- return parts;
310
- }
311
308
  async function defaultResolveFleet(sandboxClient, fleetId) {
312
309
  const fleets = sandboxClient.fleets;
313
310
  if (!fleets || typeof fleets.get !== "function") throw new Error("agent-runtime-mcp: the configured sandbox client does not expose `.fleets.get`; upgrade @tangle-network/sandbox to >= 0.2.1 or unset TANGLE_FLEET_ID.");
@@ -330,38 +327,32 @@ function parseList(raw) {
330
327
  }
331
328
  //#endregion
332
329
  //#region src/mcp/detached-coder.ts
333
- const DEFAULT_MAX_DIFF_LINES = 400;
334
330
  /**
335
- * The minimal default worker profile (§1.5: the system authors profiles — there is no hardcoded
336
- * coder). Model-only by construction: no skills, no tool grants, no standing prompt. Callers that
337
- * want a richer worker pass their own `AgentProfile` via `CoderRunSpecOptions.profile`. `harness` /
338
- * `model` / `systemPrompt` are layered onto whichever profile is used.
331
+ *
332
+ * Sandbox-session coder decode layer. The sandbox-session delegate (`./delegates`) and the
333
+ * cross-restart resume driver run the in-box harness over a `SandboxClient` and need to
334
+ * (a) build an `AgentRunSpec` from the caller-authored exact worker
335
+ * profile, (b) decode the harness event stream into a structured `CoderOutput`, and (c) gate it with
336
+ * the shared mechanical checks. This sandbox-session path is kept separate from the generic recursive
337
+ * path: `worktreeFanout` instead settles the raw `WorktreePatchArtifact` and gates via
338
+ * `patchDelivered`. Prefer `worktreeFanout` / `worktreeLoopRunner` for NEW local-repo coding.
339
+ *
340
+ * The decode tolerates two `result`-event shapes:
341
+ * 1. the in-process executor's raw worktree-harness result (`{ branch, patch, stats, checks }`),
342
+ * projected onto `CoderOutput`; and
343
+ * 2. an LLM-emitted JSON block (`{ branch, patch, testResult, typecheckResult, diffStats }`),
344
+ * lifted onto `data.result` or scanned out of the assistant transcript (any harness shape).
345
+ *
346
+ * @experimental
339
347
  */
340
- function minimalCoderProfile() {
341
- return { name: "coder" };
342
- }
343
- /** Build the authored `AgentProfile` for one harness on the sandbox-session path: the caller's
344
- * profile (or the minimal model-only default), with the per-run harness/model/prompt overrides. */
345
- function coderRunProfile(options) {
346
- const harness = options.harness ?? "claude-code";
347
- const name = options.name ?? `coder-${harness}`;
348
- const base = options.profile ?? minimalCoderProfile();
349
- return {
350
- ...base,
351
- name,
352
- ...options.systemPrompt ? { prompt: { systemPrompt: options.systemPrompt } } : {},
353
- model: options.model ? { default: options.model } : base.model,
354
- metadata: {
355
- ...base.metadata,
356
- backendType: harness
357
- }
358
- };
359
- }
348
+ const DEFAULT_MAX_DIFF_LINES = 400;
360
349
  /** @experimental Build the `AgentRunSpec<CoderTask>` the sandbox-session `runAgentRounds` path drives. */
361
- function coderRunSpec(options = {}) {
350
+ function coderRunSpec(options) {
351
+ const profile = agentProfileSchema.parse(options.profile);
352
+ assertExecutableAgentProfile(profile, "coderRunSpec");
362
353
  return {
363
- name: options.name ?? `coder-${options.harness ?? "claude-code"}`,
364
- profile: coderRunProfile(options),
354
+ name: options.name ?? profile.name,
355
+ profile,
365
356
  taskToPrompt: coderTaskToPrompt
366
357
  };
367
358
  }
@@ -373,18 +364,9 @@ const coderOutputAdapter = { parse: parseCoderEvents };
373
364
  *
374
365
  * @experimental
375
366
  */
376
- function multiHarnessCoderFanout(options = {}) {
377
- const harnesses = options.harnesses && options.harnesses.length > 0 ? options.harnesses : [
378
- "claude-code",
379
- "codex",
380
- "opencode/zai-coding-plan/glm-5.1"
381
- ];
382
- const models = options.models ?? [];
383
- const agentRuns = harnesses.map((harness, i) => coderRunSpec({
384
- ...options.profile ? { profile: options.profile } : {},
385
- harness,
386
- model: models[i]
387
- }));
367
+ function multiHarnessCoderFanout(options) {
368
+ if (!options.profiles || options.profiles.length === 0) throw new ConfigError("multiHarnessCoderFanout: at least one exact profile is required");
369
+ const agentRuns = options.profiles.map((profile) => coderRunSpec({ profile }));
388
370
  return {
389
371
  agentRuns,
390
372
  output: coderOutputAdapter,
@@ -717,7 +699,7 @@ async function runDetachedTurn(options) {
717
699
  * the trace sinks (OTEL exporter, delegation journal) observe detached work
718
700
  * exactly like a streamed `runAgentRounds` run. `runId` = the deterministic session
719
701
  * id; cost/token figures are structurally unavailable on the `driveTurn`
720
- * surface and emitted as 0 under the `'detached-turn'` driver tag.
702
+ * surface, so zero observed subtotals carry explicit unknown flags.
721
703
  */
722
704
  function createDetachedTurnTrace(options) {
723
705
  const emitter = options.traceEmitter;
@@ -782,7 +764,13 @@ function createDetachedTurnTrace(options) {
782
764
  iterationIndex: 0,
783
765
  agentRunName,
784
766
  costUsd: 0,
767
+ costUsdKnown: false,
785
768
  durationMs: endMs - startMs,
769
+ tokenUsage: {
770
+ input: 0,
771
+ output: 0,
772
+ tokensKnown: false
773
+ },
786
774
  ...error !== void 0 ? { error } : {}
787
775
  }
788
776
  });
@@ -793,6 +781,7 @@ function createDetachedTurnTrace(options) {
793
781
  payload: {
794
782
  ...error === void 0 ? { winnerIterationIndex: 0 } : {},
795
783
  totalCostUsd: 0,
784
+ costUsdKnown: false,
796
785
  durationMs: endMs - startMs,
797
786
  iterations: 1
798
787
  }
@@ -891,26 +880,26 @@ function createDetachedTurnResumeDriver(options) {
891
880
  * @experimental
892
881
  */
893
882
  function detachedSessionDelegate(options) {
883
+ if (!options.workerProfile) throw new ConfigError("detachedSessionDelegate: workerProfile is required");
884
+ const workerProfile = coderRunSpec({ profile: options.workerProfile }).profile;
885
+ const fanoutProfiles = options.fanoutProfiles?.map((profile) => coderRunSpec({ profile }).profile);
886
+ if (fanoutProfiles?.length === 0) throw new ConfigError("detachedSessionDelegate: fanoutProfiles must not be empty");
894
887
  const executor = resolveExecutor(options);
895
888
  const sandboxClient = executor.client;
896
- const fanoutHarnesses = options.fanoutHarnesses;
897
889
  const maxConcurrency = options.maxConcurrency ?? 4;
898
890
  const traceEmitter = options.traceEmitter;
899
891
  return async (args, ctx) => {
900
892
  const task = coderTaskFromArgs(args);
901
893
  const variants = Math.max(1, Math.trunc(args.variants ?? 1));
894
+ const selectedFanoutProfiles = variants <= 1 ? void 0 : fanoutProfiles ?? Array.from({ length: variants }, () => workerProfile);
895
+ if (selectedFanoutProfiles && selectedFanoutProfiles.length < variants) throw new ConfigError(`detachedSessionDelegate: ${variants} variants requested but only ${selectedFanoutProfiles.length} exact fanout profiles were configured`);
902
896
  const loopEmitter = composeLoopTraceEmitters(traceEmitter, ctx.traceEmitter);
903
897
  ctx.report({
904
898
  iteration: 0,
905
899
  phase: "starting"
906
900
  });
907
901
  if (variants <= 1) {
908
- const agentRunSpec = coderRunSpec({
909
- ...options.workerProfile ? { profile: options.workerProfile } : {},
910
- ...options.harness ? { harness: options.harness } : {},
911
- ...options.model ? { model: options.model } : {},
912
- ...options.systemPrompt ? { systemPrompt: options.systemPrompt } : {}
913
- });
902
+ const agentRunSpec = coderRunSpec({ profile: workerProfile });
914
903
  const output = coderOutputAdapter;
915
904
  const validator = createCoderValidator(task);
916
905
  if (ctx.detachedSessionRef !== void 0 && ctx.updateDetachedSessionRef) {
@@ -935,8 +924,6 @@ function detachedSessionDelegate(options) {
935
924
  task,
936
925
  sessionId,
937
926
  signal: ctx.signal,
938
- ...options.harness ? { harness: options.harness } : {},
939
- ...options.model ? { model: options.model } : {},
940
927
  ...options.reviewer ? { reviewer: options.reviewer } : {}
941
928
  });
942
929
  ctx.report({
@@ -972,11 +959,7 @@ function detachedSessionDelegate(options) {
972
959
  });
973
960
  return chosen;
974
961
  }
975
- const fanout = multiHarnessCoderFanout({
976
- ...options.workerProfile ? { profile: options.workerProfile } : {},
977
- ...fanoutHarnesses && fanoutHarnesses.length > 0 ? { harnesses: fanoutHarnesses.slice(0, variants) } : {},
978
- ...options.fanoutModels ? { models: options.fanoutModels.slice(0, variants) } : {}
979
- });
962
+ const fanout = multiHarnessCoderFanout({ profiles: selectedFanoutProfiles.slice(0, variants) });
980
963
  const agentRuns = fanout.agentRuns.slice(0, variants);
981
964
  const chosen = await pickCoderWinner({
982
965
  iterations: (await runAgentRounds({
@@ -1136,6 +1119,6 @@ const singleShotDriver = {
1136
1119
  }
1137
1120
  };
1138
1121
  //#endregion
1139
- export { CodexExecutionDiagnosticError, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_LOCAL_HARNESS, DELEGATE_DESCRIPTION, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_INPUT_SCHEMA, DELEGATE_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DELEGATION_TRACE_MAX_BYTES, DELEGATION_TRACE_MAX_SPANS, DelegationPersistenceError, DelegationStateCorruptError, DelegationTaskQueue, FileDelegationStore, InMemoryDelegationStore, InMemoryFeedbackStore, LOCAL_HARNESSES, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, detachedSessionDelegate, detachedTurnEvents, detectExecutor, eventToSnapshot, formatDetachedSessionRef, harnessSupportsReasoningEffort, hashIdempotencyInput, localHarnessExecutable, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, mergeTraceEnv, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, resolveMemoryFromEnv, runDetachedTurn, runLocalHarness, settleDetachedCoderTurn, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
1122
+ export { CodexExecutionDiagnosticError, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, DEFAULT_LOCAL_HARNESS, DELEGATE_DESCRIPTION, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_TOOL_NAME, DELEGATE_INPUT_SCHEMA, DELEGATE_TOOL_NAME, DELEGATE_UI_AUDIT_DESCRIPTION, DELEGATE_UI_AUDIT_INPUT_SCHEMA, DELEGATE_UI_AUDIT_TOOL_NAME, DELEGATION_HISTORY_DESCRIPTION, DELEGATION_HISTORY_INPUT_SCHEMA, DELEGATION_HISTORY_TOOL_NAME, DELEGATION_STATUS_DESCRIPTION, DELEGATION_STATUS_INPUT_SCHEMA, DELEGATION_STATUS_TOOL_NAME, DELEGATION_TRACE_MAX_BYTES, DELEGATION_TRACE_MAX_SPANS, DelegationPersistenceError, DelegationStateCorruptError, DelegationTaskQueue, FileDelegationStore, InMemoryDelegationStore, InMemoryFeedbackStore, LOCAL_HARNESSES, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, buildDelegationTraceSpans, capDelegationTrace, captureWorktreeDiff, coderTaskFromArgs, composeLoopTraceEmitters, createCoordinationTools, createDelegateFeedbackHandler, createDelegateHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createDelegationTraceCollector, createDetachedTurnResumeDriver, createFleetWorkspaceExecutor, createInProcessExecutor, createInProcessTransport, createKbGate, createMcpServer, createMemoryToolServer, createPropagatingTraceEmitter, createSiblingSandboxExecutor, createStdioToolServer, createWorktree, detachedSessionDelegate, detachedTurnEvents, detectExecutor, eventToSnapshot, formatDetachedSessionRef, harnessSupportsReasoningEffort, hashIdempotencyInput, localHarnessExecutable, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, mergeTraceEnv, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, resolveMemoryFromEnv, runDetachedTurn, settleDetachedCoderTurn, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
1140
1123
 
1141
1124
  //# sourceMappingURL=index.js.map