@resonatehq/sdk 0.10.4 → 0.11.1

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.
Files changed (64) hide show
  1. package/README.md +60 -0
  2. package/dist/async/context.d.ts +270 -0
  3. package/dist/async/context.d.ts.map +1 -0
  4. package/dist/async/context.js +598 -0
  5. package/dist/async/context.js.map +1 -0
  6. package/dist/async/core.d.ts +61 -0
  7. package/dist/async/core.d.ts.map +1 -0
  8. package/dist/async/core.js +239 -0
  9. package/dist/async/core.js.map +1 -0
  10. package/dist/async/index.d.ts +4 -0
  11. package/dist/async/index.d.ts.map +1 -0
  12. package/dist/async/index.js +12 -0
  13. package/dist/async/index.js.map +1 -0
  14. package/dist/async/resonate.d.ts +98 -0
  15. package/dist/async/resonate.d.ts.map +1 -0
  16. package/dist/async/resonate.js +387 -0
  17. package/dist/async/resonate.js.map +1 -0
  18. package/dist/context.d.ts.map +1 -1
  19. package/dist/context.js +1 -1
  20. package/dist/context.js.map +1 -1
  21. package/dist/core.d.ts +1 -1
  22. package/dist/core.d.ts.map +1 -1
  23. package/dist/core.js +8 -2
  24. package/dist/core.js.map +1 -1
  25. package/dist/coroutine.d.ts.map +1 -1
  26. package/dist/coroutine.js +1 -1
  27. package/dist/coroutine.js.map +1 -1
  28. package/dist/heartbeat.d.ts.map +1 -1
  29. package/dist/heartbeat.js +1 -1
  30. package/dist/heartbeat.js.map +1 -1
  31. package/dist/index.d.ts +2 -2
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +2 -2
  34. package/dist/index.js.map +1 -1
  35. package/dist/network/http.d.ts +0 -20
  36. package/dist/network/http.d.ts.map +1 -1
  37. package/dist/network/http.js +5 -99
  38. package/dist/network/http.js.map +1 -1
  39. package/dist/network/local.js +1 -1
  40. package/dist/network/local.js.map +1 -1
  41. package/dist/network/nats.d.ts.map +1 -1
  42. package/dist/network/nats.js +1 -1
  43. package/dist/network/nats.js.map +1 -1
  44. package/dist/platform.d.ts +4 -0
  45. package/dist/platform.d.ts.map +1 -0
  46. package/dist/platform.js +24 -0
  47. package/dist/platform.js.map +1 -0
  48. package/dist/promises.d.ts.map +1 -1
  49. package/dist/promises.js +1 -1
  50. package/dist/promises.js.map +1 -1
  51. package/dist/resonate.d.ts.map +1 -1
  52. package/dist/resonate.js +14 -9
  53. package/dist/resonate.js.map +1 -1
  54. package/dist/schedules.d.ts.map +1 -1
  55. package/dist/schedules.js +1 -1
  56. package/dist/schedules.js.map +1 -1
  57. package/dist/trace.d.ts +11 -0
  58. package/dist/trace.d.ts.map +1 -1
  59. package/dist/trace.js +22 -0
  60. package/dist/trace.js.map +1 -1
  61. package/dist/util.d.ts.map +1 -1
  62. package/dist/util.js +1 -1
  63. package/dist/util.js.map +1 -1
  64. package/package.json +12 -1
package/README.md CHANGED
@@ -104,3 +104,63 @@ resonate tree countdown.1
104
104
  ```
105
105
 
106
106
  Now try killing the worker mid-countdown and restarting. **The countdown picks up right where it left off without missing a beat.**
107
+
108
+ ## Async/await
109
+
110
+ The SDK also ships an async/await engine: the same durable model, written with ordinary `async` functions instead of generators. Import it from `@resonatehq/sdk/async`:
111
+
112
+ ```typescript
113
+ import { Resonate, type Context } from "@resonatehq/sdk/async";
114
+
115
+ async function countdown(ctx: Context, count: number, delay: number) {
116
+ for (let i = count; i > 0; i--) {
117
+ // Run a function, persist its result
118
+ await ctx.run((ctx: Context) => console.log(`Countdown: ${i}`));
119
+ // Sleep
120
+ await ctx.sleep(delay * 1000);
121
+ }
122
+ console.log("Done!");
123
+ }
124
+
125
+ // Instantiate Resonate
126
+ const resonate = new Resonate({ url: "http://localhost:8001" });
127
+ // Register the function
128
+ resonate.register(countdown);
129
+ ```
130
+
131
+ Same server, same CLI, same durable promises — the rest of the quickstart is unchanged.
132
+
133
+ One difference to know about: operations are **eager**. Calling `ctx.run(...)` starts the work immediately and returns an awaitable handle, so fan-out is ordinary promise code:
134
+
135
+ ```typescript
136
+ async function checkout(ctx: Context) {
137
+ const payment = ctx.run(chargeCard); // starts now
138
+ const inventory = ctx.run(reserveItems); // runs concurrently
139
+ return await Promise.all([payment, inventory]);
140
+ }
141
+ ```
142
+
143
+ ## Migrating from generators
144
+
145
+ Both engines live in the same package and speak the same protocol to the same server, so you can migrate one function at a time. The mechanical changes:
146
+
147
+ | Generator engine | Async engine |
148
+ | --- | --- |
149
+ | `import { Resonate } from "@resonatehq/sdk"` | `import { Resonate } from "@resonatehq/sdk/async"` |
150
+ | `function* (context: Context, ...)` | `async function (ctx: Context, ...)` |
151
+ | `yield* context.run(...)`, `yield* context.sleep(...)` | `await ctx.run(...)`, `await ctx.sleep(...)` |
152
+ | `yield context.beginRun(...)`, later `yield future` | `const p = ctx.run(...)`, later `await p` — every op is eager |
153
+ | `resonate.run(id, func, ...args)` → the result | `resonate.run(id, func, ...args)` → a handle; `await handle.result()` |
154
+ | `resonate.beginRun(id, func, ...args)` → a handle | same call — there are no `begin*` variants, `run` *is* begin-run |
155
+
156
+ Two things to watch:
157
+
158
+ - **Retries are opt-in.** The generator engine retries plain functions with exponential backoff by default. The async engine never retries by default — an async workflow and a plain async function are indistinguishable at runtime, so there is no safe blanket default. To keep retry behavior, pass a policy explicitly:
159
+
160
+ ```typescript
161
+ import { Exponential } from "@resonatehq/sdk/async";
162
+
163
+ await ctx.run(chargeCard, ctx.options({ retryPolicy: new Exponential() }));
164
+ ```
165
+
166
+ - **Only await durable promises inside a workflow.** A plain `await` on a timer or network call is invisible to the engine — the workflow may resume after its execution pass has ended and abort. Wrap side effects in `ctx.run`, the same rule as `context.run` in the generator engine.
@@ -0,0 +1,270 @@
1
+ import type { Clock } from "../clock.js";
2
+ import { type ResonateError } from "../exceptions.js";
3
+ import type { Options, OptionsBuilder } from "../options.js";
4
+ import type { Registry } from "../registry.js";
5
+ import { type RetryPolicy } from "../retries.js";
6
+ import type { TraceCollector } from "../trace.js";
7
+ import type { Effects } from "../types.js";
8
+ export type AnyFunc = (ctx: any, ...args: any[]) => any;
9
+ export type Params<F> = F extends (ctx: any, ...args: infer P) => any ? P : never;
10
+ export type ParamsWithOptions<F> = [...Params<F>, Options?];
11
+ export type Return<F> = F extends (...args: any[]) => infer R ? Awaited<R> : never;
12
+ /**
13
+ * Read-only execution metadata available to every function. A "leaf" function
14
+ * types its first parameter as `Info` — it gets identity + dependencies but no
15
+ * durable operations, so it never suspends and always completes in one pass.
16
+ */
17
+ export interface Info {
18
+ readonly id: string;
19
+ readonly parentId: string;
20
+ readonly originId: string;
21
+ /** The id-generation prefix (resonate:prefix). Set once at the top and
22
+ * propagated down unchanged — through every child AND across detached
23
+ * re-roots — so recursive detached ids stay bounded. */
24
+ readonly prefixId: string;
25
+ readonly branchId: string;
26
+ readonly timeoutAt: number;
27
+ readonly attempt: number;
28
+ readonly version: number;
29
+ readonly func: string;
30
+ getDependency<T = any>(key: string): T | undefined;
31
+ }
32
+ /**
33
+ * Full durable API available to a "workflow" function (first parameter typed
34
+ * `Context`). All operations are eager — calling `run`/`rpc`/`sleep` begins the
35
+ * work immediately and returns an already-running {@link DurablePromise}.
36
+ * Awaiting one now is call-and-wait; holding several and awaiting them later is
37
+ * fan-out.
38
+ *
39
+ * A pending durable promise makes the returned promise **hang** (never settle)
40
+ * for this pass — the engine ends the pass out of band. So `await` here behaves
41
+ * like a normal JS promise: it only ever throws a real rejection.
42
+ */
43
+ export interface Context extends Info {
44
+ run<F extends AnyFunc>(func: F, ...args: ParamsWithOptions<F>): DurablePromise<Return<F>>;
45
+ run<T>(func: string, ...args: any[]): DurablePromise<T>;
46
+ rpc<F extends AnyFunc>(func: F, ...args: ParamsWithOptions<F>): DurablePromise<Return<F>>;
47
+ rpc<T>(func: string, ...args: any[]): DurablePromise<T>;
48
+ /**
49
+ * Spawns a workflow as a fresh root promise — independent execution lifecycle
50
+ * and replay scope (lineage break, new originId). Unlike `run`/`rpc`, the
51
+ * spawned workflow is not a child of the current invocation: it survives parent
52
+ * completion and is dispatched independently by the server.
53
+ *
54
+ * The returned promise resolves with a {@link DetachedHandle} once the spawn is
55
+ * durably created — it does NOT wait for, and the parent does NOT suspend on,
56
+ * the detached workflow's result. This is the primitive behind the bounded
57
+ * replay forever-loop (recursive-tail) pattern.
58
+ *
59
+ * @example
60
+ * ```ts
61
+ * async function playGame(ctx: Context, n: number) {
62
+ * // ...play one game...
63
+ * await ctx.detached(playGame, n + 1); // last statement, then return
64
+ * }
65
+ * ```
66
+ */
67
+ detached<F extends AnyFunc>(func: F, ...args: ParamsWithOptions<F>): DurablePromise<DetachedHandle>;
68
+ detached(func: string, ...args: any[]): DurablePromise<DetachedHandle>;
69
+ /**
70
+ * Creates a latent durable promise (DPC) with no associated function, intended
71
+ * to be resolved out of band (human-in-the-loop / external signal) via
72
+ * `resonate.promises.resolve(id)`. Awaiting it suspends the parent until the
73
+ * promise is settled externally. The id is `${ctx.id}.${seq}`.
74
+ */
75
+ promise<T>(opts?: {
76
+ timeout?: number;
77
+ data?: any;
78
+ tags?: {
79
+ [key: string]: string;
80
+ };
81
+ }): DurablePromise<T>;
82
+ sleep(ms: number): DurablePromise<void>;
83
+ sleep(opts: {
84
+ for?: number;
85
+ until?: Date;
86
+ }): DurablePromise<void>;
87
+ sleep(msOrOpts: number | {
88
+ for?: number;
89
+ until?: Date;
90
+ }): DurablePromise<void>;
91
+ options(opts?: Partial<Omit<Options, "id">>): Options;
92
+ /**
93
+ * Aborts the entire pass if condition is true (`panic`) / false (`assert`):
94
+ * no promise is settled and the task is released for redelivery — mirroring
95
+ * the generator engine's DIE. The abort is recorded on the context before
96
+ * the throw, so a surrounding user try/catch cannot suppress it.
97
+ */
98
+ panic(condition: boolean, msg?: string): void;
99
+ assert(condition: boolean, msg?: string): void;
100
+ date: {
101
+ now(): DurablePromise<number>;
102
+ };
103
+ math: {
104
+ random(): DurablePromise<number>;
105
+ };
106
+ }
107
+ /**
108
+ * The internal outcome of a durable operation. Unlike the user-facing promise
109
+ * (which may hang on suspend), an outcome ALWAYS settles, so the pass's drain
110
+ * can read it without hanging.
111
+ */
112
+ export type Outcome = {
113
+ kind: "value";
114
+ value: any;
115
+ } | {
116
+ kind: "error";
117
+ error: any;
118
+ } | {
119
+ kind: "suspended";
120
+ remote: string[];
121
+ };
122
+ /** Lightweight reference to a detached (independently-rooted) workflow. */
123
+ export interface DetachedHandle {
124
+ readonly id: string;
125
+ }
126
+ /**
127
+ * The branded handle returned by every durable operation on {@link Context}
128
+ * (`run`, `rpc`, `sleep`, `detached`, `promise`). Behaves exactly like the
129
+ * user-facing promise it wraps (then/catch/finally/await, including the
130
+ * hang-on-suspend semantics) and additionally exposes the durable promise `id`.
131
+ *
132
+ * The brand marks the awaitables that are safe inside a workflow: replay
133
+ * determinism requires that `await` only ever targets durable promises —
134
+ * awaiting a timer, I/O, or a plain async-helper chain lets durable ids be
135
+ * assigned in completion order, which cross-wires them on replay.
136
+ */
137
+ export declare class DurablePromise<T> implements Promise<T> {
138
+ /** The durable promise id (`""` when the op failed before creating one). */
139
+ readonly id: string;
140
+ private readonly promise;
141
+ readonly [Symbol.toStringTag] = "DurablePromise";
142
+ constructor(
143
+ /** The durable promise id (`""` when the op failed before creating one). */
144
+ id: string, promise: Promise<T>);
145
+ then<TResult1 = T, TResult2 = never>(onfulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null): Promise<TResult1 | TResult2>;
146
+ catch<TResult = never>(onrejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null): Promise<T | TResult>;
147
+ finally(onfinally?: (() => void) | null): Promise<T>;
148
+ }
149
+ interface AsyncContextConfig {
150
+ id: string;
151
+ oId?: string;
152
+ prId?: string;
153
+ bId?: string;
154
+ pId?: string;
155
+ func: string;
156
+ clock: Clock;
157
+ registry: Registry;
158
+ dependencies: Map<string, any>;
159
+ optsBuilder: OptionsBuilder;
160
+ timeout: number;
161
+ version: number;
162
+ attempt?: number;
163
+ }
164
+ export declare class AsyncContext implements Context {
165
+ readonly id: string;
166
+ readonly originId: string;
167
+ readonly prefixId: string;
168
+ readonly branchId: string;
169
+ readonly parentId: string;
170
+ readonly func: string;
171
+ readonly timeoutAt: number;
172
+ readonly attempt: number;
173
+ readonly version: number;
174
+ readonly clock: Clock;
175
+ private registry;
176
+ private dependencies;
177
+ private optsBuilder;
178
+ private effects;
179
+ /** Lifecycle-event sink for this pass; shared with the root + every child. */
180
+ private trace;
181
+ private seq;
182
+ /** Set once the pass is finalized (drain stable); durable ops then panic. */
183
+ private closed;
184
+ /** Every started op's always-settling outcome; the pass drains these. */
185
+ readonly spawnedHandles: Promise<Outcome>[];
186
+ /** Resolved the first time any op observes a pending remote → ends the pass. */
187
+ readonly suspendSignal: Promise<void>;
188
+ private _fireSuspend;
189
+ /** Resolved by ctx.panic → ends the pass; the recorded error aborts it. */
190
+ readonly panicSignal: Promise<void>;
191
+ private _firePanic;
192
+ private _panicError?;
193
+ /** Tail of the creation sequencer chain (serializes promiseCreate calls). */
194
+ private createTail;
195
+ constructor(cfg: AsyncContextConfig, effects: Effects, trace: TraceCollector);
196
+ /** The panic that aborted this pass, if any. Authoritative: set by ctx.panic
197
+ * before the throw, so it survives a user try/catch around the call. */
198
+ get panicError(): ResonateError | undefined;
199
+ /** End the pass: a durable op observed a pending remote. Idempotent. */
200
+ fireSuspend(): void;
201
+ /**
202
+ * Finalize the pass. Every op in `spawnedHandles` has been drained; a durable
203
+ * op started after this point comes from a continuation that outlived the pass
204
+ * (parked on a non-durable await — a timer, I/O, etc.). It would escape the
205
+ * drain and race task.suspend/fulfill as a zombie, so it panics instead.
206
+ */
207
+ close(): void;
208
+ private guardOpen;
209
+ private child;
210
+ private claimCreateSlot;
211
+ private createSlotted;
212
+ run(funcOrName: AnyFunc | string, ...args: any[]): DurablePromise<any>;
213
+ rpc(funcOrName: AnyFunc | string, ...args: any[]): DurablePromise<any>;
214
+ sleep(ms: number): DurablePromise<void>;
215
+ sleep(opts: {
216
+ for?: number;
217
+ until?: Date;
218
+ }): DurablePromise<void>;
219
+ detached(funcOrName: AnyFunc | string, ...args: any[]): DurablePromise<DetachedHandle>;
220
+ promise<T>({ timeout, data, tags, }?: {
221
+ timeout?: number;
222
+ data?: any;
223
+ tags?: {
224
+ [key: string]: string;
225
+ };
226
+ }): DurablePromise<T>;
227
+ private remoteOutcome;
228
+ private track;
229
+ private facing;
230
+ private settle;
231
+ getDependency<T = any>(name: string): T | undefined;
232
+ options(opts?: Partial<Pick<Options, "tags" | "target" | "timeout" | "version" | "retryPolicy" | "nonRetryableErrors">>): Options;
233
+ panic(condition: boolean, msg?: string): void;
234
+ assert(condition: boolean, msg?: string): void;
235
+ readonly date: {
236
+ now: () => DurablePromise<number>;
237
+ };
238
+ readonly math: {
239
+ random: () => DurablePromise<number>;
240
+ };
241
+ private createReq;
242
+ private localCreateReq;
243
+ private remoteCreateReq;
244
+ private detachedCreateReq;
245
+ private latentCreateReq;
246
+ private sleepCreateReq;
247
+ private seqid;
248
+ }
249
+ /**
250
+ * Run a user function to completion or suspension under `ctx`.
251
+ *
252
+ * The function may park forever on a hung `await`, so we race it against the
253
+ * suspend signal rather than waiting for it to finish. Whatever wins, we then
254
+ * drain every started op (their outcomes always settle) to collect the complete
255
+ * set of remote-todos — this is the authoritative suspend decision.
256
+ */
257
+ export declare function run(ctx: AsyncContext, func: AnyFunc, args: any[]): Promise<Outcome>;
258
+ /**
259
+ * Run a user function with in-process retries (mirrors `util.executeWithRetry`
260
+ * for the generator engine). Each attempt runs under a FRESH context — so a
261
+ * function that creates durable children re-creates them with identical ids and
262
+ * replays via dedup, exactly like a cross-process replay.
263
+ *
264
+ * Only an `error` outcome is retried; `value` and `suspended` short-circuit. A
265
+ * retry is skipped (and the error returned) when the error is non-retryable, the
266
+ * policy is exhausted, or the next delay would exceed the function's timeout.
267
+ */
268
+ export declare function runWithRetry(makeCtx: (attempt: number) => AsyncContext, func: AnyFunc, args: any[], policy: RetryPolicy, nonRetryableErrors: Array<new (...args: any[]) => Error>, clock: Clock, timeoutAt: number): Promise<Outcome>;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