@fractal-solutions/qflow 2.0.0-canary.4 → 2.0.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.
- package/CHANGELOG.md +119 -107
- package/LICENSE +21 -21
- package/MIGRATION.md +1130 -1130
- package/README.md +10 -10
- package/dist/agent/engine.js +26 -26
- package/dist/agent/strategies.js +5 -5
- package/dist/durable.js +151 -151
- package/dist/mcp/client.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/memory.js +14 -14
- package/package.json +1 -1
- package/scripts/verify-package.js +114 -114
package/CHANGELOG.md
CHANGED
|
@@ -1,107 +1,119 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
## 2.0.0
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- `
|
|
24
|
-
- `
|
|
25
|
-
- `
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
###
|
|
34
|
-
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- `
|
|
53
|
-
-
|
|
54
|
-
- `
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
- `
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
###
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
###
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
-
|
|
102
|
-
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.0.0
|
|
4
|
+
|
|
5
|
+
Stable promotion of `2.0.0-canary.4`. No source changes from the final canary;
|
|
6
|
+
the same package is now published as `latest`.
|
|
7
|
+
|
|
8
|
+
### Changed
|
|
9
|
+
- Version bumped to `2.0.0`; the npm `latest` dist-tag now points here.
|
|
10
|
+
- README and MIGRATION.md describe the stable install path. The `canary` dist-tag still points to `2.0.0-canary.4`.
|
|
11
|
+
- MCP client/server metadata now reports `2.0.0`.
|
|
12
|
+
|
|
13
|
+
See [2.0.0-canary.4](#200-canary4) below for the full feature list.
|
|
14
|
+
|
|
15
|
+
## 2.0.0-canary.4
|
|
16
|
+
|
|
17
|
+
Six production gaps closed. Every item below is additive; no existing import
|
|
18
|
+
changes. See [MIGRATION.md](MIGRATION.md) and the
|
|
19
|
+
[tutorial index](documentation/tutorials/README.md) for step-by-step guides with
|
|
20
|
+
option and error-code tables.
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
- **Durable human approval** (`./approval`): `WaitForApprovalNode` and `resolveApprovalId()`; `DurableFlow` returns `status: 'suspended'` and checkpointer `approve()` / `reject()` record decisions for resumable runs. Events: `approval:requested`, `approval:resolved`, `approval:pending`; error `QFLOW_APPROVAL_PENDING`.
|
|
24
|
+
- **Durable scheduling** (`./schedule`): `ScheduleNode` with `at` / `delayMs` / `cron`, a dependency-free `nextCronTime()`, `listScheduledRuns()` / `setRunDueAt()` and `status: 'scheduled'`. Events: `schedule:waiting`, `schedule:pending`; error `QFLOW_SCHEDULE_PENDING`.
|
|
25
|
+
- **Deterministic LLM replay**: `LLMNode` cache support (`cache`, `cacheKey`, `cacheTtlMs`), checkpointer-backed `cacheGet` / `cacheSet` / `clearCache`, and the `llm:cache_hit` event.
|
|
26
|
+
- **Budget guardrails** (`./budget`): `BudgetTracker`, `BudgetNode` and `BudgetExceededError` (`QFLOW_BUDGET_EXCEEDED`), with `budget:check` / `budget:exceeded` events and `continue` / `exceeded` routing.
|
|
27
|
+
- **Unified memory** (`./memory`): `MemoryStore`, `InMemoryMemoryStore`, `SQLiteMemoryStore` and `MemoryStoreNode` with add/search/get/delete/list/clear operations and `memory:add` / `memory:search` events.
|
|
28
|
+
- **Flow versioning**: `DurableFlow` `version`, `onVersionMismatch` (`abort` / `migrate` / `ignore`) and `migrate` callback; `FlowVersionMismatchError` (`QFLOW_FLOW_VERSION_MISMATCH`) plus `flow:version_migrated`, `flow:version_mismatch` and `flow:node_remapped` events.
|
|
29
|
+
- **Side-effect worker leases**: `workerId` / `leaseMs` on checkpointer, flow and replay-safe nodes; atomic `INSERT OR IGNORE` reservations, `failSideEffect()` and `SideEffectClaimedError` (`QFLOW_SIDE_EFFECT_CLAIMED`).
|
|
30
|
+
- New subpath exports: `./approval`, `./schedule`, `./budget`, `./memory`; durable helpers and errors are re-exported from `/durable`, and all new nodes from `/nodes`.
|
|
31
|
+
- Tutorial index plus five new tutorials: approval, scheduling, LLM replay, budget guardrails and multi-tenant memory.
|
|
32
|
+
|
|
33
|
+
### Changed
|
|
34
|
+
- `runDurable()` now returns `status` (`completed`, `suspended`, `scheduled`) in addition to `{runId, result, shared, steps, resumed}`; ordinary failures still throw.
|
|
35
|
+
- `SQLiteCheckpointer` constructor accepts `{workerId, leaseMs}` and migrates older databases by adding the new columns.
|
|
36
|
+
- `DurableFlow` re-enters a waiting node on resume and reads recorded approval/schedule state from `shared` and SQLite.
|
|
37
|
+
- `ReplaySafeNode` and `withReplaySafeSideEffect()` accept `workerId` / `leaseMs`.
|
|
38
|
+
- Version bumped to `2.0.0-canary.4`.
|
|
39
|
+
|
|
40
|
+
### Fixed
|
|
41
|
+
- An expired or competing side-effect reservation can no longer be reset by another worker's upsert.
|
|
42
|
+
- Stale resume cursors fall back to the saved node class name instead of silently starting over.
|
|
43
|
+
- `MIGRATION.md` expanded into a guided reference; README now maps every production gap to 1-2-3 steps and links to the tutorials.
|
|
44
|
+
|
|
45
|
+
### Tests
|
|
46
|
+
- 18 new tests across `tests/durable_gaps.test.js` and `tests/node_gaps.test.js`; full suite: 92 passing tests across 18 files.
|
|
47
|
+
|
|
48
|
+
## 2.0.0-canary.3
|
|
49
|
+
|
|
50
|
+
### Added
|
|
51
|
+
- Provider-neutral `LLMNode` (`./llm`): adapter registry for OpenAI-compatible providers, Anthropic, Ollama and Gemini, capability negotiation, streaming, tool calls, retries/fallbacks, token/cost accounting and `llm:*` events.
|
|
52
|
+
- `ToolSpec` / `ToolRegistry` (`./tool-spec`): one portable definition for agent tools, MCP tools, LLM schemas and generated docs, with namespaces, capability/permission grants, dry-run, timeouts and idempotency caching.
|
|
53
|
+
- Replay-safe side effects (`./side-effects`): `ReplaySafeNode`, `withReplaySafeSideEffect()` and `SideEffectUncertainError`; SQLite `qflow_side_effects` reservations on `DurableFlow`.
|
|
54
|
+
- Opt-in `operationId` support on `HttpRequestNode`, `GitNode`, `WebHookNode` and `DatabaseNode` so completed effects replay instead of re-running.
|
|
55
|
+
- Dataflow nodes in `./graph`: `MapNode`, `ReduceNode`, `JoinNode`, `BranchNode`, `CycleNode` and `describeGraph()`; `./contracts` adds `StateContract` / `defineState()` validation.
|
|
56
|
+
- Agent-native nodes (`./agent`): `PlanNode`, `CriticNode`, `ReflectNode`, `FinishNode`, `HumanApprovalNode`, plus `AgentEngine.asFlow()` and `strategyGraph()`.
|
|
57
|
+
- Evaluation nodes (`./eval`): `AssertNode`, `ScoreNode`, `CompareNode`, `ReplayNode`, `compareTraces()`, `deepDiff()` and `createEvalSuite()`.
|
|
58
|
+
- Bun-native nodes (`./bun`): `BunSpawnNode`, `SQLiteQueryNode`, `FileWatchNode`, `StreamTransformNode`, `StreamMapNode`, `StreamFilterNode` and `StreamReduceNode`.
|
|
59
|
+
- New subpath exports: `./llm`, `./tool-spec`, `./contracts`, `./side-effects`, `./eval`, `./bun`; new node families are also re-exported from `./nodes` / `./agent`.
|
|
60
|
+
- Tests for every new family; the suite now has 74 passing tests.
|
|
61
|
+
- Four offline end-to-end examples in `examples/v2/` (with `bun run examples:v2`) showing replay-safe checkout, one tool spec across agent/MCP/docs, dataflow trace replay, and Bun-native ingest.
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- `AgentEngine` accepts `toolRegistry`, `grantedCapabilities` and `grantedPermissions`, and shares one `initialize()` path with `asFlow()`.
|
|
65
|
+
- `QFlowMCPServer` can be constructed with `{ toolRegistry }` and call tools through the registry execute path.
|
|
66
|
+
- `ReplayNode` compares status/events/spans by default; saved checkpoints are treated as input metadata, not replay output.
|
|
67
|
+
- Version bumped to `2.0.0-canary.3`.
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
- `StateContract` no longer shadows its own `validate()` method when a custom validator is supplied.
|
|
71
|
+
- `ToolRegistry.allowed()` accepts capability/permission arrays as well as sets.
|
|
72
|
+
- `DurableFlow` retries from the start node when a run failed before its first checkpoint, and persists object-valued node actions as JSON.
|
|
73
|
+
- `AgentFlowFinishNode` now returns the flow's final output instead of an empty string.
|
|
74
|
+
|
|
75
|
+
## 2.0.0-canary.2
|
|
76
|
+
|
|
77
|
+
### Added
|
|
78
|
+
- Site trace viewer at `#trace`: paste, upload, filter, inspect, and download flow/durable-run traces.
|
|
79
|
+
- `./trace` export: `normalizeTrace()`, `buildTraceSpans()`, `serializeTrace()` and `writeTraceFile()`.
|
|
80
|
+
- `SQLiteCheckpointer.exportRunTrace()` / `createRunTrace()` for viewer-friendly durable traces.
|
|
81
|
+
- `./optional` export exposing the optional dependency map and `loadOptional()`.
|
|
82
|
+
- `./logger` export, matching the documented per-node logging API.
|
|
83
|
+
|
|
84
|
+
### Changed
|
|
85
|
+
- Heavy integration packages are now `optionalDependencies` and load only when their node action runs.
|
|
86
|
+
- Missing optional packages throw `QFLOW_OPTIONAL_DEPENDENCY_MISSING` with an exact `bun add --optional ...` command.
|
|
87
|
+
- README examples and 2.0 export documentation were updated; Bun-only installation is now explicit.
|
|
88
|
+
|
|
89
|
+
### Fixed
|
|
90
|
+
- `Flow.run()` test example asserted the wrong return value.
|
|
91
|
+
- Per-node logging with `type: 'none'` now actually disables output.
|
|
92
|
+
- Logger module uses ESM imports instead of `require()`.
|
|
93
|
+
|
|
94
|
+
## 2.0.0-canary.1
|
|
95
|
+
|
|
96
|
+
### Added
|
|
97
|
+
- MCP bridge: `QFlowMCPServer`, `MCPClientNode`, `qflow-mcp` stdio binary, and the `./mcp` export.
|
|
98
|
+
- Unified agent engine with declarative `default`, `raor`, `ooda`, `lpavrl`, and `pema` strategies plus the `./agent` export.
|
|
99
|
+
- First-class flow events: nodes receive an observer, flows support `onAny()`, nested events are forwarded.
|
|
100
|
+
- Streaming LLM support: `streamChatCompletions()`, `StreamingLLMNode`, `AgentStreamingLLMNode`, and `llm:*` events under `./streaming`.
|
|
101
|
+
- Bun-native durable execution: `SQLiteCheckpointer`, `DurableFlow`, resume-after-failure, run/checkpoint history, and `AbortSignal` cancellation under `./durable`.
|
|
102
|
+
- Testing utilities under `./testing`: `MockNode`, `MockLLMNode`, `recordFlow()` and deterministic trace snapshots.
|
|
103
|
+
- Graph semantics: `FanOutNode` / `FanInNode` under `./graph`, plus `maxSteps`, `timeout` and `onError` flow options.
|
|
104
|
+
- Migration guide for 2.0.
|
|
105
|
+
|
|
106
|
+
### Changed
|
|
107
|
+
- Async lifecycle methods accept an optional observer as their final argument.
|
|
108
|
+
- `AgentEngine` forwards the flow observer to its LLM node, so streamed agent output reaches the outer flow.
|
|
109
|
+
- Bumped version to `2.0.0-canary.1`.
|
|
110
|
+
- Replaced the stale LGPL-2.1 `LICENSE` with MIT.
|
|
111
|
+
|
|
112
|
+
### Fixed
|
|
113
|
+
- Missing `SummarizeNode` imports and custom-tool validation in the agent engine.
|
|
114
|
+
- Circular imports caused by five nodes importing `nodes/index.js`.
|
|
115
|
+
- Tool registry imports and consumer config resolution used by the MCP bridge.
|
|
116
|
+
|
|
117
|
+
## 1.0.84
|
|
118
|
+
|
|
119
|
+
Previous 1.x release.
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025-2026 Fractal Solutions
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Fractal Solutions
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|