@tangle-network/agent-runtime 0.162.0 → 0.163.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/agent.d.ts +1 -1
- package/dist/conversation.d.ts +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/{environment-provider-Bk8rg4gs.d.ts → environment-provider-BXFFK_rZ.d.ts} +2 -2
- package/dist/environment-provider.d.ts +1 -1
- package/dist/graph.d.ts +230 -4
- package/dist/graph.js +872 -49
- package/dist/graph.js.map +1 -1
- package/dist/{index-8b0o4dMF.d.ts → index-CbyKCjR7.d.ts} +5 -5
- package/dist/{index-4mRXbu_V.d.ts → index-CykKDPnB.d.ts} +4 -4
- package/dist/{index-CTQ97IMO.d.ts → index-OFOvnNc2.d.ts} +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/intelligence.d.ts +4 -4
- package/dist/kernel.d.ts +5 -5
- package/dist/knowledge.d.ts +1 -1
- package/dist/{loop-runner-bin-DHU5kmJW.d.ts → loop-runner-bin-DrN092ew.d.ts} +3 -3
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/mcp/index.d.ts +3 -3
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{redact-BUIB5IWj.d.ts → redact-DL_ZtFvR.d.ts} +3 -3
- package/dist/{runtime-B0FIFwpH.d.ts → runtime-CCbeY1KO.d.ts} +3 -3
- package/dist/{stream-agent-turn-BEhmmYmL.d.ts → stream-agent-turn-Dx2YrEWW.d.ts} +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +8 -8
- package/dist/{types-DXKDG6DQ.d.ts → types-C2l1jaos.d.ts} +7 -4
- package/package.json +1 -1
package/dist/agent.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as SandboxClient, at as RuntimeStreamEvent, t as AgentRunSpec, w as OutputAdapter } from "./types-DpdfZoQ3.js";
|
|
2
2
|
import { a as createSurfaceImprovementProposer, c as SurfaceValidationIssue, d as validateSurfaces, i as SurfaceImprovementEdit, l as renderSurfaceIssues, n as DraftPatchInput, o as AgentSurfaces, r as DraftPatchOutput, s as ResolvedSurface, t as CreateSurfaceImprovementProposerOptions, u as resolveSubjectPath } from "./improvement-adapter-D5gwwoXQ.js";
|
|
3
|
-
import { Sp as worktreeCliProfileMaterialization, _p as promptOnlyProfileMaterialization, ap as DefineProfileMaterializationContractOptions, bp as sandboxActProfileMaterialization, cp as ProfileMaterializationIssue, dp as controlProfileMaterialization, fp as defineProfileMaterializationContract, gp as promptModelProfileMaterialization, hp as promptControlProfileMaterialization, ip as CanonicalAgentProfileMaterializationAxis, lp as ValidateProfileMaterializationOptions, mp as profileMaterializationAxes, np as AgentProfileMaterializationAxis, op as KnownAgentProfileMaterializationAxis, pp as fullProfileMaterialization, rp as AssertProfileMaterializationOptions, sp as ProfileMaterializationContract, tp as AGENT_PROFILE_MATERIALIZATION_AXES, up as assertProfileMaterialization, vp as promptResourceProfileMaterialization, xp as validateProfileMaterialization, yp as renderProfileMaterializationIssues } from "./index-
|
|
3
|
+
import { Sp as worktreeCliProfileMaterialization, _p as promptOnlyProfileMaterialization, ap as DefineProfileMaterializationContractOptions, bp as sandboxActProfileMaterialization, cp as ProfileMaterializationIssue, dp as controlProfileMaterialization, fp as defineProfileMaterializationContract, gp as promptModelProfileMaterialization, hp as promptControlProfileMaterialization, ip as CanonicalAgentProfileMaterializationAxis, lp as ValidateProfileMaterializationOptions, mp as profileMaterializationAxes, np as AgentProfileMaterializationAxis, op as KnownAgentProfileMaterializationAxis, pp as fullProfileMaterialization, rp as AssertProfileMaterializationOptions, sp as ProfileMaterializationContract, tp as AGENT_PROFILE_MATERIALIZATION_AXES, up as assertProfileMaterialization, vp as promptResourceProfileMaterialization, xp as validateProfileMaterialization, yp as renderProfileMaterializationIssues } from "./index-CbyKCjR7.js";
|
|
4
4
|
import { AgentProfile, AgentProfileFileMount, AgentProfileMcpServer } from "@tangle-network/agent-interface";
|
|
5
5
|
import { TraceAnalystDefinition } from "@tangle-network/agent-eval";
|
|
6
6
|
import { SandboxEvent } from "@tangle-network/sandbox";
|
package/dist/conversation.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as sleep, A as RunConversationOptions, B as buildForwardHeaders, C as ConversationResult, D as HaltPredicate, E as HaltContext, F as InMemoryConversationJournal, G as CircuitBreakerState, H as readDepth, I as DEFAULT_MAX_DEPTH, J as RetryBackoff, K as CircuitOpenError, L as FORWARD_HEADERS, M as ConversationJournal, N as ConversationJournalEntry, O as HaltReason, P as FileConversationJournal, Q as makePerAttemptSignal, R as ForwardHeaderName, S as ConversationPolicy, T as ConversationTurn, U as BackendCallPolicy, V as isDepthExceeded, W as CircuitBreakerConfig, X as computeBackoff, Y as RetryableErrorPredicate, Z as defaultIsRetryable, _ as createConversationBackend, a as RunPersonaConfig, b as ConversationDriveState, c as runPersonaDispatch, d as D1DatabaseLike, et as createProfileExecutionBackend, f as D1StmtLike, g as defineConversation, h as d1ToSqlAdapter, i as PersonaDriver, j as TurnOrder, k as HaltSignal, l as runConversation, m as SqlConversationJournal, n as turnId, o as RunPersonaConversationOptions, p as SqlAdapter, q as DeadlineExceededError, r as PersonaConversationResult, s as runPersonaConversation, t as slugifySpeaker, u as runConversationStream, v as AuthSource, w as ConversationStreamEvent, x as ConversationParticipant, y as Conversation, z as PropagatedHeaders } from "./index-
|
|
1
|
+
import { $ as sleep, A as RunConversationOptions, B as buildForwardHeaders, C as ConversationResult, D as HaltPredicate, E as HaltContext, F as InMemoryConversationJournal, G as CircuitBreakerState, H as readDepth, I as DEFAULT_MAX_DEPTH, J as RetryBackoff, K as CircuitOpenError, L as FORWARD_HEADERS, M as ConversationJournal, N as ConversationJournalEntry, O as HaltReason, P as FileConversationJournal, Q as makePerAttemptSignal, R as ForwardHeaderName, S as ConversationPolicy, T as ConversationTurn, U as BackendCallPolicy, V as isDepthExceeded, W as CircuitBreakerConfig, X as computeBackoff, Y as RetryableErrorPredicate, Z as defaultIsRetryable, _ as createConversationBackend, a as RunPersonaConfig, b as ConversationDriveState, c as runPersonaDispatch, d as D1DatabaseLike, et as createProfileExecutionBackend, f as D1StmtLike, g as defineConversation, h as d1ToSqlAdapter, i as PersonaDriver, j as TurnOrder, k as HaltSignal, l as runConversation, m as SqlConversationJournal, n as turnId, o as RunPersonaConversationOptions, p as SqlAdapter, q as DeadlineExceededError, r as PersonaConversationResult, s as runPersonaConversation, t as slugifySpeaker, u as runConversationStream, v as AuthSource, w as ConversationStreamEvent, x as ConversationParticipant, y as Conversation, z as PropagatedHeaders } from "./index-OFOvnNc2.js";
|
|
2
2
|
export { type AuthSource, type BackendCallPolicy, type CircuitBreakerConfig, CircuitBreakerState, CircuitOpenError, type Conversation, type ConversationDriveState, type ConversationJournal, type ConversationJournalEntry, type ConversationParticipant, type ConversationPolicy, type ConversationResult, type ConversationStreamEvent, type ConversationTurn, type D1DatabaseLike, type D1StmtLike, DEFAULT_MAX_DEPTH, DeadlineExceededError, FORWARD_HEADERS, FileConversationJournal, type ForwardHeaderName, type HaltContext, type HaltPredicate, type HaltReason, type HaltSignal, InMemoryConversationJournal, type PersonaConversationResult, type PersonaDriver, type PropagatedHeaders, type RetryBackoff, type RetryableErrorPredicate, type RunConversationOptions, type RunPersonaConfig, type RunPersonaConversationOptions, type SqlAdapter, SqlConversationJournal, type TurnOrder, buildForwardHeaders, computeBackoff, createConversationBackend, createProfileExecutionBackend, d1ToSqlAdapter, defaultIsRetryable, defineConversation, isDepthExceeded, makePerAttemptSignal, readDepth, runConversation, runConversationStream, runPersonaConversation, runPersonaDispatch, sleep, slugifySpeaker, turnId };
|
package/dist/durable.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ao as SuperviseOptions, lo as supervise, wo as SupervisorProfile } from "./index-
|
|
1
|
+
import { ao as SuperviseOptions, lo as supervise, wo as SupervisorProfile } from "./index-CbyKCjR7.js";
|
|
2
2
|
import { l as RuntimeHooks, o as RuntimeHookEvent, r as RuntimeDecisionPoint } from "./runtime-hooks-Bj6wJHlH.js";
|
|
3
|
-
import { A as ProviderModelExecutionEvidence, J as SpendGap, K as Spend, O as ProfileMaterializationReceipt, T as NodeId, o as ExecutionBindingReceipt, st as WorkerTraceEvidence } from "./types-
|
|
3
|
+
import { A as ProviderModelExecutionEvidence, J as SpendGap, K as Spend, O as ProfileMaterializationReceipt, T as NodeId, o as ExecutionBindingReceipt, st as WorkerTraceEvidence } from "./types-C2l1jaos.js";
|
|
4
4
|
//#region src/durable/chat-engine.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* `handleChatTurn` is a framework-neutral chat-turn HTTP orchestrator.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { E as SandboxClient } from "./types-DpdfZoQ3.js";
|
|
2
|
-
import { R as Runtime, p as ExecutorFactory } from "./types-
|
|
2
|
+
import { R as Runtime, p as ExecutorFactory } from "./types-C2l1jaos.js";
|
|
3
3
|
import { AgentProfile, AgentProfileValidationResult } from "@tangle-network/agent-interface";
|
|
4
4
|
import { BackendType, CreateSandboxOptions, Sandbox } from "@tangle-network/sandbox";
|
|
5
5
|
import { AgentEnvironment as AgentEnvironment$1, AgentEnvironmentCapabilities, AgentEnvironmentCapabilities as AgentEnvironmentCapabilities$1, AgentEnvironmentEvent, 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";
|
|
@@ -83,4 +83,4 @@ interface ProviderExecutorOptions {
|
|
|
83
83
|
declare function providerAsExecutor(provider: AgentEnvironmentProvider, options?: ProviderExecutorOptions): ExecutorFactory<unknown>;
|
|
84
84
|
//#endregion
|
|
85
85
|
export { providerAsSandboxClient as A, ProviderAsSandboxClientOptions as C, WorkspaceRequest as D, SandboxClientProviderOptions as E, createTangleSandboxExactProcessProvider as F, sandboxClientAsProvider as M, CreateTangleSandboxExactProcessProviderOptions as N, createAgentEnvironmentProviderRegistry as O, SandboxControlClient as P, PlacementInfo as S, ResourceRequest 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, resolveAgentEnvironmentProvider as j, providerAsExecutor as k, AgentEnvironmentSummary as l, AgentTurnInput$1 as m, AgentEnvironmentCapabilities$1 as n, AgentEnvironmentProviderRegistry as o, AgentSessionStatus$1 as p, AgentEnvironmentEvent 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 };
|
|
86
|
-
//# sourceMappingURL=environment-provider-
|
|
86
|
+
//# sourceMappingURL=environment-provider-BXFFK_rZ.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as providerAsSandboxClient, C as ProviderAsSandboxClientOptions, D as WorkspaceRequest, E as SandboxClientProviderOptions, F as createTangleSandboxExactProcessProvider, M as sandboxClientAsProvider, N as CreateTangleSandboxExactProcessProviderOptions, O as createAgentEnvironmentProviderRegistry, S as PlacementInfo, T as ResourceRequest, _ 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 resolveAgentEnvironmentProvider, k as providerAsExecutor, 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 providerAsSandboxClient, C as ProviderAsSandboxClientOptions, D as WorkspaceRequest, E as SandboxClientProviderOptions, F as createTangleSandboxExactProcessProvider, M as sandboxClientAsProvider, N as CreateTangleSandboxExactProcessProviderOptions, O as createAgentEnvironmentProviderRegistry, S as PlacementInfo, T as ResourceRequest, _ 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 resolveAgentEnvironmentProvider, k as providerAsExecutor, 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-BXFFK_rZ.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, type ResourceRequest, SandboxClientProviderOptions, type WorkspaceRequest, createAgentEnvironmentProviderRegistry, createTangleSandboxExactProcessProvider, providerAsExecutor, providerAsSandboxClient, resolveAgentEnvironmentProvider, sandboxClientAsProvider };
|
package/dist/graph.d.ts
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
|
-
import { $l as MakeWorkerAgent, If as DeliverableSpec, bo as SupervisorAgentDeps, mu as WorkerSpawnContext } from "./index-
|
|
2
|
-
import { K as Spend, t as Agent } from "./types-
|
|
3
|
-
import { o as ExecutorConfig } from "./runtime-
|
|
1
|
+
import { $l as MakeWorkerAgent, If as DeliverableSpec, an as PromptRegistry, bo as SupervisorAgentDeps, in as PromptHandle, mu as WorkerSpawnContext, os as SupervisorFinalizer } from "./index-CbyKCjR7.js";
|
|
2
|
+
import { H as SpawnJournal, K as Spend, i as Budget, j as ResultBlobStore, t as Agent } from "./types-C2l1jaos.js";
|
|
3
|
+
import { o as ExecutorConfig } from "./runtime-CCbeY1KO.js";
|
|
4
4
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
5
|
+
//#region src/runtime/graph/condition.d.ts
|
|
6
|
+
/** The leaf comparison operators; `exists`/`truthy` are unary, the rest compare against `value`. */
|
|
7
|
+
declare const CONDITION_OPS: readonly ["eq", "neq", "gt", "gte", "lt", "lte", "in", "contains", "exists", "truthy"];
|
|
8
|
+
type ConditionOp = (typeof CONDITION_OPS)[number];
|
|
9
|
+
interface ConditionLeaf {
|
|
10
|
+
/** Dotted path with `[N]` indexing into the guard context, e.g. `out.findings[0].severity`. */
|
|
11
|
+
readonly path: string;
|
|
12
|
+
readonly op: ConditionOp;
|
|
13
|
+
readonly value?: unknown;
|
|
14
|
+
}
|
|
15
|
+
type Condition = ConditionLeaf | {
|
|
16
|
+
readonly all: ReadonlyArray<Condition>;
|
|
17
|
+
} | {
|
|
18
|
+
readonly any: ReadonlyArray<Condition>;
|
|
19
|
+
} | {
|
|
20
|
+
readonly not: Condition;
|
|
21
|
+
};
|
|
22
|
+
/** Validate shape, bounds, and per-leaf path/operator rules; returns the input for chaining. */
|
|
23
|
+
declare function validateCondition(raw: unknown, context: string): Condition;
|
|
24
|
+
/** Walk a validated condition over a context to a boolean. Never throws on data shape. */
|
|
25
|
+
declare function evaluateCondition(condition: Condition, context: unknown): boolean;
|
|
26
|
+
//#endregion
|
|
5
27
|
//#region src/runtime/graph/registry.d.ts
|
|
6
28
|
/**
|
|
7
29
|
* `Registry<T>` — the ONE name→thing shape for the graph engine.
|
|
@@ -148,6 +170,97 @@ declare function kindHandle(kind: Pick<NodeKind, 'id' | 'version'>): RegistryHan
|
|
|
148
170
|
*/
|
|
149
171
|
declare function narrowEffects<Effects extends ReadonlyArray<EffectName>>(declared: Effects, provided: Readonly<Record<string, unknown>>, context: string): EffectContext<Effects>;
|
|
150
172
|
//#endregion
|
|
173
|
+
//#region src/runtime/graph/projection.d.ts
|
|
174
|
+
type Projection = {
|
|
175
|
+
readonly path: string;
|
|
176
|
+
} | {
|
|
177
|
+
readonly pick: ReadonlyArray<string>;
|
|
178
|
+
} | {
|
|
179
|
+
readonly map: string;
|
|
180
|
+
} | {
|
|
181
|
+
readonly filter: Condition;
|
|
182
|
+
} | {
|
|
183
|
+
readonly first: true;
|
|
184
|
+
} | {
|
|
185
|
+
readonly last: true;
|
|
186
|
+
} | {
|
|
187
|
+
readonly count: true;
|
|
188
|
+
};
|
|
189
|
+
/** Validate a projection: exactly one known operator, its argument well-formed. */
|
|
190
|
+
declare function validateProjection(raw: unknown, context: string): Projection;
|
|
191
|
+
/**
|
|
192
|
+
* Apply a validated projection to an admitted payload. Collection operators over a non-array
|
|
193
|
+
* refuse by name — a shape the author did not expect is a graph defect, not an empty result.
|
|
194
|
+
*/
|
|
195
|
+
declare function applyProjection(value: unknown, projection: Projection, context: string): unknown;
|
|
196
|
+
//#endregion
|
|
197
|
+
//#region src/runtime/graph/definition.d.ts
|
|
198
|
+
/** Which gating-edge outcomes release a node (adopted from ADC, agent-runtime#968). */
|
|
199
|
+
declare const JOIN_RULES: readonly ["all", "any", "any_failed", "all_done"];
|
|
200
|
+
type JoinRule = (typeof JOIN_RULES)[number];
|
|
201
|
+
/** ADC-compatible visit backstop: nothing may be ENTERED more than this many times. */
|
|
202
|
+
declare const DEFAULT_MAX_NODE_VISITS = 25;
|
|
203
|
+
/** The hard ceiling an author's `maxVisits`/`maxNodeVisits` override may reach. */
|
|
204
|
+
declare const MAX_MAX_NODE_VISITS = 100;
|
|
205
|
+
type GraphEdgeKind = 'delegates' | 'analyzes' | 'data';
|
|
206
|
+
interface EngineGraphNode {
|
|
207
|
+
readonly id: string;
|
|
208
|
+
/** `<id>/v<n>` into the engine's kind registry. */
|
|
209
|
+
readonly kind: string;
|
|
210
|
+
/** This node's config, validated by its kind's `validateConfig` at compile. */
|
|
211
|
+
readonly config?: unknown;
|
|
212
|
+
/** Per-node flags — properties of the node, never of its kind (agent-runtime#970). */
|
|
213
|
+
readonly flags?: NodeFlags;
|
|
214
|
+
/** Node-level port declarations, merged OVER the kind's. A kind whose surface depends on its
|
|
215
|
+
* config (a script) declares ports here; a typed kind's declared ports stay authoritative. */
|
|
216
|
+
readonly ports?: {
|
|
217
|
+
readonly inputs?: ReadonlyArray<PortSpec>;
|
|
218
|
+
readonly outputs?: ReadonlyArray<PortSpec>;
|
|
219
|
+
};
|
|
220
|
+
/** Which inbound gating-edge outcomes release this node. Default `all`. */
|
|
221
|
+
readonly join?: JoinRule;
|
|
222
|
+
/** Entered more than this many times fails the run `cycle-budget-exceeded`. */
|
|
223
|
+
readonly maxVisits?: number;
|
|
224
|
+
/** This node's completion check; a terminal without one (or a kind/graph default) refuses. */
|
|
225
|
+
readonly deliverable?: DeliverableSpec<unknown>;
|
|
226
|
+
/** Force-mark a terminal. Absent, a node with no outbound gating edge is terminal. */
|
|
227
|
+
readonly terminal?: boolean;
|
|
228
|
+
/** Profile fields merged over the engine-authored `{ name: id }` for this node's spawns. */
|
|
229
|
+
readonly profile?: Readonly<Partial<AgentProfile>>;
|
|
230
|
+
/** Per-instance reservation for this node's spawns; falls back to the run's `perNode`. */
|
|
231
|
+
readonly budget?: Budget;
|
|
232
|
+
}
|
|
233
|
+
interface EngineGraphEdge {
|
|
234
|
+
/** Stable id for the ledger; defaults to `<from>-><to>#<ordinal>`. */
|
|
235
|
+
readonly id?: string;
|
|
236
|
+
readonly kind: GraphEdgeKind;
|
|
237
|
+
readonly from: {
|
|
238
|
+
readonly node: string;
|
|
239
|
+
readonly port?: string;
|
|
240
|
+
};
|
|
241
|
+
readonly to: {
|
|
242
|
+
readonly node: string;
|
|
243
|
+
readonly port?: string;
|
|
244
|
+
};
|
|
245
|
+
/** Evaluated over the source's settle context; absent = satisfied by completion. */
|
|
246
|
+
readonly guard?: Condition;
|
|
247
|
+
/** `data` edges only: ONE pure reshape of the admitted payload. */
|
|
248
|
+
readonly projection?: Projection;
|
|
249
|
+
/** Refuses the traversal past this many firings (ledgered `unpropagated`). */
|
|
250
|
+
readonly maxTraversals?: number;
|
|
251
|
+
/** `delegates`/`analyzes`: the versioned directive appended to the target's task. */
|
|
252
|
+
readonly directive?: PromptHandle;
|
|
253
|
+
}
|
|
254
|
+
interface EngineGraphSpec {
|
|
255
|
+
readonly nodes: ReadonlyArray<EngineGraphNode>;
|
|
256
|
+
readonly edges: ReadonlyArray<EngineGraphEdge>;
|
|
257
|
+
/** Root node for the graph-level completion check. Defaults to the single entry node. */
|
|
258
|
+
readonly root?: string;
|
|
259
|
+
/** Becomes the ROOT node's completion check when the root declares none (#973). */
|
|
260
|
+
readonly deliverable?: DeliverableSpec<unknown>;
|
|
261
|
+
readonly maxNodeVisits?: number;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
151
264
|
//#region src/runtime/graph/engine.d.ts
|
|
152
265
|
interface GraphEngineOptions {
|
|
153
266
|
/** Kinds to register beside the core set. A host adds its own here; nothing is global. */
|
|
@@ -174,6 +287,49 @@ interface GraphEngine {
|
|
|
174
287
|
*/
|
|
175
288
|
declare function createGraphEngine(options: GraphEngineOptions): GraphEngine;
|
|
176
289
|
//#endregion
|
|
290
|
+
//#region src/runtime/graph/compile.d.ts
|
|
291
|
+
interface CompiledEdge {
|
|
292
|
+
readonly id: string;
|
|
293
|
+
readonly spec: EngineGraphEdge;
|
|
294
|
+
readonly fromPort: string;
|
|
295
|
+
readonly toPort: string;
|
|
296
|
+
}
|
|
297
|
+
interface CompiledNode {
|
|
298
|
+
readonly id: string;
|
|
299
|
+
readonly kind: NodeKind;
|
|
300
|
+
readonly config: unknown;
|
|
301
|
+
readonly join: JoinRule;
|
|
302
|
+
readonly maxVisits: number;
|
|
303
|
+
readonly oracle: boolean;
|
|
304
|
+
readonly pure: boolean;
|
|
305
|
+
readonly terminal: boolean;
|
|
306
|
+
/** The check this node must pass to count DELIVERED; resolved per #973. */
|
|
307
|
+
readonly deliverable?: DeliverableSpec<unknown>;
|
|
308
|
+
readonly inbound: ReadonlyArray<CompiledEdge>;
|
|
309
|
+
readonly outbound: ReadonlyArray<CompiledEdge>;
|
|
310
|
+
readonly spec: EngineGraphSpec['nodes'][number];
|
|
311
|
+
}
|
|
312
|
+
interface CompiledGraph {
|
|
313
|
+
readonly nodes: ReadonlyMap<string, CompiledNode>;
|
|
314
|
+
readonly edges: ReadonlyArray<CompiledEdge>;
|
|
315
|
+
readonly entries: ReadonlyArray<string>;
|
|
316
|
+
readonly terminals: ReadonlyArray<string>;
|
|
317
|
+
readonly root: string;
|
|
318
|
+
readonly maxNodeVisits: number;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Bounded structural acceptance: does a value of `source`'s shape fit `target`? Schemas with no
|
|
322
|
+
* `type` accept anything; object targets require their `required` properties to be present and
|
|
323
|
+
* accepted when the source declares properties. Depth-bounded — this is a compile-time tripwire,
|
|
324
|
+
* not a full JSON Schema validator.
|
|
325
|
+
*/
|
|
326
|
+
declare function schemaAccepts(source: JsonSchema, target: JsonSchema, depth?: number): boolean;
|
|
327
|
+
/**
|
|
328
|
+
* Lower an authored graph against an engine's kind registry into the schedulable form, refusing
|
|
329
|
+
* every structural defect before any spend.
|
|
330
|
+
*/
|
|
331
|
+
declare function compileGraph(engine: GraphEngine, spec: EngineGraphSpec, context?: string): CompiledGraph;
|
|
332
|
+
//#endregion
|
|
177
333
|
//#region src/runtime/graph/kinds.d.ts
|
|
178
334
|
interface AgentKindConfig {
|
|
179
335
|
/** Where this node's profile runs. Omit to inherit the engine's default backend. */
|
|
@@ -237,5 +393,75 @@ declare function subgraphKind(): NodeKind<{
|
|
|
237
393
|
readonly graph: unknown;
|
|
238
394
|
}>;
|
|
239
395
|
//#endregion
|
|
240
|
-
|
|
396
|
+
//#region src/runtime/graph/scheduler.d.ts
|
|
397
|
+
type GraphRunReason = 'all-children-down' | 'budget-exhausted' | 'aborted' | 'driver-failed' | 'cycle-budget-exceeded' | 'unreachable-terminal';
|
|
398
|
+
/** One node settlement as the graph result reports it. */
|
|
399
|
+
interface GraphNodeSettle {
|
|
400
|
+
readonly node: string;
|
|
401
|
+
readonly visit: number;
|
|
402
|
+
readonly status: 'done' | 'down';
|
|
403
|
+
/** The node's completion check verdict; `undefined` when the node declares no check. */
|
|
404
|
+
readonly valid?: boolean;
|
|
405
|
+
readonly out?: unknown;
|
|
406
|
+
readonly outRef?: string;
|
|
407
|
+
readonly reason?: string;
|
|
408
|
+
}
|
|
409
|
+
/** One ledgered edge firing (or refusal) — the run's observable data flow. */
|
|
410
|
+
interface GraphEdgeTraversal {
|
|
411
|
+
readonly edge: string;
|
|
412
|
+
readonly kind: 'delegates' | 'analyzes' | 'data';
|
|
413
|
+
readonly from: string;
|
|
414
|
+
readonly to: string;
|
|
415
|
+
readonly traversal: number;
|
|
416
|
+
readonly outcome: 'delivered' | 'empty' | 'unpropagated';
|
|
417
|
+
readonly directive?: string;
|
|
418
|
+
readonly port?: string;
|
|
419
|
+
readonly reason?: string;
|
|
420
|
+
}
|
|
421
|
+
type GraphRunResult = {
|
|
422
|
+
readonly kind: 'winner';
|
|
423
|
+
readonly out: unknown;
|
|
424
|
+
readonly terminals: ReadonlyArray<GraphNodeSettle>;
|
|
425
|
+
readonly settles: ReadonlyArray<GraphNodeSettle>;
|
|
426
|
+
readonly ledger: ReadonlyArray<GraphEdgeTraversal>;
|
|
427
|
+
} | {
|
|
428
|
+
readonly kind: 'no-winner';
|
|
429
|
+
readonly reason: GraphRunReason;
|
|
430
|
+
readonly error?: {
|
|
431
|
+
readonly name: string;
|
|
432
|
+
readonly message: string;
|
|
433
|
+
};
|
|
434
|
+
readonly terminals: ReadonlyArray<GraphNodeSettle>;
|
|
435
|
+
readonly settles: ReadonlyArray<GraphNodeSettle>;
|
|
436
|
+
readonly ledger: ReadonlyArray<GraphEdgeTraversal>;
|
|
437
|
+
/** Nodes provably stuck when the run ended: every upstream settled, no release possible. */
|
|
438
|
+
readonly unreachable: ReadonlyArray<string>;
|
|
439
|
+
};
|
|
440
|
+
interface GraphRunOptions {
|
|
441
|
+
/** The run's conserved pool. */
|
|
442
|
+
readonly budget: Budget;
|
|
443
|
+
/** Default per-instance reservation for nodes that declare no `budget` of their own.
|
|
444
|
+
* Required when any such node exists — the engine invents no split. */
|
|
445
|
+
readonly perNode?: Budget;
|
|
446
|
+
readonly journal?: SpawnJournal;
|
|
447
|
+
readonly blobs?: ResultBlobStore;
|
|
448
|
+
/** Resolves `delegates`/`analyzes` directives; required when any edge carries one. */
|
|
449
|
+
readonly prompts?: PromptRegistry;
|
|
450
|
+
/** How terminal settles reduce to `out`. Default `bestDelivered`. */
|
|
451
|
+
readonly finalizer?: 'bestDelivered' | 'collectDelivered' | SupervisorFinalizer;
|
|
452
|
+
readonly signal?: AbortSignal;
|
|
453
|
+
readonly now?: () => number;
|
|
454
|
+
readonly runId?: string;
|
|
455
|
+
}
|
|
456
|
+
/** Admission for every value crossing an edge (#971): JSON round-trip, `undefined` stripped, a
|
|
457
|
+
* non-representable value becomes a RECORD of that fact — a degraded record beats a vanished
|
|
458
|
+
* edge. */
|
|
459
|
+
declare function admitPayload(value: unknown): unknown;
|
|
460
|
+
/**
|
|
461
|
+
* Run a graph: host every node instance on one kernel `Scope`, resolve joins over guarded edges,
|
|
462
|
+
* enforce the traversal and visit caps, and reduce the terminal settlements through the finalizer.
|
|
463
|
+
*/
|
|
464
|
+
declare function runEngineGraph(engine: GraphEngine, spec: EngineGraphSpec | CompiledGraph, task: string, options: GraphRunOptions): Promise<GraphRunResult>;
|
|
465
|
+
//#endregion
|
|
466
|
+
export { type AgentKindConfig, type BudgetMode, CONDITION_OPS, type CompiledEdge, type CompiledGraph, type CompiledNode, type Condition, type ConditionLeaf, type ConditionOp, DEFAULT_MAX_NODE_VISITS, type EffectContext, type EffectName, type EngineGraphEdge, type EngineGraphNode, type EngineGraphSpec, type GraphEdgeKind, type GraphEdgeTraversal, type GraphEngine, type GraphEngineOptions, type GraphNodeSettle, type GraphRunOptions, type GraphRunReason, type GraphRunResult, JOIN_RULES, type JoinRule, type JsonSchema, MAX_MAX_NODE_VISITS, type NodeFlags, type NodeKind, type OnCrash, type PortSpec, type Projection, type Registered, type Registry, type RegistryHandle, type ScriptBody, type ScriptKindConfig, type SupervisorKindConfig, admitPayload, agentKind, applyProjection, compileGraph, createGraphEngine, createRegistry, evaluateCondition, formatRegistryHandle, kindHandle, narrowEffects, parseRegistryHandle, runEngineGraph, schemaAccepts, scriptKind, subgraphKind, supervisorKind, validateCondition, validateNodeKind, validateProjection };
|
|
241
467
|
//# sourceMappingURL=graph.d.ts.map
|