@agentic-surfaces/cli 0.1.22 → 0.1.24

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 (3) hide show
  1. package/README.md +35 -0
  2. package/dist/index.js +21 -0
  3. package/package.json +19 -5
package/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # @agentic-surfaces/cli
2
+
3
+ The command-line runner for [agentic-surfaces](https://github.com/dalebaldwin/agentic-surfaces) —
4
+ a local-first, agent-in-the-loop workflow engine. Loads a project's `agentic-surfaces.config.yaml`
5
+ + `workflows/*.yaml` + `agents/*.md`, runs the scheduler, and serves the live dashboard.
6
+
7
+ **Repo & full docs:** https://github.com/dalebaldwin/agentic-surfaces
8
+
9
+ ## Usage
10
+
11
+ ```bash
12
+ npx -y @agentic-surfaces/cli@latest <command> [projectDir] [--ui] [--watch] [--fake]
13
+ ```
14
+
15
+ | Command | What it does |
16
+ |---|---|
17
+ | `start <dir>` | Run the scheduler (cron triggers fire). `--ui` adds the dashboard; `--watch` restarts on config edits. |
18
+ | `run-once <workflow.yaml>` | Run one entry workflow once, ignoring its cron. |
19
+ | `ui [dir]` | Dashboard + scheduler (the default when no command is given). |
20
+ | `validate <workflow.yaml>` | Parse-check a workflow. |
21
+
22
+ Pin a version for reproducibility: `@agentic-surfaces/cli@0.1.x`.
23
+
24
+ ## Secrets
25
+
26
+ Workflows use `${VAR}`. Supply via a **`.env`** in the working directory (auto-loaded), a secrets
27
+ manager like **Doppler**, or plain `export`s. Real env / Doppler override `.env`.
28
+
29
+ ## Dashboard
30
+
31
+ `--ui` serves http://127.0.0.1:4000 — workflow graph (with the taken path highlighted), live runs,
32
+ per-node output, **agent activity** (reasoning + tool/MCP calls), and a **cache inspector**. Set
33
+ `FLOW_UI_PORT` to change the port, `FLOW_NO_OPEN=1` to not open a browser.
34
+
35
+ MIT licensed.
package/dist/index.js CHANGED
@@ -5,6 +5,26 @@ import { loadWorkflow, runWorkflowOnce, Scheduler, loadProjectConfig, buildWorkf
5
5
  import { serve, StreamingObserver } from "@agentic-surfaces/server";
6
6
  import { buildServices } from "./services.js";
7
7
  const CONFIG = "agentic-surfaces.config.yaml";
8
+ /**
9
+ * Load a `.env` file (from the cwd) into process.env, so secrets (JIRA_EMAIL, …) can be supplied
10
+ * without Doppler. Existing env vars are NOT overridden — so Doppler / explicit env still win.
11
+ * This is why `${VAR}` in workflows works whether you use Doppler, a .env, or plain exports.
12
+ */
13
+ function loadDotenv(dir = process.cwd()) {
14
+ const path = join(dir, ".env");
15
+ if (!existsSync(path))
16
+ return;
17
+ for (const line of readFileSync(path, "utf8").split(/\r?\n/)) {
18
+ const m = line.match(/^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=\s*(.*?)\s*$/);
19
+ if (!m)
20
+ continue; // skips blanks + `# comments`
21
+ let val = m[2];
22
+ if ((val.startsWith('"') && val.endsWith('"')) || (val.startsWith("'") && val.endsWith("'")))
23
+ val = val.slice(1, -1);
24
+ if (process.env[m[1]] === undefined)
25
+ process.env[m[1]] = val;
26
+ }
27
+ }
8
28
  // Locate a project folder when none is given: check the dir, its ./agentic-surfaces
9
29
  // subfolder (the repo-native convention), then walk up. Lets `agentic-surfaces`
10
30
  // be run bare from a repo root and still find the config.
@@ -122,6 +142,7 @@ function findProjectConfig(startDir) {
122
142
  }
123
143
  }
124
144
  export async function run(argv) {
145
+ loadDotenv(); // pick up a .env (cwd) for secrets — optional; Doppler / real env override it
125
146
  const [cmd, ...rest] = argv;
126
147
  try {
127
148
  // Default / `ui`: launch the visual control surface. `agentic-surfaces`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic-surfaces/cli",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -18,13 +18,27 @@
18
18
  "flow": "dist/bin.js"
19
19
  },
20
20
  "files": [
21
- "dist"
21
+ "dist",
22
+ "README.md"
22
23
  ],
23
24
  "dependencies": {
24
- "@agentic-surfaces/core": "0.1.22",
25
- "@agentic-surfaces/agent": "0.1.22",
26
- "@agentic-surfaces/server": "0.1.22"
25
+ "@agentic-surfaces/core": "0.1.24",
26
+ "@agentic-surfaces/agent": "0.1.24",
27
+ "@agentic-surfaces/server": "0.1.24"
27
28
  },
29
+ "repository": {
30
+ "type": "git",
31
+ "url": "git+https://github.com/dalebaldwin/agentic-surfaces.git",
32
+ "directory": "packages/cli"
33
+ },
34
+ "homepage": "https://github.com/dalebaldwin/agentic-surfaces#readme",
35
+ "bugs": "https://github.com/dalebaldwin/agentic-surfaces/issues",
36
+ "keywords": [
37
+ "agentic-surfaces",
38
+ "workflow",
39
+ "ai-agents",
40
+ "claude"
41
+ ],
28
42
  "scripts": {
29
43
  "build": "tsc -b",
30
44
  "test": "vitest run --root ../.."