@boardwalk-labs/workflow 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.
package/README.md CHANGED
@@ -6,7 +6,8 @@ Author **Boardwalk workflows** in plain TypeScript — agent loops, schedules, d
6
6
  import { agent, output, secrets, type WorkflowMeta } from "@boardwalk-labs/workflow";
7
7
 
8
8
  export const meta = {
9
- name: "morning-digest",
9
+ slug: "morning-digest",
10
+ title: "Morning Digest",
10
11
  description: "Summarize my open issues every weekday at 9am",
11
12
  triggers: [{ kind: "cron", expr: "0 9 * * 1-5" }],
12
13
  permissions: { secrets: [{ name: "GITHUB_TOKEN" }] },
@@ -35,7 +36,7 @@ A workflow is **a script**: the `meta` export is a **pure literal** (engines der
35
36
 
36
37
  - **`agent(prompt, opts?)`** — run an agent loop and get its final text (or `schema`-validated JSON). `model` is optional: name one explicitly, or let the engine resolve it. Loops can use **tools** (built-in or program-defined), **MCP servers**, **skills**, and **memory** — each brought **per call** on `agent()`; the manifest declares none of them.
37
38
  - **`sleep(ms | { until })`** — durable wait; the run holds, locals survive.
38
- - **`workflows.call(name, input)`** — durably invoke another workflow and await its result; idempotent across restarts. `workflows.run` is the fire-and-forget sibling.
39
+ - **`workflows.call(slug, input)`** — durably invoke another workflow by its slug and await its result; idempotent across restarts. `workflows.run` is the fire-and-forget sibling.
39
40
  - **`secrets.get(name)`** — read a secret declared in `permissions.secrets`. Resolved from your `.env` locally, from the encrypted vault on hosted Boardwalk. Secret values never reach model context — the SDK contract requires engines to redact them.
40
41
  - **`output(value)`** — declare the run's result.
41
42
  - **Memory = a persistent directory, per agent.** `agent(prompt, { memory: "memory/triager" })` names any workspace-relative directory; the engine auto-persists it across runs — no declaration needed. The loop gets read/write file tools scoped to it, and your code can read and write the same files. (`workspace.persist` is the separate knob for non-memory state your program manages directly.)
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const workflowManifestSchema: z.ZodObject<{
3
- name: z.ZodString;
3
+ slug: z.ZodString;
4
+ title: z.ZodOptional<z.ZodString>;
4
5
  description: z.ZodOptional<z.ZodString>;
5
6
  triggers: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
6
7
  kind: z.ZodLiteral<"cron">;
package/dist/manifest.js CHANGED
@@ -12,12 +12,21 @@ import { z } from "zod";
12
12
  // ============================================================================
13
13
  // Shared scalars
14
14
  // ============================================================================
15
- const NAME_RE = /^[a-zA-Z0-9-]+$/;
16
- const workflowName = z
15
+ const SLUG_RE = /^[a-zA-Z0-9-]+$/;
16
+ /** The workflow's identity: a URL-safe slug, stable across the program's life (referenced by the
17
+ * CLI, `workflows.call`, and the API). The human-readable label is `title`, not this. */
18
+ const workflowSlug = z
17
19
  .string()
18
20
  .min(1)
19
21
  .max(100)
20
- .regex(NAME_RE, "name must be alphanumeric with hyphens");
22
+ .regex(SLUG_RE, "slug must be alphanumeric with hyphens");
23
+ /** The workflow's display label — free text, author-controlled. Falls back to a title-cased slug
24
+ * in UIs when omitted. One line only. */
25
+ const workflowTitle = z
26
+ .string()
27
+ .min(1)
28
+ .max(200)
29
+ .refine((s) => !s.includes("\n"), "title must be a single line");
21
30
  /** A short identifier (tool/MCP/skill/secret names). */
22
31
  const shortName = z.string().min(1).max(120);
23
32
  /** Loosely-typed JSON Schema objects (input_schema / output_schema / tool inputSchema). */
@@ -153,7 +162,7 @@ const permissionsSchema = z.strictObject({
153
162
  });
154
163
  const callableBySchema = z.union([
155
164
  z.strictObject({ roles: z.array(z.enum(["owner", "admin", "member", "viewer"])).min(1) }),
156
- z.strictObject({ workflows: z.array(workflowName).min(1) }),
165
+ z.strictObject({ workflows: z.array(workflowSlug).min(1) }),
157
166
  z.enum(["anyone_in_org", "users_only", "workflows_only"]),
158
167
  ]);
159
168
  const egressSchema = z.union([
@@ -181,7 +190,8 @@ const notificationSchema = z.union([
181
190
  // The manifest
182
191
  // ============================================================================
183
192
  export const workflowManifestSchema = z.strictObject({
184
- name: workflowName,
193
+ slug: workflowSlug,
194
+ title: workflowTitle.optional(),
185
195
  description: z.string().max(1000).optional(),
186
196
  triggers: z.array(triggerSchema).min(1),
187
197
  // NO top-level `secrets` — the secret allowlist is `permissions.secrets` (a secret you may read
package/dist/meta.d.ts CHANGED
@@ -141,7 +141,12 @@ export interface Workspace {
141
141
  * the program. Validated by `workflowManifestSchema`; unknown fields are errors.
142
142
  */
143
143
  export interface WorkflowMeta {
144
- name: string;
144
+ /** The workflow's identity: a URL-safe slug (alphanumeric + hyphens), stable across the program's
145
+ * life. Referenced by the CLI, `workflows.call`, and the API. The human label is `title`. */
146
+ slug: string;
147
+ /** Optional human-readable display label (free text, one line). UIs fall back to a title-cased
148
+ * slug when this is omitted, so set it only when the slug doesn't read well. */
149
+ title?: string;
145
150
  description?: string;
146
151
  /** At least one trigger is required. */
147
152
  triggers: readonly Trigger[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boardwalk-labs/workflow",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Author Boardwalk workflows in TypeScript: agent(), sleep(), workflows.call(), secrets, the manifest schema, and the run-event wire format.",
5
5
  "license": "MIT",
6
6
  "repository": {