@tangle-network/agent-runtime 0.128.0 → 0.131.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 (136) hide show
  1. package/README.md +70 -20
  2. package/dist/{activation-DhWJ3p8N.js → activation-BCzMOTaV.js} +3 -3
  3. package/dist/{activation-DhWJ3p8N.js.map → activation-BCzMOTaV.js.map} +1 -1
  4. package/dist/agent.d.ts +2 -3
  5. package/dist/agent.js +4 -5
  6. package/dist/agent.js.map +1 -1
  7. package/dist/{analyst-loop-DvSciOfB.js → analyst-loop-BE8cDs5Q.js} +2 -2
  8. package/dist/{analyst-loop-DvSciOfB.js.map → analyst-loop-BE8cDs5Q.js.map} +1 -1
  9. package/dist/analyst-loop.d.ts +1 -1
  10. package/dist/analyst-loop.js +1 -1
  11. package/dist/authoring-CvHwo1oW.js +163 -0
  12. package/dist/authoring-CvHwo1oW.js.map +1 -0
  13. package/dist/candidate-execution/index.js +4 -4
  14. package/dist/{candidate-execution-BFpq-Xi6.js → candidate-execution-BNxKr-Bu.js} +5 -5
  15. package/dist/{candidate-execution-BFpq-Xi6.js.map → candidate-execution-BNxKr-Bu.js.map} +1 -1
  16. package/dist/{conversation-BpLQZGPH.js → conversation-DNtxaJ1Z.js} +113 -31
  17. package/dist/conversation-DNtxaJ1Z.js.map +1 -0
  18. package/dist/conversation.d.ts +2 -2
  19. package/dist/conversation.js +2 -2
  20. package/dist/environment-provider-CxvSd1W6.d.ts +86 -0
  21. package/dist/{environment-provider-DqFS6FSZ.js → environment-provider-Dyg8DtLK.js} +8 -4
  22. package/dist/environment-provider-Dyg8DtLK.js.map +1 -0
  23. package/dist/environment-provider.d.ts +1 -1
  24. package/dist/environment-provider.js +1 -1
  25. package/dist/graph-BJTxGOFB.js +471 -0
  26. package/dist/graph-BJTxGOFB.js.map +1 -0
  27. package/dist/{improvement-cycle-IJgCbKWQ.js → improvement-cycle-Csp38cWg.js} +133 -224
  28. package/dist/improvement-cycle-Csp38cWg.js.map +1 -0
  29. package/dist/{index-BhZhQw77.d.ts → index-CoO7atyo.d.ts} +556 -1278
  30. package/dist/{index-BhuzfG2r.d.ts → index-DwGtu9nc.d.ts} +7 -9
  31. package/dist/{index-Efjb3nrQ.d.ts → index-qYHpsmG2.d.ts} +36 -18
  32. package/dist/index.d.ts +353 -11
  33. package/dist/index.js +111 -354
  34. package/dist/index.js.map +1 -1
  35. package/dist/intelligence.d.ts +6 -6
  36. package/dist/intelligence.js +9 -8
  37. package/dist/intelligence.js.map +1 -1
  38. package/dist/kernel.d.ts +7 -5
  39. package/dist/kernel.js +13 -9
  40. package/dist/{knowledge-DF63xPr4.js → knowledge-ce0_uKCl.js} +19 -17
  41. package/dist/knowledge-ce0_uKCl.js.map +1 -0
  42. package/dist/knowledge.d.ts +1 -1
  43. package/dist/knowledge.js +1 -1
  44. package/dist/{loop-runner-bin-Ckp_9tmD.d.ts → loop-runner-bin-BwgZ8m_7.d.ts} +6 -3
  45. package/dist/{loop-runner-bin-CWqOpCEw.js → loop-runner-bin-DSbuDDqM.js} +5 -27
  46. package/dist/loop-runner-bin-DSbuDDqM.js.map +1 -0
  47. package/dist/loop-runner-bin.d.ts +1 -1
  48. package/dist/loop-runner-bin.js +1 -1
  49. package/dist/materialization-COJ1UYQ-.js +272 -0
  50. package/dist/materialization-COJ1UYQ-.js.map +1 -0
  51. package/dist/mcp/bin.js +39 -47
  52. package/dist/mcp/bin.js.map +1 -1
  53. package/dist/mcp/index.d.ts +24 -26
  54. package/dist/mcp/index.js +66 -83
  55. package/dist/mcp/index.js.map +1 -1
  56. package/dist/mcp/memory-bin.js +1 -1
  57. package/dist/{memory-server-DL6cE2Ag.js → memory-server-5HEJH672.js} +2 -2
  58. package/dist/{memory-server-DL6cE2Ag.js.map → memory-server-5HEJH672.js.map} +1 -1
  59. package/dist/model-policy-CqziaqS1.js +232 -0
  60. package/dist/model-policy-CqziaqS1.js.map +1 -0
  61. package/dist/{openai-tools-B68JaOCx.d.ts → openai-tools-D3oMyVGl.d.ts} +2 -2
  62. package/dist/{openai-tools-D3XfrrQ6.js → openai-tools-ru75mLjq.js} +2 -2
  63. package/dist/openai-tools-ru75mLjq.js.map +1 -0
  64. package/dist/{prepare--8EvLqCr.js → prepare-DYWjVcPx.js} +169 -153
  65. package/dist/prepare-DYWjVcPx.js.map +1 -0
  66. package/dist/primeintellect/index.d.ts +7 -6
  67. package/dist/primeintellect/index.js +9 -11
  68. package/dist/primeintellect/index.js.map +1 -1
  69. package/dist/profiles.d.ts +21 -174
  70. package/dist/profiles.js +67 -276
  71. package/dist/profiles.js.map +1 -1
  72. package/dist/{protected-model-port-CXVfOUu_.js → protected-model-port-48ALLGxT.js} +2 -2
  73. package/dist/{protected-model-port-CXVfOUu_.js.map → protected-model-port-48ALLGxT.js.map} +1 -1
  74. package/dist/{redact-PQzmE1Jn.d.ts → redact-9_Gf-8m3.d.ts} +58 -69
  75. package/dist/{researcher-CoVqNhfI.js → researcher-Skz5-Uc8.js} +50 -26
  76. package/dist/researcher-Skz5-Uc8.js.map +1 -0
  77. package/dist/{run-layout-C2FGmZ3v.js → run-layout-CeJsEAom.js} +2 -2
  78. package/dist/{run-layout-C2FGmZ3v.js.map → run-layout-CeJsEAom.js.map} +1 -1
  79. package/dist/runtime-D-QfLbSd.d.ts +893 -0
  80. package/dist/{runtime-5uDVVfER.js → runtime-hiAABiTk.js} +315 -1191
  81. package/dist/runtime-hiAABiTk.js.map +1 -0
  82. package/dist/{sandbox-events-Yhd1GYWl.js → sandbox-events-CRDwc5WN.js} +42 -5
  83. package/dist/sandbox-events-CRDwc5WN.js.map +1 -0
  84. package/dist/snapshot-CXiiuHhL.js +21 -0
  85. package/dist/snapshot-CXiiuHhL.js.map +1 -0
  86. package/dist/{spawn-journal-DsZKDqeh.js → spawn-journal-saHQzqYi.js} +15 -21
  87. package/dist/spawn-journal-saHQzqYi.js.map +1 -0
  88. package/dist/stream-agent-turn-C852AgMT.d.ts +128 -0
  89. package/dist/stream-agent-turn-rYgaOLO0.js +910 -0
  90. package/dist/stream-agent-turn-rYgaOLO0.js.map +1 -0
  91. package/dist/{structural-rollout-zY0oqQzO.js → structural-rollout-3uxVGcg2.js} +459 -235
  92. package/dist/structural-rollout-3uxVGcg2.js.map +1 -0
  93. package/dist/{supervise-CsTKbH9R.js → supervise-iPN27pO0.js} +864 -4785
  94. package/dist/supervise-iPN27pO0.js.map +1 -0
  95. package/dist/{supervisor-DpjO0Gmy.js → supervisor-CV6Jh28D.js} +7439 -2897
  96. package/dist/supervisor-CV6Jh28D.js.map +1 -0
  97. package/dist/testing.d.ts +3 -1
  98. package/dist/testing.js +271 -221
  99. package/dist/testing.js.map +1 -1
  100. package/dist/{top-app-5unxqovu.js → top-app-G4M18b6i.js} +3 -3
  101. package/dist/{top-app-5unxqovu.js.map → top-app-G4M18b6i.js.map} +1 -1
  102. package/dist/tui/bin.js +1 -1
  103. package/dist/tui/index.js +1 -1
  104. package/dist/{environment-provider-CUFsyymu.d.ts → types-C6Q-J0Dt.d.ts} +51 -114
  105. package/dist/{types-DnNGJ5Gz.d.ts → types-ebIY0dMG.d.ts} +556 -30
  106. package/dist/{util-MVgdwuIS.js → util-Bw6srryQ.js} +3 -2
  107. package/dist/{util-MVgdwuIS.js.map → util-Bw6srryQ.js.map} +1 -1
  108. package/dist/{workspace-archive-BQxvkypI.js → workspace-archive-aOfJ47ms.js} +3 -3
  109. package/dist/{workspace-archive-BQxvkypI.js.map → workspace-archive-aOfJ47ms.js.map} +1 -1
  110. package/package.json +12 -15
  111. package/skills/agent-graphs/IMPROVE.md +3 -3
  112. package/skills/agent-graphs/SKILL.md +4 -5
  113. package/skills/agent-graphs/cases/review-pipeline.json +1 -2
  114. package/skills/agent-graphs/cases/unmeasured-harness.json +2 -4
  115. package/dist/backends-CiOCyRHb.js +0 -743
  116. package/dist/backends-CiOCyRHb.js.map +0 -1
  117. package/dist/conversation-BpLQZGPH.js.map +0 -1
  118. package/dist/environment-provider-DqFS6FSZ.js.map +0 -1
  119. package/dist/improvement-cycle-IJgCbKWQ.js.map +0 -1
  120. package/dist/index-DLM0W1h1.d.ts +0 -545
  121. package/dist/knowledge-DF63xPr4.js.map +0 -1
  122. package/dist/local-harness-BIajef4A.d.ts +0 -465
  123. package/dist/loop-runner-bin-CWqOpCEw.js.map +0 -1
  124. package/dist/model-resolution-Btd9iIKV.js +0 -98
  125. package/dist/model-resolution-Btd9iIKV.js.map +0 -1
  126. package/dist/openai-tools-D3XfrrQ6.js.map +0 -1
  127. package/dist/prepare--8EvLqCr.js.map +0 -1
  128. package/dist/researcher-CoVqNhfI.js.map +0 -1
  129. package/dist/runtime-5uDVVfER.js.map +0 -1
  130. package/dist/sandbox-events-Yhd1GYWl.js.map +0 -1
  131. package/dist/spawn-journal-DsZKDqeh.js.map +0 -1
  132. package/dist/structural-rollout-zY0oqQzO.js.map +0 -1
  133. package/dist/supervise-CsTKbH9R.js.map +0 -1
  134. package/dist/supervisor-DpjO0Gmy.js.map +0 -1
  135. package/dist/types-C9j4qg6l.d.ts +0 -500
  136. package/skills/agent-graphs/cases/floor-trap-pi.json +0 -11
@@ -1,5 +1,6 @@
1
- import { Df as DeliverableSpec, It as SuperviseOptions, Yl as ExecutorConfig, Zt as SupervisorProfile } from "./index-BhZhQw77.js";
2
- import { Ct as SupervisedResult, z as Budget } from "./environment-provider-CUFsyymu.js";
1
+ import { $d as DeliverableSpec, An as SupervisorProfile, It as SuperviseOptions } from "./index-CoO7atyo.js";
2
+ import { H as SupervisedResult, i as Budget } from "./types-C6Q-J0Dt.js";
3
+ import { a as ExecutorConfig } from "./runtime-D-QfLbSd.js";
3
4
  import { y as AgentCandidateOutputArtifactPort } from "./types-BaIpb0XT.js";
4
5
  import { i as AgentImprovementActivationTransition, n as AgentImprovementActivationResultStore, t as AgentImprovementActivationReconciliation } from "./activation-DyWB0K6E.js";
5
6
  import { AgentCandidateBundle, AgentCandidateCapturedArtifact, AgentCandidateKnowledge } from "@tangle-network/agent-interface";
@@ -58,9 +59,8 @@ interface SupervisedKnowledgeUpdateOptions {
58
59
  budget: Budget;
59
60
  backend?: ExecutorConfig;
60
61
  makeWorkerAgent?: SuperviseOptions['makeWorkerAgent'];
61
- harness?: string;
62
- supervisorModel?: string;
63
- supervisorSystemPrompt?: string;
62
+ /** Caller-owned exact supervisor harness/provider/model identity. */
63
+ supervisorProfile: SupervisorProfile;
64
64
  superviseOptions?: Partial<Omit<SuperviseOptions, 'budget' | 'backend' | 'deliverable' | 'makeWorkerAgent' | 'allowedModels'>>;
65
65
  allowedModels?: readonly string[];
66
66
  runSupervised?: (profile: SupervisorProfile, task: unknown, opts: SuperviseOptions) => Promise<SupervisedResult<unknown>>;
@@ -81,9 +81,7 @@ interface RunKnowledgeImprovementJobOptions extends Omit<KnowledgeImprovementOpt
81
81
  readinessCheck?: KnowledgeReadinessCheck;
82
82
  backend?: ExecutorConfig;
83
83
  makeWorkerAgent?: SuperviseOptions['makeWorkerAgent'];
84
- harness?: string;
85
- supervisorModel?: string;
86
- supervisorSystemPrompt?: string;
84
+ supervisorProfile: SupervisorProfile;
87
85
  superviseOptions?: Partial<Omit<SuperviseOptions, 'budget' | 'backend' | 'deliverable' | 'makeWorkerAgent' | 'allowedModels'>>;
88
86
  allowedModels?: readonly string[];
89
87
  runSupervised?: (profile: SupervisorProfile, task: unknown, opts: SuperviseOptions) => Promise<SupervisedResult<unknown>>;
@@ -137,4 +135,4 @@ declare function runKnowledgeImprovementJob(options: RunKnowledgeImprovementJobO
137
135
  declare function buildKnowledgeImprovementExperimentBundles(bundle: AgentCandidateBundle, knowledge: KnowledgeImprovementCandidatePair): KnowledgeImprovementExperimentBundles;
138
136
  //#endregion
139
137
  export { KnowledgeImprovementActivationExecutor as C, CreateKnowledgeImprovementActivationExecutorOptions as S, SupervisedKnowledgeUpdater as _, KnowledgeImprovementJobResult as a, knowledgeReadinessDeliverable as b, createAgentKnowledgeReadinessCheck as c, KnowledgeReadinessCheckInput as d, KnowledgeReadinessCheckResult as f, SupervisedKnowledgeUpdateResult as g, SupervisedKnowledgeUpdateOptions as h, KnowledgeImprovementJobMeasurement as i, runKnowledgeImprovementJob as l, SupervisedKnowledgeUpdateInput as m, KnowledgeImprovementCandidatePair as n, RunKnowledgeImprovementJobOptions as o, RESEARCH_SUPERVISOR_SYSTEM_PROMPT as p, KnowledgeImprovementExperimentBundles as r, buildKnowledgeImprovementExperimentBundles as s, AgentKnowledgeReadinessCheckOptions as t, KnowledgeReadinessCheck as u, createSupervisedKnowledgeUpdater as v, createKnowledgeImprovementActivationExecutor as w, runSupervisedKnowledgeUpdate as x, formatSupervisedKnowledgeTask as y };
140
- //# sourceMappingURL=index-BhuzfG2r.d.ts.map
138
+ //# sourceMappingURL=index-DwGtu9nc.d.ts.map
@@ -1,6 +1,25 @@
1
- import { b as RuntimeSessionStore, i as AgentExecutionBackend } from "./types-C9j4qg6l.js";
1
+ import { V as AgentExecutionBackend, rt as RuntimeSessionStore } from "./types-ebIY0dMG.js";
2
+ import { d as ExecutorFactory } from "./types-C6Q-J0Dt.js";
2
3
  import { AgentProfile, MaximumCharge } from "@tangle-network/agent-eval";
3
4
  import { ProfileDispatchFn, Scenario } from "@tangle-network/agent-eval/campaign";
5
+ import { AgentProfile as AgentProfile$1 } from "@tangle-network/agent-interface";
6
+ //#region src/runtime/profile-execution-backend.d.ts
7
+ /**
8
+ * Bind one exact profile and Runtime executor to the stable `AgentExecutionBackend` contract used
9
+ * by `runAgentTaskStream` and conversations.
10
+ *
11
+ * Runtime still owns the model call through `streamAgentTurn`.
12
+ * The adapter only translates the two stream protocols and carries the caller's request headers
13
+ * into `ExecutorContext` so an HTTP executor can preserve authorization, recursion depth, and
14
+ * trace identity.
15
+ *
16
+ * @stable
17
+ */
18
+ declare function createProfileExecutionBackend(options: {
19
+ profile: AgentProfile$1;
20
+ executor: ExecutorFactory<unknown>;
21
+ }): AgentExecutionBackend;
22
+ //#endregion
4
23
  //#region src/conversation/call-policy.d.ts
5
24
  /**
6
25
  *
@@ -228,9 +247,8 @@ interface ConversationParticipant {
228
247
  name: string;
229
248
  /**
230
249
  * Backend that runs this participant's turn. Reuses the existing
231
- * `AgentExecutionBackend` contract from `runAgentTaskStream`, so any
232
- * registered backend (iterable, sandbox, OpenAI-compatible) works without
233
- * adaptation.
250
+ * `AgentExecutionBackend` contract from `runAgentTaskStream`, so an iterable,
251
+ * sandbox, or profile-backed Runtime executor works through the same runner.
234
252
  */
235
253
  backend: AgentExecutionBackend;
236
254
  /**
@@ -259,9 +277,9 @@ interface ConversationParticipant {
259
277
  * - `(state) => AuthSource` — per-turn / per-condition decision, e.g. base
260
278
  * sub-services are agent-owned but premium add-ons forward the user.
261
279
  *
262
- * The agent's own credentials live on the backend (set at construction
263
- * time, e.g. `createOpenAICompatibleBackend({ apiKey })`); this field is
264
- * purely about *whether to also forward the user's identity downstream*.
280
+ * The agent's own credentials live on its caller-owned backend or
281
+ * profile-bound Runtime executor; this field is purely about *whether to
282
+ * also forward the user's identity downstream*.
265
283
  */
266
284
  authSource?: AuthSource;
267
285
  }
@@ -587,11 +605,9 @@ interface RunPersonaConversationOptions {
587
605
  worker: AgentProfile;
588
606
  /** The simulated user driving the dialogue. */
589
607
  persona: PersonaDriver;
590
- /** Turn an `AgentProfile` into a runnable backend (router / sandbox / fake).
591
- * Applied to the worker and to a `profile`-kind persona. */
592
- backendFor: (profile: AgentProfile, role: 'worker' | 'persona') => AgentExecutionBackend;
593
- /** Render a profile's system prompt — prepended to that profile's messages. */
594
- systemPromptOf: (profile: AgentProfile) => string;
608
+ /** Resolve transport/executable ports for the exact profile. Runtime still materializes the
609
+ * profile and owns every model call. Applied to the worker and a profile-driven persona. */
610
+ executorFor: (profile: AgentProfile, role: 'worker' | 'persona') => ExecutorFactory<unknown>;
595
611
  /** Speaker-turn cap. Default for a scripted persona = `2 * turns.length`
596
612
  * (worker answers each user turn). REQUIRED for a `profile` persona. */
597
613
  maxTurns?: number;
@@ -612,6 +628,10 @@ interface PersonaConversationResult {
612
628
  costUsd: number;
613
629
  tokensIn: number;
614
630
  tokensOut: number;
631
+ /** Absent means every worker call reported complete token usage. */
632
+ tokensKnown?: false;
633
+ /** Absent means every worker call reported provider-billed cost, including a known zero. */
634
+ costUsdKnown?: false;
615
635
  }
616
636
  /**
617
637
  * Run one worker profile against one persona as a multi-round conversation.
@@ -620,10 +640,8 @@ interface PersonaConversationResult {
620
640
  */
621
641
  declare function runPersonaConversation(opts: RunPersonaConversationOptions): Promise<PersonaConversationResult>;
622
642
  interface RunPersonaConfig<TScenario extends Scenario, TArtifact> {
623
- /** Turn an `AgentProfile` into a runnable backend (router / sandbox / fake). */
624
- backendFor: (profile: AgentProfile, role: 'worker' | 'persona') => AgentExecutionBackend;
625
- /** Render a profile's system prompt. */
626
- systemPromptOf: (profile: AgentProfile) => string;
643
+ /** Resolve transport/executable ports for each exact profile. */
644
+ executorFor: (profile: AgentProfile, role: 'worker' | 'persona') => ExecutorFactory<unknown>;
627
645
  /** The persona driving each scenario — a driver profile or scripted turns. */
628
646
  personaOf: (scenario: TScenario) => PersonaDriver;
629
647
  /** Build the scored artifact from the finished transcript. */
@@ -667,5 +685,5 @@ declare function turnId(runId: string, index: number, speaker: string): string;
667
685
  */
668
686
  declare function slugifySpeaker(speaker: string): string;
669
687
  //#endregion
670
- export { sleep as $, RunConversationOptions as A, buildForwardHeaders as B, ConversationResult as C, HaltPredicate as D, HaltContext as E, InMemoryConversationJournal as F, CircuitBreakerState as G, readDepth as H, DEFAULT_MAX_DEPTH as I, RetryBackoff as J, CircuitOpenError as K, FORWARD_HEADERS as L, ConversationJournal as M, ConversationJournalEntry as N, HaltReason as O, FileConversationJournal as P, makePerAttemptSignal as Q, ForwardHeaderName as R, ConversationPolicy as S, ConversationTurn as T, BackendCallPolicy as U, isDepthExceeded as V, CircuitBreakerConfig as W, computeBackoff as X, RetryableErrorPredicate as Y, defaultIsRetryable as Z, createConversationBackend as _, RunPersonaConfig as a, ConversationDriveState as b, runPersonaDispatch as c, D1DatabaseLike as d, D1StmtLike as f, defineConversation as g, d1ToSqlAdapter as h, PersonaDriver as i, TurnOrder as j, HaltSignal as k, runConversation as l, SqlConversationJournal as m, turnId as n, RunPersonaConversationOptions as o, SqlAdapter as p, DeadlineExceededError as q, PersonaConversationResult as r, runPersonaConversation as s, slugifySpeaker as t, runConversationStream as u, AuthSource as v, ConversationStreamEvent as w, ConversationParticipant as x, Conversation as y, PropagatedHeaders as z };
671
- //# sourceMappingURL=index-Efjb3nrQ.d.ts.map
688
+ export { sleep as $, RunConversationOptions as A, buildForwardHeaders as B, ConversationResult as C, HaltPredicate as D, HaltContext as E, InMemoryConversationJournal as F, CircuitBreakerState as G, readDepth as H, DEFAULT_MAX_DEPTH as I, RetryBackoff as J, CircuitOpenError as K, FORWARD_HEADERS as L, ConversationJournal as M, ConversationJournalEntry as N, HaltReason as O, FileConversationJournal as P, makePerAttemptSignal as Q, ForwardHeaderName as R, ConversationPolicy as S, ConversationTurn as T, BackendCallPolicy as U, isDepthExceeded as V, CircuitBreakerConfig as W, computeBackoff as X, RetryableErrorPredicate as Y, defaultIsRetryable as Z, createConversationBackend as _, RunPersonaConfig as a, ConversationDriveState as b, runPersonaDispatch as c, D1DatabaseLike as d, createProfileExecutionBackend as et, D1StmtLike as f, defineConversation as g, d1ToSqlAdapter as h, PersonaDriver as i, TurnOrder as j, HaltSignal as k, runConversation as l, SqlConversationJournal as m, turnId as n, RunPersonaConversationOptions as o, SqlAdapter as p, DeadlineExceededError as q, PersonaConversationResult as r, runPersonaConversation as s, slugifySpeaker as t, runConversationStream as u, AuthSource as v, ConversationStreamEvent as w, ConversationParticipant as x, Conversation as y, PropagatedHeaders as z };
689
+ //# sourceMappingURL=index-qYHpsmG2.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,15 +1,357 @@
1
- import { _ as RunAgentTaskOptions, a as AgentKnowledgeProvider, b as RuntimeSessionStore, c as AgentTaskContext, d as AgentTaskStatus, f as BackendErrorDetail, g as OpenAIChatToolChoice, h as OpenAIChatTool, i as AgentExecutionBackend, l as AgentTaskRunResult, m as OpenAIChatResponseFormat, n as AgentBackendContext, o as AgentRuntimeEvent, p as KnowledgeReadinessDecision, r as AgentBackendInput, s as AgentRuntimeEventSink, t as AgentAdapter, u as AgentTaskSpec, v as RunAgentTaskStreamOptions, x as RuntimeStreamEvent, y as RuntimeSession } from "./types-C9j4qg6l.js";
2
- import { cf as AgentEvalError, df as ConfigError, du as WorktreeCheckRunner, ff as JudgeError, gf as ValidationError, hf as RuntimeRunStateError, lf as AgentEvalErrorCode, ll as CoordinationEvent, mf as PlannerError, pf as NotFoundError, rl as AnalystRegistry, rr as SupervisorFinalizer, tr as FinalizeContext, uf as BackendTransportError } from "./index-BhZhQw77.js";
1
+ import { $ as OpenAIChatToolChoice, A as RuntimeRunCompleteInput, B as AgentBackendInput, F as RuntimeRunRow, G as AgentTaskContext, H as AgentKnowledgeProvider, I as RuntimeRunStatus, J as AgentTaskStatus, K as AgentTaskRunResult, L as startRuntimeRun, M as RuntimeRunHandle, N as RuntimeRunOptions, P as RuntimeRunPersistenceAdapter, Q as OpenAIChatTool, R as AgentAdapter, U as AgentRuntimeEvent, V as AgentExecutionBackend, W as AgentRuntimeEventSink, X as KnowledgeReadinessDecision, Y as BackendErrorDetail, Z as OpenAIChatResponseFormat, et as RunAgentTaskOptions, it as RuntimeStreamEvent, j as RuntimeRunCost, m as LoopResult, nt as RuntimeSession, q as AgentTaskSpec, r as Driver, rt as RuntimeSessionStore, tt as RunAgentTaskStreamOptions, z as AgentBackendContext } from "./types-ebIY0dMG.js";
2
+ import { i as SurfaceImprovementEdit } from "./improvement-adapter-D5gwwoXQ.js";
3
+ import { o as ImprovementProposalSource } from "./types-zWfqDjeL.js";
4
+ import { Bd as PlannerError, Fd as AgentEvalErrorCode, Hd as ValidationError, Id as BackendTransportError, Ld as ConfigError, Pd as AgentEvalError, Rd as JudgeError, Vd as RuntimeRunStateError, cl as AnalystRegistry, dr as FinalizeContext, ml as CoordinationEvent, ni as StructuralRolloutPolicy, pr as SupervisorFinalizer, zd as NotFoundError } from "./index-CoO7atyo.js";
3
5
  import { a as RuntimeHookErrorContext, c as RuntimeHookTarget, d as defineRuntimeHooks, f as notifyRuntimeDecisionPoint, i as RuntimeHookContext, l as RuntimeHooks, n as RuntimeDecisionKind, o as RuntimeHookEvent, p as notifyRuntimeHookEvent, r as RuntimeDecisionPoint, s as RuntimeHookPhase, t as RuntimeDecisionEvidenceRef, u as composeRuntimeHooks } from "./runtime-hooks-sbRpjStq.js";
4
- import { A as RuntimeRunCompleteInput, F as RuntimeRunRow, I as RuntimeRunStatus, L as startRuntimeRun, M as RuntimeRunHandle, N as RuntimeRunOptions, P as RuntimeRunPersistenceAdapter, j as RuntimeRunCost, m as LoopResult, r as Driver } from "./types-DnNGJ5Gz.js";
5
- import { $t as RuntimeEventOtelOptions, Ct as SupervisedResult, Gt as EvalRunsExportConfig, H as Executor, Jt as LoopSpanNode, Kt as EvalRunsExportResult, Mt as WorkerTraceUnavailableReason, Qt as OtelSpan, R as AgentSpec, Sn as sanitizeRuntimeStreamEvent, Ut as EvalRunEvent, Wt as EvalRunGeneration, Xt as OtelExportConfig, Y as ExecutorRegistry, Yt as OtelAttribute, Zt as OtelExporter, _n as SanitizedKnowledgeRequirement, an as exportEvalRuns, bn as sanitizeAgentRuntimeEvent, cn as padSpanId, dn as RuntimeEventCollector, en as buildLoopOtelSpans, fn as RuntimeStreamEventCollector, gn as SanitizedKnowledgeReadinessReport, hn as RuntimeTelemetryOptions, ht as Settled, in as createOtelExporter, jt as WorkerTraceEvidence, ln as padTraceId, mn as RuntimeStreamEventSummary, mt as Scope, nn as buildRuntimeEventOtelSpans, on as generateSpanId, pn as RuntimeStreamEventSink, qt as INTELLIGENCE_WIRE_VERSION, rn as createOpenInferenceFileExporter, sn as loopEventToOtelSpan, tn as buildLoopSpanNodes, un as toOtelAttributes, vn as createRuntimeEventCollector, wt as Supervisor, xn as sanitizeKnowledgeReadinessReport, xt as Spend, yn as createRuntimeStreamEventCollector, z as Budget } from "./environment-provider-CUFsyymu.js";
6
+ import { At as RuntimeEventCollector, B as Spend, Bt as sanitizeKnowledgeReadinessReport, Ct as createOtelExporter, Dt as padSpanId, Et as loopEventToOtelSpan, Ft as SanitizedKnowledgeReadinessReport, H as SupervisedResult, It as SanitizedKnowledgeRequirement, Lt as createRuntimeEventCollector, Mt as RuntimeStreamEventSink, N as Scope, Nt as RuntimeStreamEventSummary, Ot as padTraceId, P as Settled, Pt as RuntimeTelemetryOptions, Rt as createRuntimeStreamEventCollector, St as createOpenInferenceFileExporter, Tt as generateSpanId, U as Supervisor, Vt as sanitizeRuntimeStreamEvent, X as WorkerTraceEvidence, Z as WorkerTraceUnavailableReason, _t as OtelSpan, bt as buildLoopSpanNodes, ct as EvalRunEvent, dt as EvalRunsExportResult, ft as INTELLIGENCE_WIRE_VERSION, gt as OtelExporter, ht as OtelExportConfig, i as Budget, jt as RuntimeStreamEventCollector, kt as toOtelAttributes, lt as EvalRunGeneration, m as ExecutorRegistry, mt as OtelAttribute, pt as LoopSpanNode, r as AgentSpec, s as Executor, ut as EvalRunsExportConfig, vt as RuntimeEventOtelOptions, wt as exportEvalRuns, xt as buildRuntimeEventOtelSpans, yt as buildLoopOtelSpans, zt as sanitizeAgentRuntimeEvent } from "./types-C6Q-J0Dt.js";
7
+ import { x as WorktreeCheckRunner } from "./runtime-D-QfLbSd.js";
6
8
  import { C as AgentCandidateCodeSurfaceSource, D as AgentCandidateBundleInput, E as buildAgentCandidateBundle, O as sealAgentCandidateBundle, S as AgentCandidateCodeSource, T as BuildAgentCandidateBundleInput, _ as exactProcessProviderAsCandidateExecutor, a as captureAgentCandidateWorkspace, b as FileAgentCandidateExecutionClaimStore, c as AGENT_CANDIDATE_EXECUTION_SUPPORT, d as recoverExpiredAgentCandidateExecution, f as persistCandidateOutputArtifact, g as ExactProcessCandidateExecutorOptions, h as candidateKnowledgeExecutionPaths, i as CreateAgentCandidateWorkspacePortOptions, l as verifyAgentCandidateBundle, m as CANDIDATE_KNOWLEDGE_ROOT_ENV, n as CaptureAgentCandidateWorkspaceOptions, o as captureAgentCandidateWorkspaceFiles, p as CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, r as CapturedAgentCandidateWorkspace, s as createAgentCandidateWorkspacePort, t as AgentCandidateWorkspaceArchiveLimits, u as RecoverExpiredAgentCandidateOptions, v as DisposePreparedAgentCandidateOptions, w as AgentCandidateProfileSource, x as FileAgentCandidateExecutionClaimStoreOptions, y as disposePreparedAgentCandidateExecution } from "./index-B3bHsVLw.js";
7
9
  import { A as AgentCandidateExecutionPhase, B as AgentCandidatePreparationEvidence, C as AgentCandidateExecutionClaim, D as AgentCandidateExecutionFailureClass, E as AgentCandidateExecutionCleanupHandles, F as AgentCandidateExecutionTerminalResult, I as AgentCandidateRetryRejection, L as InMemoryAgentCandidateExecutionClaimStore, M as AgentCandidateExecutionRecoveryEvidence, N as AgentCandidateExecutionStageResult, O as AgentCandidateExecutionFinishResult, P as AgentCandidateExecutionTerminalRecord, R as InMemoryAgentCandidateExecutionClaimStoreOptions, S as AgentCandidateExecutionAttemptRef, T as AgentCandidateExecutionClaimStore, _ as PrepareAgentCandidateExecutionOptions, a as AgentCandidateModelGrantSettleInput, b as executePreparedAgentCandidate, c as agentCandidateProfileAsAgentProfile, d as freezeGenericAgentCandidateProfile, f as omitUndefinedObjectFields, g as parseExactCandidateProfile, h as parseExactAgentProfileDiff, i as AgentCandidateModelGrantReserveInput, j as AgentCandidateExecutionPhaseResult, k as AgentCandidateExecutionLease, l as applyExactAgentProfileDiff, m as parseExactAgentProfile, n as AgentCandidateModelGrantClient, o as CreateProtectedAgentCandidateModelPortOptions, r as AgentCandidateModelGrantReservation, s as createProtectedAgentCandidateModelPort, t as AgentCandidateModelGrantActivateInput, u as assertCandidateProfileBinding, v as prepareAgentCandidateExecution, w as AgentCandidateExecutionClaimResult, x as AgentCandidateExecutionAttemptRecord, y as ExecutePreparedAgentCandidateOptions, z as candidateExecutionClaim } from "./protected-model-port-CoJOiINX.js";
8
10
  import { A as CANDIDATE_TRACE_ENV, B as VerifiedAgentCandidate, C as AgentCandidateProtectedModelSettlement, D as AgentCandidateTaskExecution, E as AgentCandidateRunFinalization, F as PreparedAgentCandidateInstruction, I as PreparedAgentCandidateKnowledge, L as PreparedAgentCandidateLaunch, M as CanonicalCandidateDocument, N as PersistedTaskOutcomeEvidence, O as AgentCandidateVerificationPorts, P as PreparedAgentCandidateExecution, R as PreparedAgentCandidateTrace, S as AgentCandidateProtectedModelReservation, T as AgentCandidateRepositoryPort, V as VerifiedAgentCandidateTaskOutcome, _ as AgentCandidateModelLimits, a as AgentCandidateExecutionPorts, b as AgentCandidateOutputPurpose, c as AgentCandidateExecutorPort, d as AgentCandidateExecutorStopRequest, f as AgentCandidateExecutorTaskOutcomeCapture, g as AgentCandidateMemoryResetResult, h as AgentCandidateMemoryPort, i as AgentCandidateContainerPort, j as CANDIDATE_TRACE_TAGS, k as AgentCandidateWorkspacePort, l as AgentCandidateExecutorProfileFile, m as AgentCandidateExecutorWorkspaceInput, n as AgentCandidateBenchmarkGraderIdentity, o as AgentCandidateExecutorFinalCapture, p as AgentCandidateExecutorWorkspaceFile, r as AgentCandidateBenchmarkGraderPort, s as AgentCandidateExecutorMemoryCapture, t as AgentCandidateArtifactPort, u as AgentCandidateExecutorRequest, v as AgentCandidateModelPort, w as AgentCandidateProtectedRunCapture, x as AgentCandidateProtectedModelActivation, y as AgentCandidateOutputArtifactPort, z as ResolvedAgentCandidateContainer } from "./types-BaIpb0XT.js";
9
- import { $ as sleep, A as RunConversationOptions, B as buildForwardHeaders, C as ConversationResult, D as HaltPredicate, E as HaltContext, F as InMemoryConversationJournal, G as CircuitBreakerState, H as readDepth, I as DEFAULT_MAX_DEPTH, J as RetryBackoff, K as CircuitOpenError, L as FORWARD_HEADERS, M as ConversationJournal, N as ConversationJournalEntry, O as HaltReason, P as FileConversationJournal, Q as makePerAttemptSignal, R as ForwardHeaderName, S as ConversationPolicy, T as ConversationTurn, U as BackendCallPolicy, V as isDepthExceeded, W as CircuitBreakerConfig, X as computeBackoff, Y as RetryableErrorPredicate, Z as defaultIsRetryable, _ as createConversationBackend, a as RunPersonaConfig, b as ConversationDriveState, c as runPersonaDispatch, d as D1DatabaseLike, f as D1StmtLike, g as defineConversation, h as d1ToSqlAdapter, i as PersonaDriver, j as TurnOrder, k as HaltSignal, l as runConversation, m as SqlConversationJournal, n as turnId, o as RunPersonaConversationOptions, p as SqlAdapter, q as DeadlineExceededError, r as PersonaConversationResult, s as runPersonaConversation, t as slugifySpeaker, u as runConversationStream, v as AuthSource, w as ConversationStreamEvent, x as ConversationParticipant, y as Conversation, z as PropagatedHeaders } from "./index-Efjb3nrQ.js";
10
- import { $ as McpServeSpec, A as resolveRouterBaseUrl, B as RawTraceDistillerOptions, C as DEFAULT_ROUTER_BASE_URL, D as cleanModelId, E as RouterEnv, F as parseRolloutPolicy, G as strategyAuthorMethod, H as buildDriverSystem, I as serializeRolloutPolicy, J as OfficialOptimizerUnavailableError, K as OfficialGepaOptions, L as structuralRolloutPolicyFromProfile, M as ROLLOUT_POLICY_EXTENSION, N as applyRolloutPolicyToProfile, O as getModels, P as normalizeRolloutPolicy, Q as officialSkillOpt, R as ReflectiveGeneratorOptions, S as ChatModelValidation, T as ResolvedChatModel, U as optimizerMethod, V as rawTraceDistiller, W as researchDriverNote, X as OfficialSkillOptOptions, Y as OfficialSensitiveCandidateInput, Z as officialGepa, _ as AgentBackendKind, a as ControlStep, at as mcpBuildPrompt, b as decideKnowledgeReadiness, c as KnowledgeRequirement, ct as createIterableBackend, d as readinessServerSentEvent, et as mcpServeVerifier, f as runtimeStreamServerSentEvent, g as runAgentTaskStream, h as runAgentTask, i as ControlRunResult, it as findingLines, j as validateChatModelId, k as resolveChatModel, l as RunRecord, lt as createOpenAICompatibleBackend, m as applyRunRecordDefaults, n as ControlDecision, nt as driverLoopGenerator, o as DataAcquisitionPlan, ot as toolBuildPrompt, p as InMemoryRuntimeSessionStore, q as OfficialOptimizerContextOptions, r as ControlEvalResult, rt as BuildPromptFindingsInput, s as KnowledgeReadinessReport, st as BackendRetryPolicy, t as ControlBudget, tt as DriverLoopGeneratorOptions, u as ServerSentEventOptions, ut as createSandboxPromptBackend, v as ResolveAgentBackendOptions, w as ModelInfo, x as ChatModelCandidate, y as resolveAgentBackend, z as reflectiveGenerator } from "./index-DLM0W1h1.js";
11
- import { A as DeepReadonly, B as commandVerifier, C as ImproveResult, D as ImprovementCandidate, E as ImproveSurface, F as AgenticGeneratorShotExecution, H as CandidateGenerator, I as AgenticGeneratorShotReceipt, L as Verifier, M as AGENTIC_PROFILE_RESOURCE_ROOT, N as AgenticGeneratorOptions, O as ImprovementCodeCandidate, P as AgenticGeneratorShotDisposition, R as VerifyResult, S as ImproveProfileSurface, T as ImproveSkillsOptions, V as defaultBuildPrompt, _ as ImproveMethodSource, a as ImproveCandidateValidationInput, b as ImproveProfileAgent, c as ImproveCodeResult, d as ImproveLineage, f as ImproveMethodContext, g as ImproveMethodResult, h as ImproveMethodOptions, i as improve, j as ReadonlyAgentProfile, k as ImprovementProfileCandidate, l as ImproveCodeRunOptions, m as ImproveMethodLineage, o as ImproveCandidateValidator, p as ImproveMethodFactory, s as ImproveCodeOptions, u as ImproveCost, v as ImproveOptimizationRunOptions, w as ImproveScenarioPartitions, x as ImproveProfileComponents, y as ImproveOptions, z as agenticGenerator } from "./redact-PQzmE1Jn.js";
12
- import { C as KnowledgeImprovementActivationExecutor, S as CreateKnowledgeImprovementActivationExecutorOptions, _ as SupervisedKnowledgeUpdater, a as KnowledgeImprovementJobResult, b as knowledgeReadinessDeliverable, c as createAgentKnowledgeReadinessCheck, d as KnowledgeReadinessCheckInput, f as KnowledgeReadinessCheckResult, g as SupervisedKnowledgeUpdateResult, h as SupervisedKnowledgeUpdateOptions, i as KnowledgeImprovementJobMeasurement, l as runKnowledgeImprovementJob, m as SupervisedKnowledgeUpdateInput, n as KnowledgeImprovementCandidatePair, o as RunKnowledgeImprovementJobOptions, p as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, r as KnowledgeImprovementExperimentBundles, s as buildKnowledgeImprovementExperimentBundles, t as AgentKnowledgeReadinessCheckOptions, u as KnowledgeReadinessCheck, v as createSupervisedKnowledgeUpdater, w as createKnowledgeImprovementActivationExecutor, x as runSupervisedKnowledgeUpdate, y as formatSupervisedKnowledgeTask } from "./index-BhuzfG2r.js";
13
- import { _ as researchLoopRunner, a as DELEGATED_LOOP_MODES, c as DelegatedLoopResult, d as ResearchLoopRunnerOptions, f as RunDelegatedLoopOptions, g as isDelegatedLoopMode, h as auditLoopRunner, i as runLoopRunnerCli, l as DelegatedLoopRunner, m as WorktreeLoopRunnerOptions, n as LoopRunnerCliResult, o as DelegatedLoopMode, p as VetoedFact, r as parseLoopRunnerArgv, s as DelegatedLoopRegistry, t as LoopRunnerCliArgs, u as ResearchLoopResult, v as runDelegatedLoop, y as worktreeLoopRunner } from "./loop-runner-bin-Ckp_9tmD.js";
14
- import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "./openai-tools-B68JaOCx.js";
15
- export { AGENTIC_PROFILE_RESOURCE_ROOT, AGENT_CANDIDATE_EXECUTION_SUPPORT, type AgentAdapter, type AgentBackendContext, type AgentBackendInput, type AgentBackendKind, type AgentCandidateArtifactPort, type AgentCandidateBenchmarkGraderIdentity, type AgentCandidateBenchmarkGraderPort, type AgentCandidateBundleInput, type AgentCandidateCodeSource, type AgentCandidateCodeSurfaceSource, type AgentCandidateContainerPort, type AgentCandidateExecutionAttemptRecord, type AgentCandidateExecutionAttemptRef, type AgentCandidateExecutionClaim, type AgentCandidateExecutionClaimResult, type AgentCandidateExecutionClaimStore, type AgentCandidateExecutionCleanupHandles, type AgentCandidateExecutionFailureClass, type AgentCandidateExecutionFinishResult, type AgentCandidateExecutionLease, type AgentCandidateExecutionPhase, type AgentCandidateExecutionPhaseResult, type AgentCandidateExecutionPorts, type AgentCandidateExecutionRecoveryEvidence, type AgentCandidateExecutionStageResult, type AgentCandidateExecutionTerminalRecord, type AgentCandidateExecutionTerminalResult, type AgentCandidateExecutorFinalCapture, type AgentCandidateExecutorMemoryCapture, type AgentCandidateExecutorPort, type AgentCandidateExecutorProfileFile, type AgentCandidateExecutorRequest, type AgentCandidateExecutorStopRequest, type AgentCandidateExecutorTaskOutcomeCapture, type AgentCandidateExecutorWorkspaceFile, type AgentCandidateExecutorWorkspaceInput, type AgentCandidateMemoryPort, type AgentCandidateMemoryResetResult, type AgentCandidateModelGrantActivateInput, type AgentCandidateModelGrantClient, type AgentCandidateModelGrantReservation, type AgentCandidateModelGrantReserveInput, type AgentCandidateModelGrantSettleInput, type AgentCandidateModelLimits, type AgentCandidateModelPort, type AgentCandidateOutputArtifactPort, type AgentCandidateOutputPurpose, type AgentCandidatePreparationEvidence, type AgentCandidateProfileSource, type AgentCandidateProtectedModelActivation, type AgentCandidateProtectedModelReservation, type AgentCandidateProtectedModelSettlement, type AgentCandidateProtectedRunCapture, type AgentCandidateRepositoryPort, type AgentCandidateRetryRejection, type AgentCandidateRunFinalization, type AgentCandidateTaskExecution, type AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, type AgentCandidateWorkspacePort, AgentEvalError, type AgentEvalErrorCode, type AgentExecutionBackend, type AgentKnowledgeProvider, type AgentKnowledgeReadinessCheckOptions, type AgentRuntimeEvent, type AgentRuntimeEventSink, type AgentSpec, type AgentTaskContext, type AgentTaskRunResult, type AgentTaskSpec, type AgentTaskStatus, type AgenticGeneratorOptions, type AgenticGeneratorShotDisposition, type AgenticGeneratorShotExecution, type AgenticGeneratorShotReceipt, type AnalystRegistry, type AuthSource, type BackendCallPolicy, type BackendErrorDetail, type BackendRetryPolicy, BackendTransportError, type Budget, type BuildAgentCandidateBundleInput, type BuildPromptFindingsInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CANDIDATE_TRACE_ENV, CANDIDATE_TRACE_TAGS, type CandidateGenerator, type CanonicalCandidateDocument, type CaptureAgentCandidateWorkspaceOptions, type CapturedAgentCandidateWorkspace, type ChatModelCandidate, type ChatModelValidation, type CircuitBreakerConfig, CircuitBreakerState, CircuitOpenError, ConfigError, type ControlBudget, type ControlDecision, type ControlEvalResult, type ControlRunResult, type ControlStep, type Conversation, type ConversationDriveState, type ConversationJournal, type ConversationJournalEntry, type ConversationParticipant, type ConversationPolicy, type ConversationResult, type ConversationStreamEvent, type ConversationTurn, type CoordinationEvent, type CreateAgentCandidateWorkspacePortOptions, type CreateKnowledgeImprovementActivationExecutorOptions, type CreateProtectedAgentCandidateModelPortOptions, type D1DatabaseLike, type D1StmtLike, DEFAULT_MAX_DEPTH, DEFAULT_ROUTER_BASE_URL, DELEGATED_LOOP_MODES, type DataAcquisitionPlan, DeadlineExceededError, type DeepReadonly, type DelegatedLoopMode, type DelegatedLoopRegistry, type DelegatedLoopResult, type DelegatedLoopRunner, type DisposePreparedAgentCandidateOptions, type Driver, type DriverLoopGeneratorOptions, type EvalRunEvent, type EvalRunGeneration, type EvalRunsExportConfig, type EvalRunsExportResult, type ExactProcessCandidateExecutorOptions, type ExecutePreparedAgentCandidateOptions, type Executor, type ExecutorRegistry, FORWARD_HEADERS, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, FileConversationJournal, type FinalizeContext, type ForwardHeaderName, type HaltContext, type HaltPredicate, type HaltReason, type HaltSignal, INTELLIGENCE_WIRE_VERSION, type ImproveCandidateValidationInput, type ImproveCandidateValidator, type ImproveCodeOptions, type ImproveCodeResult, type ImproveCodeRunOptions, type ImproveCost, type ImproveLineage, type ImproveMethodContext, type ImproveMethodFactory, type ImproveMethodLineage, type ImproveMethodOptions, type ImproveMethodResult, type ImproveMethodSource, type ImproveOptimizationRunOptions, type ImproveOptions, type ImproveProfileAgent, type ImproveProfileComponents, type ImproveProfileSurface, type ImproveResult, type ImproveScenarioPartitions, type ImproveSkillsOptions, type ImproveSurface, type ImprovementCandidate, type ImprovementCodeCandidate, type ImprovementProfileCandidate, InMemoryAgentCandidateExecutionClaimStore, type InMemoryAgentCandidateExecutionClaimStoreOptions, InMemoryConversationJournal, InMemoryRuntimeSessionStore, JudgeError, type KnowledgeImprovementActivationExecutor, type KnowledgeImprovementCandidatePair, type KnowledgeImprovementExperimentBundles, type KnowledgeImprovementJobMeasurement, type KnowledgeImprovementJobResult, type KnowledgeReadinessCheck, type KnowledgeReadinessCheckInput, type KnowledgeReadinessCheckResult, type KnowledgeReadinessDecision, type KnowledgeReadinessReport, type KnowledgeRequirement, type LoopResult, type LoopRunnerCliArgs, type LoopRunnerCliResult, type LoopSpanNode, type McpServeSpec, type ModelInfo, NotFoundError, type OfficialGepaOptions, type OfficialOptimizerContextOptions, OfficialOptimizerUnavailableError, type OfficialSensitiveCandidateInput, type OfficialSkillOptOptions, type OpenAIChatResponseFormat, type OpenAIChatTool, type OpenAIChatToolChoice, type OtelAttribute, type OtelExportConfig, type OtelExporter, type OtelSpan, type PersistedTaskOutcomeEvidence, type PersonaConversationResult, type PersonaDriver, PlannerError, type PrepareAgentCandidateExecutionOptions, type PreparedAgentCandidateExecution, type PreparedAgentCandidateInstruction, type PreparedAgentCandidateKnowledge, type PreparedAgentCandidateLaunch, type PreparedAgentCandidateTrace, type PropagatedHeaders, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, ROLLOUT_POLICY_EXTENSION, type RawTraceDistillerOptions, type ReadonlyAgentProfile, type RecoverExpiredAgentCandidateOptions, type ReflectiveGeneratorOptions, type ResearchLoopResult, type ResearchLoopRunnerOptions, type ResolveAgentBackendOptions, type ResolvedAgentCandidateContainer, type ResolvedChatModel, type RetryBackoff, type RetryableErrorPredicate, type RouterEnv, type RunAgentTaskOptions, type RunAgentTaskStreamOptions, type RunConversationOptions, type RunDelegatedLoopOptions, type RunKnowledgeImprovementJobOptions, type RunPersonaConfig, type RunPersonaConversationOptions, type RunRecord, type RuntimeDecisionEvidenceRef, type RuntimeDecisionKind, type RuntimeDecisionPoint, type RuntimeEventCollector, type RuntimeEventOtelOptions, type RuntimeHookContext, type RuntimeHookErrorContext, type RuntimeHookEvent, type RuntimeHookPhase, type RuntimeHookTarget, type RuntimeHooks, type RuntimeRunCompleteInput, type RuntimeRunCost, type RuntimeRunHandle, type RuntimeRunOptions, type RuntimeRunPersistenceAdapter, type RuntimeRunRow, RuntimeRunStateError, type RuntimeRunStatus, type RuntimeSession, type RuntimeSessionStore, type RuntimeStreamEvent, type RuntimeStreamEventCollector, type RuntimeStreamEventSink, type RuntimeStreamEventSummary, type RuntimeTelemetryOptions, type SanitizedKnowledgeReadinessReport, type SanitizedKnowledgeRequirement, type Scope, type ServerSentEventOptions, type Settled, type Spend, type SqlAdapter, SqlConversationJournal, type SupervisedKnowledgeUpdateInput, type SupervisedKnowledgeUpdateOptions, type SupervisedKnowledgeUpdateResult, type SupervisedKnowledgeUpdater, type SupervisedResult, type Supervisor, type SupervisorFinalizer, type TurnOrder, ValidationError, type VerifiedAgentCandidate, type VerifiedAgentCandidateTaskOutcome, type Verifier, type VerifyResult, type VetoedFact, type WorkerTraceEvidence, type WorkerTraceUnavailableReason, type WorktreeCheckRunner, type WorktreeLoopRunnerOptions, agentCandidateProfileAsAgentProfile, agenticGenerator, applyExactAgentProfileDiff, applyRolloutPolicyToProfile, applyRunRecordDefaults, assertCandidateProfileBinding, auditLoopRunner, buildAgentCandidateBundle, buildDriverSystem, buildForwardHeaders, buildKnowledgeImprovementExperimentBundles, buildLoopOtelSpans, buildLoopSpanNodes, buildRuntimeEventOtelSpans, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, cleanModelId, commandVerifier, composeRuntimeHooks, computeBackoff, createAgentCandidateWorkspacePort, createAgentKnowledgeReadinessCheck, createConversationBackend, createIterableBackend, createKnowledgeImprovementActivationExecutor, createOpenAICompatibleBackend, createOpenInferenceFileExporter, createOtelExporter, createProtectedAgentCandidateModelPort, createRuntimeEventCollector, createRuntimeStreamEventCollector, createSandboxPromptBackend, createSupervisedKnowledgeUpdater, d1ToSqlAdapter, decideKnowledgeReadiness, defaultBuildPrompt, defaultIsRetryable, defineConversation, defineRuntimeHooks, disposePreparedAgentCandidateExecution, driverLoopGenerator, exactProcessProviderAsCandidateExecutor, executePreparedAgentCandidate, exportEvalRuns, findingLines, formatSupervisedKnowledgeTask, freezeGenericAgentCandidateProfile, generateSpanId, getModels, improve, isDelegatedLoopMode, isDepthExceeded, knowledgeReadinessDeliverable, loopEventToOtelSpan, makePerAttemptSignal, mcpBuildPrompt, mcpServeVerifier, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, normalizeRolloutPolicy, notifyRuntimeDecisionPoint, notifyRuntimeHookEvent, officialGepa, officialSkillOpt, omitUndefinedObjectFields, optimizerMethod, padSpanId, padTraceId, parseExactAgentProfile, parseExactAgentProfileDiff, parseExactCandidateProfile, parseLoopRunnerArgv, parseRolloutPolicy, persistCandidateOutputArtifact, prepareAgentCandidateExecution, rawTraceDistiller, readDepth, readinessServerSentEvent, recoverExpiredAgentCandidateExecution, reflectiveGenerator, researchDriverNote, researchLoopRunner, resolveAgentBackend, resolveChatModel, resolveRouterBaseUrl, runAgentTask, runAgentTaskStream, runConversation, runConversationStream, runDelegatedLoop, runKnowledgeImprovementJob, runLoopRunnerCli, runPersonaConversation, runPersonaDispatch, runSupervisedKnowledgeUpdate, runtimeStreamServerSentEvent, sanitizeAgentRuntimeEvent, sanitizeKnowledgeReadinessReport, sanitizeRuntimeStreamEvent, sealAgentCandidateBundle, serializeRolloutPolicy, sleep, slugifySpeaker, startRuntimeRun, strategyAuthorMethod, structuralRolloutPolicyFromProfile, toOtelAttributes, toolBuildPrompt, turnId, validateChatModelId, verifyAgentCandidateBundle, worktreeLoopRunner };
11
+ import { $ as sleep, A as RunConversationOptions, B as buildForwardHeaders, C as ConversationResult, D as HaltPredicate, E as HaltContext, F as InMemoryConversationJournal, G as CircuitBreakerState, H as readDepth, I as DEFAULT_MAX_DEPTH, J as RetryBackoff, K as CircuitOpenError, L as FORWARD_HEADERS, M as ConversationJournal, N as ConversationJournalEntry, O as HaltReason, P as FileConversationJournal, Q as makePerAttemptSignal, R as ForwardHeaderName, S as ConversationPolicy, T as ConversationTurn, U as BackendCallPolicy, V as isDepthExceeded, W as CircuitBreakerConfig, X as computeBackoff, Y as RetryableErrorPredicate, Z as defaultIsRetryable, _ as createConversationBackend, a as RunPersonaConfig, b as ConversationDriveState, c as runPersonaDispatch, d as D1DatabaseLike, et as createProfileExecutionBackend, f as D1StmtLike, g as defineConversation, h as d1ToSqlAdapter, i as PersonaDriver, j as TurnOrder, k as HaltSignal, l as runConversation, m as SqlConversationJournal, n as turnId, o as RunPersonaConversationOptions, p as SqlAdapter, q as DeadlineExceededError, r as PersonaConversationResult, s as runPersonaConversation, t as slugifySpeaker, u as runConversationStream, v as AuthSource, w as ConversationStreamEvent, x as ConversationParticipant, y as Conversation, z as PropagatedHeaders } from "./index-qYHpsmG2.js";
12
+ import { A as ImprovementCandidate, B as Verifier, C as ImproveProfileComponents, D as ImproveScenarioPartitions, E as ImproveRuntimeCodeGeneratorOptions, F as AgenticGeneratorExecutorForWorktree, G as CandidateGenerator, H as agenticGenerator, I as AgenticGeneratorOptions, L as AgenticGeneratorShotDisposition, M as ImprovementProfileCandidate, N as DeepReadonly, O as ImproveSkillsOptions, P as ReadonlyAgentProfile, R as AgenticGeneratorShotExecution, S as ImproveProfileAgent, T as ImproveResult, U as commandVerifier, V as VerifyResult, W as defaultBuildPrompt, _ as ImproveMethodOptions, a as ImproveCandidateValidationInput, b as ImproveOptimizationRunOptions, c as ImproveCodeOptions, d as ImproveCost, f as ImproveCustomCodeGeneratorOptions, g as ImproveMethodLineage, h as ImproveMethodFactory, i as improve, j as ImprovementCodeCandidate, k as ImproveSurface, l as ImproveCodeResult, m as ImproveMethodContext, o as ImproveCandidateValidator, p as ImproveLineage, s as ImproveCodeBaseOptions, t as Redactor, u as ImproveCodeRunOptions, v as ImproveMethodResult, w as ImproveProfileSurface, x as ImproveOptions, y as ImproveMethodSource, z as AgenticGeneratorShotReceipt } from "./redact-9_Gf-8m3.js";
13
+ import { C as KnowledgeImprovementActivationExecutor, S as CreateKnowledgeImprovementActivationExecutorOptions, _ as SupervisedKnowledgeUpdater, a as KnowledgeImprovementJobResult, b as knowledgeReadinessDeliverable, c as createAgentKnowledgeReadinessCheck, d as KnowledgeReadinessCheckInput, f as KnowledgeReadinessCheckResult, g as SupervisedKnowledgeUpdateResult, h as SupervisedKnowledgeUpdateOptions, i as KnowledgeImprovementJobMeasurement, l as runKnowledgeImprovementJob, m as SupervisedKnowledgeUpdateInput, n as KnowledgeImprovementCandidatePair, o as RunKnowledgeImprovementJobOptions, p as RESEARCH_SUPERVISOR_SYSTEM_PROMPT, r as KnowledgeImprovementExperimentBundles, s as buildKnowledgeImprovementExperimentBundles, t as AgentKnowledgeReadinessCheckOptions, u as KnowledgeReadinessCheck, v as createSupervisedKnowledgeUpdater, w as createKnowledgeImprovementActivationExecutor, x as runSupervisedKnowledgeUpdate, y as formatSupervisedKnowledgeTask } from "./index-DwGtu9nc.js";
14
+ import { _ as researchLoopRunner, a as DELEGATED_LOOP_MODES, c as DelegatedLoopResult, d as ResearchLoopRunnerOptions, f as RunDelegatedLoopOptions, g as isDelegatedLoopMode, h as auditLoopRunner, i as runLoopRunnerCli, l as DelegatedLoopRunner, m as WorktreeLoopRunnerOptions, n as LoopRunnerCliResult, o as DelegatedLoopMode, p as VetoedFact, r as parseLoopRunnerArgv, s as DelegatedLoopRegistry, t as LoopRunnerCliArgs, u as ResearchLoopResult, v as runDelegatedLoop, y as worktreeLoopRunner } from "./loop-runner-bin-BwgZ8m_7.js";
15
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "./openai-tools-D3oMyVGl.js";
16
+ import { ControlBudget, ControlDecision, ControlEvalResult, ControlEvalResult as ControlEvalResult$1, ControlRunResult, ControlStep, DataAcquisitionPlan, KnowledgeReadinessReport, KnowledgeReadinessReport as KnowledgeReadinessReport$1, KnowledgeRequirement, ProposalFinding, RunRecord, RunRecord as RunRecord$1 } from "@tangle-network/agent-eval";
17
+ import { GepaOptimizationMethodConfig, SkillOptOptimizationMethodConfig } from "@tangle-network/agent-eval/campaign";
18
+ import { AgentProfile as AgentProfile$1 } from "@tangle-network/agent-interface";
19
+ import { MutableSurface, Scenario as Scenario$1, SelfImproveOptions } from "@tangle-network/agent-eval/contract";
20
+ //#region src/backends.d.ts
21
+ /** Wrap any custom async-iterable stream into a typed `AgentExecutionBackend`. @stable */
22
+ declare function createIterableBackend<TInput extends AgentBackendInput>(options: {
23
+ kind: string;
24
+ start?: AgentExecutionBackend<TInput>['start'];
25
+ resume?: AgentExecutionBackend<TInput>['resume'];
26
+ stream: AgentExecutionBackend<TInput>['stream'];
27
+ stop?: AgentExecutionBackend<TInput>['stop'];
28
+ }): AgentExecutionBackend<TInput>;
29
+ /** Build an `AgentExecutionBackend` backed by a sandbox/sidecar `streamPrompt` call. @stable */
30
+ declare function createSandboxPromptBackend<TBox, TInput extends AgentBackendInput = AgentBackendInput>(options: {
31
+ kind?: string;
32
+ getBox(input: TInput, context: Omit<AgentBackendContext, 'session'>): Promise<TBox> | TBox;
33
+ streamPrompt(box: TBox, message: string, context: AgentBackendContext): AsyncIterable<unknown>;
34
+ mapEvent?: (event: unknown, context: AgentBackendContext) => RuntimeStreamEvent | undefined;
35
+ getSessionId?: (box: TBox, input: TInput) => string | undefined;
36
+ }): AgentExecutionBackend<TInput>;
37
+ //#endregion
38
+ //#region src/improvement/build-prompts.d.ts
39
+ /** Evidence supplied to a generated tool or MCP build instruction. */
40
+ interface BuildPromptFindingsInput {
41
+ findings: ReadonlyArray<ProposalFinding>;
42
+ }
43
+ /** Render findings as the ranked-evidence block every build prompt ends with. */
44
+ declare function findingLines(findings: ReadonlyArray<ProposalFinding>): string[];
45
+ /** Build the starting instruction for a coder agent tasked with implementing a new tool. */
46
+ declare function toolBuildPrompt(args: BuildPromptFindingsInput): string;
47
+ /** Build the starting instruction for a coder agent tasked with implementing a new MCP server. */
48
+ declare function mcpBuildPrompt(args: BuildPromptFindingsInput): string;
49
+ //#endregion
50
+ //#region src/improvement/mcp-serve-verifier.d.ts
51
+ interface McpServeSpec {
52
+ /** Command that starts the built MCP server in the worktree (stdio transport). */
53
+ command: string;
54
+ args?: string[];
55
+ /** Extra env for the server process (merged over `process.env`). */
56
+ env?: Record<string, string>;
57
+ /** Handshake timeout (ms). Default 30s. */
58
+ timeoutMs?: number;
59
+ /** Minimum tools the server must expose to pass. Default 1. */
60
+ minTools?: number;
61
+ }
62
+ /** Build a `Verifier` that boots a generated MCP server over stdio and checks it exposes tools. */
63
+ declare function mcpServeVerifier(spec: McpServeSpec): Verifier;
64
+ //#endregion
65
+ //#region src/improvement/official-optimizers.d.ts
66
+ /** Runtime context appended to an official optimizer's own configuration. */
67
+ interface OfficialOptimizerContextOptions {
68
+ /** Context supplied to the optimizer before Runtime appends the profile surface and findings. */
69
+ background?: string;
70
+ /** Include current trace or analyst findings in the optimizer background. Default true. */
71
+ includeFindings?: boolean;
72
+ /** Reject oversized serialized findings before starting Python. Default 50,000 characters. */
73
+ maxFindingsChars?: number;
74
+ /**
75
+ * Redact caller-supplied context and descriptors before they leave Runtime.
76
+ * The built-in redactor is the default. Pass `false` only for public data
77
+ * that has already been reviewed.
78
+ */
79
+ redact?: Redactor | false;
80
+ /** Authorize one exact candidate containing structurally sensitive fields.
81
+ * The callback must return true for every accepted baseline and candidate. */
82
+ authorizeSensitiveCandidate?: (input: OfficialSensitiveCandidateInput) => boolean;
83
+ }
84
+ interface OfficialSensitiveCandidateInput extends ImproveCandidateValidationInput {
85
+ sensitivePaths: readonly string[];
86
+ }
87
+ /** Official GEPA configuration plus bounded Runtime findings context. */
88
+ type OfficialGepaOptions<TScenario extends {
89
+ id: string;
90
+ kind: string;
91
+ }, TArtifact = unknown> = Omit<GepaOptimizationMethodConfig<TScenario, TArtifact>, 'background' | 'evaluationId'> & OfficialOptimizerContextOptions;
92
+ /** Official SkillOpt configuration plus bounded Runtime findings context. */
93
+ type OfficialSkillOptOptions<TScenario extends {
94
+ id: string;
95
+ kind: string;
96
+ }, TArtifact = unknown> = Omit<SkillOptOptimizationMethodConfig<TScenario, TArtifact>, 'background' | 'evaluationId'> & OfficialOptimizerContextOptions;
97
+ /** Missing optional Python dependencies for an official optimizer. */
98
+ declare class OfficialOptimizerUnavailableError extends ConfigError {
99
+ readonly optimizer: 'gepa' | 'skillopt';
100
+ constructor(optimizer: 'gepa' | 'skillopt', cause: unknown);
101
+ }
102
+ /**
103
+ * Build a complete method backed by GEPA's official Optimize Anything API.
104
+ *
105
+ * The recipe is passed through unchanged. Use `engine`, `sequential`,
106
+ * `adaptive-sequential`, `best-of`, `vote`, or `omni` explicitly.
107
+ */
108
+ declare function officialGepa<TScenario extends {
109
+ id: string;
110
+ kind: string;
111
+ }, TArtifact = unknown>(options: OfficialGepaOptions<TScenario, TArtifact>): ImproveMethodFactory<TScenario, TArtifact>;
112
+ /** Build a complete method backed by Microsoft's official SkillOpt trainer. */
113
+ declare function officialSkillOpt<TScenario extends {
114
+ id: string;
115
+ kind: string;
116
+ }, TArtifact = unknown>(options: OfficialSkillOptOptions<TScenario, TArtifact>): ImproveMethodFactory<TScenario, TArtifact>;
117
+ //#endregion
118
+ //#region src/improvement/optimizer-prompt.d.ts
119
+ /**
120
+ * The senior scientific-method optimizer doctrine — the ONE substantial prompt
121
+ * core shared by every builder/author surface (tool build, MCP build, codebase
122
+ * improvement, and strategy authoring).
123
+ *
124
+ * Seeded from the proven senior prompts rather than invented: GEPA's
125
+ * `REFLECTION_SYSTEM` (localize → diagnose → minimal generalizable fix →
126
+ * preserve what works), the /evolve loop (one hypothesis with a mechanism and a
127
+ * falsifiable prediction; attack the largest measured gap first), /pursue (one
128
+ * coherent change set, no partial scaffolding), and the self-improving-loop /
129
+ * supervisor doctrine (a keep is decided by a real check, never by the author;
130
+ * observe → rate → decide). Generalized from "mutate a prompt string" to
131
+ * "build a code surface a held-out measurement will grade".
132
+ */
133
+ /**
134
+ * The shared method block every build/author prompt embeds. Domain framing
135
+ * (what a tool/MCP/codebase-edit deliverable looks like) wraps around it; this
136
+ * is the process itself.
137
+ */
138
+ declare const optimizerMethod: string;
139
+ /**
140
+ * The senior authoring process for `authorStrategy` — the same method, shaped
141
+ * to the strategy contract (author-blind, conserved budget, one module out).
142
+ */
143
+ declare const strategyAuthorMethod: string;
144
+ //#endregion
145
+ //#region src/improvement/raw-trace-distiller.d.ts
146
+ interface RawTraceDistillerOptions {
147
+ /** Anchor the emitted paths at this run root instead of the generation `runDir`
148
+ * the loop passes in. Normally unset — each call points at that generation's
149
+ * own directory (`input.runDir`). Pass an absolute path when you construct the
150
+ * producer ahead of the loop and want a fixed anchor (e.g. a test fixture). */
151
+ runDir?: string;
152
+ /** Max candidates to surface trace paths for, worst-scoring first. Default 12. */
153
+ maxCandidates?: number;
154
+ /** Max failing cells to enumerate per candidate before collapsing the rest into
155
+ * an "ls the candidate dir" pointer. Default 8. */
156
+ maxCellsPerCandidate?: number;
157
+ /** Max concrete file paths to list per cell (the agent can always `ls` the dir
158
+ * for the rest). Default 24. */
159
+ maxFilesPerCell?: number;
160
+ /** Findings to fall back to when the generation had NO failing cells, so a
161
+ * clean round never wipes the proposer's steering context. Mirrors the default
162
+ * distiller's static-seed fallback. Default: a single instruction finding. */
163
+ fallbackFindings?: ReadonlyArray<ProposalFinding>;
164
+ }
165
+ /**
166
+ * Build an `analyzeGeneration` producer that feeds the proposer RAW-TRACE
167
+ * FILESYSTEM CONTEXT — paths into the prior generation's real run traces plus a
168
+ * grep/cat-to-diagnose instruction — instead of a pre-summarized digest.
169
+ *
170
+ * Drop-in for `analyzeGeneration` on `improve({ surface: 'code' })`:
171
+ *
172
+ * await improve({
173
+ * surface: 'code',
174
+ * findings: seedFindings,
175
+ * code: { repoRoot, profile, executorForWorktree, buildPrompt },
176
+ * runDir: '/abs/run', // MUST be a real path — the traces live here
177
+ * analyzeGeneration: rawTraceDistiller(),
178
+ * scenarios, judge, agent,
179
+ * })
180
+ */
181
+ declare function rawTraceDistiller<TScenario extends Scenario$1 = Scenario$1, TArtifact = unknown>(options?: RawTraceDistillerOptions): NonNullable<SelfImproveOptions<TScenario, TArtifact>['analyzeGeneration']>;
182
+ //#endregion
183
+ //#region src/improvement/reflective-generator.d.ts
184
+ interface ReflectiveGeneratorOptions {
185
+ improvementProposalSource: ImprovementProposalSource<SurfaceImprovementEdit>;
186
+ }
187
+ /** Cheap no-sandbox `CandidateGenerator` (the `shots=1` setting): draft surface edits via the improvement adapter and apply them as one coherent candidate. */
188
+ declare function reflectiveGenerator(opts: ReflectiveGeneratorOptions): CandidateGenerator;
189
+ //#endregion
190
+ //#region src/improvement/rollout-policy.d.ts
191
+ /** The profile extensions namespace the policy persists under. */
192
+ declare const ROLLOUT_POLICY_EXTENSION = "structural-rollout";
193
+ /** Parse a serialized policy surface. Returns `undefined` for non-strings,
194
+ * malformed JSON, or values outside the policy invariants. Unknown fields are
195
+ * dropped; supported optional fields are preserved. */
196
+ declare function parseRolloutPolicy(surface: MutableSurface): StructuralRolloutPolicy | undefined;
197
+ /** Normalize an untyped policy bag (a parsed surface or a profile extension) into
198
+ * a full `StructuralRolloutPolicy`, defaults merged. Returns `undefined` when any
199
+ * present dial violates the policy invariants (mirrors `resolvePolicy`: integer
200
+ * k ≥ 1, repairRounds ≥ 0, testgen ≥ 0) — a corrupt config must read as "not
201
+ * configured", never as a fabricated recipe. */
202
+ declare function normalizeRolloutPolicy(raw: unknown): StructuralRolloutPolicy | undefined;
203
+ /** Stable serialization with fixed field order. */
204
+ declare function serializeRolloutPolicy(policy: StructuralRolloutPolicy): string;
205
+ /** Read the persisted policy off the profile. `undefined` when the profile does
206
+ * not opt into structural rollout. */
207
+ declare function structuralRolloutPolicyFromProfile(profile: ReadonlyAgentProfile): StructuralRolloutPolicy | undefined;
208
+ /** Persist a detached policy under the profile extension without mutating the input. */
209
+ declare function applyRolloutPolicyToProfile(profile: ReadonlyAgentProfile, policy: StructuralRolloutPolicy): AgentProfile$1;
210
+ //#endregion
211
+ //#region src/model-resolution.d.ts
212
+ /**
213
+ *
214
+ * Chat-model resolution + catalog validation — the shared primitive every
215
+ * product chat handler needs and was, until now, hand-rolling. Lifts the
216
+ * router `/v1/models` fetch, the fail-closed id validation, and the
217
+ * precedence resolver out of four near-identical per-repo copies.
218
+ *
219
+ * Policy-free by design: callers pass their own precedence order
220
+ * (`resolveChatModel`) and their own known-good `allowlist`
221
+ * (`validateChatModelId`), so each product keeps its resolution policy while
222
+ * sharing the catalog fetch, the malformed-id guard, and the fail-closed
223
+ * admission rule. No React, no `process.env` assumption — `env` is an
224
+ * explicit narrow record so this runs unchanged in Node and in Workers.
225
+ *
226
+ * @stable
227
+ */
228
+ /**
229
+ * A model entry as returned by the Tangle Router `/v1/models` endpoint.
230
+ * Intentionally minimal — only the fields resolution + validation read.
231
+ */
232
+ interface ModelInfo {
233
+ id: string;
234
+ name?: string;
235
+ description?: string;
236
+ /** Provider slug, when the router exposes it (`provider` or `_provider`). */
237
+ provider?: string;
238
+ _provider?: string;
239
+ architecture?: {
240
+ modality?: string;
241
+ input_modalities?: string[];
242
+ output_modalities?: string[];
243
+ };
244
+ }
245
+ /** Env keys the router base URL is resolved from. */
246
+ interface RouterEnv {
247
+ TANGLE_ROUTER_URL?: string;
248
+ TANGLE_ROUTER_BASE_URL?: string;
249
+ }
250
+ /** Default Tangle Router base URL used when no env override is set. */
251
+ declare const DEFAULT_ROUTER_BASE_URL = "https://router.tangle.tools";
252
+ /** Resolve the router base URL from env, normalised — no trailing `/v1` or `/`. */
253
+ declare function resolveRouterBaseUrl(env?: RouterEnv): string;
254
+ /**
255
+ * Fetch the model catalog from the router's `/v1/models`. Throws on a non-2xx
256
+ * response — callers decide whether to fail open (empty catalog) or closed.
257
+ */
258
+ declare function getModels(routerBaseUrl?: string): Promise<ModelInfo[]>;
259
+ /** Trim a candidate model id; `undefined` for non-strings and blanks. */
260
+ declare function cleanModelId(value: unknown): string | undefined;
261
+ interface ChatModelCandidate {
262
+ /** Stable label for telemetry — e.g. `request`, `workspace`, `env`. */
263
+ source: string;
264
+ model: string | undefined;
265
+ }
266
+ interface ResolvedChatModel {
267
+ source: string;
268
+ model: string;
269
+ }
270
+ /**
271
+ * Resolve a chat model by precedence: the first candidate carrying a
272
+ * non-blank model wins, else `fallback`. The caller owns the precedence
273
+ * order, so each product keeps its own policy (request → workspace → env,
274
+ * etc.) while the first-non-blank logic and the telemetry shape stay shared.
275
+ */
276
+ declare function resolveChatModel(candidates: ChatModelCandidate[], fallback: ResolvedChatModel): ResolvedChatModel;
277
+ type ChatModelValidation = {
278
+ succeeded: true;
279
+ value: string;
280
+ } | {
281
+ succeeded: false;
282
+ error: string;
283
+ };
284
+ /**
285
+ * Validate a caller-supplied chat-model id. Rejects non-strings, malformed
286
+ * ids, and ids absent from both the caller's `allowlist` and the live router
287
+ * catalog. Fails closed: when the catalog cannot be fetched, an unverifiable
288
+ * id is rejected rather than admitted — a bad model never reaches the agent.
289
+ */
290
+ declare function validateChatModelId(modelId: unknown, options?: {
291
+ /**
292
+ * Known-good ids that skip the catalog round trip — e.g. the product's
293
+ * default model plus any env-configured ids.
294
+ */
295
+ allowlist?: string[];
296
+ routerBaseUrl?: string;
297
+ /** Injectable catalog loader — overridden in tests. */
298
+ loadModels?: (routerBaseUrl: string) => Promise<ModelInfo[]>;
299
+ }): Promise<ChatModelValidation>;
300
+ //#endregion
301
+ //#region src/readiness.d.ts
302
+ /**
303
+ * Map a `KnowledgeReadinessReport` to a three-state branch (`ready` / `blocked` / `caveat`) the runtime, route handlers, and UI shells all switch on.
304
+ *
305
+ * @stable
306
+ */
307
+ declare function decideKnowledgeReadiness(report: KnowledgeReadinessReport$1, options?: {
308
+ minimumScore?: number;
309
+ }): KnowledgeReadinessDecision;
310
+ //#endregion
311
+ //#region src/run.d.ts
312
+ /** Stamp cross-cutting defaults onto adapter-projected RunRecords without
313
+ * overriding anything the adapter set explicitly:
314
+ * - `scenarioId` — the run's scenario, when the record omits one.
315
+ * - `failureClass` — the control layer's failure classification promoted
316
+ * onto the canonical cross-agent key, but ONLY when it's a real taxonomy
317
+ * class. This is what lets the substrate aggregate failures across every
318
+ * agent in one vocabulary instead of per-agent ad-hoc strings. */
319
+ declare function applyRunRecordDefaults(records: RunRecord$1[], scenarioId: string, controlFailureClass: string | undefined): RunRecord$1[];
320
+ /**
321
+ * Single-shot task lifecycle for adapter-driven tasks: readiness-gated, emits the runtime lifecycle event vocabulary, session-store pluggable.
322
+ *
323
+ * @stable
324
+ */
325
+ declare function runAgentTask<TState, TAction, TActionResult, TEval extends ControlEvalResult$1 = ControlEvalResult$1>(options: RunAgentTaskOptions<TState, TAction, TActionResult, TEval>): Promise<AgentTaskRunResult<TState, TAction, TActionResult, TEval>>;
326
+ /**
327
+ * Streaming task lifecycle: delegates execution to an `AgentExecutionBackend` (model API, sandbox, or custom iterable) and yields lifecycle events as they happen.
328
+ *
329
+ * @stable
330
+ */
331
+ declare function runAgentTaskStream<TInput extends AgentBackendInput = AgentBackendInput>(options: RunAgentTaskStreamOptions<TInput>): AsyncIterable<RuntimeStreamEvent>;
332
+ //#endregion
333
+ //#region src/sessions.d.ts
334
+ /** In-memory `RuntimeSessionStore` for single-process use and tests. @stable */
335
+ declare class InMemoryRuntimeSessionStore implements RuntimeSessionStore {
336
+ private readonly sessions;
337
+ private readonly events;
338
+ get(sessionId: string): RuntimeSession | undefined;
339
+ put(session: RuntimeSession): void;
340
+ appendEvent(sessionId: string, event: RuntimeStreamEvent): void;
341
+ listEvents(sessionId: string): RuntimeStreamEvent[];
342
+ }
343
+ //#endregion
344
+ //#region src/sse.d.ts
345
+ /** @stable */
346
+ interface ServerSentEventOptions {
347
+ event?: string;
348
+ id?: string;
349
+ retry?: number;
350
+ }
351
+ /** Serialize a `KnowledgeReadinessReport` as a Server-Sent Event string. @stable */
352
+ declare function readinessServerSentEvent(report: KnowledgeReadinessReport$1, options?: RuntimeTelemetryOptions & ServerSentEventOptions): string;
353
+ /** Serialize a `RuntimeStreamEvent` as a Server-Sent Event string. @stable */
354
+ declare function runtimeStreamServerSentEvent(event: RuntimeStreamEvent, options?: RuntimeTelemetryOptions & ServerSentEventOptions): string;
355
+ //#endregion
356
+ export { AGENT_CANDIDATE_EXECUTION_SUPPORT, type AgentAdapter, type AgentBackendContext, type AgentBackendInput, type AgentCandidateArtifactPort, type AgentCandidateBenchmarkGraderIdentity, type AgentCandidateBenchmarkGraderPort, type AgentCandidateBundleInput, type AgentCandidateCodeSource, type AgentCandidateCodeSurfaceSource, type AgentCandidateContainerPort, type AgentCandidateExecutionAttemptRecord, type AgentCandidateExecutionAttemptRef, type AgentCandidateExecutionClaim, type AgentCandidateExecutionClaimResult, type AgentCandidateExecutionClaimStore, type AgentCandidateExecutionCleanupHandles, type AgentCandidateExecutionFailureClass, type AgentCandidateExecutionFinishResult, type AgentCandidateExecutionLease, type AgentCandidateExecutionPhase, type AgentCandidateExecutionPhaseResult, type AgentCandidateExecutionPorts, type AgentCandidateExecutionRecoveryEvidence, type AgentCandidateExecutionStageResult, type AgentCandidateExecutionTerminalRecord, type AgentCandidateExecutionTerminalResult, type AgentCandidateExecutorFinalCapture, type AgentCandidateExecutorMemoryCapture, type AgentCandidateExecutorPort, type AgentCandidateExecutorProfileFile, type AgentCandidateExecutorRequest, type AgentCandidateExecutorStopRequest, type AgentCandidateExecutorTaskOutcomeCapture, type AgentCandidateExecutorWorkspaceFile, type AgentCandidateExecutorWorkspaceInput, type AgentCandidateMemoryPort, type AgentCandidateMemoryResetResult, type AgentCandidateModelGrantActivateInput, type AgentCandidateModelGrantClient, type AgentCandidateModelGrantReservation, type AgentCandidateModelGrantReserveInput, type AgentCandidateModelGrantSettleInput, type AgentCandidateModelLimits, type AgentCandidateModelPort, type AgentCandidateOutputArtifactPort, type AgentCandidateOutputPurpose, type AgentCandidatePreparationEvidence, type AgentCandidateProfileSource, type AgentCandidateProtectedModelActivation, type AgentCandidateProtectedModelReservation, type AgentCandidateProtectedModelSettlement, type AgentCandidateProtectedRunCapture, type AgentCandidateRepositoryPort, type AgentCandidateRetryRejection, type AgentCandidateRunFinalization, type AgentCandidateTaskExecution, type AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, type AgentCandidateWorkspacePort, AgentEvalError, type AgentEvalErrorCode, type AgentExecutionBackend, type AgentKnowledgeProvider, type AgentKnowledgeReadinessCheckOptions, type AgentRuntimeEvent, type AgentRuntimeEventSink, type AgentSpec, type AgentTaskContext, type AgentTaskRunResult, type AgentTaskSpec, type AgentTaskStatus, type AgenticGeneratorExecutorForWorktree, type AgenticGeneratorOptions, type AgenticGeneratorShotDisposition, type AgenticGeneratorShotExecution, type AgenticGeneratorShotReceipt, type AnalystRegistry, type AuthSource, type BackendCallPolicy, type BackendErrorDetail, BackendTransportError, type Budget, type BuildAgentCandidateBundleInput, type BuildPromptFindingsInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CANDIDATE_TRACE_ENV, CANDIDATE_TRACE_TAGS, type CandidateGenerator, type CanonicalCandidateDocument, type CaptureAgentCandidateWorkspaceOptions, type CapturedAgentCandidateWorkspace, type ChatModelCandidate, type ChatModelValidation, type CircuitBreakerConfig, CircuitBreakerState, CircuitOpenError, ConfigError, type ControlBudget, type ControlDecision, type ControlEvalResult, type ControlRunResult, type ControlStep, type Conversation, type ConversationDriveState, type ConversationJournal, type ConversationJournalEntry, type ConversationParticipant, type ConversationPolicy, type ConversationResult, type ConversationStreamEvent, type ConversationTurn, type CoordinationEvent, type CreateAgentCandidateWorkspacePortOptions, type CreateKnowledgeImprovementActivationExecutorOptions, type CreateProtectedAgentCandidateModelPortOptions, type D1DatabaseLike, type D1StmtLike, DEFAULT_MAX_DEPTH, DEFAULT_ROUTER_BASE_URL, DELEGATED_LOOP_MODES, type DataAcquisitionPlan, DeadlineExceededError, type DeepReadonly, type DelegatedLoopMode, type DelegatedLoopRegistry, type DelegatedLoopResult, type DelegatedLoopRunner, type DisposePreparedAgentCandidateOptions, type Driver, type EvalRunEvent, type EvalRunGeneration, type EvalRunsExportConfig, type EvalRunsExportResult, type ExactProcessCandidateExecutorOptions, type ExecutePreparedAgentCandidateOptions, type Executor, type ExecutorRegistry, FORWARD_HEADERS, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, FileConversationJournal, type FinalizeContext, type ForwardHeaderName, type HaltContext, type HaltPredicate, type HaltReason, type HaltSignal, INTELLIGENCE_WIRE_VERSION, type ImproveCandidateValidationInput, type ImproveCandidateValidator, type ImproveCodeBaseOptions, type ImproveCodeOptions, type ImproveCodeResult, type ImproveCodeRunOptions, type ImproveCost, type ImproveCustomCodeGeneratorOptions, type ImproveLineage, type ImproveMethodContext, type ImproveMethodFactory, type ImproveMethodLineage, type ImproveMethodOptions, type ImproveMethodResult, type ImproveMethodSource, type ImproveOptimizationRunOptions, type ImproveOptions, type ImproveProfileAgent, type ImproveProfileComponents, type ImproveProfileSurface, type ImproveResult, type ImproveRuntimeCodeGeneratorOptions, type ImproveScenarioPartitions, type ImproveSkillsOptions, type ImproveSurface, type ImprovementCandidate, type ImprovementCodeCandidate, type ImprovementProfileCandidate, InMemoryAgentCandidateExecutionClaimStore, type InMemoryAgentCandidateExecutionClaimStoreOptions, InMemoryConversationJournal, InMemoryRuntimeSessionStore, JudgeError, type KnowledgeImprovementActivationExecutor, type KnowledgeImprovementCandidatePair, type KnowledgeImprovementExperimentBundles, type KnowledgeImprovementJobMeasurement, type KnowledgeImprovementJobResult, type KnowledgeReadinessCheck, type KnowledgeReadinessCheckInput, type KnowledgeReadinessCheckResult, type KnowledgeReadinessDecision, type KnowledgeReadinessReport, type KnowledgeRequirement, type LoopResult, type LoopRunnerCliArgs, type LoopRunnerCliResult, type LoopSpanNode, type McpServeSpec, type ModelInfo, NotFoundError, type OfficialGepaOptions, type OfficialOptimizerContextOptions, OfficialOptimizerUnavailableError, type OfficialSensitiveCandidateInput, type OfficialSkillOptOptions, type OpenAIChatResponseFormat, type OpenAIChatTool, type OpenAIChatToolChoice, type OtelAttribute, type OtelExportConfig, type OtelExporter, type OtelSpan, type PersistedTaskOutcomeEvidence, type PersonaConversationResult, type PersonaDriver, PlannerError, type PrepareAgentCandidateExecutionOptions, type PreparedAgentCandidateExecution, type PreparedAgentCandidateInstruction, type PreparedAgentCandidateKnowledge, type PreparedAgentCandidateLaunch, type PreparedAgentCandidateTrace, type PropagatedHeaders, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, ROLLOUT_POLICY_EXTENSION, type RawTraceDistillerOptions, type ReadonlyAgentProfile, type RecoverExpiredAgentCandidateOptions, type ReflectiveGeneratorOptions, type ResearchLoopResult, type ResearchLoopRunnerOptions, type ResolvedAgentCandidateContainer, type ResolvedChatModel, type RetryBackoff, type RetryableErrorPredicate, type RouterEnv, type RunAgentTaskOptions, type RunAgentTaskStreamOptions, type RunConversationOptions, type RunDelegatedLoopOptions, type RunKnowledgeImprovementJobOptions, type RunPersonaConfig, type RunPersonaConversationOptions, type RunRecord, type RuntimeDecisionEvidenceRef, type RuntimeDecisionKind, type RuntimeDecisionPoint, type RuntimeEventCollector, type RuntimeEventOtelOptions, type RuntimeHookContext, type RuntimeHookErrorContext, type RuntimeHookEvent, type RuntimeHookPhase, type RuntimeHookTarget, type RuntimeHooks, type RuntimeRunCompleteInput, type RuntimeRunCost, type RuntimeRunHandle, type RuntimeRunOptions, type RuntimeRunPersistenceAdapter, type RuntimeRunRow, RuntimeRunStateError, type RuntimeRunStatus, type RuntimeSession, type RuntimeSessionStore, type RuntimeStreamEvent, type RuntimeStreamEventCollector, type RuntimeStreamEventSink, type RuntimeStreamEventSummary, type RuntimeTelemetryOptions, type SanitizedKnowledgeReadinessReport, type SanitizedKnowledgeRequirement, type Scope, type ServerSentEventOptions, type Settled, type Spend, type SqlAdapter, SqlConversationJournal, type SupervisedKnowledgeUpdateInput, type SupervisedKnowledgeUpdateOptions, type SupervisedKnowledgeUpdateResult, type SupervisedKnowledgeUpdater, type SupervisedResult, type Supervisor, type SupervisorFinalizer, type TurnOrder, ValidationError, type VerifiedAgentCandidate, type VerifiedAgentCandidateTaskOutcome, type Verifier, type VerifyResult, type VetoedFact, type WorkerTraceEvidence, type WorkerTraceUnavailableReason, type WorktreeCheckRunner, type WorktreeLoopRunnerOptions, agentCandidateProfileAsAgentProfile, agenticGenerator, applyExactAgentProfileDiff, applyRolloutPolicyToProfile, applyRunRecordDefaults, assertCandidateProfileBinding, auditLoopRunner, buildAgentCandidateBundle, buildForwardHeaders, buildKnowledgeImprovementExperimentBundles, buildLoopOtelSpans, buildLoopSpanNodes, buildRuntimeEventOtelSpans, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, cleanModelId, commandVerifier, composeRuntimeHooks, computeBackoff, createAgentCandidateWorkspacePort, createAgentKnowledgeReadinessCheck, createConversationBackend, createIterableBackend, createKnowledgeImprovementActivationExecutor, createOpenInferenceFileExporter, createOtelExporter, createProfileExecutionBackend, createProtectedAgentCandidateModelPort, createRuntimeEventCollector, createRuntimeStreamEventCollector, createSandboxPromptBackend, createSupervisedKnowledgeUpdater, d1ToSqlAdapter, decideKnowledgeReadiness, defaultBuildPrompt, defaultIsRetryable, defineConversation, defineRuntimeHooks, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, executePreparedAgentCandidate, exportEvalRuns, findingLines, formatSupervisedKnowledgeTask, freezeGenericAgentCandidateProfile, generateSpanId, getModels, improve, isDelegatedLoopMode, isDepthExceeded, knowledgeReadinessDeliverable, loopEventToOtelSpan, makePerAttemptSignal, mcpBuildPrompt, mcpServeVerifier, mcpToolsForRuntimeMcp, mcpToolsForRuntimeMcpSubset, normalizeRolloutPolicy, notifyRuntimeDecisionPoint, notifyRuntimeHookEvent, officialGepa, officialSkillOpt, omitUndefinedObjectFields, optimizerMethod, padSpanId, padTraceId, parseExactAgentProfile, parseExactAgentProfileDiff, parseExactCandidateProfile, parseLoopRunnerArgv, parseRolloutPolicy, persistCandidateOutputArtifact, prepareAgentCandidateExecution, rawTraceDistiller, readDepth, readinessServerSentEvent, recoverExpiredAgentCandidateExecution, reflectiveGenerator, researchLoopRunner, resolveChatModel, resolveRouterBaseUrl, runAgentTask, runAgentTaskStream, runConversation, runConversationStream, runDelegatedLoop, runKnowledgeImprovementJob, runLoopRunnerCli, runPersonaConversation, runPersonaDispatch, runSupervisedKnowledgeUpdate, runtimeStreamServerSentEvent, sanitizeAgentRuntimeEvent, sanitizeKnowledgeReadinessReport, sanitizeRuntimeStreamEvent, sealAgentCandidateBundle, serializeRolloutPolicy, sleep, slugifySpeaker, startRuntimeRun, strategyAuthorMethod, structuralRolloutPolicyFromProfile, toOtelAttributes, toolBuildPrompt, turnId, validateChatModelId, verifyAgentCandidateBundle, worktreeLoopRunner };
357
+ //# sourceMappingURL=index.d.ts.map