@tangle-network/agent-runtime 0.102.0 → 0.102.2

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 (77) hide show
  1. package/dist/agent.d.ts +1 -1
  2. package/dist/agent.js +5 -3
  3. package/dist/agent.js.map +1 -1
  4. package/dist/analyst-loop.d.ts +1 -1
  5. package/dist/candidate-execution/index.js +5 -4
  6. package/dist/{chunk-SPCD4IQQ.js → chunk-377GOJHJ.js} +2 -2
  7. package/dist/{chunk-LKKIM5QD.js → chunk-3DW5DEKQ.js} +3 -3
  8. package/dist/{chunk-4AMAFNUD.js → chunk-7FJJUC73.js} +311 -40
  9. package/dist/chunk-7FJJUC73.js.map +1 -0
  10. package/dist/{chunk-DA7YL6I4.js → chunk-CK76OZPM.js} +3 -3
  11. package/dist/{chunk-KSBUSEUA.js → chunk-EKUMRQNR.js} +2 -2
  12. package/dist/{chunk-23Z7N5IG.js → chunk-J6V6DWWS.js} +5 -5
  13. package/dist/{chunk-AIBIRAJ6.js → chunk-KSM6GFHP.js} +2 -2
  14. package/dist/chunk-L5DST3QC.js +351 -0
  15. package/dist/chunk-L5DST3QC.js.map +1 -0
  16. package/dist/{chunk-TGDHHHH4.js → chunk-LJLG734E.js} +12 -253
  17. package/dist/chunk-LJLG734E.js.map +1 -0
  18. package/dist/{chunk-MAONWP4R.js → chunk-QCXD7NHM.js} +611 -1419
  19. package/dist/chunk-QCXD7NHM.js.map +1 -0
  20. package/dist/chunk-ROILMKDL.js +1338 -0
  21. package/dist/chunk-ROILMKDL.js.map +1 -0
  22. package/dist/{chunk-N2CEE5Q3.js → chunk-SCOHHMKU.js} +3 -3
  23. package/dist/chunk-SQ3ZJH3Y.js +3082 -0
  24. package/dist/chunk-SQ3ZJH3Y.js.map +1 -0
  25. package/dist/chunk-UPWGXKXB.js +254 -0
  26. package/dist/chunk-UPWGXKXB.js.map +1 -0
  27. package/dist/{chunk-KVJQV342.js → chunk-ZUCUAFVF.js} +26 -1778
  28. package/dist/chunk-ZUCUAFVF.js.map +1 -0
  29. package/dist/{completion-gate-C80jiRfN.d.ts → completion-gate-C6dhVN-N.d.ts} +2 -2
  30. package/dist/{coordination-BFE3Den7.d.ts → coordination-D9l_YmwW.d.ts} +6 -6
  31. package/dist/environment-provider.d.ts +2 -2
  32. package/dist/{improve-CIml6hT3.d.ts → improve-B40dRu0X.d.ts} +40 -19
  33. package/dist/index.d.ts +329 -21
  34. package/dist/index.js +541 -137
  35. package/dist/index.js.map +1 -1
  36. package/dist/intelligence.d.ts +5 -5
  37. package/dist/intelligence.js +7 -5
  38. package/dist/intelligence.js.map +1 -1
  39. package/dist/knowledge.d.ts +8 -8
  40. package/dist/knowledge.js +9 -7
  41. package/dist/{local-harness-ZqCx51u7.d.ts → local-harness-CtK9dSny.d.ts} +14 -2
  42. package/dist/{loop-runner-bin-Cn1N2rRo.d.ts → loop-runner-bin-PnWslIw4.d.ts} +2 -2
  43. package/dist/loop-runner-bin.d.ts +6 -6
  44. package/dist/loop-runner-bin.js +6 -4
  45. package/dist/loops.d.ts +231 -460
  46. package/dist/loops.js +58 -37
  47. package/dist/mcp/bin.js +2 -2
  48. package/dist/mcp/index.d.ts +184 -12
  49. package/dist/mcp/index.js +31 -9
  50. package/dist/mcp/index.js.map +1 -1
  51. package/dist/mcp/memory-bin.d.ts +1 -0
  52. package/dist/mcp/memory-bin.js +22 -0
  53. package/dist/mcp/memory-bin.js.map +1 -0
  54. package/dist/profiles.d.ts +3 -3
  55. package/dist/structural-rollout-D7xik9XR.d.ts +446 -0
  56. package/dist/{substrate-DO2GHNg2.d.ts → substrate-Dyiqmd3o.d.ts} +1 -1
  57. package/dist/{supervise-BLPI50-w.d.ts → supervise-BQdNAXtK.d.ts} +4 -4
  58. package/dist/testing.js +10 -8
  59. package/dist/testing.js.map +1 -1
  60. package/dist/{types-B3vAW0Oq.d.ts → types-CLat4bT9.d.ts} +1 -1
  61. package/dist/{types-CmnA2iL3.d.ts → types-D870JlH0.d.ts} +2 -2
  62. package/dist/{worktree-fanout-DCA3G4bO.d.ts → worktree-fanout-DsIR4d6w.d.ts} +234 -234
  63. package/package.json +4 -3
  64. package/dist/chunk-4AMAFNUD.js.map +0 -1
  65. package/dist/chunk-IKGCKPDX.js +0 -1115
  66. package/dist/chunk-IKGCKPDX.js.map +0 -1
  67. package/dist/chunk-KVJQV342.js.map +0 -1
  68. package/dist/chunk-MAONWP4R.js.map +0 -1
  69. package/dist/chunk-TGDHHHH4.js.map +0 -1
  70. package/dist/{chunk-SPCD4IQQ.js.map → chunk-377GOJHJ.js.map} +0 -0
  71. package/dist/{chunk-LKKIM5QD.js.map → chunk-3DW5DEKQ.js.map} +0 -0
  72. package/dist/{chunk-DA7YL6I4.js.map → chunk-CK76OZPM.js.map} +0 -0
  73. package/dist/{chunk-KSBUSEUA.js.map → chunk-EKUMRQNR.js.map} +0 -0
  74. package/dist/{chunk-23Z7N5IG.js.map → chunk-J6V6DWWS.js.map} +0 -0
  75. package/dist/{chunk-AIBIRAJ6.js.map → chunk-KSM6GFHP.js.map} +0 -0
  76. package/dist/{chunk-N2CEE5Q3.js.map → chunk-SCOHHMKU.js.map} +0 -0
  77. package/dist/{sanitize-BTSsdBXw.d.ts → sanitize-DEbPNtyI.d.ts} +58 -58
package/dist/loops.d.ts CHANGED
@@ -2,29 +2,31 @@ import { ChatClient, RunRecord, HarnessType, AgentProfile, MaximumCharge, Analys
2
2
  export { AnalystFinding, DefaultVerdict, computeFindingId, makeFinding } from '@tangle-network/agent-eval';
3
3
  import { SandboxEvent, SandboxInstance, CreateSandboxOptions, PromptOptions, TaskOptions } from '@tangle-network/sandbox';
4
4
  export { AgentProfile, CreateSandboxOptions, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
5
- import { a as ResultBlobStore, f as SpawnJournal, N as NodeId, j as SpawnEvent, E as ExecutorFactory, A as Agent, B as Budget, S as Scope, h as Settled, b as SupervisedResult, i as Spend, U as UsageEvent, e as ExecutorRegistry, k as Supervisor } from './types-CmnA2iL3.js';
6
- export { d as AgentSpec, c as Executor, l as ExecutorContext, m as ExecutorResult, R as Runtime, n as SupervisorOpts, T as TreeView, W as WidenGate } from './types-CmnA2iL3.js';
7
- import { M as MakeWorkerAgent, A as AnalystRegistry, o as CoordinationTools, n as CoordinationEvent, as as QuestionPolicy, E as ExecutorConfig } from './coordination-BFE3Den7.js';
8
- export { bh as BusEvent, bi as BusRecord, bj as BusStats, bk as EventBus, bl as ProviderSeam, bm as PublishOptions, bn as cliWorktreeExecutor, bo as createEventBus, bp as createExecutor, bq as createExecutorRegistry } from './coordination-BFE3Den7.js';
9
- import { R as RuntimeHooks, I as Iteration, S as SandboxClient, D as Driver, A as AgentRunSpec, O as OutputAdapter, V as Validator, E as ExecCtx, t as LoopWinner, u as LoopLineageOptions, v as LoopResult, L as LoopTokenUsage, M as MountRecorder, w as SelectionReceipt } from './types-B3vAW0Oq.js';
10
- export { x as LoopDecisionPayload, y as LoopEndedPayload, z as LoopIterationDispatchPayload, B as LoopIterationEndedPayload, C as LoopIterationStartedPayload, F as LoopPlanDescription, G as LoopPlanPayload, a as LoopSandboxPlacement, H as LoopStartedPayload, J as LoopTeardownFailedPayload, r as LoopTraceEmitter, b as LoopTraceEvent, K as MountManifestEntry, N as RunProvenance, P as ValidationCtx } from './types-B3vAW0Oq.js';
5
+ import { a as ResultBlobStore, g as SpawnJournal, N as NodeId, j as SpawnEvent, E as ExecutorFactory, A as Agent, B as Budget, d as Settled, S as Scope, b as SupervisedResult, e as Spend, U as UsageEvent, h as ExecutorRegistry, k as Supervisor } from './types-D870JlH0.js';
6
+ export { f as AgentSpec, c as Executor, l as ExecutorContext, m as ExecutorResult, R as Runtime, n as SupervisorOpts, T as TreeView, W as WidenGate } from './types-D870JlH0.js';
7
+ import { M as MakeWorkerAgent, A as AnalystRegistry, o as CoordinationTools, n as CoordinationEvent, as as QuestionPolicy, E as ExecutorConfig } from './coordination-D9l_YmwW.js';
8
+ export { bh as BusEvent, bi as BusRecord, bj as BusStats, bk as EventBus, bl as ProviderSeam, bm as PublishOptions, bn as cliWorktreeExecutor, bo as createEventBus, bp as createExecutor, bq as createExecutorRegistry } from './coordination-D9l_YmwW.js';
9
+ import { R as RuntimeHooks, I as Iteration, S as SandboxClient, D as Driver, A as AgentRunSpec, O as OutputAdapter, V as Validator, E as ExecCtx, u as LoopWinner, v as LoopLineageOptions, w as LoopResult, L as LoopTokenUsage, M as MountRecorder } from './types-CLat4bT9.js';
10
+ export { x as LoopDecisionPayload, y as LoopEndedPayload, z as LoopIterationDispatchPayload, B as LoopIterationEndedPayload, C as LoopIterationStartedPayload, F as LoopPlanDescription, G as LoopPlanPayload, b as LoopSandboxPlacement, H as LoopStartedPayload, J as LoopTeardownFailedPayload, d as LoopTraceEmitter, c as LoopTraceEvent, K as MountManifestEntry, N as RunProvenance, a as SelectionReceipt, P as ValidationCtx } from './types-CLat4bT9.js';
11
11
  import { RunProfileMatrixResult, Scenario, ProfileDispatchFn, JudgeConfig, RunProfileMatrixOptions, DispatchFn } from '@tangle-network/agent-eval/campaign';
12
12
  export { AgentEnvironmentProviderRef, AgentEnvironmentProviderRegistry, ProviderAsSandboxClientOptions, ProviderExecutorOptions, SandboxClientProviderOptions, createAgentEnvironmentProviderRegistry, providerAsExecutor, providerAsSandboxClient, resolveAgentEnvironmentProvider, sandboxClientAsProvider } from './environment-provider.js';
13
- import { C as CorpusRecord, c as Corpus, O as Outcome, S as ScopeAnalyzeInput, d as AssertTraceDerivedFindings, e as SteerContext, f as ScopeAnalyst, F as FanoutOptions, g as CombinatorShape, h as ScopeWidenGate, L as LoopUntilSpec, P as PanelSpec, i as PipelineStage, W as WinnerStrategy, j as FanoutWinnerSelector, V as VerifySpec, k as WidenSpec, l as CorpusFilter, R as RenderCorpusToInstructionsOptions, D as DefinePersonaInput, m as Persona, n as RunPersonifiedOptions, o as ShapeRegistry, p as LoopShape, E as EqualKArm, q as EqualKOnCostOptions, r as EqualKVerdict, T as TrajectoryReportOptions, s as TrajectoryReport } from './worktree-fanout-DCA3G4bO.js';
14
- export { A as AuthoredHarness, t as DefinePersona, u as EqualKOnCost, v as Fanout, w as FanoutSynthesis, x as FlatWidenGate, y as LoopUntil, z as LoopUntilState, B as Panel, G as PanelJudge, H as PanelVerdict, I as PatchDeliverableOptions, J as PersonaContext, K as PersonaExecutors, M as Pipeline, N as RenderCorpusToInstructions, Q as RunPersonified, U as ShapeBudget, X as ShapeContext, Y as TrajectoryNode, Z as TrajectoryReportFn, _ as Verify, $ as Widen, a0 as WidenDecision, a1 as WidenLineage, a2 as WorktreeCliExecutorOptions, a as WorktreeFanoutOptions, b as WorktreePatchArtifact, a3 as createWorktreeCliExecutor, a4 as patchDelivered, a5 as worktreeFanout } from './worktree-fanout-DCA3G4bO.js';
13
+ import { c as CorpusRecord, C as Corpus, S as ScopeAnalyzeInput, d as AssertTraceDerivedFindings, O as Outcome, e as SteerContext, f as ScopeAnalyst, F as FanoutOptions, g as CombinatorShape, h as ScopeWidenGate, L as LoopUntilSpec, P as PanelSpec, i as PipelineStage, W as WinnerStrategy, j as FanoutWinnerSelector, V as VerifySpec, k as WidenSpec, l as CorpusFilter, R as RenderCorpusToInstructionsOptions, D as DefinePersonaInput, m as Persona, n as RunPersonifiedOptions, o as ShapeRegistry, p as LoopShape, E as EqualKArm, q as EqualKOnCostOptions, r as EqualKVerdict, T as TrajectoryReportOptions, s as TrajectoryReport } from './worktree-fanout-DsIR4d6w.js';
14
+ export { A as AuthoredHarness, t as DefinePersona, u as EqualKOnCost, v as Fanout, w as FanoutSynthesis, x as FlatWidenGate, y as LoopUntil, z as LoopUntilState, B as Panel, G as PanelJudge, H as PanelVerdict, I as PatchDeliverableOptions, J as PersonaContext, K as PersonaExecutors, M as Pipeline, N as RenderCorpusToInstructions, Q as RunPersonified, U as ShapeBudget, X as ShapeContext, Y as TrajectoryNode, Z as TrajectoryReportFn, _ as Verify, $ as Widen, a0 as WidenDecision, a1 as WidenLineage, a2 as WorktreeCliExecutorOptions, a as WorktreeFanoutOptions, b as WorktreePatchArtifact, a3 as createWorktreeCliExecutor, a4 as patchDelivered, a5 as worktreeFanout } from './worktree-fanout-DsIR4d6w.js';
15
+ import { AgentProfileMcpServer, AgentProfile as AgentProfile$1, AgentProfileSecurityPolicy } from '@tangle-network/agent-interface';
16
+ import { A as AgenticSurface, a as AgenticTask, b as AgenticOptions, c as Strategy, d as ArtifactHandle, e as SurfaceScore, f as AgenticTool } from './structural-rollout-D7xik9XR.js';
17
+ export { g as AgenticRunResult, C as CheckExecChannel, h as CheckOutcome, i as CheckRunContext, j as CheckRunner, k as CheckSource, l as CheckSourceCtx, m as CorpusReadbackOptions, R as RepairStop, n as RunAgenticOptions, o as ShotPersona, p as ShotSpec, q as StrategyCtx, r as StrategyResult, s as StructuralRolloutConfig, S as StructuralRolloutPolicy, t as StructuralRolloutResult, V as VisibleCheck, u as adaptiveRefine, v as breadthStrategy, w as canDisplace, x as compareCheckOutcomes, y as composeCheckSources, z as defaultExtractCandidate, B as defaultStructuralRolloutPolicy, D as defineStrategy, E as depthStrategy, F as filterAuthoredAsserts, G as modelAuthoredChecks, H as officialChecksFromMeta, I as refine, J as resolveEntrySymbol, K as runAgentic, L as sample, M as sampleThenRefine, N as sandboxCheckRunner, O as selectBestIndex, P as structuralRollout, Q as visibleCheckScore } from './structural-rollout-D7xik9XR.js';
15
18
  import { b as AnalystRegistryLike } from './types-CmYCMbFT.js';
16
- import { AgentProfile as AgentProfile$1 } from '@tangle-network/agent-interface';
17
- import { R as RouterConfig, T as ToolLoopChat, a as ToolLoopCompactionOptions } from './sanitize-BTSsdBXw.js';
18
- export { j as RouterChatResult, k as RouterChatToolsResult, l as RouterToolCall, m as RouterToolLoopResult, n as ToolLoopCompaction, b as ToolSpec, r as routerBrain, o as routerChatWithTools, p as routerChatWithUsage, q as routerToolLoop } from './sanitize-BTSsdBXw.js';
19
+ import { R as RouterConfig, T as ToolLoopChat, a as ToolLoopCompactionOptions } from './sanitize-DEbPNtyI.js';
20
+ export { j as RouterChatResult, k as RouterChatToolsResult, l as RouterToolCall, m as RouterToolLoopResult, n as ToolLoopCompaction, b as ToolSpec, r as routerBrain, o as routerChatWithTools, p as routerChatWithUsage, q as routerToolLoop } from './sanitize-DEbPNtyI.js';
19
21
  import { R as RuntimeStreamEvent, c as AgentExecutionBackend, f as AgentTaskStatus, B as BackendErrorDetail } from './types-BwoZWq-i.js';
20
- import { D as DeliverableSpec } from './completion-gate-C80jiRfN.js';
21
- export { g as WorktreeCommandResult, h as WorktreeProfileMaterializationReceipt, i as gateOnDeliverable } from './completion-gate-C80jiRfN.js';
22
- import { S as SupervisorProfile } from './supervise-BLPI50-w.js';
23
- export { D as DriveHarness, a as SuperviseOptions, b as SupervisorAgentDeps, s as supervise, c as supervisorAgent, w as workerFromBackend } from './supervise-BLPI50-w.js';
22
+ import { D as DeliverableSpec } from './completion-gate-C6dhVN-N.js';
23
+ export { g as WorktreeCommandResult, h as WorktreeProfileMaterializationReceipt, i as gateOnDeliverable } from './completion-gate-C6dhVN-N.js';
24
+ import { S as SupervisorProfile } from './supervise-BQdNAXtK.js';
25
+ export { D as DriveHarness, a as SuperviseOptions, b as SupervisorAgentDeps, s as supervise, c as supervisorAgent, w as workerFromBackend } from './supervise-BQdNAXtK.js';
24
26
  import { stuckLoopView, toolWasteView } from '@tangle-network/agent-eval/pipelines';
25
27
  export { AgentEnvironment, AgentEnvironmentCapabilities, AgentEnvironmentEvent, AgentEnvironmentProvider, AgentEnvironmentQuery, AgentEnvironmentStatus, AgentEnvironmentSummary, AgentProfileRef, AgentSession, AgentSessionRef, AgentSessionStatus, AgentTurnInput, AgentTurnResult, CheckpointRef, CheckpointRequest, CreateAgentEnvironmentInput, ExecRequest, ExecResult, ForkRequest, PlacementInfo, ResourceRequest, WorkspaceRequest } from '@tangle-network/agent-interface/environment-provider';
26
- import './substrate-DO2GHNg2.js';
27
- import './local-harness-ZqCx51u7.js';
28
+ import './substrate-Dyiqmd3o.js';
29
+ import './local-harness-CtK9dSny.js';
28
30
  import 'node:child_process';
29
31
  import '@tangle-network/agent-profile-materialize';
30
32
 
@@ -885,6 +887,103 @@ declare function inProcessSandboxClient(options: InProcessSandboxClientOptions):
885
887
  */
886
888
  declare function inlineSandboxClient(factory: ExecutorFactory<unknown>): SandboxClient;
887
889
 
890
+ /**
891
+ * `KeyProvider` — API-key provisioning for adopted external MCP servers.
892
+ *
893
+ * An adopted server (a `connection` artifact, or a `buildableGenerator` remote
894
+ * emit) usually needs a credential. The credential must never ride the profile
895
+ * or the artifact — both are logged, diffed, and stored as audit records — so
896
+ * the profile carries only a DECLARATIVE reference:
897
+ *
898
+ * `profile.mcp[key].metadata[mcpSecretEnvMetadataKey]`
899
+ * = { ENV_VAR_NAME: 'PROVIDER_KEY_NAME', … }
900
+ *
901
+ * and the VALUE is resolved at materialize time (`materializeLocalMcp`'s
902
+ * `keys` option) and injected straight into the spawned server child's env.
903
+ * Values exist only in the child process env — never in the profile, the
904
+ * artifact registry, an error message, or a log line (errors name the KEY
905
+ * NAME only).
906
+ *
907
+ * Fail-closed at every hop: a declared secret with no provider, or a provider
908
+ * that does not hold the named key, THROWS — booting an external server
909
+ * keyless would fail opaquely mid-eval or silently score a broken candidate.
910
+ *
911
+ * `envKeyProvider` is the same-host default: it reads the process env, which
912
+ * the operator loads via dotenvx (the secrets files never touch the repo).
913
+ *
914
+ * >>> REAL SECRET STORES PLUG IN HERE (flagged): the sandbox SDK's
915
+ * `client.secrets` (`SecretsManager.get(name)`) and the platform hub's
916
+ * short-lived capability tokens (`PlatformHubClient.mintToken` →
917
+ * `{ ENV: token }`) both satisfy `KeyProvider` with a one-line adapter; both
918
+ * need a live service, so neither is constructed here.
919
+ */
920
+
921
+ /** Resolve named secrets. The ONE seam every secret store adapts to. */
922
+ interface KeyProvider {
923
+ /** The value for `name`, or `undefined` when this provider does not hold it. */
924
+ get(name: string): Promise<string | undefined>;
925
+ }
926
+ /** The env-backed provider: reads the (dotenvx-loaded) process env. Empty /
927
+ * whitespace-only values count as absent — fail loud, not with a blank key. */
928
+ declare function envKeyProvider(env?: Record<string, string | undefined>): KeyProvider;
929
+ /** The `AgentProfileMcpServer.metadata` key the declarative secret-env map
930
+ * rides under: `{ ENV_VAR_NAME: 'PROVIDER_KEY_NAME' }`. Names only — values
931
+ * are resolved at materialize time and never stored. */
932
+ declare const mcpSecretEnvMetadataKey = "secretEnv";
933
+ /** Read (and validate) a server entry's declared secret-env map, if any.
934
+ * Malformed metadata throws — a half-declared secret must never half-boot. */
935
+ declare function secretEnvOfMcpServer(server: AgentProfileMcpServer): Record<string, string> | undefined;
936
+ /**
937
+ * Resolve a declared secret-env map into the real env entries for a server
938
+ * spawn. Fail-closed: no provider or a missing key throws, naming the KEY
939
+ * NAME only (the value never appears in any message). `label` names the
940
+ * server for the error (e.g. `profile.mcp['exa']`).
941
+ */
942
+ declare function resolveSecretEnv(secretEnv: Record<string, string>, keys: KeyProvider | undefined, label: string): Promise<Record<string, string>>;
943
+
944
+ /**
945
+ * `localSandboxClient` — the SAME-HOST pseudo-box: a `SandboxClient` whose
946
+ * `create()` MATERIALIZES the profile's stdio MCP servers as local child
947
+ * processes (`materializeLocalMcp`) and whose `streamPrompt` drives a real
948
+ * tool loop (`runBrainLoop` over the router brain) with those live tools.
949
+ *
950
+ * Despite the interface name, this does NOT isolate processes. It is only for
951
+ * author-controlled profiles whose local MCP commands a caller explicitly
952
+ * trusts; user- or model-authored code belongs in a real sandbox. `delete()`
953
+ * kills the children.
954
+ *
955
+ * A per-create profile may change the prompt surface. Permission to start a
956
+ * local MCP process applies only when its full canonical bytes match the fixed
957
+ * constructor profile; a different generated profile is refused.
958
+ *
959
+ * Event protocol matches `inlineSandboxClient`: one `llm_call` metering event
960
+ * + one terminal `result` event with finalText/tokenUsage/costUsd.
961
+ */
962
+
963
+ interface LocalSandboxClientOptions {
964
+ /** The worker brain: router chat-completions with tool-calling. All three required. */
965
+ router: {
966
+ baseUrl: string;
967
+ key: string;
968
+ model: string;
969
+ };
970
+ /** Tool-loop turns per prompt. Default 8. */
971
+ maxTurns?: number;
972
+ /** Brain sampling temperature. Default: `routerBrain`'s (0.4). */
973
+ temperature?: number;
974
+ /** Fallback profile when `create(options)` carries none on `backend.profile`. */
975
+ profile?: AgentProfile$1;
976
+ /** Resolves profile-declared MCP secret names at child-process spawn time. */
977
+ keys?: KeyProvider;
978
+ /** Explicit trust decision for the exact `profile` bytes supplied here.
979
+ * Omit to refuse local processes. A permissive policy never transfers to a
980
+ * different per-create profile and provides no host isolation. */
981
+ profileSecurityPolicy?: AgentProfileSecurityPolicy;
982
+ }
983
+ /** A same-host `SandboxClient` adapter with no process isolation. Local MCP is
984
+ * refused unless the caller explicitly supplies a policy that allows it. */
985
+ declare function localSandboxClient(opts: LocalSandboxClientOptions): SandboxClient;
986
+
888
987
  /**
889
988
  *
890
989
  * `runLoop` — the topology-agnostic kernel built atop the sandbox SDK.
@@ -1074,248 +1173,6 @@ declare function loopCampaignDispatch<Task, Output, Decision, TScenario extends
1074
1173
  */
1075
1174
  declare function loopDispatch<Task, Output, Decision, TScenario extends Scenario, TArtifact>(opts: LoopDispatchOptions<Task, Output, Decision, TScenario, TArtifact>): ProfileDispatchFn<TScenario, TArtifact>;
1076
1175
 
1077
- /**
1078
- * The general agentic primitive — sequential (depth) and parallel (breadth) over a shared,
1079
- * checkable artifact, driven through the keystone Supervisor as one recursive `Agent.act`.
1080
- *
1081
- * The domain lives behind ONE seam — `AgenticSurface` (open an artifact, list tools, call a tool,
1082
- * score the artifact, close it). EnterpriseOps implements it (seed a gym DB, MCP tools, SQL
1083
- * verifier); Commit0/AppWorld/terminal-bench implement it the same way (a repo workspace, shell
1084
- * tools, the test suite). The drivers below are domain-blind: they run over any surface.
1085
- *
1086
- * Two shapes, the agent's POMDP rollout as the unit:
1087
- * - DEPTH one persistent artifact carried across shots. Each shot the agent works the tool loop;
1088
- * between shots a trace-analyst (selector≠judge: reads the trajectory, never the score)
1089
- * steers the resumed session toward what's unfinished. shot n stands on shot n-1's
1090
- * artifact state + history. This is continuation — long-horizon, same artifact.
1091
- * - BREADTH K independent artifacts, each a fresh rollout, the deployable verifier picks the best.
1092
- *
1093
- * Both are an `Agent` whose `act` spawns leaf shots through `scope.spawn` and reacts via
1094
- * `scope.next()` — so the conserved budget pool meters them (equal-k by construction), the journal
1095
- * records the tree, and the same primitive nests. `runAgentic` runs the chosen driver through
1096
- * `createSupervisor().run`. The leaf (one shot over a handle) is resolved per-spawn from a
1097
- * surface-closed registry — the open `Executor` seam, not bespoke per-benchmark glue.
1098
- */
1099
-
1100
- interface AgenticTask {
1101
- readonly id: string;
1102
- readonly systemPrompt: string;
1103
- readonly userPrompt: string;
1104
- /** Opaque domain payload the surface reads (EOPS: servers/verifiers/tools). Drivers never read it. */
1105
- readonly meta?: Record<string, unknown>;
1106
- }
1107
- interface ArtifactHandle {
1108
- readonly id: string;
1109
- readonly surface: string;
1110
- /** Opaque per-artifact context the surface stashes (EOPS: the seeded gym server + db id). */
1111
- readonly ctx?: unknown;
1112
- }
1113
- interface AgenticTool {
1114
- readonly type: 'function';
1115
- readonly function: {
1116
- name: string;
1117
- description?: string;
1118
- parameters: Record<string, unknown>;
1119
- };
1120
- }
1121
- interface SurfaceScore {
1122
- passes: number;
1123
- total: number;
1124
- /** Checks excluded as malformed (data defect, not the agent). `total === 0` ⇒ unscoreable. */
1125
- errored: number;
1126
- }
1127
- /** A stateful, checkable environment an agent operates over with tools. Open behind one interface. */
1128
- interface AgenticSurface {
1129
- readonly name: string;
1130
- open(task: AgenticTask): Promise<ArtifactHandle>;
1131
- tools(task: AgenticTask, handle: ArtifactHandle): Promise<AgenticTool[]>;
1132
- call(handle: ArtifactHandle, name: string, args: Record<string, unknown>): Promise<string>;
1133
- score(task: AgenticTask, handle: ArtifactHandle): Promise<SurfaceScore>;
1134
- close(handle: ArtifactHandle): Promise<void>;
1135
- }
1136
- interface AgenticOptions {
1137
- routerBaseUrl: string;
1138
- routerKey: string;
1139
- model: string;
1140
- /** Optional completion transport (see `RouterConfig.complete`): when set, BOTH legs of an
1141
- * offline run use it instead of `fetch`-ing the router — the worker's tool loop (threaded into
1142
- * its `routerToolLoop` cfg) AND the analyst's critic (its `ChatClient` is bound to this same
1143
- * transport). One injected responder serves both, as a localhost mock endpoint would. Absent ⇒
1144
- * the live router fetch path (the default). */
1145
- complete?: (body: Record<string, unknown>) => Promise<unknown>;
1146
- temperature?: number;
1147
- /** Completion cap per worker turn — REQUIRED for thinking models (they burn unbounded
1148
- * budgets on reasoning and return empty content without it). Omitted ⇒ provider default. */
1149
- maxTokens?: number;
1150
- /** Turns the agent may take within ONE shot before the driver intervenes. */
1151
- innerTurns?: number;
1152
- /** The depth STEERER's analyst instruction (observe()'s system prompt). The knob a
1153
- * prompt optimizer (GEPA) tunes — the analyst IS the steerer. Omitted ⇒ the default. */
1154
- analystInstruction?: string;
1155
- /** The critic's model — lets the analyst be a stronger (or cheaper) model than the
1156
- * worker. Omitted ⇒ the worker's `model`. */
1157
- analystModel?: string;
1158
- /** Across-run learning: when set, the analyst's observe() pass appends trace-derived
1159
- * facts here (the flywheel write side). Read-back is opt-in via `corpusReadback`
1160
- * because unconditional priming can pollute context on some domains. */
1161
- corpus?: Corpus;
1162
- /** Tags written onto learned facts (and used by the caller's priming query). */
1163
- corpusTags?: string[];
1164
- /** In-context learning: when set, query `corpus` before each depth shot and inject
1165
- * the top trace-derived facts as guidance for the active run. No corpus means no read-back. */
1166
- corpusReadback?: CorpusReadbackOptions;
1167
- }
1168
- interface CorpusReadbackOptions {
1169
- /** Minimum confidence for a fact to be injected. Default 0.7. */
1170
- minConfidence?: number;
1171
- /** Extra tags a fact must carry, in addition to `corpusTags`. */
1172
- tags?: ReadonlyArray<string>;
1173
- /** Max facts injected per shot. Default 3. */
1174
- maxFacts?: number;
1175
- /** Default false: only facts tagged `audience:agent` are injected into the worker. */
1176
- includeOperatorFacts?: boolean;
1177
- }
1178
- type Msg$1 = Record<string, unknown>;
1179
- interface ShotResult {
1180
- messages: Msg$1[];
1181
- score: number;
1182
- passes: number;
1183
- total: number;
1184
- completions: number;
1185
- toolErrors: number;
1186
- }
1187
- interface AgenticRunResult {
1188
- /** The strategy name (built-in 'depth'/'breadth' or a custom strategy's name). */
1189
- mode: string;
1190
- score: number;
1191
- resolved: boolean;
1192
- completions: number;
1193
- /** DEPTH: score after each shot — the progress-over-rounds curve. BREADTH: best-so-far per rollout. */
1194
- progression: number[];
1195
- shots: number;
1196
- /** The cost vector, stamped by `runAgentic` from the Supervisor's conserved pool: real
1197
- * router tokens, priced usd (0 when the model is unpriced — never fabricated), wall ms. */
1198
- usd: number;
1199
- ms: number;
1200
- tokens: {
1201
- input: number;
1202
- output: number;
1203
- };
1204
- }
1205
- /** DEPTH: one persistent artifact, carried across analyst-steered shots. */
1206
- declare function depthStrategy(surface: AgenticSurface, task: AgenticTask, opts: AgenticOptions, cfg: {
1207
- maxShots: number;
1208
- }): Agent<unknown, Outcome<unknown>>;
1209
- /** BREADTH: K independent rollouts (each own artifact), verifier picks the best. */
1210
- declare function breadthStrategy(_surface: AgenticSurface, task: AgenticTask, opts: AgenticOptions, cfg: {
1211
- width: number;
1212
- }): Agent<unknown, Outcome<unknown>>;
1213
- /**
1214
- * A Strategy is HOW you spend the compute budget to beat the Environment's check — it
1215
- * builds the driver `Agent` the Supervisor runs. This is the OPEN extension point: a dev
1216
- * authors their own by implementing `driver()` to return an Agent whose `act()` spawns
1217
- * shots/analysts via `scope.spawn` / `scope.next` / `scope.send`. The two built-ins are
1218
- * the reference implementations to copy:
1219
- * sample — K INDEPENDENT attempts, keep the best-verifying (best-of-N / resample).
1220
- * refine — attempt → observe() reads the trace → steer the next → repeat (iterate).
1221
- * (A multi-agent "team" is just a Strategy whose driver spawns several different agents.)
1222
- */
1223
- interface Strategy {
1224
- readonly name: string;
1225
- driver(surface: AgenticSurface, task: AgenticTask, opts: AgenticOptions, budget: number): Agent<unknown, Outcome<unknown>>;
1226
- }
1227
- /** Built-in `Strategy`: K independent attempts, keep the best-verifying (best-of-N / resample). */
1228
- declare const sample: Strategy;
1229
- /** Built-in `Strategy`: attempt → `observe()` reads the trace → steer the next attempt → repeat (deepen one lineage). */
1230
- declare const refine: Strategy;
1231
- /** A role for one shot — multi-agent loops (researcher + engineer, a panel of k
1232
- * researchers) give each shot its own system prompt and optionally its own model. */
1233
- interface ShotPersona {
1234
- /** Replaces the task's systemPrompt for a FRESH shot; on a carried conversation it is
1235
- * injected as a hand-off message (the transcript's earlier roles stay intact). */
1236
- systemPrompt?: string;
1237
- /** Per-shot model override (e.g. a stronger model for the engineer shot). */
1238
- model?: string;
1239
- }
1240
- interface ShotSpec {
1241
- /** present ⇒ continue this artifact (depth); absent ⇒ the shot opens a fresh one (sample/restart). */
1242
- handle?: ArtifactHandle;
1243
- messages?: Msg$1[];
1244
- steer?: string;
1245
- persona?: ShotPersona;
1246
- /** Restrict THIS shot to a subset of the domain's tools (by name) — focus a shot on
1247
- * the relevant capabilities. Restriction-only; unknown names throw. Omitted ⇒ all. */
1248
- tools?: string[];
1249
- }
1250
- interface StrategyResult {
1251
- score: number;
1252
- resolved: boolean;
1253
- completions: number;
1254
- progression: number[];
1255
- shots: number;
1256
- }
1257
- /** Artifact lifecycle a strategy may manage itself — open/close ONLY. Raw `call`/`score`
1258
- * are withheld: scores reach the body solely through `shot()`'s ShotResult (the
1259
- * harness-verified channel), so a body cannot peek the check or fabricate around it. */
1260
- interface StrategyArtifacts {
1261
- readonly name: string;
1262
- open(task: AgenticTask): Promise<ArtifactHandle>;
1263
- close(handle: ArtifactHandle): Promise<void>;
1264
- }
1265
- /** What a strategy body composes with: the artifact lifecycle, the budget, and the two steps. */
1266
- interface StrategyCtx {
1267
- /** Open/close artifacts the body manages itself (e.g. one persistent handle for depth). */
1268
- readonly surface: StrategyArtifacts;
1269
- readonly task: AgenticTask;
1270
- readonly opts: AgenticOptions;
1271
- readonly budget: number;
1272
- readonly scope: Scope<Outcome<unknown>>;
1273
- /** Run ONE worker shot; its harness-scored result, or null if it went down. */
1274
- shot(spec?: ShotSpec): Promise<ShotResult | null>;
1275
- /** The firewalled critic reads the trajectory → a steer string, or null on COMPLETE/down. */
1276
- critique(messages: Msg$1[]): Promise<string | null>;
1277
- /** The RAW analyst channel: the firewalled critic answers `instruction` over the
1278
- * trajectory verbatim — no findings extraction, so verdict-shaped formats
1279
- * (CONTINUE/STOP decisions, calibrated predictions) survive. Same firewall:
1280
- * trajectory in, never scores. Null when the analyst went down. */
1281
- consult(messages: Msg$1[], instruction: string): Promise<string | null>;
1282
- /** The tools THIS artifact's task actually offers (names + descriptions only — never
1283
- * the implementations). Tool sets vary per task on heterogeneous domains; a strategy
1284
- * that restricts shots MUST select from this list, never from hardcoded names. */
1285
- listTools(handle: ArtifactHandle): Promise<Array<{
1286
- name: string;
1287
- description?: string;
1288
- }>>;
1289
- }
1290
- /** Author a Strategy from the composable steps — the open, compact way. */
1291
- declare function defineStrategy(name: string, run: (ctx: StrategyCtx) => Promise<StrategyResult>): Strategy;
1292
- /** A NEW strategy, authored from the steps (~20 lines): refine, but when a steered shot
1293
- * fails to improve the score it ABANDONS that line and restarts fresh (branch-when-stuck)
1294
- * — the widen/MCTS idea the depth-stuck failure motivated. Scored keep-best (the best
1295
- * checkpoint across all lines), the deployable metric. This is the "experts build BETTER
1296
- * optimizations" path: a new technique, compact, with zero Supervisor ceremony. */
1297
- declare const adaptiveRefine: Strategy;
1298
- /** The explore-then-exploit MIX: spend ⌈budget/2⌉ on independent samples (kept open),
1299
- * then refine the best-verifying line with the remaining budget. Sample's basin escape +
1300
- * refine's accumulation — the third built-in, authored from the public steps. */
1301
- declare const sampleThenRefine: Strategy;
1302
- interface RunAgenticOptions extends AgenticOptions {
1303
- surface: AgenticSurface;
1304
- task: AgenticTask;
1305
- /** Lifecycle observability — every spawn/settle (shots, analysts) streams here live.
1306
- * The seam online watchdogs/route-auditors subscribe to. */
1307
- hooks?: RuntimeHooks;
1308
- /** A Strategy (the open way) — author/pass your own. Overrides `mode` when present. */
1309
- strategy?: Strategy;
1310
- /** Built-in shorthand: 'depth'→refine, 'breadth'→sample. Default 'depth'. */
1311
- mode?: 'depth' | 'breadth';
1312
- /** budget: refine→max shots; sample→rollout width. */
1313
- budget: number;
1314
- rootBudget?: Budget;
1315
- }
1316
- /** Run a Strategy through the keystone Supervisor — `Agent.act` over a conserved-budget Scope. */
1317
- declare function runAgentic(opts: RunAgenticOptions): Promise<AgenticRunResult>;
1318
-
1319
1176
  /**
1320
1177
  * runBenchmark — the packaged optimization suite. Define a domain by implementing an
1321
1178
  * `Environment` (open / tools / call / score / close); get the optimization strategies
@@ -1458,6 +1315,10 @@ interface McpEnvironmentOptions {
1458
1315
  /** Cap on a tool result's text fed back to the worker. Default 1500 chars. */
1459
1316
  maxResultChars?: number;
1460
1317
  }
1318
+ /** Coerce an MCP inputSchema to an OpenAI-tool-valid top-level object schema.
1319
+ * Shared with the same-host stdio client (`materializeLocalMcp`) — one coercion
1320
+ * rule for every MCP tool a worker sees, regardless of transport. */
1321
+ declare function sanitizeMcpToolSchema(s: unknown): Record<string, unknown>;
1461
1322
  /** Wrap any MCP server as an `Environment`: `tools/list` becomes `AgenticTool[]` with provider-safe schemas; the domain supplies only the artifact lifecycle hooks. */
1462
1323
  declare function createMcpEnvironment(opts: McpEnvironmentOptions): Environment;
1463
1324
 
@@ -1948,11 +1809,15 @@ declare function reportLoopUsage<Task, Output, Decision>(cost: UsageSink, result
1948
1809
  * through the resumable `bridgeExecutor`.
1949
1810
  * - `backend: 'router'` → OFF-BOX: a router chat-completion as the leaf executor,
1950
1811
  * presented as a `SandboxClient` (no sandbox dependency).
1812
+ * - `backend: 'local'` → SAME-HOST: a router-brain tool loop with the
1813
+ * profile's stdio MCP servers spawned as LOCAL child
1814
+ * processes — the only backend that can reach an MCP
1815
+ * server built into a host worktree.
1951
1816
  */
1952
1817
 
1953
1818
  interface ResolveSandboxClientOptions {
1954
1819
  /** The execution transport for the driven loop. */
1955
- backend: 'sandbox' | 'bridge' | 'router';
1820
+ backend: 'sandbox' | 'bridge' | 'router' | 'local';
1956
1821
  /** `sandbox` backend: the caller's real Sandbox-backed client. Required for that backend. */
1957
1822
  sandboxClient?: SandboxClient;
1958
1823
  /** `bridge` backend: local cli-bridge transport. `bearer` + `model` required. */
@@ -1971,6 +1836,9 @@ interface ResolveSandboxClientOptions {
1971
1836
  key: string;
1972
1837
  model: string;
1973
1838
  };
1839
+ /** `local` backend: same-host pseudo-box — the router brain drives a tool loop
1840
+ * with the profile's stdio MCP servers spawned as local children. */
1841
+ local?: LocalSandboxClientOptions;
1974
1842
  }
1975
1843
  /**
1976
1844
  * Resolve a `SandboxClient` for the chosen backend. The generic, dep-light core
@@ -2504,6 +2372,108 @@ interface OpenSandboxRunOptions {
2504
2372
  */
2505
2373
  declare function openSandboxRun<Out>(client: SandboxClient, options: OpenSandboxRunOptions, deliverable: Deliverable<Out>): Promise<SandboxRun<Out>>;
2506
2374
 
2375
+ /**
2376
+ * Same-host stdio MCP: the ONE persistent newline-delimited JSON-RPC 2.0
2377
+ * connection to a spawned MCP server child process. This is the handshake
2378
+ * `mcpServeVerifier` boots for its probe (`initialize` →
2379
+ * `notifications/initialized` → `tools/list`), extracted so a trusted
2380
+ * same-host consumer can keep the server running and route `tools/call` to it.
2381
+ * This module does not isolate the child: callers must use a real sandbox for
2382
+ * user- or model-authored code.
2383
+ *
2384
+ * Two layers:
2385
+ * - `connectStdioMcp` — spawn ONE server at its cwd, run the real MCP
2386
+ * handshake, return a live connection: the listed tools, `callTool`, `close`.
2387
+ * - `materializeLocalMcp` — spawn EVERY enabled stdio server in
2388
+ * `profile.mcp`, namespace each server's tools as `<server>__<tool>` so
2389
+ * they can share a worker's tool list with a domain surface's tools, and
2390
+ * expose one route/close facade over the set. Fail-CLOSED: a declared
2391
+ * server that cannot boot throws — silently scoring the profile as if it
2392
+ * had no MCP surface would fake the with/without ablation.
2393
+ *
2394
+ * Failure taxonomy (mirrors `commandVerifier`/`mcpServeVerifier`): a missing
2395
+ * start binary or spawn fault is a SETUP bug (`McpSpawnFault` — candidate
2396
+ * graders must rethrow it, never score it); a server that crashes, errors the
2397
+ * handshake, or times out is an ordinary `Error` carrying the stderr tail; a
2398
+ * JSON-RPC error on `tools/call` is the AGENT's outcome — returned as an
2399
+ * `ERROR: …` string, never thrown (the `createMcpEnvironment` convention).
2400
+ *
2401
+ * Protocol matches the runtime's own stdio MCP server (src/mcp/server.ts):
2402
+ * newline-delimited JSON-RPC 2.0, protocol version 2024-11-05.
2403
+ */
2404
+
2405
+ interface StdioMcpServerSpec {
2406
+ /** Command that starts the MCP server (stdio transport). */
2407
+ command: string;
2408
+ args?: string[];
2409
+ /** Working directory the server starts in (a built candidate's worktree, typically). */
2410
+ cwd?: string;
2411
+ /** Declared public env for the server process. Only a minimal non-sensitive
2412
+ * subset of the parent env is inherited. */
2413
+ env?: Record<string, string>;
2414
+ /** Sensitive env for the server process. These values override `env` and are
2415
+ * redacted from child-supplied errors, tool metadata, and tool results. */
2416
+ protectedEnv?: Record<string, string>;
2417
+ /** Handshake AND per-request timeout (ms). Default 30s. */
2418
+ timeoutMs?: number;
2419
+ }
2420
+ /** A missing start binary / spawn fault: a SETUP bug, never a failed candidate.
2421
+ * Graders (the serve verifier) must rethrow this instead of scoring it. */
2422
+ declare class McpSpawnFault extends Error {
2423
+ }
2424
+ interface McpToolDescriptor {
2425
+ name: string;
2426
+ description?: string;
2427
+ inputSchema?: unknown;
2428
+ }
2429
+ interface StdioMcpConnection {
2430
+ /** The tools the server exposed at connect time (`tools/list`). */
2431
+ readonly tools: readonly McpToolDescriptor[];
2432
+ /** `tools/call` → the result's text content. A JSON-RPC error / `isError`
2433
+ * result becomes an `ERROR: …` string (the agent's outcome); a dead
2434
+ * transport or timeout throws (an infra fault). */
2435
+ callTool(name: string, args: Record<string, unknown>): Promise<string>;
2436
+ /** Kill the server child. Idempotent. */
2437
+ close(): Promise<void>;
2438
+ }
2439
+ /** Spawn a trusted host command, complete the stdio MCP handshake, and return
2440
+ * the live connection. This low-level function provides no process isolation. */
2441
+ declare function connectStdioMcp(spec: StdioMcpServerSpec): Promise<StdioMcpConnection>;
2442
+ interface MaterializeLocalMcpOptions {
2443
+ /** Handshake / per-request timeout per server (ms). Default 30s. */
2444
+ timeoutMs?: number;
2445
+ /** Cap on a tool result's text fed back to the worker. Default 2000 chars. */
2446
+ maxResultChars?: number;
2447
+ /** Resolves a server's DECLARED secrets (`metadata.secretEnv`: env var name →
2448
+ * provider key name) at spawn time. The resolved values reach ONLY the child
2449
+ * process env — never the profile, the logs, or an error message. Fail-closed:
2450
+ * a server declaring secrets without a provider (or with a missing key)
2451
+ * throws instead of booting keyless. */
2452
+ keys?: KeyProvider;
2453
+ /** Required trust decision for profiles that declare local MCP processes.
2454
+ * Omit to refuse all profile-controlled host execution. Passing
2455
+ * `allowLocalMcp: true` is only safe for an author-controlled profile: the
2456
+ * process receives this Runtime's filesystem and network privileges. */
2457
+ profileSecurityPolicy?: AgentProfileSecurityPolicy;
2458
+ }
2459
+ /** The live same-host materialization of a profile's `mcp` surface. */
2460
+ interface LocalMcpMaterialization {
2461
+ /** Worker-facing tool specs: namespaced `<server>__<tool>`, provider-safe schemas. */
2462
+ tools: AgenticTool[];
2463
+ /** Whether `name` is one of this materialization's namespaced tools. */
2464
+ owns(name: string): boolean;
2465
+ /** Route a namespaced call to its server's live stdio child. */
2466
+ call(name: string, args: Record<string, unknown>): Promise<string>;
2467
+ /** Kill every spawned server. Idempotent. */
2468
+ close(): Promise<void>;
2469
+ }
2470
+ /**
2471
+ * Spawn every explicitly trusted stdio server in `profile.mcp` as a same-host
2472
+ * child and expose its tools under `<server>__<tool>` names. The default policy
2473
+ * refuses local processes. A profile with no MCP surface returns zero tools.
2474
+ */
2475
+ declare function materializeLocalMcp(profile: AgentProfile$1, opts?: MaterializeLocalMcpOptions): Promise<LocalMcpMaterialization>;
2476
+
2507
2477
  /**
2508
2478
  *
2509
2479
  * Leak-free steering drivers — the non-LLM controls for the driven loop.
@@ -3097,205 +3067,6 @@ declare function streamAgentTurn(backend: AgentTurnBackend, prompt: string, opts
3097
3067
  */
3098
3068
  declare function collectAgentTurn(stream: AsyncIterable<RuntimeStreamEvent>): Promise<CollectedAgentTurn>;
3099
3069
 
3100
- /**
3101
- * structuralRollout — the measured structural lever as a fourth member of the
3102
- * sample/refine/sampleThenRefine strategy family: k independent samples, selection by
3103
- * TASK-VISIBLE checks only, then a guarded self-repair loop steered by the checks'
3104
- * failure output. Design: docs/design/structural-rollout-integration.md; measured basis
3105
- * (bench/src/hev-structural.mts, bench/src/mbpp-structural.mts): +8.5..+21.3pp hidden-test
3106
- * lift across Llama-3-8B/Qwen2.5-7B × HumanEval/MBPP, null only at saturation.
3107
- *
3108
- * Honesty invariants carried over from the proven rigs:
3109
- * - Visible checks are generated from task-visible information only, BEFORE any
3110
- * candidate exists, and FROZEN for every sample and repair round of the task.
3111
- * - OFFICIAL checks (shown in the task itself) rank lexicographically above
3112
- * model-AUTHORED guesses. This ordering is measured, not stylistic: authored guesses
3113
- * run 17–70% wrong depending on model × spec richness, and unweighted they flipped
3114
- * selection NEGATIVE on MBPP (6 noisy guesses outvoting the one reliable check).
3115
- * - A candidate that crashed before the checks could run ranks below one that ran and
3116
- * failed everything.
3117
- * - Repair sees ONLY the checks' failure output, and never displaces a candidate that
3118
- * passes more official checks with one that passes fewer (wrong visible examples
3119
- * poison repair at saturation — the glm /47,/116 regressions).
3120
- *
3121
- * Placement rule: this is an INFERENCE-TIME capability (it wraps the model call via the
3122
- * strategy seam). It does not belong in improve()/selfImprove (training-time); improve()
3123
- * may later tune `StructuralRolloutPolicy` as an optimizable surface.
3124
- */
3125
-
3126
- type Msg = Record<string, unknown>;
3127
- /** The rollout's compute recipe — promoted from the proven rigs' env vars (K/REPAIRS/
3128
- * TESTGEN/DIVERSE/TEMPERATURE). Defaults are the measured sweet spot: repair value
3129
- * concentrates at low k (~+12pp at k=1, +1–3pp at k=5), so `k=5, repairRounds=2` is the
3130
- * full recipe and `k=1, repairRounds=2` the low-compute preset. */
3131
- interface StructuralRolloutPolicy {
3132
- /** Independent samples per task (selection breadth). */
3133
- k: number;
3134
- /** Repair shots after selection, each steered by the checks' failure output. */
3135
- repairRounds: number;
3136
- /** Model-authored visible checks requested per task; 0 disables authoring. */
3137
- testgen: number;
3138
- /** Per-slot strategy-lens prefixes on the k samples (attacks the all-k-fail bucket).
3139
- * Measured as a paired null (+0.6pp) — kept as an optional knob, off by default. */
3140
- diverse?: boolean;
3141
- /** Sampling temperature for every shot of this strategy; omitted ⇒ the worker default. */
3142
- temperature?: number;
3143
- }
3144
- /** The measured default recipe: 5 samples, 2 guarded repair rounds, 6 authored checks. */
3145
- declare const defaultStructuralRolloutPolicy: StructuralRolloutPolicy;
3146
- /** One task-visible executable check (e.g. a single-line Python assert). */
3147
- interface VisibleCheck {
3148
- code: string;
3149
- /** 'official' = shown in the task itself (docstring example, shown assert);
3150
- * 'authored' = the model's own guess. Official outranks authored in selection. */
3151
- kind: 'official' | 'authored';
3152
- }
3153
- /** What a CheckSource composes with. `consult` is the strategy family's raw analyst
3154
- * channel (metered by the conserved pool, offline-injectable via `opts.complete`) —
3155
- * check authoring goes through it rather than a bespoke model client. */
3156
- interface CheckSourceCtx {
3157
- /** Authored-check budget for this task (`policy.testgen`). */
3158
- count: number;
3159
- /** The symbol authored checks must reference; undefined ⇒ authoring is skipped
3160
- * (no guesses beats guesses pinned to nothing). */
3161
- entrySymbol?: string;
3162
- /** One metered LLM call: instruction in, reply text out, null when the channel went
3163
- * down. The task's visible prompt is included by the channel itself. */
3164
- consult(instruction: string): Promise<string | null>;
3165
- }
3166
- /** Produces the task's visible checks. MUST derive them from agent-visible information
3167
- * only, before any candidate exists — the strategy freezes the returned set for every
3168
- * sample and repair round of the task. */
3169
- interface CheckSource {
3170
- generate(task: AgenticTask, ctx: CheckSourceCtx): Promise<VisibleCheck[]>;
3171
- }
3172
- /** The proven authored-assert filter (lifted from the rigs' generateTests): keep only
3173
- * single-line, paren-balanced asserts that reference the entry symbol — malformed lines
3174
- * are dropped here rather than poisoning every candidate's score identically. */
3175
- declare function filterAuthoredAsserts(reply: string, entrySymbol: string, count: number): string[];
3176
- /** Default authored-check source: one metered LLM call per task, before sampling,
3177
- * filtered through `filterAuthoredAsserts`. Returns [] (no signal, never a fabricated
3178
- * check) when the budget is 0, no entry symbol resolves, or the channel went down. */
3179
- declare function modelAuthoredChecks(overrides?: {
3180
- count?: number;
3181
- }): CheckSource;
3182
- /** Official checks the surface stashed on the task (e.g. MBPP's shown assert). Reads
3183
- * `task.meta[key]` as a string array; anything else means no official checks. */
3184
- declare function officialChecksFromMeta(key?: string): CheckSource;
3185
- /** Concatenate check sources (official first by convention — ordering does not affect
3186
- * scoring, which reads each check's `kind`). */
3187
- declare function composeCheckSources(...sources: CheckSource[]): CheckSource;
3188
- /** The symbol authored checks are pinned to: `task.meta.entryPoint` when the surface
3189
- * provides it, else the LAST `def name(` in the visible prompt (a code-completion stub
3190
- * lists helpers first, the entry stub last). Undefined ⇒ authoring is skipped. */
3191
- declare function resolveEntrySymbol(task: AgenticTask): string | undefined;
3192
- /** How one candidate fared against the frozen visible checks, split by check kind. */
3193
- interface CheckOutcome {
3194
- passedOfficial: number;
3195
- totalOfficial: number;
3196
- passedAuthored: number;
3197
- totalAuthored: number;
3198
- /** The checks' failure report — the ONLY feedback the repair loop may see. */
3199
- failureOutput: string;
3200
- /** True when the candidate crashed before any check could run — ranks below a
3201
- * candidate that ran and failed everything. */
3202
- crashed?: boolean;
3203
- }
3204
- /** Minimal exec channel the default runner needs. `SandboxInstance` (and therefore
3205
- * `ValidationCtx.box`) satisfies it structurally. */
3206
- interface CheckExecChannel {
3207
- exec(command: string, options?: {
3208
- timeoutMs?: number;
3209
- }): Promise<{
3210
- exitCode: number;
3211
- stdout: string;
3212
- stderr: string;
3213
- }>;
3214
- }
3215
- interface CheckRunContext {
3216
- task: AgenticTask;
3217
- /** Live exec channel for this run (`ValidationCtx.box` / a sandbox instance). */
3218
- box?: CheckExecChannel;
3219
- signal?: AbortSignal;
3220
- }
3221
- /** Executes the frozen checks against one candidate. Implementations MUST fail loud
3222
- * (throw) when they cannot execute — a silent zero poisons selection. */
3223
- interface CheckRunner {
3224
- run(candidate: string, checks: VisibleCheck[], ctx: CheckRunContext): Promise<CheckOutcome>;
3225
- }
3226
- /** Default CheckRunner backend: pipes the check program into `python3` over the sandbox
3227
- * exec channel (`ctx.box`, or one bound at construction). Never shells out to docker
3228
- * itself — the jail is the sandbox's concern. No channel ⇒ throws; it must never
3229
- * silently score 0. Empty check sets short-circuit to a no-signal outcome (nothing to
3230
- * execute, so no channel is required). */
3231
- declare function sandboxCheckRunner(options?: {
3232
- box?: CheckExecChannel;
3233
- python?: string;
3234
- timeoutMs?: number;
3235
- }): CheckRunner;
3236
- /** The selection order: crash < ran; then official pass-fraction; authored guesses only
3237
- * break ties. Returns > 0 when `a` outranks `b`. Strictly lexicographic — on MBPP,
3238
- * letting 6 noisy guesses outvote the one official check flipped selection negative. */
3239
- declare function compareCheckOutcomes(a: CheckOutcome, b: CheckOutcome): number;
3240
- /** Display scalar for receipts/reports (the rigs' `visibleScore` shape): crash = -1,
3241
- * else official fraction + 0.001 × authored fraction. Selection itself uses the exact
3242
- * lexicographic comparator, never this scalar. */
3243
- declare function visibleCheckScore(o: CheckOutcome): number;
3244
- /** Argmax by `compareCheckOutcomes`, FIRST index wins ties (deterministic; with zero
3245
- * visible coverage every candidate ties at no-signal and index 0 is the blind pick). */
3246
- declare function selectBestIndex(outcomes: ReadonlyArray<CheckOutcome>): number;
3247
- /** The repair keep-best guard: a challenger displaces the incumbent only when it is
3248
- * strictly better in the selection order AND passes at least as many official checks.
3249
- * The raw-count clause is deliberate belt-and-braces over the comparator (a custom
3250
- * runner can report shifted totals): repair must NEVER replace a candidate that passes
3251
- * more official checks with one that passes fewer. */
3252
- declare function canDisplace(challenger: CheckOutcome, incumbent: CheckOutcome): boolean;
3253
- /** The candidate a shot produced, read from its conversation: the LAST `submit_answer`
3254
- * tool-call argument (verifier environments submit the artifact explicitly), else the
3255
- * latest assistant reply's fenced code block — preferring a block containing a `def`,
3256
- * because repair replies echo the failure report in a bare fence BEFORE the fixed code
3257
- * (the rigs' extractRepairCode lesson) — else the latest non-empty assistant text. */
3258
- declare function defaultExtractCandidate(messages: ReadonlyArray<Msg>): string;
3259
- type RepairStop = 'already-passing' | 'no-signal' | 'repaired-pass' | 'rounds-exhausted' | 'no-candidates';
3260
- /** The body's deliverable — a `StrategyResult` plus selection provenance. The extra
3261
- * fields ride through `defineStrategy`'s deliverable spread onto `AgenticRunResult`
3262
- * (score/resolved stay harness-verified, exactly as for every authored strategy). */
3263
- interface StructuralRolloutResult extends StrategyResult {
3264
- /** One receipt per scored candidate (k samples, then repairs), `SelectionReceipt`
3265
- * shaped like the kernel's (`types.ts`), selector 'driver'. */
3266
- selection: SelectionReceipt[];
3267
- repairStop: RepairStop;
3268
- officialChecks: number;
3269
- authoredChecks: number;
3270
- }
3271
- interface StructuralRolloutConfig {
3272
- /** Knobs; missing fields take the measured defaults (k=5, repairRounds=2, testgen=6). */
3273
- policy?: Partial<StructuralRolloutPolicy>;
3274
- /** Where the visible checks come from. Default: official checks from
3275
- * `task.meta.visibleChecks` composed with `modelAuthoredChecks()`. */
3276
- checkSource?: CheckSource;
3277
- /** How candidates are measured. Default `sandboxCheckRunner()` — it needs an exec
3278
- * channel (bind one to the runner, or pass `box` here) and fails loud without one. */
3279
- checkRunner?: CheckRunner;
3280
- /** Exec channel threaded into every check run of this strategy (a sandbox instance /
3281
- * `ValidationCtx.box`). The strategy seam itself carries no sandbox, so the caller
3282
- * who owns one supplies it here or binds it into the runner. */
3283
- box?: CheckExecChannel;
3284
- /** Candidate extraction from a shot's conversation. Default `defaultExtractCandidate`. */
3285
- extractCandidate?: (messages: ReadonlyArray<Msg>) => string;
3286
- }
3287
- /**
3288
- * Build the structuralRollout `Strategy`: k shots → score each by the frozen visible
3289
- * checks (official above authored, crash lowest) → argmax with first-index tie-break →
3290
- * up to `repairRounds` repair shots steered by the failure output, keep-best under the
3291
- * official-check guard. Authored via `defineStrategy`, so the deliverable score stays
3292
- * harness-verified and every shot is metered by the conserved pool.
3293
- *
3294
- * Budget note: `runAgentic`'s `budget` sizes the pool — pass at least
3295
- * `k + repairRounds + 1` so the samples, repairs, and the check-author consult all admit.
3296
- */
3297
- declare function structuralRollout(config?: StructuralRolloutConfig): Strategy;
3298
-
3299
3070
  /**
3300
3071
  *
3301
3072
  * The supervisor's intelligence is AUTHORING the agents it spawns — not pressing buttons.
@@ -4208,4 +3979,4 @@ declare function runInWorkspace<T>(ws: Workspace, body: (cwd: string) => Promise
4208
3979
  commitOnInvalid?: boolean;
4209
3980
  }): Promise<WorkspaceRun<T>>;
4210
3981
 
4211
- export { Agent, AgentRunSpec, type AgentTurnBackend, type AgentTurnUsage, type AgenticOptions, type AgenticRunResult, type AgenticSurface, type AgenticTask, type AgenticTool, AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, type ArtifactHandle, AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckExecChannel, type CheckOutcome, type CheckRunContext, type CheckRunner, type CheckSource, type CheckSourceCtx, type CheckpointCapableBox, type CollectedAgentTurn, CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, CoordinationEvent, type CoordinationMcpHandle, Corpus, CorpusFilter, type CorpusReadbackOptions, CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, DeliverableSpec, Driver, type DriverAgentOptions, type DumbDriverOptions, type Environment, EqualKArm, EqualKOnCostOptions, EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, ExecutorConfig, ExecutorFactory, ExecutorRegistry, FanoutOptions, FanoutWinnerSelector, FileCorpus, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, type InMemoryRunContext, type InMemoryRunContextOptions, InMemorySpawnJournal, type InProcessOnPrompt, type InProcessPromptCtx, type InProcessSandboxClientOptions, type Inbox, type InboxMessage, type IntentAudit, type Interval, Iteration, type Leaderboard, type LeaderboardBenchScore, type LeaderboardBenchTask, type LeaderboardBenchmarkAdapter, type LeaderboardFlagSpec, type LeaderboardIterationInfo, type LeaderboardOptions, type LeaderboardRow, type LeaderboardRunContext, type LeaderboardScenario, type LeaderboardScore, type LeaderboardSpec, type LoopCampaignDispatchOptions, type LoopDispatchOptions, LoopLineageOptions, type LoopOptionsForDispatch, LoopResult, LoopShape, LoopTokenUsage, LoopUntilSpec, LoopWinner, MakeWorkerAgent, type McpEndpoint, type McpEnvironmentOptions, MountRecorder, type NaiveDriverOptions, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, Outcome, OutputAdapter, type PairwiseOptions, type PairwiseVerdict, PanelSpec, Persona, PipelineStage, type ProfileRichness, type ProfileRichnessThresholds, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, RenderCorpusToInstructionsOptions, type RepairStop, type ReservationTicket, type ResolveSandboxClientOptions, ResultBlobStore, RouterConfig, type RunAgenticOptions, RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, type SandboxToolPartState, Scope, ScopeAnalyst, ScopeAnalyzeInput, ScopeWidenGate, SelectionReceipt, type SessionCapableBox, type SessionTraceBox, Settled, ShapeRegistry, type Shell, type ShotPersona, type ShotSpec, Spend, SteerContext, type SteeringDecision, type Strategy, type StrategyCtx, type StrategyEvolutionConfig, type StrategyResult, type StreamAgentTurnOptions, type StructuralRolloutConfig, type StructuralRolloutPolicy, type StructuralRolloutResult, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, SupervisedResult, Supervisor, SupervisorProfile, type SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, ToolLoopChat, ToolLoopCompactionOptions, type TraceSource, type TrajectoryAnalysis, TrajectoryReport, TrajectoryReportOptions, type TurnResult, UsageEvent, type UsageSink, Validator, type VerifierEnvironmentOptions, VerifySpec, type VisibleCheck, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, WidenSpec, WinnerStrategy, type Workspace, type WorkspaceCommit, type WorkspaceRun, acquireSandbox, adaptiveRefine, analyzeTrace, anytimeReport, asAuthoredProfile, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, breadthStrategy, buildSteerContext, builtinShapes, canDisplace, collectAgentTurn, compareCheckOutcomes, completionAuthorizes, composeCheckSources, contentAddress, createBudgetPool, createInMemoryRunContext, createInbox, createMcpEnvironment, createPushTraceSource, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultExtractCandidate, defaultProfileRichnessThresholds, defaultSelectWinner, defaultStructuralRolloutPolicy, defaultToolDetectors, defineLeaderboard, definePersona, defineStrategy, delegate, depthStrategy, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, filterAuthoredAsserts, finalizeBestDelivered, flatWidenGate, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, jjWorkspace, leaderboard, localShell, loopCampaignDispatch, loopDispatch, loopUntil, mapSandboxEvent, mapSandboxToolEvent, modelAuthoredChecks, naiveDriver, observe, officialChecksFromMeta, openSandboxRun, pairwiseSignificance, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, refine, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, reportLoopUsage, resolveEntrySymbol, resolveSandboxClient, runAgentic, runBenchmark, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, sample, sampleThenRefine, sandboxCheckRunner, sandboxSessionTraceSource, selectBestIndex, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, structuralRollout, sumSandboxUsage, superviseSurface, supervisorInstructions, trajectoryReport, verify, visibleCheckScore, watchTrace, widen };
3982
+ export { Agent, AgentRunSpec, type AgentTurnBackend, type AgentTurnUsage, AgenticOptions, AgenticSurface, AgenticTask, AgenticTool, AnalystRegistry, type AnytimeReport, type AnytimeStrategySummary, type AnytimeTaskCurve, type ApplyContinuation, ArtifactHandle, AssertTraceDerivedFindings, type AuditIntentInput, type AuditIntentOptions, type AuthorStrategyOptions, type AuthoredProfile, type AuthoredStrategy, type BenchmarkCell, type BenchmarkConfig, type BenchmarkLift, type BenchmarkReport, type BenchmarkStrategySummary, type BenchmarkTaskRow, Budget, type BudgetPool, type BudgetReadout, type ChampionPick, type ChampionPolicy, type CheckpointCapableBox, type CollectedAgentTurn, CombinatorShape, type CompletionAnalyst, type CompletionEvidence, type CompletionPolicy, type CompletionVerdict, CoordinationEvent, type CoordinationMcpHandle, Corpus, CorpusFilter, CorpusRecord, type CreateScopeAnalystOptions, type CriuCapableClient, DefinePersonaInput, type DefinedLeaderboard, type DelegateOptions, type Deliverable, DeliverableSpec, Driver, type DriverAgentOptions, type DumbDriverOptions, type Environment, EqualKArm, EqualKOnCostOptions, EqualKVerdict, type EvolutionArchiveNode, type EvolutionAuthor, type EvolutionBandInfo, type EvolutionCandidate, type EvolutionGeneration, type EvolutionReport, ExecCtx, ExecutorConfig, ExecutorFactory, ExecutorRegistry, FanoutOptions, FanoutWinnerSelector, FileCorpus, type ForkCapableBox, type GitWorkspaceOptions, type HarvestCorpusOptions, type HarvestFailure, type HarvestReport, InMemoryCorpus, InMemoryResultBlobStore, type InMemoryRunContext, type InMemoryRunContextOptions, InMemorySpawnJournal, type InProcessOnPrompt, type InProcessPromptCtx, type InProcessSandboxClientOptions, type Inbox, type InboxMessage, type IntentAudit, type Interval, Iteration, type KeyProvider, type Leaderboard, type LeaderboardBenchScore, type LeaderboardBenchTask, type LeaderboardBenchmarkAdapter, type LeaderboardFlagSpec, type LeaderboardIterationInfo, type LeaderboardOptions, type LeaderboardRow, type LeaderboardRunContext, type LeaderboardScenario, type LeaderboardScore, type LeaderboardSpec, type LocalMcpMaterialization, type LocalSandboxClientOptions, type LoopCampaignDispatchOptions, type LoopDispatchOptions, LoopLineageOptions, type LoopOptionsForDispatch, LoopResult, LoopShape, LoopTokenUsage, LoopUntilSpec, LoopWinner, MakeWorkerAgent, type MaterializeLocalMcpOptions, type McpEndpoint, type McpEnvironmentOptions, McpSpawnFault, type McpToolDescriptor, MountRecorder, type NaiveDriverOptions, type Observation, type ObserveInput, type ObserveOptions, type OpenSandboxRunBeforeStartContext, type OpenSandboxRunOptions, type OpenSandboxRunPromptOptions, Outcome, OutputAdapter, type PairwiseOptions, type PairwiseVerdict, PanelSpec, Persona, PipelineStage, type ProfileRichness, type ProfileRichnessThresholds, type PromotionGateOptions, type PromotionVerdict, type RegistryAnalyzeProjection, RenderCorpusToInstructionsOptions, type ReservationTicket, type ResolveSandboxClientOptions, ResultBlobStore, RouterConfig, RunPersonifiedOptions, type SandboxCapabilities, SandboxClient, type SandboxLineage, type SandboxLineageHandle, type SandboxRun, SandboxRunAbortError, type SandboxToolPartState, Scope, ScopeAnalyst, ScopeAnalyzeInput, ScopeWidenGate, type SessionCapableBox, type SessionTraceBox, Settled, ShapeRegistry, type Shell, Spend, type StdioMcpConnection, type StdioMcpServerSpec, SteerContext, type SteeringDecision, Strategy, type StrategyEvolutionConfig, type StreamAgentTurnOptions, type SuperviseSurfaceOptions, type SuperviseSurfaceResult, SupervisedResult, Supervisor, SupervisorProfile, SurfaceScore, type SurfaceWorkerConfig, type SurfaceWorkerOut, ToolLoopChat, ToolLoopCompactionOptions, type TraceSource, type TrajectoryAnalysis, TrajectoryReport, TrajectoryReportOptions, type TurnResult, UsageEvent, type UsageSink, Validator, type VerifierEnvironmentOptions, VerifySpec, type WatchTraceOptions, type WaterfallCollector, type WaterfallReport, type WaterfallSpan, WidenSpec, WinnerStrategy, type Workspace, type WorkspaceCommit, type WorkspaceRun, acquireSandbox, analyzeTrace, anytimeReport, asAuthoredProfile, assertModelAllowed, assertStrategyContract, assertTraceDerivedFindings, assessAuthoredProfile, auditIntent, authorStrategy, authoredWorker, buildSteerContext, builtinShapes, collectAgentTurn, completionAuthorizes, connectStdioMcp, contentAddress, createBudgetPool, createInMemoryRunContext, createInbox, createMcpEnvironment, createPushTraceSource, createSandboxLineage, createSandboxToolPartState, createScope, createScopeAnalyst, createShapeRegistry, createSupervisor, createVerifierEnvironment, createWaterfallCollector, decodeToolPart, defaultAnalystInstruction, defaultAuditorInstruction, defaultDelegateBudget, defaultProfileRichnessThresholds, defaultSelectWinner, defaultToolDetectors, defineLeaderboard, definePersona, delegate, deterministicCompletion, discriminatingMeans, driverAgent, dumbDriver, envKeyProvider, equalKOnCost, extractLlmCallEvent, failuresAnalyst, fanout, finalizeBestDelivered, flatWidenGate, gitWorkspace, harvestCorpus, inProcessSandboxClient, inlineSandboxClient, jjWorkspace, leaderboard, localSandboxClient, localShell, loopCampaignDispatch, loopDispatch, loopUntil, mapSandboxEvent, mapSandboxToolEvent, materializeLocalMcp, mcpSecretEnvMetadataKey, naiveDriver, observe, openSandboxRun, pairwiseSignificance, panel, pickChampion, pipeline, printBenchmarkReport, probeSandboxCapabilities, profileRichnessFinding, promotionGate, registerShape, registryScopeAnalyst, renderAnytimeTable, renderCorpusToInstructions, renderLeaderboardHtml, renderLeaderboardMarkdown, renderLeaderboardSvg, renderPairwiseMarkdown, renderReport, reportLoopUsage, resolveSandboxClient, resolveSecretEnv, runBenchmark, runInWorkspace, runLoop, runPersonified, runStrategyEvolution, sandboxSessionTraceSource, sanitizeMcpToolSchema, secretEnvOfMcpServer, selectChampion, selectValidWinner, sentinelCompletion, serveCoordinationMcp, settledToIteration, spendFromUsageEvents, stopSentinel, strategyAuthorContract, streamAgentTurn, sumSandboxUsage, superviseSurface, supervisorInstructions, trajectoryReport, verify, watchTrace, widen };