rivetkit 2.3.5-rc.1 → 2.3.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.
- 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-4XKED5P5.cjs → chunk-2GZPBFZV.cjs} +138 -138
- package/dist/tsup/{chunk-4XKED5P5.cjs.map → chunk-2GZPBFZV.cjs.map} +1 -1
- package/dist/tsup/{chunk-TR5NLR5V.cjs → chunk-7HDG7FY3.cjs} +4 -4
- package/dist/tsup/{chunk-TR5NLR5V.cjs.map → chunk-7HDG7FY3.cjs.map} +1 -1
- package/dist/tsup/{chunk-UJ2FQY63.cjs → chunk-7IIAJQTF.cjs} +7 -7
- package/dist/tsup/{chunk-UJ2FQY63.cjs.map → chunk-7IIAJQTF.cjs.map} +1 -1
- package/dist/tsup/{chunk-PAG6G46L.js → chunk-ENPXVDGZ.js} +2 -2
- package/dist/tsup/{chunk-MGTSVSUC.js → chunk-FJQ36P7Q.js} +2 -2
- package/dist/tsup/{chunk-6HQCLWAW.cjs → chunk-ID7DMKXR.cjs} +2 -2
- package/dist/tsup/chunk-ID7DMKXR.cjs.map +1 -0
- package/dist/tsup/{chunk-NIC3QLKL.js → chunk-NYEGEML6.js} +3 -3
- package/dist/tsup/{chunk-TNIWIUNV.cjs → chunk-PG5P2IDC.cjs} +9 -9
- package/dist/tsup/{chunk-TNIWIUNV.cjs.map → chunk-PG5P2IDC.cjs.map} +1 -1
- package/dist/tsup/{chunk-GAV4PKFT.js → chunk-PMIEL4PM.js} +3 -3
- package/dist/tsup/{chunk-M3FCXL3Q.cjs → chunk-TKPQNJQ2.cjs} +3 -3
- package/dist/tsup/{chunk-M3FCXL3Q.cjs.map → chunk-TKPQNJQ2.cjs.map} +1 -1
- package/dist/tsup/{chunk-P4OGQ4JL.js → chunk-WGRSAJSX.js} +3 -3
- package/dist/tsup/{chunk-B4IZU537.js → chunk-YOP6FRYG.js} +2 -2
- package/dist/tsup/chunk-YOP6FRYG.js.map +1 -0
- 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 +61 -61
- package/dist/tsup/mod.js +4 -4
- package/dist/tsup/test/mod.cjs +8 -8
- 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-6HQCLWAW.cjs.map +0 -1
- package/dist/tsup/chunk-B4IZU537.js.map +0 -1
- /package/dist/tsup/{chunk-PAG6G46L.js.map → chunk-ENPXVDGZ.js.map} +0 -0
- /package/dist/tsup/{chunk-MGTSVSUC.js.map → chunk-FJQ36P7Q.js.map} +0 -0
- /package/dist/tsup/{chunk-NIC3QLKL.js.map → chunk-NYEGEML6.js.map} +0 -0
- /package/dist/tsup/{chunk-GAV4PKFT.js.map → chunk-PMIEL4PM.js.map} +0 -0
- /package/dist/tsup/{chunk-P4OGQ4JL.js.map → chunk-WGRSAJSX.js.map} +0 -0
|
@@ -8,7 +8,7 @@ var _chunkUEULFXUIcjs = require('./chunk-UEULFXUI.cjs');
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkTKPQNJQ2cjs = require('./chunk-TKPQNJQ2.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -35,7 +35,7 @@ var _chunkM3FCXL3Qcjs = require('./chunk-M3FCXL3Q.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunkID7DMKXRcjs = require('./chunk-ID7DMKXR.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
|
+
_chunkTKPQNJQ2cjs.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
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
2138
2138
|
msg: "failed to fetch actor details for scheduling error check",
|
|
2139
2139
|
actorId,
|
|
2140
|
-
error:
|
|
2140
|
+
error: _chunkID7DMKXRcjs.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
|
+
_chunkTKPQNJQ2cjs.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
|
+
_chunkID7DMKXRcjs.assertUnreachable.call(void 0, message);
|
|
2373
2373
|
}
|
|
2374
2374
|
async function sendHttpRequest(opts) {
|
|
2375
2375
|
var _a, _b, _c;
|
|
2376
|
-
|
|
2376
|
+
_chunkTKPQNJQ2cjs.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 = _chunkID7DMKXRcjs.contentTypeForEncoding.call(void 0, opts.encoding);
|
|
2386
|
+
bodyData = _chunkID7DMKXRcjs.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": _chunkID7DMKXRcjs.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 = _chunkID7DMKXRcjs.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 ? _chunkID7DMKXRcjs.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
|
+
_chunkTKPQNJQ2cjs.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 _chunkID7DMKXRcjs.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: _chunkID7DMKXRcjs.bufferToArrayBuffer.call(void 0,
|
|
2542
|
+
_chunkID7DMKXRcjs.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: _chunkID7DMKXRcjs.decodeCborCompat.call(void 0, new Uint8Array(bare5.response))
|
|
2563
2563
|
};
|
|
2564
2564
|
}
|
|
2565
2565
|
});
|
|
@@ -2613,7 +2613,7 @@ async function rawHttpFetch(driver, target, params, input, init, options = {}) {
|
|
|
2613
2613
|
throw new TypeError("Invalid input type for fetch");
|
|
2614
2614
|
}
|
|
2615
2615
|
try {
|
|
2616
|
-
|
|
2616
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug(
|
|
2617
2617
|
"directId" in target ? {
|
|
2618
2618
|
msg: "sending raw http request to actor",
|
|
2619
2619
|
actorId: target.directId
|
|
@@ -2634,7 +2634,7 @@ async function rawHttpFetch(driver, target, params, input, init, options = {}) {
|
|
|
2634
2634
|
});
|
|
2635
2635
|
return driver.sendRequest(target, proxyRequest, options);
|
|
2636
2636
|
} catch (err) {
|
|
2637
|
-
const { group, code, message, metadata, actor } =
|
|
2637
|
+
const { group, code, message, metadata, actor } = _chunkID7DMKXRcjs.deconstructError.call(void 0,
|
|
2638
2638
|
err,
|
|
2639
2639
|
true
|
|
2640
2640
|
);
|
|
@@ -2658,7 +2658,7 @@ async function rawWebSocket(driver, target, params, path, _protocols, options =
|
|
|
2658
2658
|
}
|
|
2659
2659
|
}
|
|
2660
2660
|
const fullPath = `${PATH_WEBSOCKET_PREFIX}${pathPortion}${queryPortion}`;
|
|
2661
|
-
|
|
2661
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
2662
2662
|
msg: "opening websocket",
|
|
2663
2663
|
target,
|
|
2664
2664
|
encoding,
|
|
@@ -2779,7 +2779,7 @@ var ActorHandleRaw = class {
|
|
|
2779
2779
|
}
|
|
2780
2780
|
}).send(name, body, options);
|
|
2781
2781
|
} catch (err) {
|
|
2782
|
-
const { group, code, message, metadata, actor } =
|
|
2782
|
+
const { group, code, message, metadata, actor } = _chunkID7DMKXRcjs.deconstructError.call(void 0, err, true);
|
|
2783
2783
|
if (this.#shouldRetryQueueDispatchOverload(
|
|
2784
2784
|
group,
|
|
2785
2785
|
code,
|
|
@@ -2866,13 +2866,13 @@ var ActorHandleRaw = class {
|
|
|
2866
2866
|
gatewayOptions
|
|
2867
2867
|
);
|
|
2868
2868
|
actorId = "directId" in target ? target.directId : void 0;
|
|
2869
|
-
|
|
2869
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug(
|
|
2870
2870
|
actorId ? { msg: "using direct actor gateway target", actorId } : {
|
|
2871
2871
|
msg: "using query gateway target for action",
|
|
2872
2872
|
query: this.#actorResolutionState
|
|
2873
2873
|
}
|
|
2874
2874
|
);
|
|
2875
|
-
|
|
2875
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
2876
2876
|
msg: "handling action",
|
|
2877
2877
|
name: opts.name,
|
|
2878
2878
|
encoding: this.#encoding
|
|
@@ -2906,19 +2906,19 @@ var ActorHandleRaw = class {
|
|
|
2906
2906
|
args
|
|
2907
2907
|
}),
|
|
2908
2908
|
requestToBare: (args) => ({
|
|
2909
|
-
args:
|
|
2910
|
-
|
|
2909
|
+
args: _chunkID7DMKXRcjs.bufferToArrayBuffer.call(void 0,
|
|
2910
|
+
_chunkID7DMKXRcjs.encodeCborCompat.call(void 0, args)
|
|
2911
2911
|
)
|
|
2912
2912
|
}),
|
|
2913
2913
|
responseFromJson: (json) => json.output,
|
|
2914
|
-
responseFromBare: (bare5) =>
|
|
2914
|
+
responseFromBare: (bare5) => _chunkID7DMKXRcjs.decodeCborCompat.call(void 0, new Uint8Array(bare5.output))
|
|
2915
2915
|
});
|
|
2916
2916
|
if (opts.name === "destroy" && actorId) {
|
|
2917
2917
|
await this.#waitForDestroyActionToSettle(actorId);
|
|
2918
2918
|
}
|
|
2919
2919
|
return output;
|
|
2920
2920
|
} catch (err) {
|
|
2921
|
-
const { group, code, message, metadata, actor } =
|
|
2921
|
+
const { group, code, message, metadata, actor } = _chunkID7DMKXRcjs.deconstructError.call(void 0, err, true);
|
|
2922
2922
|
if (await this.#shouldRetrySchedulingError(
|
|
2923
2923
|
group,
|
|
2924
2924
|
code,
|
|
@@ -3068,7 +3068,7 @@ var ActorHandleRaw = class {
|
|
|
3068
3068
|
* @returns {ActorConn<AD>} A connection to the actor.
|
|
3069
3069
|
*/
|
|
3070
3070
|
connect(params, options = {}) {
|
|
3071
|
-
|
|
3071
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3072
3072
|
msg: "establishing connection from handle",
|
|
3073
3073
|
query: this.#actorResolutionState
|
|
3074
3074
|
});
|
|
@@ -3135,7 +3135,7 @@ var ActorHandleRaw = class {
|
|
|
3135
3135
|
}
|
|
3136
3136
|
return response;
|
|
3137
3137
|
} catch (err) {
|
|
3138
|
-
const { group, code, message, metadata, actor } =
|
|
3138
|
+
const { group, code, message, metadata, actor } = _chunkID7DMKXRcjs.deconstructError.call(void 0, err, true);
|
|
3139
3139
|
if (await this.#shouldRetrySchedulingError(
|
|
3140
3140
|
group,
|
|
3141
3141
|
code,
|
|
@@ -3224,7 +3224,7 @@ var ActorHandleRaw = class {
|
|
|
3224
3224
|
const contentType = response.headers.get("content-type");
|
|
3225
3225
|
const encoding = (contentType == null ? void 0 : contentType.includes("application/json")) ? "json" : this.#encoding;
|
|
3226
3226
|
try {
|
|
3227
|
-
return
|
|
3227
|
+
return _chunkID7DMKXRcjs.deserializeWithEncoding.call(void 0,
|
|
3228
3228
|
encoding,
|
|
3229
3229
|
new Uint8Array(await response.clone().arrayBuffer()),
|
|
3230
3230
|
HTTP_RESPONSE_ERROR_VERSIONED,
|
|
@@ -3240,7 +3240,7 @@ var ActorHandleRaw = class {
|
|
|
3240
3240
|
group: bare5.group,
|
|
3241
3241
|
code: bare5.code,
|
|
3242
3242
|
message: bare5.message,
|
|
3243
|
-
metadata: bare5.metadata ?
|
|
3243
|
+
metadata: bare5.metadata ? _chunkID7DMKXRcjs.decodeCborCompat.call(void 0, new Uint8Array(bare5.metadata)) : void 0,
|
|
3244
3244
|
actor: bare5.actor ? {
|
|
3245
3245
|
actorId: bare5.actor.actorId,
|
|
3246
3246
|
generation: Number(bare5.actor.generation),
|
|
@@ -3344,7 +3344,7 @@ var ClientRaw = (_class = class {
|
|
|
3344
3344
|
* @returns {ActorHandle<AD>} - A handle to the actor.
|
|
3345
3345
|
*/
|
|
3346
3346
|
getForId(name, actorId, opts) {
|
|
3347
|
-
|
|
3347
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3348
3348
|
msg: "get handle to actor with id",
|
|
3349
3349
|
name,
|
|
3350
3350
|
actorId,
|
|
@@ -3374,7 +3374,7 @@ var ClientRaw = (_class = class {
|
|
|
3374
3374
|
*/
|
|
3375
3375
|
get(name, key, opts) {
|
|
3376
3376
|
const keyArray = typeof key === "string" ? [key] : key || [];
|
|
3377
|
-
|
|
3377
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3378
3378
|
msg: "get handle to actor",
|
|
3379
3379
|
name,
|
|
3380
3380
|
key: keyArray,
|
|
@@ -3404,7 +3404,7 @@ var ClientRaw = (_class = class {
|
|
|
3404
3404
|
*/
|
|
3405
3405
|
getOrCreate(name, key, opts) {
|
|
3406
3406
|
const keyArray = typeof key === "string" ? [key] : key || [];
|
|
3407
|
-
|
|
3407
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3408
3408
|
msg: "get or create handle to actor",
|
|
3409
3409
|
name,
|
|
3410
3410
|
key: keyArray,
|
|
@@ -3446,7 +3446,7 @@ var ClientRaw = (_class = class {
|
|
|
3446
3446
|
key: keyArray
|
|
3447
3447
|
}
|
|
3448
3448
|
};
|
|
3449
|
-
|
|
3449
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3450
3450
|
msg: "create actor handle",
|
|
3451
3451
|
name,
|
|
3452
3452
|
key: keyArray,
|
|
@@ -3454,7 +3454,7 @@ var ClientRaw = (_class = class {
|
|
|
3454
3454
|
create: createQuery.create
|
|
3455
3455
|
});
|
|
3456
3456
|
const actorId = await resolveGatewayTarget(this.#driver, createQuery);
|
|
3457
|
-
|
|
3457
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3458
3458
|
msg: "created actor with ID",
|
|
3459
3459
|
name,
|
|
3460
3460
|
key: keyArray,
|
|
@@ -3497,11 +3497,11 @@ var ClientRaw = (_class = class {
|
|
|
3497
3497
|
*/
|
|
3498
3498
|
async dispose() {
|
|
3499
3499
|
if (this.#disposed) {
|
|
3500
|
-
|
|
3500
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({ msg: "client already disconnected" });
|
|
3501
3501
|
return;
|
|
3502
3502
|
}
|
|
3503
3503
|
this.#disposed = true;
|
|
3504
|
-
|
|
3504
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({ msg: "disposing client" });
|
|
3505
3505
|
const disposePromises = [];
|
|
3506
3506
|
for (const conn of this[ACTOR_CONNS_SYMBOL].values()) {
|
|
3507
3507
|
disposePromises.push(conn.dispose());
|
|
@@ -3655,8 +3655,8 @@ var ActorConnRaw = class {
|
|
|
3655
3655
|
if ("getForId" in actorResolutionState) {
|
|
3656
3656
|
this.#actorId = actorResolutionState.getForId.actorId;
|
|
3657
3657
|
}
|
|
3658
|
-
this.#readyPromise =
|
|
3659
|
-
(reason) =>
|
|
3658
|
+
this.#readyPromise = _chunkID7DMKXRcjs.promiseWithResolvers.call(void 0,
|
|
3659
|
+
(reason) => _chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
3660
3660
|
msg: "unhandled ready promise rejection",
|
|
3661
3661
|
reason
|
|
3662
3662
|
})
|
|
@@ -3718,11 +3718,11 @@ var ActorConnRaw = class {
|
|
|
3718
3718
|
`Invalid action call: expected an options object { name, args }, got ${typeof opts}. Use conn.actionName(...args) for the shorthand API.`
|
|
3719
3719
|
);
|
|
3720
3720
|
}
|
|
3721
|
-
|
|
3721
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({ msg: "action", name: opts.name, args: opts.args });
|
|
3722
3722
|
const actionId = this.#actionIdCounter;
|
|
3723
3723
|
this.#actionIdCounter += 1;
|
|
3724
|
-
const { promise, resolve, reject } =
|
|
3725
|
-
(reason) =>
|
|
3724
|
+
const { promise, resolve, reject } = _chunkID7DMKXRcjs.promiseWithResolvers.call(void 0,
|
|
3725
|
+
(reason) => _chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
3726
3726
|
msg: "unhandled action promise rejection",
|
|
3727
3727
|
reason
|
|
3728
3728
|
})
|
|
@@ -3732,7 +3732,7 @@ var ActorConnRaw = class {
|
|
|
3732
3732
|
resolve,
|
|
3733
3733
|
reject
|
|
3734
3734
|
});
|
|
3735
|
-
|
|
3735
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3736
3736
|
msg: "added action to in-flight map",
|
|
3737
3737
|
actionId,
|
|
3738
3738
|
actionName: opts.name,
|
|
@@ -3772,9 +3772,9 @@ var ActorConnRaw = class {
|
|
|
3772
3772
|
try {
|
|
3773
3773
|
handler(status);
|
|
3774
3774
|
} catch (err) {
|
|
3775
|
-
|
|
3775
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
3776
3776
|
msg: "error in status change handler",
|
|
3777
|
-
error:
|
|
3777
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
3778
3778
|
});
|
|
3779
3779
|
}
|
|
3780
3780
|
}
|
|
@@ -3784,9 +3784,9 @@ var ActorConnRaw = class {
|
|
|
3784
3784
|
try {
|
|
3785
3785
|
handler();
|
|
3786
3786
|
} catch (err) {
|
|
3787
|
-
|
|
3787
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
3788
3788
|
msg: "error in open handler",
|
|
3789
|
-
error:
|
|
3789
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
3790
3790
|
});
|
|
3791
3791
|
}
|
|
3792
3792
|
}
|
|
@@ -3796,9 +3796,9 @@ var ActorConnRaw = class {
|
|
|
3796
3796
|
try {
|
|
3797
3797
|
handler();
|
|
3798
3798
|
} catch (err) {
|
|
3799
|
-
|
|
3799
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
3800
3800
|
msg: "error in close handler",
|
|
3801
|
-
error:
|
|
3801
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
3802
3802
|
});
|
|
3803
3803
|
}
|
|
3804
3804
|
}
|
|
@@ -3811,21 +3811,21 @@ var ActorConnRaw = class {
|
|
|
3811
3811
|
minTimeout: 250,
|
|
3812
3812
|
maxTimeout: 3e4,
|
|
3813
3813
|
onFailedAttempt: (error) => {
|
|
3814
|
-
|
|
3814
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
3815
3815
|
msg: "failed to reconnect",
|
|
3816
3816
|
attempt: error.attemptNumber,
|
|
3817
|
-
error:
|
|
3817
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, error)
|
|
3818
3818
|
});
|
|
3819
3819
|
},
|
|
3820
3820
|
// Cancel retry if aborted
|
|
3821
3821
|
signal: this.#abortController.signal
|
|
3822
3822
|
}).catch((err) => {
|
|
3823
3823
|
if (err instanceof _pretry.AbortError || err.name === "AbortError" || !this.#shouldRetryConnectionOpenError(err)) {
|
|
3824
|
-
|
|
3824
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).info({ msg: "connection retry aborted" });
|
|
3825
3825
|
} else {
|
|
3826
|
-
|
|
3826
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
3827
3827
|
msg: "unexpected error in connection retry",
|
|
3828
|
-
error:
|
|
3828
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
3829
3829
|
});
|
|
3830
3830
|
}
|
|
3831
3831
|
});
|
|
@@ -3834,8 +3834,8 @@ var ActorConnRaw = class {
|
|
|
3834
3834
|
try {
|
|
3835
3835
|
if (this.#onOpenPromise)
|
|
3836
3836
|
throw new Error("#onOpenPromise already defined");
|
|
3837
|
-
this.#onOpenPromise =
|
|
3838
|
-
(reason) =>
|
|
3837
|
+
this.#onOpenPromise = _chunkID7DMKXRcjs.promiseWithResolvers.call(void 0,
|
|
3838
|
+
(reason) => _chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
3839
3839
|
msg: "unhandled open promise rejection",
|
|
3840
3840
|
reason
|
|
3841
3841
|
})
|
|
@@ -3849,15 +3849,15 @@ var ActorConnRaw = class {
|
|
|
3849
3849
|
const actorError = error instanceof _chunk4FC7TVS6cjs.RivetError ? error : new (0, _chunk4FC7TVS6cjs.RivetError)(
|
|
3850
3850
|
"client",
|
|
3851
3851
|
"connection_open_failed",
|
|
3852
|
-
`Failed to open connection: ${
|
|
3853
|
-
{ error:
|
|
3852
|
+
`Failed to open connection: ${_chunkID7DMKXRcjs.stringifyError.call(void 0, error)}`,
|
|
3853
|
+
{ error: _chunkID7DMKXRcjs.stringifyError.call(void 0, error) }
|
|
3854
3854
|
);
|
|
3855
3855
|
this.#clearQueuedMessages();
|
|
3856
3856
|
this.#rejectPendingPromises(actorError, false);
|
|
3857
3857
|
this.#dispatchActorError(actorError);
|
|
3858
3858
|
this.#setConnStatus("idle");
|
|
3859
3859
|
throw new (0, _pretry.AbortError)(
|
|
3860
|
-
error instanceof Error ? error : new Error(
|
|
3860
|
+
error instanceof Error ? error : new Error(_chunkID7DMKXRcjs.stringifyError.call(void 0, error))
|
|
3861
3861
|
);
|
|
3862
3862
|
} finally {
|
|
3863
3863
|
this.#onOpenPromise = void 0;
|
|
@@ -3877,7 +3877,7 @@ var ActorConnRaw = class {
|
|
|
3877
3877
|
}
|
|
3878
3878
|
#clearQueuedMessages() {
|
|
3879
3879
|
if (this.#messageQueue.length === 0) return;
|
|
3880
|
-
|
|
3880
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3881
3881
|
msg: "clearing queued connection messages",
|
|
3882
3882
|
queueLength: this.#messageQueue.length
|
|
3883
3883
|
});
|
|
@@ -3890,7 +3890,7 @@ var ActorConnRaw = class {
|
|
|
3890
3890
|
try {
|
|
3891
3891
|
return await this.#getParams();
|
|
3892
3892
|
} catch (err) {
|
|
3893
|
-
const errorMessage =
|
|
3893
|
+
const errorMessage = _chunkID7DMKXRcjs.stringifyError.call(void 0, err);
|
|
3894
3894
|
const error = new (0, _chunk4FC7TVS6cjs.RivetError)(
|
|
3895
3895
|
"client",
|
|
3896
3896
|
"get_params_failed",
|
|
@@ -3914,7 +3914,7 @@ var ActorConnRaw = class {
|
|
|
3914
3914
|
this.#gatewayOptions
|
|
3915
3915
|
);
|
|
3916
3916
|
_invariant2.default.call(void 0, ws, "websocket should have been created");
|
|
3917
|
-
|
|
3917
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3918
3918
|
msg: "opened websocket",
|
|
3919
3919
|
connId: this.#connId,
|
|
3920
3920
|
readyState: ws.readyState,
|
|
@@ -3922,7 +3922,7 @@ var ActorConnRaw = class {
|
|
|
3922
3922
|
});
|
|
3923
3923
|
this.#websocket = ws;
|
|
3924
3924
|
ws.addEventListener("open", () => {
|
|
3925
|
-
|
|
3925
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3926
3926
|
msg: "client websocket open",
|
|
3927
3927
|
connId: this.#connId
|
|
3928
3928
|
});
|
|
@@ -3931,9 +3931,9 @@ var ActorConnRaw = class {
|
|
|
3931
3931
|
try {
|
|
3932
3932
|
await this.#handleOnMessage(ev.data);
|
|
3933
3933
|
} catch (err) {
|
|
3934
|
-
|
|
3934
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
3935
3935
|
msg: "error in websocket message handler",
|
|
3936
|
-
error:
|
|
3936
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
3937
3937
|
});
|
|
3938
3938
|
}
|
|
3939
3939
|
});
|
|
@@ -3941,9 +3941,9 @@ var ActorConnRaw = class {
|
|
|
3941
3941
|
try {
|
|
3942
3942
|
await this.#handleOnClose(ev);
|
|
3943
3943
|
} catch (err) {
|
|
3944
|
-
|
|
3944
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
3945
3945
|
msg: "error in websocket close handler",
|
|
3946
|
-
error:
|
|
3946
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
3947
3947
|
});
|
|
3948
3948
|
}
|
|
3949
3949
|
});
|
|
@@ -3951,9 +3951,9 @@ var ActorConnRaw = class {
|
|
|
3951
3951
|
try {
|
|
3952
3952
|
this.#handleOnError();
|
|
3953
3953
|
} catch (err) {
|
|
3954
|
-
|
|
3954
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
3955
3955
|
msg: "error in websocket error handler",
|
|
3956
|
-
error:
|
|
3956
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
3957
3957
|
});
|
|
3958
3958
|
}
|
|
3959
3959
|
});
|
|
@@ -3961,7 +3961,7 @@ var ActorConnRaw = class {
|
|
|
3961
3961
|
/** Called by the onopen event from drivers. */
|
|
3962
3962
|
#handleOnOpen() {
|
|
3963
3963
|
if (this.#disposed) {
|
|
3964
|
-
|
|
3964
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3965
3965
|
msg: "handleOnOpen called after dispose, closing websocket"
|
|
3966
3966
|
});
|
|
3967
3967
|
if (this.#websocket) {
|
|
@@ -3977,7 +3977,7 @@ var ActorConnRaw = class {
|
|
|
3977
3977
|
queueMicrotask(() => {
|
|
3978
3978
|
this.#openScheduled = false;
|
|
3979
3979
|
if (this.#disposed) {
|
|
3980
|
-
|
|
3980
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3981
3981
|
msg: "handleOnOpen scheduled after dispose, closing websocket"
|
|
3982
3982
|
});
|
|
3983
3983
|
if (this.#websocket) {
|
|
@@ -3986,7 +3986,7 @@ var ActorConnRaw = class {
|
|
|
3986
3986
|
}
|
|
3987
3987
|
return;
|
|
3988
3988
|
}
|
|
3989
|
-
|
|
3989
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
3990
3990
|
msg: "socket open",
|
|
3991
3991
|
messageQueueLength: this.#messageQueue.length,
|
|
3992
3992
|
connId: this.#connId
|
|
@@ -3995,14 +3995,14 @@ var ActorConnRaw = class {
|
|
|
3995
3995
|
if (this.#onOpenPromise) {
|
|
3996
3996
|
this.#onOpenPromise.resolve(void 0);
|
|
3997
3997
|
} else {
|
|
3998
|
-
|
|
3998
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({ msg: "#onOpenPromise is undefined" });
|
|
3999
3999
|
}
|
|
4000
4000
|
for (const eventName of this.#eventSubscriptions.keys()) {
|
|
4001
4001
|
this.#sendSubscription(eventName, true);
|
|
4002
4002
|
}
|
|
4003
4003
|
const queue = this.#messageQueue;
|
|
4004
4004
|
this.#messageQueue = [];
|
|
4005
|
-
|
|
4005
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
4006
4006
|
msg: "flushing message queue",
|
|
4007
4007
|
queueLength: queue.length
|
|
4008
4008
|
});
|
|
@@ -4014,23 +4014,23 @@ var ActorConnRaw = class {
|
|
|
4014
4014
|
/** Called by the onmessage event from drivers. */
|
|
4015
4015
|
async #handleOnMessage(data) {
|
|
4016
4016
|
var _a;
|
|
4017
|
-
|
|
4017
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).trace({
|
|
4018
4018
|
msg: "received message",
|
|
4019
4019
|
dataType: typeof data,
|
|
4020
4020
|
isBlob: data instanceof Blob,
|
|
4021
4021
|
isArrayBuffer: data instanceof ArrayBuffer
|
|
4022
4022
|
});
|
|
4023
4023
|
const response = await this.#parseMessage(data);
|
|
4024
|
-
|
|
4025
|
-
|
|
4024
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).trace(
|
|
4025
|
+
_chunkID7DMKXRcjs.getLogMessage.call(void 0, ) ? {
|
|
4026
4026
|
msg: "parsed message",
|
|
4027
|
-
message:
|
|
4027
|
+
message: _chunkID7DMKXRcjs.jsonStringifyCompat.call(void 0, response).substring(0, 100) + "..."
|
|
4028
4028
|
} : { msg: "parsed message" }
|
|
4029
4029
|
);
|
|
4030
4030
|
if (response.body.tag === "Init") {
|
|
4031
4031
|
this.#actorId = response.body.val.actorId;
|
|
4032
4032
|
this.#connId = response.body.val.connectionId;
|
|
4033
|
-
|
|
4033
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).trace({
|
|
4034
4034
|
msg: "received init message",
|
|
4035
4035
|
actorId: this.#actorId,
|
|
4036
4036
|
connId: this.#connId
|
|
@@ -4041,7 +4041,7 @@ var ActorConnRaw = class {
|
|
|
4041
4041
|
if (actionId !== null) {
|
|
4042
4042
|
const inFlight = this.#takeActionInFlight(Number(actionId));
|
|
4043
4043
|
this.#invalidateActorIfStale(group, code);
|
|
4044
|
-
|
|
4044
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
4045
4045
|
msg: "action error",
|
|
4046
4046
|
actionId,
|
|
4047
4047
|
actionName: inFlight == null ? void 0 : inFlight.name,
|
|
@@ -4060,7 +4060,7 @@ var ActorConnRaw = class {
|
|
|
4060
4060
|
})
|
|
4061
4061
|
);
|
|
4062
4062
|
} else {
|
|
4063
|
-
|
|
4063
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
4064
4064
|
msg: "connection error",
|
|
4065
4065
|
group,
|
|
4066
4066
|
code,
|
|
@@ -4108,27 +4108,27 @@ var ActorConnRaw = class {
|
|
|
4108
4108
|
}
|
|
4109
4109
|
} else if (response.body.tag === "ActionResponse") {
|
|
4110
4110
|
const { id: actionId } = response.body.val;
|
|
4111
|
-
|
|
4111
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
4112
4112
|
msg: "received action response",
|
|
4113
4113
|
actionId: Number(actionId),
|
|
4114
4114
|
inFlightCount: this.#actionsInFlight.size,
|
|
4115
4115
|
inFlightIds: Array.from(this.#actionsInFlight.keys())
|
|
4116
4116
|
});
|
|
4117
4117
|
const inFlight = this.#takeActionInFlight(Number(actionId));
|
|
4118
|
-
|
|
4118
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).trace({
|
|
4119
4119
|
msg: "resolving action promise",
|
|
4120
4120
|
actionId,
|
|
4121
4121
|
actionName: inFlight == null ? void 0 : inFlight.name
|
|
4122
4122
|
});
|
|
4123
4123
|
inFlight.resolve(response.body.val);
|
|
4124
4124
|
} else if (response.body.tag === "Event") {
|
|
4125
|
-
|
|
4125
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).trace({
|
|
4126
4126
|
msg: "received event",
|
|
4127
4127
|
name: response.body.val.name
|
|
4128
4128
|
});
|
|
4129
4129
|
this.#dispatchEvent(response.body.val);
|
|
4130
4130
|
} else {
|
|
4131
|
-
|
|
4131
|
+
_chunkID7DMKXRcjs.assertUnreachable.call(void 0, response.body);
|
|
4132
4132
|
}
|
|
4133
4133
|
}
|
|
4134
4134
|
/** Called by the onclose event from drivers. */
|
|
@@ -4137,7 +4137,7 @@ var ActorConnRaw = class {
|
|
|
4137
4137
|
const closeEvent = event;
|
|
4138
4138
|
const wasClean = closeEvent.wasClean;
|
|
4139
4139
|
const wasConnected = this.#connStatus === "connected";
|
|
4140
|
-
|
|
4140
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).info({
|
|
4141
4141
|
msg: "socket closed",
|
|
4142
4142
|
code: closeEvent.code,
|
|
4143
4143
|
reason: closeEvent.reason,
|
|
@@ -4204,7 +4204,7 @@ var ActorConnRaw = class {
|
|
|
4204
4204
|
this.#dispatchActorError(error);
|
|
4205
4205
|
}
|
|
4206
4206
|
if (wasConnected) {
|
|
4207
|
-
|
|
4207
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
4208
4208
|
msg: "triggering reconnect",
|
|
4209
4209
|
connId: this.#connId
|
|
4210
4210
|
});
|
|
@@ -4228,12 +4228,12 @@ var ActorConnRaw = class {
|
|
|
4228
4228
|
/** Called by the onerror event from drivers. */
|
|
4229
4229
|
#handleOnError() {
|
|
4230
4230
|
if (this.#disposed) return;
|
|
4231
|
-
|
|
4231
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn("socket error");
|
|
4232
4232
|
}
|
|
4233
4233
|
#takeActionInFlight(id) {
|
|
4234
4234
|
const inFlight = this.#actionsInFlight.get(id);
|
|
4235
4235
|
if (!inFlight) {
|
|
4236
|
-
|
|
4236
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
4237
4237
|
msg: "action not found in in-flight map",
|
|
4238
4238
|
lookupId: id,
|
|
4239
4239
|
inFlightCount: this.#actionsInFlight.size,
|
|
@@ -4248,7 +4248,7 @@ var ActorConnRaw = class {
|
|
|
4248
4248
|
throw internalClientError(`No in flight response for ${id}`);
|
|
4249
4249
|
}
|
|
4250
4250
|
this.#actionsInFlight.delete(id);
|
|
4251
|
-
|
|
4251
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
4252
4252
|
msg: "removed action from in-flight map",
|
|
4253
4253
|
actionId: id,
|
|
4254
4254
|
actionName: inFlight.name,
|
|
@@ -4275,9 +4275,9 @@ var ActorConnRaw = class {
|
|
|
4275
4275
|
try {
|
|
4276
4276
|
handler(error);
|
|
4277
4277
|
} catch (err) {
|
|
4278
|
-
|
|
4278
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
4279
4279
|
msg: "error in connection error handler",
|
|
4280
|
-
error:
|
|
4280
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
4281
4281
|
});
|
|
4282
4282
|
}
|
|
4283
4283
|
}
|
|
@@ -4382,9 +4382,9 @@ var ActorConnRaw = class {
|
|
|
4382
4382
|
try {
|
|
4383
4383
|
callback();
|
|
4384
4384
|
} catch (err) {
|
|
4385
|
-
|
|
4385
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).error({
|
|
4386
4386
|
msg: "error in open handler",
|
|
4387
|
-
error:
|
|
4387
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, err)
|
|
4388
4388
|
});
|
|
4389
4389
|
}
|
|
4390
4390
|
});
|
|
@@ -4434,7 +4434,7 @@ var ActorConnRaw = class {
|
|
|
4434
4434
|
let queueMessage = false;
|
|
4435
4435
|
if (this.#websocket) {
|
|
4436
4436
|
const readyState = this.#websocket.readyState;
|
|
4437
|
-
|
|
4437
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
4438
4438
|
msg: "websocket send attempt",
|
|
4439
4439
|
readyState,
|
|
4440
4440
|
readyStateString: readyState === 0 ? "CONNECTING" : readyState === 1 ? "OPEN" : readyState === 2 ? "CLOSING" : "CLOSED",
|
|
@@ -4443,7 +4443,7 @@ var ActorConnRaw = class {
|
|
|
4443
4443
|
actionName: (_a = message.body.val) == null ? void 0 : _a.name
|
|
4444
4444
|
});
|
|
4445
4445
|
if (this.#connStatus !== "connected") {
|
|
4446
|
-
|
|
4446
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
4447
4447
|
msg: "websocket init pending, queueing message",
|
|
4448
4448
|
connStatus: this.#connStatus,
|
|
4449
4449
|
messageType: message.body.tag
|
|
@@ -4451,7 +4451,7 @@ var ActorConnRaw = class {
|
|
|
4451
4451
|
queueMessage = true;
|
|
4452
4452
|
} else if (readyState === 1) {
|
|
4453
4453
|
try {
|
|
4454
|
-
const messageSerialized =
|
|
4454
|
+
const messageSerialized = _chunkID7DMKXRcjs.serializeWithEncoding.call(void 0,
|
|
4455
4455
|
this.#encoding,
|
|
4456
4456
|
message,
|
|
4457
4457
|
CLIENT_PROTOCOL_TO_SERVER,
|
|
@@ -4468,8 +4468,8 @@ var ActorConnRaw = class {
|
|
|
4468
4468
|
val: {
|
|
4469
4469
|
id: msg.body.val.id,
|
|
4470
4470
|
name: msg.body.val.name,
|
|
4471
|
-
args:
|
|
4472
|
-
|
|
4471
|
+
args: _chunkID7DMKXRcjs.bufferToArrayBuffer.call(void 0,
|
|
4472
|
+
_chunkID7DMKXRcjs.encodeCborCompat.call(void 0,
|
|
4473
4473
|
msg.body.val.args
|
|
4474
4474
|
)
|
|
4475
4475
|
)
|
|
@@ -4483,12 +4483,12 @@ var ActorConnRaw = class {
|
|
|
4483
4483
|
);
|
|
4484
4484
|
this.#websocket.send(messageSerialized);
|
|
4485
4485
|
const serializedLength = messageLength(messageSerialized);
|
|
4486
|
-
|
|
4486
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).trace({
|
|
4487
4487
|
msg: "sent websocket message",
|
|
4488
4488
|
len: serializedLength
|
|
4489
4489
|
});
|
|
4490
4490
|
} catch (error) {
|
|
4491
|
-
|
|
4491
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
4492
4492
|
msg: "failed to send message, added to queue",
|
|
4493
4493
|
error,
|
|
4494
4494
|
connId: this.#connId
|
|
@@ -4496,19 +4496,19 @@ var ActorConnRaw = class {
|
|
|
4496
4496
|
queueMessage = true;
|
|
4497
4497
|
}
|
|
4498
4498
|
} else {
|
|
4499
|
-
|
|
4499
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
4500
4500
|
msg: "websocket not open, queueing message",
|
|
4501
4501
|
readyState
|
|
4502
4502
|
});
|
|
4503
4503
|
queueMessage = true;
|
|
4504
4504
|
}
|
|
4505
4505
|
} else {
|
|
4506
|
-
|
|
4506
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({ msg: "no websocket, queueing message" });
|
|
4507
4507
|
queueMessage = true;
|
|
4508
4508
|
}
|
|
4509
4509
|
if (!(opts == null ? void 0 : opts.ephemeral) && queueMessage) {
|
|
4510
4510
|
this.#messageQueue.push(message);
|
|
4511
|
-
|
|
4511
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({
|
|
4512
4512
|
msg: "queued connection message",
|
|
4513
4513
|
queueLength: this.#messageQueue.length,
|
|
4514
4514
|
connId: this.#connId,
|
|
@@ -4519,8 +4519,8 @@ var ActorConnRaw = class {
|
|
|
4519
4519
|
}
|
|
4520
4520
|
async #parseMessage(data) {
|
|
4521
4521
|
_invariant2.default.call(void 0, this.#websocket, "websocket must be defined");
|
|
4522
|
-
const buffer = await
|
|
4523
|
-
return
|
|
4522
|
+
const buffer = await _chunkID7DMKXRcjs.inputDataToBuffer.call(void 0, data);
|
|
4523
|
+
return _chunkID7DMKXRcjs.deserializeWithEncoding.call(void 0,
|
|
4524
4524
|
this.#encoding,
|
|
4525
4525
|
buffer,
|
|
4526
4526
|
CLIENT_PROTOCOL_TO_CLIENT,
|
|
@@ -4555,7 +4555,7 @@ var ActorConnRaw = class {
|
|
|
4555
4555
|
group: msg.body.val.group,
|
|
4556
4556
|
code: msg.body.val.code,
|
|
4557
4557
|
message: msg.body.val.message,
|
|
4558
|
-
metadata: msg.body.val.metadata ?
|
|
4558
|
+
metadata: msg.body.val.metadata ? _chunkID7DMKXRcjs.decodeCborCompat.call(void 0,
|
|
4559
4559
|
new Uint8Array(
|
|
4560
4560
|
msg.body.val.metadata
|
|
4561
4561
|
)
|
|
@@ -4577,7 +4577,7 @@ var ActorConnRaw = class {
|
|
|
4577
4577
|
tag: "ActionResponse",
|
|
4578
4578
|
val: {
|
|
4579
4579
|
id: msg.body.val.id,
|
|
4580
|
-
output:
|
|
4580
|
+
output: _chunkID7DMKXRcjs.decodeCborCompat.call(void 0,
|
|
4581
4581
|
new Uint8Array(msg.body.val.output)
|
|
4582
4582
|
)
|
|
4583
4583
|
}
|
|
@@ -4589,7 +4589,7 @@ var ActorConnRaw = class {
|
|
|
4589
4589
|
tag: "Event",
|
|
4590
4590
|
val: {
|
|
4591
4591
|
name: msg.body.val.name,
|
|
4592
|
-
args:
|
|
4592
|
+
args: _chunkID7DMKXRcjs.decodeCborCompat.call(void 0,
|
|
4593
4593
|
new Uint8Array(msg.body.val.args)
|
|
4594
4594
|
)
|
|
4595
4595
|
}
|
|
@@ -4630,11 +4630,11 @@ var ActorConnRaw = class {
|
|
|
4630
4630
|
*/
|
|
4631
4631
|
async dispose() {
|
|
4632
4632
|
if (this.#disposed) {
|
|
4633
|
-
|
|
4633
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({ msg: "connection already disconnected" });
|
|
4634
4634
|
return;
|
|
4635
4635
|
}
|
|
4636
4636
|
this.#disposed = true;
|
|
4637
|
-
|
|
4637
|
+
_chunkTKPQNJQ2cjs.logger.call(void 0, ).debug({ msg: "disposing actor conn" });
|
|
4638
4638
|
this.#setConnStatus("idle");
|
|
4639
4639
|
clearInterval(this.#keepNodeAliveInterval);
|
|
4640
4640
|
this.#abortController.abort();
|
|
@@ -4642,8 +4642,8 @@ var ActorConnRaw = class {
|
|
|
4642
4642
|
if (this.#websocket) {
|
|
4643
4643
|
const ws = this.#websocket;
|
|
4644
4644
|
if (ws.readyState !== 2 && ws.readyState !== 3) {
|
|
4645
|
-
const { promise, resolve } =
|
|
4646
|
-
(reason) =>
|
|
4645
|
+
const { promise, resolve } = _chunkID7DMKXRcjs.promiseWithResolvers.call(void 0,
|
|
4646
|
+
(reason) => _chunkTKPQNJQ2cjs.logger.call(void 0, ).warn({
|
|
4647
4647
|
msg: "unhandled websocket close promise rejection",
|
|
4648
4648
|
reason
|
|
4649
4649
|
})
|
|
@@ -4762,7 +4762,7 @@ var ClientConfigSchemaBase = _v42.default.object({
|
|
|
4762
4762
|
* Defaults to http://localhost:6420.
|
|
4763
4763
|
*/
|
|
4764
4764
|
endpoint: _v42.default.string().optional().transform((val) => {
|
|
4765
|
-
const resolved = _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
4765
|
+
const resolved = _nullishCoalesce(_nullishCoalesce(val, () => ( _chunkID7DMKXRcjs.getRivetEngine.call(void 0, ))), () => ( _chunkID7DMKXRcjs.getRivetEndpoint.call(void 0, )));
|
|
4766
4766
|
if (!resolved && !hasWarnedMissingEndpoint) {
|
|
4767
4767
|
hasWarnedMissingEndpoint = true;
|
|
4768
4768
|
console.warn(
|
|
@@ -4772,12 +4772,12 @@ var ClientConfigSchemaBase = _v42.default.object({
|
|
|
4772
4772
|
return _nullishCoalesce(resolved, () => ( DEFAULT_ENDPOINT));
|
|
4773
4773
|
}),
|
|
4774
4774
|
/** Token to use to authenticate with the API. */
|
|
4775
|
-
token: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
4775
|
+
token: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkID7DMKXRcjs.getRivetToken.call(void 0, )))),
|
|
4776
4776
|
/** Namespace to connect to. */
|
|
4777
|
-
namespace: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
4777
|
+
namespace: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunkID7DMKXRcjs.getRivetNamespace.call(void 0, )))),
|
|
4778
4778
|
/** Name of the envoy pool. This is used to group together envoys in to different pools. */
|
|
4779
|
-
poolName: _v42.default.string().default(() => _nullishCoalesce(
|
|
4780
|
-
encoding:
|
|
4779
|
+
poolName: _v42.default.string().default(() => _nullishCoalesce(_chunkID7DMKXRcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
4780
|
+
encoding: _chunkID7DMKXRcjs.EncodingSchema.default("bare"),
|
|
4781
4781
|
headers: _v42.default.record(_v42.default.string(), _v42.default.string()).optional().default(() => ({})),
|
|
4782
4782
|
gateway: _v42.default.object({
|
|
4783
4783
|
skipReadyWait: _v42.default.boolean().optional().default(false)
|
|
@@ -4843,7 +4843,7 @@ function convertRegistryConfigToClientConfig(config) {
|
|
|
4843
4843
|
|
|
4844
4844
|
// src/engine-client/log.ts
|
|
4845
4845
|
function logger2() {
|
|
4846
|
-
return
|
|
4846
|
+
return _chunkID7DMKXRcjs.getLogger.call(void 0, "engine-client");
|
|
4847
4847
|
}
|
|
4848
4848
|
|
|
4849
4849
|
// src/engine-client/api-utils.ts
|
|
@@ -4852,7 +4852,7 @@ function getEndpoint(config) {
|
|
|
4852
4852
|
}
|
|
4853
4853
|
async function apiCall(config, method, path, body) {
|
|
4854
4854
|
const endpoint = getEndpoint(config);
|
|
4855
|
-
const url =
|
|
4855
|
+
const url = _chunkID7DMKXRcjs.combineUrlPath.call(void 0, endpoint, path, {
|
|
4856
4856
|
namespace: config.namespace
|
|
4857
4857
|
});
|
|
4858
4858
|
logger2().debug({ msg: "making api call", method, url });
|
|
@@ -5170,7 +5170,7 @@ var BufferedRemoteWebSocket = (_class2 = class {
|
|
|
5170
5170
|
function buildActorGatewayUrl(endpoint, actorId, token, path = "") {
|
|
5171
5171
|
const tokenSegment = token !== void 0 ? `@${encodeURIComponent(token)}` : "";
|
|
5172
5172
|
const gatewayPath = `/gateway/${encodeURIComponent(actorId)}${tokenSegment}${path}`;
|
|
5173
|
-
return
|
|
5173
|
+
return _chunkID7DMKXRcjs.combineUrlPath.call(void 0, endpoint, gatewayPath);
|
|
5174
5174
|
}
|
|
5175
5175
|
function buildActorQueryGatewayUrl(endpoint, namespace, query, token, path = "", maxInputSize = DEFAULT_MAX_QUERY_INPUT_SIZE, crashPolicy = void 0, runnerName, options = {}) {
|
|
5176
5176
|
if (namespace.length === 0) {
|
|
@@ -5236,7 +5236,7 @@ function buildActorQueryGatewayUrl(endpoint, namespace, query, token, path = "",
|
|
|
5236
5236
|
separator = "?";
|
|
5237
5237
|
}
|
|
5238
5238
|
const gatewayPath = `/gateway/${encodeURIComponent(name)}${path}${separator}${queryString}`;
|
|
5239
|
-
return
|
|
5239
|
+
return _chunkID7DMKXRcjs.combineUrlPath.call(void 0, endpoint, gatewayPath);
|
|
5240
5240
|
}
|
|
5241
5241
|
function pushKeyQueryParams(params, key) {
|
|
5242
5242
|
if (key.length > 0) {
|
|
@@ -5247,7 +5247,7 @@ function pushInputQueryParam(params, input, maxInputSize) {
|
|
|
5247
5247
|
if (input === void 0) {
|
|
5248
5248
|
return;
|
|
5249
5249
|
}
|
|
5250
|
-
const encodedInput =
|
|
5250
|
+
const encodedInput = _chunkID7DMKXRcjs.encodeCborCompat.call(void 0, input);
|
|
5251
5251
|
if (encodedInput.byteLength > maxInputSize) {
|
|
5252
5252
|
throw new Error(
|
|
5253
5253
|
`Actor query input exceeds maxInputSize (${encodedInput.byteLength} > ${maxInputSize} bytes). Increase client maxInputSize to allow larger query payloads.`
|
|
@@ -5256,10 +5256,10 @@ function pushInputQueryParam(params, input, maxInputSize) {
|
|
|
5256
5256
|
params.append("rvt-input", uint8ArrayToBase64Url(encodedInput));
|
|
5257
5257
|
}
|
|
5258
5258
|
function uint8ArrayToBase64Url(value) {
|
|
5259
|
-
return
|
|
5259
|
+
return _chunkID7DMKXRcjs.uint8ArrayToBase64.call(void 0, value).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
5260
5260
|
}
|
|
5261
5261
|
async function openWebSocketToGateway(runConfig, gatewayUrl, encoding, params, options = {}) {
|
|
5262
|
-
const WebSocket2 = await
|
|
5262
|
+
const WebSocket2 = await _chunkTKPQNJQ2cjs.importWebSocket.call(void 0, );
|
|
5263
5263
|
const ackHookToken = typeof process !== "undefined" && process.env.VITEST ? crypto.randomUUID() : void 0;
|
|
5264
5264
|
logger2().debug({
|
|
5265
5265
|
msg: "opening websocket to actor via guard",
|
|
@@ -5352,7 +5352,7 @@ async function lookupMetadataCached(config) {
|
|
|
5352
5352
|
msg: "failed to fetch metadata, retrying",
|
|
5353
5353
|
endpoint,
|
|
5354
5354
|
attempt: error.attemptNumber,
|
|
5355
|
-
error:
|
|
5355
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, error)
|
|
5356
5356
|
});
|
|
5357
5357
|
}
|
|
5358
5358
|
}
|
|
@@ -5364,7 +5364,7 @@ async function lookupMetadataCached(config) {
|
|
|
5364
5364
|
|
|
5365
5365
|
// src/engine-client/ws-proxy.ts
|
|
5366
5366
|
async function createWebSocketProxy(_c, targetUrl, protocols) {
|
|
5367
|
-
const WebSocket2 = await
|
|
5367
|
+
const WebSocket2 = await _chunkTKPQNJQ2cjs.importWebSocket.call(void 0, );
|
|
5368
5368
|
const state = {};
|
|
5369
5369
|
return {
|
|
5370
5370
|
onOpen: async (_event, clientWs) => {
|
|
@@ -5429,7 +5429,7 @@ async function createWebSocketProxy(_c, targetUrl, protocols) {
|
|
|
5429
5429
|
logger2().error({
|
|
5430
5430
|
msg: "target websocket error",
|
|
5431
5431
|
targetUrl,
|
|
5432
|
-
error:
|
|
5432
|
+
error: _chunkID7DMKXRcjs.stringifyError.call(void 0, error)
|
|
5433
5433
|
});
|
|
5434
5434
|
closeWebSocketIfOpen(clientWs, 1011, "Target WebSocket error");
|
|
5435
5435
|
});
|
|
@@ -5508,7 +5508,7 @@ var RemoteEngineControlClient = class {
|
|
|
5508
5508
|
#config;
|
|
5509
5509
|
#metadataPromise;
|
|
5510
5510
|
constructor(runConfig) {
|
|
5511
|
-
if (
|
|
5511
|
+
if (_chunkID7DMKXRcjs.getNextPhase.call(void 0, ) === "phase-production-build") {
|
|
5512
5512
|
logger2().info(
|
|
5513
5513
|
"detected next.js build phase, disabling health check"
|
|
5514
5514
|
);
|
|
@@ -5599,8 +5599,8 @@ var RemoteEngineControlClient = class {
|
|
|
5599
5599
|
name,
|
|
5600
5600
|
key: _chunkMYWZCDMLcjs.serializeActorKey.call(void 0, key),
|
|
5601
5601
|
runner_name_selector: this.#config.poolName,
|
|
5602
|
-
input: actorInput ?
|
|
5603
|
-
|
|
5602
|
+
input: actorInput ? _chunkID7DMKXRcjs.uint8ArrayToBase64.call(void 0,
|
|
5603
|
+
_chunkID7DMKXRcjs.encodeCborCompat.call(void 0, actorInput)
|
|
5604
5604
|
) : void 0,
|
|
5605
5605
|
crash_policy: _nullishCoalesce(crashPolicy, () => ( "sleep"))
|
|
5606
5606
|
});
|
|
@@ -5627,7 +5627,7 @@ var RemoteEngineControlClient = class {
|
|
|
5627
5627
|
name,
|
|
5628
5628
|
runner_name_selector: this.#config.poolName,
|
|
5629
5629
|
key: _chunkMYWZCDMLcjs.serializeActorKey.call(void 0, key),
|
|
5630
|
-
input: input ?
|
|
5630
|
+
input: input ? _chunkID7DMKXRcjs.uint8ArrayToBase64.call(void 0, _chunkID7DMKXRcjs.encodeCborCompat.call(void 0, input)) : void 0,
|
|
5631
5631
|
crash_policy: _nullishCoalesce(crashPolicy, () => ( "sleep"))
|
|
5632
5632
|
});
|
|
5633
5633
|
logger2().info({
|
|
@@ -5705,7 +5705,7 @@ var RemoteEngineControlClient = class {
|
|
|
5705
5705
|
const upgradeWebSocket = (_b = (_a = this.#config).getUpgradeWebSocket) == null ? void 0 : _b.call(_a);
|
|
5706
5706
|
_invariant2.default.call(void 0, upgradeWebSocket, "missing getUpgradeWebSocket");
|
|
5707
5707
|
const endpoint = getEndpoint(this.#config);
|
|
5708
|
-
const guardUrl =
|
|
5708
|
+
const guardUrl = _chunkID7DMKXRcjs.combineUrlPath.call(void 0, endpoint, path);
|
|
5709
5709
|
const wsGuardUrl = guardUrl.replace("http://", "ws://");
|
|
5710
5710
|
logger2().debug({
|
|
5711
5711
|
msg: "forwarding websocket to actor via guard",
|
|
@@ -5724,7 +5724,7 @@ var RemoteEngineControlClient = class {
|
|
|
5724
5724
|
}
|
|
5725
5725
|
);
|
|
5726
5726
|
const args = await createWebSocketProxy(c, wsGuardUrl, protocols);
|
|
5727
|
-
return await upgradeWebSocket(() => args)(c,
|
|
5727
|
+
return await upgradeWebSocket(() => args)(c, _chunkID7DMKXRcjs.noopNext.call(void 0, ));
|
|
5728
5728
|
}
|
|
5729
5729
|
displayInformation() {
|
|
5730
5730
|
return { properties: {} };
|
|
@@ -5735,7 +5735,7 @@ var RemoteEngineControlClient = class {
|
|
|
5735
5735
|
#buildGatewayUrlForTarget(target, path, options = {}) {
|
|
5736
5736
|
const endpoint = getEndpoint(this.#config);
|
|
5737
5737
|
if (shouldSkipReadyWait(options) && directActorIdFromTarget(target) && canUseDirectSkipReadyWaitPath(path)) {
|
|
5738
|
-
return
|
|
5738
|
+
return _chunkID7DMKXRcjs.combineUrlPath.call(void 0, endpoint, path);
|
|
5739
5739
|
}
|
|
5740
5740
|
if ("directId" in target) {
|
|
5741
5741
|
return buildActorGatewayUrl(
|
|
@@ -5829,4 +5829,4 @@ function apiActorToOutput(actor) {
|
|
|
5829
5829
|
|
|
5830
5830
|
|
|
5831
5831
|
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.ActorHandleRaw = ActorHandleRaw; exports.createClientWithDriver = createClientWithDriver; exports.tryParseEndpoint = tryParseEndpoint; exports.ClientConfigSchema = ClientConfigSchema; exports.convertRegistryConfigToClientConfig = convertRegistryConfigToClientConfig; exports.getMetadata = getMetadata; exports.getDatacenters = getDatacenters; exports.updateRunnerConfig = updateRunnerConfig; exports.RemoteEngineControlClient = RemoteEngineControlClient;
|
|
5832
|
-
//# sourceMappingURL=chunk-
|
|
5832
|
+
//# sourceMappingURL=chunk-2GZPBFZV.cjs.map
|