@boardwalk-labs/cli 0.1.9 → 0.1.11

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/README.md CHANGED
@@ -44,7 +44,7 @@ boardwalk dev ./index.ts --stream phase,log
44
44
 
45
45
  ## Deploying
46
46
 
47
- - **`deploy <file|dir> --org <slug>`** — create/update the workflow (idempotent by `meta.name`).
47
+ - **`deploy <file|dir> --org <slug>`** — create/update the workflow (idempotent by `meta.slug`).
48
48
  `--dry-run` prints the plan only.
49
49
  - **`run <file|dir> --org <slug>`** — deploy the current source, trigger a **real run on the
50
50
  platform**, and wait for it to finish. `--no-wait` triggers and exits.
@@ -59,7 +59,7 @@ your `meta` — the CLI never sends a hand-built manifest.
59
59
 
60
60
  The first `deploy`/`run` in a directory writes a gitignored `.boardwalk/project.json`
61
61
  with `{ orgSlug, workflowId }`. After that the workflow is identified by that stored **id**, so
62
- `--org` is optional and renaming `meta.name` or the entry file updates the same workflow instead of
62
+ `--org` is optional and renaming `meta.slug` or the entry file updates the same workflow instead of
63
63
  forking a new one. On a fresh clone, pass `--org` once to re-link (it adopts an existing same-name
64
64
  workflow if present, else creates one).
65
65
 
package/dist/client.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { FetchLike } from "./auth/pkce.js";
2
2
  export interface WorkflowSummary {
3
3
  id: string;
4
- name: string;
4
+ slug: string;
5
5
  currentVersionId: string | null;
6
6
  }
7
7
  export interface DeployResult {
@@ -31,7 +31,7 @@ export interface RunSummary {
31
31
  export interface RunListItem {
32
32
  id: string;
33
33
  workflowId: string;
34
- workflowName: string | null;
34
+ workflowSlug: string | null;
35
35
  status: string;
36
36
  triggerKind: string | null;
37
37
  createdAt: number;
package/dist/client.js CHANGED
@@ -227,7 +227,7 @@ export class BoardwalkClient {
227
227
  cachedReadTokens: numOr(cache.totalCachedRead, 0),
228
228
  },
229
229
  byModel: usageLines(u.byModel, "model"),
230
- byWorkflow: usageLines(u.byWorkflowUsage, "workflowName"),
230
+ byWorkflow: usageLines(u.byWorkflowUsage, "workflowSlug"),
231
231
  };
232
232
  }
233
233
  }
@@ -243,7 +243,7 @@ function parseRunRow(row) {
243
243
  return {
244
244
  id: row.id,
245
245
  workflowId: typeof row.workflowId === "string" ? row.workflowId : "",
246
- workflowName: typeof row.workflowName === "string" ? row.workflowName : null,
246
+ workflowSlug: typeof row.workflowSlug === "string" ? row.workflowSlug : null,
247
247
  status: row.status,
248
248
  triggerKind: typeof row.triggerKind === "string" ? row.triggerKind : null,
249
249
  createdAt: numOr(row.createdAt, 0),
@@ -279,7 +279,7 @@ function isWorkflowSummary(value) {
279
279
  if (!isRecord(value))
280
280
  return false;
281
281
  return (typeof value.id === "string" &&
282
- typeof value.name === "string" &&
282
+ typeof value.slug === "string" &&
283
283
  (value.currentVersionId === null || typeof value.currentVersionId === "string"));
284
284
  }
285
285
  function isVersion(value) {
@@ -31,7 +31,7 @@ export async function runDeploy(opts, deps) {
31
31
  const dep = await deployWithLink(client, { orgSlug: opts.org, target: opts.file, prog });
32
32
  if (dep.gitignoreUpdated)
33
33
  log(" linked → .boardwalk/project.json (added .boardwalk/ to .gitignore)");
34
- log(`✓ ${dep.outcome} "${prog.name}" version ${String(dep.versionNumber)} (${dep.workflowId})`);
34
+ log(`✓ ${dep.outcome} "${prog.slug}" version ${String(dep.versionNumber)} (${dep.workflowId})`);
35
35
  }
36
36
  /** Read-only preview of what `deploy` would do (no writes). */
37
37
  async function printPlan(client, opts, prog, log) {
@@ -41,12 +41,12 @@ async function printPlan(client, opts, prog, log) {
41
41
  return;
42
42
  }
43
43
  if (opts.org === undefined || opts.org.length === 0) {
44
- log(`plan: CREATE "${prog.name}" (unlinked — pass --org to check for an existing match)`);
44
+ log(`plan: CREATE "${prog.slug}" (unlinked — pass --org to check for an existing match)`);
45
45
  return;
46
46
  }
47
- const plan = planDeploy(await client.listWorkflows(opts.org), prog.name);
47
+ const plan = planDeploy(await client.listWorkflows(opts.org), prog.slug);
48
48
  log(plan.action === "create"
49
- ? `plan: CREATE "${prog.name}" in org ${opts.org}`
50
- : `plan: ADOPT existing "${prog.name}" (${plan.workflowId ?? "?"}) → new version`);
49
+ ? `plan: CREATE "${prog.slug}" in org ${opts.org}`
50
+ : `plan: ADOPT existing "${prog.slug}" (${plan.workflowId ?? "?"}) → new version`);
51
51
  }
52
52
  //# sourceMappingURL=deploy.js.map
@@ -70,7 +70,7 @@ export async function runDev(opts, deps = {}) {
70
70
  });
71
71
  try {
72
72
  const workflow = engine.deploy(program);
73
- const run = engine.start(workflow.name, input);
73
+ const run = engine.start(workflow.slug, input);
74
74
  runId = run.id;
75
75
  const result = await engine.wait(run.id);
76
76
  if (result.status === "completed")
@@ -9,4 +9,4 @@ export interface InitDeps {
9
9
  }
10
10
  export declare function runInit(opts: InitOptions, deps?: InitDeps): Promise<void>;
11
11
  /** Derive a manifest-legal workflow slug from the target directory's basename. */
12
- export declare function workflowNameFor(absDir: string): string;
12
+ export declare function workflowSlugFor(absDir: string): string;
@@ -66,7 +66,7 @@ export async function runInit(opts, deps = {}) {
66
66
  const builtin = BUILTIN_TEMPLATES[opts.template];
67
67
  if (builtin !== undefined) {
68
68
  const dir = resolve(opts.dir);
69
- const slug = workflowNameFor(dir);
69
+ const slug = workflowSlugFor(dir);
70
70
  const title = titleCaseSlug(slug);
71
71
  const files = Object.fromEntries(Object.entries(builtin).map(([rel, body]) => [
72
72
  rel,
@@ -167,7 +167,7 @@ function isRegistryTemplate(value) {
167
167
  value.files.length > 0);
168
168
  }
169
169
  /** Derive a manifest-legal workflow slug from the target directory's basename. */
170
- export function workflowNameFor(absDir) {
170
+ export function workflowSlugFor(absDir) {
171
171
  const base = basename(absDir)
172
172
  .toLowerCase()
173
173
  .replace(/[^a-z0-9-]+/g, "-")
@@ -66,7 +66,7 @@ export async function runRun(opts, deps) {
66
66
  const dep = await deployWithLink(client, { orgSlug: opts.org, target: opts.file, prog });
67
67
  if (dep.gitignoreUpdated)
68
68
  log(" linked → .boardwalk/project.json (added .boardwalk/ to .gitignore)");
69
- log(`✓ ${dep.outcome} "${prog.name}" version ${String(dep.versionNumber)}`);
69
+ log(`✓ ${dep.outcome} "${prog.slug}" version ${String(dep.versionNumber)}`);
70
70
  const input = parseInput(opts.input);
71
71
  const run = await client.triggerRun(dep.orgSlug, dep.workflowId, input);
72
72
  log(`▶ run ${run.id} triggered (${run.status})`);
@@ -83,7 +83,7 @@ export function formatRuns(org, runs, now) {
83
83
  ` ${col("RUN ID", ID_W)}${col("WORKFLOW", WF_W)}${col("STATUS", STATUS_W)}${col("TRIGGER", TRIGGER_W)}${col("AGE", AGE_W)}DURATION`,
84
84
  ];
85
85
  for (const r of runs) {
86
- const wf = r.workflowName ?? r.workflowId;
86
+ const wf = r.workflowSlug ?? r.workflowId;
87
87
  lines.push(` ${col(r.id, ID_W)}${col(wf, WF_W)}${col(r.status, STATUS_W)}${col(r.triggerKind ?? "—", TRIGGER_W)}${col(age(r.createdAt, now), AGE_W)}${duration(r.runtimeSeconds)}`);
88
88
  }
89
89
  return lines;
@@ -94,7 +94,7 @@ export function formatRunDetail(run, now) {
94
94
  const lines = [
95
95
  `Run ${run.id}`,
96
96
  "",
97
- field("Workflow", run.workflowName ?? run.workflowId),
97
+ field("Workflow", run.workflowSlug ?? run.workflowId),
98
98
  field("Status", status),
99
99
  field("Trigger", run.triggerKind ?? "—"),
100
100
  field("Created", `${isoUtc(run.createdAt)} (${age(run.createdAt, now)} ago)`),
@@ -1,7 +1,7 @@
1
1
  import { type BuiltArtifact } from "./artifact.js";
2
2
  import type { BoardwalkClient, WorkflowSummary } from "./client.js";
3
3
  export interface PreparedProgram {
4
- name: string;
4
+ slug: string;
5
5
  /** Entry module inside the artifact (e.g. `index.mjs`). */
6
6
  entry: string;
7
7
  /** The built, content-addressed program artifact (tarball + digest + metadata). */
@@ -9,17 +9,17 @@ export interface PreparedProgram {
9
9
  }
10
10
  /**
11
11
  * Resolve a target path to its deployable artifact: build the program (bundle + assets → tarball,
12
- * content-addressed) and extract `meta.name` from the bundled entry for the deploy identity.
12
+ * content-addressed) and extract `meta.slug` from the bundled entry for the deploy identity.
13
13
  */
14
14
  export declare function loadProgram(file: string): Promise<PreparedProgram>;
15
15
  export interface DeployPlan {
16
16
  action: "create" | "update";
17
- name: string;
17
+ slug: string;
18
18
  /** Present only for `update` — the existing workflow id to PUT. */
19
19
  workflowId?: string;
20
20
  }
21
- /** Decide create vs update by matching the program name against the org's existing workflows. */
22
- export declare function planDeploy(existing: readonly WorkflowSummary[], name: string): DeployPlan;
21
+ /** Decide create vs update by matching the program slug against the org's existing workflows. */
22
+ export declare function planDeploy(existing: readonly WorkflowSummary[], slug: string): DeployPlan;
23
23
  export interface DeployResultSummary {
24
24
  workflowId: string;
25
25
  orgSlug: string;
@@ -15,19 +15,19 @@ import { buildArtifact } from "./artifact.js";
15
15
  import { projectDirFor, readLink, writeLink } from "./project.js";
16
16
  /**
17
17
  * Resolve a target path to its deployable artifact: build the program (bundle + assets → tarball,
18
- * content-addressed) and extract `meta.name` from the bundled entry for the deploy identity.
18
+ * content-addressed) and extract `meta.slug` from the bundled entry for the deploy identity.
19
19
  */
20
20
  export async function loadProgram(file) {
21
21
  const artifact = await buildArtifact(file);
22
- const name = extractWorkflowSlug(artifact.entrySource, artifact.entry);
23
- return { name, entry: artifact.entry, artifact };
22
+ const slug = extractWorkflowSlug(artifact.entrySource, artifact.entry);
23
+ return { slug, entry: artifact.entry, artifact };
24
24
  }
25
- /** Decide create vs update by matching the program name against the org's existing workflows. */
26
- export function planDeploy(existing, name) {
27
- const match = existing.find((w) => w.name === name);
25
+ /** Decide create vs update by matching the program slug against the org's existing workflows. */
26
+ export function planDeploy(existing, slug) {
27
+ const match = existing.find((w) => w.slug === slug);
28
28
  return match !== undefined
29
- ? { action: "update", name, workflowId: match.id }
30
- : { action: "create", name };
29
+ ? { action: "update", slug, workflowId: match.id }
30
+ : { action: "create", slug };
31
31
  }
32
32
  /** The artifact reference recorded on the version (everything but the bytes, which go to storage). */
33
33
  function refOf(artifact) {
@@ -56,7 +56,7 @@ export async function deployWithLink(client, ctx) {
56
56
  // Unlinked: adopt an existing workflow with the same name, if any (so a second machine re-links
57
57
  // instead of creating a duplicate). Otherwise we'll create below.
58
58
  if (workflowId === null) {
59
- const match = (await client.listWorkflows(orgSlug)).find((w) => w.name === ctx.prog.name);
59
+ const match = (await client.listWorkflows(orgSlug)).find((w) => w.slug === ctx.prog.slug);
60
60
  if (match !== undefined) {
61
61
  workflowId = match.id;
62
62
  outcome = "adopted";
@@ -10,12 +10,12 @@ export interface DevRunResult {
10
10
  export interface DevEngine {
11
11
  /** Subscribe to the run's stamped events (the envelope is already applied). */
12
12
  onEvent(listener: (event: RunEvent) => void): () => void;
13
- /** Deploy the bundled program; returns the derived workflow name. */
13
+ /** Deploy the bundled program; returns the derived workflow slug. */
14
14
  deploy(program: string): {
15
- name: string;
15
+ slug: string;
16
16
  };
17
17
  /** Queue + dispatch a run; returns its id immediately. */
18
- start(workflowName: string, input: JsonValue | undefined): {
18
+ start(slug: string, input: JsonValue | undefined): {
19
19
  id: string;
20
20
  };
21
21
  /** Resolve when the run reaches a terminal status. */
@@ -23,10 +23,10 @@ export const createDevEngine = (opts) => {
23
23
  }),
24
24
  deploy: (program) => {
25
25
  const workflow = engine.deployWorkflow({ program });
26
- return { name: workflow.name };
26
+ return { slug: workflow.slug };
27
27
  },
28
- start: (workflowName, input) => {
29
- const run = engine.startRun(workflowName, input !== undefined ? { input } : {});
28
+ start: (slug, input) => {
29
+ const run = engine.startRun(slug, input !== undefined ? { input } : {});
30
30
  return { id: run.id };
31
31
  },
32
32
  wait: async (runId) => {
@@ -1 +1 @@
1
- {"version":3,"file":"engine.js","sourceRoot":"","sources":["../../src/dev/engine.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAE/B,uCAAuC;AACvC,EAAE;AACF,8FAA8F;AAC9F,8FAA8F;AAC9F,gGAAgG;AAChG,6FAA6F;AAC7F,oEAAoE;AACpE,EAAE;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CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YACxE,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;QACxB,CAAC;QACD,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACpB,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;YAC3C,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC;QACtE,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC;QAC1C,KAAK,EAAE,GAAG,EAAE;YACV,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC,CAAC"}
package/dist/project.js CHANGED
@@ -2,7 +2,7 @@
2
2
  // Project link — the Vercel-style tie between a local workflow directory and its deployed workflow.
3
3
  //
4
4
  // `<projectDir>/.boardwalk/project.json` (gitignored) stores `{ orgSlug, workflowId }`. Once linked,
5
- // `deploy`/`run` update the workflow BY ID — so renaming `meta.name` (or the entry file) just
5
+ // `deploy`/`run` update the workflow BY ID — so renaming `meta.slug` (or the entry file) just
6
6
  // updates the same workflow instead of forking a new one, and `--org` is no longer needed. The id is
7
7
  // environment-specific (a dev workflow id ≠ prod), so the link is gitignored, not committed.
8
8
  //
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boardwalk-labs/cli",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "The boardwalk CLI: author, validate, run, and deploy Boardwalk workflows.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "boardwalk": "tsx src/index.ts"
36
36
  },
37
37
  "dependencies": {
38
- "@boardwalk-labs/engine": "^0.1.4",
38
+ "@boardwalk-labs/engine": "^0.1.5",
39
39
  "@boardwalk-labs/workflow": "^0.1.5",
40
40
  "commander": "^13.1.0",
41
41
  "env-paths": "^3.0.0",