@particle-academy/fancy-flow 0.2.2
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/README.md +106 -0
- package/dist/chunk-BCXECQUC.js +110 -0
- package/dist/chunk-BCXECQUC.js.map +1 -0
- package/dist/chunk-JNYYJHNJ.js +247 -0
- package/dist/chunk-JNYYJHNJ.js.map +1 -0
- package/dist/chunk-WNVBXXOL.js +101 -0
- package/dist/chunk-WNVBXXOL.js.map +1 -0
- package/dist/chunk-XZEUFVJ2.js +507 -0
- package/dist/chunk-XZEUFVJ2.js.map +1 -0
- package/dist/index.cjs +1677 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +226 -0
- package/dist/index.d.ts +226 -0
- package/dist/index.js +705 -0
- package/dist/index.js.map +1 -0
- package/dist/registry/index.d.cts +170 -0
- package/dist/registry/index.d.ts +170 -0
- package/dist/registry.cjs +615 -0
- package/dist/registry.cjs.map +1 -0
- package/dist/registry.js +4 -0
- package/dist/registry.js.map +1 -0
- package/dist/runtime/index.d.cts +93 -0
- package/dist/runtime/index.d.ts +93 -0
- package/dist/runtime.cjs +252 -0
- package/dist/runtime.cjs.map +1 -0
- package/dist/runtime.js +3 -0
- package/dist/runtime.js.map +1 -0
- package/dist/schema/index.d.cts +81 -0
- package/dist/schema/index.d.ts +81 -0
- package/dist/schema.cjs +170 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.js +4 -0
- package/dist/schema.js.map +1 -0
- package/dist/styles.css +690 -0
- package/dist/styles.css.map +1 -0
- package/dist/types-TemTtb04.d.cts +103 -0
- package/dist/types-TemTtb04.d.ts +103 -0
- package/package.json +55 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/styles.css"],"sourcesContent":["/* @particle-academy/fancy-flow — minimal styles. Pair with @xyflow/react/dist/style.css.\n Dark mode honors both `.dark` ancestor (Tailwind class strategy) and OS\n `prefers-color-scheme: dark`. */\n\n.ff-canvas {\n display: flex;\n flex-direction: column;\n border: 1px solid #e4e4e7;\n border-radius: 12px;\n overflow: hidden;\n background: white;\n}\n.dark .ff-canvas { background: #0a0a0a; border-color: #3f3f46; }\n@media (prefers-color-scheme: dark) {\n .ff-canvas:not(.ff-canvas--light) { background: #0a0a0a; border-color: #3f3f46; }\n}\n\n.ff-canvas__toolbar {\n border-bottom: 1px solid #e4e4e7;\n padding: 6px 8px;\n display: flex; gap: 6px; align-items: center;\n background: rgba(244, 244, 245, 0.6);\n font-family: ui-sans-serif, system-ui, sans-serif;\n font-size: 12px;\n}\n.dark .ff-canvas__toolbar { background: rgba(24, 24, 27, 0.6); border-color: #3f3f46; color: #e4e4e7; }\n@media (prefers-color-scheme: dark) {\n .ff-canvas__toolbar { background: rgba(24, 24, 27, 0.6); border-color: #3f3f46; color: #e4e4e7; }\n}\n.ff-canvas__surface { flex: 1; min-height: 0; position: relative; }\n\n/* xyflow background grid color override for dark canvas */\n.dark .react-flow__background pattern circle { fill: rgba(255, 255, 255, 0.10); }\n\n/* === Nodes === */\n.ff-node {\n min-width: 200px;\n max-width: 280px;\n background: white;\n border: 1px solid #d4d4d8;\n border-radius: 8px;\n font-family: ui-sans-serif, system-ui, sans-serif;\n font-size: 12px;\n color: #18181b;\n box-shadow: 0 1px 2px rgba(0,0,0,0.04), 0 4px 12px rgba(0,0,0,0.06);\n transition: box-shadow 200ms, border-color 200ms;\n overflow: hidden;\n}\n.dark .ff-node {\n background: #1c1917;\n color: #fafafa;\n border-color: #3f3f46;\n box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 6px 16px rgba(0,0,0,0.5);\n}\n@media (prefers-color-scheme: dark) {\n .ff-node { background: #1c1917; color: #fafafa; border-color: #3f3f46; box-shadow: 0 1px 2px rgba(0,0,0,0.4), 0 6px 16px rgba(0,0,0,0.5); }\n}\n.ff-node--selected {\n box-shadow: 0 0 0 2px currentColor, 0 4px 16px rgba(0,0,0,0.20);\n}\n\n.ff-node__header {\n display: flex; align-items: center; gap: 8px;\n padding: 7px 10px;\n color: white;\n font-weight: 600;\n}\n.ff-node__icon { font-size: 14px; line-height: 1; }\n.ff-node__tag {\n font-size: 10px;\n letter-spacing: 0.06em;\n font-weight: 700;\n opacity: 0.85;\n text-transform: uppercase;\n}\n.ff-node__label { flex: 1; font-size: 13px; }\n.ff-node__desc {\n margin: 0;\n padding: 8px 10px 0;\n font-size: 11px;\n color: #71717a;\n}\n.dark .ff-node__desc { color: #a1a1aa; }\n@media (prefers-color-scheme: dark) { .ff-node__desc { color: #a1a1aa; } }\n\n.ff-node__body { padding: 8px 10px 10px; }\n.ff-node__status-text {\n margin: 0;\n padding: 4px 10px 8px;\n font-size: 11px;\n color: #71717a;\n}\n.dark .ff-node__status-text { color: #a1a1aa; }\n@media (prefers-color-scheme: dark) { .ff-node__status-text { color: #a1a1aa; } }\n.ff-node--status-error .ff-node__status-text { color: #dc2626; }\n.dark .ff-node--status-error .ff-node__status-text { color: #f87171; }\n\n.ff-node--status-running { animation: ff-pulse 1.4s ease-in-out infinite; }\n@keyframes ff-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4), 0 4px 12px rgba(0,0,0,0.06); }\n 50% { box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.05), 0 4px 12px rgba(0,0,0,0.06); }\n}\n\n/* Status dot in the header */\n.ff-node__dot {\n width: 8px; height: 8px; border-radius: 50%;\n background: rgba(255,255,255,0.5);\n}\n.ff-node__dot--queued { background: #fbbf24; }\n.ff-node__dot--running { background: #fde68a; box-shadow: 0 0 6px #fde68a; }\n.ff-node__dot--done { background: #34d399; }\n.ff-node__dot--error { background: #f87171; }\n\n/* Subgraph metadata row */\n.ff-subgraph__meta {\n display: flex; justify-content: space-between;\n font-size: 11px; color: #71717a;\n}\n.dark .ff-subgraph__meta { color: #a1a1aa; }\n@media (prefers-color-scheme: dark) { .ff-subgraph__meta { color: #a1a1aa; } }\n\n/* Note node — no header chrome, sticky-style */\n.ff-note {\n background: #fef3c7;\n border: 1px solid rgba(0,0,0,0.06);\n border-radius: 6px;\n padding: 8px 10px;\n font-family: ui-sans-serif, system-ui, sans-serif;\n font-size: 12px;\n color: #1f2937;\n min-width: 180px;\n box-shadow: 0 1px 2px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.06);\n /* Pin to light text-on-yellow even in dark mode for readability */\n color-scheme: light;\n}\n.ff-note--selected { box-shadow: 0 0 0 2px #a855f7, 0 4px 12px rgba(0,0,0,0.2); }\n.ff-note__title { font-weight: 600; margin-bottom: 4px; }\n.ff-note__body { margin: 0; white-space: pre-wrap; }\n\n/* xyflow wraps every custom node in a `.react-flow__node-{type}` div with\n default border / background / box-shadow / padding. Our kit ships its\n own chrome via `.ff-node`, so strip xyflow's defaults for our types\n to avoid the white \"frame\" effect around the colored cards. */\n.react-flow__node-trigger,\n.react-flow__node-action,\n.react-flow__node-decision,\n.react-flow__node-output,\n.react-flow__node-note,\n.react-flow__node-subgraph {\n background: transparent !important;\n border: none !important;\n padding: 0 !important;\n box-shadow: none !important;\n border-radius: 0 !important;\n}\n\n/* xyflow handle — match accent + visible on both themes. */\n.react-flow__handle {\n width: 10px; height: 10px;\n background: white;\n border: 2px solid #94a3b8;\n border-radius: 50%;\n}\n.dark .react-flow__handle { background: #18181b; border-color: #71717a; }\n@media (prefers-color-scheme: dark) {\n .react-flow__handle { background: #18181b; border-color: #71717a; }\n}\n.react-flow__handle:hover { background: #3b82f6; border-color: #3b82f6; }\n\n/* xyflow edge color — softer in dark */\n.dark .react-flow__edge-path { stroke: #71717a; }\n@media (prefers-color-scheme: dark) {\n .react-flow__edge-path { stroke: #71717a; }\n}\n.react-flow__connection-path { stroke: #3b82f6; stroke-width: 2; }\n\n/* xyflow controls — bump specificity + !important so dark theming wins\n over xyflow's default stylesheet. */\n.dark .react-flow__controls,\n.react-flow__controls.ff-controls {\n background: transparent;\n box-shadow: none;\n}\n.dark .react-flow__controls .react-flow__controls-button {\n background: #18181b !important;\n border-color: #3f3f46 !important;\n border-bottom-color: #3f3f46 !important;\n color: #fafafa !important;\n}\n.dark .react-flow__controls .react-flow__controls-button:hover {\n background: #27272a !important;\n}\n.dark .react-flow__controls .react-flow__controls-button svg,\n.dark .react-flow__controls .react-flow__controls-button svg path,\n.dark .react-flow__controls .react-flow__controls-button svg polyline,\n.dark .react-flow__controls .react-flow__controls-button svg polygon {\n fill: currentColor !important;\n stroke: currentColor !important;\n}\n\n/* Run controls */\n.ff-run-controls { display: flex; gap: 6px; }\n.ff-run-controls__btn {\n border: 0; border-radius: 6px;\n padding: 6px 12px;\n font: inherit; font-size: 12px; font-weight: 500;\n cursor: pointer;\n background: #e4e4e7; color: #18181b;\n}\n.dark .ff-run-controls__btn { background: #27272a; color: #fafafa; }\n.ff-run-controls__btn--run { background: #10b981; color: white; }\n.dark .ff-run-controls__btn--run { background: #10b981; color: white; }\n.ff-run-controls__btn--cancel { background: #ef4444; color: white; }\n.ff-run-controls__btn:disabled { opacity: 0.5; cursor: default; }\n\n/* Run feed */\n.ff-run-feed {\n font-family: ui-monospace, monospace;\n font-size: 11px;\n background: #0a0a0a;\n color: #fafafa;\n border-radius: 8px;\n padding: 8px 10px;\n overflow: auto;\n max-height: 240px;\n border: 1px solid #1f1f23;\n}\n.ff-run-feed__empty { color: #71717a; margin: 0; }\n.ff-run-feed__row { display: flex; gap: 8px; padding: 1px 0; }\n.ff-run-feed__row--error .ff-run-feed__text { color: #f87171; }\n.ff-run-feed__row--warn .ff-run-feed__text { color: #fbbf24; }\n.ff-run-feed__row--status .ff-run-feed__text { color: #93c5fd; }\n.ff-run-feed__time { color: #71717a; }\n.ff-run-feed__node { color: #c4b5fd; }\n.ff-run-feed__text { flex: 1; }\n\n/* === Node summary inside the card === */\n.ff-node__summary { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }\n.ff-node__summary li { display: flex; gap: 6px; font-size: 11px; }\n.ff-node__summary-key { color: #71717a; }\n.dark .ff-node__summary-key { color: #a1a1aa; }\n.ff-node__summary-value { font-family: ui-monospace, monospace; }\n.ff-node__summary-more { color: #71717a; font-size: 10px; }\n.ff-node__body-empty { font-size: 11px; color: #a1a1aa; font-style: italic; }\n\n/* === FlowEditor layout === */\n.ff-editor {\n display: grid;\n grid-template-columns: 220px 1fr 320px;\n gap: 12px;\n font-family: ui-sans-serif, system-ui, sans-serif;\n}\n.ff-editor__main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }\n.ff-editor__feed { flex-shrink: 0; }\n.ff-editor__sep { width: 1px; align-self: stretch; background: #e4e4e7; }\n.dark .ff-editor__sep { background: #3f3f46; }\n.ff-editor__btn {\n border: 1px solid #d4d4d8; background: transparent; cursor: pointer;\n border-radius: 6px; padding: 4px 10px;\n color: inherit; font-size: 12px;\n}\n.ff-editor__btn:hover { background: rgba(0,0,0,0.04); }\n.dark .ff-editor__btn { border-color: #3f3f46; }\n.dark .ff-editor__btn:hover { background: #27272a; }\n.ff-editor__count {\n margin-left: auto; font-size: 11px; color: #71717a;\n}\n.dark .ff-editor__count { color: #a1a1aa; }\n\n/* === NodePalette === */\n.ff-palette {\n display: flex; flex-direction: column;\n background: white;\n border: 1px solid #e4e4e7;\n border-radius: 12px;\n overflow: hidden;\n font-size: 13px;\n color: #18181b;\n}\n.dark .ff-palette { background: #18181b; color: #fafafa; border-color: #3f3f46; }\n.ff-palette__search { padding: 8px; border-bottom: 1px solid #e4e4e7; }\n.dark .ff-palette__search { border-color: #3f3f46; }\n.ff-palette__search-input {\n width: 100%;\n padding: 6px 10px;\n border: 1px solid #d4d4d8;\n border-radius: 6px;\n background: transparent;\n color: inherit;\n font: inherit;\n}\n.dark .ff-palette__search-input { border-color: #3f3f46; }\n.ff-palette__list { flex: 1; overflow: auto; padding: 4px; }\n.ff-palette__group { padding: 4px 0; }\n.ff-palette__group-label {\n font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;\n color: #71717a;\n padding: 4px 8px;\n}\n.dark .ff-palette__group-label { color: #a1a1aa; }\n.ff-palette__row {\n width: 100%;\n display: flex; align-items: center; gap: 8px;\n padding: 6px 8px; border: 0; background: transparent; cursor: grab;\n border-radius: 6px;\n text-align: left; color: inherit; font: inherit;\n}\n.ff-palette__row:hover { background: rgba(0,0,0,0.04); }\n.dark .ff-palette__row:hover { background: #27272a; }\n.ff-palette__row:active { cursor: grabbing; }\n.ff-palette__row-dot {\n flex-shrink: 0;\n width: 24px; height: 24px;\n border-radius: 6px;\n display: inline-flex; align-items: center; justify-content: center;\n color: white; font-size: 14px;\n}\n.ff-palette__row-text { display: flex; flex-direction: column; min-width: 0; }\n.ff-palette__row-label { font-size: 12px; font-weight: 500; }\n.ff-palette__row-desc {\n font-size: 11px; color: #71717a;\n white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n}\n.dark .ff-palette__row-desc { color: #a1a1aa; }\n\n/* === NodeConfigPanel === */\n.ff-panel {\n background: white;\n border: 1px solid #e4e4e7;\n border-radius: 12px;\n padding: 12px;\n display: flex; flex-direction: column; gap: 10px;\n overflow: auto;\n font-size: 13px;\n color: #18181b;\n}\n.dark .ff-panel { background: #18181b; color: #fafafa; border-color: #3f3f46; }\n.ff-panel--empty { align-items: center; justify-content: center; }\n.ff-panel__empty { font-size: 12px; color: #a1a1aa; }\n.ff-panel__header { display: flex; flex-direction: column; gap: 4px; }\n.ff-panel__kind-tag {\n align-self: flex-start;\n font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;\n background: rgba(168, 85, 247, 0.12); color: #a855f7;\n padding: 2px 8px; border-radius: 999px;\n}\n.ff-panel__kind-desc { margin: 0; font-size: 12px; color: #71717a; }\n.dark .ff-panel__kind-desc { color: #a1a1aa; }\n.ff-panel__divider { border: 0; border-top: 1px solid #e4e4e7; margin: 4px 0; }\n.dark .ff-panel__divider { border-top-color: #3f3f46; }\n.ff-panel__field { display: flex; flex-direction: column; gap: 4px; }\n.ff-panel__label { font-size: 12px; font-weight: 500; }\n.ff-panel__hint { font-size: 11px; color: #71717a; margin: 0; }\n.dark .ff-panel__hint { color: #a1a1aa; }\n.ff-panel__required { color: #dc2626; }\n.ff-panel__input {\n width: 100%;\n padding: 6px 8px;\n border: 1px solid #d4d4d8;\n border-radius: 6px;\n background: transparent;\n color: inherit;\n font: inherit;\n font-size: 12px;\n box-sizing: border-box;\n}\n.ff-panel__input:focus { outline: 2px solid #a855f7; outline-offset: -1px; }\n.dark .ff-panel__input { border-color: #3f3f46; }\n.ff-panel__input--textarea { font-family: inherit; resize: vertical; }\n.ff-panel__input--expression,\n.ff-panel__input--json {\n font-family: ui-monospace, monospace; font-size: 11px;\n}\n.ff-panel__switch { display: inline-flex; align-items: center; cursor: pointer; }\n.ff-panel__switch input { display: none; }\n.ff-panel__switch-slider {\n width: 32px; height: 18px;\n background: #d4d4d8;\n border-radius: 999px;\n position: relative;\n transition: background 200ms;\n}\n.ff-panel__switch-slider::before {\n content: \"\";\n position: absolute; left: 2px; top: 2px;\n width: 14px; height: 14px;\n background: white;\n border-radius: 50%;\n transition: left 200ms;\n}\n.ff-panel__switch input:checked + .ff-panel__switch-slider { background: #a855f7; }\n.ff-panel__switch input:checked + .ff-panel__switch-slider::before { left: 16px; }\n.ff-panel__issues { margin-top: 4px; }\n.ff-panel__issue { font-size: 11px; color: #b45309; margin: 2px 0; }\n.dark .ff-panel__issue { color: #fbbf24; }\n"],"mappings":";AAIA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,UAAQ,IAAI,MAAM;AAClB,iBAAe;AACf,YAAU;AACV,cAAY;AACd;AACA,CAAC,KAAK,CARL;AAQkB,cAAY;AAAS,gBAAc;AAAS;AAC/D,QAAO,sBAAuB;AAC5B,GAVD,SAUW,KAAK,CAAC;AAAoB,gBAAY;AAAS,kBAAc;AAAS;AAClF;AAEA,CAAC;AACC,iBAAe,IAAI,MAAM;AACzB,WAAS,IAAI;AACb,WAAS;AAAM,OAAK;AAAK,eAAa;AACtC,cAAY,KAAK,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;AAChC;AA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mB,cAAY;AAAK;AACrC,CAAC;AAAkB,aAAW;AAAM,SAAO;AAAS,UAAQ,IAAI;AAAG;AACnE,CA9XC,KA8XK,CADL;AACwB,SAAO;AAAS;","names":[]}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Node, Edge } from '@xyflow/react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public domain types for fancy-flow. Built-in nodes are layered on top of
|
|
5
|
+
* @xyflow/react's `Node` so consumers can mix custom xyflow nodes alongside
|
|
6
|
+
* the kit. Edges remain xyflow's standard `Edge`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type FlowNodeKind = "trigger" | "action" | "decision" | "output" | "note" | "subgraph";
|
|
10
|
+
/** Status surfaced on the node while a run is in progress. */
|
|
11
|
+
type NodeRunStatus = "idle" | "queued" | "running" | "done" | "error";
|
|
12
|
+
/** Port description on a node. Ports are visual handles xyflow can connect. */
|
|
13
|
+
type PortDescriptor = {
|
|
14
|
+
id: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Optional logical type for hosts that want to validate connections. */
|
|
17
|
+
type?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Common shape every kit node carries in its `data` slot. */
|
|
20
|
+
type BaseNodeData = {
|
|
21
|
+
label: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Free-form configuration the host owns (form values, code, parameters). */
|
|
24
|
+
config?: Record<string, unknown>;
|
|
25
|
+
/** Set by the runner; hosts shouldn't edit this directly. */
|
|
26
|
+
status?: NodeRunStatus;
|
|
27
|
+
/** Optional human-readable status detail (e.g. error message, current step). */
|
|
28
|
+
statusText?: string;
|
|
29
|
+
/** Per-node accent override, e.g. for theming a custom subclass. */
|
|
30
|
+
color?: string;
|
|
31
|
+
/** Input ports rendered on the node. Defaults vary by kind. */
|
|
32
|
+
inputs?: PortDescriptor[];
|
|
33
|
+
/** Output ports rendered on the node. Defaults vary by kind. */
|
|
34
|
+
outputs?: PortDescriptor[];
|
|
35
|
+
};
|
|
36
|
+
type TriggerNodeData = BaseNodeData & {
|
|
37
|
+
kind: "trigger";
|
|
38
|
+
};
|
|
39
|
+
type ActionNodeData = BaseNodeData & {
|
|
40
|
+
kind: "action";
|
|
41
|
+
};
|
|
42
|
+
type DecisionNodeData = BaseNodeData & {
|
|
43
|
+
kind: "decision";
|
|
44
|
+
};
|
|
45
|
+
type OutputNodeData = BaseNodeData & {
|
|
46
|
+
kind: "output";
|
|
47
|
+
};
|
|
48
|
+
type NoteNodeData = BaseNodeData & {
|
|
49
|
+
kind: "note";
|
|
50
|
+
body?: string;
|
|
51
|
+
};
|
|
52
|
+
type SubgraphNodeData = BaseNodeData & {
|
|
53
|
+
kind: "subgraph";
|
|
54
|
+
/** Ids of the nodes contained in this subgraph. */
|
|
55
|
+
childIds?: string[];
|
|
56
|
+
/** Whether the subgraph is shown collapsed (default true — children hidden). */
|
|
57
|
+
collapsed?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type FlowNodeData = TriggerNodeData | ActionNodeData | DecisionNodeData | OutputNodeData | NoteNodeData | SubgraphNodeData;
|
|
60
|
+
type FlowNode = Node<FlowNodeData>;
|
|
61
|
+
type FlowEdge = Edge;
|
|
62
|
+
/** A serializable graph — what hosts persist, what agents read/write. */
|
|
63
|
+
type FlowGraph = {
|
|
64
|
+
nodes: FlowNode[];
|
|
65
|
+
edges: FlowEdge[];
|
|
66
|
+
};
|
|
67
|
+
/** Per-node executor signature. Inputs are keyed by input-port id. */
|
|
68
|
+
type NodeExecutor<TIn = Record<string, unknown>, TOut = unknown> = (ctx: {
|
|
69
|
+
node: FlowNode;
|
|
70
|
+
inputs: TIn;
|
|
71
|
+
/** Stops the run if called. */
|
|
72
|
+
abort: (reason?: string) => never;
|
|
73
|
+
/** Lets the executor stream status updates and partial outputs. */
|
|
74
|
+
emit: (event: RunEvent) => void;
|
|
75
|
+
}) => Promise<TOut> | TOut;
|
|
76
|
+
type ExecutorRegistry = Partial<Record<FlowNodeKind | string, NodeExecutor>>;
|
|
77
|
+
type RunEvent = {
|
|
78
|
+
type: "node-status";
|
|
79
|
+
nodeId: string;
|
|
80
|
+
status: NodeRunStatus;
|
|
81
|
+
text?: string;
|
|
82
|
+
} | {
|
|
83
|
+
type: "node-output";
|
|
84
|
+
nodeId: string;
|
|
85
|
+
portId: string;
|
|
86
|
+
value: unknown;
|
|
87
|
+
} | {
|
|
88
|
+
type: "log";
|
|
89
|
+
nodeId?: string;
|
|
90
|
+
level: "info" | "warn" | "error";
|
|
91
|
+
message: string;
|
|
92
|
+
detail?: unknown;
|
|
93
|
+
} | {
|
|
94
|
+
type: "run-start";
|
|
95
|
+
} | {
|
|
96
|
+
type: "run-end";
|
|
97
|
+
ok: boolean;
|
|
98
|
+
} | {
|
|
99
|
+
type: "run-error";
|
|
100
|
+
error: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type { ActionNodeData as A, BaseNodeData as B, DecisionNodeData as D, ExecutorRegistry as E, FlowNode as F, NodeExecutor as N, OutputNodeData as O, PortDescriptor as P, RunEvent as R, SubgraphNodeData as S, TriggerNodeData as T, FlowGraph as a, FlowEdge as b, FlowNodeData as c, FlowNodeKind as d, NodeRunStatus as e, NoteNodeData as f };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { Node, Edge } from '@xyflow/react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Public domain types for fancy-flow. Built-in nodes are layered on top of
|
|
5
|
+
* @xyflow/react's `Node` so consumers can mix custom xyflow nodes alongside
|
|
6
|
+
* the kit. Edges remain xyflow's standard `Edge`.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
type FlowNodeKind = "trigger" | "action" | "decision" | "output" | "note" | "subgraph";
|
|
10
|
+
/** Status surfaced on the node while a run is in progress. */
|
|
11
|
+
type NodeRunStatus = "idle" | "queued" | "running" | "done" | "error";
|
|
12
|
+
/** Port description on a node. Ports are visual handles xyflow can connect. */
|
|
13
|
+
type PortDescriptor = {
|
|
14
|
+
id: string;
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Optional logical type for hosts that want to validate connections. */
|
|
17
|
+
type?: string;
|
|
18
|
+
};
|
|
19
|
+
/** Common shape every kit node carries in its `data` slot. */
|
|
20
|
+
type BaseNodeData = {
|
|
21
|
+
label: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
/** Free-form configuration the host owns (form values, code, parameters). */
|
|
24
|
+
config?: Record<string, unknown>;
|
|
25
|
+
/** Set by the runner; hosts shouldn't edit this directly. */
|
|
26
|
+
status?: NodeRunStatus;
|
|
27
|
+
/** Optional human-readable status detail (e.g. error message, current step). */
|
|
28
|
+
statusText?: string;
|
|
29
|
+
/** Per-node accent override, e.g. for theming a custom subclass. */
|
|
30
|
+
color?: string;
|
|
31
|
+
/** Input ports rendered on the node. Defaults vary by kind. */
|
|
32
|
+
inputs?: PortDescriptor[];
|
|
33
|
+
/** Output ports rendered on the node. Defaults vary by kind. */
|
|
34
|
+
outputs?: PortDescriptor[];
|
|
35
|
+
};
|
|
36
|
+
type TriggerNodeData = BaseNodeData & {
|
|
37
|
+
kind: "trigger";
|
|
38
|
+
};
|
|
39
|
+
type ActionNodeData = BaseNodeData & {
|
|
40
|
+
kind: "action";
|
|
41
|
+
};
|
|
42
|
+
type DecisionNodeData = BaseNodeData & {
|
|
43
|
+
kind: "decision";
|
|
44
|
+
};
|
|
45
|
+
type OutputNodeData = BaseNodeData & {
|
|
46
|
+
kind: "output";
|
|
47
|
+
};
|
|
48
|
+
type NoteNodeData = BaseNodeData & {
|
|
49
|
+
kind: "note";
|
|
50
|
+
body?: string;
|
|
51
|
+
};
|
|
52
|
+
type SubgraphNodeData = BaseNodeData & {
|
|
53
|
+
kind: "subgraph";
|
|
54
|
+
/** Ids of the nodes contained in this subgraph. */
|
|
55
|
+
childIds?: string[];
|
|
56
|
+
/** Whether the subgraph is shown collapsed (default true — children hidden). */
|
|
57
|
+
collapsed?: boolean;
|
|
58
|
+
};
|
|
59
|
+
type FlowNodeData = TriggerNodeData | ActionNodeData | DecisionNodeData | OutputNodeData | NoteNodeData | SubgraphNodeData;
|
|
60
|
+
type FlowNode = Node<FlowNodeData>;
|
|
61
|
+
type FlowEdge = Edge;
|
|
62
|
+
/** A serializable graph — what hosts persist, what agents read/write. */
|
|
63
|
+
type FlowGraph = {
|
|
64
|
+
nodes: FlowNode[];
|
|
65
|
+
edges: FlowEdge[];
|
|
66
|
+
};
|
|
67
|
+
/** Per-node executor signature. Inputs are keyed by input-port id. */
|
|
68
|
+
type NodeExecutor<TIn = Record<string, unknown>, TOut = unknown> = (ctx: {
|
|
69
|
+
node: FlowNode;
|
|
70
|
+
inputs: TIn;
|
|
71
|
+
/** Stops the run if called. */
|
|
72
|
+
abort: (reason?: string) => never;
|
|
73
|
+
/** Lets the executor stream status updates and partial outputs. */
|
|
74
|
+
emit: (event: RunEvent) => void;
|
|
75
|
+
}) => Promise<TOut> | TOut;
|
|
76
|
+
type ExecutorRegistry = Partial<Record<FlowNodeKind | string, NodeExecutor>>;
|
|
77
|
+
type RunEvent = {
|
|
78
|
+
type: "node-status";
|
|
79
|
+
nodeId: string;
|
|
80
|
+
status: NodeRunStatus;
|
|
81
|
+
text?: string;
|
|
82
|
+
} | {
|
|
83
|
+
type: "node-output";
|
|
84
|
+
nodeId: string;
|
|
85
|
+
portId: string;
|
|
86
|
+
value: unknown;
|
|
87
|
+
} | {
|
|
88
|
+
type: "log";
|
|
89
|
+
nodeId?: string;
|
|
90
|
+
level: "info" | "warn" | "error";
|
|
91
|
+
message: string;
|
|
92
|
+
detail?: unknown;
|
|
93
|
+
} | {
|
|
94
|
+
type: "run-start";
|
|
95
|
+
} | {
|
|
96
|
+
type: "run-end";
|
|
97
|
+
ok: boolean;
|
|
98
|
+
} | {
|
|
99
|
+
type: "run-error";
|
|
100
|
+
error: string;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type { ActionNodeData as A, BaseNodeData as B, DecisionNodeData as D, ExecutorRegistry as E, FlowNode as F, NodeExecutor as N, OutputNodeData as O, PortDescriptor as P, RunEvent as R, SubgraphNodeData as S, TriggerNodeData as T, FlowGraph as a, FlowEdge as b, FlowNodeData as c, FlowNodeKind as d, NodeRunStatus as e, NoteNodeData as f };
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@particle-academy/fancy-flow",
|
|
3
|
+
"version": "0.2.2",
|
|
4
|
+
"description": "Workflow editor + runner built on React Flow. Six built-in node kits (trigger / action / decision / output / note / subgraph), tokenized theme, topological execution with per-node status.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/Particle-Academy/fancy-flow.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/Particle-Academy/fancy-flow#readme",
|
|
10
|
+
"bugs": "https://github.com/Particle-Academy/fancy-flow/issues",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.cjs",
|
|
13
|
+
"module": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"import": { "types": "./dist/index.d.ts", "default": "./dist/index.js" },
|
|
18
|
+
"require": { "types": "./dist/index.d.cts", "default": "./dist/index.cjs" }
|
|
19
|
+
},
|
|
20
|
+
"./runtime": {
|
|
21
|
+
"import": { "types": "./dist/runtime.d.ts", "default": "./dist/runtime.js" },
|
|
22
|
+
"require": { "types": "./dist/runtime.d.cts", "default": "./dist/runtime.cjs" }
|
|
23
|
+
},
|
|
24
|
+
"./styles.css": "./dist/styles.css"
|
|
25
|
+
},
|
|
26
|
+
"files": ["dist", "docs", "README.md"],
|
|
27
|
+
"scripts": {
|
|
28
|
+
"build": "tsup",
|
|
29
|
+
"dev": "tsup --watch",
|
|
30
|
+
"lint": "tsc --noEmit",
|
|
31
|
+
"clean": "rm -rf dist",
|
|
32
|
+
"prepublishOnly": "tsup"
|
|
33
|
+
},
|
|
34
|
+
"keywords": ["react", "workflow", "flow", "graph", "react-flow", "xyflow", "fancy"],
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
37
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
38
|
+
"@xyflow/react": "^12.0.0"
|
|
39
|
+
},
|
|
40
|
+
"dependencies": {
|
|
41
|
+
"clsx": "^2.1.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@types/react": "^19.0.0",
|
|
45
|
+
"@types/react-dom": "^19.0.0",
|
|
46
|
+
"@xyflow/react": "^12.4.0",
|
|
47
|
+
"react": "^19.0.0",
|
|
48
|
+
"react-dom": "^19.0.0",
|
|
49
|
+
"tsup": "^8.0.0",
|
|
50
|
+
"typescript": "^5.7.0"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": { "access": "public" },
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"sideEffects": ["**/*.css"]
|
|
55
|
+
}
|