rivetkit 2.3.6 → 2.3.7
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-234EFKN2.cjs → chunk-2SGPZEAJ.cjs} +2 -2
- package/dist/tsup/{chunk-234EFKN2.cjs.map → chunk-2SGPZEAJ.cjs.map} +1 -1
- package/dist/tsup/{chunk-AXEGEUYB.cjs → chunk-46AE7JOI.cjs} +138 -138
- package/dist/tsup/{chunk-AXEGEUYB.cjs.map → chunk-46AE7JOI.cjs.map} +1 -1
- package/dist/tsup/{chunk-PLLHHJWR.js → chunk-6D2WRHJV.js} +2 -2
- package/dist/tsup/{chunk-BX4G2O6M.js → chunk-7YQJXWBW.js} +3 -3
- package/dist/tsup/{chunk-3ZE5UDOA.js → chunk-CH25U5NO.js} +3 -3
- package/dist/tsup/{chunk-HVOKIYUB.cjs → chunk-DOPH7DT2.cjs} +7 -7
- package/dist/tsup/{chunk-HVOKIYUB.cjs.map → chunk-DOPH7DT2.cjs.map} +1 -1
- package/dist/tsup/{chunk-WS3PP253.cjs → chunk-MNZFNIVI.cjs} +3 -3
- package/dist/tsup/{chunk-WS3PP253.cjs.map → chunk-MNZFNIVI.cjs.map} +1 -1
- package/dist/tsup/{chunk-RDTFPGU2.js → chunk-OG4OR2CM.js} +2 -2
- package/dist/tsup/{chunk-RDTFPGU2.js.map → chunk-OG4OR2CM.js.map} +1 -1
- package/dist/tsup/{chunk-PD7SZKHY.cjs → chunk-TQHMPWL6.cjs} +9 -9
- package/dist/tsup/{chunk-PD7SZKHY.cjs.map → chunk-TQHMPWL6.cjs.map} +1 -1
- package/dist/tsup/{chunk-FNTTW25Q.cjs → chunk-UIZZCJ5W.cjs} +4 -4
- package/dist/tsup/{chunk-FNTTW25Q.cjs.map → chunk-UIZZCJ5W.cjs.map} +1 -1
- package/dist/tsup/{chunk-OH6CBWUD.js → chunk-YHPFCYL3.js} +2 -2
- package/dist/tsup/{chunk-F6ZW7JZQ.js → chunk-YU3C5OCU.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 +62 -62
- 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-PLLHHJWR.js.map → chunk-6D2WRHJV.js.map} +0 -0
- /package/dist/tsup/{chunk-BX4G2O6M.js.map → chunk-7YQJXWBW.js.map} +0 -0
- /package/dist/tsup/{chunk-3ZE5UDOA.js.map → chunk-CH25U5NO.js.map} +0 -0
- /package/dist/tsup/{chunk-OH6CBWUD.js.map → chunk-YHPFCYL3.js.map} +0 -0
- /package/dist/tsup/{chunk-F6ZW7JZQ.js.map → chunk-YU3C5OCU.js.map} +0 -0
|
@@ -5,7 +5,7 @@ var _chunkMYWZCDMLcjs = require('./chunk-MYWZCDML.cjs');
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
8
|
+
var _chunkMNZFNIVIcjs = require('./chunk-MNZFNIVI.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
var _chunkUEULFXUIcjs = require('./chunk-UEULFXUI.cjs');
|
|
@@ -35,7 +35,7 @@ var _chunkUEULFXUIcjs = require('./chunk-UEULFXUI.cjs');
|
|
|
35
35
|
|
|
36
36
|
|
|
37
37
|
|
|
38
|
-
var
|
|
38
|
+
var _chunk2SGPZEAJcjs = require('./chunk-2SGPZEAJ.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
|
+
_chunkMNZFNIVIcjs.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
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
2138
2138
|
msg: "failed to fetch actor details for scheduling error check",
|
|
2139
2139
|
actorId,
|
|
2140
|
-
error:
|
|
2140
|
+
error: _chunk2SGPZEAJcjs.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
|
+
_chunkMNZFNIVIcjs.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
|
+
_chunk2SGPZEAJcjs.assertUnreachable.call(void 0, message);
|
|
2373
2373
|
}
|
|
2374
2374
|
async function sendHttpRequest(opts) {
|
|
2375
2375
|
var _a, _b, _c;
|
|
2376
|
-
|
|
2376
|
+
_chunkMNZFNIVIcjs.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 = _chunk2SGPZEAJcjs.contentTypeForEncoding.call(void 0, opts.encoding);
|
|
2386
|
+
bodyData = _chunk2SGPZEAJcjs.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": _chunk2SGPZEAJcjs.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 = _chunk2SGPZEAJcjs.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 ? _chunk2SGPZEAJcjs.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
|
+
_chunkMNZFNIVIcjs.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 _chunk2SGPZEAJcjs.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: _chunk2SGPZEAJcjs.bufferToArrayBuffer.call(void 0,
|
|
2542
|
+
_chunk2SGPZEAJcjs.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: _chunk2SGPZEAJcjs.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
|
+
_chunkMNZFNIVIcjs.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 } = _chunk2SGPZEAJcjs.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
|
+
_chunkMNZFNIVIcjs.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 } = _chunk2SGPZEAJcjs.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
|
+
_chunkMNZFNIVIcjs.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
|
+
_chunkMNZFNIVIcjs.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: _chunk2SGPZEAJcjs.bufferToArrayBuffer.call(void 0,
|
|
2910
|
+
_chunk2SGPZEAJcjs.encodeCborCompat.call(void 0, args)
|
|
2911
2911
|
)
|
|
2912
2912
|
}),
|
|
2913
2913
|
responseFromJson: (json) => json.output,
|
|
2914
|
-
responseFromBare: (bare5) =>
|
|
2914
|
+
responseFromBare: (bare5) => _chunk2SGPZEAJcjs.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 } = _chunk2SGPZEAJcjs.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
|
+
_chunkMNZFNIVIcjs.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 } = _chunk2SGPZEAJcjs.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 _chunk2SGPZEAJcjs.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 ? _chunk2SGPZEAJcjs.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
|
+
_chunkMNZFNIVIcjs.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
|
+
_chunkMNZFNIVIcjs.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
|
+
_chunkMNZFNIVIcjs.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
|
+
_chunkMNZFNIVIcjs.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
|
+
_chunkMNZFNIVIcjs.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
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn({ msg: "client already disconnected" });
|
|
3501
3501
|
return;
|
|
3502
3502
|
}
|
|
3503
3503
|
this.#disposed = true;
|
|
3504
|
-
|
|
3504
|
+
_chunkMNZFNIVIcjs.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());
|
|
@@ -3668,8 +3668,8 @@ var ActorConnRaw = class {
|
|
|
3668
3668
|
if ("getForId" in actorResolutionState) {
|
|
3669
3669
|
this.#actorId = actorResolutionState.getForId.actorId;
|
|
3670
3670
|
}
|
|
3671
|
-
this.#readyPromise =
|
|
3672
|
-
(reason) =>
|
|
3671
|
+
this.#readyPromise = _chunk2SGPZEAJcjs.promiseWithResolvers.call(void 0,
|
|
3672
|
+
(reason) => _chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
3673
3673
|
msg: "unhandled ready promise rejection",
|
|
3674
3674
|
reason
|
|
3675
3675
|
})
|
|
@@ -3731,11 +3731,11 @@ var ActorConnRaw = class {
|
|
|
3731
3731
|
`Invalid action call: expected an options object { name, args }, got ${typeof opts}. Use conn.actionName(...args) for the shorthand API.`
|
|
3732
3732
|
);
|
|
3733
3733
|
}
|
|
3734
|
-
|
|
3734
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({ msg: "action", name: opts.name, args: opts.args });
|
|
3735
3735
|
const actionId = this.#actionIdCounter;
|
|
3736
3736
|
this.#actionIdCounter += 1;
|
|
3737
|
-
const { promise, resolve, reject } =
|
|
3738
|
-
(reason) =>
|
|
3737
|
+
const { promise, resolve, reject } = _chunk2SGPZEAJcjs.promiseWithResolvers.call(void 0,
|
|
3738
|
+
(reason) => _chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
3739
3739
|
msg: "unhandled action promise rejection",
|
|
3740
3740
|
reason
|
|
3741
3741
|
})
|
|
@@ -3745,7 +3745,7 @@ var ActorConnRaw = class {
|
|
|
3745
3745
|
resolve,
|
|
3746
3746
|
reject
|
|
3747
3747
|
});
|
|
3748
|
-
|
|
3748
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
3749
3749
|
msg: "added action to in-flight map",
|
|
3750
3750
|
actionId,
|
|
3751
3751
|
actionName: opts.name,
|
|
@@ -3785,9 +3785,9 @@ var ActorConnRaw = class {
|
|
|
3785
3785
|
try {
|
|
3786
3786
|
handler(status);
|
|
3787
3787
|
} catch (err) {
|
|
3788
|
-
|
|
3788
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
3789
3789
|
msg: "error in status change handler",
|
|
3790
|
-
error:
|
|
3790
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
3791
3791
|
});
|
|
3792
3792
|
}
|
|
3793
3793
|
}
|
|
@@ -3797,9 +3797,9 @@ var ActorConnRaw = class {
|
|
|
3797
3797
|
try {
|
|
3798
3798
|
handler();
|
|
3799
3799
|
} catch (err) {
|
|
3800
|
-
|
|
3800
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
3801
3801
|
msg: "error in open handler",
|
|
3802
|
-
error:
|
|
3802
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
3803
3803
|
});
|
|
3804
3804
|
}
|
|
3805
3805
|
}
|
|
@@ -3809,9 +3809,9 @@ var ActorConnRaw = class {
|
|
|
3809
3809
|
try {
|
|
3810
3810
|
handler();
|
|
3811
3811
|
} catch (err) {
|
|
3812
|
-
|
|
3812
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
3813
3813
|
msg: "error in close handler",
|
|
3814
|
-
error:
|
|
3814
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
3815
3815
|
});
|
|
3816
3816
|
}
|
|
3817
3817
|
}
|
|
@@ -3824,21 +3824,21 @@ var ActorConnRaw = class {
|
|
|
3824
3824
|
minTimeout: 250,
|
|
3825
3825
|
maxTimeout: 3e4,
|
|
3826
3826
|
onFailedAttempt: (error) => {
|
|
3827
|
-
|
|
3827
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
3828
3828
|
msg: "failed to reconnect",
|
|
3829
3829
|
attempt: error.attemptNumber,
|
|
3830
|
-
error:
|
|
3830
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, error)
|
|
3831
3831
|
});
|
|
3832
3832
|
},
|
|
3833
3833
|
// Cancel retry if aborted
|
|
3834
3834
|
signal: this.#abortController.signal
|
|
3835
3835
|
}).catch((err) => {
|
|
3836
3836
|
if (err instanceof _pretry.AbortError || err.name === "AbortError" || !this.#shouldRetryConnectionOpenError(err)) {
|
|
3837
|
-
|
|
3837
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).info({ msg: "connection retry aborted" });
|
|
3838
3838
|
} else {
|
|
3839
|
-
|
|
3839
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
3840
3840
|
msg: "unexpected error in connection retry",
|
|
3841
|
-
error:
|
|
3841
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
3842
3842
|
});
|
|
3843
3843
|
}
|
|
3844
3844
|
});
|
|
@@ -3847,8 +3847,8 @@ var ActorConnRaw = class {
|
|
|
3847
3847
|
try {
|
|
3848
3848
|
if (this.#onOpenPromise)
|
|
3849
3849
|
throw new Error("#onOpenPromise already defined");
|
|
3850
|
-
this.#onOpenPromise =
|
|
3851
|
-
(reason) =>
|
|
3850
|
+
this.#onOpenPromise = _chunk2SGPZEAJcjs.promiseWithResolvers.call(void 0,
|
|
3851
|
+
(reason) => _chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
3852
3852
|
msg: "unhandled open promise rejection",
|
|
3853
3853
|
reason
|
|
3854
3854
|
})
|
|
@@ -3862,15 +3862,15 @@ var ActorConnRaw = class {
|
|
|
3862
3862
|
const actorError = error instanceof _chunk4FC7TVS6cjs.RivetError ? error : new (0, _chunk4FC7TVS6cjs.RivetError)(
|
|
3863
3863
|
"client",
|
|
3864
3864
|
"connection_open_failed",
|
|
3865
|
-
`Failed to open connection: ${
|
|
3866
|
-
{ error:
|
|
3865
|
+
`Failed to open connection: ${_chunk2SGPZEAJcjs.stringifyError.call(void 0, error)}`,
|
|
3866
|
+
{ error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, error) }
|
|
3867
3867
|
);
|
|
3868
3868
|
this.#clearQueuedMessages();
|
|
3869
3869
|
this.#rejectPendingPromises(actorError, false);
|
|
3870
3870
|
this.#dispatchActorError(actorError);
|
|
3871
3871
|
this.#setConnStatus("idle");
|
|
3872
3872
|
throw new (0, _pretry.AbortError)(
|
|
3873
|
-
error instanceof Error ? error : new Error(
|
|
3873
|
+
error instanceof Error ? error : new Error(_chunk2SGPZEAJcjs.stringifyError.call(void 0, error))
|
|
3874
3874
|
);
|
|
3875
3875
|
} finally {
|
|
3876
3876
|
this.#onOpenPromise = void 0;
|
|
@@ -3890,7 +3890,7 @@ var ActorConnRaw = class {
|
|
|
3890
3890
|
}
|
|
3891
3891
|
#clearQueuedMessages() {
|
|
3892
3892
|
if (this.#messageQueue.length === 0) return;
|
|
3893
|
-
|
|
3893
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
3894
3894
|
msg: "clearing queued connection messages",
|
|
3895
3895
|
queueLength: this.#messageQueue.length
|
|
3896
3896
|
});
|
|
@@ -3903,7 +3903,7 @@ var ActorConnRaw = class {
|
|
|
3903
3903
|
try {
|
|
3904
3904
|
return await this.#getParams();
|
|
3905
3905
|
} catch (err) {
|
|
3906
|
-
const errorMessage =
|
|
3906
|
+
const errorMessage = _chunk2SGPZEAJcjs.stringifyError.call(void 0, err);
|
|
3907
3907
|
const error = new (0, _chunk4FC7TVS6cjs.RivetError)(
|
|
3908
3908
|
"client",
|
|
3909
3909
|
"get_params_failed",
|
|
@@ -3927,7 +3927,7 @@ var ActorConnRaw = class {
|
|
|
3927
3927
|
this.#gatewayOptions
|
|
3928
3928
|
);
|
|
3929
3929
|
_invariant2.default.call(void 0, ws, "websocket should have been created");
|
|
3930
|
-
|
|
3930
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
3931
3931
|
msg: "opened websocket",
|
|
3932
3932
|
connId: this.#connId,
|
|
3933
3933
|
readyState: ws.readyState,
|
|
@@ -3935,7 +3935,7 @@ var ActorConnRaw = class {
|
|
|
3935
3935
|
});
|
|
3936
3936
|
this.#websocket = ws;
|
|
3937
3937
|
ws.addEventListener("open", () => {
|
|
3938
|
-
|
|
3938
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
3939
3939
|
msg: "client websocket open",
|
|
3940
3940
|
connId: this.#connId
|
|
3941
3941
|
});
|
|
@@ -3944,9 +3944,9 @@ var ActorConnRaw = class {
|
|
|
3944
3944
|
try {
|
|
3945
3945
|
await this.#handleOnMessage(ev.data);
|
|
3946
3946
|
} catch (err) {
|
|
3947
|
-
|
|
3947
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
3948
3948
|
msg: "error in websocket message handler",
|
|
3949
|
-
error:
|
|
3949
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
3950
3950
|
});
|
|
3951
3951
|
}
|
|
3952
3952
|
});
|
|
@@ -3954,9 +3954,9 @@ var ActorConnRaw = class {
|
|
|
3954
3954
|
try {
|
|
3955
3955
|
await this.#handleOnClose(ev);
|
|
3956
3956
|
} catch (err) {
|
|
3957
|
-
|
|
3957
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
3958
3958
|
msg: "error in websocket close handler",
|
|
3959
|
-
error:
|
|
3959
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
3960
3960
|
});
|
|
3961
3961
|
}
|
|
3962
3962
|
});
|
|
@@ -3964,9 +3964,9 @@ var ActorConnRaw = class {
|
|
|
3964
3964
|
try {
|
|
3965
3965
|
this.#handleOnError();
|
|
3966
3966
|
} catch (err) {
|
|
3967
|
-
|
|
3967
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
3968
3968
|
msg: "error in websocket error handler",
|
|
3969
|
-
error:
|
|
3969
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
3970
3970
|
});
|
|
3971
3971
|
}
|
|
3972
3972
|
});
|
|
@@ -3974,7 +3974,7 @@ var ActorConnRaw = class {
|
|
|
3974
3974
|
/** Called by the onopen event from drivers. */
|
|
3975
3975
|
#handleOnOpen() {
|
|
3976
3976
|
if (this.#disposed) {
|
|
3977
|
-
|
|
3977
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
3978
3978
|
msg: "handleOnOpen called after dispose, closing websocket"
|
|
3979
3979
|
});
|
|
3980
3980
|
if (this.#websocket) {
|
|
@@ -3990,7 +3990,7 @@ var ActorConnRaw = class {
|
|
|
3990
3990
|
queueMicrotask(() => {
|
|
3991
3991
|
this.#openScheduled = false;
|
|
3992
3992
|
if (this.#disposed) {
|
|
3993
|
-
|
|
3993
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
3994
3994
|
msg: "handleOnOpen scheduled after dispose, closing websocket"
|
|
3995
3995
|
});
|
|
3996
3996
|
if (this.#websocket) {
|
|
@@ -3999,7 +3999,7 @@ var ActorConnRaw = class {
|
|
|
3999
3999
|
}
|
|
4000
4000
|
return;
|
|
4001
4001
|
}
|
|
4002
|
-
|
|
4002
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4003
4003
|
msg: "socket open",
|
|
4004
4004
|
messageQueueLength: this.#messageQueue.length,
|
|
4005
4005
|
connId: this.#connId
|
|
@@ -4008,14 +4008,14 @@ var ActorConnRaw = class {
|
|
|
4008
4008
|
if (this.#onOpenPromise) {
|
|
4009
4009
|
this.#onOpenPromise.resolve(void 0);
|
|
4010
4010
|
} else {
|
|
4011
|
-
|
|
4011
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn({ msg: "#onOpenPromise is undefined" });
|
|
4012
4012
|
}
|
|
4013
4013
|
for (const eventName of this.#eventSubscriptions.keys()) {
|
|
4014
4014
|
this.#sendSubscription(eventName, true);
|
|
4015
4015
|
}
|
|
4016
4016
|
const queue = this.#messageQueue;
|
|
4017
4017
|
this.#messageQueue = [];
|
|
4018
|
-
|
|
4018
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4019
4019
|
msg: "flushing message queue",
|
|
4020
4020
|
queueLength: queue.length
|
|
4021
4021
|
});
|
|
@@ -4027,23 +4027,23 @@ var ActorConnRaw = class {
|
|
|
4027
4027
|
/** Called by the onmessage event from drivers. */
|
|
4028
4028
|
async #handleOnMessage(data) {
|
|
4029
4029
|
var _a;
|
|
4030
|
-
|
|
4030
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).trace({
|
|
4031
4031
|
msg: "received message",
|
|
4032
4032
|
dataType: typeof data,
|
|
4033
4033
|
isBlob: data instanceof Blob,
|
|
4034
4034
|
isArrayBuffer: data instanceof ArrayBuffer
|
|
4035
4035
|
});
|
|
4036
4036
|
const response = await this.#parseMessage(data);
|
|
4037
|
-
|
|
4038
|
-
|
|
4037
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).trace(
|
|
4038
|
+
_chunk2SGPZEAJcjs.getLogMessage.call(void 0, ) ? {
|
|
4039
4039
|
msg: "parsed message",
|
|
4040
|
-
message:
|
|
4040
|
+
message: _chunk2SGPZEAJcjs.jsonStringifyCompat.call(void 0, response).substring(0, 100) + "..."
|
|
4041
4041
|
} : { msg: "parsed message" }
|
|
4042
4042
|
);
|
|
4043
4043
|
if (response.body.tag === "Init") {
|
|
4044
4044
|
this.#actorId = response.body.val.actorId;
|
|
4045
4045
|
this.#connId = response.body.val.connectionId;
|
|
4046
|
-
|
|
4046
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).trace({
|
|
4047
4047
|
msg: "received init message",
|
|
4048
4048
|
actorId: this.#actorId,
|
|
4049
4049
|
connId: this.#connId
|
|
@@ -4054,7 +4054,7 @@ var ActorConnRaw = class {
|
|
|
4054
4054
|
if (actionId !== null) {
|
|
4055
4055
|
const inFlight = this.#takeActionInFlight(Number(actionId));
|
|
4056
4056
|
this.#invalidateActorIfStale(group, code);
|
|
4057
|
-
|
|
4057
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
4058
4058
|
msg: "action error",
|
|
4059
4059
|
actionId,
|
|
4060
4060
|
actionName: inFlight == null ? void 0 : inFlight.name,
|
|
@@ -4073,7 +4073,7 @@ var ActorConnRaw = class {
|
|
|
4073
4073
|
})
|
|
4074
4074
|
);
|
|
4075
4075
|
} else {
|
|
4076
|
-
|
|
4076
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
4077
4077
|
msg: "connection error",
|
|
4078
4078
|
group,
|
|
4079
4079
|
code,
|
|
@@ -4121,27 +4121,27 @@ var ActorConnRaw = class {
|
|
|
4121
4121
|
}
|
|
4122
4122
|
} else if (response.body.tag === "ActionResponse") {
|
|
4123
4123
|
const { id: actionId } = response.body.val;
|
|
4124
|
-
|
|
4124
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4125
4125
|
msg: "received action response",
|
|
4126
4126
|
actionId: Number(actionId),
|
|
4127
4127
|
inFlightCount: this.#actionsInFlight.size,
|
|
4128
4128
|
inFlightIds: Array.from(this.#actionsInFlight.keys())
|
|
4129
4129
|
});
|
|
4130
4130
|
const inFlight = this.#takeActionInFlight(Number(actionId));
|
|
4131
|
-
|
|
4131
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).trace({
|
|
4132
4132
|
msg: "resolving action promise",
|
|
4133
4133
|
actionId,
|
|
4134
4134
|
actionName: inFlight == null ? void 0 : inFlight.name
|
|
4135
4135
|
});
|
|
4136
4136
|
inFlight.resolve(response.body.val);
|
|
4137
4137
|
} else if (response.body.tag === "Event") {
|
|
4138
|
-
|
|
4138
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).trace({
|
|
4139
4139
|
msg: "received event",
|
|
4140
4140
|
name: response.body.val.name
|
|
4141
4141
|
});
|
|
4142
4142
|
this.#dispatchEvent(response.body.val);
|
|
4143
4143
|
} else {
|
|
4144
|
-
|
|
4144
|
+
_chunk2SGPZEAJcjs.assertUnreachable.call(void 0, response.body);
|
|
4145
4145
|
}
|
|
4146
4146
|
}
|
|
4147
4147
|
/** Called by the onclose event from drivers. */
|
|
@@ -4150,7 +4150,7 @@ var ActorConnRaw = class {
|
|
|
4150
4150
|
const closeEvent = event;
|
|
4151
4151
|
const wasClean = closeEvent.wasClean;
|
|
4152
4152
|
const wasConnected = this.#connStatus === "connected";
|
|
4153
|
-
|
|
4153
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).info({
|
|
4154
4154
|
msg: "socket closed",
|
|
4155
4155
|
code: closeEvent.code,
|
|
4156
4156
|
reason: closeEvent.reason,
|
|
@@ -4217,7 +4217,7 @@ var ActorConnRaw = class {
|
|
|
4217
4217
|
this.#dispatchActorError(error);
|
|
4218
4218
|
}
|
|
4219
4219
|
if (wasConnected) {
|
|
4220
|
-
|
|
4220
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4221
4221
|
msg: "triggering reconnect",
|
|
4222
4222
|
connId: this.#connId
|
|
4223
4223
|
});
|
|
@@ -4241,12 +4241,12 @@ var ActorConnRaw = class {
|
|
|
4241
4241
|
/** Called by the onerror event from drivers. */
|
|
4242
4242
|
#handleOnError() {
|
|
4243
4243
|
if (this.#disposed) return;
|
|
4244
|
-
|
|
4244
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn("socket error");
|
|
4245
4245
|
}
|
|
4246
4246
|
#takeActionInFlight(id) {
|
|
4247
4247
|
const inFlight = this.#actionsInFlight.get(id);
|
|
4248
4248
|
if (!inFlight) {
|
|
4249
|
-
|
|
4249
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
4250
4250
|
msg: "action not found in in-flight map",
|
|
4251
4251
|
lookupId: id,
|
|
4252
4252
|
inFlightCount: this.#actionsInFlight.size,
|
|
@@ -4261,7 +4261,7 @@ var ActorConnRaw = class {
|
|
|
4261
4261
|
throw internalClientError(`No in flight response for ${id}`);
|
|
4262
4262
|
}
|
|
4263
4263
|
this.#actionsInFlight.delete(id);
|
|
4264
|
-
|
|
4264
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4265
4265
|
msg: "removed action from in-flight map",
|
|
4266
4266
|
actionId: id,
|
|
4267
4267
|
actionName: inFlight.name,
|
|
@@ -4288,9 +4288,9 @@ var ActorConnRaw = class {
|
|
|
4288
4288
|
try {
|
|
4289
4289
|
handler(error);
|
|
4290
4290
|
} catch (err) {
|
|
4291
|
-
|
|
4291
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
4292
4292
|
msg: "error in connection error handler",
|
|
4293
|
-
error:
|
|
4293
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
4294
4294
|
});
|
|
4295
4295
|
}
|
|
4296
4296
|
}
|
|
@@ -4395,9 +4395,9 @@ var ActorConnRaw = class {
|
|
|
4395
4395
|
try {
|
|
4396
4396
|
callback();
|
|
4397
4397
|
} catch (err) {
|
|
4398
|
-
|
|
4398
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).error({
|
|
4399
4399
|
msg: "error in open handler",
|
|
4400
|
-
error:
|
|
4400
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, err)
|
|
4401
4401
|
});
|
|
4402
4402
|
}
|
|
4403
4403
|
});
|
|
@@ -4447,7 +4447,7 @@ var ActorConnRaw = class {
|
|
|
4447
4447
|
let queueMessage = false;
|
|
4448
4448
|
if (this.#websocket) {
|
|
4449
4449
|
const readyState = this.#websocket.readyState;
|
|
4450
|
-
|
|
4450
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4451
4451
|
msg: "websocket send attempt",
|
|
4452
4452
|
readyState,
|
|
4453
4453
|
readyStateString: readyState === 0 ? "CONNECTING" : readyState === 1 ? "OPEN" : readyState === 2 ? "CLOSING" : "CLOSED",
|
|
@@ -4456,7 +4456,7 @@ var ActorConnRaw = class {
|
|
|
4456
4456
|
actionName: (_a = message.body.val) == null ? void 0 : _a.name
|
|
4457
4457
|
});
|
|
4458
4458
|
if (this.#connStatus !== "connected") {
|
|
4459
|
-
|
|
4459
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4460
4460
|
msg: "websocket init pending, queueing message",
|
|
4461
4461
|
connStatus: this.#connStatus,
|
|
4462
4462
|
messageType: message.body.tag
|
|
@@ -4464,7 +4464,7 @@ var ActorConnRaw = class {
|
|
|
4464
4464
|
queueMessage = true;
|
|
4465
4465
|
} else if (readyState === 1) {
|
|
4466
4466
|
try {
|
|
4467
|
-
const messageSerialized =
|
|
4467
|
+
const messageSerialized = _chunk2SGPZEAJcjs.serializeWithEncoding.call(void 0,
|
|
4468
4468
|
this.#encoding,
|
|
4469
4469
|
message,
|
|
4470
4470
|
CLIENT_PROTOCOL_TO_SERVER,
|
|
@@ -4481,8 +4481,8 @@ var ActorConnRaw = class {
|
|
|
4481
4481
|
val: {
|
|
4482
4482
|
id: msg.body.val.id,
|
|
4483
4483
|
name: msg.body.val.name,
|
|
4484
|
-
args:
|
|
4485
|
-
|
|
4484
|
+
args: _chunk2SGPZEAJcjs.bufferToArrayBuffer.call(void 0,
|
|
4485
|
+
_chunk2SGPZEAJcjs.encodeCborCompat.call(void 0,
|
|
4486
4486
|
msg.body.val.args
|
|
4487
4487
|
)
|
|
4488
4488
|
)
|
|
@@ -4496,12 +4496,12 @@ var ActorConnRaw = class {
|
|
|
4496
4496
|
);
|
|
4497
4497
|
this.#websocket.send(messageSerialized);
|
|
4498
4498
|
const serializedLength = messageLength(messageSerialized);
|
|
4499
|
-
|
|
4499
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).trace({
|
|
4500
4500
|
msg: "sent websocket message",
|
|
4501
4501
|
len: serializedLength
|
|
4502
4502
|
});
|
|
4503
4503
|
} catch (error) {
|
|
4504
|
-
|
|
4504
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
4505
4505
|
msg: "failed to send message, added to queue",
|
|
4506
4506
|
error,
|
|
4507
4507
|
connId: this.#connId
|
|
@@ -4509,19 +4509,19 @@ var ActorConnRaw = class {
|
|
|
4509
4509
|
queueMessage = true;
|
|
4510
4510
|
}
|
|
4511
4511
|
} else {
|
|
4512
|
-
|
|
4512
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4513
4513
|
msg: "websocket not open, queueing message",
|
|
4514
4514
|
readyState
|
|
4515
4515
|
});
|
|
4516
4516
|
queueMessage = true;
|
|
4517
4517
|
}
|
|
4518
4518
|
} else {
|
|
4519
|
-
|
|
4519
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({ msg: "no websocket, queueing message" });
|
|
4520
4520
|
queueMessage = true;
|
|
4521
4521
|
}
|
|
4522
4522
|
if (!(opts == null ? void 0 : opts.ephemeral) && queueMessage) {
|
|
4523
4523
|
this.#messageQueue.push(message);
|
|
4524
|
-
|
|
4524
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({
|
|
4525
4525
|
msg: "queued connection message",
|
|
4526
4526
|
queueLength: this.#messageQueue.length,
|
|
4527
4527
|
connId: this.#connId,
|
|
@@ -4532,8 +4532,8 @@ var ActorConnRaw = class {
|
|
|
4532
4532
|
}
|
|
4533
4533
|
async #parseMessage(data) {
|
|
4534
4534
|
_invariant2.default.call(void 0, this.#websocket, "websocket must be defined");
|
|
4535
|
-
const buffer = await
|
|
4536
|
-
return
|
|
4535
|
+
const buffer = await _chunk2SGPZEAJcjs.inputDataToBuffer.call(void 0, data);
|
|
4536
|
+
return _chunk2SGPZEAJcjs.deserializeWithEncoding.call(void 0,
|
|
4537
4537
|
this.#encoding,
|
|
4538
4538
|
buffer,
|
|
4539
4539
|
CLIENT_PROTOCOL_TO_CLIENT,
|
|
@@ -4568,7 +4568,7 @@ var ActorConnRaw = class {
|
|
|
4568
4568
|
group: msg.body.val.group,
|
|
4569
4569
|
code: msg.body.val.code,
|
|
4570
4570
|
message: msg.body.val.message,
|
|
4571
|
-
metadata: msg.body.val.metadata ?
|
|
4571
|
+
metadata: msg.body.val.metadata ? _chunk2SGPZEAJcjs.decodeCborCompat.call(void 0,
|
|
4572
4572
|
new Uint8Array(
|
|
4573
4573
|
msg.body.val.metadata
|
|
4574
4574
|
)
|
|
@@ -4590,7 +4590,7 @@ var ActorConnRaw = class {
|
|
|
4590
4590
|
tag: "ActionResponse",
|
|
4591
4591
|
val: {
|
|
4592
4592
|
id: msg.body.val.id,
|
|
4593
|
-
output:
|
|
4593
|
+
output: _chunk2SGPZEAJcjs.decodeCborCompat.call(void 0,
|
|
4594
4594
|
new Uint8Array(msg.body.val.output)
|
|
4595
4595
|
)
|
|
4596
4596
|
}
|
|
@@ -4602,7 +4602,7 @@ var ActorConnRaw = class {
|
|
|
4602
4602
|
tag: "Event",
|
|
4603
4603
|
val: {
|
|
4604
4604
|
name: msg.body.val.name,
|
|
4605
|
-
args:
|
|
4605
|
+
args: _chunk2SGPZEAJcjs.decodeCborCompat.call(void 0,
|
|
4606
4606
|
new Uint8Array(msg.body.val.args)
|
|
4607
4607
|
)
|
|
4608
4608
|
}
|
|
@@ -4643,11 +4643,11 @@ var ActorConnRaw = class {
|
|
|
4643
4643
|
*/
|
|
4644
4644
|
async dispose() {
|
|
4645
4645
|
if (this.#disposed) {
|
|
4646
|
-
|
|
4646
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).warn({ msg: "connection already disconnected" });
|
|
4647
4647
|
return;
|
|
4648
4648
|
}
|
|
4649
4649
|
this.#disposed = true;
|
|
4650
|
-
|
|
4650
|
+
_chunkMNZFNIVIcjs.logger.call(void 0, ).debug({ msg: "disposing actor conn" });
|
|
4651
4651
|
this.#setConnStatus("idle");
|
|
4652
4652
|
clearInterval(this.#keepNodeAliveInterval);
|
|
4653
4653
|
this.#abortController.abort();
|
|
@@ -4655,8 +4655,8 @@ var ActorConnRaw = class {
|
|
|
4655
4655
|
if (this.#websocket) {
|
|
4656
4656
|
const ws = this.#websocket;
|
|
4657
4657
|
if (ws.readyState !== 2 && ws.readyState !== 3) {
|
|
4658
|
-
const { promise, resolve } =
|
|
4659
|
-
(reason) =>
|
|
4658
|
+
const { promise, resolve } = _chunk2SGPZEAJcjs.promiseWithResolvers.call(void 0,
|
|
4659
|
+
(reason) => _chunkMNZFNIVIcjs.logger.call(void 0, ).warn({
|
|
4660
4660
|
msg: "unhandled websocket close promise rejection",
|
|
4661
4661
|
reason
|
|
4662
4662
|
})
|
|
@@ -4775,7 +4775,7 @@ var ClientConfigSchemaBase = _v42.default.object({
|
|
|
4775
4775
|
* Defaults to http://localhost:6420.
|
|
4776
4776
|
*/
|
|
4777
4777
|
endpoint: _v42.default.string().optional().transform((val) => {
|
|
4778
|
-
const resolved = _nullishCoalesce(_nullishCoalesce(val, () => (
|
|
4778
|
+
const resolved = _nullishCoalesce(_nullishCoalesce(val, () => ( _chunk2SGPZEAJcjs.getRivetEngine.call(void 0, ))), () => ( _chunk2SGPZEAJcjs.getRivetEndpoint.call(void 0, )));
|
|
4779
4779
|
if (!resolved && !hasWarnedMissingEndpoint) {
|
|
4780
4780
|
hasWarnedMissingEndpoint = true;
|
|
4781
4781
|
console.warn(
|
|
@@ -4785,12 +4785,12 @@ var ClientConfigSchemaBase = _v42.default.object({
|
|
|
4785
4785
|
return _nullishCoalesce(resolved, () => ( DEFAULT_ENDPOINT));
|
|
4786
4786
|
}),
|
|
4787
4787
|
/** Token to use to authenticate with the API. */
|
|
4788
|
-
token: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
4788
|
+
token: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2SGPZEAJcjs.getRivetToken.call(void 0, )))),
|
|
4789
4789
|
/** Namespace to connect to. */
|
|
4790
|
-
namespace: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => (
|
|
4790
|
+
namespace: _v42.default.string().optional().transform((val) => _nullishCoalesce(val, () => ( _chunk2SGPZEAJcjs.getRivetNamespace.call(void 0, )))),
|
|
4791
4791
|
/** Name of the envoy pool. This is used to group together envoys in to different pools. */
|
|
4792
|
-
poolName: _v42.default.string().default(() => _nullishCoalesce(
|
|
4793
|
-
encoding:
|
|
4792
|
+
poolName: _v42.default.string().default(() => _nullishCoalesce(_chunk2SGPZEAJcjs.getRivetPool.call(void 0, ), () => ( "default"))),
|
|
4793
|
+
encoding: _chunk2SGPZEAJcjs.EncodingSchema.default("bare"),
|
|
4794
4794
|
headers: _v42.default.record(_v42.default.string(), _v42.default.string()).optional().default(() => ({})),
|
|
4795
4795
|
gateway: _v42.default.object({
|
|
4796
4796
|
skipReadyWait: _v42.default.boolean().optional().default(false)
|
|
@@ -4949,7 +4949,7 @@ function setRemoteHibernatableWebSocketAckTestHooks(websocket, token, enabled) {
|
|
|
4949
4949
|
|
|
4950
4950
|
// src/engine-client/log.ts
|
|
4951
4951
|
function logger2() {
|
|
4952
|
-
return
|
|
4952
|
+
return _chunk2SGPZEAJcjs.getLogger.call(void 0, "engine-client");
|
|
4953
4953
|
}
|
|
4954
4954
|
|
|
4955
4955
|
// src/engine-client/actor-websocket-client.ts
|
|
@@ -5082,7 +5082,7 @@ var BufferedRemoteWebSocket = (_class2 = class {
|
|
|
5082
5082
|
function buildActorGatewayUrl(endpoint, actorId, token, path = "") {
|
|
5083
5083
|
const tokenSegment = token !== void 0 ? `@${encodeURIComponent(token)}` : "";
|
|
5084
5084
|
const gatewayPath = `/gateway/${encodeURIComponent(actorId)}${tokenSegment}${path}`;
|
|
5085
|
-
return
|
|
5085
|
+
return _chunk2SGPZEAJcjs.combineUrlPath.call(void 0, endpoint, gatewayPath);
|
|
5086
5086
|
}
|
|
5087
5087
|
function buildActorQueryGatewayUrl(endpoint, namespace, query, token, path = "", maxInputSize = DEFAULT_MAX_QUERY_INPUT_SIZE, crashPolicy = void 0, runnerName, options = {}) {
|
|
5088
5088
|
if (namespace.length === 0) {
|
|
@@ -5148,7 +5148,7 @@ function buildActorQueryGatewayUrl(endpoint, namespace, query, token, path = "",
|
|
|
5148
5148
|
separator = "?";
|
|
5149
5149
|
}
|
|
5150
5150
|
const gatewayPath = `/gateway/${encodeURIComponent(name)}${path}${separator}${queryString}`;
|
|
5151
|
-
return
|
|
5151
|
+
return _chunk2SGPZEAJcjs.combineUrlPath.call(void 0, endpoint, gatewayPath);
|
|
5152
5152
|
}
|
|
5153
5153
|
function pushKeyQueryParams(params, key) {
|
|
5154
5154
|
if (key.length > 0) {
|
|
@@ -5159,7 +5159,7 @@ function pushInputQueryParam(params, input, maxInputSize) {
|
|
|
5159
5159
|
if (input === void 0) {
|
|
5160
5160
|
return;
|
|
5161
5161
|
}
|
|
5162
|
-
const encodedInput =
|
|
5162
|
+
const encodedInput = _chunk2SGPZEAJcjs.encodeCborCompat.call(void 0, input);
|
|
5163
5163
|
if (encodedInput.byteLength > maxInputSize) {
|
|
5164
5164
|
throw new Error(
|
|
5165
5165
|
`Actor query input exceeds maxInputSize (${encodedInput.byteLength} > ${maxInputSize} bytes). Increase client maxInputSize to allow larger query payloads.`
|
|
@@ -5168,10 +5168,10 @@ function pushInputQueryParam(params, input, maxInputSize) {
|
|
|
5168
5168
|
params.append("rvt-input", uint8ArrayToBase64Url(encodedInput));
|
|
5169
5169
|
}
|
|
5170
5170
|
function uint8ArrayToBase64Url(value) {
|
|
5171
|
-
return
|
|
5171
|
+
return _chunk2SGPZEAJcjs.uint8ArrayToBase64.call(void 0, value).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
5172
5172
|
}
|
|
5173
5173
|
async function openWebSocketToGateway(runConfig, gatewayUrl, encoding, params, options = {}) {
|
|
5174
|
-
const WebSocket2 = await
|
|
5174
|
+
const WebSocket2 = await _chunkMNZFNIVIcjs.importWebSocket.call(void 0, );
|
|
5175
5175
|
const ackHookToken = typeof process !== "undefined" && process.env.VITEST ? crypto.randomUUID() : void 0;
|
|
5176
5176
|
logger2().debug({
|
|
5177
5177
|
msg: "opening websocket to actor via guard",
|
|
@@ -5238,7 +5238,7 @@ function getEndpoint(config) {
|
|
|
5238
5238
|
}
|
|
5239
5239
|
async function apiCall(config, method, path, body) {
|
|
5240
5240
|
const endpoint = getEndpoint(config);
|
|
5241
|
-
const url =
|
|
5241
|
+
const url = _chunk2SGPZEAJcjs.combineUrlPath.call(void 0, endpoint, path, {
|
|
5242
5242
|
namespace: config.namespace
|
|
5243
5243
|
});
|
|
5244
5244
|
logger2().debug({ msg: "making api call", method, url });
|
|
@@ -5363,7 +5363,7 @@ async function lookupMetadataCached(config) {
|
|
|
5363
5363
|
msg: "failed to fetch metadata, retrying",
|
|
5364
5364
|
endpoint,
|
|
5365
5365
|
attempt: error.attemptNumber,
|
|
5366
|
-
error:
|
|
5366
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, error)
|
|
5367
5367
|
});
|
|
5368
5368
|
}
|
|
5369
5369
|
}
|
|
@@ -5375,7 +5375,7 @@ async function lookupMetadataCached(config) {
|
|
|
5375
5375
|
|
|
5376
5376
|
// src/engine-client/ws-proxy.ts
|
|
5377
5377
|
async function createWebSocketProxy(_c, targetUrl, protocols) {
|
|
5378
|
-
const WebSocket2 = await
|
|
5378
|
+
const WebSocket2 = await _chunkMNZFNIVIcjs.importWebSocket.call(void 0, );
|
|
5379
5379
|
const state = {};
|
|
5380
5380
|
return {
|
|
5381
5381
|
onOpen: async (_event, clientWs) => {
|
|
@@ -5440,7 +5440,7 @@ async function createWebSocketProxy(_c, targetUrl, protocols) {
|
|
|
5440
5440
|
logger2().error({
|
|
5441
5441
|
msg: "target websocket error",
|
|
5442
5442
|
targetUrl,
|
|
5443
|
-
error:
|
|
5443
|
+
error: _chunk2SGPZEAJcjs.stringifyError.call(void 0, error)
|
|
5444
5444
|
});
|
|
5445
5445
|
closeWebSocketIfOpen(clientWs, 1011, "Target WebSocket error");
|
|
5446
5446
|
});
|
|
@@ -5519,7 +5519,7 @@ var RemoteEngineControlClient = class {
|
|
|
5519
5519
|
#config;
|
|
5520
5520
|
#metadataPromise;
|
|
5521
5521
|
constructor(runConfig) {
|
|
5522
|
-
if (
|
|
5522
|
+
if (_chunk2SGPZEAJcjs.getNextPhase.call(void 0, ) === "phase-production-build") {
|
|
5523
5523
|
logger2().info(
|
|
5524
5524
|
"detected next.js build phase, disabling health check"
|
|
5525
5525
|
);
|
|
@@ -5610,8 +5610,8 @@ var RemoteEngineControlClient = class {
|
|
|
5610
5610
|
name,
|
|
5611
5611
|
key: _chunkMYWZCDMLcjs.serializeActorKey.call(void 0, key),
|
|
5612
5612
|
runner_name_selector: this.#config.poolName,
|
|
5613
|
-
input: actorInput ?
|
|
5614
|
-
|
|
5613
|
+
input: actorInput ? _chunk2SGPZEAJcjs.uint8ArrayToBase64.call(void 0,
|
|
5614
|
+
_chunk2SGPZEAJcjs.encodeCborCompat.call(void 0, actorInput)
|
|
5615
5615
|
) : void 0,
|
|
5616
5616
|
crash_policy: _nullishCoalesce(crashPolicy, () => ( "sleep"))
|
|
5617
5617
|
});
|
|
@@ -5638,7 +5638,7 @@ var RemoteEngineControlClient = class {
|
|
|
5638
5638
|
name,
|
|
5639
5639
|
runner_name_selector: this.#config.poolName,
|
|
5640
5640
|
key: _chunkMYWZCDMLcjs.serializeActorKey.call(void 0, key),
|
|
5641
|
-
input: input ?
|
|
5641
|
+
input: input ? _chunk2SGPZEAJcjs.uint8ArrayToBase64.call(void 0, _chunk2SGPZEAJcjs.encodeCborCompat.call(void 0, input)) : void 0,
|
|
5642
5642
|
crash_policy: _nullishCoalesce(crashPolicy, () => ( "sleep"))
|
|
5643
5643
|
});
|
|
5644
5644
|
logger2().info({
|
|
@@ -5716,7 +5716,7 @@ var RemoteEngineControlClient = class {
|
|
|
5716
5716
|
const upgradeWebSocket = (_b = (_a = this.#config).getUpgradeWebSocket) == null ? void 0 : _b.call(_a);
|
|
5717
5717
|
_invariant2.default.call(void 0, upgradeWebSocket, "missing getUpgradeWebSocket");
|
|
5718
5718
|
const endpoint = getEndpoint(this.#config);
|
|
5719
|
-
const guardUrl =
|
|
5719
|
+
const guardUrl = _chunk2SGPZEAJcjs.combineUrlPath.call(void 0, endpoint, path);
|
|
5720
5720
|
const wsGuardUrl = guardUrl.replace("http://", "ws://");
|
|
5721
5721
|
logger2().debug({
|
|
5722
5722
|
msg: "forwarding websocket to actor via guard",
|
|
@@ -5735,7 +5735,7 @@ var RemoteEngineControlClient = class {
|
|
|
5735
5735
|
}
|
|
5736
5736
|
);
|
|
5737
5737
|
const args = await createWebSocketProxy(c, wsGuardUrl, protocols);
|
|
5738
|
-
return await upgradeWebSocket(() => args)(c,
|
|
5738
|
+
return await upgradeWebSocket(() => args)(c, _chunk2SGPZEAJcjs.noopNext.call(void 0, ));
|
|
5739
5739
|
}
|
|
5740
5740
|
displayInformation() {
|
|
5741
5741
|
return { properties: {} };
|
|
@@ -5746,7 +5746,7 @@ var RemoteEngineControlClient = class {
|
|
|
5746
5746
|
#buildGatewayUrlForTarget(target, path, options = {}) {
|
|
5747
5747
|
const endpoint = getEndpoint(this.#config);
|
|
5748
5748
|
if (shouldSkipReadyWait(options) && directActorIdFromTarget(target) && canUseDirectSkipReadyWaitPath(path)) {
|
|
5749
|
-
return
|
|
5749
|
+
return _chunk2SGPZEAJcjs.combineUrlPath.call(void 0, endpoint, path);
|
|
5750
5750
|
}
|
|
5751
5751
|
if ("directId" in target) {
|
|
5752
5752
|
return buildActorGatewayUrl(
|
|
@@ -5839,4 +5839,4 @@ function apiActorToOutput(actor) {
|
|
|
5839
5839
|
|
|
5840
5840
|
|
|
5841
5841
|
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.getDatacenters = getDatacenters; exports.updateRunnerConfig = updateRunnerConfig; exports.RemoteEngineControlClient = RemoteEngineControlClient;
|
|
5842
|
-
//# sourceMappingURL=chunk-
|
|
5842
|
+
//# sourceMappingURL=chunk-46AE7JOI.cjs.map
|