@particle-academy/fancy-flow 0.21.0 → 0.23.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.
Files changed (61) hide show
  1. package/dist/{capabilities-DUhAc-EJ.d.ts → capabilities-85Mjn4uW.d.ts} +1 -1
  2. package/dist/{capabilities-ChE3Xi8R.d.cts → capabilities-exVeADXz.d.cts} +1 -1
  3. package/dist/{chunk-JE4ENQSE.js → chunk-AUL4LU63.js} +55 -7
  4. package/dist/chunk-AUL4LU63.js.map +1 -0
  5. package/dist/{chunk-L4AX73Q6.js → chunk-KDHLKBL2.js} +11 -5
  6. package/dist/chunk-KDHLKBL2.js.map +1 -0
  7. package/dist/{chunk-G3WHXMZ3.js → chunk-O7F6SGV4.js} +3 -3
  8. package/dist/{chunk-G3WHXMZ3.js.map → chunk-O7F6SGV4.js.map} +1 -1
  9. package/dist/{chunk-HMWYJIRP.js → chunk-OHVSEHDC.js} +3 -3
  10. package/dist/{chunk-HMWYJIRP.js.map → chunk-OHVSEHDC.js.map} +1 -1
  11. package/dist/{chunk-U5F22BHV.js → chunk-YXRLIV7A.js} +4 -2
  12. package/dist/chunk-YXRLIV7A.js.map +1 -0
  13. package/dist/engine.cjs +8 -2
  14. package/dist/engine.cjs.map +1 -1
  15. package/dist/engine.d.cts +3 -3
  16. package/dist/engine.d.ts +3 -3
  17. package/dist/engine.js +4 -4
  18. package/dist/index.cjs +5271 -3395
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +32 -7
  21. package/dist/index.d.ts +32 -7
  22. package/dist/index.js +213 -107
  23. package/dist/index.js.map +1 -1
  24. package/dist/layout/index.d.cts +30 -0
  25. package/dist/layout/index.d.ts +30 -0
  26. package/dist/layout.cjs +1693 -0
  27. package/dist/layout.cjs.map +1 -0
  28. package/dist/layout.js +1691 -0
  29. package/dist/layout.js.map +1 -0
  30. package/dist/llm/vercel-ai.d.cts +2 -2
  31. package/dist/llm/vercel-ai.d.ts +2 -2
  32. package/dist/registry/index.d.cts +5 -5
  33. package/dist/registry/index.d.ts +5 -5
  34. package/dist/registry.cjs +59 -3
  35. package/dist/registry.cjs.map +1 -1
  36. package/dist/registry.js +4 -4
  37. package/dist/{run-flow-ChBi6q-W.d.ts → run-flow-9U-gaYVF.d.ts} +1 -1
  38. package/dist/{run-flow-VKm57Hcj.d.cts → run-flow-AXzOR-Wq.d.cts} +1 -1
  39. package/dist/runtime/index.d.cts +3 -3
  40. package/dist/runtime/index.d.ts +3 -3
  41. package/dist/runtime.cjs +8 -2
  42. package/dist/runtime.cjs.map +1 -1
  43. package/dist/runtime.js +3 -3
  44. package/dist/schema/index.d.cts +1 -1
  45. package/dist/schema/index.d.ts +1 -1
  46. package/dist/schema.cjs.map +1 -1
  47. package/dist/schema.js +2 -2
  48. package/dist/styles.css +41 -0
  49. package/dist/styles.css.map +1 -1
  50. package/dist/{types-VGkCXEO6.d.ts → types-CFEtuRWJ.d.ts} +11 -3
  51. package/dist/{types-sOmpCitB.d.cts → types-CMSrWVYM.d.cts} +1 -1
  52. package/dist/{types-sOmpCitB.d.ts → types-CMSrWVYM.d.ts} +1 -1
  53. package/dist/{types-LG-YckGh.d.cts → types-DneUoivl.d.cts} +11 -3
  54. package/dist/ux.cjs.map +1 -1
  55. package/dist/ux.d.cts +3 -3
  56. package/dist/ux.d.ts +3 -3
  57. package/dist/ux.js +1 -1
  58. package/package.json +12 -1
  59. package/dist/chunk-JE4ENQSE.js.map +0 -1
  60. package/dist/chunk-L4AX73Q6.js.map +0 -1
  61. package/dist/chunk-U5F22BHV.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { LanguageModel } from 'ai';
2
- import { L as LlmRouteRequest, a as LlmClient } from '../capabilities-ChE3Xi8R.cjs';
3
- import '../types-sOmpCitB.cjs';
2
+ import { L as LlmRouteRequest, a as LlmClient } from '../capabilities-exVeADXz.cjs';
3
+ import '../types-CMSrWVYM.cjs';
4
4
  import '@xyflow/react';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { LanguageModel } from 'ai';
2
- import { L as LlmRouteRequest, a as LlmClient } from '../capabilities-DUhAc-EJ.js';
3
- import '../types-sOmpCitB.js';
2
+ import { L as LlmRouteRequest, a as LlmClient } from '../capabilities-85Mjn4uW.js';
3
+ import '../types-CMSrWVYM.js';
4
4
  import '@xyflow/react';
5
5
 
6
6
  /**
@@ -1,9 +1,9 @@
1
- import { a as NodeKindDefinition, P as PortSpec } from '../types-LG-YckGh.cjs';
2
- export { C as ConfigField, b as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, N as NodeCategory, c as NumberConfigField, R as RenderBodyContext, d as RepeaterConfigField, e as RepeaterRowField, S as SelectConfigField, f as SwitchConfigField, T as TextConfigField, g as TextareaConfigField } from '../types-LG-YckGh.cjs';
3
- import { P as PortDescriptor, b as FlowNode, N as NodeExecutor } from '../types-sOmpCitB.cjs';
1
+ import { a as NodeKindDefinition, P as PortSpec } from '../types-DneUoivl.cjs';
2
+ export { C as ConfigField, b as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, N as NodeCategory, c as NumberConfigField, R as RenderBodyContext, d as RepeaterConfigField, e as RepeaterRowField, S as SelectConfigField, f as SwitchConfigField, T as TextConfigField, g as TextareaConfigField } from '../types-DneUoivl.cjs';
3
+ import { P as PortDescriptor, a as FlowNode, N as NodeExecutor } from '../types-CMSrWVYM.cjs';
4
4
  import { Connection, Edge, NodeProps, NodeTypes } from '@xyflow/react';
5
- import { b as LlmRoute } from '../capabilities-ChE3Xi8R.cjs';
6
- export { C as CapabilityId, a as LlmClient, c as LlmRouteChoice, L as LlmRouteRequest, W as WorkflowResolution, d as WorkflowResolutionFailure, e as WorkflowResolver, f as capabilityStatus, g as getLlmClient, h as getWorkflowResolver, i as isResolutionFailure, r as registerLlmClient, j as registerWorkflowResolver } from '../capabilities-ChE3Xi8R.cjs';
5
+ import { b as LlmRoute } from '../capabilities-exVeADXz.cjs';
6
+ export { C as CapabilityId, a as LlmClient, c as LlmRouteChoice, L as LlmRouteRequest, W as WorkflowResolution, d as WorkflowResolutionFailure, e as WorkflowResolver, f as capabilityStatus, g as getLlmClient, h as getWorkflowResolver, i as isResolutionFailure, r as registerLlmClient, j as registerWorkflowResolver } from '../capabilities-exVeADXz.cjs';
7
7
  export { L as LEGACY_PAUSE_PREFIXES, a as PAUSE_PREFIX, P as PauseAwaiting, b as PauseSignal, d as decodePause, e as encodePause, i as isPause, p as pauseForHuman } from '../pause-9iT4tCEV.cjs';
8
8
  import * as react from 'react';
9
9
  import { ComponentType, ReactNode } from 'react';
@@ -1,9 +1,9 @@
1
- import { a as NodeKindDefinition, P as PortSpec } from '../types-VGkCXEO6.js';
2
- export { C as ConfigField, b as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, N as NodeCategory, c as NumberConfigField, R as RenderBodyContext, d as RepeaterConfigField, e as RepeaterRowField, S as SelectConfigField, f as SwitchConfigField, T as TextConfigField, g as TextareaConfigField } from '../types-VGkCXEO6.js';
3
- import { P as PortDescriptor, b as FlowNode, N as NodeExecutor } from '../types-sOmpCitB.js';
1
+ import { a as NodeKindDefinition, P as PortSpec } from '../types-CFEtuRWJ.js';
2
+ export { C as ConfigField, b as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, N as NodeCategory, c as NumberConfigField, R as RenderBodyContext, d as RepeaterConfigField, e as RepeaterRowField, S as SelectConfigField, f as SwitchConfigField, T as TextConfigField, g as TextareaConfigField } from '../types-CFEtuRWJ.js';
3
+ import { P as PortDescriptor, a as FlowNode, N as NodeExecutor } from '../types-CMSrWVYM.js';
4
4
  import { Connection, Edge, NodeProps, NodeTypes } from '@xyflow/react';
5
- import { b as LlmRoute } from '../capabilities-DUhAc-EJ.js';
6
- export { C as CapabilityId, a as LlmClient, c as LlmRouteChoice, L as LlmRouteRequest, W as WorkflowResolution, d as WorkflowResolutionFailure, e as WorkflowResolver, f as capabilityStatus, g as getLlmClient, h as getWorkflowResolver, i as isResolutionFailure, r as registerLlmClient, j as registerWorkflowResolver } from '../capabilities-DUhAc-EJ.js';
5
+ import { b as LlmRoute } from '../capabilities-85Mjn4uW.js';
6
+ export { C as CapabilityId, a as LlmClient, c as LlmRouteChoice, L as LlmRouteRequest, W as WorkflowResolution, d as WorkflowResolutionFailure, e as WorkflowResolver, f as capabilityStatus, g as getLlmClient, h as getWorkflowResolver, i as isResolutionFailure, r as registerLlmClient, j as registerWorkflowResolver } from '../capabilities-85Mjn4uW.js';
7
7
  export { L as LEGACY_PAUSE_PREFIXES, a as PAUSE_PREFIX, P as PauseAwaiting, b as PauseSignal, d as decodePause, e as encodePause, i as isPause, p as pauseForHuman } from '../pause-9iT4tCEV.js';
8
8
  import * as react from 'react';
9
9
  import { ComponentType, ReactNode } from 'react';
package/dist/registry.cjs CHANGED
@@ -179,6 +179,8 @@ function categoryAccent(category) {
179
179
  return "#ec4899";
180
180
  case "output":
181
181
  return "#a855f7";
182
+ case "layout":
183
+ return "#64748b";
182
184
  default:
183
185
  return "#71717a";
184
186
  }
@@ -321,8 +323,14 @@ async function runFlow(graph, executors, onEvent = () => {
321
323
  continue;
322
324
  }
323
325
  }
324
- if (node.type === "note") {
325
- onEvent({ type: "node-status", nodeId: node.id, status: "idle", text: "annotation" });
326
+ const visualKind = getNodeKind(node.type ?? "");
327
+ if (node.type === "note" || visualKind?.category === "layout") {
328
+ onEvent({
329
+ type: "node-status",
330
+ nodeId: node.id,
331
+ status: "idle",
332
+ text: visualKind?.category === "layout" ? "lane" : "annotation"
333
+ });
326
334
  continue;
327
335
  }
328
336
  onEvent({ type: "node-status", nodeId: node.id, status: "running" });
@@ -9745,6 +9753,27 @@ function previewValue(v) {
9745
9753
  }
9746
9754
  return "\u2026";
9747
9755
  }
9756
+ function LaneNodeInner(props) {
9757
+ const data = props.data;
9758
+ const config = data.config ?? {};
9759
+ const title = config.title ?? data.label ?? "Lane";
9760
+ const orientation = config.orientation ?? "horizontal";
9761
+ const accent = config.color ?? data.color ?? categoryAccent("layout");
9762
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9763
+ "div",
9764
+ {
9765
+ className: ["ff-lane", `ff-lane--${orientation}`, props.selected ? "ff-lane--selected" : ""].filter(Boolean).join(" "),
9766
+ style: { borderColor: props.selected ? accent : void 0 },
9767
+ children: [
9768
+ /* @__PURE__ */ jsxRuntime.jsx(NodeResizer, { isVisible: props.selected ?? false, color: accent, minWidth: 160, minHeight: 72 }),
9769
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ff-lane__header", style: { background: accent }, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ff-lane__title", children: title }) })
9770
+ ]
9771
+ }
9772
+ );
9773
+ }
9774
+ var LaneNode = ReactExports.memo(LaneNodeInner);
9775
+
9776
+ // src/registry/builtin.ts
9748
9777
  function casePorts(cases) {
9749
9778
  const byPort = /* @__PURE__ */ new Map();
9750
9779
  if (cases && typeof cases === "object" && !Array.isArray(cases)) {
@@ -10485,6 +10514,32 @@ var KINDS = [
10485
10514
  },
10486
10515
  { type: "expression", key: "message", label: "Message", required: true, example: "{{ $json }}" }
10487
10516
  ]
10517
+ },
10518
+ {
10519
+ // Swimlane — a portless, resizable container. Child nodes are parented into
10520
+ // it; it never runs (the runtime skips the `layout` category). Uses its own
10521
+ // renderer (LaneNode) instead of the default card.
10522
+ name: "@particle-academy/lane",
10523
+ aliases: ["lane", "@fancy/lane"],
10524
+ category: "layout",
10525
+ label: "Lane",
10526
+ description: "A resizable swimlane \u2014 drop nodes into it to group them.",
10527
+ icon: "\u25A4",
10528
+ inputs: [],
10529
+ outputs: [],
10530
+ configSchema: [
10531
+ { type: "text", key: "title", label: "Title", default: "Lane" },
10532
+ {
10533
+ type: "select",
10534
+ key: "orientation",
10535
+ label: "Orientation",
10536
+ default: "horizontal",
10537
+ options: [{ value: "horizontal", label: "Row" }, { value: "vertical", label: "Column" }]
10538
+ }
10539
+ ],
10540
+ defaultConfig: { title: "Lane", orientation: "horizontal" },
10541
+ resizable: { minWidth: 160, minHeight: 72 },
10542
+ component: LaneNode
10488
10543
  }
10489
10544
  ];
10490
10545
  function registerBuiltinKinds() {
@@ -10496,7 +10551,8 @@ var BUILTIN_KINDS = KINDS;
10496
10551
  function buildNodeTypes() {
10497
10552
  const map = {};
10498
10553
  for (const k of listNodeKinds()) {
10499
- for (const id2 of kindIds(k)) map[id2] = RegistryNode;
10554
+ const renderer = k.component ?? RegistryNode;
10555
+ for (const id2 of kindIds(k)) map[id2] = renderer;
10500
10556
  }
10501
10557
  return map;
10502
10558
  }