@xyo-network/dapp-kit-browser 0.1.2
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/README.md +42 -0
- package/dist/browser/browserDappHost.d.ts +29 -0
- package/dist/browser/browserDappHost.d.ts.map +1 -0
- package/dist/browser/index.d.ts +4 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs +125 -0
- package/dist/browser/index.mjs.map +7 -0
- package/dist/browser/messagePortApplicationPortEndpoint.d.ts +3 -0
- package/dist/browser/messagePortApplicationPortEndpoint.d.ts.map +1 -0
- package/package.json +69 -0
package/README.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# `@xyo-network/dapp-kit-browser`
|
|
2
|
+
|
|
3
|
+
Browser lifecycle owners and browser application-port adapters for headless
|
|
4
|
+
dApp-kit launches.
|
|
5
|
+
|
|
6
|
+
The initial slice owns read-only application sessions in either a page or a
|
|
7
|
+
dedicated worker. It composes browser-kit's page-hide and worker shutdown
|
|
8
|
+
adapters, then exposes only application ports, status, and stop. It does not
|
|
9
|
+
expose the neutral session, actor system, provider system, or locator.
|
|
10
|
+
|
|
11
|
+
Effectful application ports are rejected until dapp-kit has a transactional,
|
|
12
|
+
crash-durable browser effect journal. This package does not use memory or
|
|
13
|
+
`localStorage` as a durability substitute.
|
|
14
|
+
|
|
15
|
+
The package adapts a real `MessagePort` to the shared application-port peers in
|
|
16
|
+
`@xyo-network/dapp-kit-port`. Those peers bind every frame to
|
|
17
|
+
the authenticated attachment, plan, system incarnation, host session, request,
|
|
18
|
+
port, operation, and deadline. Hosts dispatch an explicit operation registry;
|
|
19
|
+
actor/provider locators are never reflected across the boundary. Unary calls
|
|
20
|
+
support cancellation acknowledgement. Streams use bounded receiver credit,
|
|
21
|
+
monotonic at-least-once delivery, exact duplicate checks, durable cursors, and
|
|
22
|
+
resume.
|
|
23
|
+
|
|
24
|
+
The browser package re-exports the shared
|
|
25
|
+
`connectWebSocketApplicationPort()` client for same-origin network attachments.
|
|
26
|
+
The connection handshake validates the expected dApp, plan, protocol version,
|
|
27
|
+
and grant lifetime before exposing a client; closing or losing the socket
|
|
28
|
+
detaches only that UI session.
|
|
29
|
+
|
|
30
|
+
The shared package's structural Node tests exercise paired endpoints,
|
|
31
|
+
stale-incarnation rejection, cancellation ordering, detach cleanup, bounded
|
|
32
|
+
credit, durable resume, and the real Node WebSocket server/client boundary. The
|
|
33
|
+
local runner's opt-in Chromium suite additionally bundles this package's actual
|
|
34
|
+
WebSocket client into an admitted static site and proves attach, request,
|
|
35
|
+
reload, and detach without page ownership of the runtime.
|
|
36
|
+
|
|
37
|
+
This package does not yet claim:
|
|
38
|
+
|
|
39
|
+
- forced-worker-termination conformance;
|
|
40
|
+
- service-worker support;
|
|
41
|
+
- a wallet or XL1 browser-system integration; or
|
|
42
|
+
- React or any other UI framework integration.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { WorkerMessageEndpoint } from '@ariestools/browser-kit-worker';
|
|
2
|
+
import type { DappLaunch, DappStatus } from '@xyo-network/dapp-kit';
|
|
3
|
+
export declare const BrowserDappHostErrorCode: {
|
|
4
|
+
readonly durableJournalRequired: "browser-dapp-host.durable-journal-required";
|
|
5
|
+
};
|
|
6
|
+
export type BrowserDappHostErrorCode = typeof BrowserDappHostErrorCode[keyof typeof BrowserDappHostErrorCode];
|
|
7
|
+
export interface BrowserDappHost<TPorts> {
|
|
8
|
+
status(): DappStatus;
|
|
9
|
+
stop(): Promise<void>;
|
|
10
|
+
whenReady(): Promise<TPorts>;
|
|
11
|
+
}
|
|
12
|
+
interface BrowserDappHostOptions<TPorts> {
|
|
13
|
+
readonly launch: DappLaunch<TPorts>;
|
|
14
|
+
readonly onStopError: (error: unknown) => void;
|
|
15
|
+
}
|
|
16
|
+
export interface CreatePageDappHostOptions<TPorts> extends BrowserDappHostOptions<TPorts> {
|
|
17
|
+
readonly target?: Window;
|
|
18
|
+
}
|
|
19
|
+
export interface CreateWorkerDappHostOptions<TPorts> extends BrowserDappHostOptions<TPorts> {
|
|
20
|
+
readonly endpoint: WorkerMessageEndpoint;
|
|
21
|
+
}
|
|
22
|
+
export declare class BrowserDappHostError extends Error {
|
|
23
|
+
readonly code: BrowserDappHostErrorCode;
|
|
24
|
+
constructor(code: BrowserDappHostErrorCode, message: string);
|
|
25
|
+
}
|
|
26
|
+
export declare function createPageDappHost<TPorts>(options: CreatePageDappHostOptions<TPorts>): BrowserDappHost<TPorts>;
|
|
27
|
+
export declare function createWorkerDappHost<TPorts>(options: CreateWorkerDappHostOptions<TPorts>): BrowserDappHost<TPorts>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=browserDappHost.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browserDappHost.d.ts","sourceRoot":"","sources":["../../src/browserDappHost.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAE3E,OAAO,KAAK,EACV,UAAU,EACV,UAAU,EACX,MAAM,uBAAuB,CAAA;AAE9B,eAAO,MAAM,wBAAwB;;CAAoF,CAAA;AAEzH,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAC,MAAM,OAAO,wBAAwB,CAAC,CAAA;AAE7G,MAAM,WAAW,eAAe,CAAC,MAAM;IACrC,MAAM,IAAI,UAAU,CAAA;IACpB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;IACrB,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;CAC7B;AAED,UAAU,sBAAsB,CAAC,MAAM;IACrC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAA;IACnC,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAA;CAC/C;AAED,MAAM,WAAW,yBAAyB,CAAC,MAAM,CAAE,SAAQ,sBAAsB,CAAC,MAAM,CAAC;IACvF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,MAAM,WAAW,2BAA2B,CAAC,MAAM,CAAE,SAAQ,sBAAsB,CAAC,MAAM,CAAC;IACzF,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAA;CACzC;AAED,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAA;gBAE3B,IAAI,EAAE,wBAAwB,EAAE,OAAO,EAAE,MAAM;CAK5D;AAoED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,OAAO,EAAE,yBAAyB,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CAQ9G;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,OAAO,EAAE,2BAA2B,CAAC,MAAM,CAAC,GAAG,eAAe,CAAC,MAAM,CAAC,CAKlH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,yCAAyC,CAAA;AACvD,cAAc,4BAA4B,CAAA"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
// src/browserDappHost.ts
|
|
2
|
+
import { bindPageLifecycle } from "@ariestools/browser-kit-page";
|
|
3
|
+
import { bindWorkerShutdown } from "@ariestools/browser-kit-worker";
|
|
4
|
+
var BrowserDappHostErrorCode = { durableJournalRequired: "browser-dapp-host.durable-journal-required" };
|
|
5
|
+
var BrowserDappHostError = class extends Error {
|
|
6
|
+
code;
|
|
7
|
+
constructor(code, message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = "BrowserDappHostError";
|
|
10
|
+
this.code = code;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
function assertReadOnly(status) {
|
|
14
|
+
if (status.writeState === "not-applicable" && status.writeCapabilities.length === 0) return;
|
|
15
|
+
throw new BrowserDappHostError(
|
|
16
|
+
BrowserDappHostErrorCode.durableJournalRequired,
|
|
17
|
+
"The initial browser host accepts only dApps with no write-capable application operations"
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
var BrowserDappHostInstance = class {
|
|
21
|
+
disposeLifecycle;
|
|
22
|
+
launch;
|
|
23
|
+
stopPromise;
|
|
24
|
+
constructor(launch) {
|
|
25
|
+
this.launch = launch;
|
|
26
|
+
void launch.outcome.then((outcome) => {
|
|
27
|
+
if (outcome.outcome !== "ready") this.disposeLifecycle?.();
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
bindLifecycle(dispose) {
|
|
31
|
+
this.disposeLifecycle = dispose;
|
|
32
|
+
}
|
|
33
|
+
status() {
|
|
34
|
+
return this.launch.status();
|
|
35
|
+
}
|
|
36
|
+
stop() {
|
|
37
|
+
this.stopPromise ??= this.stopOnce();
|
|
38
|
+
return this.stopPromise;
|
|
39
|
+
}
|
|
40
|
+
async whenReady() {
|
|
41
|
+
const session = await this.launch.whenReady();
|
|
42
|
+
try {
|
|
43
|
+
assertReadOnly(session.status());
|
|
44
|
+
} catch (error) {
|
|
45
|
+
try {
|
|
46
|
+
await this.stop();
|
|
47
|
+
} catch (stopError) {
|
|
48
|
+
throw new AggregateError(
|
|
49
|
+
[error, stopError],
|
|
50
|
+
"The browser dApp host rejected a writable session and failed to stop it",
|
|
51
|
+
{ cause: error }
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
return session.ports;
|
|
57
|
+
}
|
|
58
|
+
async stopOnce() {
|
|
59
|
+
this.disposeLifecycle?.();
|
|
60
|
+
await this.launch.stop();
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
function createFacade(instance) {
|
|
64
|
+
return Object.freeze({
|
|
65
|
+
status: () => instance.status(),
|
|
66
|
+
stop: () => instance.stop(),
|
|
67
|
+
whenReady: async () => await instance.whenReady()
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
function createPageDappHost(options) {
|
|
71
|
+
const instance = new BrowserDappHostInstance(options.launch);
|
|
72
|
+
const host = createFacade(instance);
|
|
73
|
+
instance.bindLifecycle(bindPageLifecycle(host, {
|
|
74
|
+
onStopError: options.onStopError,
|
|
75
|
+
target: options.target
|
|
76
|
+
}));
|
|
77
|
+
return host;
|
|
78
|
+
}
|
|
79
|
+
function createWorkerDappHost(options) {
|
|
80
|
+
const instance = new BrowserDappHostInstance(options.launch);
|
|
81
|
+
const host = createFacade(instance);
|
|
82
|
+
instance.bindLifecycle(bindWorkerShutdown(options.endpoint, host, { onStopError: options.onStopError }));
|
|
83
|
+
return host;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// src/messagePortApplicationPortEndpoint.ts
|
|
87
|
+
var MessagePortApplicationPortEndpoint = class {
|
|
88
|
+
listeners = /* @__PURE__ */ new Map();
|
|
89
|
+
port;
|
|
90
|
+
constructor(port) {
|
|
91
|
+
this.port = port;
|
|
92
|
+
}
|
|
93
|
+
addMessageListener(listener) {
|
|
94
|
+
if (this.listeners.has(listener)) return;
|
|
95
|
+
const eventListener = (event) => listener(event.data);
|
|
96
|
+
this.listeners.set(listener, eventListener);
|
|
97
|
+
this.port.addEventListener("message", eventListener);
|
|
98
|
+
}
|
|
99
|
+
removeMessageListener(listener) {
|
|
100
|
+
const eventListener = this.listeners.get(listener);
|
|
101
|
+
if (eventListener === void 0) return;
|
|
102
|
+
this.listeners.delete(listener);
|
|
103
|
+
this.port.removeEventListener("message", eventListener);
|
|
104
|
+
}
|
|
105
|
+
send(message) {
|
|
106
|
+
this.port.postMessage(message);
|
|
107
|
+
}
|
|
108
|
+
start() {
|
|
109
|
+
this.port.start();
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
function createMessagePortApplicationPortEndpoint(port) {
|
|
113
|
+
return new MessagePortApplicationPortEndpoint(port);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/index.ts
|
|
117
|
+
export * from "@xyo-network/dapp-kit-port";
|
|
118
|
+
export {
|
|
119
|
+
BrowserDappHostError,
|
|
120
|
+
BrowserDappHostErrorCode,
|
|
121
|
+
createMessagePortApplicationPortEndpoint,
|
|
122
|
+
createPageDappHost,
|
|
123
|
+
createWorkerDappHost
|
|
124
|
+
};
|
|
125
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/browserDappHost.ts", "../../src/messagePortApplicationPortEndpoint.ts", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["import { bindPageLifecycle } from '@ariestools/browser-kit-page'\nimport type { WorkerMessageEndpoint } from '@ariestools/browser-kit-worker'\nimport { bindWorkerShutdown } from '@ariestools/browser-kit-worker'\nimport type {\n DappLaunch,\n DappStatus,\n} from '@xyo-network/dapp-kit'\n\nexport const BrowserDappHostErrorCode = { durableJournalRequired: 'browser-dapp-host.durable-journal-required' } as const\n\nexport type BrowserDappHostErrorCode = typeof BrowserDappHostErrorCode[keyof typeof BrowserDappHostErrorCode]\n\nexport interface BrowserDappHost<TPorts> {\n status(): DappStatus\n stop(): Promise<void>\n whenReady(): Promise<TPorts>\n}\n\ninterface BrowserDappHostOptions<TPorts> {\n readonly launch: DappLaunch<TPorts>\n readonly onStopError: (error: unknown) => void\n}\n\nexport interface CreatePageDappHostOptions<TPorts> extends BrowserDappHostOptions<TPorts> {\n readonly target?: Window\n}\n\nexport interface CreateWorkerDappHostOptions<TPorts> extends BrowserDappHostOptions<TPorts> {\n readonly endpoint: WorkerMessageEndpoint\n}\n\nexport class BrowserDappHostError extends Error {\n readonly code: BrowserDappHostErrorCode\n\n constructor(code: BrowserDappHostErrorCode, message: string) {\n super(message)\n this.name = 'BrowserDappHostError'\n this.code = code\n }\n}\n\nfunction assertReadOnly(status: DappStatus): void {\n if (status.writeState === 'not-applicable' && status.writeCapabilities.length === 0) return\n throw new BrowserDappHostError(\n BrowserDappHostErrorCode.durableJournalRequired,\n 'The initial browser host accepts only dApps with no write-capable application operations',\n )\n}\n\nclass BrowserDappHostInstance<TPorts> {\n private disposeLifecycle?: () => void\n private readonly launch: DappLaunch<TPorts>\n private stopPromise?: Promise<void>\n\n constructor(launch: DappLaunch<TPorts>) {\n this.launch = launch\n void launch.outcome.then((outcome) => {\n if (outcome.outcome !== 'ready') this.disposeLifecycle?.()\n })\n }\n\n bindLifecycle(dispose: () => void): void {\n this.disposeLifecycle = dispose\n }\n\n status(): DappStatus {\n return this.launch.status()\n }\n\n stop(): Promise<void> {\n this.stopPromise ??= this.stopOnce()\n return this.stopPromise\n }\n\n async whenReady(): Promise<TPorts> {\n const session = await this.launch.whenReady()\n try {\n assertReadOnly(session.status())\n } catch (error) {\n try {\n await this.stop()\n } catch (stopError) {\n throw new AggregateError(\n [error, stopError],\n 'The browser dApp host rejected a writable session and failed to stop it',\n { cause: error },\n )\n }\n throw error\n }\n return session.ports\n }\n\n private async stopOnce(): Promise<void> {\n this.disposeLifecycle?.()\n await this.launch.stop()\n }\n}\n\nfunction createFacade<TPorts>(instance: BrowserDappHostInstance<TPorts>): BrowserDappHost<TPorts> {\n return Object.freeze({\n status: () => instance.status(),\n stop: () => instance.stop(),\n whenReady: async () => await instance.whenReady(),\n })\n}\n\nexport function createPageDappHost<TPorts>(options: CreatePageDappHostOptions<TPorts>): BrowserDappHost<TPorts> {\n const instance = new BrowserDappHostInstance(options.launch)\n const host = createFacade(instance)\n instance.bindLifecycle(bindPageLifecycle(host, {\n onStopError: options.onStopError,\n target: options.target,\n }))\n return host\n}\n\nexport function createWorkerDappHost<TPorts>(options: CreateWorkerDappHostOptions<TPorts>): BrowserDappHost<TPorts> {\n const instance = new BrowserDappHostInstance(options.launch)\n const host = createFacade(instance)\n instance.bindLifecycle(bindWorkerShutdown(options.endpoint, host, { onStopError: options.onStopError }))\n return host\n}\n", "import type { ApplicationPortMessageEndpoint } from '@xyo-network/dapp-kit-port'\n\nclass MessagePortApplicationPortEndpoint implements ApplicationPortMessageEndpoint {\n private readonly listeners = new Map<(message: unknown) => void, (event: MessageEvent<unknown>) => void>()\n private readonly port: MessagePort\n\n constructor(port: MessagePort) {\n this.port = port\n }\n\n addMessageListener(listener: (message: unknown) => void): void {\n if (this.listeners.has(listener)) return\n const eventListener = (event: MessageEvent<unknown>) => listener(event.data)\n this.listeners.set(listener, eventListener)\n this.port.addEventListener('message', eventListener)\n }\n\n removeMessageListener(listener: (message: unknown) => void): void {\n const eventListener = this.listeners.get(listener)\n if (eventListener === undefined) return\n this.listeners.delete(listener)\n this.port.removeEventListener('message', eventListener)\n }\n\n send(message: unknown): void {\n this.port.postMessage(message)\n }\n\n start(): void {\n this.port.start()\n }\n}\n\nexport function createMessagePortApplicationPortEndpoint(port: MessagePort): ApplicationPortMessageEndpoint {\n return new MessagePortApplicationPortEndpoint(port)\n}\n", "export * from './browserDappHost.ts'\nexport * from './messagePortApplicationPortEndpoint.ts'\nexport * from '@xyo-network/dapp-kit-port'\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messagePortApplicationPortEndpoint.d.ts","sourceRoot":"","sources":["../../src/messagePortApplicationPortEndpoint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,4BAA4B,CAAA;AAiChF,wBAAgB,wCAAwC,CAAC,IAAI,EAAE,WAAW,GAAG,8BAA8B,CAE1G"}
|
package/package.json
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xyo-network/dapp-kit-browser",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Browser lifecycle owners and application-port transport for headless XL1 dApps",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"xyo",
|
|
7
|
+
"xl1",
|
|
8
|
+
"dapp",
|
|
9
|
+
"browser",
|
|
10
|
+
"typescript"
|
|
11
|
+
],
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/XYOracleNetwork/dapp-kit/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/XYOracleNetwork/dapp-kit.git",
|
|
18
|
+
"directory": "packages/dapp-kit-browser"
|
|
19
|
+
},
|
|
20
|
+
"license": "UNLICENSED",
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": {
|
|
25
|
+
"types": "./dist/browser/index.d.ts",
|
|
26
|
+
"default": "./dist/browser/index.mjs"
|
|
27
|
+
},
|
|
28
|
+
"./package.json": "./package.json",
|
|
29
|
+
"./README.md": "./README.md"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@xyo-network/dapp-kit-port": "~0.1.2",
|
|
37
|
+
"@xyo-network/dapp-kit": "~0.1.2"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@ariestools/browser-kit-page": "~1.1.0",
|
|
41
|
+
"@ariestools/browser-kit-worker": "~1.1.0",
|
|
42
|
+
"@ariestools/toolchain": "~8.7.29",
|
|
43
|
+
"@ariestools/tsconfig": "~8.7.29",
|
|
44
|
+
"@ariestools/tsconfig-dom": "~8.7.29",
|
|
45
|
+
"@noble/hashes": "~2.3.0",
|
|
46
|
+
"eslint": "~10.8.1",
|
|
47
|
+
"eslint-import-resolver-typescript": "~4.4.5",
|
|
48
|
+
"typescript": "~6.0.3",
|
|
49
|
+
"vite": "~8.2.1",
|
|
50
|
+
"vitest": "~4.1.10",
|
|
51
|
+
"zod": "~4.4.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@ariestools/browser-kit-page": "^1.1",
|
|
55
|
+
"@ariestools/browser-kit-worker": "^1.1",
|
|
56
|
+
"@noble/hashes": "^2.3",
|
|
57
|
+
"zod": "^4.4"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=24"
|
|
61
|
+
},
|
|
62
|
+
"publishConfig": {
|
|
63
|
+
"access": "public"
|
|
64
|
+
},
|
|
65
|
+
"scripts": {
|
|
66
|
+
"test": "vitest run",
|
|
67
|
+
"test:ci": "vitest run"
|
|
68
|
+
}
|
|
69
|
+
}
|