@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/ux.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { EffectRegistry, DispatchActor } from '@particle-academy/fancy-auto-common';
2
2
  export { AutoActivityEvent } from '@particle-academy/fancy-auto-common';
3
- import { a as NodeCategory, C as ConfigField } from './types-D71SKA5A.cjs';
4
- import { E as ExecutorRegistry } from './types-JFYjPJAG.cjs';
3
+ import { a as NodeCategory, C as ConfigField } from './types-C2ATTmjN.cjs';
4
+ import { E as ExecutorRegistry } from './types-B-Syk9-M.cjs';
5
5
  import 'react';
6
6
  import '@xyflow/react';
7
7
  import './pause-9iT4tCEV.cjs';
package/dist/ux.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { EffectRegistry, DispatchActor } from '@particle-academy/fancy-auto-common';
2
2
  export { AutoActivityEvent } from '@particle-academy/fancy-auto-common';
3
- import { a as NodeCategory, C as ConfigField } from './types-Ckhz-YwC.js';
4
- import { E as ExecutorRegistry } from './types-JFYjPJAG.js';
3
+ import { a as NodeCategory, C as ConfigField } from './types-VunLGqrn.js';
4
+ import { E as ExecutorRegistry } from './types-B-Syk9-M.js';
5
5
  import 'react';
6
6
  import '@xyflow/react';
7
7
  import './pause-9iT4tCEV.js';
package/dist/ux.js CHANGED
@@ -1,6 +1,6 @@
1
- import { registerNodeKind } from './chunk-JF6WCRBU.js';
1
+ import { registerNodeKind } from './chunk-HQGOFGAL.js';
2
2
  import './chunk-F5RPRB7A.js';
3
- import './chunk-USL4FMFU.js';
3
+ import './chunk-2QXKDLGT.js';
4
4
  import { useMemo } from 'react';
5
5
  import { createEffectDispatcher } from '@particle-academy/fancy-auto-common';
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-academy/fancy-flow",
3
- "version": "0.65.2",
3
+ "version": "0.66.0",
4
4
  "description": "Workflow editor + runner. Six built-in node kits (trigger / action / decision / output / note / subgraph), tokenized theme, topological execution with per-node status. React-flow bundled; consumers npm install fancy-flow and get nothing extra.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -134,6 +134,16 @@
134
134
  "default": "./dist/llm/prism.cjs"
135
135
  }
136
136
  },
137
+ "./terminal/fancy-term-host": {
138
+ "import": {
139
+ "types": "./dist/terminal/fancy-term-host.d.ts",
140
+ "default": "./dist/terminal/fancy-term-host.js"
141
+ },
142
+ "require": {
143
+ "types": "./dist/terminal/fancy-term-host.d.cts",
144
+ "default": "./dist/terminal/fancy-term-host.cjs"
145
+ }
146
+ },
137
147
  "./fields/react-fancy": {
138
148
  "import": {
139
149
  "types": "./dist/fields/react-fancy.d.ts",
@@ -1,112 +0,0 @@
1
- import { F as FlowGraph } from './types-JFYjPJAG.cjs';
2
-
3
- /**
4
- * Host capabilities — the services core nodes need but must never depend on.
5
- *
6
- * A node that imports a provider SDK forces every consumer to install it: a
7
- * workflow app that never calls a model should not inherit an LLM dependency.
8
- * So core declares the CONTRACT and the host supplies the implementation, the
9
- * same arrangement `renderDocumentField` already uses for documents.
10
- *
11
- * That keeps opinionated nodes in core without their opinions: `llm_branch`
12
- * ships the routing semantics, port derivation and config UI, while whichever
13
- * client the host registers — Prism, an OpenAI SDK, a local model, a fake in a
14
- * test — decides how the question actually gets asked.
15
- *
16
- * Registration is deliberately explicit and typed per capability rather than a
17
- * stringly-keyed bag, so a missing one is a clear error at the seam instead of
18
- * an undefined somewhere downstream.
19
- */
20
- type LlmRoute = {
21
- port: string;
22
- description?: string;
23
- };
24
- type LlmRouteRequest = {
25
- /** Optional framing for the decision. */
26
- system?: string;
27
- /** What the model is deciding about. */
28
- prompt: string;
29
- /** The ports it must choose between. */
30
- routes: LlmRoute[];
31
- provider?: string;
32
- model?: string;
33
- /** Host-resolved credential reference, never a raw key. */
34
- credential?: string;
35
- };
36
- type LlmRouteChoice = {
37
- /** Must be one of the requested route ports. */
38
- port: string;
39
- /** Why — carried down the chosen port so a run is explainable afterwards. */
40
- reason?: string;
41
- };
42
- /**
43
- * The only thing core asks of an LLM: given routes, pick one.
44
- *
45
- * Deliberately not a general chat interface. A narrow contract is one a host
46
- * can satisfy in a few lines over any SDK, and it keeps the choice
47
- * machine-checkable — an implementation should constrain the model to the
48
- * declared ports (structured output / enum) rather than parsing prose.
49
- */
50
- type LlmClient = {
51
- chooseRoute: (request: LlmRouteRequest) => Promise<LlmRouteChoice> | LlmRouteChoice;
52
- };
53
- /** Install the host's LLM client. Returns an unregister function. */
54
- declare function registerLlmClient(client: LlmClient): () => void;
55
- declare function getLlmClient(): LlmClient | null;
56
- /**
57
- * Why a workflow reference could not be resolved.
58
- *
59
- * `missing` and `version-mismatch` are deliberately distinct. Collapsing them
60
- * into a bare null makes "no such workflow" indistinguishable from "that
61
- * workflow exists, but it is not the one you pinned" — and the second wants an
62
- * error naming both versions, because it is the interesting failure.
63
- */
64
- type WorkflowResolutionFailure = {
65
- reason: "missing" | "version-mismatch";
66
- /** The version the host actually holds, when it holds one. */
67
- available?: number;
68
- message?: string;
69
- };
70
- type WorkflowResolution = FlowGraph | WorkflowResolutionFailure | null;
71
- /**
72
- * Resolve a workflow reference to a runnable graph.
73
- *
74
- * `subflow` names another workflow rather than embedding it, so the host owns
75
- * where workflows live — a database, a file, an API.
76
- *
77
- * ## Why `version` is here
78
- *
79
- * A workflow another workflow depends on is an INTERFACE, and interfaces need
80
- * pins. Without a version, a parent goes on calling `invoice-triage`, someone
81
- * edits that child, and the parent now runs different logic having reported
82
- * success the whole time — correct-looking, no error, wrong behaviour. The same
83
- * failure family as the 0.9.0 routing divergence.
84
- *
85
- * The parameter lives on the resolver rather than being encoded into the ref
86
- * string (`invoice-triage@3`) because a stringly-typed protocol is one every
87
- * host invents differently — the "three vocabularies for one node" problem.
88
- *
89
- * Raised by the MOIC Suite consumer, whose `workflow_ref` pins versions and
90
- * fails loudly on mismatch. Their point: a host COULD NOT implement pinning
91
- * before this, because the node had no way to ask and the resolver no way to
92
- * receive.
93
- *
94
- * Returning `null` still means "no such workflow". Return a
95
- * {@link WorkflowResolutionFailure} to distinguish a version mismatch.
96
- */
97
- type WorkflowResolver = (ref: string, version?: number) => Promise<WorkflowResolution> | WorkflowResolution;
98
- /** Narrow a resolver's return value to an explicit failure. */
99
- declare function isResolutionFailure(value: WorkflowResolution): value is WorkflowResolutionFailure;
100
- /** Install the host's workflow resolver. Returns an unregister function. */
101
- declare function registerWorkflowResolver(resolver: WorkflowResolver): () => void;
102
- declare function getWorkflowResolver(): WorkflowResolver | null;
103
- type CapabilityId = "llm" | "workflow_resolver" | "document";
104
- /**
105
- * Which capabilities are currently satisfied.
106
- *
107
- * Exists so a host (or the CLI, or an agent over MCP) can answer "what does
108
- * this graph need that I haven't wired?" BEFORE a run fails halfway through.
109
- */
110
- declare function capabilityStatus(): Record<CapabilityId, boolean>;
111
-
112
- export { type CapabilityId as C, type LlmClient as L, type WorkflowResolver as W, type LlmRouteRequest as a, type LlmRoute as b, type LlmRouteChoice as c, type WorkflowResolution as d, type WorkflowResolutionFailure as e, capabilityStatus as f, getLlmClient as g, getWorkflowResolver as h, isResolutionFailure as i, registerWorkflowResolver as j, registerLlmClient as r };
@@ -1,112 +0,0 @@
1
- import { F as FlowGraph } from './types-JFYjPJAG.js';
2
-
3
- /**
4
- * Host capabilities — the services core nodes need but must never depend on.
5
- *
6
- * A node that imports a provider SDK forces every consumer to install it: a
7
- * workflow app that never calls a model should not inherit an LLM dependency.
8
- * So core declares the CONTRACT and the host supplies the implementation, the
9
- * same arrangement `renderDocumentField` already uses for documents.
10
- *
11
- * That keeps opinionated nodes in core without their opinions: `llm_branch`
12
- * ships the routing semantics, port derivation and config UI, while whichever
13
- * client the host registers — Prism, an OpenAI SDK, a local model, a fake in a
14
- * test — decides how the question actually gets asked.
15
- *
16
- * Registration is deliberately explicit and typed per capability rather than a
17
- * stringly-keyed bag, so a missing one is a clear error at the seam instead of
18
- * an undefined somewhere downstream.
19
- */
20
- type LlmRoute = {
21
- port: string;
22
- description?: string;
23
- };
24
- type LlmRouteRequest = {
25
- /** Optional framing for the decision. */
26
- system?: string;
27
- /** What the model is deciding about. */
28
- prompt: string;
29
- /** The ports it must choose between. */
30
- routes: LlmRoute[];
31
- provider?: string;
32
- model?: string;
33
- /** Host-resolved credential reference, never a raw key. */
34
- credential?: string;
35
- };
36
- type LlmRouteChoice = {
37
- /** Must be one of the requested route ports. */
38
- port: string;
39
- /** Why — carried down the chosen port so a run is explainable afterwards. */
40
- reason?: string;
41
- };
42
- /**
43
- * The only thing core asks of an LLM: given routes, pick one.
44
- *
45
- * Deliberately not a general chat interface. A narrow contract is one a host
46
- * can satisfy in a few lines over any SDK, and it keeps the choice
47
- * machine-checkable — an implementation should constrain the model to the
48
- * declared ports (structured output / enum) rather than parsing prose.
49
- */
50
- type LlmClient = {
51
- chooseRoute: (request: LlmRouteRequest) => Promise<LlmRouteChoice> | LlmRouteChoice;
52
- };
53
- /** Install the host's LLM client. Returns an unregister function. */
54
- declare function registerLlmClient(client: LlmClient): () => void;
55
- declare function getLlmClient(): LlmClient | null;
56
- /**
57
- * Why a workflow reference could not be resolved.
58
- *
59
- * `missing` and `version-mismatch` are deliberately distinct. Collapsing them
60
- * into a bare null makes "no such workflow" indistinguishable from "that
61
- * workflow exists, but it is not the one you pinned" — and the second wants an
62
- * error naming both versions, because it is the interesting failure.
63
- */
64
- type WorkflowResolutionFailure = {
65
- reason: "missing" | "version-mismatch";
66
- /** The version the host actually holds, when it holds one. */
67
- available?: number;
68
- message?: string;
69
- };
70
- type WorkflowResolution = FlowGraph | WorkflowResolutionFailure | null;
71
- /**
72
- * Resolve a workflow reference to a runnable graph.
73
- *
74
- * `subflow` names another workflow rather than embedding it, so the host owns
75
- * where workflows live — a database, a file, an API.
76
- *
77
- * ## Why `version` is here
78
- *
79
- * A workflow another workflow depends on is an INTERFACE, and interfaces need
80
- * pins. Without a version, a parent goes on calling `invoice-triage`, someone
81
- * edits that child, and the parent now runs different logic having reported
82
- * success the whole time — correct-looking, no error, wrong behaviour. The same
83
- * failure family as the 0.9.0 routing divergence.
84
- *
85
- * The parameter lives on the resolver rather than being encoded into the ref
86
- * string (`invoice-triage@3`) because a stringly-typed protocol is one every
87
- * host invents differently — the "three vocabularies for one node" problem.
88
- *
89
- * Raised by the MOIC Suite consumer, whose `workflow_ref` pins versions and
90
- * fails loudly on mismatch. Their point: a host COULD NOT implement pinning
91
- * before this, because the node had no way to ask and the resolver no way to
92
- * receive.
93
- *
94
- * Returning `null` still means "no such workflow". Return a
95
- * {@link WorkflowResolutionFailure} to distinguish a version mismatch.
96
- */
97
- type WorkflowResolver = (ref: string, version?: number) => Promise<WorkflowResolution> | WorkflowResolution;
98
- /** Narrow a resolver's return value to an explicit failure. */
99
- declare function isResolutionFailure(value: WorkflowResolution): value is WorkflowResolutionFailure;
100
- /** Install the host's workflow resolver. Returns an unregister function. */
101
- declare function registerWorkflowResolver(resolver: WorkflowResolver): () => void;
102
- declare function getWorkflowResolver(): WorkflowResolver | null;
103
- type CapabilityId = "llm" | "workflow_resolver" | "document";
104
- /**
105
- * Which capabilities are currently satisfied.
106
- *
107
- * Exists so a host (or the CLI, or an agent over MCP) can answer "what does
108
- * this graph need that I haven't wired?" BEFORE a run fails halfway through.
109
- */
110
- declare function capabilityStatus(): Record<CapabilityId, boolean>;
111
-
112
- export { type CapabilityId as C, type LlmClient as L, type WorkflowResolver as W, type LlmRouteRequest as a, type LlmRoute as b, type LlmRouteChoice as c, type WorkflowResolution as d, type WorkflowResolutionFailure as e, capabilityStatus as f, getLlmClient as g, getWorkflowResolver as h, isResolutionFailure as i, registerWorkflowResolver as j, registerLlmClient as r };