rivetkit 2.3.9 → 2.3.10

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 (90) hide show
  1. package/dist/browser/client.d.ts +6 -34
  2. package/dist/browser/client.js +14 -33
  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 +6 -34
  9. package/dist/tsup/agent-os/index.d.ts +6 -34
  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-KVKWTOW7.js → chunk-6UHZLL6S.js} +3 -3
  13. package/dist/tsup/{chunk-MQDQ3A72.js → chunk-DPM73GAL.js} +15 -36
  14. package/dist/tsup/chunk-DPM73GAL.js.map +1 -0
  15. package/dist/tsup/{chunk-BQU4XTKM.js → chunk-E6IEX6AP.js} +3 -3
  16. package/dist/tsup/{chunk-GZ5DYSIR.cjs → chunk-G6XA2OSW.cjs} +4 -4
  17. package/dist/tsup/{chunk-GZ5DYSIR.cjs.map → chunk-G6XA2OSW.cjs.map} +1 -1
  18. package/dist/tsup/{chunk-AVUMOGUE.cjs → chunk-INXPYXN6.cjs} +7 -7
  19. package/dist/tsup/{chunk-AVUMOGUE.cjs.map → chunk-INXPYXN6.cjs.map} +1 -1
  20. package/dist/tsup/{chunk-3IDKUXQT.cjs → chunk-LCWHS6K7.cjs} +151 -172
  21. package/dist/tsup/chunk-LCWHS6K7.cjs.map +1 -0
  22. package/dist/tsup/{chunk-S57DMBTM.cjs → chunk-PCJSDS7N.cjs} +3 -3
  23. package/dist/tsup/{chunk-S57DMBTM.cjs.map → chunk-PCJSDS7N.cjs.map} +1 -1
  24. package/dist/tsup/{chunk-X25YYVFL.js → chunk-Q5H37KNQ.js} +2 -2
  25. package/dist/tsup/{chunk-KPP2YRS5.cjs → chunk-U2A3Y7OK.cjs} +9 -9
  26. package/dist/tsup/{chunk-KPP2YRS5.cjs.map → chunk-U2A3Y7OK.cjs.map} +1 -1
  27. package/dist/tsup/{chunk-UBYPRYJR.js → chunk-X7XY6NCU.js} +3 -6
  28. package/dist/tsup/chunk-X7XY6NCU.js.map +1 -0
  29. package/dist/tsup/{chunk-CQ23UFQ4.js → chunk-XSPAARQ5.js} +2 -2
  30. package/dist/tsup/{chunk-M4R2O5NJ.cjs → chunk-Z2ESFE5Z.cjs} +3 -6
  31. package/dist/tsup/chunk-Z2ESFE5Z.cjs.map +1 -0
  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-CUymbyM6.d.ts → config-BRpVbJCD.d.ts} +7 -35
  41. package/dist/tsup/{config-CpB-e4I9.d.cts → config-BobvQpex.d.cts} +7 -35
  42. package/dist/tsup/{context-YBUBTwTS.d.ts → context-Cj-DFyiy.d.ts} +1 -1
  43. package/dist/tsup/{context-c-6G4mjk.d.cts → context-YEBNJrws.d.cts} +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 +124 -449
  55. package/dist/tsup/mod.cjs.map +1 -1
  56. package/dist/tsup/mod.d.cts +3 -3
  57. package/dist/tsup/mod.d.ts +3 -3
  58. package/dist/tsup/mod.js +63 -388
  59. package/dist/tsup/mod.js.map +1 -1
  60. package/dist/tsup/test/mod.cjs +6 -6
  61. package/dist/tsup/test/mod.d.cts +1 -1
  62. package/dist/tsup/test/mod.d.ts +1 -1
  63. package/dist/tsup/test/mod.js +4 -4
  64. package/dist/tsup/utils.cjs +2 -2
  65. package/dist/tsup/utils.js +1 -1
  66. package/dist/tsup/workflow/mod.cjs +6 -6
  67. package/dist/tsup/workflow/mod.d.cts +3 -3
  68. package/dist/tsup/workflow/mod.d.ts +3 -3
  69. package/dist/tsup/workflow/mod.js +3 -3
  70. package/package.json +8 -8
  71. package/src/client/actor-handle.ts +1 -3
  72. package/src/client/raw-utils.ts +2 -11
  73. package/src/common/actor-router-consts.ts +0 -1
  74. package/src/common/encoding.ts +1 -4
  75. package/src/engine-client/actor-http-client.ts +22 -6
  76. package/src/registry/index.ts +14 -159
  77. package/src/registry/napi-runtime.ts +0 -74
  78. package/src/registry/native.ts +63 -111
  79. package/src/registry/runtime.ts +0 -35
  80. package/src/registry/wasm-runtime.ts +0 -11
  81. package/dist/tsup/chunk-3IDKUXQT.cjs.map +0 -1
  82. package/dist/tsup/chunk-M4R2O5NJ.cjs.map +0 -1
  83. package/dist/tsup/chunk-MQDQ3A72.js.map +0 -1
  84. package/dist/tsup/chunk-UBYPRYJR.js.map +0 -1
  85. package/src/common/fetch-like.ts +0 -49
  86. package/src/registry/native-http.ts +0 -208
  87. /package/dist/tsup/{chunk-KVKWTOW7.js.map → chunk-6UHZLL6S.js.map} +0 -0
  88. /package/dist/tsup/{chunk-BQU4XTKM.js.map → chunk-E6IEX6AP.js.map} +0 -0
  89. /package/dist/tsup/{chunk-X25YYVFL.js.map → chunk-Q5H37KNQ.js.map} +0 -0
  90. /package/dist/tsup/{chunk-CQ23UFQ4.js.map → chunk-XSPAARQ5.js.map} +0 -0
@@ -2,10 +2,10 @@ import {
2
2
  ClientConfigSchema,
3
3
  RemoteEngineControlClient,
4
4
  createClientWithDriver
5
- } from "./chunk-MQDQ3A72.js";
5
+ } from "./chunk-DPM73GAL.js";
6
6
  import {
7
7
  getLogger
8
- } from "./chunk-UBYPRYJR.js";
8
+ } from "./chunk-X7XY6NCU.js";
9
9
 
10
10
  // src/devtools-loader/log.ts
11
11
  function logger() {
@@ -46,4 +46,4 @@ function createClient(endpointOrConfig) {
46
46
  export {
47
47
  createClient
48
48
  };
49
- //# sourceMappingURL=chunk-KVKWTOW7.js.map
49
+ //# sourceMappingURL=chunk-6UHZLL6S.js.map
@@ -8,7 +8,7 @@ import {
8
8
  import {
9
9
  importWebSocket,
10
10
  logger
11
- } from "./chunk-X25YYVFL.js";
11
+ } from "./chunk-Q5H37KNQ.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-UBYPRYJR.js";
38
+ } from "./chunk-X7XY6NCU.js";
39
39
  import {
40
40
  INTERNAL_ERROR_CODE,
41
41
  RivetError,
@@ -50,7 +50,6 @@ var PATH_WEBSOCKET_PREFIX = "/websocket/";
50
50
  var HEADER_ACTOR_QUERY = "x-rivet-query";
51
51
  var HEADER_ENCODING = "x-rivet-encoding";
52
52
  var HEADER_CONN_PARAMS = "x-rivet-conn-params";
53
- var HEADER_ORIGINAL_REQUEST_URL = "x-rivet-internal-original-request-url";
54
53
  var HEADER_ACTOR_ID = "x-rivet-actor";
55
54
  var HEADER_ACTOR_GENERATION = "x-rivet-actor-generation";
56
55
  var HEADER_ACTOR_KEY = "x-rivet-actor-key";
@@ -2144,20 +2143,6 @@ async function checkForSchedulingError(group, code, actorId, query, driver) {
2144
2143
  return null;
2145
2144
  }
2146
2145
 
2147
- // src/common/fetch-like.ts
2148
- function isUrlLike(value) {
2149
- return typeof value === "object" && value !== null && typeof value.href === "string" && typeof value.pathname === "string" && typeof value.search === "string";
2150
- }
2151
- function isRequestLike(value) {
2152
- return typeof value === "object" && value !== null && typeof value.url === "string" && typeof value.method === "string" && isHeadersLike(value.headers);
2153
- }
2154
- function isResponseLike(value) {
2155
- return typeof value === "object" && value !== null && typeof value.status === "number" && isHeadersLike(value.headers) && typeof value.arrayBuffer === "function";
2156
- }
2157
- function isHeadersLike(value) {
2158
- return typeof value === "object" && value !== null && typeof value.entries === "function";
2159
- }
2160
-
2161
2146
  // src/client/lifecycle-errors.ts
2162
2147
  function* walkErrorChain(error, maxDepth = 8) {
2163
2148
  let current = error;
@@ -2591,17 +2576,14 @@ function createQueueSender(senderOptions) {
2591
2576
  // src/client/raw-utils.ts
2592
2577
  async function rawHttpFetch(driver, target, params, input, init, options = {}) {
2593
2578
  let path;
2594
- let originalUrl;
2595
2579
  let mergedInit = init || {};
2596
2580
  if (typeof input === "string") {
2597
2581
  path = input;
2598
- } else if (isUrlLike(input)) {
2582
+ } else if (input instanceof URL) {
2599
2583
  path = input.pathname + input.search;
2600
- originalUrl = input.toString();
2601
- } else if (isRequestLike(input)) {
2584
+ } else if (input instanceof Request) {
2602
2585
  const url = new URL(input.url);
2603
2586
  path = url.pathname + url.search;
2604
- originalUrl = url.toString();
2605
2587
  const requestHeaders = new Headers(input.headers);
2606
2588
  const initHeaders = new Headers((init == null ? void 0 : init.headers) || {});
2607
2589
  const mergedHeaders = new Headers(requestHeaders);
@@ -2643,10 +2625,6 @@ async function rawHttpFetch(driver, target, params, input, init, options = {}) {
2643
2625
  const normalizedPath = path.startsWith("/") ? path.slice(1) : path;
2644
2626
  const url = new URL(`http://actor/request/${normalizedPath}`);
2645
2627
  const proxyRequestHeaders = new Headers(mergedInit.headers);
2646
- proxyRequestHeaders.delete(HEADER_ORIGINAL_REQUEST_URL);
2647
- if (originalUrl) {
2648
- proxyRequestHeaders.set(HEADER_ORIGINAL_REQUEST_URL, originalUrl);
2649
- }
2650
2628
  if (params) {
2651
2629
  proxyRequestHeaders.set(HEADER_CONN_PARAMS, JSON.stringify(params));
2652
2630
  }
@@ -3119,7 +3097,6 @@ var ActorHandleRaw = class {
3119
3097
  async #fetchWithResolvedActor(input, init) {
3120
3098
  const maxAttempts = this.#getDynamicQueryMaxAttempts();
3121
3099
  let useQueryTarget = false;
3122
- const retryableRequest = isRequestLike(input) ? input.clone() : void 0;
3123
3100
  const { skipReadyWait, ...requestInit } = init ?? {};
3124
3101
  const gatewayOptions = resolveActorGatewayOptions(
3125
3102
  this.#gatewayOptions,
@@ -3139,7 +3116,7 @@ var ActorHandleRaw = class {
3139
3116
  this.#driver,
3140
3117
  target,
3141
3118
  this.#params,
3142
- retryableRequest ? retryableRequest.clone() : input,
3119
+ input,
3143
3120
  requestInit,
3144
3121
  gatewayOptions
3145
3122
  );
@@ -4890,19 +4867,23 @@ async function sendHttpRequestToGateway(runConfig, gatewayUrl, actorRequest, opt
4890
4867
  if (actorRequest.bodyUsed) {
4891
4868
  throw new Error("Request body has already been consumed");
4892
4869
  }
4893
- if (actorRequest.body) {
4894
- bodyToSend = actorRequest.body;
4870
+ const reqBody = await actorRequest.arrayBuffer();
4871
+ if (reqBody.byteLength !== 0) {
4872
+ bodyToSend = reqBody;
4895
4873
  guardHeaders.delete("transfer-encoding");
4896
4874
  guardHeaders.delete("content-length");
4897
4875
  }
4898
4876
  }
4899
- return fetch(gatewayUrl, {
4877
+ const guardRequest = new Request(gatewayUrl, {
4900
4878
  method: actorRequest.method,
4901
4879
  headers: guardHeaders,
4902
4880
  body: bodyToSend,
4903
- signal: actorRequest.signal,
4904
- ...bodyToSend ? { duplex: "half" } : {}
4881
+ signal: actorRequest.signal
4905
4882
  });
4883
+ return mutableResponse(await fetch(guardRequest));
4884
+ }
4885
+ function mutableResponse(fetchRes) {
4886
+ return new Response(fetchRes.body, fetchRes);
4906
4887
  }
4907
4888
  function buildGuardHeaders(runConfig, actorRequest, options) {
4908
4889
  const headers = new Headers();
@@ -5843,14 +5824,12 @@ function apiActorToOutput(actor) {
5843
5824
 
5844
5825
  export {
5845
5826
  HEADER_CONN_PARAMS,
5846
- HEADER_ORIGINAL_REQUEST_URL,
5847
5827
  ALLOWED_PUBLIC_HEADERS,
5848
5828
  ActorClientError,
5849
5829
  ManagerError,
5850
5830
  MalformedResponseMessage,
5851
5831
  ActorConnDisposed,
5852
5832
  ActorConnRaw,
5853
- isResponseLike,
5854
5833
  ActorHandleRaw,
5855
5834
  createClientWithDriver,
5856
5835
  tryParseEndpoint,
@@ -5860,4 +5839,4 @@ export {
5860
5839
  updateRunnerConfig,
5861
5840
  RemoteEngineControlClient
5862
5841
  };
5863
- //# sourceMappingURL=chunk-MQDQ3A72.js.map
5842
+ //# sourceMappingURL=chunk-DPM73GAL.js.map