@tangle-network/agent-runtime 0.132.4 → 0.132.6

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 (66) hide show
  1. package/README.md +2 -2
  2. package/dist/{activation-DFJBEC62.js → activation-U2mou_hT.js} +2 -2
  3. package/dist/{activation-DFJBEC62.js.map → activation-U2mou_hT.js.map} +1 -1
  4. package/dist/agent.d.ts +1 -1
  5. package/dist/agent.js +2 -2
  6. package/dist/{authoring-WS1l0lU1.js → authoring-sf0VpHlY.js} +2 -2
  7. package/dist/{authoring-WS1l0lU1.js.map → authoring-sf0VpHlY.js.map} +1 -1
  8. package/dist/{conversation-D95pue6P.js → conversation-BiII3X_6.js} +3 -3
  9. package/dist/{conversation-D95pue6P.js.map → conversation-BiII3X_6.js.map} +1 -1
  10. package/dist/conversation.d.ts +1 -1
  11. package/dist/conversation.js +1 -1
  12. package/dist/{environment-provider-DlYw_pjo.d.ts → environment-provider-CkSDxRZd.d.ts} +2 -2
  13. package/dist/environment-provider.d.ts +1 -1
  14. package/dist/{graph-B9hFN-zX.js → graph-DjTw-HMK.js} +2 -2
  15. package/dist/{graph-B9hFN-zX.js.map → graph-DjTw-HMK.js.map} +1 -1
  16. package/dist/{improvement-cycle-DgZtiPDT.js → improvement-cycle-paspYVfE.js} +4 -4
  17. package/dist/{improvement-cycle-DgZtiPDT.js.map → improvement-cycle-paspYVfE.js.map} +1 -1
  18. package/dist/{index-CcpNgmQY.d.ts → index-BsrFZu0N.d.ts} +4 -4
  19. package/dist/{index-iwZ0at5o.d.ts → index-Cdf9NET5.d.ts} +2 -2
  20. package/dist/{index-D9dVsozT.d.ts → index-DixXnx07.d.ts} +73 -7
  21. package/dist/index.d.ts +8 -8
  22. package/dist/index.js +10 -10
  23. package/dist/index.js.map +1 -1
  24. package/dist/intelligence.d.ts +4 -4
  25. package/dist/intelligence.js +3 -3
  26. package/dist/kernel.d.ts +6 -6
  27. package/dist/kernel.js +7 -7
  28. package/dist/{knowledge-By_lZ80W.js → knowledge-DV8PEBph.js} +3 -3
  29. package/dist/{knowledge-By_lZ80W.js.map → knowledge-DV8PEBph.js.map} +1 -1
  30. package/dist/knowledge.d.ts +1 -1
  31. package/dist/knowledge.js +1 -1
  32. package/dist/{loop-runner-bin-D9OAFkP_.d.ts → loop-runner-bin-BqJGlXju.d.ts} +3 -3
  33. package/dist/{loop-runner-bin-CjsTZUVS.js → loop-runner-bin-C1G7gPX0.js} +3 -3
  34. package/dist/{loop-runner-bin-CjsTZUVS.js.map → loop-runner-bin-C1G7gPX0.js.map} +1 -1
  35. package/dist/loop-runner-bin.d.ts +1 -1
  36. package/dist/loop-runner-bin.js +1 -1
  37. package/dist/{materialization-DBXuH34A.js → materialization-JR_nN_oT.js} +18 -2
  38. package/dist/materialization-JR_nN_oT.js.map +1 -0
  39. package/dist/mcp/bin.js +3 -3
  40. package/dist/mcp/index.d.ts +3 -3
  41. package/dist/mcp/index.js +4 -4
  42. package/dist/{openai-tools-BATxru3h.js → openai-tools-Ba0yu9hI.js} +2 -2
  43. package/dist/{openai-tools-BATxru3h.js.map → openai-tools-Ba0yu9hI.js.map} +1 -1
  44. package/dist/primeintellect/index.d.ts +1 -1
  45. package/dist/{redact-mWj5eu4X.d.ts → redact-BAnM2avI.d.ts} +3 -3
  46. package/dist/{runtime-YuPbrgG1.js → runtime-BeBAzfnW.js} +65 -15
  47. package/dist/runtime-BeBAzfnW.js.map +1 -0
  48. package/dist/{runtime-aXvRThzL.d.ts → runtime-CKk_poJ-.d.ts} +3 -3
  49. package/dist/{stream-agent-turn-BxwZJVfZ.js → stream-agent-turn-Bo5ZSAUR.js} +2 -2
  50. package/dist/{stream-agent-turn-BxwZJVfZ.js.map → stream-agent-turn-Bo5ZSAUR.js.map} +1 -1
  51. package/dist/{stream-agent-turn-BXiMHdCf.d.ts → stream-agent-turn-By46GZlo.d.ts} +2 -2
  52. package/dist/{structural-rollout-Dq0j-JHl.js → structural-rollout-DGkq_Grt.js} +18 -9
  53. package/dist/structural-rollout-DGkq_Grt.js.map +1 -0
  54. package/dist/{supervise-BDj-uFfb.js → supervise-B2fTctMn.js} +40 -5
  55. package/dist/supervise-B2fTctMn.js.map +1 -0
  56. package/dist/{supervisor-DlVTwwJb.js → supervisor-BTuNGicF.js} +36 -5
  57. package/dist/supervisor-BTuNGicF.js.map +1 -0
  58. package/dist/testing.d.ts +2 -2
  59. package/dist/testing.js +11 -11
  60. package/dist/{types-B9KAen_0.d.ts → types-BjUQODeG.d.ts} +21 -2
  61. package/package.json +4 -4
  62. package/dist/materialization-DBXuH34A.js.map +0 -1
  63. package/dist/runtime-YuPbrgG1.js.map +0 -1
  64. package/dist/structural-rollout-Dq0j-JHl.js.map +0 -1
  65. package/dist/supervise-BDj-uFfb.js.map +0 -1
  66. package/dist/supervisor-DlVTwwJb.js.map +0 -1
@@ -1,2 +1,2 @@
1
- import { i as runLoopRunnerCli, n as LoopRunnerCliResult, r as parseLoopRunnerArgv, t as LoopRunnerCliArgs } from "./loop-runner-bin-D9OAFkP_.js";
1
+ import { i as runLoopRunnerCli, n as LoopRunnerCliResult, r as parseLoopRunnerArgv, t as LoopRunnerCliArgs } from "./loop-runner-bin-BqJGlXju.js";
2
2
  export { LoopRunnerCliArgs, LoopRunnerCliResult, parseLoopRunnerArgv, runLoopRunnerCli };
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import { n as runLoopRunnerCli, t as parseLoopRunnerArgv } from "./loop-runner-bin-CjsTZUVS.js";
2
+ import { n as runLoopRunnerCli, t as parseLoopRunnerArgv } from "./loop-runner-bin-C1G7gPX0.js";
3
3
  export { parseLoopRunnerArgv, runLoopRunnerCli };
@@ -32,6 +32,7 @@ function executableAgentSpecSnapshot(raw, context) {
32
32
  //#region src/runtime/supervise/materialization.ts
33
33
  const runtimeOwnedExecutorMaterializations = /* @__PURE__ */ new WeakMap();
34
34
  const runtimeOwnedScopeOwners = /* @__PURE__ */ new WeakMap();
35
+ const runtimeOwnedDriveHarnessModelObservations = /* @__PURE__ */ new WeakMap();
35
36
  const declarationKeys = /* @__PURE__ */ new Set([
36
37
  "effectiveProfile",
37
38
  "backend",
@@ -128,6 +129,21 @@ function attestRuntimeOwnedScopeOwner(owner, runtime) {
128
129
  function runtimeOwnedScopeOwnerRuntime(owner) {
129
130
  return runtimeOwnedScopeOwners.get(owner);
130
131
  }
132
+ /** Record provider model observations only for a Runtime-owned drive adapter. Arbitrary caller
133
+ * harnesses cannot publish a lookalike receipt, so their root identity remains unknown. */
134
+ function recordRuntimeOwnedDriveHarnessModel(owner, model) {
135
+ const state = runtimeOwnedDriveHarnessModelObservations.get(owner);
136
+ if (state === void 0) {
137
+ runtimeOwnedDriveHarnessModelObservations.set(owner, { observations: [model] });
138
+ return;
139
+ }
140
+ state.observations.push(model);
141
+ }
142
+ /** Read settled provider observations from one Runtime-owned drive adapter. */
143
+ function runtimeOwnedDriveHarnessModels(owner) {
144
+ const state = runtimeOwnedDriveHarnessModelObservations.get(owner);
145
+ return state === void 0 ? void 0 : Object.freeze([...state.observations]);
146
+ }
131
147
  /** Build one kernel-owned known receipt from a data-only executor declaration. */
132
148
  function knownMaterializationReceipt(input) {
133
149
  const declaration = detachedSnapshot(input.declaration, "executor materialization");
@@ -267,6 +283,6 @@ function jsonWireSnapshot(value, path = "$") {
267
283
  return out;
268
284
  }
269
285
  //#endregion
270
- export { unknownMaterializationReceipt as _, authoredProfileDigest as a, knownExecutionBindingReceipt as c, runtimeOwnedDeferredExecutorRuntime as d, runtimeOwnedExecutorExecutionBinding as f, unknownExecutionBindingReceipt as g, runtimeOwnedScopeOwnerRuntime as h, attestRuntimeOwnedScopeOwner as i, knownMaterializationReceipt as l, runtimeOwnedPendingExecutorMaterialization as m, attestRuntimeOwnedExecutor as n, finalizeRuntimeOwnedPendingExecutor as o, runtimeOwnedExecutorMaterialization as p, attestRuntimeOwnedPendingExecutor as r, inheritRuntimeOwnedExecutorAttestation as s, attestRuntimeOwnedDeferredExecutor as t, newExecutionAttemptId as u, executableAgentProfileSnapshot as v, executableAgentSpecSnapshot as y };
286
+ export { runtimeOwnedScopeOwnerRuntime as _, authoredProfileDigest as a, executableAgentProfileSnapshot as b, knownExecutionBindingReceipt as c, recordRuntimeOwnedDriveHarnessModel as d, runtimeOwnedDeferredExecutorRuntime as f, runtimeOwnedPendingExecutorMaterialization as g, runtimeOwnedExecutorMaterialization as h, attestRuntimeOwnedScopeOwner as i, knownMaterializationReceipt as l, runtimeOwnedExecutorExecutionBinding as m, attestRuntimeOwnedExecutor as n, finalizeRuntimeOwnedPendingExecutor as o, runtimeOwnedDriveHarnessModels as p, attestRuntimeOwnedPendingExecutor as r, inheritRuntimeOwnedExecutorAttestation as s, attestRuntimeOwnedDeferredExecutor as t, newExecutionAttemptId as u, unknownExecutionBindingReceipt as v, executableAgentSpecSnapshot as x, unknownMaterializationReceipt as y };
271
287
 
272
- //# sourceMappingURL=materialization-DBXuH34A.js.map
288
+ //# sourceMappingURL=materialization-JR_nN_oT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"materialization-JR_nN_oT.js","names":[],"sources":["../src/runtime/supervise/executable-spec.ts","../src/runtime/supervise/materialization.ts"],"sourcesContent":["import { type AgentProfile, agentProfileSchema } from '@tangle-network/agent-interface'\nimport { assertExecutableAgentProfile } from './model-policy'\nimport { detachedSnapshot } from './snapshot'\nimport type { AgentSpec } from './types'\n\n/**\n * Parse one untrusted profile into the exact immutable value execution may consume.\n *\n * Snapshotting before schema parsing reads caller-owned fields once. Snapshotting the parsed\n * result prevents downstream custom code from changing any identity or authority field.\n */\nexport function executableAgentProfileSnapshot(raw: unknown, context: string): AgentProfile {\n const input = detachedSnapshot(raw, `${context}: AgentProfile input`)\n const profile = agentProfileSchema.parse(input)\n assertExecutableAgentProfile(profile, context)\n return detachedSnapshot(profile, `${context}: parsed AgentProfile`)\n}\n\n/** Snapshot an executable spec while retaining trusted callbacks by reference. */\nexport function executableAgentSpecSnapshot(raw: AgentSpec, context: string): AgentSpec {\n const {\n profile: rawProfile,\n harness,\n execution: rawExecution,\n ...runtimeExtensions\n } = raw as AgentSpec & Readonly<Record<string, unknown>>\n const profile = executableAgentProfileSnapshot(rawProfile, context)\n const execution =\n rawExecution === undefined\n ? undefined\n : detachedSnapshot(rawExecution, `${context}: execution attribution`)\n return Object.freeze({\n ...runtimeExtensions,\n profile,\n harness,\n ...(execution === undefined ? {} : { execution }),\n }) as AgentSpec\n}\n","import { randomUUID } from 'node:crypto'\nimport {\n agentProfileSchema,\n canonicalAgentProfileDigest,\n canonicalCandidateDigest,\n type Sha256Digest,\n} from '@tangle-network/agent-interface'\nimport { ValidationError } from '../../errors'\nimport { detachedSnapshot } from './snapshot'\nimport type {\n ExecutionBindingReceipt,\n Executor,\n ExecutorExecutionBinding,\n ExecutorMaterialization,\n ProfileMaterializationReceipt,\n Runtime,\n UnknownMaterializationReason,\n} from './types'\n\ntype RuntimeOwnedExecutorMaterialization =\n | {\n readonly kind: 'known'\n readonly declaration: ExecutorMaterialization\n readonly binding?: ExecutorExecutionBinding\n }\n | {\n /** A Runtime-owned external executor whose exact launch is known, but whose remote\n * materializer has not yet returned its terminal acknowledgement. This private state lets\n * Runtime validate the planned authority before execution without presenting it as proof\n * that the remote process actually used that plan. */\n readonly kind: 'pending'\n readonly runtime: Runtime\n readonly declaration: ExecutorMaterialization\n readonly binding: ExecutorExecutionBinding\n }\n | { readonly kind: 'deferred'; readonly runtime: Runtime }\n\ninterface RuntimeOwnedExecutorMaterializationRef {\n current: RuntimeOwnedExecutorMaterialization\n}\n\nconst runtimeOwnedExecutorMaterializations = new WeakMap<\n object,\n RuntimeOwnedExecutorMaterializationRef\n>()\nconst runtimeOwnedScopeOwners = new WeakMap<object, Runtime>()\nconst runtimeOwnedDriveHarnessModelObservations = new WeakMap<\n object,\n { readonly observations: Array<string | undefined> }\n>()\n\ninterface KnownReceiptInput {\n readonly authoredProfileDigest: Sha256Digest\n readonly runtime: Runtime\n readonly declaration: ExecutorMaterialization\n}\n\ninterface UnknownReceiptInput {\n readonly authoredProfileDigest?: Sha256Digest\n readonly runtime: Runtime\n readonly reason: UnknownMaterializationReason\n}\n\nconst declarationKeys = new Set([\n 'effectiveProfile',\n 'backend',\n 'model',\n 'execution',\n 'materializer',\n 'plan',\n 'platformAttachments',\n])\n\n/**\n * Bind a declaration to a runtime-owned executor without putting an attestable method on the\n * public Executor interface. This module is not a package export: arbitrary caller executors stay\n * unknown even if they add a lookalike `materialization()` property.\n */\nexport function attestRuntimeOwnedExecutor<Out>(\n executor: Executor<Out>,\n declaration: ExecutorMaterialization,\n binding?: ExecutorExecutionBinding,\n): Executor<Out> {\n runtimeOwnedExecutorMaterializations.set(executor as object, {\n current: Object.freeze({\n kind: 'known',\n declaration: detachedSnapshot(declaration, 'runtime-owned executor materialization'),\n ...(binding === undefined\n ? {}\n : {\n binding: detachedSnapshot(binding, 'runtime-owned executor execution binding'),\n }),\n }),\n })\n return executor\n}\n\n/** Brand an external Runtime executor whose exact remote materialization is provable only after\n * its terminal protocol acknowledgement. The declaration is a planned authority check, never a\n * known receipt; callers must finalize this same object after validating the acknowledgement. */\nexport function attestRuntimeOwnedPendingExecutor<Out>(\n executor: Executor<Out>,\n runtime: Runtime,\n declaration: ExecutorMaterialization,\n binding: ExecutorExecutionBinding,\n): Executor<Out> {\n runtimeOwnedExecutorMaterializations.set(executor as object, {\n current: Object.freeze({\n kind: 'pending',\n runtime,\n declaration: detachedSnapshot(declaration, 'pending executor materialization'),\n binding: detachedSnapshot(binding, 'pending executor execution binding'),\n }),\n })\n return executor\n}\n\n/** Replace a private pending brand with terminally acknowledged evidence. A caller-owned executor\n * cannot enter this path because only this module can create the pending WeakMap entry. */\nexport function finalizeRuntimeOwnedPendingExecutor<Out>(\n executor: Executor<Out>,\n declaration: ExecutorMaterialization,\n binding: ExecutorExecutionBinding,\n): Executor<Out> {\n const ref = runtimeOwnedExecutorMaterializations.get(executor as object)\n if (ref?.current.kind !== 'pending' || ref.current.runtime !== executor.runtime) {\n throw new ValidationError(\n 'executor materialization: terminal acknowledgement has no matching Runtime-owned pending executor',\n )\n }\n ref.current = Object.freeze({\n kind: 'known',\n declaration: detachedSnapshot(declaration, 'runtime-owned executor materialization'),\n binding: detachedSnapshot(binding, 'runtime-owned executor execution binding'),\n })\n return executor\n}\n\n/** Mark a runtime-owned orchestration executor whose exact leaf declaration is published through\n * its private nested Scope before the first backend inference. Arbitrary executors cannot opt in. */\nexport function attestRuntimeOwnedDeferredExecutor<Out>(\n executor: Executor<Out>,\n runtime: Runtime,\n): Executor<Out> {\n runtimeOwnedExecutorMaterializations.set(executor as object, {\n current: Object.freeze({ kind: 'deferred', runtime }),\n })\n return executor\n}\n\n/** Preserve the runtime-owned attestation when a trusted wrapper changes result semantics only. */\nexport function inheritRuntimeOwnedExecutorAttestation<In, Out>(\n source: Executor<In>,\n wrapper: Executor<Out>,\n): Executor<Out> {\n const ref = runtimeOwnedExecutorMaterializations.get(source as object)\n if (ref !== undefined) {\n runtimeOwnedExecutorMaterializations.set(wrapper as object, ref)\n }\n return wrapper\n}\n\n/** Read a declaration only when Runtime itself branded this exact executor object. */\nexport function runtimeOwnedExecutorMaterialization<Out>(\n executor: Executor<Out>,\n): ExecutorMaterialization | undefined {\n const attestation = runtimeOwnedExecutorMaterializations.get(executor as object)?.current\n return attestation?.kind === 'known' ? attestation.declaration : undefined\n}\n\n/** Read one attempt binding only from the private brand on this exact executor object. */\nexport function runtimeOwnedExecutorExecutionBinding<Out>(\n executor: Executor<Out>,\n): ExecutorExecutionBinding | undefined {\n const attestation = runtimeOwnedExecutorMaterializations.get(executor as object)?.current\n return attestation?.kind === 'known' ? attestation.binding : undefined\n}\n\n/** Read a planned external declaration only for Runtime's private pending brand. This is useful for\n * pre-execution authority checks, but must never be turned into a known durable receipt. */\nexport function runtimeOwnedPendingExecutorMaterialization<Out>(executor: Executor<Out>):\n | {\n readonly runtime: Runtime\n readonly declaration: ExecutorMaterialization\n readonly binding: ExecutorExecutionBinding\n }\n | undefined {\n const attestation = runtimeOwnedExecutorMaterializations.get(executor as object)?.current\n return attestation?.kind === 'pending'\n ? {\n runtime: attestation.runtime,\n declaration: attestation.declaration,\n binding: attestation.binding,\n }\n : undefined\n}\n\n/** Read the expected leaf runtime only for a privately branded deferred orchestration executor. */\nexport function runtimeOwnedDeferredExecutorRuntime<Out>(\n executor: Executor<Out>,\n): Runtime | undefined {\n const attestation = runtimeOwnedExecutorMaterializations.get(executor as object)?.current\n return attestation?.kind === 'deferred' ? attestation.runtime : undefined\n}\n\n/** Propagate trust from a built-in driver adapter to the Agent and recursive executor it owns. */\nexport function attestRuntimeOwnedScopeOwner<T extends object>(owner: T, runtime: Runtime): T {\n runtimeOwnedScopeOwners.set(owner, runtime)\n return owner\n}\n\n/** Return a built-in scope owner's expected concrete leaf runtime; caller-owned functions/Agents\n * deliberately have no entry even if they add lookalike fields. */\nexport function runtimeOwnedScopeOwnerRuntime(owner: object): Runtime | undefined {\n return runtimeOwnedScopeOwners.get(owner)\n}\n\n/** Record provider model observations only for a Runtime-owned drive adapter. Arbitrary caller\n * harnesses cannot publish a lookalike receipt, so their root identity remains unknown. */\nexport function recordRuntimeOwnedDriveHarnessModel(\n owner: object,\n model: string | undefined,\n): void {\n const state = runtimeOwnedDriveHarnessModelObservations.get(owner)\n if (state === undefined) {\n runtimeOwnedDriveHarnessModelObservations.set(owner, { observations: [model] })\n return\n }\n state.observations.push(model)\n}\n\n/** Read settled provider observations from one Runtime-owned drive adapter. */\nexport function runtimeOwnedDriveHarnessModels(\n owner: object,\n): ReadonlyArray<string | undefined> | undefined {\n const state = runtimeOwnedDriveHarnessModelObservations.get(owner)\n return state === undefined ? undefined : Object.freeze([...state.observations])\n}\n\n/** Build one kernel-owned known receipt from a data-only executor declaration. */\nexport function knownMaterializationReceipt(\n input: KnownReceiptInput,\n): ProfileMaterializationReceipt {\n const declaration = detachedSnapshot(input.declaration, 'executor materialization')\n assertExactDeclaration(declaration)\n const effectiveProfile = agentProfileSchema.safeParse(declaration.effectiveProfile)\n if (!effectiveProfile.success) {\n throw new ValidationError('executor materialization: effectiveProfile must be an AgentProfile')\n }\n assertNonEmpty(declaration.backend, 'backend')\n assertNonEmpty(declaration.materializer, 'materializer')\n assertNonEmpty(declaration.execution?.kind, 'execution.kind')\n assertNonEmpty(declaration.execution?.id, 'execution.id')\n assertModel(declaration.model)\n\n let effectiveProfileDigest: Sha256Digest\n let materializationPlanDigest: Sha256Digest\n let platformAttachmentsDigest: Sha256Digest | undefined\n try {\n effectiveProfileDigest = canonicalAgentProfileDigest(effectiveProfile.data)\n materializationPlanDigest = canonicalCandidateDigest(jsonWireSnapshot(declaration.plan))\n platformAttachmentsDigest =\n declaration.platformAttachments === undefined\n ? undefined\n : canonicalCandidateDigest(jsonWireSnapshot(declaration.platformAttachments))\n } catch (error) {\n throw new ValidationError(\n 'executor materialization: profile, plan, and attachments must be finite RFC 8785 JSON',\n { cause: error },\n )\n }\n\n return Object.freeze({\n status: 'known' as const,\n authoredProfileDigest: input.authoredProfileDigest,\n effectiveProfileDigest,\n materializationPlanDigest,\n ...(platformAttachmentsDigest === undefined ? {} : { platformAttachmentsDigest }),\n runtime: input.runtime,\n backend: declaration.backend,\n model: declaration.model,\n execution: declaration.execution,\n materializer: declaration.materializer,\n })\n}\n\n/** Build an explicit unknown receipt without fabricating any executor-owned identity. */\nexport function unknownMaterializationReceipt(\n input: UnknownReceiptInput,\n): ProfileMaterializationReceipt {\n return Object.freeze({\n status: 'unknown' as const,\n ...(input.authoredProfileDigest === undefined\n ? {}\n : { authoredProfileDigest: input.authoredProfileDigest }),\n runtime: input.runtime,\n reason: input.reason,\n })\n}\n\n/** Mint a process-unique attempt id before executor construction. */\nexport function newExecutionAttemptId(nodeId: string): string {\n return `${nodeId}:attempt:${randomUUID()}`\n}\n\n/** Build the immutable safe receipt for a full, transient execution binding. */\nexport function knownExecutionBindingReceipt(\n materialization: ProfileMaterializationReceipt,\n bindingInput: ExecutorExecutionBinding,\n): ExecutionBindingReceipt {\n const binding = detachedSnapshot(bindingInput, 'executor execution binding')\n assertNonEmpty(binding.attemptId, 'binding.attemptId')\n assertSafeDescriptor(binding.descriptor)\n let materializationReceiptDigest: Sha256Digest\n let bindingDigest: Sha256Digest\n try {\n materializationReceiptDigest = canonicalCandidateDigest(materialization)\n // Bind the exact JSON document a backend receives. Optional AgentProfile fields are represented\n // as `undefined` in memory but omitted by JSON transport; normalize that one distinction while\n // rejecting every non-finite/non-data value instead of silently coercing it.\n bindingDigest = canonicalCandidateDigest(jsonWireSnapshot(binding.binding))\n } catch (error) {\n throw new ValidationError('executor binding must be finite RFC 8785 JSON', { cause: error })\n }\n return Object.freeze({\n status: 'known' as const,\n attemptId: binding.attemptId,\n materializationReceiptDigest,\n bindingDigest,\n descriptor: binding.descriptor,\n })\n}\n\n/** Preserve an attempt boundary even when its caller-owned transport cannot be attested. */\nexport function unknownExecutionBindingReceipt(\n materialization: ProfileMaterializationReceipt,\n attemptId: string,\n reason: UnknownMaterializationReason,\n): ExecutionBindingReceipt {\n assertNonEmpty(attemptId, 'binding.attemptId')\n return Object.freeze({\n status: 'unknown' as const,\n attemptId,\n materializationReceiptDigest: canonicalCandidateDigest(materialization),\n reason,\n })\n}\n\n/** Derive an authored-profile digest without turning non-canonical input into a fake identity. */\nexport function authoredProfileDigest(profile: unknown): Sha256Digest | undefined {\n try {\n return canonicalAgentProfileDigest(agentProfileSchema.parse(profile))\n } catch {\n return undefined\n }\n}\n\nfunction assertExactDeclaration(value: ExecutorMaterialization): void {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) {\n throw new ValidationError('executor materialization: declaration must be an object')\n }\n const unknown = Object.keys(value).filter((key) => !declarationKeys.has(key))\n if (unknown.length > 0) {\n throw new ValidationError(\n `executor materialization: unknown declaration fields: ${unknown.sort().join(', ')}`,\n )\n }\n if (!Object.hasOwn(value, 'plan')) {\n throw new ValidationError('executor materialization: plan is required')\n }\n}\n\nfunction assertModel(model: ExecutorMaterialization['model']): void {\n if (typeof model !== 'object' || model === null || Array.isArray(model)) {\n throw new ValidationError('executor materialization: model must be a known/unknown identity')\n }\n const keys = Object.keys(model).sort()\n if (model.status === 'known') {\n if (keys.join(',') !== 'id,status') {\n throw new ValidationError('executor materialization: known model accepts only status and id')\n }\n assertNonEmpty(model.id, 'model.id')\n return\n }\n if (model.status === 'unknown') {\n if (keys.join(',') !== 'reason,status') {\n throw new ValidationError(\n 'executor materialization: unknown model accepts only status and reason',\n )\n }\n assertNonEmpty(model.reason, 'model.reason')\n return\n }\n throw new ValidationError('executor materialization: model.status must be known or unknown')\n}\n\nfunction assertNonEmpty(value: unknown, field: string): asserts value is string {\n if (typeof value !== 'string' || value.trim().length === 0) {\n throw new ValidationError(`executor materialization: ${field} must be a non-empty string`)\n }\n}\n\nfunction assertSafeDescriptor(descriptor: ExecutorExecutionBinding['descriptor']): void {\n if (typeof descriptor !== 'object' || descriptor === null || Array.isArray(descriptor)) {\n throw new ValidationError('executor binding: descriptor must be an object')\n }\n for (const [key, value] of Object.entries(descriptor)) {\n if (/(url|uri|token|key|secret|bearer|credential|authorization)/i.test(key)) {\n throw new ValidationError(`executor binding: unsafe descriptor key ${JSON.stringify(key)}`)\n }\n if (\n value !== null &&\n typeof value !== 'string' &&\n typeof value !== 'number' &&\n typeof value !== 'boolean'\n ) {\n throw new ValidationError(\n `executor binding: descriptor ${JSON.stringify(key)} must be scalar`,\n )\n }\n if (typeof value === 'string' && (value.includes('://') || value.includes('@'))) {\n throw new ValidationError(\n `executor binding: descriptor ${JSON.stringify(key)} contains transport or credential text`,\n )\n }\n }\n}\n\nfunction jsonWireSnapshot(value: unknown, path = '$'): unknown {\n if (value === null || typeof value === 'string' || typeof value === 'boolean') return value\n if (typeof value === 'number') {\n if (!Number.isFinite(value)) {\n throw new ValidationError(`executor binding: ${path} must be finite`)\n }\n return value\n }\n if (Array.isArray(value)) {\n return value.map((item, index) => {\n if (item === undefined) {\n throw new ValidationError(`executor binding: ${path}[${index}] cannot be undefined`)\n }\n return jsonWireSnapshot(item, `${path}[${index}]`)\n })\n }\n if (typeof value !== 'object' || value === null) {\n throw new ValidationError(`executor binding: ${path} must be JSON data`)\n }\n const prototype = Object.getPrototypeOf(value)\n if (prototype !== Object.prototype && prototype !== null) {\n throw new ValidationError(`executor binding: ${path} must be a plain object`)\n }\n const out: Record<string, unknown> = {}\n for (const [key, item] of Object.entries(value as Record<string, unknown>)) {\n if (item === undefined) continue\n out[key] = jsonWireSnapshot(item, `${path}.${key}`)\n }\n return out\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,+BAA+B,KAAc,SAA+B;CAC1F,MAAM,QAAQ,iBAAiB,KAAK,GAAG,QAAQ,qBAAqB;CACpE,MAAM,UAAU,mBAAmB,MAAM,KAAK;CAC9C,6BAA6B,SAAS,OAAO;CAC7C,OAAO,iBAAiB,SAAS,GAAG,QAAQ,sBAAsB;AACpE;;AAGA,SAAgB,4BAA4B,KAAgB,SAA4B;CACtF,MAAM,EACJ,SAAS,YACT,SACA,WAAW,cACX,GAAG,sBACD;CACJ,MAAM,UAAU,+BAA+B,YAAY,OAAO;CAClE,MAAM,YACJ,iBAAiB,KAAA,IACb,KAAA,IACA,iBAAiB,cAAc,GAAG,QAAQ,wBAAwB;CACxE,OAAO,OAAO,OAAO;EACnB,GAAG;EACH;EACA;EACA,GAAI,cAAc,KAAA,IAAY,CAAC,IAAI,EAAE,UAAU;CACjD,CAAC;AACH;;;ACIA,MAAM,uDAAuC,IAAI,QAG/C;AACF,MAAM,0CAA0B,IAAI,QAAyB;AAC7D,MAAM,4DAA4C,IAAI,QAGpD;AAcF,MAAM,kCAAkB,IAAI,IAAI;CAC9B;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;AAOD,SAAgB,2BACd,UACA,aACA,SACe;CACf,qCAAqC,IAAI,UAAoB,EAC3D,SAAS,OAAO,OAAO;EACrB,MAAM;EACN,aAAa,iBAAiB,aAAa,wCAAwC;EACnF,GAAI,YAAY,KAAA,IACZ,CAA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BAAgB,qBAAqB,KAAK,wBAAwB;CAE9E,MAAM,MAA+B,CAAC;CACtC,KAAK,MAAM,CAAC,KAAK,SAAS,OAAO,QAAQ,KAAgC,GAAG;EAC1E,IAAI,SAAS,KAAA,GAAW;EACxB,IAAI,OAAO,iBAAiB,MAAM,GAAG,KAAK,GAAG,KAAK;CACpD;CACA,OAAO;AACT"}
package/dist/mcp/bin.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
  import { i as ConfigError } from "../errors-DEAvWQPy.js";
3
- import { st as readTraceContextFromEnv } from "../supervisor-DlVTwwJb.js";
4
- import { C as createMcpServer, Z as DelegationTaskQueue, st as FileDelegationStore } from "../supervise-BDj-uFfb.js";
5
- import { a as supervisorInstructions } from "../authoring-WS1l0lU1.js";
3
+ import { st as readTraceContextFromEnv } from "../supervisor-BTuNGicF.js";
4
+ import { C as createMcpServer, Z as DelegationTaskQueue, st as FileDelegationStore } from "../supervise-B2fTctMn.js";
5
+ import { a as supervisorInstructions } from "../authoring-sf0VpHlY.js";
6
6
  //#region src/mcp/delegate-supervisor-provisioning.ts
7
7
  function trimmed(value) {
8
8
  const v = value?.trim();
@@ -1,8 +1,8 @@
1
1
  import { E as SandboxClient, h as LoopSandboxPlacement } from "../types-6zHo67jn.js";
2
- import { $l as McpServer, $u as DelegationRunContext, Ad as ResearchOutputShape, Al as CoordinationEvent, Au as settleDetachedCoderTurn, Bd as buildDelegationTraceSpans, Bl as QuestionDecision, Bu as DriveTurnCapableBox, Cd as DelegationProgress, Cl as AnalystFindingEvent, Cu as DelegateRunCtx, Dd as DelegationStatusResult, Dl as AuthorizedDownMessage, Du as UiAuditorDelegate, Ed as DelegationStatusArgs, El as AuthorizeDownMessage, Eu as SettleDetachedCoderTurnOptions, Fd as DELEGATION_TRACE_MAX_BYTES, Fl as DownMessageDeliveryAttempt, Fu as createFleetWorkspaceExecutor, Gd as DelegationStateCorruptError, Gl as QuestionUrgency, Gu as formatDetachedSessionRef, Hd as composeLoopTraceEmitters, Hl as QuestionOption, Hu as RunDetachedTurnOptions, Id as DELEGATION_TRACE_MAX_SPANS, Il as DownMessageDeliveryOutcome, Iu as createSiblingSandboxExecutor, Jd as FileDelegationStoreOptions, Jl as WorkerSpawnContext, Ju as DelegationArgs, Kd as DelegationStore, Kl as SettledWorker, Ku as parseDetachedSessionRef, Ld as DelegationTraceCaps, Ll as DownMessageEvent, Lu as DetachedSessionRefParts, Md as UiAuditLensFilter, Ml as CoordinationToolsOptions, Mu as FleetHandle, Nd as UiAuditorDelegationOutput, Nl as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, Nu as FleetWorkspaceExecutorOptions, Od as FeedbackRating, Ol as ContinuationInstruction, Ou as coderTaskFromArgs, Pd as CappedDelegationTrace, Pl as DownMessageAuthorizationInput, Pu as SiblingSandboxExecutorOptions, Qu as DelegationResumeTick, Rd as DelegationTraceCollector, Rl as MakeWorkerAgent, Ru as DetachedTurn, Sd as DelegationProfile, Su as CoderReviewer, Td as DelegationStatus, Tu as DetachedWinnerSelection, Ud as createDelegationTraceCollector, Ul as QuestionPolicy, Uu as createDetachedTurnResumeDriver, Vd as capDelegationTrace, Vl as QuestionLevel, Vu as DriveTurnTick, Wd as DelegationPersistenceError, Wl as QuestionRecord, Wu as detachedTurnEvents, Xu as DelegationResumeContext, Yd as InMemoryDelegationStore, Yl as WorkerWatchOptions, Yu as DelegationRecord, Zl as createCoordinationTools, Zu as DelegationResumeDriver, _d as DelegationError, _u as FeedbackStore, ad as DelegateCodeArgs, af as CoderOutput, au as DELEGATE_TOOL_NAME, bd as DelegationHistoryEntry, bu as CoderDelegate, cd as DelegateFeedbackArgs, cu as DelegateHandlerOptions, dd as DelegateResearchConfig, du as validateDelegateArgs, ed as DelegationTaskQueue, eu as McpServerOptions, fd as DelegateResearchResult, fu as JsonRpcMessage, gd as DelegateUiAuditRoute, gu as FeedbackEvent, hd as DelegateUiAuditResult, hu as McpTransport, id as hashIdempotencyInput, iu as DELEGATE_INPUT_SCHEMA, jd as ResearchSource, jl as CoordinationTools, ju as DelegationExecutor, kd as FeedbackRefersTo, ku as detachedSessionDelegate, ld as DelegateFeedbackResult, lu as DelegateResult, md as DelegateUiAuditConfig, mu as McpToolDescriptor, nd as SubmitInput, nu as createMcpServer, od as DelegateCodeConfig, ou as DelegateArgs, pd as DelegateUiAuditArgs, pu as JsonRpcResponse, qd as FileDelegationStore, qu as runDetachedTurn, rd as SubmitOutput, ru as DELEGATE_DESCRIPTION, sd as DelegateCodeResult, su as DelegateError, td as DelegationTaskQueueOptions, tu as createInProcessTransport, ud as DelegateResearchArgs, uu as createDelegateHandler, vd as DelegationFeedbackSnapshot, vu as InMemoryFeedbackStore, wd as DelegationResultPayload, wl as AnalystRegistry, wu as DetachedSessionDelegateOptions, xd as DelegationHistoryResult, xu as CoderReview, yd as DelegationHistoryArgs, yu as eventToSnapshot, zd as DelegationTraceSpan, zl as Question, zu as DetachedTurnResumeDriverOptions } from "../index-D9dVsozT.js";
3
- import { ct as mergeTraceEnv, lt as readTraceContextFromEnv, ot as TraceContext, st as createPropagatingTraceEmitter, ut as traceContextToEnv } from "../types-B9KAen_0.js";
2
+ import { $l as McpServer, $u as DelegationRunContext, Ad as ResearchOutputShape, Al as CoordinationEvent, Au as settleDetachedCoderTurn, Bd as buildDelegationTraceSpans, Bl as QuestionDecision, Bu as DriveTurnCapableBox, Cd as DelegationProgress, Cl as AnalystFindingEvent, Cu as DelegateRunCtx, Dd as DelegationStatusResult, Dl as AuthorizedDownMessage, Du as UiAuditorDelegate, Ed as DelegationStatusArgs, El as AuthorizeDownMessage, Eu as SettleDetachedCoderTurnOptions, Fd as DELEGATION_TRACE_MAX_BYTES, Fl as DownMessageDeliveryAttempt, Fu as createFleetWorkspaceExecutor, Gd as DelegationStateCorruptError, Gl as QuestionUrgency, Gu as formatDetachedSessionRef, Hd as composeLoopTraceEmitters, Hl as QuestionOption, Hu as RunDetachedTurnOptions, Id as DELEGATION_TRACE_MAX_SPANS, Il as DownMessageDeliveryOutcome, Iu as createSiblingSandboxExecutor, Jd as FileDelegationStoreOptions, Jl as WorkerSpawnContext, Ju as DelegationArgs, Kd as DelegationStore, Kl as SettledWorker, Ku as parseDetachedSessionRef, Ld as DelegationTraceCaps, Ll as DownMessageEvent, Lu as DetachedSessionRefParts, Md as UiAuditLensFilter, Ml as CoordinationToolsOptions, Mu as FleetHandle, Nd as UiAuditorDelegationOutput, Nl as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, Nu as FleetWorkspaceExecutorOptions, Od as FeedbackRating, Ol as ContinuationInstruction, Ou as coderTaskFromArgs, Pd as CappedDelegationTrace, Pl as DownMessageAuthorizationInput, Pu as SiblingSandboxExecutorOptions, Qu as DelegationResumeTick, Rd as DelegationTraceCollector, Rl as MakeWorkerAgent, Ru as DetachedTurn, Sd as DelegationProfile, Su as CoderReviewer, Td as DelegationStatus, Tu as DetachedWinnerSelection, Ud as createDelegationTraceCollector, Ul as QuestionPolicy, Uu as createDetachedTurnResumeDriver, Vd as capDelegationTrace, Vl as QuestionLevel, Vu as DriveTurnTick, Wd as DelegationPersistenceError, Wl as QuestionRecord, Wu as detachedTurnEvents, Xu as DelegationResumeContext, Yd as InMemoryDelegationStore, Yl as WorkerWatchOptions, Yu as DelegationRecord, Zl as createCoordinationTools, Zu as DelegationResumeDriver, _d as DelegationError, _u as FeedbackStore, ad as DelegateCodeArgs, af as CoderOutput, au as DELEGATE_TOOL_NAME, bd as DelegationHistoryEntry, bu as CoderDelegate, cd as DelegateFeedbackArgs, cu as DelegateHandlerOptions, dd as DelegateResearchConfig, du as validateDelegateArgs, ed as DelegationTaskQueue, eu as McpServerOptions, fd as DelegateResearchResult, fu as JsonRpcMessage, gd as DelegateUiAuditRoute, gu as FeedbackEvent, hd as DelegateUiAuditResult, hu as McpTransport, id as hashIdempotencyInput, iu as DELEGATE_INPUT_SCHEMA, jd as ResearchSource, jl as CoordinationTools, ju as DelegationExecutor, kd as FeedbackRefersTo, ku as detachedSessionDelegate, ld as DelegateFeedbackResult, lu as DelegateResult, md as DelegateUiAuditConfig, mu as McpToolDescriptor, nd as SubmitInput, nu as createMcpServer, od as DelegateCodeConfig, ou as DelegateArgs, pd as DelegateUiAuditArgs, pu as JsonRpcResponse, qd as FileDelegationStore, qu as runDetachedTurn, rd as SubmitOutput, ru as DELEGATE_DESCRIPTION, sd as DelegateCodeResult, su as DelegateError, td as DelegationTaskQueueOptions, tu as createInProcessTransport, ud as DelegateResearchArgs, uu as createDelegateHandler, vd as DelegationFeedbackSnapshot, vu as InMemoryFeedbackStore, wd as DelegationResultPayload, wl as AnalystRegistry, wu as DetachedSessionDelegateOptions, xd as DelegationHistoryResult, xu as CoderReview, yd as DelegationHistoryArgs, yu as eventToSnapshot, zd as DelegationTraceSpan, zl as Question, zu as DetachedTurnResumeDriverOptions } from "../index-DixXnx07.js";
3
+ import { ct as createPropagatingTraceEmitter, dt as traceContextToEnv, lt as mergeTraceEnv, st as TraceContext, ut as readTraceContextFromEnv } from "../types-BjUQODeG.js";
4
4
  import { o as UiLens } from "../substrate-BcnuSHXm.js";
5
- import { A as LocalHarness, B as GitRunner, D as CodexTokenUsage, E as CodexExecutionPolicy, F as parseCodexTokenUsage, G as removeWorktree, H as WorktreeHandle, I as runLocalHarness, L as CreateWorktreeOptions, M as RunLocalHarnessOptions, N as harnessSupportsReasoningEffort, O as DEFAULT_LOCAL_HARNESS, P as localHarnessExecutable, R as DiffOptions, T as CodexExecutionEvidence, U as captureWorktreeDiff, V as RemoveWorktreeOptions, W as createWorktree, j as LocalHarnessResult, k as LOCAL_HARNESSES, z as DiffResult } from "../runtime-aXvRThzL.js";
5
+ import { A as LocalHarness, B as GitRunner, D as CodexTokenUsage, E as CodexExecutionPolicy, F as parseCodexTokenUsage, G as removeWorktree, H as WorktreeHandle, I as runLocalHarness, L as CreateWorktreeOptions, M as RunLocalHarnessOptions, N as harnessSupportsReasoningEffort, O as DEFAULT_LOCAL_HARNESS, P as localHarnessExecutable, R as DiffOptions, T as CodexExecutionEvidence, U as captureWorktreeDiff, V as RemoveWorktreeOptions, W as createWorktree, j as LocalHarnessResult, k as LOCAL_HARNESSES, z as DiffResult } from "../runtime-CKk_poJ-.js";
6
6
  import { a as KbGateResult, i as FactJudgeVerdict, n as FactCandidate, o as createKbGate, r as FactJudge, t as CreateKbGateOptions } from "../kb-gate-C8z2juK8.js";
7
7
  import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-CzEiSbPW.js";
8
8
  import { AgentProfileMcpServer } from "@tangle-network/agent-interface";
package/dist/mcp/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { i as ConfigError, u as ValidationError } from "../errors-DEAvWQPy.js";
2
2
  import { d as throwAbort, f as throwIfAborted, l as sleep, r as deleteBoxSafe } from "../util-Dr--8wAL.js";
3
3
  import { t as assertExecutableAgentProfile } from "../model-policy-mWSoToiQ.js";
4
- import { $ as runAgentRounds, At as createWorktree, Ft as localHarnessExecutable, It as parseCodexTokenUsage, Lt as CodexExecutionDiagnosticError, Mt as DEFAULT_LOCAL_HARNESS, Nt as LOCAL_HARNESSES, Ot as runWorktreeHarness, Pt as harnessSupportsReasoningEffort, Z as createSandboxForSpec, at as createPropagatingTraceEmitter, ct as traceContextToEnv, jt as removeWorktree, kt as captureWorktreeDiff, ot as mergeTraceEnv, st as readTraceContextFromEnv } from "../supervisor-DlVTwwJb.js";
5
- import { S as runCoderChecks, nt as selectValidWinner } from "../runtime-YuPbrgG1.js";
6
- import { $ as DELEGATION_TRACE_MAX_BYTES, A as DELEGATION_HISTORY_INPUT_SCHEMA, B as DELEGATE_FEEDBACK_INPUT_SCHEMA, C as createMcpServer, D as createDelegationStatusHandler, Dt as createCoordinationTools, E as DELEGATION_STATUS_TOOL_NAME, F as DELEGATE_UI_AUDIT_INPUT_SCHEMA, G as DELEGATE_INPUT_SCHEMA, H as createDelegateFeedbackHandler, I as DELEGATE_UI_AUDIT_TOOL_NAME, J as validateDelegateArgs, K as DELEGATE_TOOL_NAME, L as createDelegateUiAuditHandler, M as createDelegationHistoryHandler, N as validateDelegationHistoryArgs, O as validateDelegationStatusArgs, P as DELEGATE_UI_AUDIT_DESCRIPTION, Q as hashIdempotencyInput, R as validateDelegateUiAuditArgs, S as createInProcessTransport, T as DELEGATION_STATUS_INPUT_SCHEMA, Tt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, U as validateDelegateFeedbackArgs, V as DELEGATE_FEEDBACK_TOOL_NAME, W as DELEGATE_DESCRIPTION, Z as DelegationTaskQueue, at as DelegationPersistenceError, ct as InMemoryDelegationStore, et as DELEGATION_TRACE_MAX_SPANS, it as createDelegationTraceCollector, j as DELEGATION_HISTORY_TOOL_NAME, k as DELEGATION_HISTORY_DESCRIPTION, lt as InMemoryFeedbackStore, nt as capDelegationTrace, ot as DelegationStateCorruptError, q as createDelegateHandler, rt as composeLoopTraceEmitters, st as FileDelegationStore, tt as buildDelegationTraceSpans, ut as eventToSnapshot, w as DELEGATION_STATUS_DESCRIPTION, z as DELEGATE_FEEDBACK_DESCRIPTION } from "../supervise-BDj-uFfb.js";
4
+ import { $ as runAgentRounds, At as createWorktree, Ft as localHarnessExecutable, It as parseCodexTokenUsage, Lt as CodexExecutionDiagnosticError, Mt as DEFAULT_LOCAL_HARNESS, Nt as LOCAL_HARNESSES, Ot as runWorktreeHarness, Pt as harnessSupportsReasoningEffort, Z as createSandboxForSpec, at as createPropagatingTraceEmitter, ct as traceContextToEnv, jt as removeWorktree, kt as captureWorktreeDiff, ot as mergeTraceEnv, st as readTraceContextFromEnv } from "../supervisor-BTuNGicF.js";
5
+ import { S as runCoderChecks, nt as selectValidWinner } from "../runtime-BeBAzfnW.js";
6
+ import { $ as DELEGATION_TRACE_MAX_BYTES, A as DELEGATION_HISTORY_INPUT_SCHEMA, B as DELEGATE_FEEDBACK_INPUT_SCHEMA, C as createMcpServer, D as createDelegationStatusHandler, Dt as createCoordinationTools, E as DELEGATION_STATUS_TOOL_NAME, F as DELEGATE_UI_AUDIT_INPUT_SCHEMA, G as DELEGATE_INPUT_SCHEMA, H as createDelegateFeedbackHandler, I as DELEGATE_UI_AUDIT_TOOL_NAME, J as validateDelegateArgs, K as DELEGATE_TOOL_NAME, L as createDelegateUiAuditHandler, M as createDelegationHistoryHandler, N as validateDelegationHistoryArgs, O as validateDelegationStatusArgs, P as DELEGATE_UI_AUDIT_DESCRIPTION, Q as hashIdempotencyInput, R as validateDelegateUiAuditArgs, S as createInProcessTransport, T as DELEGATION_STATUS_INPUT_SCHEMA, Tt as DEFAULT_AWAIT_EVENT_TIMEOUT_MS, U as validateDelegateFeedbackArgs, V as DELEGATE_FEEDBACK_TOOL_NAME, W as DELEGATE_DESCRIPTION, Z as DelegationTaskQueue, at as DelegationPersistenceError, ct as InMemoryDelegationStore, et as DELEGATION_TRACE_MAX_SPANS, it as createDelegationTraceCollector, j as DELEGATION_HISTORY_TOOL_NAME, k as DELEGATION_HISTORY_DESCRIPTION, lt as InMemoryFeedbackStore, nt as capDelegationTrace, ot as DelegationStateCorruptError, q as createDelegateHandler, rt as composeLoopTraceEmitters, st as FileDelegationStore, tt as buildDelegationTraceSpans, ut as eventToSnapshot, w as DELEGATION_STATUS_DESCRIPTION, z as DELEGATE_FEEDBACK_DESCRIPTION } from "../supervise-B2fTctMn.js";
7
7
  import { t as createStdioToolServer } from "../tool-server-Gs3VvfSK.js";
8
8
  import { t as createKbGate } from "../kb-gate-DpaSwXVx.js";
9
- import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-BATxru3h.js";
9
+ import { n as mcpToolsForRuntimeMcpSubset, t as mcpToolsForRuntimeMcp } from "../openai-tools-Ba0yu9hI.js";
10
10
  import { t as coderTaskToPrompt } from "../coder-yhVWbdWc.js";
11
11
  import { a as createMemoryToolServer, c as resolveMemoryFromEnv, i as MEMORY_NAME_ENV, n as MEMORY_ITEMS_ENV, o as parseMemoryItems, r as MEMORY_LOG_ENV, s as readMemoryItemsFile, t as MEMORY_FILE_ENV } from "../memory-server-eD2baiRO.js";
12
12
  import { agentProfileSchema } from "@tangle-network/agent-interface";
@@ -1,4 +1,4 @@
1
- import { A as DELEGATION_HISTORY_INPUT_SCHEMA, B as DELEGATE_FEEDBACK_INPUT_SCHEMA, E as DELEGATION_STATUS_TOOL_NAME, T as DELEGATION_STATUS_INPUT_SCHEMA, V as DELEGATE_FEEDBACK_TOOL_NAME, j as DELEGATION_HISTORY_TOOL_NAME, k as DELEGATION_HISTORY_DESCRIPTION, w as DELEGATION_STATUS_DESCRIPTION, z as DELEGATE_FEEDBACK_DESCRIPTION } from "./supervise-BDj-uFfb.js";
1
+ import { A as DELEGATION_HISTORY_INPUT_SCHEMA, B as DELEGATE_FEEDBACK_INPUT_SCHEMA, E as DELEGATION_STATUS_TOOL_NAME, T as DELEGATION_STATUS_INPUT_SCHEMA, V as DELEGATE_FEEDBACK_TOOL_NAME, j as DELEGATION_HISTORY_TOOL_NAME, k as DELEGATION_HISTORY_DESCRIPTION, w as DELEGATION_STATUS_DESCRIPTION, z as DELEGATE_FEEDBACK_DESCRIPTION } from "./supervise-B2fTctMn.js";
2
2
  //#region src/mcp/openai-tools.ts
3
3
  function buildTool(name, description, parameters) {
4
4
  return {
@@ -41,4 +41,4 @@ function mcpToolsForRuntimeMcpSubset(names) {
41
41
  //#endregion
42
42
  export { mcpToolsForRuntimeMcpSubset as n, mcpToolsForRuntimeMcp as t };
43
43
 
44
- //# sourceMappingURL=openai-tools-BATxru3h.js.map
44
+ //# sourceMappingURL=openai-tools-Ba0yu9hI.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"openai-tools-BATxru3h.js","names":[],"sources":["../src/mcp/openai-tools.ts"],"sourcesContent":["/**\n *\n * OpenAI Chat Completions `tools[]` projection of the queue-bound agent-runtime\n * MCP delegation tools.\n *\n * Use when a caller-owned OpenAI-compatible transport needs the model to call\n * `delegate_feedback`, `delegation_status`, and `delegation_history`. Execution\n * is the caller's responsibility (typically the parent sandbox runtime's MCP\n * mount); Runtime's profile-bound model path materializes profile tools through\n * its executor instead.\n *\n * Sandbox-SDK callers do NOT need this helper: the sandbox runtime mounts\n * MCP servers natively and the in-sandbox harness discovers tools via the\n * runtime, not via an OpenAI tools array.\n *\n * Tool name + description + JSON-schema are pulled from the canonical\n * `DELEGATE_*` constants exported by `./tools/*` so the projection cannot\n * drift from the server's own validators.\n *\n * @experimental\n */\n\nimport type { OpenAIChatTool } from '../types'\nimport {\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA,\n DELEGATE_FEEDBACK_TOOL_NAME,\n} from './tools/delegate-feedback'\nimport {\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA,\n DELEGATION_HISTORY_TOOL_NAME,\n} from './tools/delegation-history'\nimport {\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA,\n DELEGATION_STATUS_TOOL_NAME,\n} from './tools/delegation-status'\n\nfunction buildTool(\n name: string,\n description: string,\n parameters: Readonly<Record<string, unknown>>,\n): OpenAIChatTool {\n // `parameters` arrives as a deeply-readonly `as const` literal. The\n // OpenAI-compatible transports JSON-serialize the body, so a shallow copy\n // into a plain object is sufficient and shields callers that mutate\n // the returned descriptor from corrupting the source constant.\n return {\n type: 'function',\n function: { name, description, parameters: { ...parameters } },\n }\n}\n\n/**\n *\n * Returns the queue-bound delegation tools projected into OpenAI Chat\n * Completions `tools[]` shape. The order is stable: `delegate_feedback`,\n * `delegation_status`, `delegation_history`.\n *\n * @experimental\n */\nexport function mcpToolsForRuntimeMcp(): OpenAIChatTool[] {\n return [\n buildTool(\n DELEGATE_FEEDBACK_TOOL_NAME,\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_STATUS_TOOL_NAME,\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_HISTORY_TOOL_NAME,\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n ]\n}\n\n/**\n *\n * Subset filter — return only the projected tools whose `function.name`\n * appears in `names`. Useful for curated mounts (e.g. only the queue-bound\n * delegation tools, omitting `delegate_feedback`). Unknown names are\n * silently ignored; pass an empty array to get an empty result.\n *\n * @experimental\n */\nexport function mcpToolsForRuntimeMcpSubset(names: ReadonlyArray<string>): OpenAIChatTool[] {\n const allowed = new Set(names)\n return mcpToolsForRuntimeMcp().filter((tool) => allowed.has(tool.function.name))\n}\n"],"mappings":";;AAuCA,SAAS,UACP,MACA,aACA,YACgB;CAKhB,OAAO;EACL,MAAM;EACN,UAAU;GAAE;GAAM;GAAa,YAAY,EAAE,GAAG,WAAW;EAAE;CAC/D;AACF;;;;;;;;;AAUA,SAAgB,wBAA0C;CACxD,OAAO;EACL,UACE,6BACA,+BACA,8BACF;EACA,UACE,6BACA,+BACA,8BACF;EACA,UACE,8BACA,gCACA,+BACF;CACF;AACF;;;;;;;;;;AAWA,SAAgB,4BAA4B,OAAgD;CAC1F,MAAM,UAAU,IAAI,IAAI,KAAK;CAC7B,OAAO,sBAAsB,CAAC,CAAC,QAAQ,SAAS,QAAQ,IAAI,KAAK,SAAS,IAAI,CAAC;AACjF"}
1
+ {"version":3,"file":"openai-tools-Ba0yu9hI.js","names":[],"sources":["../src/mcp/openai-tools.ts"],"sourcesContent":["/**\n *\n * OpenAI Chat Completions `tools[]` projection of the queue-bound agent-runtime\n * MCP delegation tools.\n *\n * Use when a caller-owned OpenAI-compatible transport needs the model to call\n * `delegate_feedback`, `delegation_status`, and `delegation_history`. Execution\n * is the caller's responsibility (typically the parent sandbox runtime's MCP\n * mount); Runtime's profile-bound model path materializes profile tools through\n * its executor instead.\n *\n * Sandbox-SDK callers do NOT need this helper: the sandbox runtime mounts\n * MCP servers natively and the in-sandbox harness discovers tools via the\n * runtime, not via an OpenAI tools array.\n *\n * Tool name + description + JSON-schema are pulled from the canonical\n * `DELEGATE_*` constants exported by `./tools/*` so the projection cannot\n * drift from the server's own validators.\n *\n * @experimental\n */\n\nimport type { OpenAIChatTool } from '../types'\nimport {\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA,\n DELEGATE_FEEDBACK_TOOL_NAME,\n} from './tools/delegate-feedback'\nimport {\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA,\n DELEGATION_HISTORY_TOOL_NAME,\n} from './tools/delegation-history'\nimport {\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA,\n DELEGATION_STATUS_TOOL_NAME,\n} from './tools/delegation-status'\n\nfunction buildTool(\n name: string,\n description: string,\n parameters: Readonly<Record<string, unknown>>,\n): OpenAIChatTool {\n // `parameters` arrives as a deeply-readonly `as const` literal. The\n // OpenAI-compatible transports JSON-serialize the body, so a shallow copy\n // into a plain object is sufficient and shields callers that mutate\n // the returned descriptor from corrupting the source constant.\n return {\n type: 'function',\n function: { name, description, parameters: { ...parameters } },\n }\n}\n\n/**\n *\n * Returns the queue-bound delegation tools projected into OpenAI Chat\n * Completions `tools[]` shape. The order is stable: `delegate_feedback`,\n * `delegation_status`, `delegation_history`.\n *\n * @experimental\n */\nexport function mcpToolsForRuntimeMcp(): OpenAIChatTool[] {\n return [\n buildTool(\n DELEGATE_FEEDBACK_TOOL_NAME,\n DELEGATE_FEEDBACK_DESCRIPTION,\n DELEGATE_FEEDBACK_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_STATUS_TOOL_NAME,\n DELEGATION_STATUS_DESCRIPTION,\n DELEGATION_STATUS_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n buildTool(\n DELEGATION_HISTORY_TOOL_NAME,\n DELEGATION_HISTORY_DESCRIPTION,\n DELEGATION_HISTORY_INPUT_SCHEMA as Readonly<Record<string, unknown>>,\n ),\n ]\n}\n\n/**\n *\n * Subset filter — return only the projected tools whose `function.name`\n * appears in `names`. Useful for curated mounts (e.g. only the queue-bound\n * delegation tools, omitting `delegate_feedback`). Unknown names are\n * silently ignored; pass an empty array to get an empty result.\n *\n * @experimental\n */\nexport function mcpToolsForRuntimeMcpSubset(names: ReadonlyArray<string>): OpenAIChatTool[] {\n const allowed = new Set(names)\n return mcpToolsForRuntimeMcp().filter((tool) => allowed.has(tool.function.name))\n}\n"],"mappings":";;AAuCA,SAAS,UACP,MACA,aACA,YACgB;CAKhB,OAAO;EACL,MAAM;EACN,UAAU;GAAE;GAAM;GAAa,YAAY,EAAE,GAAG,WAAW;EAAE;CAC/D;AACF;;;;;;;;;AAUA,SAAgB,wBAA0C;CACxD,OAAO;EACL,UACE,6BACA,+BACA,8BACF;EACA,UACE,6BACA,+BACA,8BACF;EACA,UACE,8BACA,gCACA,+BACF;CACF;AACF;;;;;;;;;;AAWA,SAAgB,4BAA4B,OAAgD;CAC1F,MAAM,UAAU,IAAI,IAAI,KAAK;CAC7B,OAAO,sBAAsB,CAAC,CAAC,QAAQ,SAAS,QAAQ,IAAI,KAAK,SAAS,IAAI,CAAC;AACjF"}
@@ -1,4 +1,4 @@
1
- import { a as ExecutorConfig } from "../runtime-aXvRThzL.js";
1
+ import { a as ExecutorConfig } from "../runtime-CKk_poJ-.js";
2
2
  import { RunRecord } from "@tangle-network/agent-eval";
3
3
  //#region src/primeintellect/types.d.ts
4
4
  type PrimeIntellectSplit = 'train' | 'eval';
@@ -1,5 +1,5 @@
1
- import { a as ExecutorConfig } from "./runtime-aXvRThzL.js";
2
- import { i as CollectedAgentTurn, r as AgentTurnUsage } from "./stream-agent-turn-BXiMHdCf.js";
1
+ import { a as ExecutorConfig } from "./runtime-CKk_poJ-.js";
2
+ import { i as CollectedAgentTurn, r as AgentTurnUsage } from "./stream-agent-turn-By46GZlo.js";
3
3
  import { CostLedgerHandle, MaximumCharge, ProposalFinding } from "@tangle-network/agent-eval";
4
4
  import { CampaignScenarioIdentity, CompareOptimizationMethodsOptions, OptimizationMethod, OptimizationMethodComparison, WorktreeAdapter } from "@tangle-network/agent-eval/campaign";
5
5
  import { AgentProfile as AgentProfile$1, AgentProfileDiff, HarnessType as HarnessType$1, ReasoningEffort, Sha256Digest } from "@tangle-network/agent-interface";
@@ -545,4 +545,4 @@ declare function defaultRedactor(value: unknown): unknown;
545
545
  declare function resolveRedactor(redact: Redactor | false | undefined): Redactor;
546
546
  //#endregion
547
547
  export { agenticGenerator as $, ImprovementCandidate as A, ImprovementProfilePopulationLineage as B, ImproveProfileComponents as C, ImproveScenarioPartitions as D, ImproveRuntimeCodeGeneratorOptions as E, ImprovementProfileCandidatePopulationAvailable as F, ReadonlyAgentProfile as G, ImprovementProfilePopulationObservationSource as H, ImprovementProfileCandidatePopulationUnavailable as I, AgenticGeneratorShotDisposition as J, AgenticGeneratorExecutorForWorktree as K, ImprovementProfilePopulationArtifactSource as L, ImprovementMaterializedProfilePopulationCandidate as M, ImprovementProfileCandidate as N, ImproveSkillsOptions as O, ImprovementProfileCandidatePopulation as P, VerifyResult as Q, ImprovementProfilePopulationCandidate as R, ImproveProfileAgent as S, ImproveResult as T, ImprovementRefusedProfilePopulationCandidate as U, ImprovementProfilePopulationLineageNode as V, DeepReadonly as W, AgenticGeneratorShotReceipt as X, AgenticGeneratorShotExecution as Y, Verifier as Z, ImproveMethodOptions as _, ImproveCandidateValidationInput as a, ImproveOptimizationRunOptions as b, ImproveCodeOptions as c, ImproveCost as d, commandVerifier as et, ImproveCustomCodeGeneratorOptions as f, ImproveMethodLineage as g, ImproveMethodFactory as h, improve as i, ImprovementCodeCandidate as j, ImproveSurface as k, ImproveCodeResult as l, ImproveMethodContext as m, defaultRedactor as n, CandidateGenerator as nt, ImproveCandidateValidator as o, ImproveLineage as p, AgenticGeneratorOptions as q, resolveRedactor as r, ImproveCodeBaseOptions as s, Redactor as t, defaultBuildPrompt as tt, ImproveCodeRunOptions as u, ImproveMethodResult as v, ImproveProfileSurface as w, ImproveOptions as x, ImproveMethodSource as y, ImprovementProfilePopulationCandidateSource as z };
548
- //# sourceMappingURL=redact-mWj5eu4X.d.ts.map
548
+ //# sourceMappingURL=redact-BAnM2avI.d.ts.map
@@ -1,19 +1,19 @@
1
1
  import { n as AnalystError, s as PlannerError, u as ValidationError } from "./errors-DEAvWQPy.js";
2
- import "./stream-agent-turn-BxwZJVfZ.js";
2
+ import "./stream-agent-turn-Bo5ZSAUR.js";
3
3
  import { i as InMemorySpawnJournal, r as InMemoryResultBlobStore, v as isTraceAnalysisStore, x as contentAddress } from "./spawn-journal-Cd5L-Ie9.js";
4
4
  import { a as isAbortError, i as hasCompleteCacheBreakdown, l as sleep, m as zeroTokenUsage, n as cloneTokenUsage, s as randomSuffix, t as addTokenUsage, u as stringifySafe } from "./util-Dr--8wAL.js";
5
5
  import { i as redactProtectedValue, r as redactProtectedReason } from "./protected-redaction--F3v1oo8.js";
6
6
  import { a as notifySandboxEventObserver, c as parseCanonicalTransportEvent, s as extractTransportEventIdentity } from "./sandbox-events-vIwmuPdl.js";
7
7
  import { c as profileProviderModel, i as concreteModelId, s as profileModelExecutionSettings, t as assertExecutableAgentProfile } from "./model-policy-mWSoToiQ.js";
8
- import { v as executableAgentProfileSnapshot, y as executableAgentSpecSnapshot } from "./materialization-DBXuH34A.js";
9
- import { $ as runAgentRounds, I as createWorktreeCliExecutor, N as createExecutor, P as createExecutorRegistry, Q as defaultSelectWinner, W as createPushTraceSource, et as createSandboxLineage, it as runBrainLoop, l as withDriverExecutor, m as settledToIteration, n as createSupervisor, rt as routerBrain, tt as probeSandboxCapabilities, w as rollingDispatch } from "./supervisor-DlVTwwJb.js";
8
+ import { b as executableAgentProfileSnapshot, x as executableAgentSpecSnapshot } from "./materialization-JR_nN_oT.js";
9
+ import { $ as runAgentRounds, I as createWorktreeCliExecutor, N as createExecutor, P as createExecutorRegistry, Q as defaultSelectWinner, W as createPushTraceSource, et as createSandboxLineage, it as runBrainLoop, l as withDriverExecutor, m as settledToIteration, n as createSupervisor, rt as routerBrain, tt as probeSandboxCapabilities, w as rollingDispatch } from "./supervisor-BTuNGicF.js";
10
10
  import "./environment-provider-mDsjfGjY.js";
11
11
  import { i as notifyRuntimeHookEvent } from "./runtime-hooks-C7iJOWm3.js";
12
- import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-Dq0j-JHl.js";
13
- import { It as gateOnDeliverable, Lt as mapExecutorResult, n as supervise } from "./supervise-BDj-uFfb.js";
14
- import "./authoring-WS1l0lU1.js";
15
- import "./graph-B9hFN-zX.js";
16
- import { CODING_HARNESSES, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, makeFinding as makeFinding$1, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
12
+ import { C as observe, O as strategyAuthorMethod, T as profileChatClient, b as sample, v as refine, x as sampleThenRefine, y as runAgentic } from "./structural-rollout-DGkq_Grt.js";
13
+ import { It as gateOnDeliverable, Lt as mapExecutorResult, n as supervise } from "./supervise-B2fTctMn.js";
14
+ import "./authoring-sf0VpHlY.js";
15
+ import "./graph-DjTw-HMK.js";
16
+ import { CODING_HARNESSES, InMemoryTraceStore, OUTPUT_VALUE, benjaminiHochberg, buildTrajectory, computeFindingId as computeFindingId$1, confidenceInterval, expandProfileAxes, makeFinding as makeFinding$1, modelHasSnapshot, pairedBootstrap, paretoFrontier, wilcoxonSignedRank, wilson } from "@tangle-network/agent-eval";
17
17
  import { heldoutSignificance, runProfileMatrix } from "@tangle-network/agent-eval/campaign";
18
18
  import { AgentEnvironmentCapabilitiesSchema, AgentExactRunControlRefSchema, AgentNativeContextContinuationResultSchema, AgentRunCancellationAcknowledgementSchema, AgentRunCancellationRequestSchema, AgentTurnResultSchema, InteractionAcknowledgementSchema, InteractionResponseCommandSchema, NativeContextBoundaryProofSchema, NativeContextContinuationRequestSchema, RuntimeEventEnvelopeSchema, agentNativeContextContinuationResultMatchesRequest, agentProfileSchema, agentRunCancellationAcknowledgementMatchesRequest, agentRunCancellationRequestDigest, canonicalAgentProfileDigest, canonicalCandidateDigest, nativeContextContinuationTurnDigest, validateAgentProfileSecurity } from "@tangle-network/agent-interface";
19
19
  import { dirname, isAbsolute, join, relative, resolve, sep } from "node:path";
@@ -995,6 +995,38 @@ function deterministicCompletion(check) {
995
995
  }
996
996
  //#endregion
997
997
  //#region src/runtime/loop-dispatch.ts
998
+ /**
999
+ * `loopDispatch` — turn `runAgentRounds` into an agent-eval campaign dispatch.
1000
+ *
1001
+ * Without this adapter a consumer wiring `runAgentRounds` into `runProfileMatrix` /
1002
+ * `runCampaign` has to, by hand, every time: (a) build an `ExecCtx` with a
1003
+ * sandbox client, (b) adapt the campaign `DispatchContext.trace` into a
1004
+ * `LoopTraceEmitter` (or lose all loop trace correlation), and (c) remember to
1005
+ * forward the loop's cost + tokens via `ctx.cost` (forgetting it yields a
1006
+ * `{0,0}` cell the backend-integrity guard reads as a stub). Three foot-guns,
1007
+ * the third silent. The fleet's products skipped (c) and fell back to a
1008
+ * `workerRecords[]` side-channel — the exact anti-pattern the substrate exists
1009
+ * to kill.
1010
+ *
1011
+ * `loopDispatch` collapses all three into one typed call:
1012
+ *
1013
+ * const dispatch = loopDispatch({
1014
+ * sandboxClient,
1015
+ * toLoopOptions: (scenario, profile) => ({ driver, agentRun, output, validator, task }),
1016
+ * })
1017
+ * await runProfileMatrix({ profiles, scenarios, dispatch, judges, commitSha })
1018
+ *
1019
+ * The complete Runtime cell starts inside `ctx.cost.runPaidCall` before any
1020
+ * sandbox work begins. Its provider-reported usage becomes the paid-call
1021
+ * receipt before Eval settles the call. A completed `LoopResult` cannot be
1022
+ * attached afterward because it cannot prove pre-execution admission.
1023
+ * Trace events are forwarded automatically and the Runtime context is built
1024
+ * automatically.
1025
+ *
1026
+ * Typed structurally against the campaign `DispatchContext` (imported type-only
1027
+ * from `@tangle-network/agent-eval/campaign`) — a downward dependency, never an
1028
+ * inversion.
1029
+ */
998
1030
  /** Bridge a campaign `DispatchContext.trace` to a `LoopTraceEmitter` so every
999
1031
  * `loop.*` event lands as a span under the cell's scoped trace. */
1000
1032
  function campaignTraceToLoopEmitter(trace) {
@@ -1066,15 +1098,19 @@ function costReceiptFromUsage(usage, model, cost) {
1066
1098
  /**
1067
1099
  * Eval has one pre-admitted paid call for this dispatch. A tree can only settle that one call when
1068
1100
  * Runtime can prove every visible leaf used the same model. Child identities come from Runtime's
1069
- * materialization receipts. A router root is validated against its exact profile model before
1070
- * Runtime accepts each response. A nested tree is not flattened in this result view, so it remains
1071
- * unknown rather than being relabelled from its parent. A caller-supplied override would be false.
1101
+ * materialization receipts. The root identity comes only from Runtime's settled provider receipt;
1102
+ * the authored profile remains a matching constraint, never a fallback. A nested tree is not
1103
+ * flattened in this result view, so it remains unknown rather than being relabelled from its
1104
+ * parent. A caller-supplied override would be false.
1072
1105
  */
1073
1106
  function supervisedTreeModel(result, rootProfile) {
1074
1107
  const models = /* @__PURE__ */ new Set();
1075
- const rootModel = rootProfile.harness === void 0 || rootProfile.harness === "cli-base" ? rootProfile.model?.default : void 0;
1076
- if (rootModel === void 0) return { kind: "unknown" };
1077
- models.add(rootModel);
1108
+ const rootEvidence = result.rootProviderModel;
1109
+ if (rootEvidence?.status !== "known" || rootEvidence.models.length === 0) return { kind: "unknown" };
1110
+ for (const model of rootEvidence.models) {
1111
+ if (!modelHasSnapshot(model) || !observedModelMatchesProfile(model, rootProfile)) return { kind: "unknown" };
1112
+ models.add(model);
1113
+ }
1078
1114
  let unknown = false;
1079
1115
  for (const node of result.tree.nodes) {
1080
1116
  if (node.ownedTreeRoot !== void 0) {
@@ -1098,6 +1134,20 @@ function supervisedTreeModel(result, rootProfile) {
1098
1134
  model: [...models][0]
1099
1135
  };
1100
1136
  }
1137
+ /** Match a provider-qualified response to the profile's base alias without accepting a different
1138
+ * model or using the profile alias as the reported identity. */
1139
+ function observedModelMatchesProfile(observed, profile) {
1140
+ const declared = profile.model?.default;
1141
+ if (typeof declared !== "string" || declared.length === 0) return false;
1142
+ if (modelHasSnapshot(declared)) return observed === declared;
1143
+ const observedBase = modelWithoutSnapshot(observed);
1144
+ const declaredBase = modelWithoutSnapshot(declared);
1145
+ return observedBase === declaredBase || observedBase.endsWith(`/${declaredBase}`) || declaredBase.endsWith(`/${observedBase}`);
1146
+ }
1147
+ function modelWithoutSnapshot(model) {
1148
+ const at = model.lastIndexOf("@");
1149
+ return at > 0 ? model.slice(0, at) : model;
1150
+ }
1101
1151
  /** The Eval receipt surface has no pre-admitted per-model recursive-tree receipt bundle yet. */
1102
1152
  var SupervisedTreeModelIdentityError = class extends Error {
1103
1153
  constructor(identity) {
@@ -6177,4 +6227,4 @@ function tail(s) {
6177
6227
  //#endregion
6178
6228
  export { loopUntil as $, assertStrategyContract as A, McpSpawnFault as At, promotionGate as B, chatTransportExecutor as C, pairwiseSignificance as Ct, pickChampion as D, renderPairwiseMarkdown as Dt, discriminatingMeans as E, renderLeaderboardSvg as Et, openSandboxRun as F, envKeyProvider as Ft, builtinShapes as G, trajectoryReport as H, printBenchmarkReport as I, mcpSecretEnvMetadataKey as It, FileCorpus as J, createShapeRegistry as K, runBenchmark as L, resolveMcpServerLaunch as Lt, strategyAuthorContract as M, materializeLocalMcp as Mt, strategyAuthorSystemPrompt as N, createMcpEnvironment as Nt, runStrategyEvolution as O, auditIntent as Ot, SandboxRunAbortError as P, sanitizeMcpToolSchema as Pt, flatWidenGate as Q, reconnectRetainedRun as R, resolveSecretEnv as Rt, runCoderChecks as S, leaderboard as St, createChatSessionStore as T, renderLeaderboardMarkdown as Tt, definePersona as U, equalKOnCost as V, runPersonified as W, renderCorpusToInstructions as X, InMemoryCorpus as Y, fanout as Z, settledWorkerOut as _, superviseDispatch as _t, localShell as a, assertTraceDerivedFindings as at, analyzeTrace as b, sentinelCompletion as bt, createVerifierEnvironment as c, registryScopeAnalyst as ct, worktreeFanout as d, defineLeaderboard as dt, panel as et, EVIDENCE_MAX_CHARS as f, resolveSandboxClient as ft, composeWorkerEvidence as g, loopDispatch as gt, closingWorkerNote as h, loopCampaignDispatch as ht, jjWorkspace as i, widen as it, authorStrategy as j, connectStdioMcp as jt, selectChampion as k, defaultAuditorInstruction as kt, failuresAnalyst as l, inProcessSandboxClient as lt, VERIFY_TAIL_CHARS as m, inlineSandboxClient as mt, makeFinding$1 as n, selectValidWinner as nt, runInWorkspace as o, buildSteerContext as ot, NOTE_MAX_CHARS as p, localSandboxClient as pt, registerShape as q, gitWorkspace as r, verify as rt, createWaterfallCollector as s, createScopeAnalyst as st, computeFindingId$1 as t, pipeline as tt, superviseSurface as u, harvestCorpus as ut, copyUntrackedIntoClone as v, completionAuthorizes as vt, chatWorkerSeam as w, renderLeaderboardHtml as wt, patchDelivered as x, stopSentinel as xt, withUntrackedArtifacts as y, deterministicCompletion as yt, startRetainedRun as z, secretEnvOfMcpServer as zt };
6179
6229
 
6180
- //# sourceMappingURL=runtime-YuPbrgG1.js.map
6230
+ //# sourceMappingURL=runtime-BeBAzfnW.js.map