@bian-womp/spark-workbench 0.2.26 → 0.2.27
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 +86 -12
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/Inspector.d.ts.map +1 -1
- package/lib/cjs/src/misc/WorkbenchStudio.d.ts.map +1 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.d.ts +7 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.d.ts.map +1 -1
- package/lib/cjs/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/lib/esm/index.js +86 -12
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/misc/Inspector.d.ts.map +1 -1
- package/lib/esm/src/misc/WorkbenchStudio.d.ts.map +1 -1
- package/lib/esm/src/misc/context/WorkbenchContext.d.ts +7 -1
- package/lib/esm/src/misc/context/WorkbenchContext.d.ts.map +1 -1
- package/lib/esm/src/misc/context/WorkbenchContext.provider.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inspector.d.ts","sourceRoot":"","sources":["../../../../src/misc/Inspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,QAAQ,GACT,EAAE;IACD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kBAAkB,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC7C,QAAQ,EAAE,CAAC,M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CACxE,2CAggBA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchStudio.d.ts","sourceRoot":"","sources":["../../../../src/misc/WorkbenchStudio.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAejE,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AASvE,OAAO,EAGL,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAGL,oBAAoB,EACpB,YAAY,EAGb,MAAM,yBAAyB,CAAC;AAIjC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACtC;
|
|
1
|
+
{"version":3,"file":"WorkbenchStudio.d.ts","sourceRoot":"","sources":["../../../../src/misc/WorkbenchStudio.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAejE,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AASvE,OAAO,EAGL,kBAAkB,EACnB,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAG9D,OAAO,EAGL,oBAAoB,EACpB,YAAY,EAGb,MAAM,yBAAyB,CAAC;AAIjC;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,cAAc,CAAC,EAAE,uBAAuB,CAAC;IACzC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACtC;AA+yBD,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,cAAc,EACd,OAAO,EACP,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX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M,EAAE,YAAY,CAAC;QACrB,eAAe,EAAE,CACf,GAAG,EAAE,eAAe,EACpB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,KAC7C,OAAO,CAAC,IAAI,CAAC,CAAC;KACpB,KAAK,IAAI,CAAC;IACX,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE;QAChB,GAAG,EAAE,eAAe,CAAC;QACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACjD,KAAK,IAAI,CAAC;CACZ,2CA+GA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { GraphDefinition } from "@bian-womp/spark-protocol";
|
|
2
|
+
import type { GraphDefinition, RegistryError, SystemError } from "@bian-womp/spark-protocol";
|
|
3
3
|
import type { Registry, ValidationIssue } from "@bian-womp/spark-graph";
|
|
4
4
|
import { InMemoryWorkbench } from "../../core/InMemoryWorkbench";
|
|
5
5
|
import type { HandleIssue, NodeRunStatus, EdgeRunStatus, DebugEvent } from "../../core/contracts";
|
|
@@ -67,6 +67,12 @@ export interface WorkbenchContextValue {
|
|
|
67
67
|
validationGlobal: ValidationIssue[];
|
|
68
68
|
events: Array<DebugEvent>;
|
|
69
69
|
clearEvents: () => void;
|
|
70
|
+
systemErrors: SystemError[];
|
|
71
|
+
registryErrors: RegistryError[];
|
|
72
|
+
clearSystemErrors: () => void;
|
|
73
|
+
clearRegistryErrors: () => void;
|
|
74
|
+
removeSystemError: (index: number) => void;
|
|
75
|
+
removeRegistryError: (index: number) => void;
|
|
70
76
|
isRunning: () => boolean;
|
|
71
77
|
engineKind: () => EngineKind | undefined;
|
|
72
78
|
start: (engine: EngineKind) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchContext.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"WorkbenchContext.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EACV,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,aAAa,EACb,UAAU,EACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAE3E,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC;QAAC,GAAG,EAAE,eAAe,CAAA;KAAE,CAAC,CAAC;IACnE,aAAa,CAAC,EAAE,UAAU,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,CACT,YAAY,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,MAAM,EAC1D,GAAG,EAAE;QAAE,QAAQ,EAAE,QAAQ,CAAA;KAAE,KACxB,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC;IAClD,SAAS,CAAC,EAAE,CACV,aAAa,EAAE,CAA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B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,iBAAiB,EAAE,MAAM,IAAI,CAAC;IAC9B,mBAAmB,EAAE,MAAM,IAAI,CAAC;IAChC,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,mBAAmB,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAG7C,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,UAAU,EAAE,MAAM,UAAU,GAAG,SAAS,CAAC;IACzC,KAAK,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,IAAI,CAAC;IACpC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAGlB,aAAa,EAAE,MAAM,IAAI,CAAC;IAG1B,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;IAGrE,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CAC3D;AAED,eAAO,MAAM,gBAAgB,6CAE5B,CAAC;AAEF,wBAAgB,mBAAmB,IAAI,qBAAqB,CAO3D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"WorkbenchContext.provider.d.ts","sourceRoot":"","sources":["../../../../../src/misc/context/WorkbenchContext.provider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,QAAQ,EAAwB,MAAM,wBAAwB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,YAAY,EAAmB,MAAM,4BAA4B,CAAC;AAa3E,OAAO,EAGL,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAI5B,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,MAAM,EACN,QAAQ,EACR,WAAW,EACX,SAAS,EACT,QAAQ,GACT,EAAE;IACD,EAAE,EAAE,iBAAiB,CAAC;IACtB,MAAM,EAAE,YAAY,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,EAAE,CAAC,CAAC,EAAE,QAAQ,KAAK,IAAI,CAAC;IACnC,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,2CAwnBA"}
|
package/lib/esm/index.js
CHANGED
|
@@ -1645,6 +1645,16 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1645
1645
|
const [edgeStatus, setEdgeStatus] = useState({});
|
|
1646
1646
|
const [events, setEvents] = useState([]);
|
|
1647
1647
|
const clearEvents = useCallback(() => setEvents([]), []);
|
|
1648
|
+
const [systemErrors, setSystemErrors] = useState([]);
|
|
1649
|
+
const [registryErrors, setRegistryErrors] = useState([]);
|
|
1650
|
+
const clearSystemErrors = useCallback(() => setSystemErrors([]), []);
|
|
1651
|
+
const clearRegistryErrors = useCallback(() => setRegistryErrors([]), []);
|
|
1652
|
+
const removeSystemError = useCallback((index) => {
|
|
1653
|
+
setSystemErrors((prev) => prev.filter((_, idx) => idx !== index));
|
|
1654
|
+
}, []);
|
|
1655
|
+
const removeRegistryError = useCallback((index) => {
|
|
1656
|
+
setRegistryErrors((prev) => prev.filter((_, idx) => idx !== index));
|
|
1657
|
+
}, []);
|
|
1648
1658
|
// Fallback progress animation: drive progress to 100% over ~2 minutes
|
|
1649
1659
|
const FALLBACK_TOTAL_MS = 2 * 60 * 1000;
|
|
1650
1660
|
const [fallbackStarts, setFallbackStarts] = useState({});
|
|
@@ -1827,7 +1837,10 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1827
1837
|
if (remoteDef && Array.isArray(remoteDef.nodes)) {
|
|
1828
1838
|
// Mutate current def in-place to avoid emitting graphChanged and causing update loop
|
|
1829
1839
|
const cur = wb.export();
|
|
1830
|
-
const byId = new Map((remoteDef.nodes || []).map((n) => [
|
|
1840
|
+
const byId = new Map((remoteDef.nodes || []).map((n) => [
|
|
1841
|
+
n.nodeId,
|
|
1842
|
+
n,
|
|
1843
|
+
]));
|
|
1831
1844
|
let changed = false;
|
|
1832
1845
|
for (const n of cur.nodes) {
|
|
1833
1846
|
const rn = byId.get(n.nodeId);
|
|
@@ -1859,6 +1872,8 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1859
1872
|
const off2 = runner.on("error", (e) => {
|
|
1860
1873
|
const edgeError = e;
|
|
1861
1874
|
const nodeError = e;
|
|
1875
|
+
const registryError = e;
|
|
1876
|
+
const systemError = e;
|
|
1862
1877
|
if (edgeError.kind === "edge-convert") {
|
|
1863
1878
|
const edgeId = edgeError.edgeId;
|
|
1864
1879
|
setEdgeStatus((s) => ({
|
|
@@ -1866,7 +1881,7 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1866
1881
|
[edgeId]: { ...s[edgeId], lastError: edgeError.err },
|
|
1867
1882
|
}));
|
|
1868
1883
|
}
|
|
1869
|
-
else if (nodeError.nodeId) {
|
|
1884
|
+
else if (nodeError.kind === "node-run" && nodeError.nodeId) {
|
|
1870
1885
|
const nodeId = nodeError.nodeId;
|
|
1871
1886
|
const runId = nodeError.runId;
|
|
1872
1887
|
setNodeStatus((s) => ({
|
|
@@ -1884,6 +1899,27 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1884
1899
|
};
|
|
1885
1900
|
}
|
|
1886
1901
|
}
|
|
1902
|
+
else if (registryError.kind === "registry") {
|
|
1903
|
+
// Track registry errors for UI display
|
|
1904
|
+
setRegistryErrors((prev) => {
|
|
1905
|
+
// Avoid duplicates by checking message
|
|
1906
|
+
if (prev.some((err) => err.message === registryError.message)) {
|
|
1907
|
+
return prev;
|
|
1908
|
+
}
|
|
1909
|
+
return [...prev, registryError];
|
|
1910
|
+
});
|
|
1911
|
+
}
|
|
1912
|
+
else if (systemError.kind === "system") {
|
|
1913
|
+
// Track custom errors for UI display
|
|
1914
|
+
setSystemErrors((prev) => {
|
|
1915
|
+
// Avoid duplicates by checking message and code
|
|
1916
|
+
if (prev.some((err) => err.message === systemError.message &&
|
|
1917
|
+
err.code === systemError.code)) {
|
|
1918
|
+
return prev;
|
|
1919
|
+
}
|
|
1920
|
+
return [...prev, systemError];
|
|
1921
|
+
});
|
|
1922
|
+
}
|
|
1887
1923
|
return add("runner", "error")(e);
|
|
1888
1924
|
});
|
|
1889
1925
|
const off3 = runner.on("invalidate", (e) => {
|
|
@@ -2131,6 +2167,12 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
2131
2167
|
validationGlobal,
|
|
2132
2168
|
events,
|
|
2133
2169
|
clearEvents,
|
|
2170
|
+
systemErrors,
|
|
2171
|
+
registryErrors,
|
|
2172
|
+
clearSystemErrors,
|
|
2173
|
+
clearRegistryErrors,
|
|
2174
|
+
removeSystemError,
|
|
2175
|
+
removeRegistryError,
|
|
2134
2176
|
isRunning,
|
|
2135
2177
|
engineKind,
|
|
2136
2178
|
start,
|
|
@@ -2152,6 +2194,12 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
2152
2194
|
nodeStatus,
|
|
2153
2195
|
edgeStatus,
|
|
2154
2196
|
valuesTick,
|
|
2197
|
+
systemErrors,
|
|
2198
|
+
registryErrors,
|
|
2199
|
+
clearSystemErrors,
|
|
2200
|
+
clearRegistryErrors,
|
|
2201
|
+
removeSystemError,
|
|
2202
|
+
removeRegistryError,
|
|
2155
2203
|
inputsMap,
|
|
2156
2204
|
outputsMap,
|
|
2157
2205
|
validationByNode,
|
|
@@ -2218,7 +2266,7 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2218
2266
|
return String(value ?? "");
|
|
2219
2267
|
}
|
|
2220
2268
|
};
|
|
2221
|
-
const { registry, def, selectedNodeId, selectedEdgeId, inputsMap, outputsMap, outputTypesMap, nodeStatus, validationByNode, validationByEdge, validationGlobal, valuesTick, updateEdgeType, } = useWorkbenchContext();
|
|
2269
|
+
const { registry, def, selectedNodeId, selectedEdgeId, inputsMap, outputsMap, outputTypesMap, nodeStatus, validationByNode, validationByEdge, validationGlobal, valuesTick, updateEdgeType, systemErrors, registryErrors, clearSystemErrors, clearRegistryErrors, removeSystemError, removeRegistryError, } = useWorkbenchContext();
|
|
2222
2270
|
const nodeValidationIssues = validationByNode.issues;
|
|
2223
2271
|
const edgeValidationIssues = validationByEdge.issues;
|
|
2224
2272
|
const nodeValidationHandles = validationByNode;
|
|
@@ -2304,7 +2352,7 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2304
2352
|
}
|
|
2305
2353
|
catch { }
|
|
2306
2354
|
};
|
|
2307
|
-
return (jsxs("div", { className: `${widthClass} border-l border-gray-300 p-3 flex flex-col h-full min-h-0 overflow-hidden`, children: [contextPanel && jsx("div", { className: "mb-2", children: contextPanel }), jsx("div", { className: "font-semibold mb-2", children: "Inspector" }), jsxs("div", { className: "text-xs text-gray-500 mb-2", children: ["valuesTick: ", valuesTick] }), jsx("div", { className: "flex-1 overflow-auto", children: !selectedNode && !selectedEdge ? (jsxs("div", { children: [jsx("div", { className: "text-gray-500", children: "Select a node or edge." }), globalValidationIssues && globalValidationIssues.length > 0 && (jsxs("div", { className: "mt-2 text-xs bg-red-50 border border-red-200 rounded px-2 py-1", children: [jsx("div", { className: "font-semibold mb-1", children: "Validation" }), jsx("ul", { className: "list-disc ml-4", children: globalValidationIssues.map((m, i) => (jsxs("li", { className: "flex items-center gap-1", children: [jsx(IssueBadge, { level: m.level, size: 24, className: "w-6 h-6" }), jsx("span", { children: `${m.code}: ${m.message}` }), !!m.data?.edgeId && (jsx("button", { className: "ml-2 text-[10px] px-1 py-[2px] border border-red-300 rounded text-red-700 hover:bg-red-50", onClick: (e) => {
|
|
2355
|
+
return (jsxs("div", { className: `${widthClass} border-l border-gray-300 p-3 flex flex-col h-full min-h-0 overflow-hidden`, children: [contextPanel && jsx("div", { className: "mb-2", children: contextPanel }), systemErrors.length > 0 && (jsxs("div", { className: "mb-2 space-y-1", children: [systemErrors.map((err, i) => (jsxs("div", { className: "text-xs text-red-700 bg-red-50 border border-red-200 rounded px-2 py-1 flex items-start justify-between gap-2", children: [jsxs("div", { className: "flex-1", children: [jsx("div", { className: "font-semibold", children: err.code ? `Error ${err.code}` : "Error" }), jsx("div", { className: "break-words", children: err.message })] }), jsx("button", { className: "text-red-500 hover:text-red-700 text-[10px] px-1", onClick: () => removeSystemError(i), title: "Dismiss", children: "\u00D7" })] }, i))), systemErrors.length > 1 && (jsx("button", { className: "text-xs text-red-600 hover:text-red-800 underline", onClick: clearSystemErrors, children: "Clear all" }))] })), registryErrors.length > 0 && (jsxs("div", { className: "mb-2 space-y-1", children: [registryErrors.map((err, i) => (jsxs("div", { className: "text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1 flex items-start justify-between gap-2", children: [jsxs("div", { className: "flex-1", children: [jsx("div", { className: "font-semibold", children: "Registry Error" }), jsx("div", { className: "break-words", children: err.message }), err.attempt && err.maxAttempts && (jsxs("div", { className: "text-[10px] text-amber-600 mt-1", children: ["Attempt ", err.attempt, " of ", err.maxAttempts] }))] }), jsx("button", { className: "text-amber-500 hover:text-amber-700 text-[10px] px-1", onClick: () => removeRegistryError(i), title: "Dismiss", children: "\u00D7" })] }, i))), registryErrors.length > 1 && (jsx("button", { className: "text-xs text-amber-600 hover:text-amber-800 underline", onClick: clearRegistryErrors, children: "Clear all" }))] })), jsx("div", { className: "font-semibold mb-2", children: "Inspector" }), jsxs("div", { className: "text-xs text-gray-500 mb-2", children: ["valuesTick: ", valuesTick] }), jsx("div", { className: "flex-1 overflow-auto", children: !selectedNode && !selectedEdge ? (jsxs("div", { children: [jsx("div", { className: "text-gray-500", children: "Select a node or edge." }), globalValidationIssues && globalValidationIssues.length > 0 && (jsxs("div", { className: "mt-2 text-xs bg-red-50 border border-red-200 rounded px-2 py-1", children: [jsx("div", { className: "font-semibold mb-1", children: "Validation" }), jsx("ul", { className: "list-disc ml-4", children: globalValidationIssues.map((m, i) => (jsxs("li", { className: "flex items-center gap-1", children: [jsx(IssueBadge, { level: m.level, size: 24, className: "w-6 h-6" }), jsx("span", { children: `${m.code}: ${m.message}` }), !!m.data?.edgeId && (jsx("button", { className: "ml-2 text-[10px] px-1 py-[2px] border border-red-300 rounded text-red-700 hover:bg-red-50", onClick: (e) => {
|
|
2308
2356
|
e.stopPropagation();
|
|
2309
2357
|
deleteEdgeById(m.data?.edgeId);
|
|
2310
2358
|
}, title: "Delete referenced edge", children: "Delete edge" }))] }, i))) })] }))] })) : selectedEdge ? (jsxs("div", { children: [jsxs("div", { className: "mb-2", children: [jsxs("div", { children: ["Edge: ", selectedEdge.id] }), jsxs("div", { children: [selectedEdge.source.nodeId, ".", selectedEdge.source.handle, " \u2192", " ", selectedEdge.target.nodeId, ".", selectedEdge.target.handle] }), jsx("div", { className: "mt-1", children: jsx("button", { className: "text-xs px-2 py-1 border border-red-300 rounded text-red-700 hover:bg-red-50", onClick: (e) => {
|
|
@@ -3154,11 +3202,8 @@ function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, ex
|
|
|
3154
3202
|
return backendKind === "local";
|
|
3155
3203
|
});
|
|
3156
3204
|
// Expose init callback with setInitialGraph helper
|
|
3157
|
-
|
|
3205
|
+
// Note: This runs whenever runner changes (e.g., when Flow is enabled and backendOptions changes)
|
|
3158
3206
|
useEffect(() => {
|
|
3159
|
-
if (initCalled.current)
|
|
3160
|
-
return;
|
|
3161
|
-
initCalled.current = true;
|
|
3162
3207
|
if (!onInit)
|
|
3163
3208
|
return;
|
|
3164
3209
|
const setInitialGraph = async (d, inputs) => {
|
|
@@ -3604,7 +3649,19 @@ function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, ex
|
|
|
3604
3649
|
function WorkbenchStudio({ engine, onEngineChange, example, onExampleChange, backendKind, onBackendKindChange, httpBaseUrl, onHttpBaseUrlChange, wsUrl, onWsUrlChange, debug, onDebugChange, showValues, onShowValuesChange, hideWorkbench, onHideWorkbenchChange, autoScroll, onAutoScrollChange, backendOptions, overrides, onInit, onChange, }) {
|
|
3605
3650
|
const [registry, setRegistry] = useState(createSimpleGraphRegistry());
|
|
3606
3651
|
const [wb] = useState(() => new InMemoryWorkbench({ ui: new DefaultUIExtensionRegistry() }));
|
|
3652
|
+
// Store previous runner for cleanup
|
|
3653
|
+
const prevRunnerRef = useRef(null);
|
|
3607
3654
|
const runner = useMemo(() => {
|
|
3655
|
+
// Dispose previous runner if it exists
|
|
3656
|
+
if (prevRunnerRef.current) {
|
|
3657
|
+
try {
|
|
3658
|
+
prevRunnerRef.current.dispose();
|
|
3659
|
+
}
|
|
3660
|
+
catch (err) {
|
|
3661
|
+
console.warn("Error disposing previous runner:", err);
|
|
3662
|
+
}
|
|
3663
|
+
}
|
|
3664
|
+
let newRunner;
|
|
3608
3665
|
if (backendKind === "remote-http") {
|
|
3609
3666
|
const backend = {
|
|
3610
3667
|
kind: "remote-http",
|
|
@@ -3616,9 +3673,9 @@ function WorkbenchStudio({ engine, onEngineChange, example, onExampleChange, bac
|
|
|
3616
3673
|
onCustomEvent: backendOptions.onCustomEvent,
|
|
3617
3674
|
}),
|
|
3618
3675
|
};
|
|
3619
|
-
|
|
3676
|
+
newRunner = new RemoteGraphRunner(registry, backend);
|
|
3620
3677
|
}
|
|
3621
|
-
if (backendKind === "remote-ws") {
|
|
3678
|
+
else if (backendKind === "remote-ws") {
|
|
3622
3679
|
const backend = {
|
|
3623
3680
|
kind: "remote-ws",
|
|
3624
3681
|
url: wsUrl,
|
|
@@ -3629,10 +3686,27 @@ function WorkbenchStudio({ engine, onEngineChange, example, onExampleChange, bac
|
|
|
3629
3686
|
onCustomEvent: backendOptions.onCustomEvent,
|
|
3630
3687
|
}),
|
|
3631
3688
|
};
|
|
3632
|
-
|
|
3689
|
+
newRunner = new RemoteGraphRunner(registry, backend);
|
|
3690
|
+
}
|
|
3691
|
+
else {
|
|
3692
|
+
newRunner = new LocalGraphRunner(registry);
|
|
3633
3693
|
}
|
|
3634
|
-
|
|
3694
|
+
prevRunnerRef.current = newRunner;
|
|
3695
|
+
return newRunner;
|
|
3635
3696
|
}, [registry, backendKind, httpBaseUrl, wsUrl, backendOptions]);
|
|
3697
|
+
// Cleanup runner on unmount
|
|
3698
|
+
useEffect(() => {
|
|
3699
|
+
return () => {
|
|
3700
|
+
if (prevRunnerRef.current) {
|
|
3701
|
+
try {
|
|
3702
|
+
prevRunnerRef.current.dispose();
|
|
3703
|
+
}
|
|
3704
|
+
catch (err) {
|
|
3705
|
+
console.warn("Error disposing runner on unmount:", err);
|
|
3706
|
+
}
|
|
3707
|
+
}
|
|
3708
|
+
};
|
|
3709
|
+
}, []);
|
|
3636
3710
|
// Allow external UI registration (e.g., node renderers) with access to wb
|
|
3637
3711
|
useEffect(() => {
|
|
3638
3712
|
const baseRegisterUI = (_wb) => { };
|