@lunora/workflow 1.0.0-alpha.20 → 1.0.0-alpha.22

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.
@@ -1,5 +1,5 @@
1
1
  import { WorkflowEntrypoint, WorkflowEvent, WorkflowStep } from 'cloudflare:workers';
2
- import { W as WorkflowDefinition } from "../packem_shared/types.d-DZlXmeGi.mjs";
2
+ import { W as WorkflowDefinition } from "../packem_shared/types.d-CZ1pcdmw.mjs";
3
3
  import '@lunora/values';
4
4
  /**
5
5
  * Base class for the generated `WorkflowEntrypoint` classes. Applies a
@@ -11,7 +11,7 @@ import '@lunora/values';
11
11
  *
12
12
  * ```ts
13
13
  * export class OrderPipelineWorkflow extends LunoraWorkflow {
14
- * constructor(ctx: ExecutionContext, env: Record<string, unknown>) {
14
+ * constructor(ctx: ExecutionContext, env: Record<string, unknown>) {
15
15
  * super(ctx, env, orderPipeline, "orderPipeline");
16
16
  * }
17
17
  * }
@@ -1,5 +1,5 @@
1
1
  import { WorkflowEntrypoint, WorkflowEvent, WorkflowStep } from 'cloudflare:workers';
2
- import { W as WorkflowDefinition } from "../packem_shared/types.d-DZlXmeGi.js";
2
+ import { W as WorkflowDefinition } from "../packem_shared/types.d-CZ1pcdmw.js";
3
3
  import '@lunora/values';
4
4
  /**
5
5
  * Base class for the generated `WorkflowEntrypoint` classes. Applies a
@@ -11,7 +11,7 @@ import '@lunora/values';
11
11
  *
12
12
  * ```ts
13
13
  * export class OrderPipelineWorkflow extends LunoraWorkflow {
14
- * constructor(ctx: ExecutionContext, env: Record&lt;string, unknown>) {
14
+ * constructor(ctx: ExecutionContext, env: Record<string, unknown>) {
15
15
  * super(ctx, env, orderPipeline, "orderPipeline");
16
16
  * }
17
17
  * }
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as Workflows, L as LunoraWorkflowsOptions, S as StepArgsValidator, b as StepConfig, c as StepDefinition, d as WorkflowConfig, W as WorkflowDefinition, e as WorkflowBranch, f as WorkflowInstanceStatus, g as WorkflowEventLike, h as WorkflowStepLike, i as WorkflowRunContext, j as WorkflowLogger, k as WorkflowRunFunction, l as WorkflowRunStepFunction } from "./packem_shared/types.d-DZlXmeGi.mjs";
2
- export type { A as ArgsOf, B as BranchCompensationParams, F as FunctionReference, I as InferStepArgs, R as RunFunctionOptions, m as RunStepOptions, n as StepHandler, o as StepRollbackContext, p as StepRollbackHandler, q as StepRunContext, r as WorkflowBindingLike, s as WorkflowBranchOutputs, t as WorkflowCreateOptions, u as WorkflowHandle, v as WorkflowHandler, w as WorkflowInstanceLike, x as WorkflowParallelFunction, y as WorkflowRollbackContextLike, z as WorkflowRollbackHandlerLike, C as WorkflowSpawnFunction, D as WorkflowSpawnOptions, E as WorkflowStatusResult, G as WorkflowStepConfigLike, H as WorkflowStepContextLike, J as WorkflowStepRollbackOptionsLike } from "./packem_shared/types.d-DZlXmeGi.mjs";
1
+ import { a as Workflows, L as LunoraWorkflowsOptions, S as StepArgsValidator, b as StepConfig, c as StepDefinition, d as WorkflowConfig, W as WorkflowDefinition, e as WorkflowBranch, f as WorkflowInstanceStatus, g as WorkflowEventLike, h as WorkflowStepLike, i as WorkflowRunContext, j as WorkflowLogger, k as WorkflowRunFunction, l as WorkflowRunStepFunction } from "./packem_shared/types.d-CZ1pcdmw.mjs";
2
+ export type { A as ArgsOf, B as BranchCompensationParams, F as FunctionReference, I as InferStepArgs, R as RunFunctionOptions, m as RunStepOptions, n as StepHandler, o as StepRollbackContext, p as StepRollbackHandler, q as StepRunContext, r as WorkflowBindingLike, s as WorkflowBranchOutputs, t as WorkflowCreateOptions, u as WorkflowHandle, v as WorkflowHandler, w as WorkflowInstanceLike, x as WorkflowParallelFunction, y as WorkflowRollbackContextLike, z as WorkflowRollbackHandlerLike, C as WorkflowSpawnFunction, D as WorkflowSpawnOptions, E as WorkflowStatusResult, G as WorkflowStepConfigLike, H as WorkflowStepContextLike, J as WorkflowStepRollbackOptionsLike } from "./packem_shared/types.d-CZ1pcdmw.mjs";
3
3
  import { LunoraError } from '@lunora/errors';
4
4
  import '@lunora/values';
5
5
  /** Wiring info for one declared workflow, emitted by codegen into the generated shard. */
@@ -86,7 +86,7 @@ declare const workflowDefaultName: (exportName: string) => string;
86
86
  * import { defineWorkflow } from "@lunora/workflow";
87
87
  * import { api } from "./_generated/api";
88
88
  *
89
- * export const orderPipeline = defineWorkflow&lt;{ orderId: string }>({
89
+ * export const orderPipeline = defineWorkflow<{ orderId: string }>({
90
90
  * handler: async (ctx) => {
91
91
  * const order = await ctx.step.do("load", () => ctx.run(api.orders.get, { id: ctx.params.orderId }));
92
92
  * await ctx.step.sleep("cool-off", "1 minute");
@@ -235,7 +235,7 @@ interface RunContextOptions<Params> {
235
235
  declare const createWorkflowRunContext: <Params = Record<string, unknown>>(options: RunContextOptions<Params>) => WorkflowRunContext<Params>;
236
236
  /**
237
237
  * Validate a step's args through its validator map, prefixing any
238
- * `ValidationError` with `step args.&lt;key>` so the failure points at the
238
+ * `ValidationError` with `step args.<key>` so the failure points at the
239
239
  * offending field. Delegates to `@lunora/values`' shared {@link parseValidatorMap}
240
240
  * — the same parser the procedure builder and HTTP routes use — so the
241
241
  * optional-skip and error-prefix semantics stay in lockstep across the framework.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { a as Workflows, L as LunoraWorkflowsOptions, S as StepArgsValidator, b as StepConfig, c as StepDefinition, d as WorkflowConfig, W as WorkflowDefinition, e as WorkflowBranch, f as WorkflowInstanceStatus, g as WorkflowEventLike, h as WorkflowStepLike, i as WorkflowRunContext, j as WorkflowLogger, k as WorkflowRunFunction, l as WorkflowRunStepFunction } from "./packem_shared/types.d-DZlXmeGi.js";
2
- export type { A as ArgsOf, B as BranchCompensationParams, F as FunctionReference, I as InferStepArgs, R as RunFunctionOptions, m as RunStepOptions, n as StepHandler, o as StepRollbackContext, p as StepRollbackHandler, q as StepRunContext, r as WorkflowBindingLike, s as WorkflowBranchOutputs, t as WorkflowCreateOptions, u as WorkflowHandle, v as WorkflowHandler, w as WorkflowInstanceLike, x as WorkflowParallelFunction, y as WorkflowRollbackContextLike, z as WorkflowRollbackHandlerLike, C as WorkflowSpawnFunction, D as WorkflowSpawnOptions, E as WorkflowStatusResult, G as WorkflowStepConfigLike, H as WorkflowStepContextLike, J as WorkflowStepRollbackOptionsLike } from "./packem_shared/types.d-DZlXmeGi.js";
1
+ import { a as Workflows, L as LunoraWorkflowsOptions, S as StepArgsValidator, b as StepConfig, c as StepDefinition, d as WorkflowConfig, W as WorkflowDefinition, e as WorkflowBranch, f as WorkflowInstanceStatus, g as WorkflowEventLike, h as WorkflowStepLike, i as WorkflowRunContext, j as WorkflowLogger, k as WorkflowRunFunction, l as WorkflowRunStepFunction } from "./packem_shared/types.d-CZ1pcdmw.js";
2
+ export type { A as ArgsOf, B as BranchCompensationParams, F as FunctionReference, I as InferStepArgs, R as RunFunctionOptions, m as RunStepOptions, n as StepHandler, o as StepRollbackContext, p as StepRollbackHandler, q as StepRunContext, r as WorkflowBindingLike, s as WorkflowBranchOutputs, t as WorkflowCreateOptions, u as WorkflowHandle, v as WorkflowHandler, w as WorkflowInstanceLike, x as WorkflowParallelFunction, y as WorkflowRollbackContextLike, z as WorkflowRollbackHandlerLike, C as WorkflowSpawnFunction, D as WorkflowSpawnOptions, E as WorkflowStatusResult, G as WorkflowStepConfigLike, H as WorkflowStepContextLike, J as WorkflowStepRollbackOptionsLike } from "./packem_shared/types.d-CZ1pcdmw.js";
3
3
  import { LunoraError } from '@lunora/errors';
4
4
  import '@lunora/values';
5
5
  /** Wiring info for one declared workflow, emitted by codegen into the generated shard. */
@@ -86,7 +86,7 @@ declare const workflowDefaultName: (exportName: string) => string;
86
86
  * import { defineWorkflow } from "@lunora/workflow";
87
87
  * import { api } from "./_generated/api";
88
88
  *
89
- * export const orderPipeline = defineWorkflow&lt;{ orderId: string }>({
89
+ * export const orderPipeline = defineWorkflow<{ orderId: string }>({
90
90
  * handler: async (ctx) => {
91
91
  * const order = await ctx.step.do("load", () => ctx.run(api.orders.get, { id: ctx.params.orderId }));
92
92
  * await ctx.step.sleep("cool-off", "1 minute");
@@ -235,7 +235,7 @@ interface RunContextOptions<Params> {
235
235
  declare const createWorkflowRunContext: <Params = Record<string, unknown>>(options: RunContextOptions<Params>) => WorkflowRunContext<Params>;
236
236
  /**
237
237
  * Validate a step's args through its validator map, prefixing any
238
- * `ValidationError` with `step args.&lt;key>` so the failure points at the
238
+ * `ValidationError` with `step args.<key>` so the failure points at the
239
239
  * offending field. Delegates to `@lunora/values`' shared {@link parseValidatorMap}
240
240
  * — the same parser the procedure builder and HTTP routes use — so the
241
241
  * optional-skip and error-prefix semantics stay in lockstep across the framework.
@@ -63,7 +63,7 @@ interface WorkflowBindingLike<Params = Record<string, unknown>> {
63
63
  createBatch: (batch: ReadonlyArray<WorkflowCreateOptions<Params>>) => Promise<WorkflowInstanceLike[]>;
64
64
  get: (id: string) => Promise<WorkflowInstanceLike>;
65
65
  }
66
- /** The `event` argument a workflow `run` receives. Mirrors `WorkflowEvent&lt;T>`. */
66
+ /** The `event` argument a workflow `run` receives. Mirrors `WorkflowEvent<T>`. */
67
67
  interface WorkflowEventLike<Params = Record<string, unknown>> {
68
68
  readonly instanceId: string;
69
69
  readonly payload: Readonly<Params>;
@@ -120,10 +120,10 @@ interface WorkflowStepRollbackOptionsLike<T = unknown> {
120
120
  * `do`'s two overloads mirror Cloudflare's: an optional leading `config` and an
121
121
  * optional trailing `rollback` (compensation run when a later step fails).
122
122
  *
123
- * Known mirror gap: Cloudflare constrains `do&lt;T extends Rpc.Serializable&lt;T>>` so
123
+ * Known mirror gap: Cloudflare constrains `do<T extends Rpc.Serializable<T>>` so
124
124
  * a non-serializable step result (a function, `Map`, class instance, …) is a
125
125
  * compile error there. `Rpc.Serializable` lives in `@cloudflare/workers-types`
126
- * and is not Node-importable, so this Node-safe mirror uses a bare `&lt;T>` and
126
+ * and is not Node-importable, so this Node-safe mirror uses a bare `<T>` and
127
127
  * cannot enforce that — a non-serializable result type-checks here but fails at
128
128
  * runtime on the platform. Keep step results JSON-serialisable.
129
129
  */
@@ -298,7 +298,7 @@ interface WorkflowBranch<Output = unknown> {
298
298
  * ordinary declared workflow, so it can `ctx.runStep(...)` its own undo logic.
299
299
  */
300
300
  interface BranchCompensationParams {
301
- /** Index signature: this is a workflow `params` bag, so it is a valid `Record&lt;string, unknown>` payload. */
301
+ /** Index signature: this is a workflow `params` bag, so it is a valid `Record<string, unknown>` payload. */
302
302
  [key: string]: unknown;
303
303
  /** The export name of the completed branch being compensated. */
304
304
  branch: string;
@@ -63,7 +63,7 @@ interface WorkflowBindingLike<Params = Record<string, unknown>> {
63
63
  createBatch: (batch: ReadonlyArray<WorkflowCreateOptions<Params>>) => Promise<WorkflowInstanceLike[]>;
64
64
  get: (id: string) => Promise<WorkflowInstanceLike>;
65
65
  }
66
- /** The `event` argument a workflow `run` receives. Mirrors `WorkflowEvent&lt;T>`. */
66
+ /** The `event` argument a workflow `run` receives. Mirrors `WorkflowEvent<T>`. */
67
67
  interface WorkflowEventLike<Params = Record<string, unknown>> {
68
68
  readonly instanceId: string;
69
69
  readonly payload: Readonly<Params>;
@@ -120,10 +120,10 @@ interface WorkflowStepRollbackOptionsLike<T = unknown> {
120
120
  * `do`'s two overloads mirror Cloudflare's: an optional leading `config` and an
121
121
  * optional trailing `rollback` (compensation run when a later step fails).
122
122
  *
123
- * Known mirror gap: Cloudflare constrains `do&lt;T extends Rpc.Serializable&lt;T>>` so
123
+ * Known mirror gap: Cloudflare constrains `do<T extends Rpc.Serializable<T>>` so
124
124
  * a non-serializable step result (a function, `Map`, class instance, …) is a
125
125
  * compile error there. `Rpc.Serializable` lives in `@cloudflare/workers-types`
126
- * and is not Node-importable, so this Node-safe mirror uses a bare `&lt;T>` and
126
+ * and is not Node-importable, so this Node-safe mirror uses a bare `<T>` and
127
127
  * cannot enforce that — a non-serializable result type-checks here but fails at
128
128
  * runtime on the platform. Keep step results JSON-serialisable.
129
129
  */
@@ -298,7 +298,7 @@ interface WorkflowBranch<Output = unknown> {
298
298
  * ordinary declared workflow, so it can `ctx.runStep(...)` its own undo logic.
299
299
  */
300
300
  interface BranchCompensationParams {
301
- /** Index signature: this is a workflow `params` bag, so it is a valid `Record&lt;string, unknown>` payload. */
301
+ /** Index signature: this is a workflow `params` bag, so it is a valid `Record<string, unknown>` payload. */
302
302
  [key: string]: unknown;
303
303
  /** The export name of the completed branch being compensated. */
304
304
  branch: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/workflow",
3
- "version": "1.0.0-alpha.20",
3
+ "version": "1.0.0-alpha.22",
4
4
  "description": "Durable workflows for Lunora: defineWorkflow over Cloudflare Workflows, generated WorkflowEntrypoint classes, and the ctx.workflows surface",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -48,8 +48,8 @@
48
48
  "access": "public"
49
49
  },
50
50
  "dependencies": {
51
- "@lunora/errors": "1.0.0-alpha.13",
52
- "@lunora/values": "1.0.0-alpha.18"
51
+ "@lunora/errors": "1.0.0-alpha.15",
52
+ "@lunora/values": "1.0.0-alpha.20"
53
53
  },
54
54
  "engines": {
55
55
  "node": "^22.15.0 || >=24.11.0"