@particle-academy/fancy-flow 0.34.0 → 0.36.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 (64) hide show
  1. package/dist/{capabilities-BLOeLACV.d.cts → capabilities-BtJQTbnw.d.cts} +1 -1
  2. package/dist/{capabilities-BH7zmSQQ.d.ts → capabilities-CkhKj_U_.d.ts} +1 -1
  3. package/dist/{chunk-N5ICD2WZ.js → chunk-3BKU4SQZ.js} +3 -3
  4. package/dist/{chunk-N5ICD2WZ.js.map → chunk-3BKU4SQZ.js.map} +1 -1
  5. package/dist/{chunk-EBE3FEAJ.js → chunk-A6RFLGWV.js} +4 -4
  6. package/dist/{chunk-EBE3FEAJ.js.map → chunk-A6RFLGWV.js.map} +1 -1
  7. package/dist/{chunk-Q6IPK64P.js → chunk-PVROYW7C.js} +32 -5
  8. package/dist/chunk-PVROYW7C.js.map +1 -0
  9. package/dist/{chunk-FKOXQP76.js → chunk-QZTGV3ZL.js} +3 -3
  10. package/dist/{chunk-FKOXQP76.js.map → chunk-QZTGV3ZL.js.map} +1 -1
  11. package/dist/{chunk-THU5LW22.js → chunk-UX65ML3J.js} +4 -4
  12. package/dist/{chunk-THU5LW22.js.map → chunk-UX65ML3J.js.map} +1 -1
  13. package/dist/{chunk-RE7T5GKQ.js → chunk-VLATLVGH.js} +3 -3
  14. package/dist/{chunk-RE7T5GKQ.js.map → chunk-VLATLVGH.js.map} +1 -1
  15. package/dist/engine.cjs +10 -2
  16. package/dist/engine.cjs.map +1 -1
  17. package/dist/engine.d.cts +7 -238
  18. package/dist/engine.d.ts +7 -238
  19. package/dist/engine.js +5 -5
  20. package/dist/index.cjs +163 -4
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +65 -8
  23. package/dist/index.d.ts +65 -8
  24. package/dist/index.js +142 -13
  25. package/dist/index.js.map +1 -1
  26. package/dist/layout/index.d.cts +1 -1
  27. package/dist/layout/index.d.ts +1 -1
  28. package/dist/llm/prism.d.cts +2 -2
  29. package/dist/llm/prism.d.ts +2 -2
  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 +6 -6
  33. package/dist/registry/index.d.ts +6 -6
  34. package/dist/registry-BADFn97n.d.cts +85 -0
  35. package/dist/registry-DYbFLEcW.d.ts +85 -0
  36. package/dist/registry.cjs +31 -2
  37. package/dist/registry.cjs.map +1 -1
  38. package/dist/registry.js +3 -3
  39. package/dist/{run-cohort-DitsaYgS.d.cts → run-cohort-Bjv2ZU6g.d.cts} +1 -1
  40. package/dist/{run-cohort-CV7EcwGG.d.ts → run-cohort-BnP6ErHi.d.ts} +1 -1
  41. package/dist/runtime/index.d.cts +3 -3
  42. package/dist/runtime/index.d.ts +3 -3
  43. package/dist/runtime.cjs +7 -1
  44. package/dist/runtime.cjs.map +1 -1
  45. package/dist/runtime.js +4 -4
  46. package/dist/schema/index.d.cts +1 -1
  47. package/dist/schema/index.d.ts +1 -1
  48. package/dist/schema.cjs +7 -1
  49. package/dist/schema.cjs.map +1 -1
  50. package/dist/schema.js +2 -2
  51. package/dist/styles.css +103 -0
  52. package/dist/styles.css.map +1 -1
  53. package/dist/{types-DEmDSByY.d.cts → types-D6lsIGoe.d.ts} +251 -2
  54. package/dist/{types-Bj_ZHwqG.d.ts → types-D8Dezh9v.d.cts} +251 -2
  55. package/dist/{types-CMSrWVYM.d.cts → types-sOmpCitB.d.cts} +1 -1
  56. package/dist/{types-CMSrWVYM.d.ts → types-sOmpCitB.d.ts} +1 -1
  57. package/dist/ux.cjs.map +1 -1
  58. package/dist/ux.d.cts +2 -2
  59. package/dist/ux.d.ts +2 -2
  60. package/dist/ux.js +1 -1
  61. package/package.json +181 -181
  62. package/dist/chunk-Q6IPK64P.js.map +0 -1
  63. package/dist/registry-Dd1Q66uP.d.ts +0 -45
  64. package/dist/registry-qv4gRiuQ.d.cts +0 -45
@@ -1,4 +1,4 @@
1
- import { F as FlowGraph, a as FlowNode } from '../types-CMSrWVYM.cjs';
1
+ import { F as FlowGraph, b as FlowNode } from '../types-sOmpCitB.cjs';
2
2
  import '@xyflow/react';
3
3
 
4
4
  type AutoLayoutDirection = "LR" | "TB" | "RL" | "BT";
@@ -1,4 +1,4 @@
1
- import { F as FlowGraph, a as FlowNode } from '../types-CMSrWVYM.js';
1
+ import { F as FlowGraph, b as FlowNode } from '../types-sOmpCitB.js';
2
2
  import '@xyflow/react';
3
3
 
4
4
  type AutoLayoutDirection = "LR" | "TB" | "RL" | "BT";
@@ -1,5 +1,5 @@
1
- import { L as LlmClient } from '../capabilities-BLOeLACV.cjs';
2
- import '../types-CMSrWVYM.cjs';
1
+ import { L as LlmClient } from '../capabilities-BtJQTbnw.cjs';
2
+ import '../types-sOmpCitB.cjs';
3
3
  import '@xyflow/react';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { L as LlmClient } from '../capabilities-BH7zmSQQ.js';
2
- import '../types-CMSrWVYM.js';
1
+ import { L as LlmClient } from '../capabilities-CkhKj_U_.js';
2
+ import '../types-sOmpCitB.js';
3
3
  import '@xyflow/react';
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { LanguageModel } from 'ai';
2
- import { a as LlmRouteRequest, L as LlmClient } from '../capabilities-BLOeLACV.cjs';
3
- import '../types-CMSrWVYM.cjs';
2
+ import { a as LlmRouteRequest, L as LlmClient } from '../capabilities-BtJQTbnw.cjs';
3
+ import '../types-sOmpCitB.cjs';
4
4
  import '@xyflow/react';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
1
  import { LanguageModel } from 'ai';
2
- import { a as LlmRouteRequest, L as LlmClient } from '../capabilities-BH7zmSQQ.js';
3
- import '../types-CMSrWVYM.js';
2
+ import { a as LlmRouteRequest, L as LlmClient } from '../capabilities-CkhKj_U_.js';
3
+ import '../types-sOmpCitB.js';
4
4
  import '@xyflow/react';
5
5
 
6
6
  /**
@@ -1,12 +1,12 @@
1
- import { N as NodeKindDefinition, d as PortSpec } from '../types-DEmDSByY.cjs';
2
- export { C as ConfigField, g as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, L as LEGACY_PAUSE_PREFIXES, a as NodeCategory, h as NumberConfigField, b as PAUSE_PREFIX, P as PauseAwaiting, c as PauseSignal, R as RenderBodyContext, j as RepeaterConfigField, k as RepeaterRowField, S as SelectConfigField, l as SwitchConfigField, T as TextConfigField, m as TextareaConfigField, e as decodePause, f as encodePause, i as isPause, p as pauseForHuman } from '../types-DEmDSByY.cjs';
3
- import { P as PortDescriptor, a as FlowNode, N as NodeExecutor } from '../types-CMSrWVYM.cjs';
1
+ import { d as NodeKindDefinition, j as PortSpec } from '../types-D8Dezh9v.cjs';
2
+ export { a as ConfigField, q as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, L as LEGACY_PAUSE_PREFIXES, c as NodeCategory, r as NumberConfigField, h as PAUSE_PREFIX, P as PauseAwaiting, i as PauseSignal, R as RenderBodyContext, t as RepeaterConfigField, u as RepeaterRowField, w as SelectConfigField, x as SwitchConfigField, T as TextConfigField, y as TextareaConfigField, m as decodePause, n as encodePause, o as isPause, p as pauseForHuman } from '../types-D8Dezh9v.cjs';
3
+ import { P as PortDescriptor, b as FlowNode, N as NodeExecutor } from '../types-sOmpCitB.cjs';
4
4
  import { Connection, Edge, NodeProps, NodeTypes } from '@xyflow/react';
5
- import { b as LlmRoute } from '../capabilities-BLOeLACV.cjs';
6
- export { C as CapabilityId, L as LlmClient, c as LlmRouteChoice, a 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-BLOeLACV.cjs';
5
+ import { b as LlmRoute } from '../capabilities-BtJQTbnw.cjs';
6
+ export { C as CapabilityId, L as LlmClient, c as LlmRouteChoice, a 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-BtJQTbnw.cjs';
7
7
  import * as react from 'react';
8
8
  import { ComponentType, ReactNode } from 'react';
9
- export { c as categoryAccent, d as defaultConfigFor, g as getNodeKind, k as kindIds, l as listNodeKinds, o as onNodeKindsChanged, r as registerNodeKind, a as resolveKindId, v as validateConfig } from '../registry-qv4gRiuQ.cjs';
9
+ export { N as NodeKindPresentation, c as categoryAccent, b as clearNodeKindOverrides, d as defaultConfigFor, g as getNodeKind, k as kindIds, l as listNodeKinds, o as onNodeKindsChanged, e as overrideNodeKind, r as registerNodeKind, a as resolveKindId, v as validateConfig } from '../registry-BADFn97n.cjs';
10
10
 
11
11
  /**
12
12
  * Connection validation — the single rule that decides whether an edge between
@@ -1,12 +1,12 @@
1
- import { N as NodeKindDefinition, d as PortSpec } from '../types-Bj_ZHwqG.js';
2
- export { C as ConfigField, g as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, L as LEGACY_PAUSE_PREFIXES, a as NodeCategory, h as NumberConfigField, b as PAUSE_PREFIX, P as PauseAwaiting, c as PauseSignal, R as RenderBodyContext, j as RepeaterConfigField, k as RepeaterRowField, S as SelectConfigField, l as SwitchConfigField, T as TextConfigField, m as TextareaConfigField, e as decodePause, f as encodePause, i as isPause, p as pauseForHuman } from '../types-Bj_ZHwqG.js';
3
- import { P as PortDescriptor, a as FlowNode, N as NodeExecutor } from '../types-CMSrWVYM.js';
1
+ import { d as NodeKindDefinition, j as PortSpec } from '../types-D6lsIGoe.js';
2
+ export { a as ConfigField, q as CredentialConfigField, D as DocumentConfigField, E as ExpressionConfigField, J as JsonConfigField, K as KeyValueConfigField, L as LEGACY_PAUSE_PREFIXES, c as NodeCategory, r as NumberConfigField, h as PAUSE_PREFIX, P as PauseAwaiting, i as PauseSignal, R as RenderBodyContext, t as RepeaterConfigField, u as RepeaterRowField, w as SelectConfigField, x as SwitchConfigField, T as TextConfigField, y as TextareaConfigField, m as decodePause, n as encodePause, o as isPause, p as pauseForHuman } from '../types-D6lsIGoe.js';
3
+ import { P as PortDescriptor, b as FlowNode, N as NodeExecutor } from '../types-sOmpCitB.js';
4
4
  import { Connection, Edge, NodeProps, NodeTypes } from '@xyflow/react';
5
- import { b as LlmRoute } from '../capabilities-BH7zmSQQ.js';
6
- export { C as CapabilityId, L as LlmClient, c as LlmRouteChoice, a 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-BH7zmSQQ.js';
5
+ import { b as LlmRoute } from '../capabilities-CkhKj_U_.js';
6
+ export { C as CapabilityId, L as LlmClient, c as LlmRouteChoice, a 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-CkhKj_U_.js';
7
7
  import * as react from 'react';
8
8
  import { ComponentType, ReactNode } from 'react';
9
- export { c as categoryAccent, d as defaultConfigFor, g as getNodeKind, k as kindIds, l as listNodeKinds, o as onNodeKindsChanged, r as registerNodeKind, a as resolveKindId, v as validateConfig } from '../registry-Dd1Q66uP.js';
9
+ export { N as NodeKindPresentation, c as categoryAccent, b as clearNodeKindOverrides, d as defaultConfigFor, g as getNodeKind, k as kindIds, l as listNodeKinds, o as onNodeKindsChanged, e as overrideNodeKind, r as registerNodeKind, a as resolveKindId, v as validateConfig } from '../registry-DYbFLEcW.js';
10
10
 
11
11
  /**
12
12
  * Connection validation — the single rule that decides whether an edge between
@@ -0,0 +1,85 @@
1
+ import { d as NodeKindDefinition } from './types-D8Dezh9v.cjs';
2
+
3
+ /**
4
+ * The presentation fields a consumer may override on someone else's node kind.
5
+ *
6
+ * Deliberately excludes everything behavioural — `executor`, `inputs`,
7
+ * `outputs`, `configSchema`, `sideEffects`. An "override" that could change
8
+ * those is not an override, it is a fork wearing a friendly name, and it would
9
+ * desync the graph from the runtime that executes it.
10
+ *
11
+ * `category` IS included: which drawer a node appears in is presentation, and a
12
+ * consumer regrouping their palette is the same kind of act as renaming.
13
+ */
14
+ type NodeKindPresentation = Partial<Pick<NodeKindDefinition, "label" | "description" | "icon" | "accent" | "category">>;
15
+ /**
16
+ * registerNodeKind — install a node kind in the global registry. Returns
17
+ * an `unregister` function. Calling with the same name replaces the prior
18
+ * registration (handy for HMR).
19
+ *
20
+ * A kind's `name` is its CANONICAL id and is what gets written into saved
21
+ * documents. Publish namespaced (`@fancy/llm_branch`, `@acme/salesforce_upsert`)
22
+ * and list any previous bare names in `aliases`, so graphs saved before the
23
+ * rename keep resolving.
24
+ */
25
+ declare function registerNodeKind<TC = any, TI = any, TO = any>(definition: NodeKindDefinition<TC, TI, TO>): () => void;
26
+ /**
27
+ * Resolve any id — canonical or alias — to the canonical one, or null.
28
+ *
29
+ * `kind` is persisted inside every saved graph, so a bare name that two
30
+ * packages could both claim is unfixable after the fact: the ambiguous string
31
+ * is already in the document. Canonical ids are namespaced; aliases exist so
32
+ * documents written before namespacing keep opening.
33
+ */
34
+ declare function resolveKindId(id: string): string | null;
35
+ /**
36
+ * Rename or re-describe a kind you did not author.
37
+ *
38
+ * Before this existed the only way to relabel a builtin was `registerNodeKind`
39
+ * with a full definition — which REPLACES the kind, so a consumer wanting
40
+ * "Call an API" instead of "HTTP Request" had to re-declare that node's
41
+ * configSchema, ports, executor and renderer, and silently forfeited whatever
42
+ * the builtin gained in the next release. In practice nobody renamed a node,
43
+ * and the palette could not be localised at all.
44
+ *
45
+ * ```ts
46
+ * const undo = overrideNodeKind("@particle-academy/http_request", {
47
+ * label: "Call an API",
48
+ * description: "Fetch or post JSON to a URL",
49
+ * });
50
+ * ```
51
+ *
52
+ * Applies at `getNodeKind()` and `listNodeKinds()`, so one call reaches the
53
+ * palette, the node cards on the canvas, `FlowViewer`, and anything else that
54
+ * reads the registry. Returns an unsubscribe, matching `registerNodeKind`.
55
+ *
56
+ * Patching an unregistered id is allowed and takes effect if that kind is
57
+ * registered later — order of module side effects is not something a consumer
58
+ * should have to reason about.
59
+ */
60
+ declare function overrideNodeKind(name: string, patch: NodeKindPresentation): () => void;
61
+ /** Remove every presentation override. Mostly for tests. */
62
+ declare function clearNodeKindOverrides(): void;
63
+ /** Get a single kind by canonical id or alias, or null. */
64
+ declare function getNodeKind(name: string): NodeKindDefinition | null;
65
+ /** Every id a kind answers to — canonical first. Used to key node-type maps. */
66
+ declare function kindIds(kind: NodeKindDefinition): string[];
67
+ /** List every registered kind, optionally filtered by category. */
68
+ declare function listNodeKinds(category?: string): NodeKindDefinition[];
69
+ /** Subscribe to registry changes. Returns an unsubscribe function. */
70
+ declare function onNodeKindsChanged(listener: () => void): () => void;
71
+ /** Fill in defaults from a kind's configSchema for newly-created nodes. */
72
+ declare function defaultConfigFor(kind: NodeKindDefinition): Record<string, unknown>;
73
+ /**
74
+ * Validate a config object against a kind's schema. Returns an array of
75
+ * issues (empty = valid). Validation is intentionally light — type
76
+ * coercion + required-field checks. Hosts can layer Zod / Ajv on top.
77
+ */
78
+ declare function validateConfig(kind: NodeKindDefinition, config: Record<string, unknown>): Array<{
79
+ key: string;
80
+ message: string;
81
+ }>;
82
+ /** Default accents per category. */
83
+ declare function categoryAccent(category: string): string;
84
+
85
+ export { type NodeKindPresentation as N, resolveKindId as a, clearNodeKindOverrides as b, categoryAccent as c, defaultConfigFor as d, overrideNodeKind as e, getNodeKind as g, kindIds as k, listNodeKinds as l, onNodeKindsChanged as o, registerNodeKind as r, validateConfig as v };
@@ -0,0 +1,85 @@
1
+ import { d as NodeKindDefinition } from './types-D6lsIGoe.js';
2
+
3
+ /**
4
+ * The presentation fields a consumer may override on someone else's node kind.
5
+ *
6
+ * Deliberately excludes everything behavioural — `executor`, `inputs`,
7
+ * `outputs`, `configSchema`, `sideEffects`. An "override" that could change
8
+ * those is not an override, it is a fork wearing a friendly name, and it would
9
+ * desync the graph from the runtime that executes it.
10
+ *
11
+ * `category` IS included: which drawer a node appears in is presentation, and a
12
+ * consumer regrouping their palette is the same kind of act as renaming.
13
+ */
14
+ type NodeKindPresentation = Partial<Pick<NodeKindDefinition, "label" | "description" | "icon" | "accent" | "category">>;
15
+ /**
16
+ * registerNodeKind — install a node kind in the global registry. Returns
17
+ * an `unregister` function. Calling with the same name replaces the prior
18
+ * registration (handy for HMR).
19
+ *
20
+ * A kind's `name` is its CANONICAL id and is what gets written into saved
21
+ * documents. Publish namespaced (`@fancy/llm_branch`, `@acme/salesforce_upsert`)
22
+ * and list any previous bare names in `aliases`, so graphs saved before the
23
+ * rename keep resolving.
24
+ */
25
+ declare function registerNodeKind<TC = any, TI = any, TO = any>(definition: NodeKindDefinition<TC, TI, TO>): () => void;
26
+ /**
27
+ * Resolve any id — canonical or alias — to the canonical one, or null.
28
+ *
29
+ * `kind` is persisted inside every saved graph, so a bare name that two
30
+ * packages could both claim is unfixable after the fact: the ambiguous string
31
+ * is already in the document. Canonical ids are namespaced; aliases exist so
32
+ * documents written before namespacing keep opening.
33
+ */
34
+ declare function resolveKindId(id: string): string | null;
35
+ /**
36
+ * Rename or re-describe a kind you did not author.
37
+ *
38
+ * Before this existed the only way to relabel a builtin was `registerNodeKind`
39
+ * with a full definition — which REPLACES the kind, so a consumer wanting
40
+ * "Call an API" instead of "HTTP Request" had to re-declare that node's
41
+ * configSchema, ports, executor and renderer, and silently forfeited whatever
42
+ * the builtin gained in the next release. In practice nobody renamed a node,
43
+ * and the palette could not be localised at all.
44
+ *
45
+ * ```ts
46
+ * const undo = overrideNodeKind("@particle-academy/http_request", {
47
+ * label: "Call an API",
48
+ * description: "Fetch or post JSON to a URL",
49
+ * });
50
+ * ```
51
+ *
52
+ * Applies at `getNodeKind()` and `listNodeKinds()`, so one call reaches the
53
+ * palette, the node cards on the canvas, `FlowViewer`, and anything else that
54
+ * reads the registry. Returns an unsubscribe, matching `registerNodeKind`.
55
+ *
56
+ * Patching an unregistered id is allowed and takes effect if that kind is
57
+ * registered later — order of module side effects is not something a consumer
58
+ * should have to reason about.
59
+ */
60
+ declare function overrideNodeKind(name: string, patch: NodeKindPresentation): () => void;
61
+ /** Remove every presentation override. Mostly for tests. */
62
+ declare function clearNodeKindOverrides(): void;
63
+ /** Get a single kind by canonical id or alias, or null. */
64
+ declare function getNodeKind(name: string): NodeKindDefinition | null;
65
+ /** Every id a kind answers to — canonical first. Used to key node-type maps. */
66
+ declare function kindIds(kind: NodeKindDefinition): string[];
67
+ /** List every registered kind, optionally filtered by category. */
68
+ declare function listNodeKinds(category?: string): NodeKindDefinition[];
69
+ /** Subscribe to registry changes. Returns an unsubscribe function. */
70
+ declare function onNodeKindsChanged(listener: () => void): () => void;
71
+ /** Fill in defaults from a kind's configSchema for newly-created nodes. */
72
+ declare function defaultConfigFor(kind: NodeKindDefinition): Record<string, unknown>;
73
+ /**
74
+ * Validate a config object against a kind's schema. Returns an array of
75
+ * issues (empty = valid). Validation is intentionally light — type
76
+ * coercion + required-field checks. Hosts can layer Zod / Ajv on top.
77
+ */
78
+ declare function validateConfig(kind: NodeKindDefinition, config: Record<string, unknown>): Array<{
79
+ key: string;
80
+ message: string;
81
+ }>;
82
+ /** Default accents per category. */
83
+ declare function categoryAccent(category: string): string;
84
+
85
+ export { type NodeKindPresentation as N, resolveKindId as a, clearNodeKindOverrides as b, categoryAccent as c, defaultConfigFor as d, overrideNodeKind as e, getNodeKind as g, kindIds as k, listNodeKinds as l, onNodeKindsChanged as o, registerNodeKind as r, validateConfig as v };
package/dist/registry.cjs CHANGED
@@ -35,6 +35,7 @@ function resolveNodePorts(node, kind) {
35
35
  var kinds = /* @__PURE__ */ new Map();
36
36
  var aliases = /* @__PURE__ */ new Map();
37
37
  var listeners = /* @__PURE__ */ new Set();
38
+ var overrides = /* @__PURE__ */ new Map();
38
39
  function registerNodeKind(definition) {
39
40
  kinds.set(definition.name, definition);
40
41
  for (const alias of definition.aliases ?? []) aliases.set(alias, definition.name);
@@ -54,15 +55,41 @@ function resolveKindId(id2) {
54
55
  const canonical = aliases.get(id2);
55
56
  return canonical && kinds.has(canonical) ? canonical : null;
56
57
  }
58
+ function overrideNodeKind(name, patch) {
59
+ const canonical = resolveKindId(name) ?? name;
60
+ const previous = overrides.get(canonical);
61
+ overrides.set(canonical, { ...previous, ...patch });
62
+ notify();
63
+ return () => {
64
+ if (previous) {
65
+ overrides.set(canonical, previous);
66
+ } else {
67
+ overrides.delete(canonical);
68
+ }
69
+ notify();
70
+ };
71
+ }
72
+ function clearNodeKindOverrides() {
73
+ if (overrides.size === 0) return;
74
+ overrides.clear();
75
+ notify();
76
+ }
77
+ function withOverride(kind) {
78
+ if (!kind) return null;
79
+ const patch = overrides.get(kind.name);
80
+ return patch ? { ...kind, ...patch } : kind;
81
+ }
57
82
  function getNodeKind(name) {
58
83
  const canonical = resolveKindId(name);
59
- return canonical ? kinds.get(canonical) ?? null : null;
84
+ return canonical ? withOverride(kinds.get(canonical)) : null;
60
85
  }
61
86
  function kindIds(kind) {
62
87
  return [kind.name, ...kind.aliases ?? []];
63
88
  }
64
89
  function listNodeKinds(category) {
65
- const all = Array.from(kinds.values());
90
+ const all = Array.from(kinds.values()).map(
91
+ (k) => withOverride(k)
92
+ );
66
93
  return category ? all.filter((k) => k.category === category) : all;
67
94
  }
68
95
  function onNodeKindsChanged(listener) {
@@ -10681,6 +10708,7 @@ exports.RichInputPreview = RichInputPreview;
10681
10708
  exports.buildNodeTypes = buildNodeTypes;
10682
10709
  exports.capabilityStatus = capabilityStatus;
10683
10710
  exports.categoryAccent = categoryAccent;
10711
+ exports.clearNodeKindOverrides = clearNodeKindOverrides;
10684
10712
  exports.createConnectionValidator = createConnectionValidator;
10685
10713
  exports.declaredRoutes = declaredRoutes;
10686
10714
  exports.decodePause = decodePause;
@@ -10701,6 +10729,7 @@ exports.llmRouterExecutor = llmRouterExecutor;
10701
10729
  exports.nodeConfig = nodeConfig;
10702
10730
  exports.onNodeKindsChanged = onNodeKindsChanged;
10703
10731
  exports.onRichInputAdapterChanged = onRichInputAdapterChanged;
10732
+ exports.overrideNodeKind = overrideNodeKind;
10704
10733
  exports.pauseForHuman = pauseForHuman;
10705
10734
  exports.registerBuiltinKinds = registerBuiltinKinds;
10706
10735
  exports.registerLlmClient = registerLlmClient;