@tangle-network/agent-runtime 0.105.0 → 0.106.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 (218) hide show
  1. package/README.md +2 -2
  2. package/dist/activation-CRjVfOiy.js +203 -0
  3. package/dist/activation-CRjVfOiy.js.map +1 -0
  4. package/dist/activation-DyWB0K6E.d.ts +98 -0
  5. package/dist/agent.d.ts +216 -234
  6. package/dist/agent.js +615 -547
  7. package/dist/agent.js.map +1 -1
  8. package/dist/analyst-loop-DGdtVENg.js +517 -0
  9. package/dist/analyst-loop-DGdtVENg.js.map +1 -0
  10. package/dist/analyst-loop.d.ts +10 -43
  11. package/dist/analyst-loop.js +2 -11
  12. package/dist/backends-Dy8NujB4.js +713 -0
  13. package/dist/backends-Dy8NujB4.js.map +1 -0
  14. package/dist/candidate-execution/index.d.ts +4 -192
  15. package/dist/candidate-execution/index.js +5 -66
  16. package/dist/candidate-execution-DqMbv1rU.js +488 -0
  17. package/dist/candidate-execution-DqMbv1rU.js.map +1 -0
  18. package/dist/coder-yhVWbdWc.js +40 -0
  19. package/dist/coder-yhVWbdWc.js.map +1 -0
  20. package/dist/conversation-XucG_K3l.js +1265 -0
  21. package/dist/conversation-XucG_K3l.js.map +1 -0
  22. package/dist/conversation.d.ts +2 -804
  23. package/dist/conversation.js +2 -55
  24. package/dist/environment-provider-CfLUmKmf.js +1168 -0
  25. package/dist/environment-provider-CfLUmKmf.js.map +1 -0
  26. package/dist/environment-provider-IUGU3epE.d.ts +964 -0
  27. package/dist/environment-provider.d.ts +2 -78
  28. package/dist/environment-provider.js +2 -18
  29. package/dist/errors-DEAvWQPy.js +111 -0
  30. package/dist/errors-DEAvWQPy.js.map +1 -0
  31. package/dist/improvement-adapter-Cr5TBSji.d.ts +166 -0
  32. package/dist/improvement-cycle-C095kS_g.js +2624 -0
  33. package/dist/improvement-cycle-C095kS_g.js.map +1 -0
  34. package/dist/index-BGdxAwfO.d.ts +838 -0
  35. package/dist/index-C-FYUuFG.d.ts +193 -0
  36. package/dist/index-CbNM40xG.d.ts +140 -0
  37. package/dist/index-DruSKs3Z.d.ts +7224 -0
  38. package/dist/index-Efjb3nrQ.d.ts +671 -0
  39. package/dist/index.d.ts +14 -1058
  40. package/dist/index.js +2106 -2082
  41. package/dist/index.js.map +1 -1
  42. package/dist/intelligence.d.ts +768 -889
  43. package/dist/intelligence.js +1466 -1367
  44. package/dist/intelligence.js.map +1 -1
  45. package/dist/{kb-gate-CwHO0vz6.d.ts → kb-gate-C8z2juK8.d.ts} +33 -31
  46. package/dist/kb-gate-DpaSwXVx.js +80 -0
  47. package/dist/kb-gate-DpaSwXVx.js.map +1 -0
  48. package/dist/knowledge-Ku-mPP4f.js +433 -0
  49. package/dist/knowledge-Ku-mPP4f.js.map +1 -0
  50. package/dist/knowledge.d.ts +2 -150
  51. package/dist/knowledge.js +2 -40
  52. package/dist/local-harness-Dh8PJ0ot.d.ts +455 -0
  53. package/dist/loop-runner-bin-BXsFEUcf.d.ts +162 -0
  54. package/dist/loop-runner-bin-BwjQ1NfH.js +268 -0
  55. package/dist/loop-runner-bin-BwjQ1NfH.js.map +1 -0
  56. package/dist/loop-runner-bin.d.ts +2 -15
  57. package/dist/loop-runner-bin.js +2 -24
  58. package/dist/loops.d.ts +5 -4164
  59. package/dist/loops.js +8 -419
  60. package/dist/mcp/bin.d.ts +1 -1
  61. package/dist/mcp/bin.js +116 -146
  62. package/dist/mcp/bin.js.map +1 -1
  63. package/dist/mcp/index.d.ts +295 -436
  64. package/dist/mcp/index.js +1242 -1177
  65. package/dist/mcp/index.js.map +1 -1
  66. package/dist/mcp/memory-bin.d.ts +1 -1
  67. package/dist/mcp/memory-bin.js +37 -16
  68. package/dist/mcp/memory-bin.js.map +1 -1
  69. package/dist/memory-server-DL6cE2Ag.js +234 -0
  70. package/dist/memory-server-DL6cE2Ag.js.map +1 -0
  71. package/dist/model-resolution-Btd9iIKV.js +98 -0
  72. package/dist/model-resolution-Btd9iIKV.js.map +1 -0
  73. package/dist/openai-tools-B68JaOCx.d.ts +24 -0
  74. package/dist/openai-tools-CKLy1C7M.js +44 -0
  75. package/dist/openai-tools-CKLy1C7M.js.map +1 -0
  76. package/dist/otel-export-D34IQW1C.js +843 -0
  77. package/dist/otel-export-D34IQW1C.js.map +1 -0
  78. package/dist/platform.d.ts +188 -185
  79. package/dist/platform.js +185 -218
  80. package/dist/platform.js.map +1 -1
  81. package/dist/prepare-B53sPV7M.js +4292 -0
  82. package/dist/prepare-B53sPV7M.js.map +1 -0
  83. package/dist/primeintellect/index.d.ts +149 -145
  84. package/dist/primeintellect/index.js +626 -1003
  85. package/dist/primeintellect/index.js.map +1 -1
  86. package/dist/profiles.d.ts +296 -490
  87. package/dist/profiles.js +722 -749
  88. package/dist/profiles.js.map +1 -1
  89. package/dist/protected-model-port-BLPH5VVv.js +722 -0
  90. package/dist/protected-model-port-BLPH5VVv.js.map +1 -0
  91. package/dist/protected-model-port-BP6Z4eau.d.ts +283 -0
  92. package/dist/protected-redaction--F3v1oo8.js +200 -0
  93. package/dist/protected-redaction--F3v1oo8.js.map +1 -0
  94. package/dist/redact-D-u-rrcn.js +82 -0
  95. package/dist/redact-D-u-rrcn.js.map +1 -0
  96. package/dist/redact-kbIOjfjM.d.ts +452 -0
  97. package/dist/researcher-CoVqNhfI.js +433 -0
  98. package/dist/researcher-CoVqNhfI.js.map +1 -0
  99. package/dist/runtime-BG0BziaP.js +5408 -0
  100. package/dist/runtime-BG0BziaP.js.map +1 -0
  101. package/dist/sandbox-events-DeI5xX8P.js +316 -0
  102. package/dist/sandbox-events-DeI5xX8P.js.map +1 -0
  103. package/dist/spawn-journal-CwPvKUTa.js +456 -0
  104. package/dist/spawn-journal-CwPvKUTa.js.map +1 -0
  105. package/dist/structural-rollout-IXUEplky.js +1445 -0
  106. package/dist/structural-rollout-IXUEplky.js.map +1 -0
  107. package/dist/substrate-B0TYNrXn.js +27 -0
  108. package/dist/substrate-B0TYNrXn.js.map +1 -0
  109. package/dist/{substrate-Dyiqmd3o.d.ts → substrate-BcnuSHXm.d.ts} +57 -54
  110. package/dist/supervise-BiRutHS9.js +7321 -0
  111. package/dist/supervise-BiRutHS9.js.map +1 -0
  112. package/dist/supervisor-DTKhF-RV.js +3826 -0
  113. package/dist/supervisor-DTKhF-RV.js.map +1 -0
  114. package/dist/testing.d.ts +4 -3
  115. package/dist/testing.js +2478 -2637
  116. package/dist/testing.js.map +1 -1
  117. package/dist/tool-server-RcWgLIsL.js +141 -0
  118. package/dist/tool-server-RcWgLIsL.js.map +1 -0
  119. package/dist/trace-propagation-CJJC7SVB.js +57 -0
  120. package/dist/trace-propagation-CJJC7SVB.js.map +1 -0
  121. package/dist/types-BaIpb0XT.d.ts +492 -0
  122. package/dist/types-BevOjfTY.d.ts +765 -0
  123. package/dist/types-C9j4qg6l.d.ts +500 -0
  124. package/dist/types-Cja5OTGh.d.ts +190 -0
  125. package/dist/util-MVgdwuIS.js +145 -0
  126. package/dist/util-MVgdwuIS.js.map +1 -0
  127. package/dist/workspace-archive-BosQiotA.js +575 -0
  128. package/dist/workspace-archive-BosQiotA.js.map +1 -0
  129. package/package.json +43 -56
  130. package/skills/build-with-agent-runtime/SKILL.md +1 -0
  131. package/dist/activation-Cm-9MMX1.d.ts +0 -69
  132. package/dist/analyst-loop.js.map +0 -1
  133. package/dist/backends-BO4Jqoe2.d.ts +0 -134
  134. package/dist/candidate-execution/index.js.map +0 -1
  135. package/dist/chunk-2KGAN2HM.js +0 -1256
  136. package/dist/chunk-2KGAN2HM.js.map +0 -1
  137. package/dist/chunk-2VZYRB55.js +0 -834
  138. package/dist/chunk-2VZYRB55.js.map +0 -1
  139. package/dist/chunk-3MDZX7YU.js +0 -125
  140. package/dist/chunk-3MDZX7YU.js.map +0 -1
  141. package/dist/chunk-5IBQAPVB.js +0 -29
  142. package/dist/chunk-5IBQAPVB.js.map +0 -1
  143. package/dist/chunk-5QOB7H74.js +0 -387
  144. package/dist/chunk-5QOB7H74.js.map +0 -1
  145. package/dist/chunk-C5RTIBNZ.js +0 -48
  146. package/dist/chunk-C5RTIBNZ.js.map +0 -1
  147. package/dist/chunk-CTRA64LY.js +0 -680
  148. package/dist/chunk-CTRA64LY.js.map +0 -1
  149. package/dist/chunk-DPEUKJRO.js +0 -27
  150. package/dist/chunk-DPEUKJRO.js.map +0 -1
  151. package/dist/chunk-FD2MBMOH.js +0 -494
  152. package/dist/chunk-FD2MBMOH.js.map +0 -1
  153. package/dist/chunk-H5QPIZNX.js +0 -907
  154. package/dist/chunk-H5QPIZNX.js.map +0 -1
  155. package/dist/chunk-HLKC4UYB.js +0 -3514
  156. package/dist/chunk-HLKC4UYB.js.map +0 -1
  157. package/dist/chunk-HNP72PNU.js +0 -192
  158. package/dist/chunk-HNP72PNU.js.map +0 -1
  159. package/dist/chunk-ISPWRSEC.js +0 -408
  160. package/dist/chunk-ISPWRSEC.js.map +0 -1
  161. package/dist/chunk-KRBFHMV6.js +0 -1228
  162. package/dist/chunk-KRBFHMV6.js.map +0 -1
  163. package/dist/chunk-M22PL4GH.js +0 -171
  164. package/dist/chunk-M22PL4GH.js.map +0 -1
  165. package/dist/chunk-NURIQBJQ.js +0 -72
  166. package/dist/chunk-NURIQBJQ.js.map +0 -1
  167. package/dist/chunk-OPVWXJ2H.js +0 -75
  168. package/dist/chunk-OPVWXJ2H.js.map +0 -1
  169. package/dist/chunk-PZZKQVQV.js +0 -52
  170. package/dist/chunk-PZZKQVQV.js.map +0 -1
  171. package/dist/chunk-Q2JSAVQ3.js +0 -671
  172. package/dist/chunk-Q2JSAVQ3.js.map +0 -1
  173. package/dist/chunk-RDOAVVHY.js +0 -699
  174. package/dist/chunk-RDOAVVHY.js.map +0 -1
  175. package/dist/chunk-SGKPNBXE.js +0 -60
  176. package/dist/chunk-SGKPNBXE.js.map +0 -1
  177. package/dist/chunk-SMQXZGLZ.js +0 -351
  178. package/dist/chunk-SMQXZGLZ.js.map +0 -1
  179. package/dist/chunk-UHEZW5BU.js +0 -2918
  180. package/dist/chunk-UHEZW5BU.js.map +0 -1
  181. package/dist/chunk-UPWGXKXB.js +0 -254
  182. package/dist/chunk-UPWGXKXB.js.map +0 -1
  183. package/dist/chunk-VISA6CI3.js +0 -200
  184. package/dist/chunk-VISA6CI3.js.map +0 -1
  185. package/dist/chunk-WMTCUOQL.js +0 -474
  186. package/dist/chunk-WMTCUOQL.js.map +0 -1
  187. package/dist/chunk-WRTOVNN4.js +0 -4728
  188. package/dist/chunk-WRTOVNN4.js.map +0 -1
  189. package/dist/chunk-WSTRQZYQ.js +0 -5576
  190. package/dist/chunk-WSTRQZYQ.js.map +0 -1
  191. package/dist/chunk-XBG2W2VW.js +0 -6434
  192. package/dist/chunk-XBG2W2VW.js.map +0 -1
  193. package/dist/chunk-YEJR7IXO.js +0 -68
  194. package/dist/chunk-YEJR7IXO.js.map +0 -1
  195. package/dist/chunk-YJZA2BIK.js +0 -1338
  196. package/dist/chunk-YJZA2BIK.js.map +0 -1
  197. package/dist/completion-gate-BMy5LGoP.d.ts +0 -256
  198. package/dist/conversation.js.map +0 -1
  199. package/dist/coordination-BZZSVYpZ.d.ts +0 -2570
  200. package/dist/environment-provider.js.map +0 -1
  201. package/dist/improvement-adapter-HAZz-7vK.d.ts +0 -203
  202. package/dist/knowledge.js.map +0 -1
  203. package/dist/local-harness-BDNcl6jI.d.ts +0 -175
  204. package/dist/loop-runner-bin-68aoM9-7.d.ts +0 -199
  205. package/dist/loop-runner-bin.js.map +0 -1
  206. package/dist/loops.js.map +0 -1
  207. package/dist/openai-tools-fnj6SRVg.d.ts +0 -46
  208. package/dist/protected-model-port-B4t-OQjL.d.ts +0 -271
  209. package/dist/redact-BuFjxBUJ.d.ts +0 -481
  210. package/dist/sanitize-DEbPNtyI.d.ts +0 -328
  211. package/dist/structural-rollout-DEh6CEsa.d.ts +0 -446
  212. package/dist/supervise-4_48wwvy.d.ts +0 -379
  213. package/dist/types-BCoemcXU.d.ts +0 -802
  214. package/dist/types-BwoZWq-i.d.ts +0 -510
  215. package/dist/types-Cbp72qyu.d.ts +0 -491
  216. package/dist/types-CmYCMbFT.d.ts +0 -203
  217. package/dist/types-CvNwMzQt.d.ts +0 -957
  218. package/dist/worktree-fanout-DxhAWr5Z.d.ts +0 -999
@@ -1,271 +0,0 @@
1
- import { TraceStore } from '@tangle-network/agent-eval';
2
- import { AgentCandidateArtifactRef, AgentCandidateAttemptPolicy, Sha256Digest, AgentCandidateResolvedModel, AgentCandidateFixedSpend, AgentProfile, AgentCandidateProfile, AgentProfileDiff, AgentCandidateProfilePlanEvidence, AgentCandidateProfileActivation } from '@tangle-network/agent-interface';
3
- import { A as AgentCandidateExecutorPort, a as AgentCandidateBenchmarkGraderPort, b as AgentCandidateOutputArtifactPort, P as PreparedAgentCandidateExecution, c as AgentCandidateRunFinalization, V as VerifiedAgentCandidate, d as AgentCandidateTaskExecution, e as AgentCandidateExecutionPorts, f as AgentCandidateModelPort, g as AgentCandidateProtectedModelReservation, h as AgentCandidateProtectedModelActivation, i as AgentCandidateProtectedModelSettlement } from './types-Cbp72qyu.js';
4
-
5
- interface AgentCandidatePreparationEvidence {
6
- readonly executionPlan: AgentCandidateArtifactRef;
7
- readonly materializationReceipt: AgentCandidateArtifactRef;
8
- }
9
-
10
- /** Durable one-shot lifecycle for candidate execution attempts. */
11
-
12
- /** Non-secret identities a trusted recovery worker needs to close an abandoned attempt. */
13
- interface AgentCandidateExecutionCleanupHandles {
14
- readonly preparationId: string;
15
- readonly modelGrantDigest: Sha256Digest;
16
- readonly resolvedModel: AgentCandidateResolvedModel;
17
- readonly traceRunId: string;
18
- readonly cleanupTimeoutMs: number;
19
- readonly memory?: {
20
- readonly accessDigest: Sha256Digest;
21
- readonly effectiveNamespace: string;
22
- };
23
- }
24
- /** Immutable signed identity stored for one execution attempt. */
25
- interface AgentCandidateExecutionClaim {
26
- readonly executionId: string;
27
- readonly attempt: number;
28
- readonly maxAttempts: number;
29
- readonly retryPolicy: AgentCandidateAttemptPolicy['retryPolicy'];
30
- readonly bundleDigest: Sha256Digest;
31
- readonly executionPlanDigest: Sha256Digest;
32
- /** Durable canonical bytes needed to reconstruct the signed preparation. */
33
- readonly preparationEvidence: AgentCandidatePreparationEvidence;
34
- /** Frozen plan identity with only attempt number and per-attempt grant identity normalized. */
35
- readonly retryLineageDigest: Sha256Digest;
36
- /** The winning lease stops authorizing a new terminal write at this instant. */
37
- readonly leaseExpiresAtMs: number;
38
- /** Frozen budget for task verification, executable grading, and receipt construction. */
39
- readonly resultTimeoutMs: number;
40
- /** Non-secret handles retained so an expired attempt can be closed and reconciled. */
41
- readonly cleanup: AgentCandidateExecutionCleanupHandles;
42
- }
43
- /** Secret capability required to finish the acquired attempt. */
44
- interface AgentCandidateExecutionLease {
45
- readonly executionId: string;
46
- readonly attempt: number;
47
- readonly token: string;
48
- readonly expiresAtMs: number;
49
- }
50
- /** Only the first class is retryable, and only when the closed model ledger has zero calls. */
51
- type AgentCandidateExecutionFailureClass = 'pre-model-infrastructure' | 'execution' | 'post-model-infrastructure' | 'unknown';
52
- /** Evaluator-owned terminal facts staged durably before the terminal CAS. */
53
- type AgentCandidateExecutionTerminalResult = {
54
- readonly status: 'succeeded';
55
- readonly usage: AgentCandidateFixedSpend;
56
- readonly modelSettlement: AgentCandidateArtifactRef;
57
- readonly taskOutcome: AgentCandidateArtifactRef;
58
- readonly benchmarkResult: AgentCandidateArtifactRef;
59
- readonly runReceipt: AgentCandidateArtifactRef;
60
- } | {
61
- readonly status: 'failed';
62
- readonly failureClass: AgentCandidateExecutionFailureClass;
63
- readonly usage: AgentCandidateFixedSpend;
64
- readonly modelSettlement: AgentCandidateArtifactRef;
65
- readonly failureEvidence?: AgentCandidateArtifactRef;
66
- };
67
- /** Durable terminal record for one acquired execution attempt. */
68
- type AgentCandidateExecutionTerminalRecord = AgentCandidateExecutionTerminalResult & {
69
- readonly executionId: string;
70
- readonly attempt: number;
71
- readonly bundleDigest: Sha256Digest;
72
- readonly executionPlanDigest: Sha256Digest;
73
- readonly preparationEvidence: AgentCandidateExecutionClaim['preparationEvidence'];
74
- /** RFC 8785 SHA-256 of this record with `terminalDigest` omitted. */
75
- readonly terminalDigest: Sha256Digest;
76
- };
77
- /** Monotonic durable phase: the second value means candidate code could have started. */
78
- type AgentCandidateExecutionPhase = 'claimed' | 'candidate-may-run';
79
- /** Trusted, independently observed closure facts for one expired winning lease. */
80
- interface AgentCandidateExecutionRecoveryEvidence {
81
- readonly failureClass: AgentCandidateExecutionFailureClass;
82
- readonly usage: AgentCandidateFixedSpend;
83
- readonly modelSettlement: AgentCandidateArtifactRef;
84
- readonly failureEvidence?: AgentCandidateArtifactRef;
85
- readonly process: {
86
- readonly stopped: true;
87
- readonly executionPlanDigest: Sha256Digest;
88
- };
89
- readonly model: {
90
- readonly closed: true;
91
- readonly preparationId: string;
92
- readonly grantDigest: Sha256Digest;
93
- };
94
- readonly memory?: {
95
- readonly closed: true;
96
- readonly preparationId: string;
97
- readonly accessDigest: Sha256Digest;
98
- readonly effectiveNamespace: string;
99
- };
100
- }
101
- interface AgentCandidateExecutionAttemptRef {
102
- readonly executionId: string;
103
- readonly attempt: number;
104
- }
105
- /** Persisted state available to a fresh trusted recovery worker after a crash. */
106
- interface AgentCandidateExecutionAttemptRecord {
107
- readonly claim: AgentCandidateExecutionClaim;
108
- readonly phase: AgentCandidateExecutionPhase;
109
- /** Durable outbox content written before the terminal compare-and-set. */
110
- readonly staged?: AgentCandidateExecutionTerminalRecord;
111
- readonly terminal?: AgentCandidateExecutionTerminalRecord;
112
- }
113
- /** Result of atomically claiming one execution attempt. */
114
- type AgentCandidateExecutionClaimResult = {
115
- readonly acquired: true;
116
- readonly claim: AgentCandidateExecutionClaim;
117
- readonly lease: AgentCandidateExecutionLease;
118
- } | {
119
- readonly acquired: false;
120
- readonly reason: 'already-claimed';
121
- /** The durable winner already occupying this execution-attempt slot. */
122
- readonly claim: AgentCandidateExecutionClaim;
123
- /** True only when every signed claim field matches the durable winner. */
124
- readonly exactReplay: boolean;
125
- } | {
126
- readonly acquired: false;
127
- readonly reason: 'retry-not-eligible';
128
- readonly claim: AgentCandidateExecutionClaim;
129
- readonly detail: AgentCandidateRetryRejection;
130
- };
131
- /** Result of atomically recording an attempt's terminal facts. */
132
- type AgentCandidateExecutionFinishResult = {
133
- readonly finished: true;
134
- readonly terminal: AgentCandidateExecutionTerminalRecord;
135
- } | {
136
- readonly finished: false;
137
- readonly terminal: AgentCandidateExecutionTerminalRecord;
138
- /** True when a repeated finish supplied the same terminal digest. */
139
- readonly exactReplay: boolean;
140
- };
141
- /** Result of durably staging the one immutable terminal outbox entry. */
142
- type AgentCandidateExecutionStageResult = {
143
- readonly staged: true;
144
- readonly terminal: AgentCandidateExecutionTerminalRecord;
145
- } | {
146
- readonly staged: false;
147
- readonly terminal: AgentCandidateExecutionTerminalRecord;
148
- readonly exactReplay: boolean;
149
- };
150
- /** Result of crossing the irreversible candidate-may-run boundary. */
151
- type AgentCandidateExecutionPhaseResult = {
152
- readonly marked: true;
153
- readonly phase: 'candidate-may-run';
154
- } | {
155
- readonly marked: false;
156
- readonly phase: 'candidate-may-run';
157
- };
158
- type AgentCandidateRetryRejection = 'prior-attempt-missing' | 'prior-attempt-running' | 'prior-attempt-succeeded' | 'prior-attempt-spent-model-calls' | 'prior-attempt-not-pre-model-infrastructure' | 'retry-lineage-mismatch';
159
- /**
160
- * Atomic one-shot store for candidate execution attempts.
161
- *
162
- * Implementations must linearize both methods across every process sharing the
163
- * store. Terminal publication is deliberately two-step: `stageTerminal`
164
- * fsyncs the complete immutable outbox record, then `finish` publishes exactly
165
- * those staged bytes by digest. A crash between the two leaves recoverable
166
- * evidence rather than an ambiguous completed run.
167
- */
168
- interface AgentCandidateExecutionClaimStore {
169
- tryClaim(claim: AgentCandidateExecutionClaim): Promise<AgentCandidateExecutionClaimResult>;
170
- getAttempt(attempt: AgentCandidateExecutionAttemptRef): Promise<AgentCandidateExecutionAttemptRecord | undefined>;
171
- /** Persist the point after which candidate code may have run. */
172
- markCandidateMayRun(lease: AgentCandidateExecutionLease): Promise<AgentCandidateExecutionPhaseResult>;
173
- /** Fsync the complete terminal record into the durable outbox. */
174
- stageTerminal(lease: AgentCandidateExecutionLease, result: AgentCandidateExecutionTerminalResult): Promise<AgentCandidateExecutionStageResult>;
175
- /** Publish exactly the staged terminal identified by `terminalDigest`. */
176
- finish(lease: AgentCandidateExecutionLease, terminalDigest: Sha256Digest): Promise<AgentCandidateExecutionFinishResult>;
177
- /**
178
- * Write a failed terminal only after the lease expired and a trusted worker
179
- * independently proved process death plus model and memory closure.
180
- */
181
- recoverExpired(attempt: AgentCandidateExecutionAttemptRef, evidence: AgentCandidateExecutionRecoveryEvidence): Promise<AgentCandidateExecutionFinishResult>;
182
- }
183
- interface InMemoryAgentCandidateExecutionClaimStoreOptions {
184
- /** Testable evaluator clock; defaults to `Date.now`. */
185
- now?: () => number;
186
- }
187
- /** Single-process lifecycle implementation. */
188
- declare class InMemoryAgentCandidateExecutionClaimStore implements AgentCandidateExecutionClaimStore {
189
- private readonly claims;
190
- private readonly now;
191
- constructor(options?: InMemoryAgentCandidateExecutionClaimStoreOptions);
192
- tryClaim(requested: AgentCandidateExecutionClaim): Promise<AgentCandidateExecutionClaimResult>;
193
- getAttempt(requestedAttempt: AgentCandidateExecutionAttemptRef): Promise<AgentCandidateExecutionAttemptRecord | undefined>;
194
- markCandidateMayRun(requestedLease: AgentCandidateExecutionLease): Promise<AgentCandidateExecutionPhaseResult>;
195
- stageTerminal(requestedLease: AgentCandidateExecutionLease, result: AgentCandidateExecutionTerminalResult): Promise<AgentCandidateExecutionStageResult>;
196
- finish(requestedLease: AgentCandidateExecutionLease, requestedTerminalDigest: Sha256Digest): Promise<AgentCandidateExecutionFinishResult>;
197
- recoverExpired(requestedAttempt: AgentCandidateExecutionAttemptRef, evidence: AgentCandidateExecutionRecoveryEvidence): Promise<AgentCandidateExecutionFinishResult>;
198
- private requireClaim;
199
- }
200
-
201
- interface ExecutePreparedAgentCandidateOptions {
202
- executor: AgentCandidateExecutorPort;
203
- grader: AgentCandidateBenchmarkGraderPort;
204
- outputArtifacts: AgentCandidateOutputArtifactPort;
205
- traceStore: TraceStore;
206
- /** Long-lived evaluator-owned store shared by every process that can run this benchmark. */
207
- claimStore: AgentCandidateExecutionClaimStore;
208
- /** Maximum time to prove process death and revoke protected access after a run ends. */
209
- cleanupTimeoutMs?: number;
210
- /** Maximum time for task verification, executable grading, and receipt construction. */
211
- resultTimeoutMs?: number;
212
- }
213
- /** Executes and finalizes one durably claimed candidate without exposing an unproven result. */
214
- declare function executePreparedAgentCandidate(prepared: PreparedAgentCandidateExecution, options: ExecutePreparedAgentCandidateOptions): Promise<AgentCandidateRunFinalization>;
215
-
216
- interface PrepareAgentCandidateExecutionOptions {
217
- cleanupTimeoutMs?: number;
218
- /** Maximum time for task verification, executable grading, and receipt construction. */
219
- resultTimeoutMs?: number;
220
- }
221
- /** Materializes a verified candidate into one immutable evaluator-owned execution plan. */
222
- declare function prepareAgentCandidateExecution(candidate: VerifiedAgentCandidate, task: AgentCandidateTaskExecution, ports: AgentCandidateExecutionPorts, options?: PrepareAgentCandidateExecutionOptions): Promise<PreparedAgentCandidateExecution>;
223
-
224
- /** Parse and check every native file hash plus both canonical document digests. */
225
- declare function parseAgentCandidateProfileActivation(input: unknown, expectedProfilePlanDigest?: AgentCandidateProfilePlanEvidence['digest']): AgentCandidateProfileActivation;
226
- /** Prove the measured generic profile and sealed candidate profile describe the same behavior. */
227
- declare function assertCandidateProfileBinding(measuredInput: unknown, bundled: AgentCandidateProfile): void;
228
- /** Parse a complete profile without silently discarding unsupported fields. */
229
- declare function parseExactAgentProfile(input: unknown, label: string): AgentProfile;
230
- /** Parse a profile diff without silently discarding unsupported fields. */
231
- declare function parseExactAgentProfileDiff(input: unknown, label: string): AgentProfileDiff;
232
- /** Apply one exact diff and reject any value that cannot be preserved canonically. */
233
- declare function applyExactAgentProfileDiff(baseInput: unknown, diffInput: unknown, label: string): AgentProfile;
234
-
235
- type AgentCandidateModelGrantReserveInput = Parameters<AgentCandidateModelPort['reserveGrant']>[0];
236
- type AgentCandidateModelGrantActivateInput = Parameters<AgentCandidateModelPort['activateGrant']>[0];
237
- type AgentCandidateModelGrantSettleInput = Parameters<AgentCandidateModelPort['settleGrant']>[0];
238
- /** Secret-free response from the service's reservation endpoint. */
239
- type AgentCandidateModelGrantReservation = AgentCandidateProtectedModelReservation;
240
- /**
241
- * Narrow transport contract for a service that owns scoped model credentials
242
- * and the authoritative per-call usage ledger.
243
- *
244
- * An HTTP client can bind these methods to control-plane endpoints. Keeping
245
- * transport out of the runtime prevents parent credentials, endpoint paths,
246
- * and retry policy from becoming part of the portable candidate contract.
247
- */
248
- interface AgentCandidateModelGrantClient {
249
- reserve(input: AgentCandidateModelGrantReserveInput): Promise<AgentCandidateModelGrantReservation>;
250
- activate(input: AgentCandidateModelGrantActivateInput): Promise<AgentCandidateProtectedModelActivation>;
251
- settle(input: AgentCandidateModelGrantSettleInput): Promise<AgentCandidateProtectedModelSettlement>;
252
- }
253
- interface CreateProtectedAgentCandidateModelPortOptions {
254
- client: AgentCandidateModelGrantClient;
255
- /** Catalog/snapshot resolution stays separate from credential issuance. */
256
- resolveModel: AgentCandidateModelPort['resolve'];
257
- /** The only public DNS name candidate processes may reach for inference. */
258
- gatewayDomain: string;
259
- /** Exact environment names the activation endpoint must return, no more or fewer. */
260
- activationEnvNames: readonly string[];
261
- }
262
- /**
263
- * Bind a protected model-grant service to the immutable candidate runtime.
264
- *
265
- * The service remains the authority for expiry, admission, revocation, and
266
- * metering. This adapter independently checks every response before allowing
267
- * it to cross into candidate execution or durable receipt finalization.
268
- */
269
- declare function createProtectedAgentCandidateModelPort(options: CreateProtectedAgentCandidateModelPortOptions): AgentCandidateModelPort;
270
-
271
- export { type AgentCandidateExecutionClaimStore as A, parseExactAgentProfile as B, type CreateProtectedAgentCandidateModelPortOptions as C, parseExactAgentProfileDiff as D, type ExecutePreparedAgentCandidateOptions as E, prepareAgentCandidateExecution as F, InMemoryAgentCandidateExecutionClaimStore as I, type PrepareAgentCandidateExecutionOptions as P, type AgentCandidateExecutionAttemptRecord as a, type AgentCandidateExecutionAttemptRef as b, type AgentCandidateExecutionClaim as c, type AgentCandidateExecutionClaimResult as d, type AgentCandidateExecutionCleanupHandles as e, type AgentCandidateExecutionFailureClass as f, type AgentCandidateExecutionFinishResult as g, type AgentCandidateExecutionLease as h, type AgentCandidateExecutionPhase as i, type AgentCandidateExecutionPhaseResult as j, type AgentCandidateExecutionRecoveryEvidence as k, type AgentCandidateExecutionStageResult as l, type AgentCandidateExecutionTerminalRecord as m, type AgentCandidateExecutionTerminalResult as n, type AgentCandidateModelGrantActivateInput as o, parseAgentCandidateProfileActivation as p, type AgentCandidateModelGrantClient as q, type AgentCandidateModelGrantReservation as r, type AgentCandidateModelGrantReserveInput as s, type AgentCandidateModelGrantSettleInput as t, type AgentCandidatePreparationEvidence as u, type AgentCandidateRetryRejection as v, applyExactAgentProfileDiff as w, assertCandidateProfileBinding as x, createProtectedAgentCandidateModelPort as y, executePreparedAgentCandidate as z };