@tangle-network/agent-runtime 0.195.1 → 0.196.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.
- package/dist/{activation-B4adh0sA.js → activation-BxMZybuo.js} +2 -2
- package/dist/{activation-B4adh0sA.js.map → activation-BxMZybuo.js.map} +1 -1
- package/dist/agent.d.ts +2 -2
- package/dist/agent.js +3 -3
- package/dist/{analyst-loop-CSH7P-Bf.js → analyst-loop-BknOQUW5.js} +3 -3
- package/dist/{analyst-loop-CSH7P-Bf.js.map → analyst-loop-BknOQUW5.js.map} +1 -1
- package/dist/analyst-loop.d.ts +1 -1
- package/dist/analyst-loop.js +1 -1
- package/dist/{authored-code-DzYtiflw.js → authored-code-URmkdgjv.js} +2 -2
- package/dist/{authored-code-DzYtiflw.js.map → authored-code-URmkdgjv.js.map} +1 -1
- package/dist/{conversation-BXPWMOSd.js → conversation-BxJ0SIBM.js} +5 -5
- package/dist/{conversation-BXPWMOSd.js.map → conversation-BxJ0SIBM.js.map} +1 -1
- package/dist/conversation.d.ts +1 -1
- package/dist/conversation.js +1 -1
- package/dist/{coordination-driver-CuShDjRV.js → coordination-driver-zkCrfEbS.js} +6 -6
- package/dist/{coordination-driver-CuShDjRV.js.map → coordination-driver-zkCrfEbS.js.map} +1 -1
- package/dist/{delegate-CSFC-Kh3.js → delegate-D7sonS78.js} +3 -3
- package/dist/{delegate-CSFC-Kh3.js.map → delegate-D7sonS78.js.map} +1 -1
- package/dist/{delegation-status-BlsbSeOB.js → delegation-status-CF4D0NZ_.js} +2 -2
- package/dist/{delegation-status-BlsbSeOB.js.map → delegation-status-CF4D0NZ_.js.map} +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +3 -3
- package/dist/{environment-provider-Z1JazbJ1.js → environment-provider-1fKZh2zl.js} +4 -4
- package/dist/{environment-provider-Z1JazbJ1.js.map → environment-provider-1fKZh2zl.js.map} +1 -1
- package/dist/{environment-provider-adVa6X7a.d.ts → environment-provider-B-I2jlQy.d.ts} +3 -3
- package/dist/environment-provider.d.ts +1 -1
- package/dist/environment-provider.js +1 -1
- package/dist/{errors-CDZ8XsVj.js → errors-DodWX-cb.js} +9 -1
- package/dist/errors-DodWX-cb.js.map +1 -0
- package/dist/{graph-DqPUeri6.js → graph-BuS-NxXD.js} +30 -19
- package/dist/{graph-DqPUeri6.js.map → graph-BuS-NxXD.js.map} +1 -1
- package/dist/graph.d.ts +3 -3
- package/dist/graph.js +6 -6
- package/dist/{improve-7VTwse1c.d.ts → improve-DZs0KXhK.d.ts} +3 -3
- package/dist/{improvement-cycle-DEbciBTL.js → improvement-cycle-Tw5nYT5R.js} +8 -8
- package/dist/{improvement-cycle-DEbciBTL.js.map → improvement-cycle-Tw5nYT5R.js.map} +1 -1
- package/dist/{index-DNx0nWZH.d.ts → index-CYOJsxSg.d.ts} +17 -8
- package/dist/{index-DO6DHgRP.d.ts → index-D9mb6fn2.d.ts} +3 -3
- package/dist/{index-CVD30soi.d.ts → index-ZnxSe6iK.d.ts} +4 -4
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/intelligence.d.ts +6 -6
- package/dist/intelligence.js +4 -4
- package/dist/{jsonl-file-Bh1Q9nt0.js → jsonl-file-BEpaEYjT.js} +3 -3
- package/dist/{jsonl-file-Bh1Q9nt0.js.map → jsonl-file-BEpaEYjT.js.map} +1 -1
- package/dist/kernel.d.ts +6 -6
- package/dist/kernel.js +12 -12
- package/dist/{knowledge-B0Mrp-XB.js → knowledge-CPzT_Ve7.js} +4 -4
- package/dist/{knowledge-B0Mrp-XB.js.map → knowledge-CPzT_Ve7.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-b4585v9Z.d.ts → loop-runner-bin-DwrSB04m.d.ts} +3 -3
- package/dist/{loop-runner-bin-C5K46H0Q.js → loop-runner-bin-XKMc3Ld-.js} +5 -5
- package/dist/{loop-runner-bin-C5K46H0Q.js.map → loop-runner-bin-XKMc3Ld-.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/{materialization-vZssF9Nx.js → materialization-Cy0oM8tb.js} +2 -2
- package/dist/{materialization-vZssF9Nx.js.map → materialization-Cy0oM8tb.js.map} +1 -1
- package/dist/mcp/bin.js +4 -4
- package/dist/mcp/index.d.ts +6 -6
- package/dist/mcp/index.js +11 -11
- package/dist/mcp/memory-bin.js +1 -1
- package/dist/{memory-server-Crkevawz.js → memory-server-BR310Weg.js} +3 -3
- package/dist/{memory-server-Crkevawz.js.map → memory-server-BR310Weg.js.map} +1 -1
- package/dist/{model-policy-Wf2MxXJ9.js → model-policy-DKDyr-fc.js} +2 -2
- package/dist/{model-policy-Wf2MxXJ9.js.map → model-policy-DKDyr-fc.js.map} +1 -1
- package/dist/{openai-tools-BDwAdxk5.d.ts → openai-tools-CRQhVT_V.d.ts} +2 -2
- package/dist/{openai-tools-DmvmaG0a.js → openai-tools-DoQ32vpe.js} +2 -2
- package/dist/{openai-tools-DmvmaG0a.js.map → openai-tools-DoQ32vpe.js.map} +1 -1
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/profiles.d.ts +2 -2
- package/dist/profiles.js +2 -2
- package/dist/{provision-supervisor-chyz0_Aj.js → provision-supervisor-CpMMShE_.js} +7 -7
- package/dist/{provision-supervisor-chyz0_Aj.js.map → provision-supervisor-CpMMShE_.js.map} +1 -1
- package/dist/{redact-Dv6PeuQz.js → redact-Cbl2O-4N.js} +19 -24
- package/dist/redact-Cbl2O-4N.js.map +1 -0
- package/dist/{runtime-B8x43nGP.d.ts → runtime-0xNaV6TJ.d.ts} +9 -6
- package/dist/{runtime-BZryF6gD.js → runtime-DqRieJ6e.js} +16 -16
- package/dist/{runtime-BZryF6gD.js.map → runtime-DqRieJ6e.js.map} +1 -1
- package/dist/{sandbox-events-DWeQRWxg.js → sandbox-events-DbC2WKKS.js} +19 -16
- package/dist/sandbox-events-DbC2WKKS.js.map +1 -0
- package/dist/{server-BorSFmn8.js → server-BjB6ay4N.js} +6 -6
- package/dist/{server-BorSFmn8.js.map → server-BjB6ay4N.js.map} +1 -1
- package/dist/{stream-agent-turn-DOtEsvCV.js → stream-agent-turn-Dt5mZpc3.js} +6 -6
- package/dist/{stream-agent-turn-DOtEsvCV.js.map → stream-agent-turn-Dt5mZpc3.js.map} +1 -1
- package/dist/{stream-agent-turn-B-gtBlOy.d.ts → stream-agent-turn-urHpmO_Z.d.ts} +3 -3
- package/dist/{structural-rollout-pOqANr8Y.js → structural-rollout-DPbZWgEm.js} +5 -5
- package/dist/{structural-rollout-pOqANr8Y.js.map → structural-rollout-DPbZWgEm.js.map} +1 -1
- package/dist/{substrate-qLePHqvH.d.ts → substrate-B4iT90Zv.d.ts} +2 -2
- package/dist/{supervise-BReI5ATC.js → supervise-D9aNi8_f.js} +23 -9
- package/dist/supervise-D9aNi8_f.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/{tool-server-DEmLr9YY.js → tool-server-BJbCPhoW.js} +2 -2
- package/dist/{tool-server-DEmLr9YY.js.map → tool-server-BJbCPhoW.js.map} +1 -1
- package/dist/tui/index.d.ts +1 -1
- package/dist/tui/index.js +1 -1
- package/dist/{types-B_pNTBjK.d.ts → types-DFLZMaeh.d.ts} +2 -2
- package/dist/{types-BdolQ6Zi.d.ts → types-Q0PMagdm.d.ts} +3 -1
- package/package.json +1 -1
- package/dist/errors-CDZ8XsVj.js.map +0 -1
- package/dist/redact-Dv6PeuQz.js.map +0 -1
- package/dist/sandbox-events-DWeQRWxg.js.map +0 -1
- package/dist/supervise-BReI5ATC.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as SandboxClient, k as Validator } from "./types-
|
|
2
|
-
import { p as ExecutorFactory, z as Runtime } from "./types-
|
|
1
|
+
import { E as SandboxClient, k as Validator } from "./types-Q0PMagdm.js";
|
|
2
|
+
import { p as ExecutorFactory, z as Runtime } from "./types-DFLZMaeh.js";
|
|
3
3
|
import { AgentProfile, AgentProfileValidationResult } from "@tangle-network/agent-interface";
|
|
4
4
|
import { BackendType, CreateSandboxOptions, PromptOptions, Sandbox } from "@tangle-network/sandbox";
|
|
5
5
|
import { AgentEnvironment as AgentEnvironment$1, AgentEnvironmentCapabilities, AgentEnvironmentCapabilities as AgentEnvironmentCapabilities$1, AgentEnvironmentEvent, AgentEnvironmentEvent as AgentEnvironmentEvent$1, AgentEnvironmentProvider, AgentEnvironmentProvider as AgentEnvironmentProvider$1, AgentEnvironmentQuery, AgentEnvironmentStatus, AgentEnvironmentSummary, AgentProfileRef, AgentProfileRef as AgentProfileRef$1, AgentSession, AgentSessionRef, AgentSessionStatus as AgentSessionStatus$1, AgentTurnInput, AgentTurnInput as AgentTurnInput$1, AgentTurnResult as AgentTurnResult$1, CheckpointRef, CheckpointRequest, CreateAgentEnvironmentInput, CreateAgentEnvironmentInput as CreateAgentEnvironmentInput$1, ExecRequest, ExecResult, ForkRequest, PlacementInfo, ResourceRequest, WorkspaceRequest } from "@tangle-network/agent-interface/environment-provider";
|
|
@@ -140,4 +140,4 @@ interface ProviderExecutorOptions {
|
|
|
140
140
|
declare function providerAsExecutor(provider: AgentEnvironmentProvider, options?: ProviderExecutorOptions): ExecutorFactory<unknown>;
|
|
141
141
|
//#endregion
|
|
142
142
|
export { createAgentEnvironmentProviderRegistry as A, ProviderAsSandboxClientOptions as C, ResourceRequest as D, ProviderPromptOptions as E, CreateTangleSandboxExactProcessProviderOptions as F, SandboxControlClient as I, createTangleSandboxExactProcessProvider as L, providerAsSandboxClient as M, resolveAgentEnvironmentProvider as N, SandboxClientProviderOptions as O, sandboxClientAsProvider as P, PlacementInfo as S, ProviderLeafOut as T, CheckpointRequest as _, AgentEnvironmentProviderRef as a, ExecResult as b, AgentEnvironmentStatus as c, AgentSession as d, AgentSessionRef as f, CheckpointRef as g, AgentTurnResult$1 as h, AgentEnvironmentProvider$1 as i, providerAsExecutor as j, WorkspaceRequest as k, AgentEnvironmentSummary as l, AgentTurnInput$1 as m, AgentEnvironmentCapabilities$1 as n, AgentEnvironmentProviderRegistry as o, AgentSessionStatus$1 as p, AgentEnvironmentEvent$1 as r, AgentEnvironmentQuery as s, AgentEnvironment$1 as t, AgentProfileRef$1 as u, CreateAgentEnvironmentInput$1 as v, ProviderExecutorOptions as w, ForkRequest as x, ExecRequest as y };
|
|
143
|
-
//# sourceMappingURL=environment-provider-
|
|
143
|
+
//# sourceMappingURL=environment-provider-B-I2jlQy.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as createAgentEnvironmentProviderRegistry, C as ProviderAsSandboxClientOptions, D as ResourceRequest, E as ProviderPromptOptions, F as CreateTangleSandboxExactProcessProviderOptions, L as createTangleSandboxExactProcessProvider, M as providerAsSandboxClient, N as resolveAgentEnvironmentProvider, O as SandboxClientProviderOptions, P as sandboxClientAsProvider, S as PlacementInfo, T as ProviderLeafOut, _ as CheckpointRequest, a as AgentEnvironmentProviderRef, b as ExecResult, c as AgentEnvironmentStatus, d as AgentSession, f as AgentSessionRef, g as CheckpointRef, h as AgentTurnResult, i as AgentEnvironmentProvider, j as providerAsExecutor, k as WorkspaceRequest, l as AgentEnvironmentSummary, m as AgentTurnInput, n as AgentEnvironmentCapabilities, o as AgentEnvironmentProviderRegistry, p as AgentSessionStatus, r as AgentEnvironmentEvent, s as AgentEnvironmentQuery, t as AgentEnvironment, u as AgentProfileRef, v as CreateAgentEnvironmentInput, w as ProviderExecutorOptions, x as ForkRequest, y as ExecRequest } from "./environment-provider-
|
|
1
|
+
import { A as createAgentEnvironmentProviderRegistry, C as ProviderAsSandboxClientOptions, D as ResourceRequest, E as ProviderPromptOptions, F as CreateTangleSandboxExactProcessProviderOptions, L as createTangleSandboxExactProcessProvider, M as providerAsSandboxClient, N as resolveAgentEnvironmentProvider, O as SandboxClientProviderOptions, P as sandboxClientAsProvider, S as PlacementInfo, T as ProviderLeafOut, _ as CheckpointRequest, a as AgentEnvironmentProviderRef, b as ExecResult, c as AgentEnvironmentStatus, d as AgentSession, f as AgentSessionRef, g as CheckpointRef, h as AgentTurnResult, i as AgentEnvironmentProvider, j as providerAsExecutor, k as WorkspaceRequest, l as AgentEnvironmentSummary, m as AgentTurnInput, n as AgentEnvironmentCapabilities, o as AgentEnvironmentProviderRegistry, p as AgentSessionStatus, r as AgentEnvironmentEvent, s as AgentEnvironmentQuery, t as AgentEnvironment, u as AgentProfileRef, v as CreateAgentEnvironmentInput, w as ProviderExecutorOptions, x as ForkRequest, y as ExecRequest } from "./environment-provider-B-I2jlQy.js";
|
|
2
2
|
export { type AgentEnvironment, type AgentEnvironmentCapabilities, type AgentEnvironmentEvent, type AgentEnvironmentProvider, AgentEnvironmentProviderRef, AgentEnvironmentProviderRegistry, type AgentEnvironmentQuery, type AgentEnvironmentStatus, type AgentEnvironmentSummary, type AgentProfileRef, type AgentSession, type AgentSessionRef, type AgentSessionStatus, type AgentTurnInput, type AgentTurnResult, type CheckpointRef, type CheckpointRequest, type CreateAgentEnvironmentInput, type CreateTangleSandboxExactProcessProviderOptions, type ExecRequest, type ExecResult, type ForkRequest, type PlacementInfo, ProviderAsSandboxClientOptions, ProviderExecutorOptions, ProviderLeafOut, ProviderPromptOptions, type ResourceRequest, SandboxClientProviderOptions, type WorkspaceRequest, createAgentEnvironmentProviderRegistry, createTangleSandboxExactProcessProvider, providerAsExecutor, providerAsSandboxClient, resolveAgentEnvironmentProvider, sandboxClientAsProvider };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as sandboxClientAsProvider, i as resolveAgentEnvironmentProvider, n as providerAsExecutor, o as createTangleSandboxExactProcessProvider, r as providerAsSandboxClient, t as createAgentEnvironmentProviderRegistry } from "./environment-provider-
|
|
1
|
+
import { a as sandboxClientAsProvider, i as resolveAgentEnvironmentProvider, n as providerAsExecutor, o as createTangleSandboxExactProcessProvider, r as providerAsSandboxClient, t as createAgentEnvironmentProviderRegistry } from "./environment-provider-1fKZh2zl.js";
|
|
2
2
|
export { createAgentEnvironmentProviderRegistry, createTangleSandboxExactProcessProvider, providerAsExecutor, providerAsSandboxClient, resolveAgentEnvironmentProvider, sandboxClientAsProvider };
|
|
@@ -60,6 +60,13 @@ var BackendTransportError = class extends AgentEvalError {
|
|
|
60
60
|
*/
|
|
61
61
|
providerDispatch;
|
|
62
62
|
/**
|
|
63
|
+
* The upstream's own error class when it names one (the bridge's `parse_error`,
|
|
64
|
+
* `not_configured`, a provider's `invalid_request_error`). A class the upstream never
|
|
65
|
+
* retries is a decision about the request, so a retry policy may read it where no
|
|
66
|
+
* status arrived.
|
|
67
|
+
*/
|
|
68
|
+
upstreamCode;
|
|
69
|
+
/**
|
|
63
70
|
* Truncated upstream response body (≤2 KiB) when available. Diagnostic
|
|
64
71
|
* only — surfaces in `backend_error.error.body` and `final.error.body`
|
|
65
72
|
* so operators can see "free_tier_limit", "invalid_api_key", etc. without
|
|
@@ -70,6 +77,7 @@ var BackendTransportError = class extends AgentEvalError {
|
|
|
70
77
|
super("config", message, options);
|
|
71
78
|
this.backend = backend;
|
|
72
79
|
this.status = options?.status;
|
|
80
|
+
this.upstreamCode = options?.upstreamCode;
|
|
73
81
|
this.body = options?.body;
|
|
74
82
|
this.providerDispatch = options?.providerDispatch;
|
|
75
83
|
}
|
|
@@ -184,4 +192,4 @@ var RetainedRunDispatchBindingError = class extends AgentEvalError {
|
|
|
184
192
|
//#endregion
|
|
185
193
|
export { JudgeError as a, RetainedInteractiveAdmissionError as c, RetainedRunDispatchBindingError as d, RuntimeRunStateError as f, ConfigError as i, RetainedInteractiveBindingError as l, ValidationError as m, AnalystError as n, NotFoundError as o, SessionMismatchError as p, BackendTransportError as r, PlannerError as s, AgentEvalError$1 as t, RetainedRunAdmissionError as u };
|
|
186
194
|
|
|
187
|
-
//# sourceMappingURL=errors-
|
|
195
|
+
//# sourceMappingURL=errors-DodWX-cb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors-DodWX-cb.js","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n *\n * Error taxonomy for `@tangle-network/agent-runtime`.\n *\n * Public contract: every error this package throws as part of its consumer-\n * facing API either extends `AgentEvalError` (re-exported here for ergonomic\n * `instanceof` checks at the runtime boundary) or extends one of the\n * runtime-specific subclasses below.\n *\n * Internal invariant guards (`throw new Error('this should never happen')`)\n * remain plain `Error` — they are programmer-mistake assertions, not\n * consumer-catchable contract failures.\n *\n * Subclassing strategy: where a runtime-specific failure maps cleanly to an\n * agent-eval code (validation, config, not_found), we re-use the agent-eval\n * subclass. Runtime-only failure modes (session resume against the wrong\n * backend, backend transport errors) get fresh subclasses that still carry an\n * `AgentEvalErrorCode` so cross-package handlers can pattern-match without\n * importing the runtime.\n *\n * @stable\n */\n\nimport { AgentEvalError } from '@tangle-network/agent-eval'\nimport type {\n AgentInteractiveSessionRef,\n AgentInteractiveSessionStart,\n AgentInteractiveSessionStatus,\n} from '@tangle-network/agent-interface'\nimport type {\n RetainedInteractiveAdmission,\n RetainedRunAdmission,\n} from './runtime/retained-run-types'\n\nexport {\n AgentEvalError,\n type AgentEvalErrorCode,\n ConfigError,\n JudgeError,\n NotFoundError,\n ValidationError,\n} from '@tangle-network/agent-eval'\n\n/**\n *\n * Caller asked to resume a session against a backend whose `kind` does not\n * match the session's recorded backend. This is a routing bug — the same\n * session id was reused across two different backend implementations — and\n * is not retryable without picking the right backend.\n *\n * @stable\n */\nexport class SessionMismatchError extends AgentEvalError {\n readonly sessionBackend: string\n readonly requestedBackend: string\n\n constructor(sessionBackend: string, requestedBackend: string, options?: { cause?: unknown }) {\n super(\n 'validation',\n `Cannot resume ${sessionBackend} session with ${requestedBackend} backend`,\n options,\n )\n this.sessionBackend = sessionBackend\n this.requestedBackend = requestedBackend\n }\n}\n\n/**\n *\n * A backend transport call (HTTP, gRPC, sidecar IPC) failed with a non-success\n * status. Distinct from `JudgeError` (which is structural / unrecoverable)\n * because backend failures are sometimes retryable and consumers may want to\n * branch on the upstream status code.\n *\n * @stable\n */\nexport class BackendTransportError extends AgentEvalError {\n readonly backend: string\n readonly status?: number\n /**\n * Router-owned proof that a rejected request never reached a provider.\n *\n * This is intentionally one-sided. An absent value, or any value this\n * package does not understand, remains unknown to Runtime.\n */\n readonly providerDispatch?: 'not_started'\n /**\n * The upstream's own error class when it names one (the bridge's `parse_error`,\n * `not_configured`, a provider's `invalid_request_error`). A class the upstream never\n * retries is a decision about the request, so a retry policy may read it where no\n * status arrived.\n */\n readonly upstreamCode?: string\n /**\n * Truncated upstream response body (≤2 KiB) when available. Diagnostic\n * only — surfaces in `backend_error.error.body` and `final.error.body`\n * so operators can see \"free_tier_limit\", \"invalid_api_key\", etc. without\n * cracking the log line open.\n */\n readonly body?: string\n\n constructor(\n backend: string,\n message: string,\n options?: {\n cause?: unknown\n status?: number\n upstreamCode?: string\n body?: string\n providerDispatch?: 'not_started'\n },\n ) {\n super('config', message, options)\n this.backend = backend\n this.status = options?.status\n this.upstreamCode = options?.upstreamCode\n this.body = options?.body\n this.providerDispatch = options?.providerDispatch\n }\n}\n\n/**\n *\n * A runtime-run lifecycle method was called in an order the state machine does\n * not allow: `persist()` before `complete()`, `complete()` twice, etc.\n *\n * @stable\n */\nexport class RuntimeRunStateError extends AgentEvalError {\n constructor(message: string, options?: { cause?: unknown }) {\n super('validation', message, options)\n }\n}\n\n/**\n *\n * The dynamic-loop planner returned an unusable topology move — the LLM emitted\n * no parseable envelope, an unknown `kind`, or a structurally-invalid move\n * (e.g. a fanout with zero tasks). This is a structural failure of the\n * agent-authored topology, not a config mistake: the planner ran but its output\n * cannot drive the kernel. Carries `validation` so cross-package handlers can\n * pattern-match without importing the runtime. Fail loud — never substitute a\n * default move, or the loop silently runs a topology nobody chose.\n *\n * @stable\n */\nexport class PlannerError extends AgentEvalError {\n constructor(message: string, options?: { cause?: unknown }) {\n super('validation', message, options)\n }\n}\n\n/**\n * The analyst loop could not read or run over a round's trace — e.g. an empty round\n * (no iterations to analyze) or a malformed trace projection. Fail loud: a silent empty\n * store would mask a broken capture path and the driver would steer on nothing.\n */\nexport class AnalystError extends AgentEvalError {\n constructor(message: string, options?: { cause?: unknown }) {\n super('validation', message, options)\n }\n}\n\n/**\n *\n * The caller's `onAdmission` durability hook rejected, so a retained run's\n * admission record is not durable. For a pre-create intent, no provider work\n * has started. For a later record, provider state may already be live and the\n * environment remains available for recovery. Carries `capture_integrity`\n * because the required recovery record was not written.\n *\n * @stable\n */\nabstract class RetainedAdmissionError<\n TAdmission extends RetainedRunAdmission | RetainedInteractiveAdmission,\n> extends AgentEvalError {\n readonly phase: TAdmission['phase']\n /** The exact record the hook failed to persist, for direct recovery. */\n readonly admission: TAdmission\n\n constructor(admission: TAdmission, options?: { cause?: unknown }) {\n const recovery =\n admission.phase === 'intent' || admission.phase === 'interactive_intent'\n ? 'no provider work has started'\n : 'the environment is kept for recovery'\n super(\n 'capture_integrity',\n `retained run admission (${admission.phase}) was not persisted; ${recovery}`,\n options,\n )\n this.phase = admission.phase\n this.admission = admission\n }\n}\n\n/** The caller could not persist one detached-run recovery record. @stable */\nexport class RetainedRunAdmissionError extends RetainedAdmissionError<RetainedRunAdmission> {}\n\n/** The caller could not persist one exact interactive-process recovery record. @stable */\nexport class RetainedInteractiveAdmissionError extends RetainedAdmissionError<RetainedInteractiveAdmission> {}\n\n/**\n * A provider returned a valid interactive reference that does not bind to the\n * exact start request, or returned data that could not be parsed as one.\n *\n * The requested start and any valid provider reference are detached snapshots.\n * Malformed provider data is never copied into the error, so the error remains\n * safe to persist while the environment remains available for orphan cleanup.\n *\n * @stable\n */\nexport class RetainedInteractiveBindingError extends AgentEvalError {\n /** The exact native-process start request sent to the provider. */\n readonly requested: AgentInteractiveSessionStart\n /** The valid provider data, when the provider returned a parseable value. */\n readonly returned: {\n readonly ref?: AgentInteractiveSessionRef\n readonly status?: AgentInteractiveSessionStatus\n }\n\n constructor(\n requested: AgentInteractiveSessionStart,\n returned: RetainedInteractiveBindingError['returned'],\n options?: { cause?: unknown },\n ) {\n super(\n 'backend_integrity',\n 'provider returned interactive data that does not bind to the requested start; the environment is kept for diagnosis and cleanup',\n options,\n )\n this.requested = Object.freeze(requested)\n this.returned = Object.freeze(returned)\n }\n}\n\n/**\n *\n * A retained dispatch answered with coordinates that do not bind to the\n * identity the runtime requested, or failed exact verification. The\n * environment-phase admission is already durable at this point, so its\n * coordinates plus the provider reference carried here are the manual\n * recovery path. The environment is intentionally kept. Carries\n * `backend_integrity` because the provider violated its dispatch contract.\n *\n * @stable\n */\nexport class RetainedRunDispatchBindingError extends AgentEvalError {\n /** The coordinates the runtime sent with the dispatch. */\n readonly requested: {\n readonly provider: string\n readonly environmentId: string\n readonly sessionId: string\n readonly executionId: string\n }\n /** The loose reference the provider actually returned, for triage. */\n readonly returned: {\n readonly id?: string\n readonly provider?: string\n readonly controlRef?: unknown\n }\n\n constructor(\n requested: RetainedRunDispatchBindingError['requested'],\n returned: RetainedRunDispatchBindingError['returned'],\n options?: { cause?: unknown },\n ) {\n super(\n 'backend_integrity',\n 'retained dispatch did not bind to the requested identity; the durable environment admission and the returned reference on this error are the recovery path',\n options,\n )\n this.requested = requested\n this.returned = returned\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,IAAa,uBAAb,cAA0C,eAAe;CACvD;CACA;CAEA,YAAY,gBAAwB,kBAA0B,SAA+B;EAC3F,MACE,cACA,iBAAiB,eAAe,gBAAgB,iBAAiB,WACjE,OACF;EACA,KAAK,iBAAiB;EACtB,KAAK,mBAAmB;CAC1B;AACF;;;;;;;;;;AAWA,IAAa,wBAAb,cAA2C,eAAe;CACxD;CACA;;;;;;;CAOA;;;;;;;CAOA;;;;;;;CAOA;CAEA,YACE,SACA,SACA,SAOA;EACA,MAAM,UAAU,SAAS,OAAO;EAChC,KAAK,UAAU;EACf,KAAK,SAAS,SAAS;EACvB,KAAK,eAAe,SAAS;EAC7B,KAAK,OAAO,SAAS;EACrB,KAAK,mBAAmB,SAAS;CACnC;AACF;;;;;;;;AASA,IAAa,uBAAb,cAA0C,eAAe;CACvD,YAAY,SAAiB,SAA+B;EAC1D,MAAM,cAAc,SAAS,OAAO;CACtC;AACF;;;;;;;;;;;;;AAcA,IAAa,eAAb,cAAkC,eAAe;CAC/C,YAAY,SAAiB,SAA+B;EAC1D,MAAM,cAAc,SAAS,OAAO;CACtC;AACF;;;;;;AAOA,IAAa,eAAb,cAAkC,eAAe;CAC/C,YAAY,SAAiB,SAA+B;EAC1D,MAAM,cAAc,SAAS,OAAO;CACtC;AACF;;;;;;;;;;;AAYA,IAAe,yBAAf,cAEU,eAAe;CACvB;;CAEA;CAEA,YAAY,WAAuB,SAA+B;EAChE,MAAM,WACJ,UAAU,UAAU,YAAY,UAAU,UAAU,uBAChD,iCACA;EACN,MACE,qBACA,2BAA2B,UAAU,MAAM,uBAAuB,YAClE,OACF;EACA,KAAK,QAAQ,UAAU;EACvB,KAAK,YAAY;CACnB;AACF;;AAGA,IAAa,4BAAb,cAA+C,uBAA6C,CAAC;;AAG7F,IAAa,oCAAb,cAAuD,uBAAqD,CAAC;;;;;;;;;;;AAY7G,IAAa,kCAAb,cAAqD,eAAe;;CAElE;;CAEA;CAKA,YACE,WACA,UACA,SACA;EACA,MACE,qBACA,mIACA,OACF;EACA,KAAK,YAAY,OAAO,OAAO,SAAS;EACxC,KAAK,WAAW,OAAO,OAAO,QAAQ;CACxC;AACF;;;;;;;;;;;;AAaA,IAAa,kCAAb,cAAqD,eAAe;;CAElE;;CAOA;CAMA,YACE,WACA,UACA,SACA;EACA,MACE,qBACA,8JACA,OACF;EACA,KAAK,YAAY;EACjB,KAAK,WAAW;CAClB;AACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as ConfigError, m as ValidationError } from "./errors-
|
|
2
|
-
import { f as harnessRunsAgent } from "./model-policy-
|
|
3
|
-
import { Ht as InMemorySpawnJournal, Vt as InMemoryResultBlobStore } from "./redact-
|
|
1
|
+
import { i as ConfigError, m as ValidationError } from "./errors-DodWX-cb.js";
|
|
2
|
+
import { f as harnessRunsAgent } from "./model-policy-DKDyr-fc.js";
|
|
3
|
+
import { Ht as InMemorySpawnJournal, Vt as InMemoryResultBlobStore } from "./redact-Cbl2O-4N.js";
|
|
4
4
|
import { t as composeRuntimeHooks } from "./runtime-hooks-tXpAarhW.js";
|
|
5
|
-
import { n as supervise, r as superviseWithTestBrain, u as coordinationProfileToolPrefix } from "./supervise-
|
|
5
|
+
import { n as supervise, r as superviseWithTestBrain, u as coordinationProfileToolPrefix } from "./supervise-D9aNi8_f.js";
|
|
6
6
|
import { agentProfileSchema, canonicalCandidateDigest } from "@tangle-network/agent-interface";
|
|
7
7
|
//#region src/runtime/supervise/prompt-registry.ts
|
|
8
8
|
/**
|
|
@@ -476,6 +476,10 @@ function superviseAgentGraph(graph, opts, brain) {
|
|
|
476
476
|
const ledger = [];
|
|
477
477
|
const journaled = /* @__PURE__ */ new Set();
|
|
478
478
|
const traversalCounts = /* @__PURE__ */ new Map();
|
|
479
|
+
const capSpend = /* @__PURE__ */ new Map();
|
|
480
|
+
const spend = (edge) => {
|
|
481
|
+
capSpend.set(edge, (capSpend.get(edge) ?? 0) + 1);
|
|
482
|
+
};
|
|
479
483
|
const exhausted = /* @__PURE__ */ new Set();
|
|
480
484
|
const exhaustedDelegates = /* @__PURE__ */ new Set();
|
|
481
485
|
const journalWrites = [];
|
|
@@ -503,7 +507,17 @@ function superviseAgentGraph(graph, opts, brain) {
|
|
|
503
507
|
journalWrites.push(write);
|
|
504
508
|
return write;
|
|
505
509
|
};
|
|
506
|
-
const
|
|
510
|
+
const settleUnbound = (pending) => {
|
|
511
|
+
const refused = {
|
|
512
|
+
...pending,
|
|
513
|
+
outcome: "unpropagated",
|
|
514
|
+
bytes: 0,
|
|
515
|
+
reason: `no-live-worker-bound (spawn refused after the factory, or a keyed re-spawn deduplicated to a completed result; ${pending.bytes} composed bytes never crossed)`
|
|
516
|
+
};
|
|
517
|
+
ledger[ledger.indexOf(pending)] = refused;
|
|
518
|
+
return appendJournal(refused, `graph:${refused.to}`);
|
|
519
|
+
};
|
|
520
|
+
const record = (entry, final) => {
|
|
507
521
|
const count = (traversalCounts.get(entry.edge) ?? 0) + 1;
|
|
508
522
|
traversalCounts.set(entry.edge, count);
|
|
509
523
|
const row = {
|
|
@@ -511,7 +525,10 @@ function superviseAgentGraph(graph, opts, brain) {
|
|
|
511
525
|
traversal: count
|
|
512
526
|
};
|
|
513
527
|
ledger.push(row);
|
|
514
|
-
if (
|
|
528
|
+
if (final) {
|
|
529
|
+
spend(row.edge);
|
|
530
|
+
appendJournal(row, row.workerId ?? `graph:${row.to}`);
|
|
531
|
+
}
|
|
515
532
|
return row;
|
|
516
533
|
};
|
|
517
534
|
const nodeByWorkerId = /* @__PURE__ */ new Map();
|
|
@@ -528,7 +545,7 @@ function superviseAgentGraph(graph, opts, brain) {
|
|
|
528
545
|
const edge = delegatesByWorker.get(node.id);
|
|
529
546
|
const id = edgeId(edge);
|
|
530
547
|
const cap = edge.maxTraversals ?? 32;
|
|
531
|
-
const used =
|
|
548
|
+
const used = capSpend.get(id) ?? 0;
|
|
532
549
|
const spawnContinuity = input.continuity ?? "fresh";
|
|
533
550
|
if (used >= cap) {
|
|
534
551
|
exhausted.add(id);
|
|
@@ -560,6 +577,8 @@ function superviseAgentGraph(graph, opts, brain) {
|
|
|
560
577
|
bytes,
|
|
561
578
|
...bytes === 0 ? { reason: "no directive text and no task payload" } : {}
|
|
562
579
|
}, false);
|
|
580
|
+
const stale = pendingByAssignment.get(input.assignmentId);
|
|
581
|
+
if (stale !== void 0) settleUnbound(stale);
|
|
563
582
|
pendingByAssignment.set(input.assignmentId, row);
|
|
564
583
|
return directiveText.length === 0 ? node.profile : {
|
|
565
584
|
...node.profile,
|
|
@@ -635,7 +654,7 @@ function superviseAgentGraph(graph, opts, brain) {
|
|
|
635
654
|
for (const edge of analyzes) (edge.to === root.id ? driverAnalyzesByAnalyst : routedAnalyzesByAnalyst).set(edge.analyst, edge);
|
|
636
655
|
const analyzesCapReached = (edge) => {
|
|
637
656
|
const cap = edge.maxTraversals ?? 32;
|
|
638
|
-
if ((
|
|
657
|
+
if ((capSpend.get(edgeId(edge)) ?? 0) < cap) return false;
|
|
639
658
|
exhausted.add(edgeId(edge));
|
|
640
659
|
return true;
|
|
641
660
|
};
|
|
@@ -707,6 +726,7 @@ function superviseAgentGraph(graph, opts, brain) {
|
|
|
707
726
|
};
|
|
708
727
|
ledger[ledger.indexOf(pending)] = bound;
|
|
709
728
|
nodeByWorkerId.set(payload.childId, bound.to);
|
|
729
|
+
spend(bound.edge);
|
|
710
730
|
return appendJournal(bound, payload.childId);
|
|
711
731
|
} }, opts.hooks);
|
|
712
732
|
const start = async () => {
|
|
@@ -734,16 +754,7 @@ function superviseAgentGraph(graph, opts, brain) {
|
|
|
734
754
|
...superviseOptions,
|
|
735
755
|
brain
|
|
736
756
|
});
|
|
737
|
-
for (const pending of pendingByAssignment.values())
|
|
738
|
-
const refused = {
|
|
739
|
-
...pending,
|
|
740
|
-
outcome: "unpropagated",
|
|
741
|
-
bytes: 0,
|
|
742
|
-
reason: `no-live-worker-bound (spawn refused after the factory, or a keyed re-spawn deduplicated to a completed result; ${pending.bytes} composed bytes never crossed)`
|
|
743
|
-
};
|
|
744
|
-
ledger[ledger.indexOf(pending)] = refused;
|
|
745
|
-
await appendJournal(refused, `graph:${refused.to}`);
|
|
746
|
-
}
|
|
757
|
+
for (const pending of pendingByAssignment.values()) await settleUnbound(pending);
|
|
747
758
|
pendingByAssignment.clear();
|
|
748
759
|
await Promise.all(journalWrites);
|
|
749
760
|
const exhaustedEdges = Object.freeze([...exhausted]);
|
|
@@ -767,4 +778,4 @@ function graphTask(graph, root) {
|
|
|
767
778
|
//#endregion
|
|
768
779
|
export { analyzesFindingsReportPrompt as a, dumbContinuationFailPrompt as c, kernelPromptRegistry as d, naiveContinuationPrompt as f, runGraphWithTestBrain as i, dumbContinuationPassPrompt as l, defaultEdgeTraversalCap as n, createPromptRegistry as o, promptHandle as p, runGraph as r, delegatesWorkerBriefPrompt as s, GraphEdgeCapError as t, formatPromptHandle as u };
|
|
769
780
|
|
|
770
|
-
//# sourceMappingURL=graph-
|
|
781
|
+
//# sourceMappingURL=graph-BuS-NxXD.js.map
|