@nathanstephenson/flow 0.1.6 → 0.1.7
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/dist/backend/worker/entry.js +2 -2
- package/dist/backend/worker/index.js +1 -1
- package/dist/build-id +1 -1
- package/dist/cli/bootstrap.js +1 -1
- package/dist/daemon/workflow-authoring-scope-checks.js +0 -18
- package/dist/daemon/workflow-mcp-authoring.js +6 -3
- package/package.json +1 -1
- package/web/dist/assets/{index-C_M0oDHN.js → index-DxTV-TYZ.js} +24 -24
- package/web/dist/assets/index-jwsr3cpu.css +2 -0
- package/web/dist/assets/{input-D9fbSfQF.js → input-BOuBzJVY.js} +1 -1
- package/web/dist/assets/{settings-mcp-BvSvGrcs.js → settings-mcp-D-jWezcS.js} +1 -1
- package/web/dist/assets/{settings-secrets-DlkU6W_Z.js → settings-secrets-DdQ0eujd.js} +1 -1
- package/web/dist/assets/settings-workflows-BCzYKkOk.js +23 -0
- package/web/dist/assets/switch-B0hMd_dH.js +1 -0
- package/web/dist/assets/{workflow-editors-D6XT6pcb.js → workflow-editors-CDZqnDvT.js} +3 -3
- package/web/dist/assets/{workflows-LSCnXIxN.js → workflows-BpPNiK-H.js} +2 -2
- package/web/dist/assets/{workflows-pane-BIlp7uyg.js → workflows-pane-N3Vf30Cb.js} +1 -1
- package/web/dist/index.html +5 -5
- package/web/dist/assets/index-D8CGXp1X.css +0 -2
- package/web/dist/assets/settings-workflows-DNGE-b_U.js +0 -23
- package/web/dist/assets/switch-DEvHojwW.js +0 -1
|
@@ -43,7 +43,7 @@ export function runWorker() {
|
|
|
43
43
|
if (creating || closing)
|
|
44
44
|
throw new Error("Backend worker already initialized");
|
|
45
45
|
creating = true;
|
|
46
|
-
const { mcpTools, workflowEnabled, workflowBuilderInstructions, backendModule, backend: backendName = "pi", ...options } = args[0];
|
|
46
|
+
const { mcpTools, mcpConnectionIds, workflowEnabled, workflowBuilderInstructions, backendModule, backend: backendName = "pi", ...options } = args[0];
|
|
47
47
|
const workflowBuilder = workflowBuilderInstructions === undefined ? undefined : {
|
|
48
48
|
instructions: workflowBuilderInstructions,
|
|
49
49
|
read: (path) => rpc.call("workflowBuilder.read", [path]),
|
|
@@ -72,7 +72,7 @@ export function runWorker() {
|
|
|
72
72
|
session = await backend.create({
|
|
73
73
|
...options,
|
|
74
74
|
...(workflowBuilder ? { workflowBuilder } : {
|
|
75
|
-
...(mcpTools ? { mcp: { tools: () => tools } } : {}),
|
|
75
|
+
...(mcpTools ? { mcp: { connections: (mcpConnectionIds ?? []).map((id) => ({ id })), tools: () => tools } } : {}),
|
|
76
76
|
...(workflowEnabled ? { workflow } : {}),
|
|
77
77
|
}),
|
|
78
78
|
emit: (event) => {
|
|
@@ -168,7 +168,7 @@ class WorkerSession {
|
|
|
168
168
|
const state = await this.rpc.call("create", [{ ...options, backend: this.launchOptions.backend ?? "pi",
|
|
169
169
|
workflowEnabled: !workflowBuilder && !!workflow,
|
|
170
170
|
...(workflowBuilder ? { workflowBuilderInstructions: workflowBuilder.instructions }
|
|
171
|
-
: mcp ? { mcpTools: mcpMetadata(mcp) } : {}),
|
|
171
|
+
: mcp ? { mcpTools: mcpMetadata(mcp), mcpConnectionIds: (mcp.connections ?? []).map((connection) => connection.id) } : {}),
|
|
172
172
|
...(this.launchOptions.backendModule ? { backendModule: this.launchOptions.backendModule } : {}),
|
|
173
173
|
}], controller.signal);
|
|
174
174
|
this.updateSnapshot(state);
|
package/dist/build-id
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e95e7068-765f-495c-9ba0-420a165b3c5f
|
package/dist/cli/bootstrap.js
CHANGED
|
@@ -883,7 +883,7 @@ async function bootstrap() {
|
|
|
883
883
|
if (!managed) throw new Error("Missing systemd update configuration");
|
|
884
884
|
await assertSystemdOwner(managed, managed.updater, process.pid);
|
|
885
885
|
}
|
|
886
|
-
const lease = await install.register("
|
|
886
|
+
const lease = await install.register("e95e7068-765f-495c-9ba0-420a165b3c5f", root, args, process.env.FLOW_UPDATE_CAPABILITY ?? systemdCapability(root));
|
|
887
887
|
delete process.env.FLOW_UPDATE_CAPABILITY;
|
|
888
888
|
process.on("exit", lease.release);
|
|
889
889
|
if (args[0] === "update") {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { realpathSync } from 'node:fs';
|
|
2
1
|
import { isAbsolute, resolve } from 'node:path';
|
|
3
2
|
import { isSea } from 'node:sea';
|
|
4
3
|
import { fileURLToPath } from 'node:url';
|
|
5
4
|
import { launchWorker } from "../backend/worker/launcher.js";
|
|
6
|
-
import { checkWorkflowAuthoringDirectory, workflowAuthoringDirectory } from "./workflow-authoring-scope.js";
|
|
7
5
|
const unavailable = () => new Error('Workflow authoring Scope unavailable');
|
|
8
6
|
const changed = () => new Error('Workflow authoring Scope changed; discover again');
|
|
9
7
|
const validPath = (path) => typeof path === 'string' && path.length > 0 && path.length <= 4096 && !path.includes('\0');
|
|
@@ -22,28 +20,12 @@ export class WorkflowAuthoringScopeChecks {
|
|
|
22
20
|
async read(path) {
|
|
23
21
|
if (this.closed || !validPath(path))
|
|
24
22
|
throw unavailable();
|
|
25
|
-
if (process.platform === 'linux' && this.options.linuxSync !== false) {
|
|
26
|
-
try {
|
|
27
|
-
return workflowAuthoringDirectory(realpathSync(path));
|
|
28
|
-
}
|
|
29
|
-
catch {
|
|
30
|
-
throw unavailable();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
23
|
return this.inspect({ operation: 'read', path: resolve(path) });
|
|
34
24
|
}
|
|
35
25
|
async check(directory) {
|
|
36
26
|
if (this.closed || !validDirectory(directory))
|
|
37
27
|
throw changed();
|
|
38
28
|
const pinned = { path: directory.path, identity: directory.identity };
|
|
39
|
-
if (process.platform === 'linux' && this.options.linuxSync !== false) {
|
|
40
|
-
try {
|
|
41
|
-
return checkWorkflowAuthoringDirectory(pinned);
|
|
42
|
-
}
|
|
43
|
-
catch {
|
|
44
|
-
throw changed();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
29
|
const actual = await this.inspect({ operation: 'check', ...pinned });
|
|
48
30
|
if (actual.path !== pinned.path || actual.identity !== pinned.identity)
|
|
49
31
|
throw changed();
|
|
@@ -293,10 +293,13 @@ export class WorkflowMcpAuthoringService {
|
|
|
293
293
|
async bounded(work) {
|
|
294
294
|
const deadline = Date.now() + 10_000;
|
|
295
295
|
let timer;
|
|
296
|
+
const timeout = new Promise((_, reject) => {
|
|
297
|
+
timer = setTimeout(() => reject(new Error('MCP discovery timed out')), Math.max(0, deadline - Date.now()));
|
|
298
|
+
});
|
|
296
299
|
try {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
+
const result = await Promise.race([timeout, work(deadline)]);
|
|
301
|
+
this.checkDeadline(deadline);
|
|
302
|
+
return result;
|
|
300
303
|
}
|
|
301
304
|
finally {
|
|
302
305
|
clearTimeout(timer);
|