@particle-academy/fancy-flow 0.65.2 → 0.66.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 (105) hide show
  1. package/README.md +100 -3
  2. package/dist/{FlowViewer-BI_AyyvU.d.ts → FlowViewer-BCc_BvuD.d.ts} +1 -1
  3. package/dist/{FlowViewer-DABx-6A-.d.cts → FlowViewer-CoAJ3o52.d.cts} +1 -1
  4. package/dist/{HumanPrompt-Bpp3JiVH.d.cts → HumanPrompt--pXDOyYC.d.cts} +2 -2
  5. package/dist/{HumanPrompt-BKThiyjB.d.ts → HumanPrompt-DXm_FP9z.d.ts} +2 -2
  6. package/dist/chunk-2QXKDLGT.js +58 -0
  7. package/dist/chunk-2QXKDLGT.js.map +1 -0
  8. package/dist/{chunk-77V4QC6Y.js → chunk-B7HKJJVV.js} +3 -3
  9. package/dist/{chunk-77V4QC6Y.js.map → chunk-B7HKJJVV.js.map} +1 -1
  10. package/dist/{chunk-MBVX4ZRB.js → chunk-FNYLKSFJ.js} +3 -3
  11. package/dist/{chunk-MBVX4ZRB.js.map → chunk-FNYLKSFJ.js.map} +1 -1
  12. package/dist/{chunk-JF6WCRBU.js → chunk-HQGOFGAL.js} +861 -40
  13. package/dist/chunk-HQGOFGAL.js.map +1 -0
  14. package/dist/{chunk-5H54OTKT.js → chunk-IEYCNFXZ.js} +3 -3
  15. package/dist/{chunk-5H54OTKT.js.map → chunk-IEYCNFXZ.js.map} +1 -1
  16. package/dist/{chunk-W5DPKJY4.js → chunk-MTONBM53.js} +4 -4
  17. package/dist/chunk-MTONBM53.js.map +1 -0
  18. package/dist/{chunk-RIAFHQT5.js → chunk-PNHZHEWE.js} +3 -3
  19. package/dist/{chunk-RIAFHQT5.js.map → chunk-PNHZHEWE.js.map} +1 -1
  20. package/dist/{chunk-EO6444T2.js → chunk-UCCTXJXL.js} +4 -4
  21. package/dist/{chunk-EO6444T2.js.map → chunk-UCCTXJXL.js.map} +1 -1
  22. package/dist/connectors.d.cts +2 -2
  23. package/dist/connectors.d.ts +2 -2
  24. package/dist/durable/index.d.cts +2 -2
  25. package/dist/durable/index.d.ts +2 -2
  26. package/dist/durable.cjs +837 -47
  27. package/dist/durable.cjs.map +1 -1
  28. package/dist/durable.js +2 -3
  29. package/dist/durable.js.map +1 -1
  30. package/dist/engine.cjs +843 -132
  31. package/dist/engine.cjs.map +1 -1
  32. package/dist/engine.d.cts +6 -7
  33. package/dist/engine.d.ts +6 -7
  34. package/dist/engine.js +5 -6
  35. package/dist/engine.js.map +1 -1
  36. package/dist/fields/react-fancy.d.cts +3 -3
  37. package/dist/fields/react-fancy.d.ts +3 -3
  38. package/dist/index.cjs +853 -140
  39. package/dist/index.cjs.map +1 -1
  40. package/dist/index.d.cts +65 -36
  41. package/dist/index.d.ts +65 -36
  42. package/dist/index.js +19 -18
  43. package/dist/index.js.map +1 -1
  44. package/dist/layout/index.d.cts +1 -1
  45. package/dist/layout/index.d.ts +1 -1
  46. package/dist/llm/prism.cjs.map +1 -1
  47. package/dist/llm/prism.d.cts +1 -2
  48. package/dist/llm/prism.d.ts +1 -2
  49. package/dist/llm/prism.js +1 -1
  50. package/dist/llm/vercel-ai.cjs.map +1 -1
  51. package/dist/llm/vercel-ai.d.cts +1 -2
  52. package/dist/llm/vercel-ai.d.ts +1 -2
  53. package/dist/llm/vercel-ai.js +1 -1
  54. package/dist/registry/index.d.cts +5 -6
  55. package/dist/registry/index.d.ts +5 -6
  56. package/dist/{registry-CntAdUcY.d.cts → registry-BcgllSk2.d.cts} +1 -1
  57. package/dist/{registry-DYoV-MQi.d.ts → registry-h-2QswZ5.d.ts} +1 -1
  58. package/dist/registry.cjs +867 -37
  59. package/dist/registry.cjs.map +1 -1
  60. package/dist/registry.js +3 -3
  61. package/dist/{run-cohort-C1nRh_mi.d.ts → run-cohort-CjUBWg6X.d.ts} +2 -2
  62. package/dist/{run-cohort-CBRAUj-z.d.cts → run-cohort-DL9JzzPU.d.cts} +2 -2
  63. package/dist/{run-flow-2XsHBwpd.d.cts → run-flow-B_8hgO5_.d.cts} +1 -1
  64. package/dist/{run-flow-D7AOCcfE.d.ts → run-flow-CxEGBOxd.d.ts} +1 -1
  65. package/dist/runtime/index.d.cts +5 -5
  66. package/dist/runtime/index.d.ts +5 -5
  67. package/dist/runtime.cjs +837 -36
  68. package/dist/runtime.cjs.map +1 -1
  69. package/dist/runtime.js +4 -4
  70. package/dist/schema/index.d.cts +19 -6
  71. package/dist/schema/index.d.ts +19 -6
  72. package/dist/schema.cjs +837 -36
  73. package/dist/schema.cjs.map +1 -1
  74. package/dist/schema.js +4 -4
  75. package/dist/screens.cjs +837 -36
  76. package/dist/screens.cjs.map +1 -1
  77. package/dist/screens.d.cts +2 -2
  78. package/dist/screens.d.ts +2 -2
  79. package/dist/screens.js +5 -5
  80. package/dist/terminal/fancy-term-host.cjs +99 -0
  81. package/dist/terminal/fancy-term-host.cjs.map +1 -0
  82. package/dist/terminal/fancy-term-host.d.cts +76 -0
  83. package/dist/terminal/fancy-term-host.d.ts +76 -0
  84. package/dist/terminal/fancy-term-host.js +92 -0
  85. package/dist/terminal/fancy-term-host.js.map +1 -0
  86. package/dist/types-B-Syk9-M.d.cts +620 -0
  87. package/dist/types-B-Syk9-M.d.ts +620 -0
  88. package/dist/{types-D71SKA5A.d.cts → types-C2ATTmjN.d.cts} +1 -1
  89. package/dist/{types-Ckhz-YwC.d.ts → types-VunLGqrn.d.ts} +1 -1
  90. package/dist/ux.cjs +837 -36
  91. package/dist/ux.cjs.map +1 -1
  92. package/dist/ux.d.cts +2 -2
  93. package/dist/ux.d.ts +2 -2
  94. package/dist/ux.js +2 -2
  95. package/package.json +11 -1
  96. package/dist/capabilities-BYa5p5jw.d.cts +0 -112
  97. package/dist/capabilities-COOXRiNL.d.ts +0 -112
  98. package/dist/chunk-JF6WCRBU.js.map +0 -1
  99. package/dist/chunk-UM4C46AF.js +0 -103
  100. package/dist/chunk-UM4C46AF.js.map +0 -1
  101. package/dist/chunk-USL4FMFU.js +0 -41
  102. package/dist/chunk-USL4FMFU.js.map +0 -1
  103. package/dist/chunk-W5DPKJY4.js.map +0 -1
  104. package/dist/types-JFYjPJAG.d.cts +0 -333
  105. package/dist/types-JFYjPJAG.d.ts +0 -333
package/dist/index.d.cts CHANGED
@@ -3,25 +3,24 @@ import { ReactNode, CSSProperties, ComponentProps, ComponentType } from 'react';
3
3
  import { ReactFlowProps, Edge, BackgroundVariant, Connection, NodeProps, NodeTypes } from '@xyflow/react';
4
4
  import { ConnectionValidatorOptions } from './registry/index.cjs';
5
5
  export { ANY_PORT_TYPE, BUILTIN_KINDS, PortCompatibility, RegistryNode, RichInputAdapter, RichInputPreview, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerBuiltinKinds, registerRichInputAdapter, resolveNodePorts, resolvePortSpec } from './registry/index.cjs';
6
- import { a as FlowNode, F as FlowGraph, g as NodeRunStatus, E as ExecutorRegistry } from './types-JFYjPJAG.cjs';
7
- export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, d as FlowEdge, e as FlowNodeData, f as FlowNodeKind, N as NodeExecutor, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, R as RunEvent, S as SubgraphNodeData, T as TriggerNodeData } from './types-JFYjPJAG.cjs';
8
- import { N as NodeKindDefinition, C as ConfigField, a as NodeCategory } from './types-D71SKA5A.cjs';
9
- export { A as AvailableVariable, D as DocumentConfigField, E as EmitsRelation, t as ExpressionForm, u as ExpressionGrammarHelp, K as KeyValueConfigField, O as OutputField, h as OutputShape, P as PortSpec, R as RenderBodyContext, n as RepeaterConfigField, o as RepeaterRowField, w as availableVariables, x as baseVariables, y as describeExpressionGrammar, z as outputFieldsFor } from './types-D71SKA5A.cjs';
10
- import { C as ConfigFieldRenderFn, H as HumanFieldRenderers } from './HumanPrompt-Bpp3JiVH.cjs';
11
- export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './HumanPrompt-Bpp3JiVH.cjs';
6
+ import { a as FlowNode, F as FlowGraph, h as NodeRunStatus, E as ExecutorRegistry } from './types-B-Syk9-M.cjs';
7
+ export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, e as FlowEdge, f as FlowNodeData, g as FlowNodeKind, N as NodeExecutor, i as NoteNodeData, O as OutputNodeData, P as PortDescriptor, R as RunEvent, S as SubgraphNodeData, j as TriggerNodeData } from './types-B-Syk9-M.cjs';
8
+ import { a as NodeCategory, N as NodeKindDefinition, C as ConfigField } from './types-C2ATTmjN.cjs';
9
+ export { A as AvailableVariable, D as DocumentConfigField, E as EmitsRelation, t as ExpressionForm, u as ExpressionGrammarHelp, K as KeyValueConfigField, O as OutputField, h as OutputShape, P as PortSpec, R as RenderBodyContext, n as RepeaterConfigField, o as RepeaterRowField, w as availableVariables, x as baseVariables, y as describeExpressionGrammar, z as outputFieldsFor } from './types-C2ATTmjN.cjs';
10
+ import { C as ConfigFieldRenderFn, H as HumanFieldRenderers } from './HumanPrompt--pXDOyYC.cjs';
11
+ export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './HumanPrompt--pXDOyYC.cjs';
12
12
  import { WorkflowSchema, WorkflowMetadata } from './schema/index.cjs';
13
13
  export { ImportIssue, ImportOptions, ImportResult, WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, WorkflowSchemaEdge, WorkflowSchemaNode, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './schema/index.cjs';
14
14
  import { AutoLayoutOptions } from './layout/index.cjs';
15
15
  export { AutoLayoutDirection } from './layout/index.cjs';
16
- export { F as FlowNodeStatus, a as FlowViewer, b as FlowViewerClassNames, c as FlowViewerProps } from './FlowViewer-DABx-6A-.cjs';
16
+ export { F as FlowNodeStatus, a as FlowViewer, b as FlowViewerClassNames, c as FlowViewerProps } from './FlowViewer-CoAJ3o52.cjs';
17
17
  import { FlowRunFeedEntry } from './runtime/index.cjs';
18
18
  export { HistoryController, UseFlowHistoryReturn, UseFlowRunOptions, UseFlowRunReturn, UseFlowStateReturn, applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './runtime/index.cjs';
19
- export { R as RunOptions, a as RunResult, r as runFlow } from './run-flow-2XsHBwpd.cjs';
20
- export { C as CohortGuard, a as CohortOptions, b as CohortPolicy, c as CohortResult, r as runCohort } from './run-cohort-CBRAUj-z.cjs';
19
+ export { R as RunOptions, a as RunResult, r as runFlow } from './run-flow-B_8hgO5_.cjs';
20
+ export { C as CohortGuard, a as CohortOptions, b as CohortPolicy, c as CohortResult, r as runCohort } from './run-cohort-DL9JzzPU.cjs';
21
21
  export { E as EvaluateOptions, a as ExprContext, b as ExprValue, R as Resolution, U as UnresolvedPathError, c as UnresolvedPolicy, e as evaluateConfig, d as evaluateExpression, r as resolvePath, t as text, f as truthy, g as tryResolvePath } from './expr-BfXDrs4H.cjs';
22
22
  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';
23
- export { N as NodeKindPresentation, c as categoryAccent, b as clearNodeKindOverrides, d as defaultConfigFor, e as ensureBuiltinKinds, g as getNodeKind, l as listNodeKinds, o as onNodeKindsChanged, f as overrideNodeKind, r as registerNodeKind, v as validateConfig } from './registry-CntAdUcY.cjs';
24
- import './capabilities-BYa5p5jw.cjs';
23
+ export { N as NodeKindPresentation, c as categoryAccent, b as clearNodeKindOverrides, d as defaultConfigFor, e as ensureBuiltinKinds, g as getNodeKind, l as listNodeKinds, o as onNodeKindsChanged, f as overrideNodeKind, r as registerNodeKind, v as validateConfig } from './registry-BcgllSk2.cjs';
25
24
 
26
25
  type FlowCanvasProps = Omit<ReactFlowProps<FlowNode, Edge>, "nodes" | "edges" | "height"> & {
27
26
  nodes: FlowNode[];
@@ -72,6 +71,54 @@ type FlowCanvasProps = Omit<ReactFlowProps<FlowNode, Edge>, "nodes" | "edges" |
72
71
  */
73
72
  declare function FlowCanvas({ nodes, edges, background, showControls, showMinimap, height, validateConnections, isValidConnection, colorMode, showHelperLines, zoomOnWheel, onNodesChange, toolbar, nodeTypes, edgeTypes, className, style, ...rest }: FlowCanvasProps): react.JSX.Element;
74
73
 
74
+ type NodePaletteProps = {
75
+ /** Filter to only these categories. */
76
+ categories?: NodeCategory[];
77
+ /**
78
+ * Presentation-only visibility policy for KINDS. Returning `false` omits the
79
+ * row, leaving the registered kind and its runtime behaviour untouched — the
80
+ * same contract `fieldFilter` has on `NodeConfigPanel`, one level up.
81
+ *
82
+ * `categories` cannot express this. A host that supports a subset of the
83
+ * vocabulary is the normal case, not an exotic one: a runtime with no way to
84
+ * RESUME a paused run has to keep `human_approval` / `user_input` /
85
+ * `rich_user_input` out of the palette, and those three sit in a category
86
+ * alongside nothing else it wants to hide.
87
+ *
88
+ * Without it the only lever was `overrideNodeKind` to re-categorise the
89
+ * host's OWN nodes until a category filter happened to exclude ours — which
90
+ * distorts the host's taxonomy to work around a gap in ours. A consumer
91
+ * reported doing exactly that analysis and filing instead (#14).
92
+ *
93
+ * Deliberately a predicate over the full definition rather than a list of
94
+ * ids: it has to serve custom kinds a host registered and kinds vendored in
95
+ * from the marketplace, whose names the palette cannot know in advance.
96
+ */
97
+ kindFilter?: (context: {
98
+ kind: NodeKindDefinition;
99
+ }) => boolean;
100
+ /** Called when the user clicks a kind (in addition to drag). Optional. */
101
+ onPick?: (kind: NodeKindDefinition) => void;
102
+ className?: string;
103
+ style?: CSSProperties;
104
+ };
105
+ /**
106
+ * NodePalette — sidebar listing every registered node kind, grouped by
107
+ * category. Drag a kind onto a `<FlowCanvas>` to add a new node — set
108
+ * `onDrop` on the canvas to handle the drop with the kind name from the
109
+ * `application/x-fancy-flow-kind` data type.
110
+ */
111
+ declare function NodePalette({ categories, kindFilter, onPick, className, style }: NodePaletteProps): react.JSX.Element;
112
+ /**
113
+ * useDropFromPalette — wires the canvas drop target. Returns the drop /
114
+ * dragOver handlers; they parse the dragged kind name and call `onDrop`
115
+ * with `(kindName, position)` in viewport coords.
116
+ */
117
+ declare function paletteDropHandlers(onDrop: (kindName: string, evt: React.DragEvent) => void): {
118
+ onDragOver: (e: React.DragEvent) => void;
119
+ onDrop: (e: React.DragEvent) => void;
120
+ };
121
+
75
122
  type NodeConfigPanelProps = {
76
123
  /** Currently-selected node — pass null to render the empty state. */
77
124
  node: FlowNode | null;
@@ -365,6 +412,13 @@ type FlowEditorProps = {
365
412
  fieldRenderers?: ComponentProps<typeof NodeConfigPanel>["fieldRenderers"];
366
413
  /** Presentation-only config-field filter, forwarded to `NodeConfigPanel`. */
367
414
  fieldFilter?: ComponentProps<typeof NodeConfigPanel>["fieldFilter"];
415
+ /**
416
+ * Presentation-only KIND filter, forwarded to the default `NodePalette`.
417
+ * Lets a host offer a subset of the registered vocabulary without
418
+ * re-categorising anything (#14). Ignored when `slots.palette` replaces
419
+ * the palette, since that host is rendering its own.
420
+ */
421
+ kindFilter?: ComponentProps<typeof NodePalette>["kindFilter"];
368
422
  /** Show run feed below the canvas. Default true. */
369
423
  showFeed?: boolean;
370
424
  /** Total editor height. Default 720. */
@@ -414,31 +468,6 @@ type FlowEditorProps = {
414
468
  */
415
469
  declare const FlowEditor: react.ForwardRefExoticComponent<FlowEditorProps & react.RefAttributes<FlowEditorApi>>;
416
470
 
417
- type NodePaletteProps = {
418
- /** Filter to only these categories. */
419
- categories?: NodeCategory[];
420
- /** Called when the user clicks a kind (in addition to drag). Optional. */
421
- onPick?: (kind: NodeKindDefinition) => void;
422
- className?: string;
423
- style?: CSSProperties;
424
- };
425
- /**
426
- * NodePalette — sidebar listing every registered node kind, grouped by
427
- * category. Drag a kind onto a `<FlowCanvas>` to add a new node — set
428
- * `onDrop` on the canvas to handle the drop with the kind name from the
429
- * `application/x-fancy-flow-kind` data type.
430
- */
431
- declare function NodePalette({ categories, onPick, className, style }: NodePaletteProps): react.JSX.Element;
432
- /**
433
- * useDropFromPalette — wires the canvas drop target. Returns the drop /
434
- * dragOver handlers; they parse the dragged kind name and call `onDrop`
435
- * with `(kindName, position)` in viewport coords.
436
- */
437
- declare function paletteDropHandlers(onDrop: (kindName: string, evt: React.DragEvent) => void): {
438
- onDragOver: (e: React.DragEvent) => void;
439
- onDrop: (e: React.DragEvent) => void;
440
- };
441
-
442
471
  /** Entry-point node — outputs only, no inputs. */
443
472
  declare function TriggerNodeInner(props: NodeProps<FlowNode>): react.JSX.Element;
444
473
  declare const TriggerNode: react.MemoExoticComponent<typeof TriggerNodeInner>;
package/dist/index.d.ts CHANGED
@@ -3,25 +3,24 @@ import { ReactNode, CSSProperties, ComponentProps, ComponentType } from 'react';
3
3
  import { ReactFlowProps, Edge, BackgroundVariant, Connection, NodeProps, NodeTypes } from '@xyflow/react';
4
4
  import { ConnectionValidatorOptions } from './registry/index.js';
5
5
  export { ANY_PORT_TYPE, BUILTIN_KINDS, PortCompatibility, RegistryNode, RichInputAdapter, RichInputPreview, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerBuiltinKinds, registerRichInputAdapter, resolveNodePorts, resolvePortSpec } from './registry/index.js';
6
- import { a as FlowNode, F as FlowGraph, g as NodeRunStatus, E as ExecutorRegistry } from './types-JFYjPJAG.js';
7
- export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, d as FlowEdge, e as FlowNodeData, f as FlowNodeKind, N as NodeExecutor, h as NoteNodeData, O as OutputNodeData, P as PortDescriptor, R as RunEvent, S as SubgraphNodeData, T as TriggerNodeData } from './types-JFYjPJAG.js';
8
- import { N as NodeKindDefinition, C as ConfigField, a as NodeCategory } from './types-Ckhz-YwC.js';
9
- export { A as AvailableVariable, D as DocumentConfigField, E as EmitsRelation, t as ExpressionForm, u as ExpressionGrammarHelp, K as KeyValueConfigField, O as OutputField, h as OutputShape, P as PortSpec, R as RenderBodyContext, n as RepeaterConfigField, o as RepeaterRowField, w as availableVariables, x as baseVariables, y as describeExpressionGrammar, z as outputFieldsFor } from './types-Ckhz-YwC.js';
10
- import { C as ConfigFieldRenderFn, H as HumanFieldRenderers } from './HumanPrompt-BKThiyjB.js';
11
- export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './HumanPrompt-BKThiyjB.js';
6
+ import { a as FlowNode, F as FlowGraph, h as NodeRunStatus, E as ExecutorRegistry } from './types-B-Syk9-M.js';
7
+ export { A as ActionNodeData, B as BaseNodeData, D as DecisionNodeData, e as FlowEdge, f as FlowNodeData, g as FlowNodeKind, N as NodeExecutor, i as NoteNodeData, O as OutputNodeData, P as PortDescriptor, R as RunEvent, S as SubgraphNodeData, j as TriggerNodeData } from './types-B-Syk9-M.js';
8
+ import { a as NodeCategory, N as NodeKindDefinition, C as ConfigField } from './types-VunLGqrn.js';
9
+ export { A as AvailableVariable, D as DocumentConfigField, E as EmitsRelation, t as ExpressionForm, u as ExpressionGrammarHelp, K as KeyValueConfigField, O as OutputField, h as OutputShape, P as PortSpec, R as RenderBodyContext, n as RepeaterConfigField, o as RepeaterRowField, w as availableVariables, x as baseVariables, y as describeExpressionGrammar, z as outputFieldsFor } from './types-VunLGqrn.js';
10
+ import { C as ConfigFieldRenderFn, H as HumanFieldRenderers } from './HumanPrompt-DXm_FP9z.js';
11
+ export { a as ConfigFieldRenderContext, b as ConfigFieldRenderer, c as ConfigFieldRendererProps } from './HumanPrompt-DXm_FP9z.js';
12
12
  import { WorkflowSchema, WorkflowMetadata } from './schema/index.js';
13
13
  export { ImportIssue, ImportOptions, ImportResult, WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, WorkflowSchemaEdge, WorkflowSchemaNode, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './schema/index.js';
14
14
  import { AutoLayoutOptions } from './layout/index.js';
15
15
  export { AutoLayoutDirection } from './layout/index.js';
16
- export { F as FlowNodeStatus, a as FlowViewer, b as FlowViewerClassNames, c as FlowViewerProps } from './FlowViewer-BI_AyyvU.js';
16
+ export { F as FlowNodeStatus, a as FlowViewer, b as FlowViewerClassNames, c as FlowViewerProps } from './FlowViewer-BCc_BvuD.js';
17
17
  import { FlowRunFeedEntry } from './runtime/index.js';
18
18
  export { HistoryController, UseFlowHistoryReturn, UseFlowRunOptions, UseFlowRunReturn, UseFlowStateReturn, applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './runtime/index.js';
19
- export { R as RunOptions, a as RunResult, r as runFlow } from './run-flow-D7AOCcfE.js';
20
- export { C as CohortGuard, a as CohortOptions, b as CohortPolicy, c as CohortResult, r as runCohort } from './run-cohort-C1nRh_mi.js';
19
+ export { R as RunOptions, a as RunResult, r as runFlow } from './run-flow-CxEGBOxd.js';
20
+ export { C as CohortGuard, a as CohortOptions, b as CohortPolicy, c as CohortResult, r as runCohort } from './run-cohort-CjUBWg6X.js';
21
21
  export { E as EvaluateOptions, a as ExprContext, b as ExprValue, R as Resolution, U as UnresolvedPathError, c as UnresolvedPolicy, e as evaluateConfig, d as evaluateExpression, r as resolvePath, t as text, f as truthy, g as tryResolvePath } from './expr-BfXDrs4H.js';
22
22
  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';
23
- export { N as NodeKindPresentation, c as categoryAccent, b as clearNodeKindOverrides, d as defaultConfigFor, e as ensureBuiltinKinds, g as getNodeKind, l as listNodeKinds, o as onNodeKindsChanged, f as overrideNodeKind, r as registerNodeKind, v as validateConfig } from './registry-DYoV-MQi.js';
24
- import './capabilities-COOXRiNL.js';
23
+ export { N as NodeKindPresentation, c as categoryAccent, b as clearNodeKindOverrides, d as defaultConfigFor, e as ensureBuiltinKinds, g as getNodeKind, l as listNodeKinds, o as onNodeKindsChanged, f as overrideNodeKind, r as registerNodeKind, v as validateConfig } from './registry-h-2QswZ5.js';
25
24
 
26
25
  type FlowCanvasProps = Omit<ReactFlowProps<FlowNode, Edge>, "nodes" | "edges" | "height"> & {
27
26
  nodes: FlowNode[];
@@ -72,6 +71,54 @@ type FlowCanvasProps = Omit<ReactFlowProps<FlowNode, Edge>, "nodes" | "edges" |
72
71
  */
73
72
  declare function FlowCanvas({ nodes, edges, background, showControls, showMinimap, height, validateConnections, isValidConnection, colorMode, showHelperLines, zoomOnWheel, onNodesChange, toolbar, nodeTypes, edgeTypes, className, style, ...rest }: FlowCanvasProps): react.JSX.Element;
74
73
 
74
+ type NodePaletteProps = {
75
+ /** Filter to only these categories. */
76
+ categories?: NodeCategory[];
77
+ /**
78
+ * Presentation-only visibility policy for KINDS. Returning `false` omits the
79
+ * row, leaving the registered kind and its runtime behaviour untouched — the
80
+ * same contract `fieldFilter` has on `NodeConfigPanel`, one level up.
81
+ *
82
+ * `categories` cannot express this. A host that supports a subset of the
83
+ * vocabulary is the normal case, not an exotic one: a runtime with no way to
84
+ * RESUME a paused run has to keep `human_approval` / `user_input` /
85
+ * `rich_user_input` out of the palette, and those three sit in a category
86
+ * alongside nothing else it wants to hide.
87
+ *
88
+ * Without it the only lever was `overrideNodeKind` to re-categorise the
89
+ * host's OWN nodes until a category filter happened to exclude ours — which
90
+ * distorts the host's taxonomy to work around a gap in ours. A consumer
91
+ * reported doing exactly that analysis and filing instead (#14).
92
+ *
93
+ * Deliberately a predicate over the full definition rather than a list of
94
+ * ids: it has to serve custom kinds a host registered and kinds vendored in
95
+ * from the marketplace, whose names the palette cannot know in advance.
96
+ */
97
+ kindFilter?: (context: {
98
+ kind: NodeKindDefinition;
99
+ }) => boolean;
100
+ /** Called when the user clicks a kind (in addition to drag). Optional. */
101
+ onPick?: (kind: NodeKindDefinition) => void;
102
+ className?: string;
103
+ style?: CSSProperties;
104
+ };
105
+ /**
106
+ * NodePalette — sidebar listing every registered node kind, grouped by
107
+ * category. Drag a kind onto a `<FlowCanvas>` to add a new node — set
108
+ * `onDrop` on the canvas to handle the drop with the kind name from the
109
+ * `application/x-fancy-flow-kind` data type.
110
+ */
111
+ declare function NodePalette({ categories, kindFilter, onPick, className, style }: NodePaletteProps): react.JSX.Element;
112
+ /**
113
+ * useDropFromPalette — wires the canvas drop target. Returns the drop /
114
+ * dragOver handlers; they parse the dragged kind name and call `onDrop`
115
+ * with `(kindName, position)` in viewport coords.
116
+ */
117
+ declare function paletteDropHandlers(onDrop: (kindName: string, evt: React.DragEvent) => void): {
118
+ onDragOver: (e: React.DragEvent) => void;
119
+ onDrop: (e: React.DragEvent) => void;
120
+ };
121
+
75
122
  type NodeConfigPanelProps = {
76
123
  /** Currently-selected node — pass null to render the empty state. */
77
124
  node: FlowNode | null;
@@ -365,6 +412,13 @@ type FlowEditorProps = {
365
412
  fieldRenderers?: ComponentProps<typeof NodeConfigPanel>["fieldRenderers"];
366
413
  /** Presentation-only config-field filter, forwarded to `NodeConfigPanel`. */
367
414
  fieldFilter?: ComponentProps<typeof NodeConfigPanel>["fieldFilter"];
415
+ /**
416
+ * Presentation-only KIND filter, forwarded to the default `NodePalette`.
417
+ * Lets a host offer a subset of the registered vocabulary without
418
+ * re-categorising anything (#14). Ignored when `slots.palette` replaces
419
+ * the palette, since that host is rendering its own.
420
+ */
421
+ kindFilter?: ComponentProps<typeof NodePalette>["kindFilter"];
368
422
  /** Show run feed below the canvas. Default true. */
369
423
  showFeed?: boolean;
370
424
  /** Total editor height. Default 720. */
@@ -414,31 +468,6 @@ type FlowEditorProps = {
414
468
  */
415
469
  declare const FlowEditor: react.ForwardRefExoticComponent<FlowEditorProps & react.RefAttributes<FlowEditorApi>>;
416
470
 
417
- type NodePaletteProps = {
418
- /** Filter to only these categories. */
419
- categories?: NodeCategory[];
420
- /** Called when the user clicks a kind (in addition to drag). Optional. */
421
- onPick?: (kind: NodeKindDefinition) => void;
422
- className?: string;
423
- style?: CSSProperties;
424
- };
425
- /**
426
- * NodePalette — sidebar listing every registered node kind, grouped by
427
- * category. Drag a kind onto a `<FlowCanvas>` to add a new node — set
428
- * `onDrop` on the canvas to handle the drop with the kind name from the
429
- * `application/x-fancy-flow-kind` data type.
430
- */
431
- declare function NodePalette({ categories, onPick, className, style }: NodePaletteProps): react.JSX.Element;
432
- /**
433
- * useDropFromPalette — wires the canvas drop target. Returns the drop /
434
- * dragOver handlers; they parse the dragged kind name and call `onDrop`
435
- * with `(kindName, position)` in viewport coords.
436
- */
437
- declare function paletteDropHandlers(onDrop: (kindName: string, evt: React.DragEvent) => void): {
438
- onDragOver: (e: React.DragEvent) => void;
439
- onDrop: (e: React.DragEvent) => void;
440
- };
441
-
442
471
  /** Entry-point node — outputs only, no inputs. */
443
472
  declare function TriggerNodeInner(props: NodeProps<FlowNode>): react.JSX.Element;
444
473
  declare const TriggerNode: react.MemoExoticComponent<typeof TriggerNodeInner>;
package/dist/index.js CHANGED
@@ -1,20 +1,19 @@
1
- import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-EO6444T2.js';
2
- export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-EO6444T2.js';
3
- import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-MBVX4ZRB.js';
4
- export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-MBVX4ZRB.js';
5
- export { runCohort } from './chunk-RIAFHQT5.js';
6
- export { UnresolvedPathError, evaluateConfig, evaluateExpression, resolvePath, text, truthy, tryResolvePath } from './chunk-UM4C46AF.js';
7
- import { buildNodeTypes } from './chunk-5H54OTKT.js';
8
- export { ANY_PORT_TYPE, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility } from './chunk-5H54OTKT.js';
1
+ import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-UCCTXJXL.js';
2
+ export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-UCCTXJXL.js';
3
+ import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-FNYLKSFJ.js';
4
+ export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-FNYLKSFJ.js';
5
+ export { runCohort } from './chunk-PNHZHEWE.js';
6
+ import { buildNodeTypes } from './chunk-IEYCNFXZ.js';
7
+ export { ANY_PORT_TYPE, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility } from './chunk-IEYCNFXZ.js';
9
8
  export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
10
- import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-W5DPKJY4.js';
11
- export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-W5DPKJY4.js';
12
- import './chunk-77V4QC6Y.js';
13
- import { ReactFlowProvider, useReactFlow, humanInputFields, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, FlowEditorProvider, addEdge, applyEdgeChanges, applyNodeChanges, Position, ensureBuiltinKinds, validateConfig, categoryAccent, Handle } from './chunk-JF6WCRBU.js';
14
- export { BUILTIN_KINDS, LaneNode, NoteNode, categoryAccent, clearNodeKindOverrides, defaultConfigFor, ensureBuiltinKinds, getNodeKind, listNodeKinds, onNodeKindsChanged, overrideNodeKind, registerBuiltinKinds, registerNodeKind, resolveNodePorts, resolvePortSpec, runFlow, useFlowEditor, useFlowEditorOptional, validateConfig } from './chunk-JF6WCRBU.js';
9
+ import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-MTONBM53.js';
10
+ export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-MTONBM53.js';
11
+ import './chunk-B7HKJJVV.js';
12
+ import { ReactFlowProvider, useReactFlow, humanInputFields, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, FlowEditorProvider, addEdge, applyEdgeChanges, applyNodeChanges, Position, ensureBuiltinKinds, validateConfig, categoryAccent, Handle } from './chunk-HQGOFGAL.js';
13
+ export { BUILTIN_KINDS, LaneNode, NoteNode, UnresolvedPathError, categoryAccent, clearNodeKindOverrides, defaultConfigFor, ensureBuiltinKinds, evaluateConfig, evaluateExpression, getNodeKind, listNodeKinds, onNodeKindsChanged, overrideNodeKind, registerBuiltinKinds, registerNodeKind, resolveNodePorts, resolvePath, resolvePortSpec, runFlow, text, truthy, tryResolvePath, useFlowEditor, useFlowEditorOptional, validateConfig } from './chunk-HQGOFGAL.js';
15
14
  import { getRichInputAdapter } from './chunk-F5RPRB7A.js';
16
15
  export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
17
- import './chunk-USL4FMFU.js';
16
+ import './chunk-2QXKDLGT.js';
18
17
  import { forwardRef, useState, useMemo, useEffect, useCallback, useRef, useImperativeHandle, useId, memo } from 'react';
19
18
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
20
19
 
@@ -31,7 +30,7 @@ var CATEGORY_LABELS = {
31
30
  annotation: "Notes",
32
31
  custom: "Custom"
33
32
  };
34
- function NodePalette({ categories, onPick, className, style }) {
33
+ function NodePalette({ categories, kindFilter, onPick, className, style }) {
35
34
  const [, setRev] = useState(0);
36
35
  useEffect(() => onNodeKindsChanged(() => setRev((n) => n + 1)), []);
37
36
  const [query, setQuery] = useState("");
@@ -39,7 +38,8 @@ function NodePalette({ categories, onPick, className, style }) {
39
38
  const grouped = useMemo(() => {
40
39
  const all = listNodeKinds();
41
40
  const q = query.trim().toLowerCase();
42
- const filtered = q ? all.filter((k) => k.name.includes(q) || k.label.toLowerCase().includes(q) || (k.description ?? "").toLowerCase().includes(q)) : all;
41
+ const allowed = kindFilter ? all.filter((k) => kindFilter({ kind: k })) : all;
42
+ const filtered = q ? allowed.filter((k) => k.name.includes(q) || k.label.toLowerCase().includes(q) || (k.description ?? "").toLowerCase().includes(q)) : allowed;
43
43
  const map = /* @__PURE__ */ new Map();
44
44
  for (const cat of visibleCats) map.set(cat, []);
45
45
  for (const k of filtered) {
@@ -47,7 +47,7 @@ function NodePalette({ categories, onPick, className, style }) {
47
47
  map.get(k.category).push(k);
48
48
  }
49
49
  return map;
50
- }, [query, visibleCats]);
50
+ }, [query, visibleCats, kindFilter]);
51
51
  return /* @__PURE__ */ jsxs("aside", { className: ["ff-palette", className ?? ""].filter(Boolean).join(" "), style, children: [
52
52
  /* @__PURE__ */ jsx("div", { className: "ff-palette__search", children: /* @__PURE__ */ jsx(
53
53
  "input",
@@ -1176,6 +1176,7 @@ function FlowEditorInner({
1176
1176
  showPanel = true,
1177
1177
  fieldRenderers,
1178
1178
  fieldFilter,
1179
+ kindFilter,
1179
1180
  showFeed = true,
1180
1181
  extraToolbar,
1181
1182
  actions = [],
@@ -1603,7 +1604,7 @@ function FlowEditorInner({
1603
1604
  ] })
1604
1605
  ] });
1605
1606
  return /* @__PURE__ */ jsxs(FlowEditorProvider, { value: api, children: [
1606
- showPalette && (slots.palette ? slots.palette(api) : /* @__PURE__ */ jsx(NodePalette, { className: "ff-editor__palette" })),
1607
+ showPalette && (slots.palette ? slots.palette(api) : /* @__PURE__ */ jsx(NodePalette, { className: "ff-editor__palette", kindFilter })),
1607
1608
  /* @__PURE__ */ jsxs("div", { className: "ff-editor__main", ...dropHandlers, children: [
1608
1609
  /* @__PURE__ */ jsx(
1609
1610
  FlowCanvas,