rivetkit 2.3.11-rc.3 → 2.3.11-rc.5

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 (79) hide show
  1. package/dist/browser/client.d.ts +17 -0
  2. package/dist/browser/client.js +20 -9
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +1 -1
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/agent-os/index.cjs +1 -1
  7. package/dist/tsup/agent-os/index.cjs.map +1 -1
  8. package/dist/tsup/agent-os/index.d.cts +16 -0
  9. package/dist/tsup/agent-os/index.d.ts +16 -0
  10. package/dist/tsup/agent-os/index.js +1 -1
  11. package/dist/tsup/agent-os/index.js.map +1 -1
  12. package/dist/tsup/{chunk-VAVQ4N74.js → chunk-2Y5DOOJU.js} +3 -3
  13. package/dist/tsup/{chunk-IVOQLFNA.cjs → chunk-3KU25OWA.cjs} +4 -4
  14. package/dist/tsup/{chunk-IVOQLFNA.cjs.map → chunk-3KU25OWA.cjs.map} +1 -1
  15. package/dist/tsup/{chunk-4JQYWBMT.js → chunk-6QL27Q5R.js} +2 -2
  16. package/dist/tsup/{chunk-4JQYWBMT.js.map → chunk-6QL27Q5R.js.map} +1 -1
  17. package/dist/tsup/{chunk-T34YWMEG.js → chunk-7PVR3YAW.js} +2 -2
  18. package/dist/tsup/{chunk-5MC4O5QQ.cjs → chunk-ABUZVZUU.cjs} +3 -3
  19. package/dist/tsup/{chunk-5MC4O5QQ.cjs.map → chunk-ABUZVZUU.cjs.map} +1 -1
  20. package/dist/tsup/{chunk-RVZYWLP2.cjs → chunk-E4TYUKOJ.cjs} +157 -146
  21. package/dist/tsup/chunk-E4TYUKOJ.cjs.map +1 -0
  22. package/dist/tsup/{chunk-QO6FXNYD.cjs → chunk-FT4UYLUJ.cjs} +2 -2
  23. package/dist/tsup/{chunk-QO6FXNYD.cjs.map → chunk-FT4UYLUJ.cjs.map} +1 -1
  24. package/dist/tsup/{chunk-2C7J6RYX.cjs → chunk-H452AOZ4.cjs} +9 -9
  25. package/dist/tsup/{chunk-2C7J6RYX.cjs.map → chunk-H452AOZ4.cjs.map} +1 -1
  26. package/dist/tsup/{chunk-RA7NE7YH.js → chunk-JQY6YJTM.js} +3 -3
  27. package/dist/tsup/{chunk-GN75YOYN.js → chunk-JZ4SICLQ.js} +22 -11
  28. package/dist/tsup/chunk-JZ4SICLQ.js.map +1 -0
  29. package/dist/tsup/{chunk-KJF2L4B6.cjs → chunk-NEDUXJE3.cjs} +7 -7
  30. package/dist/tsup/{chunk-KJF2L4B6.cjs.map → chunk-NEDUXJE3.cjs.map} +1 -1
  31. package/dist/tsup/{chunk-IBCX366R.js → chunk-Z23GEV4Y.js} +2 -2
  32. package/dist/tsup/client/mod.cjs +5 -5
  33. package/dist/tsup/client/mod.d.cts +2 -2
  34. package/dist/tsup/client/mod.d.ts +2 -2
  35. package/dist/tsup/client/mod.js +4 -4
  36. package/dist/tsup/common/log.cjs +2 -2
  37. package/dist/tsup/common/log.js +1 -1
  38. package/dist/tsup/common/websocket.cjs +3 -3
  39. package/dist/tsup/common/websocket.js +2 -2
  40. package/dist/tsup/{config-BKAMOHez.d.ts → config-CZcjyT5B.d.ts} +17 -0
  41. package/dist/tsup/{config-Caocy3Z9.d.cts → config-rGWrumlO.d.cts} +17 -0
  42. package/dist/tsup/{context-D1_m5x1D.d.cts → context-B8W8E8nW.d.cts} +1 -1
  43. package/dist/tsup/{context-AfCExwbr.d.ts → context-_UrDZhEh.d.ts} +1 -1
  44. package/dist/tsup/db/drizzle.cjs +2 -2
  45. package/dist/tsup/db/drizzle.js +1 -1
  46. package/dist/tsup/db/mod.cjs +2 -2
  47. package/dist/tsup/db/mod.js +1 -1
  48. package/dist/tsup/dynamic/mod.d.cts +1 -1
  49. package/dist/tsup/dynamic/mod.d.ts +1 -1
  50. package/dist/tsup/inspector/mod.cjs +4 -4
  51. package/dist/tsup/inspector/mod.js +3 -3
  52. package/dist/tsup/inspector-tab/mod.d.cts +2 -2
  53. package/dist/tsup/inspector-tab/mod.d.ts +2 -2
  54. package/dist/tsup/mod.cjs +65 -65
  55. package/dist/tsup/mod.d.cts +3 -3
  56. package/dist/tsup/mod.d.ts +3 -3
  57. package/dist/tsup/mod.js +4 -4
  58. package/dist/tsup/test/mod.cjs +6 -6
  59. package/dist/tsup/test/mod.d.cts +1 -1
  60. package/dist/tsup/test/mod.d.ts +1 -1
  61. package/dist/tsup/test/mod.js +4 -4
  62. package/dist/tsup/utils.cjs +2 -2
  63. package/dist/tsup/utils.js +1 -1
  64. package/dist/tsup/workflow/mod.cjs +6 -6
  65. package/dist/tsup/workflow/mod.d.cts +3 -3
  66. package/dist/tsup/workflow/mod.d.ts +3 -3
  67. package/dist/tsup/workflow/mod.js +3 -3
  68. package/package.json +8 -8
  69. package/src/client/client.ts +11 -0
  70. package/src/client/query.ts +2 -0
  71. package/src/client/resolve-gateway-target.ts +2 -0
  72. package/src/engine-client/driver.ts +4 -0
  73. package/src/engine-client/mod.ts +13 -4
  74. package/dist/tsup/chunk-GN75YOYN.js.map +0 -1
  75. package/dist/tsup/chunk-RVZYWLP2.cjs.map +0 -1
  76. /package/dist/tsup/{chunk-VAVQ4N74.js.map → chunk-2Y5DOOJU.js.map} +0 -0
  77. /package/dist/tsup/{chunk-T34YWMEG.js.map → chunk-7PVR3YAW.js.map} +0 -0
  78. /package/dist/tsup/{chunk-RA7NE7YH.js.map → chunk-JQY6YJTM.js.map} +0 -0
  79. /package/dist/tsup/{chunk-IBCX366R.js.map → chunk-Z23GEV4Y.js.map} +0 -0
@@ -165,6 +165,7 @@ declare const CreateRequestSchema: z.ZodObject<{
165
165
  key: z.ZodArray<z.ZodString>;
166
166
  input: z.ZodOptional<z.ZodUnknown>;
167
167
  region: z.ZodOptional<z.ZodString>;
168
+ poolName: z.ZodOptional<z.ZodString>;
168
169
  }, z.core.$strip>;
169
170
  declare const ActorQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
170
171
  getForId: z.ZodObject<{
@@ -182,6 +183,7 @@ declare const ActorQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
182
183
  key: z.ZodArray<z.ZodString>;
183
184
  input: z.ZodOptional<z.ZodUnknown>;
184
185
  region: z.ZodOptional<z.ZodString>;
186
+ poolName: z.ZodOptional<z.ZodString>;
185
187
  }, z.core.$strip>;
186
188
  }, z.core.$strip>, z.ZodObject<{
187
189
  create: z.ZodObject<{
@@ -189,6 +191,7 @@ declare const ActorQuerySchema: z.ZodUnion<readonly [z.ZodObject<{
189
191
  key: z.ZodArray<z.ZodString>;
190
192
  input: z.ZodOptional<z.ZodUnknown>;
191
193
  region: z.ZodOptional<z.ZodString>;
194
+ poolName: z.ZodOptional<z.ZodString>;
192
195
  }, z.core.$strip>;
193
196
  }, z.core.$strip>]>;
194
197
  type ActorQuery = z.infer<typeof ActorQuerySchema>;
@@ -342,6 +345,8 @@ interface GetOrCreateWithKeyInput {
342
345
  input?: unknown;
343
346
  region?: string;
344
347
  crashPolicy?: CrashPolicy;
348
+ /** Overrides the client's configured pool name for this actor. */
349
+ poolName?: string;
345
350
  }
346
351
  interface CreateInput {
347
352
  c?: Context | undefined;
@@ -350,6 +355,8 @@ interface CreateInput {
350
355
  input?: unknown;
351
356
  region?: string;
352
357
  crashPolicy?: CrashPolicy;
358
+ /** Overrides the client's configured pool name for this actor. */
359
+ poolName?: string;
353
360
  }
354
361
  interface ListActorsInput {
355
362
  c?: Context | undefined;
@@ -856,6 +863,11 @@ interface GetOrCreateOptions extends QueryOptions {
856
863
  createInRegion?: string;
857
864
  /** Input data to pass to the actor. */
858
865
  createWithInput?: unknown;
866
+ /**
867
+ * Name of the envoy pool to select for this actor if it is created.
868
+ * Overrides the client's configured `poolName` for this call.
869
+ */
870
+ poolName?: string;
859
871
  }
860
872
  /**
861
873
  * Options for creating a actor.
@@ -867,6 +879,11 @@ interface CreateOptions extends QueryOptions {
867
879
  region?: string;
868
880
  /** Input data to pass to the actor. */
869
881
  input?: unknown;
882
+ /**
883
+ * Name of the envoy pool to select for this actor.
884
+ * Overrides the client's configured `poolName` for this call.
885
+ */
886
+ poolName?: string;
870
887
  }
871
888
  /**
872
889
  * Represents a region to connect to.
@@ -194,7 +194,7 @@ function noopNext() {
194
194
  // package.json
195
195
  var package_default = {
196
196
  name: "rivetkit",
197
- version: "2.3.11-rc.3",
197
+ version: "2.3.11-rc.5",
198
198
  description: "Lightweight libraries for building stateful actors on edge platforms",
199
199
  license: "Apache-2.0",
200
200
  keywords: [
@@ -4212,7 +4212,14 @@ var RemoteEngineControlClient = class {
4212
4212
  }
4213
4213
  async getOrCreateWithKey(input) {
4214
4214
  await this.#metadataPromise;
4215
- const { name, key, input: actorInput, region, crashPolicy } = input;
4215
+ const {
4216
+ name,
4217
+ key,
4218
+ input: actorInput,
4219
+ region,
4220
+ crashPolicy,
4221
+ poolName
4222
+ } = input;
4216
4223
  logger3().info({
4217
4224
  msg: "getOrCreateWithKey: getting or creating actor via engine api",
4218
4225
  name,
@@ -4222,7 +4229,7 @@ var RemoteEngineControlClient = class {
4222
4229
  datacenter: region,
4223
4230
  name,
4224
4231
  key: serializeActorKey(key),
4225
- runner_name_selector: this.#config.poolName,
4232
+ runner_name_selector: poolName ?? this.#config.poolName,
4226
4233
  input: actorInput ? uint8ArrayToBase64(
4227
4234
  encodeCborCompat(actorInput)
4228
4235
  ) : void 0,
@@ -4242,14 +4249,15 @@ var RemoteEngineControlClient = class {
4242
4249
  key,
4243
4250
  input,
4244
4251
  region,
4245
- crashPolicy
4252
+ crashPolicy,
4253
+ poolName
4246
4254
  }) {
4247
4255
  await this.#metadataPromise;
4248
4256
  logger3().info({ msg: "creating actor via engine api", name, key });
4249
4257
  const result = await createActor(this.#config, {
4250
4258
  datacenter: region,
4251
4259
  name,
4252
- runner_name_selector: this.#config.poolName,
4260
+ runner_name_selector: poolName ?? this.#config.poolName,
4253
4261
  key: serializeActorKey(key),
4254
4262
  input: input ? uint8ArrayToBase64(encodeCborCompat(input)) : void 0,
4255
4263
  crash_policy: crashPolicy ?? "sleep"
@@ -4385,7 +4393,7 @@ var RemoteEngineControlClient = class {
4385
4393
  path,
4386
4394
  this.#config.maxInputSize,
4387
4395
  void 0,
4388
- "getOrCreateForKey" in target ? this.#config.poolName : void 0,
4396
+ "getOrCreateForKey" in target ? target.getOrCreateForKey.poolName ?? this.#config.poolName : void 0,
4389
4397
  options
4390
4398
  );
4391
4399
  }
@@ -5993,7 +6001,8 @@ async function resolveGatewayTarget(driver, target) {
5993
6001
  name: target.getOrCreateForKey.name,
5994
6002
  key: target.getOrCreateForKey.key,
5995
6003
  input: target.getOrCreateForKey.input,
5996
- region: target.getOrCreateForKey.region
6004
+ region: target.getOrCreateForKey.region,
6005
+ poolName: target.getOrCreateForKey.poolName
5997
6006
  });
5998
6007
  return output.actorId;
5999
6008
  }
@@ -6002,7 +6011,8 @@ async function resolveGatewayTarget(driver, target) {
6002
6011
  name: target.create.name,
6003
6012
  key: target.create.key,
6004
6013
  input: target.create.input,
6005
- region: target.create.region
6014
+ region: target.create.region,
6015
+ poolName: target.create.poolName
6006
6016
  });
6007
6017
  return output.actorId;
6008
6018
  }
@@ -6710,7 +6720,8 @@ var ClientRaw = class {
6710
6720
  name,
6711
6721
  key: keyArray,
6712
6722
  input: opts?.createWithInput,
6713
- region: opts?.createInRegion
6723
+ region: opts?.createInRegion,
6724
+ poolName: opts?.poolName
6714
6725
  }
6715
6726
  };
6716
6727
  const handle = this.#createHandle(