@tangle-network/agent-runtime 0.104.0 → 0.106.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/README.md +176 -42
  2. package/dist/activation-CRjVfOiy.js +203 -0
  3. package/dist/activation-CRjVfOiy.js.map +1 -0
  4. package/dist/activation-DyWB0K6E.d.ts +98 -0
  5. package/dist/agent.d.ts +216 -234
  6. package/dist/agent.js +615 -547
  7. package/dist/agent.js.map +1 -1
  8. package/dist/analyst-loop-DGdtVENg.js +517 -0
  9. package/dist/analyst-loop-DGdtVENg.js.map +1 -0
  10. package/dist/analyst-loop.d.ts +10 -43
  11. package/dist/analyst-loop.js +2 -11
  12. package/dist/backends-Dy8NujB4.js +713 -0
  13. package/dist/backends-Dy8NujB4.js.map +1 -0
  14. package/dist/candidate-execution/index.d.ts +4 -192
  15. package/dist/candidate-execution/index.js +5 -66
  16. package/dist/candidate-execution-DqMbv1rU.js +488 -0
  17. package/dist/candidate-execution-DqMbv1rU.js.map +1 -0
  18. package/dist/coder-yhVWbdWc.js +40 -0
  19. package/dist/coder-yhVWbdWc.js.map +1 -0
  20. package/dist/conversation-XucG_K3l.js +1265 -0
  21. package/dist/conversation-XucG_K3l.js.map +1 -0
  22. package/dist/conversation.d.ts +2 -804
  23. package/dist/conversation.js +2 -55
  24. package/dist/environment-provider-CfLUmKmf.js +1168 -0
  25. package/dist/environment-provider-CfLUmKmf.js.map +1 -0
  26. package/dist/environment-provider-IUGU3epE.d.ts +964 -0
  27. package/dist/environment-provider.d.ts +2 -78
  28. package/dist/environment-provider.js +2 -18
  29. package/dist/errors-DEAvWQPy.js +111 -0
  30. package/dist/errors-DEAvWQPy.js.map +1 -0
  31. package/dist/improvement-adapter-Cr5TBSji.d.ts +166 -0
  32. package/dist/improvement-cycle-C095kS_g.js +2624 -0
  33. package/dist/improvement-cycle-C095kS_g.js.map +1 -0
  34. package/dist/index-BGdxAwfO.d.ts +838 -0
  35. package/dist/index-C-FYUuFG.d.ts +193 -0
  36. package/dist/index-CbNM40xG.d.ts +140 -0
  37. package/dist/index-DruSKs3Z.d.ts +7224 -0
  38. package/dist/index-Efjb3nrQ.d.ts +671 -0
  39. package/dist/index.d.ts +14 -1134
  40. package/dist/index.js +2134 -1972
  41. package/dist/index.js.map +1 -1
  42. package/dist/intelligence.d.ts +776 -888
  43. package/dist/intelligence.js +1466 -1410
  44. package/dist/intelligence.js.map +1 -1
  45. package/dist/{kb-gate-CwHO0vz6.d.ts → kb-gate-C8z2juK8.d.ts} +33 -31
  46. package/dist/kb-gate-DpaSwXVx.js +80 -0
  47. package/dist/kb-gate-DpaSwXVx.js.map +1 -0
  48. package/dist/knowledge-Ku-mPP4f.js +433 -0
  49. package/dist/knowledge-Ku-mPP4f.js.map +1 -0
  50. package/dist/knowledge.d.ts +2 -150
  51. package/dist/knowledge.js +2 -40
  52. package/dist/local-harness-Dh8PJ0ot.d.ts +455 -0
  53. package/dist/loop-runner-bin-BXsFEUcf.d.ts +162 -0
  54. package/dist/loop-runner-bin-BwjQ1NfH.js +268 -0
  55. package/dist/loop-runner-bin-BwjQ1NfH.js.map +1 -0
  56. package/dist/loop-runner-bin.d.ts +2 -17
  57. package/dist/loop-runner-bin.js +2 -24
  58. package/dist/loops.d.ts +5 -4164
  59. package/dist/loops.js +8 -419
  60. package/dist/mcp/bin.d.ts +1 -1
  61. package/dist/mcp/bin.js +116 -146
  62. package/dist/mcp/bin.js.map +1 -1
  63. package/dist/mcp/index.d.ts +295 -437
  64. package/dist/mcp/index.js +1242 -1177
  65. package/dist/mcp/index.js.map +1 -1
  66. package/dist/mcp/memory-bin.d.ts +1 -1
  67. package/dist/mcp/memory-bin.js +37 -16
  68. package/dist/mcp/memory-bin.js.map +1 -1
  69. package/dist/memory-server-DL6cE2Ag.js +234 -0
  70. package/dist/memory-server-DL6cE2Ag.js.map +1 -0
  71. package/dist/model-resolution-Btd9iIKV.js +98 -0
  72. package/dist/model-resolution-Btd9iIKV.js.map +1 -0
  73. package/dist/openai-tools-B68JaOCx.d.ts +24 -0
  74. package/dist/openai-tools-CKLy1C7M.js +44 -0
  75. package/dist/openai-tools-CKLy1C7M.js.map +1 -0
  76. package/dist/otel-export-D34IQW1C.js +843 -0
  77. package/dist/otel-export-D34IQW1C.js.map +1 -0
  78. package/dist/platform.d.ts +188 -185
  79. package/dist/platform.js +185 -218
  80. package/dist/platform.js.map +1 -1
  81. package/dist/prepare-B53sPV7M.js +4292 -0
  82. package/dist/prepare-B53sPV7M.js.map +1 -0
  83. package/dist/primeintellect/index.d.ts +150 -147
  84. package/dist/primeintellect/index.js +626 -1004
  85. package/dist/primeintellect/index.js.map +1 -1
  86. package/dist/profiles.d.ts +296 -490
  87. package/dist/profiles.js +722 -749
  88. package/dist/profiles.js.map +1 -1
  89. package/dist/protected-model-port-BLPH5VVv.js +722 -0
  90. package/dist/protected-model-port-BLPH5VVv.js.map +1 -0
  91. package/dist/protected-model-port-BP6Z4eau.d.ts +283 -0
  92. package/dist/protected-redaction--F3v1oo8.js +200 -0
  93. package/dist/protected-redaction--F3v1oo8.js.map +1 -0
  94. package/dist/redact-D-u-rrcn.js +82 -0
  95. package/dist/redact-D-u-rrcn.js.map +1 -0
  96. package/dist/redact-kbIOjfjM.d.ts +452 -0
  97. package/dist/researcher-CoVqNhfI.js +433 -0
  98. package/dist/researcher-CoVqNhfI.js.map +1 -0
  99. package/dist/runtime-BG0BziaP.js +5408 -0
  100. package/dist/runtime-BG0BziaP.js.map +1 -0
  101. package/dist/sandbox-events-DeI5xX8P.js +316 -0
  102. package/dist/sandbox-events-DeI5xX8P.js.map +1 -0
  103. package/dist/spawn-journal-CwPvKUTa.js +456 -0
  104. package/dist/spawn-journal-CwPvKUTa.js.map +1 -0
  105. package/dist/structural-rollout-IXUEplky.js +1445 -0
  106. package/dist/structural-rollout-IXUEplky.js.map +1 -0
  107. package/dist/substrate-B0TYNrXn.js +27 -0
  108. package/dist/substrate-B0TYNrXn.js.map +1 -0
  109. package/dist/{substrate-Dyiqmd3o.d.ts → substrate-BcnuSHXm.d.ts} +57 -54
  110. package/dist/supervise-BiRutHS9.js +7321 -0
  111. package/dist/supervise-BiRutHS9.js.map +1 -0
  112. package/dist/supervisor-DTKhF-RV.js +3826 -0
  113. package/dist/supervisor-DTKhF-RV.js.map +1 -0
  114. package/dist/testing.d.ts +4 -3
  115. package/dist/testing.js +2478 -2637
  116. package/dist/testing.js.map +1 -1
  117. package/dist/tool-server-RcWgLIsL.js +141 -0
  118. package/dist/tool-server-RcWgLIsL.js.map +1 -0
  119. package/dist/trace-propagation-CJJC7SVB.js +57 -0
  120. package/dist/trace-propagation-CJJC7SVB.js.map +1 -0
  121. package/dist/types-BaIpb0XT.d.ts +492 -0
  122. package/dist/types-BevOjfTY.d.ts +765 -0
  123. package/dist/types-C9j4qg6l.d.ts +500 -0
  124. package/dist/types-Cja5OTGh.d.ts +190 -0
  125. package/dist/util-MVgdwuIS.js +145 -0
  126. package/dist/util-MVgdwuIS.js.map +1 -0
  127. package/dist/workspace-archive-BosQiotA.js +575 -0
  128. package/dist/workspace-archive-BosQiotA.js.map +1 -0
  129. package/package.json +43 -55
  130. package/skills/build-with-agent-runtime/SKILL.md +16 -9
  131. package/skills/loop-writer/SKILL.md +1 -1
  132. package/dist/activation-Cm-9MMX1.d.ts +0 -69
  133. package/dist/analyst-loop.js.map +0 -1
  134. package/dist/backends-BO4Jqoe2.d.ts +0 -134
  135. package/dist/candidate-execution/index.js.map +0 -1
  136. package/dist/chunk-2KGAN2HM.js +0 -1256
  137. package/dist/chunk-2KGAN2HM.js.map +0 -1
  138. package/dist/chunk-2QJSNOGK.js +0 -48
  139. package/dist/chunk-2QJSNOGK.js.map +0 -1
  140. package/dist/chunk-2UABGGUB.js +0 -474
  141. package/dist/chunk-2UABGGUB.js.map +0 -1
  142. package/dist/chunk-2VZYRB55.js +0 -834
  143. package/dist/chunk-2VZYRB55.js.map +0 -1
  144. package/dist/chunk-2X65HYMI.js +0 -3526
  145. package/dist/chunk-2X65HYMI.js.map +0 -1
  146. package/dist/chunk-3MDZX7YU.js +0 -125
  147. package/dist/chunk-3MDZX7YU.js.map +0 -1
  148. package/dist/chunk-3PPVCS75.js +0 -199
  149. package/dist/chunk-3PPVCS75.js.map +0 -1
  150. package/dist/chunk-5HNDYWUT.js +0 -6424
  151. package/dist/chunk-5HNDYWUT.js.map +0 -1
  152. package/dist/chunk-5IBQAPVB.js +0 -29
  153. package/dist/chunk-5IBQAPVB.js.map +0 -1
  154. package/dist/chunk-5QOB7H74.js +0 -387
  155. package/dist/chunk-5QOB7H74.js.map +0 -1
  156. package/dist/chunk-ATDFUJYI.js +0 -4728
  157. package/dist/chunk-ATDFUJYI.js.map +0 -1
  158. package/dist/chunk-B7K7V22Y.js +0 -699
  159. package/dist/chunk-B7K7V22Y.js.map +0 -1
  160. package/dist/chunk-DPEUKJRO.js +0 -27
  161. package/dist/chunk-DPEUKJRO.js.map +0 -1
  162. package/dist/chunk-FD2MBMOH.js +0 -494
  163. package/dist/chunk-FD2MBMOH.js.map +0 -1
  164. package/dist/chunk-FJI3EXU3.js +0 -2402
  165. package/dist/chunk-FJI3EXU3.js.map +0 -1
  166. package/dist/chunk-HAO4CXHP.js +0 -200
  167. package/dist/chunk-HAO4CXHP.js.map +0 -1
  168. package/dist/chunk-ISPWRSEC.js +0 -408
  169. package/dist/chunk-ISPWRSEC.js.map +0 -1
  170. package/dist/chunk-KRBFHMV6.js +0 -1228
  171. package/dist/chunk-KRBFHMV6.js.map +0 -1
  172. package/dist/chunk-L5DST3QC.js +0 -351
  173. package/dist/chunk-L5DST3QC.js.map +0 -1
  174. package/dist/chunk-M22PL4GH.js +0 -171
  175. package/dist/chunk-M22PL4GH.js.map +0 -1
  176. package/dist/chunk-NURIQBJQ.js +0 -72
  177. package/dist/chunk-NURIQBJQ.js.map +0 -1
  178. package/dist/chunk-PZZKQVQV.js +0 -52
  179. package/dist/chunk-PZZKQVQV.js.map +0 -1
  180. package/dist/chunk-Q2JSAVQ3.js +0 -671
  181. package/dist/chunk-Q2JSAVQ3.js.map +0 -1
  182. package/dist/chunk-SBTWKPVR.js +0 -5576
  183. package/dist/chunk-SBTWKPVR.js.map +0 -1
  184. package/dist/chunk-SGKPNBXE.js +0 -60
  185. package/dist/chunk-SGKPNBXE.js.map +0 -1
  186. package/dist/chunk-SNSMRT6H.js +0 -680
  187. package/dist/chunk-SNSMRT6H.js.map +0 -1
  188. package/dist/chunk-STJEHM5F.js +0 -1338
  189. package/dist/chunk-STJEHM5F.js.map +0 -1
  190. package/dist/chunk-UPWGXKXB.js +0 -254
  191. package/dist/chunk-UPWGXKXB.js.map +0 -1
  192. package/dist/chunk-YEJR7IXO.js +0 -68
  193. package/dist/chunk-YEJR7IXO.js.map +0 -1
  194. package/dist/chunk-ZXICDSAK.js +0 -907
  195. package/dist/chunk-ZXICDSAK.js.map +0 -1
  196. package/dist/completion-gate-Bv47cOnn.d.ts +0 -256
  197. package/dist/conversation.js.map +0 -1
  198. package/dist/coordination-CxtzMxSM.d.ts +0 -2570
  199. package/dist/environment-provider.js.map +0 -1
  200. package/dist/improve--2A0gK1-.d.ts +0 -440
  201. package/dist/improvement-adapter-HAZz-7vK.d.ts +0 -203
  202. package/dist/knowledge.js.map +0 -1
  203. package/dist/local-harness-CtK9dSny.d.ts +0 -175
  204. package/dist/loop-runner-bin-DUOGtvOl.d.ts +0 -207
  205. package/dist/loop-runner-bin.js.map +0 -1
  206. package/dist/loops.js.map +0 -1
  207. package/dist/openai-tools-fnj6SRVg.d.ts +0 -46
  208. package/dist/protected-model-port-DzkUY3HQ.d.ts +0 -271
  209. package/dist/sanitize-DEbPNtyI.d.ts +0 -328
  210. package/dist/structural-rollout-C4mabf87.d.ts +0 -446
  211. package/dist/supervise-7q9F5brx.d.ts +0 -379
  212. package/dist/types-BCoemcXU.d.ts +0 -802
  213. package/dist/types-BwoZWq-i.d.ts +0 -510
  214. package/dist/types-Cbp72qyu.d.ts +0 -491
  215. package/dist/types-CmYCMbFT.d.ts +0 -203
  216. package/dist/types-CvNwMzQt.d.ts +0 -957
  217. package/dist/worktree-fanout-WsOzt8qu.d.ts +0 -999
@@ -1,65 +1,45 @@
1
- import { a as SandboxClient, b as LoopSandboxPlacement } from '../types-BCoemcXU.js';
2
- import { F as FleetHandle, D as DelegationExecutor, a as DelegationTaskQueue, b as FeedbackStore, c as DelegateFeedbackResult, d as DelegateFeedbackArgs, U as UiAuditorDelegate, e as DelegateUiAuditArgs, f as DelegateUiAuditResult, g as DelegationHistoryResult, h as DelegationHistoryArgs, i as DelegationStatusResult, j as DelegationStatusArgs } from '../coordination-CxtzMxSM.js';
3
- export { A as AnalystRegistry, C as CappedDelegationTrace, k as CoderDelegate, l as CoderReview, m as CoderReviewer, n as CoordinationEvent, o as CoordinationTools, p as CoordinationToolsOptions, q as DELEGATE_DESCRIPTION, r as DELEGATE_INPUT_SCHEMA, s as DELEGATE_TOOL_NAME, t as DELEGATION_TRACE_MAX_BYTES, u as DELEGATION_TRACE_MAX_SPANS, v as DelegateArgs, w as DelegateCodeArgs, x as DelegateCodeConfig, y as DelegateCodeResult, z as DelegateHandlerOptions, B as DelegateResearchArgs, G as DelegateResearchConfig, H as DelegateResearchResult, I as DelegateResult, J as DelegateRunCtx, K as DelegateUiAuditConfig, L as DelegateUiAuditRoute, N as DelegationError, O as DelegationFeedbackSnapshot, P as DelegationHistoryEntry, Q as DelegationPersistenceError, R as DelegationProfile, S as DelegationProgress, T as DelegationRecord, V as DelegationResultPayload, X as DelegationResumeContext, Y as DelegationResumeDriver, Z as DelegationResumeTick, _ as DelegationRunContext, $ as DelegationStateCorruptError, a0 as DelegationStatus, a1 as DelegationStore, a2 as DelegationTaskQueueOptions, a3 as DelegationTraceCaps, a4 as DelegationTraceCollector, a5 as DelegationTraceSpan, a6 as DetachedSessionDelegateOptions, a7 as DetachedSessionRefParts, a8 as DetachedTurn, a9 as DetachedTurnResumeDriverOptions, aa as DetachedWinnerSelection, ab as DriveTurnCapableBox, ac as DriveTurnTick, ad as FeedbackEvent, ae as FeedbackRating, af as FeedbackRefersTo, ag as FileDelegationStore, ah as FileDelegationStoreOptions, ai as FleetWorkspaceExecutorOptions, aj as InMemoryDelegationStore, ak as InMemoryFeedbackStore, al as JsonRpcMessage, am as JsonRpcResponse, M as MakeWorkerAgent, an as McpServer, ao as McpServerOptions, ap as McpToolDescriptor, aq as McpTransport, ar as Question, as as QuestionDecision, at as QuestionPolicy, au as QuestionRecord, av as ResearchOutputShape, aw as ResearchSource, ax as RunDetachedTurnOptions, ay as SettleDetachedCoderTurnOptions, az as SettledWorker, aA as SiblingSandboxExecutorOptions, aB as SubmitInput, aC as SubmitOutput, aD as TraceContext, aE as UiAuditorDelegationOutput, aF as buildDelegationTraceSpans, aG as capDelegationTrace, aH as coderTaskFromArgs, aI as composeLoopTraceEmitters, aJ as createCoordinationTools, aK as createDelegateHandler, aL as createDelegationTraceCollector, aM as createDetachedTurnResumeDriver, aN as createFleetWorkspaceExecutor, aO as createInProcessTransport, aP as createMcpServer, aQ as createPropagatingTraceEmitter, aR as createSiblingSandboxExecutor, aS as detachedSessionDelegate, aT as detachedTurnEvents, aU as eventToSnapshot, aV as formatDetachedSessionRef, aW as hashIdempotencyInput, aX as parseDetachedSessionRef, aY as readTraceContextFromEnv, aZ as runDetachedTurn, a_ as settleDetachedCoderTurn, a$ as traceContextToEnv, b0 as validateDelegateArgs } from '../coordination-CxtzMxSM.js';
4
- import { L as LocalHarness, r as runLocalHarness } from '../local-harness-CtK9dSny.js';
5
- export { a as CodexExecutionEvidence, c as CodexExecutionPolicy, C as CodexTokenUsage, b as LocalHarnessResult, R as RunLocalHarnessOptions, p as parseCodexTokenUsage } from '../local-harness-CtK9dSny.js';
6
- import { G as GitRunner } from '../completion-gate-Bv47cOnn.js';
7
- export { C as CreateWorktreeOptions, b as DiffOptions, c as DiffResult, R as RemoveWorktreeOptions, d as WorktreeHandle, e as captureWorktreeDiff, f as createWorktree, r as removeWorktree } from '../completion-gate-Bv47cOnn.js';
8
- export { C as CreateKbGateOptions, F as FactCandidate, a as FactJudge, b as FactJudgeVerdict, K as KbGateResult, c as createKbGate } from '../kb-gate-CwHO0vz6.js';
9
- import { AgentProfileMcpServer } from '@tangle-network/agent-interface';
10
- export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from '../openai-tools-fnj6SRVg.js';
11
- import { AnalystFinding } from '@tangle-network/agent-eval';
12
- import { a as UiLens } from '../substrate-Dyiqmd3o.js';
13
- import '@tangle-network/sandbox';
14
- import '../types-BwoZWq-i.js';
15
- import '../types-CvNwMzQt.js';
16
- import '../sanitize-DEbPNtyI.js';
17
- import '../environment-provider.js';
18
- import '@tangle-network/agent-interface/environment-provider';
19
- import 'node:child_process';
20
- import '@tangle-network/agent-profile-materialize';
21
-
1
+ import { E as SandboxClient, h as LoopSandboxPlacement } from "../types-BevOjfTY.js";
2
+ import { $c as DetachedSessionRefParts, $l as traceContextToEnv, Ac as McpToolDescriptor, Al as DelegateUiAuditConfig, As as createCoordinationTools, Au as FileDelegationStore, Bc as DetachedSessionDelegateOptions, Bl as DelegationResultPayload, Bs as DelegateResult, Cc as captureWorktreeDiff, Cl as DelegateCodeResult, Cs as QuestionLevel, Cu as buildDelegationTraceSpans, Dl as DelegateResearchConfig, Ds as QuestionUrgency, Du as DelegationPersistenceError, El as DelegateResearchArgs, Es as QuestionRecord, Eu as createDelegationTraceCollector, Fc as eventToSnapshot, Fl as DelegationHistoryArgs, Fs as DELEGATE_DESCRIPTION, Gc as detachedSessionDelegate, Gl as FeedbackRefersTo, Hc as SettleDetachedCoderTurnOptions, Hl as DelegationStatusArgs, Hs as validateDelegateArgs, Hu as CoderOutput, Ic as CoderDelegate, Il as DelegationHistoryEntry, Is as DELEGATE_INPUT_SCHEMA, Jc as FleetHandle, Jl as UiAuditLensFilter, Kc as settleDetachedCoderTurn, Kl as ResearchOutputShape, Lc as CoderReview, Ll as DelegationHistoryResult, Ls as DELEGATE_TOOL_NAME, Mc as FeedbackEvent, Ml as DelegateUiAuditRoute, Ms as McpServerOptions, Mu as InMemoryDelegationStore, Nc as FeedbackStore, Nl as DelegationError, Ns as createInProcessTransport, Oc as JsonRpcMessage, Ol as DelegateResearchResult, Os as SettledWorker, Ou as DelegationStateCorruptError, Pc as InMemoryFeedbackStore, Pl as DelegationFeedbackSnapshot, Ps as createMcpServer, Qc as createSiblingSandboxExecutor, Ql as readTraceContextFromEnv, Rc as CoderReviewer, Rl as DelegationProfile, Rs as DelegateArgs, Sc as WorktreeHandle, Sl as DelegateCodeConfig, Ss as QuestionDecision, Su as DelegationTraceSpan, Tc as removeWorktree, Tl as DelegateFeedbackResult, Ts as QuestionPolicy, Tu as composeLoopTraceEmitters, Uc as UiAuditorDelegate, Ul as DelegationStatusResult, Vc as DetachedWinnerSelection, Vl as DelegationStatus, Vs as createDelegateHandler, Wc as coderTaskFromArgs, Wl as FeedbackRating, Xc as SiblingSandboxExecutorOptions, Xl as TraceContext, Yc as FleetWorkspaceExecutorOptions, Yl as UiAuditorDelegationOutput, Zc as createFleetWorkspaceExecutor, Zl as createPropagatingTraceEmitter, _c as CreateWorktreeOptions, _l as DelegationTaskQueueOptions, _s as CoordinationToolsOptions, _u as CappedDelegationTrace, al as createDetachedTurnResumeDriver, bc as GitRunner, bl as hashIdempotencyInput, bs as MakeWorkerAgent, bu as DelegationTraceCaps, cl as parseDetachedSessionRef, dl as DelegationRecord, el as DetachedTurn, fl as DelegationResumeContext, gl as DelegationTaskQueue, gs as CoordinationTools, hl as DelegationRunContext, hs as CoordinationEvent, il as RunDetachedTurnOptions, jc as McpTransport, jl as DelegateUiAuditResult, js as McpServer, ju as FileDelegationStoreOptions, kc as JsonRpcResponse, kl as DelegateUiAuditArgs, ks as WorkerWatchOptions, ku as DelegationStore, ll as runDetachedTurn, ml as DelegationResumeTick, ms as AnalystRegistry, nl as DriveTurnCapableBox, ol as detachedTurnEvents, pl as DelegationResumeDriver, ps as AnalystFindingEvent, qc as DelegationExecutor, ql as ResearchSource, rl as DriveTurnTick, sl as formatDetachedSessionRef, tl as DetachedTurnResumeDriverOptions, ul as DelegationArgs, vc as DiffOptions, vl as SubmitInput, vs as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, vu as DELEGATION_TRACE_MAX_BYTES, wc as createWorktree, wl as DelegateFeedbackArgs, ws as QuestionOption, wu as capDelegationTrace, xc as RemoveWorktreeOptions, xl as DelegateCodeArgs, xs as Question, xu as DelegationTraceCollector, yc as DiffResult, yl as SubmitOutput, ys as DownMessageEvent, yu as DELEGATION_TRACE_MAX_SPANS, zc as DelegateRunCtx, zl as DelegationProgress, zs as DelegateHandlerOptions } from "../index-DruSKs3Z.js";
3
+ import { o as UiLens } from "../substrate-BcnuSHXm.js";
4
+ import { a as LocalHarnessResult, c as runLocalHarness, i as LocalHarness, n as CodexExecutionPolicy, o as RunLocalHarnessOptions, r as CodexTokenUsage, s as parseCodexTokenUsage, t as CodexExecutionEvidence } from "../local-harness-Dh8PJ0ot.js";
5
+ import { a as KbGateResult, i as FactJudgeVerdict, n as FactCandidate, o as createKbGate, r as FactJudge, t as CreateKbGateOptions } from "../kb-gate-C8z2juK8.js";
6
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-B68JaOCx.js";
7
+ import { AnalystFinding } from "@tangle-network/agent-eval";
8
+ import { AgentProfileMcpServer } from "@tangle-network/agent-interface";
9
+ //#region src/mcp/codex-diagnostics.d.ts
22
10
  /** Bounded, credential-redacted process context attached when reproducible Codex output fails
23
11
  * validation. The process still fails closed; this only preserves enough evidence to diagnose it. */
24
12
  interface CodexExecutionFailureDiagnostic {
25
- exitCode: number | null;
26
- killedBySignal: NodeJS.Signals | null;
27
- timedOut: boolean;
28
- aborted?: boolean;
29
- durationMs: number;
30
- stdout: string;
31
- stderr: string;
32
- stdoutTruncated: boolean;
33
- stderrTruncated: boolean;
13
+ exitCode: number | null;
14
+ killedBySignal: NodeJS.Signals | null;
15
+ timedOut: boolean;
16
+ aborted?: boolean;
17
+ durationMs: number;
18
+ stdout: string;
19
+ stderr: string;
20
+ stdoutTruncated: boolean;
21
+ stderrTruncated: boolean;
34
22
  }
35
23
  /** Thrown when reproducible Codex exits without one valid terminal usage event. */
36
24
  declare class CodexExecutionDiagnosticError extends Error {
37
- readonly reason: string;
38
- readonly diagnostic: CodexExecutionFailureDiagnostic;
39
- readonly code = "CODEX_EXECUTION_DIAGNOSTIC";
40
- constructor(reason: string, diagnostic: CodexExecutionFailureDiagnostic, cause?: unknown);
25
+ readonly reason: string;
26
+ readonly diagnostic: CodexExecutionFailureDiagnostic;
27
+ readonly code = "CODEX_EXECUTION_DIAGNOSTIC";
28
+ constructor(reason: string, diagnostic: CodexExecutionFailureDiagnostic, cause?: unknown);
41
29
  }
42
-
43
- /**
44
- *
45
- * Helpers extracted from `bin.ts` so the env-detection + executor-selection
46
- * logic is unit-testable without spawning a subprocess. The bin imports from
47
- * here; tests import from here directly.
48
- *
49
- * @experimental
50
- */
51
-
30
+ //#endregion
31
+ //#region src/mcp/bin-helpers.d.ts
52
32
  /** @experimental */
53
33
  interface DetectExecutorArgs {
54
- sandboxClient: SandboxClient;
55
- /** Raw env (defaults to `process.env`). Pass an explicit map for tests. */
56
- env?: Record<string, string | undefined>;
57
- /**
58
- * Override how a fleet handle is resolved from the client + fleet id. The
59
- * default reads `client.fleets.get(fleetId)` and validates the returned
60
- * shape against the structural `FleetHandle` contract.
61
- */
62
- resolveFleet?: (client: SandboxClient, fleetId: string) => Promise<FleetHandle>;
34
+ sandboxClient: SandboxClient;
35
+ /** Raw env (defaults to `process.env`). Pass an explicit map for tests. */
36
+ env?: Record<string, string | undefined>;
37
+ /**
38
+ * Override how a fleet handle is resolved from the client + fleet id. The
39
+ * default reads `client.fleets.get(fleetId)` and validates the returned
40
+ * shape against the structural `FleetHandle` contract.
41
+ */
42
+ resolveFleet?: (client: SandboxClient, fleetId: string) => Promise<FleetHandle>;
63
43
  }
64
44
  /**
65
45
  * Pick the right executor for an MCP server invocation based on env vars.
@@ -76,39 +56,40 @@ interface DetectExecutorArgs {
76
56
  * @experimental
77
57
  */
78
58
  declare function detectExecutor(args: DetectExecutorArgs): Promise<DelegationExecutor>;
79
-
59
+ //#endregion
60
+ //#region src/mcp/in-process-executor.d.ts
80
61
  /** @experimental */
81
62
  interface InProcessExecutorOptions {
82
- /** Absolute path to the git repo (the workspace). Worktrees go under `<repoRoot>/.agent-worktrees/`. */
83
- repoRoot: string;
84
- /** Harnesses to round-robin across `create()` calls. One entry = no fanout. Default `['claude']`. */
85
- harnesses?: ReadonlyArray<LocalHarness>;
86
- /** Optional per-delegation test command run in the worktree after the harness exits. */
87
- testCmd?: string;
88
- /** Optional per-delegation typecheck command. Same shape as `testCmd`. */
89
- typecheckCmd?: string;
90
- /** Wall-clock cap per harness subprocess (ms). Default 5min. */
91
- harnessTimeoutMs?: number;
92
- /** Wall-clock cap per test/typecheck subprocess (ms). Default 2min. */
93
- postCheckTimeoutMs?: number;
94
- /** Test seam — override the git runner used by the worktree helpers. */
95
- runGit?: GitRunner;
96
- /** Test seam — override the harness runner (defaults to the real CLI via `runLocalHarness`). */
97
- runHarness?: typeof runLocalHarness;
98
- /** Test seam — override the post-check runner (defaults to a `sh -c` spawn). A throw is folded
99
- * into a non-fatal `{exitCode:-1}` so a broken check command fails the signal, not the run. */
100
- runPostCheck?: (cmd: string, cwd: string, signal?: AbortSignal) => Promise<{
101
- exitCode: number;
102
- stdout: string;
103
- stderr: string;
104
- }>;
63
+ /** Absolute path to the git repo (the workspace). Worktrees go under `<repoRoot>/.agent-worktrees/`. */
64
+ repoRoot: string;
65
+ /** Harnesses to round-robin across `create()` calls. One entry = no fanout. Default `['claude']`. */
66
+ harnesses?: ReadonlyArray<LocalHarness>;
67
+ /** Optional per-delegation test command run in the worktree after the harness exits. */
68
+ testCmd?: string;
69
+ /** Optional per-delegation typecheck command. Same shape as `testCmd`. */
70
+ typecheckCmd?: string;
71
+ /** Wall-clock cap per harness subprocess (ms). Default 5min. */
72
+ harnessTimeoutMs?: number;
73
+ /** Wall-clock cap per test/typecheck subprocess (ms). Default 2min. */
74
+ postCheckTimeoutMs?: number;
75
+ /** Test seam — override the git runner used by the worktree helpers. */
76
+ runGit?: GitRunner;
77
+ /** Test seam — override the harness runner (defaults to the real CLI via `runLocalHarness`). */
78
+ runHarness?: typeof runLocalHarness;
79
+ /** Test seam — override the post-check runner (defaults to a `sh -c` spawn). A throw is folded
80
+ * into a non-fatal `{exitCode:-1}` so a broken check command fails the signal, not the run. */
81
+ runPostCheck?: (cmd: string, cwd: string, signal?: AbortSignal) => Promise<{
82
+ exitCode: number;
83
+ stdout: string;
84
+ stderr: string;
85
+ }>;
105
86
  }
106
87
  /** @experimental */
107
88
  interface InProcessExecutorDescribePlacement extends LoopSandboxPlacement {
108
- /** Worktree path in the parent sandbox's filesystem (set so traces correlate to on-disk artifacts). */
109
- worktreePath?: string;
110
- /** Which harness handled this delegation. */
111
- harness?: LocalHarness;
89
+ /** Worktree path in the parent sandbox's filesystem (set so traces correlate to on-disk artifacts). */
90
+ worktreePath?: string;
91
+ /** Which harness handled this delegation. */
92
+ harness?: LocalHarness;
112
93
  }
113
94
  /**
114
95
  * Build an in-process executor. Returns a {@link DelegationExecutor} whose `client.create()`
@@ -120,109 +101,42 @@ interface InProcessExecutorDescribePlacement extends LoopSandboxPlacement {
120
101
  * @experimental
121
102
  */
122
103
  declare function createInProcessExecutor(options: InProcessExecutorOptions): DelegationExecutor;
123
-
124
- /**
125
- * `createStdioToolServer` — the generic newline-delimited JSON-RPC 2.0 MCP
126
- * server core: `initialize` / `notifications/initialized` / `tools/list` /
127
- * `tools/call` over a stdio-shaped transport, protocol 2024-11-05.
128
- *
129
- * Extracted from `createMcpServer` (server.ts) so every in-repo MCP server —
130
- * the delegation server, the memory server — serves the ONE wire protocol the
131
- * same-host client (`connectStdioMcp`, runtime/stdio-mcp-client.ts) speaks.
132
- * A second hand-rolled serve loop could drift from what the client expects;
133
- * this core makes that impossible by construction.
134
- *
135
- * @experimental
136
- */
137
- /** @experimental */
138
- interface McpToolDescriptor {
139
- name: string;
140
- description: string;
141
- inputSchema: Record<string, unknown>;
142
- handler: (raw: unknown) => Promise<unknown>;
143
- }
144
- /** @experimental */
145
- interface McpTransport {
146
- input: NodeJS.ReadableStream;
147
- output: NodeJS.WritableStream;
148
- }
149
- /** @experimental */
150
- interface JsonRpcMessage {
151
- jsonrpc: '2.0';
152
- id?: number | string | null;
153
- method: string;
154
- params?: unknown;
155
- }
156
- /** @experimental */
157
- interface JsonRpcResponse {
158
- jsonrpc: '2.0';
159
- id: number | string | null;
160
- result?: unknown;
161
- error?: {
162
- code: number;
163
- message: string;
164
- data?: unknown;
165
- };
166
- }
104
+ //#endregion
105
+ //#region src/mcp/tool-server.d.ts
167
106
  /** @experimental */
168
107
  interface StdioToolServerOptions {
169
- /** Server display name surfaced via `initialize`. */
170
- serverName: string;
171
- /** Server version surfaced via `initialize`. */
172
- serverVersion: string;
173
- /** The tools to serve. Duplicate names throw — a silent shadow would hide a tool. */
174
- tools: readonly McpToolDescriptor[];
108
+ /** Server display name surfaced via `initialize`. */
109
+ serverName: string;
110
+ /** Server version surfaced via `initialize`. */
111
+ serverVersion: string;
112
+ /** The tools to serve. Duplicate names throw — a silent shadow would hide a tool. */
113
+ tools: readonly McpToolDescriptor[];
175
114
  }
176
115
  /** @experimental */
177
116
  interface StdioToolServer {
178
- /** Tools currently registered, keyed by name. */
179
- readonly tools: ReadonlyMap<string, McpToolDescriptor>;
180
- /** Handle a single parsed JSON-RPC message. Returns the response object (or `null` for notifications). */
181
- handle(message: JsonRpcMessage): Promise<JsonRpcResponse | null>;
182
- /** Drive the server on a stdio-shaped transport until `stop()` is called. */
183
- serve(transport?: McpTransport): Promise<void>;
184
- /** Stop a `serve` call. Subsequent requests are rejected. */
185
- stop(): void;
117
+ /** Tools currently registered, keyed by name. */
118
+ readonly tools: ReadonlyMap<string, McpToolDescriptor>;
119
+ /** Handle a single parsed JSON-RPC message. Returns the response object (or `null` for notifications). */
120
+ handle(message: JsonRpcMessage): Promise<JsonRpcResponse | null>;
121
+ /** Drive the server on a stdio-shaped transport until `stop()` is called. */
122
+ serve(transport?: McpTransport): Promise<void>;
123
+ /** Stop a `serve` call. Subsequent requests are rejected. */
124
+ stop(): void;
186
125
  }
187
126
  /** Build the generic stdio JSON-RPC tool server. */
188
127
  declare function createStdioToolServer(options: StdioToolServerOptions): StdioToolServer;
189
-
190
- /**
191
- * Memory MCP server — the LIVE serving half of the `memory` profile surface
192
- * (Phase 5). A curated memory (lessons distilled from prior runs) is only
193
- * real if the DRIVEN agent can query it mid-task; this module serves a flat
194
- * store of `MemoryItem` rows as `memory_search` / `memory_get` tools over the
195
- * ONE in-repo stdio JSON-RPC core (`createStdioToolServer`), so the exact
196
- * wire protocol the same-host client (`connectStdioMcp` /
197
- * `materializeLocalMcp`, runtime/stdio-mcp-client.ts) speaks is guaranteed by
198
- * construction — serve and consume cannot drift.
199
- *
200
- * Retrieval is DETERMINISTIC lexical overlap (no vectors, no LLM): a lift
201
- * measured with this memory mounted is attributable to the lessons
202
- * themselves, never to retrieval-model noise — the same discipline as
203
- * agent-eval's `memoryCurationProposer` (deterministic curation). Every
204
- * `memory_search` can append one JSONL row to a retrieval log (`logPath`) —
205
- * the per-query record an off-policy retrieval estimator (agent-knowledge's
206
- * `RetrievalHoldout`) consumes. agent-knowledge is NOT a dependency of this
207
- * repo, so the log file is the flagged cross-package seam, not an import.
208
- *
209
- * Fail-loud discipline (mirrors `materializeLocalMcp`): an EMPTY memory is
210
- * never served — a profile without memory simply omits the artifact, and
211
- * silently serving zero rows would fake the with/without ablation.
212
- *
213
- * @experimental
214
- */
215
-
128
+ //#endregion
129
+ //#region src/mcp/memory-server.d.ts
216
130
  /** One row of agent memory: a crisp lesson/fact with provenance. */
217
131
  interface MemoryItem {
218
- /** Stable id (content-hash by convention; see `memoryArtifactFromLessons`). */
219
- id: string;
220
- /** The lesson itself — one imperative or observation the agent should recall. */
221
- text: string;
222
- /** Optional retrieval tags, matched by `memory_search` alongside the text. */
223
- tags?: string[];
224
- /** Provenance: the finding / trace / curation pass this row came from. */
225
- source?: string;
132
+ /** Stable id (content-hash by convention; see `memoryArtifactFromLessons`). */
133
+ id: string;
134
+ /** The lesson itself — one imperative or observation the agent should recall. */
135
+ text: string;
136
+ /** Optional retrieval tags, matched by `memory_search` alongside the text. */
137
+ tags?: string[];
138
+ /** Provenance: the finding / trace / curation pass this row came from. */
139
+ source?: string;
226
140
  }
227
141
  /**
228
142
  * The `memory` artifact payload — HOW a profile's memory is stored and served:
@@ -239,15 +153,15 @@ interface MemoryItem {
239
153
  * — the retrieval log a holdout estimator reads (see module doc).
240
154
  */
241
155
  interface AgentMemorySpec {
242
- store: 'file' | 'mcp';
243
- /** `store:'file'` — host path to the durable row store (JSON array or JSONL). */
244
- path?: string;
245
- /** Inline seed rows, served alongside (and winning over) `path` rows. */
246
- items?: MemoryItem[];
247
- /** `store:'mcp'` — the external server that already serves memory tools. */
248
- server?: AgentProfileMcpServer;
249
- /** JSONL retrieval log: one row per `memory_search` (ts, query, k, returned). */
250
- logPath?: string;
156
+ store: 'file' | 'mcp';
157
+ /** `store:'file'` — host path to the durable row store (JSON array or JSONL). */
158
+ path?: string;
159
+ /** Inline seed rows, served alongside (and winning over) `path` rows. */
160
+ items?: MemoryItem[];
161
+ /** `store:'mcp'` — the external server that already serves memory tools. */
162
+ server?: AgentProfileMcpServer;
163
+ /** JSONL retrieval log: one row per `memory_search` (ts, query, k, returned). */
164
+ logPath?: string;
251
165
  }
252
166
  /** Env var naming the durable row store file the memory bin loads (the
253
167
  * `memoryMcpServer` ↔ memory-bin contract). */
@@ -259,16 +173,16 @@ declare const MEMORY_LOG_ENV = "AGENT_MEMORY_LOG";
259
173
  /** Env var overriding the served display name (default 'agent-memory'). */
260
174
  declare const MEMORY_NAME_ENV = "AGENT_MEMORY_NAME";
261
175
  interface CreateMemoryToolServerOptions {
262
- /** The rows to serve. MUST be non-empty (an empty memory is never served). */
263
- items: readonly MemoryItem[];
264
- /** Server display name surfaced via `initialize`. Default 'agent-memory'. */
265
- serverName?: string;
266
- /** Server version surfaced via `initialize`. Default '0'. */
267
- serverVersion?: string;
268
- /** Default result count for `memory_search`. Default 5. */
269
- defaultK?: number;
270
- /** Append one JSONL row per `memory_search` (the retrieval-holdout seam). */
271
- logPath?: string;
176
+ /** The rows to serve. MUST be non-empty (an empty memory is never served). */
177
+ items: readonly MemoryItem[];
178
+ /** Server display name surfaced via `initialize`. Default 'agent-memory'. */
179
+ serverName?: string;
180
+ /** Server version surfaced via `initialize`. Default '0'. */
181
+ serverVersion?: string;
182
+ /** Default result count for `memory_search`. Default 5. */
183
+ defaultK?: number;
184
+ /** Append one JSONL row per `memory_search` (the retrieval-holdout seam). */
185
+ logPath?: string;
272
186
  }
273
187
  /**
274
188
  * Build the memory MCP server: `memory_search` (lexical top-k over the rows)
@@ -281,9 +195,9 @@ declare function parseMemoryItems(value: unknown, source: string): MemoryItem[];
281
195
  declare function readMemoryItemsFile(path: string): MemoryItem[];
282
196
  /** What the memory bin resolved from its environment. */
283
197
  interface ResolvedMemoryEnv {
284
- items: MemoryItem[];
285
- serverName?: string;
286
- logPath?: string;
198
+ items: MemoryItem[];
199
+ serverName?: string;
200
+ logPath?: string;
287
201
  }
288
202
  /**
289
203
  * Resolve the bin's memory from `AGENT_MEMORY_FILE` (durable store) and/or
@@ -291,35 +205,18 @@ interface ResolvedMemoryEnv {
291
205
  * a boot FAILURE, matching the fail-closed materialization discipline.
292
206
  */
293
207
  declare function resolveMemoryFromEnv(env: Record<string, string | undefined>): ResolvedMemoryEnv;
294
-
295
- /**
296
- *
297
- * The trace-analyst KIND directory — the operator's lenses, as composable DATA.
298
- *
299
- * An analyst is not one question. A kind is ONE lens (completeness, correctness, policy, efficiency,
300
- * tool-use, …); each emits `AnalystFinding`s tagged by its `area`. The driver `list_analysts` to see
301
- * the menu, `run_analyst(kind, worker)` to apply a lens, and `define_analyst` to author a new one —
302
- * so at test time you compose the exact lenses a domain needs (maximum specificity), not one generic
303
- * reviewer. The kinds are data, the runner is generic, and the finding shape + firewall are reused
304
- * from agent-eval / the keystone — never re-derived.
305
- *
306
- * A kind here is a lightweight lens (`Check`); it is a deliberate SUBSET of agent-eval's full
307
- * `TraceAnalystKindSpec`, so a kind that needs the heavy agentic actor (sub-agent recursion, tools,
308
- * goldens) upgrades to `createTraceAnalystKind` without changing this directory's surface.
309
- *
310
- * @experimental
311
- */
312
-
208
+ //#endregion
209
+ //#region src/mcp/tools/checks.d.ts
313
210
  /** One lens — a composable analyst kind. Identity fields mirror `TraceAnalystKindSpec` so a kind is
314
211
  * upgradeable to the full agentic factory; `lookFor` is the lens question the actor applies. */
315
212
  interface Check {
316
- readonly id: string;
317
- readonly description: string;
318
- /** Coarse classification stamped on every finding this kind emits (the renderer groups by it). */
319
- readonly area: string;
320
- readonly version: string;
321
- /** The lens — what this analyst looks for in the trace. */
322
- readonly lookFor: string;
213
+ readonly id: string;
214
+ readonly description: string;
215
+ /** Coarse classification stamped on every finding this kind emits (the renderer groups by it). */
216
+ readonly area: string;
217
+ readonly version: string;
218
+ /** The lens — what this analyst looks for in the trace. */
219
+ readonly lookFor: string;
323
220
  }
324
221
  /** The built-in lens directory. Domain-blind (about any agent trace); compose at test time. */
325
222
  declare const defaultChecks: Record<string, Check>;
@@ -330,11 +227,11 @@ declare function liftFindings(kind: Check, rows: unknown[], producedAt: string):
330
227
  * the trace shape: a `{ messages }` conversation, a bare message array, else stringified. */
331
228
  declare function renderTrace(trace: unknown): string;
332
229
  interface CheckRunnerOptions {
333
- routerBaseUrl: string;
334
- routerKey: string;
335
- model: string;
336
- /** Test/override seam — replace the LLM call. Default: a router chat completion. */
337
- chat?: (system: string, user: string) => Promise<string>;
230
+ routerBaseUrl: string;
231
+ routerKey: string;
232
+ model: string;
233
+ /** Test/override seam — replace the LLM call. Default: a router chat completion. */
234
+ chat?: (system: string, user: string) => Promise<string>;
338
235
  }
339
236
  /** Run ONE lens over a trace → findings. Generic over any kind: prompt = the lens + the agent-eval
340
237
  * finding schema; the model's JSON array is parsed (`parseRawFinding`), lifted, and firewalled. */
@@ -345,288 +242,249 @@ declare function runCheck(kind: Check, trace: unknown, opts: CheckRunnerOptions,
345
242
  * passed in because replay-safe paths must not read `Date.now`.
346
243
  */
347
244
  declare function makeCheckRunner(kinds: Record<string, Check>, opts: CheckRunnerOptions): (kindId: string, trace: unknown, producedAt: string) => Promise<AnalystFinding[] | {
348
- error: string;
245
+ error: string;
349
246
  }>;
350
-
351
- /**
352
- *
353
- * `delegate_feedback` MCP tool — synchronous record of agent / user /
354
- * downstream-judge feedback on a delegation, artifact, or outcome.
355
- *
356
- * The store is append-only. Every rating is its own event; no dedupe.
357
- * When `refersTo.kind === 'delegation'`, the snapshot is also attached
358
- * to the matching queue record so `delegation_history` surfaces it
359
- * inline without a join.
360
- *
361
- * @experimental
362
- */
363
-
247
+ //#endregion
248
+ //#region src/mcp/tools/delegate-feedback.d.ts
364
249
  /** MCP tool name for the `delegate_feedback` feedback-recording tool. @experimental */
365
250
  declare const DELEGATE_FEEDBACK_TOOL_NAME = "delegate_feedback";
366
251
  /** Human-readable description of the `delegate_feedback` MCP tool, injected into the tool manifest. @experimental */
367
252
  declare const DELEGATE_FEEDBACK_DESCRIPTION: string;
368
253
  /** JSON Schema for `delegate_feedback` tool arguments (`refersTo`, `rating`, `by`, optional fields). @experimental */
369
254
  declare const DELEGATE_FEEDBACK_INPUT_SCHEMA: {
370
- readonly type: "object";
371
- readonly properties: {
372
- readonly refersTo: {
373
- readonly type: "object";
374
- readonly properties: {
375
- readonly kind: {
376
- readonly type: "string";
377
- readonly enum: readonly ["delegation", "artifact", "outcome"];
378
- };
379
- readonly ref: {
380
- readonly type: "string";
381
- };
382
- };
383
- readonly required: readonly ["kind", "ref"];
384
- readonly additionalProperties: false;
255
+ readonly type: "object";
256
+ readonly properties: {
257
+ readonly refersTo: {
258
+ readonly type: "object";
259
+ readonly properties: {
260
+ readonly kind: {
261
+ readonly type: "string";
262
+ readonly enum: readonly ["delegation", "artifact", "outcome"];
385
263
  };
386
- readonly rating: {
387
- readonly type: "object";
388
- readonly properties: {
389
- readonly score: {
390
- readonly type: "number";
391
- readonly minimum: 0;
392
- readonly maximum: 1;
393
- };
394
- readonly label: {
395
- readonly type: "string";
396
- readonly enum: readonly ["good", "bad", "neutral", "mixed"];
397
- };
398
- readonly notes: {
399
- readonly type: "string";
400
- };
401
- };
402
- readonly required: readonly ["score", "notes"];
403
- readonly additionalProperties: false;
264
+ readonly ref: {
265
+ readonly type: "string";
404
266
  };
405
- readonly by: {
406
- readonly type: "string";
407
- readonly enum: readonly ["agent", "user", "downstream-judge"];
267
+ };
268
+ readonly required: readonly ["kind", "ref"];
269
+ readonly additionalProperties: false;
270
+ };
271
+ readonly rating: {
272
+ readonly type: "object";
273
+ readonly properties: {
274
+ readonly score: {
275
+ readonly type: "number";
276
+ readonly minimum: 0;
277
+ readonly maximum: 1;
408
278
  };
409
- readonly capturedAt: {
410
- readonly type: "string";
279
+ readonly label: {
280
+ readonly type: "string";
281
+ readonly enum: readonly ["good", "bad", "neutral", "mixed"];
411
282
  };
412
- readonly namespace: {
413
- readonly type: "string";
283
+ readonly notes: {
284
+ readonly type: "string";
414
285
  };
286
+ };
287
+ readonly required: readonly ["score", "notes"];
288
+ readonly additionalProperties: false;
289
+ };
290
+ readonly by: {
291
+ readonly type: "string";
292
+ readonly enum: readonly ["agent", "user", "downstream-judge"];
293
+ };
294
+ readonly capturedAt: {
295
+ readonly type: "string";
415
296
  };
416
- readonly required: readonly ["refersTo", "rating", "by"];
417
- readonly additionalProperties: false;
297
+ readonly namespace: {
298
+ readonly type: "string";
299
+ };
300
+ };
301
+ readonly required: readonly ["refersTo", "rating", "by"];
302
+ readonly additionalProperties: false;
418
303
  };
419
304
  /** Parse and validate raw MCP tool input into typed `DelegateFeedbackArgs`; throws `TypeError` on bad input. @experimental */
420
305
  declare function validateDelegateFeedbackArgs(raw: unknown): DelegateFeedbackArgs;
421
306
  /** @experimental */
422
307
  interface DelegateFeedbackHandlerOptions {
423
- queue: DelegationTaskQueue;
424
- store: FeedbackStore;
425
- generateId?: () => string;
426
- now?: () => string;
308
+ queue: DelegationTaskQueue;
309
+ store: FeedbackStore;
310
+ generateId?: () => string;
311
+ now?: () => string;
427
312
  }
428
313
  /** Build the MCP tool handler that persists feedback events and attaches them to delegation records. @experimental */
429
314
  declare function createDelegateFeedbackHandler(options: DelegateFeedbackHandlerOptions): (raw: unknown) => Promise<DelegateFeedbackResult>;
430
-
431
- /**
432
- *
433
- * `delegate_ui_audit` MCP tool — async kickoff for UI audit runs. Validates
434
- * the input, computes an idempotency key over the canonical fields, hands
435
- * the task to the queue, and returns a taskId. Identical inputs return
436
- * the same taskId.
437
- *
438
- * The handler does not import the auditor profile directly — consumers
439
- * inject a `UiAuditorDelegate` via `createMcpServer({ uiAuditorDelegate })`.
440
- * The delegate is the seam where the consumer chooses the judge (vision
441
- * model) and the `SandboxClient` (in-process Playwright vs fleet vs
442
- * remote browser). agent-runtime ships the in-process client under
443
- * `./profiles` so consumers who want the canonical setup can wire it
444
- * with a few lines.
445
- *
446
- * @experimental
447
- */
448
-
315
+ //#endregion
316
+ //#region src/mcp/tools/delegate-ui-audit.d.ts
449
317
  /** MCP tool name for the `delegate_ui_audit` async kickoff tool. @experimental */
450
318
  declare const DELEGATE_UI_AUDIT_TOOL_NAME = "delegate_ui_audit";
451
319
  /** Human-readable description of the `delegate_ui_audit` MCP tool, injected into the tool manifest. @experimental */
452
320
  declare const DELEGATE_UI_AUDIT_DESCRIPTION: string;
453
321
  /** JSON Schema for `delegate_ui_audit` tool arguments (`workspaceDir`, `routes`, optional config). @experimental */
454
322
  declare const DELEGATE_UI_AUDIT_INPUT_SCHEMA: {
455
- readonly type: "object";
456
- readonly properties: {
457
- readonly workspaceDir: {
323
+ readonly type: "object";
324
+ readonly properties: {
325
+ readonly workspaceDir: {
326
+ readonly type: "string";
327
+ readonly description: "Absolute path for the audit workspace.";
328
+ };
329
+ readonly routes: {
330
+ readonly type: "array";
331
+ readonly items: {
332
+ readonly type: "object";
333
+ readonly properties: {
334
+ readonly name: {
458
335
  readonly type: "string";
459
- readonly description: "Absolute path for the audit workspace.";
460
- };
461
- readonly routes: {
336
+ readonly description: "Stable route name (used in screenshot filenames).";
337
+ };
338
+ readonly url: {
339
+ readonly type: "string";
340
+ readonly description: "Fully-qualified URL.";
341
+ };
342
+ readonly viewports: {
462
343
  readonly type: "array";
463
344
  readonly items: {
464
- readonly type: "object";
465
- readonly properties: {
466
- readonly name: {
467
- readonly type: "string";
468
- readonly description: "Stable route name (used in screenshot filenames).";
469
- };
470
- readonly url: {
471
- readonly type: "string";
472
- readonly description: "Fully-qualified URL.";
473
- };
474
- readonly viewports: {
475
- readonly type: "array";
476
- readonly items: {
477
- readonly type: "object";
478
- readonly properties: {
479
- readonly width: {
480
- readonly type: "integer";
481
- readonly minimum: 1;
482
- };
483
- readonly height: {
484
- readonly type: "integer";
485
- readonly minimum: 1;
486
- };
487
- };
488
- readonly required: readonly ["width", "height"];
489
- readonly additionalProperties: false;
490
- };
491
- readonly description: "Viewports to capture at. Default [{1280, 800}].";
492
- };
493
- readonly fullPage: {
494
- readonly type: "boolean";
495
- };
496
- readonly waitFor: {
497
- readonly type: "string";
498
- readonly description: "CSS selector to wait for before capturing.";
499
- };
345
+ readonly type: "object";
346
+ readonly properties: {
347
+ readonly width: {
348
+ readonly type: "integer";
349
+ readonly minimum: 1;
350
+ };
351
+ readonly height: {
352
+ readonly type: "integer";
353
+ readonly minimum: 1;
500
354
  };
501
- readonly required: readonly ["name", "url"];
502
- readonly additionalProperties: false;
355
+ };
356
+ readonly required: readonly ["width", "height"];
357
+ readonly additionalProperties: false;
503
358
  };
504
- readonly minItems: 1;
359
+ readonly description: "Viewports to capture at. Default [{1280, 800}].";
360
+ };
361
+ readonly fullPage: {
362
+ readonly type: "boolean";
363
+ };
364
+ readonly waitFor: {
365
+ readonly type: "string";
366
+ readonly description: "CSS selector to wait for before capturing.";
367
+ };
505
368
  };
506
- readonly namespace: {
369
+ readonly required: readonly ["name", "url"];
370
+ readonly additionalProperties: false;
371
+ };
372
+ readonly minItems: 1;
373
+ };
374
+ readonly namespace: {
375
+ readonly type: "string";
376
+ readonly description: "Multi-tenant scope.";
377
+ };
378
+ readonly config: {
379
+ readonly type: "object";
380
+ readonly properties: {
381
+ readonly lenses: {
382
+ readonly type: "array";
383
+ readonly items: {
507
384
  readonly type: "string";
508
- readonly description: "Multi-tenant scope.";
385
+ readonly enum: readonly UiLens[];
386
+ };
387
+ readonly description: "Lenses to iterate. Default: every lens except \"other\".";
509
388
  };
510
- readonly config: {
511
- readonly type: "object";
512
- readonly properties: {
513
- readonly lenses: {
514
- readonly type: "array";
515
- readonly items: {
516
- readonly type: "string";
517
- readonly enum: readonly UiLens[];
518
- };
519
- readonly description: "Lenses to iterate. Default: every lens except \"other\".";
520
- };
521
- readonly maxIterations: {
522
- readonly type: "integer";
523
- readonly minimum: 1;
524
- };
525
- readonly maxConcurrency: {
526
- readonly type: "integer";
527
- readonly minimum: 1;
528
- };
529
- readonly productContext: {
530
- readonly type: "string";
531
- };
532
- };
533
- readonly additionalProperties: false;
389
+ readonly maxIterations: {
390
+ readonly type: "integer";
391
+ readonly minimum: 1;
392
+ };
393
+ readonly maxConcurrency: {
394
+ readonly type: "integer";
395
+ readonly minimum: 1;
396
+ };
397
+ readonly productContext: {
398
+ readonly type: "string";
534
399
  };
400
+ };
401
+ readonly additionalProperties: false;
535
402
  };
536
- readonly required: readonly ["workspaceDir", "routes"];
537
- readonly additionalProperties: false;
403
+ };
404
+ readonly required: readonly ["workspaceDir", "routes"];
405
+ readonly additionalProperties: false;
538
406
  };
539
407
  /** Parse and validate raw MCP tool input into typed `DelegateUiAuditArgs`; throws `TypeError` on bad input. @experimental */
540
408
  declare function validateDelegateUiAuditArgs(raw: unknown): DelegateUiAuditArgs;
541
409
  /** @experimental */
542
410
  interface DelegateUiAuditHandlerOptions {
543
- queue: DelegationTaskQueue;
544
- delegate: UiAuditorDelegate;
545
- estimateDurationMs?: (args: DelegateUiAuditArgs) => number;
411
+ queue: DelegationTaskQueue;
412
+ delegate: UiAuditorDelegate;
413
+ estimateDurationMs?: (args: DelegateUiAuditArgs) => number;
546
414
  }
547
415
  /** Build the MCP tool handler that validates input, deduplicates via idempotency key, and enqueues a UI audit. @experimental */
548
416
  declare function createDelegateUiAuditHandler(options: DelegateUiAuditHandlerOptions): (raw: unknown) => Promise<DelegateUiAuditResult>;
549
-
550
- /**
551
- *
552
- * `delegation_history` MCP tool — synchronous read of past delegations.
553
- * The agent uses this for self-introspection — "have I delegated this
554
- * kind of task before? did it work?" — and calibration.
555
- *
556
- * @experimental
557
- */
558
-
417
+ //#endregion
418
+ //#region src/mcp/tools/delegation-history.d.ts
559
419
  /** MCP tool name for the `delegation_history` read-past-delegations tool. @experimental */
560
420
  declare const DELEGATION_HISTORY_TOOL_NAME = "delegation_history";
561
421
  /** Human-readable description of the `delegation_history` MCP tool, injected into the tool manifest. @experimental */
562
422
  declare const DELEGATION_HISTORY_DESCRIPTION: string;
563
423
  /** JSON Schema for `delegation_history` tool arguments (optional `namespace`, `profile`, `since`, `limit`). @experimental */
564
424
  declare const DELEGATION_HISTORY_INPUT_SCHEMA: {
565
- readonly type: "object";
566
- readonly properties: {
567
- readonly namespace: {
568
- readonly type: "string";
569
- };
570
- readonly profile: {
571
- readonly type: "string";
572
- readonly enum: readonly ["coder", "researcher"];
573
- };
574
- readonly since: {
575
- readonly type: "string";
576
- readonly description: "ISO datetime — earliest startedAt to include.";
577
- };
578
- readonly limit: {
579
- readonly type: "integer";
580
- readonly minimum: 1;
581
- readonly maximum: 500;
582
- };
425
+ readonly type: "object";
426
+ readonly properties: {
427
+ readonly namespace: {
428
+ readonly type: "string";
429
+ };
430
+ readonly profile: {
431
+ readonly type: "string";
432
+ readonly enum: readonly ["coder", "researcher"];
583
433
  };
584
- readonly additionalProperties: false;
434
+ readonly since: {
435
+ readonly type: "string";
436
+ readonly description: "ISO datetime — earliest startedAt to include.";
437
+ };
438
+ readonly limit: {
439
+ readonly type: "integer";
440
+ readonly minimum: 1;
441
+ readonly maximum: 500;
442
+ };
443
+ };
444
+ readonly additionalProperties: false;
585
445
  };
586
446
  /** Parse and validate raw MCP tool input into typed `DelegationHistoryArgs`; throws `TypeError` on bad input. @experimental */
587
447
  declare function validateDelegationHistoryArgs(raw: unknown): DelegationHistoryArgs;
588
448
  /** @experimental */
589
449
  interface DelegationHistoryHandlerOptions {
590
- queue: DelegationTaskQueue;
450
+ queue: DelegationTaskQueue;
591
451
  }
592
452
  /** Build the MCP tool handler that reads filtered past delegations from a `DelegationTaskQueue`. @experimental */
593
453
  declare function createDelegationHistoryHandler(options: DelegationHistoryHandlerOptions): (raw: unknown) => Promise<DelegationHistoryResult>;
594
-
595
- /**
596
- *
597
- * `delegation_status` MCP tool — synchronous poll. Returns the current
598
- * state machine + optional progress + final result (when terminal).
599
- *
600
- * @experimental
601
- */
602
-
454
+ //#endregion
455
+ //#region src/mcp/tools/delegation-status.d.ts
603
456
  /** MCP tool name for the `delegation_status` synchronous-poll tool. @experimental */
604
457
  declare const DELEGATION_STATUS_TOOL_NAME = "delegation_status";
605
458
  /** Human-readable description of the `delegation_status` MCP tool, injected into the tool manifest. @experimental */
606
459
  declare const DELEGATION_STATUS_DESCRIPTION: string;
607
460
  /** JSON Schema for `delegation_status` tool arguments (`taskId` + optional `includeTrace`). @experimental */
608
461
  declare const DELEGATION_STATUS_INPUT_SCHEMA: {
609
- readonly type: "object";
610
- readonly properties: {
611
- readonly taskId: {
612
- readonly type: "string";
613
- readonly description: "Returned by delegate_ui_audit.";
614
- };
615
- readonly includeTrace: {
616
- readonly type: "boolean";
617
- readonly description: "Also return the journaled loop-trace span tree for this delegation. Default false.";
618
- };
462
+ readonly type: "object";
463
+ readonly properties: {
464
+ readonly taskId: {
465
+ readonly type: "string";
466
+ readonly description: "Returned by delegate_ui_audit.";
467
+ };
468
+ readonly includeTrace: {
469
+ readonly type: "boolean";
470
+ readonly description: "Also return the journaled loop-trace span tree for this delegation. Default false.";
619
471
  };
620
- readonly required: readonly ["taskId"];
621
- readonly additionalProperties: false;
472
+ };
473
+ readonly required: readonly ["taskId"];
474
+ readonly additionalProperties: false;
622
475
  };
623
476
  /** Parse and validate raw MCP tool input into typed `DelegationStatusArgs`; throws `TypeError` on bad input. @experimental */
624
477
  declare function validateDelegationStatusArgs(raw: unknown): DelegationStatusArgs;
625
478
  /** @experimental */
626
479
  interface DelegationStatusHandlerOptions {
627
- queue: DelegationTaskQueue;
480
+ queue: DelegationTaskQueue;
628
481
  }
629
482
  /** Build the MCP tool handler that polls a `DelegationTaskQueue` for task status. @experimental */
630
483
  declare function createDelegationStatusHandler(options: DelegationStatusHandlerOptions): (raw: unknown) => Promise<DelegationStatusResult>;
631
-
632
- export { type AgentMemorySpec, type Check, type CheckRunnerOptions, CodexExecutionDiagnosticError, type CodexExecutionFailureDiagnostic, type CreateMemoryToolServerOptions, DELEGATE_FEEDBACK_DESCRIPTION, DELEGATE_FEEDBACK_INPUT_SCHEMA, DELEGATE_FEEDBACK_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, DelegateFeedbackArgs, DelegateFeedbackResult, DelegateUiAuditArgs, DelegateUiAuditResult, DelegationExecutor, DelegationHistoryArgs, DelegationHistoryResult, DelegationStatusArgs, DelegationStatusResult, DelegationTaskQueue, type DetectExecutorArgs, FeedbackStore, FleetHandle, GitRunner, type InProcessExecutorDescribePlacement, type InProcessExecutorOptions, LocalHarness, MEMORY_FILE_ENV, MEMORY_ITEMS_ENV, MEMORY_LOG_ENV, MEMORY_NAME_ENV, type MemoryItem, type ResolvedMemoryEnv, type McpToolDescriptor as StdioToolDescriptor, type StdioToolServer, type StdioToolServerOptions, UiAuditorDelegate, createDelegateFeedbackHandler, createDelegateUiAuditHandler, createDelegationHistoryHandler, createDelegationStatusHandler, createInProcessExecutor, createMemoryToolServer, createStdioToolServer, defaultChecks, detectExecutor, liftFindings, makeCheckRunner, parseMemoryItems, readMemoryItemsFile, renderTrace, resolveMemoryFromEnv, runCheck, runLocalHarness, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
484
+ //#endregion
485
+ //#region src/mcp/index.d.ts
486
+ /** @deprecated Use `McpToolDescriptor`; both names are the same protocol contract. */
487
+ type StdioToolDescriptor = McpToolDescriptor;
488
+ //#endregion
489
+ export { type AgentMemorySpec, type AnalystFindingEvent, type AnalystRegistry, type CappedDelegationTrace, type Check, type CheckRunnerOptions, type CoderDelegate, type CoderOutput, type CoderReview, type CoderReviewer, CodexExecutionDiagnosticError, type CodexExecutionEvidence, type CodexExecutionFailureDiagnostic, type CodexExecutionPolicy, type CodexTokenUsage, type CoordinationEvent, type CoordinationTools, type CoordinationToolsOptions, type CreateKbGateOptions, type CreateMemoryToolServerOptions, type CreateWorktreeOptions, DEFAULT_AWAIT_EVENT_TIMEOUT_MS, 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 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 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, 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, StdioToolDescriptor, type StdioToolServer, type StdioToolServerOptions, type SubmitInput, type SubmitOutput, type TraceContext, type UiAuditLensFilter, type UiAuditorDelegate, type UiAuditorDelegationOutput, 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, defaultChecks, detachedSessionDelegate, detachedTurnEvents, detectExecutor, eventToSnapshot, formatDetachedSessionRef, hashIdempotencyInput, liftFindings, makeCheckRunner, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, parseCodexTokenUsage, parseDetachedSessionRef, parseMemoryItems, readMemoryItemsFile, readTraceContextFromEnv, removeWorktree, renderTrace, resolveMemoryFromEnv, runCheck, runDetachedTurn, runLocalHarness, settleDetachedCoderTurn, traceContextToEnv, validateDelegateArgs, validateDelegateFeedbackArgs, validateDelegateUiAuditArgs, validateDelegationHistoryArgs, validateDelegationStatusArgs };
490
+ //# sourceMappingURL=index.d.ts.map