@tangle-network/agent-runtime 0.94.12 → 0.95.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 (80) hide show
  1. package/dist/agent.d.ts +2 -25
  2. package/dist/agent.js +9 -12
  3. package/dist/agent.js.map +1 -1
  4. package/dist/{agentic-generator-DDMM45kZ.d.ts → agentic-generator-hCaQRAes.d.ts} +0 -1
  5. package/dist/analyst-loop.d.ts +1 -1
  6. package/dist/candidate-execution/index.d.ts +43 -16
  7. package/dist/candidate-execution/index.js +18 -8
  8. package/dist/{chunk-VYA2YEKA.js → chunk-2KGAN2HM.js} +83 -14
  9. package/dist/chunk-2KGAN2HM.js.map +1 -0
  10. package/dist/{chunk-FTXM7Q7P.js → chunk-6YBA64Z2.js} +120 -724
  11. package/dist/chunk-6YBA64Z2.js.map +1 -0
  12. package/dist/{chunk-HGRW27YY.js → chunk-AP7CPGMZ.js} +139 -19
  13. package/dist/chunk-AP7CPGMZ.js.map +1 -0
  14. package/dist/{chunk-XP5KDM3R.js → chunk-BPGXIKK7.js} +3 -3
  15. package/dist/{chunk-D3H7F6L2.js → chunk-DHCHL6OG.js} +2 -3
  16. package/dist/chunk-DHCHL6OG.js.map +1 -0
  17. package/dist/{chunk-PCURO3DL.js → chunk-G55QE4IQ.js} +512 -36
  18. package/dist/chunk-G55QE4IQ.js.map +1 -0
  19. package/dist/{chunk-C3UKLQ54.js → chunk-IADLKE7I.js} +14 -4
  20. package/dist/chunk-IADLKE7I.js.map +1 -0
  21. package/dist/{chunk-WIPGQ4GT.js → chunk-IMSNJSXH.js} +1 -1
  22. package/dist/{chunk-WIPGQ4GT.js.map → chunk-IMSNJSXH.js.map} +1 -1
  23. package/dist/{chunk-VSWBYWFK.js → chunk-M6MD6JBS.js} +20 -27
  24. package/dist/chunk-M6MD6JBS.js.map +1 -0
  25. package/dist/chunk-MKGRLDWB.js +684 -0
  26. package/dist/chunk-MKGRLDWB.js.map +1 -0
  27. package/dist/{chunk-AEG3NGJ2.js → chunk-Q2JSAVQ3.js} +34 -2
  28. package/dist/chunk-Q2JSAVQ3.js.map +1 -0
  29. package/dist/{chunk-37V4KQDC.js → chunk-WTZ37EQY.js} +1021 -514
  30. package/dist/chunk-WTZ37EQY.js.map +1 -0
  31. package/dist/{chunk-U33YZ7B2.js → chunk-YLUOTX6U.js} +4 -4
  32. package/dist/{chunk-33OG2NN3.js → chunk-Z5I642SY.js} +2 -2
  33. package/dist/{completion-gate-D1gX1-hg.d.ts → completion-gate-C80jiRfN.d.ts} +1 -1
  34. package/dist/conversation.d.ts +12 -1
  35. package/dist/conversation.js +2 -2
  36. package/dist/{coordination-Dr_axlAf.d.ts → coordination-BFE3Den7.d.ts} +10 -11
  37. package/dist/environment-provider.d.ts +2 -2
  38. package/dist/environment-provider.js +1 -1
  39. package/dist/{improve-BN3HyXIO.d.ts → improve-B-UYaEH5.d.ts} +3 -3
  40. package/dist/index.d.ts +22 -25
  41. package/dist/index.js +45 -50
  42. package/dist/index.js.map +1 -1
  43. package/dist/intelligence.d.ts +177 -119
  44. package/dist/intelligence.js +501 -342
  45. package/dist/intelligence.js.map +1 -1
  46. package/dist/knowledge.d.ts +22 -11
  47. package/dist/knowledge.js +9 -4
  48. package/dist/lifecycle.d.ts +2 -2
  49. package/dist/lifecycle.js +1 -1
  50. package/dist/{loop-runner-bin-BRQSQdHa.d.ts → loop-runner-bin-BIQldFS8.d.ts} +2 -2
  51. package/dist/loop-runner-bin.d.ts +5 -5
  52. package/dist/loop-runner-bin.js +6 -6
  53. package/dist/loops.d.ts +12 -12
  54. package/dist/loops.js +5 -5
  55. package/dist/mcp/bin.js +3 -3
  56. package/dist/mcp/index.d.ts +6 -6
  57. package/dist/mcp/index.js +6 -6
  58. package/dist/{mcp-serve-verifier-DQQDbuyz.d.ts → mcp-serve-verifier-Bs_n0xPc.d.ts} +1 -1
  59. package/dist/primeintellect/index.js +1 -1
  60. package/dist/profile-DbfaMTdk.d.ts +233 -0
  61. package/dist/profiles.d.ts +1 -1
  62. package/dist/{supervise-DmYOug5f.d.ts → supervise-BLPI50-w.d.ts} +3 -3
  63. package/dist/{types-ByAYqlVb.d.ts → types-B3vAW0Oq.d.ts} +1 -1
  64. package/dist/types-CWqfCO8s.d.ts +491 -0
  65. package/dist/{types-1d5QGK3t.d.ts → types-CmnA2iL3.d.ts} +3 -3
  66. package/dist/{worktree-fanout-CPprU-qI.d.ts → worktree-fanout-DCA3G4bO.d.ts} +3 -3
  67. package/package.json +13 -10
  68. package/dist/chunk-37V4KQDC.js.map +0 -1
  69. package/dist/chunk-AEG3NGJ2.js.map +0 -1
  70. package/dist/chunk-C3UKLQ54.js.map +0 -1
  71. package/dist/chunk-D3H7F6L2.js.map +0 -1
  72. package/dist/chunk-FTXM7Q7P.js.map +0 -1
  73. package/dist/chunk-HGRW27YY.js.map +0 -1
  74. package/dist/chunk-PCURO3DL.js.map +0 -1
  75. package/dist/chunk-VSWBYWFK.js.map +0 -1
  76. package/dist/chunk-VYA2YEKA.js.map +0 -1
  77. package/dist/prepare-DIeVgQG3.d.ts +0 -718
  78. /package/dist/{chunk-XP5KDM3R.js.map → chunk-BPGXIKK7.js.map} +0 -0
  79. /package/dist/{chunk-U33YZ7B2.js.map → chunk-YLUOTX6U.js.map} +0 -0
  80. /package/dist/{chunk-33OG2NN3.js.map → chunk-Z5I642SY.js.map} +0 -0
@@ -13,16 +13,16 @@ import {
13
13
  settledToIteration,
14
14
  supervise,
15
15
  withDriverExecutor
16
- } from "./chunk-C3UKLQ54.js";
16
+ } from "./chunk-IADLKE7I.js";
17
17
  import {
18
18
  newRuntimeSession,
19
19
  normalizeBackendStreamEvent,
20
20
  nowIso
21
- } from "./chunk-AEG3NGJ2.js";
21
+ } from "./chunk-Q2JSAVQ3.js";
22
22
  import {
23
23
  InMemoryResultBlobStore,
24
24
  InMemorySpawnJournal
25
- } from "./chunk-WIPGQ4GT.js";
25
+ } from "./chunk-IMSNJSXH.js";
26
26
  import {
27
27
  addTokenUsage,
28
28
  isAbortError,
@@ -5788,4 +5788,4 @@ export {
5788
5788
  computeFindingId,
5789
5789
  makeFinding2 as makeFinding
5790
5790
  };
5791
- //# sourceMappingURL=chunk-U33YZ7B2.js.map
5791
+ //# sourceMappingURL=chunk-YLUOTX6U.js.map
@@ -8,7 +8,7 @@ import {
8
8
  DELEGATION_STATUS_DESCRIPTION,
9
9
  DELEGATION_STATUS_INPUT_SCHEMA,
10
10
  DELEGATION_STATUS_TOOL_NAME
11
- } from "./chunk-C3UKLQ54.js";
11
+ } from "./chunk-IADLKE7I.js";
12
12
 
13
13
  // src/mcp/openai-tools.ts
14
14
  function buildTool(name, description, parameters) {
@@ -45,4 +45,4 @@ export {
45
45
  mcpToolsForRuntimeMcp,
46
46
  mcpToolsForRuntimeMcpSubset
47
47
  };
48
- //# sourceMappingURL=chunk-33OG2NN3.js.map
48
+ //# sourceMappingURL=chunk-Z5I642SY.js.map
@@ -1,6 +1,6 @@
1
1
  import { WorkspacePlanReceipt } from '@tangle-network/agent-profile-materialize';
2
2
  import { L as LocalHarness, C as CodexTokenUsage, c as CodexExecutionPolicy } from './local-harness-ZqCx51u7.js';
3
- import { c as Executor } from './types-1d5QGK3t.js';
3
+ import { c as Executor } from './types-CmnA2iL3.js';
4
4
 
5
5
  /**
6
6
  *
@@ -1,4 +1,4 @@
1
- import { c as AgentExecutionBackend } from './types-BwoZWq-i.js';
1
+ import { c as AgentExecutionBackend, k as RuntimeSessionStore } from './types-BwoZWq-i.js';
2
2
  import { AgentProfile, MaximumCharge } from '@tangle-network/agent-eval';
3
3
  import { Scenario, ProfileDispatchFn } from '@tangle-network/agent-eval/campaign';
4
4
 
@@ -370,6 +370,8 @@ interface ConversationTurn {
370
370
  * `${runId}.t${index}.${speakerSlug}`.
371
371
  */
372
372
  turnId: string;
373
+ /** Backend session used for this turn. Present on turns recorded by session-aware runners. */
374
+ sessionId?: string;
373
375
  text: string;
374
376
  /**
375
377
  * Aggregated backend usage for this turn alone. Populated from any
@@ -424,6 +426,13 @@ interface RunConversationOptions {
424
426
  * driver process crash mid-run loses zero acknowledged turns.
425
427
  */
426
428
  journal?: ConversationJournal;
429
+ /**
430
+ * Stores each participant's backend session. The runner keeps an in-memory
431
+ * store for one invocation when omitted. Reuse a durable store with the same
432
+ * `runId` and journal after a process restart. Backends implementing `resume`
433
+ * continue their provider session; other backends receive the full transcript.
434
+ */
435
+ sessionStore?: RuntimeSessionStore;
427
436
  /**
428
437
  * Headers to forward verbatim to every participant backend call (gateway
429
438
  * propagation: `X-Tangle-Forwarded-Authorization`, run/turn correlation,
@@ -656,6 +665,8 @@ declare class SqlConversationJournal implements ConversationJournal {
656
665
  * forward events as they arrive. Both share one driving loop.
657
666
  *
658
667
  * Distributed-systems primitives layered on top of the loop:
668
+ * - **Participant sessions**: one backend session per participant is resumed
669
+ * between turns; stateless backends receive one reconstructed transcript.
659
670
  * - **Idempotent turn ids** — `turnId(runId, index, speaker)` stays stable
660
671
  * across retries so caching gateways can dedupe.
661
672
  * - **Durable journal** — optional `ConversationJournal` persists every
@@ -23,8 +23,8 @@ import {
23
23
  sleep,
24
24
  slugifySpeaker,
25
25
  turnId
26
- } from "./chunk-VYA2YEKA.js";
27
- import "./chunk-AEG3NGJ2.js";
26
+ } from "./chunk-2KGAN2HM.js";
27
+ import "./chunk-Q2JSAVQ3.js";
28
28
  import "./chunk-YEJR7IXO.js";
29
29
  import "./chunk-DGUM43GV.js";
30
30
  export {
@@ -1,12 +1,12 @@
1
- import { E as ExecutorFactory, e as ExecutorRegistry, i as Spend, A as Agent, S as Scope, a as ResultBlobStore, B as Budget } from './types-1d5QGK3t.js';
1
+ import { E as ExecutorFactory, e as ExecutorRegistry, i as Spend, A as Agent, S as Scope, a as ResultBlobStore, B as Budget } from './types-CmnA2iL3.js';
2
2
  import { AgentProfile } from '@tangle-network/agent-interface';
3
3
  import { U as UiLens, a as UiFinding, C as CoderTask } from './substrate-DO2GHNg2.js';
4
- import { S as SandboxClient, E as ExecCtx, r as LoopTraceEmitter, a as LoopTraceEvent, A as AgentRunSpec } from './types-ByAYqlVb.js';
4
+ import { S as SandboxClient, E as ExecCtx, r as LoopTraceEmitter, b as LoopTraceEvent, A as AgentRunSpec } from './types-B3vAW0Oq.js';
5
5
  import { BackendType, SandboxEvent, SandboxInstance } from '@tangle-network/sandbox';
6
6
  import { AgentEvalError } from '@tangle-network/agent-eval';
7
7
  import { b as ToolSpec, c as RuntimeTelemetryOptions, R as RouterConfig } from './sanitize-BTSsdBXw.js';
8
8
  import { R as RuntimeStreamEvent } from './types-BwoZWq-i.js';
9
- import { G as GitRunner, a as WorktreeCheckRunner, D as DeliverableSpec } from './completion-gate-D1gX1-hg.js';
9
+ import { G as GitRunner, a as WorktreeCheckRunner, D as DeliverableSpec } from './completion-gate-C80jiRfN.js';
10
10
  import { L as LocalHarness } from './local-harness-ZqCx51u7.js';
11
11
  import { ProviderExecutorOptions, AgentEnvironmentProviderRegistry } from './environment-provider.js';
12
12
  import { AgentEnvironmentProvider } from '@tangle-network/agent-interface/environment-provider';
@@ -1012,9 +1012,9 @@ interface DelegateUiAuditResult {
1012
1012
  estimatedDurationMs?: number;
1013
1013
  }
1014
1014
  /**
1015
- * Loose shape of a research output over the wire the substrate cannot
1016
- * import the `ResearchOutput` type from agent-knowledge without inducing
1017
- * a dependency cycle, so the MCP layer treats it structurally.
1015
+ * Provider-neutral research output carried over the MCP boundary. The MCP
1016
+ * layer accepts this structural shape instead of coupling its wire contract to
1017
+ * one research implementation.
1018
1018
  *
1019
1019
  * @experimental
1020
1020
  */
@@ -1908,11 +1908,10 @@ declare function settleDetachedCoderTurn(turn: DetachedTurn, options: SettleDeta
1908
1908
  *
1909
1909
  * Feedback persistence surface for the MCP layer.
1910
1910
  *
1911
- * The substrate cannot import `@tangle-network/agent-knowledge` (it would
1912
- * induce a dependency cycle), so the store is an abstract interface. The
1913
- * default implementation is in-memory; consumers wire their own adapter
1914
- * (a real KbStore-backed sink, an HTTP relay to gtm-agent's knowledge
1915
- * service, etc.) via `createMcpServer({ feedbackStore })`.
1911
+ * Feedback storage is product policy, so the MCP layer depends on this narrow
1912
+ * interface instead of choosing a knowledge store. The default implementation
1913
+ * is in-memory; consumers wire their own durable adapter via
1914
+ * `createMcpServer({ feedbackStore })`.
1916
1915
  *
1917
1916
  * Feedback events are append-only: every rating is a new event with a
1918
1917
  * fresh id, even when the same delegation is rated multiple times. The
@@ -2,8 +2,8 @@ import { AgentProfile, AgentProfileValidationResult } from '@tangle-network/agen
2
2
  import { CreateAgentEnvironmentInput, AgentTurnInput, AgentEnvironmentProvider, AgentEnvironmentCapabilities, AgentProfileRef } from '@tangle-network/agent-interface/environment-provider';
3
3
  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';
4
4
  import { CreateSandboxOptions, BackendType } from '@tangle-network/sandbox';
5
- import { R as Runtime, E as ExecutorFactory } from './types-1d5QGK3t.js';
6
- import { S as SandboxClient } from './types-ByAYqlVb.js';
5
+ import { R as Runtime, E as ExecutorFactory } from './types-CmnA2iL3.js';
6
+ import { S as SandboxClient } from './types-B3vAW0Oq.js';
7
7
  import '@tangle-network/agent-eval';
8
8
  import './types-BwoZWq-i.js';
9
9
 
@@ -4,7 +4,7 @@ import {
4
4
  providerAsSandboxClient,
5
5
  resolveAgentEnvironmentProvider,
6
6
  sandboxClientAsProvider
7
- } from "./chunk-VSWBYWFK.js";
7
+ } from "./chunk-M6MD6JBS.js";
8
8
  import "./chunk-3MDZX7YU.js";
9
9
  import "./chunk-DGUM43GV.js";
10
10
  export {
@@ -2,7 +2,7 @@ import { WorktreeAdapter } from '@tangle-network/agent-eval/campaign';
2
2
  import { Scenario, SelfImproveOptions, SurfaceProposer, SelfImproveResult, MutableSurface } from '@tangle-network/agent-eval/contract';
3
3
  import { AgentProfile } from '@tangle-network/agent-interface';
4
4
  import { L as LocalHarness } from './local-harness-ZqCx51u7.js';
5
- import { V as Verifier, C as CandidateGenerator } from './agentic-generator-DDMM45kZ.js';
5
+ import { V as Verifier, C as CandidateGenerator } from './agentic-generator-hCaQRAes.js';
6
6
 
7
7
  /**
8
8
  *
@@ -65,7 +65,7 @@ type ImproveOptions<TScenario extends Scenario, TArtifact> = Omit<SelfImproveOpt
65
65
  * trace-analyst over the runDir's traces) to replace it; pass `null` to disable
66
66
  * and keep the static `findings` all the way through. */
67
67
  analyzeGeneration?: SelfImproveOptions<TScenario, TArtifact>['analyzeGeneration'] | null;
68
- /** META-HARNESS mode: instead of the ~400-char distilled findings, feed the
68
+ /** META-HARNESS mode: instead of the ~1500-char distilled findings, feed the
69
69
  * proposer RAW-TRACE FILESYSTEM CONTEXT — the PATHS into the prior generation's
70
70
  * real run traces under `runDir` (per-cell `spans.jsonl` event logs +
71
71
  * `cached-result.json` scores + artifacts) plus a `grep`/`cat`-to-diagnose
@@ -169,4 +169,4 @@ declare function applyImprovementWinnerToProfile(profile: AgentProfile, surface:
169
169
  */
170
170
  declare function improve<TScenario extends Scenario, TArtifact>(profile: AgentProfile, findings: unknown[], opts: ImproveOptions<TScenario, TArtifact>): Promise<ImproveResult<TScenario, TArtifact>>;
171
171
 
172
- export { type ImproveSurface as I, type ImproveOptions as a, type ImproveResult as b, type ImproveCodeOptions as c, type ImproveMemoryOptions as d, type ImproveSkillsOptions as e, applyImprovementWinnerToProfile as f, improve as i };
172
+ export { type ImproveOptions as I, type ImproveResult as a, type ImproveCodeOptions as b, type ImproveMemoryOptions as c, type ImproveSkillsOptions as d, type ImproveSurface as e, applyImprovementWinnerToProfile as f, improve as i };
package/dist/index.d.ts CHANGED
@@ -2,38 +2,40 @@ import { AgentEvalError, AnalystFinding, KnowledgeReadinessReport, RunRecord, Co
2
2
  export { AgentEvalError, AgentEvalErrorCode, ConfigError, ControlBudget, ControlDecision, ControlEvalResult, ControlRunResult, ControlStep, DataAcquisitionPlan, JudgeError, KnowledgeReadinessReport, KnowledgeRequirement, NotFoundError, RunRecord, ValidationError } from '@tangle-network/agent-eval';
3
3
  import { c as createOpenAICompatibleBackend } from './backends-BO4Jqoe2.js';
4
4
  export { a as createIterableBackend, b as createSandboxPromptBackend } from './backends-BO4Jqoe2.js';
5
- export { AgentCandidateCodeSource, AgentCandidateCodeSurfaceSource, AgentCandidateModelGrantActivateInput, AgentCandidateModelGrantClient, AgentCandidateModelGrantReservation, AgentCandidateModelGrantReserveInput, AgentCandidateModelGrantSettleInput, AgentCandidateProfileSource, AgentCandidateWorkspaceArchiveLimits, BuildAgentCandidateBundleInput, CaptureAgentCandidateWorkspaceOptions, CapturedAgentCandidateWorkspace, CreateAgentCandidateWorkspacePortOptions, CreateProtectedAgentCandidateModelPortOptions, DisposePreparedAgentCandidateOptions, FileAgentCandidateExecutionClaimStore, FileAgentCandidateExecutionClaimStoreOptions, RecoverExpiredAgentCandidateOptions, applyExactAgentProfileDiff, buildAgentCandidateBundle, candidateExecutionClaim, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, disposePreparedAgentCandidateExecution, parseExactAgentProfile, parseExactAgentProfileDiff, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, verifyAgentCandidateBundle } from './candidate-execution/index.js';
6
- export { d as AgentCandidateArtifactPort, e as AgentCandidateBenchmarkGraderIdentity, f as AgentCandidateBenchmarkGraderPort, A as AgentCandidateBundleInput, g as AgentCandidateContainerPort, h as AgentCandidateExecutionAttemptRecord, i as AgentCandidateExecutionAttemptRef, j as AgentCandidateExecutionClaim, k as AgentCandidateExecutionClaimResult, l as AgentCandidateExecutionClaimStore, m as AgentCandidateExecutionCleanupHandles, n as AgentCandidateExecutionFailureClass, o as AgentCandidateExecutionFinishResult, p as AgentCandidateExecutionLease, q as AgentCandidateExecutionPhase, r as AgentCandidateExecutionPhaseResult, b as AgentCandidateExecutionPorts, s as AgentCandidateExecutionRecoveryEvidence, t as AgentCandidateExecutionStageResult, u as AgentCandidateExecutionTerminalRecord, v as AgentCandidateExecutionTerminalResult, w as AgentCandidateExecutionUsage, x as AgentCandidateExecutorFinalCapture, y as AgentCandidateExecutorMemoryCapture, z as AgentCandidateExecutorPort, B as AgentCandidateExecutorProfileFile, C as AgentCandidateExecutorRequest, D as AgentCandidateExecutorStopRequest, F as AgentCandidateExecutorTaskOutcomeCapture, G as AgentCandidateExecutorWorkspaceFile, H as AgentCandidateExecutorWorkspaceInput, I as AgentCandidateMemoryPort, J as AgentCandidateMemoryResetResult, K as AgentCandidateModelLimits, L as AgentCandidateModelPort, M as AgentCandidateOutputArtifactPort, N as AgentCandidateOutputPurpose, O as AgentCandidateProtectedModelActivation, Q as AgentCandidateProtectedModelCall, R as AgentCandidateProtectedModelReservation, S as AgentCandidateProtectedModelSettlement, T as AgentCandidateProtectedRunCapture, U as AgentCandidateRepositoryPort, V as AgentCandidateRetryRejection, c as AgentCandidateRunFinalization, a as AgentCandidateTaskExecution, W as AgentCandidateVerificationPorts, X as AgentCandidateWorkspacePort, Y as CANDIDATE_TRACE_ENV, Z as CANDIDATE_TRACE_TAGS, _ as CanonicalCandidateDocument, E as ExecutePreparedAgentCandidateOptions, $ as InMemoryAgentCandidateExecutionClaimStore, P as PrepareAgentCandidateExecutionOptions, a0 as PreparedAgentCandidateExecution, a1 as PreparedAgentCandidateInstruction, a2 as PreparedAgentCandidateLaunch, a3 as PreparedAgentCandidateTrace, a4 as ResolvedAgentCandidateContainer, a5 as VerifiedAgentCandidate, a6 as VerifiedAgentCandidateTaskOutcome, a7 as executePreparedAgentCandidate, a8 as prepareAgentCandidateExecution, a9 as sealAgentCandidateBundle } from './prepare-DIeVgQG3.js';
5
+ export { AGENT_CANDIDATE_EXECUTION_SUPPORT, AgentCandidateBundleInput, AgentCandidateCodeSource, AgentCandidateCodeSurfaceSource, AgentCandidateModelGrantActivateInput, AgentCandidateModelGrantClient, AgentCandidateModelGrantReservation, AgentCandidateModelGrantReserveInput, AgentCandidateModelGrantSettleInput, AgentCandidateProfileSource, AgentCandidateWorkspaceArchiveLimits, BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CaptureAgentCandidateWorkspaceOptions, CapturedAgentCandidateWorkspace, CreateAgentCandidateWorkspacePortOptions, CreateProtectedAgentCandidateModelPortOptions, DisposePreparedAgentCandidateOptions, FileAgentCandidateExecutionClaimStore, FileAgentCandidateExecutionClaimStoreOptions, RecoverExpiredAgentCandidateOptions, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, disposePreparedAgentCandidateExecution, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, sealAgentCandidateBundle, verifyAgentCandidateBundle } from './candidate-execution/index.js';
6
+ export { a as AgentCandidateExecutionAttemptRecord, b as AgentCandidateExecutionAttemptRef, c as AgentCandidateExecutionClaim, d as AgentCandidateExecutionClaimResult, A as AgentCandidateExecutionClaimStore, e as AgentCandidateExecutionCleanupHandles, f as AgentCandidateExecutionFailureClass, g as AgentCandidateExecutionFinishResult, h as AgentCandidateExecutionLease, i as AgentCandidateExecutionPhase, j as AgentCandidateExecutionPhaseResult, k as AgentCandidateExecutionRecoveryEvidence, l as AgentCandidateExecutionStageResult, m as AgentCandidateExecutionTerminalRecord, n as AgentCandidateExecutionTerminalResult, o as AgentCandidatePreparationEvidence, q as AgentCandidateRetryRejection, E as ExecutePreparedAgentCandidateOptions, I as InMemoryAgentCandidateExecutionClaimStore, P as PrepareAgentCandidateExecutionOptions, r as applyExactAgentProfileDiff, s as executePreparedAgentCandidate, t as parseExactAgentProfile, u as parseExactAgentProfileDiff, v as prepareAgentCandidateExecution } from './profile-DbfaMTdk.js';
7
+ export { f as AgentCandidateArtifactPort, a as AgentCandidateBenchmarkGraderPort, g as AgentCandidateContainerPort, e as AgentCandidateExecutionPorts, h as AgentCandidateExecutorFinalCapture, i as AgentCandidateExecutorMemoryCapture, A as AgentCandidateExecutorPort, j as AgentCandidateExecutorProfileFile, k as AgentCandidateExecutorRequest, l as AgentCandidateExecutorStopRequest, m as AgentCandidateExecutorTaskOutcomeCapture, n as AgentCandidateExecutorWorkspaceFile, o as AgentCandidateExecutorWorkspaceInput, p as AgentCandidateMemoryPort, q as AgentCandidateMemoryResetResult, r as AgentCandidateModelLimits, s as AgentCandidateModelPort, b as AgentCandidateOutputArtifactPort, t as AgentCandidateOutputPurpose, u as AgentCandidateProtectedModelActivation, v as AgentCandidateProtectedModelReservation, w as AgentCandidateProtectedModelSettlement, x as AgentCandidateProtectedRunCapture, y as AgentCandidateRepositoryPort, c as AgentCandidateRunFinalization, d as AgentCandidateTaskExecution, z as AgentCandidateVerificationPorts, B as AgentCandidateWorkspacePort, C as CANDIDATE_TRACE_ENV, D as CANDIDATE_TRACE_TAGS, E as CanonicalCandidateDocument, P as PreparedAgentCandidateExecution, F as PreparedAgentCandidateInstruction, G as PreparedAgentCandidateKnowledge, H as PreparedAgentCandidateLaunch, I as PreparedAgentCandidateTrace, R as ResolvedAgentCandidateContainer, V as VerifiedAgentCandidate, J as VerifiedAgentCandidateTaskOutcome } from './types-CWqfCO8s.js';
7
8
  export { AuthSource, BackendCallPolicy, CircuitBreakerConfig, CircuitBreakerState, CircuitOpenError, Conversation, ConversationDriveState, ConversationJournal, ConversationJournalEntry, ConversationParticipant, ConversationPolicy, ConversationResult, ConversationStreamEvent, ConversationTurn, D1DatabaseLike, D1StmtLike, DEFAULT_MAX_DEPTH, DeadlineExceededError, FORWARD_HEADERS, FileConversationJournal, ForwardHeaderName, HaltContext, HaltPredicate, HaltReason, HaltSignal, InMemoryConversationJournal, PersonaConversationResult, PersonaDriver, PropagatedHeaders, RetryBackoff, RetryableErrorPredicate, RunConversationOptions, RunPersonaConfig, RunPersonaConversationOptions, SqlAdapter, SqlConversationJournal, TurnOrder, buildForwardHeaders, computeBackoff, createConversationBackend, d1ToSqlAdapter, defaultIsRetryable, defineConversation, isDepthExceeded, makePerAttemptSignal, readDepth, runConversation, runConversationStream, runPersonaConversation, runPersonaDispatch, sleep, slugifySpeaker, turnId } from './conversation.js';
8
- import { C as CandidateGenerator } from './agentic-generator-DDMM45kZ.js';
9
- export { A as AGENTIC_PROFILE_RESOURCE_ROOT, a as AgenticGeneratorOptions, b as AgenticGeneratorShotDisposition, c as AgenticGeneratorShotExecution, d as AgenticGeneratorShotReceipt, I as ImprovementDriverOptions, M as ManagedImprovementDriver, V as Verifier, e as VerifyResult, f as agenticGenerator, g as commandVerifier, i as improvementDriver } from './agentic-generator-DDMM45kZ.js';
10
- export { c as ImproveCodeOptions, d as ImproveMemoryOptions, a as ImproveOptions, b as ImproveResult, e as ImproveSkillsOptions, I as ImproveSurface, f as applyImprovementWinnerToProfile, i as improve } from './improve-BN3HyXIO.js';
11
- export { M as McpServeSpec, m as mcpServeVerifier } from './mcp-serve-verifier-DQQDbuyz.js';
9
+ import { C as CandidateGenerator } from './agentic-generator-hCaQRAes.js';
10
+ export { A as AGENTIC_PROFILE_RESOURCE_ROOT, a as AgenticGeneratorOptions, b as AgenticGeneratorShotDisposition, c as AgenticGeneratorShotExecution, d as AgenticGeneratorShotReceipt, I as ImprovementDriverOptions, M as ManagedImprovementDriver, V as Verifier, e as VerifyResult, f as agenticGenerator, g as commandVerifier, i as improvementDriver } from './agentic-generator-hCaQRAes.js';
11
+ export { b as ImproveCodeOptions, c as ImproveMemoryOptions, I as ImproveOptions, a as ImproveResult, d as ImproveSkillsOptions, e as ImproveSurface, f as applyImprovementWinnerToProfile, i as improve } from './improve-B-UYaEH5.js';
12
+ export { M as McpServeSpec, m as mcpServeVerifier } from './mcp-serve-verifier-Bs_n0xPc.js';
12
13
  import { ProposeContext, SurfaceProposer } from '@tangle-network/agent-eval/campaign';
13
- import { AgentProfileDiff, AgentProfile } from '@tangle-network/agent-interface';
14
+ import { AgentProfile, AgentProfileDiff } from '@tangle-network/agent-interface';
15
+ export { AgentCandidateBenchmarkGraderIdentity } from '@tangle-network/agent-interface';
14
16
  import { Scenario, SelfImproveOptions } from '@tangle-network/agent-eval/contract';
15
17
  import { S as SurfaceImprovementEdit } from './improvement-adapter-BieWeK5J.js';
16
18
  import { I as ImprovementAdapter } from './types-BC3bZpH0.js';
17
- export { AgentKnowledgeReadinessCheckOptions, KnowledgeImprovementJobMeasurement, KnowledgeImprovementJobResult, KnowledgeReadinessCheck, KnowledgeReadinessCheckInput, KnowledgeReadinessCheckResult, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, RunKnowledgeImprovementJobOptions, SupervisedKnowledgeUpdateInput, SupervisedKnowledgeUpdateOptions, SupervisedKnowledgeUpdateResult, SupervisedKnowledgeUpdater, createAgentKnowledgeReadinessCheck, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate } from './knowledge.js';
18
- export { D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, W as WorktreeLoopRunnerOptions, h as auditLoopRunner, i as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, j as runDelegatedLoop, k as runLoopRunnerCli, s as selfImproveLoopRunner, w as worktreeLoopRunner } from './loop-runner-bin-BRQSQdHa.js';
19
+ export { AgentKnowledgeReadinessCheckOptions, ApprovedKnowledgeImprovementCandidate, KnowledgeImprovementJobMeasurement, KnowledgeImprovementJobResult, KnowledgeReadinessCheck, KnowledgeReadinessCheckInput, KnowledgeReadinessCheckResult, RESEARCH_SUPERVISOR_SYSTEM_PROMPT, RunKnowledgeImprovementJobOptions, SupervisedKnowledgeUpdateInput, SupervisedKnowledgeUpdateOptions, SupervisedKnowledgeUpdateResult, SupervisedKnowledgeUpdater, createAgentKnowledgeReadinessCheck, createSupervisedKnowledgeUpdater, formatSupervisedKnowledgeTask, knowledgeReadinessDeliverable, runKnowledgeImprovementJob, runSupervisedKnowledgeUpdate } from './knowledge.js';
20
+ export { D as DELEGATED_LOOP_MODES, a as DelegatedLoopMode, b as DelegatedLoopRegistry, c as DelegatedLoopResult, d as DelegatedLoopRunner, L as LoopRunnerCliArgs, e as LoopRunnerCliResult, R as ResearchLoopResult, f as ResearchLoopRunnerOptions, g as RunDelegatedLoopOptions, V as VetoedFact, W as WorktreeLoopRunnerOptions, h as auditLoopRunner, i as isDelegatedLoopMode, p as parseLoopRunnerArgv, r as researchLoopRunner, j as runDelegatedLoop, k as runLoopRunnerCli, s as selfImproveLoopRunner, w as worktreeLoopRunner } from './loop-runner-bin-BIQldFS8.js';
19
21
  export { m as mcpToolsForRuntimeMcp, a as mcpToolsForRuntimeMcpSubset } from './openai-tools-fnj6SRVg.js';
20
- export { b0 as EvalRunEvent, b1 as EvalRunGeneration, b2 as EvalRunsExportConfig, b3 as EvalRunsExportResult, b4 as INTELLIGENCE_WIRE_VERSION, b5 as LoopSpanNode, b6 as OtelAttribute, b7 as OtelExportConfig, b8 as OtelExporter, b9 as OtelSpan, ba as RuntimeEventOtelOptions, bb as buildLoopOtelSpans, bc as buildLoopSpanNodes, bd as buildRuntimeEventOtelSpans, be as createOtelExporter, bf as exportEvalRuns, bg as loopEventToOtelSpan } from './coordination-Dr_axlAf.js';
22
+ export { b0 as EvalRunEvent, b1 as EvalRunGeneration, b2 as EvalRunsExportConfig, b3 as EvalRunsExportResult, b4 as INTELLIGENCE_WIRE_VERSION, b5 as LoopSpanNode, b6 as OtelAttribute, b7 as OtelExportConfig, b8 as OtelExporter, b9 as OtelSpan, ba as RuntimeEventOtelOptions, bb as buildLoopOtelSpans, bc as buildLoopSpanNodes, bd as buildRuntimeEventOtelSpans, be as createOtelExporter, bf as exportEvalRuns, bg as loopEventToOtelSpan } from './coordination-BFE3Den7.js';
21
23
  import { K as KnowledgeReadinessDecision, A as AgentBackendInput, c as AgentExecutionBackend, h as RunAgentTaskOptions, i as AgentTaskRunResult, j as RunAgentTaskStreamOptions, R as RuntimeStreamEvent, k as RuntimeSessionStore, l as RuntimeSession } from './types-BwoZWq-i.js';
22
24
  export { m as AgentAdapter, d as AgentBackendContext, n as AgentKnowledgeProvider, e as AgentRuntimeEvent, o as AgentRuntimeEventSink, p as AgentTaskContext, g as AgentTaskSpec, f as AgentTaskStatus, B as BackendErrorDetail, b as OpenAIChatResponseFormat, O as OpenAIChatTool, a as OpenAIChatToolChoice } from './types-BwoZWq-i.js';
23
- import { R as RuntimeHooks } from './types-ByAYqlVb.js';
24
- export { c as RuntimeDecisionEvidenceRef, d as RuntimeDecisionKind, e as RuntimeDecisionPoint, f as RuntimeHookContext, g as RuntimeHookErrorContext, h as RuntimeHookEvent, i as RuntimeHookPhase, j as RuntimeHookTarget, k as RuntimeRunHandle, l as RuntimeRunPersistenceAdapter, m as RuntimeRunRow, n as composeRuntimeHooks, o as defineRuntimeHooks, p as notifyRuntimeDecisionPoint, q as notifyRuntimeHookEvent, s as startRuntimeRun } from './types-ByAYqlVb.js';
25
+ import { R as RuntimeHooks } from './types-B3vAW0Oq.js';
26
+ export { c as RuntimeDecisionEvidenceRef, d as RuntimeDecisionKind, e as RuntimeDecisionPoint, f as RuntimeHookContext, g as RuntimeHookErrorContext, h as RuntimeHookEvent, i as RuntimeHookPhase, j as RuntimeHookTarget, k as RuntimeRunHandle, l as RuntimeRunPersistenceAdapter, m as RuntimeRunRow, n as composeRuntimeHooks, o as defineRuntimeHooks, p as notifyRuntimeDecisionPoint, q as notifyRuntimeHookEvent, s as startRuntimeRun } from './types-B3vAW0Oq.js';
25
27
  import { c as RuntimeTelemetryOptions } from './sanitize-BTSsdBXw.js';
26
28
  export { d as RuntimeEventCollector, e as RuntimeStreamEventCollector, S as SanitizedKnowledgeReadinessReport, f as createRuntimeEventCollector, g as createRuntimeStreamEventCollector, s as sanitizeAgentRuntimeEvent, h as sanitizeKnowledgeReadinessReport, i as sanitizeRuntimeStreamEvent } from './sanitize-BTSsdBXw.js';
27
29
  import './local-harness-ZqCx51u7.js';
28
30
  import 'node:child_process';
29
31
  import '@tangle-network/agent-knowledge';
30
- import './supervise-DmYOug5f.js';
31
- import './types-1d5QGK3t.js';
32
+ import './supervise-BLPI50-w.js';
33
+ import './types-CmnA2iL3.js';
32
34
  import '@tangle-network/sandbox';
33
- import './completion-gate-D1gX1-hg.js';
35
+ import './completion-gate-C80jiRfN.js';
34
36
  import '@tangle-network/agent-profile-materialize';
35
37
  import './kb-gate-CwHO0vz6.js';
36
- import './worktree-fanout-CPprU-qI.js';
38
+ import './worktree-fanout-DCA3G4bO.js';
37
39
  import './substrate-DO2GHNg2.js';
38
40
  import './environment-provider.js';
39
41
  import '@tangle-network/agent-interface/environment-provider';
@@ -263,16 +265,11 @@ declare function toolBuildPrompt(args: FindingsArg): string;
263
265
  /** Build the starting instruction for a coder agent tasked with implementing a new MCP server. */
264
266
  declare function mcpBuildPrompt(args: FindingsArg): string;
265
267
 
266
- interface AgentProfileDiffProposal {
267
- diff: AgentProfileDiff;
268
- label?: string;
269
- rationale?: string;
270
- }
271
268
  type ProfileDiffProposerContext<TFindings = unknown> = ProposeContext<TFindings> & {
272
269
  profile: AgentProfile;
273
270
  };
274
271
  interface ProfileDiffProposerOptions<TFindings = unknown> {
275
- proposeDiffs(context: ProfileDiffProposerContext<TFindings>): Promise<readonly AgentProfileDiffProposal[]> | readonly AgentProfileDiffProposal[];
272
+ proposeDiffs(context: ProfileDiffProposerContext<TFindings>): Promise<readonly AgentProfileDiff[]> | readonly AgentProfileDiff[];
276
273
  }
277
274
  /**
278
275
  * Turn exact AgentProfileDiffs from any source into full profile candidates for
@@ -286,7 +283,7 @@ declare function profileDiffProposer<TFindings = unknown>(options: ProfileDiffPr
286
283
  * `rawTraceDistiller` — the meta-harness `analyzeGeneration` producer.
287
284
  *
288
285
  * The default `generationFailureDistiller` (in `improve.ts`) COMPRESSES each
289
- * generation's failing cells into ~400-char structured findings before the next
286
+ * generation's failing cells into ~1500-char structured findings before the next
290
287
  * proposal round. That is the ACE-style recipe: a small summary is the proposer's
291
288
  * whole view of what went wrong. This producer does the opposite — the
292
289
  * meta-harness recipe (yoonholee.com/meta-harness): it does NOT summarize. It
@@ -294,7 +291,7 @@ declare function profileDiffProposer<TFindings = unknown>(options: ProfileDiffPr
294
291
  * disk under `runDir` — the durable per-cell `spans.jsonl` event logs,
295
292
  * `cached-result.json` scores, and any artifacts the substrate persisted — and
296
293
  * instructs the agent to `grep`/`cat`/`ls` them to diagnose the failures itself
297
- * (up to the harness's full context, ~millions of tokens, vs a ~400-char digest).
294
+ * (up to the harness's full context, ~millions of tokens, vs a ~1500-char digest).
298
295
  *
299
296
  * It emits `AnalystFinding[]` so it drops into the SAME `opts.analyzeGeneration`
300
297
  * slot the default distiller uses, and renders through the same
@@ -796,4 +793,4 @@ interface StreamToolLoopOptions<Raw> {
796
793
  * `capped` if it stops for any non-completed reason with calls still pending. */
797
794
  declare function streamToolLoop<Raw>(opts: StreamToolLoopOptions<Raw>): AsyncGenerator<StreamToolLoopYield<Raw>, void, unknown>;
798
795
 
799
- export { AgentBackendInput, type AgentBackendKind, AgentExecutionBackend, type AgentProfileDiffProposal, AgentTaskRunResult, BackendTransportError, CandidateGenerator, type ChatStreamEvent, type ChatTurnHooks, type ChatTurnIdentity, type ChatTurnProducer, type ChatTurnResult, DEFAULT_ROUTER_BASE_URL, InMemoryRuntimeSessionStore, type ModelInfo, PlannerError, type ProfileDiffProposerContext, type ProfileDiffProposerOptions, type RawTraceDistillerOptions, type ReflectiveGeneratorOptions, type ResolveAgentBackendOptions, type ResolvedChatModel, type RouterEnv, type RunChatTurnInput, type RunToolLoopOptions, RuntimeHooks, RuntimeRunStateError, RuntimeSessionStore, RuntimeStreamEvent, RuntimeTelemetryOptions, type StreamToolLoopOptions, type StreamToolLoopYield, type ToolCallOutcome, type ToolLoopAssistantToolCall, type ToolLoopCall, type ToolLoopEvent, type ToolLoopMessage, type ToolLoopResult, type ToolLoopStopReason, applyRunRecordDefaults, cleanModelId, createOpenAICompatibleBackend, decideKnowledgeReadiness, deriveExecutionId, getModels, handleChatTurn, mcpBuildPrompt, profileDiffProposer, rawTraceDistiller, readinessServerSentEvent, reflectiveGenerator, resolveAgentBackend, resolveChatModel, resolveRouterBaseUrl, runAgentTask, runAgentTaskStream, runToolLoop, runtimeStreamServerSentEvent, streamToolLoop, toolBuildPrompt, validateChatModelId };
796
+ export { AgentBackendInput, type AgentBackendKind, AgentExecutionBackend, AgentTaskRunResult, BackendTransportError, CandidateGenerator, type ChatStreamEvent, type ChatTurnHooks, type ChatTurnIdentity, type ChatTurnProducer, type ChatTurnResult, DEFAULT_ROUTER_BASE_URL, InMemoryRuntimeSessionStore, type ModelInfo, PlannerError, type ProfileDiffProposerContext, type ProfileDiffProposerOptions, type RawTraceDistillerOptions, type ReflectiveGeneratorOptions, type ResolveAgentBackendOptions, type ResolvedChatModel, type RouterEnv, type RunChatTurnInput, type RunToolLoopOptions, RuntimeHooks, RuntimeRunStateError, RuntimeSessionStore, RuntimeStreamEvent, RuntimeTelemetryOptions, type StreamToolLoopOptions, type StreamToolLoopYield, type ToolCallOutcome, type ToolLoopAssistantToolCall, type ToolLoopCall, type ToolLoopEvent, type ToolLoopMessage, type ToolLoopResult, type ToolLoopStopReason, applyRunRecordDefaults, cleanModelId, createOpenAICompatibleBackend, decideKnowledgeReadiness, deriveExecutionId, getModels, handleChatTurn, mcpBuildPrompt, profileDiffProposer, rawTraceDistiller, readinessServerSentEvent, reflectiveGenerator, resolveAgentBackend, resolveChatModel, resolveRouterBaseUrl, runAgentTask, runAgentTaskStream, runToolLoop, runtimeStreamServerSentEvent, streamToolLoop, toolBuildPrompt, validateChatModelId };
package/dist/index.js CHANGED
@@ -6,22 +6,25 @@ import {
6
6
  knowledgeReadinessDeliverable,
7
7
  runKnowledgeImprovementJob,
8
8
  runSupervisedKnowledgeUpdate
9
- } from "./chunk-HGRW27YY.js";
9
+ } from "./chunk-AP7CPGMZ.js";
10
10
  import "./chunk-5QOB7H74.js";
11
11
  import {
12
12
  FileAgentCandidateExecutionClaimStore,
13
13
  buildAgentCandidateBundle,
14
- captureAgentCandidateWorkspace,
15
- captureAgentCandidateWorkspaceFiles,
16
- createAgentCandidateWorkspacePort,
17
14
  createProtectedAgentCandidateModelPort,
18
15
  disposePreparedAgentCandidateExecution,
19
- recoverExpiredAgentCandidateExecution
20
- } from "./chunk-FTXM7Q7P.js";
16
+ recoverExpiredAgentCandidateExecution,
17
+ sealAgentCandidateBundle
18
+ } from "./chunk-6YBA64Z2.js";
19
+ import {
20
+ captureAgentCandidateWorkspace,
21
+ captureAgentCandidateWorkspaceFiles,
22
+ createAgentCandidateWorkspacePort
23
+ } from "./chunk-MKGRLDWB.js";
21
24
  import {
22
25
  mcpToolsForRuntimeMcp,
23
26
  mcpToolsForRuntimeMcpSubset
24
- } from "./chunk-33OG2NN3.js";
27
+ } from "./chunk-Z5I642SY.js";
25
28
  import {
26
29
  DEFAULT_ROUTER_BASE_URL,
27
30
  cleanModelId,
@@ -40,7 +43,7 @@ import {
40
43
  runLoopRunnerCli,
41
44
  selfImproveLoopRunner,
42
45
  worktreeLoopRunner
43
- } from "./chunk-XP5KDM3R.js";
46
+ } from "./chunk-BPGXIKK7.js";
44
47
  import "./chunk-SGKPNBXE.js";
45
48
  import {
46
49
  CircuitBreakerState,
@@ -67,46 +70,49 @@ import {
67
70
  sleep,
68
71
  slugifySpeaker,
69
72
  turnId
70
- } from "./chunk-VYA2YEKA.js";
73
+ } from "./chunk-2KGAN2HM.js";
71
74
  import {
72
75
  applyImprovementWinnerToProfile,
73
76
  improve,
74
77
  improvementDriver,
75
78
  rawTraceDistiller
76
- } from "./chunk-PCURO3DL.js";
79
+ } from "./chunk-G55QE4IQ.js";
77
80
  import {
81
+ AGENT_CANDIDATE_EXECUTION_SUPPORT,
82
+ CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV,
83
+ CANDIDATE_KNOWLEDGE_ROOT_ENV,
78
84
  CANDIDATE_TRACE_ENV,
79
85
  CANDIDATE_TRACE_TAGS,
80
86
  InMemoryAgentCandidateExecutionClaimStore,
81
87
  applyExactAgentProfileDiff,
82
88
  candidateExecutionClaim,
89
+ candidateKnowledgeExecutionPaths,
83
90
  canonicalCandidateDigest,
84
91
  executePreparedAgentCandidate,
85
92
  parseExactAgentProfile,
86
93
  parseExactAgentProfileDiff,
87
94
  persistCandidateOutputArtifact,
88
95
  prepareAgentCandidateExecution,
89
- sealAgentCandidateBundle,
90
96
  verifyAgentCandidateBundle
91
- } from "./chunk-37V4KQDC.js";
92
- import "./chunk-U33YZ7B2.js";
97
+ } from "./chunk-WTZ37EQY.js";
98
+ import "./chunk-YLUOTX6U.js";
93
99
  import {
94
100
  composeRuntimeHooks,
95
101
  defineRuntimeHooks,
96
102
  notifyRuntimeDecisionPoint,
97
103
  notifyRuntimeHookEvent
98
- } from "./chunk-C3UKLQ54.js";
104
+ } from "./chunk-IADLKE7I.js";
99
105
  import "./chunk-DPEUKJRO.js";
100
106
  import {
101
107
  InMemoryRuntimeSessionStore,
102
108
  createIterableBackend,
103
109
  createOpenAICompatibleBackend,
104
110
  createSandboxPromptBackend,
105
- newRuntimeSession,
106
111
  normalizeBackendStreamEvent,
107
112
  nowIso,
113
+ startOrResumeRuntimeSession,
108
114
  touchSession
109
- } from "./chunk-AEG3NGJ2.js";
115
+ } from "./chunk-Q2JSAVQ3.js";
110
116
  import {
111
117
  INTELLIGENCE_WIRE_VERSION,
112
118
  buildLoopOtelSpans,
@@ -121,8 +127,8 @@ import {
121
127
  sanitizeKnowledgeReadinessReport,
122
128
  sanitizeRuntimeStreamEvent
123
129
  } from "./chunk-ISTDY47H.js";
124
- import "./chunk-WIPGQ4GT.js";
125
- import "./chunk-VSWBYWFK.js";
130
+ import "./chunk-IMSNJSXH.js";
131
+ import "./chunk-M6MD6JBS.js";
126
132
  import "./chunk-3MDZX7YU.js";
127
133
  import "./chunk-QDSOD7RC.js";
128
134
  import "./chunk-M22PL4GH.js";
@@ -135,7 +141,7 @@ import {
135
141
  AGENTIC_PROFILE_RESOURCE_ROOT,
136
142
  agenticGenerator,
137
143
  commandVerifier
138
- } from "./chunk-D3H7F6L2.js";
144
+ } from "./chunk-DHCHL6OG.js";
139
145
  import "./chunk-EP6RVHMX.js";
140
146
  import {
141
147
  AgentEvalError,
@@ -145,7 +151,6 @@ import {
145
151
  NotFoundError,
146
152
  PlannerError,
147
153
  RuntimeRunStateError,
148
- SessionMismatchError,
149
154
  ValidationError
150
155
  } from "./chunk-YEJR7IXO.js";
151
156
  import "./chunk-DGUM43GV.js";
@@ -256,13 +261,13 @@ function profileDiffProposer(options) {
256
261
  const candidates = [];
257
262
  const normalizedBaseline = applyExactAgentProfileDiff(
258
263
  profile,
259
- { schemaVersion: 1, kind: "agent-profile-diff" },
264
+ { kind: "agent-profile-diff" },
260
265
  "profile diff baseline"
261
266
  );
262
267
  const seen = /* @__PURE__ */ new Set([canonicalJson(normalizedBaseline)]);
263
268
  for (const [index, proposal] of proposals.entries()) {
264
269
  if (candidates.length >= ctx.populationSize || ctx.signal.aborted) break;
265
- const diff = parseExactAgentProfileDiff(proposal.diff, `profile diff proposal ${index}`);
270
+ const diff = parseExactAgentProfileDiff(proposal, `profile diff proposal ${index}`);
266
271
  const axes = changedAgentProfileAxes(diff);
267
272
  if (axes.length === 0) continue;
268
273
  const candidate = applyExactAgentProfileDiff(
@@ -275,16 +280,16 @@ function profileDiffProposer(options) {
275
280
  seen.add(surface);
276
281
  candidates.push({
277
282
  surface,
278
- label: proposal.label ?? diff.title ?? diff.id ?? `Change ${axes.join(", ")}`,
279
- rationale: candidateRationale(proposal, diff, axes)
283
+ label: diff.title ?? diff.id ?? `Change ${axes.join(", ")}`,
284
+ rationale: candidateRationale(diff, axes)
280
285
  });
281
286
  }
282
287
  return candidates;
283
288
  }
284
289
  };
285
290
  }
286
- function candidateRationale(proposal, diff, axes) {
287
- const reason = proposal.rationale ?? diff.rationale ?? `Changes profile axes: ${axes.join(", ")}.`;
291
+ function candidateRationale(diff, axes) {
292
+ const reason = diff.rationale ?? `Changes profile axes: ${axes.join(", ")}.`;
288
293
  const source = diff.source ? [diff.source.kind, ...diff.source.artifacts ?? []].join(" \xB7 ") : "source unspecified";
289
294
  return `${reason} Source: ${source}. Diff: ${canonicalCandidateDigest(diff)}.`;
290
295
  }
@@ -557,19 +562,16 @@ async function* runAgentTaskStream(options) {
557
562
  return;
558
563
  }
559
564
  const store = options.sessionStore;
560
- const existing = options.sessionId ? await store?.get(options.sessionId) : void 0;
561
- const shouldResume = Boolean(options.resume && existing);
562
- let session = shouldResume && existing ? await resumeBackendSession(options.backend, existing, input, {
563
- task,
564
- knowledge,
565
- signal: options.signal
566
- }) : await startBackendSession(
567
- options.backend,
565
+ const opened = await startOrResumeRuntimeSession({
566
+ backend: options.backend,
568
567
  input,
569
- { task, knowledge, signal: options.signal },
570
- options.sessionId
571
- );
572
- await store?.put(session);
568
+ context: { task, knowledge, signal: options.signal },
569
+ store,
570
+ sessionId: options.sessionId,
571
+ resume: options.resume
572
+ });
573
+ let session = opened.session;
574
+ const shouldResume = opened.resumed;
573
575
  const sessionEvent = streamEvent({
574
576
  type: shouldResume ? "session_resumed" : "session_created",
575
577
  task,
@@ -587,7 +589,7 @@ async function* runAgentTaskStream(options) {
587
589
  yield backendStart;
588
590
  let finalText = "";
589
591
  try {
590
- for await (const rawEvent of options.backend.stream(input, {
592
+ for await (const rawEvent of options.backend.stream(opened.input, {
591
593
  task,
592
594
  knowledge,
593
595
  session,
@@ -709,17 +711,6 @@ async function runKnowledgePreflightStream(task, questions, acquisitionPlans, pr
709
711
  function streamEvent(event) {
710
712
  return { ...event, timestamp: nowIso() };
711
713
  }
712
- async function startBackendSession(backend, input, context, requestedSessionId) {
713
- if (backend.start) return backend.start(input, { ...context, requestedSessionId });
714
- return newRuntimeSession(backend.kind, requestedSessionId);
715
- }
716
- async function resumeBackendSession(backend, session, input, context) {
717
- if (session.backend !== backend.kind) {
718
- throw new SessionMismatchError(session.backend, backend.kind);
719
- }
720
- if (backend.resume) return backend.resume(session, input, context);
721
- return touchSession({ ...session, status: "active" });
722
- }
723
714
  function buildReadiness(task, provider) {
724
715
  if (provider?.buildReadiness) return provider.buildReadiness(task);
725
716
  return scoreKnowledgeReadiness({
@@ -1394,8 +1385,11 @@ function randomSuffix2(len = 8) {
1394
1385
  }
1395
1386
  export {
1396
1387
  AGENTIC_PROFILE_RESOURCE_ROOT,
1388
+ AGENT_CANDIDATE_EXECUTION_SUPPORT,
1397
1389
  AgentEvalError,
1398
1390
  BackendTransportError,
1391
+ CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV,
1392
+ CANDIDATE_KNOWLEDGE_ROOT_ENV,
1399
1393
  CANDIDATE_TRACE_ENV,
1400
1394
  CANDIDATE_TRACE_TAGS,
1401
1395
  CircuitBreakerState,
@@ -1430,6 +1424,7 @@ export {
1430
1424
  buildLoopSpanNodes,
1431
1425
  buildRuntimeEventOtelSpans,
1432
1426
  candidateExecutionClaim,
1427
+ candidateKnowledgeExecutionPaths,
1433
1428
  captureAgentCandidateWorkspace,
1434
1429
  captureAgentCandidateWorkspaceFiles,
1435
1430
  cleanModelId,