@particle-academy/fancy-flow 0.65.2 → 0.66.1

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 (112) 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-27RZJAE2.js +2586 -0
  7. package/dist/chunk-27RZJAE2.js.map +1 -0
  8. package/dist/{chunk-MBVX4ZRB.js → chunk-2QTEELJE.js} +4 -3
  9. package/dist/chunk-2QTEELJE.js.map +1 -0
  10. package/dist/chunk-2QXKDLGT.js +58 -0
  11. package/dist/chunk-2QXKDLGT.js.map +1 -0
  12. package/dist/{chunk-W5DPKJY4.js → chunk-6AYC3BWI.js} +4 -4
  13. package/dist/chunk-6AYC3BWI.js.map +1 -0
  14. package/dist/{chunk-5H54OTKT.js → chunk-6TH646CS.js} +127 -5
  15. package/dist/chunk-6TH646CS.js.map +1 -0
  16. package/dist/{chunk-EO6444T2.js → chunk-BUNFPBTF.js} +5 -4
  17. package/dist/chunk-BUNFPBTF.js.map +1 -0
  18. package/dist/{chunk-77V4QC6Y.js → chunk-FV3D366L.js} +3 -3
  19. package/dist/{chunk-77V4QC6Y.js.map → chunk-FV3D366L.js.map} +1 -1
  20. package/dist/{chunk-JF6WCRBU.js → chunk-OWENS2H5.js} +36 -1905
  21. package/dist/chunk-OWENS2H5.js.map +1 -0
  22. package/dist/{chunk-RIAFHQT5.js → chunk-RE3XNVSB.js} +3 -3
  23. package/dist/{chunk-RIAFHQT5.js.map → chunk-RE3XNVSB.js.map} +1 -1
  24. package/dist/connectors.d.cts +2 -2
  25. package/dist/connectors.d.ts +2 -2
  26. package/dist/durable/index.d.cts +2 -2
  27. package/dist/durable/index.d.ts +2 -2
  28. package/dist/durable.cjs +865 -9135
  29. package/dist/durable.cjs.map +1 -1
  30. package/dist/durable.js +2 -4
  31. package/dist/durable.js.map +1 -1
  32. package/dist/engine.cjs +927 -9278
  33. package/dist/engine.cjs.map +1 -1
  34. package/dist/engine.d.cts +6 -7
  35. package/dist/engine.d.ts +6 -7
  36. package/dist/engine.js +5 -7
  37. package/dist/engine.js.map +1 -1
  38. package/dist/fields/react-fancy.d.cts +3 -3
  39. package/dist/fields/react-fancy.d.ts +3 -3
  40. package/dist/index.cjs +11009 -10282
  41. package/dist/index.cjs.map +1 -1
  42. package/dist/index.d.cts +65 -36
  43. package/dist/index.d.ts +65 -36
  44. package/dist/index.js +22 -19
  45. package/dist/index.js.map +1 -1
  46. package/dist/layout/index.d.cts +1 -1
  47. package/dist/layout/index.d.ts +1 -1
  48. package/dist/llm/prism.cjs.map +1 -1
  49. package/dist/llm/prism.d.cts +1 -2
  50. package/dist/llm/prism.d.ts +1 -2
  51. package/dist/llm/prism.js +1 -1
  52. package/dist/llm/vercel-ai.cjs.map +1 -1
  53. package/dist/llm/vercel-ai.d.cts +1 -2
  54. package/dist/llm/vercel-ai.d.ts +1 -2
  55. package/dist/llm/vercel-ai.js +1 -1
  56. package/dist/registry/index.d.cts +20 -9
  57. package/dist/registry/index.d.ts +20 -9
  58. package/dist/{registry-CntAdUcY.d.cts → registry-BcgllSk2.d.cts} +1 -1
  59. package/dist/{registry-DYoV-MQi.d.ts → registry-h-2QswZ5.d.ts} +1 -1
  60. package/dist/registry.cjs +11252 -10409
  61. package/dist/registry.cjs.map +1 -1
  62. package/dist/registry.js +5 -4
  63. package/dist/{run-cohort-C1nRh_mi.d.ts → run-cohort-CjUBWg6X.d.ts} +2 -2
  64. package/dist/{run-cohort-CBRAUj-z.d.cts → run-cohort-DL9JzzPU.d.cts} +2 -2
  65. package/dist/{run-flow-2XsHBwpd.d.cts → run-flow-B_8hgO5_.d.cts} +1 -1
  66. package/dist/{run-flow-D7AOCcfE.d.ts → run-flow-CxEGBOxd.d.ts} +1 -1
  67. package/dist/runtime/index.d.cts +5 -5
  68. package/dist/runtime/index.d.ts +5 -5
  69. package/dist/runtime.cjs +10843 -10194
  70. package/dist/runtime.cjs.map +1 -1
  71. package/dist/runtime.js +5 -5
  72. package/dist/schema/index.d.cts +19 -6
  73. package/dist/schema/index.d.ts +19 -6
  74. package/dist/schema.cjs +881 -9142
  75. package/dist/schema.cjs.map +1 -1
  76. package/dist/schema.js +4 -5
  77. package/dist/screens.cjs +842 -86
  78. package/dist/screens.cjs.map +1 -1
  79. package/dist/screens.d.cts +2 -2
  80. package/dist/screens.d.ts +2 -2
  81. package/dist/screens.js +7 -6
  82. package/dist/screens.js.map +1 -1
  83. package/dist/terminal/fancy-term-host.cjs +99 -0
  84. package/dist/terminal/fancy-term-host.cjs.map +1 -0
  85. package/dist/terminal/fancy-term-host.d.cts +76 -0
  86. package/dist/terminal/fancy-term-host.d.ts +76 -0
  87. package/dist/terminal/fancy-term-host.js +92 -0
  88. package/dist/terminal/fancy-term-host.js.map +1 -0
  89. package/dist/types-B-Syk9-M.d.cts +620 -0
  90. package/dist/types-B-Syk9-M.d.ts +620 -0
  91. package/dist/{types-D71SKA5A.d.cts → types-C2ATTmjN.d.cts} +1 -1
  92. package/dist/{types-Ckhz-YwC.d.ts → types-VunLGqrn.d.ts} +1 -1
  93. package/dist/ux.cjs +885 -9142
  94. package/dist/ux.cjs.map +1 -1
  95. package/dist/ux.d.cts +2 -2
  96. package/dist/ux.d.ts +2 -2
  97. package/dist/ux.js +2 -3
  98. package/dist/ux.js.map +1 -1
  99. package/package.json +11 -1
  100. package/dist/capabilities-BYa5p5jw.d.cts +0 -112
  101. package/dist/capabilities-COOXRiNL.d.ts +0 -112
  102. package/dist/chunk-5H54OTKT.js.map +0 -1
  103. package/dist/chunk-EO6444T2.js.map +0 -1
  104. package/dist/chunk-JF6WCRBU.js.map +0 -1
  105. package/dist/chunk-MBVX4ZRB.js.map +0 -1
  106. package/dist/chunk-UM4C46AF.js +0 -103
  107. package/dist/chunk-UM4C46AF.js.map +0 -1
  108. package/dist/chunk-USL4FMFU.js +0 -41
  109. package/dist/chunk-USL4FMFU.js.map +0 -1
  110. package/dist/chunk-W5DPKJY4.js.map +0 -1
  111. package/dist/types-JFYjPJAG.d.cts +0 -333
  112. 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,20 @@
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';
9
- 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';
1
+ import { removeNodes, removeEdges, cloneSubgraph, alignNodes, distributeNodes, reconnectEdge, assignToLane, removeFromLane, duplicateNode, setEdgeLabel, FlowCanvas } from './chunk-BUNFPBTF.js';
2
+ export { ActionNode, DecisionNode, FlowCanvas, FlowViewer, NodeShell, OutputNode, SubgraphNode, TriggerNode, alignNodes, cloneSubgraph, defaultNodeTypes, distributeNodes, reconnectEdge } from './chunk-BUNFPBTF.js';
3
+ import { useFlowState, useFlowRun, useFlowHistory, applyOutputsToNodes, applyStatusesToNodes } from './chunk-2QTEELJE.js';
4
+ export { applyOutputsToNodes, applyStatusesToNodes, createHistory, useFlowHistory, useFlowRun, useFlowState } from './chunk-2QTEELJE.js';
5
+ export { runCohort } from './chunk-RE3XNVSB.js';
6
+ import { buildNodeTypes, FlowEditorProvider, registerBuiltinKinds } from './chunk-6TH646CS.js';
7
+ export { ANY_PORT_TYPE, BUILTIN_KINDS, LaneNode, NoteNode, RegistryNode, buildNodeTypes, createConnectionValidator, defaultPortCompatibility, registerBuiltinKinds, useFlowEditor, useFlowEditorOptional } from './chunk-6TH646CS.js';
15
8
  import { getRichInputAdapter } from './chunk-F5RPRB7A.js';
16
9
  export { RichInputPreview, getRichInputAdapter, isRichInputEnabled, onRichInputAdapterChanged, registerRichInputAdapter } from './chunk-F5RPRB7A.js';
17
- import './chunk-USL4FMFU.js';
10
+ import { ReactFlowProvider, useReactFlow, addEdge, applyEdgeChanges, applyNodeChanges, Position, Handle } from './chunk-OWENS2H5.js';
11
+ export { LEGACY_PAUSE_PREFIXES, PAUSE_PREFIX, decodePause, encodePause, isPause, pauseForHuman } from './chunk-UEOE6B52.js';
12
+ import { workflowToBlob, importWorkflow, exportWorkflow } from './chunk-6AYC3BWI.js';
13
+ export { WORKFLOW_SCHEMA_URL, WORKFLOW_SCHEMA_VERSION, exportWorkflow, importWorkflow, migrateSchema, workflowToBlob } from './chunk-6AYC3BWI.js';
14
+ import './chunk-FV3D366L.js';
15
+ import { humanInputFields, onNodeKindsChanged, listNodeKinds, getNodeKind, defaultConfigFor, ensureBuiltinKinds, validateConfig, categoryAccent } from './chunk-27RZJAE2.js';
16
+ export { UnresolvedPathError, categoryAccent, clearNodeKindOverrides, defaultConfigFor, ensureBuiltinKinds, evaluateConfig, evaluateExpression, getNodeKind, listNodeKinds, onNodeKindsChanged, overrideNodeKind, registerNodeKind, resolveNodePorts, resolvePath, resolvePortSpec, runFlow, text, truthy, tryResolvePath, validateConfig } from './chunk-27RZJAE2.js';
17
+ import './chunk-2QXKDLGT.js';
18
18
  import { forwardRef, useState, useMemo, useEffect, useCallback, useRef, useImperativeHandle, useId, memo } from 'react';
19
19
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
20
20
 
@@ -31,7 +31,7 @@ var CATEGORY_LABELS = {
31
31
  annotation: "Notes",
32
32
  custom: "Custom"
33
33
  };
34
- function NodePalette({ categories, onPick, className, style }) {
34
+ function NodePalette({ categories, kindFilter, onPick, className, style }) {
35
35
  const [, setRev] = useState(0);
36
36
  useEffect(() => onNodeKindsChanged(() => setRev((n) => n + 1)), []);
37
37
  const [query, setQuery] = useState("");
@@ -39,7 +39,8 @@ function NodePalette({ categories, onPick, className, style }) {
39
39
  const grouped = useMemo(() => {
40
40
  const all = listNodeKinds();
41
41
  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;
42
+ const allowed = kindFilter ? all.filter((k) => kindFilter({ kind: k })) : all;
43
+ const filtered = q ? allowed.filter((k) => k.name.includes(q) || k.label.toLowerCase().includes(q) || (k.description ?? "").toLowerCase().includes(q)) : allowed;
43
44
  const map = /* @__PURE__ */ new Map();
44
45
  for (const cat of visibleCats) map.set(cat, []);
45
46
  for (const k of filtered) {
@@ -47,7 +48,7 @@ function NodePalette({ categories, onPick, className, style }) {
47
48
  map.get(k.category).push(k);
48
49
  }
49
50
  return map;
50
- }, [query, visibleCats]);
51
+ }, [query, visibleCats, kindFilter]);
51
52
  return /* @__PURE__ */ jsxs("aside", { className: ["ff-palette", className ?? ""].filter(Boolean).join(" "), style, children: [
52
53
  /* @__PURE__ */ jsx("div", { className: "ff-palette__search", children: /* @__PURE__ */ jsx(
53
54
  "input",
@@ -1176,6 +1177,7 @@ function FlowEditorInner({
1176
1177
  showPanel = true,
1177
1178
  fieldRenderers,
1178
1179
  fieldFilter,
1180
+ kindFilter,
1179
1181
  showFeed = true,
1180
1182
  extraToolbar,
1181
1183
  actions = [],
@@ -1603,7 +1605,7 @@ function FlowEditorInner({
1603
1605
  ] })
1604
1606
  ] });
1605
1607
  return /* @__PURE__ */ jsxs(FlowEditorProvider, { value: api, children: [
1606
- showPalette && (slots.palette ? slots.palette(api) : /* @__PURE__ */ jsx(NodePalette, { className: "ff-editor__palette" })),
1608
+ showPalette && (slots.palette ? slots.palette(api) : /* @__PURE__ */ jsx(NodePalette, { className: "ff-editor__palette", kindFilter })),
1607
1609
  /* @__PURE__ */ jsxs("div", { className: "ff-editor__main", ...dropHandlers, children: [
1608
1610
  /* @__PURE__ */ jsx(
1609
1611
  FlowCanvas,
@@ -1920,6 +1922,7 @@ var flowKeys = {
1920
1922
 
1921
1923
  // src/index.ts
1922
1924
  ensureBuiltinKinds();
1925
+ registerBuiltinKinds();
1923
1926
 
1924
1927
  export { ConfigFieldRenderer, ExpressionField, FlowEditor, FlowRunControls, FlowRunFeed, NodeConfigPanel, NodePalette, NodePort, availableVariables, baseVariables, defineNode, describeExpressionGrammar, flowKeys, flowLive, outputFieldsFor, paletteDropHandlers };
1925
1928
  //# sourceMappingURL=index.js.map