@resonatehq/sdk 0.8.1 → 0.8.3

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 (91) hide show
  1. package/dist/dev/network.d.ts +13 -6
  2. package/dist/dev/network.d.ts.map +1 -1
  3. package/dist/dev/network.js +32 -17
  4. package/dist/dev/network.js.map +1 -1
  5. package/dist/dev/server.d.ts +2 -1
  6. package/dist/dev/server.d.ts.map +1 -1
  7. package/dist/dev/server.js +42 -51
  8. package/dist/dev/server.js.map +1 -1
  9. package/dist/sim/example-1.js +9 -7
  10. package/dist/sim/example-1.js.map +1 -1
  11. package/dist/sim/example-2.js +9 -7
  12. package/dist/sim/example-2.js.map +1 -1
  13. package/dist/sim/example-3.js +9 -7
  14. package/dist/sim/example-3.js.map +1 -1
  15. package/dist/sim/main.d.ts.map +1 -1
  16. package/dist/sim/main.js +5 -4
  17. package/dist/sim/main.js.map +1 -1
  18. package/dist/sim/src/server.d.ts.map +1 -1
  19. package/dist/sim/src/worker.d.ts +2 -1
  20. package/dist/sim/src/worker.d.ts.map +1 -1
  21. package/dist/sim/src/worker.js +29 -14
  22. package/dist/sim/src/worker.js.map +1 -1
  23. package/dist/src/computation.d.ts +4 -3
  24. package/dist/src/computation.d.ts.map +1 -1
  25. package/dist/src/computation.js +53 -20
  26. package/dist/src/computation.js.map +1 -1
  27. package/dist/src/context.d.ts +27 -11
  28. package/dist/src/context.d.ts.map +1 -1
  29. package/dist/src/context.js +68 -33
  30. package/dist/src/context.js.map +1 -1
  31. package/dist/src/core.d.ts +5 -5
  32. package/dist/src/core.d.ts.map +1 -1
  33. package/dist/src/core.js +11 -11
  34. package/dist/src/core.js.map +1 -1
  35. package/dist/src/coroutine.d.ts.map +1 -1
  36. package/dist/src/coroutine.js +41 -27
  37. package/dist/src/coroutine.js.map +1 -1
  38. package/dist/src/decorator.d.ts +3 -3
  39. package/dist/src/decorator.d.ts.map +1 -1
  40. package/dist/src/decorator.js +4 -4
  41. package/dist/src/decorator.js.map +1 -1
  42. package/dist/src/encoder.d.ts +12 -0
  43. package/dist/src/encoder.d.ts.map +1 -0
  44. package/dist/src/encoder.js +107 -0
  45. package/dist/src/encoder.js.map +1 -0
  46. package/dist/src/exceptions.d.ts +35 -0
  47. package/dist/src/exceptions.d.ts.map +1 -0
  48. package/dist/src/exceptions.js +75 -0
  49. package/dist/src/exceptions.js.map +1 -0
  50. package/dist/src/handler.d.ts +18 -15
  51. package/dist/src/handler.d.ts.map +1 -1
  52. package/dist/src/handler.js +141 -39
  53. package/dist/src/handler.js.map +1 -1
  54. package/dist/src/index.d.ts +1 -1
  55. package/dist/src/index.d.ts.map +1 -1
  56. package/dist/src/index.js +2 -2
  57. package/dist/src/index.js.map +1 -1
  58. package/dist/src/network/network.d.ts +32 -16
  59. package/dist/src/network/network.d.ts.map +1 -1
  60. package/dist/src/network/remote.d.ts +26 -36
  61. package/dist/src/network/remote.d.ts.map +1 -1
  62. package/dist/src/network/remote.js +156 -193
  63. package/dist/src/network/remote.js.map +1 -1
  64. package/dist/src/processor/processor.d.ts +2 -2
  65. package/dist/src/processor/processor.d.ts.map +1 -1
  66. package/dist/src/processor/processor.js +8 -4
  67. package/dist/src/processor/processor.js.map +1 -1
  68. package/dist/src/promises.d.ts +19 -10
  69. package/dist/src/promises.d.ts.map +1 -1
  70. package/dist/src/promises.js +38 -26
  71. package/dist/src/promises.js.map +1 -1
  72. package/dist/src/registry.d.ts +3 -4
  73. package/dist/src/registry.d.ts.map +1 -1
  74. package/dist/src/registry.js +25 -49
  75. package/dist/src/registry.js.map +1 -1
  76. package/dist/src/resonate-inner.d.ts +8 -5
  77. package/dist/src/resonate-inner.d.ts.map +1 -1
  78. package/dist/src/resonate-inner.js +8 -6
  79. package/dist/src/resonate-inner.js.map +1 -1
  80. package/dist/src/resonate.d.ts +223 -22
  81. package/dist/src/resonate.d.ts.map +1 -1
  82. package/dist/src/resonate.js +277 -153
  83. package/dist/src/resonate.js.map +1 -1
  84. package/dist/src/schedules.d.ts +3 -2
  85. package/dist/src/schedules.d.ts.map +1 -1
  86. package/dist/src/schedules.js +2 -2
  87. package/dist/src/schedules.js.map +1 -1
  88. package/dist/src/types.d.ts +4 -0
  89. package/dist/src/types.d.ts.map +1 -1
  90. package/dist/tsconfig.build.tsbuildinfo +1 -1
  91. package/package.json +2 -2
@@ -1,4 +1,3 @@
1
- import type { Network } from "./network/network";
2
1
  import { Options } from "./options";
3
2
  import { Promises } from "./promises";
4
3
  import { Schedules } from "./schedules";
@@ -20,11 +19,14 @@ export interface ResonateSchedule {
20
19
  }
21
20
  export declare class Resonate {
22
21
  private unicast;
23
- private anycast;
22
+ private anycastPreference;
23
+ private anycastNoPreference;
24
24
  private pid;
25
25
  private ttl;
26
26
  private inner;
27
27
  private network;
28
+ private encoder;
29
+ private messageSource;
28
30
  private handler;
29
31
  private registry;
30
32
  private heartbeat;
@@ -32,19 +34,74 @@ export declare class Resonate {
32
34
  private subscriptions;
33
35
  readonly promises: Promises;
34
36
  readonly schedules: Schedules;
35
- constructor({ group, pid, ttl }: {
36
- group: string;
37
- pid: string;
38
- ttl: number;
39
- }, network: Network);
37
+ constructor({ url, group, pid, ttl, auth, }?: {
38
+ url?: string;
39
+ group?: string;
40
+ pid?: string;
41
+ ttl?: number;
42
+ auth?: {
43
+ username: string;
44
+ password: string;
45
+ };
46
+ });
40
47
  /**
41
- * Create a local Resonate instance
48
+ * Initializes a Resonate client instance for local development.
49
+ *
50
+ * Creates and returns a Resonate client configured for **local-only execution**
51
+ * with zero external dependencies. All state is stored in local memory — no
52
+ * network or external persistence is required. This mode is ideal for rapid
53
+ * testing, debugging, and experimentation before connecting to a Resonate server.
54
+ *
55
+ * The client runs with a `"default"` worker group, a `"default"` process ID,
56
+ * and an effectively infinite TTL (`Number.MAX_SAFE_INTEGER`) for tasks.
57
+ *
58
+ * @returns A {@link Resonate} client instance configured for local development.
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * const resonate = Resonate.local();
63
+ * resonate.register(foo);
64
+ * const result = await resonate.run("foo.1", foo, { data: "test" });
65
+ * console.log(result);
66
+ * ```
42
67
  */
43
68
  static local(): Resonate;
44
69
  /**
45
- * Create a remote Resonate instance
70
+ * Initializes a Resonate client instance with remote configuration.
71
+ *
72
+ * Creates and returns a Resonate client that connects to a **Resonate Server**
73
+ * and optional remote message sources. This configuration enables distributed,
74
+ * durable workers to cooperate and execute functions via **durable RPCs**.
75
+ *
76
+ * By default, the client connects to a Resonate Server running locally
77
+ * (`http://localhost:8001`) and joins the `"default"` worker group.
78
+ *
79
+ * The client is identified by a unique process ID (`pid`) and maintains
80
+ * claimed task leases for the duration specified by `ttl`.
81
+ *
82
+ * @param options - Configuration options for the remote client.
83
+ * @param options.url - The base URL of the remote Resonate Server. Defaults to `"http://localhost:8001"`.
84
+ * @param options.group - The worker group name. Defaults to `"default"`.
85
+ * @param options.pid - Optional process identifier for the client. Defaults to a randomly generated UUID.
86
+ * @param options.ttl - Time-to-live (in seconds) for claimed tasks. Defaults to `1 * util.MIN`.
87
+ * @param options.auth - Optional authentication credentials for connecting to the remote server.
88
+ *
89
+ * @returns A {@link Resonate} client instance configured for remote operation.
90
+ *
91
+ * @example
92
+ * ```ts
93
+ * const resonate = Resonate.remote({
94
+ * url: "https://resonate.example.com",
95
+ * group: "analytics",
96
+ * ttl: 30,
97
+ * auth: { username: "user", password: "secret" },
98
+ * });
99
+ *
100
+ * const result = await resonate.run("task-42", "processData", { input: "dataset.csv" });
101
+ * console.log(result);
102
+ * ```
46
103
  */
47
- static remote({ url, group, pid, ttl, auth, messageSourceAuth, }?: {
104
+ static remote({ url, group, pid, ttl, auth, }?: {
48
105
  url?: string;
49
106
  group?: string;
50
107
  pid?: string;
@@ -59,7 +116,34 @@ export declare class Resonate {
59
116
  };
60
117
  }): Resonate;
61
118
  /**
62
- * Register a function and returns a registered function
119
+ * Registers a function with Resonate for execution and version control.
120
+ *
121
+ * This method makes a function available for distributed or top-level execution
122
+ * under a specific name and version.
123
+ *
124
+ * Providing explicit `name` or `version` options allows precise control over
125
+ * function identification and versioning, enabling repeatable, distributed
126
+ * invocation and backward-compatible deployments.
127
+ *
128
+ * @param nameOrFunc - Either the function name (string) or the function itself.
129
+ * When passing a name, provide the function and optional options as additional parameters.
130
+ * @param funcOrOptions - The function to register, or an optional configuration object
131
+ * with versioning information when the first argument is a name.
132
+ * @param maybeOptions - Optional configuration object when both name and function are provided.
133
+ * Supports a `version` field to specify the registered function version.
134
+ *
135
+ * @returns A {@link ResonateFunc} wrapper for the registered function.
136
+ * When used as a decorator, returns a decorator that registers the target function
137
+ * upon definition.
138
+ *
139
+ * @example
140
+ * ```ts
141
+ * function greet(ctx: Context, name: string): string {
142
+ * return `Hello, ${name}!`;
143
+ * }
144
+ *
145
+ * resonate.register("greet_user", greet, { version: 2 });
146
+ * ```
63
147
  */
64
148
  register<F extends Func>(name: string, func: F, options?: {
65
149
  version?: number;
@@ -68,25 +152,131 @@ export declare class Resonate {
68
152
  version?: number;
69
153
  }): ResonateFunc<F>;
70
154
  /**
71
- * Invoke a function and return a value
155
+ * Runs a registered function with Resonate and waits for the result.
156
+ *
157
+ * This method executes the specified function under a **durable promise**
158
+ * identified by the provided `id`. If a promise with the same `id` already exists,
159
+ * Resonate subscribes to its result or returns it immediately if it has already completed.
160
+ *
161
+ * Duplicate executions for the same `id` are automatically prevented, ensuring
162
+ * idempotent and consistent behavior across distributed runs.
163
+ *
164
+ * This is a **blocking operation** — execution will not continue until the
165
+ * function result is available.
166
+ *
167
+ * @param id - The unique identifier of the durable promise. Reusing an ID ensures
168
+ * idempotent execution.
169
+ * @param funcOrName - Either the registered function reference or its string name
170
+ * to execute.
171
+ * @param args - Positional arguments passed to the function.
172
+ *
173
+ * @returns A promise resolving to the final result returned from the function execution.
174
+ *
175
+ * @example
176
+ * ```ts
177
+ * const result = await client.run("job-123", "processData", { input: "records.csv" });
178
+ * console.log("Result:", result);
179
+ * ```
72
180
  */
73
181
  run<F extends Func>(id: string, func: F, ...args: ParamsWithOptions<F>): Promise<Return<F>>;
74
182
  run<T>(id: string, name: string, ...args: any[]): Promise<T>;
75
183
  run<T>(id: string, funcOrName: Func | string, ...args: any[]): Promise<T>;
76
184
  /**
77
- * Invoke a function and return a promise
185
+ * Runs a registered function asynchronously with Resonate.
186
+ *
187
+ * This method schedules the specified function for execution under a **durable promise**
188
+ * identified by the provided `id`. If a promise with the same `id` already exists,
189
+ * Resonate subscribes to its result or returns it immediately if it has already completed.
190
+ *
191
+ * Unlike {@link run}, this method is **non-blocking** and immediately returns a
192
+ * {@link ResonateHandle} that can be awaited or queried later to retrieve the final result
193
+ * once execution completes.
194
+ *
195
+ * Duplicate executions for the same `id` are automatically prevented, ensuring idempotent
196
+ * and consistent behavior across distributed runs.
197
+ *
198
+ * @param id - The unique identifier of the durable promise. Reusing an ID ensures
199
+ * idempotent execution.
200
+ * @param funcOrName - Either the registered function reference or its string name
201
+ * to execute.
202
+ * @param argsWithOpts - Positional arguments and optional configuration parameters
203
+ * passed to the function.
204
+ *
205
+ * @returns A {@link ResonateHandle} representing the asynchronous execution.
206
+ * The handle can be awaited or inspected for status and results.
207
+ *
208
+ * @example
209
+ * ```ts
210
+ * const handle = await client.beginRun("run-001", "generateReport", { period: "Q3" });
211
+ * const result = await handle.getResult();
212
+ * console.log(result);
213
+ * ```
78
214
  */
79
215
  beginRun<F extends Func>(id: string, func: F, ...args: ParamsWithOptions<F>): Promise<ResonateHandle<Return<F>>>;
80
216
  beginRun<T>(id: string, func: string, ...args: any[]): Promise<ResonateHandle<T>>;
81
217
  beginRun(id: string, funcOrName: Func | string, ...args: any[]): Promise<ResonateHandle<any>>;
82
218
  /**
83
- * Invoke a remote function and return a value
219
+ * Executes a registered function remotely with Resonate and waits for the result.
220
+ *
221
+ * This method runs the specified function on a remote worker or process under a
222
+ * **durable promise** identified by the provided `id`. If a promise with the same
223
+ * `id` already exists, Resonate subscribes to its result or returns it immediately
224
+ * if it has already completed.
225
+ *
226
+ * Unlike {@link beginRpc}, this method is **blocking** — it waits for the remote
227
+ * function to complete and returns the final result before continuing execution.
228
+ *
229
+ * Duplicate executions for the same `id` are automatically prevented, ensuring
230
+ * idempotent and consistent behavior across distributed runs.
231
+ *
232
+ * @param id - The unique identifier of the durable promise. Reusing an ID ensures
233
+ * idempotent remote execution.
234
+ * @param funcOrName - Either the registered function reference or its string name
235
+ * to execute remotely.
236
+ * @param args - Positional arguments passed to the remote function.
237
+ *
238
+ * @returns A promise resolving to the final result returned from the remote
239
+ * function execution.
240
+ *
241
+ * @example
242
+ * ```ts
243
+ * const result = await client.rpc("job-42", "analyzeData", { file: "input.csv" });
244
+ * console.log("Remote result:", result);
245
+ * ```
84
246
  */
85
247
  rpc<F extends Func>(id: string, func: F, ...args: ParamsWithOptions<F>): Promise<Return<F>>;
86
248
  rpc<T>(id: string, name: string, ...args: any[]): Promise<T>;
87
249
  rpc<T>(id: string, funcOrName: Func | string, ...args: any[]): Promise<T>;
88
250
  /**
89
- * Invoke a remote function and return a promise
251
+ * Initiates a remote procedure call (RPC) with Resonate and returns a handle to the execution.
252
+ *
253
+ * This method schedules a registered function for **remote execution** under a durable promise
254
+ * identified by the provided `id`. The function runs on a remote worker or process as part of
255
+ * Resonate’s distributed execution environment.
256
+ *
257
+ * Unlike {@link rpc}, this method is **non-blocking** and immediately returns a
258
+ * {@link ResonateHandle} that can be awaited or queried later to retrieve the final result once
259
+ * remote execution completes.
260
+ *
261
+ * If a durable promise with the same `id` already exists, Resonate subscribes to its result or
262
+ * returns it immediately if it has already completed. Duplicate executions for the same `id`
263
+ * are automatically prevented, ensuring idempotent and consistent behavior.
264
+ *
265
+ * @param id - The unique identifier of the durable promise. Reusing an ID ensures
266
+ * idempotent remote execution.
267
+ * @param funcOrName - Either the registered function reference or its string name to execute remotely.
268
+ * @param argsWithOpts - Positional arguments and optional configuration parameters
269
+ * passed to the remote function.
270
+ *
271
+ * @returns A {@link ResonateHandle} representing the asynchronous remote execution.
272
+ * The handle can be awaited or inspected for completion and results.
273
+ *
274
+ * @example
275
+ * ```ts
276
+ * const handle = await client.beginRpc("task-123", "processData", { input: "hello" });
277
+ * const result = await handle.getResult();
278
+ * console.log(result);
279
+ * ```
90
280
  */
91
281
  beginRpc<F extends Func>(id: string, func: F, ...args: ParamsWithOptions<F>): Promise<ResonateHandle<Return<F>>>;
92
282
  beginRpc<T>(id: string, func: string, ...args: any[]): Promise<ResonateHandle<T>>;
@@ -94,20 +284,31 @@ export declare class Resonate {
94
284
  schedule<F extends Func>(name: string, cron: string, func: F, ...args: ParamsWithOptions<F>): Promise<ResonateSchedule>;
95
285
  schedule(name: string, cron: string, func: string, ...args: any[]): Promise<ResonateSchedule>;
96
286
  /**
97
- * Get a promise and return a value
287
+ * Retrieves or subscribes to an existing execution by its unique ID.
288
+ *
289
+ * This method attaches to an existing **durable promise** identified by `id`.
290
+ * If the associated execution is still in progress, it returns a {@link ResonateHandle}
291
+ * that can be awaited or observed until completion. If the execution has already
292
+ * finished, the handle is immediately resolved with the stored result.
293
+ *
294
+ * Notes:
295
+ * - A durable promise with the given `id` must already exist.
296
+ * - This operation is **non-blocking**; awaiting the returned handle will block
297
+ * only if the execution is still running.
298
+ *
299
+ * @param id - Unique identifier of the target execution or durable promise.
300
+ *
301
+ * @returns A {@link ResonateHandle} representing the existing execution.
302
+ * The handle can be awaited or queried to retrieve the final result.
98
303
  */
99
304
  get<T = any>(id: string): Promise<ResonateHandle<T>>;
100
305
  options(opts?: Partial<Options>): Options;
101
- /** Store a named dependency for use with `Context`.
102
- * The dependency is made available to all functions via
103
- * their execution `Context`.
104
- * Setting a dependency for a name that already exists will
105
- * overwrite the previously set dependency.
106
- */
306
+ private getArgsAndOpts;
107
307
  setDependency(name: string, obj: any): void;
108
308
  stop(): void;
109
309
  private createPromiseAndTask;
110
310
  private createPromise;
311
+ private createSubscription;
111
312
  private readPromise;
112
313
  private createHandle;
113
314
  private onMessage;
@@ -1 +1 @@
1
- {"version":3,"file":"resonate.d.ts","sourceRoot":"","sources":["../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