@tangle-network/agent-runtime 0.123.1 → 0.126.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 (32) hide show
  1. package/dist/agent.d.ts +1 -1
  2. package/dist/agent.js +2 -2
  3. package/dist/{index-4NcThsDc.d.ts → index-DIV33AF5.d.ts} +2 -2
  4. package/dist/{index-CQBioeAj.d.ts → index-D_M4d1_B.d.ts} +4 -4
  5. package/dist/{index-xP27vtnt.d.ts → index-EdjCQBV9.d.ts} +51 -127
  6. package/dist/index.d.ts +4 -4
  7. package/dist/index.js +4 -4
  8. package/dist/kernel.d.ts +2 -2
  9. package/dist/kernel.js +3 -3
  10. package/dist/{knowledge-BOHj6nGh.js → knowledge-EnuEqm_Y.js} +2 -2
  11. package/dist/{knowledge-BOHj6nGh.js.map → knowledge-EnuEqm_Y.js.map} +1 -1
  12. package/dist/knowledge.d.ts +1 -1
  13. package/dist/knowledge.js +1 -1
  14. package/dist/{loop-runner-bin-DMnNxZHw.d.ts → loop-runner-bin-Bo29_fiD.d.ts} +2 -2
  15. package/dist/{loop-runner-bin-DUM37LLw.js → loop-runner-bin-qwT_4F5I.js} +3 -3
  16. package/dist/{loop-runner-bin-DUM37LLw.js.map → loop-runner-bin-qwT_4F5I.js.map} +1 -1
  17. package/dist/loop-runner-bin.d.ts +1 -1
  18. package/dist/loop-runner-bin.js +1 -1
  19. package/dist/mcp/bin.js +1 -1
  20. package/dist/mcp/index.d.ts +1 -1
  21. package/dist/mcp/index.js +3 -3
  22. package/dist/{openai-tools-Bm1SDJIp.js → openai-tools-Bp1KSkP6.js} +2 -2
  23. package/dist/{openai-tools-Bm1SDJIp.js.map → openai-tools-Bp1KSkP6.js.map} +1 -1
  24. package/dist/primeintellect/index.d.ts +1 -1
  25. package/dist/{runtime-DZblIf3R.js → runtime-BzXz7OjS.js} +85 -124
  26. package/dist/runtime-BzXz7OjS.js.map +1 -0
  27. package/dist/{supervise-Cx24b3lw.js → supervise-Ds8FtyI9.js} +111 -8
  28. package/dist/supervise-Ds8FtyI9.js.map +1 -0
  29. package/dist/testing.js +8 -8
  30. package/package.json +4 -4
  31. package/dist/runtime-DZblIf3R.js.map +0 -1
  32. package/dist/supervise-Cx24b3lw.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import { $d as createDelegationTraceCollector, $u as createDetachedTurnResumeDriver, Ad as DelegationHistoryEntry, Al as McpServer, Au as CoderDelegate, Bd as ResearchOutputShape, Bl as DelegateResult, Bu as settleDetachedCoderTurn, Cd as DelegateUiAuditArgs, Cl as QuestionUrgency, Cu as JsonRpcResponse, Dd as DelegationError, Du as FeedbackStore, Ed as DelegateUiAuditRoute, El as WorkerWatchOptions, Eu as FeedbackEvent, Fd as DelegationStatus, Fl as DELEGATE_INPUT_SCHEMA, Fu as DetachedWinnerSelection, Gd as DELEGATION_TRACE_MAX_BYTES, Gu as createFleetWorkspaceExecutor, Hd as UiAuditLensFilter, Hl as validateDelegateArgs, Hu as FleetHandle, Id as DelegationStatusArgs, Il as DELEGATE_TOOL_NAME, Iu as SettleDetachedCoderTurnOptions, Jd as DelegationTraceCollector, Ju as DetachedTurn, Kd as DELEGATION_TRACE_MAX_SPANS, Ku as createSiblingSandboxExecutor, Ld as DelegationStatusResult, Ll as DelegateArgs, Lu as UiAuditorDelegate, Md as DelegationProfile, Ml as createInProcessTransport, Mu as CoderReviewer, Nd as DelegationProgress, Nl as createMcpServer, Nu as DelegateRunCtx, Od as DelegationFeedbackSnapshot, Ol as createCoordinationTools, Ou as InMemoryFeedbackStore, Pd as DelegationResultPayload, Pl as DELEGATE_DESCRIPTION, Pu as DetachedSessionDelegateOptions, Qd as composeLoopTraceEmitters, Qu as RunDetachedTurnOptions, Rd as FeedbackRating, Rl as DelegateError, Ru as coderTaskFromArgs, Sd as DelegateResearchResult, Sl as QuestionRecord, Su as JsonRpcMessage, Td as DelegateUiAuditResult, Tl as WorkerSpawnContext, Tu as McpTransport, Ud as UiAuditorDelegationOutput, Uu as FleetWorkspaceExecutorOptions, Vd as ResearchSource, Vl as createDelegateHandler, Vu as DelegationExecutor, Wd as CappedDelegationTrace, Wu as SiblingSandboxExecutorOptions, Xd as buildDelegationTraceSpans, Xu as DriveTurnCapableBox, Yd as DelegationTraceSpan, Yu as DetachedTurnResumeDriverOptions, Zd as capDelegationTrace, Zu as DriveTurnTick, _d as DelegateCodeResult, _l as Question, _u as RemoveWorktreeOptions, ad as DelegationRecord, af as InMemoryDelegationStore, al as AuthorizeDownMessage, bd as DelegateResearchArgs, bl as QuestionOption, bu as createWorktree, cd as DelegationResumeTick, cl as CoordinationEvent, dd as DelegationTaskQueueOptions, dl as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, ed as detachedTurnEvents, ef as DelegationPersistenceError, fd as SubmitInput, fl as DownMessageAuthorizationInput, gd as DelegateCodeConfig, gl as MakeWorkerAgent, gu as GitRunner, hd as DelegateCodeArgs, hf as CoderOutput, hl as DownMessageEvent, hu as DiffResult, id as DelegationArgs, if as FileDelegationStoreOptions, jd as DelegationHistoryResult, jl as McpServerOptions, ju as CoderReview, kd as DelegationHistoryArgs, ku as eventToSnapshot, ld as DelegationRunContext, ll as CoordinationTools, md as hashIdempotencyInput, ml as DownMessageDeliveryOutcome, mu as DiffOptions, nd as parseDetachedSessionRef, nf as DelegationStore, nl as AnalystFindingEvent, od as DelegationResumeContext, ol as AuthorizedDownMessage, pd as SubmitOutput, pl as DownMessageDeliveryAttempt, pu as CreateWorktreeOptions, qd as DelegationTraceCaps, qu as DetachedSessionRefParts, rd as runDetachedTurn, rf as FileDelegationStore, rl as AnalystRegistry, sd as DelegationResumeDriver, sl as ContinuationInstruction, td as formatDetachedSessionRef, tf as DelegationStateCorruptError, ud as DelegationTaskQueue, ul as CoordinationToolsOptions, vd as DelegateFeedbackArgs, vl as QuestionDecision, vu as WorktreeHandle, wd as DelegateUiAuditConfig, wl as SettledWorker, wu as McpToolDescriptor, xd as DelegateResearchConfig, xl as QuestionPolicy, xu as removeWorktree, yd as DelegateFeedbackResult, yl as QuestionLevel, yu as captureWorktreeDiff, zd as FeedbackRefersTo, zl as DelegateHandlerOptions, zu as detachedSessionDelegate } from "../index-xP27vtnt.js";
1
+ import { $c as ContinuationInstruction, $u as DelegationResumeDriver, Ad as FeedbackRating, Al as DelegateError, Au as coderTaskFromArgs, Bd as DelegationTraceCollector, Bu as DetachedTurn, Cd as DelegationHistoryResult, Cl as McpServerOptions, Cu as CoderReview, Dd as DelegationStatus, Dl as DELEGATE_INPUT_SCHEMA, Du as DetachedWinnerSelection, Ed as DelegationResultPayload, El as DELEGATE_DESCRIPTION, Eu as DetachedSessionDelegateOptions, Fd as UiAuditorDelegationOutput, Fu as FleetWorkspaceExecutorOptions, Gd as createDelegationTraceCollector, Gu as createDetachedTurnResumeDriver, Hd as buildDelegationTraceSpans, Hu as DriveTurnCapableBox, Id as CappedDelegationTrace, Iu as SiblingSandboxExecutorOptions, Jc as AnalystFindingEvent, Jd as DelegationStore, Ju as parseDetachedSessionRef, Kd as DelegationPersistenceError, Ku as detachedTurnEvents, Ld as DELEGATION_TRACE_MAX_BYTES, Lu as createFleetWorkspaceExecutor, Md as ResearchOutputShape, Ml as DelegateResult, Mu as settleDetachedCoderTurn, Nd as ResearchSource, Nl as createDelegateHandler, Nu as DelegationExecutor, Od as DelegationStatusArgs, Ol as DELEGATE_TOOL_NAME, Ou as SettleDetachedCoderTurnOptions, Pd as UiAuditLensFilter, Pl as validateDelegateArgs, Pu as FleetHandle, Qc as AuthorizedDownMessage, Qu as DelegationResumeContext, Rd as DELEGATION_TRACE_MAX_SPANS, Ru as createSiblingSandboxExecutor, Sd as DelegationHistoryEntry, Sl as McpServer, Su as CoderDelegate, Td as DelegationProgress, Tl as createMcpServer, Tu as DelegateRunCtx, Ud as capDelegationTrace, Uu as DriveTurnTick, Vd as DelegationTraceSpan, Vu as DetachedTurnResumeDriverOptions, Wd as composeLoopTraceEmitters, Wu as RunDetachedTurnOptions, Xd as FileDelegationStoreOptions, Xu as DelegationArgs, Yc as AnalystRegistry, Yd as FileDelegationStore, Yu as runDetachedTurn, Zc as AuthorizeDownMessage, Zd as InMemoryDelegationStore, Zu as DelegationRecord, _d as DelegateUiAuditResult, _l as WorkerSpawnContext, _u as McpTransport, ad as SubmitOutput, al as DownMessageDeliveryAttempt, au as CreateWorktreeOptions, bd as DelegationFeedbackSnapshot, bl as createCoordinationTools, bu as InMemoryFeedbackStore, cd as DelegateCodeConfig, cl as MakeWorkerAgent, cu as GitRunner, dd as DelegateFeedbackResult, dl as QuestionLevel, du as captureWorktreeDiff, ed as DelegationResumeTick, el as CoordinationEvent, fd as DelegateResearchArgs, fl as QuestionOption, fu as createWorktree, gd as DelegateUiAuditConfig, gl as SettledWorker, gu as McpToolDescriptor, hd as DelegateUiAuditArgs, hl as QuestionUrgency, hu as JsonRpcResponse, id as SubmitInput, il as DownMessageAuthorizationInput, jd as FeedbackRefersTo, jl as DelegateHandlerOptions, ju as detachedSessionDelegate, kd as DelegationStatusResult, kl as DelegateArgs, ku as UiAuditorDelegate, ld as DelegateCodeResult, ll as Question, lu as RemoveWorktreeOptions, md as DelegateResearchResult, ml as QuestionRecord, mu as JsonRpcMessage, nd as DelegationTaskQueue, nl as CoordinationToolsOptions, od as hashIdempotencyInput, ol as DownMessageDeliveryOutcome, ou as DiffOptions, pd as DelegateResearchConfig, pl as QuestionPolicy, pu as removeWorktree, qd as DelegationStateCorruptError, qu as formatDetachedSessionRef, rd as DelegationTaskQueueOptions, rl as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, sd as DelegateCodeArgs, sf as CoderOutput, sl as DownMessageEvent, su as DiffResult, td as DelegationRunContext, tl as CoordinationTools, ud as DelegateFeedbackArgs, ul as QuestionDecision, uu as WorktreeHandle, vd as DelegateUiAuditRoute, vl as WorkerWatchOptions, vu as FeedbackEvent, wd as DelegationProfile, wl as createInProcessTransport, wu as CoderReviewer, xd as DelegationHistoryArgs, xu as eventToSnapshot, yd as DelegationError, yu as FeedbackStore, zd as DelegationTraceCaps, zu as DetachedSessionRefParts } from "../index-EdjCQBV9.js";
2
2
  import { E as SandboxClient, h as LoopSandboxPlacement } from "../types-DnNGJ5Gz.js";
3
3
  import { Bt as mergeTraceEnv, Ht as traceContextToEnv, Rt as TraceContext, Vt as readTraceContextFromEnv, zt as createPropagatingTraceEmitter } from "../environment-provider-PM9PeW_J.js";
4
4
  import { o as UiLens } from "../substrate-BcnuSHXm.js";
package/dist/mcp/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { u as ValidationError } from "../errors-DEAvWQPy.js";
2
2
  import { l as throwAbort, n as deleteBoxSafe, s as sleep, u as throwIfAborted } from "../util-MVgdwuIS.js";
3
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, tt as selectValidWinner } from "../runtime-DZblIf3R.js";
5
- import { A as DELEGATE_DESCRIPTION, At as createSandboxForSpec, 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 runAgentRounds, N as createDelegateHandler, O as createDelegateFeedbackHandler, P as validateDelegateArgs, 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-Cx24b3lw.js";
4
+ import { S as runCoderChecks, tt as selectValidWinner } from "../runtime-BzXz7OjS.js";
5
+ import { A as DELEGATE_DESCRIPTION, At as createSandboxForSpec, 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 runAgentRounds, N as createDelegateHandler, O as createDelegateFeedbackHandler, P as validateDelegateArgs, 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-Ds8FtyI9.js";
6
6
  import { t as createStdioToolServer } from "../tool-server-RcWgLIsL.js";
7
7
  import { t as createKbGate } from "../kb-gate-DpaSwXVx.js";
8
- import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-Bm1SDJIp.js";
8
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-Bp1KSkP6.js";
9
9
  import { t as coderTaskToPrompt } from "../coder-yhVWbdWc.js";
10
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
11
  import { randomUUID } from "node:crypto";
@@ -1,4 +1,4 @@
1
- import { D as DELEGATE_FEEDBACK_TOOL_NAME, E as DELEGATE_FEEDBACK_INPUT_SCHEMA, T as DELEGATE_FEEDBACK_DESCRIPTION, _ as DELEGATION_HISTORY_TOOL_NAME, d as DELEGATION_STATUS_INPUT_SCHEMA, f as DELEGATION_STATUS_TOOL_NAME, g as DELEGATION_HISTORY_INPUT_SCHEMA, h as DELEGATION_HISTORY_DESCRIPTION, u as DELEGATION_STATUS_DESCRIPTION } from "./supervise-Cx24b3lw.js";
1
+ import { D as DELEGATE_FEEDBACK_TOOL_NAME, E as DELEGATE_FEEDBACK_INPUT_SCHEMA, T as DELEGATE_FEEDBACK_DESCRIPTION, _ as DELEGATION_HISTORY_TOOL_NAME, d as DELEGATION_STATUS_INPUT_SCHEMA, f as DELEGATION_STATUS_TOOL_NAME, g as DELEGATION_HISTORY_INPUT_SCHEMA, h as DELEGATION_HISTORY_DESCRIPTION, u as DELEGATION_STATUS_DESCRIPTION } from "./supervise-Ds8FtyI9.js";
2
2
  //#region src/mcp/openai-tools.ts
3
3
  function buildTool(name, description, parameters) {
4
4
  return {
@@ -41,4 +41,4 @@ function mcpToolsForRuntimeMcpSubset(names) {
41
41
  //#endregion
42
42
  export { mcpToolsForRuntimeMcpSubset as n, mcpToolsForRuntimeMcp as t };
43
43
 
44
- //# sourceMappingURL=openai-tools-Bm1SDJIp.js.map
44
+ //# sourceMappingURL=openai-tools-Bp1KSkP6.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"openai-tools-Bm1SDJIp.js","names":[],"sources":["../src/mcp/openai-tools.ts"],"sourcesContent":["/**\n *\n * OpenAI Chat Completions `tools[]` projection of the queue-bound agent-runtime\n * MCP delegation tools.\n *\n * Use when configuring `createOpenAICompatibleBackend({ tools: ... })` so the\n * model can call `delegate_feedback`, `delegation_status`, and\n * `delegation_history` through the OpenAI-compat transport (tcloud, OpenRouter,\n * OpenAI direct, cli-bridge). The runtime surfaces tool calls as `tool_call`\n * stream events — execution is the caller's responsibility (typically the\n * parent sandbox runtime's MCP mount).\n *\n * Sandbox-SDK callers do NOT need this helper: the sandbox runtime mounts\n * MCP servers natively and the in-sandbox harness discovers tools via the\n * runtime, not via an OpenAI tools array.\n *\n * Tool name + description + JSON-schema are pulled from the canonical\n * `DELEGATE_*` constants exported by `./tools/*` so the projection cannot\n * drift from the server's own validators.\n *\n * @experimental\n */\n\nimport type { OpenAIChatTool } from '../types'\nimport {\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA,\n DELEGATE_FEEDBACK_TOOL_NAME,\n} from './tools/delegate-feedback'\nimport {\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA,\n DELEGATION_HISTORY_TOOL_NAME,\n} from './tools/delegation-history'\nimport {\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA,\n DELEGATION_STATUS_TOOL_NAME,\n} from './tools/delegation-status'\n\nfunction buildTool(\n name: string,\n description: string,\n parameters: Readonly<Record<string, unknown>>,\n): OpenAIChatTool {\n // `parameters` arrives as a deeply-readonly `as const` literal. The\n // OpenAI-compat backend JSON-serializes the body so a shallow copy\n // into a plain object is sufficient — and shields callers that mutate\n // the returned descriptor from corrupting the source constant.\n return {\n type: 'function',\n function: { name, description, parameters: { ...parameters } },\n }\n}\n\n/**\n *\n * Returns the queue-bound delegation tools projected into OpenAI Chat\n * Completions `tools[]` shape. The order is stable: `delegate_feedback`,\n * `delegation_status`, `delegation_history`.\n *\n * @experimental\n */\nexport function mcpToolsForRuntimeMcp(): OpenAIChatTool[] {\n return [\n buildTool(\n DELEGATE_FEEDBACK_TOOL_NAME,\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_STATUS_TOOL_NAME,\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_HISTORY_TOOL_NAME,\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n ]\n}\n\n/**\n *\n * Subset filter — return only the projected tools whose `function.name`\n * appears in `names`. Useful for curated mounts (e.g. only the queue-bound\n * delegation tools, omitting `delegate_feedback`). Unknown names are\n * silently ignored; pass an empty array to get an empty result.\n *\n * @experimental\n */\nexport function mcpToolsForRuntimeMcpSubset(names: ReadonlyArray<string>): OpenAIChatTool[] {\n const allowed = new Set(names)\n return mcpToolsForRuntimeMcp().filter((tool) => allowed.has(tool.function.name))\n}\n"],"mappings":";;AAwCA,SAAS,UACP,MACA,aACA,YACgB;CAKhB,OAAO;EACL,MAAM;EACN,UAAU;GAAE;GAAM;GAAa,YAAY,EAAE,GAAG,WAAW;EAAE;CAC/D;AACF;;;;;;;;;AAUA,SAAgB,wBAA0C;CACxD,OAAO;EACL,UACE,6BACA,+BACA,8BACF;EACA,UACE,6BACA,+BACA,8BACF;EACA,UACE,8BACA,gCACA,+BACF;CACF;AACF;;;;;;;;;;AAWA,SAAgB,4BAA4B,OAAgD;CAC1F,MAAM,UAAU,IAAI,IAAI,KAAK;CAC7B,OAAO,sBAAsB,CAAC,CAAC,QAAQ,SAAS,QAAQ,IAAI,KAAK,SAAS,IAAI,CAAC;AACjF"}
1
+ {"version":3,"file":"openai-tools-Bp1KSkP6.js","names":[],"sources":["../src/mcp/openai-tools.ts"],"sourcesContent":["/**\n *\n * OpenAI Chat Completions `tools[]` projection of the queue-bound agent-runtime\n * MCP delegation tools.\n *\n * Use when configuring `createOpenAICompatibleBackend({ tools: ... })` so the\n * model can call `delegate_feedback`, `delegation_status`, and\n * `delegation_history` through the OpenAI-compat transport (tcloud, OpenRouter,\n * OpenAI direct, cli-bridge). The runtime surfaces tool calls as `tool_call`\n * stream events — execution is the caller's responsibility (typically the\n * parent sandbox runtime's MCP mount).\n *\n * Sandbox-SDK callers do NOT need this helper: the sandbox runtime mounts\n * MCP servers natively and the in-sandbox harness discovers tools via the\n * runtime, not via an OpenAI tools array.\n *\n * Tool name + description + JSON-schema are pulled from the canonical\n * `DELEGATE_*` constants exported by `./tools/*` so the projection cannot\n * drift from the server's own validators.\n *\n * @experimental\n */\n\nimport type { OpenAIChatTool } from '../types'\nimport {\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA,\n DELEGATE_FEEDBACK_TOOL_NAME,\n} from './tools/delegate-feedback'\nimport {\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA,\n DELEGATION_HISTORY_TOOL_NAME,\n} from './tools/delegation-history'\nimport {\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA,\n DELEGATION_STATUS_TOOL_NAME,\n} from './tools/delegation-status'\n\nfunction buildTool(\n name: string,\n description: string,\n parameters: Readonly<Record<string, unknown>>,\n): OpenAIChatTool {\n // `parameters` arrives as a deeply-readonly `as const` literal. The\n // OpenAI-compat backend JSON-serializes the body so a shallow copy\n // into a plain object is sufficient — and shields callers that mutate\n // the returned descriptor from corrupting the source constant.\n return {\n type: 'function',\n function: { name, description, parameters: { ...parameters } },\n }\n}\n\n/**\n *\n * Returns the queue-bound delegation tools projected into OpenAI Chat\n * Completions `tools[]` shape. The order is stable: `delegate_feedback`,\n * `delegation_status`, `delegation_history`.\n *\n * @experimental\n */\nexport function mcpToolsForRuntimeMcp(): OpenAIChatTool[] {\n return [\n buildTool(\n DELEGATE_FEEDBACK_TOOL_NAME,\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_STATUS_TOOL_NAME,\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_HISTORY_TOOL_NAME,\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n ]\n}\n\n/**\n *\n * Subset filter — return only the projected tools whose `function.name`\n * appears in `names`. Useful for curated mounts (e.g. only the queue-bound\n * delegation tools, omitting `delegate_feedback`). Unknown names are\n * silently ignored; pass an empty array to get an empty result.\n *\n * @experimental\n */\nexport function mcpToolsForRuntimeMcpSubset(names: ReadonlyArray<string>): OpenAIChatTool[] {\n const allowed = new Set(names)\n return mcpToolsForRuntimeMcp().filter((tool) => allowed.has(tool.function.name))\n}\n"],"mappings":";;AAwCA,SAAS,UACP,MACA,aACA,YACgB;CAKhB,OAAO;EACL,MAAM;EACN,UAAU;GAAE;GAAM;GAAa,YAAY,EAAE,GAAG,WAAW;EAAE;CAC/D;AACF;;;;;;;;;AAUA,SAAgB,wBAA0C;CACxD,OAAO;EACL,UACE,6BACA,+BACA,8BACF;EACA,UACE,6BACA,+BACA,8BACF;EACA,UACE,8BACA,gCACA,+BACF;CACF;AACF;;;;;;;;;;AAWA,SAAgB,4BAA4B,OAAgD;CAC1F,MAAM,UAAU,IAAI,IAAI,KAAK;CAC7B,OAAO,sBAAsB,CAAC,CAAC,QAAQ,SAAS,QAAQ,IAAI,KAAK,SAAS,IAAI,CAAC;AACjF"}
@@ -1,5 +1,5 @@
1
1
  import { i as AgentExecutionBackend, r as AgentBackendInput } from "../types-C9j4qg6l.js";
2
- import { lt as createOpenAICompatibleBackend } from "../index-CQBioeAj.js";
2
+ import { lt as createOpenAICompatibleBackend } from "../index-D_M4d1_B.js";
3
3
  import { RunRecord } from "@tangle-network/agent-eval";
4
4
  //#region src/primeintellect/types.d.ts
5
5
  type PrimeIntellectSplit = 'train' | 'eval';
@@ -7,7 +7,7 @@ import { _t as routerChatWithUsage, bt as runBrainLoop, en as isHarnessNativeMod
7
7
  import { C as observe, O as strategyAuthorMethod, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-zY0oqQzO.js";
8
8
  import { i as notifyRuntimeHookEvent, t as composeRuntimeHooks } from "./runtime-hooks-C7iJOWm3.js";
9
9
  import { a as notifySandboxEventObserver, i as mapSandboxToolEvent, r as mapSandboxEvent, t as createSandboxToolPartState } from "./sandbox-events-Yhd1GYWl.js";
10
- import { Ct as createWorktreeCliExecutor, Et as createPushTraceSource, Ft as probeSandboxCapabilities, Mt as runAgentRounds, Pt as createSandboxLineage, Qt as kernelPromptRegistry, St as createExecutorRegistry, Zt as formatPromptHandle, jt as defaultSelectWinner, n as supervise, nn as gateOnDeliverable, r as workerFromBackend, xt as createExecutor } from "./supervise-Cx24b3lw.js";
10
+ import { Ct as createWorktreeCliExecutor, Et as createPushTraceSource, Ft as probeSandboxCapabilities, Mt as runAgentRounds, Pt as createSandboxLineage, Qt as kernelPromptRegistry, St as createExecutorRegistry, Zt as formatPromptHandle, jt as defaultSelectWinner, n as supervise, nn as gateOnDeliverable, r as workerFromBackend, xt as createExecutor } from "./supervise-Ds8FtyI9.js";
11
11
  import { CODING_HARNESSES, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, harnessAxisOf, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, scoreKnowledgeReadiness, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
12
12
  import { heldoutSignificance, runProfileMatrix } from "@tangle-network/agent-eval/campaign";
13
13
  import { agentProfileSchema, canonicalCandidateDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
@@ -1295,106 +1295,13 @@ function resolveSandboxClient(opts) {
1295
1295
  }
1296
1296
  }
1297
1297
  //#endregion
1298
- //#region src/runtime/steering-drivers.ts
1299
- /**
1300
- * Interpret a {@link SteeringDirectiveData} as a loop `Driver` — the ONE interpreter both
1301
- * control policies share. The directive is data; only `applyContinuation` (how the caller's
1302
- * opaque Task carries a steering string) remains code, exactly as `taskToPrompt` does.
1303
- */
1304
- function steeringDriver(directive, applyContinuation, name) {
1305
- const driverName = name ?? directive.kind;
1306
- const maxIterations = directive.maxTraversals;
1307
- const continuationFor = (passed) => directive.kind === "naive" ? directive.continuation : passed ? directive.onPass : directive.onFail;
1308
- const rationale = directive.kind === "naive" ? "naive fixed continuation (no grade signal)" : "dumb pass/fail-only continuation (no grader findings)";
1309
- return {
1310
- name: driverName,
1311
- plan(task, history) {
1312
- if (history.length === 0) return Promise.resolve([task]);
1313
- const passed = history[history.length - 1]?.verdict?.valid === true;
1314
- if (passed) return Promise.resolve([]);
1315
- if (history.length >= maxIterations) return Promise.resolve([]);
1316
- return Promise.resolve([applyContinuation(task, continuationFor(passed))]);
1317
- },
1318
- decide(history) {
1319
- return decideUntilValidOrCapped(history, maxIterations);
1320
- },
1321
- describePlan() {
1322
- return {
1323
- kind: "refine",
1324
- rationale
1325
- };
1326
- }
1327
- };
1328
- }
1329
- /**
1330
- * Shared `decide()` for the steering drivers. Verbatim semantics of the
1331
- * reference refine driver: a valid iteration anywhere → terminal `'pick-winner'`;
1332
- * otherwise `'refine'` (non-terminal, run another shot) while history is under
1333
- * the shot cap, else terminal `'fail'`. Pure over history; reads only
1334
- * `verdict.valid` (never notes/scores) so it adds no leak of its own.
1335
- */
1336
- function decideUntilValidOrCapped(history, maxIterations) {
1337
- if (history.some((it) => it.verdict?.valid)) return "pick-winner";
1338
- return history.length < maxIterations ? "refine" : "fail";
1339
- }
1340
- /**
1341
- * `naiveDriver` — the no-signal steering control.
1342
- *
1343
- * `plan()` runs the initial `task` at shot 0, then issues the SAME fixed
1344
- * `continuation` every subsequent round until a shot is valid or the cap is
1345
- * hit. It reads NOTHING from `history[last].verdict` — not `.valid`, not
1346
- * `.notes`, not `.scores`. It is the floor a coached loop must beat to earn its
1347
- * coaching: any lift over naive that is not also present in `dumb` is
1348
- * attributable to the pass/fail bit, and any lift of `refine` over `dumb` is
1349
- * attributable to the grader's findings.
1350
- */
1351
- /** Thin compatibility wrapper over {@link steeringDriver} for the naive (no-signal) control.
1352
- * @deprecated The policy is DATA now — build the directive and interpret it:
1353
- * `steeringDriver({ kind: 'naive', continuation, maxTraversals }, applyContinuation)`. This
1354
- * wrapper survives for existing callers and will be removed in the next major. */
1355
- function naiveDriver(options) {
1356
- const { continuation, applyContinuation, maxIterations, name = "naive" } = options;
1357
- return steeringDriver({
1358
- kind: "naive",
1359
- continuation,
1360
- maxTraversals: maxIterations
1361
- }, applyContinuation, name);
1362
- }
1363
- /**
1364
- * `dumbDriver` — the pass/fail-only steering control.
1365
- *
1366
- * `plan()` runs the initial `task` at shot 0, then reads ONLY
1367
- * `history[last].verdict.valid` (the boolean) and issues `onPass` or `onFail`
1368
- * accordingly. It MUST NOT read `.notes` or `.scores` — that boundary is the
1369
- * leak-free firewall. A `verdict` with no `valid` set (or no verdict) is
1370
- * treated as not-valid, so the driver is total and never throws on a
1371
- * grader/transport gap.
1372
- *
1373
- * The `dumb → refine` gap is the headline measurement: refine reads the
1374
- * grader's `notes`, dumb reads only the pass/fail bit, so the difference is
1375
- * exactly the value the findings add over a bare boolean.
1376
- */
1377
- /** Thin compatibility wrapper over {@link steeringDriver} for the dumb (pass/fail-only) control.
1378
- * @deprecated The policy is DATA now — build the directive and interpret it:
1379
- * `steeringDriver({ kind: 'dumb', onPass, onFail, maxTraversals }, applyContinuation)`. This
1380
- * wrapper survives for existing callers and will be removed in the next major. */
1381
- function dumbDriver(options) {
1382
- const { onPass, onFail, applyContinuation, maxIterations, name = "dumb" } = options;
1383
- return steeringDriver({
1384
- kind: "dumb",
1385
- onPass,
1386
- onFail,
1387
- maxTraversals: maxIterations
1388
- }, applyContinuation, name);
1389
- }
1390
- //#endregion
1391
1298
  //#region src/runtime/define-leaderboard.ts
1392
1299
  /**
1393
1300
  * `defineLeaderboard` — the declarative eval-leaderboard facade.
1394
1301
  *
1395
1302
  * A product's harness×model leaderboard is always the same assembly: expand a
1396
1303
  * base profile across the harness×model axes (`expandProfileAxes`), run every
1397
- * (profile, case) cell as a driven loop (`loopDispatch` + the naive steering directive), score
1304
+ * (profile, case) cell as a driven loop (`loopDispatch` + the naive retry driver), score
1398
1305
  * with the domain's grader, and emit ONE `runProfileMatrix` call. Each product
1399
1306
  * hand-rolled that assembly (~650 lines each) and re-hit the same footguns:
1400
1307
  * stale cell-cache reuse, zero-token stub cells, missing model snapshots.
@@ -1420,6 +1327,36 @@ function dumbDriver(options) {
1420
1327
  *
1421
1328
  * @experimental
1422
1329
  */
1330
+ /**
1331
+ * The no-signal retry floor as a bare `Driver` literal: re-run the case VERBATIM as an
1332
+ * independent attempt until one shot scores (`verdict.valid`) or the shot cap. It reads ONLY
1333
+ * `verdict.valid` — never `notes`/`scores` — so a leaderboard cell's retries carry no grader
1334
+ * findings into the next shot (the leak-free firewall). Steering POLICY texts are registry data
1335
+ * (`delegates/naive-continuation` and siblings in the kernel prompt registry) attached to graph
1336
+ * edges; this loop-kernel control folds no text in — each shot is the same task object, and the
1337
+ * per-shot nonce in `taskToPrompt` keeps the attempts independent at the router.
1338
+ */
1339
+ function naiveRetryDriver(shots) {
1340
+ return {
1341
+ name: "naive",
1342
+ plan(task, history) {
1343
+ if (history.length === 0) return Promise.resolve([task]);
1344
+ if (history[history.length - 1]?.verdict?.valid === true) return Promise.resolve([]);
1345
+ if (history.length >= shots) return Promise.resolve([]);
1346
+ return Promise.resolve([task]);
1347
+ },
1348
+ decide(history) {
1349
+ if (history.some((it) => it.verdict?.valid)) return "pick-winner";
1350
+ return history.length < shots ? "refine" : "fail";
1351
+ },
1352
+ describePlan() {
1353
+ return {
1354
+ kind: "refine",
1355
+ rationale: "naive fixed continuation (no grade signal)"
1356
+ };
1357
+ }
1358
+ };
1359
+ }
1423
1360
  /** Read `--name <value>` from an argv array. */
1424
1361
  function argOf(argv, name) {
1425
1362
  const i = argv.indexOf(`--${name}`);
@@ -1588,11 +1525,7 @@ function defineLeaderboard(spec) {
1588
1525
  ...!isHarnessNativeModel(modelId) || backendName === "cli-bridge" ? { model: modelId } : {}
1589
1526
  };
1590
1527
  return {
1591
- driver: steeringDriver({
1592
- kind: "naive",
1593
- continuation: "",
1594
- maxTraversals: shots
1595
- }, (task) => task, "naive"),
1528
+ driver: naiveRetryDriver(shots),
1596
1529
  agentRun: {
1597
1530
  profile: cellProfile,
1598
1531
  taskToPrompt: (s) => `${promptOf(s)}\n\n<!-- independent-attempt:${shotNonce++} -->`,
@@ -4691,10 +4624,13 @@ function deriveTurnSignal(callerSignal, timeoutMs) {
4691
4624
  * 4. **Per-edge traversal caps** — the cyclic-graph backstop. A delegates edge whose cap is
4692
4625
  * exhausted REFUSES further traversals (fail loud), so a cycle cannot spin the pool dry.
4693
4626
  *
4694
- * ORACLES ARE ENVIRONMENT, NEVER NODES. Graders/verifiers must not be addressable in the graph —
4695
- * an edge to them leaks the rubric. Analysts (`analyzes` edges) are LENSES from the environment's
4696
- * registry reading trace evidence; they are not nodes either, and a graph that names a node id as
4697
- * its analyst is refused.
4627
+ * ORACLES ARE ENVIRONMENT, NEVER WORKERS. Graders/verifiers must not be spawnable in the graph —
4628
+ * a delegates edge to them leaks the rubric. An `analyzes` edge names its analyst in one of two
4629
+ * forms: a LENS id from the environment's registry (a pure function over trace evidence), or the
4630
+ * id of a graph NODE — a tool-equipped analyst AGENT spawned on each matching settle with the
4631
+ * node's pinned profile, whose settle output IS the findings. Either way the oracle doctrine
4632
+ * holds: an analyst node can never be a delegates target (refused loudly), so no driver can hand
4633
+ * it work, and an id living in both the registry and the nodes is refused as ambiguous.
4698
4634
  *
4699
4635
  * @experimental
4700
4636
  */
@@ -4753,16 +4689,24 @@ function validateGraph(graph, registry, analysts) {
4753
4689
  const root = requireNode(roots[0], "root resolution");
4754
4690
  for (const edge of delegates) if (edge.from !== root.id) throw new ValidationError(`runGraph: ${edgeId(edge)} delegates from a non-root node — P0 executes one driver over its workers (the 2-node cyclic case, star-generalized); deeper delegation is P3`);
4755
4691
  const analystIds = /* @__PURE__ */ new Set();
4692
+ const analystNodes = /* @__PURE__ */ new Map();
4756
4693
  for (const edge of analyzes) {
4757
4694
  if (analystIds.has(edge.analyst)) throw new ValidationError(`runGraph: two analyzes edges share analyst '${edge.analyst}' — one analyzes edge per analyst lens (traversals are ledgered by analyst id; a second edge would silently absorb the first's). Register the lens under a second id for a second edge.`);
4758
4695
  analystIds.add(edge.analyst);
4759
- if (byId.has(edge.analyst)) throw new ValidationError(`runGraph: ${edgeId(edge)} names node '${edge.analyst}' as its analyst — oracles and analysts are ENVIRONMENT, never nodes; pass a lens id from RunGraphOptions.analysts`);
4760
- if (!analysts) throw new ValidationError(`runGraph: ${edgeId(edge)} needs RunGraphOptions.analysts (the lens registry its analyst resolves against)`);
4761
- if (!analysts.kinds.some((kind) => kind.id === edge.analyst)) throw new ValidationError(`runGraph: ${edgeId(edge)} analyst '${edge.analyst}' is not in the analysts registry (known: ${analysts.kinds.map((kind) => kind.id).join(", ") || "none"})`);
4696
+ const analystNode = byId.get(edge.analyst);
4697
+ const inRegistry = analysts?.kinds.some((kind) => kind.id === edge.analyst) === true;
4698
+ if (analystNode !== void 0 && inRegistry) throw new ValidationError(`runGraph: ${edgeId(edge)} analyst '${edge.analyst}' is BOTH a graph node and a lens in the analysts registry the id alone distinguishes the two analyst forms, so this is ambiguous; rename the node or register the lens under another id`);
4699
+ if (analystNode !== void 0) {
4700
+ if (analystNode.id === root.id) throw new ValidationError(`runGraph: ${edgeId(edge)} names the ROOT as its analyst — the root is the driver; give the analyst its own node with no delegates edge pointing at it`);
4701
+ if (delegatedTo.has(analystNode.id)) throw new ValidationError(`runGraph: ${edgeId(edge)} names node '${edge.analyst}' as its analyst, but that node is a delegates target — oracle doctrine: an analyst is never delegated to. An analyst NODE is legal only with NO delegates edge pointing at it; give the analyst its own delegates-free node or pass a lens id from RunGraphOptions.analysts.`);
4702
+ analystNodes.set(analystNode.id, analystNode);
4703
+ } else if (!analysts) throw new ValidationError(`runGraph: ${edgeId(edge)} analyst '${edge.analyst}' is not a graph node, and no RunGraphOptions.analysts registry was provided to resolve it as a lens`);
4704
+ else if (!inRegistry) throw new ValidationError(`runGraph: ${edgeId(edge)} analyst '${edge.analyst}' is neither a graph node nor in the analysts registry (known lenses: ${analysts.kinds.map((kind) => kind.id).join(", ") || "none"})`);
4762
4705
  if (edge.over.length === 0) throw new ValidationError(`runGraph: ${edgeId(edge)} must analyze at least one node`);
4763
4706
  for (const over of edge.over) requireNode(over, edgeId(edge));
4764
4707
  requireNode(edge.to, edgeId(edge));
4765
4708
  }
4709
+ for (const edge of analyzes) for (const over of edge.over) if (analystNodes.has(over)) throw new ValidationError(`runGraph: ${edgeId(edge)} analyzes '${over}', which is an analyst node — an analyst run settles as a finding, never as a worker, so this edge would silently never fire; analyst nodes are not analyzable`);
4766
4710
  const workers = /* @__PURE__ */ new Map();
4767
4711
  const delegatesByWorker = /* @__PURE__ */ new Map();
4768
4712
  for (const edge of delegates) {
@@ -4770,12 +4714,13 @@ function validateGraph(graph, registry, analysts) {
4770
4714
  delegatesByWorker.set(edge.to, edge);
4771
4715
  workers.set(edge.to, requireNode(edge.to, edgeId(edge)));
4772
4716
  }
4773
- for (const node of graph.nodes) if (node.id !== root.id && !workers.has(node.id)) throw new ValidationError(`runGraph: node '${node.id}' has no delegates edge to it — an unreachable node never runs`);
4717
+ for (const node of graph.nodes) if (node.id !== root.id && !workers.has(node.id) && !analystNodes.has(node.id)) throw new ValidationError(`runGraph: node '${node.id}' has no delegates edge to it — an unreachable node never runs`);
4774
4718
  return {
4775
4719
  root,
4776
4720
  workers,
4777
4721
  delegatesByWorker,
4778
- analyzes
4722
+ analyzes,
4723
+ analystNodes
4779
4724
  };
4780
4725
  }
4781
4726
  const byteLength = (text) => Buffer.byteLength(text, "utf8");
@@ -4797,7 +4742,7 @@ function stringifyPayload(payload) {
4797
4742
  */
4798
4743
  function runGraph(graph, opts) {
4799
4744
  const registry = opts.registry ?? kernelPromptRegistry();
4800
- const { root, workers, delegatesByWorker, analyzes } = validateGraph(graph, registry, opts.analysts);
4745
+ const { root, workers, delegatesByWorker, analyzes, analystNodes } = validateGraph(graph, registry, opts.analysts);
4801
4746
  if (!opts.backend && !opts.makeWorkerAgent) throw new ValidationError("runGraph: provide opts.backend (where nodes run) or opts.makeWorkerAgent");
4802
4747
  const journal = opts.journal ?? new InMemorySpawnJournal();
4803
4748
  const blobs = opts.blobs ?? new InMemoryResultBlobStore();
@@ -4848,6 +4793,11 @@ function runGraph(graph, opts) {
4848
4793
  const pendingByAssignment = /* @__PURE__ */ new Map();
4849
4794
  const graphWorker = (authoredProfile, spawnContext) => {
4850
4795
  const requested = typeof authoredProfile?.name === "string" ? authoredProfile.name : void 0;
4796
+ if (spawnContext?.analyst !== void 0) {
4797
+ const analystNode = analystNodes.get(spawnContext.analyst);
4798
+ if (!analystNode || requested !== analystNode.id) throw new ValidationError(`runGraph: analyst run for ${JSON.stringify(spawnContext.analyst)} does not name an analyst node of this graph (analyst nodes: ${[...analystNodes.keys()].join(", ") || "none"})`);
4799
+ return makeLeaf(analystNode.profile, spawnContext);
4800
+ }
4851
4801
  const node = requested !== void 0 ? workers.get(requested) : void 0;
4852
4802
  if (!node) throw new ValidationError(`runGraph: spawn_agent named profile ${JSON.stringify(requested)} which is not a worker node of this graph (nodes: ${[...workers.keys()].join(", ")}). Spawn by node id: profile.name selects the node; the node profile itself is pinned by the graph.`);
4853
4803
  const edge = delegatesByWorker.get(node.id);
@@ -4892,16 +4842,26 @@ function runGraph(graph, opts) {
4892
4842
  };
4893
4843
  return makeLeaf(pinned, spawnContext);
4894
4844
  };
4895
- const routes = analyzes.map((edge) => edge.to === root.id ? {
4896
- kind: edge.analyst,
4897
- over: edge.over
4898
- } : {
4899
- kind: edge.analyst,
4900
- over: edge.over,
4901
- to: edge.to,
4902
- directive: registry.resolve(edge.directive).text
4845
+ const routes = analyzes.map((edge) => {
4846
+ const analystNode = analystNodes.get(edge.analyst);
4847
+ if (analystNode) return {
4848
+ kind: edge.analyst,
4849
+ over: edge.over,
4850
+ agent: analystNode.profile,
4851
+ directive: registry.resolve(edge.directive).text,
4852
+ ...edge.to === root.id ? {} : { to: edge.to }
4853
+ };
4854
+ return edge.to === root.id ? {
4855
+ kind: edge.analyst,
4856
+ over: edge.over
4857
+ } : {
4858
+ kind: edge.analyst,
4859
+ over: edge.over,
4860
+ to: edge.to,
4861
+ directive: registry.resolve(edge.directive).text
4862
+ };
4903
4863
  });
4904
- const driverAnalyzesBriefs = analyzes.filter((edge) => edge.to === root.id).map((edge) => `Findings from analyst '${edge.analyst}' (over: ${edge.over.join(", ")}) will arrive as finding events.\n${registry.resolve(edge.directive).text}`);
4864
+ const driverAnalyzesBriefs = analyzes.filter((edge) => edge.to === root.id).map((edge) => analystNodes.has(edge.analyst) ? `Findings from analyst '${edge.analyst}' (a tool-equipped analyst agent node, over: ${edge.over.join(", ")}) will arrive as finding events.` : `Findings from analyst '${edge.analyst}' (over: ${edge.over.join(", ")}) will arrive as finding events.\n${registry.resolve(edge.directive).text}`);
4905
4865
  const graphBrief = [
4906
4866
  "AGENT GRAPH: you are the driver node of a fixed topology. You may spawn ONLY these worker",
4907
4867
  "nodes, by EXACT name (spawn_agent with profile: { name: '<node id>' }; the node's full",
@@ -5013,10 +4973,11 @@ function runGraph(graph, opts) {
5013
4973
  runId,
5014
4974
  hooks,
5015
4975
  onCoordinationEvent,
5016
- ...routes.length > 0 && opts.analysts ? {
5017
- analysts: opts.analysts,
5018
- analyzeOnSettle: routes
4976
+ ...routes.length > 0 ? {
4977
+ analyzeOnSettle: routes,
4978
+ ...opts.analysts ? { analysts: opts.analysts } : {}
5019
4979
  } : {},
4980
+ ...opts.watchWorkers ? { watchWorkers: opts.watchWorkers } : {},
5020
4981
  ...opts.router ? { router: opts.router } : {},
5021
4982
  ...opts.brain ? { brain: opts.brain } : {},
5022
4983
  ...authorizeMessage ? { authorizeMessage } : {},
@@ -6189,6 +6150,6 @@ function tail(s) {
6189
6150
  return s.slice(-400);
6190
6151
  }
6191
6152
  //#endregion
6192
- export { panel as $, runStrategyEvolution as A, defaultAuditorInstruction as At, equalKOnCost as B, secretEnvOfMcpServer as Bt, GraphEdgeCapError as C, leaderboard as Ct, streamAgentTurn as D, renderLeaderboardSvg as Dt, collectAgentTurn as E, renderLeaderboardMarkdown as Et, SandboxRunAbortError as F, sanitizeMcpToolSchema as Ft, createShapeRegistry as G, definePersona as H, openSandboxRun as I, envKeyProvider as It, InMemoryCorpus as J, registerShape as K, printBenchmarkReport as L, mcpSecretEnvMetadataKey as Lt, assertStrategyContract as M, connectStdioMcp as Mt, authorStrategy as N, materializeLocalMcp as Nt, discriminatingMeans as O, renderPairwiseMarkdown as Ot, strategyAuthorContract as P, createMcpEnvironment as Pt, loopUntil as Q, runBenchmark as R, resolveMcpServerLaunch as Rt, runCoderChecks as S, stopSentinel as St, runGraph as T, renderLeaderboardHtml as Tt, runPersonified as U, trajectoryReport as V, builtinShapes as W, fanout as X, renderCorpusToInstructions as Y, flatWidenGate as Z, settledWorkerOut as _, loopCampaignDispatch as _t, localShell as a, buildSteerContext as at, analyzeTrace as b, deterministicCompletion as bt, createVerifierEnvironment as c, inProcessSandboxClient as ct, worktreeFanout as d, dumbDriver as dt, pipeline as et, EVIDENCE_MAX_CHARS as f, naiveDriver as ft, composeWorkerEvidence as g, inlineSandboxClient as gt, closingWorkerNote as h, localSandboxClient as ht, jjWorkspace as i, assertTraceDerivedFindings as it, selectChampion as j, McpSpawnFault as jt, pickChampion as k, auditIntent as kt, failuresAnalyst as l, harvestCorpus as lt, VERIFY_TAIL_CHARS as m, resolveSandboxClient as mt, makeFinding$1 as n, verify as nt, runInWorkspace as o, createScopeAnalyst as ot, NOTE_MAX_CHARS as p, steeringDriver as pt, FileCorpus as q, gitWorkspace as r, widen as rt, createWaterfallCollector as s, registryScopeAnalyst as st, computeFindingId$1 as t, selectValidWinner as tt, superviseSurface as u, defineLeaderboard as ut, copyUntrackedIntoClone as v, loopDispatch as vt, defaultEdgeTraversalCap as w, pairwiseSignificance as wt, patchDelivered as x, sentinelCompletion as xt, withUntrackedArtifacts as y, completionAuthorizes as yt, promotionGate as z, resolveSecretEnv as zt };
6153
+ export { panel as $, runStrategyEvolution as A, materializeLocalMcp as At, equalKOnCost as B, GraphEdgeCapError as C, renderLeaderboardMarkdown as Ct, streamAgentTurn as D, defaultAuditorInstruction as Dt, collectAgentTurn as E, auditIntent as Et, SandboxRunAbortError as F, resolveMcpServerLaunch as Ft, createShapeRegistry as G, definePersona as H, openSandboxRun as I, resolveSecretEnv as It, InMemoryCorpus as J, registerShape as K, printBenchmarkReport as L, secretEnvOfMcpServer as Lt, assertStrategyContract as M, sanitizeMcpToolSchema as Mt, authorStrategy as N, envKeyProvider as Nt, discriminatingMeans as O, McpSpawnFault as Ot, strategyAuthorContract as P, mcpSecretEnvMetadataKey as Pt, loopUntil as Q, runBenchmark as R, runCoderChecks as S, renderLeaderboardHtml as St, runGraph as T, renderPairwiseMarkdown as Tt, runPersonified as U, trajectoryReport as V, builtinShapes as W, fanout as X, renderCorpusToInstructions as Y, flatWidenGate as Z, settledWorkerOut as _, deterministicCompletion as _t, localShell as a, buildSteerContext as at, analyzeTrace as b, leaderboard as bt, createVerifierEnvironment as c, inProcessSandboxClient as ct, worktreeFanout as d, resolveSandboxClient as dt, pipeline as et, EVIDENCE_MAX_CHARS as f, localSandboxClient as ft, composeWorkerEvidence as g, completionAuthorizes as gt, closingWorkerNote as h, loopDispatch as ht, jjWorkspace as i, assertTraceDerivedFindings as it, selectChampion as j, createMcpEnvironment as jt, pickChampion as k, connectStdioMcp as kt, failuresAnalyst as l, harvestCorpus as lt, VERIFY_TAIL_CHARS as m, loopCampaignDispatch as mt, makeFinding$1 as n, verify as nt, runInWorkspace as o, createScopeAnalyst as ot, NOTE_MAX_CHARS as p, inlineSandboxClient as pt, FileCorpus as q, gitWorkspace as r, widen as rt, createWaterfallCollector as s, registryScopeAnalyst as st, computeFindingId$1 as t, selectValidWinner as tt, superviseSurface as u, defineLeaderboard as ut, copyUntrackedIntoClone as v, sentinelCompletion as vt, defaultEdgeTraversalCap as w, renderLeaderboardSvg as wt, patchDelivered as x, pairwiseSignificance as xt, withUntrackedArtifacts as y, stopSentinel as yt, promotionGate as z };
6193
6154
 
6194
- //# sourceMappingURL=runtime-DZblIf3R.js.map
6155
+ //# sourceMappingURL=runtime-BzXz7OjS.js.map