@tangle-network/agent-runtime 0.338.0 → 0.339.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 (140) hide show
  1. package/dist/{activation-CsbNax2X.d.ts → activation-CJIIl_Ey.d.ts} +4 -24
  2. package/dist/{activation-kbkAuSmY.js → activation-CVSFxis9.js} +5 -18
  3. package/dist/{activation-kbkAuSmY.js.map → activation-CVSFxis9.js.map} +1 -1
  4. package/dist/agent.d.ts +4 -4
  5. package/dist/agent.js +3 -3
  6. package/dist/{bundle-DM60AI2B.js → bundle-DVOhBTic.js} +2 -2
  7. package/dist/{bundle-DM60AI2B.js.map → bundle-DVOhBTic.js.map} +1 -1
  8. package/dist/candidate-execution/index.d.ts +4 -63
  9. package/dist/candidate-execution/index.js +6 -145
  10. package/dist/candidate-execution/index.js.map +1 -1
  11. package/dist/{delegate-Se1YZKMb.js → delegate-CCWE_AkU.js} +2 -2
  12. package/dist/{delegate-Se1YZKMb.js.map → delegate-CCWE_AkU.js.map} +1 -1
  13. package/dist/{driver-control-acknowledgers-T2a1Ouay.js → driver-control-acknowledgers-C53ggdJ6.js} +12 -8
  14. package/dist/driver-control-acknowledgers-C53ggdJ6.js.map +1 -0
  15. package/dist/{durable-file-B_eJr6Mb.js → durable-file-gNI9ILAn.js} +1 -3
  16. package/dist/durable-file-gNI9ILAn.js.map +1 -0
  17. package/dist/durable.d.ts +3 -35
  18. package/dist/durable.js +10 -10
  19. package/dist/durable.js.map +1 -1
  20. package/dist/{graph-CY0wH838.js → graph-CI9JXKqO.js} +4 -4
  21. package/dist/graph-CI9JXKqO.js.map +1 -0
  22. package/dist/{graph-registry-By0tUj4S.js → graph-registry-BnO64cn8.js} +3 -3
  23. package/dist/{graph-registry-By0tUj4S.js.map → graph-registry-BnO64cn8.js.map} +1 -1
  24. package/dist/{improve-CWGBT13K.js → improve-BOXTLWJ3.js} +8 -35
  25. package/dist/improve-BOXTLWJ3.js.map +1 -0
  26. package/dist/{improvement-adapter-D5gwwoXQ.d.ts → improvement-adapter-HUt_-cWA.d.ts} +2 -20
  27. package/dist/index.d.ts +9 -206
  28. package/dist/index.js +91 -302
  29. package/dist/index.js.map +1 -1
  30. package/dist/intelligence.d.ts +10 -142
  31. package/dist/intelligence.js +7 -81
  32. package/dist/intelligence.js.map +1 -1
  33. package/dist/{jsonl-file-DBv31uPi.js → jsonl-file-C9Kde_0Z.js} +2 -2
  34. package/dist/{jsonl-file-DBv31uPi.js.map → jsonl-file-C9Kde_0Z.js.map} +1 -1
  35. package/dist/kernel.d.ts +4 -3
  36. package/dist/kernel.js +12 -14
  37. package/dist/loop-runner-CWzG1bH4.d.ts +32 -0
  38. package/dist/loop-runner-bin.d.ts +32 -2
  39. package/dist/loop-runner-bin.js +93 -1
  40. package/dist/loop-runner-bin.js.map +1 -0
  41. package/dist/loop-runner-pmPIHFVY.js +59 -0
  42. package/dist/loop-runner-pmPIHFVY.js.map +1 -0
  43. package/dist/mcp/bin.js +3 -3
  44. package/dist/mcp/index.d.ts +99 -418
  45. package/dist/mcp/index.js +121 -203
  46. package/dist/mcp/index.js.map +1 -1
  47. package/dist/mcp/memory-bin.js +231 -1
  48. package/dist/mcp/memory-bin.js.map +1 -1
  49. package/dist/model-policy-CyCUwHed.js.map +1 -1
  50. package/dist/placement.d.ts +2 -9
  51. package/dist/placement.js +1 -1
  52. package/dist/placement.js.map +1 -1
  53. package/dist/platform.d.ts +188 -1
  54. package/dist/platform.js +129 -1
  55. package/dist/platform.js.map +1 -1
  56. package/dist/{prepare-Bt0IouPq.js → prepare-bXkvPMJA.js} +8 -160
  57. package/dist/prepare-bXkvPMJA.js.map +1 -0
  58. package/dist/{profile-Do-5xO_D.js → profile-Dpei_Sq0.js} +2 -2
  59. package/dist/profile-Dpei_Sq0.js.map +1 -0
  60. package/dist/{profile-materialization-BnoEf1co.d.ts → profile-materialization-B1wm2SPT.d.ts} +3 -5
  61. package/dist/profiles.d.ts +2 -2
  62. package/dist/profiles.js +3 -40
  63. package/dist/profiles.js.map +1 -1
  64. package/dist/{protected-model-port-DGxQ8_YM.d.ts → protected-model-port-BGgpy2r9.d.ts} +3 -29
  65. package/dist/protected-redaction-DFCeo4vg.js.map +1 -1
  66. package/dist/{provision-supervisor-0jMufp4h.js → provision-supervisor-CJ6Zz6dz.js} +6 -6
  67. package/dist/{provision-supervisor-0jMufp4h.js.map → provision-supervisor-CJ6Zz6dz.js.map} +1 -1
  68. package/dist/{run-cancellation-BoW5Sg9Y.js → run-cancellation-C9oL62sW.js} +3 -7
  69. package/dist/{run-cancellation-BoW5Sg9Y.js.map → run-cancellation-C9oL62sW.js.map} +1 -1
  70. package/dist/{runtime-D37zRSs7.js → runtime-B2fjL9Oi.js} +2531 -2889
  71. package/dist/runtime-B2fjL9Oi.js.map +1 -0
  72. package/dist/{runtime-hooks-Bj6wJHlH.d.ts → runtime-hooks-nsqxSUFL.d.ts} +2 -6
  73. package/dist/{sandbox-profile-compat-xSoVtdWw.js → sandbox-profile-compat-BzVBFqrz.js} +2 -4
  74. package/dist/sandbox-profile-compat-BzVBFqrz.js.map +1 -0
  75. package/dist/{search-executor-DmgUm5p7.js → search-executor-zMumiak_.js} +3 -3
  76. package/dist/search-executor-zMumiak_.js.map +1 -0
  77. package/dist/{server-DQHJszfk.js → server-_4voDNrl.js} +362 -67
  78. package/dist/server-_4voDNrl.js.map +1 -0
  79. package/dist/{structural-rollout-DAvIE8mw.js → structural-rollout-DpLCXzaL.js} +80 -80
  80. package/dist/structural-rollout-DpLCXzaL.js.map +1 -0
  81. package/dist/{substrate-B0TYNrXn.js → substrate-CGDFTSRh.js} +2 -9
  82. package/dist/substrate-CGDFTSRh.js.map +1 -0
  83. package/dist/{supervise-WuPAwfPh.js → supervise-qAwXmPtD.js} +10 -57
  84. package/dist/supervise-qAwXmPtD.js.map +1 -0
  85. package/dist/{supervisor-CPG1I9UN.js → supervisor-DHrUJhEZ.js} +179 -236
  86. package/dist/supervisor-DHrUJhEZ.js.map +1 -0
  87. package/dist/testing.d.ts +2 -2
  88. package/dist/testing.js +13 -13
  89. package/dist/testing.js.map +1 -1
  90. package/dist/tool-loop.d.ts +1 -1
  91. package/dist/{tool-server-Dqer2M4_.js → tool-server-XV4aJwoQ.js} +2 -2
  92. package/dist/tool-server-XV4aJwoQ.js.map +1 -0
  93. package/dist/top-snapshot-CbZE1JsU.js +502 -0
  94. package/dist/top-snapshot-CbZE1JsU.js.map +1 -0
  95. package/dist/tui/bin.js +711 -1
  96. package/dist/tui/bin.js.map +1 -1
  97. package/dist/tui/index.d.ts +2 -70
  98. package/dist/tui/index.js +3 -3
  99. package/dist/{types-CrNWif8-.d.ts → types-CaOXqRTq.d.ts} +713 -2096
  100. package/dist/workspace-store/index.d.ts +2 -27
  101. package/dist/workspace-store/index.js +2 -2
  102. package/dist/workspace-store/index.js.map +1 -1
  103. package/dist/{workspace-streams-BZZds1Fw.d.ts → workspace-streams-BiS4ABah.d.ts} +3 -18
  104. package/package.json +1 -1
  105. package/skills/agent-graphs/references/authoring.md +3 -2
  106. package/dist/coder-yhVWbdWc.js +0 -40
  107. package/dist/coder-yhVWbdWc.js.map +0 -1
  108. package/dist/delegation-status-CF4D0NZ_.js +0 -358
  109. package/dist/delegation-status-CF4D0NZ_.js.map +0 -1
  110. package/dist/driver-control-acknowledgers-T2a1Ouay.js.map +0 -1
  111. package/dist/durable-file-B_eJr6Mb.js.map +0 -1
  112. package/dist/graph-CY0wH838.js.map +0 -1
  113. package/dist/improve-CWGBT13K.js.map +0 -1
  114. package/dist/integrations-6xttbPi9.d.ts +0 -190
  115. package/dist/integrations-dFi-ALk7.js +0 -132
  116. package/dist/integrations-dFi-ALk7.js.map +0 -1
  117. package/dist/kb-gate-C8z2juK8.d.ts +0 -80
  118. package/dist/kb-gate-DpaSwXVx.js +0 -80
  119. package/dist/kb-gate-DpaSwXVx.js.map +0 -1
  120. package/dist/loop-runner-bin-CFnrAHpl.d.ts +0 -164
  121. package/dist/loop-runner-bin-CdPlhy9g.js +0 -246
  122. package/dist/loop-runner-bin-CdPlhy9g.js.map +0 -1
  123. package/dist/memory-server-DXQ8IxGR.js +0 -234
  124. package/dist/memory-server-DXQ8IxGR.js.map +0 -1
  125. package/dist/openai-tools-DoQ32vpe.js +0 -44
  126. package/dist/openai-tools-DoQ32vpe.js.map +0 -1
  127. package/dist/openai-tools-zh2I_uD7.d.ts +0 -24
  128. package/dist/prepare-Bt0IouPq.js.map +0 -1
  129. package/dist/profile-Do-5xO_D.js.map +0 -1
  130. package/dist/runtime-D37zRSs7.js.map +0 -1
  131. package/dist/sandbox-profile-compat-xSoVtdWw.js.map +0 -1
  132. package/dist/search-executor-DmgUm5p7.js.map +0 -1
  133. package/dist/server-DQHJszfk.js.map +0 -1
  134. package/dist/structural-rollout-DAvIE8mw.js.map +0 -1
  135. package/dist/substrate-B0TYNrXn.js.map +0 -1
  136. package/dist/supervise-WuPAwfPh.js.map +0 -1
  137. package/dist/supervisor-CPG1I9UN.js.map +0 -1
  138. package/dist/tool-server-Dqer2M4_.js.map +0 -1
  139. package/dist/top-app-C55Wa7uy.js +0 -1214
  140. package/dist/top-app-C55Wa7uy.js.map +0 -1
package/dist/agent.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { BT as OutputAdapter, HT as SandboxClient, S as RuntimeStreamEvent, _T as AgentRunSpec } from "./types-CrNWif8-.js";
2
- import { C as worktreeCliProfileMaterialization, S as validateProfileMaterialization, _ as promptModelProfileMaterialization, a as DefineProfileMaterializationContractOptions, b as renderProfileMaterializationIssues, c as ProfileMaterializationIssue, d as assertProfileMaterializes, f as controlProfileMaterialization, g as promptControlProfileMaterialization, h as profileMaterializationAxes, i as CanonicalAgentProfileMaterializationAxis, l as ValidateProfileMaterializationOptions, m as fullProfileMaterialization, n as AgentProfileMaterializationAxis, o as KnownAgentProfileMaterializationAxis, p as defineProfileMaterializationContract, r as AssertProfileMaterializationOptions, s as ProfileMaterializationContract, t as AGENT_PROFILE_MATERIALIZATION_AXES, u as assertProfileMaterialization, v as promptOnlyProfileMaterialization, x as sandboxActProfileMaterialization, y as promptResourceProfileMaterialization } from "./profile-materialization-BnoEf1co.js";
3
- import { a as createSurfaceImprovementProposer, c as SurfaceValidationIssue, d as validateSurfaces, i as SurfaceImprovementEdit, l as renderSurfaceIssues, n as DraftPatchInput, o as AgentSurfaces, r as DraftPatchOutput, s as ResolvedSurface, t as CreateSurfaceImprovementProposerOptions, u as resolveSubjectPath } from "./improvement-adapter-D5gwwoXQ.js";
1
+ import { S as RuntimeStreamEvent, Vx as AgentRunSpec, fS as SandboxClient, uS as OutputAdapter } from "./types-CaOXqRTq.js";
2
+ import { _ as promptResourceProfileMaterialization, a as ProfileMaterializationContract, b as worktreeCliProfileMaterialization, c as assertProfileMaterialization, d as defineProfileMaterializationContract, f as fullProfileMaterialization, g as promptOnlyProfileMaterialization, h as promptModelProfileMaterialization, l as assertProfileMaterializes, m as promptControlProfileMaterialization, n as AssertProfileMaterializationOptions, o as ProfileMaterializationIssue, p as profileMaterializationAxes, r as DefineProfileMaterializationContractOptions, s as ValidateProfileMaterializationOptions, t as AgentProfileMaterializationAxis, u as controlProfileMaterialization, v as sandboxActProfileMaterialization, y as validateProfileMaterialization } from "./profile-materialization-B1wm2SPT.js";
3
+ import { a as createSurfaceImprovementProposer, c as SurfaceValidationIssue, i as SurfaceImprovementEdit, l as renderSurfaceIssues, n as DraftPatchInput, o as AgentSurfaces, r as DraftPatchOutput, s as ResolvedSurface, t as CreateSurfaceImprovementProposerOptions, u as validateSurfaces } from "./improvement-adapter-HUt_-cWA.js";
4
4
  import { AgentProfile, AgentProfileFileMount, AgentProfileMcpServer } from "@tangle-network/agent-interface";
5
5
  import { TraceAnalystDefinition } from "@tangle-network/agent-eval";
6
6
  import { SandboxEvent } from "@tangle-network/sandbox";
@@ -274,5 +274,5 @@ interface CreateSandboxActOptions<TPersona, TRunOutput> {
274
274
  */
275
275
  declare function createSandboxAct<TPersona, TRunOutput>(options: CreateSandboxActOptions<TPersona, TRunOutput>): (persona: TPersona, ctx: AgentRunContext) => AgentRunInvocation<TRunOutput>;
276
276
  //#endregion
277
- export { AGENT_PROFILE_MATERIALIZATION_AXES, type AgentManifest, AgentManifestError, type AgentProfileMaterializationAxis, type AgentRubric, type AgentRunContext, type AgentRunInvocation, type AgentRuntime, type AgentSurfaces, type AnalystConfig, type AssertProfileMaterializationOptions, type CanonicalAgentProfileMaterializationAxis, type CreateSandboxActOptions, type CreateSurfaceImprovementProposerOptions, type DefineProfileMaterializationContractOptions, type DraftPatchInput, type DraftPatchOutput, type JudgeConfig, type KnownAgentProfileMaterializationAxis, type ProfileMaterializationContract, type ProfileMaterializationIssue, type ResolvedSurface, type RubricDimension, type SandboxActComposeOverrides, type SurfaceImprovementEdit, type SurfaceValidationIssue, type ValidateProfileMaterializationOptions, assertProfileMaterialization, assertProfileMaterializes, collectAgentRun, controlProfileMaterialization, createSandboxAct, createSurfaceImprovementProposer, defineAgent, defineProfileMaterializationContract, fullProfileMaterialization, profileMaterializationAxes, promptControlProfileMaterialization, promptModelProfileMaterialization, promptOnlyProfileMaterialization, promptResourceProfileMaterialization, renderProfileMaterializationIssues, renderSurfaceIssues, resolveSubjectPath, sandboxActProfileMaterialization, unimplementedAgentRun, validateProfileMaterialization, validateSurfaces, worktreeCliProfileMaterialization };
277
+ export { type AgentManifest, AgentManifestError, type AgentRubric, type AgentRunContext, type AgentRunInvocation, type AgentRuntime, type AgentSurfaces, type AnalystConfig, type AssertProfileMaterializationOptions, type CreateSandboxActOptions, type CreateSurfaceImprovementProposerOptions, type DefineProfileMaterializationContractOptions, type DraftPatchInput, type DraftPatchOutput, type JudgeConfig, type ProfileMaterializationContract, type ProfileMaterializationIssue, type ResolvedSurface, type RubricDimension, type SandboxActComposeOverrides, type SurfaceImprovementEdit, type SurfaceValidationIssue, type ValidateProfileMaterializationOptions, assertProfileMaterialization, assertProfileMaterializes, collectAgentRun, controlProfileMaterialization, createSandboxAct, createSurfaceImprovementProposer, defineAgent, defineProfileMaterializationContract, fullProfileMaterialization, profileMaterializationAxes, promptControlProfileMaterialization, promptModelProfileMaterialization, promptOnlyProfileMaterialization, promptResourceProfileMaterialization, renderSurfaceIssues, sandboxActProfileMaterialization, unimplementedAgentRun, validateProfileMaterialization, validateSurfaces, worktreeCliProfileMaterialization };
278
278
  //# sourceMappingURL=agent.d.ts.map
package/dist/agent.js CHANGED
@@ -1,6 +1,6 @@
1
- import { Ca as mapSandboxEvent, Ci as validateProfileMaterialization, Dt as createSandboxForSpec, _i as promptResourceProfileMaterialization, bi as sandboxActProfileMaterialization, ci as assertProfileMaterialization, di as defineProfileMaterializationContract, fi as fullProfileMaterialization, gi as promptOnlyProfileMaterialization, hi as promptModelProfileMaterialization, li as assertProfileMaterializes, mi as promptControlProfileMaterialization, pi as profileMaterializationAxes, si as AGENT_PROFILE_MATERIALIZATION_AXES, ui as controlProfileMaterialization, vi as renderProfileMaterializationIssues, wi as worktreeCliProfileMaterialization } from "./supervisor-CPG1I9UN.js";
1
+ import { Ar as controlProfileMaterialization, Bi as mapSandboxEvent, Fr as promptModelProfileMaterialization, Hr as validateProfileMaterialization, Ir as promptOnlyProfileMaterialization, Lr as promptResourceProfileMaterialization, Mr as fullProfileMaterialization, Nr as profileMaterializationAxes, Or as assertProfileMaterialization, Pr as promptControlProfileMaterialization, Ur as worktreeCliProfileMaterialization, bt as createSandboxForSpec, jr as defineProfileMaterializationContract, kr as assertProfileMaterializes, zr as sandboxActProfileMaterialization } from "./supervisor-DHrUJhEZ.js";
2
2
  import { t as sha256 } from "./content-digest-sBTLujlK.js";
3
- import "./runtime-D37zRSs7.js";
3
+ import "./runtime-B2fjL9Oi.js";
4
4
  import { existsSync, readFileSync, statSync } from "node:fs";
5
5
  import { isAbsolute, join, relative, resolve, sep } from "node:path";
6
6
  import { parseFindingSubject } from "@tangle-network/agent-eval/analyst";
@@ -513,6 +513,6 @@ function applyComposeOverrides(base, overrides) {
513
513
  };
514
514
  }
515
515
  //#endregion
516
- export { AGENT_PROFILE_MATERIALIZATION_AXES, AgentManifestError, assertProfileMaterialization, assertProfileMaterializes, collectAgentRun, controlProfileMaterialization, createSandboxAct, createSurfaceImprovementProposer, defineAgent, defineProfileMaterializationContract, fullProfileMaterialization, profileMaterializationAxes, promptControlProfileMaterialization, promptModelProfileMaterialization, promptOnlyProfileMaterialization, promptResourceProfileMaterialization, renderProfileMaterializationIssues, renderSurfaceIssues, resolveSubjectPath, sandboxActProfileMaterialization, unimplementedAgentRun, validateProfileMaterialization, validateSurfaces, worktreeCliProfileMaterialization };
516
+ export { AgentManifestError, assertProfileMaterialization, assertProfileMaterializes, collectAgentRun, controlProfileMaterialization, createSandboxAct, createSurfaceImprovementProposer, defineAgent, defineProfileMaterializationContract, fullProfileMaterialization, profileMaterializationAxes, promptControlProfileMaterialization, promptModelProfileMaterialization, promptOnlyProfileMaterialization, promptResourceProfileMaterialization, renderSurfaceIssues, sandboxActProfileMaterialization, unimplementedAgentRun, validateProfileMaterialization, validateSurfaces, worktreeCliProfileMaterialization };
517
517
 
518
518
  //# sourceMappingURL=agent.js.map
@@ -1,4 +1,4 @@
1
- import { B as omitTopLevelDigest, F as canonicalCandidateDigest$1, z as immutableCandidateValue } from "./sandbox-profile-compat-xSoVtdWw.js";
1
+ import { B as omitTopLevelDigest, F as canonicalCandidateDigest$1, z as immutableCandidateValue } from "./sandbox-profile-compat-BzVBFqrz.js";
2
2
  import { agentCandidateBundleSchema } from "@tangle-network/agent-interface";
3
3
  //#region src/candidate-execution/bundle.ts
4
4
  /** Validate and content-address a candidate bundle before it crosses an approval boundary. */
@@ -14,4 +14,4 @@ function sealAgentCandidateBundle(input) {
14
14
  //#endregion
15
15
  export { sealAgentCandidateBundle as t };
16
16
 
17
- //# sourceMappingURL=bundle-DM60AI2B.js.map
17
+ //# sourceMappingURL=bundle-DVOhBTic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle-DM60AI2B.js","names":["canonicalCandidateDigest"],"sources":["../src/candidate-execution/bundle.ts"],"sourcesContent":["import type { AgentCandidateBundle } from '@tangle-network/agent-interface'\nimport { agentCandidateBundleSchema } from '@tangle-network/agent-interface'\n\nimport { canonicalCandidateDigest, immutableCandidateValue, omitTopLevelDigest } from './digest'\n\n/** Exact candidate wire shape before the runtime computes its canonical digest. */\nexport type AgentCandidateBundleInput = Omit<AgentCandidateBundle, 'digest'>\n\n/** Validate and content-address a candidate bundle before it crosses an approval boundary. */\nexport function sealAgentCandidateBundle(input: AgentCandidateBundleInput): AgentCandidateBundle {\n const digest = canonicalCandidateDigest(input)\n const parsed = agentCandidateBundleSchema.parse({ ...input, digest })\n const parsedDigest = canonicalCandidateDigest(omitTopLevelDigest(parsed))\n if (parsedDigest !== digest) {\n throw new Error('candidate bundle changed while validating its canonical wire shape')\n }\n return immutableCandidateValue(parsed)\n}\n"],"mappings":";;;;AASA,SAAgB,yBAAyB,OAAwD;CAC/F,MAAM,SAASA,2BAAyB,KAAK;CAC7C,MAAM,SAAS,2BAA2B,MAAM;EAAE,GAAG;EAAO;CAAO,CAAC;CAEpE,IADqBA,2BAAyB,mBAAmB,MAAM,CACxD,MAAM,QACnB,MAAM,IAAI,MAAM,oEAAoE;CAEtF,OAAO,wBAAwB,MAAM;AACvC"}
1
+ {"version":3,"file":"bundle-DVOhBTic.js","names":["canonicalCandidateDigest"],"sources":["../src/candidate-execution/bundle.ts"],"sourcesContent":["import type { AgentCandidateBundle } from '@tangle-network/agent-interface'\nimport { agentCandidateBundleSchema } from '@tangle-network/agent-interface'\n\nimport { canonicalCandidateDigest, immutableCandidateValue, omitTopLevelDigest } from './digest'\n\n/** Exact candidate wire shape before the runtime computes its canonical digest. */\nexport type AgentCandidateBundleInput = Omit<AgentCandidateBundle, 'digest'>\n\n/** Validate and content-address a candidate bundle before it crosses an approval boundary. */\nexport function sealAgentCandidateBundle(input: AgentCandidateBundleInput): AgentCandidateBundle {\n const digest = canonicalCandidateDigest(input)\n const parsed = agentCandidateBundleSchema.parse({ ...input, digest })\n const parsedDigest = canonicalCandidateDigest(omitTopLevelDigest(parsed))\n if (parsedDigest !== digest) {\n throw new Error('candidate bundle changed while validating its canonical wire shape')\n }\n return immutableCandidateValue(parsed)\n}\n"],"mappings":";;;;AASA,SAAgB,yBAAyB,OAAwD;CAC/F,MAAM,SAASA,2BAAyB,KAAK;CAC7C,MAAM,SAAS,2BAA2B,MAAM;EAAE,GAAG;EAAO;CAAO,CAAC;CAEpE,IADqBA,2BAAyB,mBAAmB,MAAM,CACxD,MAAM,QACnB,MAAM,IAAI,MAAM,oEAAoE;CAEtF,OAAO,wBAAwB,MAAM;AACvC"}
@@ -1,7 +1,6 @@
1
- import { $ as PreparedAgentCandidateLaunch, A as AgentCandidateMemoryPort, B as AgentCandidateProtectedRunCapture, C as AgentCandidateExecutorPort, D as AgentCandidateExecutorTaskOutcomeCapture, E as AgentCandidateExecutorStopRequest, F as AgentCandidateOutputPurpose, G as AgentCandidateWorkspacePort, H as AgentCandidateRunFinalization, I as AgentCandidateProtectedModelActivation, J as CanonicalCandidateDocument, K as CANDIDATE_TRACE_ENV, L as AgentCandidateProtectedModelReservation, M as AgentCandidateModelLimits, N as AgentCandidateModelPort, O as AgentCandidateExecutorWorkspaceFile, P as AgentCandidateOutputArtifactPort, Q as PreparedAgentCandidateKnowledge, R as AgentCandidateProtectedModelSettlement, S as AgentCandidateExecutorMemoryCapture, T as AgentCandidateExecutorRequest, U as AgentCandidateTaskExecution, V as AgentCandidateRepositoryPort, W as AgentCandidateVerificationPorts, X as PreparedAgentCandidateExecution, Y as PersistedTaskOutcomeEvidence, Z as PreparedAgentCandidateInstruction, _ as AgentCandidateBenchmarkGraderIdentity, a as captureAgentCandidateWorkspaceTreeToArtifacts, b as AgentCandidateExecutionPorts, c as verifyAgentCandidateWorkspaceTree, d as captureAgentCandidateWorkspaceFiles, et as PreparedAgentCandidateTrace, f as CaptureAgentCandidateWorkspaceOptions, g as AgentCandidateArtifactPort, h as createAgentCandidateWorkspacePort, i as captureAgentCandidateWorkspaceToArtifacts, it as AgentCandidateExecutionRoots, j as AgentCandidateMemoryResetResult, k as AgentCandidateExecutorWorkspaceInput, l as AgentCandidateWorkspaceArchiveLimits, m as captureAgentCandidateWorkspace, n as AgentCandidateWorkspaceTree, nt as VerifiedAgentCandidate, o as materializeAgentCandidateWorkspaceFromArtifacts, p as CreateAgentCandidateWorkspacePortOptions, q as CANDIDATE_TRACE_TAGS, r as CaptureAgentCandidateWorkspaceToArtifactsOptions, rt as VerifiedAgentCandidateTaskOutcome, s as verifyAgentCandidateWorkspaceArtifacts, t as AgentCandidateWorkspaceArtifactsOptions, tt as ResolvedAgentCandidateContainer, u as CapturedAgentCandidateWorkspace, v as AgentCandidateBenchmarkGraderPort, w as AgentCandidateExecutorProfileFile, x as AgentCandidateExecutorFinalCapture, y as AgentCandidateContainerPort, z as AgentCandidateProtectedModelSettlementCall } from "../workspace-streams-BZZds1Fw.js";
2
- 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-DGxQ8_YM.js";
3
- import { AgentCandidateArtifactRef, AgentCandidateBundle, AgentCandidateCapturedArtifact, AgentCandidateCodeDisabled, AgentCandidateCodeNoOp, AgentCandidateExecution, AgentCandidateGitHubRepository, AgentCandidateKnowledge, AgentCandidateMemoryPolicy, AgentCandidateProfile, AgentCandidateResolvedModel, AgentCandidateRunCell, AgentCandidateWorkspaceManifestMaterial, AgentCandidateWorkspaceSnapshotEvidence, AgentProfile, AgentProfileDiff, Sha256Digest } from "@tangle-network/agent-interface";
4
- import { TraceStore } from "@tangle-network/agent-eval";
1
+ import { $ as VerifiedAgentCandidate, A as AgentCandidateMemoryResetResult, B as AgentCandidateRepositoryPort, C as AgentCandidateExecutorProfileFile, D as AgentCandidateExecutorWorkspaceFile, E as AgentCandidateExecutorTaskOutcomeCapture, F as AgentCandidateProtectedModelActivation, G as CanonicalCandidateDocument, H as AgentCandidateTaskExecution, I as AgentCandidateProtectedModelReservation, J as PreparedAgentCandidateInstruction, K as PersistedTaskOutcomeEvidence, L as AgentCandidateProtectedModelSettlement, M as AgentCandidateModelPort, N as AgentCandidateOutputArtifactPort, O as AgentCandidateExecutorWorkspaceInput, P as AgentCandidateOutputPurpose, Q as ResolvedAgentCandidateContainer, R as AgentCandidateProtectedModelSettlementCall, S as AgentCandidateExecutorPort, T as AgentCandidateExecutorStopRequest, U as AgentCandidateVerificationPorts, V as AgentCandidateRunFinalization, W as AgentCandidateWorkspacePort, X as PreparedAgentCandidateLaunch, Y as PreparedAgentCandidateKnowledge, Z as PreparedAgentCandidateTrace, _ as AgentCandidateBenchmarkGraderPort, a as captureAgentCandidateWorkspaceTreeToArtifacts, b as AgentCandidateExecutorFinalCapture, c as verifyAgentCandidateWorkspaceTree, d as captureAgentCandidateWorkspaceFiles, et as VerifiedAgentCandidateTaskOutcome, f as CaptureAgentCandidateWorkspaceOptions, g as AgentCandidateArtifactPort, h as createAgentCandidateWorkspacePort, i as captureAgentCandidateWorkspaceToArtifacts, j as AgentCandidateModelLimits, k as AgentCandidateMemoryPort, l as AgentCandidateWorkspaceArchiveLimits, m as captureAgentCandidateWorkspace, n as AgentCandidateWorkspaceTree, o as materializeAgentCandidateWorkspaceFromArtifacts, p as CreateAgentCandidateWorkspacePortOptions, q as PreparedAgentCandidateExecution, r as CaptureAgentCandidateWorkspaceToArtifactsOptions, s as verifyAgentCandidateWorkspaceArtifacts, t as AgentCandidateWorkspaceArtifactsOptions, tt as AgentCandidateExecutionRoots, u as CapturedAgentCandidateWorkspace, v as AgentCandidateContainerPort, w as AgentCandidateExecutorRequest, x as AgentCandidateExecutorMemoryCapture, y as AgentCandidateExecutionPorts, z as AgentCandidateProtectedRunCapture } from "../workspace-streams-BiS4ABah.js";
2
+ import { A as AgentCandidateExecutionStageResult, C as AgentCandidateExecutionCleanupHandles, D as AgentCandidateExecutionPhase, E as AgentCandidateExecutionLease, M as AgentCandidateExecutionTerminalResult, N as AgentCandidateRetryRejection, O as AgentCandidateExecutionPhaseResult, P as AgentCandidatePreparationEvidence, S as AgentCandidateExecutionClaimStore, T as AgentCandidateExecutionFinishResult, _ as executePreparedAgentCandidate, a as createProtectedAgentCandidateModelPort, b as AgentCandidateExecutionClaim, c as assertCandidateProfileBinding, f as parseExactAgentProfileDiff, g as ExecutePreparedAgentCandidateOptions, h as prepareAgentCandidateExecution, i as CreateProtectedAgentCandidateModelPortOptions, j as AgentCandidateExecutionTerminalRecord, k as AgentCandidateExecutionRecoveryEvidence, l as freezeGenericAgentCandidateProfile, n as AgentCandidateModelGrantClient, o as agentCandidateProfileAsAgentProfile, p as parseExactCandidateProfile, r as AgentCandidateModelGrantReserveInput, s as applyExactAgentProfileDiff, t as AgentCandidateModelGrantActivateInput, u as omitUndefinedObjectFields, v as AgentCandidateExecutionAttemptRecord, w as AgentCandidateExecutionFailureClass, x as AgentCandidateExecutionClaimResult, y as AgentCandidateExecutionAttemptRef } from "../protected-model-port-BGgpy2r9.js";
3
+ import { AgentCandidateArtifactRef, AgentCandidateBundle, AgentCandidateCapturedArtifact, AgentCandidateCodeDisabled, AgentCandidateCodeNoOp, AgentCandidateExecution, AgentCandidateGitHubRepository, AgentCandidateKnowledge, AgentCandidateMemoryPolicy, AgentCandidateProfile, AgentCandidateResolvedModel, AgentCandidateWorkspaceManifestMaterial, AgentCandidateWorkspaceSnapshotEvidence, AgentProfile, AgentProfileDiff, Sha256Digest } from "@tangle-network/agent-interface";
5
4
  import { CodeSurface } from "@tangle-network/agent-eval/campaign";
6
5
  import { AgentEnvironmentProvider, AgentExactProcessResources } from "@tangle-network/agent-interface/environment-provider";
7
6
  //#region src/candidate-execution/artifacts.d.ts
@@ -35,14 +34,6 @@ interface WorkspaceScanOptions {
35
34
  */
36
35
  readonly portableTree?: boolean;
37
36
  }
38
- /**
39
- * Refuse a materialized workspace whose files, modes, or bytes are not the signed manifest.
40
- *
41
- * The scan streams, so the size of the largest file does not decide whether the check can run, and
42
- * the refusal names the one mismatch a caller can produce on its own: a capture and a verify that
43
- * disagree about `portableTree`.
44
- */
45
- declare function verifyMaterializedWorkspace(root: string, expected: AgentCandidateWorkspaceManifestMaterial, options?: Omit<WorkspaceScanOptions, 'limits'>): Promise<void>;
46
37
  /**
47
38
  * The canonical manifest of one materialized workspace, read without holding any file.
48
39
  *
@@ -161,26 +152,6 @@ interface ExactProcessCandidateExecutorOptions {
161
152
  /** Adapt one neutral exact-process provider to Runtime's trusted candidate boundary. */
162
153
  declare function exactProcessProviderAsCandidateExecutor(options: ExactProcessCandidateExecutorOptions): AgentCandidateExecutorPort;
163
154
  //#endregion
164
- //#region src/candidate-execution/knowledge.d.ts
165
- /** Environment variable containing the materialized candidate knowledge root. */
166
- declare const CANDIDATE_KNOWLEDGE_ROOT_ENV = "TANGLE_CANDIDATE_KNOWLEDGE_ROOT";
167
- /** Environment variable containing the materialized retrieval configuration path. */
168
- declare const CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV = "TANGLE_CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG";
169
- /** Deterministic, signed locations used by every candidate executor. */
170
- declare function candidateKnowledgeExecutionPaths(taskRoot: string, hasRetrievalConfig: boolean): {
171
- root: string;
172
- retrievalConfig?: string;
173
- };
174
- //#endregion
175
- //#region src/candidate-execution/output-artifacts.d.ts
176
- /** Persist evaluator evidence, read it back, and bind the returned locator to the exact bytes. */
177
- declare function persistCandidateOutputArtifact(port: AgentCandidateOutputArtifactPort, input: {
178
- executionId: string;
179
- purpose: AgentCandidateOutputPurpose;
180
- bytes: Uint8Array;
181
- signal?: AbortSignal;
182
- }): Promise<AgentCandidateArtifactRef>;
183
- //#endregion
184
155
  //#region src/candidate-execution/protected-model-grant.d.ts
185
156
  /** Reservation fields supplied by a caller before Runtime resolves the model. */
186
157
  type AgentCandidateModelGrantRunReservationInput = Omit<AgentCandidateModelGrantReserveInput, 'resolved'>;
@@ -220,37 +191,7 @@ interface RunProtectedAgentCandidateModelGrantResult<TResult> {
220
191
  */
221
192
  declare function runProtectedAgentCandidateModelGrant<TResult>(options: RunProtectedAgentCandidateModelGrantOptions<TResult>): Promise<RunProtectedAgentCandidateModelGrantResult<TResult>>;
222
193
  //#endregion
223
- //#region src/candidate-execution/recover.d.ts
224
- interface RecoverExpiredAgentCandidateOptions {
225
- attempt: AgentCandidateExecutionAttemptRef;
226
- claimStore: AgentCandidateExecutionClaimStore;
227
- executor: AgentCandidateExecutorPort;
228
- traceStore: TraceStore;
229
- ports: Pick<AgentCandidateExecutionPorts, 'models' | 'memory'>;
230
- outputArtifacts: AgentCandidateOutputArtifactPort;
231
- cleanupTimeoutMs?: number;
232
- /** Evaluator clock; must be the same clock used by the claim store. */
233
- now?: () => number;
234
- }
235
- /** Close an expired crashed attempt from persisted non-secret handles, then record failure. */
236
- declare function recoverExpiredAgentCandidateExecution(options: RecoverExpiredAgentCandidateOptions): Promise<AgentCandidateExecutionFinishResult>;
237
- //#endregion
238
194
  //#region src/candidate-execution/verify.d.ts
239
- /** Surfaces admitted by Runtime's verifier before an environment adapter is selected. */
240
- declare const AGENT_CANDIDATE_EXECUTION_SUPPORT: Readonly<{
241
- outcomes: readonly ["workspace", "output"];
242
- code: readonly ["disabled", "no-op", "git-patch"];
243
- memory: readonly ["disabled", "isolated"];
244
- knowledge: true;
245
- profile: Readonly<{
246
- mcpTransports: readonly ["stdio"];
247
- remoteMcp: false;
248
- tools: false;
249
- permissions: false;
250
- modes: false;
251
- confidential: false;
252
- }>;
253
- }>;
254
195
  /** Verifies every digest, resource, workspace, and Git object in a candidate bundle. */
255
196
  declare function verifyAgentCandidateBundle(input: unknown, ports: AgentCandidateVerificationPorts): Promise<VerifiedAgentCandidate>;
256
197
  //#endregion
@@ -375,5 +316,5 @@ declare function describeWorkspaceTree(directory: string, options?: DescribeWork
375
316
  */
376
317
  declare function seedWorkspaceTree(input: SeedWorkspaceTreeInput): Promise<WorkspaceTreeDescriptor>;
377
318
  //#endregion
378
- export { AGENT_CANDIDATE_EXECUTION_SUPPORT, 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 AgentCandidateExecutionRoots, 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 AgentCandidateModelGrantRunReservationInput, type AgentCandidateModelGrantSettleInput, type AgentCandidateModelLimits, type AgentCandidateModelPort, type AgentCandidateOutputArtifactPort, type AgentCandidateOutputPurpose, type AgentCandidatePreparationEvidence, type AgentCandidateProfileSource, type AgentCandidateProtectedModelActivation, type AgentCandidateProtectedModelReservation, type AgentCandidateProtectedModelSettlement, type AgentCandidateProtectedModelSettlementCall, type AgentCandidateProtectedRunCapture, type AgentCandidateRepositoryPort, type AgentCandidateRetryRejection, type AgentCandidateRunFinalization, type AgentCandidateTaskExecution, type AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, type AgentCandidateWorkspaceArtifactsOptions, type AgentCandidateWorkspacePort, type AgentCandidateWorkspaceSnapshotReferences, type AgentCandidateWorkspaceTree, type BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CANDIDATE_TRACE_ENV, CANDIDATE_TRACE_TAGS, type CanonicalCandidateDocument, type CaptureAgentCandidateWorkspaceOptions, type CaptureAgentCandidateWorkspaceToArtifactsOptions, type CaptureAgentWorkspaceSnapshotOptions, type CapturedAgentCandidateWorkspace, type CreateAgentCandidateWorkspacePortOptions, type CreateProtectedAgentCandidateModelPortOptions, type DescribeWorkspaceTreeOptions, type DisposePreparedAgentCandidateOptions, type ExactProcessCandidateExecutorOptions, type ExecutePreparedAgentCandidateOptions, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, InMemoryAgentCandidateExecutionClaimStore, type InMemoryAgentCandidateExecutionClaimStoreOptions, type MaterializeAgentWorkspaceSnapshotOptions, type PersistedTaskOutcomeEvidence, type PrepareAgentCandidateExecutionOptions, type PreparedAgentCandidateExecution, type PreparedAgentCandidateInstruction, type PreparedAgentCandidateKnowledge, type PreparedAgentCandidateLaunch, type PreparedAgentCandidateTrace, type ProtectedAgentCandidateModelGrantContext, type RecoverExpiredAgentCandidateOptions, type ResolvedAgentCandidateContainer, type RunProtectedAgentCandidateModelGrantOptions, type RunProtectedAgentCandidateModelGrantResult, type SeedWorkspaceTreeInput, type VerifiedAgentCandidate, type VerifiedAgentCandidateTaskOutcome, type WorkspaceScanLimits, type WorkspaceScanOptions, type WorkspaceTreeAlgorithm, type WorkspaceTreeDescriptor, type WorkspaceTreeEntryPolicy, type WorkspaceTreeExclusion, type WorkspaceTreeExclusionReason, agentCandidateProfileAsAgentProfile, applyExactAgentProfileDiff, assertCandidateProfileBinding, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, candidateWorkspaceManifest, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, captureAgentCandidateWorkspaceToArtifacts, captureAgentCandidateWorkspaceTreeToArtifacts, captureAgentWorkspaceSnapshot, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, describeWorkspaceTree, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, executePreparedAgentCandidate, freezeGenericAgentCandidateProfile, materializeAgentCandidateWorkspaceFromArtifacts, materializeAgentWorkspaceSnapshot, omitUndefinedObjectFields, parseExactAgentProfile, parseExactAgentProfileDiff, parseExactCandidateProfile, persistCandidateOutputArtifact, prepareAgentCandidateExecution, recoverExpiredAgentCandidateExecution, runProtectedAgentCandidateModelGrant, scanMaterializedWorkspaceManifest, sealAgentCandidateBundle, seedWorkspaceTree, verifyAgentCandidateBundle, verifyAgentCandidateWorkspaceArtifacts, verifyAgentCandidateWorkspaceTree, verifyMaterializedWorkspace };
319
+ export { type AgentCandidateArtifactPort, 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 AgentCandidateExecutionRoots, 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 AgentCandidateModelGrantClient, type AgentCandidateModelGrantReserveInput, type AgentCandidateModelGrantRunReservationInput, type AgentCandidateModelLimits, type AgentCandidateModelPort, type AgentCandidateOutputArtifactPort, type AgentCandidateOutputPurpose, type AgentCandidatePreparationEvidence, type AgentCandidateProfileSource, type AgentCandidateProtectedModelActivation, type AgentCandidateProtectedModelReservation, type AgentCandidateProtectedModelSettlement, type AgentCandidateProtectedModelSettlementCall, type AgentCandidateProtectedRunCapture, type AgentCandidateRepositoryPort, type AgentCandidateRetryRejection, type AgentCandidateRunFinalization, type AgentCandidateTaskExecution, type AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArtifactsOptions, type AgentCandidateWorkspacePort, type AgentCandidateWorkspaceSnapshotReferences, type AgentCandidateWorkspaceTree, type BuildAgentCandidateBundleInput, type CanonicalCandidateDocument, type CaptureAgentCandidateWorkspaceOptions, type CaptureAgentCandidateWorkspaceToArtifactsOptions, type CaptureAgentWorkspaceSnapshotOptions, type CapturedAgentCandidateWorkspace, type CreateAgentCandidateWorkspacePortOptions, type CreateProtectedAgentCandidateModelPortOptions, type DescribeWorkspaceTreeOptions, type DisposePreparedAgentCandidateOptions, type ExactProcessCandidateExecutorOptions, type ExecutePreparedAgentCandidateOptions, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, type MaterializeAgentWorkspaceSnapshotOptions, type PersistedTaskOutcomeEvidence, type PreparedAgentCandidateExecution, type PreparedAgentCandidateInstruction, type PreparedAgentCandidateKnowledge, type PreparedAgentCandidateLaunch, type PreparedAgentCandidateTrace, type ProtectedAgentCandidateModelGrantContext, type ResolvedAgentCandidateContainer, type RunProtectedAgentCandidateModelGrantOptions, type RunProtectedAgentCandidateModelGrantResult, type SeedWorkspaceTreeInput, type VerifiedAgentCandidate, type VerifiedAgentCandidateTaskOutcome, type WorkspaceScanLimits, type WorkspaceScanOptions, type WorkspaceTreeAlgorithm, type WorkspaceTreeDescriptor, type WorkspaceTreeEntryPolicy, type WorkspaceTreeExclusion, type WorkspaceTreeExclusionReason, agentCandidateProfileAsAgentProfile, applyExactAgentProfileDiff, assertCandidateProfileBinding, buildAgentCandidateBundle, candidateWorkspaceManifest, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, captureAgentCandidateWorkspaceToArtifacts, captureAgentCandidateWorkspaceTreeToArtifacts, captureAgentWorkspaceSnapshot, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, describeWorkspaceTree, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, executePreparedAgentCandidate, freezeGenericAgentCandidateProfile, materializeAgentCandidateWorkspaceFromArtifacts, materializeAgentWorkspaceSnapshot, omitUndefinedObjectFields, parseExactAgentProfileDiff, parseExactCandidateProfile, prepareAgentCandidateExecution, runProtectedAgentCandidateModelGrant, scanMaterializedWorkspaceManifest, sealAgentCandidateBundle, seedWorkspaceTree, verifyAgentCandidateBundle, verifyAgentCandidateWorkspaceArtifacts, verifyAgentCandidateWorkspaceTree };
379
320
  //# sourceMappingURL=index.d.ts.map
@@ -1,8 +1,8 @@
1
- import { A as verifyMaterializedWorkspace, C as candidateWorkspaceManifest, D as scanMaterializedWorkspaceManifest, E as readVerifiedArtifact, L as deepFreezeCandidate, N as verifiedArtifactChunks, P as canonicalCandidateBytes$1, R as embeddedCandidateArtifact, _ as workspaceLimits, a as materializeAgentCandidateWorkspaceFromArtifacts, c as verifyAgentCandidateWorkspaceTree, h as captureAgentCandidateWorkspaceFiles, i as captureAgentCandidateWorkspaceTreeToArtifacts, l as captureAgentCandidateWorkspace, r as captureAgentCandidateWorkspaceToArtifacts, s as verifyAgentCandidateWorkspaceArtifacts, u as createAgentCandidateWorkspacePort, v as persistCandidateOutputArtifact } from "../sandbox-profile-compat-xSoVtdWw.js";
2
- import { a as applyExactAgentProfileDiff, b as parseExactCandidateProfile, g as omitUndefinedObjectFields, i as agentCandidateProfileAsAgentProfile, o as assertCandidateProfileBinding, p as freezeGenericAgentCandidateProfile, v as parseExactAgentProfile, y as parseExactAgentProfileDiff } from "../profile-Do-5xO_D.js";
3
- import { t as sealAgentCandidateBundle } from "../bundle-DM60AI2B.js";
4
- import { A as candidateKnowledgeExecutionPaths, C as sealTerminalDigest, D as exactProcessProviderAsCandidateExecutor, E as sealAgentCandidateModelSettlement, F as CANDIDATE_TRACE_TAGS, N as verifyAgentCandidateBundle, O as CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, P as CANDIDATE_TRACE_ENV, S as requireStagedTerminal, T as createProtectedAgentCandidateModelPort, _ as assertTerminalMatchesClaim, a as sealAgentCandidateExecutorStopAcknowledgement, b as rejectedFinish, c as beginPreparedCandidateDisposal, d as candidateClaimFileInternals, f as candidateCleanupDeadline, g as assertTerminalAllowedInPhase, h as assertRecoveryMatchesStaged, i as persistCandidateModelSettlementEvidence, j as AGENT_CANDIDATE_EXECUTION_SUPPORT, k as CANDIDATE_KNOWLEDGE_ROOT_ENV, l as consumePreparedCandidateExecution, m as withinCandidateCleanupDeadline, n as executePreparedAgentCandidate, o as candidateExecutionClaim, p as candidateCleanupTimeout, r as RecoveryAgentCandidateTraceStore, s as assertPreparedCandidateIntegrity, t as prepareAgentCandidateExecution, u as InMemoryAgentCandidateExecutionClaimStore, v as assertTerminalMatchesStaged, w as terminalRecord, x as rejectedStage, y as recoveredTerminalRecord } from "../prepare-Bt0IouPq.js";
5
- import { agentCandidateArtifactRefSchema, agentCandidateExecutionPlanMaterialSchema, agentCandidateMaterializationReceiptSchema, agentCandidateWorkspaceManifestMaterialSchema, agentCandidateWorkspaceSnapshotEvidenceSchema } from "@tangle-network/agent-interface";
1
+ import { C as candidateWorkspaceManifest, D as scanMaterializedWorkspaceManifest, L as deepFreezeCandidate, N as verifiedArtifactChunks, P as canonicalCandidateBytes$1, R as embeddedCandidateArtifact, _ as workspaceLimits, a as materializeAgentCandidateWorkspaceFromArtifacts, c as verifyAgentCandidateWorkspaceTree, h as captureAgentCandidateWorkspaceFiles, i as captureAgentCandidateWorkspaceTreeToArtifacts, l as captureAgentCandidateWorkspace, r as captureAgentCandidateWorkspaceToArtifacts, s as verifyAgentCandidateWorkspaceArtifacts, u as createAgentCandidateWorkspacePort } from "../sandbox-profile-compat-BzVBFqrz.js";
2
+ import { a as applyExactAgentProfileDiff, b as parseExactCandidateProfile, g as omitUndefinedObjectFields, i as agentCandidateProfileAsAgentProfile, o as assertCandidateProfileBinding, p as freezeGenericAgentCandidateProfile, v as parseExactAgentProfile, y as parseExactAgentProfileDiff } from "../profile-Dpei_Sq0.js";
3
+ import { t as sealAgentCandidateBundle } from "../bundle-DVOhBTic.js";
4
+ import { _ as sealTerminalDigest, a as consumePreparedCandidateExecution, b as sealAgentCandidateModelSettlement, c as withinCandidateCleanupDeadline, d as assertTerminalMatchesClaim, f as assertTerminalMatchesStaged, g as requireStagedTerminal, h as rejectedStage, i as beginPreparedCandidateDisposal, l as assertRecoveryMatchesStaged, m as rejectedFinish, n as executePreparedAgentCandidate, o as candidateClaimFileInternals, p as recoveredTerminalRecord, r as assertPreparedCandidateIntegrity, s as candidateCleanupDeadline, t as prepareAgentCandidateExecution, u as assertTerminalAllowedInPhase, v as terminalRecord, w as verifyAgentCandidateBundle, x as exactProcessProviderAsCandidateExecutor, y as createProtectedAgentCandidateModelPort } from "../prepare-bXkvPMJA.js";
5
+ import { agentCandidateArtifactRefSchema, agentCandidateWorkspaceManifestMaterialSchema, agentCandidateWorkspaceSnapshotEvidenceSchema } from "@tangle-network/agent-interface";
6
6
  import { createHash, randomUUID } from "node:crypto";
7
7
  import { constants, linkSync } from "node:fs";
8
8
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -439,145 +439,6 @@ function isCandidateGrantDrainingError(error) {
439
439
  return typeof candidate.message === "string" && /\bcandidate_grant_draining\b/u.test(candidate.message);
440
440
  }
441
441
  //#endregion
442
- //#region src/candidate-execution/recover.ts
443
- /** Close an expired crashed attempt from persisted non-secret handles, then record failure. */
444
- async function recoverExpiredAgentCandidateExecution(options) {
445
- const record = await options.claimStore.getAttempt(options.attempt);
446
- if (!record) throw new Error("candidate execution recovery attempt is missing");
447
- if (record.terminal) return Object.freeze({
448
- finished: false,
449
- terminal: record.terminal,
450
- exactReplay: true
451
- });
452
- const cleanupTimeoutMs = candidateCleanupTimeout(options.cleanupTimeoutMs ?? record.claim.cleanup.cleanupTimeoutMs);
453
- if (cleanupTimeoutMs > record.claim.cleanup.cleanupTimeoutMs) throw new Error("recovery cleanup timeout exceeds the frozen preparation bound");
454
- if ((options.now ?? Date.now)() < record.claim.leaseExpiresAtMs) throw new Error("candidate execution lease has not expired");
455
- const cleanupDeadlineAtMs = candidateCleanupDeadline(cleanupTimeoutMs);
456
- const recoveryTraceStore = new RecoveryAgentCandidateTraceStore(options.traceStore);
457
- const preparation = withinCandidateCleanupDeadline(() => readRecoveryPreparation(record.claim, options.outputArtifacts), cleanupDeadlineAtMs, "expired candidate preparation evidence read");
458
- const processClosure = withinCandidateCleanupDeadline(async (cleanupSignal) => {
459
- sealAgentCandidateExecutorStopAcknowledgement(await options.executor.stop({
460
- executionId: record.claim.executionId,
461
- executionPlanDigest: record.claim.executionPlanDigest
462
- }, {
463
- traceStore: recoveryTraceStore,
464
- reason: "failed",
465
- signal: cleanupSignal,
466
- deadlineAtMs: cleanupDeadlineAtMs
467
- }));
468
- if (options.executor.dispose) {
469
- const disposed = await options.executor.dispose({
470
- executionId: record.claim.executionId,
471
- executionPlanDigest: record.claim.executionPlanDigest
472
- }, { signal: cleanupSignal });
473
- if (disposed.disposed !== true || Object.keys(disposed).some((key) => key !== "disposed")) throw new Error("expired candidate executor did not acknowledge resource disposal");
474
- }
475
- return { stopped: true };
476
- }, cleanupDeadlineAtMs, "expired candidate process termination");
477
- const modelClosure = withinCandidateCleanupDeadline(async () => sealAgentCandidateModelSettlement(await options.ports.models.settleGrant({
478
- executionId: record.claim.executionId,
479
- preparationId: record.claim.cleanup.preparationId,
480
- grantDigest: record.claim.cleanup.modelGrantDigest,
481
- resolved: record.claim.cleanup.resolvedModel,
482
- reason: "failed"
483
- }), {
484
- preparationId: record.claim.cleanup.preparationId,
485
- grantDigest: record.claim.cleanup.modelGrantDigest,
486
- model: record.claim.cleanup.resolvedModel.model
487
- }), cleanupDeadlineAtMs, "expired candidate model settlement");
488
- const memoryClosure = record.claim.cleanup.memory ? withinCandidateCleanupDeadline(async () => {
489
- const memory = record.claim.cleanup.memory;
490
- if (!memory) throw new Error("expired candidate memory handle is missing");
491
- const closed = await options.ports.memory.close({
492
- executionId: record.claim.executionId,
493
- preparationId: record.claim.cleanup.preparationId,
494
- accessDigest: memory.accessDigest,
495
- effectiveNamespace: memory.effectiveNamespace,
496
- reason: "failed"
497
- });
498
- if (closed.closed !== true || Object.keys(closed).some((key) => key !== "closed")) throw new Error("expired candidate memory did not acknowledge closure");
499
- return { closed: true };
500
- }, cleanupDeadlineAtMs, "expired candidate memory closure") : void 0;
501
- const closureOutcomes = Promise.allSettled([modelClosure, memoryClosure ?? Promise.resolve(void 0)]);
502
- const [preparationOutcome, processOutcome] = await Promise.allSettled([preparation, processClosure]);
503
- const failures = [preparationOutcome, processOutcome].filter((outcome) => outcome.status === "rejected").map((outcome) => outcome.reason);
504
- const [modelOutcome, memoryOutcome] = await closureOutcomes;
505
- for (const outcome of [modelOutcome, memoryOutcome]) if (outcome.status === "rejected") failures.push(outcome.reason);
506
- if (failures.length > 0) throw new AggregateError(failures, "expired candidate cleanup could not be proven");
507
- if (modelOutcome.status !== "fulfilled") throw new Error("expired candidate model settlement was not recovered");
508
- const model = modelOutcome.value;
509
- const modelSettlement = await withinCandidateCleanupDeadline(() => persistCandidateModelSettlementEvidence({
510
- executionId: record.claim.executionId,
511
- executionPlanDigest: record.claim.executionPlanDigest,
512
- resolvedModel: record.claim.cleanup.resolvedModel
513
- }, model, options.outputArtifacts), cleanupDeadlineAtMs, "expired candidate model-settlement persistence");
514
- const failureClass = record.phase === "claimed" && model.usage.modelCalls === 0 ? "pre-model-infrastructure" : "unknown";
515
- const failureEvidence = await withinCandidateCleanupDeadline(() => persistCandidateOutputArtifact(options.outputArtifacts, {
516
- executionId: record.claim.executionId,
517
- purpose: "failure-evidence",
518
- bytes: canonicalCandidateBytes$1({
519
- kind: "agent-candidate-recovery-failure",
520
- executionId: record.claim.executionId,
521
- attempt: record.claim.attempt,
522
- bundleDigest: record.claim.bundleDigest,
523
- executionPlanDigest: record.claim.executionPlanDigest,
524
- materializationReceiptDigest: record.claim.preparationEvidence.materializationReceipt.sha256,
525
- failureClass,
526
- processStopped: true,
527
- modelSettlementDigest: modelSettlement.digest,
528
- memoryClosed: record.claim.cleanup.memory !== void 0
529
- })
530
- }), cleanupDeadlineAtMs, "expired candidate failure-evidence persistence");
531
- const memory = record.claim.cleanup.memory;
532
- return await options.claimStore.recoverExpired(options.attempt, {
533
- failureClass,
534
- usage: model.usage,
535
- modelSettlement: modelSettlement.artifact,
536
- failureEvidence,
537
- process: {
538
- stopped: true,
539
- executionPlanDigest: record.claim.executionPlanDigest
540
- },
541
- model: {
542
- closed: true,
543
- preparationId: record.claim.cleanup.preparationId,
544
- grantDigest: record.claim.cleanup.modelGrantDigest
545
- },
546
- ...memory ? { memory: {
547
- closed: true,
548
- preparationId: record.claim.cleanup.preparationId,
549
- accessDigest: memory.accessDigest,
550
- effectiveNamespace: memory.effectiveNamespace
551
- } } : {}
552
- });
553
- }
554
- async function readRecoveryPreparation(claim, artifacts) {
555
- const [planBytes, receiptBytes] = await Promise.all([readVerifiedArtifact(claim.preparationEvidence.executionPlan, artifacts), readVerifiedArtifact(claim.preparationEvidence.materializationReceipt, artifacts)]);
556
- const plan = agentCandidateExecutionPlanMaterialSchema.parse(parseCanonicalBytes(planBytes, "plan"));
557
- if (claim.preparationEvidence.executionPlan.sha256 !== claim.executionPlanDigest) throw new Error("recovery execution plan artifact does not match the claimed digest");
558
- const receiptMaterial = parseCanonicalBytes(receiptBytes, "materialization receipt");
559
- const receipt = agentCandidateMaterializationReceiptSchema.parse({
560
- ...receiptMaterial,
561
- digest: claim.preparationEvidence.materializationReceipt.sha256
562
- });
563
- if (receipt.bundleDigest !== claim.bundleDigest || receipt.executionPlan.digest !== claim.executionPlanDigest || plan.runCell.bundleDigest !== claim.bundleDigest || plan.executionId !== claim.executionId) throw new Error("recovery preparation evidence does not match the durable claim");
564
- return {
565
- plan,
566
- receipt
567
- };
568
- }
569
- function parseCanonicalBytes(bytes, label) {
570
- let parsed;
571
- try {
572
- parsed = JSON.parse(Buffer.from(bytes).toString("utf8"));
573
- } catch (error) {
574
- throw new Error(`candidate recovery ${label} is not JSON`, { cause: error });
575
- }
576
- if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) throw new Error(`candidate recovery ${label} must be an object`);
577
- if (!Buffer.from(canonicalCandidateBytes$1(parsed)).equals(Buffer.from(bytes))) throw new Error(`candidate recovery ${label} bytes are not canonical`);
578
- return parsed;
579
- }
580
- //#endregion
581
442
  //#region src/candidate-execution/workspace-transfer.ts
582
443
  /**
583
444
  * Capture through the canonical archive owner and return references only.
@@ -903,6 +764,6 @@ async function lstatIfPresent(path) {
903
764
  }
904
765
  }
905
766
  //#endregion
906
- export { AGENT_CANDIDATE_EXECUTION_SUPPORT, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, CANDIDATE_TRACE_ENV, CANDIDATE_TRACE_TAGS, FileAgentCandidateExecutionClaimStore, InMemoryAgentCandidateExecutionClaimStore, agentCandidateProfileAsAgentProfile, applyExactAgentProfileDiff, assertCandidateProfileBinding, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, candidateWorkspaceManifest, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, captureAgentCandidateWorkspaceToArtifacts, captureAgentCandidateWorkspaceTreeToArtifacts, captureAgentWorkspaceSnapshot, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, describeWorkspaceTree, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, executePreparedAgentCandidate, freezeGenericAgentCandidateProfile, materializeAgentCandidateWorkspaceFromArtifacts, materializeAgentWorkspaceSnapshot, omitUndefinedObjectFields, parseExactAgentProfile, parseExactAgentProfileDiff, parseExactCandidateProfile, persistCandidateOutputArtifact, prepareAgentCandidateExecution, recoverExpiredAgentCandidateExecution, runProtectedAgentCandidateModelGrant, scanMaterializedWorkspaceManifest, sealAgentCandidateBundle, seedWorkspaceTree, verifyAgentCandidateBundle, verifyAgentCandidateWorkspaceArtifacts, verifyAgentCandidateWorkspaceTree, verifyMaterializedWorkspace };
767
+ export { FileAgentCandidateExecutionClaimStore, agentCandidateProfileAsAgentProfile, applyExactAgentProfileDiff, assertCandidateProfileBinding, buildAgentCandidateBundle, candidateWorkspaceManifest, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, captureAgentCandidateWorkspaceToArtifacts, captureAgentCandidateWorkspaceTreeToArtifacts, captureAgentWorkspaceSnapshot, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, describeWorkspaceTree, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, executePreparedAgentCandidate, freezeGenericAgentCandidateProfile, materializeAgentCandidateWorkspaceFromArtifacts, materializeAgentWorkspaceSnapshot, omitUndefinedObjectFields, parseExactAgentProfileDiff, parseExactCandidateProfile, prepareAgentCandidateExecution, runProtectedAgentCandidateModelGrant, scanMaterializedWorkspaceManifest, sealAgentCandidateBundle, seedWorkspaceTree, verifyAgentCandidateBundle, verifyAgentCandidateWorkspaceArtifacts, verifyAgentCandidateWorkspaceTree };
907
768
 
908
769
  //# sourceMappingURL=index.js.map