@particle-academy/fancy-flow 0.78.0 → 0.79.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/dist/{chunk-XO4ODEY2.js → chunk-I5EPWHNM.js} +3 -3
- package/dist/{chunk-XO4ODEY2.js.map → chunk-I5EPWHNM.js.map} +1 -1
- package/dist/{chunk-BBFHGAEN.js → chunk-J66LOLJR.js} +4 -4
- package/dist/{chunk-BBFHGAEN.js.map → chunk-J66LOLJR.js.map} +1 -1
- package/dist/{chunk-3EDB6ELL.js → chunk-KMONOPAK.js} +3 -3
- package/dist/{chunk-3EDB6ELL.js.map → chunk-KMONOPAK.js.map} +1 -1
- package/dist/{chunk-GPFIJR2K.js → chunk-LBE4L3DS.js} +4 -4
- package/dist/{chunk-GPFIJR2K.js.map → chunk-LBE4L3DS.js.map} +1 -1
- package/dist/{chunk-J5YUYDMK.js → chunk-OZHBAXMA.js} +21 -4
- package/dist/chunk-OZHBAXMA.js.map +1 -0
- package/dist/{chunk-S4MOUOG4.js → chunk-QMJVUT7C.js} +3 -3
- package/dist/{chunk-S4MOUOG4.js.map → chunk-QMJVUT7C.js.map} +1 -1
- package/dist/{chunk-4GNDRRJ3.js → chunk-R4G7SPLD.js} +3 -3
- package/dist/{chunk-4GNDRRJ3.js.map → chunk-R4G7SPLD.js.map} +1 -1
- package/dist/durable.cjs +19 -2
- package/dist/durable.cjs.map +1 -1
- package/dist/durable.js +1 -1
- package/dist/engine.cjs +19 -2
- package/dist/engine.cjs.map +1 -1
- package/dist/engine.js +4 -4
- package/dist/index.cjs +19 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/registry.cjs +19 -2
- package/dist/registry.cjs.map +1 -1
- package/dist/registry.js +2 -2
- package/dist/runtime.cjs +19 -2
- package/dist/runtime.cjs.map +1 -1
- package/dist/runtime.js +3 -3
- package/dist/schema.cjs +19 -2
- package/dist/schema.cjs.map +1 -1
- package/dist/schema.js +3 -3
- package/dist/screens.cjs +19 -2
- package/dist/screens.cjs.map +1 -1
- package/dist/screens.js +4 -4
- package/dist/ux.cjs +19 -2
- package/dist/ux.cjs.map +1 -1
- package/dist/ux.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-J5YUYDMK.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RichInputPreview } from './chunk-F5RPRB7A.js';
|
|
2
2
|
import { NodeResizer, NodeToolbar, Handle, Position } from './chunk-OWENS2H5.js';
|
|
3
|
-
import { BUILTIN_KIND_DATA, getNodeKind, categoryAccent, resolveNodePorts, nodeConfig, ensureBuiltinKinds, registerBuiltinKindInternal, listNodeKinds, kindIds } from './chunk-
|
|
3
|
+
import { BUILTIN_KIND_DATA, getNodeKind, categoryAccent, resolveNodePorts, nodeConfig, ensureBuiltinKinds, registerBuiltinKindInternal, listNodeKinds, kindIds } from './chunk-OZHBAXMA.js';
|
|
4
4
|
import { memo, createContext, useMemo, useState, useRef, useEffect, createElement, useContext } from 'react';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -315,5 +315,5 @@ function buildNodeTypes() {
|
|
|
315
315
|
}
|
|
316
316
|
|
|
317
317
|
export { ANY_PORT_TYPE, BUILTIN_KINDS, FlowEditorProvider, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional };
|
|
318
|
-
//# sourceMappingURL=chunk-
|
|
319
|
-
//# sourceMappingURL=chunk-
|
|
318
|
+
//# sourceMappingURL=chunk-I5EPWHNM.js.map
|
|
319
|
+
//# sourceMappingURL=chunk-I5EPWHNM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/registry/connection.ts","../src/registry/RegistryNode.tsx","../src/components/nodes/LaneNode.tsx","../src/components/FlowEditor/api.ts","../src/components/nodes/NoteNode.tsx","../src/registry/builtin.ts","../src/registry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IAGnC,UAAA,EAAY,CAAC,GAAA,KACX,aAAA,CAAc,gBAAA,EAAkB,EAAE,MAAA,EAAS,GAAA,CAAI,MAAA,IAAU,EAAC,EAA+B;AAAA;AAE/F,CAAA;AASO,IAAM,aAAA,GAAsC,iBAAA,CAAkB,GAAA,CAAI,CAAC,IAAA,KAAS;AACjF,EAAA,MAAM,QAAA,GAAW,SAAA,CAAU,IAAA,CAAK,IAAI,CAAA;AACpC,EAAA,OAAO,WAAW,EAAE,GAAG,IAAA,EAAM,GAAG,UAAS,GAAI,IAAA;AAC/C,CAAC;AAkBM,SAAS,oBAAA,GAA6B;AAM3C,EAAA,kBAAA,EAAmB;AAEnB,EAAA,KAAA,MAAW,IAAA,IAAQ,aAAA,EAAe,2BAAA,CAA4B,IAAI,CAAA;AACpE;;;ACmBO,SAAS,cAAA,GAA4B;AAC1C,EAAA,MAAM,MAAiB,EAAC;AACxB,EAAA,KAAA,MAAW,CAAA,IAAK,eAAc,EAAG;AAM/B,IAAA,MAAM,QAAA,GAAW,EAAE,SAAA,IAAa,YAAA;AAChC,IAAA,KAAA,MAAW,MAAM,OAAA,CAAQ,CAAC,CAAA,EAAG,GAAA,CAAI,EAAE,CAAA,GAAI,QAAA;AAAA,EACzC;AACA,EAAA,OAAO,GAAA;AACT","file":"chunk-XO4ODEY2.js","sourcesContent":["import type { Connection, Edge } from \"@xyflow/react\";\nimport type { FlowNode, PortDescriptor } from \"../types\";\nimport { getNodeKind } from \"./registry\";\nimport { resolveNodePorts } from \"./ports\";\n\n/**\n * Connection validation — the single rule that decides whether an edge between\n * two ports is allowed. Lives here (React-free, registry-adjacent) so BOTH the\n * canvas (`<FlowCanvas isValidConnection>`) and the agent bridge's\n * `flow_connect` tool call the same function: a connection the canvas refuses\n * is a connection an agent cannot sneak past, and vice versa — no drift.\n *\n * `PortDescriptor.type` has always documented itself as being \"for hosts that\n * want to validate connections\", but nothing consumed it. This wires it up.\n */\n\n/**\n * Wildcard port type — matches any other type. A port that declares no `type`\n * is treated as a wildcard too, so existing flows (whose ports are untyped)\n * validate exactly as before.\n */\nexport const ANY_PORT_TYPE = \"any\";\n\n/** Decides whether a source-output port may feed a target-input port. */\nexport type PortCompatibility = (\n source: PortDescriptor | undefined,\n target: PortDescriptor | undefined,\n) => boolean;\n\n/**\n * Default compatibility rule: allow the connection UNLESS both ports declare a\n * concrete, differing type. An absent type or the `any` wildcard matches\n * anything — so typed ports get enforced while untyped ports stay permissive,\n * making this a safe default that never breaks an existing untyped graph.\n */\nexport const defaultPortCompatibility: PortCompatibility = (source, target) => {\n const s = source?.type;\n const t = target?.type;\n if (!s || !t) return true;\n if (s === ANY_PORT_TYPE || t === ANY_PORT_TYPE) return true;\n return s === t;\n};\n\nexport type ConnectionValidatorOptions = {\n /** Override the type-compatibility rule. Defaults to {@link defaultPortCompatibility}. */\n compatible?: PortCompatibility;\n /**\n * Allow a node's own output to feed its own input (a self-loop). Default\n * false — self-connections are almost always an accident, and the rare flow\n * that wants one can opt in.\n */\n allowSelfConnection?: boolean;\n};\n\n/** Resolve a node's effective ports for one side, going through the registry. */\nfunction portsFor(node: FlowNode, side: \"inputs\" | \"outputs\"): PortDescriptor[] {\n const kind = getNodeKind((node.data as any)?.kind ?? node.type);\n const resolved = resolveNodePorts(node, kind ?? undefined);\n return resolved[side] ?? [];\n}\n\n/**\n * Resolve which port a handle id refers to. When a side has a single port and\n * the handle id is absent (React Flow omits it for a lone default handle), use\n * that port; otherwise match by id.\n */\nfunction findPort(\n ports: PortDescriptor[],\n handleId: string | null | undefined,\n): PortDescriptor | undefined {\n if (handleId == null) return ports.length === 1 ? ports[0] : undefined;\n return ports.find((p) => p.id === handleId);\n}\n\n/**\n * Build an `isValidConnection` predicate that enforces port-type compatibility\n * against a live node list. Pass it straight to `<FlowCanvas isValidConnection>`\n * or reuse it to gate an agent's `flow_connect`.\n *\n * `getNodes` is called on every check so the validator always sees the current\n * graph (wire it to a ref/state getter, not a snapshot).\n *\n * A connection is rejected when: an endpoint is missing; it is a self-loop and\n * `allowSelfConnection` is off; either node is unknown; or the resolved ports\n * are type-incompatible. Nodes/ports with no declared type validate as before.\n */\nexport function createConnectionValidator(\n getNodes: () => FlowNode[],\n options: ConnectionValidatorOptions = {},\n): (connection: Connection | Edge) => boolean {\n const compatible = options.compatible ?? defaultPortCompatibility;\n return (connection) => {\n const { source, target, sourceHandle, targetHandle } = connection;\n if (!source || !target) return false;\n if (!options.allowSelfConnection && source === target) return false;\n\n const nodes = getNodes();\n const src = nodes.find((n) => n.id === source);\n const tgt = nodes.find((n) => n.id === target);\n if (!src || !tgt) return false;\n\n const outPort = findPort(portsFor(src, \"outputs\"), sourceHandle);\n const inPort = findPort(portsFor(tgt, \"inputs\"), targetHandle);\n return compatible(outPort, inPort);\n };\n}\n","import { memo, useMemo } from \"react\";\nimport { Handle, NodeResizer, NodeToolbar, Position, type NodeProps } from \"@xyflow/react\";\nimport type { FlowNode, NodeRunStatus, PortDescriptor } from \"../types\";\nimport { categoryAccent, getNodeKind } from \"./registry\";\nimport { nodeConfig, resolveNodePorts } from \"./ports\";\n\n/**\n * RegistryNode — generic node renderer that looks up the node's kind in\n * the registry and applies its `accent`/`label`/`icon`/`renderBody`. Used\n * as the xyflow node component for every registered kind.\n */\nfunction RegistryNodeInner(props: NodeProps<FlowNode>) {\n const kindName = (props.data as any).kind ?? props.type;\n const kind = useMemo(() => getNodeKind(kindName), [kindName]);\n\n if (!kind) {\n return (\n <div className=\"ff-node ff-node--unknown\">\n <div className=\"ff-node__header\" style={{ background: \"#71717a\" }}>\n <span className=\"ff-node__tag\">UNKNOWN</span>\n <span className=\"ff-node__label\">{kindName}</span>\n </div>\n <p className=\"ff-node__desc\">No registered kind for \"{kindName}\".</p>\n </div>\n );\n }\n\n const data = props.data;\n const status: NodeRunStatus = data.status ?? \"idle\";\n const accent = kind.accent ?? categoryAccent(kind.category);\n const resolved = resolveNodePorts(props, kind);\n const inputs: PortDescriptor[] = resolved.inputs ?? defaultInputs(kind.category);\n const outputs: PortDescriptor[] = resolved.outputs ?? defaultOutputs(kind.category);\n const config = nodeConfig(props);\n const label = data.label ?? kind.label;\n\n return (\n <div\n className={[\n \"ff-node\",\n `ff-node--status-${status}`,\n `ff-node--cat-${kind.category}`,\n props.selected ? \"ff-node--selected\" : \"\",\n kind.resizable ? \"ff-node--resizable\" : \"\",\n ].filter(Boolean).join(\" \")}\n style={{ borderColor: props.selected ? accent : undefined }}\n >\n {kind.resizable && (\n <NodeResizer\n isVisible={props.selected ?? false}\n color={accent}\n {...(typeof kind.resizable === \"object\" ? kind.resizable : {})}\n />\n )}\n {kind.toolbar && (\n <NodeToolbar isVisible={props.selected ?? false}>\n {kind.toolbar({ nodeId: props.id, config: config as any, selected: props.selected ?? false })}\n </NodeToolbar>\n )}\n <header className=\"ff-node__header\" style={{ background: accent }}>\n {kind.icon && <span className=\"ff-node__icon\" aria-hidden>{kind.icon}</span>}\n <span className=\"ff-node__tag\">{kind.label.toUpperCase()}</span>\n <span className=\"ff-node__label\">{label}</span>\n {status !== \"idle\" && <span className={`ff-node__dot ff-node__dot--${status}`} aria-label={`status ${status}`} />}\n </header>\n\n {data.description && <p className=\"ff-node__desc\">{data.description}</p>}\n\n <div className=\"ff-node__body\">\n {kind.renderBody\n ? kind.renderBody({ nodeId: props.id, config: config as any, selected: props.selected ?? false })\n : <DefaultBody config={config} kind={kind.configSchema} />}\n </div>\n\n {data.statusText && <p className=\"ff-node__status-text\">{data.statusText}</p>}\n\n {(data as any).output !== undefined && (\n <p className=\"ff-node__output\" title=\"Latest output\">→ {previewValue((data as any).output)}</p>\n )}\n\n {inputs.map((p, i) => (\n <Handle\n key={p.id}\n type=\"target\"\n position={Position.Left}\n id={p.id}\n style={portStyle(i, inputs.length)}\n title={p.label ?? p.id}\n />\n ))}\n {outputs.map((p, i) => (\n <Handle\n key={p.id}\n type=\"source\"\n position={Position.Right}\n id={p.id}\n style={portStyle(i, outputs.length)}\n title={p.label ?? p.id}\n />\n ))}\n </div>\n );\n}\n\nexport const RegistryNode = memo(RegistryNodeInner);\n\nfunction defaultInputs(category: string): PortDescriptor[] {\n return category === \"trigger\" ? [] : [{ id: \"in\" }];\n}\nfunction defaultOutputs(category: string): PortDescriptor[] {\n return category === \"output\" ? [] : [{ id: \"out\" }];\n}\n\nfunction portStyle(i: number, total: number): React.CSSProperties {\n if (total <= 1) return {};\n const slot = (100 / (total + 1)) * (i + 1);\n return { top: `${slot}%` };\n}\n\n/**\n * DefaultBody — compact summary of the config values for nodes that\n * don't provide a custom renderBody. Skips fields that look empty.\n */\nfunction DefaultBody({ config, kind }: { config: Record<string, unknown>; kind?: import(\"./types\").ConfigField[] }) {\n const fields = kind ?? [];\n // A kind with no config schema has nothing to configure — don't nag with a\n // \"configure in the panel\" prompt (that's only for a kind that HAS fields but\n // none are filled in yet). Triggers, Output, etc. render as just their header.\n if (fields.length === 0) return null;\n const visible = fields\n .map((f) => ({ field: f, value: config[f.key] }))\n .filter(({ value }) => value !== undefined && value !== \"\" && value !== null);\n if (visible.length === 0) {\n return <div className=\"ff-node__body-empty\">— configure in the panel</div>;\n }\n return (\n <ul className=\"ff-node__summary\">\n {visible.slice(0, 4).map(({ field, value }) => (\n <li key={field.key}>\n <span className=\"ff-node__summary-key\">{field.label}:</span>\n <span className=\"ff-node__summary-value\">{previewValue(value)}</span>\n </li>\n ))}\n {visible.length > 4 && <li className=\"ff-node__summary-more\">+ {visible.length - 4} more</li>}\n </ul>\n );\n}\n\nconst truncate = (s: string, n = 30): string => (s.length > n ? s.slice(0, n - 1) + \"…\" : s);\n\n/** A short, human name for one item in a repeater/list value. */\nfunction itemLabel(item: unknown): string {\n if (item && typeof item === \"object\") {\n const o = item as Record<string, unknown>;\n const name = o.label ?? o.name ?? o.key ?? o.title ?? o.id;\n if (typeof name === \"string\" && name) return name;\n if (typeof name === \"number\") return String(name);\n return \"item\";\n }\n return String(item ?? \"\");\n}\n\n/**\n * A node card's job is to read at a glance, not to be a data dump — so a value\n * is summarised, never `JSON.stringify`d. An array becomes its item names (or a\n * count), an object becomes a field count. Raw JSON on a card was the specific\n * thing to kill: `Fields: [{\"key\":\"answer\",…}]` reads as noise.\n */\nexport function previewValue(v: unknown): string {\n if (v === null || v === undefined) return \"\";\n if (typeof v === \"string\") return truncate(v);\n if (typeof v === \"number\" || typeof v === \"boolean\") return String(v);\n if (Array.isArray(v)) {\n if (v.length === 0) return \"none\";\n const names = v.slice(0, 3).map(itemLabel).filter(Boolean).join(\", \");\n const rest = v.length > 3 ? `, +${v.length - 3}` : \"\";\n return names ? truncate(names + rest) : `${v.length} item${v.length === 1 ? \"\" : \"s\"}`;\n }\n if (typeof v === \"object\") {\n const keys = Object.keys(v as object);\n return keys.length === 0 ? \"empty\" : `${keys.length} field${keys.length === 1 ? \"\" : \"s\"}`;\n }\n return \"…\";\n}\n","import { memo } from \"react\";\nimport { NodeResizer, type NodeProps } from \"@xyflow/react\";\nimport type { FlowNode } from \"../../types\";\nimport { categoryAccent } from \"../../registry/registry\";\n\n/**\n * LaneNode — a resizable swimlane band. A portless container: child nodes are\n * parented into it (`parentId` + `extent:'parent'`) and render on top, so this\n * node is just the titled background. Wired as the `@particle-academy/lane`\n * kind's `component`, so `buildNodeTypes` uses it instead of the default card.\n */\nfunction LaneNodeInner(props: NodeProps<FlowNode>) {\n const data = props.data as any;\n const config = data.config ?? {};\n const title: string = config.title ?? data.label ?? \"Lane\";\n const orientation: string = config.orientation ?? \"horizontal\";\n const accent: string = config.color ?? data.color ?? categoryAccent(\"layout\");\n return (\n <div\n className={[\"ff-lane\", `ff-lane--${orientation}`, props.selected ? \"ff-lane--selected\" : \"\"]\n .filter(Boolean)\n .join(\" \")}\n style={{ borderColor: props.selected ? accent : undefined }}\n >\n <NodeResizer isVisible={props.selected ?? false} color={accent} minWidth={160} minHeight={72} />\n <div className=\"ff-lane__header\" style={{ background: accent }}>\n <span className=\"ff-lane__title\">{title}</span>\n </div>\n </div>\n );\n}\n\nexport const LaneNode = memo(LaneNodeInner);\n","import { createContext, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { Edge } from \"@xyflow/react\";\nimport type { FlowGraph, FlowNode, NodeRunStatus } from \"../../types\";\nimport type { WorkflowSchema } from \"../../schema\";\nimport type { AlignEdge } from \"./graph-ops\";\nimport type { AutoLayoutOptions } from \"../../layout\";\n\n/**\n * Everything the editor knows and can do, handed to every extension point.\n *\n * This is the seam that makes `<FlowEditor>` composable instead of fixed: it is\n * passed to custom actions and slots, returned from `useFlowEditor()` inside\n * any child, and exposed on the editor `ref` so a host can drive the editor\n * imperatively (or an MCP bridge can drive it for an agent).\n */\nexport type FlowEditorApi = {\n // ── State ────────────────────────────────────────────────────────────\n /** The current graph. */\n graph: FlowGraph;\n nodes: FlowNode[];\n edges: Edge[];\n /** Currently selected node id, or null. */\n selectedId: string | null;\n /** Currently selected node, or null. */\n selected: FlowNode | null;\n /** Currently selected edge id, or null. Independent of node selection. */\n selectedEdgeId: string | null;\n /** Currently selected edge, or null. */\n selectedEdge: Edge | null;\n /** All multi-selected node ids (xyflow box / shift selection). */\n selectedIds: string[];\n /** All multi-selected nodes. */\n selectedNodes: FlowNode[];\n /** True while a run is in flight. */\n running: boolean;\n /** Per-node run status, keyed by node id. */\n statuses: Record<string, NodeRunStatus>;\n\n // ── Selection ────────────────────────────────────────────────────────\n select: (id: string | null) => void;\n /** Select an edge (the connection between two nodes), or clear with null. */\n selectEdge: (id: string | null) => void;\n\n // ── Graph mutation ───────────────────────────────────────────────────\n /** Add a node of `kind` at an optional flow position. Returns the new id. */\n addNode: (kind: string, position?: { x: number; y: number }) => string | null;\n /** Replace one node (matched by id). */\n updateNode: (node: FlowNode) => void;\n /** Delete nodes by id, pruning every edge attached to them. */\n deleteNodes: (ids: string[]) => void;\n /** Delete the current selection (no-op when nothing is selected). */\n deleteSelected: () => void;\n /** Delete edges by id — i.e. break the connections between nodes. */\n deleteEdges: (ids: string[]) => void;\n /** Delete the selected edge (no-op when no edge is selected). */\n deleteSelectedEdge: () => void;\n /** Label a connection, or clear the label by passing undefined/\"\". */\n setEdgeLabel: (id: string, label: string | undefined) => void;\n /** Copy a node (offset slightly) and select the copy. Returns the new id. */\n duplicateNode: (id: string) => string | null;\n /** Replace the whole graph. */\n setGraph: (graph: FlowGraph) => void;\n\n // ── Bulk (multi-selection) ───────────────────────────────────────────\n /** Duplicate the current multi-selection, preserving edges between them. */\n duplicateSelected: () => void;\n /** Align the multi-selection to a shared edge/center of its bounding box. */\n alignSelected: (edge: AlignEdge) => void;\n /** Evenly distribute the multi-selection's gaps along an axis (needs 3+). */\n distributeSelected: (axis: \"h\" | \"v\") => void;\n\n // ── Swimlanes ────────────────────────────────────────────────────────\n /** Add a swimlane, stacked with existing lanes. Returns the new lane id. */\n addLane: (orientation?: \"horizontal\" | \"vertical\", title?: string) => string | null;\n /** Put a node inside a lane (sets parentId + a lane-relative position). */\n assignToLane: (nodeId: string, laneId: string) => void;\n /** Remove a node from its lane (restores its absolute position). */\n removeFromLane: (nodeId: string) => void;\n /** Auto-arrange the graph (or a lane's children) into a tidy DAG layout. */\n autoLayout: (options?: AutoLayoutOptions) => void;\n /** Tidy just one lane's children. */\n tidyLane: (laneId: string) => void;\n\n // ── Clipboard ────────────────────────────────────────────────────────\n /** Copy the current selection to the editor clipboard. */\n copy: () => void;\n /** Copy then delete the current selection. */\n cut: () => void;\n /** Paste the clipboard (optionally at a flow position) and select the result. */\n paste: (at?: { x: number; y: number }) => void;\n\n // ── Run ──────────────────────────────────────────────────────────────\n run: () => void;\n cancel: () => void;\n reset: () => void;\n\n // ── Workflow I/O ─────────────────────────────────────────────────────\n /** The current graph as a WorkflowSchema (what `export` downloads). */\n toWorkflow: () => WorkflowSchema;\n /** Download the workflow as JSON. */\n exportWorkflow: () => void;\n /** Open a file picker and load a workflow. */\n importWorkflow: () => void;\n\n // ── Viewport ─────────────────────────────────────────────────────────\n fitView: () => void;\n\n // ── History ──\n /** Undo the last committing edit (add / delete / connect / config / drag /\n * import). Transient interactions (a drag in progress, selection) are not\n * their own steps. */\n undo: () => void;\n /** Redo the last undone edit. */\n redo: () => void;\n /** True when there is an edit to undo. */\n canUndo: boolean;\n /** True when there is an undone edit to redo. */\n canRedo: boolean;\n};\n\n/**\n * A declarative toolbar button. JSON-friendly on purpose — a host (or an\n * agent) can describe editor affordances as data rather than JSX.\n */\nexport type FlowEditorAction = {\n /** Stable id — also the `data-action` handle, so agents never guess DOM. */\n id: string;\n label: ReactNode;\n /** Native tooltip. */\n title?: string;\n /** Where it sits relative to the built-in buttons. Default \"end\". */\n placement?: \"start\" | \"end\";\n /** Disable when this returns true. Re-evaluated on every render. */\n disabled?: (api: FlowEditorApi) => boolean;\n /** Hide entirely when this returns false. */\n visible?: (api: FlowEditorApi) => boolean;\n /** Only enabled when a node is selected. Sugar over `disabled`. */\n requiresSelection?: boolean;\n onSelect: (api: FlowEditorApi) => void;\n};\n\n/** Which built-in toolbar affordances to render. All default to true. */\nexport type FlowEditorBuiltins = {\n run?: boolean;\n delete?: boolean;\n /** Undo/redo toolbar buttons. Default true. */\n history?: boolean;\n /** \"Add lane\" toolbar button. Default true. */\n addLane?: boolean;\n /** \"Tidy\" (auto-layout) toolbar button. Default true. */\n autoLayout?: boolean;\n /** Right-click a node for Delete / Duplicate. Default true. */\n contextMenu?: boolean;\n /** Right-click a connection for Label / Delete. Default true. */\n edgeContextMenu?: boolean;\n export?: boolean;\n import?: boolean;\n count?: boolean;\n};\n\n/** Replaceable regions. Each receives the editor API. */\nexport type FlowEditorSlots = {\n /** Replace the ENTIRE toolbar (built-ins and actions are not rendered). */\n toolbar?: (api: FlowEditorApi) => ReactNode;\n /** Replace the left palette. */\n palette?: (api: FlowEditorApi) => ReactNode;\n /** Replace the right config panel. */\n panel?: (api: FlowEditorApi) => ReactNode;\n /** Appended inside the config panel, under the fields — per-node actions. */\n panelFooter?: (api: FlowEditorApi) => ReactNode;\n /** Replace the run feed. */\n feed?: (api: FlowEditorApi) => ReactNode;\n /** Rendered over the canvas when the graph is empty. */\n empty?: (api: FlowEditorApi) => ReactNode;\n /** Replace the node right-click menu. Receives the right-clicked node id;\n * call `close` when an item is chosen. */\n contextMenu?: (api: FlowEditorApi, nodeId: string, close: () => void) => ReactNode;\n /** Replace the connection right-click menu. Receives the right-clicked edge\n * id; call `close` when an item is chosen. */\n edgeContextMenu?: (api: FlowEditorApi, edgeId: string, close: () => void) => ReactNode;\n};\n\nconst FlowEditorContext = createContext<FlowEditorApi | null>(null);\n\nexport const FlowEditorProvider = FlowEditorContext.Provider;\n\n/**\n * Read the editor API from any child of `<FlowEditor>`. Throws outside one, so\n * a misplaced custom control fails loudly instead of silently doing nothing.\n */\nexport function useFlowEditor(): FlowEditorApi {\n const api = useContext(FlowEditorContext);\n if (api === null) {\n throw new Error(\"useFlowEditor() must be called inside <FlowEditor>.\");\n }\n return api;\n}\n\n/** Non-throwing variant, for components that may render outside an editor. */\nexport function useFlowEditorOptional(): FlowEditorApi | null {\n return useContext(FlowEditorContext);\n}\n","import { memo, useEffect, useRef, useState } from \"react\";\nimport { NodeResizer, type NodeProps } from \"@xyflow/react\";\nimport type { FlowNode } from \"../../types\";\nimport { useFlowEditorOptional } from \"../FlowEditor/api\";\n\n/**\n * NoteNode — a sticky-note annotation. A portless, visual-only node: nothing\n * wires to it and the engine skips it entirely, so a note NEVER reaches a\n * runner — its text lives in the document purely for people reading the canvas\n * and for editor / agent (MCP) tools. Wired as the `@particle-academy/note`\n * kind's `component`, so `buildNodeTypes` uses it instead of the default card;\n * also the legacy `defaultNodeTypes.note` renderer.\n *\n * Inside a `<FlowEditor>` the note is editable in place — double-click to type;\n * commits flow through `api.updateNode`, so each is one undoable step. In a\n * read-only viewer (no editor context) it renders as static text. Text is read\n * from `config.text` (canonical), falling back to the legacy `data.body` shape.\n */\n\ntype NoteColor = \"amber\" | \"sky\" | \"violet\" | \"emerald\" | \"rose\" | \"slate\";\n\n/** Soft sticky-note fills that read in both light and dark. */\nconst NOTE_COLORS: Record<NoteColor, { bg: string; border: string; title: string }> = {\n amber: { bg: \"rgba(234, 179, 8, 0.14)\", border: \"rgba(234, 179, 8, 0.55)\", title: \"#a16207\" },\n sky: { bg: \"rgba(14, 165, 233, 0.12)\", border: \"rgba(14, 165, 233, 0.5)\", title: \"#0369a1\" },\n violet: { bg: \"rgba(139, 92, 246, 0.13)\", border: \"rgba(139, 92, 246, 0.5)\", title: \"#6d28d9\" },\n emerald: { bg: \"rgba(16, 185, 129, 0.13)\", border: \"rgba(16, 185, 129, 0.5)\", title: \"#047857\" },\n rose: { bg: \"rgba(244, 63, 94, 0.12)\", border: \"rgba(244, 63, 94, 0.5)\", title: \"#be123c\" },\n slate: { bg: \"rgba(100, 116, 139, 0.12)\", border: \"rgba(100, 116, 139, 0.5)\", title: \"#475569\" },\n};\n\nfunction coerceColor(v: unknown): NoteColor {\n return typeof v === \"string\" && v in NOTE_COLORS ? (v as NoteColor) : \"amber\";\n}\n\nfunction NoteNodeInner(props: NodeProps<FlowNode>) {\n const data = props.data as any;\n const config = (data.config ?? {}) as Record<string, unknown>;\n const api = useFlowEditorOptional();\n\n const hasConfigText = typeof config.text === \"string\" && config.text.length > 0;\n // config.text is canonical; legacy notes carried their text in `data.body`.\n const text = hasConfigText\n ? String(config.text)\n : typeof data.body === \"string\"\n ? data.body\n : typeof data.text === \"string\"\n ? data.text\n : \"\";\n // config.title is canonical; a legacy note used its `data.label` as the title.\n const title =\n (typeof config.title === \"string\" && config.title) ||\n (!hasConfigText && typeof data.body === \"string\" && typeof data.label === \"string\" ? data.label : \"\");\n const skin = NOTE_COLORS[coerceColor(config.color)];\n\n const [editing, setEditing] = useState(false);\n const [draft, setDraft] = useState(text);\n const areaRef = useRef<HTMLTextAreaElement>(null);\n\n useEffect(() => {\n if (editing && areaRef.current) {\n const el = areaRef.current;\n el.focus();\n el.setSelectionRange(el.value.length, el.value.length);\n }\n }, [editing]);\n\n const commit = () => {\n setEditing(false);\n if (!api || draft === text) return;\n const current = api.nodes.find((n) => n.id === props.id);\n if (!current) return;\n api.updateNode({\n ...current,\n data: { ...(current.data as any), config: { ...config, text: draft } },\n } as FlowNode);\n };\n\n return (\n <div\n className={[\"ff-note\", props.selected ? \"ff-note--selected\" : \"\"].filter(Boolean).join(\" \")}\n style={{ background: skin.bg, borderColor: skin.border }}\n onDoubleClick={api ? () => { setDraft(text); setEditing(true); } : undefined}\n >\n <NodeResizer isVisible={props.selected ?? false} color={skin.border} minWidth={140} minHeight={80} />\n {title && <div className=\"ff-note__title\" style={{ color: skin.title }}>{title}</div>}\n {editing ? (\n <textarea\n ref={areaRef}\n className=\"ff-note__input nodrag nowheel\"\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={commit}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") setEditing(false);\n if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) commit();\n }}\n />\n ) : (\n <div className=\"ff-note__body\">\n {text || <span className=\"ff-note__placeholder\">{api ? \"Double-click to write a note…\" : \"Note\"}</span>}\n </div>\n )}\n </div>\n );\n}\n\nexport const NoteNode = memo(NoteNodeInner);\n","import { createElement } from \"react\";\nimport { ensureBuiltinKinds, registerBuiltinKindInternal } from \"./registry\";\nimport { RichInputPreview } from \"./rich-input\";\nimport { LaneNode } from \"../components/nodes/LaneNode\";\nimport { NoteNode } from \"../components/nodes/NoteNode\";\nimport { BUILTIN_KIND_DATA } from \"./builtin-kinds\";\nimport type { NodeKindDefinition } from \"./types\";\n\n/**\n * The built-in kit WITH its React renderers — the editor's door into it.\n *\n * ## Why this file is a decorator rather than the table\n *\n * `/engine` promised to be React-free and was not (#11). The exact edge was\n * `engine.ts → registry/registry.ts → registry/builtin.ts → react`, and it was\n * a REGRESSION of a fix whose comment is still in `engine.ts`: that file\n * imports from the module rather than the barrel precisely to avoid this, and\n * `registry.ts` later gained a `builtin.ts` import so the registry\n * self-populates. Both changes were right. Nothing tested the property, so the\n * second silently undid the first.\n *\n * The surface turned out to be four lines across three kinds in a 1,064-line\n * file, so the table moved to `builtin-kinds.ts` (React-free, what `registry.ts`\n * imports) and only the renderers stayed here.\n *\n * ## Where this gets applied, and why THERE\n *\n * `src/index.ts` calls `registerBuiltinKinds()` at module scope. That is not an\n * arbitrary choice: `package.json`'s `sideEffects` lists `./dist/index.js` and\n * `./dist/index.cjs` and NOT `./dist/registry.js`, so a consumer's bundler is\n * entitled to drop a top-level statement in the registry chunk and obliged to\n * keep one in the root barrel. Putting it anywhere else would work until\n * somebody's tree-shaker disagreed, and the symptom would be lanes quietly\n * rendering as ordinary cards.\n *\n * A consumer who never imports the React root still gets every kind — schema,\n * ports, executors — because `registry.ts` self-populates from the data\n * module. They simply get no renderers, which is correct: a queue worker has\n * no DOM to render into.\n *\n * ## Host and marketplace kinds are untouched\n *\n * Both arrive at runtime through `registerNodeKind` carrying their own\n * `component` / `renderBody`, and never pass through here. This split is\n * first-party-only by construction and adds no rule a third-party kind has to\n * follow.\n */\n\n/** The renderers, by canonical kind name. */\nconst RENDERERS: Record<string, Partial<NodeKindDefinition>> = {\n \"@particle-academy/lane\": { component: LaneNode },\n \"@particle-academy/terminal_lane\": { component: LaneNode },\n \"@particle-academy/note\": { component: NoteNode },\n \"@particle-academy/rich_user_input\": {\n // Previews the authored page inside a FauxClient frame, so the canvas shows\n // what the person hitting this step will actually see.\n renderBody: (ctx) =>\n createElement(RichInputPreview, { config: (ctx.config ?? {}) as Record<string, unknown> }),\n },\n};\n\n/**\n * Every builtin, with renderers attached to the four that have one.\n *\n * A kind with no renderer is passed through by identity rather than copied, so\n * `BUILTIN_KINDS` and `BUILTIN_KIND_DATA` share objects wherever there is\n * nothing to add.\n */\nexport const BUILTIN_KINDS: NodeKindDefinition[] = BUILTIN_KIND_DATA.map((kind) => {\n const renderer = RENDERERS[kind.name];\n return renderer ? { ...kind, ...renderer } : kind;\n});\n\n/**\n * Register every built-in kind, renderers included.\n *\n * Idempotent, and safe to call after `registry.ts` has already self-populated\n * the plain table: it goes through `registerBuiltinKindInternal`, which\n * replaces a BUILTIN by name, so this UPGRADES the four kinds in place rather\n * than duplicating anything.\n *\n * It does NOT replace a name a host has claimed with `registerNodeKind`. That\n * is the whole point of 0.66.2 — a consumer's replacement of a builtin used to\n * be silently reverted every time this ran, and since the root barrel calls it\n * as an import side effect, whether that happened depended on bundler ordering.\n *\n * The distinction matters to anyone reading this to decide whether calling it\n * is safe: safe against builtins, deliberately powerless against a host.\n */\nexport function registerBuiltinKinds(): void {\n // Lay the React-free table down FIRST, through the same lazy path every other\n // entry point uses. Without this the flag is still unset, so the next read\n // anywhere — `getNodeKind`, the palette, a viewer — triggers\n // `ensureBuiltinKinds()` and re-registers the plain table OVER the decorated\n // kinds, silently dropping the four renderers this function exists to attach.\n ensureBuiltinKinds();\n\n for (const kind of BUILTIN_KINDS) registerBuiltinKindInternal(kind);\n}\n\n// Everything else the table exports keeps its old import path, so no consumer\n// of `./builtin` has to change.\nexport { BUILTIN_KIND_DATA, registerBuiltinKindData } from \"./builtin-kinds\";\n","export type {\n ConfigField,\n TextConfigField,\n TextareaConfigField,\n NumberConfigField,\n SelectConfigField,\n SwitchConfigField,\n JsonConfigField,\n ExpressionConfigField,\n CredentialConfigField,\n RepeaterConfigField,\n RepeaterRowField,\n KeyValueConfigField,\n DocumentConfigField,\n NodeCategory,\n NodeKindDefinition,\n EmitsRelation,\n PortSpec,\n RenderBodyContext,\n} from \"./types\";\n\nexport { resolvePortSpec, resolveNodePorts, nodeConfig } from \"./ports\";\n\nexport {\n createConnectionValidator,\n defaultPortCompatibility,\n ANY_PORT_TYPE,\n type PortCompatibility,\n type ConnectionValidatorOptions,\n} from \"./connection\";\n\n/** Host capabilities — core declares the contract, the host supplies the impl. */\nexport {\n registerLlmClient,\n getLlmClient,\n registerWorkflowResolver,\n getWorkflowResolver,\n registerTerminalHost,\n getTerminalHost,\n capabilityStatus,\n type LlmClient,\n type LlmRoute,\n type LlmRouteRequest,\n type LlmRouteChoice,\n type WorkflowResolver,\n type WorkflowResolution,\n type WorkflowResolutionFailure,\n type TerminalHost,\n type TerminalSession,\n type TerminalSessionSpec,\n type TerminalExit,\n type CapabilityId,\n isResolutionFailure,\n} from \"./capabilities\";\n\n/**\n * The human-pause contract — a run waiting for a person, not a failure.\n * `decodePause` is the one function a durable runner needs.\n */\nexport {\n pauseForHuman,\n encodePause,\n decodePause,\n isPause,\n PAUSE_PREFIX,\n LEGACY_PAUSE_PREFIXES,\n type PauseAwaiting,\n type PauseSignal,\n} from \"./pause\";\n\nexport { subflowExecutor, subflowPorts, subflowMode, DEFAULT_MAX_DEPTH, type SubflowMode } from \"./subflow\";\nexport { llmRouterExecutor, declaredRoutes, resolveFallbackPort } from \"./llm-router\";\n/** @deprecated Renamed to `llmRouterExecutor` — the id and label now match. */\nexport { llmRouterExecutor as llmBranchExecutor } from \"./llm-router\";\n\nexport {\n registerRichInputAdapter,\n getRichInputAdapter,\n isRichInputEnabled,\n onRichInputAdapterChanged,\n RichInputPreview,\n type RichInputAdapter,\n} from \"./rich-input\";\n\nexport {\n registerNodeKind,\n unregisterNodeKind,\n applyKindSchemaOverlay,\n clearKindSchemaOverlays,\n type KindSchemaOverlay,\n type KindSchemaOverlayResult,\n overrideNodeKind,\n clearNodeKindOverrides,\n type NodeKindPresentation,\n getNodeKind,\n resolveKindId,\n kindIds,\n listNodeKinds,\n onNodeKindsChanged,\n defaultConfigFor,\n validateConfig,\n categoryAccent,\n} from \"./registry\";\n\nexport { RegistryNode } from \"./RegistryNode\";\nexport { registerBuiltinKinds, BUILTIN_KINDS } from \"./builtin\";\nexport { ensureBuiltinKinds } from \"./registry\";\n\nimport type { NodeTypes } from \"@xyflow/react\";\nimport { RegistryNode } from \"./RegistryNode\";\nimport { kindIds, listNodeKinds } from \"./registry\";\n\n/**\n * Build an xyflow `nodeTypes` map from the registry — every registered\n * kind gets `RegistryNode` as its renderer. Refresh manually via\n * `useNodeTypes()` (a hook that subscribes to registry changes).\n */\nexport function buildNodeTypes(): NodeTypes {\n const map: NodeTypes = {};\n for (const k of listNodeKinds()) {\n // A kind may bring its own full renderer (lanes/containers); otherwise the\n // default card. Key on every id the kind answers to, not just the canonical\n // one — xyflow looks the renderer up by `node.type` BEFORE RegistryNode gets\n // a chance to resolve aliases, so a graph carrying a pre-namespace type would\n // otherwise fall through to the unknown-node placeholder.\n const renderer = k.component ?? RegistryNode;\n for (const id of kindIds(k)) map[id] = renderer;\n }\n return map;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/registry/connection.ts","../src/registry/RegistryNode.tsx","../src/components/nodes/LaneNode.tsx","../src/components/FlowEditor/api.ts","../src/components/nodes/NoteNode.tsx","../src/registry/builtin.ts","../src/registry/index.ts"],"names":["jsxs","jsx","memo"],"mappings":";;;;;;;AAqBO,IAAM,aAAA,GAAgB;AActB,IAAM,wBAAA,GAA8C,CAAC,MAAA,EAAQ,MAAA,KAAW;AAC7E,EAAA,MAAM,IAAI,MAAA,EAAQ,IAAA;AAClB,EAAA,MAAM,IAAI,MAAA,EAAQ,IAAA;AAClB,EAAA,IAAI,CAAC,CAAA,IAAK,CAAC,CAAA,EAAG,OAAO,IAAA;AACrB,EAAA,IAAI,CAAA,KAAM,aAAA,IAAiB,CAAA,KAAM,aAAA,EAAe,OAAO,IAAA;AACvD,EAAA,OAAO,CAAA,KAAM,CAAA;AACf;AAcA,SAAS,QAAA,CAAS,MAAgB,IAAA,EAA8C;AAC9E,EAAA,MAAM,OAAO,WAAA,CAAa,IAAA,CAAK,IAAA,EAAc,IAAA,IAAQ,KAAK,IAAI,CAAA;AAC9D,EAAA,MAAM,QAAA,GAAW,gBAAA,CAAiB,IAAA,EAAM,IAAA,IAAQ,MAAS,CAAA;AACzD,EAAA,OAAO,QAAA,CAAS,IAAI,CAAA,IAAK,EAAC;AAC5B;AAOA,SAAS,QAAA,CACP,OACA,QAAA,EAC4B;AAC5B,EAAA,IAAI,QAAA,IAAY,MAAM,OAAO,KAAA,CAAM,WAAW,CAAA,GAAI,KAAA,CAAM,CAAC,CAAA,GAAI,MAAA;AAC7D,EAAA,OAAO,MAAM,IAAA,CAAK,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, PortDescriptor } from \"../types\";\nimport { getNodeKind } from \"./registry\";\nimport { resolveNodePorts } from \"./ports\";\n\n/**\n * Connection validation — the single rule that decides whether an edge between\n * two ports is allowed. Lives here (React-free, registry-adjacent) so BOTH the\n * canvas (`<FlowCanvas isValidConnection>`) and the agent bridge's\n * `flow_connect` tool call the same function: a connection the canvas refuses\n * is a connection an agent cannot sneak past, and vice versa — no drift.\n *\n * `PortDescriptor.type` has always documented itself as being \"for hosts that\n * want to validate connections\", but nothing consumed it. This wires it up.\n */\n\n/**\n * Wildcard port type — matches any other type. A port that declares no `type`\n * is treated as a wildcard too, so existing flows (whose ports are untyped)\n * validate exactly as before.\n */\nexport const ANY_PORT_TYPE = \"any\";\n\n/** Decides whether a source-output port may feed a target-input port. */\nexport type PortCompatibility = (\n source: PortDescriptor | undefined,\n target: PortDescriptor | undefined,\n) => boolean;\n\n/**\n * Default compatibility rule: allow the connection UNLESS both ports declare a\n * concrete, differing type. An absent type or the `any` wildcard matches\n * anything — so typed ports get enforced while untyped ports stay permissive,\n * making this a safe default that never breaks an existing untyped graph.\n */\nexport const defaultPortCompatibility: PortCompatibility = (source, target) => {\n const s = source?.type;\n const t = target?.type;\n if (!s || !t) return true;\n if (s === ANY_PORT_TYPE || t === ANY_PORT_TYPE) return true;\n return s === t;\n};\n\nexport type ConnectionValidatorOptions = {\n /** Override the type-compatibility rule. Defaults to {@link defaultPortCompatibility}. */\n compatible?: PortCompatibility;\n /**\n * Allow a node's own output to feed its own input (a self-loop). Default\n * false — self-connections are almost always an accident, and the rare flow\n * that wants one can opt in.\n */\n allowSelfConnection?: boolean;\n};\n\n/** Resolve a node's effective ports for one side, going through the registry. */\nfunction portsFor(node: FlowNode, side: \"inputs\" | \"outputs\"): PortDescriptor[] {\n const kind = getNodeKind((node.data as any)?.kind ?? node.type);\n const resolved = resolveNodePorts(node, kind ?? undefined);\n return resolved[side] ?? [];\n}\n\n/**\n * Resolve which port a handle id refers to. When a side has a single port and\n * the handle id is absent (React Flow omits it for a lone default handle), use\n * that port; otherwise match by id.\n */\nfunction findPort(\n ports: PortDescriptor[],\n handleId: string | null | undefined,\n): PortDescriptor | undefined {\n if (handleId == null) return ports.length === 1 ? ports[0] : undefined;\n return ports.find((p) => p.id === handleId);\n}\n\n/**\n * Build an `isValidConnection` predicate that enforces port-type compatibility\n * against a live node list. Pass it straight to `<FlowCanvas isValidConnection>`\n * or reuse it to gate an agent's `flow_connect`.\n *\n * `getNodes` is called on every check so the validator always sees the current\n * graph (wire it to a ref/state getter, not a snapshot).\n *\n * A connection is rejected when: an endpoint is missing; it is a self-loop and\n * `allowSelfConnection` is off; either node is unknown; or the resolved ports\n * are type-incompatible. Nodes/ports with no declared type validate as before.\n */\nexport function createConnectionValidator(\n getNodes: () => FlowNode[],\n options: ConnectionValidatorOptions = {},\n): (connection: Connection | Edge) => boolean {\n const compatible = options.compatible ?? defaultPortCompatibility;\n return (connection) => {\n const { source, target, sourceHandle, targetHandle } = connection;\n if (!source || !target) return false;\n if (!options.allowSelfConnection && source === target) return false;\n\n const nodes = getNodes();\n const src = nodes.find((n) => n.id === source);\n const tgt = nodes.find((n) => n.id === target);\n if (!src || !tgt) return false;\n\n const outPort = findPort(portsFor(src, \"outputs\"), sourceHandle);\n const inPort = findPort(portsFor(tgt, \"inputs\"), targetHandle);\n return compatible(outPort, inPort);\n };\n}\n","import { memo, useMemo } from \"react\";\nimport { Handle, NodeResizer, NodeToolbar, Position, type NodeProps } from \"@xyflow/react\";\nimport type { FlowNode, NodeRunStatus, PortDescriptor } from \"../types\";\nimport { categoryAccent, getNodeKind } from \"./registry\";\nimport { nodeConfig, resolveNodePorts } from \"./ports\";\n\n/**\n * RegistryNode — generic node renderer that looks up the node's kind in\n * the registry and applies its `accent`/`label`/`icon`/`renderBody`. Used\n * as the xyflow node component for every registered kind.\n */\nfunction RegistryNodeInner(props: NodeProps<FlowNode>) {\n const kindName = (props.data as any).kind ?? props.type;\n const kind = useMemo(() => getNodeKind(kindName), [kindName]);\n\n if (!kind) {\n return (\n <div className=\"ff-node ff-node--unknown\">\n <div className=\"ff-node__header\" style={{ background: \"#71717a\" }}>\n <span className=\"ff-node__tag\">UNKNOWN</span>\n <span className=\"ff-node__label\">{kindName}</span>\n </div>\n <p className=\"ff-node__desc\">No registered kind for \"{kindName}\".</p>\n </div>\n );\n }\n\n const data = props.data;\n const status: NodeRunStatus = data.status ?? \"idle\";\n const accent = kind.accent ?? categoryAccent(kind.category);\n const resolved = resolveNodePorts(props, kind);\n const inputs: PortDescriptor[] = resolved.inputs ?? defaultInputs(kind.category);\n const outputs: PortDescriptor[] = resolved.outputs ?? defaultOutputs(kind.category);\n const config = nodeConfig(props);\n const label = data.label ?? kind.label;\n\n return (\n <div\n className={[\n \"ff-node\",\n `ff-node--status-${status}`,\n `ff-node--cat-${kind.category}`,\n props.selected ? \"ff-node--selected\" : \"\",\n kind.resizable ? \"ff-node--resizable\" : \"\",\n ].filter(Boolean).join(\" \")}\n style={{ borderColor: props.selected ? accent : undefined }}\n >\n {kind.resizable && (\n <NodeResizer\n isVisible={props.selected ?? false}\n color={accent}\n {...(typeof kind.resizable === \"object\" ? kind.resizable : {})}\n />\n )}\n {kind.toolbar && (\n <NodeToolbar isVisible={props.selected ?? false}>\n {kind.toolbar({ nodeId: props.id, config: config as any, selected: props.selected ?? false })}\n </NodeToolbar>\n )}\n <header className=\"ff-node__header\" style={{ background: accent }}>\n {kind.icon && <span className=\"ff-node__icon\" aria-hidden>{kind.icon}</span>}\n <span className=\"ff-node__tag\">{kind.label.toUpperCase()}</span>\n <span className=\"ff-node__label\">{label}</span>\n {status !== \"idle\" && <span className={`ff-node__dot ff-node__dot--${status}`} aria-label={`status ${status}`} />}\n </header>\n\n {data.description && <p className=\"ff-node__desc\">{data.description}</p>}\n\n <div className=\"ff-node__body\">\n {kind.renderBody\n ? kind.renderBody({ nodeId: props.id, config: config as any, selected: props.selected ?? false })\n : <DefaultBody config={config} kind={kind.configSchema} />}\n </div>\n\n {data.statusText && <p className=\"ff-node__status-text\">{data.statusText}</p>}\n\n {(data as any).output !== undefined && (\n <p className=\"ff-node__output\" title=\"Latest output\">→ {previewValue((data as any).output)}</p>\n )}\n\n {inputs.map((p, i) => (\n <Handle\n key={p.id}\n type=\"target\"\n position={Position.Left}\n id={p.id}\n style={portStyle(i, inputs.length)}\n title={p.label ?? p.id}\n />\n ))}\n {outputs.map((p, i) => (\n <Handle\n key={p.id}\n type=\"source\"\n position={Position.Right}\n id={p.id}\n style={portStyle(i, outputs.length)}\n title={p.label ?? p.id}\n />\n ))}\n </div>\n );\n}\n\nexport const RegistryNode = memo(RegistryNodeInner);\n\nfunction defaultInputs(category: string): PortDescriptor[] {\n return category === \"trigger\" ? [] : [{ id: \"in\" }];\n}\nfunction defaultOutputs(category: string): PortDescriptor[] {\n return category === \"output\" ? [] : [{ id: \"out\" }];\n}\n\nfunction portStyle(i: number, total: number): React.CSSProperties {\n if (total <= 1) return {};\n const slot = (100 / (total + 1)) * (i + 1);\n return { top: `${slot}%` };\n}\n\n/**\n * DefaultBody — compact summary of the config values for nodes that\n * don't provide a custom renderBody. Skips fields that look empty.\n */\nfunction DefaultBody({ config, kind }: { config: Record<string, unknown>; kind?: import(\"./types\").ConfigField[] }) {\n const fields = kind ?? [];\n // A kind with no config schema has nothing to configure — don't nag with a\n // \"configure in the panel\" prompt (that's only for a kind that HAS fields but\n // none are filled in yet). Triggers, Output, etc. render as just their header.\n if (fields.length === 0) return null;\n const visible = fields\n .map((f) => ({ field: f, value: config[f.key] }))\n .filter(({ value }) => value !== undefined && value !== \"\" && value !== null);\n if (visible.length === 0) {\n return <div className=\"ff-node__body-empty\">— configure in the panel</div>;\n }\n return (\n <ul className=\"ff-node__summary\">\n {visible.slice(0, 4).map(({ field, value }) => (\n <li key={field.key}>\n <span className=\"ff-node__summary-key\">{field.label}:</span>\n <span className=\"ff-node__summary-value\">{previewValue(value)}</span>\n </li>\n ))}\n {visible.length > 4 && <li className=\"ff-node__summary-more\">+ {visible.length - 4} more</li>}\n </ul>\n );\n}\n\nconst truncate = (s: string, n = 30): string => (s.length > n ? s.slice(0, n - 1) + \"…\" : s);\n\n/** A short, human name for one item in a repeater/list value. */\nfunction itemLabel(item: unknown): string {\n if (item && typeof item === \"object\") {\n const o = item as Record<string, unknown>;\n const name = o.label ?? o.name ?? o.key ?? o.title ?? o.id;\n if (typeof name === \"string\" && name) return name;\n if (typeof name === \"number\") return String(name);\n return \"item\";\n }\n return String(item ?? \"\");\n}\n\n/**\n * A node card's job is to read at a glance, not to be a data dump — so a value\n * is summarised, never `JSON.stringify`d. An array becomes its item names (or a\n * count), an object becomes a field count. Raw JSON on a card was the specific\n * thing to kill: `Fields: [{\"key\":\"answer\",…}]` reads as noise.\n */\nexport function previewValue(v: unknown): string {\n if (v === null || v === undefined) return \"\";\n if (typeof v === \"string\") return truncate(v);\n if (typeof v === \"number\" || typeof v === \"boolean\") return String(v);\n if (Array.isArray(v)) {\n if (v.length === 0) return \"none\";\n const names = v.slice(0, 3).map(itemLabel).filter(Boolean).join(\", \");\n const rest = v.length > 3 ? `, +${v.length - 3}` : \"\";\n return names ? truncate(names + rest) : `${v.length} item${v.length === 1 ? \"\" : \"s\"}`;\n }\n if (typeof v === \"object\") {\n const keys = Object.keys(v as object);\n return keys.length === 0 ? \"empty\" : `${keys.length} field${keys.length === 1 ? \"\" : \"s\"}`;\n }\n return \"…\";\n}\n","import { memo } from \"react\";\nimport { NodeResizer, type NodeProps } from \"@xyflow/react\";\nimport type { FlowNode } from \"../../types\";\nimport { categoryAccent } from \"../../registry/registry\";\n\n/**\n * LaneNode — a resizable swimlane band. A portless container: child nodes are\n * parented into it (`parentId` + `extent:'parent'`) and render on top, so this\n * node is just the titled background. Wired as the `@particle-academy/lane`\n * kind's `component`, so `buildNodeTypes` uses it instead of the default card.\n */\nfunction LaneNodeInner(props: NodeProps<FlowNode>) {\n const data = props.data as any;\n const config = data.config ?? {};\n const title: string = config.title ?? data.label ?? \"Lane\";\n const orientation: string = config.orientation ?? \"horizontal\";\n const accent: string = config.color ?? data.color ?? categoryAccent(\"layout\");\n return (\n <div\n className={[\"ff-lane\", `ff-lane--${orientation}`, props.selected ? \"ff-lane--selected\" : \"\"]\n .filter(Boolean)\n .join(\" \")}\n style={{ borderColor: props.selected ? accent : undefined }}\n >\n <NodeResizer isVisible={props.selected ?? false} color={accent} minWidth={160} minHeight={72} />\n <div className=\"ff-lane__header\" style={{ background: accent }}>\n <span className=\"ff-lane__title\">{title}</span>\n </div>\n </div>\n );\n}\n\nexport const LaneNode = memo(LaneNodeInner);\n","import { createContext, useContext } from \"react\";\nimport type { ReactNode } from \"react\";\nimport type { Edge } from \"@xyflow/react\";\nimport type { FlowGraph, FlowNode, NodeRunStatus } from \"../../types\";\nimport type { WorkflowSchema } from \"../../schema\";\nimport type { AlignEdge } from \"./graph-ops\";\nimport type { AutoLayoutOptions } from \"../../layout\";\n\n/**\n * Everything the editor knows and can do, handed to every extension point.\n *\n * This is the seam that makes `<FlowEditor>` composable instead of fixed: it is\n * passed to custom actions and slots, returned from `useFlowEditor()` inside\n * any child, and exposed on the editor `ref` so a host can drive the editor\n * imperatively (or an MCP bridge can drive it for an agent).\n */\nexport type FlowEditorApi = {\n // ── State ────────────────────────────────────────────────────────────\n /** The current graph. */\n graph: FlowGraph;\n nodes: FlowNode[];\n edges: Edge[];\n /** Currently selected node id, or null. */\n selectedId: string | null;\n /** Currently selected node, or null. */\n selected: FlowNode | null;\n /** Currently selected edge id, or null. Independent of node selection. */\n selectedEdgeId: string | null;\n /** Currently selected edge, or null. */\n selectedEdge: Edge | null;\n /** All multi-selected node ids (xyflow box / shift selection). */\n selectedIds: string[];\n /** All multi-selected nodes. */\n selectedNodes: FlowNode[];\n /** True while a run is in flight. */\n running: boolean;\n /** Per-node run status, keyed by node id. */\n statuses: Record<string, NodeRunStatus>;\n\n // ── Selection ────────────────────────────────────────────────────────\n select: (id: string | null) => void;\n /** Select an edge (the connection between two nodes), or clear with null. */\n selectEdge: (id: string | null) => void;\n\n // ── Graph mutation ───────────────────────────────────────────────────\n /** Add a node of `kind` at an optional flow position. Returns the new id. */\n addNode: (kind: string, position?: { x: number; y: number }) => string | null;\n /** Replace one node (matched by id). */\n updateNode: (node: FlowNode) => void;\n /** Delete nodes by id, pruning every edge attached to them. */\n deleteNodes: (ids: string[]) => void;\n /** Delete the current selection (no-op when nothing is selected). */\n deleteSelected: () => void;\n /** Delete edges by id — i.e. break the connections between nodes. */\n deleteEdges: (ids: string[]) => void;\n /** Delete the selected edge (no-op when no edge is selected). */\n deleteSelectedEdge: () => void;\n /** Label a connection, or clear the label by passing undefined/\"\". */\n setEdgeLabel: (id: string, label: string | undefined) => void;\n /** Copy a node (offset slightly) and select the copy. Returns the new id. */\n duplicateNode: (id: string) => string | null;\n /** Replace the whole graph. */\n setGraph: (graph: FlowGraph) => void;\n\n // ── Bulk (multi-selection) ───────────────────────────────────────────\n /** Duplicate the current multi-selection, preserving edges between them. */\n duplicateSelected: () => void;\n /** Align the multi-selection to a shared edge/center of its bounding box. */\n alignSelected: (edge: AlignEdge) => void;\n /** Evenly distribute the multi-selection's gaps along an axis (needs 3+). */\n distributeSelected: (axis: \"h\" | \"v\") => void;\n\n // ── Swimlanes ────────────────────────────────────────────────────────\n /** Add a swimlane, stacked with existing lanes. Returns the new lane id. */\n addLane: (orientation?: \"horizontal\" | \"vertical\", title?: string) => string | null;\n /** Put a node inside a lane (sets parentId + a lane-relative position). */\n assignToLane: (nodeId: string, laneId: string) => void;\n /** Remove a node from its lane (restores its absolute position). */\n removeFromLane: (nodeId: string) => void;\n /** Auto-arrange the graph (or a lane's children) into a tidy DAG layout. */\n autoLayout: (options?: AutoLayoutOptions) => void;\n /** Tidy just one lane's children. */\n tidyLane: (laneId: string) => void;\n\n // ── Clipboard ────────────────────────────────────────────────────────\n /** Copy the current selection to the editor clipboard. */\n copy: () => void;\n /** Copy then delete the current selection. */\n cut: () => void;\n /** Paste the clipboard (optionally at a flow position) and select the result. */\n paste: (at?: { x: number; y: number }) => void;\n\n // ── Run ──────────────────────────────────────────────────────────────\n run: () => void;\n cancel: () => void;\n reset: () => void;\n\n // ── Workflow I/O ─────────────────────────────────────────────────────\n /** The current graph as a WorkflowSchema (what `export` downloads). */\n toWorkflow: () => WorkflowSchema;\n /** Download the workflow as JSON. */\n exportWorkflow: () => void;\n /** Open a file picker and load a workflow. */\n importWorkflow: () => void;\n\n // ── Viewport ─────────────────────────────────────────────────────────\n fitView: () => void;\n\n // ── History ──\n /** Undo the last committing edit (add / delete / connect / config / drag /\n * import). Transient interactions (a drag in progress, selection) are not\n * their own steps. */\n undo: () => void;\n /** Redo the last undone edit. */\n redo: () => void;\n /** True when there is an edit to undo. */\n canUndo: boolean;\n /** True when there is an undone edit to redo. */\n canRedo: boolean;\n};\n\n/**\n * A declarative toolbar button. JSON-friendly on purpose — a host (or an\n * agent) can describe editor affordances as data rather than JSX.\n */\nexport type FlowEditorAction = {\n /** Stable id — also the `data-action` handle, so agents never guess DOM. */\n id: string;\n label: ReactNode;\n /** Native tooltip. */\n title?: string;\n /** Where it sits relative to the built-in buttons. Default \"end\". */\n placement?: \"start\" | \"end\";\n /** Disable when this returns true. Re-evaluated on every render. */\n disabled?: (api: FlowEditorApi) => boolean;\n /** Hide entirely when this returns false. */\n visible?: (api: FlowEditorApi) => boolean;\n /** Only enabled when a node is selected. Sugar over `disabled`. */\n requiresSelection?: boolean;\n onSelect: (api: FlowEditorApi) => void;\n};\n\n/** Which built-in toolbar affordances to render. All default to true. */\nexport type FlowEditorBuiltins = {\n run?: boolean;\n delete?: boolean;\n /** Undo/redo toolbar buttons. Default true. */\n history?: boolean;\n /** \"Add lane\" toolbar button. Default true. */\n addLane?: boolean;\n /** \"Tidy\" (auto-layout) toolbar button. Default true. */\n autoLayout?: boolean;\n /** Right-click a node for Delete / Duplicate. Default true. */\n contextMenu?: boolean;\n /** Right-click a connection for Label / Delete. Default true. */\n edgeContextMenu?: boolean;\n export?: boolean;\n import?: boolean;\n count?: boolean;\n};\n\n/** Replaceable regions. Each receives the editor API. */\nexport type FlowEditorSlots = {\n /** Replace the ENTIRE toolbar (built-ins and actions are not rendered). */\n toolbar?: (api: FlowEditorApi) => ReactNode;\n /** Replace the left palette. */\n palette?: (api: FlowEditorApi) => ReactNode;\n /** Replace the right config panel. */\n panel?: (api: FlowEditorApi) => ReactNode;\n /** Appended inside the config panel, under the fields — per-node actions. */\n panelFooter?: (api: FlowEditorApi) => ReactNode;\n /** Replace the run feed. */\n feed?: (api: FlowEditorApi) => ReactNode;\n /** Rendered over the canvas when the graph is empty. */\n empty?: (api: FlowEditorApi) => ReactNode;\n /** Replace the node right-click menu. Receives the right-clicked node id;\n * call `close` when an item is chosen. */\n contextMenu?: (api: FlowEditorApi, nodeId: string, close: () => void) => ReactNode;\n /** Replace the connection right-click menu. Receives the right-clicked edge\n * id; call `close` when an item is chosen. */\n edgeContextMenu?: (api: FlowEditorApi, edgeId: string, close: () => void) => ReactNode;\n};\n\nconst FlowEditorContext = createContext<FlowEditorApi | null>(null);\n\nexport const FlowEditorProvider = FlowEditorContext.Provider;\n\n/**\n * Read the editor API from any child of `<FlowEditor>`. Throws outside one, so\n * a misplaced custom control fails loudly instead of silently doing nothing.\n */\nexport function useFlowEditor(): FlowEditorApi {\n const api = useContext(FlowEditorContext);\n if (api === null) {\n throw new Error(\"useFlowEditor() must be called inside <FlowEditor>.\");\n }\n return api;\n}\n\n/** Non-throwing variant, for components that may render outside an editor. */\nexport function useFlowEditorOptional(): FlowEditorApi | null {\n return useContext(FlowEditorContext);\n}\n","import { memo, useEffect, useRef, useState } from \"react\";\nimport { NodeResizer, type NodeProps } from \"@xyflow/react\";\nimport type { FlowNode } from \"../../types\";\nimport { useFlowEditorOptional } from \"../FlowEditor/api\";\n\n/**\n * NoteNode — a sticky-note annotation. A portless, visual-only node: nothing\n * wires to it and the engine skips it entirely, so a note NEVER reaches a\n * runner — its text lives in the document purely for people reading the canvas\n * and for editor / agent (MCP) tools. Wired as the `@particle-academy/note`\n * kind's `component`, so `buildNodeTypes` uses it instead of the default card;\n * also the legacy `defaultNodeTypes.note` renderer.\n *\n * Inside a `<FlowEditor>` the note is editable in place — double-click to type;\n * commits flow through `api.updateNode`, so each is one undoable step. In a\n * read-only viewer (no editor context) it renders as static text. Text is read\n * from `config.text` (canonical), falling back to the legacy `data.body` shape.\n */\n\ntype NoteColor = \"amber\" | \"sky\" | \"violet\" | \"emerald\" | \"rose\" | \"slate\";\n\n/** Soft sticky-note fills that read in both light and dark. */\nconst NOTE_COLORS: Record<NoteColor, { bg: string; border: string; title: string }> = {\n amber: { bg: \"rgba(234, 179, 8, 0.14)\", border: \"rgba(234, 179, 8, 0.55)\", title: \"#a16207\" },\n sky: { bg: \"rgba(14, 165, 233, 0.12)\", border: \"rgba(14, 165, 233, 0.5)\", title: \"#0369a1\" },\n violet: { bg: \"rgba(139, 92, 246, 0.13)\", border: \"rgba(139, 92, 246, 0.5)\", title: \"#6d28d9\" },\n emerald: { bg: \"rgba(16, 185, 129, 0.13)\", border: \"rgba(16, 185, 129, 0.5)\", title: \"#047857\" },\n rose: { bg: \"rgba(244, 63, 94, 0.12)\", border: \"rgba(244, 63, 94, 0.5)\", title: \"#be123c\" },\n slate: { bg: \"rgba(100, 116, 139, 0.12)\", border: \"rgba(100, 116, 139, 0.5)\", title: \"#475569\" },\n};\n\nfunction coerceColor(v: unknown): NoteColor {\n return typeof v === \"string\" && v in NOTE_COLORS ? (v as NoteColor) : \"amber\";\n}\n\nfunction NoteNodeInner(props: NodeProps<FlowNode>) {\n const data = props.data as any;\n const config = (data.config ?? {}) as Record<string, unknown>;\n const api = useFlowEditorOptional();\n\n const hasConfigText = typeof config.text === \"string\" && config.text.length > 0;\n // config.text is canonical; legacy notes carried their text in `data.body`.\n const text = hasConfigText\n ? String(config.text)\n : typeof data.body === \"string\"\n ? data.body\n : typeof data.text === \"string\"\n ? data.text\n : \"\";\n // config.title is canonical; a legacy note used its `data.label` as the title.\n const title =\n (typeof config.title === \"string\" && config.title) ||\n (!hasConfigText && typeof data.body === \"string\" && typeof data.label === \"string\" ? data.label : \"\");\n const skin = NOTE_COLORS[coerceColor(config.color)];\n\n const [editing, setEditing] = useState(false);\n const [draft, setDraft] = useState(text);\n const areaRef = useRef<HTMLTextAreaElement>(null);\n\n useEffect(() => {\n if (editing && areaRef.current) {\n const el = areaRef.current;\n el.focus();\n el.setSelectionRange(el.value.length, el.value.length);\n }\n }, [editing]);\n\n const commit = () => {\n setEditing(false);\n if (!api || draft === text) return;\n const current = api.nodes.find((n) => n.id === props.id);\n if (!current) return;\n api.updateNode({\n ...current,\n data: { ...(current.data as any), config: { ...config, text: draft } },\n } as FlowNode);\n };\n\n return (\n <div\n className={[\"ff-note\", props.selected ? \"ff-note--selected\" : \"\"].filter(Boolean).join(\" \")}\n style={{ background: skin.bg, borderColor: skin.border }}\n onDoubleClick={api ? () => { setDraft(text); setEditing(true); } : undefined}\n >\n <NodeResizer isVisible={props.selected ?? false} color={skin.border} minWidth={140} minHeight={80} />\n {title && <div className=\"ff-note__title\" style={{ color: skin.title }}>{title}</div>}\n {editing ? (\n <textarea\n ref={areaRef}\n className=\"ff-note__input nodrag nowheel\"\n value={draft}\n onChange={(e) => setDraft(e.target.value)}\n onBlur={commit}\n onKeyDown={(e) => {\n if (e.key === \"Escape\") setEditing(false);\n if (e.key === \"Enter\" && (e.metaKey || e.ctrlKey)) commit();\n }}\n />\n ) : (\n <div className=\"ff-note__body\">\n {text || <span className=\"ff-note__placeholder\">{api ? \"Double-click to write a note…\" : \"Note\"}</span>}\n </div>\n )}\n </div>\n );\n}\n\nexport const NoteNode = memo(NoteNodeInner);\n","import { createElement } from \"react\";\nimport { ensureBuiltinKinds, registerBuiltinKindInternal } from \"./registry\";\nimport { RichInputPreview } from \"./rich-input\";\nimport { LaneNode } from \"../components/nodes/LaneNode\";\nimport { NoteNode } from \"../components/nodes/NoteNode\";\nimport { BUILTIN_KIND_DATA } from \"./builtin-kinds\";\nimport type { NodeKindDefinition } from \"./types\";\n\n/**\n * The built-in kit WITH its React renderers — the editor's door into it.\n *\n * ## Why this file is a decorator rather than the table\n *\n * `/engine` promised to be React-free and was not (#11). The exact edge was\n * `engine.ts → registry/registry.ts → registry/builtin.ts → react`, and it was\n * a REGRESSION of a fix whose comment is still in `engine.ts`: that file\n * imports from the module rather than the barrel precisely to avoid this, and\n * `registry.ts` later gained a `builtin.ts` import so the registry\n * self-populates. Both changes were right. Nothing tested the property, so the\n * second silently undid the first.\n *\n * The surface turned out to be four lines across three kinds in a 1,064-line\n * file, so the table moved to `builtin-kinds.ts` (React-free, what `registry.ts`\n * imports) and only the renderers stayed here.\n *\n * ## Where this gets applied, and why THERE\n *\n * `src/index.ts` calls `registerBuiltinKinds()` at module scope. That is not an\n * arbitrary choice: `package.json`'s `sideEffects` lists `./dist/index.js` and\n * `./dist/index.cjs` and NOT `./dist/registry.js`, so a consumer's bundler is\n * entitled to drop a top-level statement in the registry chunk and obliged to\n * keep one in the root barrel. Putting it anywhere else would work until\n * somebody's tree-shaker disagreed, and the symptom would be lanes quietly\n * rendering as ordinary cards.\n *\n * A consumer who never imports the React root still gets every kind — schema,\n * ports, executors — because `registry.ts` self-populates from the data\n * module. They simply get no renderers, which is correct: a queue worker has\n * no DOM to render into.\n *\n * ## Host and marketplace kinds are untouched\n *\n * Both arrive at runtime through `registerNodeKind` carrying their own\n * `component` / `renderBody`, and never pass through here. This split is\n * first-party-only by construction and adds no rule a third-party kind has to\n * follow.\n */\n\n/** The renderers, by canonical kind name. */\nconst RENDERERS: Record<string, Partial<NodeKindDefinition>> = {\n \"@particle-academy/lane\": { component: LaneNode },\n \"@particle-academy/terminal_lane\": { component: LaneNode },\n \"@particle-academy/note\": { component: NoteNode },\n \"@particle-academy/rich_user_input\": {\n // Previews the authored page inside a FauxClient frame, so the canvas shows\n // what the person hitting this step will actually see.\n renderBody: (ctx) =>\n createElement(RichInputPreview, { config: (ctx.config ?? {}) as Record<string, unknown> }),\n },\n};\n\n/**\n * Every builtin, with renderers attached to the four that have one.\n *\n * A kind with no renderer is passed through by identity rather than copied, so\n * `BUILTIN_KINDS` and `BUILTIN_KIND_DATA` share objects wherever there is\n * nothing to add.\n */\nexport const BUILTIN_KINDS: NodeKindDefinition[] = BUILTIN_KIND_DATA.map((kind) => {\n const renderer = RENDERERS[kind.name];\n return renderer ? { ...kind, ...renderer } : kind;\n});\n\n/**\n * Register every built-in kind, renderers included.\n *\n * Idempotent, and safe to call after `registry.ts` has already self-populated\n * the plain table: it goes through `registerBuiltinKindInternal`, which\n * replaces a BUILTIN by name, so this UPGRADES the four kinds in place rather\n * than duplicating anything.\n *\n * It does NOT replace a name a host has claimed with `registerNodeKind`. That\n * is the whole point of 0.66.2 — a consumer's replacement of a builtin used to\n * be silently reverted every time this ran, and since the root barrel calls it\n * as an import side effect, whether that happened depended on bundler ordering.\n *\n * The distinction matters to anyone reading this to decide whether calling it\n * is safe: safe against builtins, deliberately powerless against a host.\n */\nexport function registerBuiltinKinds(): void {\n // Lay the React-free table down FIRST, through the same lazy path every other\n // entry point uses. Without this the flag is still unset, so the next read\n // anywhere — `getNodeKind`, the palette, a viewer — triggers\n // `ensureBuiltinKinds()` and re-registers the plain table OVER the decorated\n // kinds, silently dropping the four renderers this function exists to attach.\n ensureBuiltinKinds();\n\n for (const kind of BUILTIN_KINDS) registerBuiltinKindInternal(kind);\n}\n\n// Everything else the table exports keeps its old import path, so no consumer\n// of `./builtin` has to change.\nexport { BUILTIN_KIND_DATA, registerBuiltinKindData } from \"./builtin-kinds\";\n","export type {\n ConfigField,\n TextConfigField,\n TextareaConfigField,\n NumberConfigField,\n SelectConfigField,\n SwitchConfigField,\n JsonConfigField,\n ExpressionConfigField,\n CredentialConfigField,\n RepeaterConfigField,\n RepeaterRowField,\n KeyValueConfigField,\n DocumentConfigField,\n NodeCategory,\n NodeKindDefinition,\n EmitsRelation,\n PortSpec,\n RenderBodyContext,\n} from \"./types\";\n\nexport { resolvePortSpec, resolveNodePorts, nodeConfig } from \"./ports\";\n\nexport {\n createConnectionValidator,\n defaultPortCompatibility,\n ANY_PORT_TYPE,\n type PortCompatibility,\n type ConnectionValidatorOptions,\n} from \"./connection\";\n\n/** Host capabilities — core declares the contract, the host supplies the impl. */\nexport {\n registerLlmClient,\n getLlmClient,\n registerWorkflowResolver,\n getWorkflowResolver,\n registerTerminalHost,\n getTerminalHost,\n capabilityStatus,\n type LlmClient,\n type LlmRoute,\n type LlmRouteRequest,\n type LlmRouteChoice,\n type WorkflowResolver,\n type WorkflowResolution,\n type WorkflowResolutionFailure,\n type TerminalHost,\n type TerminalSession,\n type TerminalSessionSpec,\n type TerminalExit,\n type CapabilityId,\n isResolutionFailure,\n} from \"./capabilities\";\n\n/**\n * The human-pause contract — a run waiting for a person, not a failure.\n * `decodePause` is the one function a durable runner needs.\n */\nexport {\n pauseForHuman,\n encodePause,\n decodePause,\n isPause,\n PAUSE_PREFIX,\n LEGACY_PAUSE_PREFIXES,\n type PauseAwaiting,\n type PauseSignal,\n} from \"./pause\";\n\nexport { subflowExecutor, subflowPorts, subflowMode, DEFAULT_MAX_DEPTH, type SubflowMode } from \"./subflow\";\nexport { llmRouterExecutor, declaredRoutes, resolveFallbackPort } from \"./llm-router\";\n/** @deprecated Renamed to `llmRouterExecutor` — the id and label now match. */\nexport { llmRouterExecutor as llmBranchExecutor } from \"./llm-router\";\n\nexport {\n registerRichInputAdapter,\n getRichInputAdapter,\n isRichInputEnabled,\n onRichInputAdapterChanged,\n RichInputPreview,\n type RichInputAdapter,\n} from \"./rich-input\";\n\nexport {\n registerNodeKind,\n unregisterNodeKind,\n applyKindSchemaOverlay,\n clearKindSchemaOverlays,\n type KindSchemaOverlay,\n type KindSchemaOverlayResult,\n overrideNodeKind,\n clearNodeKindOverrides,\n type NodeKindPresentation,\n getNodeKind,\n resolveKindId,\n kindIds,\n listNodeKinds,\n onNodeKindsChanged,\n defaultConfigFor,\n validateConfig,\n categoryAccent,\n} from \"./registry\";\n\nexport { RegistryNode } from \"./RegistryNode\";\nexport { registerBuiltinKinds, BUILTIN_KINDS } from \"./builtin\";\nexport { ensureBuiltinKinds } from \"./registry\";\n\nimport type { NodeTypes } from \"@xyflow/react\";\nimport { RegistryNode } from \"./RegistryNode\";\nimport { kindIds, listNodeKinds } from \"./registry\";\n\n/**\n * Build an xyflow `nodeTypes` map from the registry — every registered\n * kind gets `RegistryNode` as its renderer. Refresh manually via\n * `useNodeTypes()` (a hook that subscribes to registry changes).\n */\nexport function buildNodeTypes(): NodeTypes {\n const map: NodeTypes = {};\n for (const k of listNodeKinds()) {\n // A kind may bring its own full renderer (lanes/containers); otherwise the\n // default card. Key on every id the kind answers to, not just the canonical\n // one — xyflow looks the renderer up by `node.type` BEFORE RegistryNode gets\n // a chance to resolve aliases, so a graph carrying a pre-namespace type would\n // otherwise fall through to the unknown-node placeholder.\n const renderer = k.component ?? RegistryNode;\n for (const id of kindIds(k)) map[id] = renderer;\n }\n return map;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { NoteNode, createConnectionValidator, buildNodeTypes } from './chunk-
|
|
1
|
+
import { NoteNode, createConnectionValidator, buildNodeTypes } from './chunk-I5EPWHNM.js';
|
|
2
2
|
import { Handle, Position, reconnectEdge, index, BackgroundVariant, Background, Controls, MiniMap, ViewportPortal } from './chunk-OWENS2H5.js';
|
|
3
|
-
import { getNodeKind, categoryAccent } from './chunk-
|
|
3
|
+
import { getNodeKind, categoryAccent } from './chunk-OZHBAXMA.js';
|
|
4
4
|
import { memo, useMemo, useRef, useState, useCallback, useEffect } from 'react';
|
|
5
5
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
6
6
|
|
|
@@ -659,5 +659,5 @@ function cx(...parts) {
|
|
|
659
659
|
}
|
|
660
660
|
|
|
661
661
|
export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, assignToLane, cloneSubgraph, defaultNodeTypes, distributeNodes, duplicateNode, reconnectEdge2 as reconnectEdge, removeEdges, removeFromLane, removeNodes, setEdgeLabel };
|
|
662
|
-
//# sourceMappingURL=chunk-
|
|
663
|
-
//# sourceMappingURL=chunk-
|
|
662
|
+
//# sourceMappingURL=chunk-J66LOLJR.js.map
|
|
663
|
+
//# sourceMappingURL=chunk-J66LOLJR.js.map
|