@tangle-network/agent-runtime 0.102.2 → 0.103.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 (77) hide show
  1. package/README.md +73 -10
  2. package/dist/agent.d.ts +1 -1
  3. package/dist/agent.js +5 -5
  4. package/dist/analyst-loop.d.ts +1 -1
  5. package/dist/candidate-execution/index.d.ts +5 -41
  6. package/dist/candidate-execution/index.js +8 -6
  7. package/dist/{chunk-QCXD7NHM.js → chunk-3LJF5XSE.js} +79 -334
  8. package/dist/chunk-3LJF5XSE.js.map +1 -0
  9. package/dist/{chunk-3DW5DEKQ.js → chunk-5AITUUHO.js} +3 -3
  10. package/dist/{chunk-SQ3ZJH3Y.js → chunk-6WZZXQV5.js} +467 -23
  11. package/dist/chunk-6WZZXQV5.js.map +1 -0
  12. package/dist/{chunk-SCOHHMKU.js → chunk-AAN2MB2X.js} +3 -3
  13. package/dist/{chunk-KSM6GFHP.js → chunk-B7K7V22Y.js} +2 -2
  14. package/dist/{chunk-ZUCUAFVF.js → chunk-EAQ5YRRY.js} +1382 -62
  15. package/dist/chunk-EAQ5YRRY.js.map +1 -0
  16. package/dist/chunk-ISPWRSEC.js +408 -0
  17. package/dist/chunk-ISPWRSEC.js.map +1 -0
  18. package/dist/{chunk-7FJJUC73.js → chunk-LFM4JBRW.js} +29 -6
  19. package/dist/{chunk-7FJJUC73.js.map → chunk-LFM4JBRW.js.map} +1 -1
  20. package/dist/{chunk-ROILMKDL.js → chunk-QYCKIV6C.js} +3 -3
  21. package/dist/{chunk-LJLG734E.js → chunk-SBTWKPVR.js} +10 -11
  22. package/dist/{chunk-LJLG734E.js.map → chunk-SBTWKPVR.js.map} +1 -1
  23. package/dist/{chunk-CK76OZPM.js → chunk-SNSMRT6H.js} +56 -386
  24. package/dist/chunk-SNSMRT6H.js.map +1 -0
  25. package/dist/{chunk-EKUMRQNR.js → chunk-TUSOOIDV.js} +2 -2
  26. package/dist/{chunk-J6V6DWWS.js → chunk-ZOYN3JR5.js} +5 -5
  27. package/dist/{chunk-377GOJHJ.js → chunk-ZXICDSAK.js} +333 -4
  28. package/dist/chunk-ZXICDSAK.js.map +1 -0
  29. package/dist/{completion-gate-C6dhVN-N.d.ts → completion-gate-DLINnrkM.d.ts} +1 -1
  30. package/dist/{coordination-D9l_YmwW.d.ts → coordination-DTehA977.d.ts} +250 -8
  31. package/dist/environment-provider.d.ts +2 -2
  32. package/dist/index.d.ts +12 -12
  33. package/dist/index.js +17 -15
  34. package/dist/index.js.map +1 -1
  35. package/dist/intelligence.d.ts +26 -8
  36. package/dist/intelligence.js +24 -7
  37. package/dist/intelligence.js.map +1 -1
  38. package/dist/knowledge.d.ts +6 -6
  39. package/dist/knowledge.js +9 -9
  40. package/dist/{loop-runner-bin-PnWslIw4.d.ts → loop-runner-bin-DhIXsLAd.d.ts} +2 -2
  41. package/dist/loop-runner-bin.d.ts +5 -5
  42. package/dist/loop-runner-bin.js +6 -6
  43. package/dist/loops.d.ts +305 -148
  44. package/dist/loops.js +82 -14
  45. package/dist/mcp/bin.js +3 -3
  46. package/dist/mcp/index.d.ts +6 -6
  47. package/dist/mcp/index.js +6 -6
  48. package/dist/profiles.d.ts +1 -1
  49. package/dist/{profile-DbfaMTdk.d.ts → protected-model-port-DzkUY3HQ.d.ts} +41 -3
  50. package/dist/{structural-rollout-D7xik9XR.d.ts → structural-rollout-BFPIy3iw.d.ts} +3 -3
  51. package/dist/supervise-Cp8bNcJi.d.ts +379 -0
  52. package/dist/testing.js +10 -10
  53. package/dist/testing.js.map +1 -1
  54. package/dist/{types-CWqfCO8s.d.ts → types-Cbp72qyu.d.ts} +1 -1
  55. package/dist/{types-CLat4bT9.d.ts → types-DK11_O4L.d.ts} +1 -1
  56. package/dist/types-lZTE_LBd.d.ts +957 -0
  57. package/dist/{worktree-fanout-DsIR4d6w.d.ts → worktree-fanout-DiiJWjJO.d.ts} +17 -5
  58. package/package.json +3 -2
  59. package/skills/build-with-agent-runtime/SKILL.md +7 -5
  60. package/skills/generate-eval/SKILL.md +45 -52
  61. package/skills/loop-writer/SKILL.md +79 -147
  62. package/skills/supervise/SKILL.md +33 -14
  63. package/dist/chunk-377GOJHJ.js.map +0 -1
  64. package/dist/chunk-CK76OZPM.js.map +0 -1
  65. package/dist/chunk-IMSNJSXH.js +0 -73
  66. package/dist/chunk-IMSNJSXH.js.map +0 -1
  67. package/dist/chunk-QCXD7NHM.js.map +0 -1
  68. package/dist/chunk-SQ3ZJH3Y.js.map +0 -1
  69. package/dist/chunk-ZUCUAFVF.js.map +0 -1
  70. package/dist/supervise-BQdNAXtK.d.ts +0 -131
  71. package/dist/types-D870JlH0.d.ts +0 -500
  72. /package/dist/{chunk-3DW5DEKQ.js.map → chunk-5AITUUHO.js.map} +0 -0
  73. /package/dist/{chunk-SCOHHMKU.js.map → chunk-AAN2MB2X.js.map} +0 -0
  74. /package/dist/{chunk-KSM6GFHP.js.map → chunk-B7K7V22Y.js.map} +0 -0
  75. /package/dist/{chunk-ROILMKDL.js.map → chunk-QYCKIV6C.js.map} +0 -0
  76. /package/dist/{chunk-EKUMRQNR.js.map → chunk-TUSOOIDV.js.map} +0 -0
  77. /package/dist/{chunk-J6V6DWWS.js.map → chunk-ZOYN3JR5.js.map} +0 -0
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @tangle-network/agent-runtime
2
2
 
3
- The engine Tangle's AI agents run on. It runs an agent as a **chat turn**, a **one-shot task**, or a **team of agents** working toward a goal, records every run, and uses those records to **measure and improve** agents against real pass/fail checks.
3
+ A TypeScript runtime for running AI agents as a **chat turn**, a **one-shot task**, or a **team of agents** working toward a goal — that records every run and uses those records to **measure and improve** agents against real pass/fail checks. It is the engine Tangle's own production agents run on.
4
4
 
5
- One loop, used four common ways. Domain behavior (models, tools, knowledge) plugs in as adapters; the scoring statistics and the ship decision come from [`@tangle-network/agent-eval`](https://www.npmjs.com/package/@tangle-network/agent-eval); sandboxed execution from [`@tangle-network/sandbox`](https://www.npmjs.com/package/@tangle-network/sandbox).
5
+ Domain behavior (models, tools, knowledge) plugs in as adapters; the scoring statistics and the ship decision come from [`@tangle-network/agent-eval`](https://www.npmjs.com/package/@tangle-network/agent-eval); sandboxed execution from [`@tangle-network/sandbox`](https://www.npmjs.com/package/@tangle-network/sandbox).
6
6
 
7
7
  ```bash
8
8
  pnpm add @tangle-network/agent-runtime @tangle-network/agent-eval @tangle-network/sandbox
@@ -10,6 +10,7 @@ pnpm add @tangle-network/agent-runtime @tangle-network/agent-eval @tangle-networ
10
10
 
11
11
  ## Contents
12
12
 
13
+ - [Quickstart](#quickstart-offline-no-api-keys)
13
14
  - [What you do with it](#what-you-do-with-it)
14
15
  - [Run a chat turn](#run-a-chat-turn)
15
16
  - [Supervise a team of agents](#supervise-a-team-of-agents)
@@ -17,15 +18,51 @@ pnpm add @tangle-network/agent-runtime @tangle-network/agent-eval @tangle-networ
17
18
  - [Improve a knowledge base](#improve-a-knowledge-base)
18
19
  - [Run on PrimeIntellect](#run-on-primeintellect)
19
20
  - [How it works](#how-it-works-the-short-version)
21
+ - [Primitives](#primitives)
20
22
  - [Examples](#examples)
21
23
  - [Where to go next](#where-to-go-next)
22
24
 
23
- **See it run in 30 seconds** (offline, no keys): the one move everything else builds on, a driver reading a worker's output and composing the next step from it:
25
+ ## Quickstart (offline, no API keys)
26
+
27
+ The core move everything else builds on: a driver runs a worker, reads the worker's real output, and writes the next prompt from it until a check passes. This is the full working loop from [`examples/quickstart/quickstart.ts`](./examples/quickstart/quickstart.ts) (the worker is a scripted stand-in so it runs with zero credentials; swap it for a real sandbox, CLI-harness, or router backend without changing the driver):
28
+
29
+ ```ts
30
+ import { inProcessSandboxClient, runLoop } from '@tangle-network/agent-runtime/loops'
31
+
32
+ const result = await runLoop<Task, Note, 'refine' | 'pick-winner' | 'fail'>({
33
+ task: { prompt: 'Write a one-line release note for one-click restore.' },
34
+ driver: {
35
+ name: 'refine',
36
+ plan: async (task, history) => {
37
+ const last = history[history.length - 1]
38
+ if (!last) return [task] // shot 0: run the task as written
39
+ if (last.verdict?.valid || history.length >= 3) return [] // done, or out of shots
40
+ // The core move: read the last worker's real output, write the next prompt FROM it.
41
+ return [{ prompt: `Rewrite "${last.output?.note}" to mention the rollback path.` }]
42
+ },
43
+ decide: (history) =>
44
+ history.some((shot) => shot.verdict?.valid) ? 'pick-winner' : history.length < 3 ? 'refine' : 'fail',
45
+ },
46
+ agentRun: { profile: { name: 'note-writer' } as AgentProfile, taskToPrompt: (t) => t.prompt },
47
+ output, // parses the worker's event stream into { note }
48
+ validator, // pass/fail check: does the note mention "rollback"?
49
+ ctx: { sandboxClient: worker },
50
+ maxIterations: 3,
51
+ })
52
+ ```
53
+
54
+ Run it from a clone of this repo and you get exactly this:
24
55
 
25
56
  ```bash
26
- pnpm tsx examples/driver-loop/driver-loop.ts
57
+ $ pnpm i && pnpm build
58
+ $ pnpm tsx examples/quickstart/quickstart.ts
59
+ shot 0: reject — "Shipped one-click restore."
60
+ shot 1: PASS — "Shipped one-click restore with an instant rollback path."
61
+ decision: pick-winner — winner: shot 1
27
62
  ```
28
63
 
64
+ The fully annotated version of this loop, with every seam explained, is [`examples/driver-loop`](./examples/driver-loop).
65
+
29
66
  ## What you do with it
30
67
 
31
68
  | You want to… | Call |
@@ -113,12 +150,19 @@ import {
113
150
  reviewAgentImprovementProposal,
114
151
  } from '@tangle-network/agent-runtime/intelligence'
115
152
 
153
+ const baseline = freezeBaseline(liveProfile)
116
154
  const result = await proposeAgentImprovement({
117
155
  runId,
118
156
  profile: liveProfile,
119
157
  analysis,
120
158
  improvement: { surface: 'prompt', scenarios, judge, agent },
121
- buildExperiment: ({ improvement }) => freezeExperiment(liveProfile, improvement.candidate),
159
+ buildExperiment: ({ improvement }) =>
160
+ buildExperimentMaterial({
161
+ baseline,
162
+ candidate: compileCandidateBundle({ baseline, improvement: improvement.candidate }),
163
+ benchmark: heldOutBenchmark,
164
+ policy: comparisonPolicy,
165
+ }),
122
166
  placeCell,
123
167
  })
124
168
 
@@ -140,7 +184,8 @@ const outcome = await executeAgentImprovementActivation(
140
184
  )
141
185
  ```
142
186
 
143
- `freezeExperiment`, `placeCell`, and the transaction functions are application ports because storage and compute differ by product.
187
+ `buildExperimentMaterial`, `placeCell`, and the transaction functions are application ports because storage and compute differ by product.
188
+ The builder returns only baseline, candidate, tasks, and policy; Runtime adds the search ancestry and seals the final experiment.
144
189
  Runtime owns candidate identity, measurement, review binding, expiry, retry identity, and result validation; the application owns its atomic write.
145
190
 
146
191
  ### Improve a knowledge base
@@ -232,12 +277,31 @@ Use `importPrimeIntellectTraces(...)` to convert them to agent-eval `RunRecord`s
232
277
  - **Improvement is gated.** A change ships only after it beats the current agent on fresh tasks no tuning step ever saw, with a statistical test, not a single lucky run.
233
278
  - **The grader is honest.** Whatever gives feedback never sees the answer key, and scores are recomputed from the attempts actually run. An agent cannot fabricate its own win.
234
279
 
280
+ ## Primitives
281
+
282
+ The general-purpose pieces, by import path. Every export with its one-line summary lives in the generated [`docs/api/primitive-catalog.md`](./docs/api/primitive-catalog.md) — check it before building anything new.
283
+
284
+ | Primitive | What it does | Import |
285
+ |---|---|---|
286
+ | Chat-turn runtime | Stream, trace, and persist one production chat turn (`handleChatTurn`); normalize any backend's stream into one event shape (`streamAgentTurn`) | root · `/loops` |
287
+ | Supervision | One agent spawns, budgets, and steers workers toward a goal (`supervise`, `delegate`), on an in-process loop or a sandboxed coding harness | `/loops` · `/mcp` |
288
+ | Loop kernel + combinators | Write a driver (`plan`/`decide`) and run it (`runLoop`), or compose fixed shapes: refine (`loopUntil`), best-of-N (`fanout`), chain (`pipeline`), multi-judge (`panel`) | `/loops` |
289
+ | Improvement driver | Optimize one part of an agent and ship only if it wins on tasks it never practiced on (`improve`); production proposal/review/activation flow | root · `/intelligence` |
290
+ | Benchmarks + leaderboards | Compare strategies with significance stats (`runBenchmark`), stand up a harness×model leaderboard (`defineLeaderboard`, `leaderboard`) | `/loops` |
291
+ | Knowledge improvement | Produce a measured candidate copy of a KB/wiki/RAG corpus without touching the live one (`runKnowledgeImprovementJob`) | `/knowledge` |
292
+ | MCP tool servers | Give an agent a `delegate` tool or live worker-coordination tools over MCP | `/mcp` |
293
+ | Conversations + durability | Multi-turn two-agent sessions with SQL-backed resume (D1/pg/sqlite/libSQL adapters) | `/conversation` |
294
+ | Training/eval adapter | Package the same runtime program as a PrimeIntellect Verifiers environment; import its traces back | `/primeintellect` |
295
+
296
+ Remaining subpaths: `/agent`, `/profiles`, `/platform`, `/analyst-loop`, `/environment-provider`, `/testing` (validated fixture records for consumer tests).
297
+
235
298
  ## Examples
236
299
 
237
300
  Runnable, grouped by what they show. Copy the one nearest your task:
238
301
 
239
302
  | Do this | Example |
240
303
  |---|---|
304
+ | The smallest complete loop (start here) | [`quickstart`](./examples/quickstart) · [`driver-loop`](./examples/driver-loop) |
241
305
  | Run a product chat turn | [`chat-handler`](./examples/chat-handler) |
242
306
  | Drive a team of agents to a goal | [`supervise`](./examples/supervise) · [`recursive-supervisor`](./examples/recursive-supervisor) |
243
307
  | Benchmark strategies on your own domain | [`coding-benchmark`](./examples/coding-benchmark) |
@@ -249,15 +313,14 @@ Runnable, grouped by what they show. Copy the one nearest your task:
249
313
  | Evaluate or train a runtime program on PrimeIntellect | `@tangle-network/agent-runtime/primeintellect` |
250
314
  | Study coordination vs raw compute | [`ablation-suite`](./examples/ablation-suite) |
251
315
 
252
- All 28 live in [`examples/`](./examples).
316
+ All 29 live in [`examples/`](./examples).
253
317
 
254
318
  ## Where to go next
255
319
 
256
320
  - New here? [`docs/concepts.md`](./docs/concepts.md), the mental model in plain terms.
257
321
  - [`docs/canonical-api.md`](./docs/canonical-api.md), find the primitive: "I want to ___ → use ___".
258
322
  - [`docs/api/primitive-catalog.md`](./docs/api/primitive-catalog.md), every export in one generated, never-stale list with its import path. Check it before building anything new.
259
- - Import subpaths: the root export is the product surface (`handleChatTurn`, `improve`); deeper capabilities ship as subpaths: `/loops` (multi-agent + the loop kernel), `/conversation` (multi-turn conversations), `/knowledge` (KB improvement), `/primeintellect` (Prime task, runtime, and trace adapter), `/mcp` (tool servers), `/intelligence` (observability drop-in), `/testing` (validated fixture records for consumer tests), `/agent`, `/profiles`, `/platform`, `/analyst-loop`, `/environment-provider`.
260
- - [`docs/architecture.md`](./docs/architecture.md), the design, end to end.
323
+ - [`docs/design.md`](./docs/design.md), the design philosophy and the internal research docs behind it background reading, not required to use the package.
261
324
  - [`bench/HARNESS.md`](./bench/HARNESS.md), the experiment harness and how to run a benchmark.
262
325
 
263
- **Contributing:** `pnpm i && pnpm test` gets you running; the full local gate is the [`package.json`](./package.json) scripts (`lint`, `typecheck`, `docs:check`).
326
+ **Contributing:** `pnpm i && pnpm build && pnpm test` gets you running; the full local gate is the [`package.json`](./package.json) scripts (`lint`, `typecheck`, `docs:check`).
package/dist/agent.d.ts CHANGED
@@ -5,7 +5,7 @@ import { A as AgentSurfaces } from './improvement-adapter-HAZz-7vK.js';
5
5
  export { C as CreateSurfaceImprovementProposerOptions, D as DraftPatchInput, a as DraftPatchOutput, R as ResolvedSurface, S as SurfaceImprovementEdit, b as SurfaceValidationIssue, c as createSurfaceImprovementProposer, r as renderSurfaceIssues, d as resolveSubjectPath, v as validateSurfaces } from './improvement-adapter-HAZz-7vK.js';
6
6
  import { AgentProfile, AgentProfileFileMount, AgentProfileMcpServer } from '@tangle-network/agent-interface';
7
7
  import { SandboxEvent } from '@tangle-network/sandbox';
8
- import { S as SandboxClient, O as OutputAdapter, A as AgentRunSpec } from './types-CLat4bT9.js';
8
+ import { S as SandboxClient, O as OutputAdapter, A as AgentRunSpec } from './types-DK11_O4L.js';
9
9
  import './types-CmYCMbFT.js';
10
10
 
11
11
  /**
package/dist/agent.js CHANGED
@@ -1,14 +1,14 @@
1
- import "./chunk-QCXD7NHM.js";
1
+ import "./chunk-3LJF5XSE.js";
2
2
  import "./chunk-Q2JSAVQ3.js";
3
3
  import {
4
4
  createSandboxForSpec
5
- } from "./chunk-ZUCUAFVF.js";
5
+ } from "./chunk-EAQ5YRRY.js";
6
6
  import "./chunk-DPEUKJRO.js";
7
- import "./chunk-ROILMKDL.js";
7
+ import "./chunk-QYCKIV6C.js";
8
8
  import "./chunk-UPWGXKXB.js";
9
9
  import "./chunk-2VZYRB55.js";
10
- import "./chunk-SQ3ZJH3Y.js";
11
- import "./chunk-IMSNJSXH.js";
10
+ import "./chunk-6WZZXQV5.js";
11
+ import "./chunk-ISPWRSEC.js";
12
12
  import "./chunk-M6MD6JBS.js";
13
13
  import "./chunk-3MDZX7YU.js";
14
14
  import {
@@ -1,5 +1,5 @@
1
1
  import { TraceAnalystByteBudgets, TraceAnalysisStore } from '@tangle-network/agent-eval';
2
- import { I as Iteration } from './types-CLat4bT9.js';
2
+ import { I as Iteration } from './types-DK11_O4L.js';
3
3
  import { R as RunAnalystLoopOpts, a as RunAnalystLoopResult } from './types-CmYCMbFT.js';
4
4
  export { A as AnalystLoopEvent, b as AnalystRegistryLike, c as AnalystRegistryStreamingLike, F as FindingsStoreLike, d as ImprovementEditBatch, I as ImprovementProposalSource, e as ImprovementReport, K as KnowledgeProposalBatch, f as KnowledgeProposalSource, g as KnowledgeReport } from './types-CmYCMbFT.js';
5
5
  import '@tangle-network/sandbox';
@@ -1,10 +1,10 @@
1
1
  import { CodeSurface } from '@tangle-network/agent-eval/campaign';
2
2
  import { AgentCandidateBundle, AgentCandidateCodeDisabled, AgentCandidateCodeNoOp, AgentCandidateGitHubRepository, AgentProfile, AgentProfileDiff, AgentCandidateProfile, AgentCandidateExecution, AgentCandidateKnowledge, AgentCandidateMemoryPolicy, AgentCandidateArtifactRef, Sha256Digest, AgentCandidateWorkspaceSnapshotEvidence } from '@tangle-network/agent-interface';
3
3
  export { AgentCandidateBenchmarkGraderIdentity } from '@tangle-network/agent-interface';
4
- import { c as AgentCandidateExecutionClaim, A as AgentCandidateExecutionClaimStore, d as AgentCandidateExecutionClaimResult, b as AgentCandidateExecutionAttemptRef, a as AgentCandidateExecutionAttemptRecord, h as AgentCandidateExecutionLease, j as AgentCandidateExecutionPhaseResult, n as AgentCandidateExecutionTerminalResult, l as AgentCandidateExecutionStageResult, g as AgentCandidateExecutionFinishResult, k as AgentCandidateExecutionRecoveryEvidence } from '../profile-DbfaMTdk.js';
5
- export { e as AgentCandidateExecutionCleanupHandles, f as AgentCandidateExecutionFailureClass, i as AgentCandidateExecutionPhase, m as AgentCandidateExecutionTerminalRecord, 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';
6
- import { P as PreparedAgentCandidateExecution, A as AgentCandidateExecutorPort, b as AgentCandidateOutputArtifactPort, t as AgentCandidateOutputPurpose, s as AgentCandidateModelPort, v as AgentCandidateProtectedModelReservation, u as AgentCandidateProtectedModelActivation, w as AgentCandidateProtectedModelSettlement, e as AgentCandidateExecutionPorts, z as AgentCandidateVerificationPorts, V as VerifiedAgentCandidate, n as AgentCandidateExecutorWorkspaceFile, B as AgentCandidateWorkspacePort } from '../types-CWqfCO8s.js';
7
- export { f as AgentCandidateArtifactPort, a as AgentCandidateBenchmarkGraderPort, g as AgentCandidateContainerPort, h as AgentCandidateExecutorFinalCapture, i as AgentCandidateExecutorMemoryCapture, j as AgentCandidateExecutorProfileFile, k as AgentCandidateExecutorRequest, l as AgentCandidateExecutorStopRequest, m as AgentCandidateExecutorTaskOutcomeCapture, o as AgentCandidateExecutorWorkspaceInput, p as AgentCandidateMemoryPort, q as AgentCandidateMemoryResetResult, r as AgentCandidateModelLimits, x as AgentCandidateProtectedRunCapture, y as AgentCandidateRepositoryPort, c as AgentCandidateRunFinalization, d as AgentCandidateTaskExecution, C as CANDIDATE_TRACE_ENV, D as CANDIDATE_TRACE_TAGS, E as CanonicalCandidateDocument, F as PreparedAgentCandidateInstruction, G as PreparedAgentCandidateKnowledge, H as PreparedAgentCandidateLaunch, I as PreparedAgentCandidateTrace, R as ResolvedAgentCandidateContainer, J as VerifiedAgentCandidateTaskOutcome } from '../types-CWqfCO8s.js';
4
+ import { c as AgentCandidateExecutionClaim, A as AgentCandidateExecutionClaimStore, d as AgentCandidateExecutionClaimResult, b as AgentCandidateExecutionAttemptRef, a as AgentCandidateExecutionAttemptRecord, h as AgentCandidateExecutionLease, j as AgentCandidateExecutionPhaseResult, n as AgentCandidateExecutionTerminalResult, l as AgentCandidateExecutionStageResult, g as AgentCandidateExecutionFinishResult, k as AgentCandidateExecutionRecoveryEvidence } from '../protected-model-port-DzkUY3HQ.js';
5
+ export { e as AgentCandidateExecutionCleanupHandles, f as AgentCandidateExecutionFailureClass, i as AgentCandidateExecutionPhase, m as AgentCandidateExecutionTerminalRecord, o as AgentCandidateModelGrantActivateInput, q as AgentCandidateModelGrantClient, r as AgentCandidateModelGrantReservation, s as AgentCandidateModelGrantReserveInput, t as AgentCandidateModelGrantSettleInput, u as AgentCandidatePreparationEvidence, v as AgentCandidateRetryRejection, C as CreateProtectedAgentCandidateModelPortOptions, E as ExecutePreparedAgentCandidateOptions, I as InMemoryAgentCandidateExecutionClaimStore, P as PrepareAgentCandidateExecutionOptions, w as applyExactAgentProfileDiff, x as assertCandidateProfileBinding, y as createProtectedAgentCandidateModelPort, z as executePreparedAgentCandidate, B as parseExactAgentProfile, D as parseExactAgentProfileDiff, F as prepareAgentCandidateExecution } from '../protected-model-port-DzkUY3HQ.js';
6
+ import { P as PreparedAgentCandidateExecution, A as AgentCandidateExecutorPort, b as AgentCandidateOutputArtifactPort, w as AgentCandidateOutputPurpose, e as AgentCandidateExecutionPorts, z as AgentCandidateVerificationPorts, V as VerifiedAgentCandidate, r as AgentCandidateExecutorWorkspaceFile, B as AgentCandidateWorkspacePort } from '../types-Cbp72qyu.js';
7
+ export { j as AgentCandidateArtifactPort, a as AgentCandidateBenchmarkGraderPort, k as AgentCandidateContainerPort, l as AgentCandidateExecutorFinalCapture, m as AgentCandidateExecutorMemoryCapture, n as AgentCandidateExecutorProfileFile, o as AgentCandidateExecutorRequest, p as AgentCandidateExecutorStopRequest, q as AgentCandidateExecutorTaskOutcomeCapture, s as AgentCandidateExecutorWorkspaceInput, t as AgentCandidateMemoryPort, u as AgentCandidateMemoryResetResult, v as AgentCandidateModelLimits, f as AgentCandidateModelPort, h as AgentCandidateProtectedModelActivation, g as AgentCandidateProtectedModelReservation, i as AgentCandidateProtectedModelSettlement, x as AgentCandidateProtectedRunCapture, y as AgentCandidateRepositoryPort, c as AgentCandidateRunFinalization, d as AgentCandidateTaskExecution, C as CANDIDATE_TRACE_ENV, D as CANDIDATE_TRACE_TAGS, E as CanonicalCandidateDocument, F as PreparedAgentCandidateInstruction, G as PreparedAgentCandidateKnowledge, H as PreparedAgentCandidateLaunch, I as PreparedAgentCandidateTrace, R as ResolvedAgentCandidateContainer, J as VerifiedAgentCandidateTaskOutcome } from '../types-Cbp72qyu.js';
8
8
  import { AgentEnvironmentProvider, AgentExactProcessResources } from '@tangle-network/agent-interface/environment-provider';
9
9
  import { TraceStore } from '@tangle-network/agent-eval';
10
10
 
@@ -122,42 +122,6 @@ declare function persistCandidateOutputArtifact(port: AgentCandidateOutputArtifa
122
122
  signal?: AbortSignal;
123
123
  }): Promise<AgentCandidateArtifactRef>;
124
124
 
125
- type AgentCandidateModelGrantReserveInput = Parameters<AgentCandidateModelPort['reserveGrant']>[0];
126
- type AgentCandidateModelGrantActivateInput = Parameters<AgentCandidateModelPort['activateGrant']>[0];
127
- type AgentCandidateModelGrantSettleInput = Parameters<AgentCandidateModelPort['settleGrant']>[0];
128
- /** Secret-free response from the service's reservation endpoint. */
129
- type AgentCandidateModelGrantReservation = AgentCandidateProtectedModelReservation;
130
- /**
131
- * Narrow transport contract for a service that owns scoped model credentials
132
- * and the authoritative per-call usage ledger.
133
- *
134
- * An HTTP client can bind these methods to control-plane endpoints. Keeping
135
- * transport out of the runtime prevents parent credentials, endpoint paths,
136
- * and retry policy from becoming part of the portable candidate contract.
137
- */
138
- interface AgentCandidateModelGrantClient {
139
- reserve(input: AgentCandidateModelGrantReserveInput): Promise<AgentCandidateModelGrantReservation>;
140
- activate(input: AgentCandidateModelGrantActivateInput): Promise<AgentCandidateProtectedModelActivation>;
141
- settle(input: AgentCandidateModelGrantSettleInput): Promise<AgentCandidateProtectedModelSettlement>;
142
- }
143
- interface CreateProtectedAgentCandidateModelPortOptions {
144
- client: AgentCandidateModelGrantClient;
145
- /** Catalog/snapshot resolution stays separate from credential issuance. */
146
- resolveModel: AgentCandidateModelPort['resolve'];
147
- /** The only public DNS name candidate processes may reach for inference. */
148
- gatewayDomain: string;
149
- /** Exact environment names the activation endpoint must return, no more or fewer. */
150
- activationEnvNames: readonly string[];
151
- }
152
- /**
153
- * Bind a protected model-grant service to the immutable candidate runtime.
154
- *
155
- * The service remains the authority for expiry, admission, revocation, and
156
- * metering. This adapter independently checks every response before allowing
157
- * it to cross into candidate execution or durable receipt finalization.
158
- */
159
- declare function createProtectedAgentCandidateModelPort(options: CreateProtectedAgentCandidateModelPortOptions): AgentCandidateModelPort;
160
-
161
125
  interface RecoverExpiredAgentCandidateOptions {
162
126
  attempt: AgentCandidateExecutionAttemptRef;
163
127
  claimStore: AgentCandidateExecutionClaimStore;
@@ -225,4 +189,4 @@ declare function captureAgentCandidateWorkspaceFiles(input: readonly AgentCandid
225
189
  /** Create the standard bounded materializer for candidate execution ports. */
226
190
  declare function createAgentCandidateWorkspacePort(options?: CreateAgentCandidateWorkspacePortOptions): AgentCandidateWorkspacePort;
227
191
 
228
- export { AGENT_CANDIDATE_EXECUTION_SUPPORT, type AgentCandidateBundleInput, type AgentCandidateCodeSource, type AgentCandidateCodeSurfaceSource, AgentCandidateExecutionAttemptRecord, AgentCandidateExecutionAttemptRef, AgentCandidateExecutionClaim, AgentCandidateExecutionClaimResult, AgentCandidateExecutionClaimStore, AgentCandidateExecutionFinishResult, AgentCandidateExecutionLease, AgentCandidateExecutionPhaseResult, AgentCandidateExecutionPorts, AgentCandidateExecutionRecoveryEvidence, AgentCandidateExecutionStageResult, AgentCandidateExecutionTerminalResult, AgentCandidateExecutorPort, AgentCandidateExecutorWorkspaceFile, type AgentCandidateModelGrantActivateInput, type AgentCandidateModelGrantClient, type AgentCandidateModelGrantReservation, type AgentCandidateModelGrantReserveInput, type AgentCandidateModelGrantSettleInput, AgentCandidateModelPort, AgentCandidateOutputArtifactPort, AgentCandidateOutputPurpose, type AgentCandidateProfileSource, AgentCandidateProtectedModelActivation, AgentCandidateProtectedModelReservation, AgentCandidateProtectedModelSettlement, AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, AgentCandidateWorkspacePort, type BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, type CaptureAgentCandidateWorkspaceOptions, type CapturedAgentCandidateWorkspace, type CreateAgentCandidateWorkspacePortOptions, type CreateProtectedAgentCandidateModelPortOptions, type DisposePreparedAgentCandidateOptions, type ExactProcessCandidateExecutorOptions, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, PreparedAgentCandidateExecution, type RecoverExpiredAgentCandidateOptions, VerifiedAgentCandidate, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, createProtectedAgentCandidateModelPort, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, sealAgentCandidateBundle, verifyAgentCandidateBundle };
192
+ export { AGENT_CANDIDATE_EXECUTION_SUPPORT, type AgentCandidateBundleInput, type AgentCandidateCodeSource, type AgentCandidateCodeSurfaceSource, AgentCandidateExecutionAttemptRecord, AgentCandidateExecutionAttemptRef, AgentCandidateExecutionClaim, AgentCandidateExecutionClaimResult, AgentCandidateExecutionClaimStore, AgentCandidateExecutionFinishResult, AgentCandidateExecutionLease, AgentCandidateExecutionPhaseResult, AgentCandidateExecutionPorts, AgentCandidateExecutionRecoveryEvidence, AgentCandidateExecutionStageResult, AgentCandidateExecutionTerminalResult, AgentCandidateExecutorPort, AgentCandidateExecutorWorkspaceFile, AgentCandidateOutputArtifactPort, AgentCandidateOutputPurpose, type AgentCandidateProfileSource, AgentCandidateVerificationPorts, type AgentCandidateWorkspaceArchiveLimits, AgentCandidateWorkspacePort, type BuildAgentCandidateBundleInput, CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV, CANDIDATE_KNOWLEDGE_ROOT_ENV, type CaptureAgentCandidateWorkspaceOptions, type CapturedAgentCandidateWorkspace, type CreateAgentCandidateWorkspacePortOptions, type DisposePreparedAgentCandidateOptions, type ExactProcessCandidateExecutorOptions, FileAgentCandidateExecutionClaimStore, type FileAgentCandidateExecutionClaimStoreOptions, PreparedAgentCandidateExecution, type RecoverExpiredAgentCandidateOptions, VerifiedAgentCandidate, buildAgentCandidateBundle, candidateExecutionClaim, candidateKnowledgeExecutionPaths, captureAgentCandidateWorkspace, captureAgentCandidateWorkspaceFiles, createAgentCandidateWorkspacePort, disposePreparedAgentCandidateExecution, exactProcessProviderAsCandidateExecutor, persistCandidateOutputArtifact, recoverExpiredAgentCandidateExecution, sealAgentCandidateBundle, verifyAgentCandidateBundle };
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  FileAgentCandidateExecutionClaimStore,
3
3
  buildAgentCandidateBundle,
4
- createProtectedAgentCandidateModelPort,
5
4
  disposePreparedAgentCandidateExecution,
6
5
  recoverExpiredAgentCandidateExecution
7
- } from "../chunk-CK76OZPM.js";
6
+ } from "../chunk-SNSMRT6H.js";
8
7
  import {
8
+ createProtectedAgentCandidateModelPort,
9
9
  exactProcessProviderAsCandidateExecutor
10
- } from "../chunk-377GOJHJ.js";
10
+ } from "../chunk-ZXICDSAK.js";
11
11
  import {
12
12
  captureAgentCandidateWorkspace,
13
13
  captureAgentCandidateWorkspaceFiles,
14
14
  createAgentCandidateWorkspacePort,
15
15
  sealAgentCandidateBundle
16
- } from "../chunk-KSM6GFHP.js";
16
+ } from "../chunk-B7K7V22Y.js";
17
17
  import {
18
18
  AGENT_CANDIDATE_EXECUTION_SUPPORT,
19
19
  CANDIDATE_KNOWLEDGE_RETRIEVAL_CONFIG_ENV,
@@ -22,6 +22,7 @@ import {
22
22
  CANDIDATE_TRACE_TAGS,
23
23
  InMemoryAgentCandidateExecutionClaimStore,
24
24
  applyExactAgentProfileDiff,
25
+ assertCandidateProfileBinding,
25
26
  candidateExecutionClaim,
26
27
  candidateKnowledgeExecutionPaths,
27
28
  executePreparedAgentCandidate,
@@ -30,9 +31,9 @@ import {
30
31
  persistCandidateOutputArtifact,
31
32
  prepareAgentCandidateExecution,
32
33
  verifyAgentCandidateBundle
33
- } from "../chunk-LJLG734E.js";
34
+ } from "../chunk-SBTWKPVR.js";
34
35
  import "../chunk-UPWGXKXB.js";
35
- import "../chunk-IMSNJSXH.js";
36
+ import "../chunk-ISPWRSEC.js";
36
37
  import "../chunk-3MDZX7YU.js";
37
38
  export {
38
39
  AGENT_CANDIDATE_EXECUTION_SUPPORT,
@@ -43,6 +44,7 @@ export {
43
44
  FileAgentCandidateExecutionClaimStore,
44
45
  InMemoryAgentCandidateExecutionClaimStore,
45
46
  applyExactAgentProfileDiff,
47
+ assertCandidateProfileBinding,
46
48
  buildAgentCandidateBundle,
47
49
  candidateExecutionClaim,
48
50
  candidateKnowledgeExecutionPaths,