@boardwalk-labs/workflow 0.1.1 → 0.1.2

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
@@ -27,7 +27,7 @@ A workflow is **a script**: the `meta` export is a **pure literal** (engines der
27
27
 
28
28
  | Import | What it is |
29
29
  | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
- | `@boardwalk-labs/workflow` | The author API: `agent()`, `sleep()`, `workflows.call()`, `secrets.get()`, `artifacts.write()`, `parallel()`, `input` / `output()` / `config`, `Phase()` — plus the manifest schema and run-event wire format |
30
+ | `@boardwalk-labs/workflow` | The author API: `agent()`, `sleep()`, `workflows.call()`, `secrets.get()`, `artifacts.write()`, `parallel()`, `input` / `output()` / `config`, `phase()` — plus the manifest schema and run-event wire format |
31
31
  | `@boardwalk-labs/workflow/runtime` | The **engine-facing** API: install a `WorkflowHost` before evaluating a program. Authors never import this |
32
32
  | `@boardwalk-labs/workflow/extract` | Static `meta` → manifest extraction (AST-based, never executes the program). Used by engines and tooling |
33
33
 
package/dist/events.js CHANGED
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: MIT
1
2
  // The run-event wire format — one typed, ordered stream per run, identical in every engine.
2
3
  //
3
4
  // Every event carries an envelope (runId, turnId, per-turn 1-based seq, server timestamp) and
package/dist/extract.js CHANGED
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: MIT
1
2
  // @boardwalk-labs/workflow/extract — static extraction of a workflow program's `meta` → manifest.
2
3
  //
3
4
  // A workflow is a TS/JS program file whose `export const meta = { … }` is a PURE LITERAL.
package/dist/host.js CHANGED
@@ -1,14 +1,4 @@
1
- // The host seam — the engine-implementation boundary of the SDK.
2
- //
3
- // `@boardwalk-labs/workflow` is a host-backed package: the hooks authors import (agent, sleep,
4
- // workflows.call, secrets.get, input) are thin facades over a `WorkflowHost` the *engine*
5
- // installs at runtime. hosted Boardwalk installs its hosted adapter; the local engine installs
6
- // one backed by the developer's environment. The author's program is identical either way —
7
- // explicit hooks instead of injected globals.
8
- //
9
- // State is a module-level singleton. Node ESM caches a module by resolved path, so the
10
- // program (which imports the hooks) and the engine (which installs the host) share ONE
11
- // instance of this module and therefore one host + one `input`.
1
+ // SPDX-License-Identifier: MIT
12
2
  let currentHost = null;
13
3
  /**
14
4
  * The trigger payload for the current run, exposed to the program as
package/dist/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { AgentOptions, ArtifactBody, ArtifactRef, CallOptions, JsonValue, PhaseOptions, SleepArg } from "./types.js";
2
2
  /**
3
3
  * Mark the current run phase for live-tail and run-log grouping. Everything after this call
4
- * belongs to the named phase until the next `Phase(...)` marker or the run ends. This is
4
+ * belongs to the named phase until the next `phase(...)` marker or the run ends. This is
5
5
  * observability-only; it does not checkpoint or skip code on restart.
6
6
  */
7
- export declare function Phase(name: string, opts?: PhaseOptions): void;
7
+ export declare function phase(name: string, opts?: PhaseOptions): void;
8
8
  /**
9
9
  * Run an agent leaf to completion. Without `opts.schema`, resolves to the leaf's final text
10
10
  * (`T` defaults to `string`); with a schema, resolves to the validated object — pass the
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: MIT
1
2
  // @boardwalk-labs/workflow — the author-facing API a workflow program imports.
2
3
  //
3
4
  // import { agent, workflows, sleep, secrets, input, type WorkflowMeta } from "@boardwalk-labs/workflow"
@@ -13,13 +14,13 @@
13
14
  import { requireHost, recordOutput } from "./host.js";
14
15
  /**
15
16
  * Mark the current run phase for live-tail and run-log grouping. Everything after this call
16
- * belongs to the named phase until the next `Phase(...)` marker or the run ends. This is
17
+ * belongs to the named phase until the next `phase(...)` marker or the run ends. This is
17
18
  * observability-only; it does not checkpoint or skip code on restart.
18
19
  */
19
- export function Phase(name, opts) {
20
+ export function phase(name, opts) {
20
21
  const host = requireHost();
21
22
  if (host.setPhase === undefined) {
22
- throw new Error("Phase is not supported by the installed engine");
23
+ throw new Error("phase is not supported by the installed engine");
23
24
  }
24
25
  host.setPhase(name, opts);
25
26
  }
package/dist/manifest.js CHANGED
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: MIT
1
2
  // workflowManifestSchema — the validator of record for a workflow's `meta`.
2
3
  //
3
4
  // One Zod schema, consumed by every engine (local `dev`, the self-hosted server, Boardwalk
package/dist/meta.js CHANGED
@@ -1,8 +1,2 @@
1
- // WorkflowMeta — the TypeScript shape of a workflow's `meta` export.
2
- //
3
- // A workflow program declares `export const meta = { … } satisfies WorkflowMeta`. The
4
- // `satisfies` operator is type-only and erased at compile time, so it does NOT break the
5
- // pure-literal static extraction engines perform over the source (see extract.ts). This type
6
- // is the author-facing typing; `workflowManifestSchema` (manifest.ts) is the validator of
7
- // record — the two are kept faithful to each other.
1
+ // SPDX-License-Identifier: MIT
8
2
  export {};
package/dist/runtime.js CHANGED
@@ -1,3 +1,4 @@
1
+ // SPDX-License-Identifier: MIT
1
2
  // @boardwalk-labs/workflow/runtime — the ENGINE-facing API.
2
3
  //
3
4
  // An engine imports this to install the host adapter and the trigger payload BEFORE
package/dist/types.d.ts CHANGED
@@ -97,7 +97,7 @@ export type SleepArg = number | {
97
97
  } | {
98
98
  until: string | Date;
99
99
  };
100
- /** Options for {@link import("./index.js").Phase}, the run-timeline marker. */
100
+ /** Options for {@link import("./index.js").phase}, the run-timeline marker. */
101
101
  export interface PhaseOptions {
102
102
  /**
103
103
  * Optional stable identifier for the phase. Omit for the engine to assign one in marker order.
package/dist/types.js CHANGED
@@ -1,2 +1,2 @@
1
- // Option/argument types for the workflow hooks (Phase, agent, workflows.call, sleep, secrets).
1
+ // SPDX-License-Identifier: MIT
2
2
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boardwalk-labs/workflow",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
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": {