@victframework/runtime 0.1.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-governance.d.ts +285 -0
- package/dist/agent-governance.js +438 -0
- package/dist/agent-governance.js.map +1 -0
- package/dist/agent-registry.d.ts +103 -0
- package/dist/agent-registry.js +758 -0
- package/dist/agent-registry.js.map +1 -0
- package/dist/agent-types.d.ts +433 -0
- package/dist/agent-types.js +480 -0
- package/dist/agent-types.js.map +1 -0
- package/dist/authority.d.ts +83 -0
- package/dist/authority.js +170 -0
- package/dist/authority.js.map +1 -0
- package/dist/boundary-conformance.d.ts +51 -0
- package/dist/boundary-conformance.js +364 -0
- package/dist/boundary-conformance.js.map +1 -0
- package/dist/control-conformance.d.ts +68 -0
- package/dist/control-conformance.js +1131 -0
- package/dist/control-conformance.js.map +1 -0
- package/dist/control-in-memory.d.ts +257 -0
- package/dist/control-in-memory.js +886 -0
- package/dist/control-in-memory.js.map +1 -0
- package/dist/control-types.d.ts +1017 -0
- package/dist/control-types.js +779 -0
- package/dist/control-types.js.map +1 -0
- package/dist/durable-run.d.ts +73 -0
- package/dist/durable-run.js +262 -0
- package/dist/durable-run.js.map +1 -0
- package/dist/effect-policy.d.ts +22 -0
- package/dist/effect-policy.js +45 -0
- package/dist/effect-policy.js.map +1 -0
- package/dist/errors.d.ts +36 -0
- package/dist/errors.js +71 -0
- package/dist/errors.js.map +1 -0
- package/dist/in-memory-stores.d.ts +16 -0
- package/dist/in-memory-stores.js +522 -0
- package/dist/in-memory-stores.js.map +1 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/operator-config.d.ts +141 -0
- package/dist/operator-config.js +289 -0
- package/dist/operator-config.js.map +1 -0
- package/dist/orchestration-activation.d.ts +116 -0
- package/dist/orchestration-activation.js +223 -0
- package/dist/orchestration-activation.js.map +1 -0
- package/dist/orchestration-canary-conformance.d.ts +10 -0
- package/dist/orchestration-canary-conformance.js +726 -0
- package/dist/orchestration-canary-conformance.js.map +1 -0
- package/dist/orchestration-commands.d.ts +47 -0
- package/dist/orchestration-commands.js +538 -0
- package/dist/orchestration-commands.js.map +1 -0
- package/dist/orchestration-conformance.d.ts +59 -0
- package/dist/orchestration-conformance.js +594 -0
- package/dist/orchestration-conformance.js.map +1 -0
- package/dist/orchestration-driver-types.d.ts +163 -0
- package/dist/orchestration-driver-types.js +21 -0
- package/dist/orchestration-driver-types.js.map +1 -0
- package/dist/orchestration-driver.d.ts +48 -0
- package/dist/orchestration-driver.js +1030 -0
- package/dist/orchestration-driver.js.map +1 -0
- package/dist/orchestration-in-memory.d.ts +18 -0
- package/dist/orchestration-in-memory.js +1313 -0
- package/dist/orchestration-in-memory.js.map +1 -0
- package/dist/orchestration-join-conformance.d.ts +20 -0
- package/dist/orchestration-join-conformance.js +542 -0
- package/dist/orchestration-join-conformance.js.map +1 -0
- package/dist/orchestration-plan.d.ts +52 -0
- package/dist/orchestration-plan.js +265 -0
- package/dist/orchestration-plan.js.map +1 -0
- package/dist/orchestration-race-conformance.d.ts +35 -0
- package/dist/orchestration-race-conformance.js +1265 -0
- package/dist/orchestration-race-conformance.js.map +1 -0
- package/dist/orchestration-remediation-conformance.d.ts +54 -0
- package/dist/orchestration-remediation-conformance.js +632 -0
- package/dist/orchestration-remediation-conformance.js.map +1 -0
- package/dist/orchestration-store-types.d.ts +568 -0
- package/dist/orchestration-store-types.js +2 -0
- package/dist/orchestration-store-types.js.map +1 -0
- package/dist/pack-conformance.d.ts +59 -0
- package/dist/pack-conformance.js +222 -0
- package/dist/pack-conformance.js.map +1 -0
- package/dist/pack-install.d.ts +44 -0
- package/dist/pack-install.js +126 -0
- package/dist/pack-install.js.map +1 -0
- package/dist/registry.d.ts +107 -0
- package/dist/registry.js +481 -0
- package/dist/registry.js.map +1 -0
- package/dist/runtime.d.ts +158 -0
- package/dist/runtime.js +1341 -0
- package/dist/runtime.js.map +1 -0
- package/dist/serialization.d.ts +26 -0
- package/dist/serialization.js +162 -0
- package/dist/serialization.js.map +1 -0
- package/dist/store-conformance.d.ts +45 -0
- package/dist/store-conformance.js +876 -0
- package/dist/store-conformance.js.map +1 -0
- package/dist/store-errors.d.ts +49 -0
- package/dist/store-errors.js +48 -0
- package/dist/store-errors.js.map +1 -0
- package/dist/store-types.d.ts +331 -0
- package/dist/store-types.js +14 -0
- package/dist/store-types.js.map +1 -0
- package/dist/store-validation.d.ts +63 -0
- package/dist/store-validation.js +164 -0
- package/dist/store-validation.js.map +1 -0
- package/dist/stream-hub.d.ts +151 -0
- package/dist/stream-hub.js +402 -0
- package/dist/stream-hub.js.map +1 -0
- package/dist/testing.d.ts +25 -0
- package/dist/testing.js +19 -0
- package/dist/testing.js.map +1 -0
- package/dist/types.d.ts +221 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import type { OrchestrationRunResult, ProcessDueTimersOptions, ProcessDueTimersResult, ResolveBlockedInput, ResolveBlockedOutcome, SignalCommand, SignalResult, CancelCommand, CancelResult, RecoverOrchestrationOptions, RecoverOrchestrationSummary } from './orchestration-driver-types.js';
|
|
2
|
+
import type { ApplicationGraphDefinition, KernelEvent } from '@victframework/kernel';
|
|
3
|
+
import { CapabilityRegistry } from './registry.js';
|
|
4
|
+
import type { RecoveryResult } from './store-types.js';
|
|
5
|
+
import type { ActivationResult, ActiveGraphInfo, CapabilityDefinition, DoubleInvoke, RestorationResult, RunNodeOptions, RunOptions, RunRecord, RunResult, VictRuntimeOptions } from './types.js';
|
|
6
|
+
declare const RECOVERY_CODE = "VICT_RUN_INTERRUPTED_BY_RESTART";
|
|
7
|
+
declare const RECOVERY_REASON = "The process executing this run ended before the run reached a terminal state.";
|
|
8
|
+
declare const RECOVERY_REMEDIATION = "Automatic resume is unavailable at this stage. Inspect the run and its events, then start a deliberate new run; the new run receives a new run id.";
|
|
9
|
+
export { RECOVERY_CODE, RECOVERY_REASON, RECOVERY_REMEDIATION };
|
|
10
|
+
/**
|
|
11
|
+
* The usable in-process Vict runtime.
|
|
12
|
+
*
|
|
13
|
+
* Composes a capability registry, the active activation snapshot, execution
|
|
14
|
+
* policy, and durable semantic stores (activation catalog + execution
|
|
15
|
+
* store). Contains no ARA-specific logic.
|
|
16
|
+
*
|
|
17
|
+
* Safety model:
|
|
18
|
+
* - Activation is atomic from the caller's perspective: the candidate is
|
|
19
|
+
* compiled, snapshotted, and published/selected in the catalog BEFORE the
|
|
20
|
+
* in-memory snapshot is replaced. A failed compile or storage write leaves
|
|
21
|
+
* the previously active graph selected and runnable.
|
|
22
|
+
* - Activation manifests are immutable and durable; every run pins exactly
|
|
23
|
+
* one activationVersion (RUN-001), persisted with the run.
|
|
24
|
+
* - Runs execute against the pinned snapshot; in-flight runs cannot observe
|
|
25
|
+
* registry changes. Every run transition and its events are committed
|
|
26
|
+
* atomically (DATA-003) with optimistic concurrency, and the durable
|
|
27
|
+
* write-ahead rule holds: a capability is invoked only after its
|
|
28
|
+
* `node.started` intent (and every preceding durable write) has committed.
|
|
29
|
+
* - Test doubles are snapshotted at run start; replacing a double mid-run
|
|
30
|
+
* affects only later runs. Duplicate `registerDouble` is rejected; use
|
|
31
|
+
* `replaceDouble`.
|
|
32
|
+
* - Effect policy is enforced before any capability runs (see effect-policy).
|
|
33
|
+
* Irreversible effects never run their real implementation in simulate or
|
|
34
|
+
* test modes; in those modes a registered safe double may run, and without
|
|
35
|
+
* one the operation is blocked.
|
|
36
|
+
* - Run records are retained according to the runtime's `payloadRetention`
|
|
37
|
+
* (default `'summary'`): complete payloads are stored only under explicit
|
|
38
|
+
* `'full'` retention — which transfers responsibility for the persisted
|
|
39
|
+
* content to the caller/operator. Thrown error messages are never stored.
|
|
40
|
+
*/
|
|
41
|
+
export declare class VictRuntime {
|
|
42
|
+
#private;
|
|
43
|
+
constructor(options?: VictRuntimeOptions);
|
|
44
|
+
/**
|
|
45
|
+
* Drive an existing orchestration run to terminal/quiescent against its
|
|
46
|
+
* EXACT pinned activation. Selection changes never affect this run; a
|
|
47
|
+
* newer selected activation applies only to future runs.
|
|
48
|
+
*/
|
|
49
|
+
resumeRun<T = unknown>(runId: string, options?: {
|
|
50
|
+
concurrency?: number;
|
|
51
|
+
onEvent?: (event: KernelEvent) => void;
|
|
52
|
+
}): Promise<OrchestrationRunResult<T>>;
|
|
53
|
+
/** Idempotently deliver one signal to one exact durable wait. */
|
|
54
|
+
signal(command: SignalCommand): Promise<SignalResult>;
|
|
55
|
+
/** Idempotently request cancellation of one orchestration run. */
|
|
56
|
+
cancel(command: CancelCommand): Promise<CancelResult>;
|
|
57
|
+
/** Resolve bounded due timers (timer waits, wait timeouts, retry backoff). */
|
|
58
|
+
processDueTimers(options?: ProcessDueTimersOptions): Promise<ProcessDueTimersResult>;
|
|
59
|
+
/**
|
|
60
|
+
* Explicit boot-time effect-aware recovery for orchestration runs:
|
|
61
|
+
* reclaim policy-permitted expired claims (pure/read recompute; keyed
|
|
62
|
+
* write retries with the same key) and block ambiguous unsafe work.
|
|
63
|
+
* Historical Stage 02 sequential recovery is unchanged.
|
|
64
|
+
*/
|
|
65
|
+
recoverOrchestration(options?: RecoverOrchestrationOptions): Promise<RecoverOrchestrationSummary>;
|
|
66
|
+
/**
|
|
67
|
+
* Bounded authorized operator resolution for one blocked run. Denied by
|
|
68
|
+
* default: only runtimes explicitly constructed with
|
|
69
|
+
* `orchestration.operatorAuthorized: true` may resolve blocked work.
|
|
70
|
+
*/
|
|
71
|
+
resolveBlocked(input: ResolveBlockedInput): Promise<ResolveBlockedOutcome>;
|
|
72
|
+
registerCapability<I, O>(definition: CapabilityDefinition<I, O>): this;
|
|
73
|
+
/**
|
|
74
|
+
* Install a batch atomically (used by `installCapabilityPack`). Stages
|
|
75
|
+
* every contract/capability/double and commits only on full success.
|
|
76
|
+
*/
|
|
77
|
+
installCapabilityPackBatch(install: (staging: {
|
|
78
|
+
registerContract(contract: Parameters<CapabilityRegistry['registerContract']>[0]): void;
|
|
79
|
+
registerCapability(definition: CapabilityDefinition): void;
|
|
80
|
+
registerDouble(capabilityId: string, invoke: DoubleInvoke, options?: {
|
|
81
|
+
readonly modes?: readonly ('test' | 'simulate')[];
|
|
82
|
+
}): void;
|
|
83
|
+
}) => void): void;
|
|
84
|
+
registerContract(contract: Parameters<CapabilityRegistry['registerContract']>[0]): this;
|
|
85
|
+
/** Register a test double. Duplicate registration is rejected; use `replaceDouble`. */
|
|
86
|
+
registerDouble(capabilityId: string, invoke: DoubleInvoke, options?: {
|
|
87
|
+
readonly modes?: readonly ('test' | 'simulate')[];
|
|
88
|
+
}): this;
|
|
89
|
+
/** Explicitly replace an existing test double. Later runs use the replacement; in-flight runs do not. */
|
|
90
|
+
replaceDouble(capabilityId: string, invoke: DoubleInvoke): this;
|
|
91
|
+
/** True when a test double is registered for the capability. */
|
|
92
|
+
hasDouble(capabilityId: string): boolean;
|
|
93
|
+
/** The eligible modes of a registered test double (undefined when none is registered). */
|
|
94
|
+
getDoubleModes(capabilityId: string): ReadonlySet<'test' | 'simulate'> | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* Compile and activate a graph atomically from the caller's perspective:
|
|
97
|
+
*
|
|
98
|
+
* 1. compile and resolve the candidate completely;
|
|
99
|
+
* 2. snapshot capability and captured contract parsing semantics;
|
|
100
|
+
* 3. build and validate the serializable manifest;
|
|
101
|
+
* 4. publish and select it in the durable catalog (one transaction);
|
|
102
|
+
* 5. only then replace the active in-memory snapshot.
|
|
103
|
+
*
|
|
104
|
+
* A compile failure returns a structured rejection; a storage failure
|
|
105
|
+
* throws a structured store error. In both cases the previously active
|
|
106
|
+
* graph remains selected and runnable, and durable state never claims an
|
|
107
|
+
* activation the catalog did not select.
|
|
108
|
+
*/
|
|
109
|
+
activate(definition: ApplicationGraphDefinition): Promise<ActivationResult>;
|
|
110
|
+
/**
|
|
111
|
+
* Restore the exact durable activation for a graph definition.
|
|
112
|
+
*
|
|
113
|
+
* The current registered code (capabilities and contracts) must reproduce
|
|
114
|
+
* the stored activation exactly: the definition is recompiled against the
|
|
115
|
+
* live registry, all three version identities are recomputed, and the
|
|
116
|
+
* rebuilt canonical manifest is compared with the stored one. On an exact
|
|
117
|
+
* match the activation becomes the active in-memory snapshot. On any
|
|
118
|
+
* mismatch the stored manifest is preserved, the currently active graph is
|
|
119
|
+
* left unchanged, no capability is executed, and no “closest” revision is
|
|
120
|
+
* chosen.
|
|
121
|
+
*
|
|
122
|
+
* By default the activation currently selected for `definition.id` is
|
|
123
|
+
* restored; pass `activationVersion` to restore a specific one.
|
|
124
|
+
*/
|
|
125
|
+
restoreActivation(definition: ApplicationGraphDefinition, options?: {
|
|
126
|
+
activationVersion?: string;
|
|
127
|
+
}): Promise<RestorationResult>;
|
|
128
|
+
/**
|
|
129
|
+
* Explicit boot-time recovery (single local owner). Finds runs left in a
|
|
130
|
+
* nonterminal running state by a previous process, atomically transitions
|
|
131
|
+
* each to `blocked`, and appends one safe interruption event. Never
|
|
132
|
+
* invokes or replays a capability. Repeated recovery is idempotent.
|
|
133
|
+
*/
|
|
134
|
+
recoverInterruptedRuns(): Promise<RecoveryResult>;
|
|
135
|
+
activeGraph(): ActiveGraphInfo | undefined;
|
|
136
|
+
/**
|
|
137
|
+
* Execute the active graph. Capability-only graphs keep the verified
|
|
138
|
+
* Stage 02 sequential engine; graphs with control nodes run on the Stage
|
|
139
|
+
* 03 durable orchestration driver (token/attempt state machine). Run
|
|
140
|
+
* transitions and events are committed to the store atomically as the
|
|
141
|
+
* run progresses; when `run()` resolves, the durable record is current.
|
|
142
|
+
*/
|
|
143
|
+
run<T = unknown>(input: unknown, options?: RunOptions): Promise<RunResult<T>>;
|
|
144
|
+
/**
|
|
145
|
+
* Execute a single node of the active graph in isolation (mode forced to
|
|
146
|
+
* `'test'`). The isolated compile resolves against the activation snapshot,
|
|
147
|
+
* so post-activation registry changes cannot affect it. Does not traverse
|
|
148
|
+
* edges, does not change the active graph, and does not write durable run
|
|
149
|
+
* records. The trace is returned directly.
|
|
150
|
+
*/
|
|
151
|
+
runNode<T = unknown>(nodeId: string, input: unknown, options?: RunNodeOptions): Promise<RunResult<T>>;
|
|
152
|
+
/** All stored runs (assembled views with their traces), oldest first. */
|
|
153
|
+
listRuns(): Promise<readonly RunRecord[]>;
|
|
154
|
+
/** One stored run (assembled view with its trace), or undefined. */
|
|
155
|
+
getRun(runId: string): Promise<RunRecord | undefined>;
|
|
156
|
+
}
|
|
157
|
+
/** Create a runtime instance. Application code should use the `@victframework/sdk` facade instead. */
|
|
158
|
+
export declare function createRuntime(options?: VictRuntimeOptions): VictRuntime;
|