@bian-womp/spark-graph 0.2.93 → 0.3.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/lib/cjs/index.cjs +1462 -994
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/core/order.d.ts +7 -0
- package/lib/cjs/src/core/order.d.ts.map +1 -0
- package/lib/cjs/src/examples/async.d.ts.map +1 -1
- package/lib/cjs/src/examples/progress.d.ts.map +1 -1
- package/lib/cjs/src/examples/runMode.d.ts +2 -0
- package/lib/cjs/src/examples/runMode.d.ts.map +1 -0
- package/lib/cjs/src/examples/shared.d.ts.map +1 -1
- package/lib/cjs/src/examples/simple.d.ts.map +1 -1
- package/lib/cjs/src/examples/snapshot.d.ts.map +1 -1
- package/lib/cjs/src/examples/validation.d.ts.map +1 -1
- package/lib/cjs/src/index.d.ts +4 -7
- package/lib/cjs/src/index.d.ts.map +1 -1
- package/lib/cjs/src/misc/base.d.ts +41 -0
- package/lib/cjs/src/misc/base.d.ts.map +1 -1
- package/lib/cjs/src/runtime/AbstractEngine.d.ts +18 -4
- package/lib/cjs/src/runtime/AbstractEngine.d.ts.map +1 -1
- package/lib/cjs/src/runtime/Engine.d.ts +17 -3
- package/lib/cjs/src/runtime/Engine.d.ts.map +1 -1
- package/lib/cjs/src/runtime/GraphLifecycleApi.d.ts +37 -0
- package/lib/cjs/src/runtime/GraphLifecycleApi.d.ts.map +1 -0
- package/lib/cjs/src/runtime/GraphRuntime.d.ts +29 -29
- package/lib/cjs/src/runtime/GraphRuntime.d.ts.map +1 -1
- package/lib/cjs/src/runtime/UnifiedEngine.d.ts +32 -0
- package/lib/cjs/src/runtime/UnifiedEngine.d.ts.map +1 -0
- package/lib/cjs/src/runtime/components/EventEmitter.d.ts +12 -0
- package/lib/cjs/src/runtime/components/EventEmitter.d.ts.map +1 -0
- package/lib/cjs/src/runtime/components/ExecutionScheduler.d.ts +56 -0
- package/lib/cjs/src/runtime/components/ExecutionScheduler.d.ts.map +1 -0
- package/lib/cjs/src/runtime/components/GraphStructure.d.ts +36 -0
- package/lib/cjs/src/runtime/components/GraphStructure.d.ts.map +1 -0
- package/lib/cjs/src/runtime/components/HandleResolver.d.ts +27 -0
- package/lib/cjs/src/runtime/components/HandleResolver.d.ts.map +1 -0
- package/lib/cjs/src/runtime/components/RunContextManager.d.ts +55 -0
- package/lib/cjs/src/runtime/components/RunContextManager.d.ts.map +1 -0
- package/lib/cjs/src/runtime/components/ValuePropagator.d.ts +46 -0
- package/lib/cjs/src/runtime/components/ValuePropagator.d.ts.map +1 -0
- package/lib/cjs/src/runtime/components/interfaces.d.ts +34 -0
- package/lib/cjs/src/runtime/components/interfaces.d.ts.map +1 -0
- package/lib/cjs/src/runtime/components/types.d.ts +43 -0
- package/lib/cjs/src/runtime/components/types.d.ts.map +1 -0
- package/lib/cjs/src/runtime/utils.d.ts +16 -0
- package/lib/cjs/src/runtime/utils.d.ts.map +1 -0
- package/lib/esm/index.js +1459 -989
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/core/order.d.ts +7 -0
- package/lib/esm/src/core/order.d.ts.map +1 -0
- package/lib/esm/src/examples/async.d.ts.map +1 -1
- package/lib/esm/src/examples/progress.d.ts.map +1 -1
- package/lib/esm/src/examples/runMode.d.ts +2 -0
- package/lib/esm/src/examples/runMode.d.ts.map +1 -0
- package/lib/esm/src/examples/shared.d.ts.map +1 -1
- package/lib/esm/src/examples/simple.d.ts.map +1 -1
- package/lib/esm/src/examples/snapshot.d.ts.map +1 -1
- package/lib/esm/src/examples/validation.d.ts.map +1 -1
- package/lib/esm/src/index.d.ts +4 -7
- package/lib/esm/src/index.d.ts.map +1 -1
- package/lib/esm/src/misc/base.d.ts +41 -0
- package/lib/esm/src/misc/base.d.ts.map +1 -1
- package/lib/esm/src/runtime/AbstractEngine.d.ts +18 -4
- package/lib/esm/src/runtime/AbstractEngine.d.ts.map +1 -1
- package/lib/esm/src/runtime/Engine.d.ts +17 -3
- package/lib/esm/src/runtime/Engine.d.ts.map +1 -1
- package/lib/esm/src/runtime/GraphLifecycleApi.d.ts +37 -0
- package/lib/esm/src/runtime/GraphLifecycleApi.d.ts.map +1 -0
- package/lib/esm/src/runtime/GraphRuntime.d.ts +29 -29
- package/lib/esm/src/runtime/GraphRuntime.d.ts.map +1 -1
- package/lib/esm/src/runtime/UnifiedEngine.d.ts +32 -0
- package/lib/esm/src/runtime/UnifiedEngine.d.ts.map +1 -0
- package/lib/esm/src/runtime/components/EventEmitter.d.ts +12 -0
- package/lib/esm/src/runtime/components/EventEmitter.d.ts.map +1 -0
- package/lib/esm/src/runtime/components/ExecutionScheduler.d.ts +56 -0
- package/lib/esm/src/runtime/components/ExecutionScheduler.d.ts.map +1 -0
- package/lib/esm/src/runtime/components/GraphStructure.d.ts +36 -0
- package/lib/esm/src/runtime/components/GraphStructure.d.ts.map +1 -0
- package/lib/esm/src/runtime/components/HandleResolver.d.ts +27 -0
- package/lib/esm/src/runtime/components/HandleResolver.d.ts.map +1 -0
- package/lib/esm/src/runtime/components/RunContextManager.d.ts +55 -0
- package/lib/esm/src/runtime/components/RunContextManager.d.ts.map +1 -0
- package/lib/esm/src/runtime/components/ValuePropagator.d.ts +46 -0
- package/lib/esm/src/runtime/components/ValuePropagator.d.ts.map +1 -0
- package/lib/esm/src/runtime/components/interfaces.d.ts +34 -0
- package/lib/esm/src/runtime/components/interfaces.d.ts.map +1 -0
- package/lib/esm/src/runtime/components/types.d.ts +43 -0
- package/lib/esm/src/runtime/components/types.d.ts.map +1 -0
- package/lib/esm/src/runtime/utils.d.ts +16 -0
- package/lib/esm/src/runtime/utils.d.ts.map +1 -0
- package/package.json +2 -2
- package/lib/cjs/src/examples/engine.d.ts +0 -6
- package/lib/cjs/src/examples/engine.d.ts.map +0 -1
- package/lib/cjs/src/runtime/BatchedEngine.d.ts +0 -17
- package/lib/cjs/src/runtime/BatchedEngine.d.ts.map +0 -1
- package/lib/cjs/src/runtime/EngineFactory.d.ts +0 -10
- package/lib/cjs/src/runtime/EngineFactory.d.ts.map +0 -1
- package/lib/cjs/src/runtime/HybridEngine.d.ts +0 -21
- package/lib/cjs/src/runtime/HybridEngine.d.ts.map +0 -1
- package/lib/cjs/src/runtime/PullEngine.d.ts +0 -8
- package/lib/cjs/src/runtime/PullEngine.d.ts.map +0 -1
- package/lib/cjs/src/runtime/PushEngine.d.ts +0 -7
- package/lib/cjs/src/runtime/PushEngine.d.ts.map +0 -1
- package/lib/cjs/src/runtime/StepEngine.d.ts +0 -11
- package/lib/cjs/src/runtime/StepEngine.d.ts.map +0 -1
- package/lib/esm/src/examples/engine.d.ts +0 -6
- package/lib/esm/src/examples/engine.d.ts.map +0 -1
- package/lib/esm/src/runtime/BatchedEngine.d.ts +0 -17
- package/lib/esm/src/runtime/BatchedEngine.d.ts.map +0 -1
- package/lib/esm/src/runtime/EngineFactory.d.ts +0 -10
- package/lib/esm/src/runtime/EngineFactory.d.ts.map +0 -1
- package/lib/esm/src/runtime/HybridEngine.d.ts +0 -21
- package/lib/esm/src/runtime/HybridEngine.d.ts.map +0 -1
- package/lib/esm/src/runtime/PullEngine.d.ts +0 -8
- package/lib/esm/src/runtime/PullEngine.d.ts.map +0 -1
- package/lib/esm/src/runtime/PushEngine.d.ts +0 -7
- package/lib/esm/src/runtime/PushEngine.d.ts.map +0 -1
- package/lib/esm/src/runtime/StepEngine.d.ts +0 -11
- package/lib/esm/src/runtime/StepEngine.d.ts.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { GraphDefinition } from "@bian-womp/spark-protocol";
|
|
2
|
+
/**
|
|
3
|
+
* Computes the forward-reachable subgraph from a starting node.
|
|
4
|
+
* Returns nodes in topological order, starting from the given node.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getForwardOrder(def: GraphDefinition, startId: string): string[];
|
|
7
|
+
//# sourceMappingURL=order.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../../../src/core/order.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,eAAe,EACpB,OAAO,EAAE,MAAM,GACd,MAAM,EAAE,CAiEV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../../src/examples/async.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../../src/examples/async.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAUjE,wBAAgB,mBAAmB,oBAoDlC;AAED,wBAAgB,wBAAwB,CAAC,EAAE,CAAC,EAAE,MAAM,yBAInD;AAED,wBAAsB,IAAI,kBAmCzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../../src/examples/progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AASjE,wBAAgB,sBAAsB,oBAsBrC;AAED,wBAAgB,2BAA2B,CAAC,EAAE,CAAC,EAAE,MAAM,yBAItD;AAED,wBAAsB,IAAI,
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../../src/examples/progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AASjE,wBAAgB,sBAAsB,oBAsBrC;AAED,wBAAgB,2BAA2B,CAAC,EAAE,CAAC,EAAE,MAAM,yBAItD;AAED,wBAAsB,IAAI,kBAyBzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runMode.d.ts","sourceRoot":"","sources":["../../../../src/examples/runMode.ts"],"names":[],"mappings":"AA4QA,wBAAsB,IAAI,kBAuBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/examples/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9E,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACrC,EAAE,EAAE,CAAC,CAAC,SAAS,eAAe,EAC5B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAC5B,IAAI,CAAC;CACX,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/examples/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE9E,wBAAgB,cAAc,CAAC,MAAM,EAAE;IACrC,EAAE,EAAE,CAAC,CAAC,SAAS,eAAe,EAC5B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAC5B,IAAI,CAAC;CACX,QA8DA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../../src/examples/simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"simple.d.ts","sourceRoot":"","sources":["../../../../src/examples/simple.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AA4CjE,wBAAgB,oBAAoB,oBAEnC;AAED,wBAAgB,yBAAyB,CAAC,EAAE,CAAC,EAAE,MAAM,yBAEpD;AAGD,wBAAsB,IAAI,kBAuDzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../../src/examples/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAKjE,wBAAgB,sBAAsB,IAAI,eAAe,CAcxD;AAED,wBAAsB,IAAI,
|
|
1
|
+
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../../src/examples/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAKjE,wBAAgB,sBAAsB,IAAI,eAAe,CAcxD;AAED,wBAAsB,IAAI,kBAiDzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/examples/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,wBAAgB,wBAAwB,IAAI,eAAe,
|
|
1
|
+
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../../src/examples/validation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,wBAAgB,wBAAwB,IAAI,eAAe,CA0C1D;AAED,wBAAgB,6BAA6B,CAAC,EAAE,CAAC,EAAE,MAAM,yBAGxD;AAED,wBAAsB,IAAI,kBA2DzB"}
|
package/lib/cjs/src/index.d.ts
CHANGED
|
@@ -6,13 +6,10 @@ export { GraphBuilder } from "./builder/GraphBuilder";
|
|
|
6
6
|
export type { ValidationIssue, ValidationReport } from "./builder/GraphBuilder";
|
|
7
7
|
export { GraphRuntime } from "./runtime/GraphRuntime";
|
|
8
8
|
export type { RuntimeEventName, RuntimeEventMap } from "./runtime/GraphRuntime";
|
|
9
|
+
export type { RuntimeNode, RuntimeEdge, RunContext, RunContextId, } from "./runtime/components/types";
|
|
9
10
|
export type { Engine, EngineEventListener, EngineEventMap, EngineEventName, } from "./runtime/Engine";
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { PullEngine } from "./runtime/PullEngine";
|
|
13
|
-
export { HybridEngine } from "./runtime/HybridEngine";
|
|
14
|
-
export { StepEngine } from "./runtime/StepEngine";
|
|
15
|
-
export { createEngine } from "./runtime/EngineFactory";
|
|
11
|
+
export { UnifiedEngine } from "./runtime/UnifiedEngine";
|
|
12
|
+
export type { GraphLifecycleApi } from "./runtime/GraphLifecycleApi";
|
|
16
13
|
export { ComputeCategory } from "./plugins/compute";
|
|
17
14
|
export { CompositeCategory } from "./plugins/composite";
|
|
18
15
|
export { createSimpleGraphRegistry, createSimpleGraphDef, } from "./examples/simple";
|
|
@@ -20,7 +17,7 @@ export { createAsyncGraphRegistry, createAsyncGraphDef, } from "./examples/async
|
|
|
20
17
|
export { createProgressGraphRegistry, createProgressGraphDef, } from "./examples/progress";
|
|
21
18
|
export { createValidationGraphRegistry, createValidationGraphDef, } from "./examples/validation";
|
|
22
19
|
export { installLogging } from "./examples/shared";
|
|
23
|
-
export { registerDelayNode, registerProgressNodes, generateId, } from "./misc/base";
|
|
20
|
+
export { registerDelayNode, registerProgressNodes, generateId, BaseMathOperation, BaseCompareOperation, BaseLogicOperation, } from "./misc/base";
|
|
24
21
|
export { mergeGraphDefinitions, computeGraphCenter, offsetImportedPositions, mergeInputsOutputs, mergeSnapshotData, mergeRuntimeState, buildValueConverter, type ConverterConfig, type ValueMappingConfig, type ValueConverter, type ValueConverterConfig, } from "./misc/utils/merge";
|
|
25
22
|
export { parseJsonPath, getValueAtPath, setValueAtPath, findMatchingPaths, type JsonPath, type PathSegment, } from "./misc/utils/json";
|
|
26
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,gBAA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,WAAW,EACX,UAAU,EACV,YAAY,GACb,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACV,MAAM,EACN,mBAAmB,EACnB,cAAc,EACd,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,YAAY,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,2BAA2B,EAC3B,sBAAsB,GACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,6BAA6B,EAC7B,wBAAwB,GACzB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EACL,iBAAiB,EACjB,qBAAqB,EACrB,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,oBAAoB,GAC1B,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,KAAK,QAAQ,EACb,KAAK,WAAW,GACjB,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
import type { GraphDefinition } from "@bian-womp/spark-protocol";
|
|
2
2
|
import { Registry } from "../builder/Registry";
|
|
3
|
+
export declare const BaseMathOperation: {
|
|
4
|
+
readonly Add: 0;
|
|
5
|
+
readonly Subtract: 1;
|
|
6
|
+
readonly Multiply: 2;
|
|
7
|
+
readonly Divide: 3;
|
|
8
|
+
readonly Min: 4;
|
|
9
|
+
readonly Max: 5;
|
|
10
|
+
readonly Modulo: 6;
|
|
11
|
+
readonly Power: 7;
|
|
12
|
+
readonly Round: 8;
|
|
13
|
+
readonly Floor: 9;
|
|
14
|
+
readonly Ceil: 10;
|
|
15
|
+
readonly Abs: 11;
|
|
16
|
+
readonly Sum: 12;
|
|
17
|
+
readonly Avg: 13;
|
|
18
|
+
readonly MinAll: 14;
|
|
19
|
+
readonly MaxAll: 15;
|
|
20
|
+
readonly Sin: 16;
|
|
21
|
+
readonly Cos: 17;
|
|
22
|
+
readonly Tan: 18;
|
|
23
|
+
readonly Asin: 19;
|
|
24
|
+
readonly Acos: 20;
|
|
25
|
+
readonly Atan: 21;
|
|
26
|
+
readonly Sqrt: 22;
|
|
27
|
+
readonly Exp: 23;
|
|
28
|
+
readonly Log: 24;
|
|
29
|
+
};
|
|
30
|
+
export declare const BaseCompareOperation: {
|
|
31
|
+
readonly LessThan: 0;
|
|
32
|
+
readonly LessThanOrEqual: 1;
|
|
33
|
+
readonly GreaterThan: 2;
|
|
34
|
+
readonly GreaterThanOrEqual: 3;
|
|
35
|
+
readonly Equal: 4;
|
|
36
|
+
readonly NotEqual: 5;
|
|
37
|
+
};
|
|
38
|
+
export declare const BaseLogicOperation: {
|
|
39
|
+
readonly Not: 0;
|
|
40
|
+
readonly And: 1;
|
|
41
|
+
readonly Or: 2;
|
|
42
|
+
readonly Xor: 3;
|
|
43
|
+
};
|
|
3
44
|
export declare function setupBasicGraphRegistry(id?: string): Registry;
|
|
4
45
|
export declare function registerDelayNode(registry: Registry): void;
|
|
5
46
|
export declare function registerProgressNodes(registry: Registry): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/misc/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../../src/misc/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAiJ/C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BpB,CAAC;AAEX,eAAO,MAAM,oBAAoB;;;;;;;CAOvB,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;CAKrB,CAAC;AAEX,wBAAgB,uBAAuB,CAAC,EAAE,CAAC,EAAE,MAAM,GAAG,QAAQ,CAu5B7D;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,QA+BnD;AAqBD,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,QA6BvD;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,eAAe,6BAUrE;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,EACd,IAAI,GAAE,GAAG,CAAC,MAAM,CAAa,GAC5B,MAAM,CAaR"}
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
+
import { RunMode } from "@bian-womp/spark-protocol";
|
|
1
2
|
import type { Engine, EngineEventListener, EngineEventName } from "./Engine";
|
|
2
3
|
import { GraphRuntime } from "./GraphRuntime";
|
|
3
4
|
export declare abstract class AbstractEngine implements Engine {
|
|
4
|
-
graphRuntime: GraphRuntime;
|
|
5
|
+
protected readonly graphRuntime: GraphRuntime;
|
|
5
6
|
constructor(graphRuntime: GraphRuntime);
|
|
6
|
-
launch(
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
abstract launch(): void;
|
|
8
|
+
abstract setRunMode(runMode: RunMode): void;
|
|
9
|
+
abstract computeNode(nodeId: string, options?: {
|
|
10
|
+
skipPropagateValues?: boolean;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
abstract runFromHere(nodeId: string): Promise<void>;
|
|
13
|
+
setInputs(nodeId: string, inputs: Record<string, unknown>, options?: {
|
|
14
|
+
dry?: boolean;
|
|
15
|
+
}): void;
|
|
16
|
+
triggerExternal(nodeId: string, event: unknown, options?: {
|
|
17
|
+
dry?: boolean;
|
|
18
|
+
}): void;
|
|
9
19
|
on<K extends EngineEventName>(event: K, handler: EngineEventListener<K>): () => void;
|
|
10
20
|
getOutput(nodeId: string, output: string): unknown;
|
|
11
21
|
whenIdle(): Promise<void>;
|
|
22
|
+
cancelNodeRuns(nodeIds: string[]): void;
|
|
23
|
+
copyOutputs(fromNodeId: string, toNodeId: string, options?: {
|
|
24
|
+
dry?: boolean;
|
|
25
|
+
}): void;
|
|
12
26
|
dispose(): void;
|
|
13
27
|
}
|
|
14
28
|
//# sourceMappingURL=AbstractEngine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AbstractEngine.d.ts","sourceRoot":"","sources":["../../../../src/runtime/AbstractEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,8BAAsB,cAAe,YAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"AbstractEngine.d.ts","sourceRoot":"","sources":["../../../../src/runtime/AbstractEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAg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1,14 +1,28 @@
|
|
|
1
|
+
import type { RunMode } from "@bian-womp/spark-protocol";
|
|
1
2
|
import type { RuntimeEventName, RuntimeEventListener, RuntimeEventMap } from "./GraphRuntime";
|
|
2
3
|
export type EngineEventName = RuntimeEventName;
|
|
3
4
|
export type EngineEventListener<K extends EngineEventName> = RuntimeEventListener<K>;
|
|
4
5
|
export type EngineEventMap = RuntimeEventMap;
|
|
5
6
|
export interface Engine {
|
|
6
|
-
launch(
|
|
7
|
-
setInputs(nodeId: string, inputs: Record<string, unknown
|
|
8
|
-
|
|
7
|
+
launch(): void;
|
|
8
|
+
setInputs(nodeId: string, inputs: Record<string, unknown>, options?: {
|
|
9
|
+
dry?: boolean;
|
|
10
|
+
}): void;
|
|
11
|
+
triggerExternal(nodeId: string, event: unknown, options?: {
|
|
12
|
+
dry?: boolean;
|
|
13
|
+
}): void;
|
|
14
|
+
setRunMode(runMode: RunMode): void;
|
|
9
15
|
on<K extends EngineEventName>(event: K, handler: EngineEventListener<K>): () => void;
|
|
10
16
|
getOutput(nodeId: string, output: string): unknown;
|
|
11
17
|
whenIdle(): Promise<void>;
|
|
18
|
+
runFromHere(nodeId: string): Promise<void>;
|
|
19
|
+
computeNode(nodeId: string, options?: {
|
|
20
|
+
skipPropagateValues?: boolean;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
cancelNodeRuns(nodeIds: string[]): void | Promise<void>;
|
|
23
|
+
copyOutputs(fromNodeId: string, toNodeId: string, options?: {
|
|
24
|
+
dry?: boolean;
|
|
25
|
+
}): void | Promise<void>;
|
|
12
26
|
dispose(): void;
|
|
13
27
|
}
|
|
14
28
|
//# sourceMappingURL=Engine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Engine.d.ts","sourceRoot":"","sources":["../../../../src/runtime/Engine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,eAAe,EAChB,MAAM,gBAAgB,CAAC;AAExB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,OAAO,CAAC;IACnD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3C,WAAW,CACT,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1C,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,WAAW,CACT,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1B,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxB,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { GraphDefinition, RegistryDescriptor, RegistryDelta, RuntimeSnapshot, RuntimeSnapshotFull, RunnerOptions, RuntimeHistoryInfo, Viewport } from "@bian-womp/spark-protocol";
|
|
2
|
+
/**
|
|
3
|
+
* GraphLifecycleApi interface for non-execution operations.
|
|
4
|
+
* These operations manage graph lifecycle, snapshots, registry, environment, etc.
|
|
5
|
+
* Execution operations are handled by the Engine interface.
|
|
6
|
+
*
|
|
7
|
+
* This interface can be implemented by both local and remote graph runtimes.
|
|
8
|
+
*/
|
|
9
|
+
export interface GraphLifecycleApi {
|
|
10
|
+
build(def: GraphDefinition, opts?: {
|
|
11
|
+
environment?: Record<string, unknown>;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
update(def: GraphDefinition, options?: {
|
|
14
|
+
dry?: boolean;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
launch(opts?: RunnerOptions): Promise<void>;
|
|
17
|
+
snapshot(): Promise<RuntimeSnapshot>;
|
|
18
|
+
snapshotFull(): Promise<RuntimeSnapshotFull>;
|
|
19
|
+
applySnapshotFull(payload: RuntimeSnapshotFull, options?: {
|
|
20
|
+
skipBuild?: boolean;
|
|
21
|
+
}): Promise<void>;
|
|
22
|
+
describeRegistry(): Promise<RegistryDescriptor>;
|
|
23
|
+
applyRegistry(deltas: RegistryDelta[]): Promise<void>;
|
|
24
|
+
setEnvironment(environment: Record<string, unknown>, opts?: {
|
|
25
|
+
merge?: boolean;
|
|
26
|
+
dry?: boolean;
|
|
27
|
+
}): Promise<void>;
|
|
28
|
+
getEnvironment(): Promise<Record<string, unknown>>;
|
|
29
|
+
coerce(from: string, to: string, value: unknown): Promise<unknown>;
|
|
30
|
+
setExtData(data: Record<string, unknown>): Promise<void>;
|
|
31
|
+
getExtData(): Promise<Record<string, unknown>>;
|
|
32
|
+
setViewport(viewport: Viewport): Promise<void>;
|
|
33
|
+
commit(reason?: string): Promise<RuntimeHistoryInfo | undefined>;
|
|
34
|
+
undo(): Promise<boolean>;
|
|
35
|
+
redo(): Promise<boolean>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=GraphLifecycleApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphLifecycleApi.d.ts","sourceRoot":"","sources":["../../../../src/runtime/GraphLifecycleApi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,kBAAkB,EAClB,aAAa,EACb,eAAe,EACf,mBAAmB,EACnB,aAAa,EACb,kBAAkB,EAClB,QAAQ,EACT,MAAM,2BAA2B,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAEhC,KAAK,CACH,GAAG,EAAE,eAAe,EACpB,IAAI,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,GAC/C,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,OAA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AAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IACjE,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RuntimeValue, RuntimeInvalidate, RuntimeError, RuntimeStats, ResolvedHandles, GraphDefinition } from "@bian-womp/spark-protocol";
|
|
2
2
|
import type { RuntimeNodeStats } from "../core/types";
|
|
3
3
|
import { Registry } from "../builder/Registry";
|
|
4
|
+
import type { IRuntimeCoordinator } from "./components/interfaces";
|
|
4
5
|
export type RuntimeEventListener<K extends RuntimeEventName> = (e: RuntimeEventMap[K]) => void;
|
|
5
6
|
export type RuntimeEventName = "value" | "invalidate" | "error" | "stats";
|
|
6
7
|
export interface RuntimeEventMap {
|
|
@@ -9,34 +10,22 @@ export interface RuntimeEventMap {
|
|
|
9
10
|
error: RuntimeError;
|
|
10
11
|
stats: RuntimeStats;
|
|
11
12
|
}
|
|
12
|
-
export declare class GraphRuntime {
|
|
13
|
-
private
|
|
14
|
-
private
|
|
15
|
-
private
|
|
16
|
-
private
|
|
17
|
-
private
|
|
18
|
-
private
|
|
19
|
-
private recomputeTokenByNode;
|
|
13
|
+
export declare class GraphRuntime implements IRuntimeCoordinator {
|
|
14
|
+
private graphStructure;
|
|
15
|
+
private eventEmitter;
|
|
16
|
+
private runContextManager;
|
|
17
|
+
private handleResolver;
|
|
18
|
+
private valuePropagator;
|
|
19
|
+
private executionScheduler;
|
|
20
20
|
private paused;
|
|
21
|
-
private
|
|
22
|
-
|
|
21
|
+
private environment;
|
|
22
|
+
constructor();
|
|
23
23
|
static create(def: GraphDefinition, registry: Registry, opts?: {
|
|
24
24
|
environment?: Record<string, unknown>;
|
|
25
25
|
}): GraphRuntime;
|
|
26
26
|
on<K extends RuntimeEventName>(event: K, handler: RuntimeEventListener<K>): () => void;
|
|
27
|
-
private emit;
|
|
28
27
|
setInputs(nodeId: string, inputs: Record<string, unknown>): void;
|
|
29
28
|
getOutput(nodeId: string, output: string): unknown;
|
|
30
|
-
private static buildEdgeConverters;
|
|
31
|
-
private createExecutionContext;
|
|
32
|
-
private scheduleInputsChangedInternal;
|
|
33
|
-
private allInboundHaveValue;
|
|
34
|
-
private getEffectiveInputs;
|
|
35
|
-
private invalidateDownstreamInternal;
|
|
36
|
-
private propagate;
|
|
37
|
-
private static computeResolvedHandleMap;
|
|
38
|
-
private static buildEdges;
|
|
39
|
-
private reemitNodeOutputs;
|
|
40
29
|
updateNodeHandles(nodeId: string, handles: ResolvedHandles, registry: Registry): void;
|
|
41
30
|
launch(invalidate?: boolean): void;
|
|
42
31
|
triggerExternal(nodeId: string, event: unknown): void;
|
|
@@ -53,18 +42,31 @@ export declare class GraphRuntime {
|
|
|
53
42
|
setEnvironment(env: Record<string, unknown>): void;
|
|
54
43
|
getGraphDef(): GraphDefinition;
|
|
55
44
|
whenIdle(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Run this node and optionally all dynamically reachable downstream nodes as a run-context.
|
|
47
|
+
* Includes nodes added later behind the same path (via re-emits).
|
|
48
|
+
* @param startNodeId - The node to start execution from
|
|
49
|
+
* @param options - Execution options
|
|
50
|
+
* @param options.skipPropagateValues - If true, don't set inputs of linked nodes (default: false)
|
|
51
|
+
* @param options.propagate - If false, don't schedule downstream nodes (default: true)
|
|
52
|
+
*/
|
|
53
|
+
runFromHereContext(startNodeId: string, options?: {
|
|
54
|
+
skipPropagateValues?: boolean;
|
|
55
|
+
propagate?: boolean;
|
|
56
|
+
}): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Schedule a node with run-context IDs attached
|
|
59
|
+
*/
|
|
60
|
+
private scheduleInputsChangedWithRunContexts;
|
|
56
61
|
pause(): void;
|
|
57
62
|
isPaused(): boolean;
|
|
58
63
|
resume(): void;
|
|
59
64
|
invalidateDownstream(nodeId: string): void;
|
|
60
65
|
scheduleInputsChanged(nodeId: string): void;
|
|
61
|
-
/**
|
|
62
|
-
* Cancel all active runs for a node and emit cancellation events
|
|
63
|
-
* @param node - The node to cancel runs for
|
|
64
|
-
* @param reason - The cancellation reason ("snapshot" | "node-deleted")
|
|
65
|
-
*/
|
|
66
|
-
private cancelNodeActiveRuns;
|
|
67
66
|
cancelNodeRuns(nodeIds: string[]): void;
|
|
67
|
+
copyOutputs(fromNodeId: string, toNodeId: string, options?: {
|
|
68
|
+
dry?: boolean;
|
|
69
|
+
}): void;
|
|
68
70
|
hydrate(payload: {
|
|
69
71
|
inputs?: Record<string, Record<string, unknown>>;
|
|
70
72
|
outputs?: Record<string, Record<string, unknown>>;
|
|
@@ -72,7 +74,5 @@ export declare class GraphRuntime {
|
|
|
72
74
|
reemit?: boolean;
|
|
73
75
|
}): void;
|
|
74
76
|
update(def: GraphDefinition, registry: Registry): void;
|
|
75
|
-
private scheduleRecomputeHandles;
|
|
76
|
-
private recomputeHandlesForNode;
|
|
77
77
|
}
|
|
78
78
|
//# sourceMappingURL=GraphRuntime.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GraphRuntime.d.ts","sourceRoot":"","sources":["../../../../src/runtime/GraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,
|
|
1
|
+
{"version":3,"file":"GraphRuntime.d.ts","sourceRoot":"","sources":["../../../../src/runtime/GraphRuntime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,eAAe,EAGhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAoB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAExE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAO/C,OAAO,KAAK,EAAE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AM,EAClB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;QAAE,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1B,IAAI;IAeP,OAAO,CACL,OAAO,EAAE;QACP,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACjD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACnD,EACD,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1B,IAAI;IA+CP,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;CAoQvD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { RunMode } from "@bian-womp/spark-protocol";
|
|
2
|
+
import { AbstractEngine } from "./AbstractEngine";
|
|
3
|
+
import { GraphRuntime } from "./GraphRuntime";
|
|
4
|
+
/**
|
|
5
|
+
* Unified Engine implementation that handles both manual and auto run modes.
|
|
6
|
+
* - Manual mode: Runtime is paused, nodes execute only when explicitly called via computeNode/runFromHere
|
|
7
|
+
* - Auto mode: Runtime is resumed, nodes automatically execute when inputs change
|
|
8
|
+
*/
|
|
9
|
+
export declare class UnifiedEngine extends AbstractEngine {
|
|
10
|
+
private runMode;
|
|
11
|
+
constructor(graphRuntime: GraphRuntime, runMode?: RunMode);
|
|
12
|
+
launch(invalidate?: boolean, runMode?: RunMode): void;
|
|
13
|
+
/**
|
|
14
|
+
* Run only this node, no downstream propagation.
|
|
15
|
+
* Works in both modes, but typically only used in manual mode.
|
|
16
|
+
* @param nodeId - The node to run
|
|
17
|
+
* @param options - Execution options
|
|
18
|
+
* @param options.skipPropagateValues - If true, don't set inputs of linked nodes (default: false)
|
|
19
|
+
*/
|
|
20
|
+
computeNode(nodeId: string, options?: {
|
|
21
|
+
skipPropagateValues?: boolean;
|
|
22
|
+
}): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Run this node and all dynamically reachable downstream nodes.
|
|
25
|
+
* Works in both modes, but typically only used in manual mode.
|
|
26
|
+
* Uses run-context system for dynamic graph updates.
|
|
27
|
+
*/
|
|
28
|
+
runFromHere(nodeId: string): Promise<void>;
|
|
29
|
+
getRunMode(): RunMode;
|
|
30
|
+
setRunMode(runMode: RunMode): void;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=UnifiedEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnifiedEngine.d.ts","sourceRoot":"","sources":["../../../../src/runtime/UnifiedEngine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C;;;;GAIG;AACH,qBAAa,aAAc,SAAQ,cAAc;IAC/C,OAAO,CAAC,OAAO,CAAqB;gBAExB,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,OAAO;IAKhD,MAAM,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI;IAK9D;;;;;;OAMG;IACG,WAAW,CACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE;QAAE,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAAE,GAC1C,OAAO,CAAC,IAAI,CAAC;IAOhB;;;;OAIG;IACG,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAIhD,UAAU,IAAI,OAAO;IAIrB,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI;CAYnC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RuntimeEventName, RuntimeEventMap, RuntimeEventListener } from "../GraphRuntime";
|
|
2
|
+
/**
|
|
3
|
+
* Event emitter component for GraphRuntime
|
|
4
|
+
* Handles all event listener management and emission
|
|
5
|
+
*/
|
|
6
|
+
export declare class EventEmitter {
|
|
7
|
+
private listeners;
|
|
8
|
+
on<K extends RuntimeEventName>(event: K, handler: RuntimeEventListener<K>): () => void;
|
|
9
|
+
emit<K extends RuntimeEventName>(event: K, payload: RuntimeEventMap[K]): void;
|
|
10
|
+
clear(): void;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=EventEmitter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEmitter.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/components/EventEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB;;;GAGG;AACH,qBAAa,YAAY;IACvB,OAAO,CAAC,SAAS,CAGb;IAEJ,EAAE,CAAC,CAAC,SAAS,gBAAgB,EAC3B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAC/B,MAAM,IAAI;IAOb,IAAI,CAAC,CAAC,SAAS,gBAAgB,EAC7B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,eAAe,CAAC,CAAC,CAAC,GAC1B,IAAI;IAYP,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { ExecutionContext } from "../../core/types";
|
|
2
|
+
import type { RuntimeNode, RunContextId } from "./types";
|
|
3
|
+
import type { GraphStructure } from "./GraphStructure";
|
|
4
|
+
import type { EventEmitter } from "./EventEmitter";
|
|
5
|
+
import type { RunContextManager } from "./RunContextManager";
|
|
6
|
+
import { IValuePropagator, IRuntimeCoordinator } from "./interfaces";
|
|
7
|
+
/**
|
|
8
|
+
* ExecutionScheduler component - handles node execution scheduling and lifecycle
|
|
9
|
+
*/
|
|
10
|
+
export declare class ExecutionScheduler {
|
|
11
|
+
private graphStructure;
|
|
12
|
+
private eventEmitter;
|
|
13
|
+
private runContextManager;
|
|
14
|
+
private valuePropagator;
|
|
15
|
+
private runtimeCoordinator;
|
|
16
|
+
private environment;
|
|
17
|
+
constructor(graphStructure: GraphStructure, eventEmitter: EventEmitter, runContextManager: RunContextManager, valuePropagator: IValuePropagator, runtimeCoordinator: IRuntimeCoordinator, environment?: Record<string, unknown>);
|
|
18
|
+
setEnvironment(environment: Record<string, unknown>): void;
|
|
19
|
+
/**
|
|
20
|
+
* Check if all inbound edges for a node have values
|
|
21
|
+
*/
|
|
22
|
+
allInboundHaveValue(nodeId: string): boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Compute effective inputs for a node by merging real inputs with defaults
|
|
25
|
+
*/
|
|
26
|
+
getEffectiveInputs(nodeId: string): Record<string, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* Create an execution context for a node
|
|
29
|
+
*/
|
|
30
|
+
createExecutionContext(nodeId: string, node: RuntimeNode<any>, inputs: Record<string, unknown>, runId: string, abortSignal: AbortSignal, runContextIds?: Set<RunContextId>, options?: {
|
|
31
|
+
emitHandler?: (handle: string, value: unknown) => void;
|
|
32
|
+
reportProgress?: (p: number) => void;
|
|
33
|
+
}): ExecutionContext<any>;
|
|
34
|
+
/**
|
|
35
|
+
* Schedule a node for execution when its inputs change
|
|
36
|
+
*/
|
|
37
|
+
scheduleInputsChanged(nodeId: string): void;
|
|
38
|
+
/**
|
|
39
|
+
* Schedule a node for execution with run-context IDs
|
|
40
|
+
*/
|
|
41
|
+
scheduleInputsChangedWithRunContexts(nodeId: string, runContextIds: Set<RunContextId>): void;
|
|
42
|
+
/**
|
|
43
|
+
* Internal method for scheduling (also used by GraphRuntime)
|
|
44
|
+
*/
|
|
45
|
+
scheduleInputsChangedInternal(nodeId: string, runContextIds?: Set<RunContextId>): void;
|
|
46
|
+
/**
|
|
47
|
+
* Cancel all active runs for a node
|
|
48
|
+
*/
|
|
49
|
+
cancelNodeActiveRuns(node: RuntimeNode, reason: "snapshot" | "node-deleted" | "user-cancelled"): void;
|
|
50
|
+
/**
|
|
51
|
+
* Cancel runs for multiple nodes.
|
|
52
|
+
* Can be called for snapshot/undo/redo operations or user-initiated cancellation.
|
|
53
|
+
*/
|
|
54
|
+
cancelNodeRuns(nodeIds: string[], reason?: "snapshot" | "user-cancelled"): void;
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=ExecutionScheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecutionScheduler.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/components/ExecutionScheduler.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAErE;;GAEG;AACH,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,eAAe,CAAmB;IAC1C,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,WAAW,CAA+B;gBAGhD,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,eAAe,EAAE,gBAAgB,EACjC,kBAAkB,EAAE,mBAAmB,EACvC,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;I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
|
|
|
1
|
+
import type { GraphDefinition, ResolvedHandles } from "@bian-womp/spark-protocol";
|
|
2
|
+
import { Registry } from "../../builder/Registry";
|
|
3
|
+
import type { RuntimeNode, RuntimeEdge } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* GraphStructure component - manages nodes, edges, and handle resolution
|
|
6
|
+
*/
|
|
7
|
+
export declare class GraphStructure {
|
|
8
|
+
private nodes;
|
|
9
|
+
private edges;
|
|
10
|
+
private registry?;
|
|
11
|
+
private resolvedByNode;
|
|
12
|
+
constructor(registry?: Registry);
|
|
13
|
+
getNode(nodeId: string): RuntimeNode<any> | undefined;
|
|
14
|
+
getNodes(): Map<string, RuntimeNode<any>>;
|
|
15
|
+
setNode(nodeId: string, node: RuntimeNode<any>): void;
|
|
16
|
+
deleteNode(nodeId: string): void;
|
|
17
|
+
hasNode(nodeId: string): boolean;
|
|
18
|
+
getEdges(): RuntimeEdge[];
|
|
19
|
+
setEdges(edges: RuntimeEdge[]): void;
|
|
20
|
+
getRegistry(): Registry | undefined;
|
|
21
|
+
setRegistry(registry: Registry): void;
|
|
22
|
+
getResolvedHandles(nodeId: string): ResolvedHandles | undefined;
|
|
23
|
+
setResolvedHandles(nodeId: string, handles: ResolvedHandles): void;
|
|
24
|
+
getResolvedHandlesMap(): Map<string, ResolvedHandles>;
|
|
25
|
+
static computeResolvedHandleMap(def: GraphDefinition, registry: Registry, environment?: Record<string, unknown>): {
|
|
26
|
+
map: Map<string, ResolvedHandles>;
|
|
27
|
+
pending: Set<string>;
|
|
28
|
+
};
|
|
29
|
+
static buildEdges(def: GraphDefinition, registry: Registry, resolvedByNode: Map<string, ResolvedHandles>): RuntimeEdge[];
|
|
30
|
+
clear(): void;
|
|
31
|
+
static buildEdgeConverters(srcDeclared: string | string[] | undefined, dstDeclared: string | undefined, registry: Registry, edgeLabel: string): {
|
|
32
|
+
convert?: (v: unknown) => unknown;
|
|
33
|
+
convertAsync?: (v: unknown, signal: AbortSignal) => Promise<unknown>;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=GraphStructure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GraphStructure.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/components/GraphStructure.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAMlD,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAGxD;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,KAAK,CAAuC;IACpD,OAAO,CAAC,KAAK,CAAqB;IAClC,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,cAAc,CAAsC;gBAEhD,QAAQ,CAAC,EAAE,QAAQ;IAK/B,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,SAAS;IAIrD,QAAQ,IAAI,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC;IAIzC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI;IAIrD,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIhC,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAKhC,QAAQ,IAAI,WAAW,EAAE;IAIzB,QAAQ,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI;IAKpC,WAAW,IAAI,QAAQ,GAAG,SAAS;IAInC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAKrC,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS;IAI/D,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAIlE,qBAAqB,IAAI,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC;IAKrD,MAAM,CAAC,wBAAwB,CAC7B,GAAG,EAAE,eAAe,EACpB,QAAQ,EAAE,QAAQ,EAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACpC;QAAE,GAAG,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;QAAC,OAAO,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;KAAE;IAoD9D,MAAM,CAAC,UAAU,CACf,GAAG,EAAE,eAAe,EACpB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GAC3C,WAAW,EAAE;IAgDhB,KAAK,IAAI,IAAI;IAOb,MAAM,CAAC,mBAAmB,CACxB,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,EAC1C,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,GAChB;QACD,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC;QAClC,YAAY,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;KACtE;CAmFF"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Registry } from "../../builder/Registry";
|
|
2
|
+
import type { GraphStructure } from "./GraphStructure";
|
|
3
|
+
import type { EventEmitter } from "./EventEmitter";
|
|
4
|
+
import type { IRuntimeCoordinator } from "./interfaces";
|
|
5
|
+
/**
|
|
6
|
+
* HandleResolver component - manages dynamic handle resolution
|
|
7
|
+
*/
|
|
8
|
+
export declare class HandleResolver {
|
|
9
|
+
private recomputeTokenByNode;
|
|
10
|
+
private graphStructure;
|
|
11
|
+
private eventEmitter;
|
|
12
|
+
private runtimeCoordinator;
|
|
13
|
+
private registry?;
|
|
14
|
+
private environment;
|
|
15
|
+
constructor(graphStructure: GraphStructure, eventEmitter: EventEmitter, runtimeCoordinator: IRuntimeCoordinator, registry?: Registry, environment?: Record<string, unknown>);
|
|
16
|
+
setRegistry(registry: Registry): void;
|
|
17
|
+
setEnvironment(environment: Record<string, unknown>): void;
|
|
18
|
+
/**
|
|
19
|
+
* Schedule async recomputation of handles for a node
|
|
20
|
+
*/
|
|
21
|
+
scheduleRecomputeHandles(nodeId: string): void;
|
|
22
|
+
/**
|
|
23
|
+
* Recompute dynamic handles for a single node using current inputs/environment
|
|
24
|
+
*/
|
|
25
|
+
private recomputeHandlesForNode;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=HandleResolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HandleResolver.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/components/HandleResolver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAGxD;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,oBAAoB,CAA6B;IACzD,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,QAAQ,CAAC,CAAW;IAC5B,OAAO,CAAC,WAAW,CAA+B;gBAGhD,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,mBAAmB,EACvC,QAAQ,CAAC,EAAE,QAAQ,EACnB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IASvC,WAAW,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAIrC,cAAc,CAAC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAI1D;;OAEG;IACH,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAU9C;;OAEG;YACW,uBAAuB;CA2EtC"}
|