@rivetkit/supabase 2.3.21 → 2.3.23
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/mod.js +85 -53
- package/dist/mod.mjs +85 -53
- package/package.json +3 -3
package/dist/mod.js
CHANGED
|
@@ -335,7 +335,7 @@ __export(mod_exports, {
|
|
|
335
335
|
module.exports = __toCommonJS(mod_exports);
|
|
336
336
|
var wasmBindings = __toESM(require("@rivetkit/rivetkit-wasm"));
|
|
337
337
|
|
|
338
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
338
|
+
// ../rivetkit/dist/tsup/chunk-ZOVJDAOW.js
|
|
339
339
|
var INTERNAL_ERROR_CODE = "internal_error";
|
|
340
340
|
var INTERNAL_ERROR_DESCRIPTION = "An internal error occurred";
|
|
341
341
|
var USER_ERROR_CODE = "user_error";
|
|
@@ -439,7 +439,7 @@ function toRivetError(error46, fallback) {
|
|
|
439
439
|
);
|
|
440
440
|
}
|
|
441
441
|
function encodeBridgeRivetError(error46) {
|
|
442
|
-
|
|
442
|
+
const payload = {
|
|
443
443
|
group: error46.group,
|
|
444
444
|
code: error46.code,
|
|
445
445
|
message: error46.message,
|
|
@@ -448,11 +448,21 @@ function encodeBridgeRivetError(error46) {
|
|
|
448
448
|
public: error46.public,
|
|
449
449
|
statusCode: error46.statusCode,
|
|
450
450
|
actor: error46.actor
|
|
451
|
-
}
|
|
451
|
+
};
|
|
452
|
+
try {
|
|
453
|
+
return {
|
|
454
|
+
encoded: `${BRIDGE_RIVET_ERROR_PREFIX}${JSON.stringify(payload)}`
|
|
455
|
+
};
|
|
456
|
+
} catch (cause) {
|
|
457
|
+
return {
|
|
458
|
+
encoded: `${BRIDGE_RIVET_ERROR_PREFIX}${JSON.stringify({ ...payload, metadata: void 0 })}`,
|
|
459
|
+
droppedMetadataCause: cause
|
|
460
|
+
};
|
|
461
|
+
}
|
|
452
462
|
}
|
|
453
463
|
function encodeErrorForBridge(error46) {
|
|
454
464
|
if (isCanonicalStructuredRivetError(error46)) {
|
|
455
|
-
return encodeBridgeRivetError(error46);
|
|
465
|
+
return encodeBridgeRivetError(error46).encoded;
|
|
456
466
|
}
|
|
457
467
|
return String(error46);
|
|
458
468
|
}
|
|
@@ -528,7 +538,7 @@ function unsupportedFeature(feature) {
|
|
|
528
538
|
);
|
|
529
539
|
}
|
|
530
540
|
|
|
531
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
541
|
+
// ../rivetkit/dist/tsup/chunk-674WU4L6.js
|
|
532
542
|
var import_pino = require("pino");
|
|
533
543
|
|
|
534
544
|
// ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/external.js
|
|
@@ -13201,7 +13211,7 @@ var classic_default = external_exports;
|
|
|
13201
13211
|
// ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/index.js
|
|
13202
13212
|
var v4_default = classic_default;
|
|
13203
13213
|
|
|
13204
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
13214
|
+
// ../rivetkit/dist/tsup/chunk-674WU4L6.js
|
|
13205
13215
|
var cbor = __toESM(require("cbor-x"), 1);
|
|
13206
13216
|
var import_invariant = __toESM(require_invariant(), 1);
|
|
13207
13217
|
var getRivetEngine = () => getEnvUniversal("RIVET_ENGINE");
|
|
@@ -13372,7 +13382,7 @@ function noopNext() {
|
|
|
13372
13382
|
}
|
|
13373
13383
|
var package_default = {
|
|
13374
13384
|
name: "rivetkit",
|
|
13375
|
-
version: "2.3.
|
|
13385
|
+
version: "2.3.23",
|
|
13376
13386
|
description: "Lightweight libraries for building stateful actors on edge platforms",
|
|
13377
13387
|
license: "Apache-2.0",
|
|
13378
13388
|
keywords: [
|
|
@@ -14679,7 +14689,7 @@ function Config({ initialBufferLength = 1024, maxBufferLength = 1024 * 1024 * 32
|
|
|
14679
14689
|
};
|
|
14680
14690
|
}
|
|
14681
14691
|
|
|
14682
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
14692
|
+
// ../rivetkit/dist/tsup/chunk-Z3Z5EOSP.js
|
|
14683
14693
|
var config2 = /* @__PURE__ */ Config({});
|
|
14684
14694
|
function readWorkflowCbor(bc) {
|
|
14685
14695
|
return readData(bc);
|
|
@@ -15589,44 +15599,6 @@ function removePrefixFromKey(prefixedKey) {
|
|
|
15589
15599
|
return prefixedKey.slice(KEYS.KV.length);
|
|
15590
15600
|
}
|
|
15591
15601
|
|
|
15592
|
-
// ../rivetkit/dist/tsup/chunk-2CI2IEVN.js
|
|
15593
|
-
function logger() {
|
|
15594
|
-
return getLogger("actor-client");
|
|
15595
|
-
}
|
|
15596
|
-
var webSocketPromise = null;
|
|
15597
|
-
async function importWebSocket() {
|
|
15598
|
-
if (webSocketPromise !== null) {
|
|
15599
|
-
return webSocketPromise;
|
|
15600
|
-
}
|
|
15601
|
-
webSocketPromise = (async () => {
|
|
15602
|
-
let _WebSocket;
|
|
15603
|
-
if (typeof WebSocket !== "undefined") {
|
|
15604
|
-
_WebSocket = WebSocket;
|
|
15605
|
-
} else {
|
|
15606
|
-
try {
|
|
15607
|
-
const moduleName = "ws";
|
|
15608
|
-
const ws = await import(
|
|
15609
|
-
/* webpackIgnore: true */
|
|
15610
|
-
moduleName
|
|
15611
|
-
);
|
|
15612
|
-
_WebSocket = ws.default;
|
|
15613
|
-
logger().debug("using websocket from npm");
|
|
15614
|
-
} catch {
|
|
15615
|
-
_WebSocket = class MockWebSocket {
|
|
15616
|
-
constructor() {
|
|
15617
|
-
throw new Error(
|
|
15618
|
-
'WebSocket support requires installing the "ws" peer dependency.'
|
|
15619
|
-
);
|
|
15620
|
-
}
|
|
15621
|
-
};
|
|
15622
|
-
logger().debug("using mock websocket");
|
|
15623
|
-
}
|
|
15624
|
-
}
|
|
15625
|
-
return _WebSocket;
|
|
15626
|
-
})();
|
|
15627
|
-
return webSocketPromise;
|
|
15628
|
-
}
|
|
15629
|
-
|
|
15630
15602
|
// ../rivetkit/dist/tsup/chunk-JTHHCZCZ.js
|
|
15631
15603
|
var MIGRATION_TRANSACTION_TIMEOUT_MS = 5 * 6e4;
|
|
15632
15604
|
function isManualTransactionControl(query) {
|
|
@@ -15710,7 +15682,45 @@ var AsyncMutex = class {
|
|
|
15710
15682
|
}
|
|
15711
15683
|
};
|
|
15712
15684
|
|
|
15713
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
15685
|
+
// ../rivetkit/dist/tsup/chunk-KC3T3MMB.js
|
|
15686
|
+
function logger() {
|
|
15687
|
+
return getLogger("actor-client");
|
|
15688
|
+
}
|
|
15689
|
+
var webSocketPromise = null;
|
|
15690
|
+
async function importWebSocket() {
|
|
15691
|
+
if (webSocketPromise !== null) {
|
|
15692
|
+
return webSocketPromise;
|
|
15693
|
+
}
|
|
15694
|
+
webSocketPromise = (async () => {
|
|
15695
|
+
let _WebSocket;
|
|
15696
|
+
if (typeof WebSocket !== "undefined") {
|
|
15697
|
+
_WebSocket = WebSocket;
|
|
15698
|
+
} else {
|
|
15699
|
+
try {
|
|
15700
|
+
const moduleName = "ws";
|
|
15701
|
+
const ws = await import(
|
|
15702
|
+
/* webpackIgnore: true */
|
|
15703
|
+
moduleName
|
|
15704
|
+
);
|
|
15705
|
+
_WebSocket = ws.default;
|
|
15706
|
+
logger().debug("using websocket from npm");
|
|
15707
|
+
} catch {
|
|
15708
|
+
_WebSocket = class MockWebSocket {
|
|
15709
|
+
constructor() {
|
|
15710
|
+
throw new Error(
|
|
15711
|
+
'WebSocket support requires installing the "ws" peer dependency.'
|
|
15712
|
+
);
|
|
15713
|
+
}
|
|
15714
|
+
};
|
|
15715
|
+
logger().debug("using mock websocket");
|
|
15716
|
+
}
|
|
15717
|
+
}
|
|
15718
|
+
return _WebSocket;
|
|
15719
|
+
})();
|
|
15720
|
+
return webSocketPromise;
|
|
15721
|
+
}
|
|
15722
|
+
|
|
15723
|
+
// ../rivetkit/dist/tsup/chunk-LKNGMRIT.js
|
|
15714
15724
|
var import_invariant2 = __toESM(require_invariant(), 1);
|
|
15715
15725
|
|
|
15716
15726
|
// ../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
@@ -16925,7 +16935,7 @@ var TraceAPI = (
|
|
|
16925
16935
|
// ../../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
16926
16936
|
var trace = TraceAPI.getInstance();
|
|
16927
16937
|
|
|
16928
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
16938
|
+
// ../rivetkit/dist/tsup/chunk-LKNGMRIT.js
|
|
16929
16939
|
var import_invariant3 = __toESM(require_invariant(), 1);
|
|
16930
16940
|
var import_invariant4 = __toESM(require_invariant(), 1);
|
|
16931
16941
|
var PATH_CONNECT = "/connect";
|
|
@@ -23102,7 +23112,7 @@ function apiActorToOutput(actor2) {
|
|
|
23102
23112
|
};
|
|
23103
23113
|
}
|
|
23104
23114
|
|
|
23105
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
23115
|
+
// ../rivetkit/dist/tsup/chunk-HO6UA2RJ.js
|
|
23106
23116
|
var nativeStateTransactionOpeners = /* @__PURE__ */ new WeakMap();
|
|
23107
23117
|
var nativeStateTransactionClientBinders = /* @__PURE__ */ new WeakMap();
|
|
23108
23118
|
function registerNativeStateTransactionOpener(provider, opener) {
|
|
@@ -28255,7 +28265,18 @@ function isStructuredBridgeError(error46) {
|
|
|
28255
28265
|
}
|
|
28256
28266
|
function encodeNativeCallbackError(error46) {
|
|
28257
28267
|
const structuredError = isStructuredBridgeError(error46) ? error46 : deconstructError(error46, true);
|
|
28258
|
-
const
|
|
28268
|
+
const { encoded, droppedMetadataCause } = encodeBridgeRivetError(structuredError);
|
|
28269
|
+
if (droppedMetadataCause !== void 0) {
|
|
28270
|
+
logger22().warn(
|
|
28271
|
+
{
|
|
28272
|
+
group: structuredError.group,
|
|
28273
|
+
code: structuredError.code,
|
|
28274
|
+
error: String(droppedMetadataCause)
|
|
28275
|
+
},
|
|
28276
|
+
"dropped error metadata that JSON cannot encode"
|
|
28277
|
+
);
|
|
28278
|
+
}
|
|
28279
|
+
const bridgeError = new Error(encoded, {
|
|
28259
28280
|
cause: error46 instanceof Error ? error46 : void 0
|
|
28260
28281
|
});
|
|
28261
28282
|
return Object.assign(bridgeError, {
|
|
@@ -29592,7 +29613,10 @@ var ActorContextHandleAdapter = class {
|
|
|
29592
29613
|
}
|
|
29593
29614
|
this.#request = request;
|
|
29594
29615
|
this[ACTOR_CONTEXT_INTERNAL_SYMBOL] = new NativeWorkflowRuntimeAdapter(
|
|
29595
|
-
this
|
|
29616
|
+
this,
|
|
29617
|
+
() => this.#logByInvocationScope.delete(
|
|
29618
|
+
this.#runtime.currentInvocationScope() ?? NO_INVOCATION_SCOPE
|
|
29619
|
+
)
|
|
29596
29620
|
);
|
|
29597
29621
|
}
|
|
29598
29622
|
get kv() {
|
|
@@ -29764,7 +29788,10 @@ var ActorContextHandleAdapter = class {
|
|
|
29764
29788
|
() => this.#runtime.actorInvocationTraceContext(this.#ctx)
|
|
29765
29789
|
);
|
|
29766
29790
|
}
|
|
29767
|
-
/**
|
|
29791
|
+
/**
|
|
29792
|
+
* Cached per invocation, because the `run` context outlives workflow runs and steps.
|
|
29793
|
+
* A workflow queue receive clears the entry, because the run's ray becomes the message's ray.
|
|
29794
|
+
*/
|
|
29768
29795
|
get log() {
|
|
29769
29796
|
const scope = this.#runtime.currentInvocationScope() ?? NO_INVOCATION_SCOPE;
|
|
29770
29797
|
const cached2 = this.#logByInvocationScope.get(scope);
|
|
@@ -30311,13 +30338,15 @@ var ActorContextHandleAdapter = class {
|
|
|
30311
30338
|
};
|
|
30312
30339
|
var NativeWorkflowRuntimeAdapter = class {
|
|
30313
30340
|
#ctx;
|
|
30341
|
+
#onMessagesReceived;
|
|
30314
30342
|
#completions = /* @__PURE__ */ new Map();
|
|
30315
30343
|
id;
|
|
30316
30344
|
driver;
|
|
30317
30345
|
queueManager;
|
|
30318
30346
|
stateManager;
|
|
30319
|
-
constructor(ctx) {
|
|
30347
|
+
constructor(ctx, onMessagesReceived) {
|
|
30320
30348
|
this.#ctx = ctx;
|
|
30349
|
+
this.#onMessagesReceived = onMessagesReceived;
|
|
30321
30350
|
this.id = ctx.actorId;
|
|
30322
30351
|
this.driver = {
|
|
30323
30352
|
kvBatchGet: async (actorId, keys) => {
|
|
@@ -30357,6 +30386,9 @@ var NativeWorkflowRuntimeAdapter = class {
|
|
|
30357
30386
|
timeout: timeout ?? 0,
|
|
30358
30387
|
completable
|
|
30359
30388
|
});
|
|
30389
|
+
if (messages.length > 0) {
|
|
30390
|
+
this.#onMessagesReceived();
|
|
30391
|
+
}
|
|
30360
30392
|
return messages.map(
|
|
30361
30393
|
(message) => this.#wrapQueueMessage(message)
|
|
30362
30394
|
);
|
package/dist/mod.mjs
CHANGED
|
@@ -297,7 +297,7 @@ var require_retry2 = __commonJS({
|
|
|
297
297
|
// src/mod.ts
|
|
298
298
|
import * as wasmBindings from "@rivetkit/rivetkit-wasm";
|
|
299
299
|
|
|
300
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
300
|
+
// ../rivetkit/dist/tsup/chunk-ZOVJDAOW.js
|
|
301
301
|
var INTERNAL_ERROR_CODE = "internal_error";
|
|
302
302
|
var INTERNAL_ERROR_DESCRIPTION = "An internal error occurred";
|
|
303
303
|
var USER_ERROR_CODE = "user_error";
|
|
@@ -401,7 +401,7 @@ function toRivetError(error46, fallback) {
|
|
|
401
401
|
);
|
|
402
402
|
}
|
|
403
403
|
function encodeBridgeRivetError(error46) {
|
|
404
|
-
|
|
404
|
+
const payload = {
|
|
405
405
|
group: error46.group,
|
|
406
406
|
code: error46.code,
|
|
407
407
|
message: error46.message,
|
|
@@ -410,11 +410,21 @@ function encodeBridgeRivetError(error46) {
|
|
|
410
410
|
public: error46.public,
|
|
411
411
|
statusCode: error46.statusCode,
|
|
412
412
|
actor: error46.actor
|
|
413
|
-
}
|
|
413
|
+
};
|
|
414
|
+
try {
|
|
415
|
+
return {
|
|
416
|
+
encoded: `${BRIDGE_RIVET_ERROR_PREFIX}${JSON.stringify(payload)}`
|
|
417
|
+
};
|
|
418
|
+
} catch (cause) {
|
|
419
|
+
return {
|
|
420
|
+
encoded: `${BRIDGE_RIVET_ERROR_PREFIX}${JSON.stringify({ ...payload, metadata: void 0 })}`,
|
|
421
|
+
droppedMetadataCause: cause
|
|
422
|
+
};
|
|
423
|
+
}
|
|
414
424
|
}
|
|
415
425
|
function encodeErrorForBridge(error46) {
|
|
416
426
|
if (isCanonicalStructuredRivetError(error46)) {
|
|
417
|
-
return encodeBridgeRivetError(error46);
|
|
427
|
+
return encodeBridgeRivetError(error46).encoded;
|
|
418
428
|
}
|
|
419
429
|
return String(error46);
|
|
420
430
|
}
|
|
@@ -490,7 +500,7 @@ function unsupportedFeature(feature) {
|
|
|
490
500
|
);
|
|
491
501
|
}
|
|
492
502
|
|
|
493
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
503
|
+
// ../rivetkit/dist/tsup/chunk-674WU4L6.js
|
|
494
504
|
import {
|
|
495
505
|
pino,
|
|
496
506
|
stdTimeFunctions
|
|
@@ -13166,7 +13176,7 @@ var classic_default = external_exports;
|
|
|
13166
13176
|
// ../../../node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/index.js
|
|
13167
13177
|
var v4_default = classic_default;
|
|
13168
13178
|
|
|
13169
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
13179
|
+
// ../rivetkit/dist/tsup/chunk-674WU4L6.js
|
|
13170
13180
|
var import_invariant = __toESM(require_invariant(), 1);
|
|
13171
13181
|
import * as cbor from "cbor-x";
|
|
13172
13182
|
var getRivetEngine = () => getEnvUniversal("RIVET_ENGINE");
|
|
@@ -13337,7 +13347,7 @@ function noopNext() {
|
|
|
13337
13347
|
}
|
|
13338
13348
|
var package_default = {
|
|
13339
13349
|
name: "rivetkit",
|
|
13340
|
-
version: "2.3.
|
|
13350
|
+
version: "2.3.23",
|
|
13341
13351
|
description: "Lightweight libraries for building stateful actors on edge platforms",
|
|
13342
13352
|
license: "Apache-2.0",
|
|
13343
13353
|
keywords: [
|
|
@@ -14644,7 +14654,7 @@ function Config({ initialBufferLength = 1024, maxBufferLength = 1024 * 1024 * 32
|
|
|
14644
14654
|
};
|
|
14645
14655
|
}
|
|
14646
14656
|
|
|
14647
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
14657
|
+
// ../rivetkit/dist/tsup/chunk-Z3Z5EOSP.js
|
|
14648
14658
|
var config2 = /* @__PURE__ */ Config({});
|
|
14649
14659
|
function readWorkflowCbor(bc) {
|
|
14650
14660
|
return readData(bc);
|
|
@@ -15554,44 +15564,6 @@ function removePrefixFromKey(prefixedKey) {
|
|
|
15554
15564
|
return prefixedKey.slice(KEYS.KV.length);
|
|
15555
15565
|
}
|
|
15556
15566
|
|
|
15557
|
-
// ../rivetkit/dist/tsup/chunk-2CI2IEVN.js
|
|
15558
|
-
function logger() {
|
|
15559
|
-
return getLogger("actor-client");
|
|
15560
|
-
}
|
|
15561
|
-
var webSocketPromise = null;
|
|
15562
|
-
async function importWebSocket() {
|
|
15563
|
-
if (webSocketPromise !== null) {
|
|
15564
|
-
return webSocketPromise;
|
|
15565
|
-
}
|
|
15566
|
-
webSocketPromise = (async () => {
|
|
15567
|
-
let _WebSocket;
|
|
15568
|
-
if (typeof WebSocket !== "undefined") {
|
|
15569
|
-
_WebSocket = WebSocket;
|
|
15570
|
-
} else {
|
|
15571
|
-
try {
|
|
15572
|
-
const moduleName = "ws";
|
|
15573
|
-
const ws = await import(
|
|
15574
|
-
/* webpackIgnore: true */
|
|
15575
|
-
moduleName
|
|
15576
|
-
);
|
|
15577
|
-
_WebSocket = ws.default;
|
|
15578
|
-
logger().debug("using websocket from npm");
|
|
15579
|
-
} catch {
|
|
15580
|
-
_WebSocket = class MockWebSocket {
|
|
15581
|
-
constructor() {
|
|
15582
|
-
throw new Error(
|
|
15583
|
-
'WebSocket support requires installing the "ws" peer dependency.'
|
|
15584
|
-
);
|
|
15585
|
-
}
|
|
15586
|
-
};
|
|
15587
|
-
logger().debug("using mock websocket");
|
|
15588
|
-
}
|
|
15589
|
-
}
|
|
15590
|
-
return _WebSocket;
|
|
15591
|
-
})();
|
|
15592
|
-
return webSocketPromise;
|
|
15593
|
-
}
|
|
15594
|
-
|
|
15595
15567
|
// ../rivetkit/dist/tsup/chunk-JTHHCZCZ.js
|
|
15596
15568
|
var MIGRATION_TRANSACTION_TIMEOUT_MS = 5 * 6e4;
|
|
15597
15569
|
function isManualTransactionControl(query) {
|
|
@@ -15675,7 +15647,45 @@ var AsyncMutex = class {
|
|
|
15675
15647
|
}
|
|
15676
15648
|
};
|
|
15677
15649
|
|
|
15678
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
15650
|
+
// ../rivetkit/dist/tsup/chunk-KC3T3MMB.js
|
|
15651
|
+
function logger() {
|
|
15652
|
+
return getLogger("actor-client");
|
|
15653
|
+
}
|
|
15654
|
+
var webSocketPromise = null;
|
|
15655
|
+
async function importWebSocket() {
|
|
15656
|
+
if (webSocketPromise !== null) {
|
|
15657
|
+
return webSocketPromise;
|
|
15658
|
+
}
|
|
15659
|
+
webSocketPromise = (async () => {
|
|
15660
|
+
let _WebSocket;
|
|
15661
|
+
if (typeof WebSocket !== "undefined") {
|
|
15662
|
+
_WebSocket = WebSocket;
|
|
15663
|
+
} else {
|
|
15664
|
+
try {
|
|
15665
|
+
const moduleName = "ws";
|
|
15666
|
+
const ws = await import(
|
|
15667
|
+
/* webpackIgnore: true */
|
|
15668
|
+
moduleName
|
|
15669
|
+
);
|
|
15670
|
+
_WebSocket = ws.default;
|
|
15671
|
+
logger().debug("using websocket from npm");
|
|
15672
|
+
} catch {
|
|
15673
|
+
_WebSocket = class MockWebSocket {
|
|
15674
|
+
constructor() {
|
|
15675
|
+
throw new Error(
|
|
15676
|
+
'WebSocket support requires installing the "ws" peer dependency.'
|
|
15677
|
+
);
|
|
15678
|
+
}
|
|
15679
|
+
};
|
|
15680
|
+
logger().debug("using mock websocket");
|
|
15681
|
+
}
|
|
15682
|
+
}
|
|
15683
|
+
return _WebSocket;
|
|
15684
|
+
})();
|
|
15685
|
+
return webSocketPromise;
|
|
15686
|
+
}
|
|
15687
|
+
|
|
15688
|
+
// ../rivetkit/dist/tsup/chunk-LKNGMRIT.js
|
|
15679
15689
|
var import_invariant2 = __toESM(require_invariant(), 1);
|
|
15680
15690
|
|
|
15681
15691
|
// ../../../node_modules/.pnpm/p-retry@6.2.1/node_modules/p-retry/index.js
|
|
@@ -16890,7 +16900,7 @@ var TraceAPI = (
|
|
|
16890
16900
|
// ../../../node_modules/.pnpm/@opentelemetry+api@1.9.0/node_modules/@opentelemetry/api/build/esm/trace-api.js
|
|
16891
16901
|
var trace = TraceAPI.getInstance();
|
|
16892
16902
|
|
|
16893
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
16903
|
+
// ../rivetkit/dist/tsup/chunk-LKNGMRIT.js
|
|
16894
16904
|
var import_invariant3 = __toESM(require_invariant(), 1);
|
|
16895
16905
|
var import_invariant4 = __toESM(require_invariant(), 1);
|
|
16896
16906
|
var PATH_CONNECT = "/connect";
|
|
@@ -23067,7 +23077,7 @@ function apiActorToOutput(actor2) {
|
|
|
23067
23077
|
};
|
|
23068
23078
|
}
|
|
23069
23079
|
|
|
23070
|
-
// ../rivetkit/dist/tsup/chunk-
|
|
23080
|
+
// ../rivetkit/dist/tsup/chunk-HO6UA2RJ.js
|
|
23071
23081
|
var nativeStateTransactionOpeners = /* @__PURE__ */ new WeakMap();
|
|
23072
23082
|
var nativeStateTransactionClientBinders = /* @__PURE__ */ new WeakMap();
|
|
23073
23083
|
function registerNativeStateTransactionOpener(provider, opener) {
|
|
@@ -28220,7 +28230,18 @@ function isStructuredBridgeError(error46) {
|
|
|
28220
28230
|
}
|
|
28221
28231
|
function encodeNativeCallbackError(error46) {
|
|
28222
28232
|
const structuredError = isStructuredBridgeError(error46) ? error46 : deconstructError(error46, true);
|
|
28223
|
-
const
|
|
28233
|
+
const { encoded, droppedMetadataCause } = encodeBridgeRivetError(structuredError);
|
|
28234
|
+
if (droppedMetadataCause !== void 0) {
|
|
28235
|
+
logger22().warn(
|
|
28236
|
+
{
|
|
28237
|
+
group: structuredError.group,
|
|
28238
|
+
code: structuredError.code,
|
|
28239
|
+
error: String(droppedMetadataCause)
|
|
28240
|
+
},
|
|
28241
|
+
"dropped error metadata that JSON cannot encode"
|
|
28242
|
+
);
|
|
28243
|
+
}
|
|
28244
|
+
const bridgeError = new Error(encoded, {
|
|
28224
28245
|
cause: error46 instanceof Error ? error46 : void 0
|
|
28225
28246
|
});
|
|
28226
28247
|
return Object.assign(bridgeError, {
|
|
@@ -29557,7 +29578,10 @@ var ActorContextHandleAdapter = class {
|
|
|
29557
29578
|
}
|
|
29558
29579
|
this.#request = request;
|
|
29559
29580
|
this[ACTOR_CONTEXT_INTERNAL_SYMBOL] = new NativeWorkflowRuntimeAdapter(
|
|
29560
|
-
this
|
|
29581
|
+
this,
|
|
29582
|
+
() => this.#logByInvocationScope.delete(
|
|
29583
|
+
this.#runtime.currentInvocationScope() ?? NO_INVOCATION_SCOPE
|
|
29584
|
+
)
|
|
29561
29585
|
);
|
|
29562
29586
|
}
|
|
29563
29587
|
get kv() {
|
|
@@ -29729,7 +29753,10 @@ var ActorContextHandleAdapter = class {
|
|
|
29729
29753
|
() => this.#runtime.actorInvocationTraceContext(this.#ctx)
|
|
29730
29754
|
);
|
|
29731
29755
|
}
|
|
29732
|
-
/**
|
|
29756
|
+
/**
|
|
29757
|
+
* Cached per invocation, because the `run` context outlives workflow runs and steps.
|
|
29758
|
+
* A workflow queue receive clears the entry, because the run's ray becomes the message's ray.
|
|
29759
|
+
*/
|
|
29733
29760
|
get log() {
|
|
29734
29761
|
const scope = this.#runtime.currentInvocationScope() ?? NO_INVOCATION_SCOPE;
|
|
29735
29762
|
const cached2 = this.#logByInvocationScope.get(scope);
|
|
@@ -30276,13 +30303,15 @@ var ActorContextHandleAdapter = class {
|
|
|
30276
30303
|
};
|
|
30277
30304
|
var NativeWorkflowRuntimeAdapter = class {
|
|
30278
30305
|
#ctx;
|
|
30306
|
+
#onMessagesReceived;
|
|
30279
30307
|
#completions = /* @__PURE__ */ new Map();
|
|
30280
30308
|
id;
|
|
30281
30309
|
driver;
|
|
30282
30310
|
queueManager;
|
|
30283
30311
|
stateManager;
|
|
30284
|
-
constructor(ctx) {
|
|
30312
|
+
constructor(ctx, onMessagesReceived) {
|
|
30285
30313
|
this.#ctx = ctx;
|
|
30314
|
+
this.#onMessagesReceived = onMessagesReceived;
|
|
30286
30315
|
this.id = ctx.actorId;
|
|
30287
30316
|
this.driver = {
|
|
30288
30317
|
kvBatchGet: async (actorId, keys) => {
|
|
@@ -30322,6 +30351,9 @@ var NativeWorkflowRuntimeAdapter = class {
|
|
|
30322
30351
|
timeout: timeout ?? 0,
|
|
30323
30352
|
completable
|
|
30324
30353
|
});
|
|
30354
|
+
if (messages.length > 0) {
|
|
30355
|
+
this.#onMessagesReceived();
|
|
30356
|
+
}
|
|
30325
30357
|
return messages.map(
|
|
30326
30358
|
(message) => this.#wrapQueueMessage(message)
|
|
30327
30359
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/supabase",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.23",
|
|
4
4
|
"description": "Supabase Edge Functions integration for RivetKit actors",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"check-edge-closure": "node ../../../scripts/ci/check-edge-native-closure.mjs"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@rivetkit/rivetkit-wasm": "2.3.
|
|
42
|
+
"@rivetkit/rivetkit-wasm": "2.3.23",
|
|
43
43
|
"cbor-x": "^1.6.0",
|
|
44
44
|
"pino": "^9.5.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@size-limit/file": "^11.1.6",
|
|
48
48
|
"@types/node": "^22.0.0",
|
|
49
|
-
"rivetkit": "2.3.
|
|
49
|
+
"rivetkit": "2.3.23",
|
|
50
50
|
"size-limit": "^11.1.6",
|
|
51
51
|
"tsup": "^8.4.0",
|
|
52
52
|
"typescript": "^5.5.2"
|