rivetkit 2.3.5-rc.1 → 2.3.6

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 (111) hide show
  1. package/dist/browser/client.d.ts +19 -5
  2. package/dist/browser/client.js +32 -9
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +12 -2
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/agent-os/index.cjs +115 -5
  7. package/dist/tsup/agent-os/index.cjs.map +1 -1
  8. package/dist/tsup/agent-os/index.d.cts +19 -5
  9. package/dist/tsup/agent-os/index.d.ts +19 -5
  10. package/dist/tsup/agent-os/index.js +115 -5
  11. package/dist/tsup/agent-os/index.js.map +1 -1
  12. package/dist/tsup/{chunk-6HQCLWAW.cjs → chunk-234EFKN2.cjs} +13 -3
  13. package/dist/tsup/chunk-234EFKN2.cjs.map +1 -0
  14. package/dist/tsup/{chunk-NIC3QLKL.js → chunk-3ZE5UDOA.js} +3 -3
  15. package/dist/tsup/{chunk-4XKED5P5.cjs → chunk-AXEGEUYB.cjs} +262 -252
  16. package/dist/tsup/chunk-AXEGEUYB.cjs.map +1 -0
  17. package/dist/tsup/{chunk-P4OGQ4JL.js → chunk-BX4G2O6M.js} +3 -3
  18. package/dist/tsup/{chunk-GAV4PKFT.js → chunk-F6ZW7JZQ.js} +130 -120
  19. package/dist/tsup/chunk-F6ZW7JZQ.js.map +1 -0
  20. package/dist/tsup/{chunk-TR5NLR5V.cjs → chunk-FNTTW25Q.cjs} +4 -4
  21. package/dist/tsup/{chunk-TR5NLR5V.cjs.map → chunk-FNTTW25Q.cjs.map} +1 -1
  22. package/dist/tsup/{chunk-G3CCRCTK.cjs → chunk-HNHLBM3Y.cjs} +108 -6
  23. package/dist/tsup/chunk-HNHLBM3Y.cjs.map +1 -0
  24. package/dist/tsup/{chunk-UJ2FQY63.cjs → chunk-HVOKIYUB.cjs} +7 -7
  25. package/dist/tsup/{chunk-UJ2FQY63.cjs.map → chunk-HVOKIYUB.cjs.map} +1 -1
  26. package/dist/tsup/{chunk-PAG6G46L.js → chunk-OH6CBWUD.js} +2 -2
  27. package/dist/tsup/{chunk-TNIWIUNV.cjs → chunk-PD7SZKHY.cjs} +9 -9
  28. package/dist/tsup/{chunk-TNIWIUNV.cjs.map → chunk-PD7SZKHY.cjs.map} +1 -1
  29. package/dist/tsup/{chunk-MGTSVSUC.js → chunk-PLLHHJWR.js} +2 -2
  30. package/dist/tsup/{chunk-SHBE77IT.js → chunk-QWLJCP3X.js} +106 -4
  31. package/dist/tsup/chunk-QWLJCP3X.js.map +1 -0
  32. package/dist/tsup/{chunk-B4IZU537.js → chunk-RDTFPGU2.js} +13 -3
  33. package/dist/tsup/chunk-RDTFPGU2.js.map +1 -0
  34. package/dist/tsup/{chunk-M3FCXL3Q.cjs → chunk-WS3PP253.cjs} +3 -3
  35. package/dist/tsup/{chunk-M3FCXL3Q.cjs.map → chunk-WS3PP253.cjs.map} +1 -1
  36. package/dist/tsup/client/mod.cjs +5 -5
  37. package/dist/tsup/client/mod.d.cts +2 -2
  38. package/dist/tsup/client/mod.d.ts +2 -2
  39. package/dist/tsup/client/mod.js +4 -4
  40. package/dist/tsup/common/log.cjs +2 -2
  41. package/dist/tsup/common/log.js +1 -1
  42. package/dist/tsup/common/websocket.cjs +3 -3
  43. package/dist/tsup/common/websocket.js +2 -2
  44. package/dist/tsup/{config-BzdqbLAP.d.ts → config-BRpVbJCD.d.ts} +20 -6
  45. package/dist/tsup/{config-CPPEwn_e.d.cts → config-BobvQpex.d.cts} +20 -6
  46. package/dist/tsup/{context-wWv-K2K_.d.ts → context-Cj-DFyiy.d.ts} +1 -1
  47. package/dist/tsup/{context-DSA9gFXB.d.cts → context-YEBNJrws.d.cts} +1 -1
  48. package/dist/tsup/db/drizzle.cjs +2 -2
  49. package/dist/tsup/db/drizzle.js +1 -1
  50. package/dist/tsup/db/mod.cjs +2 -2
  51. package/dist/tsup/db/mod.js +1 -1
  52. package/dist/tsup/dynamic/mod.cjs +2 -2
  53. package/dist/tsup/dynamic/mod.d.cts +1 -1
  54. package/dist/tsup/dynamic/mod.d.ts +1 -1
  55. package/dist/tsup/dynamic/mod.js +1 -1
  56. package/dist/tsup/inspector/mod.cjs +4 -4
  57. package/dist/tsup/inspector/mod.js +3 -3
  58. package/dist/tsup/inspector-tab/mod.cjs +2 -2
  59. package/dist/tsup/inspector-tab/mod.d.cts +2 -2
  60. package/dist/tsup/inspector-tab/mod.d.ts +2 -2
  61. package/dist/tsup/inspector-tab/mod.js +1 -1
  62. package/dist/tsup/mod.cjs +175 -85
  63. package/dist/tsup/mod.cjs.map +1 -1
  64. package/dist/tsup/mod.d.cts +3 -3
  65. package/dist/tsup/mod.d.ts +3 -3
  66. package/dist/tsup/mod.js +107 -17
  67. package/dist/tsup/mod.js.map +1 -1
  68. package/dist/tsup/test/mod.cjs +16 -13
  69. package/dist/tsup/test/mod.cjs.map +1 -1
  70. package/dist/tsup/test/mod.d.cts +1 -1
  71. package/dist/tsup/test/mod.d.ts +1 -1
  72. package/dist/tsup/test/mod.js +15 -12
  73. package/dist/tsup/test/mod.js.map +1 -1
  74. package/dist/tsup/unstable/migrations.cjs +101 -0
  75. package/dist/tsup/unstable/migrations.cjs.map +1 -0
  76. package/dist/tsup/unstable/migrations.d.cts +29 -0
  77. package/dist/tsup/unstable/migrations.d.ts +29 -0
  78. package/dist/tsup/unstable/migrations.js +101 -0
  79. package/dist/tsup/unstable/migrations.js.map +1 -0
  80. package/dist/tsup/utils.cjs +2 -2
  81. package/dist/tsup/utils.js +1 -1
  82. package/dist/tsup/workflow/mod.cjs +9 -9
  83. package/dist/tsup/workflow/mod.d.cts +3 -3
  84. package/dist/tsup/workflow/mod.d.ts +3 -3
  85. package/dist/tsup/workflow/mod.js +4 -4
  86. package/package.json +19 -9
  87. package/src/actor/actions.ts +119 -0
  88. package/src/actor/config.ts +61 -18
  89. package/src/actor/definition.ts +3 -0
  90. package/src/client/actor-common.ts +3 -1
  91. package/src/client/client.ts +24 -11
  92. package/src/registry/config/index.ts +2 -4
  93. package/src/registry/index.ts +86 -5
  94. package/src/registry/napi-runtime.ts +4 -0
  95. package/src/registry/native.ts +17 -16
  96. package/src/registry/runtime.ts +1 -0
  97. package/src/registry/wasm-runtime.ts +6 -0
  98. package/src/test/mod.ts +1 -19
  99. package/src/test/ready.ts +22 -0
  100. package/src/unstable/migrations.test.ts +170 -0
  101. package/src/unstable/migrations.ts +141 -0
  102. package/dist/tsup/chunk-4XKED5P5.cjs.map +0 -1
  103. package/dist/tsup/chunk-6HQCLWAW.cjs.map +0 -1
  104. package/dist/tsup/chunk-B4IZU537.js.map +0 -1
  105. package/dist/tsup/chunk-G3CCRCTK.cjs.map +0 -1
  106. package/dist/tsup/chunk-GAV4PKFT.js.map +0 -1
  107. package/dist/tsup/chunk-SHBE77IT.js.map +0 -1
  108. /package/dist/tsup/{chunk-NIC3QLKL.js.map → chunk-3ZE5UDOA.js.map} +0 -0
  109. /package/dist/tsup/{chunk-P4OGQ4JL.js.map → chunk-BX4G2O6M.js.map} +0 -0
  110. /package/dist/tsup/{chunk-PAG6G46L.js.map → chunk-OH6CBWUD.js.map} +0 -0
  111. /package/dist/tsup/{chunk-MGTSVSUC.js.map → chunk-PLLHHJWR.js.map} +0 -0
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  encodeWorkflowHistoryTransport
3
- } from "./chunk-MGTSVSUC.js";
3
+ } from "./chunk-PLLHHJWR.js";
4
4
  import {
5
5
  assertUnreachable,
6
6
  bufferToArrayBuffer,
7
7
  encodeCborCompat
8
- } from "./chunk-B4IZU537.js";
8
+ } from "./chunk-RDTFPGU2.js";
9
9
 
10
10
  // src/workflow/inspector.ts
11
11
  function createHistoryEmitter() {
@@ -248,4 +248,4 @@ function toWorkflowHistory(snapshot) {
248
248
  export {
249
249
  createWorkflowInspectorAdapter
250
250
  };
251
- //# sourceMappingURL=chunk-P4OGQ4JL.js.map
251
+ //# sourceMappingURL=chunk-BX4G2O6M.js.map
@@ -2,13 +2,13 @@ import {
2
2
  deserializeActorKey,
3
3
  serializeActorKey
4
4
  } from "./chunk-JI6GZ2C2.js";
5
- import {
6
- AsyncMutex
7
- } from "./chunk-7AFZMFPQ.js";
8
5
  import {
9
6
  importWebSocket,
10
7
  logger
11
- } from "./chunk-PAG6G46L.js";
8
+ } from "./chunk-OH6CBWUD.js";
9
+ import {
10
+ AsyncMutex
11
+ } from "./chunk-7AFZMFPQ.js";
12
12
  import {
13
13
  EncodingSchema,
14
14
  assertUnreachable,
@@ -35,7 +35,7 @@ import {
35
35
  serializeWithEncoding,
36
36
  stringifyError,
37
37
  uint8ArrayToBase64
38
- } from "./chunk-B4IZU537.js";
38
+ } from "./chunk-RDTFPGU2.js";
39
39
  import {
40
40
  INTERNAL_ERROR_CODE,
41
41
  RivetError,
@@ -3543,6 +3543,23 @@ function createClientWithDriver(driver, config = {}) {
3543
3543
  }
3544
3544
  function createActorProxy(handle) {
3545
3545
  const methodCache = /* @__PURE__ */ new Map();
3546
+ const actionPath = (name) => {
3547
+ let method = methodCache.get(name);
3548
+ if (method) return method;
3549
+ method = new Proxy(
3550
+ (...args) => handle.action({ name, args }),
3551
+ {
3552
+ get(target, prop) {
3553
+ if (typeof prop === "symbol")
3554
+ return Reflect.get(target, prop);
3555
+ if (prop === "then") return void 0;
3556
+ return actionPath(`${name}.${prop}`);
3557
+ }
3558
+ }
3559
+ );
3560
+ methodCache.set(name, method);
3561
+ return method;
3562
+ };
3546
3563
  return new Proxy(handle, {
3547
3564
  get(target, prop, receiver) {
3548
3565
  if (typeof prop === "symbol") {
@@ -3557,12 +3574,7 @@ function createActorProxy(handle) {
3557
3574
  }
3558
3575
  if (typeof prop === "string") {
3559
3576
  if (prop === "then") return void 0;
3560
- let method = methodCache.get(prop);
3561
- if (!method) {
3562
- method = (...args) => target.action({ name: prop, args });
3563
- methodCache.set(prop, method);
3564
- }
3565
- return method;
3577
+ return actionPath(prop);
3566
3578
  }
3567
3579
  },
3568
3580
  // Support for 'in' operator
@@ -3580,6 +3592,7 @@ function createActorProxy(handle) {
3580
3592
  },
3581
3593
  // Support proper property descriptors
3582
3594
  getOwnPropertyDescriptor(target, prop) {
3595
+ if (prop === "then") return void 0;
3583
3596
  const targetDescriptor = Reflect.getOwnPropertyDescriptor(
3584
3597
  target,
3585
3598
  prop
@@ -3592,7 +3605,7 @@ function createActorProxy(handle) {
3592
3605
  configurable: true,
3593
3606
  enumerable: false,
3594
3607
  writable: false,
3595
- value: (...args) => target.action({ name: prop, args })
3608
+ value: actionPath(prop)
3596
3609
  };
3597
3610
  }
3598
3611
  return void 0;
@@ -4838,112 +4851,6 @@ function convertRegistryConfigToClientConfig(config) {
4838
4851
  };
4839
4852
  }
4840
4853
 
4841
- // src/engine-client/api-utils.ts
4842
- import { z as z3 } from "zod/v4";
4843
-
4844
- // src/engine-client/log.ts
4845
- function logger2() {
4846
- return getLogger("engine-client");
4847
- }
4848
-
4849
- // src/engine-client/api-utils.ts
4850
- function getEndpoint(config) {
4851
- return config.endpoint ?? "http://127.0.0.1:6420";
4852
- }
4853
- async function apiCall(config, method, path, body) {
4854
- const endpoint = getEndpoint(config);
4855
- const url = combineUrlPath(endpoint, path, {
4856
- namespace: config.namespace
4857
- });
4858
- logger2().debug({ msg: "making api call", method, url });
4859
- const headers = {
4860
- ...config.headers
4861
- };
4862
- if (config.token) {
4863
- headers.Authorization = `Bearer ${config.token}`;
4864
- }
4865
- return await sendHttpRequest({
4866
- method,
4867
- url,
4868
- headers,
4869
- body,
4870
- encoding: "json",
4871
- skipParseResponse: false,
4872
- requestVersionedDataHandler: void 0,
4873
- requestVersion: void 0,
4874
- responseVersionedDataHandler: void 0,
4875
- responseVersion: void 0,
4876
- requestZodSchema: z3.any(),
4877
- responseZodSchema: z3.any(),
4878
- // Identity conversions (passthrough for generic API calls)
4879
- requestToJson: (value) => value,
4880
- requestToBare: (value) => value,
4881
- responseFromJson: (value) => value,
4882
- responseFromBare: (value) => value
4883
- });
4884
- }
4885
-
4886
- // src/engine-client/api-endpoints.ts
4887
- async function getActor(config, _, actorId) {
4888
- return apiCall(
4889
- config,
4890
- "GET",
4891
- `/actors?actor_ids=${encodeURIComponent(actorId)}`
4892
- );
4893
- }
4894
- async function getActorByKey(config, name, key) {
4895
- const serializedKey = serializeActorKey(key);
4896
- return apiCall(
4897
- config,
4898
- "GET",
4899
- `/actors?name=${encodeURIComponent(name)}&key=${encodeURIComponent(serializedKey)}`
4900
- );
4901
- }
4902
- async function listActorsByName(config, name) {
4903
- return apiCall(
4904
- config,
4905
- "GET",
4906
- `/actors?name=${encodeURIComponent(name)}`
4907
- );
4908
- }
4909
- async function getOrCreateActor(config, request) {
4910
- return apiCall(
4911
- config,
4912
- "PUT",
4913
- `/actors`,
4914
- request
4915
- );
4916
- }
4917
- async function createActor(config, request) {
4918
- return apiCall(
4919
- config,
4920
- "POST",
4921
- `/actors`,
4922
- request
4923
- );
4924
- }
4925
- async function destroyActor(config, actorId) {
4926
- return apiCall(
4927
- config,
4928
- "DELETE",
4929
- `/actors/${encodeURIComponent(actorId)}`
4930
- );
4931
- }
4932
- async function getMetadata(config) {
4933
- return apiCall(config, "GET", `/metadata`);
4934
- }
4935
- async function getDatacenters(config) {
4936
- return apiCall(config, "GET", `/datacenters`);
4937
- }
4938
- async function updateRunnerConfig(config, runnerName, request) {
4939
- return apiCall(
4940
- config,
4941
- "PUT",
4942
- `/runner-configs/${runnerName}`,
4943
- request
4944
- );
4945
- }
4946
-
4947
4854
  // src/engine-client/mod.ts
4948
4855
  import invariant3 from "invariant";
4949
4856
 
@@ -5040,6 +4947,11 @@ function setRemoteHibernatableWebSocketAckTestHooks(websocket, token, enabled) {
5040
4947
  );
5041
4948
  }
5042
4949
 
4950
+ // src/engine-client/log.ts
4951
+ function logger2() {
4952
+ return getLogger("engine-client");
4953
+ }
4954
+
5043
4955
  // src/engine-client/actor-websocket-client.ts
5044
4956
  var BufferedRemoteWebSocket = class {
5045
4957
  CONNECTING = 0;
@@ -5319,6 +5231,105 @@ function buildWebSocketProtocols(runConfig, encoding, params, ackHookToken, targ
5319
5231
  return protocols;
5320
5232
  }
5321
5233
 
5234
+ // src/engine-client/api-utils.ts
5235
+ import { z as z3 } from "zod/v4";
5236
+ function getEndpoint(config) {
5237
+ return config.endpoint ?? "http://127.0.0.1:6420";
5238
+ }
5239
+ async function apiCall(config, method, path, body) {
5240
+ const endpoint = getEndpoint(config);
5241
+ const url = combineUrlPath(endpoint, path, {
5242
+ namespace: config.namespace
5243
+ });
5244
+ logger2().debug({ msg: "making api call", method, url });
5245
+ const headers = {
5246
+ ...config.headers
5247
+ };
5248
+ if (config.token) {
5249
+ headers.Authorization = `Bearer ${config.token}`;
5250
+ }
5251
+ return await sendHttpRequest({
5252
+ method,
5253
+ url,
5254
+ headers,
5255
+ body,
5256
+ encoding: "json",
5257
+ skipParseResponse: false,
5258
+ requestVersionedDataHandler: void 0,
5259
+ requestVersion: void 0,
5260
+ responseVersionedDataHandler: void 0,
5261
+ responseVersion: void 0,
5262
+ requestZodSchema: z3.any(),
5263
+ responseZodSchema: z3.any(),
5264
+ // Identity conversions (passthrough for generic API calls)
5265
+ requestToJson: (value) => value,
5266
+ requestToBare: (value) => value,
5267
+ responseFromJson: (value) => value,
5268
+ responseFromBare: (value) => value
5269
+ });
5270
+ }
5271
+
5272
+ // src/engine-client/api-endpoints.ts
5273
+ async function getActor(config, _, actorId) {
5274
+ return apiCall(
5275
+ config,
5276
+ "GET",
5277
+ `/actors?actor_ids=${encodeURIComponent(actorId)}`
5278
+ );
5279
+ }
5280
+ async function getActorByKey(config, name, key) {
5281
+ const serializedKey = serializeActorKey(key);
5282
+ return apiCall(
5283
+ config,
5284
+ "GET",
5285
+ `/actors?name=${encodeURIComponent(name)}&key=${encodeURIComponent(serializedKey)}`
5286
+ );
5287
+ }
5288
+ async function listActorsByName(config, name) {
5289
+ return apiCall(
5290
+ config,
5291
+ "GET",
5292
+ `/actors?name=${encodeURIComponent(name)}`
5293
+ );
5294
+ }
5295
+ async function getOrCreateActor(config, request) {
5296
+ return apiCall(
5297
+ config,
5298
+ "PUT",
5299
+ `/actors`,
5300
+ request
5301
+ );
5302
+ }
5303
+ async function createActor(config, request) {
5304
+ return apiCall(
5305
+ config,
5306
+ "POST",
5307
+ `/actors`,
5308
+ request
5309
+ );
5310
+ }
5311
+ async function destroyActor(config, actorId) {
5312
+ return apiCall(
5313
+ config,
5314
+ "DELETE",
5315
+ `/actors/${encodeURIComponent(actorId)}`
5316
+ );
5317
+ }
5318
+ async function getMetadata(config) {
5319
+ return apiCall(config, "GET", `/metadata`);
5320
+ }
5321
+ async function getDatacenters(config) {
5322
+ return apiCall(config, "GET", `/datacenters`);
5323
+ }
5324
+ async function updateRunnerConfig(config, runnerName, request) {
5325
+ return apiCall(
5326
+ config,
5327
+ "PUT",
5328
+ `/runner-configs/${runnerName}`,
5329
+ request
5330
+ );
5331
+ }
5332
+
5322
5333
  // src/engine-client/metadata.ts
5323
5334
  import pRetry2 from "p-retry";
5324
5335
  var metadataLookupCache = /* @__PURE__ */ new Map();
@@ -5824,9 +5835,8 @@ export {
5824
5835
  tryParseEndpoint,
5825
5836
  ClientConfigSchema,
5826
5837
  convertRegistryConfigToClientConfig,
5827
- getMetadata,
5828
5838
  getDatacenters,
5829
5839
  updateRunnerConfig,
5830
5840
  RemoteEngineControlClient
5831
5841
  };
5832
- //# sourceMappingURL=chunk-GAV4PKFT.js.map
5842
+ //# sourceMappingURL=chunk-F6ZW7JZQ.js.map