@nathanstephenson/flow 0.1.10-beta.2 → 0.1.10-beta.4

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 (79) hide show
  1. package/README.md +27 -1
  2. package/build/backend-worker-chunks/{chunk-LO7O6NAM.mjs → chunk-JOI2POLP.mjs} +1 -1
  3. package/build/backend-worker-chunks/{chunk-UQDH2COY.mjs → chunk-K774KOGL.mjs} +2 -7
  4. package/build/backend-worker-chunks/chunk-LAEUXDNH.mjs +130 -0
  5. package/build/backend-worker-chunks/{chunk-MLOUI3ZM.mjs → chunk-NZZME2I3.mjs} +6 -1
  6. package/build/backend-worker-chunks/claude-GY27HBAY.mjs +35739 -0
  7. package/build/backend-worker-chunks/{pi-HJKTV2TH.mjs → pi-JV6MWPW7.mjs} +1901 -45
  8. package/build/backend-worker.mjs +52 -116
  9. package/dist/backend/claude/background-calls.js +7 -3
  10. package/dist/backend/claude/index.js +106 -16
  11. package/dist/backend/claude/subagents.js +41 -9
  12. package/dist/backend/fake/index.js +26 -5
  13. package/dist/backend/pi/cache-warming.js +8 -0
  14. package/dist/backend/pi/canonical-json.js +120 -0
  15. package/dist/backend/pi/compaction-model.js +3 -2
  16. package/dist/backend/pi/host-auth.js +258 -0
  17. package/dist/backend/pi/index.js +38 -12
  18. package/dist/backend/pi/model-auth.js +159 -0
  19. package/dist/backend/pi/model-catalog.js +120 -0
  20. package/dist/backend/pi/model-config.js +5 -0
  21. package/dist/backend/pi/model-selection.js +32 -0
  22. package/dist/backend/pi/subagents.js +7 -3
  23. package/dist/backend/pi/work.js +9 -1
  24. package/dist/backend/pi/workflow-subagent.js +4 -3
  25. package/dist/backend/worker/entry.js +32 -6
  26. package/dist/backend/worker/index.js +87 -7
  27. package/dist/backend/worker/rpc.js +13 -0
  28. package/dist/backend/worker/sandbox-mcp.js +18 -7
  29. package/dist/build-id +1 -1
  30. package/dist/cli/bootstrap.js +1 -1
  31. package/dist/client/reduce.js +11 -3
  32. package/dist/client/subagent-tree.js +49 -0
  33. package/dist/client/tool-summary.js +26 -15
  34. package/dist/daemon/git.js +10 -7
  35. package/dist/daemon/host.js +100 -22
  36. package/dist/daemon/models.js +2 -2
  37. package/dist/daemon/pi-model-cache.js +44 -0
  38. package/dist/daemon/runtime.js +63 -3
  39. package/dist/daemon/server.js +3 -0
  40. package/dist/daemon/store.js +2 -0
  41. package/dist/daemon/workflow-environment.js +191 -0
  42. package/dist/daemon/workflow-execution-launch.js +77 -0
  43. package/dist/daemon/workflow-execution-resources.js +76 -0
  44. package/dist/daemon/workflow-execution-values.js +128 -0
  45. package/dist/daemon/workflow-executions.js +272 -285
  46. package/dist/daemon/workflow-schedule-driver.js +247 -0
  47. package/dist/daemon/workflow-schedule-routes.js +137 -0
  48. package/dist/daemon/workflow-schedules.js +341 -0
  49. package/dist/isolation/filesystem.js +5 -1
  50. package/dist/isolation/sandbox.js +61 -18
  51. package/dist/isolation/shared-sandbox.js +3 -3
  52. package/dist/protocol/workflow-schedules.js +1 -0
  53. package/dist/tui/render.js +7 -1
  54. package/dist/workflows/calls.js +10 -7
  55. package/dist/workflows/errors.js +2 -0
  56. package/dist/workflows/executors.js +1 -1
  57. package/dist/workflows/invocations.js +8 -5
  58. package/dist/workflows/owner.js +45 -0
  59. package/dist/workflows/records.js +8 -2
  60. package/dist/workflows/schedule-errors.js +2 -0
  61. package/dist/workflows/schedule-store.js +385 -0
  62. package/dist/workflows/scheduler.js +29 -18
  63. package/dist/workflows/schedules.js +129 -0
  64. package/dist/workflows/store.js +110 -11
  65. package/package.json +8 -5
  66. package/web/dist/assets/index-BWKZK5HD.css +2 -0
  67. package/web/dist/assets/index-nIc09tKZ.js +40 -0
  68. package/web/dist/assets/{settings-mcp-sebWClE0.js → settings-mcp-bcNKV147.js} +1 -1
  69. package/web/dist/assets/settings-workflows-C_TKOhVa.js +23 -0
  70. package/web/dist/assets/workflows-DHG-CIo3.js +146 -0
  71. package/web/dist/assets/workflows-pane-9u_hJvgQ.js +1 -0
  72. package/web/dist/index.html +4 -3
  73. package/build/backend-worker-chunks/claude-COCNALN2.mjs +0 -30846
  74. package/web/dist/assets/index-CLdr6AA0.js +0 -40
  75. package/web/dist/assets/index-DHAcGIoF.css +0 -2
  76. package/web/dist/assets/settings-workflows-BvArjkes.js +0 -23
  77. package/web/dist/assets/workflow-editors-Tztq_Opa.js +0 -139
  78. package/web/dist/assets/workflows-CdDynCfW.js +0 -7
  79. package/web/dist/assets/workflows-pane-DaqHEeXu.js +0 -1
package/README.md CHANGED
@@ -21,7 +21,7 @@ Flow runs coding-agent sessions. You can watch and control them from a terminal
21
21
 
22
22
  ## Requirements
23
23
 
24
- - Node.js 22 or later, and npm. CI checks installs on Linux and macOS.
24
+ - Node.js 22.19.0 or later, and npm. CI checks installs on Linux and macOS.
25
25
  - A user-owned npm prefix, for example from a Node version manager. Do not use sudo or a shared
26
26
  system prefix.
27
27
  - For filesystem isolation on Linux: Bubblewrap. See [docs/isolation.md](docs/isolation.md).
@@ -73,6 +73,14 @@ Configure credentials for the Backend Adapter that you use.
73
73
  - **pi** — pi keeps its own credential store. Run `pi`, then `/login`, before you start a pi
74
74
  session. Flow reads pi state from `PI_CODING_AGENT_DIR` (default `~/.pi/agent`).
75
75
 
76
+ Flow uses its own Pi SDK. Update Flow, not only standalone pi, to get a newer model catalogue.
77
+ Pi 1.6 calls the Azure Provider `azure`. Flow accepts saved `azure-openai-responses/<model>`
78
+ references, but legacy Provider keys in Pi's `auth.json` and `models.json` must change to `azure`.
79
+ The API name `azure-openai-responses` does not change. Unavailable models require an explicit new
80
+ selection; Flow does not substitute another model.
81
+
82
+ Pi cache warming stays limited to active runs unless Pi's global `cacheWarming` setting is `idle`.
83
+
76
84
  ## Everyday use
77
85
 
78
86
  ### Commands
@@ -182,3 +190,21 @@ requirements, the browser update, systemd setup and the repair procedure.
182
190
  | [docs/workflow-builder-scope.md](docs/workflow-builder-scope.md) | Workflows, including direct MCP steps |
183
191
  | [docs/development.md](docs/development.md) | Build, test, web development, releases |
184
192
  | [docs/milestones.md](docs/milestones.md) | Project status and design notes from each milestone |
193
+
194
+ ### Repeating workflows
195
+
196
+ Open **Schedules** to run a saved workflow every N minutes/hours/days, or daily at a local time in
197
+ an explicitly saved IANA timezone. Enabling never runs immediately. The Session Host must remain
198
+ running; missed times are recorded without catch-up. Daily clock gaps are skipped and repeated times
199
+ run only once, at the first occurrence.
200
+
201
+ Choose fixed typed inputs, an opted-in Project, MCP connections and an overlap limit (default 3).
202
+ Shared-directory runs can conflict. Optional fresh worktrees use the current local base branch commit
203
+ without fetching or copying uncommitted changes. Each occurrence uses the latest saved root/called
204
+ workflows and retains its own snapshot. Pause or delete stops future runs, not already admitted work.
205
+
206
+ Code/MCP-only success creates no Agent Session or model summary. An actual agent step, human input
207
+ or recovery attaches one Agent Session with the normal controls. Inspect execution graphs, attempts,
208
+ activity and results in occurrence history, and follow its Agent Session link when input is needed.
209
+ Terminal history lasts seven days; active/input/recovery work and associated transcripts are not
210
+ pruned by that window. Unsafe worktree cleanup preserves dirty files and unmerged commits.
@@ -1,7 +1,7 @@
1
1
  import { createRequire as __flowCreateRequire } from 'node:module'; const require = __flowCreateRequire(import.meta.url);
2
2
  import {
3
3
  external_exports
4
- } from "./chunk-MLOUI3ZM.mjs";
4
+ } from "./chunk-NZZME2I3.mjs";
5
5
 
6
6
  // src/backend/effort.ts
7
7
  var EFFORT_ORDER = ["off", "minimal", "low", "medium", "high", "xhigh", "max"];
@@ -32,7 +32,7 @@ import {
32
32
  toJSONSchema,
33
33
  union,
34
34
  unknown
35
- } from "./chunk-MLOUI3ZM.mjs";
35
+ } from "./chunk-NZZME2I3.mjs";
36
36
 
37
37
  // node_modules/ajv/dist/compile/codegen/code.js
38
38
  var require_code = __commonJS({
@@ -7188,10 +7188,6 @@ var require_dist = __commonJS({
7188
7188
  }
7189
7189
  });
7190
7190
 
7191
- // src/backend/permission-errors.ts
7192
- var AutoPermissionUnavailable = class extends Error {
7193
- };
7194
-
7195
7191
  // node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
7196
7192
  var LATEST_PROTOCOL_VERSION = "2025-11-25";
7197
7193
  var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
@@ -15291,6 +15287,5 @@ export {
15291
15287
  mergeCapabilities,
15292
15288
  AjvJsonSchemaValidator,
15293
15289
  assertToolsCallTaskCapability,
15294
- assertClientRequestTaskCapability,
15295
- AutoPermissionUnavailable
15290
+ assertClientRequestTaskCapability
15296
15291
  };
@@ -0,0 +1,130 @@
1
+ import { createRequire as __flowCreateRequire } from 'node:module'; const require = __flowCreateRequire(import.meta.url);
2
+ import {
3
+ AutoPermissionUnavailable
4
+ } from "./chunk-NZZME2I3.mjs";
5
+
6
+ // src/backend/worker/rpc.ts
7
+ function waitForAbort(work, signal) {
8
+ if (!signal) return work;
9
+ return new Promise((resolve, reject) => {
10
+ const abort = () => {
11
+ reject(signal.reason);
12
+ };
13
+ signal.addEventListener("abort", abort, { once: true });
14
+ void work.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));
15
+ if (signal.aborted) {
16
+ signal.removeEventListener("abort", abort);
17
+ abort();
18
+ }
19
+ });
20
+ }
21
+ function errorText(error) {
22
+ return error instanceof Error ? error.message : String(error);
23
+ }
24
+ var WorkerRpc = class {
25
+ nextId = 0;
26
+ failure;
27
+ pending = /* @__PURE__ */ new Map();
28
+ incoming = /* @__PURE__ */ new Map();
29
+ send;
30
+ dispatch;
31
+ notification;
32
+ constructor(send, dispatch, notification) {
33
+ this.send = send;
34
+ this.dispatch = dispatch;
35
+ this.notification = notification;
36
+ }
37
+ call(method, args = [], signal) {
38
+ if (this.failure) return Promise.reject(this.failure);
39
+ if (signal?.aborted) return Promise.reject(new Error("Worker call cancelled"));
40
+ const id = ++this.nextId;
41
+ return new Promise((resolve, reject) => {
42
+ const abort = () => {
43
+ this.pending.delete(id);
44
+ try {
45
+ this.send({ kind: "cancel", id });
46
+ } catch {
47
+ }
48
+ reject(new Error("Worker call cancelled"));
49
+ };
50
+ const cleanup = () => signal?.removeEventListener("abort", abort);
51
+ this.pending.set(id, {
52
+ resolve: (value) => {
53
+ cleanup();
54
+ resolve(value);
55
+ },
56
+ reject: (error) => {
57
+ cleanup();
58
+ reject(error);
59
+ }
60
+ });
61
+ signal?.addEventListener("abort", abort, { once: true });
62
+ try {
63
+ this.send({ kind: "call", id, method, args });
64
+ } catch (error) {
65
+ this.pending.delete(id);
66
+ cleanup();
67
+ reject(error);
68
+ }
69
+ });
70
+ }
71
+ notify(name, value) {
72
+ if (!this.failure) this.send({ kind: "notification", name, value });
73
+ }
74
+ receive(raw) {
75
+ if (this.failure || !raw || typeof raw !== "object") return;
76
+ const message = raw;
77
+ switch (message.kind) {
78
+ case "reply": {
79
+ const pending = this.pending.get(message.id);
80
+ this.pending.delete(message.id);
81
+ if (message.error !== void 0) pending?.reject(message.errorCode === "auto_permission_unavailable" ? new AutoPermissionUnavailable(message.error) : new Error(message.error));
82
+ else pending?.resolve(message.value);
83
+ break;
84
+ }
85
+ case "cancel":
86
+ this.incoming.get(message.id)?.abort();
87
+ break;
88
+ case "notification":
89
+ this.notification(message.name, message.value);
90
+ break;
91
+ case "call": {
92
+ if (!Number.isSafeInteger(message.id) || typeof message.method !== "string" || !Array.isArray(message.args) || this.incoming.has(message.id)) return;
93
+ const controller = new AbortController();
94
+ this.incoming.set(message.id, controller);
95
+ void Promise.resolve().then(() => this.dispatch(message.method, message.args, controller.signal)).then(
96
+ (value) => this.reply({ kind: "reply", id: message.id, value }),
97
+ (error) => this.reply({
98
+ kind: "reply",
99
+ id: message.id,
100
+ error: errorText(error),
101
+ ...error instanceof AutoPermissionUnavailable ? { errorCode: "auto_permission_unavailable" } : {}
102
+ })
103
+ ).finally(() => this.incoming.delete(message.id));
104
+ break;
105
+ }
106
+ }
107
+ }
108
+ reply(message) {
109
+ if (this.failure) return;
110
+ try {
111
+ this.send(message);
112
+ } catch (error) {
113
+ this.close(new Error(errorText(error)));
114
+ }
115
+ }
116
+ close(error) {
117
+ if (this.failure) return;
118
+ this.failure = error;
119
+ for (const pending of this.pending.values()) pending.reject(error);
120
+ this.pending.clear();
121
+ for (const controller of this.incoming.values()) controller.abort();
122
+ this.incoming.clear();
123
+ }
124
+ };
125
+
126
+ export {
127
+ waitForAbort,
128
+ errorText,
129
+ WorkerRpc
130
+ };
@@ -39,6 +39,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
39
39
  mod
40
40
  ));
41
41
 
42
+ // src/backend/permission-errors.ts
43
+ var AutoPermissionUnavailable = class extends Error {
44
+ };
45
+
42
46
  // node_modules/zod/v4/classic/external.js
43
47
  var external_exports = {};
44
48
  __export(external_exports, {
@@ -19748,5 +19752,6 @@ export {
19748
19752
  ZodIssueCode,
19749
19753
  iso_exports,
19750
19754
  coerce_exports,
19751
- external_exports
19755
+ external_exports,
19756
+ AutoPermissionUnavailable
19752
19757
  };