@agentic-surfaces/cli 0.1.4 → 0.1.5

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 (2) hide show
  1. package/dist/index.js +17 -7
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -51,10 +51,10 @@ export async function run(argv) {
51
51
  console.log("OK:", rest[0]);
52
52
  return 0;
53
53
  }
54
- if (cmd === "run-once") {
54
+ if (cmd === "run-once" || cmd === "run") {
55
55
  const file = rest.find(a => !a.startsWith("--"));
56
56
  if (!file) {
57
- console.error("run-once: missing workflow file");
57
+ console.error("run: missing workflow file");
58
58
  return 1;
59
59
  }
60
60
  const fake = rest.includes("--fake");
@@ -75,13 +75,23 @@ export async function run(argv) {
75
75
  const observer = session?.observer;
76
76
  const runWorkflowFn = buildWorkflowRunner({ workflows: allWorkflows, registry, services, observer });
77
77
  const servicesWithRunner = { ...services, runWorkflow: runWorkflowFn };
78
- const outputs = await runWorkflowOnce(wf, { registry, services: servicesWithRunner, observer });
79
- console.log("ran", wf.name, "->", [...outputs.keys()].join(", "));
78
+ // A run error must NOT tear down the --ui server: the failure is already
79
+ // streamed to the dashboard (the failed node + run), so keep serving so it
80
+ // stays inspectable. Without --ui, an error still exits non-zero.
81
+ let failed = false;
82
+ try {
83
+ const outputs = await runWorkflowOnce(wf, { registry, services: servicesWithRunner, observer });
84
+ console.log("ran", wf.name, "->", [...outputs.keys()].join(", "));
85
+ }
86
+ catch (err) {
87
+ failed = true;
88
+ console.error("run failed:", err instanceof Error ? err.message : String(err));
89
+ }
80
90
  if (session) {
81
- console.log(`\n▶ Dashboard live at ${session.url} — Ctrl-C to exit`);
91
+ console.log(`\n▶ Dashboard live at ${session.url} — Ctrl-C to exit${failed ? " (run failed — see the dashboard)" : ""}`);
82
92
  await new Promise(() => { }); // keep the server up so the run stays viewable
83
93
  }
84
- return 0;
94
+ return failed ? 1 : 0;
85
95
  }
86
96
  if (cmd === "start") {
87
97
  const dir = rest.find(a => !a.startsWith("--")) ?? ".";
@@ -111,7 +121,7 @@ export async function run(argv) {
111
121
  console.log(`▶ Dashboard live at ${session.url}`);
112
122
  return 0;
113
123
  }
114
- console.error("usage: flow <validate|run-once|start> ...");
124
+ console.error("usage: flow <validate|run|start> [workflow|projectDir] [--ui] [--fake]");
115
125
  return 1;
116
126
  }
117
127
  catch (err) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic-surfaces/cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -21,9 +21,9 @@
21
21
  "dist"
22
22
  ],
23
23
  "dependencies": {
24
- "@agentic-surfaces/core": "0.1.4",
25
- "@agentic-surfaces/agent": "0.1.4",
26
- "@agentic-surfaces/server": "0.1.4"
24
+ "@agentic-surfaces/core": "0.1.5",
25
+ "@agentic-surfaces/agent": "0.1.5",
26
+ "@agentic-surfaces/server": "0.1.5"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "tsc -b",