@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 +1 -1
- package/dist/events.js +1 -0
- package/dist/extract.js +1 -0
- package/dist/host.js +1 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -3
- package/dist/manifest.js +1 -0
- package/dist/meta.js +1 -7
- package/dist/runtime.js +1 -0
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
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`, `
|
|
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
package/dist/extract.js
CHANGED
package/dist/host.js
CHANGED
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
//
|
|
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 `
|
|
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
|
|
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 `
|
|
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
|
|
20
|
+
export function phase(name, opts) {
|
|
20
21
|
const host = requireHost();
|
|
21
22
|
if (host.setPhase === undefined) {
|
|
22
|
-
throw new Error("
|
|
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
package/dist/meta.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
//
|
|
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
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").
|
|
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
|
-
//
|
|
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.
|
|
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": {
|