@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,55 @@
|
|
|
1
|
+
import type { RunContext, RunContextId, RuntimeNode } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* RunContextManager component - manages run-context lifecycle
|
|
4
|
+
*/
|
|
5
|
+
export declare class RunContextManager {
|
|
6
|
+
private runContexts;
|
|
7
|
+
private runContextCounter;
|
|
8
|
+
/**
|
|
9
|
+
* Create a new run-context for runFromHere
|
|
10
|
+
*/
|
|
11
|
+
createRunContext(startNodeId: string, options?: {
|
|
12
|
+
skipPropagateValues?: boolean;
|
|
13
|
+
propagate?: boolean;
|
|
14
|
+
}): RunContext;
|
|
15
|
+
/**
|
|
16
|
+
* Get a run-context by ID
|
|
17
|
+
*/
|
|
18
|
+
getRunContext(id: RunContextId): RunContext | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Get all run-contexts
|
|
21
|
+
*/
|
|
22
|
+
getAllRunContexts(): Map<RunContextId, RunContext>;
|
|
23
|
+
/**
|
|
24
|
+
* Check if there are any active run-contexts
|
|
25
|
+
*/
|
|
26
|
+
hasActiveRunContexts(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Finish and remove a run-context when its pending count reaches zero
|
|
29
|
+
*/
|
|
30
|
+
finishRunContext(id: RunContextId, nodes: Map<string, RuntimeNode<any>>): void;
|
|
31
|
+
/**
|
|
32
|
+
* Cancel a node for all run-contexts (called from UI or update())
|
|
33
|
+
* @param nodeId - The node to cancel
|
|
34
|
+
* @param includeDownstream - Whether to also cancel downstream nodes
|
|
35
|
+
* @param edges - All edges in the graph (for downstream traversal)
|
|
36
|
+
* @param nodes - All nodes in the graph (for clearing activeRunContexts)
|
|
37
|
+
*/
|
|
38
|
+
cancelNodeInRunContexts(nodeId: string, includeDownstream: boolean, edges: Array<{
|
|
39
|
+
source: {
|
|
40
|
+
nodeId: string;
|
|
41
|
+
};
|
|
42
|
+
target: {
|
|
43
|
+
nodeId: string;
|
|
44
|
+
};
|
|
45
|
+
}>, nodes: Map<string, RuntimeNode<any>>): void;
|
|
46
|
+
/**
|
|
47
|
+
* Resolve all pending run-context promises (for cleanup)
|
|
48
|
+
*/
|
|
49
|
+
resolveAll(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Clear all run-contexts
|
|
52
|
+
*/
|
|
53
|
+
clear(): void;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=RunContextManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RunContextManager.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/components/RunContextManager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAErE;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,WAAW,CAAuC;IAC1D,OAAO,CAAC,iBAAiB,CAAK;IAE9B;;OAEG;IACH,gBAAgB,CACd,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE;QACR,mBAAmB,CAAC,EAAE,OAAO,CAAC;QAC9B,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,GACA,UAAU;IAcb;;OAEG;IACH,aAAa,CAAC,EAAE,EAAE,YAAY,GAAG,UAAU,GAAG,SAAS;IAIvD;;OAEG;IACH,iBAAiB,IAAI,GAAG,CAAC,YAAY,EAAE,UAAU,CAAC;IAIlD;;OAEG;IACH,oBAAoB,IAAI,OAAO;IAI/B;;OAEG;IACH,gBAAgB,CACd,EAAE,EAAE,YAAY,EAChB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,GACnC,IAAI;IAcP;;;;;;OAMG;IACH,uBAAuB,CACrB,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,OAAO,EAC1B,KAAK,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,MAAM,EAAE;YAAE,MAAM,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC,EACxE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,GACnC,IAAI;IAoCP;;OAEG;IACH,UAAU,IAAI,IAAI;IAMlB;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { RunContextId } from "./types";
|
|
2
|
+
import type { GraphStructure } from "./GraphStructure";
|
|
3
|
+
import type { EventEmitter } from "./EventEmitter";
|
|
4
|
+
import type { RunContextManager } from "./RunContextManager";
|
|
5
|
+
import { IExecutionScheduler, IHandleResolver, IRuntimeCoordinator } from "./interfaces";
|
|
6
|
+
/**
|
|
7
|
+
* ValuePropagator component - handles value propagation through edges
|
|
8
|
+
*/
|
|
9
|
+
export declare class ValuePropagator {
|
|
10
|
+
private graphStructure;
|
|
11
|
+
private eventEmitter;
|
|
12
|
+
private runContextManager;
|
|
13
|
+
private executionScheduler;
|
|
14
|
+
private handleResolver;
|
|
15
|
+
private runtimeCoordinator;
|
|
16
|
+
private arrayInputBuckets;
|
|
17
|
+
constructor(graphStructure: GraphStructure, eventEmitter: EventEmitter, runContextManager: RunContextManager, handleResolver: IHandleResolver, runtimeCoordinator: IRuntimeCoordinator);
|
|
18
|
+
/**
|
|
19
|
+
* Set the execution scheduler (called after construction to resolve circular dependency)
|
|
20
|
+
*/
|
|
21
|
+
setExecutionScheduler(executionScheduler: IExecutionScheduler): void;
|
|
22
|
+
/**
|
|
23
|
+
* Propagate value through edges
|
|
24
|
+
* @param runContextIds - Optional set of run-context IDs. If provided, propagation is run-context aware.
|
|
25
|
+
* If undefined or empty, behaves like auto mode (always propagates values and execution).
|
|
26
|
+
*/
|
|
27
|
+
propagate(srcNodeId: string, srcHandle: string, value: unknown, runContextIds?: Set<RunContextId>): void;
|
|
28
|
+
/**
|
|
29
|
+
* Propagate value in run-context aware mode (convenience method)
|
|
30
|
+
*/
|
|
31
|
+
propagateInRunContexts(srcNodeId: string, srcHandle: string, value: unknown, runContextIds: Set<RunContextId>): void;
|
|
32
|
+
/**
|
|
33
|
+
* Re-emit all outputs from a node (used when graph updates)
|
|
34
|
+
* Only re-emits outputs that are valid according to resolved handles
|
|
35
|
+
*/
|
|
36
|
+
reemitNodeOutputs(nodeId: string): void;
|
|
37
|
+
/**
|
|
38
|
+
* Clear array input buckets for a node (when node is deleted)
|
|
39
|
+
*/
|
|
40
|
+
clearArrayBuckets(nodeId: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Clear all array buckets
|
|
43
|
+
*/
|
|
44
|
+
clearAllArrayBuckets(): void;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=ValuePropagator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValuePropagator.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/components/ValuePropagator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,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;AAE7D,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAEtB;;GAEG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,cAAc,CAAiB;IACvC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,iBAAiB,CAAoB;IAC7C,OAAO,CAAC,kBAAkB,CAAuB;IACjD,OAAO,CAAC,cAAc,CAAkB;IACxC,OAAO,CAAC,kBAAkB,CAAsB;IAChD,OAAO,CAAC,iBAAiB,CAGrB;gBAGF,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE,YAAY,EAC1B,iBAAiB,EAAE,iBAAiB,EACpC,cAAc,EAAE,eAAe,EAC/B,kBAAkB,EAAE,mBAAmB;IASzC;;OAEG;IACH,qBAAqB,CAAC,kBAAkB,EAAE,mBAAmB,GAAG,IAAI;IAIpE;;;;OAIG;IACH,SAAS,CACP,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,EACd,aAAa,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAChC,IAAI;IA8NP;;OAEG;IACH,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,GAAG,CAAC,YAAY,CAAC,GAC/B,IAAI;IAIP;;;OAGG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAqBvC;;OAEG;IACH,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIvC;;OAEG;IACH,oBAAoB,IAAI,IAAI;CAG7B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ResolvedHandles } from "@bian-womp/spark-protocol";
|
|
2
|
+
import type { Registry } from "../../builder/Registry";
|
|
3
|
+
import type { RunContextId } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Interface for value propagation operations
|
|
6
|
+
*/
|
|
7
|
+
export interface IValuePropagator {
|
|
8
|
+
propagate(srcNodeId: string, srcHandle: string, value: unknown, runContextIds?: Set<RunContextId>): void;
|
|
9
|
+
propagateInRunContexts(srcNodeId: string, srcHandle: string, value: unknown, runContextIds: Set<RunContextId>): void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Interface for execution scheduling operations
|
|
13
|
+
*/
|
|
14
|
+
export interface IExecutionScheduler {
|
|
15
|
+
scheduleInputsChanged(nodeId: string): void;
|
|
16
|
+
scheduleInputsChangedWithRunContexts(nodeId: string, runContextIds: Set<RunContextId>): void;
|
|
17
|
+
allInboundHaveValue(nodeId: string): boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Interface for handle resolution operations
|
|
21
|
+
*/
|
|
22
|
+
export interface IHandleResolver {
|
|
23
|
+
scheduleRecomputeHandles(nodeId: string): void;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Interface for runtime coordination operations
|
|
27
|
+
* Implemented by GraphRuntime to coordinate cross-component operations
|
|
28
|
+
*/
|
|
29
|
+
export interface IRuntimeCoordinator {
|
|
30
|
+
updateNodeHandles(nodeId: string, handles: ResolvedHandles, registry: Registry): void;
|
|
31
|
+
invalidateDownstream(nodeId: string): void;
|
|
32
|
+
isPaused(): boolean;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=interfaces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/components/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CACP,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,EACd,aAAa,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC,GAChC,IAAI,CAAC;IACR,sBAAsB,CACpB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,GAAG,CAAC,YAAY,CAAC,GAC/B,IAAI,CAAC;CACT;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,oCAAoC,CAClC,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,GAAG,CAAC,YAAY,CAAC,GAC/B,IAAI,CAAC;IACR,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CAC9C;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CAChD;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAClC,iBAAiB,CACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,QAAQ,GACjB,IAAI,CAAC;IACR,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3C,QAAQ,IAAI,OAAO,CAAC;CACrB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { GraphNodeDefinition, GraphEdgeDefinition, ExecutionPolicy, LogLevel } from "@bian-womp/spark-protocol";
|
|
2
|
+
import type { NodeTypeDescriptor, RuntimeEdgeStats, RuntimeNodeStats } from "../../core/types";
|
|
3
|
+
import type { CategoryRuntime } from "../../core/categories";
|
|
4
|
+
export interface RuntimeNode<State = any> extends GraphNodeDefinition {
|
|
5
|
+
inputs: Record<string, unknown>;
|
|
6
|
+
outputs: Record<string, unknown>;
|
|
7
|
+
state: State;
|
|
8
|
+
runtime: CategoryRuntime<State>;
|
|
9
|
+
lifecycle: NodeTypeDescriptor<Record<string, string>, Record<string, string>, State, any>["lifecycle"];
|
|
10
|
+
policy?: Partial<ExecutionPolicy>;
|
|
11
|
+
logLevel?: LogLevel;
|
|
12
|
+
latestRunId?: string;
|
|
13
|
+
runSeq: number;
|
|
14
|
+
activeControllers: Set<AbortController>;
|
|
15
|
+
controllerRunIds: Map<AbortController, string>;
|
|
16
|
+
snapshotCancelledRunIds?: Set<string>;
|
|
17
|
+
queue: Array<{
|
|
18
|
+
runId: string;
|
|
19
|
+
inputs: Record<string, unknown>;
|
|
20
|
+
}>;
|
|
21
|
+
lastScheduledAt?: number;
|
|
22
|
+
stats: RuntimeNodeStats;
|
|
23
|
+
activeRunContexts: Set<string>;
|
|
24
|
+
}
|
|
25
|
+
export interface RuntimeEdge extends GraphEdgeDefinition {
|
|
26
|
+
convert?: (value: unknown) => unknown;
|
|
27
|
+
convertAsync?: (value: unknown, signal: AbortSignal) => Promise<unknown>;
|
|
28
|
+
stats: RuntimeEdgeStats;
|
|
29
|
+
srcUnionTypes?: string[];
|
|
30
|
+
dstDeclared?: string;
|
|
31
|
+
effectiveTypeId: string;
|
|
32
|
+
}
|
|
33
|
+
export type RunContextId = string;
|
|
34
|
+
export interface RunContext {
|
|
35
|
+
id: RunContextId;
|
|
36
|
+
startNodes: Set<string>;
|
|
37
|
+
cancelledNodes: Set<string>;
|
|
38
|
+
pending: number;
|
|
39
|
+
skipPropagateValues: boolean;
|
|
40
|
+
propagate: boolean;
|
|
41
|
+
resolve?: () => void;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/runtime/components/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,QAAQ,EACT,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,WAAW,CAAC,KAAK,GAAG,GAAG,CAAE,SAAQ,mBAAmB;IACnE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,eAAe,CAAC,KAAK,CAAC,CAAC;IAChC,SAAS,EAAE,kBAAkB,CAC3B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACtB,KAAK,EACL,GAAG,CACJ,CAAC,WAAW,CAAC,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAClC,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,EAAE,GAAG,CAAC,eAAe,CAAC,CAAC;IAGxC,gBAAgB,EAAE,GAAG,CAAC,eAAe,EAAE,MAAM,CAAC,CAAC;IAK/C,uBAAuB,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,gBAAgB,CAAC;IAExB,iBAAiB,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,WAAY,SAAQ,mBAAmB;IACtD,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACzE,KAAK,EAAE,gBAAgB,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,YAAY,CAAC;IACjB,UAAU,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACxB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility functions for runtime components
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Type guard to check if a value is a Promise
|
|
6
|
+
*/
|
|
7
|
+
export declare function isPromise<T = unknown>(value: unknown): value is Promise<T>;
|
|
8
|
+
/**
|
|
9
|
+
* Unwrap a value that might be a Promise
|
|
10
|
+
*/
|
|
11
|
+
export declare function unwrapMaybePromise<T>(value: T | Promise<T>): Promise<T>;
|
|
12
|
+
/**
|
|
13
|
+
* Shallow/deep-ish equality check to avoid unnecessary runs on identical values
|
|
14
|
+
*/
|
|
15
|
+
export declare function valuesEqual(a: unknown, b: unknown): boolean;
|
|
16
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/runtime/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,OAAO,CAAC,CAAC,CAAC,CAE1E;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAE7E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAW3D"}
|