rivetkit 2.3.11-rc.2 → 2.3.11-rc.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.
- package/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.js +1 -1
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +1 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.js +1 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-J4RT6EFK.cjs → chunk-2C7J6RYX.cjs} +9 -9
- package/dist/tsup/{chunk-J4RT6EFK.cjs.map → chunk-2C7J6RYX.cjs.map} +1 -1
- package/dist/tsup/{chunk-XWIXH7JF.js → chunk-4JQYWBMT.js} +2 -2
- package/dist/tsup/{chunk-XWIXH7JF.js.map → chunk-4JQYWBMT.js.map} +1 -1
- package/dist/tsup/{chunk-NRRWLN6D.cjs → chunk-5MC4O5QQ.cjs} +3 -3
- package/dist/tsup/{chunk-NRRWLN6D.cjs.map → chunk-5MC4O5QQ.cjs.map} +1 -1
- package/dist/tsup/{chunk-XR2KF2ZA.js → chunk-GN75YOYN.js} +3 -3
- package/dist/tsup/{chunk-NLAW2MIM.js → chunk-IBCX366R.js} +2 -2
- package/dist/tsup/{chunk-7TVKYMD3.cjs → chunk-IVOQLFNA.cjs} +4 -4
- package/dist/tsup/{chunk-7TVKYMD3.cjs.map → chunk-IVOQLFNA.cjs.map} +1 -1
- package/dist/tsup/{chunk-LPGJPAVY.cjs → chunk-KJF2L4B6.cjs} +7 -7
- package/dist/tsup/{chunk-LPGJPAVY.cjs.map → chunk-KJF2L4B6.cjs.map} +1 -1
- package/dist/tsup/{chunk-5SHK4JM5.cjs → chunk-QO6FXNYD.cjs} +2 -2
- package/dist/tsup/{chunk-5SHK4JM5.cjs.map → chunk-QO6FXNYD.cjs.map} +1 -1
- package/dist/tsup/{chunk-75K5VACB.js → chunk-RA7NE7YH.js} +3 -3
- package/dist/tsup/{chunk-3NPCXMJS.cjs → chunk-RVZYWLP2.cjs} +138 -138
- package/dist/tsup/{chunk-3NPCXMJS.cjs.map → chunk-RVZYWLP2.cjs.map} +1 -1
- package/dist/tsup/{chunk-RVJQMOAA.js → chunk-T34YWMEG.js} +2 -2
- package/dist/tsup/{chunk-KHSNHG4G.js → chunk-VAVQ4N74.js} +3 -3
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +2 -2
- package/dist/tsup/db/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +4 -4
- package/dist/tsup/inspector/mod.js +3 -3
- package/dist/tsup/mod.cjs +65 -65
- package/dist/tsup/mod.js +4 -4
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +6 -6
- package/dist/tsup/workflow/mod.js +3 -3
- package/package.json +8 -8
- /package/dist/tsup/{chunk-XR2KF2ZA.js.map → chunk-GN75YOYN.js.map} +0 -0
- /package/dist/tsup/{chunk-NLAW2MIM.js.map → chunk-IBCX366R.js.map} +0 -0
- /package/dist/tsup/{chunk-75K5VACB.js.map → chunk-RA7NE7YH.js.map} +0 -0
- /package/dist/tsup/{chunk-RVJQMOAA.js.map → chunk-T34YWMEG.js.map} +0 -0
- /package/dist/tsup/{chunk-KHSNHG4G.js.map → chunk-VAVQ4N74.js.map} +0 -0
|
@@ -8,7 +8,7 @@ var _chunkUEULFXUIcjs = require('./chunk-UEULFXUI.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk5MC4O5QQcjs = require('./chunk-5MC4O5QQ.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -35,7 +35,7 @@ var _chunkNRRWLN6Dcjs = require('./chunk-NRRWLN6D.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkQO6FXNYDcjs = require('./chunk-QO6FXNYD.cjs');
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
@@ -2126,7 +2126,7 @@ async function checkForSchedulingError(group, code, actorId, query, driver) {
|
|
|
2126
2126
|
try {
|
|
2127
2127
|
const actor = await driver.getForId({ name, actorId });
|
|
2128
2128
|
if (actor == null ? void 0 : actor.error) {
|
|
2129
|
-
|
|
2129
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).info({
|
|
2130
2130
|
msg: "found actor scheduling error",
|
|
2131
2131
|
actorId,
|
|
2132
2132
|
error: actor.error
|
|
@@ -2134,10 +2134,10 @@ async function checkForSchedulingError(group, code, actorId, query, driver) {
|
|
|
2134
2134
|
return actorSchedulingError(group, code, actorId, actor.error);
|
|
2135
2135
|
}
|
|
2136
2136
|
} catch (err) {
|
|
2137
|
-
|
|
2137
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
2138
2138
|
msg: "failed to fetch actor details for scheduling error check",
|
|
2139
2139
|
actorId,
|
|
2140
|
-
error:
|
|
2140
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
2141
2141
|
});
|
|
2142
2142
|
}
|
|
2143
2143
|
return null;
|
|
@@ -2347,7 +2347,7 @@ function parseWebSocketCloseReason(reason) {
|
|
|
2347
2347
|
const [mainPart, rayId] = reason.split("#");
|
|
2348
2348
|
const [group, code] = mainPart.split(".");
|
|
2349
2349
|
if (!group || !code) {
|
|
2350
|
-
|
|
2350
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({ msg: "failed to parse close reason", reason });
|
|
2351
2351
|
return void 0;
|
|
2352
2352
|
}
|
|
2353
2353
|
return {
|
|
@@ -2369,11 +2369,11 @@ function messageLength(message) {
|
|
|
2369
2369
|
if (typeof message === "string") {
|
|
2370
2370
|
return message.length;
|
|
2371
2371
|
}
|
|
2372
|
-
|
|
2372
|
+
_chunkQO6FXNYDcjs.assertUnreachable.call(void 0, message);
|
|
2373
2373
|
}
|
|
2374
2374
|
async function sendHttpRequest(opts) {
|
|
2375
2375
|
var _a, _b, _c;
|
|
2376
|
-
|
|
2376
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
2377
2377
|
msg: "sending http request",
|
|
2378
2378
|
url: opts.url,
|
|
2379
2379
|
encoding: opts.encoding
|
|
@@ -2382,8 +2382,8 @@ async function sendHttpRequest(opts) {
|
|
|
2382
2382
|
let bodyData;
|
|
2383
2383
|
if (opts.method === "POST" || opts.method === "PUT") {
|
|
2384
2384
|
_invariant2.default.call(void 0, opts.body !== void 0, "missing body");
|
|
2385
|
-
contentType =
|
|
2386
|
-
bodyData =
|
|
2385
|
+
contentType = _chunkQO6FXNYDcjs.contentTypeForEncoding.call(void 0, opts.encoding);
|
|
2386
|
+
bodyData = _chunkQO6FXNYDcjs.serializeWithEncoding.call(void 0,
|
|
2387
2387
|
opts.encoding,
|
|
2388
2388
|
opts.body,
|
|
2389
2389
|
opts.requestVersionedDataHandler,
|
|
@@ -2403,7 +2403,7 @@ async function sendHttpRequest(opts) {
|
|
|
2403
2403
|
...contentType ? {
|
|
2404
2404
|
"Content-Type": contentType
|
|
2405
2405
|
} : {},
|
|
2406
|
-
"User-Agent":
|
|
2406
|
+
"User-Agent": _chunkQO6FXNYDcjs.httpUserAgent.call(void 0, )
|
|
2407
2407
|
},
|
|
2408
2408
|
body: bodyData,
|
|
2409
2409
|
credentials: "include",
|
|
@@ -2421,7 +2421,7 @@ async function sendHttpRequest(opts) {
|
|
|
2421
2421
|
const rayId = response.headers.get("x-rivet-ray-id");
|
|
2422
2422
|
const encoding = (contentType2 == null ? void 0 : contentType2.includes("application/json")) ? "json" : opts.encoding;
|
|
2423
2423
|
try {
|
|
2424
|
-
const responseData =
|
|
2424
|
+
const responseData = _chunkQO6FXNYDcjs.deserializeWithEncoding.call(void 0,
|
|
2425
2425
|
encoding,
|
|
2426
2426
|
new Uint8Array(bufferResponse),
|
|
2427
2427
|
HTTP_RESPONSE_ERROR_VERSIONED,
|
|
@@ -2439,7 +2439,7 @@ async function sendHttpRequest(opts) {
|
|
|
2439
2439
|
group: bare5.group,
|
|
2440
2440
|
code: bare5.code,
|
|
2441
2441
|
message: bare5.message,
|
|
2442
|
-
metadata: bare5.metadata ?
|
|
2442
|
+
metadata: bare5.metadata ? _chunkQO6FXNYDcjs.decodeCborCompat.call(void 0, new Uint8Array(bare5.metadata)) : void 0,
|
|
2443
2443
|
actor: bare5.actor ? {
|
|
2444
2444
|
actorId: bare5.actor.actorId,
|
|
2445
2445
|
generation: Number(bare5.actor.generation),
|
|
@@ -2447,7 +2447,7 @@ async function sendHttpRequest(opts) {
|
|
|
2447
2447
|
} : void 0
|
|
2448
2448
|
})
|
|
2449
2449
|
);
|
|
2450
|
-
|
|
2450
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
2451
2451
|
msg: "http error response",
|
|
2452
2452
|
group: responseData.group,
|
|
2453
2453
|
code: responseData.code,
|
|
@@ -2491,7 +2491,7 @@ ${textResponse}`
|
|
|
2491
2491
|
}
|
|
2492
2492
|
try {
|
|
2493
2493
|
const buffer = new Uint8Array(await response.arrayBuffer());
|
|
2494
|
-
return
|
|
2494
|
+
return _chunkQO6FXNYDcjs.deserializeWithEncoding.call(void 0,
|
|
2495
2495
|
opts.encoding,
|
|
2496
2496
|
buffer,
|
|
2497
2497
|
opts.responseVersionedDataHandler,
|
|
@@ -2538,8 +2538,8 @@ function createQueueSender(senderOptions) {
|
|
|
2538
2538
|
}),
|
|
2539
2539
|
requestToBare: (value) => ({
|
|
2540
2540
|
name: _nullishCoalesce(value.name, () => ( name)),
|
|
2541
|
-
body:
|
|
2542
|
-
|
|
2541
|
+
body: _chunkQO6FXNYDcjs.bufferToArrayBuffer.call(void 0,
|
|
2542
|
+
_chunkQO6FXNYDcjs.encodeCborCompat.call(void 0, value.body)
|
|
2543
2543
|
),
|
|
2544
2544
|
wait: _nullishCoalesce(value.wait, () => ( false)),
|
|
2545
2545
|
timeout: value.timeout !== void 0 ? BigInt(value.timeout) : null
|
|
@@ -2559,7 +2559,7 @@ function createQueueSender(senderOptions) {
|
|
|
2559
2559
|
}
|
|
2560
2560
|
return {
|
|
2561
2561
|
status: bare5.status,
|
|
2562
|
-
response:
|
|
2562
|
+
response: _chunkQO6FXNYDcjs.decodeCborCompat.call(void 0, new Uint8Array(bare5.response))
|
|
2563
2563
|
};
|
|
2564
2564
|
}
|
|
2565
2565
|
});
|
|
@@ -2627,7 +2627,7 @@ async function rawHttpFetch(driver, target, params, input, init, options = {}) {
|
|
|
2627
2627
|
throw new TypeError("Invalid input type for fetch");
|
|
2628
2628
|
}
|
|
2629
2629
|
try {
|
|
2630
|
-
|
|
2630
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug(
|
|
2631
2631
|
"directId" in target ? {
|
|
2632
2632
|
msg: "sending raw http request to actor",
|
|
2633
2633
|
actorId: target.directId
|
|
@@ -2648,7 +2648,7 @@ async function rawHttpFetch(driver, target, params, input, init, options = {}) {
|
|
|
2648
2648
|
});
|
|
2649
2649
|
return driver.sendRequest(target, proxyRequest, options);
|
|
2650
2650
|
} catch (err) {
|
|
2651
|
-
const { group, code, message, metadata, actor } =
|
|
2651
|
+
const { group, code, message, metadata, actor } = _chunkQO6FXNYDcjs.deconstructError.call(void 0,
|
|
2652
2652
|
err,
|
|
2653
2653
|
true
|
|
2654
2654
|
);
|
|
@@ -2672,7 +2672,7 @@ async function rawWebSocket(driver, target, params, path, _protocols, options =
|
|
|
2672
2672
|
}
|
|
2673
2673
|
}
|
|
2674
2674
|
const fullPath = `${PATH_WEBSOCKET_PREFIX}${pathPortion}${queryPortion}`;
|
|
2675
|
-
|
|
2675
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
2676
2676
|
msg: "opening websocket",
|
|
2677
2677
|
target,
|
|
2678
2678
|
encoding,
|
|
@@ -2793,7 +2793,7 @@ var ActorHandleRaw = class {
|
|
|
2793
2793
|
}
|
|
2794
2794
|
}).send(name, body, options);
|
|
2795
2795
|
} catch (err) {
|
|
2796
|
-
const { group, code, message, metadata, actor } =
|
|
2796
|
+
const { group, code, message, metadata, actor } = _chunkQO6FXNYDcjs.deconstructError.call(void 0, err, true);
|
|
2797
2797
|
if (this.#shouldRetryQueueDispatchOverload(
|
|
2798
2798
|
group,
|
|
2799
2799
|
code,
|
|
@@ -2880,13 +2880,13 @@ var ActorHandleRaw = class {
|
|
|
2880
2880
|
gatewayOptions
|
|
2881
2881
|
);
|
|
2882
2882
|
actorId = "directId" in target ? target.directId : void 0;
|
|
2883
|
-
|
|
2883
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug(
|
|
2884
2884
|
actorId ? { msg: "using direct actor gateway target", actorId } : {
|
|
2885
2885
|
msg: "using query gateway target for action",
|
|
2886
2886
|
query: this.#actorResolutionState
|
|
2887
2887
|
}
|
|
2888
2888
|
);
|
|
2889
|
-
|
|
2889
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
2890
2890
|
msg: "handling action",
|
|
2891
2891
|
name: opts.name,
|
|
2892
2892
|
encoding: this.#encoding
|
|
@@ -2920,19 +2920,19 @@ var ActorHandleRaw = class {
|
|
|
2920
2920
|
args
|
|
2921
2921
|
}),
|
|
2922
2922
|
requestToBare: (args) => ({
|
|
2923
|
-
args:
|
|
2924
|
-
|
|
2923
|
+
args: _chunkQO6FXNYDcjs.bufferToArrayBuffer.call(void 0,
|
|
2924
|
+
_chunkQO6FXNYDcjs.encodeCborCompat.call(void 0, args)
|
|
2925
2925
|
)
|
|
2926
2926
|
}),
|
|
2927
2927
|
responseFromJson: (json) => json.output,
|
|
2928
|
-
responseFromBare: (bare5) =>
|
|
2928
|
+
responseFromBare: (bare5) => _chunkQO6FXNYDcjs.decodeCborCompat.call(void 0, new Uint8Array(bare5.output))
|
|
2929
2929
|
});
|
|
2930
2930
|
if (opts.name === "destroy" && actorId) {
|
|
2931
2931
|
await this.#waitForDestroyActionToSettle(actorId);
|
|
2932
2932
|
}
|
|
2933
2933
|
return output;
|
|
2934
2934
|
} catch (err) {
|
|
2935
|
-
const { group, code, message, metadata, actor } =
|
|
2935
|
+
const { group, code, message, metadata, actor } = _chunkQO6FXNYDcjs.deconstructError.call(void 0, err, true);
|
|
2936
2936
|
if (await this.#shouldRetrySchedulingError(
|
|
2937
2937
|
group,
|
|
2938
2938
|
code,
|
|
@@ -3082,7 +3082,7 @@ var ActorHandleRaw = class {
|
|
|
3082
3082
|
* @returns {ActorConn<AD>} A connection to the actor.
|
|
3083
3083
|
*/
|
|
3084
3084
|
connect(params, options = {}) {
|
|
3085
|
-
|
|
3085
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3086
3086
|
msg: "establishing connection from handle",
|
|
3087
3087
|
query: this.#actorResolutionState
|
|
3088
3088
|
});
|
|
@@ -3149,7 +3149,7 @@ var ActorHandleRaw = class {
|
|
|
3149
3149
|
}
|
|
3150
3150
|
return response;
|
|
3151
3151
|
} catch (err) {
|
|
3152
|
-
const { group, code, message, metadata, actor } =
|
|
3152
|
+
const { group, code, message, metadata, actor } = _chunkQO6FXNYDcjs.deconstructError.call(void 0, err, true);
|
|
3153
3153
|
if (await this.#shouldRetrySchedulingError(
|
|
3154
3154
|
group,
|
|
3155
3155
|
code,
|
|
@@ -3238,7 +3238,7 @@ var ActorHandleRaw = class {
|
|
|
3238
3238
|
const contentType = response.headers.get("content-type");
|
|
3239
3239
|
const encoding = (contentType == null ? void 0 : contentType.includes("application/json")) ? "json" : this.#encoding;
|
|
3240
3240
|
try {
|
|
3241
|
-
return
|
|
3241
|
+
return _chunkQO6FXNYDcjs.deserializeWithEncoding.call(void 0,
|
|
3242
3242
|
encoding,
|
|
3243
3243
|
new Uint8Array(await response.clone().arrayBuffer()),
|
|
3244
3244
|
HTTP_RESPONSE_ERROR_VERSIONED,
|
|
@@ -3254,7 +3254,7 @@ var ActorHandleRaw = class {
|
|
|
3254
3254
|
group: bare5.group,
|
|
3255
3255
|
code: bare5.code,
|
|
3256
3256
|
message: bare5.message,
|
|
3257
|
-
metadata: bare5.metadata ?
|
|
3257
|
+
metadata: bare5.metadata ? _chunkQO6FXNYDcjs.decodeCborCompat.call(void 0, new Uint8Array(bare5.metadata)) : void 0,
|
|
3258
3258
|
actor: bare5.actor ? {
|
|
3259
3259
|
actorId: bare5.actor.actorId,
|
|
3260
3260
|
generation: Number(bare5.actor.generation),
|
|
@@ -3358,7 +3358,7 @@ var ClientRaw = (_class = class {
|
|
|
3358
3358
|
* @returns {ActorHandle<AD>} - A handle to the actor.
|
|
3359
3359
|
*/
|
|
3360
3360
|
getForId(name, actorId, opts) {
|
|
3361
|
-
|
|
3361
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3362
3362
|
msg: "get handle to actor with id",
|
|
3363
3363
|
name,
|
|
3364
3364
|
actorId,
|
|
@@ -3388,7 +3388,7 @@ var ClientRaw = (_class = class {
|
|
|
3388
3388
|
*/
|
|
3389
3389
|
get(name, key, opts) {
|
|
3390
3390
|
const keyArray = typeof key === "string" ? [key] : key || [];
|
|
3391
|
-
|
|
3391
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3392
3392
|
msg: "get handle to actor",
|
|
3393
3393
|
name,
|
|
3394
3394
|
key: keyArray,
|
|
@@ -3418,7 +3418,7 @@ var ClientRaw = (_class = class {
|
|
|
3418
3418
|
*/
|
|
3419
3419
|
getOrCreate(name, key, opts) {
|
|
3420
3420
|
const keyArray = typeof key === "string" ? [key] : key || [];
|
|
3421
|
-
|
|
3421
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3422
3422
|
msg: "get or create handle to actor",
|
|
3423
3423
|
name,
|
|
3424
3424
|
key: keyArray,
|
|
@@ -3460,7 +3460,7 @@ var ClientRaw = (_class = class {
|
|
|
3460
3460
|
key: keyArray
|
|
3461
3461
|
}
|
|
3462
3462
|
};
|
|
3463
|
-
|
|
3463
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3464
3464
|
msg: "create actor handle",
|
|
3465
3465
|
name,
|
|
3466
3466
|
key: keyArray,
|
|
@@ -3468,7 +3468,7 @@ var ClientRaw = (_class = class {
|
|
|
3468
3468
|
create: createQuery.create
|
|
3469
3469
|
});
|
|
3470
3470
|
const actorId = await resolveGatewayTarget(this.#driver, createQuery);
|
|
3471
|
-
|
|
3471
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3472
3472
|
msg: "created actor with ID",
|
|
3473
3473
|
name,
|
|
3474
3474
|
key: keyArray,
|
|
@@ -3511,11 +3511,11 @@ var ClientRaw = (_class = class {
|
|
|
3511
3511
|
*/
|
|
3512
3512
|
async dispose() {
|
|
3513
3513
|
if (this.#disposed) {
|
|
3514
|
-
|
|
3514
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({ msg: "client already disconnected" });
|
|
3515
3515
|
return;
|
|
3516
3516
|
}
|
|
3517
3517
|
this.#disposed = true;
|
|
3518
|
-
|
|
3518
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({ msg: "disposing client" });
|
|
3519
3519
|
const disposePromises = [];
|
|
3520
3520
|
for (const conn of this[ACTOR_CONNS_SYMBOL].values()) {
|
|
3521
3521
|
disposePromises.push(conn.dispose());
|
|
@@ -3682,8 +3682,8 @@ var ActorConnRaw = class {
|
|
|
3682
3682
|
if ("getForId" in actorResolutionState) {
|
|
3683
3683
|
this.#actorId = actorResolutionState.getForId.actorId;
|
|
3684
3684
|
}
|
|
3685
|
-
this.#readyPromise =
|
|
3686
|
-
(reason) =>
|
|
3685
|
+
this.#readyPromise = _chunkQO6FXNYDcjs.promiseWithResolvers.call(void 0,
|
|
3686
|
+
(reason) => _chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
3687
3687
|
msg: "unhandled ready promise rejection",
|
|
3688
3688
|
reason
|
|
3689
3689
|
})
|
|
@@ -3746,11 +3746,11 @@ var ActorConnRaw = class {
|
|
|
3746
3746
|
`Invalid action call: expected an options object { name, args }, got ${typeof opts}. Use conn.actionName(...args) for the shorthand API.`
|
|
3747
3747
|
);
|
|
3748
3748
|
}
|
|
3749
|
-
|
|
3749
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({ msg: "action", name: opts.name, args: opts.args });
|
|
3750
3750
|
const actionId = this.#actionIdCounter;
|
|
3751
3751
|
this.#actionIdCounter += 1;
|
|
3752
|
-
const { promise, resolve, reject } =
|
|
3753
|
-
(reason) =>
|
|
3752
|
+
const { promise, resolve, reject } = _chunkQO6FXNYDcjs.promiseWithResolvers.call(void 0,
|
|
3753
|
+
(reason) => _chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
3754
3754
|
msg: "unhandled action promise rejection",
|
|
3755
3755
|
reason
|
|
3756
3756
|
})
|
|
@@ -3760,7 +3760,7 @@ var ActorConnRaw = class {
|
|
|
3760
3760
|
resolve,
|
|
3761
3761
|
reject
|
|
3762
3762
|
});
|
|
3763
|
-
|
|
3763
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3764
3764
|
msg: "added action to in-flight map",
|
|
3765
3765
|
actionId,
|
|
3766
3766
|
actionName: opts.name,
|
|
@@ -3800,9 +3800,9 @@ var ActorConnRaw = class {
|
|
|
3800
3800
|
try {
|
|
3801
3801
|
handler(status);
|
|
3802
3802
|
} catch (err) {
|
|
3803
|
-
|
|
3803
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
3804
3804
|
msg: "error in status change handler",
|
|
3805
|
-
error:
|
|
3805
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
3806
3806
|
});
|
|
3807
3807
|
}
|
|
3808
3808
|
}
|
|
@@ -3812,9 +3812,9 @@ var ActorConnRaw = class {
|
|
|
3812
3812
|
try {
|
|
3813
3813
|
handler();
|
|
3814
3814
|
} catch (err) {
|
|
3815
|
-
|
|
3815
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
3816
3816
|
msg: "error in open handler",
|
|
3817
|
-
error:
|
|
3817
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
3818
3818
|
});
|
|
3819
3819
|
}
|
|
3820
3820
|
}
|
|
@@ -3824,9 +3824,9 @@ var ActorConnRaw = class {
|
|
|
3824
3824
|
try {
|
|
3825
3825
|
handler();
|
|
3826
3826
|
} catch (err) {
|
|
3827
|
-
|
|
3827
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
3828
3828
|
msg: "error in close handler",
|
|
3829
|
-
error:
|
|
3829
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
3830
3830
|
});
|
|
3831
3831
|
}
|
|
3832
3832
|
}
|
|
@@ -3839,21 +3839,21 @@ var ActorConnRaw = class {
|
|
|
3839
3839
|
minTimeout: 250,
|
|
3840
3840
|
maxTimeout: 3e4,
|
|
3841
3841
|
onFailedAttempt: (error) => {
|
|
3842
|
-
|
|
3842
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
3843
3843
|
msg: "failed to reconnect",
|
|
3844
3844
|
attempt: error.attemptNumber,
|
|
3845
|
-
error:
|
|
3845
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, error)
|
|
3846
3846
|
});
|
|
3847
3847
|
},
|
|
3848
3848
|
// Cancel retry if aborted
|
|
3849
3849
|
signal: this.#abortController.signal
|
|
3850
3850
|
}).catch((err) => {
|
|
3851
3851
|
if (err instanceof _pretry.AbortError || err.name === "AbortError" || !this.#shouldRetryConnectionOpenError(err)) {
|
|
3852
|
-
|
|
3852
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).info({ msg: "connection retry aborted" });
|
|
3853
3853
|
} else {
|
|
3854
|
-
|
|
3854
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
3855
3855
|
msg: "unexpected error in connection retry",
|
|
3856
|
-
error:
|
|
3856
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
3857
3857
|
});
|
|
3858
3858
|
}
|
|
3859
3859
|
});
|
|
@@ -3862,8 +3862,8 @@ var ActorConnRaw = class {
|
|
|
3862
3862
|
try {
|
|
3863
3863
|
if (this.#onOpenPromise)
|
|
3864
3864
|
throw new Error("#onOpenPromise already defined");
|
|
3865
|
-
this.#onOpenPromise =
|
|
3866
|
-
(reason) =>
|
|
3865
|
+
this.#onOpenPromise = _chunkQO6FXNYDcjs.promiseWithResolvers.call(void 0,
|
|
3866
|
+
(reason) => _chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
3867
3867
|
msg: "unhandled open promise rejection",
|
|
3868
3868
|
reason
|
|
3869
3869
|
})
|
|
@@ -3877,15 +3877,15 @@ var ActorConnRaw = class {
|
|
|
3877
3877
|
const actorError = error instanceof _chunk4FC7TVS6cjs.RivetError ? error : new (0, _chunk4FC7TVS6cjs.RivetError)(
|
|
3878
3878
|
"client",
|
|
3879
3879
|
"connection_open_failed",
|
|
3880
|
-
`Failed to open connection: ${
|
|
3881
|
-
{ error:
|
|
3880
|
+
`Failed to open connection: ${_chunkQO6FXNYDcjs.stringifyError.call(void 0, error)}`,
|
|
3881
|
+
{ error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, error) }
|
|
3882
3882
|
);
|
|
3883
3883
|
this.#clearQueuedMessages();
|
|
3884
3884
|
this.#rejectPendingPromises(actorError, false);
|
|
3885
3885
|
this.#dispatchActorError(actorError);
|
|
3886
3886
|
this.#setConnStatus("idle");
|
|
3887
3887
|
throw new (0, _pretry.AbortError)(
|
|
3888
|
-
error instanceof Error ? error : new Error(
|
|
3888
|
+
error instanceof Error ? error : new Error(_chunkQO6FXNYDcjs.stringifyError.call(void 0, error))
|
|
3889
3889
|
);
|
|
3890
3890
|
} finally {
|
|
3891
3891
|
this.#onOpenPromise = void 0;
|
|
@@ -3905,7 +3905,7 @@ var ActorConnRaw = class {
|
|
|
3905
3905
|
}
|
|
3906
3906
|
#clearQueuedMessages() {
|
|
3907
3907
|
if (this.#messageQueue.length === 0) return;
|
|
3908
|
-
|
|
3908
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3909
3909
|
msg: "clearing queued connection messages",
|
|
3910
3910
|
queueLength: this.#messageQueue.length
|
|
3911
3911
|
});
|
|
@@ -3918,7 +3918,7 @@ var ActorConnRaw = class {
|
|
|
3918
3918
|
try {
|
|
3919
3919
|
return await this.#getParams();
|
|
3920
3920
|
} catch (err) {
|
|
3921
|
-
const errorMessage =
|
|
3921
|
+
const errorMessage = _chunkQO6FXNYDcjs.stringifyError.call(void 0, err);
|
|
3922
3922
|
const error = new (0, _chunk4FC7TVS6cjs.RivetError)(
|
|
3923
3923
|
"client",
|
|
3924
3924
|
"get_params_failed",
|
|
@@ -3942,7 +3942,7 @@ var ActorConnRaw = class {
|
|
|
3942
3942
|
this.#gatewayOptions
|
|
3943
3943
|
);
|
|
3944
3944
|
_invariant2.default.call(void 0, ws, "websocket should have been created");
|
|
3945
|
-
|
|
3945
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3946
3946
|
msg: "opened websocket",
|
|
3947
3947
|
connId: this.#connId,
|
|
3948
3948
|
readyState: ws.readyState,
|
|
@@ -3950,7 +3950,7 @@ var ActorConnRaw = class {
|
|
|
3950
3950
|
});
|
|
3951
3951
|
this.#websocket = ws;
|
|
3952
3952
|
ws.addEventListener("open", () => {
|
|
3953
|
-
|
|
3953
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3954
3954
|
msg: "client websocket open",
|
|
3955
3955
|
connId: this.#connId
|
|
3956
3956
|
});
|
|
@@ -3959,9 +3959,9 @@ var ActorConnRaw = class {
|
|
|
3959
3959
|
try {
|
|
3960
3960
|
await this.#handleOnMessage(ev.data);
|
|
3961
3961
|
} catch (err) {
|
|
3962
|
-
|
|
3962
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
3963
3963
|
msg: "error in websocket message handler",
|
|
3964
|
-
error:
|
|
3964
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
3965
3965
|
});
|
|
3966
3966
|
}
|
|
3967
3967
|
});
|
|
@@ -3969,9 +3969,9 @@ var ActorConnRaw = class {
|
|
|
3969
3969
|
try {
|
|
3970
3970
|
await this.#handleOnClose(ev);
|
|
3971
3971
|
} catch (err) {
|
|
3972
|
-
|
|
3972
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
3973
3973
|
msg: "error in websocket close handler",
|
|
3974
|
-
error:
|
|
3974
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
3975
3975
|
});
|
|
3976
3976
|
}
|
|
3977
3977
|
});
|
|
@@ -3979,9 +3979,9 @@ var ActorConnRaw = class {
|
|
|
3979
3979
|
try {
|
|
3980
3980
|
this.#handleOnError();
|
|
3981
3981
|
} catch (err) {
|
|
3982
|
-
|
|
3982
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
3983
3983
|
msg: "error in websocket error handler",
|
|
3984
|
-
error:
|
|
3984
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
3985
3985
|
});
|
|
3986
3986
|
}
|
|
3987
3987
|
});
|
|
@@ -3989,7 +3989,7 @@ var ActorConnRaw = class {
|
|
|
3989
3989
|
/** Called by the onopen event from drivers. */
|
|
3990
3990
|
#handleOnOpen() {
|
|
3991
3991
|
if (this.#disposed) {
|
|
3992
|
-
|
|
3992
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
3993
3993
|
msg: "handleOnOpen called after dispose, closing websocket"
|
|
3994
3994
|
});
|
|
3995
3995
|
if (this.#websocket) {
|
|
@@ -4005,7 +4005,7 @@ var ActorConnRaw = class {
|
|
|
4005
4005
|
queueMicrotask(() => {
|
|
4006
4006
|
this.#openScheduled = false;
|
|
4007
4007
|
if (this.#disposed) {
|
|
4008
|
-
|
|
4008
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4009
4009
|
msg: "handleOnOpen scheduled after dispose, closing websocket"
|
|
4010
4010
|
});
|
|
4011
4011
|
if (this.#websocket) {
|
|
@@ -4014,7 +4014,7 @@ var ActorConnRaw = class {
|
|
|
4014
4014
|
}
|
|
4015
4015
|
return;
|
|
4016
4016
|
}
|
|
4017
|
-
|
|
4017
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4018
4018
|
msg: "socket open",
|
|
4019
4019
|
messageQueueLength: this.#messageQueue.length,
|
|
4020
4020
|
connId: this.#connId
|
|
@@ -4023,14 +4023,14 @@ var ActorConnRaw = class {
|
|
|
4023
4023
|
if (this.#onOpenPromise) {
|
|
4024
4024
|
this.#onOpenPromise.resolve(void 0);
|
|
4025
4025
|
} else {
|
|
4026
|
-
|
|
4026
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({ msg: "#onOpenPromise is undefined" });
|
|
4027
4027
|
}
|
|
4028
4028
|
for (const eventName of this.#eventSubscriptions.keys()) {
|
|
4029
4029
|
this.#sendSubscription(eventName, true);
|
|
4030
4030
|
}
|
|
4031
4031
|
const queue = this.#messageQueue;
|
|
4032
4032
|
this.#messageQueue = [];
|
|
4033
|
-
|
|
4033
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4034
4034
|
msg: "flushing message queue",
|
|
4035
4035
|
queueLength: queue.length
|
|
4036
4036
|
});
|
|
@@ -4042,23 +4042,23 @@ var ActorConnRaw = class {
|
|
|
4042
4042
|
/** Called by the onmessage event from drivers. */
|
|
4043
4043
|
async #handleOnMessage(data) {
|
|
4044
4044
|
var _a;
|
|
4045
|
-
|
|
4045
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).trace({
|
|
4046
4046
|
msg: "received message",
|
|
4047
4047
|
dataType: typeof data,
|
|
4048
4048
|
isBlob: data instanceof Blob,
|
|
4049
4049
|
isArrayBuffer: data instanceof ArrayBuffer
|
|
4050
4050
|
});
|
|
4051
4051
|
const response = await this.#parseMessage(data);
|
|
4052
|
-
|
|
4053
|
-
|
|
4052
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).trace(
|
|
4053
|
+
_chunkQO6FXNYDcjs.getLogMessage.call(void 0, ) ? {
|
|
4054
4054
|
msg: "parsed message",
|
|
4055
|
-
message:
|
|
4055
|
+
message: _chunkQO6FXNYDcjs.jsonStringifyCompat.call(void 0, response).substring(0, 100) + "..."
|
|
4056
4056
|
} : { msg: "parsed message" }
|
|
4057
4057
|
);
|
|
4058
4058
|
if (response.body.tag === "Init") {
|
|
4059
4059
|
this.#actorId = response.body.val.actorId;
|
|
4060
4060
|
this.#connId = response.body.val.connectionId;
|
|
4061
|
-
|
|
4061
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).trace({
|
|
4062
4062
|
msg: "received init message",
|
|
4063
4063
|
actorId: this.#actorId,
|
|
4064
4064
|
connId: this.#connId
|
|
@@ -4069,7 +4069,7 @@ var ActorConnRaw = class {
|
|
|
4069
4069
|
if (actionId !== null) {
|
|
4070
4070
|
const inFlight = this.#takeActionInFlight(Number(actionId));
|
|
4071
4071
|
this.#invalidateActorIfStale(group, code);
|
|
4072
|
-
|
|
4072
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
4073
4073
|
msg: "action error",
|
|
4074
4074
|
actionId,
|
|
4075
4075
|
actionName: inFlight == null ? void 0 : inFlight.name,
|
|
@@ -4088,7 +4088,7 @@ var ActorConnRaw = class {
|
|
|
4088
4088
|
})
|
|
4089
4089
|
);
|
|
4090
4090
|
} else {
|
|
4091
|
-
|
|
4091
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
4092
4092
|
msg: "connection error",
|
|
4093
4093
|
group,
|
|
4094
4094
|
code,
|
|
@@ -4136,27 +4136,27 @@ var ActorConnRaw = class {
|
|
|
4136
4136
|
}
|
|
4137
4137
|
} else if (response.body.tag === "ActionResponse") {
|
|
4138
4138
|
const { id: actionId } = response.body.val;
|
|
4139
|
-
|
|
4139
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4140
4140
|
msg: "received action response",
|
|
4141
4141
|
actionId: Number(actionId),
|
|
4142
4142
|
inFlightCount: this.#actionsInFlight.size,
|
|
4143
4143
|
inFlightIds: Array.from(this.#actionsInFlight.keys())
|
|
4144
4144
|
});
|
|
4145
4145
|
const inFlight = this.#takeActionInFlight(Number(actionId));
|
|
4146
|
-
|
|
4146
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).trace({
|
|
4147
4147
|
msg: "resolving action promise",
|
|
4148
4148
|
actionId,
|
|
4149
4149
|
actionName: inFlight == null ? void 0 : inFlight.name
|
|
4150
4150
|
});
|
|
4151
4151
|
inFlight.resolve(response.body.val);
|
|
4152
4152
|
} else if (response.body.tag === "Event") {
|
|
4153
|
-
|
|
4153
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).trace({
|
|
4154
4154
|
msg: "received event",
|
|
4155
4155
|
name: response.body.val.name
|
|
4156
4156
|
});
|
|
4157
4157
|
this.#dispatchEvent(response.body.val);
|
|
4158
4158
|
} else {
|
|
4159
|
-
|
|
4159
|
+
_chunkQO6FXNYDcjs.assertUnreachable.call(void 0, response.body);
|
|
4160
4160
|
}
|
|
4161
4161
|
}
|
|
4162
4162
|
/** Called by the onclose event from drivers. */
|
|
@@ -4165,7 +4165,7 @@ var ActorConnRaw = class {
|
|
|
4165
4165
|
const closeEvent = event;
|
|
4166
4166
|
const wasClean = closeEvent.wasClean;
|
|
4167
4167
|
const wasConnected = this.#connStatus === "connected";
|
|
4168
|
-
|
|
4168
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).info({
|
|
4169
4169
|
msg: "socket closed",
|
|
4170
4170
|
code: closeEvent.code,
|
|
4171
4171
|
reason: closeEvent.reason,
|
|
@@ -4232,7 +4232,7 @@ var ActorConnRaw = class {
|
|
|
4232
4232
|
this.#dispatchActorError(error);
|
|
4233
4233
|
}
|
|
4234
4234
|
if (wasConnected) {
|
|
4235
|
-
|
|
4235
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4236
4236
|
msg: "triggering reconnect",
|
|
4237
4237
|
connId: this.#connId
|
|
4238
4238
|
});
|
|
@@ -4256,12 +4256,12 @@ var ActorConnRaw = class {
|
|
|
4256
4256
|
/** Called by the onerror event from drivers. */
|
|
4257
4257
|
#handleOnError() {
|
|
4258
4258
|
if (this.#disposed) return;
|
|
4259
|
-
|
|
4259
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn("socket error");
|
|
4260
4260
|
}
|
|
4261
4261
|
#takeActionInFlight(id) {
|
|
4262
4262
|
const inFlight = this.#actionsInFlight.get(id);
|
|
4263
4263
|
if (!inFlight) {
|
|
4264
|
-
|
|
4264
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
4265
4265
|
msg: "action not found in in-flight map",
|
|
4266
4266
|
lookupId: id,
|
|
4267
4267
|
inFlightCount: this.#actionsInFlight.size,
|
|
@@ -4276,7 +4276,7 @@ var ActorConnRaw = class {
|
|
|
4276
4276
|
throw internalClientError(`No in flight response for ${id}`);
|
|
4277
4277
|
}
|
|
4278
4278
|
this.#actionsInFlight.delete(id);
|
|
4279
|
-
|
|
4279
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4280
4280
|
msg: "removed action from in-flight map",
|
|
4281
4281
|
actionId: id,
|
|
4282
4282
|
actionName: inFlight.name,
|
|
@@ -4303,9 +4303,9 @@ var ActorConnRaw = class {
|
|
|
4303
4303
|
try {
|
|
4304
4304
|
handler(error);
|
|
4305
4305
|
} catch (err) {
|
|
4306
|
-
|
|
4306
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
4307
4307
|
msg: "error in connection error handler",
|
|
4308
|
-
error:
|
|
4308
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
4309
4309
|
});
|
|
4310
4310
|
}
|
|
4311
4311
|
}
|
|
@@ -4410,9 +4410,9 @@ var ActorConnRaw = class {
|
|
|
4410
4410
|
try {
|
|
4411
4411
|
callback();
|
|
4412
4412
|
} catch (err) {
|
|
4413
|
-
|
|
4413
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).error({
|
|
4414
4414
|
msg: "error in open handler",
|
|
4415
|
-
error:
|
|
4415
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, err)
|
|
4416
4416
|
});
|
|
4417
4417
|
}
|
|
4418
4418
|
});
|
|
@@ -4462,7 +4462,7 @@ var ActorConnRaw = class {
|
|
|
4462
4462
|
let queueMessage = false;
|
|
4463
4463
|
if (this.#websocket) {
|
|
4464
4464
|
const readyState = this.#websocket.readyState;
|
|
4465
|
-
|
|
4465
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4466
4466
|
msg: "websocket send attempt",
|
|
4467
4467
|
readyState,
|
|
4468
4468
|
readyStateString: readyState === 0 ? "CONNECTING" : readyState === 1 ? "OPEN" : readyState === 2 ? "CLOSING" : "CLOSED",
|
|
@@ -4471,7 +4471,7 @@ var ActorConnRaw = class {
|
|
|
4471
4471
|
actionName: (_a = message.body.val) == null ? void 0 : _a.name
|
|
4472
4472
|
});
|
|
4473
4473
|
if (this.#connStatus !== "connected") {
|
|
4474
|
-
|
|
4474
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4475
4475
|
msg: "websocket init pending, queueing message",
|
|
4476
4476
|
connStatus: this.#connStatus,
|
|
4477
4477
|
messageType: message.body.tag
|
|
@@ -4479,7 +4479,7 @@ var ActorConnRaw = class {
|
|
|
4479
4479
|
queueMessage = true;
|
|
4480
4480
|
} else if (readyState === 1) {
|
|
4481
4481
|
try {
|
|
4482
|
-
const messageSerialized =
|
|
4482
|
+
const messageSerialized = _chunkQO6FXNYDcjs.serializeWithEncoding.call(void 0,
|
|
4483
4483
|
this.#encoding,
|
|
4484
4484
|
message,
|
|
4485
4485
|
CLIENT_PROTOCOL_TO_SERVER,
|
|
@@ -4496,8 +4496,8 @@ var ActorConnRaw = class {
|
|
|
4496
4496
|
val: {
|
|
4497
4497
|
id: msg.body.val.id,
|
|
4498
4498
|
name: msg.body.val.name,
|
|
4499
|
-
args:
|
|
4500
|
-
|
|
4499
|
+
args: _chunkQO6FXNYDcjs.bufferToArrayBuffer.call(void 0,
|
|
4500
|
+
_chunkQO6FXNYDcjs.encodeCborCompat.call(void 0,
|
|
4501
4501
|
msg.body.val.args
|
|
4502
4502
|
)
|
|
4503
4503
|
)
|
|
@@ -4511,12 +4511,12 @@ var ActorConnRaw = class {
|
|
|
4511
4511
|
);
|
|
4512
4512
|
this.#websocket.send(messageSerialized);
|
|
4513
4513
|
const serializedLength = messageLength(messageSerialized);
|
|
4514
|
-
|
|
4514
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).trace({
|
|
4515
4515
|
msg: "sent websocket message",
|
|
4516
4516
|
len: serializedLength
|
|
4517
4517
|
});
|
|
4518
4518
|
} catch (error) {
|
|
4519
|
-
|
|
4519
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
4520
4520
|
msg: "failed to send message, added to queue",
|
|
4521
4521
|
error,
|
|
4522
4522
|
connId: this.#connId
|
|
@@ -4524,19 +4524,19 @@ var ActorConnRaw = class {
|
|
|
4524
4524
|
queueMessage = true;
|
|
4525
4525
|
}
|
|
4526
4526
|
} else {
|
|
4527
|
-
|
|
4527
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4528
4528
|
msg: "websocket not open, queueing message",
|
|
4529
4529
|
readyState
|
|
4530
4530
|
});
|
|
4531
4531
|
queueMessage = true;
|
|
4532
4532
|
}
|
|
4533
4533
|
} else {
|
|
4534
|
-
|
|
4534
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({ msg: "no websocket, queueing message" });
|
|
4535
4535
|
queueMessage = true;
|
|
4536
4536
|
}
|
|
4537
4537
|
if (!(opts == null ? void 0 : opts.ephemeral) && queueMessage) {
|
|
4538
4538
|
this.#messageQueue.push(message);
|
|
4539
|
-
|
|
4539
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({
|
|
4540
4540
|
msg: "queued connection message",
|
|
4541
4541
|
queueLength: this.#messageQueue.length,
|
|
4542
4542
|
connId: this.#connId,
|
|
@@ -4547,8 +4547,8 @@ var ActorConnRaw = class {
|
|
|
4547
4547
|
}
|
|
4548
4548
|
async #parseMessage(data) {
|
|
4549
4549
|
_invariant2.default.call(void 0, this.#websocket, "websocket must be defined");
|
|
4550
|
-
const buffer = await
|
|
4551
|
-
return
|
|
4550
|
+
const buffer = await _chunkQO6FXNYDcjs.inputDataToBuffer.call(void 0, data);
|
|
4551
|
+
return _chunkQO6FXNYDcjs.deserializeWithEncoding.call(void 0,
|
|
4552
4552
|
this.#encoding,
|
|
4553
4553
|
buffer,
|
|
4554
4554
|
CLIENT_PROTOCOL_TO_CLIENT,
|
|
@@ -4583,7 +4583,7 @@ var ActorConnRaw = class {
|
|
|
4583
4583
|
group: msg.body.val.group,
|
|
4584
4584
|
code: msg.body.val.code,
|
|
4585
4585
|
message: msg.body.val.message,
|
|
4586
|
-
metadata: msg.body.val.metadata ?
|
|
4586
|
+
metadata: msg.body.val.metadata ? _chunkQO6FXNYDcjs.decodeCborCompat.call(void 0,
|
|
4587
4587
|
new Uint8Array(
|
|
4588
4588
|
msg.body.val.metadata
|
|
4589
4589
|
)
|
|
@@ -4605,7 +4605,7 @@ var ActorConnRaw = class {
|
|
|
4605
4605
|
tag: "ActionResponse",
|
|
4606
4606
|
val: {
|
|
4607
4607
|
id: msg.body.val.id,
|
|
4608
|
-
output:
|
|
4608
|
+
output: _chunkQO6FXNYDcjs.decodeCborCompat.call(void 0,
|
|
4609
4609
|
new Uint8Array(msg.body.val.output)
|
|
4610
4610
|
)
|
|
4611
4611
|
}
|
|
@@ -4617,7 +4617,7 @@ var ActorConnRaw = class {
|
|
|
4617
4617
|
tag: "Event",
|
|
4618
4618
|
val: {
|
|
4619
4619
|
name: msg.body.val.name,
|
|
4620
|
-
args:
|
|
4620
|
+
args: _chunkQO6FXNYDcjs.decodeCborCompat.call(void 0,
|
|
4621
4621
|
new Uint8Array(msg.body.val.args)
|
|
4622
4622
|
)
|
|
4623
4623
|
}
|
|
@@ -4658,11 +4658,11 @@ var ActorConnRaw = class {
|
|
|
4658
4658
|
*/
|
|
4659
4659
|
async dispose() {
|
|
4660
4660
|
if (this.#disposed) {
|
|
4661
|
-
|
|
4661
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).warn({ msg: "connection already disconnected" });
|
|
4662
4662
|
return;
|
|
4663
4663
|
}
|
|
4664
4664
|
this.#disposed = true;
|
|
4665
|
-
|
|
4665
|
+
_chunk5MC4O5QQcjs.logger.call(void 0, ).debug({ msg: "disposing actor conn" });
|
|
4666
4666
|
this.#setConnStatus("idle");
|
|
4667
4667
|
clearInterval(this.#keepNodeAliveInterval);
|
|
4668
4668
|
this.#abortController.abort();
|
|
@@ -4670,8 +4670,8 @@ var ActorConnRaw = class {
|
|
|
4670
4670
|
if (this.#websocket) {
|
|
4671
4671
|
const ws = this.#websocket;
|
|
4672
4672
|
if (ws.readyState !== 2 && ws.readyState !== 3) {
|
|
4673
|
-
const { promise, resolve } =
|
|
4674
|
-
(reason) =>
|
|
4673
|
+
const { promise, resolve } = _chunkQO6FXNYDcjs.promiseWithResolvers.call(void 0,
|
|
4674
|
+
(reason) => _chunk5MC4O5QQcjs.logger.call(void 0, ).warn({
|
|
4675
4675
|
msg: "unhandled websocket close promise rejection",
|
|
4676
4676
|
reason
|
|
4677
4677
|
})
|
|
@@ -4790,7 +4790,7 @@ var ClientConfigSchemaBase = _v42.default.object({
|
|
|
4790
4790
|
* Defaults to http://localhost:6420.
|
|
4791
4791
|
*/
|
|
4792
4792
|
endpoint: _v42.default.string().optional().transform((val) => {
|
|
4793
|
-
const resolved = _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
4793
|
+
const resolved = _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkQO6FXNYDcjs.getRivetEngine.call(void 0, ))), () => ( _chunkQO6FXNYDcjs.getRivetEndpoint.call(void 0, )));
|
|
4794
4794
|
if (!resolved && !hasWarnedMissingEndpoint) {
|
|
4795
4795
|
hasWarnedMissingEndpoint = true;
|
|
4796
4796
|
console.warn(
|
|
@@ -4800,12 +4800,12 @@ var ClientConfigSchemaBase = _v42.default.object({
|
|
|
4800
4800
|
return _nullishCoalesce(resolved, () => ( DEFAULT_ENDPOINT));
|
|
4801
4801
|
}),
|
|
4802
4802
|
/** Token to use to authenticate with the API. */
|
|
4803
|
-
token: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
4803
|
+
token: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkQO6FXNYDcjs.getRivetToken.call(void 0, )))),
|
|
4804
4804
|
/** Namespace to connect to. */
|
|
4805
|
-
namespace: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
4805
|
+
namespace: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkQO6FXNYDcjs.getRivetNamespace.call(void 0, )))),
|
|
4806
4806
|
/** Name of the envoy pool. This is used to group together envoys in to different pools. */
|
|
4807
|
-
poolName: _v42.default.string().default(() => _nullishCoalesce(
|
|
4808
|
-
encoding:
|
|
4807
|
+
poolName: _v42.default.string().default(() => _nullishCoalesce(_chunkQO6FXNYDcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
4808
|
+
encoding: _chunkQO6FXNYDcjs.EncodingSchema.default("bare"),
|
|
4809
4809
|
headers: _v42.default.record(_v42.default.string(), _v42.default.string()).optional().default(() => ({})),
|
|
4810
4810
|
gateway: _v42.default.object({
|
|
4811
4811
|
skipReadyWait: _v42.default.boolean().optional().default(false)
|
|
@@ -4964,7 +4964,7 @@ function setRemoteHibernatableWebSocketAckTestHooks(websocket, token, enabled) {
|
|
|
4964
4964
|
|
|
4965
4965
|
// src/engine-client/log.ts
|
|
4966
4966
|
function logger2() {
|
|
4967
|
-
return
|
|
4967
|
+
return _chunkQO6FXNYDcjs.getLogger.call(void 0, "engine-client");
|
|
4968
4968
|
}
|
|
4969
4969
|
|
|
4970
4970
|
// src/engine-client/actor-websocket-client.ts
|
|
@@ -5097,7 +5097,7 @@ var BufferedRemoteWebSocket = (_class2 = class {
|
|
|
5097
5097
|
function buildActorGatewayUrl(endpoint, actorId, token, path = "") {
|
|
5098
5098
|
const tokenSegment = token !== void 0 ? `@${encodeURIComponent(token)}` : "";
|
|
5099
5099
|
const gatewayPath = `/gateway/${encodeURIComponent(actorId)}${tokenSegment}${path}`;
|
|
5100
|
-
return
|
|
5100
|
+
return _chunkQO6FXNYDcjs.combineUrlPath.call(void 0, endpoint, gatewayPath);
|
|
5101
5101
|
}
|
|
5102
5102
|
function buildActorQueryGatewayUrl(endpoint, namespace, query, token, path = "", maxInputSize = DEFAULT_MAX_QUERY_INPUT_SIZE, crashPolicy = void 0, runnerName, options = {}) {
|
|
5103
5103
|
if (namespace.length === 0) {
|
|
@@ -5163,7 +5163,7 @@ function buildActorQueryGatewayUrl(endpoint, namespace, query, token, path = "",
|
|
|
5163
5163
|
separator = "?";
|
|
5164
5164
|
}
|
|
5165
5165
|
const gatewayPath = `/gateway/${encodeURIComponent(name)}${path}${separator}${queryString}`;
|
|
5166
|
-
return
|
|
5166
|
+
return _chunkQO6FXNYDcjs.combineUrlPath.call(void 0, endpoint, gatewayPath);
|
|
5167
5167
|
}
|
|
5168
5168
|
function pushKeyQueryParams(params, key) {
|
|
5169
5169
|
if (key.length > 0) {
|
|
@@ -5174,7 +5174,7 @@ function pushInputQueryParam(params, input, maxInputSize) {
|
|
|
5174
5174
|
if (input === void 0) {
|
|
5175
5175
|
return;
|
|
5176
5176
|
}
|
|
5177
|
-
const encodedInput =
|
|
5177
|
+
const encodedInput = _chunkQO6FXNYDcjs.encodeCborCompat.call(void 0, input);
|
|
5178
5178
|
if (encodedInput.byteLength > maxInputSize) {
|
|
5179
5179
|
throw new Error(
|
|
5180
5180
|
`Actor query input exceeds maxInputSize (${encodedInput.byteLength} > ${maxInputSize} bytes). Increase client maxInputSize to allow larger query payloads.`
|
|
@@ -5183,10 +5183,10 @@ function pushInputQueryParam(params, input, maxInputSize) {
|
|
|
5183
5183
|
params.append("rvt-input", uint8ArrayToBase64Url(encodedInput));
|
|
5184
5184
|
}
|
|
5185
5185
|
function uint8ArrayToBase64Url(value) {
|
|
5186
|
-
return
|
|
5186
|
+
return _chunkQO6FXNYDcjs.uint8ArrayToBase64.call(void 0, value).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
5187
5187
|
}
|
|
5188
5188
|
async function openWebSocketToGateway(runConfig, gatewayUrl, encoding, params, options = {}) {
|
|
5189
|
-
const WebSocket2 = await
|
|
5189
|
+
const WebSocket2 = await _chunk5MC4O5QQcjs.importWebSocket.call(void 0, );
|
|
5190
5190
|
const ackHookToken = typeof process !== "undefined" && process.env.VITEST ? crypto.randomUUID() : void 0;
|
|
5191
5191
|
logger2().debug({
|
|
5192
5192
|
msg: "opening websocket to actor via guard",
|
|
@@ -5253,7 +5253,7 @@ function getEndpoint(config) {
|
|
|
5253
5253
|
}
|
|
5254
5254
|
async function apiCall(config, method, path, body) {
|
|
5255
5255
|
const endpoint = getEndpoint(config);
|
|
5256
|
-
const url =
|
|
5256
|
+
const url = _chunkQO6FXNYDcjs.combineUrlPath.call(void 0, endpoint, path, {
|
|
5257
5257
|
namespace: config.namespace
|
|
5258
5258
|
});
|
|
5259
5259
|
logger2().debug({ msg: "making api call", method, url });
|
|
@@ -5378,7 +5378,7 @@ async function lookupMetadataCached(config) {
|
|
|
5378
5378
|
msg: "failed to fetch metadata, retrying",
|
|
5379
5379
|
endpoint,
|
|
5380
5380
|
attempt: error.attemptNumber,
|
|
5381
|
-
error:
|
|
5381
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, error)
|
|
5382
5382
|
});
|
|
5383
5383
|
}
|
|
5384
5384
|
}
|
|
@@ -5390,7 +5390,7 @@ async function lookupMetadataCached(config) {
|
|
|
5390
5390
|
|
|
5391
5391
|
// src/engine-client/ws-proxy.ts
|
|
5392
5392
|
async function createWebSocketProxy(_c, targetUrl, protocols) {
|
|
5393
|
-
const WebSocket2 = await
|
|
5393
|
+
const WebSocket2 = await _chunk5MC4O5QQcjs.importWebSocket.call(void 0, );
|
|
5394
5394
|
const state = {};
|
|
5395
5395
|
return {
|
|
5396
5396
|
onOpen: async (_event, clientWs) => {
|
|
@@ -5455,7 +5455,7 @@ async function createWebSocketProxy(_c, targetUrl, protocols) {
|
|
|
5455
5455
|
logger2().error({
|
|
5456
5456
|
msg: "target websocket error",
|
|
5457
5457
|
targetUrl,
|
|
5458
|
-
error:
|
|
5458
|
+
error: _chunkQO6FXNYDcjs.stringifyError.call(void 0, error)
|
|
5459
5459
|
});
|
|
5460
5460
|
closeWebSocketIfOpen(clientWs, 1011, "Target WebSocket error");
|
|
5461
5461
|
});
|
|
@@ -5534,7 +5534,7 @@ var RemoteEngineControlClient = class {
|
|
|
5534
5534
|
#config;
|
|
5535
5535
|
#metadataPromise;
|
|
5536
5536
|
constructor(runConfig) {
|
|
5537
|
-
if (
|
|
5537
|
+
if (_chunkQO6FXNYDcjs.getNextPhase.call(void 0, ) === "phase-production-build") {
|
|
5538
5538
|
logger2().info(
|
|
5539
5539
|
"detected next.js build phase, disabling health check"
|
|
5540
5540
|
);
|
|
@@ -5625,8 +5625,8 @@ var RemoteEngineControlClient = class {
|
|
|
5625
5625
|
name,
|
|
5626
5626
|
key: _chunkMYWZCDMLcjs.serializeActorKey.call(void 0, key),
|
|
5627
5627
|
runner_name_selector: this.#config.poolName,
|
|
5628
|
-
input: actorInput ?
|
|
5629
|
-
|
|
5628
|
+
input: actorInput ? _chunkQO6FXNYDcjs.uint8ArrayToBase64.call(void 0,
|
|
5629
|
+
_chunkQO6FXNYDcjs.encodeCborCompat.call(void 0, actorInput)
|
|
5630
5630
|
) : void 0,
|
|
5631
5631
|
crash_policy: _nullishCoalesce(crashPolicy, () => ( "sleep"))
|
|
5632
5632
|
});
|
|
@@ -5653,7 +5653,7 @@ var RemoteEngineControlClient = class {
|
|
|
5653
5653
|
name,
|
|
5654
5654
|
runner_name_selector: this.#config.poolName,
|
|
5655
5655
|
key: _chunkMYWZCDMLcjs.serializeActorKey.call(void 0, key),
|
|
5656
|
-
input: input ?
|
|
5656
|
+
input: input ? _chunkQO6FXNYDcjs.uint8ArrayToBase64.call(void 0, _chunkQO6FXNYDcjs.encodeCborCompat.call(void 0, input)) : void 0,
|
|
5657
5657
|
crash_policy: _nullishCoalesce(crashPolicy, () => ( "sleep"))
|
|
5658
5658
|
});
|
|
5659
5659
|
logger2().info({
|
|
@@ -5731,7 +5731,7 @@ var RemoteEngineControlClient = class {
|
|
|
5731
5731
|
const upgradeWebSocket = (_b = (_a = this.#config).getUpgradeWebSocket) == null ? void 0 : _b.call(_a);
|
|
5732
5732
|
_invariant2.default.call(void 0, upgradeWebSocket, "missing getUpgradeWebSocket");
|
|
5733
5733
|
const endpoint = getEndpoint(this.#config);
|
|
5734
|
-
const guardUrl =
|
|
5734
|
+
const guardUrl = _chunkQO6FXNYDcjs.combineUrlPath.call(void 0, endpoint, path);
|
|
5735
5735
|
const wsGuardUrl = guardUrl.replace("http://", "ws://");
|
|
5736
5736
|
logger2().debug({
|
|
5737
5737
|
msg: "forwarding websocket to actor via guard",
|
|
@@ -5750,7 +5750,7 @@ var RemoteEngineControlClient = class {
|
|
|
5750
5750
|
}
|
|
5751
5751
|
);
|
|
5752
5752
|
const args = await createWebSocketProxy(c, wsGuardUrl, protocols);
|
|
5753
|
-
return await upgradeWebSocket(() => args)(c,
|
|
5753
|
+
return await upgradeWebSocket(() => args)(c, _chunkQO6FXNYDcjs.noopNext.call(void 0, ));
|
|
5754
5754
|
}
|
|
5755
5755
|
displayInformation() {
|
|
5756
5756
|
return { properties: {} };
|
|
@@ -5761,7 +5761,7 @@ var RemoteEngineControlClient = class {
|
|
|
5761
5761
|
#buildGatewayUrlForTarget(target, path, options = {}) {
|
|
5762
5762
|
const endpoint = getEndpoint(this.#config);
|
|
5763
5763
|
if (shouldSkipReadyWait(options) && directActorIdFromTarget(target) && canUseDirectSkipReadyWaitPath(path)) {
|
|
5764
|
-
return
|
|
5764
|
+
return _chunkQO6FXNYDcjs.combineUrlPath.call(void 0, endpoint, path);
|
|
5765
5765
|
}
|
|
5766
5766
|
if ("directId" in target) {
|
|
5767
5767
|
return buildActorGatewayUrl(
|
|
@@ -5855,4 +5855,4 @@ function apiActorToOutput(actor) {
|
|
|
5855
5855
|
|
|
5856
5856
|
|
|
5857
5857
|
exports.HEADER_CONN_PARAMS = HEADER_CONN_PARAMS; exports.ALLOWED_PUBLIC_HEADERS = ALLOWED_PUBLIC_HEADERS; exports.ActorClientError = ActorClientError; exports.ManagerError = ManagerError; exports.MalformedResponseMessage = MalformedResponseMessage; exports.ActorConnDisposed = ActorConnDisposed; exports.ActorConnRaw = ActorConnRaw; exports.isResponseLike = isResponseLike; exports.ActorHandleRaw = ActorHandleRaw; exports.createClientWithDriver = createClientWithDriver; exports.tryParseEndpoint = tryParseEndpoint; exports.ClientConfigSchema = ClientConfigSchema; exports.convertRegistryConfigToClientConfig = convertRegistryConfigToClientConfig; exports.getDatacenters = getDatacenters; exports.updateRunnerConfig = updateRunnerConfig; exports.RemoteEngineControlClient = RemoteEngineControlClient;
|
|
5858
|
-
//# sourceMappingURL=chunk-
|
|
5858
|
+
//# sourceMappingURL=chunk-RVZYWLP2.cjs.map
|