@bian-womp/spark-graph 0.2.30 → 0.2.32
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 +83 -54
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/examples/async.d.ts +1 -1
- package/lib/cjs/src/examples/async.d.ts.map +1 -1
- package/lib/cjs/src/plugins/composite.d.ts +1 -1
- package/lib/cjs/src/plugins/composite.d.ts.map +1 -1
- package/lib/cjs/src/runtime/AbstractEngine.d.ts +1 -1
- package/lib/cjs/src/runtime/AbstractEngine.d.ts.map +1 -1
- package/lib/cjs/src/runtime/Engine.d.ts +1 -1
- package/lib/cjs/src/runtime/Engine.d.ts.map +1 -1
- package/lib/cjs/src/runtime/GraphRuntime.d.ts +1 -1
- package/lib/cjs/src/runtime/GraphRuntime.d.ts.map +1 -1
- package/lib/cjs/src/runtime/LocalRunner.d.ts +1 -1
- package/lib/cjs/src/runtime/LocalRunner.d.ts.map +1 -1
- package/lib/cjs/src/runtime/RunnerControl.d.ts +1 -1
- package/lib/cjs/src/runtime/RunnerControl.d.ts.map +1 -1
- package/lib/esm/index.js +83 -54
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/examples/async.d.ts +1 -1
- package/lib/esm/src/examples/async.d.ts.map +1 -1
- package/lib/esm/src/plugins/composite.d.ts +1 -1
- package/lib/esm/src/plugins/composite.d.ts.map +1 -1
- package/lib/esm/src/runtime/AbstractEngine.d.ts +1 -1
- package/lib/esm/src/runtime/AbstractEngine.d.ts.map +1 -1
- package/lib/esm/src/runtime/Engine.d.ts +1 -1
- package/lib/esm/src/runtime/Engine.d.ts.map +1 -1
- package/lib/esm/src/runtime/GraphRuntime.d.ts +1 -1
- package/lib/esm/src/runtime/GraphRuntime.d.ts.map +1 -1
- package/lib/esm/src/runtime/LocalRunner.d.ts +1 -1
- package/lib/esm/src/runtime/LocalRunner.d.ts.map +1 -1
- package/lib/esm/src/runtime/RunnerControl.d.ts +1 -1
- package/lib/esm/src/runtime/RunnerControl.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphDefinition } from "
|
|
1
|
+
import type { GraphDefinition } from "@bian-womp/spark-protocol";
|
|
2
2
|
export declare function createAsyncGraphDef(): GraphDefinition;
|
|
3
3
|
export declare function createAsyncGraphRegistry(): import("..").Registry;
|
|
4
4
|
export declare function main(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../../src/examples/async.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../../../src/examples/async.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AASjE,wBAAgB,mBAAmB,oBAqDlC;AAED,wBAAgB,wBAAwB,0BAIvC;AAED,wBAAsB,IAAI,kBAoCzB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { GraphDefinition } from "@bian-womp/spark-protocol";
|
|
1
2
|
import type { NodeCategoryDescriptor } from "../core/categories";
|
|
2
|
-
import type { GraphDefinition } from "../core/types";
|
|
3
3
|
import { Registry } from "../builder/Registry";
|
|
4
4
|
import { GraphRuntime } from "../runtime/GraphRuntime";
|
|
5
5
|
export interface CompositeImpl {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"composite.d.ts","sourceRoot":"","sources":["../../../../src/plugins/composite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"composite.d.ts","sourceRoot":"","sources":["../../../../src/plugins/composite.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,eAAe,CAAC;IACrB,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;QAC3D,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,MAAM,EAAE,MAAM,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC7D,CAAC;CACH;AAED,eAAO,MAAM,iBAAiB,GAC5B,UAAU,QAAQ,KACjB,sBAAsB,CACvB,aAAa,EACb;IAAE,KAAK,CAAC,EAAE,YAAY,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,IAAI,CAAA;CAAE,CAsD5C,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { GraphRuntime } from "./GraphRuntime";
|
|
|
3
3
|
export declare abstract class AbstractEngine implements Engine {
|
|
4
4
|
graphRuntime: GraphRuntime;
|
|
5
5
|
constructor(graphRuntime: GraphRuntime);
|
|
6
|
-
launch(): void;
|
|
6
|
+
launch(invalidate?: boolean): void;
|
|
7
7
|
setInput(nodeId: string, handle: string, value: unknown): void;
|
|
8
8
|
setInputs(nodeId: string, inputs: Record<string, unknown>): void;
|
|
9
9
|
triggerExternal(nodeId: string, event: unknown): void;
|
|
@@ -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;IACjC,YAAY,EAAE,YAAY;gBAA1B,YAAY,EAAE,YAAY;IAE7C,MAAM,
|
|
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;IACjC,YAAY,EAAE,YAAY;gBAA1B,YAAY,EAAE,YAAY;IAE7C,MAAM,CAAC,UAAU,UAAQ,GAAG,IAAI;IAIhC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAI9D,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAIhE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAIrD,EAAE,CAAC,CAAC,SAAS,eAAe,EAC1B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC9B,MAAM,IAAI;IAIb,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;IAIlD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,OAAO,IAAI,IAAI;CAGhB"}
|
|
@@ -3,7 +3,7 @@ export type EngineEventName = RuntimeEventName;
|
|
|
3
3
|
export type EngineEventListener<K extends EngineEventName> = RuntimeEventListener<K>;
|
|
4
4
|
export type EngineEventMap = RuntimeEventMap;
|
|
5
5
|
export interface Engine {
|
|
6
|
-
launch(): void;
|
|
6
|
+
launch(invalidate?: boolean): void;
|
|
7
7
|
setInput(nodeId: string, handle: string, value: unknown): void;
|
|
8
8
|
setInputs(nodeId: string, inputs: Record<string, unknown>): void;
|
|
9
9
|
triggerExternal(nodeId: string, event: unknown): void;
|
|
@@ -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,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAC/C,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,eAAe,IACvD,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC1B,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC;AAC7C,MAAM,WAAW,MAAM;IACrB,MAAM,
|
|
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,MAAM,MAAM,eAAe,GAAG,gBAAgB,CAAC;AAC/C,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,eAAe,IACvD,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC1B,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC;AAC7C,MAAM,WAAW,MAAM;IACrB,MAAM,CAAC,UAAU,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/D,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACjE,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACtD,EAAE,CAAC,CAAC,SAAS,eAAe,EAC1B,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,mBAAmB,CAAC,CAAC,CAAC,GAC9B,MAAM,IAAI,CAAC;IACd,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;IACnD,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1B,OAAO,IAAI,IAAI,CAAC;CACjB"}
|
|
@@ -37,7 +37,7 @@ export declare class GraphRuntime {
|
|
|
37
37
|
private static buildEdges;
|
|
38
38
|
private reemitNodeOutputs;
|
|
39
39
|
updateNodeHandles(nodeId: string, handles: ResolvedHandles, registry: Registry): void;
|
|
40
|
-
launch(): void;
|
|
40
|
+
launch(invalidate?: boolean): void;
|
|
41
41
|
triggerExternal(nodeId: string, event: unknown): void;
|
|
42
42
|
dispose(): void;
|
|
43
43
|
getNodeIds(): string[];
|
|
@@ -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,EAIhB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAQvB,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,gBAAgB,IAAI,CAC7D,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,KAClB,IAAI,CAAC;AAUV,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1E,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,YAAY,CAAC;IACpB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,KAAK,EAAE,YAAY,CAAC;IACpB,KAAK,EAAE,YAAY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,KAAK,IAAI,IAAI;IAIb,MAAM,IAAI,IAAI;IAId,6BAA6B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAInD,8BAA8B,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAKpD,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;IAsEP,MAAM,CAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAG,IAAI;IAqRtD,OAAO,CAAC,wBAAwB;YAWlB,uBAAuB;CA0DtC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GraphDefinition } from "
|
|
1
|
+
import type { GraphDefinition } from "@bian-womp/spark-protocol";
|
|
2
2
|
import { AbstractEngine } from "./AbstractEngine";
|
|
3
3
|
import type { RunnerControl } from "./RunnerControl";
|
|
4
4
|
import { Registry } from "../builder/Registry";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalRunner.d.ts","sourceRoot":"","sources":["../../../../src/runtime/LocalRunner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LocalRunner.d.ts","sourceRoot":"","sources":["../../../../src/runtime/LocalRunner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,qBAAa,WAAY,YAAW,aAAa;IAInC,OAAO,CAAC,QAAQ;IAH5B,OAAO,CAAC,OAAO,CAAe;IAC9B,OAAO,CAAC,MAAM,CAAC,CAAiB;gBAEZ,QAAQ,EAAE,QAAQ;IAIhC,KAAK,CACT,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;IAKV,MAAM,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAWjD,SAAS,IAAI,cAAc;CAK5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunnerControl.d.ts","sourceRoot":"","sources":["../../../../src/runtime/RunnerControl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"RunnerControl.d.ts","sourceRoot":"","sources":["../../../../src/runtime/RunnerControl.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC5B,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,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5C,SAAS,IAAI,MAAM,CAAC;CACrB"}
|
package/lib/esm/index.js
CHANGED
|
@@ -571,57 +571,67 @@ class GraphRuntime {
|
|
|
571
571
|
return node?.outputs[output];
|
|
572
572
|
}
|
|
573
573
|
static buildEdgeConverters(srcDeclared, dstDeclared, registry) {
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
return payload;
|
|
594
|
-
if (res.kind === "async")
|
|
595
|
-
return await res.convertAsync(payload, signal);
|
|
596
|
-
return res.convert(payload);
|
|
597
|
-
};
|
|
574
|
+
if (!dstDeclared || !srcDeclared) {
|
|
575
|
+
return {};
|
|
576
|
+
}
|
|
577
|
+
const isUnion = Array.isArray(srcDeclared);
|
|
578
|
+
const srcTypes = isUnion ? srcDeclared : [srcDeclared];
|
|
579
|
+
// Helper to get the coercion for a specific type
|
|
580
|
+
const getCoercion = (typeId) => {
|
|
581
|
+
return registry.resolveCoercion(typeId, dstDeclared);
|
|
582
|
+
};
|
|
583
|
+
// Resolve coercions for all source types
|
|
584
|
+
const coercions = srcTypes.map(getCoercion);
|
|
585
|
+
const hasAsync = coercions.some((r) => r?.kind === "async");
|
|
586
|
+
// Helper to extract and validate typed output for unions
|
|
587
|
+
const extractPayload = (v) => {
|
|
588
|
+
const typeId = getTypedOutputTypeId(v);
|
|
589
|
+
const payload = getTypedOutputValue(v);
|
|
590
|
+
if (isUnion) {
|
|
591
|
+
if (!typeId) {
|
|
592
|
+
throw new Error(`Typed output required for union source; allowed: ${srcTypes.join("|")}`);
|
|
598
593
|
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
const typeId = getTypedOutputTypeId(v);
|
|
602
|
-
if (!typeId)
|
|
603
|
-
throw new Error(`Typed output required for union source; allowed: ${srcTypes.join("|")}`);
|
|
604
|
-
if (!srcTypes.includes(typeId))
|
|
605
|
-
throw new Error(`Invalid typed output ${typeId}; allowed: ${srcTypes.join("|")}`);
|
|
606
|
-
const payload = getTypedOutputValue(v);
|
|
607
|
-
const res = registry.resolveCoercion(typeId, dstDeclared);
|
|
608
|
-
if (!res)
|
|
609
|
-
return payload;
|
|
610
|
-
if (res.kind === "async")
|
|
611
|
-
throw new Error("Async coercion required but convert used");
|
|
612
|
-
return res.convert(payload);
|
|
613
|
-
};
|
|
594
|
+
if (!srcTypes.includes(typeId)) {
|
|
595
|
+
throw new Error(`Invalid typed output ${typeId}; allowed: ${srcTypes.join("|")}`);
|
|
614
596
|
}
|
|
615
597
|
}
|
|
616
|
-
else {
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
convertAsync = res.convertAsync;
|
|
620
|
-
else if (res?.kind === "sync")
|
|
621
|
-
convert = res.convert;
|
|
598
|
+
else if (typeId) {
|
|
599
|
+
// Warn if typed output is used for non-union source
|
|
600
|
+
console.warn(`Typed output ${typeId} is fed even though source is not union: ${srcDeclared} -> ${dstDeclared}`);
|
|
622
601
|
}
|
|
602
|
+
return { typeId: typeId || srcTypes[0], payload };
|
|
603
|
+
};
|
|
604
|
+
if (hasAsync) {
|
|
605
|
+
return {
|
|
606
|
+
convertAsync: async (v, signal) => {
|
|
607
|
+
const { typeId, payload } = extractPayload(v);
|
|
608
|
+
const res = getCoercion(typeId);
|
|
609
|
+
if (!res)
|
|
610
|
+
return payload;
|
|
611
|
+
if (res.kind === "async") {
|
|
612
|
+
return await res.convertAsync(payload, signal);
|
|
613
|
+
}
|
|
614
|
+
return res.convert(payload);
|
|
615
|
+
},
|
|
616
|
+
};
|
|
623
617
|
}
|
|
624
|
-
|
|
618
|
+
// Sync path
|
|
619
|
+
const firstCoercion = coercions.find((r) => r?.kind === "sync");
|
|
620
|
+
if (!firstCoercion) {
|
|
621
|
+
return {};
|
|
622
|
+
}
|
|
623
|
+
return {
|
|
624
|
+
convert: (v) => {
|
|
625
|
+
const { typeId, payload } = extractPayload(v);
|
|
626
|
+
const res = getCoercion(typeId);
|
|
627
|
+
if (!res)
|
|
628
|
+
return payload;
|
|
629
|
+
if (res.kind === "async") {
|
|
630
|
+
throw new Error("Async coercion required but convert used");
|
|
631
|
+
}
|
|
632
|
+
return res.convert(payload);
|
|
633
|
+
},
|
|
634
|
+
};
|
|
625
635
|
}
|
|
626
636
|
scheduleInputsChanged(nodeId) {
|
|
627
637
|
const node = this.nodes.get(nodeId);
|
|
@@ -825,6 +835,9 @@ class GraphRuntime {
|
|
|
825
835
|
const dstNode = this.nodes.get(e.target.nodeId);
|
|
826
836
|
if (!dstNode)
|
|
827
837
|
return;
|
|
838
|
+
// Skip writing to unresolved handles - wait for handle resolution
|
|
839
|
+
if (e.dstDeclared === undefined)
|
|
840
|
+
return;
|
|
828
841
|
const dstIsArray = typeof e.dstDeclared === "string" && e.dstDeclared.endsWith("[]");
|
|
829
842
|
let next = v;
|
|
830
843
|
// If target input is an array type, merge per-edge contributions deterministically
|
|
@@ -1033,6 +1046,7 @@ class GraphRuntime {
|
|
|
1033
1046
|
for (const e of this.edges) {
|
|
1034
1047
|
let srcDeclared = e.effectiveTypeId; // Use effectiveTypeId as fallback
|
|
1035
1048
|
let dstDeclared = e.dstDeclared;
|
|
1049
|
+
const oldDstDeclared = dstDeclared; // Track old value to detect resolution
|
|
1036
1050
|
if (e.source.nodeId === nodeId) {
|
|
1037
1051
|
const resolved = this.resolvedByNode.get(nodeId);
|
|
1038
1052
|
srcDeclared = resolved
|
|
@@ -1055,11 +1069,24 @@ class GraphRuntime {
|
|
|
1055
1069
|
const conv = GraphRuntime.buildEdgeConverters(srcDeclared, dstDeclared, registry);
|
|
1056
1070
|
e.convert = conv.convert;
|
|
1057
1071
|
e.convertAsync = conv.convertAsync;
|
|
1072
|
+
// If target handle was just resolved (was undefined, now has a type), re-propagate values
|
|
1073
|
+
if (e.target.nodeId === nodeId &&
|
|
1074
|
+
oldDstDeclared === undefined &&
|
|
1075
|
+
dstDeclared !== undefined) {
|
|
1076
|
+
const srcNode = this.nodes.get(e.source.nodeId);
|
|
1077
|
+
if (srcNode) {
|
|
1078
|
+
const srcValue = srcNode.outputs[e.source.handle];
|
|
1079
|
+
if (srcValue !== undefined) {
|
|
1080
|
+
// Re-propagate through the now-resolved edge converter
|
|
1081
|
+
this.propagate(e.source.nodeId, e.source.handle, srcValue);
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1058
1085
|
}
|
|
1059
1086
|
// Invalidate downstream for this node so UI refreshes
|
|
1060
1087
|
this.invalidateDownstream(nodeId);
|
|
1061
1088
|
}
|
|
1062
|
-
launch() {
|
|
1089
|
+
launch(invalidate = false) {
|
|
1063
1090
|
// call onActivated for nodes that implement it
|
|
1064
1091
|
for (const node of this.nodes.values()) {
|
|
1065
1092
|
const ctrl = new AbortController();
|
|
@@ -1083,10 +1110,12 @@ class GraphRuntime {
|
|
|
1083
1110
|
});
|
|
1084
1111
|
node.runtime.onActivated?.(ctx);
|
|
1085
1112
|
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
this.
|
|
1113
|
+
if (invalidate) {
|
|
1114
|
+
// After activation, schedule nodes that have all inbound inputs present
|
|
1115
|
+
for (const nodeId of this.nodes.keys()) {
|
|
1116
|
+
if (this.allInboundHaveValue(nodeId))
|
|
1117
|
+
this.scheduleInputsChanged(nodeId);
|
|
1118
|
+
}
|
|
1090
1119
|
}
|
|
1091
1120
|
}
|
|
1092
1121
|
triggerExternal(nodeId, event) {
|
|
@@ -1872,11 +1901,11 @@ class AbstractEngine {
|
|
|
1872
1901
|
constructor(graphRuntime) {
|
|
1873
1902
|
this.graphRuntime = graphRuntime;
|
|
1874
1903
|
}
|
|
1875
|
-
launch() {
|
|
1876
|
-
this.graphRuntime.launch();
|
|
1904
|
+
launch(invalidate = false) {
|
|
1905
|
+
this.graphRuntime.launch(invalidate);
|
|
1877
1906
|
}
|
|
1878
1907
|
setInput(nodeId, handle, value) {
|
|
1879
|
-
this.setInputs(nodeId, { [handle]: value });
|
|
1908
|
+
this.graphRuntime.setInputs(nodeId, { [handle]: value });
|
|
1880
1909
|
}
|
|
1881
1910
|
setInputs(nodeId, inputs) {
|
|
1882
1911
|
this.graphRuntime.setInputs(nodeId, inputs);
|