@agentic-surfaces/cli 0.1.26 → 0.1.27

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 +10 -4
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { readFileSync, readdirSync, existsSync } from "node:fs";
2
2
  import { join, dirname, resolve } from "node:path";
3
3
  import { spawn } from "node:child_process";
4
- import { loadWorkflow, runWorkflowOnce, Scheduler, loadProjectConfig, buildWorkflowRunner, defaultRegistry, parseAgentFile } from "@agentic-surfaces/core";
4
+ import { loadWorkflow, runWorkflowOnce, Scheduler, loadProjectConfig, buildWorkflowRunner, defaultRegistry, parseAgentFile, FilePauseState } from "@agentic-surfaces/core";
5
5
  import { serve, StreamingObserver } from "@agentic-surfaces/server";
6
6
  import { buildServices } from "./services.js";
7
7
  const CONFIG = "agentic-surfaces.config.yaml";
@@ -105,6 +105,7 @@ function launchUi(opts) {
105
105
  agents: [...opts.agents.values()],
106
106
  onRun: opts.onRun,
107
107
  cache: opts.cache,
108
+ pause: opts.pause,
108
109
  config: { dryRun: opts.dryRun, agent: opts.agentDefaults, version: VERSION },
109
110
  });
110
111
  const url = `http://127.0.0.1:${p}`;
@@ -164,8 +165,10 @@ export async function run(argv) {
164
165
  const services = buildServices({ projectConfig: pc, projectDir: dir });
165
166
  const runWorkflowFn = buildWorkflowRunner({ workflows: allWorkflows, registry, services: { ...services, agents }, observer });
166
167
  const servicesWithRunner = { ...services, agents, runWorkflow: runWorkflowFn };
168
+ // Platform-wide play/pause (file-backed so it survives a --watch restart).
169
+ const pause = new FilePauseState();
167
170
  // Cron-triggered workflows fire on schedule too.
168
- const sched = new Scheduler(servicesWithRunner, registry, observer);
171
+ const sched = new Scheduler(servicesWithRunner, registry, observer, pause);
169
172
  for (const [, w] of allWorkflows)
170
173
  sched.add(w);
171
174
  sched.start();
@@ -173,6 +176,7 @@ export async function run(argv) {
173
176
  observer, workflows: allWorkflows, agents,
174
177
  onRun: (name, payload) => runWorkflowFn(name, payload),
175
178
  cache: services.cache,
179
+ pause,
176
180
  dryRun: pc?.dryRun,
177
181
  agentDefaults: { model: pc?.agent?.model, effort: pc?.agent?.effort },
178
182
  });
@@ -257,16 +261,18 @@ export async function run(argv) {
257
261
  const observer = ui ? new StreamingObserver() : undefined;
258
262
  const runWorkflowFn = buildWorkflowRunner({ workflows: allWorkflows, registry, services: { ...services, agents }, observer });
259
263
  const servicesWithRunner = { ...services, agents, runWorkflow: runWorkflowFn };
260
- const sched = new Scheduler(servicesWithRunner, registry, observer);
264
+ const pause = new FilePauseState();
265
+ const sched = new Scheduler(servicesWithRunner, registry, observer, pause);
261
266
  for (const [, w] of allWorkflows)
262
267
  sched.add(w);
263
268
  sched.start();
264
- console.log("scheduler started; watching", workflowsDir);
269
+ console.log(`scheduler started; watching ${workflowsDir}${pause.isPaused() ? " (PAUSED)" : ""}`);
265
270
  if (ui) {
266
271
  const url = launchUi({
267
272
  observer: observer, workflows: allWorkflows, agents,
268
273
  onRun: (name, payload) => runWorkflowFn(name, payload),
269
274
  cache: services.cache,
275
+ pause,
270
276
  dryRun: pc?.dryRun,
271
277
  agentDefaults: { model: pc?.agent?.model, effort: pc?.agent?.effort },
272
278
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic-surfaces/cli",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -22,9 +22,9 @@
22
22
  "README.md"
23
23
  ],
24
24
  "dependencies": {
25
- "@agentic-surfaces/core": "0.1.26",
26
- "@agentic-surfaces/server": "0.1.26",
27
- "@agentic-surfaces/agent": "0.1.26"
25
+ "@agentic-surfaces/core": "0.1.27",
26
+ "@agentic-surfaces/agent": "0.1.27",
27
+ "@agentic-surfaces/server": "0.1.27"
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",