@bian-womp/spark-workbench 0.2.26 → 0.2.28
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 +159 -39
- package/lib/cjs/index.cjs.map +1 -1
- package/lib/cjs/src/misc/DebugEvents.d.ts.map +1 -1
- package/lib/cjs/src/misc/DefaultNode.d.ts.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/cjs/src/misc/value.d.ts +6 -0
- package/lib/cjs/src/misc/value.d.ts.map +1 -1
- package/lib/cjs/src/runtime/LocalGraphRunner.d.ts.map +1 -1
- package/lib/cjs/src/runtime/RemoteGraphRunner.d.ts.map +1 -1
- package/lib/esm/index.js +160 -41
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/src/misc/DebugEvents.d.ts.map +1 -1
- package/lib/esm/src/misc/DefaultNode.d.ts.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/lib/esm/src/misc/value.d.ts +6 -0
- package/lib/esm/src/misc/value.d.ts.map +1 -1
- package/lib/esm/src/runtime/LocalGraphRunner.d.ts.map +1 -1
- package/lib/esm/src/runtime/RemoteGraphRunner.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugEvents.d.ts","sourceRoot":"","sources":["../../../../src/misc/DebugEvents.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DebugEvents.d.ts","sourceRoot":"","sources":["../../../../src/misc/DebugEvents.tsx"],"names":[],"mappings":"AAKA,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,kBAAkB,EAClB,aAAa,EACb,qBAAqB,GACtB,EAAE;IACD,UAAU,EAAE,OAAO,CAAC;IACpB,kBAAkB,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,OAAO,CAAC;IACvB,qBAAqB,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C,2CA4GA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultNode.d.ts","sourceRoot":"","sources":["../../../../src/misc/DefaultNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAOvB,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGrE,eAAO,MAAM,WAAW,yDAuDtB,CAAC;AAGH,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,YAAY,GACb,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,2CAwDA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,aAAa,GACd,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"DefaultNode.d.ts","sourceRoot":"","sources":["../../../../src/misc/DefaultNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,IAAI,EACV,MAAM,eAAe,CAAC;AAOvB,OAAO,EAA2B,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGrE,eAAO,MAAM,WAAW,yDAuDtB,CAAC;AAGH,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,KAAK,EACL,UAAU,EACV,KAAK,EACL,MAAM,EACN,YAAY,GACb,EAAE;IACD,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE;QAAE,MAAM,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,OAAO,CAAC,EAAE,GAAG,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,GAAG,EAAE,CAAA;KAAE,CAAC;IAChE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;CAC3B,2CAwDA;AAED,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,aAAa,GACd,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,2CA+H7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inspector.d.ts","sourceRoot":"","sources":["../../../../src/misc/Inspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Inspector.d.ts","sourceRoot":"","sources":["../../../../src/misc/Inspector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAQnD,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,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC;IACvD,SAAS,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,KAAK,GAAG,CAAC,OAAO,CAAC;IAC7D,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,KAAK,IAAI,CAAC;CACxE,2CAmgBA"}
|
|
@@ -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,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AAC;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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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"}
|
|
@@ -5,6 +5,12 @@ export declare function resolveOutputDisplay(raw: unknown, declared: string | st
|
|
|
5
5
|
value: unknown;
|
|
6
6
|
};
|
|
7
7
|
export declare function formatDeclaredTypeSignature(declared: string | string[] | undefined): string;
|
|
8
|
+
/**
|
|
9
|
+
* Formats a handle ID for display in the UI.
|
|
10
|
+
* For handles with format "prefix:middle:suffix:extra" (4 parts), displays only the middle part.
|
|
11
|
+
* Otherwise returns the handle ID as-is.
|
|
12
|
+
*/
|
|
13
|
+
export declare function prettyHandle(id: string): string;
|
|
8
14
|
export declare function preformatValueForDisplay(typeId: string | undefined, value: unknown, registry?: Registry): string | undefined;
|
|
9
15
|
export declare function summarizeDeep(value: unknown): unknown;
|
|
10
16
|
//# sourceMappingURL=value.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../../../src/misc/value.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAGd,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW5D;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GACtC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAcrC;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GACtC,MAAM,CAGR;AAGD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,OAAO,EACd,QAAQ,CAAC,EAAE,QAAQ,GAClB,MAAM,GAAG,SAAS,CA8BpB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAiCrD"}
|
|
1
|
+
{"version":3,"file":"value.d.ts","sourceRoot":"","sources":["../../../../src/misc/value.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAGd,MAAM,wBAAwB,CAAC;AAEhC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW5D;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GACtC;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAcrC;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,GACtC,MAAM,CAGR;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAS/C;AAGD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,KAAK,EAAE,OAAO,EACd,QAAQ,CAAC,EAAE,QAAQ,GAClB,MAAM,GAAG,SAAS,CA8BpB;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAiCrD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalGraphRunner.d.ts","sourceRoot":"","sources":["../../../../src/runtime/LocalGraphRunner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EAOT,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE5D,qBAAa,gBAAiB,SAAQ,mBAAmB;gBAC3C,QAAQ,EAAE,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,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IASlE,YAAY;IASZ,iBAAiB,CAAC,OAAO,EAAE,mBAAmB;IAKpD,cAAc,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE;IAWvE,cAAc,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS;IAOrD,UAAU,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAoBzE,SAAS,CAAC,GAAG,EAAE,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA6BxE,OAAO,IAAI,IAAI;IAaf;;;OAGG;YACW,aAAa;cA6HX,kBAAkB,IAAI,OAAO,CAAC,YAAY,CAAC;CAuD5D"}
|
package/lib/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { HttpPollingTransport, WebSocketTransport, RemoteRunner } from '@bian-wo
|
|
|
3
3
|
import React, { useCallback, useState, useRef, useEffect, useMemo, createContext, useContext, useImperativeHandle } from 'react';
|
|
4
4
|
import { Position, Handle, useUpdateNodeInternals, useReactFlow, ReactFlowProvider, ReactFlow, Background, BackgroundVariant, MiniMap, Controls } from '@xyflow/react';
|
|
5
5
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
-
import { XCircleIcon, WarningCircleIcon, ArrowClockwiseIcon, PlugsConnectedIcon, ClockClockwiseIcon, WifiHighIcon, WifiSlashIcon, StopIcon, PlayIcon } from '@phosphor-icons/react';
|
|
6
|
+
import { XCircleIcon, WarningCircleIcon, CopyIcon, TrashIcon, ArrowClockwiseIcon, PlugsConnectedIcon, ClockClockwiseIcon, WifiHighIcon, WifiSlashIcon, StopIcon, PlayIcon } from '@phosphor-icons/react';
|
|
7
7
|
import cx from 'classnames';
|
|
8
8
|
import isEqual from 'lodash/isEqual';
|
|
9
9
|
|
|
@@ -522,7 +522,16 @@ class LocalGraphRunner extends AbstractGraphRunner {
|
|
|
522
522
|
const runtimeInputs = this.runtime
|
|
523
523
|
? this.runtime.getNodeData?.(n.nodeId)?.inputs ?? {}
|
|
524
524
|
: {};
|
|
525
|
-
|
|
525
|
+
// Build inbound handle set for this node from current def
|
|
526
|
+
const inbound = new Set(def.edges
|
|
527
|
+
.filter((e) => e.target.nodeId === n.nodeId)
|
|
528
|
+
.map((e) => e.target.handle));
|
|
529
|
+
// Merge staged only for non-inbound handles so UI reflects runtime values for wired inputs
|
|
530
|
+
const merged = { ...runtimeInputs };
|
|
531
|
+
for (const [h, v] of Object.entries(staged)) {
|
|
532
|
+
if (!inbound.has(h))
|
|
533
|
+
merged[h] = v;
|
|
534
|
+
}
|
|
526
535
|
if (Object.keys(merged).length > 0)
|
|
527
536
|
out[n.nodeId] = merged;
|
|
528
537
|
}
|
|
@@ -793,12 +802,21 @@ class RemoteGraphRunner extends AbstractGraphRunner {
|
|
|
793
802
|
const desc = this.registry.nodes.get(n.typeId);
|
|
794
803
|
const handles = Object.keys(resolved ?? desc?.inputs ?? {});
|
|
795
804
|
const cur = {};
|
|
805
|
+
// Build inbound handle set for this node to honor wiring precedence
|
|
806
|
+
const inbound = new Set(def.edges
|
|
807
|
+
.filter((e) => e.target.nodeId === n.nodeId)
|
|
808
|
+
.map((e) => e.target.handle));
|
|
796
809
|
for (const h of handles) {
|
|
797
810
|
const rec = cache.get(`${n.nodeId}.${h}`);
|
|
798
811
|
if (rec && rec.io === "input")
|
|
799
812
|
cur[h] = rec.value;
|
|
800
813
|
}
|
|
801
|
-
|
|
814
|
+
// Merge staged only for non-inbound handles so UI doesn't override runtime values
|
|
815
|
+
const merged = { ...cur };
|
|
816
|
+
for (const [h, v] of Object.entries(staged)) {
|
|
817
|
+
if (!inbound.has(h))
|
|
818
|
+
merged[h] = v;
|
|
819
|
+
}
|
|
802
820
|
if (Object.keys(merged).length > 0)
|
|
803
821
|
out[n.nodeId] = merged;
|
|
804
822
|
}
|
|
@@ -1262,6 +1280,23 @@ function formatDeclaredTypeSignature(declared) {
|
|
|
1262
1280
|
return declared.join(" | ");
|
|
1263
1281
|
return declared ?? "";
|
|
1264
1282
|
}
|
|
1283
|
+
/**
|
|
1284
|
+
* Formats a handle ID for display in the UI.
|
|
1285
|
+
* For handles with format "prefix:middle:suffix:extra" (4 parts), displays only the middle part.
|
|
1286
|
+
* Otherwise returns the handle ID as-is.
|
|
1287
|
+
*/
|
|
1288
|
+
function prettyHandle(id) {
|
|
1289
|
+
try {
|
|
1290
|
+
const parts = String(id).split(":");
|
|
1291
|
+
// If there are exactly 3 colons (4 parts), display only the second part
|
|
1292
|
+
if (parts.length === 4)
|
|
1293
|
+
return parts[1] || id;
|
|
1294
|
+
return id;
|
|
1295
|
+
}
|
|
1296
|
+
catch {
|
|
1297
|
+
return id;
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1265
1300
|
// Pre-format common structures for display; return undefined to defer to caller
|
|
1266
1301
|
function preformatValueForDisplay(typeId, value, registry) {
|
|
1267
1302
|
if (value === undefined || value === null)
|
|
@@ -1645,6 +1680,16 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1645
1680
|
const [edgeStatus, setEdgeStatus] = useState({});
|
|
1646
1681
|
const [events, setEvents] = useState([]);
|
|
1647
1682
|
const clearEvents = useCallback(() => setEvents([]), []);
|
|
1683
|
+
const [systemErrors, setSystemErrors] = useState([]);
|
|
1684
|
+
const [registryErrors, setRegistryErrors] = useState([]);
|
|
1685
|
+
const clearSystemErrors = useCallback(() => setSystemErrors([]), []);
|
|
1686
|
+
const clearRegistryErrors = useCallback(() => setRegistryErrors([]), []);
|
|
1687
|
+
const removeSystemError = useCallback((index) => {
|
|
1688
|
+
setSystemErrors((prev) => prev.filter((_, idx) => idx !== index));
|
|
1689
|
+
}, []);
|
|
1690
|
+
const removeRegistryError = useCallback((index) => {
|
|
1691
|
+
setRegistryErrors((prev) => prev.filter((_, idx) => idx !== index));
|
|
1692
|
+
}, []);
|
|
1648
1693
|
// Fallback progress animation: drive progress to 100% over ~2 minutes
|
|
1649
1694
|
const FALLBACK_TOTAL_MS = 2 * 60 * 1000;
|
|
1650
1695
|
const [fallbackStarts, setFallbackStarts] = useState({});
|
|
@@ -1827,7 +1872,10 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1827
1872
|
if (remoteDef && Array.isArray(remoteDef.nodes)) {
|
|
1828
1873
|
// Mutate current def in-place to avoid emitting graphChanged and causing update loop
|
|
1829
1874
|
const cur = wb.export();
|
|
1830
|
-
const byId = new Map((remoteDef.nodes || []).map((n) => [
|
|
1875
|
+
const byId = new Map((remoteDef.nodes || []).map((n) => [
|
|
1876
|
+
n.nodeId,
|
|
1877
|
+
n,
|
|
1878
|
+
]));
|
|
1831
1879
|
let changed = false;
|
|
1832
1880
|
for (const n of cur.nodes) {
|
|
1833
1881
|
const rn = byId.get(n.nodeId);
|
|
@@ -1859,6 +1907,8 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1859
1907
|
const off2 = runner.on("error", (e) => {
|
|
1860
1908
|
const edgeError = e;
|
|
1861
1909
|
const nodeError = e;
|
|
1910
|
+
const registryError = e;
|
|
1911
|
+
const systemError = e;
|
|
1862
1912
|
if (edgeError.kind === "edge-convert") {
|
|
1863
1913
|
const edgeId = edgeError.edgeId;
|
|
1864
1914
|
setEdgeStatus((s) => ({
|
|
@@ -1866,7 +1916,7 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1866
1916
|
[edgeId]: { ...s[edgeId], lastError: edgeError.err },
|
|
1867
1917
|
}));
|
|
1868
1918
|
}
|
|
1869
|
-
else if (nodeError.nodeId) {
|
|
1919
|
+
else if (nodeError.kind === "node-run" && nodeError.nodeId) {
|
|
1870
1920
|
const nodeId = nodeError.nodeId;
|
|
1871
1921
|
const runId = nodeError.runId;
|
|
1872
1922
|
setNodeStatus((s) => ({
|
|
@@ -1884,6 +1934,27 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
1884
1934
|
};
|
|
1885
1935
|
}
|
|
1886
1936
|
}
|
|
1937
|
+
else if (registryError.kind === "registry") {
|
|
1938
|
+
// Track registry errors for UI display
|
|
1939
|
+
setRegistryErrors((prev) => {
|
|
1940
|
+
// Avoid duplicates by checking message
|
|
1941
|
+
if (prev.some((err) => err.message === registryError.message)) {
|
|
1942
|
+
return prev;
|
|
1943
|
+
}
|
|
1944
|
+
return [...prev, registryError];
|
|
1945
|
+
});
|
|
1946
|
+
}
|
|
1947
|
+
else if (systemError.kind === "system") {
|
|
1948
|
+
// Track custom errors for UI display
|
|
1949
|
+
setSystemErrors((prev) => {
|
|
1950
|
+
// Avoid duplicates by checking message and code
|
|
1951
|
+
if (prev.some((err) => err.message === systemError.message &&
|
|
1952
|
+
err.code === systemError.code)) {
|
|
1953
|
+
return prev;
|
|
1954
|
+
}
|
|
1955
|
+
return [...prev, systemError];
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1887
1958
|
return add("runner", "error")(e);
|
|
1888
1959
|
});
|
|
1889
1960
|
const off3 = runner.on("invalidate", (e) => {
|
|
@@ -2131,6 +2202,12 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
2131
2202
|
validationGlobal,
|
|
2132
2203
|
events,
|
|
2133
2204
|
clearEvents,
|
|
2205
|
+
systemErrors,
|
|
2206
|
+
registryErrors,
|
|
2207
|
+
clearSystemErrors,
|
|
2208
|
+
clearRegistryErrors,
|
|
2209
|
+
removeSystemError,
|
|
2210
|
+
removeRegistryError,
|
|
2134
2211
|
isRunning,
|
|
2135
2212
|
engineKind,
|
|
2136
2213
|
start,
|
|
@@ -2152,6 +2229,12 @@ function WorkbenchProvider({ wb, runner, registry, setRegistry, overrides, child
|
|
|
2152
2229
|
nodeStatus,
|
|
2153
2230
|
edgeStatus,
|
|
2154
2231
|
valuesTick,
|
|
2232
|
+
systemErrors,
|
|
2233
|
+
registryErrors,
|
|
2234
|
+
clearSystemErrors,
|
|
2235
|
+
clearRegistryErrors,
|
|
2236
|
+
removeSystemError,
|
|
2237
|
+
removeRegistryError,
|
|
2155
2238
|
inputsMap,
|
|
2156
2239
|
outputsMap,
|
|
2157
2240
|
validationByNode,
|
|
@@ -2180,6 +2263,7 @@ function IssueBadge({ level, title, size = 12, className, }) {
|
|
|
2180
2263
|
function DebugEvents({ autoScroll, onAutoScrollChange, hideWorkbench, onHideWorkbenchChange, }) {
|
|
2181
2264
|
const { events, clearEvents } = useWorkbenchContext();
|
|
2182
2265
|
const scrollRef = useRef(null);
|
|
2266
|
+
const [copied, setCopied] = useState(false);
|
|
2183
2267
|
const rows = useMemo(() => {
|
|
2184
2268
|
const filtered = hideWorkbench
|
|
2185
2269
|
? events.filter((e) => e.source !== "workbench")
|
|
@@ -2203,7 +2287,25 @@ function DebugEvents({ autoScroll, onAutoScrollChange, hideWorkbench, onHideWork
|
|
|
2203
2287
|
return String(v);
|
|
2204
2288
|
}
|
|
2205
2289
|
};
|
|
2206
|
-
|
|
2290
|
+
const handleCopyLogs = async () => {
|
|
2291
|
+
try {
|
|
2292
|
+
const formattedEvents = rows.map((ev) => ({
|
|
2293
|
+
no: ev.no,
|
|
2294
|
+
at: ev.at,
|
|
2295
|
+
source: ev.source,
|
|
2296
|
+
type: ev.type,
|
|
2297
|
+
payload: summarizeDeep(ev.payload),
|
|
2298
|
+
}));
|
|
2299
|
+
const jsonString = JSON.stringify(formattedEvents, null, 2);
|
|
2300
|
+
await navigator.clipboard.writeText(jsonString);
|
|
2301
|
+
setCopied(true);
|
|
2302
|
+
setTimeout(() => setCopied(false), 2000);
|
|
2303
|
+
}
|
|
2304
|
+
catch (err) {
|
|
2305
|
+
console.error("Failed to copy logs:", err);
|
|
2306
|
+
}
|
|
2307
|
+
};
|
|
2308
|
+
return (jsxs("div", { className: "flex flex-col h-full min-h-0", children: [jsxs("div", { className: "flex items-center justify-between mb-1", children: [jsx("div", { className: "font-semibold", children: "Events" }), jsxs("div", { className: "flex items-center gap-2", children: [jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-700", children: [jsx("input", { type: "checkbox", checked: hideWorkbench, onChange: (e) => onHideWorkbenchChange?.(e.target.checked) }), jsx("span", { children: "Hide workbench" })] }), jsxs("label", { className: "flex items-center gap-1 text-xs text-gray-700", children: [jsx("input", { type: "checkbox", checked: autoScroll, onChange: (e) => onAutoScrollChange?.(e.target.checked) }), jsx("span", { children: "Auto scroll" })] }), jsx("button", { onClick: handleCopyLogs, className: "p-2 border border-gray-300 rounded flex items-center justify-center", title: copied ? "Copied!" : "Copy logs as formatted JSON", children: jsx(CopyIcon, { size: 14 }) }), jsx("button", { onClick: clearEvents, className: "p-2 border border-gray-300 rounded flex items-center justify-center", title: "Clear all events", children: jsx(TrashIcon, { size: 14 }) })] })] }), jsx("div", { ref: scrollRef, className: "flex-1 overflow-auto text-[11px] leading-4 divide-y divide-gray-200", children: rows.map((ev) => (jsxs("div", { className: "opacity-85 odd:bg-gray-50 px-2 py-1", children: [jsxs("div", { className: "flex items-baseline gap-2", children: [jsx("span", { className: "w-12 shrink-0 text-right text-gray-500 select-none", children: ev.no }), jsxs("span", { className: "text-gray-500", children: [new Date(ev.at).toLocaleTimeString(), " \u00B7 ", ev.source, ":", ev.type] })] }), jsx("pre", { className: "m-0 whitespace-pre-wrap ml-12", children: renderPayload(ev.payload) })] }, `${ev.at}:${ev.no}`))) })] }));
|
|
2207
2309
|
}
|
|
2208
2310
|
|
|
2209
2311
|
function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHideWorkbenchChange, toString, toElement, contextPanel, setInput, }) {
|
|
@@ -2218,20 +2320,24 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2218
2320
|
return String(value ?? "");
|
|
2219
2321
|
}
|
|
2220
2322
|
};
|
|
2221
|
-
const { registry, def, selectedNodeId, selectedEdgeId, inputsMap, outputsMap, outputTypesMap, nodeStatus, validationByNode, validationByEdge, validationGlobal, valuesTick, updateEdgeType, } = useWorkbenchContext();
|
|
2323
|
+
const { registry, def, selectedNodeId, selectedEdgeId, inputsMap, outputsMap, outputTypesMap, nodeStatus, validationByNode, validationByEdge, validationGlobal, valuesTick, updateEdgeType, systemErrors, registryErrors, clearSystemErrors, clearRegistryErrors, removeSystemError, removeRegistryError, } = useWorkbenchContext();
|
|
2222
2324
|
const nodeValidationIssues = validationByNode.issues;
|
|
2223
2325
|
const edgeValidationIssues = validationByEdge.issues;
|
|
2224
2326
|
const nodeValidationHandles = validationByNode;
|
|
2225
2327
|
const globalValidationIssues = validationGlobal;
|
|
2226
2328
|
const selectedNode = def.nodes.find((n) => n.nodeId === selectedNodeId);
|
|
2227
2329
|
const selectedEdge = def.edges.find((e) => e.id === selectedEdgeId);
|
|
2228
|
-
|
|
2330
|
+
selectedNode
|
|
2229
2331
|
? registry.nodes.get(selectedNode.typeId)
|
|
2230
2332
|
: undefined;
|
|
2231
|
-
|
|
2232
|
-
|
|
2333
|
+
// Use computeEffectiveHandles to merge registry defaults with dynamically resolved handles
|
|
2334
|
+
const effectiveHandles = selectedNode
|
|
2335
|
+
? computeEffectiveHandles(selectedNode, registry)
|
|
2336
|
+
: { inputs: {}, outputs: {}};
|
|
2337
|
+
const inputHandles = Object.entries(effectiveHandles.inputs)
|
|
2338
|
+
.filter(([k]) => !isInputPrivate(effectiveHandles.inputs, k))
|
|
2233
2339
|
.map(([k]) => k);
|
|
2234
|
-
const outputHandles = Object.keys(
|
|
2340
|
+
const outputHandles = Object.keys(effectiveHandles.outputs);
|
|
2235
2341
|
const nodeInputs = selectedNodeId ? inputsMap[selectedNodeId] ?? {} : {};
|
|
2236
2342
|
const nodeOutputs = selectedNodeId ? outputsMap[selectedNodeId] ?? {} : {};
|
|
2237
2343
|
const selectedNodeStatus = selectedNodeId
|
|
@@ -2272,12 +2378,11 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2272
2378
|
}
|
|
2273
2379
|
return;
|
|
2274
2380
|
}
|
|
2275
|
-
const
|
|
2276
|
-
const handles = Object.keys(desc?.inputs ?? {});
|
|
2381
|
+
const handles = Object.keys(effectiveHandles.inputs);
|
|
2277
2382
|
const nextDrafts = { ...drafts };
|
|
2278
2383
|
const nextOriginals = { ...originals };
|
|
2279
2384
|
for (const h of handles) {
|
|
2280
|
-
const typeId = getInputTypeId(
|
|
2385
|
+
const typeId = getInputTypeId(effectiveHandles.inputs, h);
|
|
2281
2386
|
const current = nodeInputs[h];
|
|
2282
2387
|
const display = safeToString(typeId, current);
|
|
2283
2388
|
const wasOriginal = originals[h];
|
|
@@ -2293,7 +2398,7 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2293
2398
|
setDrafts(nextDrafts);
|
|
2294
2399
|
if (!shallowEqual(originals, nextOriginals))
|
|
2295
2400
|
setOriginals(nextOriginals);
|
|
2296
|
-
}, [selectedNodeId,
|
|
2401
|
+
}, [selectedNodeId, selectedNode, registry, valuesTick]);
|
|
2297
2402
|
const widthClass = debug ? "w-[480px]" : "w-[320px]";
|
|
2298
2403
|
const { wb } = useWorkbenchContext();
|
|
2299
2404
|
const deleteEdgeById = (edgeId) => {
|
|
@@ -2304,7 +2409,7 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2304
2409
|
}
|
|
2305
2410
|
catch { }
|
|
2306
2411
|
};
|
|
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) => {
|
|
2412
|
+
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
2413
|
e.stopPropagation();
|
|
2309
2414
|
deleteEdgeById(m.data?.edgeId);
|
|
2310
2415
|
}, 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) => {
|
|
@@ -2319,7 +2424,7 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2319
2424
|
deleteEdgeById(selectedEdge.id);
|
|
2320
2425
|
}, title: "Delete this edge", children: "Delete edge" })] }, i))) })] }))] })) : (jsxs("div", { children: [selectedNode && (jsxs("div", { className: "mb-2", children: [jsxs("div", { children: ["Node: ", selectedNode.nodeId] }), jsxs("div", { children: ["Type: ", selectedNode.typeId] }), !!selectedNodeStatus?.lastError && (jsx("div", { className: "mt-2 text-sm text-red-700 bg-red-50 border border-red-200 rounded px-2 py-1 break-words", children: String(selectedNodeStatus.lastError?.message ??
|
|
2321
2426
|
selectedNodeStatus.lastError) }))] })), jsxs("div", { className: "mb-2", children: [jsx("div", { className: "font-semibold mb-1", children: "Inputs" }), inputHandles.length === 0 ? (jsx("div", { className: "text-gray-500", children: "No inputs" })) : (inputHandles.map((h) => {
|
|
2322
|
-
const typeId = getInputTypeId(
|
|
2427
|
+
const typeId = getInputTypeId(effectiveHandles.inputs, h);
|
|
2323
2428
|
const isLinked = def.edges.some((e) => e.target.nodeId === selectedNodeId &&
|
|
2324
2429
|
e.target.handle === h);
|
|
2325
2430
|
const commonProps = {
|
|
@@ -2347,7 +2452,7 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2347
2452
|
const title = inIssues
|
|
2348
2453
|
.map((v) => `${v.code}: ${v.message}`)
|
|
2349
2454
|
.join("; ");
|
|
2350
|
-
return (jsxs("div", { className: "flex items-center gap-2 mb-1", children: [jsxs("label", { className: "w-32 flex flex-col", children: [jsx("span", { children: h }), jsx("span", { className: "text-gray-500 text-[11px]", children: typeId })] }), hasValidation && (jsx(IssueBadge, { level: hasErr ? "error" : "warning", size: 24, className: "ml-1 w-6 h-6", title: title })), isEnum ? (jsxs("select", { className: "border border-gray-300 rounded px-2 py-1 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full", value: current !== undefined && current !== null
|
|
2455
|
+
return (jsxs("div", { className: "flex items-center gap-2 mb-1", children: [jsxs("label", { className: "w-32 flex flex-col", children: [jsx("span", { children: prettyHandle(h) }), jsx("span", { className: "text-gray-500 text-[11px]", children: typeId })] }), hasValidation && (jsx(IssueBadge, { level: hasErr ? "error" : "warning", size: 24, className: "ml-1 w-6 h-6", title: title })), isEnum ? (jsxs("select", { className: "border border-gray-300 rounded px-2 py-1 focus:outline-none focus:ring-2 focus:ring-blue-500 w-full", value: current !== undefined && current !== null
|
|
2351
2456
|
? String(current)
|
|
2352
2457
|
: "", onChange: (e) => {
|
|
2353
2458
|
const val = e.target.value;
|
|
@@ -2363,8 +2468,8 @@ function Inspector({ debug, autoScroll, hideWorkbench, onAutoScrollChange, onHid
|
|
|
2363
2468
|
if (e.key === "Escape")
|
|
2364
2469
|
revert();
|
|
2365
2470
|
}, ...commonProps }))] }, h));
|
|
2366
|
-
}))] }), jsxs("div", { children: [jsx("div", { className: "font-semibold mb-1", children: "Outputs" }), outputHandles.length === 0 ? (jsx("div", { className: "text-gray-500", children: "No outputs" })) : (outputHandles.map((h) => (jsxs("div", { className: "flex items-center gap-2 mb-1", children: [jsxs("label", { className: "w-20 flex flex-col", children: [jsx("span", { children: h }), jsx("span", { className: "text-gray-500 text-[11px]", children: outputTypesMap[selectedNodeId]?.[h] ?? "" })] }), jsx("div", { className: "flex-1", children: (() => {
|
|
2367
|
-
const { typeId, value } = resolveOutputDisplay(nodeOutputs[h],
|
|
2471
|
+
}))] }), jsxs("div", { children: [jsx("div", { className: "font-semibold mb-1", children: "Outputs" }), outputHandles.length === 0 ? (jsx("div", { className: "text-gray-500", children: "No outputs" })) : (outputHandles.map((h) => (jsxs("div", { className: "flex items-center gap-2 mb-1", children: [jsxs("label", { className: "w-20 flex flex-col", children: [jsx("span", { children: prettyHandle(h) }), jsx("span", { className: "text-gray-500 text-[11px]", children: outputTypesMap[selectedNodeId]?.[h] ?? "" })] }), jsx("div", { className: "flex-1", children: (() => {
|
|
2472
|
+
const { typeId, value } = resolveOutputDisplay(nodeOutputs[h], effectiveHandles.outputs[h]);
|
|
2368
2473
|
return toElement(typeId, value);
|
|
2369
2474
|
})() }), (() => {
|
|
2370
2475
|
const outIssues = selectedNodeHandleValidation.outputs.filter((m) => m.handle === h);
|
|
@@ -2508,18 +2613,6 @@ function DefaultNodeHeader({ id, title, validation, right, showId, onInvalidate,
|
|
|
2508
2613
|
}
|
|
2509
2614
|
function DefaultNodeContent({ data, isConnectable, }) {
|
|
2510
2615
|
const { showValues, inputValues, outputValues, toString } = data;
|
|
2511
|
-
const prettyHandle = React.useCallback((id) => {
|
|
2512
|
-
try {
|
|
2513
|
-
const parts = String(id).split(":");
|
|
2514
|
-
// If there are exactly 3 colons (4 parts), display only the second part
|
|
2515
|
-
if (parts.length === 4)
|
|
2516
|
-
return parts[1] || id;
|
|
2517
|
-
return id;
|
|
2518
|
-
}
|
|
2519
|
-
catch {
|
|
2520
|
-
return id;
|
|
2521
|
-
}
|
|
2522
|
-
}, []);
|
|
2523
2616
|
const inputEntries = data.inputHandles ?? [];
|
|
2524
2617
|
const outputEntries = data.outputHandles ?? [];
|
|
2525
2618
|
const status = data.status ?? { activeRuns: 0 };
|
|
@@ -3154,11 +3247,8 @@ function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, ex
|
|
|
3154
3247
|
return backendKind === "local";
|
|
3155
3248
|
});
|
|
3156
3249
|
// Expose init callback with setInitialGraph helper
|
|
3157
|
-
|
|
3250
|
+
// Note: This runs whenever runner changes (e.g., when Flow is enabled and backendOptions changes)
|
|
3158
3251
|
useEffect(() => {
|
|
3159
|
-
if (initCalled.current)
|
|
3160
|
-
return;
|
|
3161
|
-
initCalled.current = true;
|
|
3162
3252
|
if (!onInit)
|
|
3163
3253
|
return;
|
|
3164
3254
|
const setInitialGraph = async (d, inputs) => {
|
|
@@ -3604,7 +3694,19 @@ function WorkbenchStudioCanvas({ setRegistry, autoScroll, onAutoScrollChange, ex
|
|
|
3604
3694
|
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
3695
|
const [registry, setRegistry] = useState(createSimpleGraphRegistry());
|
|
3606
3696
|
const [wb] = useState(() => new InMemoryWorkbench({ ui: new DefaultUIExtensionRegistry() }));
|
|
3697
|
+
// Store previous runner for cleanup
|
|
3698
|
+
const prevRunnerRef = useRef(null);
|
|
3607
3699
|
const runner = useMemo(() => {
|
|
3700
|
+
// Dispose previous runner if it exists
|
|
3701
|
+
if (prevRunnerRef.current) {
|
|
3702
|
+
try {
|
|
3703
|
+
prevRunnerRef.current.dispose();
|
|
3704
|
+
}
|
|
3705
|
+
catch (err) {
|
|
3706
|
+
console.warn("Error disposing previous runner:", err);
|
|
3707
|
+
}
|
|
3708
|
+
}
|
|
3709
|
+
let newRunner;
|
|
3608
3710
|
if (backendKind === "remote-http") {
|
|
3609
3711
|
const backend = {
|
|
3610
3712
|
kind: "remote-http",
|
|
@@ -3616,9 +3718,9 @@ function WorkbenchStudio({ engine, onEngineChange, example, onExampleChange, bac
|
|
|
3616
3718
|
onCustomEvent: backendOptions.onCustomEvent,
|
|
3617
3719
|
}),
|
|
3618
3720
|
};
|
|
3619
|
-
|
|
3721
|
+
newRunner = new RemoteGraphRunner(registry, backend);
|
|
3620
3722
|
}
|
|
3621
|
-
if (backendKind === "remote-ws") {
|
|
3723
|
+
else if (backendKind === "remote-ws") {
|
|
3622
3724
|
const backend = {
|
|
3623
3725
|
kind: "remote-ws",
|
|
3624
3726
|
url: wsUrl,
|
|
@@ -3629,10 +3731,27 @@ function WorkbenchStudio({ engine, onEngineChange, example, onExampleChange, bac
|
|
|
3629
3731
|
onCustomEvent: backendOptions.onCustomEvent,
|
|
3630
3732
|
}),
|
|
3631
3733
|
};
|
|
3632
|
-
|
|
3734
|
+
newRunner = new RemoteGraphRunner(registry, backend);
|
|
3633
3735
|
}
|
|
3634
|
-
|
|
3736
|
+
else {
|
|
3737
|
+
newRunner = new LocalGraphRunner(registry);
|
|
3738
|
+
}
|
|
3739
|
+
prevRunnerRef.current = newRunner;
|
|
3740
|
+
return newRunner;
|
|
3635
3741
|
}, [registry, backendKind, httpBaseUrl, wsUrl, backendOptions]);
|
|
3742
|
+
// Cleanup runner on unmount
|
|
3743
|
+
useEffect(() => {
|
|
3744
|
+
return () => {
|
|
3745
|
+
if (prevRunnerRef.current) {
|
|
3746
|
+
try {
|
|
3747
|
+
prevRunnerRef.current.dispose();
|
|
3748
|
+
}
|
|
3749
|
+
catch (err) {
|
|
3750
|
+
console.warn("Error disposing runner on unmount:", err);
|
|
3751
|
+
}
|
|
3752
|
+
}
|
|
3753
|
+
};
|
|
3754
|
+
}, []);
|
|
3636
3755
|
// Allow external UI registration (e.g., node renderers) with access to wb
|
|
3637
3756
|
useEffect(() => {
|
|
3638
3757
|
const baseRegisterUI = (_wb) => { };
|
|
@@ -3646,5 +3765,5 @@ function WorkbenchStudio({ engine, onEngineChange, example, onExampleChange, bac
|
|
|
3646
3765
|
}, httpBaseUrl: httpBaseUrl, onHttpBaseUrlChange: onHttpBaseUrlChange, wsUrl: wsUrl, onWsUrlChange: onWsUrlChange, debug: debug, onDebugChange: onDebugChange, showValues: showValues, onShowValuesChange: onShowValuesChange, hideWorkbench: hideWorkbench, onHideWorkbenchChange: onHideWorkbenchChange, backendOptions: backendOptions, overrides: overrides, onInit: onInit, onChange: onChange }) }));
|
|
3647
3766
|
}
|
|
3648
3767
|
|
|
3649
|
-
export { AbstractWorkbench, CLIWorkbench, DefaultNode, DefaultNodeContent, DefaultNodeHeader, DefaultUIExtensionRegistry, InMemoryWorkbench, Inspector, LocalGraphRunner, NodeHandles, RemoteGraphRunner, WorkbenchCanvas, WorkbenchContext, WorkbenchProvider, WorkbenchStudio, formatDataUrlAsLabel, formatDeclaredTypeSignature, getNodeBorderClassNames, preformatValueForDisplay, resolveOutputDisplay, summarizeDeep, toReactFlow, useQueryParamBoolean, useQueryParamString, useThrottledValue, useWorkbenchBridge, useWorkbenchContext, useWorkbenchGraphTick, useWorkbenchGraphUiTick, useWorkbenchVersionTick };
|
|
3768
|
+
export { AbstractWorkbench, CLIWorkbench, DefaultNode, DefaultNodeContent, DefaultNodeHeader, DefaultUIExtensionRegistry, InMemoryWorkbench, Inspector, LocalGraphRunner, NodeHandles, RemoteGraphRunner, WorkbenchCanvas, WorkbenchContext, WorkbenchProvider, WorkbenchStudio, formatDataUrlAsLabel, formatDeclaredTypeSignature, getNodeBorderClassNames, preformatValueForDisplay, prettyHandle, resolveOutputDisplay, summarizeDeep, toReactFlow, useQueryParamBoolean, useQueryParamString, useThrottledValue, useWorkbenchBridge, useWorkbenchContext, useWorkbenchGraphTick, useWorkbenchGraphUiTick, useWorkbenchVersionTick };
|
|
3650
3769
|
//# sourceMappingURL=index.js.map
|