@dimchansky/meshpost 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,70 @@
1
+ export const uuidPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
2
+ export const maxAttemptNumber = 0x7fffffff;
3
+ /** Check whether a value is a lowercase hyphenated UUID string. */
4
+ export function isUuid(value) {
5
+ return typeof value === 'string' && uuidPattern.test(value);
6
+ }
7
+ /** Generate an RFC 4122 v4 UUID even in non-secure contexts (e.g. plain HTTP LAN) where crypto.randomUUID is absent. */
8
+ export function randomUuid() {
9
+ if (typeof crypto.randomUUID === 'function')
10
+ return crypto.randomUUID();
11
+ const bytes = crypto.getRandomValues(new Uint8Array(16));
12
+ bytes[6] = (bytes[6] & 0x0f) | 0x40;
13
+ bytes[8] = (bytes[8] & 0x3f) | 0x80;
14
+ const hex = Array.from(bytes, (b) => b.toString(16).padStart(2, '0')).join('');
15
+ return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
16
+ }
17
+ /** Deterministic 64-bit hex hash (works even in non-secure contexts such as file://). */
18
+ export function namespaceHash(input) {
19
+ let h1 = 0xdeadbeef ^ input.length;
20
+ let h2 = 0x41c6ce57 ^ input.length;
21
+ for (let i = 0; i < input.length; i++) {
22
+ const ch = input.charCodeAt(i);
23
+ h1 = Math.imul(h1 ^ ch, 2654435761);
24
+ h2 = Math.imul(h2 ^ ch, 1597334677);
25
+ }
26
+ h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);
27
+ h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);
28
+ return (h2 >>> 0).toString(16).padStart(8, '0') + (h1 >>> 0).toString(16).padStart(8, '0');
29
+ }
30
+ /** Type guard validating a parsed signaling payload (`need`, `offer`, or `answer`). */
31
+ export function isSignal(value) {
32
+ if (!value || typeof value !== 'object')
33
+ return false;
34
+ if (!('kind' in value))
35
+ return false;
36
+ if (value.kind === 'need') {
37
+ return ('previous' in value &&
38
+ (value.previous === null ||
39
+ (typeof value.previous === 'number' &&
40
+ Number.isSafeInteger(value.previous) &&
41
+ value.previous > 0 &&
42
+ value.previous <= maxAttemptNumber)));
43
+ }
44
+ return ((value.kind === 'offer' || value.kind === 'answer') &&
45
+ 'attempt' in value &&
46
+ typeof value.attempt === 'number' &&
47
+ Number.isSafeInteger(value.attempt) &&
48
+ value.attempt > 0 &&
49
+ value.attempt <= maxAttemptNumber &&
50
+ 'sdp' in value &&
51
+ typeof value.sdp === 'string' &&
52
+ value.sdp.length <= 64 * 1024);
53
+ }
54
+ /** Add a fallback for co-located endpoints when multicast DNS is unavailable.
55
+ * Preserve the original candidate and its priority. Never transmit this local hint.
56
+ */
57
+ export function withLoopbackFallback(signal) {
58
+ if (signal.kind === 'need')
59
+ return signal;
60
+ const eol = signal.sdp.includes('\r\n') ? '\r\n' : '\n';
61
+ let index = 0;
62
+ const lines = [];
63
+ for (const line of signal.sdp.split(eol)) {
64
+ lines.push(line);
65
+ const match = /^a=candidate:\S+ (\d+) udp \d+ [a-z0-9.-]+\.local (\d+) typ host(?: |$)/i.exec(line);
66
+ if (match)
67
+ lines.push(`a=candidate:mp${++index} ${match[1]} udp 1 127.0.0.1 ${match[2]} typ host`);
68
+ }
69
+ return index ? { ...signal, sdp: lines.join(eol) } : signal;
70
+ }
package/dist/tabs.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { type Signaling } from './signaling.js';
2
+ /** Discover tabs in the same origin and storage partition. Carries signaling only. */
3
+ export declare function tabSignaling(): Signaling;
package/dist/tabs.js ADDED
@@ -0,0 +1,93 @@
1
+ import { isSignal, isUuid, namespaceHash } from './signaling.js';
2
+ const maxSeenPeers = 256;
3
+ /** Discover tabs in the same origin and storage partition. Carries signaling only. */
4
+ export function tabSignaling() {
5
+ return (discovery) => {
6
+ const scope = discovery.appId +
7
+ ':' +
8
+ discovery.room +
9
+ (discovery.password !== undefined ? ':' + discovery.password : '');
10
+ const channel = new BroadcastChannel('meshpost/1/' + namespaceHash(scope));
11
+ const seen = new Map();
12
+ let closed = false;
13
+ const post = (body) => channel.postMessage({ ...body, from: discovery.self });
14
+ const roster = () => discovery.roster([...seen.keys()]);
15
+ const touch = (id) => {
16
+ const known = seen.has(id);
17
+ if (!known && seen.size >= maxSeenPeers) {
18
+ const oldest = seen.keys().next().value;
19
+ if (oldest !== undefined)
20
+ seen.delete(oldest);
21
+ }
22
+ seen.delete(id);
23
+ seen.set(id, Date.now());
24
+ if (!known)
25
+ roster();
26
+ return known;
27
+ };
28
+ channel.onmessage = ({ data }) => {
29
+ if (closed || !data || !isUuid(data.from) || data.from === discovery.self)
30
+ return;
31
+ if (data.to !== undefined && data.to !== discovery.self)
32
+ return;
33
+ switch (data.type) {
34
+ case 'hello':
35
+ touch(data.from);
36
+ post({ type: 'present', to: data.from });
37
+ break;
38
+ case 'heartbeat':
39
+ if (!touch(data.from))
40
+ post({ type: 'present', to: data.from });
41
+ break;
42
+ case 'present':
43
+ touch(data.from);
44
+ break;
45
+ case 'bye':
46
+ if (seen.delete(data.from))
47
+ roster();
48
+ break;
49
+ case 'signal':
50
+ if (isSignal(data.signal)) {
51
+ touch(data.from);
52
+ discovery.receive(data.from, data.signal);
53
+ }
54
+ break;
55
+ }
56
+ };
57
+ const timer = setInterval(() => {
58
+ let changed = false;
59
+ for (const [id, last] of seen) {
60
+ if (Date.now() - last > 30_000) {
61
+ seen.delete(id);
62
+ changed = true;
63
+ }
64
+ }
65
+ if (changed)
66
+ roster();
67
+ if (!closed)
68
+ post({ type: 'heartbeat' });
69
+ }, 5000);
70
+ queueMicrotask(() => {
71
+ if (closed)
72
+ return;
73
+ discovery.status('online');
74
+ post({ type: 'hello' });
75
+ });
76
+ return {
77
+ send(to, signal) {
78
+ if (closed)
79
+ return false;
80
+ post({ type: 'signal', to, signal });
81
+ return true;
82
+ },
83
+ close() {
84
+ if (closed)
85
+ return;
86
+ closed = true;
87
+ clearInterval(timer);
88
+ post({ type: 'bye' });
89
+ channel.close();
90
+ }
91
+ };
92
+ };
93
+ }
@@ -0,0 +1,180 @@
1
+ # Room behavior and wire protocol
2
+
3
+ This document specifies limits, lifecycle rules, wire formats, and security boundaries for Meshpost v1.
4
+
5
+ ## Limits and timeouts
6
+
7
+ | Parameter | Default / Limit | Notes |
8
+ | ---------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------- |
9
+ | Max packet size | `16,384` bytes (16 KiB) | Or the smaller peer SCTP `maxMessageSize`. |
10
+ | `createChannel` payload max | `16,384 - (1 + nameBytes.length)` bytes | `name` must be `1–64` UTF-8 bytes. |
11
+ | Send buffer limit | `64 KiB` unreliable / `256 KiB` reliable | Per peer and per data channel. Exceeding returns `'busy'`. |
12
+ | `onDrain` threshold | `32 KiB` unreliable / `128 KiB` reliable | Fires when `bufferedAmount` drops to half the data channel limit. |
13
+ | `maxPeers` | `32` | Simultaneous peer connections per room. |
14
+ | `handshakeTimeoutMs` | `35,000` ms (`180,000` ms manual demo) | Deadline per connection attempt before retry. |
15
+ | `iceGatheringTimeoutMs` | `2,500` ms (up to `10,000` ms with TURN) | Max wait for ICE candidates before publishing SDP (default capped at `handshakeTimeoutMs / 2`). |
16
+ | Disconnect grace period | `8,000` ms | Wait time for transient `disconnected` state before dropping. |
17
+ | Leave flush grace | `750` ms | Max wait for `meshpost/1/leave` to flush on `room.leave()`. |
18
+ | Early-packet buffer | `64` packets or `256 KiB` per peer | Holds packets arriving before both data channels open. |
19
+ | Discovery lease | `30,000` ms (`5,000` ms heartbeat) | Peers send a heartbeat every 5,000 ms and expire from the roster after 30,000 ms of silence. |
20
+ | MQTT handshake timeout | `10,000` ms | Deadline for `CONNECT -> CONNACK -> SUBACK` per broker. |
21
+ | MQTT replay window / MID TTL | `±60,000` ms / `120,000` ms | Anti-replay window for password-encrypted MQTT signaling. |
22
+
23
+ ## Room lifecycle
24
+
25
+ ### Identity and membership
26
+
27
+ - `joinRoom(name, options)` generates a fresh random peer ID (UUID v4, exposed as `room.id`). A page reload creates a new peer ID.
28
+ - `joinRoom()` returns synchronously and starts discovery immediately.
29
+ - `room.peers` returns a snapshot array of remote peer IDs whose unreliable and reliable channels are both open.
30
+ - Subscribe to `onPeerJoin` and `onPeerLeave` for future changes. Each subscription returns an unsubscribe function.
31
+ - A room of `N` peers forms up to `N(N - 1) / 2` direct connections (bounded per peer by `maxPeers`).
32
+ - There is no host election, packet forwarding, or history replay. Any peer can join first.
33
+
34
+ ### Roster and retries
35
+
36
+ - Meshpost uses the signaling roster only to start new connections. Removing a peer ID stops future retries, but does not close an already-open link.
37
+ - Meshpost retries missing connections with increasing random delays (`350 ms` to `8 s` base delay with `±25%` jitter) while the peer remains in the roster and signaling is `'online'`.
38
+ - When `signalingState` transitions back to `'online'`, Meshpost automatically resumes discovery for all advertised peers without an active link.
39
+
40
+ ### Disconnects and `leave()`
41
+
42
+ - A `failed` or `closed` connection drops immediately.
43
+ - A transient `disconnected` state waits `8,000` ms before dropping.
44
+ - Calling `room.leave()` more than once has no extra effect.
45
+ - Local `room.send()` throws immediately after `leave()` starts. `room.getStats()` returns `Promise<null>` instead of throwing.
46
+ - `room.signalingState` changes to `'closed'` before `onPeerLeave` callbacks run.
47
+ - `onSignalingChange` emits `'closed'` at most once.
48
+ - Meshpost attempts to send `meshpost/1/leave` over the reliable channel and waits up to `750` ms before closing the `RTCPeerConnection`.
49
+ - Abruptly closing a tab can skip the departure notice. Other peer pairs keep working normally.
50
+
51
+ ### Synchronous errors
52
+
53
+ - `joinRoom()` throws `TypeError` for invalid `name` (`^[a-zA-Z0-9_-]{1,64}$`), invalid `appId` (`^[a-zA-Z0-9._-]{1,64}$`), or empty `password`.
54
+ - `joinRoom()` throws `RangeError` for invalid timeouts or `maxPeers`, throws browser errors immediately if `rtcConfig` is malformed, and throws `Error` if `mqttSignaling()` is used with `password` without `crypto.subtle`.
55
+ - `room.send()` throws `Error` after `leave()`, and `TypeError` for non-`Uint8Array` payloads or invalid `delivery`.
56
+ - `createChannel()` throws `TypeError` for an empty name or invalid `delivery`, and `RangeError` if the UTF-8 name exceeds 64 bytes.
57
+
58
+ ## Sending and receiving
59
+
60
+ `room.send(bytes, { to?, delivery? })` takes a `Uint8Array` and defaults to `delivery: 'unreliable'`.
61
+
62
+ - Without `to`, Meshpost snapshots `room.peers` and attempts one independent send per peer.
63
+ - No local echo occurs. An empty room returns an empty map.
64
+ - Unicast to yourself or an unknown peer ID returns `'unavailable'`.
65
+
66
+ | `SendResult` | Meaning |
67
+ | ------------- | ---------------------------------------------------------------------------------- |
68
+ | `accepted` | The browser accepted the packet into the channel send buffer. |
69
+ | `busy` | Adding the packet would exceed the channel budget, or the browser buffer is full. |
70
+ | `unavailable` | No open channel exists for this peer, or the channel closed during send. |
71
+ | `too-large` | The packet exceeds `16,384` bytes or the smaller negotiated SCTP `maxMessageSize`. |
72
+
73
+ ### Delivery guarantees and backpressure
74
+
75
+ - Both channels preserve message boundaries. Empty (`0`-byte) packets are valid.
76
+ - Meshpost keeps no internal send queue. Check the returned `SendResult` map.
77
+ - Subscribe to `room.onDrain(peerId, delivery)` to resume sending after `'busy'`.
78
+ - Reliable delivery preserves order only within one live channel. A disconnect can drop unacknowledged packets.
79
+ - Broadcast sends one independent packet to each peer. A send can succeed for one peer and fail for another, and peers can receive packets in different orders.
80
+ - A return value of `'accepted'` never proves that the remote app processed the packet.
81
+
82
+ ### Connection stats (`room.getStats(peerId)`)
83
+
84
+ - Returns `Promise<PeerStats | null>` for a connected remote peer, or `null` if the peer is unknown, not ready, disconnected while awaiting stats, or the room is closed.
85
+ - `rttMs` is the active ICE candidate pair's `currentRoundTripTime` rounded to whole milliseconds (`>= 0`), or `null` if unavailable.
86
+ - `route` is `'relay'` if either the local or remote active candidate is a TURN `'relay'`, `'direct'` if both candidate types are known and neither is `'relay'`, and `'unknown'` otherwise.
87
+ - `bytesSent` and `bytesReceived` sum WebRTC `data-channel` application payload counters across stream `0` and stream `1` (for the current connection; monotonic across ICE path switches, reset on reconnect).
88
+ - `bufferedUnreliable` and `bufferedReliable` report each channel's `bufferedAmount` read after `pc.getStats()` resolves.
89
+
90
+ ### Application patterns
91
+
92
+ - **State snapshots (unreliable):** Include a per-sender sequence number and discard stale packets. Reset state on `onPeerLeave`.
93
+ - **Critical commands (reliable):** Add application message IDs, acknowledgements, and retries if commands must survive reconnects.
94
+
95
+ ## Wire protocol (v1)
96
+
97
+ ### Negotiation (avoiding simultaneous offers / glare)
98
+
99
+ - When two peers discover each other at the same time, only the peer with the lexicographically smaller UUID creates the SDP offer.
100
+ - The offerer assigns strictly increasing `attempt` numbers starting from a random 28-bit positive integer (valid range `1..2^31 - 1`).
101
+ - Stale offers, stale answers, invalid SDPs, extreme attempt jumps (`> 1024` above a known baseline), and callbacks from replaced links cannot poison `previous` or close a newer link.
102
+ - Duplicate `answer` delivery is ignored once the first `answer` for an attempt is applied.
103
+
104
+ ### ICE gathering and loopback fallback
105
+
106
+ - Each side waits to publish one complete SDP (no trickle ICE required by adapters).
107
+ - Publication occurs when `iceGatheringState` reaches `'complete'` or when `iceGatheringTimeoutMs` elapses, whichever comes first.
108
+ - When you configure TURN servers (or `iceTransportPolicy: 'relay'`) and omit `iceGatheringTimeoutMs`, Meshpost waits up to `min(10,000 ms, handshakeTimeoutMs / 2)` for the first `relay` or public (`srflx`) candidate.
109
+ - By default, `defaultIceServers` provides public Cloudflare and Google STUN servers. Override with `rtcConfig.iceServers` or extend with `turnConfig`.
110
+ - To help two browsers on the same machine connect when mDNS `.local` names fail to resolve, Meshpost adds a low-priority (priority `1`) `127.0.0.1` candidate for each remote UDP `.local` candidate (unless `iceTransportPolicy` is `'relay'`).
111
+ - Original candidates stay intact, and Meshpost never sends this local fallback over signaling.
112
+
113
+ ### SCTP data channels
114
+
115
+ Each `RTCPeerConnection` creates two pre-negotiated channels with `protocol` set to `appId`:
116
+
117
+ | Stream ID | Label | Configuration |
118
+ | --------: | ----------------------- | ----------------------------------- |
119
+ | 0 | `meshpost/1/unreliable` | `ordered: false, maxRetransmits: 0` |
120
+ | 1 | `meshpost/1/reliable` | `ordered: true` (full reliability) |
121
+
122
+ ### Framing and early packets
123
+
124
+ - Application messages on both channels are raw binary `ArrayBuffer` frames. `room.send()` adds no library header.
125
+ - A text message `'meshpost/1/leave'` on stream `1` signals graceful departure. Other text messages are ignored.
126
+ - Incoming binary packets larger than `16,384` bytes are ignored on stream `0` and close the link on stream `1`.
127
+ - Packets arriving before both channels open are buffered up to `64` packets and `256 KiB` per peer.
128
+ - Exceeding the early buffer drops excess unreliable packets or closes the incomplete link on a reliable packet.
129
+ - Buffered packets fire strictly after `onPeerJoin`.
130
+
131
+ ### Logical channels (`createChannel`)
132
+
133
+ - `createChannel(room, name, { delivery })` frames packets as `[nameLen (1 byte), ...utf8(name), ...payload]`.
134
+ - `nameLen` is `1–64` bytes. Meshpost filters incoming frames by delivery mode and exact name prefix, then passes a `subarray` view of the original `Uint8Array` (no copy).
135
+
136
+ ## Signaling adapters
137
+
138
+ ### Custom `Signaling` contract
139
+
140
+ - A `Signaling` factory receives `Discovery` (`appId`, `room`, `self`, optional `password`, `roster`, `receive`, `status`) and returns `{ send(to, signal), close() }`.
141
+ - `send(to, signal)` must return `boolean` (`true` when accepted for delivery; returning `false` drops the pending link).
142
+ - Report `status('online')` before publishing a roster.
143
+ - Deliver a roster containing a sender before calling `receive(from, signal)`.
144
+ - Isolate rooms by `(appId, room)` (and `password` if used).
145
+
146
+ | `Signal` | Purpose |
147
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------ |
148
+ | `{ kind: 'need', previous }` | Answerer requests an offer. Matching `previous` starts a new attempt; otherwise pending offer resends. |
149
+ | `{ kind: 'offer', attempt, sdp }` | Offerer publishes its complete SDP offer. |
150
+ | `{ kind: 'answer', attempt, sdp }` | Answerer replies to the named attempt. |
151
+
152
+ ### `tabSignaling()`
153
+
154
+ - Uses a `BroadcastChannel` scoped to `namespaceHash(appId:room[:password])`.
155
+ - Sends `hello` on join, `heartbeat` every 5 s (`O(N)` steady-state traffic), and expires peers after 30 s.
156
+ - Validates sender UUIDs and caps tracked peers at `256`.
157
+
158
+ ### `mqttSignaling(options?)`
159
+
160
+ - Zero-dependency MQTT 3.1.1 client over WebSocket connecting to `urls` (default `defaultMqttRelays`) in parallel.
161
+ - Waits for `CONNACK` and `SUBACK` within `handshakeTimeoutMs` (`10 s`), monitors `PINGRESP` every 20 s, and caps incoming buffers at `128 KiB`.
162
+ - Splits traffic across two topics: `${roomTopic}` for presence (`hello`, `heartbeat`, `bye`) and `${roomTopic}/${peerId}` for targeted `present` and `signal` messages.
163
+ - Deduplicates messages across brokers using `${from}:${mid}` with a `120 s` TTL (and reuses one startup `mid` for initial `hello`).
164
+ - Transitions to `'offline'` if all brokers fail on startup or disconnect later, then reconnects with jittered backoff.
165
+
166
+ ### `manualSignaling(outgoing)`
167
+
168
+ - Produces JSON envelopes with `{ v: 1, app, room, from, auth?, to?, signal? }`.
169
+ - `auth` is a hash tag derived from `(appId, room, password)` when `password` is set; the raw password is never included.
170
+ - Does not emit a `need` signal when you accept an `offer` directly, and ignores duplicate `need` retries.
171
+ - Provides `contact()`, `accept(text)` (max `128 KiB`), and `forget(peerId)`.
172
+
173
+ ## Security model
174
+
175
+ - **In-transit data:** WebRTC DTLS encrypts all data channel traffic end-to-end between connected peers.
176
+ - **Signaling integrity:** SDP contains the DTLS certificate fingerprint. An attacker who can modify signaling messages can intercept and alter the handshake (MitM).
177
+ - **Public MQTT without `password`:** Anyone on a public broker can observe room topics or tamper with unencrypted SDP. Use `password` or a trusted signaling server whenever confidentiality or authenticity matters.
178
+ - **Public MQTT with `password`:** Meshpost encrypts and authenticates MQTT signaling payloads with AES-256-GCM (key derived via PBKDF2-SHA256, 100,000 iterations) and binds each message to its MQTT topic as additional authenticated data (AAD). To block replays, it rejects timestamps outside `±60 s` and tracks seen message IDs (`mid`) for `120 s`. Browser encryption (`crypto.subtle`) requires HTTPS or `localhost`.
179
+ - **Manual signaling:** Exchange connection text only over a trusted channel with the intended peer.
180
+ - **Application concerns:** Durable user identity, authorization, shared state, and game rules belong in the application layer.
package/package.json CHANGED
@@ -1,6 +1,67 @@
1
1
  {
2
2
  "name": "@dimchansky/meshpost",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "author": "Dmitrij Koniajev",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "description": "Zero-dependency TypeScript library for hostless browser-to-browser WebRTC mesh rooms.",
9
+ "keywords": [
10
+ "webrtc",
11
+ "p2p",
12
+ "peer-to-peer",
13
+ "mesh",
14
+ "datachannel",
15
+ "serverless",
16
+ "mqtt",
17
+ "typescript",
18
+ "esm"
19
+ ],
20
+ "homepage": "https://github.com/dimchansky/meshpost#readme",
21
+ "repository": {
22
+ "type": "git",
23
+ "url": "git+https://github.com/dimchansky/meshpost.git"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/dimchansky/meshpost/issues"
27
+ },
28
+ "engines": {
29
+ "node": ">=22"
30
+ },
31
+ "publishConfig": {
32
+ "access": "public"
33
+ },
34
+ "main": "./dist/index.js",
35
+ "types": "./dist/index.d.ts",
36
+ "exports": {
37
+ ".": {
38
+ "types": "./dist/index.d.ts",
39
+ "import": "./dist/index.js"
40
+ }
41
+ },
42
+ "files": [
43
+ "dist/*.js",
44
+ "dist/*.d.ts",
45
+ "README.md",
46
+ "LICENSE",
47
+ "docs"
48
+ ],
49
+ "scripts": {
50
+ "clean": "node -e \"import('node:fs').then(fs => fs.rmSync('dist', { recursive: true, force: true }))\"",
51
+ "build": "tsc -p tsconfig.json",
52
+ "check:pkg": "publint",
53
+ "demo": "npm run build && node examples/build.mjs",
54
+ "test": "npm run demo && playwright test",
55
+ "demo:tabs": "npm run demo && node examples/serve.mjs",
56
+ "prepack": "npm run clean && npm run build",
57
+ "format": "prettier --write .",
58
+ "format:check": "prettier --check ."
59
+ },
60
+ "devDependencies": {
61
+ "@playwright/test": "1.56.1",
62
+ "esbuild": "0.25.12",
63
+ "prettier": "3.6.2",
64
+ "publint": "0.3.25",
65
+ "typescript": "5.9.3"
66
+ }
67
+ }