rivetkit 2.3.3 → 2.3.5-rc.1
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.d.ts +157 -9
- package/dist/browser/client.js +518 -542
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +101 -2
- package/dist/browser/inspector/client.js +1245 -227
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/agent-os/index.cjs +103 -36
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.d.cts +159 -11
- package/dist/tsup/agent-os/index.d.ts +159 -11
- package/dist/tsup/agent-os/index.js +103 -36
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/{chunk-34P567PO.cjs → chunk-4XKED5P5.cjs} +145 -176
- package/dist/tsup/chunk-4XKED5P5.cjs.map +1 -0
- package/dist/tsup/{chunk-PYO2U53V.cjs → chunk-6HQCLWAW.cjs} +384 -4
- package/dist/tsup/chunk-6HQCLWAW.cjs.map +1 -0
- package/dist/tsup/{chunk-JZ7TWV65.js → chunk-7AFZMFPQ.js} +15 -1
- package/dist/tsup/chunk-7AFZMFPQ.js.map +1 -0
- package/dist/tsup/{chunk-BLDO2FKO.js → chunk-B4IZU537.js} +382 -2
- package/dist/tsup/chunk-B4IZU537.js.map +1 -0
- package/dist/tsup/{chunk-3MHDOUD7.cjs → chunk-G3CCRCTK.cjs} +14 -9
- package/dist/tsup/chunk-G3CCRCTK.cjs.map +1 -0
- package/dist/tsup/{chunk-CXRPENO3.js → chunk-GAV4PKFT.js} +15 -46
- package/dist/tsup/{chunk-CXRPENO3.js.map → chunk-GAV4PKFT.js.map} +1 -1
- package/dist/tsup/{chunk-HXUEHHJF.js → chunk-JI6GZ2C2.js} +2 -11
- package/dist/tsup/{chunk-HXUEHHJF.js.map → chunk-JI6GZ2C2.js.map} +1 -1
- package/dist/tsup/{chunk-YUEC5SEY.cjs → chunk-M3FCXL3Q.cjs} +3 -3
- package/dist/tsup/{chunk-YUEC5SEY.cjs.map → chunk-M3FCXL3Q.cjs.map} +1 -1
- package/dist/tsup/{chunk-KEKWJECX.js → chunk-MGTSVSUC.js} +2 -2
- package/dist/tsup/{chunk-VE2X4KMG.cjs → chunk-MYWZCDML.cjs} +2 -11
- package/dist/tsup/chunk-MYWZCDML.cjs.map +1 -0
- package/dist/tsup/{chunk-DFA7SYSW.js → chunk-NIC3QLKL.js} +3 -3
- package/dist/tsup/{chunk-BZM4PMFS.js → chunk-P4OGQ4JL.js} +5 -7
- package/dist/tsup/{chunk-BZM4PMFS.js.map → chunk-P4OGQ4JL.js.map} +1 -1
- package/dist/tsup/{chunk-NT2NK3VT.js → chunk-PAG6G46L.js} +2 -2
- package/dist/tsup/{chunk-XIX5DOZN.js → chunk-SHBE77IT.js} +14 -9
- package/dist/tsup/chunk-SHBE77IT.js.map +1 -0
- package/dist/tsup/{chunk-TYLP3U4Y.cjs → chunk-TNIWIUNV.cjs} +9 -11
- package/dist/tsup/chunk-TNIWIUNV.cjs.map +1 -0
- package/dist/tsup/{chunk-S644FL73.cjs → chunk-TR5NLR5V.cjs} +4 -4
- package/dist/tsup/{chunk-S644FL73.cjs.map → chunk-TR5NLR5V.cjs.map} +1 -1
- package/dist/tsup/{chunk-ZA7FLHKH.cjs → chunk-UEULFXUI.cjs} +16 -2
- package/dist/tsup/chunk-UEULFXUI.cjs.map +1 -0
- package/dist/tsup/{chunk-X63ROSOG.cjs → chunk-UJ2FQY63.cjs} +7 -7
- package/dist/tsup/{chunk-X63ROSOG.cjs.map → chunk-UJ2FQY63.cjs.map} +1 -1
- package/dist/tsup/client/mod.cjs +7 -8
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.d.cts +5 -4
- package/dist/tsup/client/mod.d.ts +5 -4
- package/dist/tsup/client/mod.js +6 -7
- 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/{config-D49x8NpL.d.cts → config-BxOimoGX.d.cts} +16 -0
- package/dist/tsup/{config-D49x8NpL.d.ts → config-BxOimoGX.d.ts} +16 -0
- package/dist/tsup/{config-ZkIsRFsN.d.ts → config-BzdqbLAP.d.ts} +164 -27
- package/dist/tsup/{config-BfBhjEbk.d.cts → config-CPPEwn_e.d.cts} +164 -27
- package/dist/tsup/{context-sZ9GlaBK.d.cts → context-DSA9gFXB.d.cts} +2 -2
- package/dist/tsup/{context-B7-84u9K.d.ts → context-wWv-K2K_.d.ts} +2 -2
- package/dist/tsup/db/drizzle.cjs +120 -68
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.d.cts +8 -3
- package/dist/tsup/db/drizzle.d.ts +8 -3
- package/dist/tsup/db/drizzle.js +120 -68
- package/dist/tsup/db/drizzle.js.map +1 -1
- package/dist/tsup/db/mod.cjs +74 -22
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.d.cts +4 -3
- package/dist/tsup/db/mod.d.ts +4 -3
- package/dist/tsup/db/mod.js +74 -22
- package/dist/tsup/db/mod.js.map +1 -1
- package/dist/tsup/dynamic/mod.cjs +2 -2
- package/dist/tsup/dynamic/mod.d.cts +3 -3
- package/dist/tsup/dynamic/mod.d.ts +3 -3
- package/dist/tsup/dynamic/mod.js +1 -1
- package/dist/tsup/inspector/mod.cjs +4 -5
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.js +3 -4
- package/dist/tsup/inspector/mod.js.map +1 -1
- package/dist/tsup/inspector-tab/mod.cjs +2 -2
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
- package/dist/tsup/inspector-tab/mod.d.cts +5 -5
- package/dist/tsup/inspector-tab/mod.d.ts +5 -5
- package/dist/tsup/inspector-tab/mod.js +1 -1
- package/dist/tsup/inspector-tab/mod.js.map +1 -1
- package/dist/tsup/mod.cjs +605 -158
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.d.cts +5 -5
- package/dist/tsup/mod.d.ts +5 -5
- package/dist/tsup/mod.js +528 -81
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +10 -11
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.d.cts +3 -3
- package/dist/tsup/test/mod.d.ts +3 -3
- package/dist/tsup/test/mod.js +6 -7
- package/dist/tsup/test/mod.js.map +1 -1
- package/dist/tsup/utils-CV0akuDD.d.ts +162 -0
- package/dist/tsup/utils-DQDCphrl.d.cts +162 -0
- package/dist/tsup/utils.cjs +6 -2
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.d.cts +3 -146
- package/dist/tsup/utils.d.ts +3 -146
- package/dist/tsup/utils.js +5 -1
- package/dist/tsup/workflow/mod.cjs +198 -151
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.d.cts +5 -5
- package/dist/tsup/workflow/mod.d.ts +5 -5
- package/dist/tsup/workflow/mod.js +187 -140
- package/dist/tsup/workflow/mod.js.map +1 -1
- package/package.json +8 -8
- package/src/actor/config.test.ts +14 -0
- package/src/actor/config.ts +104 -16
- package/src/actor/definition.ts +18 -7
- package/src/agent-os/actor/index.ts +2 -2
- package/src/common/bare/generated/actor-runtime-socket-protocol/v1.ts +848 -0
- package/src/common/bare/generated/inspector/v6.ts +1367 -0
- package/src/common/database/config.ts +24 -0
- package/src/common/database/mod.test.ts +148 -59
- package/src/common/database/mod.ts +93 -23
- package/src/common/database/native-database.test.ts +9 -0
- package/src/common/database/native-database.ts +151 -0
- package/src/common/database/shared.ts +15 -0
- package/src/common/encoding.ts +28 -21
- package/src/db/drizzle.test.ts +157 -0
- package/src/db/drizzle.ts +170 -79
- package/src/dynamic/isolate-runtime.ts +0 -2
- package/src/engine-client/driver.ts +0 -15
- package/src/engine-client/mod.ts +0 -41
- package/src/inspector/client.browser.ts +69 -8
- package/src/inspector-tab/mod.ts +1 -0
- package/src/registry/config/index.ts +1 -35
- package/src/registry/napi-runtime.ts +204 -16
- package/src/registry/native.ts +200 -30
- package/src/registry/runtime.ts +146 -3
- package/src/registry/wasm-runtime.ts +217 -6
- package/src/utils.ts +3 -0
- package/src/workflow/context.ts +5 -27
- package/src/workflow/driver.test.ts +62 -0
- package/src/workflow/driver.ts +231 -113
- package/src/workflow/mod.ts +3 -3
- package/dist/tsup/chunk-34P567PO.cjs.map +0 -1
- package/dist/tsup/chunk-3MHDOUD7.cjs.map +0 -1
- package/dist/tsup/chunk-APW73HCH.cjs +0 -382
- package/dist/tsup/chunk-APW73HCH.cjs.map +0 -1
- package/dist/tsup/chunk-BLDO2FKO.js.map +0 -1
- package/dist/tsup/chunk-DHXWD4DF.js +0 -382
- package/dist/tsup/chunk-DHXWD4DF.js.map +0 -1
- package/dist/tsup/chunk-JZ7TWV65.js.map +0 -1
- package/dist/tsup/chunk-PYO2U53V.cjs.map +0 -1
- package/dist/tsup/chunk-TYLP3U4Y.cjs.map +0 -1
- package/dist/tsup/chunk-VE2X4KMG.cjs.map +0 -1
- package/dist/tsup/chunk-XIX5DOZN.js.map +0 -1
- package/dist/tsup/chunk-ZA7FLHKH.cjs.map +0 -1
- package/src/actor/driver.ts +0 -141
- package/src/actor/instance/mod.ts +0 -2484
- package/src/drivers/engine/actor-driver.ts +0 -2473
- /package/dist/tsup/{chunk-KEKWJECX.js.map → chunk-MGTSVSUC.js.map} +0 -0
- /package/dist/tsup/{chunk-DFA7SYSW.js.map → chunk-NIC3QLKL.js.map} +0 -0
- /package/dist/tsup/{chunk-NT2NK3VT.js.map → chunk-PAG6G46L.js.map} +0 -0
package/dist/tsup/test/mod.cjs
CHANGED
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkUJ2FQY63cjs = require('../chunk-UJ2FQY63.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
10
|
-
require('../chunk-
|
|
11
|
-
require('../chunk-
|
|
12
|
-
require('../chunk-PYO2U53V.cjs');
|
|
7
|
+
var _chunk4XKED5P5cjs = require('../chunk-4XKED5P5.cjs');
|
|
8
|
+
require('../chunk-MYWZCDML.cjs');
|
|
9
|
+
require('../chunk-UEULFXUI.cjs');
|
|
10
|
+
require('../chunk-M3FCXL3Q.cjs');
|
|
11
|
+
require('../chunk-6HQCLWAW.cjs');
|
|
13
12
|
require('../chunk-4FC7TVS6.cjs');
|
|
14
13
|
|
|
15
14
|
// src/test/mod.ts
|
|
16
15
|
var _pretry = require('p-retry'); var _pretry2 = _interopRequireDefault(_pretry);
|
|
17
16
|
async function waitForRegistryReady(registry) {
|
|
18
|
-
const clientConfig =
|
|
17
|
+
const clientConfig = _chunk4XKED5P5cjs.convertRegistryConfigToClientConfig.call(void 0,
|
|
19
18
|
registry.parseConfig()
|
|
20
19
|
);
|
|
21
20
|
await _pretry2.default.call(void 0,
|
|
22
21
|
async () => {
|
|
23
|
-
await
|
|
22
|
+
await _chunk4XKED5P5cjs.getMetadata.call(void 0, clientConfig);
|
|
24
23
|
},
|
|
25
24
|
{
|
|
26
25
|
retries: 20,
|
|
@@ -34,8 +33,8 @@ async function setupTest(c, registry) {
|
|
|
34
33
|
registry.config.noWelcome = true;
|
|
35
34
|
registry.start();
|
|
36
35
|
await waitForRegistryReady(registry);
|
|
37
|
-
const client =
|
|
38
|
-
...
|
|
36
|
+
const client = _chunkUJ2FQY63cjs.createClient.call(void 0, {
|
|
37
|
+
..._chunk4XKED5P5cjs.convertRegistryConfigToClientConfig.call(void 0, registry.parseConfig()),
|
|
39
38
|
disableMetadataLookup: false
|
|
40
39
|
});
|
|
41
40
|
c.onTestFinished(async () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/test/mod.cjs","../../../src/test/mod.ts"],"names":[],"mappings":"AAAA;AACE;AACF,yDAA8B;AAC9B;AACE;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/test/mod.cjs","../../../src/test/mod.ts"],"names":[],"mappings":"AAAA;AACE;AACF,yDAA8B;AAC9B;AACE;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACA;ACbA,iFAAmB;AAWnB,MAAA,SAAe,oBAAA,CAAqB,QAAA,EAAwC;AAC3E,EAAA,MAAM,aAAA,EAAe,mEAAA;AAAA,IACpB,QAAA,CAAS,WAAA,CAAY;AAAA,EACtB,CAAA;AAEA,EAAA,MAAM,8BAAA;AAAA,IACL,MAAA,CAAA,EAAA,GAAY;AACX,MAAA,MAAM,2CAAA,YAAwB,CAAA;AAAA,IAC/B,CAAA;AAAA,IACA;AAAA,MACC,OAAA,EAAS,EAAA;AAAA,MACT,UAAA,EAAY,EAAA;AAAA,MACZ,UAAA,EAAY;AAAA,IACb;AAAA,EACD,CAAA;AACD;AAEA,MAAA,SAAsB,SAAA,CACrB,CAAA,EACA,QAAA,EAC8B;AAC9B,EAAA,QAAA,CAAS,MAAA,CAAO,KAAA,EAAO,EAAE,GAAG,QAAA,CAAS,MAAA,CAAO,IAAA,EAAM,OAAA,EAAS,KAAK,CAAA;AAChE,EAAA,QAAA,CAAS,MAAA,CAAO,UAAA,EAAY,IAAA;AAE5B,EAAA,QAAA,CAAS,KAAA,CAAM,CAAA;AACf,EAAA,MAAM,oBAAA,CAAqB,QAAQ,CAAA;AAEnC,EAAA,MAAM,OAAA,EAAS,4CAAA;AAAgB,IAC9B,GAAG,mEAAA,QAAoC,CAAS,WAAA,CAAY,CAAC,CAAA;AAAA,IAC7D,qBAAA,EAAuB;AAAA,EACxB,CAAC,CAAA;AAED,EAAA,CAAA,CAAE,cAAA,CAAe,MAAA,CAAA,EAAA,GAAY;AAC5B,IAAA,MAAM,MAAA,CAAO,OAAA,CAAQ,CAAA;AAAA,EACtB,CAAC,CAAA;AAED,EAAA,OAAO,EAAE,OAAO,CAAA;AACjB;ADJA;AACE;AACF,8BAAC","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/test/mod.cjs","sourcesContent":[null,"import pRetry from \"p-retry\";\nimport type { TestContext } from \"vitest\";\nimport { convertRegistryConfigToClientConfig } from \"@/client/config\";\nimport { type Client, createClient } from \"@/client/mod\";\nimport { getMetadata } from \"@/engine-client/api-endpoints\";\nimport type { Registry } from \"@/registry\";\n\nexport interface SetupTestResult<A extends Registry<any>> {\n\tclient: Client<A>;\n}\n\nasync function waitForRegistryReady(registry: Registry<any>): Promise<void> {\n\tconst clientConfig = convertRegistryConfigToClientConfig(\n\t\tregistry.parseConfig(),\n\t);\n\n\tawait pRetry(\n\t\tasync () => {\n\t\t\tawait getMetadata(clientConfig);\n\t\t},\n\t\t{\n\t\t\tretries: 20,\n\t\t\tminTimeout: 50,\n\t\t\tmaxTimeout: 250,\n\t\t},\n\t);\n}\n\nexport async function setupTest<A extends Registry<any>>(\n\tc: TestContext,\n\tregistry: A,\n): Promise<SetupTestResult<A>> {\n\tregistry.config.test = { ...registry.config.test, enabled: true };\n\tregistry.config.noWelcome = true;\n\n\tregistry.start();\n\tawait waitForRegistryReady(registry);\n\n\tconst client = createClient<A>({\n\t\t...convertRegistryConfigToClientConfig(registry.parseConfig()),\n\t\tdisableMetadataLookup: false,\n\t});\n\n\tc.onTestFinished(async () => {\n\t\tawait client.dispose();\n\t});\n\n\treturn { client };\n}\n"]}
|
package/dist/tsup/test/mod.d.cts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { TestContext } from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import { aB as Registry, a1 as Client } from '../config-CPPEwn_e.cjs';
|
|
3
3
|
import 'zod/v4';
|
|
4
|
-
import '../config-
|
|
4
|
+
import '../config-BxOimoGX.cjs';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'pino';
|
|
8
8
|
import '@rivetkit/virtual-websocket';
|
|
9
9
|
import '@standard-schema/spec';
|
|
10
|
+
import '../utils-DQDCphrl.cjs';
|
|
10
11
|
import 'hono';
|
|
11
|
-
import '../utils.cjs';
|
|
12
12
|
import '../utils-CqDnC_PS.cjs';
|
|
13
13
|
import 'hono/utils/http-status';
|
|
14
14
|
|
package/dist/tsup/test/mod.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { TestContext } from 'vitest';
|
|
2
|
-
import {
|
|
2
|
+
import { aB as Registry, a1 as Client } from '../config-BzdqbLAP.js';
|
|
3
3
|
import 'zod/v4';
|
|
4
|
-
import '../config-
|
|
4
|
+
import '../config-BxOimoGX.js';
|
|
5
5
|
import '@rivetkit/rivetkit-wasm';
|
|
6
6
|
import 'zod';
|
|
7
7
|
import 'pino';
|
|
8
8
|
import '@rivetkit/virtual-websocket';
|
|
9
9
|
import '@standard-schema/spec';
|
|
10
|
+
import '../utils-CV0akuDD.js';
|
|
10
11
|
import 'hono';
|
|
11
|
-
import '../utils.js';
|
|
12
12
|
import '../utils-CqDnC_PS.js';
|
|
13
13
|
import 'hono/utils/http-status';
|
|
14
14
|
|
package/dist/tsup/test/mod.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createClient
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-NIC3QLKL.js";
|
|
4
4
|
import {
|
|
5
5
|
convertRegistryConfigToClientConfig,
|
|
6
6
|
getMetadata
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-BLDO2FKO.js";
|
|
7
|
+
} from "../chunk-GAV4PKFT.js";
|
|
8
|
+
import "../chunk-JI6GZ2C2.js";
|
|
9
|
+
import "../chunk-7AFZMFPQ.js";
|
|
10
|
+
import "../chunk-PAG6G46L.js";
|
|
11
|
+
import "../chunk-B4IZU537.js";
|
|
13
12
|
import "../chunk-ZZ3WBRPD.js";
|
|
14
13
|
|
|
15
14
|
// src/test/mod.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/test/mod.ts"],"sourcesContent":["import pRetry from \"p-retry\";\nimport type { TestContext } from \"vitest\";\nimport { convertRegistryConfigToClientConfig } from \"@/client/config\";\nimport { type Client, createClient } from \"@/client/mod\";\nimport { getMetadata } from \"@/engine-client/api-endpoints\";\nimport type { Registry } from \"@/registry\";\n\nexport interface SetupTestResult<A extends Registry<any>> {\n\tclient: Client<A>;\n}\n\nasync function waitForRegistryReady(registry: Registry<any>): Promise<void> {\n\tconst clientConfig = convertRegistryConfigToClientConfig(\n\t\tregistry.parseConfig(),\n\t);\n\n\tawait pRetry(\n\t\tasync () => {\n\t\t\tawait getMetadata(clientConfig);\n\t\t},\n\t\t{\n\t\t\tretries: 20,\n\t\t\tminTimeout: 50,\n\t\t\tmaxTimeout: 250,\n\t\t},\n\t);\n}\n\nexport async function setupTest<A extends Registry<any>>(\n\tc: TestContext,\n\tregistry: A,\n): Promise<SetupTestResult<A>> {\n\tregistry.config.test = { ...registry.config.test, enabled: true };\n\tregistry.config.noWelcome = true;\n\n\tregistry.start();\n\tawait waitForRegistryReady(registry);\n\n\tconst client = createClient<A>({\n\t\t...convertRegistryConfigToClientConfig(registry.parseConfig()),\n\t\tdisableMetadataLookup: false,\n\t});\n\n\tc.onTestFinished(async () => {\n\t\tawait client.dispose();\n\t});\n\n\treturn { client };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/test/mod.ts"],"sourcesContent":["import pRetry from \"p-retry\";\nimport type { TestContext } from \"vitest\";\nimport { convertRegistryConfigToClientConfig } from \"@/client/config\";\nimport { type Client, createClient } from \"@/client/mod\";\nimport { getMetadata } from \"@/engine-client/api-endpoints\";\nimport type { Registry } from \"@/registry\";\n\nexport interface SetupTestResult<A extends Registry<any>> {\n\tclient: Client<A>;\n}\n\nasync function waitForRegistryReady(registry: Registry<any>): Promise<void> {\n\tconst clientConfig = convertRegistryConfigToClientConfig(\n\t\tregistry.parseConfig(),\n\t);\n\n\tawait pRetry(\n\t\tasync () => {\n\t\t\tawait getMetadata(clientConfig);\n\t\t},\n\t\t{\n\t\t\tretries: 20,\n\t\t\tminTimeout: 50,\n\t\t\tmaxTimeout: 250,\n\t\t},\n\t);\n}\n\nexport async function setupTest<A extends Registry<any>>(\n\tc: TestContext,\n\tregistry: A,\n): Promise<SetupTestResult<A>> {\n\tregistry.config.test = { ...registry.config.test, enabled: true };\n\tregistry.config.noWelcome = true;\n\n\tregistry.start();\n\tawait waitForRegistryReady(registry);\n\n\tconst client = createClient<A>({\n\t\t...convertRegistryConfigToClientConfig(registry.parseConfig()),\n\t\tdisableMetadataLookup: false,\n\t});\n\n\tc.onTestFinished(async () => {\n\t\tawait client.dispose();\n\t});\n\n\treturn { client };\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,OAAO,YAAY;AAWnB,eAAe,qBAAqB,UAAwC;AAC3E,QAAM,eAAe;AAAA,IACpB,SAAS,YAAY;AAAA,EACtB;AAEA,QAAM;AAAA,IACL,YAAY;AACX,YAAM,YAAY,YAAY;AAAA,IAC/B;AAAA,IACA;AAAA,MACC,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,YAAY;AAAA,IACb;AAAA,EACD;AACD;AAEA,eAAsB,UACrB,GACA,UAC8B;AAC9B,WAAS,OAAO,OAAO,EAAE,GAAG,SAAS,OAAO,MAAM,SAAS,KAAK;AAChE,WAAS,OAAO,YAAY;AAE5B,WAAS,MAAM;AACf,QAAM,qBAAqB,QAAQ;AAEnC,QAAM,SAAS,aAAgB;AAAA,IAC9B,GAAG,oCAAoC,SAAS,YAAY,CAAC;AAAA,IAC7D,uBAAuB;AAAA,EACxB,CAAC;AAED,IAAE,eAAe,YAAY;AAC5B,UAAM,OAAO,QAAQ;AAAA,EACtB,CAAC;AAED,SAAO,EAAE,OAAO;AACjB;","names":[]}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { Context, Handler } from 'hono';
|
|
2
|
+
import './utils-CqDnC_PS.js';
|
|
3
|
+
import { z } from 'zod/v4';
|
|
4
|
+
|
|
5
|
+
declare const EncodingSchema: z.ZodEnum<{
|
|
6
|
+
json: "json";
|
|
7
|
+
cbor: "cbor";
|
|
8
|
+
bare: "bare";
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Encoding used to communicate between the client & actor.
|
|
12
|
+
*/
|
|
13
|
+
type Encoding = z.infer<typeof EncodingSchema>;
|
|
14
|
+
/** Stringifies with compat for values that BARE & CBOR supports. */
|
|
15
|
+
declare function jsonStringifyCompat(input: any, space?: string | number): string;
|
|
16
|
+
/** Parses JSON with compat for values that BARE & CBOR supports. */
|
|
17
|
+
declare function jsonParseCompat(input: string): any;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Joins multiple abort signals into one.
|
|
21
|
+
*
|
|
22
|
+
* The returned signal aborts when the first input signal aborts.
|
|
23
|
+
* Uses `AbortSignal.any(...)` when available, with a runtime fallback.
|
|
24
|
+
*
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
declare function joinSignals(...signals: Array<AbortSignal | undefined | null>): AbortSignal;
|
|
28
|
+
/**
|
|
29
|
+
* Returns a promise that resolves after the given number of milliseconds.
|
|
30
|
+
*
|
|
31
|
+
* @experimental
|
|
32
|
+
*/
|
|
33
|
+
declare function sleep(ms: number): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a fixed-rate interval tick function that can be awaited in a loop.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* const tick = interval(100);
|
|
39
|
+
* while (!c.aborted) {
|
|
40
|
+
* await tick();
|
|
41
|
+
* if (c.aborted) break;
|
|
42
|
+
* // ... game logic
|
|
43
|
+
* }
|
|
44
|
+
*
|
|
45
|
+
* @experimental
|
|
46
|
+
*/
|
|
47
|
+
declare function interval(ms: number): () => Promise<void>;
|
|
48
|
+
declare const VERSION: string;
|
|
49
|
+
/**
|
|
50
|
+
* Builds the HTTP user agent used by this library.
|
|
51
|
+
*
|
|
52
|
+
* @experimental
|
|
53
|
+
*/
|
|
54
|
+
declare function httpUserAgent(): string;
|
|
55
|
+
type UpgradeWebSocket = (createEvents: (c: Context) => any) => Handler;
|
|
56
|
+
type GetUpgradeWebSocket = () => UpgradeWebSocket;
|
|
57
|
+
/**
|
|
58
|
+
* Reads an environment variable from Deno or Node runtimes.
|
|
59
|
+
*
|
|
60
|
+
* @experimental
|
|
61
|
+
*/
|
|
62
|
+
declare function getEnvUniversal(key: string): string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Traces a debug value and returns it.
|
|
65
|
+
*
|
|
66
|
+
* @experimental
|
|
67
|
+
*/
|
|
68
|
+
declare function dbg<T>(x: T): T;
|
|
69
|
+
/**
|
|
70
|
+
* Converts various ArrayBuffer-like types to Uint8Array.
|
|
71
|
+
* Handles ArrayBuffer, ArrayBufferView (including typed arrays), and passes through existing Uint8Array.
|
|
72
|
+
*
|
|
73
|
+
* @param data - The ArrayBuffer or ArrayBufferView to convert
|
|
74
|
+
* @returns A Uint8Array view of the data
|
|
75
|
+
*
|
|
76
|
+
* @experimental
|
|
77
|
+
*/
|
|
78
|
+
declare function toUint8Array(data: ArrayBuffer | ArrayBufferView): Uint8Array;
|
|
79
|
+
type LongTimeoutHandle = {
|
|
80
|
+
abort: () => void;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Polyfill for Promise.withResolvers().
|
|
84
|
+
*
|
|
85
|
+
* This is specifically for Cloudflare Workers. Their implementation of Promise.withResolvers does not work correctly.
|
|
86
|
+
*
|
|
87
|
+
* @experimental
|
|
88
|
+
*/
|
|
89
|
+
declare function promiseWithResolvers<T>(onReject: (reason?: any) => void): {
|
|
90
|
+
promise: Promise<T>;
|
|
91
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
92
|
+
reject: (reason?: any) => void;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Sets a timeout that supports delays larger than the JavaScript timer limit.
|
|
96
|
+
*
|
|
97
|
+
* @experimental
|
|
98
|
+
*/
|
|
99
|
+
declare function setLongTimeout(listener: () => void, after: number): LongTimeoutHandle;
|
|
100
|
+
/**
|
|
101
|
+
* A tiny utility that coalesces/enqueues async operations so only the latest
|
|
102
|
+
* queued task runs per cycle, while callers receive a promise that resolves
|
|
103
|
+
* when the task for the cycle they joined has completed.
|
|
104
|
+
*/
|
|
105
|
+
declare class SinglePromiseQueue {
|
|
106
|
+
#private;
|
|
107
|
+
/** The currently running promise of #drainLoop. Do not await this, instead await `pending` to await the current cycle. */
|
|
108
|
+
runningDrainLoop?: Promise<void>;
|
|
109
|
+
/** Queue the next operation and return a promise that resolves when it flushes. */
|
|
110
|
+
enqueue(op: () => Promise<void>): Promise<void>;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Converts a Buffer or Uint8Array into an ArrayBuffer view.
|
|
114
|
+
*
|
|
115
|
+
* @experimental
|
|
116
|
+
*/
|
|
117
|
+
declare function bufferToArrayBuffer(buf: Buffer | Uint8Array): ArrayBuffer;
|
|
118
|
+
/**
|
|
119
|
+
* Properly combines a base URL endpoint with a path, preserving any base path in the endpoint.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* combineUrlPath("http://localhost:8787/rivet", "/actors/action")
|
|
123
|
+
* // Returns: "http://localhost:8787/rivet/actors/action"
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* combineUrlPath("http://localhost:8787/rivet", "/actors?type=foo", { namespace: "test" })
|
|
127
|
+
* // Returns: "http://localhost:8787/rivet/actors?type=foo&namespace=test"
|
|
128
|
+
*
|
|
129
|
+
* @param endpoint The base URL endpoint that may contain a path component
|
|
130
|
+
* @param path The path to append to the endpoint (may include query parameters)
|
|
131
|
+
* @param queryParams Optional additional query parameters to append
|
|
132
|
+
* @returns The properly combined URL string
|
|
133
|
+
*
|
|
134
|
+
* @experimental
|
|
135
|
+
*/
|
|
136
|
+
declare function combineUrlPath(endpoint: string, path: string, queryParams?: Record<string, string | undefined>): string;
|
|
137
|
+
/**
|
|
138
|
+
* Compares two ArrayBuffer values by byte content.
|
|
139
|
+
*
|
|
140
|
+
* @experimental
|
|
141
|
+
*/
|
|
142
|
+
declare function arrayBuffersEqual(buf1: ArrayBuffer, buf2: ArrayBuffer): boolean;
|
|
143
|
+
declare const EXTRA_ERROR_LOG: {
|
|
144
|
+
issues: string;
|
|
145
|
+
support: string;
|
|
146
|
+
version: string;
|
|
147
|
+
};
|
|
148
|
+
type Runtime = "deno" | "bun" | "node";
|
|
149
|
+
/**
|
|
150
|
+
* Detects the current JavaScript runtime from the user agent.
|
|
151
|
+
*
|
|
152
|
+
* @experimental
|
|
153
|
+
*/
|
|
154
|
+
declare function detectRuntime(): Runtime;
|
|
155
|
+
type DeepReadonly<T> = {
|
|
156
|
+
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
|
|
157
|
+
};
|
|
158
|
+
type DeepMutable<T> = {
|
|
159
|
+
-readonly [K in keyof T]: T[K] extends object ? DeepMutable<T[K]> : T[K];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export { type DeepMutable as D, type Encoding as E, type GetUpgradeWebSocket as G, type LongTimeoutHandle as L, type Runtime as R, SinglePromiseQueue as S, type UpgradeWebSocket as U, VERSION as V, type DeepReadonly as a, EXTRA_ERROR_LOG as b, arrayBuffersEqual as c, bufferToArrayBuffer as d, combineUrlPath as e, dbg as f, detectRuntime as g, getEnvUniversal as h, httpUserAgent as i, interval as j, joinSignals as k, jsonParseCompat as l, jsonStringifyCompat as m, sleep as n, promiseWithResolvers as p, setLongTimeout as s, toUint8Array as t };
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { Context, Handler } from 'hono';
|
|
2
|
+
import './utils-CqDnC_PS.cjs';
|
|
3
|
+
import { z } from 'zod/v4';
|
|
4
|
+
|
|
5
|
+
declare const EncodingSchema: z.ZodEnum<{
|
|
6
|
+
json: "json";
|
|
7
|
+
cbor: "cbor";
|
|
8
|
+
bare: "bare";
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* Encoding used to communicate between the client & actor.
|
|
12
|
+
*/
|
|
13
|
+
type Encoding = z.infer<typeof EncodingSchema>;
|
|
14
|
+
/** Stringifies with compat for values that BARE & CBOR supports. */
|
|
15
|
+
declare function jsonStringifyCompat(input: any, space?: string | number): string;
|
|
16
|
+
/** Parses JSON with compat for values that BARE & CBOR supports. */
|
|
17
|
+
declare function jsonParseCompat(input: string): any;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Joins multiple abort signals into one.
|
|
21
|
+
*
|
|
22
|
+
* The returned signal aborts when the first input signal aborts.
|
|
23
|
+
* Uses `AbortSignal.any(...)` when available, with a runtime fallback.
|
|
24
|
+
*
|
|
25
|
+
* @experimental
|
|
26
|
+
*/
|
|
27
|
+
declare function joinSignals(...signals: Array<AbortSignal | undefined | null>): AbortSignal;
|
|
28
|
+
/**
|
|
29
|
+
* Returns a promise that resolves after the given number of milliseconds.
|
|
30
|
+
*
|
|
31
|
+
* @experimental
|
|
32
|
+
*/
|
|
33
|
+
declare function sleep(ms: number): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a fixed-rate interval tick function that can be awaited in a loop.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* const tick = interval(100);
|
|
39
|
+
* while (!c.aborted) {
|
|
40
|
+
* await tick();
|
|
41
|
+
* if (c.aborted) break;
|
|
42
|
+
* // ... game logic
|
|
43
|
+
* }
|
|
44
|
+
*
|
|
45
|
+
* @experimental
|
|
46
|
+
*/
|
|
47
|
+
declare function interval(ms: number): () => Promise<void>;
|
|
48
|
+
declare const VERSION: string;
|
|
49
|
+
/**
|
|
50
|
+
* Builds the HTTP user agent used by this library.
|
|
51
|
+
*
|
|
52
|
+
* @experimental
|
|
53
|
+
*/
|
|
54
|
+
declare function httpUserAgent(): string;
|
|
55
|
+
type UpgradeWebSocket = (createEvents: (c: Context) => any) => Handler;
|
|
56
|
+
type GetUpgradeWebSocket = () => UpgradeWebSocket;
|
|
57
|
+
/**
|
|
58
|
+
* Reads an environment variable from Deno or Node runtimes.
|
|
59
|
+
*
|
|
60
|
+
* @experimental
|
|
61
|
+
*/
|
|
62
|
+
declare function getEnvUniversal(key: string): string | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Traces a debug value and returns it.
|
|
65
|
+
*
|
|
66
|
+
* @experimental
|
|
67
|
+
*/
|
|
68
|
+
declare function dbg<T>(x: T): T;
|
|
69
|
+
/**
|
|
70
|
+
* Converts various ArrayBuffer-like types to Uint8Array.
|
|
71
|
+
* Handles ArrayBuffer, ArrayBufferView (including typed arrays), and passes through existing Uint8Array.
|
|
72
|
+
*
|
|
73
|
+
* @param data - The ArrayBuffer or ArrayBufferView to convert
|
|
74
|
+
* @returns A Uint8Array view of the data
|
|
75
|
+
*
|
|
76
|
+
* @experimental
|
|
77
|
+
*/
|
|
78
|
+
declare function toUint8Array(data: ArrayBuffer | ArrayBufferView): Uint8Array;
|
|
79
|
+
type LongTimeoutHandle = {
|
|
80
|
+
abort: () => void;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Polyfill for Promise.withResolvers().
|
|
84
|
+
*
|
|
85
|
+
* This is specifically for Cloudflare Workers. Their implementation of Promise.withResolvers does not work correctly.
|
|
86
|
+
*
|
|
87
|
+
* @experimental
|
|
88
|
+
*/
|
|
89
|
+
declare function promiseWithResolvers<T>(onReject: (reason?: any) => void): {
|
|
90
|
+
promise: Promise<T>;
|
|
91
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
92
|
+
reject: (reason?: any) => void;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Sets a timeout that supports delays larger than the JavaScript timer limit.
|
|
96
|
+
*
|
|
97
|
+
* @experimental
|
|
98
|
+
*/
|
|
99
|
+
declare function setLongTimeout(listener: () => void, after: number): LongTimeoutHandle;
|
|
100
|
+
/**
|
|
101
|
+
* A tiny utility that coalesces/enqueues async operations so only the latest
|
|
102
|
+
* queued task runs per cycle, while callers receive a promise that resolves
|
|
103
|
+
* when the task for the cycle they joined has completed.
|
|
104
|
+
*/
|
|
105
|
+
declare class SinglePromiseQueue {
|
|
106
|
+
#private;
|
|
107
|
+
/** The currently running promise of #drainLoop. Do not await this, instead await `pending` to await the current cycle. */
|
|
108
|
+
runningDrainLoop?: Promise<void>;
|
|
109
|
+
/** Queue the next operation and return a promise that resolves when it flushes. */
|
|
110
|
+
enqueue(op: () => Promise<void>): Promise<void>;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Converts a Buffer or Uint8Array into an ArrayBuffer view.
|
|
114
|
+
*
|
|
115
|
+
* @experimental
|
|
116
|
+
*/
|
|
117
|
+
declare function bufferToArrayBuffer(buf: Buffer | Uint8Array): ArrayBuffer;
|
|
118
|
+
/**
|
|
119
|
+
* Properly combines a base URL endpoint with a path, preserving any base path in the endpoint.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* combineUrlPath("http://localhost:8787/rivet", "/actors/action")
|
|
123
|
+
* // Returns: "http://localhost:8787/rivet/actors/action"
|
|
124
|
+
*
|
|
125
|
+
* @example
|
|
126
|
+
* combineUrlPath("http://localhost:8787/rivet", "/actors?type=foo", { namespace: "test" })
|
|
127
|
+
* // Returns: "http://localhost:8787/rivet/actors?type=foo&namespace=test"
|
|
128
|
+
*
|
|
129
|
+
* @param endpoint The base URL endpoint that may contain a path component
|
|
130
|
+
* @param path The path to append to the endpoint (may include query parameters)
|
|
131
|
+
* @param queryParams Optional additional query parameters to append
|
|
132
|
+
* @returns The properly combined URL string
|
|
133
|
+
*
|
|
134
|
+
* @experimental
|
|
135
|
+
*/
|
|
136
|
+
declare function combineUrlPath(endpoint: string, path: string, queryParams?: Record<string, string | undefined>): string;
|
|
137
|
+
/**
|
|
138
|
+
* Compares two ArrayBuffer values by byte content.
|
|
139
|
+
*
|
|
140
|
+
* @experimental
|
|
141
|
+
*/
|
|
142
|
+
declare function arrayBuffersEqual(buf1: ArrayBuffer, buf2: ArrayBuffer): boolean;
|
|
143
|
+
declare const EXTRA_ERROR_LOG: {
|
|
144
|
+
issues: string;
|
|
145
|
+
support: string;
|
|
146
|
+
version: string;
|
|
147
|
+
};
|
|
148
|
+
type Runtime = "deno" | "bun" | "node";
|
|
149
|
+
/**
|
|
150
|
+
* Detects the current JavaScript runtime from the user agent.
|
|
151
|
+
*
|
|
152
|
+
* @experimental
|
|
153
|
+
*/
|
|
154
|
+
declare function detectRuntime(): Runtime;
|
|
155
|
+
type DeepReadonly<T> = {
|
|
156
|
+
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
|
|
157
|
+
};
|
|
158
|
+
type DeepMutable<T> = {
|
|
159
|
+
-readonly [K in keyof T]: T[K] extends object ? DeepMutable<T[K]> : T[K];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
export { type DeepMutable as D, type Encoding as E, type GetUpgradeWebSocket as G, type LongTimeoutHandle as L, type Runtime as R, SinglePromiseQueue as S, type UpgradeWebSocket as U, VERSION as V, type DeepReadonly as a, EXTRA_ERROR_LOG as b, arrayBuffersEqual as c, bufferToArrayBuffer as d, combineUrlPath as e, dbg as f, detectRuntime as g, getEnvUniversal as h, httpUserAgent as i, interval as j, joinSignals as k, jsonParseCompat as l, jsonStringifyCompat as m, sleep as n, promiseWithResolvers as p, setLongTimeout as s, toUint8Array as t };
|
package/dist/tsup/utils.cjs
CHANGED
|
@@ -17,7 +17,9 @@
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
var _chunk6HQCLWAWcjs = require('./chunk-6HQCLWAW.cjs');
|
|
21
23
|
require('./chunk-4FC7TVS6.cjs');
|
|
22
24
|
|
|
23
25
|
|
|
@@ -38,5 +40,7 @@ require('./chunk-4FC7TVS6.cjs');
|
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
exports.EXTRA_ERROR_LOG = _chunk6HQCLWAWcjs.EXTRA_ERROR_LOG; exports.SinglePromiseQueue = _chunk6HQCLWAWcjs.SinglePromiseQueue; exports.VERSION = _chunk6HQCLWAWcjs.VERSION; exports.arrayBuffersEqual = _chunk6HQCLWAWcjs.arrayBuffersEqual; exports.assertUnreachable = _chunk6HQCLWAWcjs.assertUnreachable; exports.bufferToArrayBuffer = _chunk6HQCLWAWcjs.bufferToArrayBuffer; exports.combineUrlPath = _chunk6HQCLWAWcjs.combineUrlPath; exports.dbg = _chunk6HQCLWAWcjs.dbg; exports.detectRuntime = _chunk6HQCLWAWcjs.detectRuntime; exports.getEnvUniversal = _chunk6HQCLWAWcjs.getEnvUniversal; exports.httpUserAgent = _chunk6HQCLWAWcjs.httpUserAgent; exports.interval = _chunk6HQCLWAWcjs.interval; exports.joinSignals = _chunk6HQCLWAWcjs.joinSignals; exports.jsonParseCompat = _chunk6HQCLWAWcjs.jsonParseCompat; exports.jsonStringifyCompat = _chunk6HQCLWAWcjs.jsonStringifyCompat; exports.promiseWithResolvers = _chunk6HQCLWAWcjs.promiseWithResolvers; exports.setLongTimeout = _chunk6HQCLWAWcjs.setLongTimeout; exports.sleep = _chunk6HQCLWAWcjs.sleep; exports.stringifyError = _chunk6HQCLWAWcjs.stringifyError; exports.toUint8Array = _chunk6HQCLWAWcjs.toUint8Array;
|
|
42
46
|
//# sourceMappingURL=utils.cjs.map
|
package/dist/tsup/utils.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/utils.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/utils.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,qoCAAC","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/utils.cjs"}
|
package/dist/tsup/utils.d.cts
CHANGED
|
@@ -1,148 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'hono';
|
|
2
2
|
export { d as assertUnreachable, s as stringifyError } from './utils-CqDnC_PS.cjs';
|
|
3
|
+
export { D as DeepMutable, a as DeepReadonly, b as EXTRA_ERROR_LOG, G as GetUpgradeWebSocket, L as LongTimeoutHandle, R as Runtime, S as SinglePromiseQueue, U as UpgradeWebSocket, V as VERSION, c as arrayBuffersEqual, d as bufferToArrayBuffer, e as combineUrlPath, f as dbg, g as detectRuntime, h as getEnvUniversal, i as httpUserAgent, j as interval, k as joinSignals, l as jsonParseCompat, m as jsonStringifyCompat, p as promiseWithResolvers, s as setLongTimeout, n as sleep, t as toUint8Array } from './utils-DQDCphrl.cjs';
|
|
3
4
|
import 'hono/utils/http-status';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Joins multiple abort signals into one.
|
|
7
|
-
*
|
|
8
|
-
* The returned signal aborts when the first input signal aborts.
|
|
9
|
-
* Uses `AbortSignal.any(...)` when available, with a runtime fallback.
|
|
10
|
-
*
|
|
11
|
-
* @experimental
|
|
12
|
-
*/
|
|
13
|
-
declare function joinSignals(...signals: Array<AbortSignal | undefined | null>): AbortSignal;
|
|
14
|
-
/**
|
|
15
|
-
* Returns a promise that resolves after the given number of milliseconds.
|
|
16
|
-
*
|
|
17
|
-
* @experimental
|
|
18
|
-
*/
|
|
19
|
-
declare function sleep(ms: number): Promise<void>;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a fixed-rate interval tick function that can be awaited in a loop.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* const tick = interval(100);
|
|
25
|
-
* while (!c.aborted) {
|
|
26
|
-
* await tick();
|
|
27
|
-
* if (c.aborted) break;
|
|
28
|
-
* // ... game logic
|
|
29
|
-
* }
|
|
30
|
-
*
|
|
31
|
-
* @experimental
|
|
32
|
-
*/
|
|
33
|
-
declare function interval(ms: number): () => Promise<void>;
|
|
34
|
-
declare const VERSION: string;
|
|
35
|
-
/**
|
|
36
|
-
* Builds the HTTP user agent used by this library.
|
|
37
|
-
*
|
|
38
|
-
* @experimental
|
|
39
|
-
*/
|
|
40
|
-
declare function httpUserAgent(): string;
|
|
41
|
-
type UpgradeWebSocket = (createEvents: (c: Context) => any) => Handler;
|
|
42
|
-
type GetUpgradeWebSocket = () => UpgradeWebSocket;
|
|
43
|
-
/**
|
|
44
|
-
* Reads an environment variable from Deno or Node runtimes.
|
|
45
|
-
*
|
|
46
|
-
* @experimental
|
|
47
|
-
*/
|
|
48
|
-
declare function getEnvUniversal(key: string): string | undefined;
|
|
49
|
-
/**
|
|
50
|
-
* Traces a debug value and returns it.
|
|
51
|
-
*
|
|
52
|
-
* @experimental
|
|
53
|
-
*/
|
|
54
|
-
declare function dbg<T>(x: T): T;
|
|
55
|
-
/**
|
|
56
|
-
* Converts various ArrayBuffer-like types to Uint8Array.
|
|
57
|
-
* Handles ArrayBuffer, ArrayBufferView (including typed arrays), and passes through existing Uint8Array.
|
|
58
|
-
*
|
|
59
|
-
* @param data - The ArrayBuffer or ArrayBufferView to convert
|
|
60
|
-
* @returns A Uint8Array view of the data
|
|
61
|
-
*
|
|
62
|
-
* @experimental
|
|
63
|
-
*/
|
|
64
|
-
declare function toUint8Array(data: ArrayBuffer | ArrayBufferView): Uint8Array;
|
|
65
|
-
type LongTimeoutHandle = {
|
|
66
|
-
abort: () => void;
|
|
67
|
-
};
|
|
68
|
-
/**
|
|
69
|
-
* Polyfill for Promise.withResolvers().
|
|
70
|
-
*
|
|
71
|
-
* This is specifically for Cloudflare Workers. Their implementation of Promise.withResolvers does not work correctly.
|
|
72
|
-
*
|
|
73
|
-
* @experimental
|
|
74
|
-
*/
|
|
75
|
-
declare function promiseWithResolvers<T>(onReject: (reason?: any) => void): {
|
|
76
|
-
promise: Promise<T>;
|
|
77
|
-
resolve: (value: T | PromiseLike<T>) => void;
|
|
78
|
-
reject: (reason?: any) => void;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Sets a timeout that supports delays larger than the JavaScript timer limit.
|
|
82
|
-
*
|
|
83
|
-
* @experimental
|
|
84
|
-
*/
|
|
85
|
-
declare function setLongTimeout(listener: () => void, after: number): LongTimeoutHandle;
|
|
86
|
-
/**
|
|
87
|
-
* A tiny utility that coalesces/enqueues async operations so only the latest
|
|
88
|
-
* queued task runs per cycle, while callers receive a promise that resolves
|
|
89
|
-
* when the task for the cycle they joined has completed.
|
|
90
|
-
*/
|
|
91
|
-
declare class SinglePromiseQueue {
|
|
92
|
-
#private;
|
|
93
|
-
/** The currently running promise of #drainLoop. Do not await this, instead await `pending` to await the current cycle. */
|
|
94
|
-
runningDrainLoop?: Promise<void>;
|
|
95
|
-
/** Queue the next operation and return a promise that resolves when it flushes. */
|
|
96
|
-
enqueue(op: () => Promise<void>): Promise<void>;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Converts a Buffer or Uint8Array into an ArrayBuffer view.
|
|
100
|
-
*
|
|
101
|
-
* @experimental
|
|
102
|
-
*/
|
|
103
|
-
declare function bufferToArrayBuffer(buf: Buffer | Uint8Array): ArrayBuffer;
|
|
104
|
-
/**
|
|
105
|
-
* Properly combines a base URL endpoint with a path, preserving any base path in the endpoint.
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* combineUrlPath("http://localhost:8787/rivet", "/actors/action")
|
|
109
|
-
* // Returns: "http://localhost:8787/rivet/actors/action"
|
|
110
|
-
*
|
|
111
|
-
* @example
|
|
112
|
-
* combineUrlPath("http://localhost:8787/rivet", "/actors?type=foo", { namespace: "test" })
|
|
113
|
-
* // Returns: "http://localhost:8787/rivet/actors?type=foo&namespace=test"
|
|
114
|
-
*
|
|
115
|
-
* @param endpoint The base URL endpoint that may contain a path component
|
|
116
|
-
* @param path The path to append to the endpoint (may include query parameters)
|
|
117
|
-
* @param queryParams Optional additional query parameters to append
|
|
118
|
-
* @returns The properly combined URL string
|
|
119
|
-
*
|
|
120
|
-
* @experimental
|
|
121
|
-
*/
|
|
122
|
-
declare function combineUrlPath(endpoint: string, path: string, queryParams?: Record<string, string | undefined>): string;
|
|
123
|
-
/**
|
|
124
|
-
* Compares two ArrayBuffer values by byte content.
|
|
125
|
-
*
|
|
126
|
-
* @experimental
|
|
127
|
-
*/
|
|
128
|
-
declare function arrayBuffersEqual(buf1: ArrayBuffer, buf2: ArrayBuffer): boolean;
|
|
129
|
-
declare const EXTRA_ERROR_LOG: {
|
|
130
|
-
issues: string;
|
|
131
|
-
support: string;
|
|
132
|
-
version: string;
|
|
133
|
-
};
|
|
134
|
-
type Runtime = "deno" | "bun" | "node";
|
|
135
|
-
/**
|
|
136
|
-
* Detects the current JavaScript runtime from the user agent.
|
|
137
|
-
*
|
|
138
|
-
* @experimental
|
|
139
|
-
*/
|
|
140
|
-
declare function detectRuntime(): Runtime;
|
|
141
|
-
type DeepReadonly<T> = {
|
|
142
|
-
readonly [K in keyof T]: T[K] extends object ? DeepReadonly<T[K]> : T[K];
|
|
143
|
-
};
|
|
144
|
-
type DeepMutable<T> = {
|
|
145
|
-
-readonly [K in keyof T]: T[K] extends object ? DeepMutable<T[K]> : T[K];
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export { type DeepMutable, type DeepReadonly, EXTRA_ERROR_LOG, type GetUpgradeWebSocket, type LongTimeoutHandle, type Runtime, SinglePromiseQueue, type UpgradeWebSocket, VERSION, arrayBuffersEqual, bufferToArrayBuffer, combineUrlPath, dbg, detectRuntime, getEnvUniversal, httpUserAgent, interval, joinSignals, promiseWithResolvers, setLongTimeout, sleep, toUint8Array };
|
|
5
|
+
import 'zod/v4';
|