@tangle-network/agent-runtime 0.163.0 → 0.165.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-DxGP0h_p.js → activation-DmUIq51m.js} +3 -3
- package/dist/{activation-DxGP0h_p.js.map → activation-DmUIq51m.js.map} +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/{authoring-kO7vE_c9.js → authoring-Cm122Duf.js} +2 -2
- package/dist/{authoring-kO7vE_c9.js.map → authoring-Cm122Duf.js.map} +1 -1
- package/dist/candidate-execution/index.js +4 -4
- package/dist/{candidate-execution-izJj02pU.js → candidate-execution-DC0T8l2p.js} +4 -4
- package/dist/{candidate-execution-izJj02pU.js.map → candidate-execution-DC0T8l2p.js.map} +1 -1
- package/dist/conversation.d.ts +1 -1
- package/dist/durable.d.ts +2 -2
- package/dist/durable.js +1 -1
- package/dist/{environment-provider-BXFFK_rZ.d.ts → environment-provider-DWjbGH8W.d.ts} +2 -2
- package/dist/environment-provider.d.ts +1 -1
- package/dist/{graph-COikUkrj.js → graph-DGri_zJm.js} +3 -3
- package/dist/{graph-COikUkrj.js.map → graph-DGri_zJm.js.map} +1 -1
- package/dist/graph.d.ts +155 -53
- package/dist/graph.js +946 -330
- package/dist/graph.js.map +1 -1
- package/dist/{improvement-cycle-dGtgX1vr.js → improvement-cycle-BOd5DFeG.js} +4 -4
- package/dist/{improvement-cycle-dGtgX1vr.js.map → improvement-cycle-BOd5DFeG.js.map} +1 -1
- package/dist/{index-CbyKCjR7.d.ts → index-BGQtpQuJ.d.ts} +5 -5
- package/dist/{index-CykKDPnB.d.ts → index-BgptUCKl.d.ts} +4 -4
- package/dist/{index-OFOvnNc2.d.ts → index-CFMB9ux3.d.ts} +2 -2
- package/dist/index.d.ts +7 -7
- package/dist/index.js +11 -11
- package/dist/intelligence.d.ts +4 -4
- package/dist/intelligence.js +5 -5
- package/dist/kernel.d.ts +5 -5
- package/dist/kernel.js +7 -7
- package/dist/{knowledge-CZT8ahp6.js → knowledge-7_IfyD9R.js} +5 -5
- package/dist/{knowledge-CZT8ahp6.js.map → knowledge-7_IfyD9R.js.map} +1 -1
- package/dist/knowledge.d.ts +1 -1
- package/dist/knowledge.js +1 -1
- package/dist/{loop-runner-bin-DrN092ew.d.ts → loop-runner-bin-C2NXQK7J.d.ts} +3 -3
- package/dist/{loop-runner-bin-CIjmKf7v.js → loop-runner-bin-Dx-5GZQK.js} +3 -3
- package/dist/{loop-runner-bin-CIjmKf7v.js.map → loop-runner-bin-Dx-5GZQK.js.map} +1 -1
- package/dist/loop-runner-bin.d.ts +1 -1
- package/dist/loop-runner-bin.js +1 -1
- package/dist/mcp/bin.js +3 -3
- package/dist/mcp/index.d.ts +3 -3
- package/dist/mcp/index.js +4 -4
- package/dist/{openai-tools-DG779Z6S.js → openai-tools-CDS7eSww.js} +2 -2
- package/dist/{openai-tools-DG779Z6S.js.map → openai-tools-CDS7eSww.js.map} +1 -1
- package/dist/{prepare-VLGnSyav.js → prepare-BCScSDCv.js} +7 -5
- package/dist/prepare-BCScSDCv.js.map +1 -0
- package/dist/primeintellect/index.d.ts +1 -1
- package/dist/{protected-model-port-CcCH0Uji.js → protected-model-port-D-5E3HBe.js} +2 -2
- package/dist/{protected-model-port-CcCH0Uji.js.map → protected-model-port-D-5E3HBe.js.map} +1 -1
- package/dist/{redact-DL_ZtFvR.d.ts → redact-DkObldQP.d.ts} +3 -3
- package/dist/{runtime-CCbeY1KO.d.ts → runtime-B0HZbuEv.d.ts} +4 -4
- package/dist/{runtime-BT00zfIS.js → runtime-DESENUe1.js} +7 -7
- package/dist/{runtime-BT00zfIS.js.map → runtime-DESENUe1.js.map} +1 -1
- package/dist/{spawn-journal-oewq1g2h.js → spawn-journal-Tgvp5VS5.js} +8 -2
- package/dist/{spawn-journal-oewq1g2h.js.map → spawn-journal-Tgvp5VS5.js.map} +1 -1
- package/dist/{stream-agent-turn-Dx2YrEWW.d.ts → stream-agent-turn-DxQ3GOuR.d.ts} +2 -2
- package/dist/{structural-rollout-DAenyNls.js → structural-rollout-DZGDg0yX.js} +3 -3
- package/dist/{structural-rollout-DAenyNls.js.map → structural-rollout-DZGDg0yX.js.map} +1 -1
- package/dist/{supervise-Di6xvnOL.js → supervise-Da20R0PO.js} +3 -3
- package/dist/{supervise-Di6xvnOL.js.map → supervise-Da20R0PO.js.map} +1 -1
- package/dist/{supervisor-DmWq4vkU.js → supervisor-DpIKMlPJ.js} +114 -40
- package/dist/supervisor-DpIKMlPJ.js.map +1 -0
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +12 -12
- package/dist/{types-C2l1jaos.d.ts → types-DjVO-p7R.d.ts} +58 -3
- package/dist/{workspace-archive-BptlGCEU.js → workspace-archive-CHY5HvrF.js} +2 -2
- package/dist/{workspace-archive-BptlGCEU.js.map → workspace-archive-CHY5HvrF.js.map} +1 -1
- package/package.json +1 -1
- package/dist/prepare-VLGnSyav.js.map +0 -1
- package/dist/supervisor-DmWq4vkU.js.map +0 -1
package/dist/graph.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
2
|
-
import { H as SpawnJournal, K as Spend, i as Budget, j as ResultBlobStore, 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-BGQtpQuJ.js";
|
|
2
|
+
import { H as SpawnJournal, K as Spend, V as SpawnEvent, i as Budget, j as ResultBlobStore, t as Agent } from "./types-DjVO-p7R.js";
|
|
3
|
+
import { o as ExecutorConfig } from "./runtime-B0HZbuEv.js";
|
|
4
4
|
import { AgentProfile } from "@tangle-network/agent-interface";
|
|
5
5
|
//#region src/runtime/graph/condition.d.ts
|
|
6
6
|
/** The leaf comparison operators; `exists`/`truthy` are unary, the rest compare against `value`. */
|
|
@@ -330,6 +330,121 @@ declare function schemaAccepts(source: JsonSchema, target: JsonSchema, depth?: n
|
|
|
330
330
|
*/
|
|
331
331
|
declare function compileGraph(engine: GraphEngine, spec: EngineGraphSpec, context?: string): CompiledGraph;
|
|
332
332
|
//#endregion
|
|
333
|
+
//#region src/runtime/graph/scheduler-types.d.ts
|
|
334
|
+
/** Result vocabulary shared by the scheduler and the fold (agent-runtime#973, #974, #976). */
|
|
335
|
+
type GraphRunReason = 'all-children-down' | 'budget-exhausted' | 'aborted' | 'driver-failed' | 'cycle-budget-exceeded' | 'unreachable-terminal';
|
|
336
|
+
/** One node settlement as the graph result reports it. */
|
|
337
|
+
interface GraphNodeSettle {
|
|
338
|
+
readonly node: string;
|
|
339
|
+
readonly visit: number;
|
|
340
|
+
readonly status: 'done' | 'down';
|
|
341
|
+
/** The node's completion check verdict; `undefined` when the node declares no check. */
|
|
342
|
+
readonly valid?: boolean;
|
|
343
|
+
readonly out?: unknown;
|
|
344
|
+
readonly outRef?: string;
|
|
345
|
+
readonly reason?: string;
|
|
346
|
+
}
|
|
347
|
+
/** One ledgered edge firing (or refusal) — the run's observable data flow. */
|
|
348
|
+
interface GraphEdgeTraversal {
|
|
349
|
+
readonly edge: string;
|
|
350
|
+
readonly kind: 'delegates' | 'analyzes' | 'data';
|
|
351
|
+
readonly from: string;
|
|
352
|
+
readonly to: string;
|
|
353
|
+
readonly traversal: number;
|
|
354
|
+
readonly outcome: 'delivered' | 'empty' | 'unpropagated';
|
|
355
|
+
readonly directive?: string;
|
|
356
|
+
readonly port?: string;
|
|
357
|
+
readonly reason?: string;
|
|
358
|
+
}
|
|
359
|
+
type GraphRunResult = {
|
|
360
|
+
readonly kind: 'winner';
|
|
361
|
+
readonly out: unknown;
|
|
362
|
+
readonly terminals: ReadonlyArray<GraphNodeSettle>;
|
|
363
|
+
readonly settles: ReadonlyArray<GraphNodeSettle>;
|
|
364
|
+
readonly ledger: ReadonlyArray<GraphEdgeTraversal>;
|
|
365
|
+
} | {
|
|
366
|
+
readonly kind: 'no-winner';
|
|
367
|
+
readonly reason: GraphRunReason;
|
|
368
|
+
readonly error?: {
|
|
369
|
+
readonly name: string;
|
|
370
|
+
readonly message: string;
|
|
371
|
+
};
|
|
372
|
+
readonly terminals: ReadonlyArray<GraphNodeSettle>;
|
|
373
|
+
readonly settles: ReadonlyArray<GraphNodeSettle>;
|
|
374
|
+
readonly ledger: ReadonlyArray<GraphEdgeTraversal>;
|
|
375
|
+
/** Nodes provably stuck when the run ended: every upstream settled, no release possible. */
|
|
376
|
+
readonly unreachable: ReadonlyArray<string>;
|
|
377
|
+
} | {
|
|
378
|
+
/** Every live branch parked on a host wake: a legitimate terminal state for an offline run.
|
|
379
|
+
* Restart over the same journal and `resume(token, payload)` to continue (#976). */
|
|
380
|
+
readonly kind: 'suspended';
|
|
381
|
+
readonly tokens: ReadonlyArray<string>;
|
|
382
|
+
readonly terminals: ReadonlyArray<GraphNodeSettle>;
|
|
383
|
+
readonly settles: ReadonlyArray<GraphNodeSettle>;
|
|
384
|
+
readonly ledger: ReadonlyArray<GraphEdgeTraversal>;
|
|
385
|
+
};
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/runtime/graph/fold.d.ts
|
|
388
|
+
type FoldEdgeState = 'pending' | 'satisfied' | 'dead' | 'failed';
|
|
389
|
+
interface FoldEdge {
|
|
390
|
+
state: FoldEdgeState;
|
|
391
|
+
/** Set by a `join-state` whose wave this edge was pending inside; cleared when the in-flight
|
|
392
|
+
* completion it refers to settles (absorbed, never re-released). */
|
|
393
|
+
consumedOnce: boolean;
|
|
394
|
+
/** Delivered consumptions — what the per-edge cap counts. */
|
|
395
|
+
traversals: number;
|
|
396
|
+
/** How many of the source's settles this edge has accounted for — by a journaled verdict or by
|
|
397
|
+
* an absorption. The idempotence key: a kill between a settle and its verdicts re-judges ONLY
|
|
398
|
+
* the unaccounted edges on restart, never a judged or absorbed one twice. */
|
|
399
|
+
judgedSourceSettles: number;
|
|
400
|
+
/** The admitted source payload this state reflects (the source settle's outRef). */
|
|
401
|
+
payloadRef?: string;
|
|
402
|
+
capped: boolean;
|
|
403
|
+
}
|
|
404
|
+
type FoldInstanceStatus = 'released' | 'live' | 'done' | 'down' | 'suspended';
|
|
405
|
+
interface FoldInstance {
|
|
406
|
+
readonly node: string;
|
|
407
|
+
readonly instance: string;
|
|
408
|
+
readonly visit: number;
|
|
409
|
+
inputRef?: string;
|
|
410
|
+
status: FoldInstanceStatus;
|
|
411
|
+
settle?: GraphNodeSettle;
|
|
412
|
+
}
|
|
413
|
+
interface FoldSuspension {
|
|
414
|
+
readonly token: string;
|
|
415
|
+
readonly node: string;
|
|
416
|
+
readonly instance: string;
|
|
417
|
+
readonly onExpire: 'wait' | 'fail' | 'default';
|
|
418
|
+
readonly expiresAtMs?: number;
|
|
419
|
+
readonly defaultRef?: string;
|
|
420
|
+
status: 'pending' | 'woken' | 'expired';
|
|
421
|
+
}
|
|
422
|
+
interface FoldNode {
|
|
423
|
+
visits: number;
|
|
424
|
+
blocked: boolean;
|
|
425
|
+
settles: GraphNodeSettle[];
|
|
426
|
+
}
|
|
427
|
+
interface GraphFoldState {
|
|
428
|
+
readonly nodes: Map<string, FoldNode>;
|
|
429
|
+
readonly edges: Map<string, FoldEdge>;
|
|
430
|
+
/** Every node instance the journal knows, keyed by `<node>#<visit>`. */
|
|
431
|
+
readonly instances: Map<string, FoldInstance>;
|
|
432
|
+
/** Kernel node id → engine instance label, from `spawned`. */
|
|
433
|
+
readonly spawnedIds: Map<string, string>;
|
|
434
|
+
readonly suspensions: Map<string, FoldSuspension>;
|
|
435
|
+
readonly exhaustedEdges: Set<string>;
|
|
436
|
+
}
|
|
437
|
+
/** The reducer's zero: every node unvisited, every edge pending, nothing suspended. */
|
|
438
|
+
declare function emptyFoldState(compiled: CompiledGraph): GraphFoldState;
|
|
439
|
+
/**
|
|
440
|
+
* Apply ONE journal event. The live scheduler calls this right after each append; the restart path
|
|
441
|
+
* calls it over the loaded journal. Unknown kernel events are ignored — the engine folds only what
|
|
442
|
+
* it understands, exactly as the kernel's replay skips the engine's events.
|
|
443
|
+
*/
|
|
444
|
+
declare function applyGraphFoldEvent(state: GraphFoldState, ev: SpawnEvent, compiled: CompiledGraph): void;
|
|
445
|
+
/** Fold a loaded journal (append order) into scheduler state. */
|
|
446
|
+
declare function foldGraphJournal(events: ReadonlyArray<SpawnEvent>, compiled: CompiledGraph): GraphFoldState;
|
|
447
|
+
//#endregion
|
|
333
448
|
//#region src/runtime/graph/kinds.d.ts
|
|
334
449
|
interface AgentKindConfig {
|
|
335
450
|
/** Where this node's profile runs. Omit to inherit the engine's default backend. */
|
|
@@ -394,49 +509,26 @@ declare function subgraphKind(): NodeKind<{
|
|
|
394
509
|
}>;
|
|
395
510
|
//#endregion
|
|
396
511
|
//#region src/runtime/graph/scheduler.d.ts
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
readonly
|
|
402
|
-
readonly
|
|
403
|
-
/**
|
|
404
|
-
readonly
|
|
405
|
-
readonly
|
|
406
|
-
readonly outRef?: string;
|
|
407
|
-
readonly reason?: string;
|
|
512
|
+
/** Engine-appended `woken` ordinals start here — far above any kernel cursor counter. */
|
|
513
|
+
declare const ENGINE_WOKEN_SEQ_BASE = 10000000;
|
|
514
|
+
declare const SUSPEND_MARK = "__graphSuspension";
|
|
515
|
+
interface SuspensionRequest {
|
|
516
|
+
readonly [SUSPEND_MARK]: true;
|
|
517
|
+
readonly onExpire: 'wait' | 'fail' | 'default';
|
|
518
|
+
/** Milliseconds from the suspension's journaling instant; absent with `onExpire: 'wait'`. */
|
|
519
|
+
readonly expiresInMs?: number;
|
|
520
|
+
readonly default?: unknown;
|
|
408
521
|
}
|
|
409
|
-
/**
|
|
410
|
-
|
|
411
|
-
readonly
|
|
412
|
-
readonly
|
|
413
|
-
readonly
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
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
|
-
};
|
|
522
|
+
/** What a kind's executor returns to park its node on a host wake (agent-runtime#976). */
|
|
523
|
+
declare function suspended(options?: {
|
|
524
|
+
readonly onExpire?: 'wait' | 'fail' | 'default';
|
|
525
|
+
readonly expiresInMs?: number;
|
|
526
|
+
readonly default?: unknown;
|
|
527
|
+
}): SuspensionRequest;
|
|
528
|
+
/** Admission for every value crossing an edge (#971): JSON round-trip, `undefined` stripped, a
|
|
529
|
+
* non-representable value becomes a RECORD of that fact — a degraded record beats a vanished
|
|
530
|
+
* edge. */
|
|
531
|
+
declare function admitPayload(value: unknown): unknown;
|
|
440
532
|
interface GraphRunOptions {
|
|
441
533
|
/** The run's conserved pool. */
|
|
442
534
|
readonly budget: Budget;
|
|
@@ -452,16 +544,26 @@ interface GraphRunOptions {
|
|
|
452
544
|
readonly signal?: AbortSignal;
|
|
453
545
|
readonly now?: () => number;
|
|
454
546
|
readonly runId?: string;
|
|
547
|
+
/** Continue an existing journaled run. An existing tree without this refuses, like the kernel. */
|
|
548
|
+
readonly resume?: boolean;
|
|
549
|
+
/** Hold a fully-suspended run open for live `resume()` calls instead of returning
|
|
550
|
+
* `{ kind: 'suspended' }`. Offline callers leave this off and restart later (#976). */
|
|
551
|
+
readonly waitForWakes?: boolean;
|
|
455
552
|
}
|
|
456
|
-
/**
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
553
|
+
/** A live run: await `done`; deliver host wakes through `resume`/`expire` (#976). */
|
|
554
|
+
interface GraphRunHandle {
|
|
555
|
+
readonly done: Promise<GraphRunResult>;
|
|
556
|
+
resume(token: string, payload: unknown): Promise<void>;
|
|
557
|
+
expire(token: string): Promise<void>;
|
|
558
|
+
}
|
|
559
|
+
/** Run a graph to its result: `createGraphRun` awaited — the one-call form for a run that needs
|
|
560
|
+
* no live host wakes. */
|
|
561
|
+
declare function runEngineGraph(engine: GraphEngine, spec: EngineGraphSpec | CompiledGraph, task: string, options: GraphRunOptions): Promise<GraphRunResult>;
|
|
460
562
|
/**
|
|
461
|
-
*
|
|
462
|
-
*
|
|
563
|
+
* Start (or resume) a graph run and return its handle: await `done` for the result; deliver host
|
|
564
|
+
* wakes through `resume`/`expire` while it runs (#976).
|
|
463
565
|
*/
|
|
464
|
-
declare function
|
|
566
|
+
declare function createGraphRun(engine: GraphEngine, spec: EngineGraphSpec | CompiledGraph, task: string, options: GraphRunOptions): GraphRunHandle;
|
|
465
567
|
//#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 };
|
|
568
|
+
export { type AgentKindConfig, type BudgetMode, CONDITION_OPS, type CompiledEdge, type CompiledGraph, type CompiledNode, type Condition, type ConditionLeaf, type ConditionOp, DEFAULT_MAX_NODE_VISITS, ENGINE_WOKEN_SEQ_BASE, type EffectContext, type EffectName, type EngineGraphEdge, type EngineGraphNode, type EngineGraphSpec, type FoldEdge, type FoldEdgeState, type FoldInstance, type FoldInstanceStatus, type FoldNode, type FoldSuspension, type GraphEdgeKind, type GraphEdgeTraversal, type GraphEngine, type GraphEngineOptions, type GraphFoldState, type GraphNodeSettle, type GraphRunHandle, 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, type SuspensionRequest, admitPayload, agentKind, applyGraphFoldEvent, applyProjection, compileGraph, createGraphEngine, createGraphRun, createRegistry, emptyFoldState, evaluateCondition, foldGraphJournal, formatRegistryHandle, kindHandle, narrowEffects, parseRegistryHandle, runEngineGraph, schemaAccepts, scriptKind, subgraphKind, supervisorKind, suspended, validateCondition, validateNodeKind, validateProjection };
|
|
467
569
|
//# sourceMappingURL=graph.d.ts.map
|