From 7a557f95e4db038fada0bfe7c96efa0f12b8e957 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Tue, 7 Jul 2026 21:39:06 +0200 Subject: [PATCH 01/75] Stage 0: scaffold peershell monorepo (npm workspaces) - shared/ @peershell/protocol: wire protocol (binary framing with peerId, control messages), SessionTransport interface, PIN challenge-response, UTF-8 splitter, room-code/token/tunnel-path validators. Builds via tsc. - clients/tabby (tabby-peershell): self-contained Angular 15 / webpack build (externalizes Angular/RxJS/tabby-*, bundles @peershell/protocol), Stage 0 NgModule skeleton + Node smoke-load test (loads/constructs as Tabby would). - clients/web + server: placeholders (Stage 4 / Stage 5). - PROTOCOL.md spec, README (no-E2E disclaimer + dev workflow), build:all pipeline, copy-web-asset / publish-plugins scripts, .gitignore. build:all green; `npm test` smoke-load PASS. --- .gitignore | 12 + PROTOCOL.md | 100 + README.md | 56 + clients/tabby/package.json | 59 + clients/tabby/src/index.ts | 17 + clients/tabby/test/smoke-load.cjs | 34 + clients/tabby/tsconfig.json | 30 + clients/tabby/webpack.config.mjs | 132 + clients/web/build.mjs | 14 + clients/web/package.json | 14 + clients/web/src/index.html | 16 + package-lock.json | 4316 +++++++++++++++++++++++++++++ package.json | 30 + scripts/copy-web-asset.mjs | 22 + scripts/publish-plugins.mjs | 22 + server/package.json | 14 + server/src/README.md | 8 + shared/package.json | 18 + shared/src/api.ts | 65 + shared/src/index.ts | 4 + shared/src/pinAuth.ts | 53 + shared/src/protocol.ts | 101 + shared/src/utf8Splitter.ts | 20 + shared/tsconfig.json | 19 + 24 files changed, 5176 insertions(+) create mode 100644 .gitignore create mode 100644 PROTOCOL.md create mode 100644 README.md create mode 100644 clients/tabby/package.json create mode 100644 clients/tabby/src/index.ts create mode 100644 clients/tabby/test/smoke-load.cjs create mode 100644 clients/tabby/tsconfig.json create mode 100644 clients/tabby/webpack.config.mjs create mode 100644 clients/web/build.mjs create mode 100644 clients/web/package.json create mode 100644 clients/web/src/index.html create mode 100644 package-lock.json create mode 100644 package.json create mode 100644 scripts/copy-web-asset.mjs create mode 100644 scripts/publish-plugins.mjs create mode 100644 server/package.json create mode 100644 server/src/README.md create mode 100644 shared/package.json create mode 100644 shared/src/api.ts create mode 100644 shared/src/index.ts create mode 100644 shared/src/pinAuth.ts create mode 100644 shared/src/protocol.ts create mode 100644 shared/src/utf8Splitter.ts create mode 100644 shared/tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9ace0b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +node_modules/ +dist/ +typings/ +*.tsbuildinfo +.webpack-cache/ + +# Generated: web-client bundle embedded into the Tabby plugin (built from clients/web) +clients/tabby/assets/web-client.html + +# Local env / secrets +.env +*.local diff --git a/PROTOCOL.md b/PROTOCOL.md new file mode 100644 index 0000000..e3fe92d --- /dev/null +++ b/PROTOCOL.md @@ -0,0 +1,100 @@ +# peershell wire protocol (v1 — draft, frozen at Stage 5) + +Language-neutral spec of the peershell wire protocol. Implemented once in `@peershell/protocol` +(`shared/`) and consumed by every client (Tabby plugin, web-client, future native terminal, future +mobile app) and by the server. Native ports (Swift/Kotlin/Dart) should follow this document. + +## Roles and transport + +- **host**: a Tabby (or future terminal) instance sharing one local terminal session. Opens a single + **outbound** WSS connection to the server. No inbound ports, no NAT traversal, no STUN/TURN. +- **guest**: a peer that views + controls the shared session (Tabby desktop, browser via magic-link, + or mobile). Connects to the server (browser/mobile reach the server's public URL via cloudflared). +- **server**: rendezvous + blind relay + reverse HTTP tunnel + accounts/dashboard. After pairing it + **forwards every frame verbatim** between host and a guest; it never needs to parse terminal bytes. + +Data path is always host <-> server <-> guest. There is no direct peer link in the MVP; the transport +sits behind a `SessionTransport` interface so a future WebRTC DataChannel can replace the relay leg. + +## Framing + +One WebSocket carries two frame kinds (`ws.binaryType = 'arraybuffer'`): + +- **TEXT frame = JSON control message** — the envelope below. +- **BINARY frame = terminal data** — layout: + + ``` + [ peerId: uint32 big-endian ][ tag: uint8 ][ raw PTY bytes ... ] + tag: 0x01 = output (host -> guest), 0x02 = input (guest -> host) + ``` + + Raw PTY bytes are **never** decoded as UTF-8 in transit. A multibyte codepoint may be split across + frames; the **receiving client** is responsible for reassembling via a UTF-8 splitter before writing + to its terminal (Tabby desktop gets this from `UTF8SplitterMiddleware`; web/mobile use + `@peershell/protocol`'s `Utf8Splitter`). MVP uses `peerId = 0` (1 host + 1 guest). `peerId` exists so + the server can route frames once multiple guests are supported. + +## Control envelope + +``` +{ "t": , "v": 1, "peerId"?: , ... } +``` + +`v` is `PROTOCOL_VERSION` (currently 1). Unknown/incompatible `v` -> `error{code:"bad-version"}`. + +### REST (client -> server, not WebSocket) +- `POST /register { email, password }` +- `POST /login { email, password } -> { token } | { needs2fa: true, challenge }` +- `POST /2fa/verify { challenge, code } -> { token }` +- `GET /sessions -> { sessions: [{ room, magicLink, createdAt }] }` (dashboard, authenticated) + +### Signaling (client <-> server, WS TEXT) +- `hello { role: "host"|"guest", kind?: "desktop"|"web"|"mobile", client }` +- `create-session { }` (host, authenticated) -> `session-created { room, magicLink }` +- `session-close { }` (host) — revokes the magic-link +- `join { room?|token?, name? }` (guest) +- `peer-joined { peerId, kind }` (to host) +- `peer-left { peerId, reason }` +- `error { code, message }` +- `ping {}` / `pong {}` + +### PIN auth (host <-> peer, relayed; gates every incoming connection) +- `pin-challenge { nonce }` — host sends a **fresh, single-use** nonce per attempt +- `pin-response { hash }` — `hash = H(pin, nonce)` (e.g. SHA-256); raw PIN never sent +- `pin-ok {}` / `pin-fail { left }` — host verifies locally; rate-limited (~5 tries), then kick + +### Sync (after pin-ok, relayed) +- `snapshot { cols, rows, data }` — `data` = base64 of the host's `frontend.saveState()` VT snapshot +- `snapshot-ack {}` — guest confirms it rendered the snapshot; **barrier**: host starts streaming + `output` only after receiving the ack (avoids output-before-snapshot race) +- `resize { cols, rows }` — host -> guest only (tmate model; guest never resizes the host PTY) + +### Terminal data (after pin-ok + snapshot-ack) +- BINARY tag `0x01` output (host -> guest), `0x02` input (guest -> host). See Framing. + +### HTTP tunnel (server <-> host — serves the web-client page over the host's outbound leg) +- `http-get { peerId, reqId, path, headers }` +- `http-response { peerId, reqId, status, headers, bodyBase64 }` +- Correlation key = `(peerId, reqId)`. NOT real HTTP: these are application frames over the WS; the + Electron renderer does not open a listening port. The host validates `path` against a strict + **whitelist** (only `/`), rejecting traversal/SSRF (`..`, absolute paths, `file://`, `http://`); + anything else -> `403`. + +## Tokens, PIN, keepalive + +- **magic-link token**: opaque, CSPRNG, **TTL 15 min** (default, configurable), **single-use = revoked + after a join completes (post `pin-ok`)** — not on first GET. Expired join -> `error{code:"link-expired", + suggestRenew:true}`. Host can revoke anytime. +- **room-code** (if shown): Crockford base32 minus ambiguous chars; client validates `^[2-9A-HJ-NP-Z]{6,10}$`. +- **PIN**: per-session, local only, min 6 digits (8+ recommended for hostile environments). Verified via + `H(pin, nonce)` challenge-response. A hostile relay sees `nonce`+`hash` and can brute-force short PINs + **offline** — hence entropy + rate-limit; a future PAKE (SPAKE2) removes this if the relay is untrusted. +- **keepalive**: `ping` every 20s from both ends; `ping`/`pong` do **not** reset the liveness timer — only + real frames (control/snapshot/output/input) do. No real frame for 60s -> close + `peer-left`. + +## Security note (MVP) + +The MVP has **no end-to-end encryption**: the relay sees terminal I/O in cleartext (commands, output, +env vars, secrets). Self-hosting is required for production use. An E2E layer (e.g. ChaCha20/AES-GCM with +a key derived from the PIN/passphrase) can be added behind `SessionTransport` without changing this +protocol's shape. The PIN itself never crosses the wire in cleartext. diff --git a/README.md b/README.md new file mode 100644 index 0000000..40a7c20 --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# peershell + +> Take your terminal anywhere and work as if it were local. + +Share one live terminal session with remote peers and let them see the exact screen and type as if +local — from another **Tabby** (via the `tabby-peershell` plugin), from a **browser** (via a magic-link), +and, in future, from a dedicated **mobile app** or **our own terminal**. Same wire protocol everywhere. + +It is the `tmate` / VS Code Live Share model, brokered by a lightweight rendezvous server: the host opens +a single **outbound** connection (no inbound ports, no NAT), the server pairs peers and blindly relays +frames, and it reverse-tunnels the web page from the host. See [`PROTOCOL.md`](./PROTOCOL.md). + +## Security — read this first + +**The MVP has NO end-to-end encryption.** The relay server sees every byte of the terminal in cleartext: +typed commands, output, environment variables, secrets, keys. **Do not use it for sensitive data unless +you self-host the relay.** Access to a shared session requires **both** a magic-link **and** a per-session +**PIN** that is validated locally and never sent to the server in cleartext. End-to-end encryption is +planned behind the same transport interface. + +## Monorepo layout (npm workspaces) + +``` +shared/ @peershell/protocol — TS-only, framework-neutral wire protocol (published to npm) +clients/tabby/ tabby-peershell — the Tabby plugin (Angular/Electron); all Tabby-specific code +clients/web/ @peershell/web-client — standalone browser client (xterm.js), embedded + served by host +server/ @peershell/server — rendezvous + relay + tunnel + accounts (implemented later) +``` + +> This repo uses **npm workspaces** (npm >= 9). It is independent of Tabby's package manager: the plugin +> is discovered by Tabby at runtime from its built `dist/`, not installed into Tabby's workspace. + +## Development + +Requires Node >= 18 and a checkout of the Tabby source at `/opt/tabby` (used for `tabby-*` types; the +plugin build is self-contained and does not need Tabby's `node_modules`). + +```sh +npm install # installs all workspaces (self-contained Angular 15 + webpack toolchain) +npm run build:all # shared -> web -> copy asset -> tabby -> server (in order) +npm run watch:tabby # iterate on the plugin (Tabby has no hot-reload; reload its window after a build) +``` + +Load the built plugin into a running Tabby (on your desktop): + +```sh +# option A: symlink into Tabby's user plugins dir +ln -s /opt/peershell/clients/tabby ~/.config/tabby/plugins/node_modules/tabby-peershell +# option B: dev env var (from a Tabby source checkout) +TABBY_DEV=1 TABBY_PLUGINS=/opt/peershell/clients/tabby yarn start +``` + +## Publishing + +`tabby-peershell` is published to npm from `clients/tabby/` (keyword `tabby-plugin`, so Tabby's plugin +manager can find it). See `scripts/publish-plugins.mjs`. diff --git a/clients/tabby/package.json b/clients/tabby/package.json new file mode 100644 index 0000000..df94714 --- /dev/null +++ b/clients/tabby/package.json @@ -0,0 +1,59 @@ +{ + "name": "tabby-peershell", + "version": "0.1.0", + "description": "Share your terminal session anywhere (peershell) — collaborative terminal for Tabby", + "keywords": [ + "tabby-plugin" + ], + "main": "dist/index.js", + "author": "tis24dev", + "license": "Apache-2.0", + "repository": "https://github.com/tis24dev/peershell", + "files": [ + "dist", + "assets" + ], + "scripts": { + "build": "webpack --progress --color --config ./webpack.config.mjs", + "watch": "webpack --progress --color --watch --config ./webpack.config.mjs", + "test": "node test/smoke-load.cjs" + }, + "dependencies": { + "@peershell/protocol": "*" + }, + "peerDependencies": { + "tabby-core": "*", + "tabby-settings": "*", + "tabby-terminal": "*" + }, + "devDependencies": { + "@angular/animations": "^15.2.6", + "@angular/common": "^15.2.6", + "@angular/compiler": "^15.2.6", + "@angular/compiler-cli": "^15.2.6", + "@angular/core": "^15.2.6", + "@angular/forms": "^15.2.6", + "@angular/platform-browser": "^15.2.6", + "@babel/core": "^7.22.0", + "@ng-bootstrap/ng-bootstrap": "^14.1.0", + "@ngtools/webpack": "^15.2.5", + "@tabby-gang/to-string-loader": "^1.1.7-beta.2", + "@types/node": "20.3.1", + "apply-loader": "2.0.0", + "babel-loader": "^9.1.2", + "css-loader": "^6.7.3", + "ngx-toastr": "^16.0.2", + "pug-loader": "^2.4.0", + "rxjs": "^7.5.7", + "sass": "^1.63.4", + "sass-loader": "^13.2.0", + "source-map-loader": "^4.0.1", + "style-loader": "^3.3.1", + "svg-inline-loader": "^0.8.2", + "tslib": "^2.6.0", + "typescript": "^4.9.5", + "webpack": "^5.90.0", + "webpack-cli": "^5.0.1", + "yaml-loader": "0.8.0" + } +} diff --git a/clients/tabby/src/index.ts b/clients/tabby/src/index.ts new file mode 100644 index 0000000..417e1c4 --- /dev/null +++ b/clients/tabby/src/index.ts @@ -0,0 +1,17 @@ +/* eslint-disable @typescript-eslint/no-extraneous-class */ +import { NgModule } from '@angular/core' + +import { PROTOCOL_VERSION } from '@peershell/protocol' + +/** + * Stage 0 skeleton. Verifies the plugin builds (self-contained toolchain), bundles + * @peershell/protocol, and is discovered + instantiated by Tabby. Real providers + * (share/join, transport, session mirror, settings) land in later stages. + */ +@NgModule({}) +export default class PeershellModule { + constructor () { + // eslint-disable-next-line no-console + console.log(`[peershell] plugin loaded — protocol v${PROTOCOL_VERSION} (Stage 0 skeleton)`) + } +} diff --git a/clients/tabby/test/smoke-load.cjs b/clients/tabby/test/smoke-load.cjs new file mode 100644 index 0000000..8ca3b9d --- /dev/null +++ b/clients/tabby/test/smoke-load.cjs @@ -0,0 +1,34 @@ +// Stage 0 smoke test: load the built UMD bundle the way Tabby would (nodeRequire), with the +// externalized host packages stubbed, and instantiate the default NgModule. Confirms the bundle +// is valid, @peershell/protocol is inlined, and the plugin constructs (logs) without a real Tabby. +// Full GUI verification happens by loading dist/ into a real Tabby (see README). +const Module = require('module') +const path = require('path') + +const stubs = { + '@angular/core': { NgModule: () => target => target }, +} +const origLoad = Module._load +Module._load = function (request, parent, isMain) { + if (Object.prototype.hasOwnProperty.call(stubs, request)) { + return stubs[request] + } + return origLoad.call(this, request, parent, isMain) +} + +const bundle = require(path.resolve(__dirname, '..', 'dist', 'index.js')) +const PluginModule = bundle.default || bundle + +if (typeof PluginModule !== 'function') { + console.error('FAIL: default export is not a class/function:', typeof PluginModule) + process.exit(1) +} + +// Instantiating triggers the module constructor's console.log. +const instance = new PluginModule() +if (!instance) { + console.error('FAIL: could not instantiate the plugin module') + process.exit(1) +} + +console.log('PASS: bundle loaded and PeershellModule instantiated:', PluginModule.name || '(anonymous)') diff --git a/clients/tabby/tsconfig.json b/clients/tabby/tsconfig.json new file mode 100644 index 0000000..837abd8 --- /dev/null +++ b/clients/tabby/tsconfig.json @@ -0,0 +1,30 @@ +{ + "compilerOptions": { + "module": "es2015", + "target": "es2016", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "strictNullChecks": true, + "noImplicitReturns": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "importHelpers": true, + "sourceMap": true, + "baseUrl": ".", + "lib": ["DOM", "ES2019", "ES2020"], + "paths": { + "@peershell/protocol": ["../../shared/src"], + "tabby-core": ["../../../tabby/tabby-core/src"], + "tabby-terminal": ["../../../tabby/tabby-terminal/src"], + "tabby-settings": ["../../../tabby/tabby-settings/src"] + } + }, + "angularCompilerOptions": { + "strictTemplates": true, + "enableResourceInlining": true, + "strictInjectionParameters": true + }, + "include": ["src"] +} diff --git a/clients/tabby/webpack.config.mjs b/clients/tabby/webpack.config.mjs new file mode 100644 index 0000000..5dea8f0 --- /dev/null +++ b/clients/tabby/webpack.config.mjs @@ -0,0 +1,132 @@ +// Self-contained plugin build. Mirrors Tabby's webpack.plugin.config.mjs but imports the toolchain +// from THIS repo's node_modules (the /opt/tabby checkout is source-only, not installed), and bundles +// our own code + @peershell/protocol (+ xterm later). Angular/RxJS/@ng-bootstrap/ngx-toastr/tabby-* +// are externalized: Tabby provides them at runtime. +import * as fs from 'fs' +import * as path from 'path' +import * as url from 'url' +import wp from 'webpack' +import { AngularWebpackPlugin } from '@ngtools/webpack' +import { createEs2015LinkerPlugin } from '@angular/compiler-cli/linker/babel' + +const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) +const root = path.resolve(__dirname, '..', '..') + +const linkerPlugin = createEs2015LinkerPlugin({ + linkerJitMode: true, + fileSystem: { + resolve: path.resolve, + exists: fs.existsSync, + dirname: path.dirname, + relative: path.relative, + readFile: fs.readFileSync, + }, +}) + +export default () => { + const isDev = !!process.env.TABBY_DEV + return { + target: 'node', + entry: path.resolve(__dirname, 'src/index.ts'), + context: __dirname, + mode: isDev ? 'development' : 'production', + devtool: false, + optimization: { minimize: false }, + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'index.js', + pathinfo: true, + libraryTarget: 'umd', + publicPath: 'auto', + }, + resolve: { + modules: [ + path.join(__dirname, 'src'), + path.join(__dirname, 'node_modules'), + path.join(root, 'node_modules'), + 'node_modules', + ], + extensions: ['.ts', '.js'], + mainFields: ['esm2015', 'browser', 'module', 'main'], + }, + resolveLoader: { + modules: [path.join(root, 'node_modules'), path.join(__dirname, 'node_modules'), 'node_modules'], + }, + ignoreWarnings: [/Failed to parse source map/], + module: { + rules: [ + { + test: /\.js$/, + enforce: 'pre', + use: { + loader: 'source-map-loader', + options: { + filterSourceMappingUrl: (_url, resourcePath) => { + if (/node_modules/.test(resourcePath) && !resourcePath.includes('xterm')) { + return false + } + return true + }, + }, + }, + }, + { + test: /\.(m?)js$/, + loader: 'babel-loader', + options: { + plugins: [linkerPlugin], + compact: false, + cacheDirectory: true, + }, + resolve: { fullySpecified: false }, + }, + { + test: /\.ts$/, + use: [{ loader: '@ngtools/webpack' }], + }, + { + test: /\.pug$/, + use: [ + 'apply-loader', + { loader: 'pug-loader', options: { pretty: true } }, + ], + }, + { test: /\.scss$/, use: ['@tabby-gang/to-string-loader', 'css-loader', 'sass-loader'], include: /(theme.*|component)\.scss/ }, + { test: /\.scss$/, use: ['style-loader', 'css-loader', 'sass-loader'], exclude: /(theme.*|component)\.scss/ }, + { test: /\.css$/, use: ['@tabby-gang/to-string-loader', 'css-loader'], include: /component\.css/ }, + { test: /\.css$/, use: ['style-loader', 'css-loader'], exclude: /component\.css/ }, + { test: /\.yaml$/, use: ['yaml-loader'] }, + { test: /\.svg/, use: ['svg-inline-loader'] }, + { test: /\.html$/, type: 'asset/source' }, + ], + }, + externals: [ + '@electron/remote', + 'child_process', + 'electron', + 'fs', + 'net', + 'ngx-toastr', + 'os', + 'path', + 'readline', + 'stream', + /^@angular(?!\/common\/locales)/, + /^@ng-bootstrap/, + /^rxjs/, + /^tabby-/, + ], + plugins: [ + new wp.SourceMapDevToolPlugin({ + exclude: [/node_modules/, /vendor/], + filename: '[file].map', + moduleFilenameTemplate: 'webpack-tabby-peershell:///[resource-path]', + }), + new AngularWebpackPlugin({ + tsconfig: path.resolve(__dirname, 'tsconfig.json'), + directTemplateLoading: false, + jitMode: true, + }), + ], + } +} diff --git a/clients/web/build.mjs b/clients/web/build.mjs new file mode 100644 index 0000000..9ddd0dc --- /dev/null +++ b/clients/web/build.mjs @@ -0,0 +1,14 @@ +#!/usr/bin/env node +// Stage 0 build: emit a self-contained dist/index.html (placeholder). +// Stage 4 replaces this with a webpack (target 'web') build that inlines xterm.js + the transport. +import * as fs from 'fs' +import * as path from 'path' +import * as url from 'url' + +const dir = path.resolve(url.fileURLToPath(new URL('.', import.meta.url))) +const src = path.join(dir, 'src', 'index.html') +const outDir = path.join(dir, 'dist') + +fs.mkdirSync(outDir, { recursive: true }) +fs.copyFileSync(src, path.join(outDir, 'index.html')) +console.log('[web-client] wrote dist/index.html (Stage 0 placeholder)') diff --git a/clients/web/package.json b/clients/web/package.json new file mode 100644 index 0000000..7b0e1a5 --- /dev/null +++ b/clients/web/package.json @@ -0,0 +1,14 @@ +{ + "name": "@peershell/web-client", + "version": "0.1.0", + "private": true, + "description": "peershell standalone browser client (xterm.js) — served by the host over the tunnel", + "license": "Apache-2.0", + "scripts": { + "build": "node build.mjs", + "test": "echo \"(web-client: implemented in Stage 4)\"" + }, + "dependencies": { + "@peershell/protocol": "*" + } +} diff --git a/clients/web/src/index.html b/clients/web/src/index.html new file mode 100644 index 0000000..2a0fff3 --- /dev/null +++ b/clients/web/src/index.html @@ -0,0 +1,16 @@ + + + + + + peershell + + + +
+

peershell

+

Web client placeholder — not yet implemented (Stage 4).

+
+ + diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7381a13 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,4316 @@ +{ + "name": "peershell", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "peershell", + "version": "0.0.0", + "license": "Apache-2.0", + "workspaces": [ + "shared", + "clients/web", + "clients/tabby", + "server" + ], + "devDependencies": { + "typescript": "^4.9.5" + }, + "engines": { + "node": ">=18" + } + }, + "clients/tabby": { + "name": "tabby-peershell", + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@peershell/protocol": "*" + }, + "devDependencies": { + "@angular/animations": "^15.2.6", + "@angular/common": "^15.2.6", + "@angular/compiler": "^15.2.6", + "@angular/compiler-cli": "^15.2.6", + "@angular/core": "^15.2.6", + "@angular/forms": "^15.2.6", + "@angular/platform-browser": "^15.2.6", + "@babel/core": "^7.22.0", + "@ng-bootstrap/ng-bootstrap": "^14.1.0", + "@ngtools/webpack": "^15.2.5", + "@tabby-gang/to-string-loader": "^1.1.7-beta.2", + "@types/node": "20.3.1", + "apply-loader": "2.0.0", + "babel-loader": "^9.1.2", + "css-loader": "^6.7.3", + "ngx-toastr": "^16.0.2", + "pug-loader": "^2.4.0", + "rxjs": "^7.5.7", + "sass": "^1.63.4", + "sass-loader": "^13.2.0", + "source-map-loader": "^4.0.1", + "style-loader": "^3.3.1", + "svg-inline-loader": "^0.8.2", + "tslib": "^2.6.0", + "typescript": "^4.9.5", + "webpack": "^5.90.0", + "webpack-cli": "^5.0.1", + "yaml-loader": "0.8.0" + }, + "peerDependencies": { + "tabby-core": "*", + "tabby-settings": "*", + "tabby-terminal": "*" + } + }, + "clients/web": { + "name": "@peershell/web-client", + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@peershell/protocol": "*" + } + }, + "node_modules/@ampproject/remapping": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.3.0.tgz", + "integrity": "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@angular/animations": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/animations/-/animations-15.2.10.tgz", + "integrity": "sha512-yxfN8qQpMaukRU5LjFkJBmy85rqrOp86tYVCsf+hmPEFRiXBMUj6xYLeCMcpk3Mt1JtnWGBR34ivGx+7bNeAow==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/core": "15.2.10" + } + }, + "node_modules/@angular/common": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-15.2.10.tgz", + "integrity": "sha512-jdBn3fctkqoNrJn9VLsUHpcCEhCxWSczdsR+BBbD6T0oLl6vMrAVNjPwfBejnlgfWN1KoRU9kgOYsMxa5apIWQ==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/core": "15.2.10", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@angular/compiler": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-15.2.10.tgz", + "integrity": "sha512-M0XkeU0O73UlJZwDvOyp8/apetz9UKj78eTFDseMYJDLcxe6MpkbkxqpsGZnKYDj7LIep8PmCAKEkhtenE82zw==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/core": "15.2.10" + }, + "peerDependenciesMeta": { + "@angular/core": { + "optional": true + } + } + }, + "node_modules/@angular/compiler-cli": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-15.2.10.tgz", + "integrity": "sha512-mCFIxrs60XicKfA2o42hA7LrQvhybi9BQveWuZn/2iIEOXx7R62Iemz8E21pLWftAZHGxEW3NECfBrY1d3gVmA==", + "dependencies": { + "@babel/core": "7.19.3", + "@jridgewell/sourcemap-codec": "^1.4.14", + "chokidar": "^3.0.0", + "convert-source-map": "^1.5.1", + "dependency-graph": "^0.11.0", + "magic-string": "^0.27.0", + "reflect-metadata": "^0.1.2", + "semver": "^7.0.0", + "tslib": "^2.3.0", + "yargs": "^17.2.1" + }, + "bin": { + "ng-xi18n": "bundles/src/bin/ng_xi18n.js", + "ngc": "bundles/src/bin/ngc.js", + "ngcc": "bundles/ngcc/main-ngcc.js" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/compiler": "15.2.10", + "typescript": ">=4.8.2 <5.0" + } + }, + "node_modules/@angular/compiler-cli/node_modules/@babel/core": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.3.tgz", + "integrity": "sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ==", + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-compilation-targets": "^7.19.3", + "@babel/helper-module-transforms": "^7.19.0", + "@babel/helpers": "^7.19.0", + "@babel/parser": "^7.19.3", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.3", + "@babel/types": "^7.19.3", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@angular/compiler-cli/node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@angular/core": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-15.2.10.tgz", + "integrity": "sha512-meGGidnitQJGDxYd9/LrqYiVlId+vGaLoiLgJdKBz+o2ZO6OmXQGuNw2VBqf17/Cc0/UjzrOY7+kILNFKkk/WQ==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "rxjs": "^6.5.3 || ^7.4.0", + "zone.js": "~0.11.4 || ~0.12.0 || ~0.13.0" + } + }, + "node_modules/@angular/forms": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/forms/-/forms-15.2.10.tgz", + "integrity": "sha512-NIntGsNcN6o8L1txsbWXOf6f3K/CUBizdKsxsYVYGJIXEW5qU6UnWmfAZffNNXsT/XvbgUCjgDwT0cAwcqZPuQ==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": "15.2.10", + "@angular/core": "15.2.10", + "@angular/platform-browser": "15.2.10", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@angular/localize": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/localize/-/localize-15.2.10.tgz", + "integrity": "sha512-RHN+mUR4H34c/LLnNPAyQbfuZME4i9JgodK5YRRX8cSAFPafYLT0SspSuLsKtcCCEDadAZNDHzb8qv5MBtzJtg==", + "peer": true, + "dependencies": { + "@babel/core": "7.19.3", + "glob": "8.1.0", + "yargs": "^17.2.1" + }, + "bin": { + "localize-extract": "tools/bundles/src/extract/cli.js", + "localize-migrate": "tools/bundles/src/migrate/cli.js", + "localize-translate": "tools/bundles/src/translate/cli.js" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/compiler": "15.2.10", + "@angular/compiler-cli": "15.2.10" + } + }, + "node_modules/@angular/localize/node_modules/@babel/core": { + "version": "7.19.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.19.3.tgz", + "integrity": "sha512-WneDJxdsjEvyKtXKsaBGbDeiyOjR5vYq4HcShxnIbG0qixpoHjI3MqeZM9NDvsojNCEBItQE4juOo/bU6e72gQ==", + "peer": true, + "dependencies": { + "@ampproject/remapping": "^2.1.0", + "@babel/code-frame": "^7.18.6", + "@babel/generator": "^7.19.3", + "@babel/helper-compilation-targets": "^7.19.3", + "@babel/helper-module-transforms": "^7.19.0", + "@babel/helpers": "^7.19.0", + "@babel/parser": "^7.19.3", + "@babel/template": "^7.18.10", + "@babel/traverse": "^7.19.3", + "@babel/types": "^7.19.3", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.1", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@angular/localize/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "peer": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@angular/platform-browser": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-15.2.10.tgz", + "integrity": "sha512-9tbgVGSJqwfrOzT8aA/kWBLNhJSQ9gUg0CJxwFBSJm8VkBUJrszoBlDsnSvlxx8/W2ejNULKHFTXeUzq0O/+RQ==", + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/animations": "15.2.10", + "@angular/common": "15.2.10", + "@angular/core": "15.2.10" + }, + "peerDependenciesMeta": { + "@angular/animations": { + "optional": true + } + } + }, + "node_modules/@angular/platform-browser-dynamic": { + "version": "15.2.10", + "resolved": "https://registry.npmjs.org/@angular/platform-browser-dynamic/-/platform-browser-dynamic-15.2.10.tgz", + "integrity": "sha512-JHP6W+FX715Qv7DhqvfZLuBZXSDJrboiQsR06gUAgDSjAUyhbqmpVg/2YOtgeWpPkzNDtXdPU2PhcRdIv5J3Yg==", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0" + }, + "peerDependencies": { + "@angular/common": "15.2.10", + "@angular/compiler": "15.2.10", + "@angular/core": "15.2.10", + "@angular/platform-browser": "15.2.10" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", + "integrity": "sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw==", + "dependencies": { + "@babel/helper-validator-identifier": "^7.29.7", + "js-tokens": "^4.0.0", + "picocolors": "^1.1.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/compat-data": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.7.tgz", + "integrity": "sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/core": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.7.tgz", + "integrity": "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA==", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-compilation-targets": "^7.29.7", + "@babel/helper-module-transforms": "^7.29.7", + "@babel/helpers": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/remapping": "^2.3.5", + "convert-source-map": "^2.0.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.2", + "json5": "^2.2.3", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/generator": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.7.tgz", + "integrity": "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ==", + "dependencies": { + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7", + "@jridgewell/gen-mapping": "^0.3.12", + "@jridgewell/trace-mapping": "^0.3.28", + "jsesc": "^3.0.2" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz", + "integrity": "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g==", + "dependencies": { + "@babel/compat-data": "^7.29.7", + "@babel/helper-validator-option": "^7.29.7", + "browserslist": "^4.24.0", + "lru-cache": "^5.1.1", + "semver": "^6.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-compilation-targets/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/@babel/helper-globals": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-globals/-/helper-globals-7.29.7.tgz", + "integrity": "sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz", + "integrity": "sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g==", + "dependencies": { + "@babel/traverse": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz", + "integrity": "sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg==", + "dependencies": { + "@babel/helper-module-imports": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7", + "@babel/traverse": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-option": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz", + "integrity": "sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helpers": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.29.7.tgz", + "integrity": "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg==", + "dependencies": { + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.7.tgz", + "integrity": "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg==", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/template": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", + "integrity": "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/types": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/traverse": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.7.tgz", + "integrity": "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw==", + "dependencies": { + "@babel/code-frame": "^7.29.7", + "@babel/generator": "^7.29.7", + "@babel/helper-globals": "^7.29.7", + "@babel/parser": "^7.29.7", + "@babel/template": "^7.29.7", + "@babel/types": "^7.29.7", + "debug": "^4.3.1" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.7.tgz", + "integrity": "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA==", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@discoveryjs/json-ext": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", + "integrity": "sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==", + "dev": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@ng-bootstrap/ng-bootstrap": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-14.2.0.tgz", + "integrity": "sha512-nqEKVXauSontGKqC5WSKpch5TiAGDZB3hluvxkINS0r9LUE6sBQRP3qeYOe7Uwu+UbQcj28NG3qFHhpfnG8KHw==", + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/common": "^15.0.0", + "@angular/core": "^15.0.0", + "@angular/forms": "^15.0.0", + "@angular/localize": "^15.0.0", + "@popperjs/core": "^2.11.6", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@ngtools/webpack": { + "version": "15.2.11", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-15.2.11.tgz", + "integrity": "sha512-yqp+FziuJ+wIVij4eTqfhuiTPNaG1PU8ukeGOdqkVH4nQMlmzs9UldXy1iYC/6swzn6XO/pkqisU3m/jxemMzA==", + "dev": true, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "@angular/compiler-cli": "^15.0.0", + "typescript": ">=4.8.2 <5.0", + "webpack": "^5.54.0" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz", + "integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.6", + "@parcel/watcher-darwin-arm64": "2.5.6", + "@parcel/watcher-darwin-x64": "2.5.6", + "@parcel/watcher-freebsd-x64": "2.5.6", + "@parcel/watcher-linux-arm-glibc": "2.5.6", + "@parcel/watcher-linux-arm-musl": "2.5.6", + "@parcel/watcher-linux-arm64-glibc": "2.5.6", + "@parcel/watcher-linux-arm64-musl": "2.5.6", + "@parcel/watcher-linux-x64-glibc": "2.5.6", + "@parcel/watcher-linux-x64-musl": "2.5.6", + "@parcel/watcher-win32-arm64": "2.5.6", + "@parcel/watcher-win32-ia32": "2.5.6", + "@parcel/watcher-win32-x64": "2.5.6" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.6.tgz", + "integrity": "sha512-YQxSS34tPF/6ZG7r/Ih9xy+kP/WwediEUsqmtf0cuCV5TPPKw/PQHRhueUo6JdeFJaqV3pyjm0GdYjZotbRt/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.6.tgz", + "integrity": "sha512-Z2ZdrnwyXvvvdtRHLmM4knydIdU9adO3D4n/0cVipF3rRiwP+3/sfzpAwA/qKFL6i1ModaabkU7IbpeMBgiVEA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.6.tgz", + "integrity": "sha512-HgvOf3W9dhithcwOWX9uDZyn1lW9R+7tPZ4sug+NGrGIo4Rk1hAXLEbcH1TQSqxts0NYXXlOWqVpvS1SFS4fRg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.6.tgz", + "integrity": "sha512-vJVi8yd/qzJxEKHkeemh7w3YAn6RJCtYlE4HPMoVnCpIXEzSrxErBW5SJBgKLbXU3WdIpkjBTeUNtyBVn8TRng==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.6.tgz", + "integrity": "sha512-9JiYfB6h6BgV50CCfasfLf/uvOcJskMSwcdH1PHH9rvS1IrNy8zad6IUVPVUfmXr+u+Km9IxcfMLzgdOudz9EQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.6.tgz", + "integrity": "sha512-Ve3gUCG57nuUUSyjBq/MAM0CzArtuIOxsBdQ+ftz6ho8n7s1i9E1Nmk/xmP323r2YL0SONs1EuwqBp2u1k5fxg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.6.tgz", + "integrity": "sha512-f2g/DT3NhGPdBmMWYoxixqYr3v/UXcmLOYy16Bx0TM20Tchduwr4EaCbmxh1321TABqPGDpS8D/ggOTaljijOA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.6.tgz", + "integrity": "sha512-qb6naMDGlbCwdhLj6hgoVKJl2odL34z2sqkC7Z6kzir8b5W65WYDpLB6R06KabvZdgoHI/zxke4b3zR0wAbDTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.6.tgz", + "integrity": "sha512-kbT5wvNQlx7NaGjzPFu8nVIW1rWqV780O7ZtkjuWaPUgpv2NMFpjYERVi0UYj1msZNyCzGlaCWEtzc+exjMGbQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.6.tgz", + "integrity": "sha512-1JRFeC+h7RdXwldHzTsmdtYR/Ku8SylLgTU/reMuqdVD7CtLwf0VR1FqeprZ0eHQkO0vqsbvFLXUmYm/uNKJBg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.6.tgz", + "integrity": "sha512-3ukyebjc6eGlw9yRt678DxVF7rjXatWiHvTXqphZLvo7aC5NdEgFufVwjFfY51ijYEWpXbqF5jtrK275z52D4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.6.tgz", + "integrity": "sha512-k35yLp1ZMwwee3Ez/pxBi5cf4AoBKYXj00CZ80jUz5h8prpiaQsiRPKQMxoLstNuqe2vR4RNPEAEcjEFzhEz/g==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.6.tgz", + "integrity": "sha512-hbQlYcCq5dlAX9Qx+kFb0FHue6vbjlf0FrNzSKdYK2APUf7tGfGxQCk2ihEREmbR6ZMc0MVAD5RIX/41gpUzTw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher/node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true, + "optional": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@peershell/protocol": { + "resolved": "shared", + "link": true + }, + "node_modules/@peershell/server": { + "resolved": "server", + "link": true + }, + "node_modules/@peershell/web-client": { + "resolved": "clients/web", + "link": true + }, + "node_modules/@popperjs/core": { + "version": "2.11.8", + "resolved": "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz", + "integrity": "sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/popperjs" + } + }, + "node_modules/@tabby-gang/to-string-loader": { + "version": "1.1.7-beta.2", + "resolved": "https://registry.npmjs.org/@tabby-gang/to-string-loader/-/to-string-loader-1.1.7-beta.2.tgz", + "integrity": "sha512-2hgj8KMl2Qm4dcruu1iFZqeIMXLvMpNrEKIDjEjei5NbQ/aOagOozPQV4B/jlTDybiLiXzx33Ys6Xj/8tVXZMw==", + "dev": true, + "dependencies": { + "loader-utils": "^1.0.0" + } + }, + "node_modules/@types/babel-types": { + "version": "7.0.16", + "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.16.tgz", + "integrity": "sha512-5QXs9GBFTNTmilLlWBhnsprqpjfrotyrnzUdwDrywEL/DA4LuCWQT300BTOXA3Y9ngT9F2uvmCoIxI6z8DlJEA==", + "dev": true, + "peer": true + }, + "node_modules/@types/babylon": { + "version": "6.16.9", + "resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.9.tgz", + "integrity": "sha512-sEKyxMVEowhcr8WLfN0jJYe4gS4Z9KC2DGz0vqfC7+MXFbmvOF7jSjALC77thvAO2TLgFUPa9vDeOak+AcUrZA==", + "dev": true, + "peer": true, + "dependencies": { + "@types/babel-types": "*" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true + }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true + }, + "node_modules/@types/node": { + "version": "20.3.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.3.1.tgz", + "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", + "dev": true + }, + "node_modules/@webassemblyjs/ast": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", + "integrity": "sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/helper-numbers": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2" + } + }, + "node_modules/@webassemblyjs/floating-point-hex-parser": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz", + "integrity": "sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-api-error": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz", + "integrity": "sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-buffer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz", + "integrity": "sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-numbers": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz", + "integrity": "sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA==", + "dev": true, + "dependencies": { + "@webassemblyjs/floating-point-hex-parser": "1.13.2", + "@webassemblyjs/helper-api-error": "1.13.2", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/helper-wasm-bytecode": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz", + "integrity": "sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA==", + "dev": true + }, + "node_modules/@webassemblyjs/helper-wasm-section": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz", + "integrity": "sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/wasm-gen": "1.14.1" + } + }, + "node_modules/@webassemblyjs/ieee754": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz", + "integrity": "sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw==", + "dev": true, + "dependencies": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "node_modules/@webassemblyjs/leb128": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.13.2.tgz", + "integrity": "sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw==", + "dev": true, + "dependencies": { + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webassemblyjs/utf8": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.13.2.tgz", + "integrity": "sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ==", + "dev": true + }, + "node_modules/@webassemblyjs/wasm-edit": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz", + "integrity": "sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/helper-wasm-section": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-opt": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1", + "@webassemblyjs/wast-printer": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-gen": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz", + "integrity": "sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wasm-opt": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz", + "integrity": "sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-buffer": "1.14.1", + "@webassemblyjs/wasm-gen": "1.14.1", + "@webassemblyjs/wasm-parser": "1.14.1" + } + }, + "node_modules/@webassemblyjs/wasm-parser": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz", + "integrity": "sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@webassemblyjs/helper-api-error": "1.13.2", + "@webassemblyjs/helper-wasm-bytecode": "1.13.2", + "@webassemblyjs/ieee754": "1.13.2", + "@webassemblyjs/leb128": "1.13.2", + "@webassemblyjs/utf8": "1.13.2" + } + }, + "node_modules/@webassemblyjs/wast-printer": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz", + "integrity": "sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw==", + "dev": true, + "dependencies": { + "@webassemblyjs/ast": "1.14.1", + "@xtuc/long": "4.2.2" + } + }, + "node_modules/@webpack-cli/configtest": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@webpack-cli/configtest/-/configtest-2.1.1.tgz", + "integrity": "sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/info": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/info/-/info-2.0.2.tgz", + "integrity": "sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + } + }, + "node_modules/@webpack-cli/serve": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-2.0.5.tgz", + "integrity": "sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ==", + "dev": true, + "engines": { + "node": ">=14.15.0" + }, + "peerDependencies": { + "webpack": "5.x.x", + "webpack-cli": "5.x.x" + }, + "peerDependenciesMeta": { + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", + "integrity": "sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==", + "dev": true + }, + "node_modules/@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", + "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==", + "dev": true + }, + "node_modules/acorn": { + "version": "4.0.13", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", + "integrity": "sha512-fu2ygVGuMmlzG8ZeRJ0bvR41nsAkxxhbyk8bZ1SS521Z7vmgJFTQQlfz/Mp/nJexGBz+v8sC9bM6+lNgskt4Ug==", + "dev": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-globals": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-3.1.0.tgz", + "integrity": "sha512-uWttZCk96+7itPxK8xCzY86PnxKTMrReKDqrHzv42VQY0K30PUO8WY13WMOuI+cOdX4EIdzdvQ8k6jkuGRFMYw==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "^4.0.4" + } + }, + "node_modules/ajv": { + "version": "8.20.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", + "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv-keywords": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-5.1.0.tgz", + "integrity": "sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.3" + }, + "peerDependencies": { + "ajv": "^8.8.2" + } + }, + "node_modules/align-text": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", + "integrity": "sha512-GrTZLRpmp6wIC2ztrWW9MjjTgSKccffgFagbNDOX95/dcjEcYZibYTeaOntySQLcdw1ztBoFkviiUvTMbb9MYg==", + "dev": true, + "peer": true, + "dependencies": { + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/align-text/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==", + "dev": true, + "peer": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/apply-loader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/apply-loader/-/apply-loader-2.0.0.tgz", + "integrity": "sha512-6DYvIuO7d5z6xixh3ZYt8bRiH+IZvqROYGrESFEGrOatfpk1uDq0d5tH7lxhzhnbFbLH9XjIOhXcTHiUgIBl8g==", + "dev": true, + "dependencies": { + "loader-utils": "^1.1.0" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "peer": true + }, + "node_modules/babel-loader": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.2.1.tgz", + "integrity": "sha512-fqe8naHt46e0yIdkjUZYqddSXfej3AHajX+CSO5X7oy0EmPc6o5Xh+RClNoHjnieWz9AW4kZxW9yyFMhVB1QLA==", + "dev": true, + "dependencies": { + "find-cache-dir": "^4.0.0", + "schema-utils": "^4.0.0" + }, + "engines": { + "node": ">= 14.15.0" + }, + "peerDependencies": { + "@babel/core": "^7.12.0", + "webpack": ">=5" + } + }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", + "dev": true, + "peer": true, + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/babel-types": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", + "integrity": "sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==", + "dev": true, + "peer": true, + "dependencies": { + "babel-runtime": "^6.26.0", + "esutils": "^2.0.2", + "lodash": "^4.17.4", + "to-fast-properties": "^1.0.3" + } + }, + "node_modules/babylon": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", + "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "dev": true, + "peer": true, + "bin": { + "babylon": "bin/babylon.js" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "peer": true + }, + "node_modules/baseline-browser-mapping": { + "version": "2.10.42", + "resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.10.42.tgz", + "integrity": "sha512-c/jurFrDLyui7o1J86yLkRu4LMsTYcBohveus7/I2Hzdn9KIP2bdJPTue/lR1KH46enoPbD77GKeSYNdyPoD3Q==", + "bin": { + "baseline-browser-mapping": "dist/cli.cjs" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/big.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", + "integrity": "sha512-vyL2OymJxmarO8gxMr0mhChsO9QGwhynfuu4+MHTAW6czfq9humCB7rKpUjDd9YUiDPU4mzpyupFSvOClAwbmQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", + "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", + "peer": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browserslist": { + "version": "4.28.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.28.5.tgz", + "integrity": "sha512-Cu2E6QejHWzuDMTkuwgpABFgDfZrXLQq5V13YOACZx4mFAG4IwGTbTfHPMr4WtxlHoXSM8FIuRwYYCz5XiabaQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "baseline-browser-mapping": "^2.10.42", + "caniuse-lite": "^1.0.30001800", + "electron-to-chromium": "^1.5.387", + "node-releases": "^2.0.50", + "update-browserslist-db": "^1.2.3" + }, + "bin": { + "browserslist": "cli.js" + }, + "engines": { + "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", + "integrity": "sha512-wzLkDa4K/mzI1OSITC+DUyjgIl/ETNHE9QvYgy6J6Jvqyyz4C0Xfd+lQhb19sX2jMpZV4IssUn0VDVmglV+s4g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/caniuse-lite": { + "version": "1.0.30001803", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001803.tgz", + "integrity": "sha512-g/uHREV2ZpK9qMalCsWaxmA6ol+DX8GYhuf3T40RKoP+oL7vhRJh8LNt73PCjpnR6l14FzfPrB5Yux4PKm2meg==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ] + }, + "node_modules/center-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", + "integrity": "sha512-Baz3aNe2gd2LP2qk5U+sDk/m4oSuwSDcBfayTCTBoWpfIGO5XFxPmjILQII4NGiZjD6DoDI6kf7gKaxkf7s3VQ==", + "dev": true, + "peer": true, + "dependencies": { + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/character-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", + "integrity": "sha512-+UqJQjFEFaTAs3bNsF2j2kEN1baG/zghZbdqoYEDxGZtJo9LBzl1A+m0D4n3qKx8N2FNv8/Xp6yV9mQmBuptaw==", + "dev": true, + "peer": true, + "dependencies": { + "is-regex": "^1.0.3" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/chrome-trace-event": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz", + "integrity": "sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ==", + "dev": true, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/clean-css": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", + "integrity": "sha512-EJUDT7nDVFDvaQgAo2G/PJvxmp1o/c6iXLbswsBbUFXi1Nr+AjA2cKmfbKDMjMvzEe75g3P6JkaDDAKk96A85A==", + "dev": true, + "peer": true, + "dependencies": { + "source-map": "~0.6.0" + }, + "engines": { + "node": ">= 4.0" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/clone-deep": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-4.0.1.tgz", + "integrity": "sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.2", + "shallow-clone": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true + }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true + }, + "node_modules/common-path-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", + "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", + "dev": true + }, + "node_modules/constantinople": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.1.2.tgz", + "integrity": "sha512-yePcBqEFhLOqSBtwYOGGS1exHo/s1xjekXiinh4itpNQGCu4KA1euPh1fg07N2wMITZXQkBz75Ntdt1ctGZouw==", + "dev": true, + "peer": true, + "dependencies": { + "@types/babel-types": "^7.0.0", + "@types/babylon": "^6.16.2", + "babel-types": "^6.26.0", + "babylon": "^6.18.0" + } + }, + "node_modules/convert-source-map": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" + }, + "node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "dev": true, + "hasInstallScript": true, + "peer": true + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/css-loader": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/css-loader/-/css-loader-6.11.0.tgz", + "integrity": "sha512-CTJ+AEQJjq5NzLga5pE39qdiSV56F8ywCIsqNIRF0r7BDgWsN25aazToqAFg7ZrtA/U016xudB3ffgweORxX7g==", + "dev": true, + "dependencies": { + "icss-utils": "^5.1.0", + "postcss": "^8.4.33", + "postcss-modules-extract-imports": "^3.1.0", + "postcss-modules-local-by-default": "^4.0.5", + "postcss-modules-scope": "^3.2.0", + "postcss-modules-values": "^4.0.0", + "postcss-value-parser": "^4.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/cssesc": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "dev": true, + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/dependency-graph": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.11.0.tgz", + "integrity": "sha512-JeMq7fEshyepOWDfcfHK06N3MhyPhz++vtqWhMT5O9A3K42rdsEDpfdVqjaqaAhsw6a+ZqeDvQVtD0hFHQWrzg==", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctypes": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz", + "integrity": "sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ==", + "dev": true, + "peer": true + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/electron-to-chromium": { + "version": "1.5.388", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.388.tgz", + "integrity": "sha512-Pl/aJaqOOxYxda3vcx1IKSJimwYXHDkEnGn0F+kG2EE68dDtx2uCinaS+Vih8Z91B9t8CSAbiF/HKyWcnXjhzw==" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" + }, + "node_modules/emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/enhanced-resolve": { + "version": "5.24.2", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.24.2.tgz", + "integrity": "sha512-rpsZEGT1jFuve6QlpyRp9ckQ+kN61hvF9BzCPyMdaKTm8UJce96KBn3sorXOFXlzjPrs3Vc4T1NsSroZ3PxlFw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.4", + "tapable": "^2.3.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/envinfo": { + "version": "7.21.0", + "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.21.0.tgz", + "integrity": "sha512-Lw7I8Zp5YKHFCXL7+Dz95g4CcbMEpgvqZNNq3AmlT5XAV6CgAAk6gyAMqn2zjw08K9BHfcNuKrMiCPLByGafow==", + "dev": true, + "bin": { + "envinfo": "dist/cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-module-lexer": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-2.3.0.tgz", + "integrity": "sha512-KLdwQm2NvGLDkQDCGvmiQrhkd0JbMzXthwQAUgWjQuQdBLFa3eiBP5arXZyA+f8x+x7OXgud6bq2rxjGtHV2tw==", + "dev": true + }, + "node_modules/es-object-atoms": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz", + "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==", + "dev": true, + "peer": true, + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz", + "integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/fastest-levenshtein": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", + "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", + "dev": true, + "engines": { + "node": ">= 4.9.1" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-cache-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-4.0.0.tgz", + "integrity": "sha512-9ZonPT4ZAK4a+1pUPVPZJapbi7O5qbbJPdYw/NOQWZZbVLdDTYM3A4R9z/DpAM08IDaFGsvPgiGZ82WEwUDWjg==", + "dev": true, + "dependencies": { + "common-path-prefix": "^3.0.0", + "pkg-dir": "^7.0.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-up": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-6.3.0.tgz", + "integrity": "sha512-v2ZsoEuVHYy8ZIlYqwPe/39Cy+cFDzp4dXPaxNvkEuouymu+2Jbz0PxpKarJHYJTmv2HWT3O382qY8l4jMWthw==", + "dev": true, + "dependencies": { + "locate-path": "^7.1.0", + "path-exists": "^5.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "bin": { + "flat": "cli.js" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "peer": true + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "peer": true, + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "peer": true, + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "peer": true, + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz", + "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/icss-utils": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/icss-utils/-/icss-utils-5.1.0.tgz", + "integrity": "sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/immutable": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.9.tgz", + "integrity": "sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==", + "dev": true + }, + "node_modules/import-local": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", + "integrity": "sha512-2SPlun1JUPWoM6t3F0dw0FkCF/jWY8kttcY4f599GLTSjh2OCuuhdTkJQsEcZzBqbXZGKMK2OqW1oZsjtf/gQA==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "peer": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "peer": true + }, + "node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "peer": true + }, + "node_modules/is-core-module": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", + "dev": true, + "dependencies": { + "hasown": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-expression": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz", + "integrity": "sha512-vyMeQMq+AiH5uUnoBfMTwf18tO3bM6k1QXBE9D6ueAAquEfCZe3AJPtud9g6qS0+4X8xA7ndpZiDyeb2l2qOBw==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "~4.0.2", + "object-assign": "^4.0.1" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "dev": true, + "peer": true + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/javascript-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz", + "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==", + "dev": true + }, + "node_modules/jest-worker": { + "version": "27.5.1", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", + "integrity": "sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/js-stringify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/js-stringify/-/js-stringify-1.0.2.tgz", + "integrity": "sha512-rtS5ATOo2Q5k1G+DADISilDA6lv79zIiwFd6CcjuIxGKLFm5C+RLImRscVap9k55i+MOZwgliw+NejvkLuGD5g==", + "dev": true, + "peer": true + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" + }, + "node_modules/jsesc": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", + "integrity": "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==", + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, + "node_modules/json5": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", + "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==", + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jstransformer": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-1.0.0.tgz", + "integrity": "sha512-C9YK3Rf8q6VAPDCCU9fnqo3mAfOH6vUGnMcP4AQAYIEpWtfGLpwOTmZ+igtdK5y+VvI2n3CyYSzy4Qh34eq24A==", + "dev": true, + "peer": true, + "dependencies": { + "is-promise": "^2.0.0", + "promise": "^7.0.1" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lazy-cache": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", + "integrity": "sha512-RE2g0b5VGZsOCFOCgP7omTRYFqydmZkBwl5oNnQ1lDYC57uyO9KqNnNVxT7COSHTxrRCWVcAVOcbjk+tvh/rgQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/loader-runner": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.2.tgz", + "integrity": "sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w==", + "dev": true, + "engines": { + "node": ">=6.11.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/loader-utils": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.2.tgz", + "integrity": "sha512-I5d00Pd/jwMD2QCduo657+YM/6L3KZu++pmX9VFncxaxvHcru9jx1lBaFft+r4Mt2jK0Yhp41XlRAihzPxHNCg==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/loader-utils/node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, + "node_modules/locate-path": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.2.0.tgz", + "integrity": "sha512-gvVijfZvn7R+2qyPX8mAuKcFGDf6Nc61GdvGafQsHL0sBIxfKzA+usWn4GFC/bk+QdwPUD4kWFJLhElipq+0VA==", + "dev": true, + "dependencies": { + "p-locate": "^6.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", + "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", + "dev": true, + "peer": true + }, + "node_modules/longest": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", + "integrity": "sha512-k+yt5n3l48JU4k8ftnKG6V7u32wyH2NfKzeMto9F/QRE0amxy/LayxwlvjjkZEIzqR+19IrtFO8p5kB9QaYUFg==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "dependencies": { + "yallist": "^3.0.2" + } + }, + "node_modules/magic-string": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.27.0.tgz", + "integrity": "sha512-8UnnX2PeRAPZuN12svgR9j7M1uWMovg/CEnIwIG0LFkXSJJe4PdfUGiTGl8V9bsBHFUtfVINcSyYxd7q+kx9fA==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.13" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", + "integrity": "sha512-7o1wEA2RyMP7Iu7GNba9vc0RWWGACJOCZBJX2GJWip0ikV+wcOsgVuY9uE8CPiyQhkGFSlhuSkZPavN7u1c2Fw==", + "peer": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minimizer-webpack-plugin": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.6.1.tgz", + "integrity": "sha512-DoeAZz8Q1C1znwsUzej1fdoi4jCf7/+Em27ouLqfK/+3m8G+D7yDhUwrc3CNhjSzGUN1kn7Iv4sWmjflQHenpw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "jest-worker": "^27.4.5", + "schema-utils": "^4.3.0", + "terser": "^5.31.1" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.1.0" + }, + "peerDependenciesMeta": { + "@minify-html/node": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "@swc/css": { + "optional": true + }, + "@swc/html": { + "optional": true + }, + "clean-css": { + "optional": true + }, + "cssnano": { + "optional": true + }, + "csso": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "html-minifier-terser": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "postcss": { + "optional": true + }, + "uglify-js": { + "optional": true + } + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "node_modules/nanoid": { + "version": "3.3.15", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", + "integrity": "sha512-y7Wygv/7mEOvxTuEQDB8StXdMRBWf1kR/tlhAzBRUFkB2jfcLOAxO/SHmOO2zgz1pVgK29/kyupn059/bCHdjA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true + }, + "node_modules/ngx-toastr": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/ngx-toastr/-/ngx-toastr-16.2.0.tgz", + "integrity": "sha512-7X6UhOKiaUeC2eTOsUqctZH0ZWKG8VlzDxWJhdEF1N3kPod46SU/Vn2l0hbt8EDwTjxHKfKyevU2idkYDoZYog==", + "dev": true, + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/common": ">=14.0.0-0", + "@angular/core": ">=14.0.0-0", + "@angular/platform-browser": ">=14.0.0-0" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "dev": true, + "optional": true + }, + "node_modules/node-releases": { + "version": "2.0.50", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.50.tgz", + "integrity": "sha512-J6l92tKHX6w8Jy5nO1Vuc01NoIiRGi/d6qBKVxh+IQ8Cr3b6HbVNfKiF8ZpFKufTwpwxMmce2W3iQZ861ZRyTg==", + "engines": { + "node": ">=18" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "peer": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-limit": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", + "integrity": "sha512-5b0R4txpzjPWVw/cXXUResoD4hb6U/x9BH08L7nw+GN1sezDzPdxeRvpc9c433fZhBan/wusjbCsqwqm4EIBIQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^1.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-6.0.0.tgz", + "integrity": "sha512-wPrq66Llhl7/4AGC6I+cqxT07LhXvWL08LNXz1fENOw0Ap4sRZZ/gZpTTJ5jpurzzzfS2W/Ge9BY3LgLjCShcw==", + "dev": true, + "dependencies": { + "p-limit": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", + "integrity": "sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==", + "dev": true, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==" + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pkg-dir": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", + "integrity": "sha512-Ie9z/WINcxxLp27BKOCHGde4ITq9UklYKDzVo1nhk5sqGEXU3FpkwP5GM2voTGJkGd9B3Otl+Q4uwSOeSUtOBA==", + "dev": true, + "dependencies": { + "find-up": "^6.3.0" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/postcss": { + "version": "8.5.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", + "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-modules-extract-imports": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-3.1.0.tgz", + "integrity": "sha512-k3kNe0aNFQDAZGbin48pL2VNidTF0w4/eASDsxlyspobzU3wZQLOGj7L9gfRe0Jo9/4uud09DsjFNH7winGv8Q==", + "dev": true, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-local-by-default": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-modules-local-by-default/-/postcss-modules-local-by-default-4.2.0.tgz", + "integrity": "sha512-5kcJm/zk+GJDSfw+V/42fJ5fhjL5YbFDl8nVdXkJPLLW+Vf9mTD5Xe0wqIaDnLuL2U6cDNpTr+UQ+v2HWIBhzw==", + "dev": true, + "dependencies": { + "icss-utils": "^5.0.0", + "postcss-selector-parser": "^7.0.0", + "postcss-value-parser": "^4.1.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-scope": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/postcss-modules-scope/-/postcss-modules-scope-3.2.1.tgz", + "integrity": "sha512-m9jZstCVaqGjTAuny8MdgE88scJnCiQSlSrOWcTQgM2t32UBe+MUmFSO5t7VMSfAf/FJKImAxBav8ooCHJXCJA==", + "dev": true, + "dependencies": { + "postcss-selector-parser": "^7.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-modules-values": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/postcss-modules-values/-/postcss-modules-values-4.0.0.tgz", + "integrity": "sha512-RDxHkAiEGI78gS2ofyvCsu7iycRv7oqw5xMWn9iMoR0N/7mf9D50ecQqUo5BZ9Zh2vH4bCUR/ktCqbB9m8vJjQ==", + "dev": true, + "dependencies": { + "icss-utils": "^5.0.0" + }, + "engines": { + "node": "^10 || ^12 || >= 14" + }, + "peerDependencies": { + "postcss": "^8.1.0" + } + }, + "node_modules/postcss-selector-parser": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.4.tgz", + "integrity": "sha512-HeP7D2wyhkR+XaK6v4W8oRF62Dsz4flyuczALJp61GckGm42u1saSSJ/0auvcBqxs3jMRFEcPK34At/0JBKdOg==", + "dev": true, + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/postcss-value-parser": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", + "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", + "dev": true + }, + "node_modules/promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", + "dev": true, + "peer": true, + "dependencies": { + "asap": "~2.0.3" + } + }, + "node_modules/pug": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.4.tgz", + "integrity": "sha512-XhoaDlvi6NIzL49nu094R2NA6P37ijtgMDuWE+ofekDChvfKnzFal60bhSdiy8y2PBO6fmz3oMEIcfpBVRUdvw==", + "dev": true, + "peer": true, + "dependencies": { + "pug-code-gen": "^2.0.2", + "pug-filters": "^3.1.1", + "pug-lexer": "^4.1.0", + "pug-linker": "^3.0.6", + "pug-load": "^2.0.12", + "pug-parser": "^5.0.1", + "pug-runtime": "^2.0.5", + "pug-strip-comments": "^1.0.4" + } + }, + "node_modules/pug-attrs": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pug-attrs/-/pug-attrs-2.0.4.tgz", + "integrity": "sha512-TaZ4Z2TWUPDJcV3wjU3RtUXMrd3kM4Wzjbe3EWnSsZPsJ3LDI0F3yCnf2/W7PPFF+edUFQ0HgDL1IoxSz5K8EQ==", + "dev": true, + "peer": true, + "dependencies": { + "constantinople": "^3.0.1", + "js-stringify": "^1.0.1", + "pug-runtime": "^2.0.5" + } + }, + "node_modules/pug-code-gen": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pug-code-gen/-/pug-code-gen-2.0.3.tgz", + "integrity": "sha512-r9sezXdDuZJfW9J91TN/2LFbiqDhmltTFmGpHTsGdrNGp3p4SxAjjXEfnuK2e4ywYsRIVP0NeLbSAMHUcaX1EA==", + "dev": true, + "peer": true, + "dependencies": { + "constantinople": "^3.1.2", + "doctypes": "^1.1.0", + "js-stringify": "^1.0.1", + "pug-attrs": "^2.0.4", + "pug-error": "^1.3.3", + "pug-runtime": "^2.0.5", + "void-elements": "^2.0.1", + "with": "^5.0.0" + } + }, + "node_modules/pug-error": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/pug-error/-/pug-error-1.3.3.tgz", + "integrity": "sha512-qE3YhESP2mRAWMFJgKdtT5D7ckThRScXRwkfo+Erqga7dyJdY3ZquspprMCj/9sJ2ijm5hXFWQE/A3l4poMWiQ==", + "dev": true, + "peer": true + }, + "node_modules/pug-filters": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pug-filters/-/pug-filters-3.1.1.tgz", + "integrity": "sha512-lFfjNyGEyVWC4BwX0WyvkoWLapI5xHSM3xZJFUhx4JM4XyyRdO8Aucc6pCygnqV2uSgJFaJWW3Ft1wCWSoQkQg==", + "dev": true, + "peer": true, + "dependencies": { + "clean-css": "^4.1.11", + "constantinople": "^3.0.1", + "jstransformer": "1.0.0", + "pug-error": "^1.3.3", + "pug-walk": "^1.1.8", + "resolve": "^1.1.6", + "uglify-js": "^2.6.1" + } + }, + "node_modules/pug-lexer": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/pug-lexer/-/pug-lexer-4.1.0.tgz", + "integrity": "sha512-i55yzEBtjm0mlplW4LoANq7k3S8gDdfC6+LThGEvsK4FuobcKfDAwt6V4jKPH9RtiE3a2Akfg5UpafZ1OksaPA==", + "dev": true, + "peer": true, + "dependencies": { + "character-parser": "^2.1.1", + "is-expression": "^3.0.0", + "pug-error": "^1.3.3" + } + }, + "node_modules/pug-linker": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/pug-linker/-/pug-linker-3.0.6.tgz", + "integrity": "sha512-bagfuHttfQOpANGy1Y6NJ+0mNb7dD2MswFG2ZKj22s8g0wVsojpRlqveEQHmgXXcfROB2RT6oqbPYr9EN2ZWzg==", + "dev": true, + "peer": true, + "dependencies": { + "pug-error": "^1.3.3", + "pug-walk": "^1.1.8" + } + }, + "node_modules/pug-load": { + "version": "2.0.12", + "resolved": "https://registry.npmjs.org/pug-load/-/pug-load-2.0.12.tgz", + "integrity": "sha512-UqpgGpyyXRYgJs/X60sE6SIf8UBsmcHYKNaOccyVLEuT6OPBIMo6xMPhoJnqtB3Q3BbO4Z3Bjz5qDsUWh4rXsg==", + "dev": true, + "peer": true, + "dependencies": { + "object-assign": "^4.1.0", + "pug-walk": "^1.1.8" + } + }, + "node_modules/pug-loader": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/pug-loader/-/pug-loader-2.4.0.tgz", + "integrity": "sha512-cD4bU2wmkZ1EEVyu0IfKOsh1F26KPva5oglO1Doc3knx8VpBIXmFHw16k9sITYIjQMCnRv1vb4vfQgy7VdR6eg==", + "dev": true, + "dependencies": { + "loader-utils": "^1.1.0", + "pug-walk": "^1.0.0", + "resolve": "^1.1.7" + }, + "peerDependencies": { + "pug": "^2.0.0" + } + }, + "node_modules/pug-parser": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/pug-parser/-/pug-parser-5.0.1.tgz", + "integrity": "sha512-nGHqK+w07p5/PsPIyzkTQfzlYfuqoiGjaoqHv1LjOv2ZLXmGX1O+4Vcvps+P4LhxZ3drYSljjq4b+Naid126wA==", + "dev": true, + "peer": true, + "dependencies": { + "pug-error": "^1.3.3", + "token-stream": "0.0.1" + } + }, + "node_modules/pug-runtime": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/pug-runtime/-/pug-runtime-2.0.5.tgz", + "integrity": "sha512-P+rXKn9un4fQY77wtpcuFyvFaBww7/91f3jHa154qU26qFAnOe6SW1CbIDcxiG5lLK9HazYrMCCuDvNgDQNptw==", + "dev": true, + "peer": true + }, + "node_modules/pug-strip-comments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/pug-strip-comments/-/pug-strip-comments-1.0.4.tgz", + "integrity": "sha512-i5j/9CS4yFhSxHp5iKPHwigaig/VV9g+FgReLJWWHEHbvKsbqL0oP/K5ubuLco6Wu3Kan5p7u7qk8A4oLLh6vw==", + "dev": true, + "peer": true, + "dependencies": { + "pug-error": "^1.3.3" + } + }, + "node_modules/pug-walk": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/pug-walk/-/pug-walk-1.1.8.tgz", + "integrity": "sha512-GMu3M5nUL3fju4/egXwZO0XLi6fW/K3T3VTgFQ14GxNi8btlxgT5qZL//JwZFm/2Fa64J/PNS8AZeys3wiMkVA==", + "dev": true + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rechoir": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.8.0.tgz", + "integrity": "sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ==", + "dev": true, + "dependencies": { + "resolve": "^1.20.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/reflect-metadata": { + "version": "0.1.14", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz", + "integrity": "sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A==" + }, + "node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true, + "peer": true + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.22.12", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.12.tgz", + "integrity": "sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "is-core-module": "^2.16.1", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/right-align": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", + "integrity": "sha512-yqINtL/G7vs2v+dFIZmFUDbnVyFUJFKd6gK22Kgo6R4jfJGFtisKyncWDDULgjfqf4ASQuIQyjJ7XZ+3aWpsAg==", + "dev": true, + "peer": true, + "dependencies": { + "align-text": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/sass": { + "version": "1.101.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.101.0.tgz", + "integrity": "sha512-OL3GoQyoUdDt843DpVmDO6y2k1sc5IhUDSpu8XucEI+35neq5QivZ1iuegnpraEVTJXlQGK1gl27zKcTLEPbQw==", + "dev": true, + "dependencies": { + "chokidar": "^5.0.0", + "immutable": "^5.1.5", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=20.19.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" + } + }, + "node_modules/sass-loader": { + "version": "13.3.3", + "resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-13.3.3.tgz", + "integrity": "sha512-mt5YN2F1MOZr3d/wBRcZxeFgwgkH44wVc2zohO2YF6JiOMkiXe4BYRZpSu2sO1g71mo/j16txzUhsKZlqjVGzA==", + "dev": true, + "dependencies": { + "neo-async": "^2.6.2" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "fibers": ">= 3.1.0", + "node-sass": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0", + "sass": "^1.3.0", + "sass-embedded": "*", + "webpack": "^5.0.0" + }, + "peerDependenciesMeta": { + "fibers": { + "optional": true + }, + "node-sass": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + } + } + }, + "node_modules/sass/node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "dev": true, + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/sass/node_modules/readdirp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", + "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", + "dev": true, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/schema-utils": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-4.3.3.tgz", + "integrity": "sha512-eflK8wEtyOE6+hsaRVPxvUKYCpRgzLqDTb8krvAsRIwOGlHoSgYLgBXoubGgLd2fT41/OUYdb48v4k4WWHQurA==", + "dev": true, + "dependencies": { + "@types/json-schema": "^7.0.9", + "ajv": "^8.9.0", + "ajv-formats": "^2.1.1", + "ajv-keywords": "^5.1.0" + }, + "engines": { + "node": ">= 10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shallow-clone": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-3.0.1.tgz", + "integrity": "sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/simple-html-tokenizer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/simple-html-tokenizer/-/simple-html-tokenizer-0.1.1.tgz", + "integrity": "sha512-Mc/gH3RvlKvB/gkp9XwgDKEWrSYyefIJPGG8Jk1suZms/rISdUuVEMx5O1WBnTWaScvxXDvGJrZQWblUmQHjkQ==", + "dev": true + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-loader": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/source-map-loader/-/source-map-loader-4.0.2.tgz", + "integrity": "sha512-oYwAqCuL0OZhBoSgmdrLa7mv9MjommVMiQIWgcztf+eS4+8BfcUee6nenFnDhKOhzAVnk5gpZdfnz1iiBv+5sg==", + "dev": true, + "dependencies": { + "iconv-lite": "^0.6.3", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": ">= 14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.72.1" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/style-loader": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.4.tgz", + "integrity": "sha512-0WqXzrsMTyb8yjZJHDqwmnwRJvhALK9LfRtRc6B4UTWe8AijYLZYZ9thuJTZc2VfQWINADW/j+LiJnfy2RoC1w==", + "dev": true, + "engines": { + "node": ">= 12.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "^5.0.0" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", + "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/svg-inline-loader": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/svg-inline-loader/-/svg-inline-loader-0.8.2.tgz", + "integrity": "sha512-kbrcEh5n5JkypaSC152eGfGcnT4lkR0eSfvefaUJkLqgGjRQJyKDvvEE/CCv5aTSdfXuc+N98w16iAojhShI3g==", + "dev": true, + "dependencies": { + "loader-utils": "^1.1.0", + "object-assign": "^4.0.1", + "simple-html-tokenizer": "^0.1.1" + } + }, + "node_modules/tabby-core": { + "version": "1.0.231-nightly.0", + "resolved": "https://registry.npmjs.org/tabby-core/-/tabby-core-1.0.231-nightly.0.tgz", + "integrity": "sha512-CpOLTw9XWLeSJoAXGf6CIH1m5DULvmNTIncy0n0n8PAewQZmhMf5JYMzwiBzey+54LDZ/yit9aBRgat7yGx+Eg==", + "peer": true, + "peerDependencies": { + "@angular/animations": "^15", + "@angular/common": "^15", + "@angular/core": "^15", + "@angular/forms": "^15", + "@angular/platform-browser": "^15", + "@angular/platform-browser-dynamic": "^15", + "rxjs": "^7" + } + }, + "node_modules/tabby-peershell": { + "resolved": "clients/tabby", + "link": true + }, + "node_modules/tabby-settings": { + "version": "1.0.231-nightly.0", + "resolved": "https://registry.npmjs.org/tabby-settings/-/tabby-settings-1.0.231-nightly.0.tgz", + "integrity": "sha512-qKhpga8qIl+fEi0HL2KEKzCGpl/m6hRbN8HCeFl6bqxw+3e9xO2xuMW/Uh50xAonYBwlvmU9daJl7HuUWvIC4w==", + "peer": true, + "peerDependencies": { + "@angular/animations": "^15", + "@angular/common": "^15", + "@angular/core": "^15", + "@angular/forms": "^15", + "@angular/platform-browser": "^15", + "@ng-bootstrap/ng-bootstrap": "^14", + "rxjs": "^7", + "tabby-core": "*" + } + }, + "node_modules/tabby-terminal": { + "version": "1.0.231-nightly.0", + "resolved": "https://registry.npmjs.org/tabby-terminal/-/tabby-terminal-1.0.231-nightly.0.tgz", + "integrity": "sha512-Ou2b0VVai+B5nL1g0BEmxE0OeB6HmTCaqFgnooZj9ffeohyUwdzfklOimE2a6Huvdb7g8eSp4sWACw5L4botwQ==", + "peer": true, + "peerDependencies": { + "@angular/animations": "^15", + "@angular/common": "^15", + "@angular/core": "^15", + "@angular/forms": "^15", + "@angular/platform-browser": "^15", + "@ng-bootstrap/ng-bootstrap": "^14", + "rxjs": "^7", + "tabby-core": "*", + "tabby-settings": "*" + } + }, + "node_modules/tapable": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.3.3.tgz", + "integrity": "sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + } + }, + "node_modules/terser": { + "version": "5.48.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.48.0.tgz", + "integrity": "sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q==", + "dev": true, + "dependencies": { + "@jridgewell/source-map": "^0.3.3", + "acorn": "^8.15.0", + "commander": "^2.20.0", + "source-map-support": "~0.5.20" + }, + "bin": { + "terser": "bin/terser" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terser/node_modules/acorn": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/to-fast-properties": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", + "integrity": "sha512-lxrWP8ejsq+7E3nNjwYmUBMAgjMTZoTI+sdBOpvNyijeDLa29LUn9QaoXAHv4+Z578hbmHHJKZknzxVtvo77og==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/token-stream": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/token-stream/-/token-stream-0.0.1.tgz", + "integrity": "sha512-nfjOAu/zAWmX9tgwi5NRp7O7zTDUD1miHiB40klUnAh9qnL1iXdgzcz/i5dMaL5jahcBAaSfmNOBBJBLJW8TEg==", + "dev": true, + "peer": true + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" + }, + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "node_modules/uglify-js": { + "version": "2.8.29", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", + "integrity": "sha512-qLq/4y2pjcU3vhlhseXGGJ7VbFO4pBANu0kwl8VCa9KEI0V8VfZIx2Fy3w01iSTA/pGwKZSmu/+I4etLNDdt5w==", + "dev": true, + "peer": true, + "dependencies": { + "source-map": "~0.5.1", + "yargs": "~3.10.0" + }, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + }, + "optionalDependencies": { + "uglify-to-browserify": "~1.0.0" + } + }, + "node_modules/uglify-js/node_modules/cliui": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", + "integrity": "sha512-GIOYRizG+TGoc7Wgc1LiOTLare95R3mzKgoln+Q/lE4ceiYH19gUpl0l0Ffq4lJDEf3FxujMe6IBfOCs7pfqNA==", + "dev": true, + "peer": true, + "dependencies": { + "center-align": "^0.1.1", + "right-align": "^0.1.1", + "wordwrap": "0.0.2" + } + }, + "node_modules/uglify-js/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/uglify-js/node_modules/yargs": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", + "integrity": "sha512-QFzUah88GAGy9lyDKGBqZdkYApt63rCXYBGYnEP4xDJPXNqXXnBDACnbrXnViV6jRSqAePwrATi2i8mfYm4L1A==", + "dev": true, + "peer": true, + "dependencies": { + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", + "window-size": "0.1.0" + } + }, + "node_modules/uglify-to-browserify": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", + "integrity": "sha512-vb2s1lYx2xBtUgy+ta+b2J/GLVUR+wmpINwHePmPRhOsIVCG2wDzKJ0n14GslH1BifsqVzSOwQhRaCAsZ/nI4Q==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/update-browserslist-db": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz", + "integrity": "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "bin": { + "update-browserslist-db": "cli.js" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true + }, + "node_modules/void-elements": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", + "integrity": "sha512-qZKX4RnBzH2ugr8Lxa7x+0V6XD9Sb/ouARtiasEQCHB1EVU4NXtmHsDDrx1dO4ne5fc3J6EW05BP1Dl0z0iung==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/watchpack": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.2.tgz", + "integrity": "sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack": { + "version": "5.108.4", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.108.4.tgz", + "integrity": "sha512-yur8LyJoeiWh47dErD+Ok7vlbmDsJ3UbbRPAoxbGJ54WpE2y5yVo5G/inUzujnYgw3tPmBRdn+G7PoxXaYC33w==", + "dev": true, + "dependencies": { + "@types/estree": "^1.0.8", + "@types/json-schema": "^7.0.15", + "@webassemblyjs/ast": "^1.14.1", + "@webassemblyjs/wasm-edit": "^1.14.1", + "@webassemblyjs/wasm-parser": "^1.14.1", + "acorn": "^8.16.0", + "acorn-import-phases": "^1.0.3", + "browserslist": "^4.28.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^5.22.2", + "es-module-lexer": "^2.1.0", + "eslint-scope": "5.1.1", + "events": "^3.2.0", + "graceful-fs": "^4.2.11", + "loader-runner": "^4.3.2", + "mime-db": "^1.54.0", + "minimizer-webpack-plugin": "^5.6.1", + "neo-async": "^2.6.2", + "schema-utils": "^4.3.3", + "tapable": "^2.3.0", + "watchpack": "^2.5.2", + "webpack-sources": "^3.5.0" + }, + "bin": { + "webpack": "bin/webpack.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependenciesMeta": { + "webpack-cli": { + "optional": true + } + } + }, + "node_modules/webpack-cli": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-5.1.4.tgz", + "integrity": "sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg==", + "dev": true, + "dependencies": { + "@discoveryjs/json-ext": "^0.5.0", + "@webpack-cli/configtest": "^2.1.1", + "@webpack-cli/info": "^2.0.2", + "@webpack-cli/serve": "^2.0.5", + "colorette": "^2.0.14", + "commander": "^10.0.1", + "cross-spawn": "^7.0.3", + "envinfo": "^7.7.3", + "fastest-levenshtein": "^1.0.12", + "import-local": "^3.0.2", + "interpret": "^3.1.1", + "rechoir": "^0.8.0", + "webpack-merge": "^5.7.3" + }, + "bin": { + "webpack-cli": "bin/cli.js" + }, + "engines": { + "node": ">=14.15.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/webpack" + }, + "peerDependencies": { + "webpack": "5.x.x" + }, + "peerDependenciesMeta": { + "@webpack-cli/generators": { + "optional": true + }, + "webpack-bundle-analyzer": { + "optional": true + }, + "webpack-dev-server": { + "optional": true + } + } + }, + "node_modules/webpack-cli/node_modules/commander": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", + "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", + "dev": true, + "engines": { + "node": ">=14" + } + }, + "node_modules/webpack-merge": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/webpack-merge/-/webpack-merge-5.10.0.tgz", + "integrity": "sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA==", + "dev": true, + "dependencies": { + "clone-deep": "^4.0.1", + "flat": "^5.0.2", + "wildcard": "^2.0.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/webpack-sources": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.5.1.tgz", + "integrity": "sha512-jyuiGJdtvY434z5bUZrjz67v76/ePNvFZTp9Mdz29IlH4+GPsgyGjiv0fKI+M7BdkU6ADjulUcKAd3tUK3WlEw==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/webpack/node_modules/acorn": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/webpack/node_modules/acorn-import-phases": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/acorn-import-phases/-/acorn-import-phases-1.0.4.tgz", + "integrity": "sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ==", + "dev": true, + "engines": { + "node": ">=10.13.0" + }, + "peerDependencies": { + "acorn": "^8.14.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wildcard": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.1.tgz", + "integrity": "sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==", + "dev": true + }, + "node_modules/window-size": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", + "integrity": "sha512-1pTPQDKTdd61ozlKGNCjhNRd+KPmgLSGa3mZTHoOliaGcESD8G1PXhh7c1fgiPjVbNVfgy2Faw4BI8/m0cC8Mg==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/with": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/with/-/with-5.1.1.tgz", + "integrity": "sha512-uAnSsFGfSpF6DNhBXStvlZILfHJfJu4eUkfbRGk94kGO1Ta7bg6FwfvoOhhyHAJuFbCw+0xk4uJ3u57jLvlCJg==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "^3.1.0", + "acorn-globals": "^3.0.0" + } + }, + "node_modules/with/node_modules/acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha512-OLUyIIZ7mF5oaAUT1w0TFqQS81q3saT46x8t7ukpPjMNk+nbs4ZHhs7ToV8EWnLYLepjETXd4XaCE4uxkMeqUw==", + "dev": true, + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/wordwrap": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", + "integrity": "sha512-xSBsCeh+g+dinoBv3GAOWM4LcVVO68wLXRanibtBSdUvkGWQRGeE9P7IwU9EmDDi4jA6L44lz15CGMwdw9N5+Q==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "peer": true + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "dev": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/yaml-loader": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/yaml-loader/-/yaml-loader-0.8.0.tgz", + "integrity": "sha512-LjeKnTzVBKWiQBeE2L9ssl6WprqaUIxCSNs5tle8PaDydgu3wVFXTbMfsvF2MSErpy9TDVa092n4q6adYwJaWg==", + "dev": true, + "dependencies": { + "javascript-stringify": "^2.0.1", + "loader-utils": "^2.0.0", + "yaml": "^2.0.0" + }, + "engines": { + "node": ">= 12.13" + } + }, + "node_modules/yaml-loader/node_modules/loader-utils": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.4.tgz", + "integrity": "sha512-xXqpXoINfFhgua9xiqD8fPFHgkoq1mmmpE92WlDbm9rNRd/EbRb+Gqf908T2DMfuHjjJlksiK2RbHVOdD/MqSw==", + "dev": true, + "dependencies": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + }, + "engines": { + "node": ">=8.9.0" + } + }, + "node_modules/yargs": { + "version": "17.7.3", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz", + "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "engines": { + "node": ">=12" + } + }, + "node_modules/yocto-queue": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-1.2.2.tgz", + "integrity": "sha512-4LCcse/U2MHZ63HAJVE+v71o7yOdIe4cZ70Wpf8D/IyjDKYQLV5GD46B+hSTjJsvV5PztjvHoU580EftxjDZFQ==", + "dev": true, + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zone.js": { + "version": "0.13.3", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.13.3.tgz", + "integrity": "sha512-MKPbmZie6fASC/ps4dkmIhaT5eonHkEt6eAy80K42tAm0G2W+AahLJjbfi6X9NPdciOE9GRFTTM8u2IiF6O3ww==", + "peer": true, + "dependencies": { + "tslib": "^2.3.0" + } + }, + "server": { + "name": "@peershell/server", + "version": "0.1.0", + "license": "Apache-2.0", + "dependencies": { + "@peershell/protocol": "*" + } + }, + "shared": { + "name": "@peershell/protocol", + "version": "0.1.0", + "license": "Apache-2.0" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..f2d2d0e --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "peershell", + "version": "0.0.0", + "private": true, + "description": "Take your terminal anywhere and work as if it were local", + "license": "Apache-2.0", + "repository": "https://github.com/tis24dev/peershell", + "workspaces": [ + "shared", + "clients/web", + "clients/tabby", + "server" + ], + "engines": { + "node": ">=18" + }, + "devDependencies": { + "typescript": "^4.9.5" + }, + "scripts": { + "build:shared": "npm run build -w @peershell/protocol", + "build:web": "npm run build -w @peershell/web-client", + "copy:web-asset": "node scripts/copy-web-asset.mjs", + "build:tabby": "npm run build -w tabby-peershell", + "build:server": "npm run build -w @peershell/server", + "build:all": "npm run build:shared && npm run build:web && npm run copy:web-asset && npm run build:tabby && npm run build:server", + "watch:tabby": "npm run watch -w tabby-peershell", + "test": "npm run test --workspaces --if-present" + } +} diff --git a/scripts/copy-web-asset.mjs b/scripts/copy-web-asset.mjs new file mode 100644 index 0000000..96294be --- /dev/null +++ b/scripts/copy-web-asset.mjs @@ -0,0 +1,22 @@ +#!/usr/bin/env node +// Copies the built, self-contained web-client HTML into the Tabby plugin so it can +// be embedded (asset/source) and served over the outbound tunnel (httpTunnelHandler). +// Fails loudly if the source is missing so `build:all` never silently ships a stale/absent page. +import * as fs from 'fs' +import * as path from 'path' +import * as url from 'url' + +const root = path.resolve(url.fileURLToPath(new URL('.', import.meta.url)), '..') +const src = path.join(root, 'clients', 'web', 'dist', 'index.html') +const destDir = path.join(root, 'clients', 'tabby', 'assets') +const dest = path.join(destDir, 'web-client.html') + +if (!fs.existsSync(src)) { + console.error(`[copy-web-asset] ERROR: web-client build not found at ${src}`) + console.error('[copy-web-asset] Run `npm run build:web` first (build:all does this in order).') + process.exit(1) +} + +fs.mkdirSync(destDir, { recursive: true }) +fs.copyFileSync(src, dest) +console.log(`[copy-web-asset] ${path.relative(root, src)} -> ${path.relative(root, dest)}`) diff --git a/scripts/publish-plugins.mjs b/scripts/publish-plugins.mjs new file mode 100644 index 0000000..6e24d7a --- /dev/null +++ b/scripts/publish-plugins.mjs @@ -0,0 +1,22 @@ +#!/usr/bin/env node +// Publishes the Tabby plugin (clients/tabby -> npm "tabby-peershell") from the monorepo subdir. +// Verifies the bundle exists before publishing. Version bump/tagging is expected to be done +// beforehand (or by CI on a release tag). Kept intentionally small. +import * as fs from 'fs' +import * as path from 'path' +import * as url from 'url' +import { execFileSync } from 'child_process' + +const root = path.resolve(url.fileURLToPath(new URL('.', import.meta.url)), '..') +const pluginDir = path.join(root, 'clients', 'tabby') +const bundle = path.join(pluginDir, 'dist', 'index.js') + +if (!fs.existsSync(bundle)) { + console.error(`[publish] ERROR: built bundle missing at ${bundle}. Run \`npm run build:all\` first.`) + process.exit(1) +} + +const dry = process.argv.includes('--dry-run') +const args = ['publish', ...(dry ? ['--dry-run'] : []), '--access', 'public'] +console.log(`[publish] npm ${args.join(' ')} (cwd=${pluginDir})`) +execFileSync('npm', args, { cwd: pluginDir, stdio: 'inherit' }) diff --git a/server/package.json b/server/package.json new file mode 100644 index 0000000..e696fd9 --- /dev/null +++ b/server/package.json @@ -0,0 +1,14 @@ +{ + "name": "@peershell/server", + "version": "0.1.0", + "private": true, + "description": "peershell rendezvous + relay + reverse-tunnel + accounts (implemented in Stage 5)", + "license": "Apache-2.0", + "scripts": { + "build": "echo \"(server: implemented in Stage 5)\"", + "test": "echo \"(server: implemented in Stage 5)\"" + }, + "dependencies": { + "@peershell/protocol": "*" + } +} diff --git a/server/src/README.md b/server/src/README.md new file mode 100644 index 0000000..266e14f --- /dev/null +++ b/server/src/README.md @@ -0,0 +1,8 @@ +# @peershell/server (Stage 5) + +Placeholder. The rendezvous + blind relay + reverse HTTP tunnel + accounts/dashboard server is +implemented in Stage 5 (deployed on the user's Proxmox behind a cloudflared tunnel). It consumes +`@peershell/protocol` and must implement the contract in `../../PROTOCOL.md`. + +A throwaway ~120-line Node `ws`+`http` relay (per the plan's verification section) is the precursor +used to smoke-test the clients before this is built. diff --git a/shared/package.json b/shared/package.json new file mode 100644 index 0000000..c2a4ca7 --- /dev/null +++ b/shared/package.json @@ -0,0 +1,18 @@ +{ + "name": "@peershell/protocol", + "version": "0.1.0", + "description": "peershell wire protocol — framework-neutral, shared by all clients and the server", + "license": "Apache-2.0", + "repository": "https://github.com/tis24dev/peershell", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist", + "src" + ], + "scripts": { + "build": "tsc -p tsconfig.json", + "watch": "tsc -p tsconfig.json --watch", + "test": "echo \"(shared: tests added in a later stage)\"" + } +} diff --git a/shared/src/api.ts b/shared/src/api.ts new file mode 100644 index 0000000..542863f --- /dev/null +++ b/shared/src/api.ts @@ -0,0 +1,65 @@ +/** + * Transport abstraction + small shared validators. The transport is framework-neutral (callback + * based); the Tabby plugin adapts it to RxJS internally, the web/mobile clients use it directly. + * A future WebRTC DataChannel transport implements the same interface. + */ +import { ControlMessage, Channel } from './protocol' + +export type TransportState = 'connecting' | 'open' | 'closed' + +export interface BinaryPayload { + peerId: number + channel: Channel + data: Uint8Array +} + +export interface SessionTransport { + connect(url: string, token?: string): Promise + sendControl(msg: ControlMessage): void + sendData(peerId: number, channel: Channel, data: Uint8Array): void + close(code?: number, reason?: string): void + + onControl(cb: (msg: ControlMessage) => void): void + onBinary(cb: (frame: BinaryPayload) => void): void + onState(cb: (state: TransportState) => void): void +} + +// --- validators ----------------------------------------------------------- + +/** Crockford base32 (minus ambiguous chars), 6-10 chars. */ +export const ROOM_CODE_RE = /^[2-9A-HJ-NP-Z]{6,10}$/ + +export function isValidRoomCode(code: string): boolean { + return ROOM_CODE_RE.test(code.toUpperCase()) +} + +export function normalizeRoomCode(code: string): string { + return code.trim().toUpperCase() +} + +/** Opaque magic-link/session token: url-safe, reasonable length bounds. */ +export const TOKEN_RE = /^[A-Za-z0-9_-]{16,128}$/ + +export function isValidToken(token: string): boolean { + return TOKEN_RE.test(token) +} + +/** + * Whitelist for the reverse HTTP tunnel: the host only ever serves the embedded web-client page. + * Rejects traversal/SSRF. URL-decode is applied before checking. + */ +export function isAllowedTunnelPath(rawPath: string): boolean { + let path: string + try { + path = decodeURIComponent(rawPath) + } catch { + return false + } + if (path.includes('..') || path.includes('\0')) { + return false + } + if (/^[a-z]+:\/\//i.test(path)) { + return false + } + return path === '/' || path === '/index.html' +} diff --git a/shared/src/index.ts b/shared/src/index.ts new file mode 100644 index 0000000..5fffc22 --- /dev/null +++ b/shared/src/index.ts @@ -0,0 +1,4 @@ +export * from './protocol' +export * from './api' +export * from './pinAuth' +export * from './utf8Splitter' diff --git a/shared/src/pinAuth.ts b/shared/src/pinAuth.ts new file mode 100644 index 0000000..1f6ef1d --- /dev/null +++ b/shared/src/pinAuth.ts @@ -0,0 +1,53 @@ +/** + * Per-session PIN challenge-response. The raw PIN never crosses the wire: the host sends a + * fresh single-use `nonce`, the peer replies with `H(pin, nonce)`, the host verifies locally. + * + * Uses Web Crypto (`globalThis.crypto`), available in browsers and Node >= 18. + */ + +const MIN_PIN_LENGTH = 6 + +function toHex(bytes: Uint8Array): string { + let out = '' + for (const b of bytes) { + out += b.toString(16).padStart(2, '0') + } + return out +} + +/** A fresh, single-use nonce (hex). Generate a new one for every challenge. */ +export function generateNonce(byteLength = 16): string { + const arr = new Uint8Array(byteLength) + globalThis.crypto.getRandomValues(arr) + return toHex(arr) +} + +/** `H(pin, nonce)` as a hex string (SHA-256 over `nonce:pin`). */ +export async function hashPin(pin: string, nonce: string): Promise { + const data = new TextEncoder().encode(`${nonce}:${pin}`) + const digest = await globalThis.crypto.subtle.digest('SHA-256', data) + return toHex(new Uint8Array(digest)) +} + +/** Constant-time-ish comparison of two equal-length hex strings. */ +function safeEqualHex(a: string, b: string): boolean { + if (a.length !== b.length) { + return false + } + let diff = 0 + for (let i = 0; i < a.length; i++) { + diff |= a.charCodeAt(i) ^ b.charCodeAt(i) + } + return diff === 0 +} + +/** Verify a peer's `pin-response` hash against the expected `H(pin, nonce)`. */ +export async function verifyPin(pin: string, nonce: string, responseHash: string): Promise { + const expected = await hashPin(pin, nonce) + return safeEqualHex(expected, responseHash) +} + +/** Basic PIN policy check (min length, digits). Callers should also rate-limit attempts. */ +export function isAcceptablePin(pin: string): boolean { + return pin.length >= MIN_PIN_LENGTH && /^[0-9]+$/.test(pin) +} diff --git a/shared/src/protocol.ts b/shared/src/protocol.ts new file mode 100644 index 0000000..f72faf2 --- /dev/null +++ b/shared/src/protocol.ts @@ -0,0 +1,101 @@ +/** + * peershell wire protocol — control messages + binary terminal framing. + * Framework-neutral (no Angular/RxJS/Node-Buffer). See PROTOCOL.md for the spec. + */ + +export const PROTOCOL_VERSION = 1 + +/** Binary frame channel tags. */ +export enum Channel { + Output = 0x01, // host -> guest + Input = 0x02, // guest -> host +} + +/** Peer id used while only 1 host + 1 guest are supported. */ +export const SINGLE_PEER = 0 + +// --------------------------------------------------------------------------- +// Control messages (JSON, sent as WebSocket TEXT frames) +// --------------------------------------------------------------------------- + +export type Role = 'host' | 'guest' +export type ClientKind = 'desktop' | 'web' | 'mobile' + +interface Base { + v?: number + peerId?: number +} + +export type ControlMessage = + | (Base & { t: 'hello', role: Role, kind?: ClientKind, client?: string }) + | (Base & { t: 'create-session' }) + | (Base & { t: 'session-created', room: string, magicLink: string }) + | (Base & { t: 'session-close' }) + | (Base & { t: 'join', room?: string, token?: string, name?: string }) + | (Base & { t: 'peer-joined', peerId: number, kind: ClientKind }) + | (Base & { t: 'peer-left', peerId?: number, reason?: string }) + | (Base & { t: 'error', code: string, message?: string }) + | (Base & { t: 'ping' }) + | (Base & { t: 'pong' }) + | (Base & { t: 'pin-challenge', nonce: string }) + | (Base & { t: 'pin-response', hash: string }) + | (Base & { t: 'pin-ok' }) + | (Base & { t: 'pin-fail', left: number }) + | (Base & { t: 'snapshot', cols: number, rows: number, data: string }) + | (Base & { t: 'snapshot-ack' }) + | (Base & { t: 'resize', cols: number, rows: number }) + | (Base & { t: 'http-get', reqId: string, path: string, headers?: Record }) + | (Base & { t: 'http-response', reqId: string, status: number, headers?: Record, bodyBase64: string }) + +export type ControlType = ControlMessage['t'] + +/** Serialize a control message to a JSON string (stamps the protocol version). */ +export function encodeControl(msg: ControlMessage): string { + return JSON.stringify({ v: PROTOCOL_VERSION, ...msg }) +} + +/** Parse a JSON control message. Throws on malformed JSON or missing `t`. */ +export function decodeControl(text: string): ControlMessage { + const obj = JSON.parse(text) + if (typeof obj !== 'object' || obj === null || typeof obj.t !== 'string') { + throw new Error('peershell: malformed control message') + } + return obj as ControlMessage +} + +// --------------------------------------------------------------------------- +// Binary terminal frames (WebSocket BINARY frames) +// [ peerId: uint32 BE ][ tag: uint8 ][ raw PTY bytes... ] +// --------------------------------------------------------------------------- + +export const BINARY_HEADER_BYTES = 5 + +export interface BinaryFrame { + peerId: number + channel: Channel + data: Uint8Array +} + +/** Encode a terminal data frame. `data` is copied after the 5-byte header. */ +export function encodeBinaryFrame(peerId: number, channel: Channel, data: Uint8Array): Uint8Array { + const out = new Uint8Array(BINARY_HEADER_BYTES + data.length) + const view = new DataView(out.buffer) + view.setUint32(0, peerId >>> 0, false) // big-endian + view.setUint8(4, channel) + out.set(data, BINARY_HEADER_BYTES) + return out +} + +/** Decode a terminal data frame from an ArrayBuffer or Uint8Array. */ +export function decodeBinaryFrame(input: ArrayBuffer | Uint8Array): BinaryFrame { + const bytes = input instanceof Uint8Array ? input : new Uint8Array(input) + if (bytes.length < BINARY_HEADER_BYTES) { + throw new Error('peershell: binary frame too short') + } + const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength) + const peerId = view.getUint32(0, false) + const channel = view.getUint8(4) as Channel + // slice() copies so callers can retain the payload independently of the socket buffer. + const data = bytes.slice(BINARY_HEADER_BYTES) + return { peerId, channel, data } +} diff --git a/shared/src/utf8Splitter.ts b/shared/src/utf8Splitter.ts new file mode 100644 index 0000000..2975da6 --- /dev/null +++ b/shared/src/utf8Splitter.ts @@ -0,0 +1,20 @@ +/** + * Reassembles UTF-8 text from a byte stream where multibyte codepoints may be split + * across frames. Wraps a streaming TextDecoder (available in browsers and Node >= 18). + * + * The Tabby desktop guest gets equivalent behaviour from Tabby's UTF8SplitterMiddleware; + * the web-client and future native/mobile clients use this. + */ +export class Utf8Splitter { + private readonly decoder = new TextDecoder('utf-8') + + /** Decode a chunk, holding back any trailing incomplete multibyte sequence. */ + write(bytes: Uint8Array): string { + return this.decoder.decode(bytes, { stream: true }) + } + + /** Flush any buffered bytes at end of stream (emits U+FFFD for a truncated tail). */ + flush(): string { + return this.decoder.decode() + } +} diff --git a/shared/tsconfig.json b/shared/tsconfig.json new file mode 100644 index 0000000..c1e6e37 --- /dev/null +++ b/shared/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "node", + "lib": ["ES2020", "DOM"], + "declaration": true, + "sourceMap": true, + "outDir": "dist", + "rootDir": "src", + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true + }, + "include": ["src"] +} From 48debdffaaf9ccc363952995b89e7af161e809ad Mon Sep 17 00:00:00 2001 From: tis24dev Date: Tue, 7 Jul 2026 21:44:54 +0200 Subject: [PATCH 02/75] Stage 1: jest+ts-jest test foundation + @peershell/protocol unit tests - root jest (ts-jest, node env) with jest.setup providing Web Crypto for Node 18 - shared tests: binary frame round-trip (peerId/tag/payload, uint32, empty, short-frame throw), control encode/decode + version stamp, PIN challenge- response (deterministic hash, nonce-varies, PIN-not-in-hash, verify ok/ko), UTF-8 splitter reassembly of split multibyte, room-code + tunnel-path validators - root scripts: `test` -> jest, `test:smoke` -> plugin bundle load check 15/15 tests green. --- clients/tabby/package.json | 3 + jest.config.cjs | 13 + jest.setup.cjs | 5 + package-lock.json | 3163 +++++++++++++++++++++++++++--- package.json | 3 +- shared/test/pinAuth.test.ts | 37 + shared/test/protocol.test.ts | 50 + shared/test/utf8Splitter.test.ts | 40 + tsconfig.jest.json | 13 + 9 files changed, 3075 insertions(+), 252 deletions(-) create mode 100644 jest.config.cjs create mode 100644 jest.setup.cjs create mode 100644 shared/test/pinAuth.test.ts create mode 100644 shared/test/protocol.test.ts create mode 100644 shared/test/utf8Splitter.test.ts create mode 100644 tsconfig.jest.json diff --git a/clients/tabby/package.json b/clients/tabby/package.json index df94714..9010775 100644 --- a/clients/tabby/package.json +++ b/clients/tabby/package.json @@ -38,10 +38,12 @@ "@ng-bootstrap/ng-bootstrap": "^14.1.0", "@ngtools/webpack": "^15.2.5", "@tabby-gang/to-string-loader": "^1.1.7-beta.2", + "@types/jest": "^29.5.14", "@types/node": "20.3.1", "apply-loader": "2.0.0", "babel-loader": "^9.1.2", "css-loader": "^6.7.3", + "jest": "^29.7.0", "ngx-toastr": "^16.0.2", "pug-loader": "^2.4.0", "rxjs": "^7.5.7", @@ -50,6 +52,7 @@ "source-map-loader": "^4.0.1", "style-loader": "^3.3.1", "svg-inline-loader": "^0.8.2", + "ts-jest": "^29.4.11", "tslib": "^2.6.0", "typescript": "^4.9.5", "webpack": "^5.90.0", diff --git a/jest.config.cjs b/jest.config.cjs new file mode 100644 index 0000000..e3d326c --- /dev/null +++ b/jest.config.cjs @@ -0,0 +1,13 @@ +/** Jest config for the monorepo (ts-jest, node env). Runs *.test.ts under shared/ and clients/. */ +module.exports = { + testEnvironment: 'node', + setupFiles: ['/jest.setup.cjs'], + roots: ['/shared', '/clients'], + testMatch: ['**/*.test.ts'], + transform: { + '^.+\\.ts$': ['ts-jest', { tsconfig: '/tsconfig.jest.json' }], + }, + moduleNameMapper: { + '^@peershell/protocol$': '/shared/src/index.ts', + }, +} diff --git a/jest.setup.cjs b/jest.setup.cjs new file mode 100644 index 0000000..f225aa4 --- /dev/null +++ b/jest.setup.cjs @@ -0,0 +1,5 @@ +// jest-environment-node (Node 18) does not expose the Web Crypto global; the real runtimes +// (browsers, Electron renderer, Node >= 20) do. Provide it for tests so pinAuth can run. +if (!globalThis.crypto) { + globalThis.crypto = require('crypto').webcrypto +} diff --git a/package-lock.json b/package-lock.json index 7381a13..fc8a765 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,10 +40,12 @@ "@ng-bootstrap/ng-bootstrap": "^14.1.0", "@ngtools/webpack": "^15.2.5", "@tabby-gang/to-string-loader": "^1.1.7-beta.2", + "@types/jest": "^29.5.14", "@types/node": "20.3.1", "apply-loader": "2.0.0", "babel-loader": "^9.1.2", "css-loader": "^6.7.3", + "jest": "^29.7.0", "ngx-toastr": "^16.0.2", "pug-loader": "^2.4.0", "rxjs": "^7.5.7", @@ -52,6 +54,7 @@ "source-map-loader": "^4.0.1", "style-loader": "^3.3.1", "svg-inline-loader": "^0.8.2", + "ts-jest": "^29.4.11", "tslib": "^2.6.0", "typescript": "^4.9.5", "webpack": "^5.90.0", @@ -468,6 +471,15 @@ "@babel/core": "^7.0.0" } }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz", + "integrity": "sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, "node_modules/@babel/helper-string-parser": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", @@ -518,6 +530,228 @@ "node": ">=6.0.0" } }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz", + "integrity": "sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.12.13" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-static-block": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz", + "integrity": "sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-attributes": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.29.7.tgz", + "integrity": "sha512-zGYcYfq/WmZ4V+kBIXQon9dSSc8ircGZqw9ZaNhhGj9nZkeBu1jHLBDQqYYi5WA9uawvA2sIMbry2nCFhf5Djg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-jsx": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz", + "integrity": "sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-private-property-in-object": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz", + "integrity": "sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.14.5", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz", + "integrity": "sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.14.5" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-typescript": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz", + "integrity": "sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, "node_modules/@babel/template": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.29.7.tgz", @@ -560,6 +794,12 @@ "node": ">=6.9.0" } }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, "node_modules/@discoveryjs/json-ext": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz", @@ -569,105 +809,542 @@ "node": ">=10.0.0" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" + "node_modules/@istanbuljs/load-nyc-config/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, "engines": { - "node": ">=6.0.0" + "node": ">=8" } }, - "node_modules/@jridgewell/source-map": { - "version": "0.3.11", - "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", - "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.25" + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.5.5", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", - "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==" - }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@ng-bootstrap/ng-bootstrap": { - "version": "14.2.0", - "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-14.2.0.tgz", - "integrity": "sha512-nqEKVXauSontGKqC5WSKpch5TiAGDZB3hluvxkINS0r9LUE6sBQRP3qeYOe7Uwu+UbQcj28NG3qFHhpfnG8KHw==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, "dependencies": { - "tslib": "^2.3.0" + "p-limit": "^2.2.0" }, - "peerDependencies": { - "@angular/common": "^15.0.0", - "@angular/core": "^15.0.0", - "@angular/forms": "^15.0.0", - "@angular/localize": "^15.0.0", - "@popperjs/core": "^2.11.6", - "rxjs": "^6.5.3 || ^7.4.0" + "engines": { + "node": ">=8" } }, - "node_modules/@ngtools/webpack": { - "version": "15.2.11", - "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-15.2.11.tgz", - "integrity": "sha512-yqp+FziuJ+wIVij4eTqfhuiTPNaG1PU8ukeGOdqkVH4nQMlmzs9UldXy1iYC/6swzn6XO/pkqisU3m/jxemMzA==", + "node_modules/@istanbuljs/load-nyc-config/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true, "engines": { - "node": "^14.20.0 || ^16.13.0 || >=18.10.0", - "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", - "yarn": ">= 1.13.0" - }, - "peerDependencies": { - "@angular/compiler-cli": "^15.0.0", - "typescript": ">=4.8.2 <5.0", - "webpack": "^5.54.0" + "node": ">=8" } }, - "node_modules/@parcel/watcher": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz", - "integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==", + "node_modules/@istanbuljs/schema": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.6.tgz", + "integrity": "sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-29.7.0.tgz", + "integrity": "sha512-5Ni4CU7XHQi32IJ398EEP4RrB8eV09sXP2ROqD4bksHrnTree52PsxvX8tpL8LvTZ3pFzXyPbNQReSN41CAhOg==", "dev": true, - "hasInstallScript": true, - "optional": true, "dependencies": { - "detect-libc": "^2.0.3", - "is-glob": "^4.0.3", - "node-addon-api": "^7.0.0", - "picomatch": "^4.0.3" + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0" }, "engines": { - "node": ">= 10.0.0" - }, - "funding": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/core": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-29.7.0.tgz", + "integrity": "sha512-n7aeXWKMnGtDA48y8TLWJPJmLmmZ642Ceo78cYWEpiD7FzDgmNDV/GCVRorPABdXLJZ/9wzzgZAlHjXjxDHGsg==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/reporters": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-changed-files": "^29.7.0", + "jest-config": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-resolve-dependencies": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "jest-watcher": "^29.7.0", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/environment": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-29.7.0.tgz", + "integrity": "sha512-aQIfHDq33ExsN4jP1NWGXhxgQ/wixs60gDiKO+XVMd8Mn0NWPWgc34ZQDTb2jKaUWQ7MuwoitXAsN2XVXNMpAw==", + "dev": true, + "dependencies": { + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-8uMeAMycttpva3P1lBHB8VciS9V0XAr3GymPpipdyQXbBcuhkLQOSe8E/p92RyAdToS6ZD1tFkX+CkhoECE0dQ==", + "dev": true, + "dependencies": { + "expect": "^29.7.0", + "jest-snapshot": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/expect-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/expect-utils/-/expect-utils-29.7.0.tgz", + "integrity": "sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA==", + "dev": true, + "dependencies": { + "jest-get-type": "^29.6.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/fake-timers": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-29.7.0.tgz", + "integrity": "sha512-q4DH1Ha4TTFPdxLsqDXK1d3+ioSL7yL5oCMJZgDYm6i+6CygW5E5xVr/D1HdsGxjt1ZWSfUAs9OxSB/BNelWrQ==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@sinonjs/fake-timers": "^10.0.2", + "@types/node": "*", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/globals": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-29.7.0.tgz", + "integrity": "sha512-mpiz3dutLbkW2MNFubUGUEVLkTGiqW6yLVTA+JbP6fI6J5iL9Y0Nlg8k95pcF8ctKwCS7WVxteBs29hhfAotzQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/types": "^29.6.3", + "jest-mock": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-29.7.0.tgz", + "integrity": "sha512-DApq0KJbJOEzAFYjHADNNxAE3KbhxQB1y5Kplb5Waqw6zVbuWatSnMjE5gs8FUgEPmNsnZA3NCWl9NG0ia04Pg==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "@types/node": "*", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^6.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.1.3", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "slash": "^3.0.0", + "string-length": "^4.0.1", + "strip-ansi": "^6.0.0", + "v8-to-istanbul": "^9.0.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/@jest/reporters/node_modules/brace-expansion": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@jest/reporters/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@jest/reporters/node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/reporters/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@jest/schemas": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-29.6.3.tgz", + "integrity": "sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==", + "dev": true, + "dependencies": { + "@sinclair/typebox": "^0.27.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-29.6.3.tgz", + "integrity": "sha512-MHjT95QuipcPrpLM+8JMSzFx6eHp5Bm+4XeFDJlwsvVBjmKNiIAvasGK2fxz2WbGRlnvqehFbh07MMa7n3YJnw==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.18", + "callsites": "^3.0.0", + "graceful-fs": "^4.2.9" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-result": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-29.7.0.tgz", + "integrity": "sha512-Fdx+tv6x1zlkJPcWXmMDAG2HBnaR9XPSd5aDWQVsfrZmLVT3lU1cwyxLgRmXR9yrq4NBoEm9BMsfgFzTQAbJYA==", + "dev": true, + "dependencies": { + "@jest/console": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-29.7.0.tgz", + "integrity": "sha512-GQwJ5WZVrKnOJuiYiAF52UNUJXgTZx1NHjFSEB0qEMmSZKAkdMoIzw/Cj6x6NF4AvV23AUqDpFzQkN/eYCYTxw==", + "dev": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-29.7.0.tgz", + "integrity": "sha512-ok/BTPFzFKVMwO5eOHRrvnBVHdRy9IrsrW1GpMaQ9MCnilNLXQKmAX8s1YXDFaai9xJpac2ySzV0YeRRECr2Vw==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/types": "^29.6.3", + "@jridgewell/trace-mapping": "^0.3.18", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^2.0.0", + "fast-json-stable-stringify": "^2.1.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.2" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jest/transform/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, + "node_modules/@jest/types": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-29.6.3.tgz", + "integrity": "sha512-u3UPsIilWKOM3F9CXtrG8LEJmNxwoCQC/XVj4IKYXvvpx7QIi/Kg1LI5uDmDpKlac62NUtX7eLjRh+jVZcLOzw==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^17.0.8", + "chalk": "^4.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/source-map": { + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@jridgewell/source-map/-/source-map-0.3.11.tgz", + "integrity": "sha512-ZMp1V8ZFcPG5dIWnQLr3NSI1MiCU7UETdS/A0G8V/XWHvJv3ZsFqutJn1Y5RPmAPX6F3BiE397OqveU/9NCuIA==", + "dev": true, + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.25" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@ng-bootstrap/ng-bootstrap": { + "version": "14.2.0", + "resolved": "https://registry.npmjs.org/@ng-bootstrap/ng-bootstrap/-/ng-bootstrap-14.2.0.tgz", + "integrity": "sha512-nqEKVXauSontGKqC5WSKpch5TiAGDZB3hluvxkINS0r9LUE6sBQRP3qeYOe7Uwu+UbQcj28NG3qFHhpfnG8KHw==", + "dependencies": { + "tslib": "^2.3.0" + }, + "peerDependencies": { + "@angular/common": "^15.0.0", + "@angular/core": "^15.0.0", + "@angular/forms": "^15.0.0", + "@angular/localize": "^15.0.0", + "@popperjs/core": "^2.11.6", + "rxjs": "^6.5.3 || ^7.4.0" + } + }, + "node_modules/@ngtools/webpack": { + "version": "15.2.11", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-15.2.11.tgz", + "integrity": "sha512-yqp+FziuJ+wIVij4eTqfhuiTPNaG1PU8ukeGOdqkVH4nQMlmzs9UldXy1iYC/6swzn6XO/pkqisU3m/jxemMzA==", + "dev": true, + "engines": { + "node": "^14.20.0 || ^16.13.0 || >=18.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "@angular/compiler-cli": "^15.0.0", + "typescript": ">=4.8.2 <5.0", + "webpack": "^5.54.0" + } + }, + "node_modules/@parcel/watcher": { + "version": "2.5.6", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz", + "integrity": "sha512-tmmZ3lQxAe/k/+rNnXQRawJ4NjxO2hqiOLTHvWchtGZULp4RyFeh6aU4XdOYBFe2KE1oShQTv4AblOs2iOrNnQ==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "dependencies": { + "detect-libc": "^2.0.3", + "is-glob": "^4.0.3", + "node-addon-api": "^7.0.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { "type": "opencollective", "url": "https://opencollective.com/parcel" }, @@ -982,6 +1659,30 @@ "url": "https://opencollective.com/popperjs" } }, + "node_modules/@sinclair/typebox": { + "version": "0.27.10", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.10.tgz", + "integrity": "sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA==", + "dev": true + }, + "node_modules/@sinonjs/commons": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", + "integrity": "sha512-K3mCHKQ9sVh8o1C9cxkwxaOmXoAMlDxC1mYyHrjqOWEcBjYr76t96zL2zlj5dUGZ3HSw240X1qgH3Mjf1yJWpQ==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "10.3.0", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.3.0.tgz", + "integrity": "sha512-V4BG07kuYSUkTCSBHG8G8TNhM+F19jXFWnQtzj+we8DrkpSBCee9Z3Ms8yiGer/dlmhe35/Xdgyo3/0rQKg7YA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^3.0.0" + } + }, "node_modules/@tabby-gang/to-string-loader": { "version": "1.1.7-beta.2", "resolved": "https://registry.npmjs.org/@tabby-gang/to-string-loader/-/to-string-loader-1.1.7-beta.2.tgz", @@ -991,16 +1692,57 @@ "loader-utils": "^1.0.0" } }, - "node_modules/@types/babel-types": { - "version": "7.0.16", - "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.16.tgz", - "integrity": "sha512-5QXs9GBFTNTmilLlWBhnsprqpjfrotyrnzUdwDrywEL/DA4LuCWQT300BTOXA3Y9ngT9F2uvmCoIxI6z8DlJEA==", + "node_modules/@types/babel__core": { + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, - "peer": true + "dependencies": { + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.7", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } }, - "node_modules/@types/babylon": { - "version": "6.16.9", - "resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.9.tgz", + "node_modules/@types/babel__generator": { + "version": "7.27.0", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.27.0.tgz", + "integrity": "sha512-ufFd2Xi92OAVPYsy+P4n7/U7e68fex0+Ee8gSG9KX7eo084CWiQ4sdxktvdl0bOPupXtVJPY19zk6EwWqUQ8lg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.28.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.28.0.tgz", + "integrity": "sha512-8PvcXf70gTDZBgt9ptxJ8elBeBjcLOAcOtoO/mPJjtji1+CdGbHgm77om1GrsPxsiE+uXIpNSK64UYaIwQXd4Q==", + "dev": true, + "dependencies": { + "@babel/types": "^7.28.2" + } + }, + "node_modules/@types/babel-types": { + "version": "7.0.16", + "resolved": "https://registry.npmjs.org/@types/babel-types/-/babel-types-7.0.16.tgz", + "integrity": "sha512-5QXs9GBFTNTmilLlWBhnsprqpjfrotyrnzUdwDrywEL/DA4LuCWQT300BTOXA3Y9ngT9F2uvmCoIxI6z8DlJEA==", + "dev": true, + "peer": true + }, + "node_modules/@types/babylon": { + "version": "6.16.9", + "resolved": "https://registry.npmjs.org/@types/babylon/-/babylon-6.16.9.tgz", "integrity": "sha512-sEKyxMVEowhcr8WLfN0jJYe4gS4Z9KC2DGz0vqfC7+MXFbmvOF7jSjALC77thvAO2TLgFUPa9vDeOak+AcUrZA==", "dev": true, "peer": true, @@ -1014,6 +1756,49 @@ "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", "dev": true }, + "node_modules/@types/graceful-fs": { + "version": "4.1.9", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", + "integrity": "sha512-olP3sd1qOEe5dXTSaFvQG+02VdRXcdytWLAZsAq1PecU8uqQAhkrnbli7DagjtXKW/Bl7YJbUsa8MPcuc8LHEQ==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.3.tgz", + "integrity": "sha512-NQn7AHQnk/RSLOxrBbGyJM/aVQ+pjj5HCgasFxc0K/KhoATfQ/47AyUl15I2yBUpihjmas+a+VJBOqecrFH+uA==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.4.tgz", + "integrity": "sha512-pk2B1NWalF9toCRu6gjBzR69syFjP4Od8WRAX+0mmf9lAjCRicLOWc+ZrxZHx/0XRjotgkF9t6iaMJ+aXcOdZQ==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/jest": { + "version": "29.5.14", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-29.5.14.tgz", + "integrity": "sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ==", + "dev": true, + "dependencies": { + "expect": "^29.0.0", + "pretty-format": "^29.0.0" + } + }, "node_modules/@types/json-schema": { "version": "7.0.15", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", @@ -1026,6 +1811,27 @@ "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", "dev": true }, + "node_modules/@types/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "17.0.35", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", + "integrity": "sha512-qUHkeCyQFxMXg79wQfTtfndEC+N9ZZg76HJftDJp+qH2tV7Gj4OJi7l+PiWwJ+pWtW8GwSmqsDj/oymhrTWXjg==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "21.0.3", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", + "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", + "dev": true + }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -1324,6 +2130,21 @@ "node": ">=0.10.0" } }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -1367,6 +2188,15 @@ "loader-utils": "^1.1.0" } }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -1374,6 +2204,27 @@ "dev": true, "peer": true }, + "node_modules/babel-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.7.0.tgz", + "integrity": "sha512-BrvGY3xZSwEcCzKvKsCi2GgHqDqsYkOP4/by5xCgIwGXQxIEh+8ew3gmrE1y7XRR6LHZIj6yLYnUi/mm2KXKBg==", + "dev": true, + "dependencies": { + "@jest/transform": "^29.7.0", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^29.6.3", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.8.0" + } + }, "node_modules/babel-loader": { "version": "9.2.1", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-9.2.1.tgz", @@ -1391,6 +2242,104 @@ "webpack": ">=5" } }, + "node_modules/babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/istanbul-lib-instrument": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz", + "integrity": "sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-istanbul/node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.6.3.tgz", + "integrity": "sha512-ESAc/RJvGTFEzRwOTT4+lNDk/GNHMkKbNzsvT0qKRfDyyYTskxB5rnU2njIDYVxXCBHHEI1c0YwHob3WaYujOg==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.1.14", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz", + "integrity": "sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.12.13", + "@babel/plugin-syntax-class-static-block": "^7.14.5", + "@babel/plugin-syntax-import-attributes": "^7.24.7", + "@babel/plugin-syntax-import-meta": "^7.10.4", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.10.4", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.10.4", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-private-property-in-object": "^7.14.5", + "@babel/plugin-syntax-top-level-await": "^7.14.5" + }, + "peerDependencies": { + "@babel/core": "^7.0.0 || ^8.0.0-0" + } + }, + "node_modules/babel-preset-jest": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-29.6.3.tgz", + "integrity": "sha512-0B3bhxR6snWXJZtR/RliHTDPRgn1sNHOR0yVtq/IiQFyuOVjFS+wuio/R4gSNkyYmKmJB4wGZv2NZanmKmTnNA==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, "node_modules/babel-runtime": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", @@ -1428,8 +2377,7 @@ "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "peer": true + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/baseline-browser-mapping": { "version": "2.10.42", @@ -1514,6 +2462,27 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bs-logger": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz", + "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==", + "dev": true, + "dependencies": { + "fast-json-stable-stringify": "2.x" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", @@ -1551,6 +2520,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", @@ -1594,6 +2572,43 @@ "node": ">=0.10.0" } }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/character-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-2.2.0.tgz", @@ -1636,6 +2651,27 @@ "node": ">=6.0" } }, + "node_modules/ci-info": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.9.0.tgz", + "integrity": "sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "engines": { + "node": ">=8" + } + }, + "node_modules/cjs-module-lexer": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz", + "integrity": "sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==", + "dev": true + }, "node_modules/clean-css": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.4.tgz", @@ -1676,6 +2712,22 @@ "node": ">=6" } }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.3.tgz", + "integrity": "sha512-1L5aqIkwPfiodaMgQunkF1zRhNqifHBmtbbbxcr6yVxxBnliw4TDOW6NxpO8DJLgJ16OT+Y4ztZqP6p/FtXnAw==", + "dev": true + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1710,6 +2762,12 @@ "integrity": "sha512-QE33hToZseCH3jS0qN96O/bSh3kaw/h+Tq7ngyY9eWDUnTlTNUyqfqvCXioLe5Na5jFsL78ra/wuBU4iuEgd4w==", "dev": true }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, "node_modules/constantinople": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.1.2.tgz", @@ -1737,6 +2795,27 @@ "hasInstallScript": true, "peer": true }, + "node_modules/create-jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/create-jest/-/create-jest-29.7.0.tgz", + "integrity": "sha512-Adz2bdH0Vq3F53KEMJOoftQFutWCukm6J24wbPWRO4k1kMY7gS7ds/uoJkNuV8wDCtWWnuwGcJwpWcih+zEW1Q==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.9", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "prompts": "^2.0.1" + }, + "bin": { + "create-jest": "bin/create-jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -1824,6 +2903,29 @@ "node": ">=0.10.0" } }, + "node_modules/dedent": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", + "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==", + "dev": true, + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/dependency-graph": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/dependency-graph/-/dependency-graph-0.11.0.tgz", @@ -1842,6 +2944,24 @@ "node": ">=8" } }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-29.6.3.tgz", + "integrity": "sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, "node_modules/doctypes": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz", @@ -1869,6 +2989,18 @@ "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.388.tgz", "integrity": "sha512-Pl/aJaqOOxYxda3vcx1IKSJimwYXHDkEnGn0F+kG2EE68dDtx2uCinaS+Vih8Z91B9t8CSAbiF/HKyWcnXjhzw==" }, + "node_modules/emittery": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.13.1.tgz", + "integrity": "sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -1908,6 +3040,15 @@ "node": ">=4" } }, + "node_modules/error-ex": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.4.tgz", + "integrity": "sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, "node_modules/es-define-property": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", @@ -1954,6 +3095,15 @@ "node": ">=6" } }, + "node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -1967,6 +3117,19 @@ "node": ">=8.0.0" } }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -2016,24 +3179,78 @@ "node": ">=0.8.x" } }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-uri": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz", - "integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==", + "node_modules/execa": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/fastify" - }, - { - "type": "opencollective", + "dependencies": { + "cross-spawn": "^7.0.3", + "get-stream": "^6.0.0", + "human-signals": "^2.1.0", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.1", + "onetime": "^5.1.2", + "signal-exit": "^3.0.3", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expect": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-29.7.0.tgz", + "integrity": "sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw==", + "dev": true, + "dependencies": { + "@jest/expect-utils": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-uri": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz", + "integrity": "sha512-i70LwGWUduXqzicKXWshooq+sWL1K3WUU5rKZNG/0i3a1OSoX3HqhH5WbWwTmqWfor4urUakGPiRQcleRZTwOg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", "url": "https://opencollective.com/fastify" } ] @@ -2047,6 +3264,15 @@ "node": ">= 4.9.1" } }, + "node_modules/fb-watchman": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", + "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -2102,8 +3328,7 @@ "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "peer": true + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" }, "node_modules/fsevents": { "version": "2.3.3", @@ -2168,6 +3393,15 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, "node_modules/get-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", @@ -2182,6 +3416,18 @@ "node": ">= 0.4" } }, + "node_modules/get-stream": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/glob": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", @@ -2232,6 +3478,46 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/handlebars": { + "version": "4.7.9", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz", + "integrity": "sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/handlebars/node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "optional": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/handlebars/node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true + }, "node_modules/has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", @@ -2282,6 +3568,21 @@ "node": ">= 0.4" } }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/human-signals": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + "dev": true, + "engines": { + "node": ">=10.17.0" + } + }, "node_modules/iconv-lite": { "version": "0.6.3", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", @@ -2327,247 +3628,1091 @@ "engines": { "node": ">=8" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/interpret": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", + "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "dev": true + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "peer": true + }, + "node_modules/is-core-module": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", + "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", + "dev": true, + "dependencies": { + "hasown": "^2.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-expression": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz", + "integrity": "sha512-vyMeQMq+AiH5uUnoBfMTwf18tO3bM6k1QXBE9D6ueAAquEfCZe3AJPtud9g6qS0+4X8xA7ndpZiDyeb2l2qOBw==", + "dev": true, + "peer": true, + "dependencies": { + "acorn": "~4.0.2", + "object-assign": "^4.0.1" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "dev": true, + "peer": true + }, + "node_modules/is-regex": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", + "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "dev": true, + "peer": true, + "dependencies": { + "call-bound": "^1.0.2", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz", + "integrity": "sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-6.0.3.tgz", + "integrity": "sha512-Vtgk7L/R2JHyyGW07spoFlB8/lpjiOLTjMdms6AFMraYt3BaJauod/NGrfnVG/y4Ix1JEuMRPDPEj2ua+zz1/Q==", + "dev": true, + "dependencies": { + "@babel/core": "^7.23.9", + "@babel/parser": "^7.23.9", + "@istanbuljs/schema": "^0.1.3", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^4.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-lib-report/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz", + "integrity": "sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/istanbul-reports": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.2.0.tgz", + "integrity": "sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/javascript-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz", + "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==", + "dev": true + }, + "node_modules/jest": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz", + "integrity": "sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw==", + "dev": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/types": "^29.6.3", + "import-local": "^3.0.2", + "jest-cli": "^29.7.0" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-changed-files": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-29.7.0.tgz", + "integrity": "sha512-fEArFiwf1BpQ+4bXSprcDc3/x4HSzL4al2tozwVpDFpsxALjLYdyiIK4e5Vz66GQJIbXJ82+35PtysofptNX2w==", + "dev": true, + "dependencies": { + "execa": "^5.0.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-changed-files/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-changed-files/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-circus": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-29.7.0.tgz", + "integrity": "sha512-3E1nCMgipcTkCocFwM90XXQab9bS+GMsjdpmPrlelaxwD93Ad8iVEjX/vvHPdLPnFf+L40u+5+iutRdA1N9myw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/expect": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "dedent": "^1.0.0", + "is-generator-fn": "^2.0.0", + "jest-each": "^29.7.0", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "p-limit": "^3.1.0", + "pretty-format": "^29.7.0", + "pure-rand": "^6.0.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-circus/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-circus/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-cli": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-29.7.0.tgz", + "integrity": "sha512-OVVobw2IubN/GSYsxETi+gOe7Ka59EFMR/twOU3Jb2GnKKeMGJB5SGUUrEz3SFVmJASUdZUzy83sLNNQ2gZslg==", + "dev": true, + "dependencies": { + "@jest/core": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "create-jest": "^29.7.0", + "exit": "^0.1.2", + "import-local": "^3.0.2", + "jest-config": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "yargs": "^17.3.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "node-notifier": "^8.0.1 || ^9.0.0 || ^10.0.0" + }, + "peerDependenciesMeta": { + "node-notifier": { + "optional": true + } + } + }, + "node_modules/jest-config": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-29.7.0.tgz", + "integrity": "sha512-uXbpfeQ7R6TZBqI3/TxCU4q4ttk3u0PJeC+E0zbfSoSjq6bJ7buBPxzQPL0ifrkY4DNu4JUdk0ImlBUYi840eQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.11.6", + "@jest/test-sequencer": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-jest": "^29.7.0", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-circus": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-runner": "^29.7.0", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "micromatch": "^4.0.4", + "parse-json": "^5.2.0", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "peerDependencies": { + "@types/node": "*", + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-config/node_modules/brace-expansion": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/jest-config/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/jest-config/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/jest-diff": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz", + "integrity": "sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^29.6.3", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-docblock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-29.7.0.tgz", + "integrity": "sha512-q617Auw3A612guyaFgsbFeYpNP5t2aoUNLwBUbc/0kD1R4t9ixDbyFTHd1nok4epoVFpr7PmeWHrhvuV3XaJ4g==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-each": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-29.7.0.tgz", + "integrity": "sha512-gns+Er14+ZrEoC5fhOfYCY1LOHHr0TI+rQUHZS8Ttw2l7gl+80eHc/gFf2Ktkw0+SIACDTeWvpFcv3B04VembQ==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "jest-util": "^29.7.0", + "pretty-format": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-environment-node": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-29.7.0.tgz", + "integrity": "sha512-DOSwCRqXirTOyheM+4d5YZOrWcdu0LNZ87ewUoywbcb2XR4wKgqiG8vNeYwhjFMbEkfju7wx2GYH0P2gevGvFw==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-mock": "^29.7.0", + "jest-util": "^29.7.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-get-type": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-29.6.3.tgz", + "integrity": "sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw==", + "dev": true, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-haste-map": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-29.7.0.tgz", + "integrity": "sha512-fP8u2pyfqx0K1rGn1R9pyE0/KTn+G7PxktWidOBTqFPLYX0b9ksaMFkhK5vrS3DVun09pckLdlx90QthlW7AmA==", + "dev": true, + "dependencies": { + "@jest/types": "^29.6.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^29.6.3", + "jest-util": "^29.7.0", + "jest-worker": "^29.7.0", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + }, + "optionalDependencies": { + "fsevents": "^2.3.2" + } + }, + "node_modules/jest-haste-map/node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", + "dev": true, + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/import-local/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/jest-leak-detector": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", + "integrity": "sha512-kYA8IJcSYtST2BY9I+SMC32nDpBT3J2NvWJx8+JCuCdl/CR1I4EKUJROiP8XtCcxqgTTBGJNdbB1A8XRKbTetw==", "dev": true, "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/import-local/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/jest-matcher-utils": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz", + "integrity": "sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g==", "dev": true, "dependencies": { - "p-locate": "^4.1.0" + "chalk": "^4.0.0", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/import-local/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/jest-message-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-29.7.0.tgz", + "integrity": "sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w==", "dev": true, "dependencies": { - "p-try": "^2.0.0" + "@babel/code-frame": "^7.12.13", + "@jest/types": "^29.6.3", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "micromatch": "^4.0.4", + "pretty-format": "^29.7.0", + "slash": "^3.0.0", + "stack-utils": "^2.0.3" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/import-local/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/jest-mock": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-29.7.0.tgz", + "integrity": "sha512-ITOMZn+UkYS4ZFh83xYAOzWStloNzJFO2s8DWrE4lhtGD+AorgnbkiKERe4wQVBydIGPx059g6riW5Btp6Llnw==", "dev": true, "dependencies": { - "p-limit": "^2.2.0" + "@jest/types": "^29.6.3", + "@types/node": "*", + "jest-util": "^29.7.0" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/import-local/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/jest-pnp-resolver": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz", + "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==", "dev": true, "engines": { - "node": ">=8" + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } } }, - "node_modules/import-local/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "node_modules/jest-regex-util": { + "version": "29.6.3", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-29.6.3.tgz", + "integrity": "sha512-KJJBsRCyyLNWCNBOvZyRDnAIfUiRJ8v+hOBQYGn8gDyF3UegwiP4gwRR3/SDa42g1YbVycTidUF3rKjyLFDWbg==", "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "peer": true, + "node_modules/jest-resolve": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz", + "integrity": "sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==", + "dev": true, "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "chalk": "^4.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^29.7.0", + "jest-validate": "^29.7.0", + "resolve": "^1.20.0", + "resolve.exports": "^2.0.0", + "slash": "^3.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "peer": true - }, - "node_modules/interpret": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-3.1.1.tgz", - "integrity": "sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ==", + "node_modules/jest-resolve-dependencies": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-29.7.0.tgz", + "integrity": "sha512-un0zD/6qxJ+S0et7WxeI3H5XSe9lTBBR7bOHCHXkKR6luG5mwDDlIzVQ0V5cZCuoTgEdcdwzTghYkTWfubi+nA==", "dev": true, + "dependencies": { + "jest-regex-util": "^29.6.3", + "jest-snapshot": "^29.7.0" + }, "engines": { - "node": ">=10.13.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/jest-runner": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-29.7.0.tgz", + "integrity": "sha512-fsc4N6cPCAahybGBfTRcq5wFR6fpLznMg47sY5aDpsoejOcVYFb07AHuSnR0liMcPTgBsA3ZJL6kFOjPdoNipQ==", + "dev": true, "dependencies": { - "binary-extensions": "^2.0.0" + "@jest/console": "^29.7.0", + "@jest/environment": "^29.7.0", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "graceful-fs": "^4.2.9", + "jest-docblock": "^29.7.0", + "jest-environment-node": "^29.7.0", + "jest-haste-map": "^29.7.0", + "jest-leak-detector": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-resolve": "^29.7.0", + "jest-runtime": "^29.7.0", + "jest-util": "^29.7.0", + "jest-watcher": "^29.7.0", + "jest-worker": "^29.7.0", + "p-limit": "^3.1.0", + "source-map-support": "0.5.13" }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "node_modules/jest-runner/node_modules/jest-worker": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-29.7.0.tgz", + "integrity": "sha512-eIz2msL/EzL9UFTFFx7jBTkeZfku0yUAyZZZmJ93H2TYEiroIx2PQjEXcwYtYl8zXCxb+PAmA2hLIt/6ZEkPHw==", "dev": true, - "peer": true + "dependencies": { + "@types/node": "*", + "jest-util": "^29.7.0", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } }, - "node_modules/is-core-module": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.16.2.tgz", - "integrity": "sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA==", + "node_modules/jest-runner/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", "dev": true, "dependencies": { - "hasown": "^2.0.3" + "yocto-queue": "^0.1.0" }, "engines": { - "node": ">= 0.4" + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-expression": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-expression/-/is-expression-3.0.0.tgz", - "integrity": "sha512-vyMeQMq+AiH5uUnoBfMTwf18tO3bM6k1QXBE9D6ueAAquEfCZe3AJPtud9g6qS0+4X8xA7ndpZiDyeb2l2qOBw==", + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", "dev": true, - "peer": true, "dependencies": { - "acorn": "~4.0.2", - "object-assign": "^4.0.1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "node_modules/jest-runner/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "node_modules/jest-runtime": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-29.7.0.tgz", + "integrity": "sha512-gUnLjgwdGqW7B4LvOIkbKs9WGbn+QLqRQQ9juC6HndeDiezIwhDP+mhMwHWCEcfQ5RUXa6OPnFF8BJh5xegwwQ==", + "dev": true, + "dependencies": { + "@jest/environment": "^29.7.0", + "@jest/fake-timers": "^29.7.0", + "@jest/globals": "^29.7.0", + "@jest/source-map": "^29.6.3", + "@jest/test-result": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "cjs-module-lexer": "^1.0.0", + "collect-v8-coverage": "^1.0.0", + "glob": "^7.1.3", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-mock": "^29.7.0", + "jest-regex-util": "^29.6.3", + "jest-resolve": "^29.7.0", + "jest-snapshot": "^29.7.0", + "jest-util": "^29.7.0", + "slash": "^3.0.0", + "strip-bom": "^4.0.0" + }, "engines": { - "node": ">=8" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "node_modules/jest-runtime/node_modules/brace-expansion": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", + "dev": true, "dependencies": { - "is-extglob": "^2.1.1" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/jest-runtime/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=0.10.0" + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/jest-runtime/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">=0.12.0" + "node": "*" } }, - "node_modules/is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "node_modules/jest-snapshot": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-29.7.0.tgz", + "integrity": "sha512-Rm0BMWtxBcioHr1/OX5YCP8Uov4riHvKPknOGs804Zg9JGZgmIBkbtlxJC/7Z4msKYVbIJtfU+tKb8xlYNfdkw==", "dev": true, "dependencies": { - "isobject": "^3.0.1" + "@babel/core": "^7.11.6", + "@babel/generator": "^7.7.2", + "@babel/plugin-syntax-jsx": "^7.7.2", + "@babel/plugin-syntax-typescript": "^7.7.2", + "@babel/types": "^7.3.3", + "@jest/expect-utils": "^29.7.0", + "@jest/transform": "^29.7.0", + "@jest/types": "^29.6.3", + "babel-preset-current-node-syntax": "^1.0.0", + "chalk": "^4.0.0", + "expect": "^29.7.0", + "graceful-fs": "^4.2.9", + "jest-diff": "^29.7.0", + "jest-get-type": "^29.6.3", + "jest-matcher-utils": "^29.7.0", + "jest-message-util": "^29.7.0", + "jest-util": "^29.7.0", + "natural-compare": "^1.4.0", + "pretty-format": "^29.7.0", + "semver": "^7.5.3" }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/is-promise": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", - "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==", + "node_modules/jest-util": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.7.0.tgz", + "integrity": "sha512-z6EbKajIpqGKU56y5KBUgy1dt1ihhQJgWzUlZHArA/+X2ad7Cb5iF+AK1EWVL/Bo7Rz9uurpqw6SiBCefUbCGA==", "dev": true, - "peer": true + "dependencies": { + "@jest/types": "^29.6.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } }, - "node_modules/is-regex": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.2.1.tgz", - "integrity": "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==", + "node_modules/jest-validate": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-29.7.0.tgz", + "integrity": "sha512-ZB7wHqaRGVw/9hST/OuFUReG7M8vKeq0/J2egIGLdvjHCmYqGARhzXmtgi+gVeZ5uXFF219aOc3Ls2yLg27tkw==", "dev": true, - "peer": true, "dependencies": { - "call-bound": "^1.0.2", - "gopd": "^1.2.0", - "has-tostringtag": "^1.0.2", - "hasown": "^2.0.2" + "@jest/types": "^29.6.3", + "camelcase": "^6.2.0", + "chalk": "^4.0.0", + "jest-get-type": "^29.6.3", + "leven": "^3.1.0", + "pretty-format": "^29.7.0" }, "engines": { - "node": ">= 0.4" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "engines": { + "node": ">=10" }, "funding": { - "url": "https://github.com/sponsors/ljharb" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==", + "node_modules/jest-watcher": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-29.7.0.tgz", + "integrity": "sha512-49Fg7WXkU3Vl2h6LbLtMQ/HyB6rXSIX7SqvBLQmssRBGN9I0PNvPmAmCWSOY6SOvrjhI/F7/bGAv9RtnsPA03g==", "dev": true, + "dependencies": { + "@jest/test-result": "^29.7.0", + "@jest/types": "^29.6.3", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "emittery": "^0.13.1", + "jest-util": "^29.7.0", + "string-length": "^4.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/javascript-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/javascript-stringify/-/javascript-stringify-2.1.0.tgz", - "integrity": "sha512-JVAfqNPTvNq3sB/VHQJAFxN/sPgKnsKrCwyRt15zwNCdrMMJDdcEOdubuy+DuJYYdm0ox1J4uzEuYKkN+9yhVg==", - "dev": true - }, "node_modules/jest-worker": { "version": "27.5.1", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.5.1.tgz", @@ -2594,6 +4739,19 @@ "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, + "node_modules/js-yaml": { + "version": "3.15.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.15.0.tgz", + "integrity": "sha512-ttBQIIQPDeLjpPOohtUdXuXUVoA2uIB6fEH9HyJ7234s5mBJ5wTx20njxplLZQgLaOfpmPQA7X2t5AX6tIPbog==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, "node_modules/jsesc": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.1.0.tgz", @@ -2605,6 +4763,12 @@ "node": ">=6" } }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, "node_modules/json-schema-traverse": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", @@ -2642,6 +4806,15 @@ "node": ">=0.10.0" } }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/lazy-cache": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", @@ -2652,6 +4825,21 @@ "node": ">=0.10.0" } }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "dev": true + }, "node_modules/loader-runner": { "version": "4.3.2", "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.2.tgz", @@ -2713,6 +4901,12 @@ "dev": true, "peer": true }, + "node_modules/lodash.memoize": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", + "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", + "dev": true + }, "node_modules/longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -2742,6 +4936,36 @@ "node": ">=12" } }, + "node_modules/make-dir": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", + "dev": true, + "dependencies": { + "semver": "^7.5.3" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true + }, + "node_modules/makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "dependencies": { + "tmpl": "1.0.5" + } + }, "node_modules/math-intrinsics": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", @@ -2758,6 +4982,19 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/mime-db": { "version": "1.54.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", @@ -2767,6 +5004,15 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/minimatch": { "version": "5.1.9", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.9.tgz", @@ -2871,6 +5117,12 @@ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, "node_modules/neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", @@ -2898,6 +5150,12 @@ "dev": true, "optional": true }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==", + "dev": true + }, "node_modules/node-releases": { "version": "2.0.50", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.50.tgz", @@ -2914,6 +5172,18 @@ "node": ">=0.10.0" } }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -2927,11 +5197,25 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "peer": true, "dependencies": { "wrappy": "1" } }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", @@ -2971,6 +5255,24 @@ "node": ">=6" } }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", @@ -2980,6 +5282,15 @@ "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", @@ -3011,6 +5322,15 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, + "node_modules/pirates": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.7.tgz", + "integrity": "sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, "node_modules/pkg-dir": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-7.0.0.tgz", @@ -3132,6 +5452,32 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, + "node_modules/pretty-format": { + "version": "29.7.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", + "integrity": "sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==", + "dev": true, + "dependencies": { + "@jest/schemas": "^29.6.3", + "ansi-styles": "^5.0.0", + "react-is": "^18.0.0" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/pretty-format/node_modules/ansi-styles": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-5.2.0.tgz", + "integrity": "sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, "node_modules/promise": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", @@ -3142,6 +5488,19 @@ "asap": "~2.0.3" } }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/pug": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/pug/-/pug-2.0.4.tgz", @@ -3293,6 +5652,28 @@ "integrity": "sha512-GMu3M5nUL3fju4/egXwZO0XLi6fW/K3T3VTgFQ14GxNi8btlxgT5qZL//JwZFm/2Fa64J/PNS8AZeys3wiMkVA==", "dev": true }, + "node_modules/pure-rand": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", + "integrity": "sha512-bVWawvoZoBYpp6yIoQtQXHZjmz35RSVHnUOTefl8Vcjr8snTPY1wnpSPMWekcFwbxI6gtmT7rSYPFvz71ldiOA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/dubzzz" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fast-check" + } + ] + }, + "node_modules/react-is": { + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", + "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", + "dev": true + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -3397,6 +5778,15 @@ "node": ">=8" } }, + "node_modules/resolve.exports": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.3.tgz", + "integrity": "sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -3572,12 +5962,33 @@ "node": ">=8" } }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, "node_modules/simple-html-tokenizer": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/simple-html-tokenizer/-/simple-html-tokenizer-0.1.1.tgz", "integrity": "sha512-Mc/gH3RvlKvB/gkp9XwgDKEWrSYyefIJPGG8Jk1suZms/rISdUuVEMx5O1WBnTWaScvxXDvGJrZQWblUmQHjkQ==", "dev": true }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -3626,6 +6037,37 @@ "source-map": "^0.6.0" } }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true + }, + "node_modules/stack-utils": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.6.tgz", + "integrity": "sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-length": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", + "integrity": "sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/string-width": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", @@ -3650,6 +6092,36 @@ "node": ">=8" } }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/style-loader": { "version": "3.3.4", "resolved": "https://registry.npmjs.org/style-loader/-/style-loader-3.3.4.tgz", @@ -3799,6 +6271,69 @@ "node": ">=0.4.0" } }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/brace-expansion": { + "version": "1.1.15", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz", + "integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/test-exclude/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, "node_modules/to-fast-properties": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", @@ -3827,11 +6362,96 @@ "dev": true, "peer": true }, + "node_modules/ts-jest": { + "version": "29.4.11", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.11.tgz", + "integrity": "sha512-IrFl7l9AuB/qrNw5quqvAv/hmKMb8dhWOH4jQOGo0Oq8tCeo1O86/iTFG1FaRimgUkF13l4PcepO8ATFT6Ns4g==", + "dev": true, + "dependencies": { + "bs-logger": "^0.2.6", + "fast-json-stable-stringify": "^2.1.0", + "handlebars": "^4.7.9", + "json5": "^2.2.3", + "lodash.memoize": "^4.1.2", + "make-error": "^1.3.6", + "semver": "^7.8.0", + "type-fest": "^4.41.0", + "yargs-parser": "^21.1.1" + }, + "bin": { + "ts-jest": "cli.js" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || ^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "@babel/core": ">=7.0.0-beta.0 <8", + "@jest/transform": "^29.0.0 || ^30.0.0", + "@jest/types": "^29.0.0 || ^30.0.0", + "babel-jest": "^29.0.0 || ^30.0.0", + "jest": "^29.0.0 || ^30.0.0", + "jest-util": "^29.0.0 || ^30.0.0", + "typescript": ">=4.3 <7" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "@jest/transform": { + "optional": true + }, + "@jest/types": { + "optional": true + }, + "babel-jest": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jest-util": { + "optional": true + } + } + }, + "node_modules/ts-jest/node_modules/type-fest": { + "version": "4.41.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-4.41.0.tgz", + "integrity": "sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typescript": { "version": "4.9.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", @@ -3942,6 +6562,26 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/v8-to-istanbul": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", + "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, "node_modules/void-elements": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", @@ -3952,6 +6592,15 @@ "node": ">=0.10.0" } }, + "node_modules/walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "dependencies": { + "makeerror": "1.0.12" + } + }, "node_modules/watchpack": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.5.2.tgz", @@ -4194,8 +6843,20 @@ "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "peer": true + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" + }, + "node_modules/write-file-atomic": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.2.tgz", + "integrity": "sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, "node_modules/y18n": { "version": "5.0.8", diff --git a/package.json b/package.json index f2d2d0e..cff10ab 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "build:server": "npm run build -w @peershell/server", "build:all": "npm run build:shared && npm run build:web && npm run copy:web-asset && npm run build:tabby && npm run build:server", "watch:tabby": "npm run watch -w tabby-peershell", - "test": "npm run test --workspaces --if-present" + "test": "jest", + "test:smoke": "node clients/tabby/test/smoke-load.cjs" } } diff --git a/shared/test/pinAuth.test.ts b/shared/test/pinAuth.test.ts new file mode 100644 index 0000000..fe6300e --- /dev/null +++ b/shared/test/pinAuth.test.ts @@ -0,0 +1,37 @@ +import { hashPin, verifyPin, generateNonce, isAcceptablePin } from '../src/pinAuth' + +describe('pinAuth challenge-response', () => { + it('hash is deterministic and a 64-char hex digest', async () => { + const h1 = await hashPin('123456', 'nonceA') + const h2 = await hashPin('123456', 'nonceA') + expect(h1).toBe(h2) + expect(h1).toMatch(/^[0-9a-f]{64}$/) + }) + + it('a different nonce yields a different hash, and the raw PIN never appears in the hash', async () => { + const h1 = await hashPin('123456', 'nonceA') + const h2 = await hashPin('123456', 'nonceB') + expect(h1).not.toBe(h2) + expect(h1.includes('123456')).toBe(false) + }) + + it('verifyPin accepts the correct PIN and rejects a wrong one', async () => { + const nonce = generateNonce() + const hash = await hashPin('654321', nonce) + expect(await verifyPin('654321', nonce, hash)).toBe(true) + expect(await verifyPin('000000', nonce, hash)).toBe(false) + }) + + it('generateNonce is fresh 32-char hex', () => { + const a = generateNonce() + const b = generateNonce() + expect(a).toMatch(/^[0-9a-f]{32}$/) + expect(a).not.toBe(b) + }) + + it('isAcceptablePin enforces min length and digits', () => { + expect(isAcceptablePin('12345')).toBe(false) + expect(isAcceptablePin('123456')).toBe(true) + expect(isAcceptablePin('abcdef')).toBe(false) + }) +}) diff --git a/shared/test/protocol.test.ts b/shared/test/protocol.test.ts new file mode 100644 index 0000000..8af5825 --- /dev/null +++ b/shared/test/protocol.test.ts @@ -0,0 +1,50 @@ +import { + encodeBinaryFrame, decodeBinaryFrame, Channel, BINARY_HEADER_BYTES, + encodeControl, decodeControl, PROTOCOL_VERSION, +} from '../src/protocol' + +describe('binary framing', () => { + it('round-trips peerId, channel and payload', () => { + const data = new Uint8Array([0, 1, 2, 255, 128]) + const frame = encodeBinaryFrame(0x01020304, Channel.Output, data) + expect(frame.length).toBe(BINARY_HEADER_BYTES + data.length) + const d = decodeBinaryFrame(frame) + expect(d.peerId).toBe(0x01020304) + expect(d.channel).toBe(Channel.Output) + expect(Array.from(d.data)).toEqual(Array.from(data)) + }) + + it('preserves a large peerId (uint32) big-endian', () => { + const d = decodeBinaryFrame(encodeBinaryFrame(0xffffffff, Channel.Input, new Uint8Array([9]))) + expect(d.peerId).toBe(0xffffffff) + }) + + it('handles input channel and empty payload (from ArrayBuffer)', () => { + const f = encodeBinaryFrame(0, Channel.Input, new Uint8Array()) + const d = decodeBinaryFrame(f.buffer) + expect(d.channel).toBe(Channel.Input) + expect(d.peerId).toBe(0) + expect(d.data.length).toBe(0) + }) + + it('throws on a too-short frame', () => { + expect(() => decodeBinaryFrame(new Uint8Array([1, 2]))).toThrow() + }) +}) + +describe('control messages', () => { + it('stamps the protocol version and round-trips', () => { + const s = encodeControl({ t: 'pin-challenge', nonce: 'abc' }) + expect(JSON.parse(s).v).toBe(PROTOCOL_VERSION) + const m = decodeControl(s) + expect(m.t).toBe('pin-challenge') + if (m.t === 'pin-challenge') { + expect(m.nonce).toBe('abc') + } + }) + + it('rejects malformed messages', () => { + expect(() => decodeControl('not json')).toThrow() + expect(() => decodeControl('{"x":1}')).toThrow() + }) +}) diff --git a/shared/test/utf8Splitter.test.ts b/shared/test/utf8Splitter.test.ts new file mode 100644 index 0000000..79cfbcc --- /dev/null +++ b/shared/test/utf8Splitter.test.ts @@ -0,0 +1,40 @@ +import { Utf8Splitter } from '../src/utf8Splitter' +import { isValidRoomCode, isAllowedTunnelPath } from '../src/api' + +describe('Utf8Splitter', () => { + it('reassembles multibyte codepoints split one byte at a time', () => { + const full = 'aé🚀z' // 'é' = 2 bytes, '🚀' = 4 bytes + const bytes = new TextEncoder().encode(full) + const s = new Utf8Splitter() + let out = '' + for (const b of bytes) { + out += s.write(new Uint8Array([b])) + } + out += s.flush() + expect(out).toBe(full) + expect(out.includes('�')).toBe(false) + }) + + it('passes ASCII straight through', () => { + const s = new Utf8Splitter() + expect(s.write(new TextEncoder().encode('hello'))).toBe('hello') + }) +}) + +describe('validators', () => { + it('accepts valid room codes and rejects ambiguous chars', () => { + expect(isValidRoomCode('ABC234')).toBe(true) + expect(isValidRoomCode('abc234')).toBe(true) // normalized to upper + expect(isValidRoomCode('ABC01O')).toBe(false) // 0/1/O excluded + expect(isValidRoomCode('SHORT')).toBe(false) // < 6 + }) + + it('tunnel path whitelist rejects traversal/SSRF', () => { + expect(isAllowedTunnelPath('/')).toBe(true) + expect(isAllowedTunnelPath('/index.html')).toBe(true) + expect(isAllowedTunnelPath('/../../etc/passwd')).toBe(false) + expect(isAllowedTunnelPath('/%2e%2e/%2e%2e/etc/passwd')).toBe(false) + expect(isAllowedTunnelPath('http://169.254.169.254/')).toBe(false) + expect(isAllowedTunnelPath('/secret')).toBe(false) + }) +}) diff --git a/tsconfig.jest.json b/tsconfig.jest.json new file mode 100644 index 0000000..370d234 --- /dev/null +++ b/tsconfig.jest.json @@ -0,0 +1,13 @@ +{ + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "node", + "lib": ["ES2020", "DOM"], + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "types": ["jest", "node"] + } +} From 5a870489b0f82076b49a0d993ae3442b26358f8e Mon Sep 17 00:00:00 2001 From: tis24dev Date: Tue, 7 Jul 2026 21:51:10 +0200 Subject: [PATCH 03/75] Stage 1: shared WebSocketTransport + dev relay + end-to-end wire test - shared/websocketTransport.ts: SessionTransport over WebSocket (global by default, injectable impl for Node), text=control / binary=framed data - server/dev-relay.cjs: throwaway rendezvous + blind relay (pairs host/guest by room/token, forwards every frame), runnable standalone; @peershell/server precursor - shared/test/transport.integration.test.ts: two transports through the relay do hello -> create/join -> PIN challenge-response -> snapshot-ack barrier -> output/input frames; plus wrong-PIN -> pin-fail 17/17 tests green; build:all green. --- package-lock.json | 34 ++++- package.json | 4 +- server/dev-relay.cjs | 145 ++++++++++++++++++++++ shared/src/index.ts | 1 + shared/src/websocketTransport.ts | 135 ++++++++++++++++++++ shared/test/transport.integration.test.ts | 133 ++++++++++++++++++++ 6 files changed, 450 insertions(+), 2 deletions(-) create mode 100644 server/dev-relay.cjs create mode 100644 shared/src/websocketTransport.ts create mode 100644 shared/test/transport.integration.test.ts diff --git a/package-lock.json b/package-lock.json index fc8a765..a716749 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,9 @@ "server" ], "devDependencies": { - "typescript": "^4.9.5" + "@types/ws": "^8.18.1", + "typescript": "^4.9.5", + "ws": "^8.21.0" }, "engines": { "node": ">=18" @@ -1817,6 +1819,15 @@ "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "dev": true }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yargs": { "version": "17.0.35", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.35.tgz", @@ -6858,6 +6869,27 @@ "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, + "node_modules/ws": { + "version": "8.21.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", + "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", + "dev": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/y18n": { "version": "5.0.8", "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", diff --git a/package.json b/package.json index cff10ab..4b678c0 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,9 @@ "node": ">=18" }, "devDependencies": { - "typescript": "^4.9.5" + "@types/ws": "^8.18.1", + "typescript": "^4.9.5", + "ws": "^8.21.0" }, "scripts": { "build:shared": "npm run build -w @peershell/protocol", diff --git a/server/dev-relay.cjs b/server/dev-relay.cjs new file mode 100644 index 0000000..bb3830e --- /dev/null +++ b/server/dev-relay.cjs @@ -0,0 +1,145 @@ +/** + * Throwaway dev rendezvous + blind relay (precursor of the real @peershell/server, Stage 5). + * Pairs one host + one guest by room/token, then forwards EVERY frame (text control + binary) + * verbatim between them. No auth, no TLS, no HTTP tunnel yet — just enough to exercise the wire. + * + * const { startRelay } = require('./dev-relay.cjs') + * const relay = await startRelay(0) // ephemeral port -> { port, url, close } + * + * Or run standalone: node server/dev-relay.cjs (PORT env, default 8787) + */ +const http = require('http') +const crypto = require('crypto') +const { WebSocketServer } = require('ws') + +const CODE_ALPHABET = '23456789ABCDEFGHJKMNPQRSTUVWXYZ' + +function genCode(n = 6) { + const bytes = crypto.randomBytes(n) + let out = '' + for (let i = 0; i < n; i++) { + out += CODE_ALPHABET[bytes[i] % CODE_ALPHABET.length] + } + return out +} + +const genToken = () => crypto.randomBytes(18).toString('base64url') + +function startRelay(port = 0) { + return new Promise(resolve => { + let boundPort = port + const rooms = new Map() // room -> { host, guest } + const tokens = new Map() // token -> room + + const server = http.createServer((_req, res) => { + res.writeHead(200, { 'content-type': 'text/plain' }) + res.end('peershell dev relay\n') + }) + const wss = new WebSocketServer({ server }) + + function safeSend(sock, data, binary) { + if (sock && sock.readyState === sock.OPEN) { + sock.send(data, { binary: !!binary }) + } + } + + wss.on('connection', sock => { + sock._role = null + sock._room = null + sock._peer = null + + sock.on('message', (data, isBinary) => { + // Once paired, the relay is blind: forward everything to the peer. + if (sock._peer) { + safeSend(sock._peer, isBinary ? data : data.toString(), isBinary) + return + } + if (isBinary) { + return // no binary before pairing + } + let msg + try { + msg = JSON.parse(data.toString()) + } catch { + return + } + handleSignal(sock, msg) + }) + + sock.on('close', () => { + const room = sock._room + if (room && rooms.has(room)) { + const entry = rooms.get(room) + const other = entry.host === sock ? entry.guest : entry.host + safeSend(other, JSON.stringify({ v: 1, t: 'peer-left', reason: 'socket-closed' }), false) + rooms.delete(room) + for (const [tok, r] of tokens) { + if (r === room) { + tokens.delete(tok) + } + } + } + }) + }) + + function handleSignal(sock, msg) { + switch (msg.t) { + case 'hello': + sock._role = msg.role + sock._kind = msg.kind || 'desktop' + break + case 'create-session': { + const room = genCode() + const token = genToken() + rooms.set(room, { host: sock, guest: null }) + tokens.set(token, room) + sock._room = room + const magicLink = `http://127.0.0.1:${boundPort}/s/${token}` + safeSend(sock, JSON.stringify({ v: 1, t: 'session-created', room, magicLink }), false) + break + } + case 'join': { + const room = msg.room ? String(msg.room).toUpperCase() : tokens.get(msg.token) + const entry = room && rooms.get(room) + if (!entry) { + safeSend(sock, JSON.stringify({ v: 1, t: 'error', code: 'no-such-room' }), false) + return + } + if (entry.guest) { + safeSend(sock, JSON.stringify({ v: 1, t: 'error', code: 'session-busy' }), false) + return + } + entry.guest = sock + sock._room = room + sock._peer = entry.host + entry.host._peer = sock + safeSend(entry.host, JSON.stringify({ v: 1, t: 'peer-joined', peerId: 0, kind: sock._kind }), false) + break + } + default: + break + } + } + + server.listen(port, '127.0.0.1', () => { + boundPort = server.address().port + resolve({ + port: boundPort, + url: `ws://127.0.0.1:${boundPort}`, + close: () => new Promise(res => { + for (const c of wss.clients) { + try { c.terminate() } catch { /* ignore */ } + } + wss.close(() => server.close(() => res())) + }), + }) + }) + }) +} + +module.exports = { startRelay } + +if (require.main === module) { + const port = Number(process.env.PORT || 8787) + startRelay(port).then(r => console.log(`[dev-relay] listening on ${r.url}`)) +} diff --git a/shared/src/index.ts b/shared/src/index.ts index 5fffc22..efc21eb 100644 --- a/shared/src/index.ts +++ b/shared/src/index.ts @@ -2,3 +2,4 @@ export * from './protocol' export * from './api' export * from './pinAuth' export * from './utf8Splitter' +export * from './websocketTransport' diff --git a/shared/src/websocketTransport.ts b/shared/src/websocketTransport.ts new file mode 100644 index 0000000..2ea0b5a --- /dev/null +++ b/shared/src/websocketTransport.ts @@ -0,0 +1,135 @@ +/** + * SessionTransport over a WebSocket. Framework-neutral: uses the global `WebSocket` by default + * (Electron renderer + browsers), or an injected implementation (e.g. the `ws` package in Node tests). + * A future WebRTC DataChannel transport can implement the same SessionTransport interface. + */ +import { + ControlMessage, Channel, encodeControl, decodeControl, encodeBinaryFrame, decodeBinaryFrame, +} from './protocol' +import { SessionTransport, TransportState, BinaryPayload } from './api' + +/** Minimal browser-WebSocket surface we rely on (satisfied by DOM WebSocket and the `ws` package). */ +export interface WebSocketLike { + binaryType: string + send(data: string | ArrayBufferView | ArrayBuffer): void + close(code?: number, reason?: string): void + onopen: ((ev: unknown) => void) | null + onmessage: ((ev: { data: unknown }) => void) | null + onclose: ((ev: unknown) => void) | null + onerror: ((ev: unknown) => void) | null +} + +export type WebSocketCtor = new (url: string) => WebSocketLike + +function toUint8(data: unknown): Uint8Array { + if (data instanceof ArrayBuffer) { + return new Uint8Array(data) + } + if (ArrayBuffer.isView(data)) { + const v = data as ArrayBufferView + return new Uint8Array(v.buffer, v.byteOffset, v.byteLength) + } + throw new Error('peershell: unexpected binary message type') +} + +export class WebSocketTransport implements SessionTransport { + private ws: WebSocketLike | null = null + private state: TransportState = 'closed' + private readonly WS: WebSocketCtor + private readonly controlCbs: Array<(m: ControlMessage) => void> = [] + private readonly binaryCbs: Array<(f: BinaryPayload) => void> = [] + private readonly stateCbs: Array<(s: TransportState) => void> = [] + + constructor(wsImpl?: WebSocketCtor) { + const impl = wsImpl ?? (globalThis as unknown as { WebSocket?: WebSocketCtor }).WebSocket + if (!impl) { + throw new Error('peershell: no WebSocket implementation available (inject one for Node)') + } + this.WS = impl + } + + connect(url: string, token?: string): Promise { + return new Promise((resolve, reject) => { + this.setState('connecting') + const full = token + ? `${url}${url.includes('?') ? '&' : '?'}token=${encodeURIComponent(token)}` + : url + let ws: WebSocketLike + try { + ws = new this.WS(full) + } catch (err) { + this.setState('closed') + reject(err instanceof Error ? err : new Error(String(err))) + return + } + ws.binaryType = 'arraybuffer' + this.ws = ws + ws.onopen = () => { + this.setState('open') + resolve() + } + ws.onerror = () => { + if (this.state === 'connecting') { + reject(new Error('peershell: WebSocket connection failed')) + } + } + ws.onclose = () => this.setState('closed') + ws.onmessage = ev => this.dispatch(ev.data) + }) + } + + private dispatch(data: unknown): void { + if (typeof data === 'string') { + let msg: ControlMessage + try { + msg = decodeControl(data) + } catch { + return // ignore malformed control frames + } + for (const cb of this.controlCbs) { + cb(msg) + } + return + } + let frame: BinaryPayload + try { + frame = decodeBinaryFrame(toUint8(data)) + } catch { + return + } + for (const cb of this.binaryCbs) { + cb(frame) + } + } + + sendControl(msg: ControlMessage): void { + this.ws?.send(encodeControl(msg)) + } + + sendData(peerId: number, channel: Channel, data: Uint8Array): void { + this.ws?.send(encodeBinaryFrame(peerId, channel, data)) + } + + close(code?: number, reason?: string): void { + this.ws?.close(code, reason) + } + + onControl(cb: (m: ControlMessage) => void): void { + this.controlCbs.push(cb) + } + + onBinary(cb: (f: BinaryPayload) => void): void { + this.binaryCbs.push(cb) + } + + onState(cb: (s: TransportState) => void): void { + this.stateCbs.push(cb) + } + + private setState(s: TransportState): void { + this.state = s + for (const cb of this.stateCbs) { + cb(s) + } + } +} diff --git a/shared/test/transport.integration.test.ts b/shared/test/transport.integration.test.ts new file mode 100644 index 0000000..9975745 --- /dev/null +++ b/shared/test/transport.integration.test.ts @@ -0,0 +1,133 @@ +/** + * End-to-end wire test: two WebSocketTransport instances talk through the throwaway dev relay, + * exercising the full Stage 1-3 handshake (hello -> create/join -> PIN challenge-response -> + * snapshot-ack barrier -> output/input binary frames). Uses the `ws` package as the injected + * WebSocket implementation for Node. + */ +import WebSocket from 'ws' +import { WebSocketTransport, WebSocketCtor } from '../src/websocketTransport' +import { Channel } from '../src/protocol' +import { hashPin, verifyPin, generateNonce } from '../src/pinAuth' + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { startRelay } = require('../../server/dev-relay.cjs') as { + startRelay: (port?: number) => Promise<{ port: number, url: string, close: () => Promise }> +} + +const WS = WebSocket as unknown as WebSocketCtor +const enc = (s: string) => new TextEncoder().encode(s) +const dec = (b: Uint8Array) => new TextDecoder().decode(b) + +let relay: { url: string, close: () => Promise } + +beforeAll(async () => { + relay = await startRelay(0) +}) + +afterAll(async () => { + await relay.close() +}) + +async function connectPair() { + const host = new WebSocketTransport(WS) + const guest = new WebSocketTransport(WS) + await host.connect(relay.url) + await guest.connect(relay.url) + return { host, guest } +} + +it('mirrors output and injects input across the relay after a correct PIN', async () => { + const { host, guest } = await connectPair() + const PIN = '135790' + let hostNonce = '' + + const done = new Promise<{ output: string, input: string }>(resolve => { + let output = '' + + host.onControl(m => { + if (m.t === 'session-created') { + guest.sendControl({ t: 'hello', role: 'guest', kind: 'web' }) + guest.sendControl({ t: 'join', room: m.room }) + } else if (m.t === 'peer-joined') { + hostNonce = generateNonce() + host.sendControl({ t: 'pin-challenge', nonce: hostNonce }) + } else if (m.t === 'pin-response') { + void verifyPin(PIN, hostNonce, m.hash).then(ok => { + expect(ok).toBe(true) + host.sendControl({ t: 'pin-ok' }) + host.sendControl({ t: 'snapshot', cols: 80, rows: 24, data: '' }) + }) + } else if (m.t === 'snapshot-ack') { + host.sendData(0, Channel.Output, enc('hello from host\r\n')) + } + }) + host.onBinary(f => { + if (f.channel === Channel.Input) { + resolve({ output, input: dec(f.data) }) + } + }) + + guest.onControl(m => { + if (m.t === 'pin-challenge') { + void hashPin(PIN, m.nonce).then(hash => guest.sendControl({ t: 'pin-response', hash })) + } else if (m.t === 'snapshot') { + guest.sendControl({ t: 'snapshot-ack' }) + } + }) + guest.onBinary(f => { + if (f.channel === Channel.Output) { + output = dec(f.data) + guest.sendData(0, Channel.Input, enc('ls\n')) + } + }) + }) + + host.sendControl({ t: 'hello', role: 'host', kind: 'desktop' }) + host.sendControl({ t: 'create-session' }) + + const result = await done + expect(result.output).toBe('hello from host\r\n') + expect(result.input).toBe('ls\n') + + host.close() + guest.close() +}, 15000) + +it('rejects a wrong PIN with pin-fail', async () => { + const { host, guest } = await connectPair() + const CORRECT = '111111' + const WRONG = '999999' + let hostNonce = '' + + const failed = new Promise(resolve => { + host.onControl(m => { + if (m.t === 'session-created') { + guest.sendControl({ t: 'hello', role: 'guest', kind: 'web' }) + guest.sendControl({ t: 'join', room: m.room }) + } else if (m.t === 'peer-joined') { + hostNonce = generateNonce() + host.sendControl({ t: 'pin-challenge', nonce: hostNonce }) + } else if (m.t === 'pin-response') { + void verifyPin(CORRECT, hostNonce, m.hash).then(ok => { + host.sendControl(ok ? { t: 'pin-ok' } : { t: 'pin-fail', left: 4 }) + }) + } + }) + guest.onControl(m => { + if (m.t === 'pin-challenge') { + void hashPin(WRONG, m.nonce).then(hash => guest.sendControl({ t: 'pin-response', hash })) + } else if (m.t === 'pin-fail') { + resolve(true) + } else if (m.t === 'pin-ok') { + resolve(false) + } + }) + }) + + host.sendControl({ t: 'hello', role: 'host', kind: 'desktop' }) + host.sendControl({ t: 'create-session' }) + + expect(await failed).toBe(true) + host.close() + guest.close() +}, 15000) From 3035061e6c11596b503d0f9dfb790e5322d46846 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Tue, 7 Jul 2026 22:10:54 +0200 Subject: [PATCH 04/75] =?UTF-8?q?Stage=201:=20Tabby=20host=20glue=20?= =?UTF-8?q?=E2=80=94=20ShareController,=20providers,=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - host/shareController.ts: Tabby-agnostic host controller (HostTerminal port + SessionTransport). Creates session, snapshot-ack barrier, mirrors output, injects guest input, forwards resize, tears down on tab close. Unit-tested with mock transport + mock tab. - services/peershell.service.ts: adapts a real BaseTerminalTabComponent to HostTerminal, owns active shares, gates on configured server URL. - providers: toolbar "Share terminal" + tab context-menu Share/Stop. - config.ts: PeershellConfigProvider (peershell.serverUrl, magicLinkTtl). - types/tabby.d.ts: minimal ambient shims so the plugin builds decoupled from Tabby's source tree (real impls come from Tabby at runtime as webpack externals). - shared/base64.ts (snapshot payload). Generic-stub smoke-load resilient to future externals. 19/19 tests green; build:all green; smoke-load PASS. --- clients/tabby/src/config.ts | 12 ++ clients/tabby/src/host/shareController.ts | 128 ++++++++++++++++++ clients/tabby/src/index.ts | 24 ++-- clients/tabby/src/providers/tabContextMenu.ts | 32 +++++ .../src/providers/toolbarButtonProvider.ts | 26 ++++ .../tabby/src/services/peershell.service.ts | 86 ++++++++++++ clients/tabby/src/types/tabby.d.ts | 78 +++++++++++ clients/tabby/test/shareController.test.ts | 113 ++++++++++++++++ clients/tabby/test/smoke-load.cjs | 29 ++-- clients/tabby/tsconfig.json | 5 +- jest.setup.cjs | 6 + shared/src/base64.ts | 23 ++++ shared/src/index.ts | 1 + tsconfig.jest.json | 6 +- 14 files changed, 547 insertions(+), 22 deletions(-) create mode 100644 clients/tabby/src/config.ts create mode 100644 clients/tabby/src/host/shareController.ts create mode 100644 clients/tabby/src/providers/tabContextMenu.ts create mode 100644 clients/tabby/src/providers/toolbarButtonProvider.ts create mode 100644 clients/tabby/src/services/peershell.service.ts create mode 100644 clients/tabby/src/types/tabby.d.ts create mode 100644 clients/tabby/test/shareController.test.ts create mode 100644 shared/src/base64.ts diff --git a/clients/tabby/src/config.ts b/clients/tabby/src/config.ts new file mode 100644 index 0000000..ba68ea6 --- /dev/null +++ b/clients/tabby/src/config.ts @@ -0,0 +1,12 @@ +import { ConfigProvider } from 'tabby-core' + +export class PeershellConfigProvider extends ConfigProvider { + defaults = { + peershell: { + serverUrl: null, + magicLinkTtlMinutes: 15, + }, + } + + platformDefaults = {} +} diff --git a/clients/tabby/src/host/shareController.ts b/clients/tabby/src/host/shareController.ts new file mode 100644 index 0000000..a5b00f6 --- /dev/null +++ b/clients/tabby/src/host/shareController.ts @@ -0,0 +1,128 @@ +/** + * Host side of a shared session. Deliberately Tabby-agnostic: it drives a SessionTransport and a + * small HostTerminal port, so it is fully unit-testable with mocks. PeershellService adapts a real + * Tabby BaseTerminalTabComponent to HostTerminal. + * + * Stage 1 scope: connect, create session, and — after a guest joins and acks the snapshot — mirror + * the terminal output out and inject the guest's input back. The PIN gate lands in Stage 3; the + * snapshot-ack barrier is already wired here. + */ +import { Observable, Subscription } from 'rxjs' +import { + SessionTransport, ControlMessage, Channel, SINGLE_PEER, utf8ToBase64, +} from '@peershell/protocol' + +/** Port the controller needs from the host terminal (adapted from Tabby's tab). */ +export interface HostTerminal { + readonly output$: Observable + sendInput(data: Uint8Array): void + getSize(): { cols: number, rows: number } + readonly resize$: Observable<{ cols: number, rows: number }> + snapshot(): string + readonly closed$: Observable +} + +export interface ShareHandle { room: string, magicLink: string } + +export interface ShareHooks { + onSession?: (h: ShareHandle) => void + onPeerJoined?: () => void + onPeerLeft?: (reason?: string) => void + onError?: (code: string, message?: string) => void +} + +export class ShareController { + room: string | null = null + magicLink: string | null = null + + private subs = new Subscription() + private streaming = false + private peerId = SINGLE_PEER + private stopped = false + + constructor( + private readonly transport: SessionTransport, + private readonly tab: HostTerminal, + private readonly hooks: ShareHooks = {}, + ) {} + + async start(serverUrl: string, token?: string): Promise { + this.transport.onControl(m => this.onControl(m)) + this.transport.onBinary(f => { + if (f.channel === Channel.Input) { + this.tab.sendInput(f.data) + } + }) + this.subs.add(this.tab.closed$.subscribe(() => this.stop('host-ended'))) + + await this.transport.connect(serverUrl, token) + this.transport.sendControl({ t: 'hello', role: 'host', kind: 'desktop', client: 'tabby-peershell' }) + this.transport.sendControl({ t: 'create-session' }) + } + + private onControl(m: ControlMessage): void { + switch (m.t) { + case 'session-created': + this.room = m.room + this.magicLink = m.magicLink + this.hooks.onSession?.({ room: m.room, magicLink: m.magicLink }) + break + case 'peer-joined': + this.peerId = m.peerId ?? SINGLE_PEER + this.hooks.onPeerJoined?.() + this.sendSnapshot() + break + case 'snapshot-ack': + this.beginStream() + break + case 'peer-left': + this.streaming = false + this.hooks.onPeerLeft?.(m.reason) + break + case 'error': + this.hooks.onError?.(m.code, m.message) + break + default: + break + } + } + + private sendSnapshot(): void { + const size = this.tab.getSize() + this.transport.sendControl({ + t: 'snapshot', + cols: size.cols, + rows: size.rows, + data: utf8ToBase64(this.tab.snapshot()), + }) + } + + private beginStream(): void { + if (this.streaming || this.stopped) { + return + } + this.streaming = true + this.subs.add(this.tab.output$.subscribe(data => { + if (this.streaming) { + this.transport.sendData(this.peerId, Channel.Output, data) + } + })) + this.subs.add(this.tab.resize$.subscribe(sz => { + this.transport.sendControl({ t: 'resize', cols: sz.cols, rows: sz.rows }) + })) + } + + stop(reason = 'stopped'): void { + if (this.stopped) { + return + } + this.stopped = true + if (this.room !== null) { + this.transport.sendControl({ t: 'peer-left', reason }) + this.transport.sendControl({ t: 'session-close' }) + } + this.streaming = false + this.subs.unsubscribe() + this.transport.close(1000, reason) + } +} diff --git a/clients/tabby/src/index.ts b/clients/tabby/src/index.ts index 417e1c4..7f3653f 100644 --- a/clients/tabby/src/index.ts +++ b/clients/tabby/src/index.ts @@ -1,17 +1,25 @@ /* eslint-disable @typescript-eslint/no-extraneous-class */ import { NgModule } from '@angular/core' +import { ConfigProvider, ToolbarButtonProvider, TabContextMenuItemProvider } from 'tabby-core' import { PROTOCOL_VERSION } from '@peershell/protocol' +import { PeershellConfigProvider } from './config' +import { PeershellService } from './services/peershell.service' +import { PeershellToolbarButtonProvider } from './providers/toolbarButtonProvider' +import { PeershellContextMenu } from './providers/tabContextMenu' -/** - * Stage 0 skeleton. Verifies the plugin builds (self-contained toolchain), bundles - * @peershell/protocol, and is discovered + instantiated by Tabby. Real providers - * (share/join, transport, session mirror, settings) land in later stages. - */ -@NgModule({}) +@NgModule({ + providers: [ + { provide: ConfigProvider, useClass: PeershellConfigProvider, multi: true }, + { provide: ToolbarButtonProvider, useClass: PeershellToolbarButtonProvider, multi: true }, + { provide: TabContextMenuItemProvider, useClass: PeershellContextMenu, multi: true }, + ], +}) export default class PeershellModule { - constructor () { + constructor (_peershell: PeershellService) { // eslint-disable-next-line no-console - console.log(`[peershell] plugin loaded — protocol v${PROTOCOL_VERSION} (Stage 0 skeleton)`) + console.log(`[peershell] plugin loaded — protocol v${PROTOCOL_VERSION}`) } } + +export { PeershellService } diff --git a/clients/tabby/src/providers/tabContextMenu.ts b/clients/tabby/src/providers/tabContextMenu.ts new file mode 100644 index 0000000..0371ae1 --- /dev/null +++ b/clients/tabby/src/providers/tabContextMenu.ts @@ -0,0 +1,32 @@ +import { Injectable } from '@angular/core' +import { BaseTabComponent, TabContextMenuItemProvider, MenuItemOptions } from 'tabby-core' +import { BaseTerminalTabComponent } from 'tabby-terminal' + +import { PeershellService } from '../services/peershell.service' + +@Injectable() +export class PeershellContextMenu extends TabContextMenuItemProvider { + weight = 5 + + constructor(private readonly peershell: PeershellService) { + super() + } + + async getItems(tab: BaseTabComponent, tabHeader?: boolean): Promise { + if (tabHeader || !(tab instanceof BaseTerminalTabComponent)) { + return [] + } + if (this.peershell.isSharing(tab)) { + return [{ + label: 'Stop sharing (peershell)', + click: () => this.peershell.stopSharing(tab), + }] + } + return [{ + label: 'Share this terminal (peershell)', + click: () => { + void this.peershell.startSharing(tab) + }, + }] + } +} diff --git a/clients/tabby/src/providers/toolbarButtonProvider.ts b/clients/tabby/src/providers/toolbarButtonProvider.ts new file mode 100644 index 0000000..97f6029 --- /dev/null +++ b/clients/tabby/src/providers/toolbarButtonProvider.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@angular/core' +import { ToolbarButtonProvider, ToolbarButton } from 'tabby-core' + +import { PeershellService } from '../services/peershell.service' + +const SHARE_ICON = ` + +` + +@Injectable() +export class PeershellToolbarButtonProvider extends ToolbarButtonProvider { + constructor(private readonly peershell: PeershellService) { + super() + } + + provide(): ToolbarButton[] { + return [{ + icon: SHARE_ICON, + title: 'Share terminal (peershell)', + weight: 8, + click: () => { + void this.peershell.shareActive() + }, + }] + } +} diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts new file mode 100644 index 0000000..e2c2919 --- /dev/null +++ b/clients/tabby/src/services/peershell.service.ts @@ -0,0 +1,86 @@ +import { Injectable } from '@angular/core' +import { map } from 'rxjs' +import { AppService, ConfigService, NotificationsService, BaseTabComponent } from 'tabby-core' +import { BaseTerminalTabComponent, ResizeEvent } from 'tabby-terminal' +import { WebSocketTransport } from '@peershell/protocol' + +import { ShareController, HostTerminal } from '../host/shareController' + +/** Owns the active host shares and adapts a Tabby terminal tab to the transport-driven controller. */ +@Injectable({ providedIn: 'root' }) +export class PeershellService { + private readonly shares = new Map() + + constructor( + private readonly app: AppService, + private readonly config: ConfigService, + private readonly notifications: NotificationsService, + ) {} + + isSharing(tab: BaseTabComponent): boolean { + return tab instanceof BaseTerminalTabComponent && this.shares.has(tab) + } + + async shareActive(): Promise { + const tab = this.app.activeTab + if (tab instanceof BaseTerminalTabComponent) { + await this.startSharing(tab) + } else { + this.notifications.error('peershell: focus a terminal tab to share it') + } + } + + async startSharing(tab: BaseTerminalTabComponent): Promise { + if (this.shares.has(tab)) { + return + } + const serverUrl: string | null = this.config.store.peershell?.serverUrl + if (!serverUrl) { + this.notifications.error('peershell: set the server URL in settings first') + return + } + + const transport = new WebSocketTransport() + const controller = new ShareController(transport, this.adapt(tab), { + onSession: h => this.notifications.info('peershell: sharing this terminal', h.magicLink), + onPeerLeft: () => this.notifications.notice('peershell: peer disconnected'), + onError: (code, message) => this.notifications.error(`peershell: ${code}`, message), + }) + + this.shares.set(tab, controller) + tab.destroyed$.subscribe(() => this.shares.delete(tab)) + + try { + await controller.start(serverUrl) + } catch (err) { + this.shares.delete(tab) + this.notifications.error('peershell: could not connect to the server', String(err)) + } + } + + stopSharing(tab: BaseTerminalTabComponent): void { + const controller = this.shares.get(tab) + if (controller) { + controller.stop('stopped') + this.shares.delete(tab) + this.notifications.notice('peershell: sharing stopped') + } + } + + private adapt(tab: BaseTerminalTabComponent): HostTerminal { + return { + output$: tab.binaryOutput$.pipe(map((b: Buffer) => new Uint8Array(b))), + sendInput: (data: Uint8Array) => tab.sendInput(Buffer.from(data)), + getSize: () => ({ cols: tab.size?.columns ?? 80, rows: tab.size?.rows ?? 24 }), + resize$: tab.resize$.pipe(map((e: ResizeEvent) => ({ cols: e.columns, rows: e.rows }))), + snapshot: () => { + try { + return String(tab.frontend?.saveState() ?? '') + } catch { + return '' + } + }, + closed$: tab.destroyed$, + } + } +} diff --git a/clients/tabby/src/types/tabby.d.ts b/clients/tabby/src/types/tabby.d.ts new file mode 100644 index 0000000..d214451 --- /dev/null +++ b/clients/tabby/src/types/tabby.d.ts @@ -0,0 +1,78 @@ +/** + * Minimal ambient type shims for the Tabby host packages we import. Lets the plugin build + * without compiling Tabby's full source tree (or installing all of Tabby's deps): the real + * implementations are provided by Tabby at runtime (these modules are webpack externals). + * Extend these declarations as later stages use more of the Tabby API. + */ +declare module 'tabby-core' { + import { Observable } from 'rxjs' + + export abstract class BaseTabComponent { + get destroyed$(): Observable + } + + export interface ToolbarButton { + icon?: string + title: string + weight?: number + click?: () => void + submenu?: () => Promise + } + + export abstract class ToolbarButtonProvider { + abstract provide(): ToolbarButton[] + } + + export interface MenuItemOptions { + label?: string + click?: () => void + type?: string + enabled?: boolean + submenu?: MenuItemOptions[] + } + + export abstract class TabContextMenuItemProvider { + weight: number + abstract getItems(tab: BaseTabComponent, tabHeader?: boolean): Promise + } + + export abstract class ConfigProvider { + defaults?: unknown + platformDefaults?: unknown + } + + export class ConfigService { + store: any + save(): Promise + } + + export class AppService { + get activeTab(): BaseTabComponent | null + } + + export class NotificationsService { + notice(text: string): void + info(text: string, details?: string): void + error(text: string, details?: string): void + } +} + +declare module 'tabby-terminal' { + import { Observable } from 'rxjs' + import { BaseTabComponent } from 'tabby-core' + + export interface ResizeEvent { columns: number, rows: number } + + export abstract class BaseSession { + get closed$(): Observable + } + + export abstract class BaseTerminalTabComponent

extends BaseTabComponent { + session: BaseSession | null + size: ResizeEvent + frontend?: { saveState(): any } + get binaryOutput$(): Observable + get resize$(): Observable + sendInput(data: string | Buffer): void + } +} diff --git a/clients/tabby/test/shareController.test.ts b/clients/tabby/test/shareController.test.ts new file mode 100644 index 0000000..1aea1c8 --- /dev/null +++ b/clients/tabby/test/shareController.test.ts @@ -0,0 +1,113 @@ +import { Subject } from 'rxjs' +import { + SessionTransport, ControlMessage, BinaryPayload, Channel, TransportState, base64ToUtf8, +} from '@peershell/protocol' +import { ShareController, HostTerminal } from '../src/host/shareController' + +class MockTransport implements SessionTransport { + sentControl: ControlMessage[] = [] + sentData: Array<{ peerId: number, channel: Channel, data: Uint8Array }> = [] + closed = false + private controlCb?: (m: ControlMessage) => void + private binaryCb?: (f: BinaryPayload) => void + + connect(): Promise { + return Promise.resolve() + } + sendControl(m: ControlMessage): void { + this.sentControl.push(m) + } + sendData(peerId: number, channel: Channel, data: Uint8Array): void { + this.sentData.push({ peerId, channel, data }) + } + close(): void { + this.closed = true + } + onControl(cb: (m: ControlMessage) => void): void { + this.controlCb = cb + } + onBinary(cb: (f: BinaryPayload) => void): void { + this.binaryCb = cb + } + onState(_cb: (s: TransportState) => void): void { /* unused */ } + + emitControl(m: ControlMessage): void { + this.controlCb?.(m) + } + emitBinary(f: BinaryPayload): void { + this.binaryCb?.(f) + } + controlTypes(): string[] { + return this.sentControl.map(c => c.t) + } +} + +function mockTab() { + const output$ = new Subject() + const resize$ = new Subject<{ cols: number, rows: number }>() + const closed$ = new Subject() + const inputs: Uint8Array[] = [] + const tab: HostTerminal = { + output$, + resize$, + closed$, + sendInput: d => inputs.push(d), + getSize: () => ({ cols: 80, rows: 24 }), + snapshot: () => 'SNAPSHOT', + } + return { tab, output$, resize$, closed$, inputs } +} + +it('creates a session, then mirrors output only after snapshot-ack and injects input', async () => { + const t = new MockTransport() + const m = mockTab() + const c = new ShareController(t, m.tab) + + await c.start('ws://relay') + expect(t.controlTypes()).toEqual(['hello', 'create-session']) + + t.emitControl({ t: 'session-created', room: 'ABC234', magicLink: 'http://x/s/tok' }) + expect(c.room).toBe('ABC234') + expect(c.magicLink).toBe('http://x/s/tok') + + t.emitControl({ t: 'peer-joined', peerId: 0, kind: 'web' }) + const snap = t.sentControl.find(x => x.t === 'snapshot') + expect(snap && snap.t === 'snapshot' && base64ToUtf8(snap.data)).toBe('SNAPSHOT') + + // Barrier: no output before the guest acks the snapshot. + m.output$.next(new Uint8Array([1, 2, 3])) + expect(t.sentData.length).toBe(0) + + t.emitControl({ t: 'snapshot-ack' }) + m.output$.next(new Uint8Array([9, 9])) + expect(t.sentData).toHaveLength(1) + expect(t.sentData[0].channel).toBe(Channel.Output) + expect(Array.from(t.sentData[0].data)).toEqual([9, 9]) + + // Guest input frame is injected into the local terminal. + t.emitBinary({ peerId: 0, channel: Channel.Input, data: new Uint8Array([108, 115]) }) + expect(m.inputs).toHaveLength(1) + expect(Array.from(m.inputs[0])).toEqual([108, 115]) + + // resize is forwarded as a control message. + m.resize$.next({ cols: 120, rows: 40 }) + expect(t.sentControl.find(x => x.t === 'resize')).toEqual({ t: 'resize', cols: 120, rows: 40 }) +}) + +it('tears down on tab close and stops forwarding', async () => { + const t = new MockTransport() + const m = mockTab() + const c = new ShareController(t, m.tab) + await c.start('ws://relay') + t.emitControl({ t: 'session-created', room: 'ABC234', magicLink: 'http://x/s/tok' }) + t.emitControl({ t: 'peer-joined', peerId: 0, kind: 'desktop' }) + t.emitControl({ t: 'snapshot-ack' }) + + m.closed$.next() + expect(t.closed).toBe(true) + expect(t.controlTypes()).toEqual(expect.arrayContaining(['peer-left', 'session-close'])) + + const before = t.sentData.length + m.output$.next(new Uint8Array([5])) + expect(t.sentData.length).toBe(before) +}) diff --git a/clients/tabby/test/smoke-load.cjs b/clients/tabby/test/smoke-load.cjs index 8ca3b9d..7138f31 100644 --- a/clients/tabby/test/smoke-load.cjs +++ b/clients/tabby/test/smoke-load.cjs @@ -1,17 +1,29 @@ -// Stage 0 smoke test: load the built UMD bundle the way Tabby would (nodeRequire), with the -// externalized host packages stubbed, and instantiate the default NgModule. Confirms the bundle -// is valid, @peershell/protocol is inlined, and the plugin constructs (logs) without a real Tabby. -// Full GUI verification happens by loading dist/ into a real Tabby (see README). +// Stage 0+ smoke test: load the built UMD bundle the way Tabby would (nodeRequire) with the +// externalized host packages (@angular, tabby-*, rxjs, ...) generically stubbed, and instantiate +// the default NgModule. Confirms the bundle is valid, @peershell/protocol is inlined, decorators +// apply, and the plugin constructs (logs) without a real Tabby. Full GUI verification happens by +// loading dist/ into a real Tabby (see README). const Module = require('module') const path = require('path') -const stubs = { - '@angular/core': { NgModule: () => target => target }, +// A generic stub: any property access yields another stub; calling it (decorator factory) returns +// an identity decorator; `new`-ing it or `extends`-ing it works. +function makeStub() { + const f = function () {} + return new Proxy(f, { + get: (_t, p) => (typeof p === 'symbol' ? undefined : makeStub()), + apply: () => (target) => target, + construct: () => ({}), + }) } + +const EXTERNAL_PREFIXES = ['@angular/', 'tabby-', 'rxjs', 'ngx-toastr', '@ng-bootstrap'] +const isExternal = req => EXTERNAL_PREFIXES.some(p => req === p || req.startsWith(p)) + const origLoad = Module._load Module._load = function (request, parent, isMain) { - if (Object.prototype.hasOwnProperty.call(stubs, request)) { - return stubs[request] + if (isExternal(request)) { + return makeStub() } return origLoad.call(this, request, parent, isMain) } @@ -24,7 +36,6 @@ if (typeof PluginModule !== 'function') { process.exit(1) } -// Instantiating triggers the module constructor's console.log. const instance = new PluginModule() if (!instance) { console.error('FAIL: could not instantiate the plugin module') diff --git a/clients/tabby/tsconfig.json b/clients/tabby/tsconfig.json index 837abd8..8eaaf92 100644 --- a/clients/tabby/tsconfig.json +++ b/clients/tabby/tsconfig.json @@ -15,10 +15,7 @@ "baseUrl": ".", "lib": ["DOM", "ES2019", "ES2020"], "paths": { - "@peershell/protocol": ["../../shared/src"], - "tabby-core": ["../../../tabby/tabby-core/src"], - "tabby-terminal": ["../../../tabby/tabby-terminal/src"], - "tabby-settings": ["../../../tabby/tabby-settings/src"] + "@peershell/protocol": ["../../shared/src"] } }, "angularCompilerOptions": { diff --git a/jest.setup.cjs b/jest.setup.cjs index f225aa4..da91d3b 100644 --- a/jest.setup.cjs +++ b/jest.setup.cjs @@ -3,3 +3,9 @@ if (!globalThis.crypto) { globalThis.crypto = require('crypto').webcrypto } +if (!globalThis.btoa) { + globalThis.btoa = s => Buffer.from(s, 'binary').toString('base64') +} +if (!globalThis.atob) { + globalThis.atob = s => Buffer.from(s, 'base64').toString('binary') +} diff --git a/shared/src/base64.ts b/shared/src/base64.ts new file mode 100644 index 0000000..cfac1a7 --- /dev/null +++ b/shared/src/base64.ts @@ -0,0 +1,23 @@ +/** + * Portable base64 (btoa/atob are globals in browsers, Electron renderer, and Node >= 16). + * Used for the VT snapshot payload in the `snapshot` control message. + */ +export function bytesToBase64(bytes: Uint8Array): string { + let bin = '' + for (let i = 0; i < bytes.length; i++) { + bin += String.fromCharCode(bytes[i]) + } + return btoa(bin) +} + +export function base64ToBytes(b64: string): Uint8Array { + const bin = atob(b64) + const out = new Uint8Array(bin.length) + for (let i = 0; i < bin.length; i++) { + out[i] = bin.charCodeAt(i) + } + return out +} + +export const utf8ToBase64 = (s: string): string => bytesToBase64(new TextEncoder().encode(s)) +export const base64ToUtf8 = (b64: string): string => new TextDecoder().decode(base64ToBytes(b64)) diff --git a/shared/src/index.ts b/shared/src/index.ts index efc21eb..2bb3300 100644 --- a/shared/src/index.ts +++ b/shared/src/index.ts @@ -2,4 +2,5 @@ export * from './protocol' export * from './api' export * from './pinAuth' export * from './utf8Splitter' +export * from './base64' export * from './websocketTransport' diff --git a/tsconfig.jest.json b/tsconfig.jest.json index 370d234..24db530 100644 --- a/tsconfig.jest.json +++ b/tsconfig.jest.json @@ -8,6 +8,10 @@ "strict": true, "skipLibCheck": true, "forceConsistentCasingInFileNames": true, - "types": ["jest", "node"] + "types": ["jest", "node"], + "baseUrl": ".", + "paths": { + "@peershell/protocol": ["shared/src"] + } } } From 962c37ed8b93b98fd10f4d3a9977e675b1efe9de Mon Sep 17 00:00:00 2001 From: tis24dev Date: Tue, 7 Jul 2026 22:55:50 +0200 Subject: [PATCH 05/75] Stage 2: MirrorController (guest logic) + host<->guest integration test - guest/mirrorController.ts: Tabby-agnostic guest controller (SessionTransport + MirrorSink port). join, render+ack snapshot (barrier), render live output, forward keystrokes, surface host resize + session end. Unit-tested with mocks. - test/hostGuest.integration.test.ts: real ShareController (mock host tab) <-> dev relay <-> real MirrorController (mock sink); asserts snapshot, live output host->guest, input guest->host, host resize. - jest forceExit (integration tests use real sockets). 22/22 tests green; build:all green; smoke-load PASS. --- clients/tabby/src/guest/mirrorController.ts | 81 ++++++++++++++++ .../tabby/test/hostGuest.integration.test.ts | 91 ++++++++++++++++++ clients/tabby/test/mirrorController.test.ts | 93 +++++++++++++++++++ jest.config.cjs | 2 + 4 files changed, 267 insertions(+) create mode 100644 clients/tabby/src/guest/mirrorController.ts create mode 100644 clients/tabby/test/hostGuest.integration.test.ts create mode 100644 clients/tabby/test/mirrorController.test.ts diff --git a/clients/tabby/src/guest/mirrorController.ts b/clients/tabby/src/guest/mirrorController.ts new file mode 100644 index 0000000..621912e --- /dev/null +++ b/clients/tabby/src/guest/mirrorController.ts @@ -0,0 +1,81 @@ +/** + * Guest side of a shared session. Tabby-agnostic (drives a SessionTransport + a small MirrorSink + * port), so it is fully unit-testable and reusable by the web-client / mobile later. MirrorSession + * adapts it to a Tabby BaseSession. + * + * Stage 2 scope: join, render the snapshot then ack it (barrier), render live output, forward the + * guest's keystrokes as input, and surface host resizes + session end. The PIN gate lands in Stage 3. + */ +import { + SessionTransport, ControlMessage, Channel, ClientKind, SINGLE_PEER, base64ToBytes, +} from '@peershell/protocol' + +/** Port the controller drives on the guest terminal (adapted from a Tabby session). */ +export interface MirrorSink { + emit(data: Uint8Array): void + hostResize(cols: number, rows: number): void + ended(reason: string): void +} + +export class MirrorController { + private readonly peerId = SINGLE_PEER + private endedFlag = false + + constructor( + private readonly transport: SessionTransport, + private readonly sink: MirrorSink, + ) { + this.transport.onControl(m => this.onControl(m)) + this.transport.onBinary(f => { + if (f.channel === Channel.Output) { + this.sink.emit(f.data) + } + }) + } + + /** Announce as a guest and join the room. Handlers are wired in the ctor so no frame is missed. */ + join(room: string, opts: { name?: string, kind?: ClientKind } = {}): void { + this.transport.sendControl({ + t: 'hello', role: 'guest', kind: opts.kind ?? 'desktop', client: 'tabby-peershell', + }) + this.transport.sendControl({ t: 'join', room, name: opts.name }) + } + + private onControl(m: ControlMessage): void { + switch (m.t) { + case 'snapshot': + this.sink.emit(base64ToBytes(m.data)) + this.sink.hostResize(m.cols, m.rows) + this.transport.sendControl({ t: 'snapshot-ack' }) + break + case 'resize': + this.sink.hostResize(m.cols, m.rows) + break + case 'peer-left': + this.end(m.reason ?? 'host ended the session') + break + case 'error': + this.end(m.message ? `${m.code}: ${m.message}` : m.code) + break + default: + break + } + } + + /** Forward the guest's keystrokes to the host. */ + writeInput(data: Uint8Array): void { + this.transport.sendData(this.peerId, Channel.Input, data) + } + + private end(reason: string): void { + if (this.endedFlag) { + return + } + this.endedFlag = true + this.sink.ended(reason) + } + + close(): void { + this.transport.close(1000, 'guest-closed') + } +} diff --git a/clients/tabby/test/hostGuest.integration.test.ts b/clients/tabby/test/hostGuest.integration.test.ts new file mode 100644 index 0000000..23faa91 --- /dev/null +++ b/clients/tabby/test/hostGuest.integration.test.ts @@ -0,0 +1,91 @@ +/** + * End-to-end interop of the two real controllers through the throwaway relay: ShareController (host, + * driving a mock terminal) <-> dev relay <-> MirrorController (guest, driving a mock sink). Verifies + * snapshot delivery + ack barrier, live output host->guest, and input guest->host. + */ +import WebSocket from 'ws' +import { Subject } from 'rxjs' +import { WebSocketTransport, WebSocketCtor } from '@peershell/protocol' +import { ShareController, HostTerminal } from '../src/host/shareController' +import { MirrorController } from '../src/guest/mirrorController' + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { startRelay } = require('../../../server/dev-relay.cjs') as { + startRelay: (port?: number) => Promise<{ url: string, close: () => Promise }> +} + +const WS = WebSocket as unknown as WebSocketCtor +const enc = (s: string) => new TextEncoder().encode(s) +const dec = (b: Uint8Array) => new TextDecoder().decode(b) + +function waitFor(pred: () => boolean, timeoutMs = 12000): Promise { + return new Promise((resolve, reject) => { + const iv = setInterval(() => { + if (pred()) { + clearInterval(iv) + clearTimeout(to) + resolve() + } + }, 10) + const to = setTimeout(() => { + clearInterval(iv) + reject(new Error('waitFor timed out')) + }, timeoutMs) + }) +} + +let relay: { url: string, close: () => Promise } +beforeAll(async () => { relay = await startRelay(0) }) +afterAll(async () => { await relay.close() }) + +it('mirrors snapshot + live output host->guest and input guest->host', async () => { + const hostTransport = new WebSocketTransport(WS) + const guestTransport = new WebSocketTransport(WS) + + const output$ = new Subject() + const inputs: Uint8Array[] = [] + const hostTab: HostTerminal = { + output$, + resize$: new Subject<{ cols: number, rows: number }>(), + closed$: new Subject(), + sendInput: d => inputs.push(d), + getSize: () => ({ cols: 111, rows: 33 }), + snapshot: () => 'SNAPSHOT-VT', + } + + const emits: Uint8Array[] = [] + let hostResize: { cols: number, rows: number } | null = null + let sawLive = false + const guest = new MirrorController(guestTransport, { + emit: d => { + emits.push(d) + if (dec(d).includes('LIVE')) { + sawLive = true + } + }, + hostResize: (cols, rows) => { hostResize = { cols, rows } }, + ended: () => { /* noop */ }, + }) + + const host = new ShareController(hostTransport, hostTab, { + onSession: ({ room }) => guest.join(room), + }) + + await guestTransport.connect(relay.url) + await host.start(relay.url) + + // Keep emitting host output until the guest has received a live frame (survives the ack round-trip). + const pump = setInterval(() => output$.next(enc('LIVE\r\n')), 15) + await waitFor(() => sawLive) + clearInterval(pump) + + guest.writeInput(enc('typed-by-guest\n')) + await waitFor(() => inputs.some(i => dec(i).includes('typed-by-guest'))) + + expect(dec(emits[0])).toBe('SNAPSHOT-VT') + expect(hostResize).toEqual({ cols: 111, rows: 33 }) + expect(emits.some(e => dec(e).includes('LIVE'))).toBe(true) + + host.stop('done') + guest.close() +}, 15000) diff --git a/clients/tabby/test/mirrorController.test.ts b/clients/tabby/test/mirrorController.test.ts new file mode 100644 index 0000000..c10a2d2 --- /dev/null +++ b/clients/tabby/test/mirrorController.test.ts @@ -0,0 +1,93 @@ +import { + SessionTransport, ControlMessage, BinaryPayload, Channel, TransportState, utf8ToBase64, +} from '@peershell/protocol' +import { MirrorController, MirrorSink } from '../src/guest/mirrorController' + +class MockTransport implements SessionTransport { + sentControl: ControlMessage[] = [] + sentData: Array<{ peerId: number, channel: Channel, data: Uint8Array }> = [] + private controlCb?: (m: ControlMessage) => void + private binaryCb?: (f: BinaryPayload) => void + + connect(): Promise { + return Promise.resolve() + } + sendControl(m: ControlMessage): void { + this.sentControl.push(m) + } + sendData(peerId: number, channel: Channel, data: Uint8Array): void { + this.sentData.push({ peerId, channel, data }) + } + close(): void { /* noop */ } + onControl(cb: (m: ControlMessage) => void): void { + this.controlCb = cb + } + onBinary(cb: (f: BinaryPayload) => void): void { + this.binaryCb = cb + } + onState(_cb: (s: TransportState) => void): void { /* unused */ } + + emitControl(m: ControlMessage): void { + this.controlCb?.(m) + } + emitBinary(f: BinaryPayload): void { + this.binaryCb?.(f) + } + controlTypes(): string[] { + return this.sentControl.map(c => c.t) + } +} + +function mockSink() { + const emits: Uint8Array[] = [] + const resizes: Array<{ cols: number, rows: number }> = [] + let ended: string | null = null + const sink: MirrorSink = { + emit: d => emits.push(d), + hostResize: (cols, rows) => resizes.push({ cols, rows }), + ended: reason => { ended = reason }, + } + return { sink, emits, resizes, getEnded: () => ended } +} + +const dec = (b: Uint8Array) => new TextDecoder().decode(b) + +it('joins, renders + acks the snapshot, renders output, and forwards input', () => { + const t = new MockTransport() + const s = mockSink() + const c = new MirrorController(t, s.sink) + + c.join('ABC234') + expect(t.controlTypes()).toEqual(['hello', 'join']) + + t.emitControl({ t: 'snapshot', cols: 100, rows: 30, data: utf8ToBase64('SNAP') }) + expect(dec(s.emits[0])).toBe('SNAP') + expect(s.resizes[0]).toEqual({ cols: 100, rows: 30 }) + expect(t.controlTypes()).toContain('snapshot-ack') + + t.emitBinary({ peerId: 0, channel: Channel.Output, data: new Uint8Array([79, 75]) }) + expect(dec(s.emits[1])).toBe('OK') + + // input channel from host is ignored by the guest + t.emitBinary({ peerId: 0, channel: Channel.Input, data: new Uint8Array([1]) }) + expect(s.emits).toHaveLength(2) + + c.writeInput(new Uint8Array([108, 115])) + expect(t.sentData).toHaveLength(1) + expect(t.sentData[0].channel).toBe(Channel.Input) + expect(Array.from(t.sentData[0].data)).toEqual([108, 115]) +}) + +it('surfaces a host resize and ends on peer-left (once)', () => { + const t = new MockTransport() + const s = mockSink() + const c = new MirrorController(t, s.sink) + c.join('ABC234') + + t.emitControl({ t: 'resize', cols: 132, rows: 43 }) + expect(s.resizes.at(-1)).toEqual({ cols: 132, rows: 43 }) + + t.emitControl({ t: 'peer-left', reason: 'host-ended' }) + t.emitControl({ t: 'peer-left', reason: 'again' }) + expect(s.getEnded()).toBe('host-ended') +}) diff --git a/jest.config.cjs b/jest.config.cjs index e3d326c..a6f7baa 100644 --- a/jest.config.cjs +++ b/jest.config.cjs @@ -2,6 +2,8 @@ module.exports = { testEnvironment: 'node', setupFiles: ['/jest.setup.cjs'], + // integration tests use real sockets; close them per-test but force-exit to avoid handle races + forceExit: true, roots: ['/shared', '/clients'], testMatch: ['**/*.test.ts'], transform: { From c5b064e34b0b7623e24b9db4e80bae20a3db3160 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Tue, 7 Jul 2026 23:01:58 +0200 Subject: [PATCH 06/75] Stage 2: MirrorSession + MirrorTabComponent + join flow - guest/mirrorSession.ts: MirrorSession extends BaseSession (7 abstract members; UTF8SplitterMiddleware; delegates wire logic to MirrorController; exposes hostResize$). write()->input frame, resize() no-op (tmate), emitOutput from frames. - guest/mirrorTab.component.ts: MirrorTabComponent extends BaseTerminalTabComponent (reuses base template; onFrontendReady creates MirrorSession + adopts host size via hostResize$; no frontend.resize$ subscription -> no resize loop). - peershell.service.ts: joinShared() (prompt room-code, connect, open mirror tab). - toolbar: "Join shared terminal" button. index.ts: full NgModule (Common/Forms/Ngb/ Toastr/TabbyCore/TabbyTerminal imports + MirrorTabComponent declaration). - expanded tabby.d.ts shim (BaseSession, UTF8SplitterMiddleware, BaseTerminalTabComponent members, LogService, PromptModalComponent, openNewTab, module default exports). build:all green; 22/22 tests green; smoke-load PASS. GUI wiring/profile of the mirror tab needs validation in a real Tabby. --- clients/tabby/src/guest/mirrorSession.ts | 65 +++++++++++++++++++ .../tabby/src/guest/mirrorTab.component.ts | 57 ++++++++++++++++ clients/tabby/src/index.ts | 19 +++++- .../src/providers/toolbarButtonProvider.ts | 24 +++++-- .../tabby/src/services/peershell.service.ts | 50 +++++++++++++- clients/tabby/src/types/tabby.d.ts | 61 ++++++++++++++++- 6 files changed, 264 insertions(+), 12 deletions(-) create mode 100644 clients/tabby/src/guest/mirrorSession.ts create mode 100644 clients/tabby/src/guest/mirrorTab.component.ts diff --git a/clients/tabby/src/guest/mirrorSession.ts b/clients/tabby/src/guest/mirrorSession.ts new file mode 100644 index 0000000..847b103 --- /dev/null +++ b/clients/tabby/src/guest/mirrorSession.ts @@ -0,0 +1,65 @@ +import { Injector } from '@angular/core' +import { Observable, Subject } from 'rxjs' +import { LogService } from 'tabby-core' +import { BaseSession, UTF8SplitterMiddleware } from 'tabby-terminal' +import { SessionTransport } from '@peershell/protocol' + +import { MirrorController, MirrorSink } from './mirrorController' + +/** + * A "fake shell" session backing the guest mirror tab. Inbound frames become terminal output via + * emitOutput(); the guest's keystrokes arrive through write() and are forwarded to the host. + * Delegates all wire logic to the Tabby-agnostic MirrorController. + */ +export class MirrorSession extends BaseSession { + private readonly hostResize = new Subject<{ cols: number, rows: number }>() + private readonly controller: MirrorController + + constructor(injector: Injector, private readonly transport: SessionTransport, private readonly room: string) { + super(injector.get(LogService).create('peershell')) + // Reassemble multibyte UTF-8 split across network frames before rendering (see PROTOCOL.md). + this.middleware.push(new UTF8SplitterMiddleware()) + + const sink: MirrorSink = { + emit: data => this.emitOutput(Buffer.from(data)), + hostResize: (cols, rows) => this.hostResize.next({ cols, rows }), + ended: reason => { + this.emitOutput(Buffer.from(`\r\n[peershell] ${reason}\r\n`)) + void this.destroy() + }, + } + this.controller = new MirrorController(this.transport, sink) + } + + get hostResize$(): Observable<{ cols: number, rows: number }> { + return this.hostResize + } + + async start(_options?: unknown): Promise { + this.open = true + this.controller.join(this.room) + } + + write(data: Buffer): void { + this.controller.writeInput(new Uint8Array(data)) + } + + // tmate model: the guest never resizes the host PTY; it only adopts the host's size. + resize(_columns: number, _rows: number): void { /* no-op */ } + + kill(_signal?: string): void { + this.controller.close() + } + + async gracefullyKillProcess(): Promise { + this.controller.close() + } + + supportsWorkingDirectory(): boolean { + return false + } + + async getWorkingDirectory(): Promise { + return null + } +} diff --git a/clients/tabby/src/guest/mirrorTab.component.ts b/clients/tabby/src/guest/mirrorTab.component.ts new file mode 100644 index 0000000..cd71d37 --- /dev/null +++ b/clients/tabby/src/guest/mirrorTab.component.ts @@ -0,0 +1,57 @@ +import { Component, Injector, Input } from '@angular/core' +import { BaseTerminalTabComponent } from 'tabby-terminal' +import { SessionTransport } from '@peershell/protocol' + +import { MirrorSession } from './mirrorSession' + +/** + * Guest tab that renders a mirrored remote terminal. Reuses BaseTerminalTabComponent's template so + * xterm.js rendering, selection, scrollback, etc. all work; only the session is our MirrorSession. + * + * NOTE: needs validation in a real Tabby GUI (module wiring + profile), which cannot run headless here. + */ +@Component({ + selector: 'peershell-mirror-tab', + template: BaseTerminalTabComponent.template, + styles: BaseTerminalTabComponent.styles, + animations: BaseTerminalTabComponent.animations, +}) +export class MirrorTabComponent extends BaseTerminalTabComponent { + @Input() transport!: SessionTransport + @Input() room!: string + session: MirrorSession | null = null + + // eslint-disable-next-line @typescript-eslint/no-useless-constructor + constructor(injector: Injector) { + super(injector) + } + + ngOnInit(): void { + this.logger = this.log.create('peershell-mirror') + if (!this.profile) { + this.profile = { + name: `peershell: ${this.room}`, + type: 'peershell-mirror', + options: {}, + } + } + super.ngOnInit() + } + + protected onFrontendReady(): void { + const session = new MirrorSession(this.injector, this.transport, this.room) + this.setSession(session) + // Adopt the host's size (tmate model). Guest window resizes are ignored (no frontend.resize$ + // subscription) so there is no resize feedback loop. + this.subscribeUntilDestroyed(session.hostResize$, ({ cols, rows }) => { + this.frontend?.xterm?.resize(cols, rows) + }) + void session.start() + super.onFrontendReady() + } + + ngOnDestroy(): void { + super.ngOnDestroy() + void this.session?.destroy() + } +} diff --git a/clients/tabby/src/index.ts b/clients/tabby/src/index.ts index 7f3653f..a9cad66 100644 --- a/clients/tabby/src/index.ts +++ b/clients/tabby/src/index.ts @@ -1,19 +1,36 @@ /* eslint-disable @typescript-eslint/no-extraneous-class */ import { NgModule } from '@angular/core' -import { ConfigProvider, ToolbarButtonProvider, TabContextMenuItemProvider } from 'tabby-core' +import { CommonModule } from '@angular/common' +import { FormsModule } from '@angular/forms' +import { NgbModule } from '@ng-bootstrap/ng-bootstrap' +import { ToastrModule } from 'ngx-toastr' +import TabbyCorePlugin, { ConfigProvider, ToolbarButtonProvider, TabContextMenuItemProvider } from 'tabby-core' +import TabbyTerminalModule from 'tabby-terminal' import { PROTOCOL_VERSION } from '@peershell/protocol' import { PeershellConfigProvider } from './config' import { PeershellService } from './services/peershell.service' import { PeershellToolbarButtonProvider } from './providers/toolbarButtonProvider' import { PeershellContextMenu } from './providers/tabContextMenu' +import { MirrorTabComponent } from './guest/mirrorTab.component' @NgModule({ + imports: [ + CommonModule, + FormsModule, + NgbModule, + ToastrModule, + TabbyCorePlugin, + TabbyTerminalModule, + ], providers: [ { provide: ConfigProvider, useClass: PeershellConfigProvider, multi: true }, { provide: ToolbarButtonProvider, useClass: PeershellToolbarButtonProvider, multi: true }, { provide: TabContextMenuItemProvider, useClass: PeershellContextMenu, multi: true }, ], + declarations: [ + MirrorTabComponent, + ], }) export default class PeershellModule { constructor (_peershell: PeershellService) { diff --git a/clients/tabby/src/providers/toolbarButtonProvider.ts b/clients/tabby/src/providers/toolbarButtonProvider.ts index 97f6029..6c26ef6 100644 --- a/clients/tabby/src/providers/toolbarButtonProvider.ts +++ b/clients/tabby/src/providers/toolbarButtonProvider.ts @@ -14,13 +14,23 @@ export class PeershellToolbarButtonProvider extends ToolbarButtonProvider { } provide(): ToolbarButton[] { - return [{ - icon: SHARE_ICON, - title: 'Share terminal (peershell)', - weight: 8, - click: () => { - void this.peershell.shareActive() + return [ + { + icon: SHARE_ICON, + title: 'Share terminal (peershell)', + weight: 8, + click: () => { + void this.peershell.shareActive() + }, }, - }] + { + icon: SHARE_ICON, + title: 'Join shared terminal (peershell)', + weight: 9, + click: () => { + void this.peershell.joinShared() + }, + }, + ] } } diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index e2c2919..b17852b 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -1,10 +1,12 @@ import { Injectable } from '@angular/core' import { map } from 'rxjs' -import { AppService, ConfigService, NotificationsService, BaseTabComponent } from 'tabby-core' +import { NgbModal } from '@ng-bootstrap/ng-bootstrap' +import { AppService, ConfigService, NotificationsService, BaseTabComponent, PromptModalComponent } from 'tabby-core' import { BaseTerminalTabComponent, ResizeEvent } from 'tabby-terminal' -import { WebSocketTransport } from '@peershell/protocol' +import { WebSocketTransport, normalizeRoomCode, isValidRoomCode } from '@peershell/protocol' import { ShareController, HostTerminal } from '../host/shareController' +import { MirrorTabComponent } from '../guest/mirrorTab.component' /** Owns the active host shares and adapts a Tabby terminal tab to the transport-driven controller. */ @Injectable({ providedIn: 'root' }) @@ -15,6 +17,7 @@ export class PeershellService { private readonly app: AppService, private readonly config: ConfigService, private readonly notifications: NotificationsService, + private readonly ngbModal: NgbModal, ) {} isSharing(tab: BaseTabComponent): boolean { @@ -58,6 +61,49 @@ export class PeershellService { } } + async joinShared(): Promise { + const serverUrl: string | null = this.config.store.peershell?.serverUrl + if (!serverUrl) { + this.notifications.error('peershell: set the server URL in settings first') + return + } + const room = await this.promptRoom() + if (!room) { + return + } + const transport = new WebSocketTransport() + try { + await transport.connect(serverUrl) + } catch (err) { + this.notifications.error('peershell: could not connect to the server', String(err)) + return + } + this.app.openNewTab({ + type: MirrorTabComponent, + inputs: { + transport, + room, + profile: { name: `peershell: ${room}`, type: 'peershell-mirror', options: {} }, + }, + }) + } + + private async promptRoom(): Promise { + const modal = this.ngbModal.open(PromptModalComponent) + modal.componentInstance.prompt = 'Room code' + const result = await modal.result.catch(() => null) + const value: string | undefined = result?.value + if (!value) { + return null + } + const room = normalizeRoomCode(value) + if (!isValidRoomCode(room)) { + this.notifications.error('peershell: invalid room code') + return null + } + return room + } + stopSharing(tab: BaseTerminalTabComponent): void { const controller = this.shares.get(tab) if (controller) { diff --git a/clients/tabby/src/types/tabby.d.ts b/clients/tabby/src/types/tabby.d.ts index d214451..e6c0fcd 100644 --- a/clients/tabby/src/types/tabby.d.ts +++ b/clients/tabby/src/types/tabby.d.ts @@ -7,8 +7,18 @@ declare module 'tabby-core' { import { Observable } from 'rxjs' + const _default: any + export default _default + + export type Logger = any + + export class LogService { + create(name: string): Logger + } + export abstract class BaseTabComponent { get destroyed$(): Observable + subscribeUntilDestroyed(observable: Observable, callback: (value: T) => void): void } export interface ToolbarButton { @@ -46,8 +56,14 @@ declare module 'tabby-core' { save(): Promise } + export interface NewTabParameters { + type: any + inputs?: Record + } + export class AppService { get activeTab(): BaseTabComponent | null + openNewTab(params: NewTabParameters): T } export class NotificationsService { @@ -55,24 +71,65 @@ declare module 'tabby-core' { info(text: string, details?: string): void error(text: string, details?: string): void } + + export class PromptModalComponent { + prompt: string + value: string + password: boolean + } } declare module 'tabby-terminal' { import { Observable } from 'rxjs' import { BaseTabComponent } from 'tabby-core' + const _default: any + export default _default + export interface ResizeEvent { columns: number, rows: number } + export class UTF8SplitterMiddleware { + constructor() + } + export abstract class BaseSession { + open: boolean + readonly middleware: { push(middleware: unknown): void } + constructor(logger: unknown) + protected emitOutput(data: Buffer): void + feedFromTerminal(data: Buffer): void + releaseInitialDataBuffer(): void + destroy(): Promise get closed$(): Observable + get destroyed$(): Observable + abstract start(options: unknown): Promise + abstract resize(columns: number, rows: number): void + abstract write(data: Buffer): void + abstract kill(signal?: string): void + abstract gracefullyKillProcess(): Promise + abstract supportsWorkingDirectory(): boolean + abstract getWorkingDirectory(): Promise } export abstract class BaseTerminalTabComponent

extends BaseTabComponent { + static template: any + static styles: any + static animations: any + protected injector: any + profile: P session: BaseSession | null size: ResizeEvent - frontend?: { saveState(): any } + frontend?: any + protected log: { create(name: string): any } + protected logger: any + protected config: { store: any } + constructor(injector: any) + setSession(session: BaseSession | null, destroyOnSessionClose?: boolean): void + sendInput(data: string | Buffer): void get binaryOutput$(): Observable get resize$(): Observable - sendInput(data: string | Buffer): void + protected onFrontendReady(): void + ngOnInit(): void + ngOnDestroy(): void } } From 5e24f5ab2528100c640ded2e814a743a13a05a75 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 02:22:30 +0200 Subject: [PATCH 07/75] Stage 3: PIN challenge-response gate + keepalive + magic-link display - shared/pinAuth: generatePin (local per-session PIN). websocketTransport: keepalive (ping every 20s, unref'd timer, pong-on-ping handled below the app, cleared on close) + tests. - ShareController: on peer-joined issue pin-challenge (fresh nonce/attempt); verify pin-response; pin-ok -> snapshot/stream; wrong -> pin-fail + re-challenge, rate-limited to 5 then kick (peer-left). Input frames rejected until authenticated. - MirrorController: PinProvider callback; answer pin-challenge with H(pin,nonce); pin-fail(0) -> end. Tests + host<->guest integration now cover PIN (happy + wrong). - Tabby glue: PeershellService generates + shows the PIN (with magic-link) on share; joinShared threads a PIN prompt (PromptModalComponent password) through MirrorTabComponent -> MirrorSession -> MirrorController. 29/29 tests green; build:all green; smoke-load PASS. (magic-link TTL/revocation is server-side, Stage 5; client sends session-close on stop.) --- clients/tabby/src/guest/mirrorController.ts | 33 +++++-- clients/tabby/src/guest/mirrorSession.ts | 11 ++- .../tabby/src/guest/mirrorTab.component.ts | 4 +- clients/tabby/src/host/shareController.ts | 53 +++++++++-- .../tabby/src/services/peershell.service.ts | 23 ++++- .../tabby/test/hostGuest.integration.test.ts | 57 +++++++++--- clients/tabby/test/mirrorController.test.ts | 60 ++++++++++--- clients/tabby/test/shareController.test.ts | 90 ++++++++++++++----- shared/src/pinAuth.ts | 8 ++ shared/src/websocketTransport.ts | 33 +++++++ shared/test/websocketTransport.test.ts | 84 +++++++++++++++++ 11 files changed, 389 insertions(+), 67 deletions(-) create mode 100644 shared/test/websocketTransport.test.ts diff --git a/clients/tabby/src/guest/mirrorController.ts b/clients/tabby/src/guest/mirrorController.ts index 621912e..e0f0dd8 100644 --- a/clients/tabby/src/guest/mirrorController.ts +++ b/clients/tabby/src/guest/mirrorController.ts @@ -1,13 +1,13 @@ /** * Guest side of a shared session. Tabby-agnostic (drives a SessionTransport + a small MirrorSink - * port), so it is fully unit-testable and reusable by the web-client / mobile later. MirrorSession - * adapts it to a Tabby BaseSession. + * port + a PIN provider), so it is fully unit-testable and reusable by the web-client / mobile later. + * MirrorSession adapts it to a Tabby BaseSession. * - * Stage 2 scope: join, render the snapshot then ack it (barrier), render live output, forward the - * guest's keystrokes as input, and surface host resizes + session end. The PIN gate lands in Stage 3. + * Flow: join -> answer the host's PIN challenge -> on pin-ok, render the snapshot then ack it + * (barrier) -> render live output, forward the guest's keystrokes. */ import { - SessionTransport, ControlMessage, Channel, ClientKind, SINGLE_PEER, base64ToBytes, + SessionTransport, ControlMessage, Channel, ClientKind, SINGLE_PEER, base64ToBytes, hashPin, } from '@peershell/protocol' /** Port the controller drives on the guest terminal (adapted from a Tabby session). */ @@ -17,6 +17,9 @@ export interface MirrorSink { ended(reason: string): void } +/** Asks the user for the session PIN. Returns null if cancelled. */ +export type PinProvider = () => Promise + export class MirrorController { private readonly peerId = SINGLE_PEER private endedFlag = false @@ -24,6 +27,7 @@ export class MirrorController { constructor( private readonly transport: SessionTransport, private readonly sink: MirrorSink, + private readonly pinProvider: PinProvider, ) { this.transport.onControl(m => this.onControl(m)) this.transport.onBinary(f => { @@ -43,6 +47,15 @@ export class MirrorController { private onControl(m: ControlMessage): void { switch (m.t) { + case 'pin-challenge': + void this.answerPin(m.nonce) + break + case 'pin-fail': + if (m.left <= 0) { + this.end('wrong PIN') + } + // left > 0: the host re-challenges, which re-prompts. + break case 'snapshot': this.sink.emit(base64ToBytes(m.data)) this.sink.hostResize(m.cols, m.rows) @@ -62,6 +75,16 @@ export class MirrorController { } } + private async answerPin(nonce: string): Promise { + const pin = await this.pinProvider() + if (!pin) { + this.close() + return + } + const hash = await hashPin(pin, nonce) + this.transport.sendControl({ t: 'pin-response', hash }) + } + /** Forward the guest's keystrokes to the host. */ writeInput(data: Uint8Array): void { this.transport.sendData(this.peerId, Channel.Input, data) diff --git a/clients/tabby/src/guest/mirrorSession.ts b/clients/tabby/src/guest/mirrorSession.ts index 847b103..9e43c40 100644 --- a/clients/tabby/src/guest/mirrorSession.ts +++ b/clients/tabby/src/guest/mirrorSession.ts @@ -4,7 +4,7 @@ import { LogService } from 'tabby-core' import { BaseSession, UTF8SplitterMiddleware } from 'tabby-terminal' import { SessionTransport } from '@peershell/protocol' -import { MirrorController, MirrorSink } from './mirrorController' +import { MirrorController, MirrorSink, PinProvider } from './mirrorController' /** * A "fake shell" session backing the guest mirror tab. Inbound frames become terminal output via @@ -15,7 +15,12 @@ export class MirrorSession extends BaseSession { private readonly hostResize = new Subject<{ cols: number, rows: number }>() private readonly controller: MirrorController - constructor(injector: Injector, private readonly transport: SessionTransport, private readonly room: string) { + constructor( + injector: Injector, + private readonly transport: SessionTransport, + private readonly room: string, + pinProvider: PinProvider, + ) { super(injector.get(LogService).create('peershell')) // Reassemble multibyte UTF-8 split across network frames before rendering (see PROTOCOL.md). this.middleware.push(new UTF8SplitterMiddleware()) @@ -28,7 +33,7 @@ export class MirrorSession extends BaseSession { void this.destroy() }, } - this.controller = new MirrorController(this.transport, sink) + this.controller = new MirrorController(this.transport, sink, pinProvider) } get hostResize$(): Observable<{ cols: number, rows: number }> { diff --git a/clients/tabby/src/guest/mirrorTab.component.ts b/clients/tabby/src/guest/mirrorTab.component.ts index cd71d37..2c879c8 100644 --- a/clients/tabby/src/guest/mirrorTab.component.ts +++ b/clients/tabby/src/guest/mirrorTab.component.ts @@ -3,6 +3,7 @@ import { BaseTerminalTabComponent } from 'tabby-terminal' import { SessionTransport } from '@peershell/protocol' import { MirrorSession } from './mirrorSession' +import { PinProvider } from './mirrorController' /** * Guest tab that renders a mirrored remote terminal. Reuses BaseTerminalTabComponent's template so @@ -19,6 +20,7 @@ import { MirrorSession } from './mirrorSession' export class MirrorTabComponent extends BaseTerminalTabComponent { @Input() transport!: SessionTransport @Input() room!: string + @Input() pinProvider!: PinProvider session: MirrorSession | null = null // eslint-disable-next-line @typescript-eslint/no-useless-constructor @@ -39,7 +41,7 @@ export class MirrorTabComponent extends BaseTerminalTabComponent { } protected onFrontendReady(): void { - const session = new MirrorSession(this.injector, this.transport, this.room) + const session = new MirrorSession(this.injector, this.transport, this.room, this.pinProvider) this.setSession(session) // Adopt the host's size (tmate model). Guest window resizes are ignored (no frontend.resize$ // subscription) so there is no resize feedback loop. diff --git a/clients/tabby/src/host/shareController.ts b/clients/tabby/src/host/shareController.ts index a5b00f6..a4a0adc 100644 --- a/clients/tabby/src/host/shareController.ts +++ b/clients/tabby/src/host/shareController.ts @@ -3,15 +3,18 @@ * small HostTerminal port, so it is fully unit-testable with mocks. PeershellService adapts a real * Tabby BaseTerminalTabComponent to HostTerminal. * - * Stage 1 scope: connect, create session, and — after a guest joins and acks the snapshot — mirror - * the terminal output out and inject the guest's input back. The PIN gate lands in Stage 3; the - * snapshot-ack barrier is already wired here. + * Flow: connect -> create session -> guest joins -> PIN challenge-response (rate-limited) -> on + * pin-ok send the snapshot, wait for snapshot-ack (barrier), then mirror output and inject input. + * Input frames are ignored until the guest is authenticated. */ import { Observable, Subscription } from 'rxjs' import { SessionTransport, ControlMessage, Channel, SINGLE_PEER, utf8ToBase64, + generateNonce, verifyPin, } from '@peershell/protocol' +const MAX_PIN_ATTEMPTS = 5 + /** Port the controller needs from the host terminal (adapted from Tabby's tab). */ export interface HostTerminal { readonly output$: Observable @@ -27,6 +30,8 @@ export interface ShareHandle { room: string, magicLink: string } export interface ShareHooks { onSession?: (h: ShareHandle) => void onPeerJoined?: () => void + onAuthenticated?: () => void + onPinFailed?: () => void onPeerLeft?: (reason?: string) => void onError?: (code: string, message?: string) => void } @@ -37,19 +42,24 @@ export class ShareController { private subs = new Subscription() private streaming = false + private authenticated = false private peerId = SINGLE_PEER private stopped = false + private nonce = '' + private attemptsLeft = MAX_PIN_ATTEMPTS constructor( private readonly transport: SessionTransport, private readonly tab: HostTerminal, + private readonly pin: string, private readonly hooks: ShareHooks = {}, ) {} async start(serverUrl: string, token?: string): Promise { this.transport.onControl(m => this.onControl(m)) this.transport.onBinary(f => { - if (f.channel === Channel.Input) { + // Reject any input until the guest has passed the PIN. + if (f.channel === Channel.Input && this.authenticated) { this.tab.sendInput(f.data) } }) @@ -69,14 +79,20 @@ export class ShareController { break case 'peer-joined': this.peerId = m.peerId ?? SINGLE_PEER + this.authenticated = false + this.attemptsLeft = MAX_PIN_ATTEMPTS this.hooks.onPeerJoined?.() - this.sendSnapshot() + this.challenge() + break + case 'pin-response': + void this.verifyResponse(m.hash) break case 'snapshot-ack': this.beginStream() break case 'peer-left': this.streaming = false + this.authenticated = false this.hooks.onPeerLeft?.(m.reason) break case 'error': @@ -87,6 +103,30 @@ export class ShareController { } } + private challenge(): void { + this.nonce = generateNonce() + this.transport.sendControl({ t: 'pin-challenge', nonce: this.nonce }) + } + + private async verifyResponse(hash: string): Promise { + const ok = await verifyPin(this.pin, this.nonce, hash) + if (ok) { + this.authenticated = true + this.transport.sendControl({ t: 'pin-ok' }) + this.hooks.onAuthenticated?.() + this.sendSnapshot() + return + } + this.attemptsLeft -= 1 + this.transport.sendControl({ t: 'pin-fail', left: this.attemptsLeft }) + if (this.attemptsLeft > 0) { + this.challenge() + } else { + this.transport.sendControl({ t: 'peer-left', reason: 'pin-failed' }) + this.hooks.onPinFailed?.() + } + } + private sendSnapshot(): void { const size = this.tab.getSize() this.transport.sendControl({ @@ -98,7 +138,7 @@ export class ShareController { } private beginStream(): void { - if (this.streaming || this.stopped) { + if (this.streaming || this.stopped || !this.authenticated) { return } this.streaming = true @@ -122,6 +162,7 @@ export class ShareController { this.transport.sendControl({ t: 'session-close' }) } this.streaming = false + this.authenticated = false this.subs.unsubscribe() this.transport.close(1000, reason) } diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index b17852b..3b98c88 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -3,10 +3,11 @@ import { map } from 'rxjs' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { AppService, ConfigService, NotificationsService, BaseTabComponent, PromptModalComponent } from 'tabby-core' import { BaseTerminalTabComponent, ResizeEvent } from 'tabby-terminal' -import { WebSocketTransport, normalizeRoomCode, isValidRoomCode } from '@peershell/protocol' +import { WebSocketTransport, normalizeRoomCode, isValidRoomCode, generatePin } from '@peershell/protocol' import { ShareController, HostTerminal } from '../host/shareController' import { MirrorTabComponent } from '../guest/mirrorTab.component' +import { PinProvider } from '../guest/mirrorController' /** Owns the active host shares and adapts a Tabby terminal tab to the transport-driven controller. */ @Injectable({ providedIn: 'root' }) @@ -43,9 +44,14 @@ export class PeershellService { return } + // Per-session PIN, generated locally and shown to the host. Never sent to the server in + // cleartext (challenge-response only). The host shares it with the intended guest out-of-band. + const pin = generatePin(6) const transport = new WebSocketTransport() - const controller = new ShareController(transport, this.adapt(tab), { - onSession: h => this.notifications.info('peershell: sharing this terminal', h.magicLink), + const controller = new ShareController(transport, this.adapt(tab), pin, { + onSession: h => this.notifications.info(`peershell: sharing — PIN ${pin}`, h.magicLink), + onAuthenticated: () => this.notifications.notice('peershell: guest connected'), + onPinFailed: () => this.notifications.error('peershell: guest failed the PIN'), onPeerLeft: () => this.notifications.notice('peershell: peer disconnected'), onError: (code, message) => this.notifications.error(`peershell: ${code}`, message), }) @@ -78,11 +84,13 @@ export class PeershellService { this.notifications.error('peershell: could not connect to the server', String(err)) return } + const pinProvider: PinProvider = () => this.promptPin() this.app.openNewTab({ type: MirrorTabComponent, inputs: { transport, room, + pinProvider, profile: { name: `peershell: ${room}`, type: 'peershell-mirror', options: {} }, }, }) @@ -104,6 +112,15 @@ export class PeershellService { return room } + private async promptPin(): Promise { + const modal = this.ngbModal.open(PromptModalComponent) + modal.componentInstance.prompt = 'Session PIN' + modal.componentInstance.password = true + const result = await modal.result.catch(() => null) + const value: string | undefined = result?.value + return value ? value.trim() : null + } + stopSharing(tab: BaseTerminalTabComponent): void { const controller = this.shares.get(tab) if (controller) { diff --git a/clients/tabby/test/hostGuest.integration.test.ts b/clients/tabby/test/hostGuest.integration.test.ts index 23faa91..afdb342 100644 --- a/clients/tabby/test/hostGuest.integration.test.ts +++ b/clients/tabby/test/hostGuest.integration.test.ts @@ -1,13 +1,13 @@ /** * End-to-end interop of the two real controllers through the throwaway relay: ShareController (host, * driving a mock terminal) <-> dev relay <-> MirrorController (guest, driving a mock sink). Verifies - * snapshot delivery + ack barrier, live output host->guest, and input guest->host. + * the PIN handshake, snapshot delivery + ack barrier, live output host->guest, and input guest->host. */ import WebSocket from 'ws' import { Subject } from 'rxjs' import { WebSocketTransport, WebSocketCtor } from '@peershell/protocol' import { ShareController, HostTerminal } from '../src/host/shareController' -import { MirrorController } from '../src/guest/mirrorController' +import { MirrorController, MirrorSink } from '../src/guest/mirrorController' // eslint-disable-next-line @typescript-eslint/no-var-requires const { startRelay } = require('../../../server/dev-relay.cjs') as { @@ -17,6 +17,7 @@ const { startRelay } = require('../../../server/dev-relay.cjs') as { const WS = WebSocket as unknown as WebSocketCtor const enc = (s: string) => new TextEncoder().encode(s) const dec = (b: Uint8Array) => new TextDecoder().decode(b) +const PIN = '246810' function waitFor(pred: () => boolean, timeoutMs = 12000): Promise { return new Promise((resolve, reject) => { @@ -38,13 +39,8 @@ let relay: { url: string, close: () => Promise } beforeAll(async () => { relay = await startRelay(0) }) afterAll(async () => { await relay.close() }) -it('mirrors snapshot + live output host->guest and input guest->host', async () => { - const hostTransport = new WebSocketTransport(WS) - const guestTransport = new WebSocketTransport(WS) - - const output$ = new Subject() - const inputs: Uint8Array[] = [] - const hostTab: HostTerminal = { +function hostTerminal(output$: Subject, inputs: Uint8Array[]): HostTerminal { + return { output$, resize$: new Subject<{ cols: number, rows: number }>(), closed$: new Subject(), @@ -52,11 +48,18 @@ it('mirrors snapshot + live output host->guest and input guest->host', async () getSize: () => ({ cols: 111, rows: 33 }), snapshot: () => 'SNAPSHOT-VT', } +} + +it('PIN handshake, then mirrors snapshot + live output host->guest and input guest->host', async () => { + const hostTransport = new WebSocketTransport(WS) + const guestTransport = new WebSocketTransport(WS) + const output$ = new Subject() + const inputs: Uint8Array[] = [] const emits: Uint8Array[] = [] let hostResize: { cols: number, rows: number } | null = null let sawLive = false - const guest = new MirrorController(guestTransport, { + const sink: MirrorSink = { emit: d => { emits.push(d) if (dec(d).includes('LIVE')) { @@ -65,16 +68,15 @@ it('mirrors snapshot + live output host->guest and input guest->host', async () }, hostResize: (cols, rows) => { hostResize = { cols, rows } }, ended: () => { /* noop */ }, - }) - - const host = new ShareController(hostTransport, hostTab, { + } + const guest = new MirrorController(guestTransport, sink, async () => PIN) + const host = new ShareController(hostTransport, hostTerminal(output$, inputs), PIN, { onSession: ({ room }) => guest.join(room), }) await guestTransport.connect(relay.url) await host.start(relay.url) - // Keep emitting host output until the guest has received a live frame (survives the ack round-trip). const pump = setInterval(() => output$.next(enc('LIVE\r\n')), 15) await waitFor(() => sawLive) clearInterval(pump) @@ -89,3 +91,30 @@ it('mirrors snapshot + live output host->guest and input guest->host', async () host.stop('done') guest.close() }, 15000) + +it('a wrong PIN never streams and ends the guest', async () => { + const hostTransport = new WebSocketTransport(WS) + const guestTransport = new WebSocketTransport(WS) + const output$ = new Subject() + const inputs: Uint8Array[] = [] + + let endedReason: string | null = null + const sink: MirrorSink = { + emit: () => { /* should never receive a snapshot/output */ }, + hostResize: () => { /* noop */ }, + ended: reason => { endedReason = reason }, + } + const guest = new MirrorController(guestTransport, sink, async () => 'wrong-pin') + const host = new ShareController(hostTransport, hostTerminal(output$, inputs), PIN, { + onSession: ({ room }) => guest.join(room), + }) + + await guestTransport.connect(relay.url) + await host.start(relay.url) + + await waitFor(() => endedReason !== null) + expect(endedReason).toBe('wrong PIN') + + host.stop('done') + guest.close() +}, 15000) diff --git a/clients/tabby/test/mirrorController.test.ts b/clients/tabby/test/mirrorController.test.ts index c10a2d2..abcd48a 100644 --- a/clients/tabby/test/mirrorController.test.ts +++ b/clients/tabby/test/mirrorController.test.ts @@ -1,7 +1,7 @@ import { - SessionTransport, ControlMessage, BinaryPayload, Channel, TransportState, utf8ToBase64, + SessionTransport, ControlMessage, BinaryPayload, Channel, TransportState, utf8ToBase64, hashPin, } from '@peershell/protocol' -import { MirrorController, MirrorSink } from '../src/guest/mirrorController' +import { MirrorController, MirrorSink, PinProvider } from '../src/guest/mirrorController' class MockTransport implements SessionTransport { sentControl: ControlMessage[] = [] @@ -36,6 +36,9 @@ class MockTransport implements SessionTransport { controlTypes(): string[] { return this.sentControl.map(c => c.t) } + last(t: T): Extract | undefined { + return [...this.sentControl].reverse().find(c => c.t === t) as never + } } function mockSink() { @@ -51,15 +54,42 @@ function mockSink() { } const dec = (b: Uint8Array) => new TextDecoder().decode(b) +const noPin: PinProvider = async () => null + +function waitUntil(pred: () => boolean, ms = 2000): Promise { + return new Promise((resolve, reject) => { + const iv = setInterval(() => { + if (pred()) { + clearInterval(iv) + clearTimeout(to) + resolve() + } + }, 5) + const to = setTimeout(() => { + clearInterval(iv) + reject(new Error('waitUntil timeout')) + }, ms) + }) +} -it('joins, renders + acks the snapshot, renders output, and forwards input', () => { +it('answers the PIN challenge with H(pin, nonce)', async () => { const t = new MockTransport() const s = mockSink() - const c = new MirrorController(t, s.sink) - + const c = new MirrorController(t, s.sink, async () => '424242') c.join('ABC234') expect(t.controlTypes()).toEqual(['hello', 'join']) + t.emitControl({ t: 'pin-challenge', nonce: 'nonce-xyz' }) + await waitUntil(() => t.sentControl.some(x => x.t === 'pin-response')) + expect(t.last('pin-response')!.hash).toBe(await hashPin('424242', 'nonce-xyz')) +}) + +it('renders + acks the snapshot, renders output, forwards input', () => { + const t = new MockTransport() + const s = mockSink() + const c = new MirrorController(t, s.sink, noPin) + c.join('ABC234') + t.emitControl({ t: 'snapshot', cols: 100, rows: 30, data: utf8ToBase64('SNAP') }) expect(dec(s.emits[0])).toBe('SNAP') expect(s.resizes[0]).toEqual({ cols: 100, rows: 30 }) @@ -68,20 +98,28 @@ it('joins, renders + acks the snapshot, renders output, and forwards input', () t.emitBinary({ peerId: 0, channel: Channel.Output, data: new Uint8Array([79, 75]) }) expect(dec(s.emits[1])).toBe('OK') - // input channel from host is ignored by the guest - t.emitBinary({ peerId: 0, channel: Channel.Input, data: new Uint8Array([1]) }) - expect(s.emits).toHaveLength(2) - c.writeInput(new Uint8Array([108, 115])) - expect(t.sentData).toHaveLength(1) expect(t.sentData[0].channel).toBe(Channel.Input) expect(Array.from(t.sentData[0].data)).toEqual([108, 115]) }) +it('ends on pin-fail with no attempts left, but not while attempts remain', () => { + const t = new MockTransport() + const s = mockSink() + const c = new MirrorController(t, s.sink, noPin) + c.join('ABC234') + + t.emitControl({ t: 'pin-fail', left: 3 }) + expect(s.getEnded()).toBeNull() + + t.emitControl({ t: 'pin-fail', left: 0 }) + expect(s.getEnded()).toBe('wrong PIN') +}) + it('surfaces a host resize and ends on peer-left (once)', () => { const t = new MockTransport() const s = mockSink() - const c = new MirrorController(t, s.sink) + const c = new MirrorController(t, s.sink, noPin) c.join('ABC234') t.emitControl({ t: 'resize', cols: 132, rows: 43 }) diff --git a/clients/tabby/test/shareController.test.ts b/clients/tabby/test/shareController.test.ts index 1aea1c8..b5a80e9 100644 --- a/clients/tabby/test/shareController.test.ts +++ b/clients/tabby/test/shareController.test.ts @@ -1,9 +1,11 @@ import { Subject } from 'rxjs' import { - SessionTransport, ControlMessage, BinaryPayload, Channel, TransportState, base64ToUtf8, + SessionTransport, ControlMessage, BinaryPayload, Channel, TransportState, base64ToUtf8, hashPin, } from '@peershell/protocol' import { ShareController, HostTerminal } from '../src/host/shareController' +const PIN = '135790' + class MockTransport implements SessionTransport { sentControl: ControlMessage[] = [] sentData: Array<{ peerId: number, channel: Channel, data: Uint8Array }> = [] @@ -40,6 +42,9 @@ class MockTransport implements SessionTransport { controlTypes(): string[] { return this.sentControl.map(c => c.t) } + last(t: T): Extract | undefined { + return [...this.sentControl].reverse().find(c => c.t === t) as never + } } function mockTab() { @@ -58,56 +63,93 @@ function mockTab() { return { tab, output$, resize$, closed$, inputs } } -it('creates a session, then mirrors output only after snapshot-ack and injects input', async () => { +function waitUntil(pred: () => boolean, ms = 2000): Promise { + return new Promise((resolve, reject) => { + const iv = setInterval(() => { + if (pred()) { + clearInterval(iv) + clearTimeout(to) + resolve() + } + }, 5) + const to = setTimeout(() => { + clearInterval(iv) + reject(new Error('waitUntil timeout')) + }, ms) + }) +} + +async function respond(t: MockTransport, nonce: string, pin: string): Promise { + t.emitControl({ t: 'pin-response', hash: await hashPin(pin, nonce) }) +} + +it('gates on PIN (rate-limited), then mirrors output after snapshot-ack and injects input', async () => { const t = new MockTransport() const m = mockTab() - const c = new ShareController(t, m.tab) + const c = new ShareController(t, m.tab, PIN) await c.start('ws://relay') expect(t.controlTypes()).toEqual(['hello', 'create-session']) t.emitControl({ t: 'session-created', room: 'ABC234', magicLink: 'http://x/s/tok' }) expect(c.room).toBe('ABC234') - expect(c.magicLink).toBe('http://x/s/tok') t.emitControl({ t: 'peer-joined', peerId: 0, kind: 'web' }) - const snap = t.sentControl.find(x => x.t === 'snapshot') - expect(snap && snap.t === 'snapshot' && base64ToUtf8(snap.data)).toBe('SNAPSHOT') + const chal = t.last('pin-challenge') + expect(chal).toBeTruthy() + + // Wrong PIN -> pin-fail{left:4} + a fresh challenge; input still rejected. + await respond(t, chal!.nonce, '000000') + await waitUntil(() => t.sentControl.some(x => x.t === 'pin-fail')) + expect(t.last('pin-fail')!.left).toBe(4) + t.emitBinary({ peerId: 0, channel: Channel.Input, data: new Uint8Array([1]) }) + expect(m.inputs).toHaveLength(0) - // Barrier: no output before the guest acks the snapshot. - m.output$.next(new Uint8Array([1, 2, 3])) - expect(t.sentData.length).toBe(0) + // Correct PIN on the new challenge -> pin-ok + snapshot. + await respond(t, t.last('pin-challenge')!.nonce, PIN) + await waitUntil(() => t.sentControl.some(x => x.t === 'snapshot')) + expect(t.sentControl.some(x => x.t === 'pin-ok')).toBe(true) + expect(base64ToUtf8(t.last('snapshot')!.data)).toBe('SNAPSHOT') + + // Barrier: no output before ack. + m.output$.next(new Uint8Array([9])) + expect(t.sentData).toHaveLength(0) t.emitControl({ t: 'snapshot-ack' }) m.output$.next(new Uint8Array([9, 9])) expect(t.sentData).toHaveLength(1) - expect(t.sentData[0].channel).toBe(Channel.Output) expect(Array.from(t.sentData[0].data)).toEqual([9, 9]) - // Guest input frame is injected into the local terminal. + // Authenticated: input now accepted. t.emitBinary({ peerId: 0, channel: Channel.Input, data: new Uint8Array([108, 115]) }) - expect(m.inputs).toHaveLength(1) expect(Array.from(m.inputs[0])).toEqual([108, 115]) +}) - // resize is forwarded as a control message. - m.resize$.next({ cols: 120, rows: 40 }) - expect(t.sentControl.find(x => x.t === 'resize')).toEqual({ t: 'resize', cols: 120, rows: 40 }) +it('kicks the peer after exhausting PIN attempts', async () => { + const t = new MockTransport() + const m = mockTab() + const c = new ShareController(t, m.tab, PIN) + await c.start('ws://relay') + t.emitControl({ t: 'session-created', room: 'ABC234', magicLink: 'http://x' }) + t.emitControl({ t: 'peer-joined', peerId: 0, kind: 'web' }) + + for (let i = 0; i < 5; i++) { + await respond(t, t.last('pin-challenge')!.nonce, '999999') + await waitUntil(() => t.sentControl.filter(x => x.t === 'pin-fail').length === i + 1) + } + expect(t.last('pin-fail')!.left).toBe(0) + expect(t.sentControl.some(x => x.t === 'peer-left' && x.reason === 'pin-failed')).toBe(true) + expect(c['authenticated']).toBe(false) }) -it('tears down on tab close and stops forwarding', async () => { +it('tears down on tab close', async () => { const t = new MockTransport() const m = mockTab() - const c = new ShareController(t, m.tab) + const c = new ShareController(t, m.tab, PIN) await c.start('ws://relay') - t.emitControl({ t: 'session-created', room: 'ABC234', magicLink: 'http://x/s/tok' }) - t.emitControl({ t: 'peer-joined', peerId: 0, kind: 'desktop' }) - t.emitControl({ t: 'snapshot-ack' }) + t.emitControl({ t: 'session-created', room: 'ABC234', magicLink: 'http://x' }) m.closed$.next() expect(t.closed).toBe(true) expect(t.controlTypes()).toEqual(expect.arrayContaining(['peer-left', 'session-close'])) - - const before = t.sentData.length - m.output$.next(new Uint8Array([5])) - expect(t.sentData.length).toBe(before) }) diff --git a/shared/src/pinAuth.ts b/shared/src/pinAuth.ts index 1f6ef1d..9e15001 100644 --- a/shared/src/pinAuth.ts +++ b/shared/src/pinAuth.ts @@ -22,6 +22,14 @@ export function generateNonce(byteLength = 16): string { return toHex(arr) } +/** A random numeric PIN (default 6 digits) for a share. Kept local; never sent in cleartext. */ +export function generatePin(digits = 6): string { + const arr = new Uint32Array(1) + globalThis.crypto.getRandomValues(arr) + const n = arr[0] % (10 ** digits) + return n.toString().padStart(digits, '0') +} + /** `H(pin, nonce)` as a hex string (SHA-256 over `nonce:pin`). */ export async function hashPin(pin: string, nonce: string): Promise { const data = new TextEncoder().encode(`${nonce}:${pin}`) diff --git a/shared/src/websocketTransport.ts b/shared/src/websocketTransport.ts index 2ea0b5a..5c37d2d 100644 --- a/shared/src/websocketTransport.ts +++ b/shared/src/websocketTransport.ts @@ -21,6 +21,8 @@ export interface WebSocketLike { export type WebSocketCtor = new (url: string) => WebSocketLike +const KEEPALIVE_INTERVAL_MS = 20000 + function toUint8(data: unknown): Uint8Array { if (data instanceof ArrayBuffer) { return new Uint8Array(data) @@ -35,6 +37,7 @@ function toUint8(data: unknown): Uint8Array { export class WebSocketTransport implements SessionTransport { private ws: WebSocketLike | null = null private state: TransportState = 'closed' + private keepalive: ReturnType | null = null private readonly WS: WebSocketCtor private readonly controlCbs: Array<(m: ControlMessage) => void> = [] private readonly binaryCbs: Array<(f: BinaryPayload) => void> = [] @@ -66,6 +69,7 @@ export class WebSocketTransport implements SessionTransport { this.ws = ws ws.onopen = () => { this.setState('open') + this.startKeepalive() resolve() } ws.onerror = () => { @@ -86,6 +90,14 @@ export class WebSocketTransport implements SessionTransport { } catch { return // ignore malformed control frames } + // Keepalive is handled at the transport layer and not surfaced to the app. + if (msg.t === 'ping') { + this.sendControl({ t: 'pong' }) + return + } + if (msg.t === 'pong') { + return + } for (const cb of this.controlCbs) { cb(msg) } @@ -111,9 +123,27 @@ export class WebSocketTransport implements SessionTransport { } close(code?: number, reason?: string): void { + this.stopKeepalive() this.ws?.close(code, reason) } + private startKeepalive(): void { + this.stopKeepalive() + this.keepalive = setInterval(() => this.sendControl({ t: 'ping' }), KEEPALIVE_INTERVAL_MS) + // Don't keep a Node process (or test runner) alive just for keepalive. + const timer = this.keepalive as unknown as { unref?: () => void } + if (typeof timer.unref === 'function') { + timer.unref() + } + } + + private stopKeepalive(): void { + if (this.keepalive !== null) { + clearInterval(this.keepalive) + this.keepalive = null + } + } + onControl(cb: (m: ControlMessage) => void): void { this.controlCbs.push(cb) } @@ -128,6 +158,9 @@ export class WebSocketTransport implements SessionTransport { private setState(s: TransportState): void { this.state = s + if (s === 'closed') { + this.stopKeepalive() + } for (const cb of this.stateCbs) { cb(s) } diff --git a/shared/test/websocketTransport.test.ts b/shared/test/websocketTransport.test.ts new file mode 100644 index 0000000..fb9fe42 --- /dev/null +++ b/shared/test/websocketTransport.test.ts @@ -0,0 +1,84 @@ +import { WebSocketTransport, WebSocketCtor, WebSocketLike } from '../src/websocketTransport' +import { encodeControl, encodeBinaryFrame, Channel } from '../src/protocol' + +let last: FakeWS + +class FakeWS implements WebSocketLike { + binaryType = '' + sent: Array = [] + closed = false + onopen: ((ev: unknown) => void) | null = null + onmessage: ((ev: { data: unknown }) => void) | null = null + onclose: ((ev: unknown) => void) | null = null + onerror: ((ev: unknown) => void) | null = null + + constructor(public url: string) { + last = this + } + send(data: string | ArrayBufferView | ArrayBuffer): void { + this.sent.push(data) + } + close(): void { + this.closed = true + this.onclose?.(null) + } + sentControlTypes(): string[] { + return this.sent + .filter((d): d is string => typeof d === 'string') + .map(d => JSON.parse(d).t) + } +} + +const WS = FakeWS as unknown as WebSocketCtor + +async function connected() { + const transport = new WebSocketTransport(WS) + const p = transport.connect('ws://x') + last.onopen?.(null) + await p + return transport +} + +afterEach(() => jest.useRealTimers()) + +it('routes text -> control and arraybuffer -> binary', async () => { + jest.useFakeTimers() + const transport = await connected() + const controls: string[] = [] + const bins: Array<{ channel: Channel, data: number[] }> = [] + transport.onControl(m => controls.push(m.t)) + transport.onBinary(f => bins.push({ channel: f.channel, data: Array.from(f.data) })) + + last.onmessage?.({ data: encodeControl({ t: 'pin-ok' }) }) + const frame = encodeBinaryFrame(0, Channel.Output, new Uint8Array([1, 2, 3])) + last.onmessage?.({ data: frame.buffer }) + + expect(controls).toEqual(['pin-ok']) + expect(bins).toEqual([{ channel: Channel.Output, data: [1, 2, 3] }]) +}) + +it('sends a ping every 20s and answers an incoming ping with pong (both handled below the app)', async () => { + jest.useFakeTimers() + const transport = await connected() + const appControls: string[] = [] + transport.onControl(m => appControls.push(m.t)) + + jest.advanceTimersByTime(20000) + expect(last.sentControlTypes()).toContain('ping') + + last.onmessage?.({ data: encodeControl({ t: 'ping' }) }) + expect(last.sentControlTypes()).toContain('pong') + + // ping/pong are not surfaced to the application + last.onmessage?.({ data: encodeControl({ t: 'pong' }) }) + expect(appControls).toEqual([]) +}) + +it('stops the keepalive timer on close', async () => { + jest.useFakeTimers() + const transport = await connected() + transport.close() + const before = last.sent.length + jest.advanceTimersByTime(60000) + expect(last.sent.length).toBe(before) +}) From 8a96378a9d60249be0be35d91b87b5f26a9b2854 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 02:37:10 +0200 Subject: [PATCH 08/75] Stage 4: promote MirrorController to shared + HTTP tunnel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Move MirrorController (+ MirrorSink/PinProvider) into @peershell/protocol so it is reused by the Tabby plugin (MirrorSession) and the coming web-client. Update plugin imports + relocate its unit test to shared/. - shared/httpTunnelHandler.ts: answers tunneled http-get by serving the embedded web-client HTML; strict path whitelist (only '/'), 403 on traversal/SSRF. Unit-tested. - dev-relay: reverse HTTP tunnel — GET /s/ forwards http-get to the host and returns the host's http-response body (intercepted, not forwarded to a peer). - shared/test/tunnel.integration.test.ts: Node HTTP GET of the magic-link returns the host-served page over the tunnel. 32/32 tests green; build:all green; smoke-load PASS. --- clients/tabby/src/guest/mirrorSession.ts | 4 +- .../tabby/src/guest/mirrorTab.component.ts | 3 +- .../tabby/src/services/peershell.service.ts | 3 +- .../tabby/test/hostGuest.integration.test.ts | 3 +- server/dev-relay.cjs | 71 +++++++++++++++---- shared/src/httpTunnelHandler.ts | 36 ++++++++++ shared/src/index.ts | 2 + .../guest => shared/src}/mirrorController.ts | 17 ++--- shared/test/httpTunnelHandler.test.ts | 53 ++++++++++++++ .../test/mirrorController.test.ts | 4 +- shared/test/tunnel.integration.test.ts | 70 ++++++++++++++++++ 11 files changed, 235 insertions(+), 31 deletions(-) create mode 100644 shared/src/httpTunnelHandler.ts rename {clients/tabby/src/guest => shared/src}/mirrorController.ts (85%) create mode 100644 shared/test/httpTunnelHandler.test.ts rename {clients/tabby => shared}/test/mirrorController.test.ts (97%) create mode 100644 shared/test/tunnel.integration.test.ts diff --git a/clients/tabby/src/guest/mirrorSession.ts b/clients/tabby/src/guest/mirrorSession.ts index 9e43c40..7115e6c 100644 --- a/clients/tabby/src/guest/mirrorSession.ts +++ b/clients/tabby/src/guest/mirrorSession.ts @@ -2,9 +2,7 @@ import { Injector } from '@angular/core' import { Observable, Subject } from 'rxjs' import { LogService } from 'tabby-core' import { BaseSession, UTF8SplitterMiddleware } from 'tabby-terminal' -import { SessionTransport } from '@peershell/protocol' - -import { MirrorController, MirrorSink, PinProvider } from './mirrorController' +import { SessionTransport, MirrorController, MirrorSink, PinProvider } from '@peershell/protocol' /** * A "fake shell" session backing the guest mirror tab. Inbound frames become terminal output via diff --git a/clients/tabby/src/guest/mirrorTab.component.ts b/clients/tabby/src/guest/mirrorTab.component.ts index 2c879c8..435a014 100644 --- a/clients/tabby/src/guest/mirrorTab.component.ts +++ b/clients/tabby/src/guest/mirrorTab.component.ts @@ -1,9 +1,8 @@ import { Component, Injector, Input } from '@angular/core' import { BaseTerminalTabComponent } from 'tabby-terminal' -import { SessionTransport } from '@peershell/protocol' +import { SessionTransport, PinProvider } from '@peershell/protocol' import { MirrorSession } from './mirrorSession' -import { PinProvider } from './mirrorController' /** * Guest tab that renders a mirrored remote terminal. Reuses BaseTerminalTabComponent's template so diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index 3b98c88..ffffa99 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -3,11 +3,10 @@ import { map } from 'rxjs' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { AppService, ConfigService, NotificationsService, BaseTabComponent, PromptModalComponent } from 'tabby-core' import { BaseTerminalTabComponent, ResizeEvent } from 'tabby-terminal' -import { WebSocketTransport, normalizeRoomCode, isValidRoomCode, generatePin } from '@peershell/protocol' +import { WebSocketTransport, normalizeRoomCode, isValidRoomCode, generatePin, PinProvider } from '@peershell/protocol' import { ShareController, HostTerminal } from '../host/shareController' import { MirrorTabComponent } from '../guest/mirrorTab.component' -import { PinProvider } from '../guest/mirrorController' /** Owns the active host shares and adapts a Tabby terminal tab to the transport-driven controller. */ @Injectable({ providedIn: 'root' }) diff --git a/clients/tabby/test/hostGuest.integration.test.ts b/clients/tabby/test/hostGuest.integration.test.ts index afdb342..5bcf036 100644 --- a/clients/tabby/test/hostGuest.integration.test.ts +++ b/clients/tabby/test/hostGuest.integration.test.ts @@ -5,9 +5,8 @@ */ import WebSocket from 'ws' import { Subject } from 'rxjs' -import { WebSocketTransport, WebSocketCtor } from '@peershell/protocol' +import { WebSocketTransport, WebSocketCtor, MirrorController, MirrorSink } from '@peershell/protocol' import { ShareController, HostTerminal } from '../src/host/shareController' -import { MirrorController, MirrorSink } from '../src/guest/mirrorController' // eslint-disable-next-line @typescript-eslint/no-var-requires const { startRelay } = require('../../../server/dev-relay.cjs') as { diff --git a/server/dev-relay.cjs b/server/dev-relay.cjs index bb3830e..9e32d64 100644 --- a/server/dev-relay.cjs +++ b/server/dev-relay.cjs @@ -30,10 +30,46 @@ function startRelay(port = 0) { let boundPort = port const rooms = new Map() // room -> { host, guest } const tokens = new Map() // token -> room + const pendingHttp = new Map() // reqId -> http res (browser waiting for the tunneled page) - const server = http.createServer((_req, res) => { - res.writeHead(200, { 'content-type': 'text/plain' }) - res.end('peershell dev relay\n') + function resolveHttp(msg) { + const res = pendingHttp.get(msg.reqId) + if (res) { + pendingHttp.delete(msg.reqId) + res.writeHead(msg.status || 200, msg.headers || {}) + res.end(Buffer.from(msg.bodyBase64 || '', 'base64')) + } + } + + // Reverse HTTP tunnel: GET /s/ is forwarded to the host as an http-get frame; the + // host answers with http-response (intercepted below) which we return to the browser. + const server = http.createServer((req, res) => { + const m = /^\/s\/([^/?#]+)/.exec(req.url || '') + if (!m) { + res.writeHead(200, { 'content-type': 'text/plain' }) + res.end('peershell dev relay\n') + return + } + const room = tokens.get(m[1]) + const entry = room && rooms.get(room) + if (!entry || !entry.host) { + res.writeHead(404) + res.end('unknown session') + return + } + const reqId = crypto.randomBytes(6).toString('hex') + pendingHttp.set(reqId, res) + entry.host.send(JSON.stringify({ v: 1, t: 'http-get', peerId: 0, reqId, path: '/' })) + const to = setTimeout(() => { + if (pendingHttp.has(reqId)) { + pendingHttp.delete(reqId) + res.writeHead(504) + res.end('tunnel timeout') + } + }, 5000) + if (typeof to.unref === 'function') { + to.unref() + } }) const wss = new WebSocketServer({ server }) @@ -49,21 +85,32 @@ function startRelay(port = 0) { sock._peer = null sock.on('message', (data, isBinary) => { - // Once paired, the relay is blind: forward everything to the peer. - if (sock._peer) { - safeSend(sock._peer, isBinary ? data : data.toString(), isBinary) - return - } if (isBinary) { - return // no binary before pairing + if (sock._peer) { + safeSend(sock._peer, data, true) + } + return } - let msg + const text = data.toString() + let msg = null try { - msg = JSON.parse(data.toString()) + msg = JSON.parse(text) } catch { + /* ignore non-JSON text */ + } + // http-response is relay-directed (answers a tunneled page request), never forwarded. + if (msg && msg.t === 'http-response') { + resolveHttp(msg) return } - handleSignal(sock, msg) + // Once paired, the relay is blind: forward everything else to the peer. + if (sock._peer) { + safeSend(sock._peer, text, false) + return + } + if (msg) { + handleSignal(sock, msg) + } }) sock.on('close', () => { diff --git a/shared/src/httpTunnelHandler.ts b/shared/src/httpTunnelHandler.ts new file mode 100644 index 0000000..e617925 --- /dev/null +++ b/shared/src/httpTunnelHandler.ts @@ -0,0 +1,36 @@ +/** + * Host side of the reverse HTTP tunnel. The server forwards a browser's page request as an + * `http-get` frame over the host's outbound WS; the host answers with `http-response` carrying the + * embedded web-client HTML. NOT a real HTTP server (the renderer opens no port) — just frame handling. + * + * Strictly whitelists the path (only `/`) to prevent path-traversal / SSRF via a malicious guest. + */ +import { ControlMessage } from './protocol' +import { SessionTransport, isAllowedTunnelPath } from './api' +import { utf8ToBase64 } from './base64' + +export class HttpTunnelHandler { + constructor( + private readonly transport: SessionTransport, + private readonly serveHtml: () => string, + ) { + this.transport.onControl(m => { + if (m.t === 'http-get') { + this.handle(m) + } + }) + } + + private handle(m: Extract): void { + const allowed = isAllowedTunnelPath(m.path) + const body = allowed ? this.serveHtml() : 'Forbidden' + this.transport.sendControl({ + t: 'http-response', + peerId: m.peerId, + reqId: m.reqId, + status: allowed ? 200 : 403, + headers: { 'content-type': allowed ? 'text/html; charset=utf-8' : 'text/plain; charset=utf-8' }, + bodyBase64: utf8ToBase64(body), + }) + } +} diff --git a/shared/src/index.ts b/shared/src/index.ts index 2bb3300..b4a7734 100644 --- a/shared/src/index.ts +++ b/shared/src/index.ts @@ -4,3 +4,5 @@ export * from './pinAuth' export * from './utf8Splitter' export * from './base64' export * from './websocketTransport' +export * from './mirrorController' +export * from './httpTunnelHandler' diff --git a/clients/tabby/src/guest/mirrorController.ts b/shared/src/mirrorController.ts similarity index 85% rename from clients/tabby/src/guest/mirrorController.ts rename to shared/src/mirrorController.ts index e0f0dd8..4778429 100644 --- a/clients/tabby/src/guest/mirrorController.ts +++ b/shared/src/mirrorController.ts @@ -1,16 +1,17 @@ /** - * Guest side of a shared session. Tabby-agnostic (drives a SessionTransport + a small MirrorSink - * port + a PIN provider), so it is fully unit-testable and reusable by the web-client / mobile later. - * MirrorSession adapts it to a Tabby BaseSession. + * Guest side of a shared session. Framework-neutral (drives a SessionTransport + a small MirrorSink + * port + a PIN provider), so it is reused by the Tabby plugin (via MirrorSession) and the web-client + * (and future mobile). PIN/render/input logic lives here once. * * Flow: join -> answer the host's PIN challenge -> on pin-ok, render the snapshot then ack it * (barrier) -> render live output, forward the guest's keystrokes. */ -import { - SessionTransport, ControlMessage, Channel, ClientKind, SINGLE_PEER, base64ToBytes, hashPin, -} from '@peershell/protocol' +import { Channel, ClientKind, SINGLE_PEER, ControlMessage } from './protocol' +import { SessionTransport } from './api' +import { base64ToBytes } from './base64' +import { hashPin } from './pinAuth' -/** Port the controller drives on the guest terminal (adapted from a Tabby session). */ +/** Port the controller drives on the guest terminal (adapted from a Tabby session or an xterm). */ export interface MirrorSink { emit(data: Uint8Array): void hostResize(cols: number, rows: number): void @@ -40,7 +41,7 @@ export class MirrorController { /** Announce as a guest and join the room. Handlers are wired in the ctor so no frame is missed. */ join(room: string, opts: { name?: string, kind?: ClientKind } = {}): void { this.transport.sendControl({ - t: 'hello', role: 'guest', kind: opts.kind ?? 'desktop', client: 'tabby-peershell', + t: 'hello', role: 'guest', kind: opts.kind ?? 'desktop', client: 'peershell', }) this.transport.sendControl({ t: 'join', room, name: opts.name }) } diff --git a/shared/test/httpTunnelHandler.test.ts b/shared/test/httpTunnelHandler.test.ts new file mode 100644 index 0000000..d6bffb4 --- /dev/null +++ b/shared/test/httpTunnelHandler.test.ts @@ -0,0 +1,53 @@ +import { + HttpTunnelHandler, SessionTransport, ControlMessage, BinaryPayload, Channel, TransportState, base64ToUtf8, +} from '../src' + +class MockTransport implements SessionTransport { + sentControl: ControlMessage[] = [] + private controlCb?: (m: ControlMessage) => void + + connect(): Promise { + return Promise.resolve() + } + sendControl(m: ControlMessage): void { + this.sentControl.push(m) + } + sendData(_p: number, _c: Channel, _d: Uint8Array): void { /* unused */ } + close(): void { /* unused */ } + onControl(cb: (m: ControlMessage) => void): void { + this.controlCb = cb + } + onBinary(_cb: (f: BinaryPayload) => void): void { /* unused */ } + onState(_cb: (s: TransportState) => void): void { /* unused */ } + + emitControl(m: ControlMessage): void { + this.controlCb?.(m) + } +} + +const HTML = 'peershell' + +it('serves the embedded HTML for the root path', () => { + const t = new MockTransport() + // eslint-disable-next-line no-new + new HttpTunnelHandler(t, () => HTML) + + t.emitControl({ t: 'http-get', peerId: 0, reqId: 'r1', path: '/' }) + const res = t.sentControl.find(m => m.t === 'http-response') as Extract + expect(res.status).toBe(200) + expect(res.reqId).toBe('r1') + expect(base64ToUtf8(res.bodyBase64)).toBe(HTML) +}) + +it('rejects traversal / SSRF paths with 403', () => { + const t = new MockTransport() + // eslint-disable-next-line no-new + new HttpTunnelHandler(t, () => HTML) + + for (const path of ['/../../etc/passwd', '/%2e%2e/x', 'http://169.254.169.254/', '/secret']) { + t.sentControl.length = 0 + t.emitControl({ t: 'http-get', peerId: 0, reqId: 'r', path }) + const res = t.sentControl.find(m => m.t === 'http-response') as Extract + expect(res.status).toBe(403) + } +}) diff --git a/clients/tabby/test/mirrorController.test.ts b/shared/test/mirrorController.test.ts similarity index 97% rename from clients/tabby/test/mirrorController.test.ts rename to shared/test/mirrorController.test.ts index abcd48a..002f69d 100644 --- a/clients/tabby/test/mirrorController.test.ts +++ b/shared/test/mirrorController.test.ts @@ -1,7 +1,7 @@ import { + MirrorController, MirrorSink, PinProvider, SessionTransport, ControlMessage, BinaryPayload, Channel, TransportState, utf8ToBase64, hashPin, -} from '@peershell/protocol' -import { MirrorController, MirrorSink, PinProvider } from '../src/guest/mirrorController' +} from '../src' class MockTransport implements SessionTransport { sentControl: ControlMessage[] = [] diff --git a/shared/test/tunnel.integration.test.ts b/shared/test/tunnel.integration.test.ts new file mode 100644 index 0000000..683c8a4 --- /dev/null +++ b/shared/test/tunnel.integration.test.ts @@ -0,0 +1,70 @@ +/** + * Reverse HTTP tunnel end-to-end: a Node HTTP client GETs the host's magic-link on the relay; the + * relay forwards http-get down the host's outbound WS; the host's HttpTunnelHandler serves the + * embedded page; the body comes back to the HTTP client. No browser needed. + */ +import * as http from 'http' +import WebSocket from 'ws' +import { WebSocketTransport, WebSocketCtor, HttpTunnelHandler } from '../src' + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const { startRelay } = require('../../server/dev-relay.cjs') as { + startRelay: (port?: number) => Promise<{ url: string, close: () => Promise }> +} + +const WS = WebSocket as unknown as WebSocketCtor +const HTML = 'peershell web-clienthi' + +function waitFor(pred: () => boolean, timeoutMs = 8000): Promise { + return new Promise((resolve, reject) => { + const iv = setInterval(() => { + if (pred()) { + clearInterval(iv) + clearTimeout(to) + resolve() + } + }, 10) + const to = setTimeout(() => { + clearInterval(iv) + reject(new Error('waitFor timed out')) + }, timeoutMs) + }) +} + +function httpGet(url: string): Promise<{ status: number, body: string }> { + return new Promise((resolve, reject) => { + http.get(url, res => { + let body = '' + res.setEncoding('utf-8') + res.on('data', c => { body += c }) + res.on('end', () => resolve({ status: res.statusCode ?? 0, body })) + }).on('error', reject) + }) +} + +let relay: { url: string, close: () => Promise } +beforeAll(async () => { relay = await startRelay(0) }) +afterAll(async () => { await relay.close() }) + +it('serves the host-embedded web-client page over the tunnel', async () => { + const hostTransport = new WebSocketTransport(WS) + let magicLink = '' + hostTransport.onControl(m => { + if (m.t === 'session-created') { + magicLink = m.magicLink + } + }) + // eslint-disable-next-line no-new + new HttpTunnelHandler(hostTransport, () => HTML) + + await hostTransport.connect(relay.url) + hostTransport.sendControl({ t: 'hello', role: 'host', kind: 'desktop' }) + hostTransport.sendControl({ t: 'create-session' }) + await waitFor(() => magicLink !== '') + + const res = await httpGet(magicLink) + expect(res.status).toBe(200) + expect(res.body).toBe(HTML) + + hostTransport.close() +}, 15000) From 8235f9a5f73b545ba77ab917d8f2fa69b5c91b05 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 02:42:15 +0200 Subject: [PATCH 09/75] Stage 4: browser web-client (xterm.js) self-contained build - clients/web: webpack (target web) -> single self-contained dist/index.html (JS + xterm CSS inlined via HtmlInlineScriptPlugin + style-loader). Reuses WebSocketTransport + MirrorController + Utf8Splitter from @peershell/protocol. - reads the magic-link token from /s/ (or ?token=), PIN overlay prompt, term.onData -> input, adopts host size (tmate), UTF-8 splitter before term.write. - MirrorController.join now takes { room | token } so the browser can join by token; desktop still joins by room. Updated call sites/tests. - build:web output is embedded into the plugin (copy-web-asset) for the host to serve. 32/32 tests green; build:all green (web-client embedded, 307 KB). Browser E2E is validated in a real browser; the guest logic is covered by @peershell/protocol tests. --- clients/tabby/src/guest/mirrorSession.ts | 2 +- .../tabby/test/hostGuest.integration.test.ts | 4 +- clients/web/build.mjs | 14 - clients/web/package.json | 18 +- clients/web/src/index.html | 26 +- clients/web/src/index.ts | 104 +++++ clients/web/tsconfig.json | 17 + clients/web/webpack.config.mjs | 44 ++ package-lock.json | 413 +++++++++++++++++- shared/src/mirrorController.ts | 11 +- shared/test/mirrorController.test.ts | 8 +- 11 files changed, 624 insertions(+), 37 deletions(-) delete mode 100644 clients/web/build.mjs create mode 100644 clients/web/src/index.ts create mode 100644 clients/web/tsconfig.json create mode 100644 clients/web/webpack.config.mjs diff --git a/clients/tabby/src/guest/mirrorSession.ts b/clients/tabby/src/guest/mirrorSession.ts index 7115e6c..3cc8067 100644 --- a/clients/tabby/src/guest/mirrorSession.ts +++ b/clients/tabby/src/guest/mirrorSession.ts @@ -40,7 +40,7 @@ export class MirrorSession extends BaseSession { async start(_options?: unknown): Promise { this.open = true - this.controller.join(this.room) + this.controller.join({ room: this.room }) } write(data: Buffer): void { diff --git a/clients/tabby/test/hostGuest.integration.test.ts b/clients/tabby/test/hostGuest.integration.test.ts index 5bcf036..3308a78 100644 --- a/clients/tabby/test/hostGuest.integration.test.ts +++ b/clients/tabby/test/hostGuest.integration.test.ts @@ -70,7 +70,7 @@ it('PIN handshake, then mirrors snapshot + live output host->guest and input gue } const guest = new MirrorController(guestTransport, sink, async () => PIN) const host = new ShareController(hostTransport, hostTerminal(output$, inputs), PIN, { - onSession: ({ room }) => guest.join(room), + onSession: ({ room }) => guest.join({ room }), }) await guestTransport.connect(relay.url) @@ -105,7 +105,7 @@ it('a wrong PIN never streams and ends the guest', async () => { } const guest = new MirrorController(guestTransport, sink, async () => 'wrong-pin') const host = new ShareController(hostTransport, hostTerminal(output$, inputs), PIN, { - onSession: ({ room }) => guest.join(room), + onSession: ({ room }) => guest.join({ room }), }) await guestTransport.connect(relay.url) diff --git a/clients/web/build.mjs b/clients/web/build.mjs deleted file mode 100644 index 9ddd0dc..0000000 --- a/clients/web/build.mjs +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env node -// Stage 0 build: emit a self-contained dist/index.html (placeholder). -// Stage 4 replaces this with a webpack (target 'web') build that inlines xterm.js + the transport. -import * as fs from 'fs' -import * as path from 'path' -import * as url from 'url' - -const dir = path.resolve(url.fileURLToPath(new URL('.', import.meta.url))) -const src = path.join(dir, 'src', 'index.html') -const outDir = path.join(dir, 'dist') - -fs.mkdirSync(outDir, { recursive: true }) -fs.copyFileSync(src, path.join(outDir, 'index.html')) -console.log('[web-client] wrote dist/index.html (Stage 0 placeholder)') diff --git a/clients/web/package.json b/clients/web/package.json index 7b0e1a5..9b2e529 100644 --- a/clients/web/package.json +++ b/clients/web/package.json @@ -5,10 +5,22 @@ "description": "peershell standalone browser client (xterm.js) — served by the host over the tunnel", "license": "Apache-2.0", "scripts": { - "build": "node build.mjs", - "test": "echo \"(web-client: implemented in Stage 4)\"" + "build": "webpack --config ./webpack.config.mjs", + "test": "echo \"(web-client: browser E2E; logic covered by @peershell/protocol tests)\"" }, "dependencies": { - "@peershell/protocol": "*" + "@peershell/protocol": "*", + "@xterm/addon-fit": "^0.10.0", + "@xterm/xterm": "^5.5.0" + }, + "devDependencies": { + "css-loader": "^6.11.0", + "html-inline-script-webpack-plugin": "^3.2.1", + "html-webpack-plugin": "^5.6.7", + "style-loader": "^3.3.4", + "ts-loader": "^9.6.2", + "typescript": "^4.9.5", + "webpack": "^5.108.4", + "webpack-cli": "^5.1.4" } } diff --git a/clients/web/src/index.html b/clients/web/src/index.html index 2a0fff3..dc325d5 100644 --- a/clients/web/src/index.html +++ b/clients/web/src/index.html @@ -4,13 +4,27 @@ peershell + - -

-

peershell

-

Web client placeholder — not yet implemented (Stage 4).

-
+
+
connecting…
+ diff --git a/clients/web/src/index.ts b/clients/web/src/index.ts new file mode 100644 index 0000000..a8a1413 --- /dev/null +++ b/clients/web/src/index.ts @@ -0,0 +1,104 @@ +import { Terminal } from '@xterm/xterm' +import { FitAddon } from '@xterm/addon-fit' +import '@xterm/xterm/css/xterm.css' +import { + WebSocketTransport, MirrorController, MirrorSink, Utf8Splitter, PinProvider, +} from '@peershell/protocol' + +const el = (id: string): HTMLElement => document.getElementById(id) as HTMLElement +const setStatus = (s: string): void => { el('status').textContent = s } + +/** Token from the magic-link path (/s/) or ?token= query. */ +function getToken(): string | null { + const m = /\/s\/([^/?#]+)/.exec(location.pathname) + if (m) { + return decodeURIComponent(m[1]) + } + return new URLSearchParams(location.search).get('token') +} + +function wsUrl(): string { + const proto = location.protocol === 'https:' ? 'wss:' : 'ws:' + return `${proto}//${location.host}` +} + +/** PIN overlay -> resolves the entered PIN (or null if cancelled). */ +function askPin(): Promise { + return new Promise(resolve => { + const overlay = el('overlay') + const input = el('overlay-input') as HTMLInputElement + const ok = el('overlay-ok') + overlay.classList.remove('hidden') + input.value = '' + input.focus() + const done = (value: string | null): void => { + overlay.classList.add('hidden') + ok.removeEventListener('click', onOk) + input.removeEventListener('keydown', onKey) + resolve(value) + } + const onOk = (): void => done(input.value.trim() || null) + const onKey = (e: KeyboardEvent): void => { + if (e.key === 'Enter') { + onOk() + } else if (e.key === 'Escape') { + done(null) + } + } + ok.addEventListener('click', onOk) + input.addEventListener('keydown', onKey) + }) +} + +async function main(): Promise { + const token = getToken() + if (!token) { + setStatus('Missing session token in the URL.') + return + } + + const term = new Terminal({ + cursorBlink: true, + fontFamily: 'ui-monospace, SFMono-Regular, Menlo, monospace', + theme: { background: '#000000' }, + }) + const fit = new FitAddon() + term.loadAddon(fit) + term.open(el('terminal')) + fit.fit() + + const splitter = new Utf8Splitter() + const encoder = new TextEncoder() + const transport = new WebSocketTransport() // browser global WebSocket + + const sink: MirrorSink = { + // Reassemble multibyte UTF-8 split across frames before writing to xterm. + emit: data => term.write(splitter.write(data)), + // Adopt the host's size (tmate model); the browser window does not drive the size. + hostResize: (cols, rows) => term.resize(cols, rows), + ended: reason => { + term.write(`\r\n[peershell] ${reason}\r\n`) + setStatus(reason) + }, + } + const pinProvider: PinProvider = () => askPin() + const controller = new MirrorController(transport, sink, pinProvider) + + term.onData(d => controller.writeInput(encoder.encode(d))) + transport.onState(s => { + if (s === 'closed') { + setStatus('disconnected') + } + }) + + try { + await transport.connect(wsUrl(), token) + } catch { + setStatus('Could not connect to the server.') + return + } + setStatus('') + controller.join({ token, kind: 'web' }) +} + +void main().catch(err => setStatus(`error: ${String(err)}`)) diff --git a/clients/web/tsconfig.json b/clients/web/tsconfig.json new file mode 100644 index 0000000..ecfaf3f --- /dev/null +++ b/clients/web/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2019", + "module": "ESNext", + "moduleResolution": "node", + "lib": ["DOM", "ES2020"], + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "forceConsistentCasingInFileNames": true, + "baseUrl": ".", + "paths": { + "@peershell/protocol": ["../../shared/src"] + } + }, + "include": ["src"] +} diff --git a/clients/web/webpack.config.mjs b/clients/web/webpack.config.mjs new file mode 100644 index 0000000..435f0b8 --- /dev/null +++ b/clients/web/webpack.config.mjs @@ -0,0 +1,44 @@ +// Builds the browser web-client into a single self-contained dist/index.html (JS + CSS inlined), +// which the host embeds and serves over the reverse tunnel. Reuses @peershell/protocol from source. +import * as path from 'path' +import * as url from 'url' +import HtmlWebpackPlugin from 'html-webpack-plugin' +import HtmlInlineScriptPlugin from 'html-inline-script-webpack-plugin' + +const __dirname = url.fileURLToPath(new URL('.', import.meta.url)) + +export default () => ({ + target: 'web', + mode: 'production', + entry: path.resolve(__dirname, 'src/index.ts'), + output: { + path: path.resolve(__dirname, 'dist'), + filename: 'bundle.js', + }, + resolve: { + extensions: ['.ts', '.js'], + alias: { + '@peershell/protocol': path.resolve(__dirname, '../../shared/src/index.ts'), + }, + }, + module: { + rules: [ + { + test: /\.ts$/, + use: { + loader: 'ts-loader', + options: { configFile: path.resolve(__dirname, 'tsconfig.json') }, + }, + }, + { test: /\.css$/, use: ['style-loader', 'css-loader'] }, + ], + }, + plugins: [ + new HtmlWebpackPlugin({ + template: path.resolve(__dirname, 'src/index.html'), + inject: 'body', + minify: false, + }), + new HtmlInlineScriptPlugin(), + ], +}) diff --git a/package-lock.json b/package-lock.json index a716749..8a1066e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -74,7 +74,19 @@ "version": "0.1.0", "license": "Apache-2.0", "dependencies": { - "@peershell/protocol": "*" + "@peershell/protocol": "*", + "@xterm/addon-fit": "^0.10.0", + "@xterm/xterm": "^5.5.0" + }, + "devDependencies": { + "css-loader": "^6.11.0", + "html-inline-script-webpack-plugin": "^3.2.1", + "html-webpack-plugin": "^5.6.7", + "style-loader": "^3.3.4", + "ts-loader": "^9.6.2", + "typescript": "^4.9.5", + "webpack": "^5.108.4", + "webpack-cli": "^5.1.4" } }, "node_modules/@ampproject/remapping": { @@ -1767,6 +1779,12 @@ "@types/node": "*" } }, + "node_modules/@types/html-minifier-terser": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", + "integrity": "sha512-oh/6byDPnL1zeNXFrDXFLyZjkr1MsBG667IM792caf1L2UPOOMf65NFzjUH/ltyfwjAGfs1rsX1eftK0jC/KIg==", + "dev": true + }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", @@ -2033,6 +2051,19 @@ } } }, + "node_modules/@xterm/addon-fit": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.10.0.tgz", + "integrity": "sha512-UFYkDm4HUahf2lnEyHvio51TNGiLK66mqP2JoATy7hRZeXaGMRDr00JiSF7m63vR5WKATF605yEggJKsw0JpMQ==", + "peerDependencies": { + "@xterm/xterm": "^5.0.0" + } + }, + "node_modules/@xterm/xterm": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz", + "integrity": "sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==" + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -2421,6 +2452,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "dev": true + }, "node_modules/brace-expansion": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", @@ -2540,6 +2577,16 @@ "node": ">=6" } }, + "node_modules/camel-case": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/camel-case/-/camel-case-4.1.2.tgz", + "integrity": "sha512-gxGWBrTT1JuMx6R+o5PTXMmUnhnVzLQ9SNutD4YqKtI6ap897t3tKECYla6gCWEkplXnlNybEkZg9GEGxKFCgw==", + "dev": true, + "dependencies": { + "pascal-case": "^3.1.2", + "tslib": "^2.0.3" + } + }, "node_modules/camelcase": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", @@ -2876,6 +2923,34 @@ } } }, + "node_modules/css-select": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-4.3.0.tgz", + "integrity": "sha512-wPpOYtnsVontu2mODhA19JrqWxNsfdatRKd64kmpRbQgh1KtItko5sTnEpPdpSaJszTOhEMlF/RPz28qj4HqhQ==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.0.1", + "domhandler": "^4.3.1", + "domutils": "^2.8.0", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.2.2.tgz", + "integrity": "sha512-u/O3vwbptzhMs3L1fQE82ZSLHQQfto5gyZzwteVIEyeaY5Fc7R4dapF/BvRoSYFeqfBk4m0V1Vafq5Pjv25wvA==", + "dev": true, + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -2980,6 +3055,80 @@ "dev": true, "peer": true }, + "node_modules/dom-converter": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/dom-converter/-/dom-converter-0.2.0.tgz", + "integrity": "sha512-gd3ypIPfOMr9h5jIKq8E3sHOTCjeirnl0WK5ZdS1AW0Odt0b1PaWaHdJ4Qk4klv+YB9aJBS7mESXjFoDQPu6DA==", + "dev": true, + "dependencies": { + "utila": "~0.4" + } + }, + "node_modules/dom-serializer": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.4.1.tgz", + "integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==", + "dev": true, + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.2.0", + "entities": "^2.0.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ] + }, + "node_modules/domhandler": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.1.tgz", + "integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==", + "dev": true, + "dependencies": { + "domelementtype": "^2.2.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", + "dev": true, + "dependencies": { + "dom-serializer": "^1.0.1", + "domelementtype": "^2.2.0", + "domhandler": "^4.2.0" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dot-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", + "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", + "dev": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, "node_modules/dunder-proto": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", @@ -3039,6 +3188,15 @@ "node": ">=10.13.0" } }, + "node_modules/entities": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", + "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==", + "dev": true, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/envinfo": { "version": "7.21.0", "resolved": "https://registry.npmjs.org/envinfo/-/envinfo-7.21.0.tgz", @@ -3579,12 +3737,128 @@ "node": ">= 0.4" } }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "bin": { + "he": "bin/he" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, + "node_modules/html-inline-script-webpack-plugin": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/html-inline-script-webpack-plugin/-/html-inline-script-webpack-plugin-3.2.1.tgz", + "integrity": "sha512-PEj9Ve31BE0dva6eTD6wHMOztgIdPxF6gx3wad7ohBkCn7MXpuUvPC9t5ThMJ2NrVi1jWGBYU76DfoS+8dabRw==", + "dev": true, + "engines": { + "node": ">=14.0.0", + "npm": ">=6.0.0" + }, + "peerDependencies": { + "html-webpack-plugin": "^5.0.0", + "webpack": "^5.0.0" + } + }, + "node_modules/html-minifier-terser": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", + "integrity": "sha512-YXxSlJBZTP7RS3tWnQw74ooKa6L9b9i9QYXY21eUEvhZ3u9XLfv6OnFsQq6RxkhHygsaUMvYsZRV5rU/OVNZxw==", + "dev": true, + "dependencies": { + "camel-case": "^4.1.2", + "clean-css": "^5.2.2", + "commander": "^8.3.0", + "he": "^1.2.0", + "param-case": "^3.0.4", + "relateurl": "^0.2.7", + "terser": "^5.10.0" + }, + "bin": { + "html-minifier-terser": "cli.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/html-minifier-terser/node_modules/clean-css": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-5.3.3.tgz", + "integrity": "sha512-D5J+kHaVb/wKSFcyyV75uCn8fiY4sV38XJoe4CUyGQ+mOU/fMVYUdH1hJC+CJQ5uY3EnW27SbJYS4X8BiLrAFg==", + "dev": true, + "dependencies": { + "source-map": "~0.6.0" + }, + "engines": { + "node": ">= 10.0" + } + }, + "node_modules/html-minifier-terser/node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/html-webpack-plugin": { + "version": "5.6.7", + "resolved": "https://registry.npmjs.org/html-webpack-plugin/-/html-webpack-plugin-5.6.7.tgz", + "integrity": "sha512-md+vXtdCAe60s1k6AU3dUyMJnDxUyQAwfwPKoLisvgUF1IXjtlLsk2se54+qfL9Mdm26bbwvjJybpNx48NKRLw==", + "dev": true, + "dependencies": { + "@types/html-minifier-terser": "^6.0.0", + "html-minifier-terser": "^6.0.2", + "lodash": "^4.17.21", + "pretty-error": "^4.0.0", + "tapable": "^2.0.0" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/html-webpack-plugin" + }, + "peerDependencies": { + "@rspack/core": "0.x || 1.x", + "webpack": "^5.20.0" + }, + "peerDependenciesMeta": { + "@rspack/core": { + "optional": true + }, + "webpack": { + "optional": true + } + } + }, + "node_modules/htmlparser2": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", + "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", + "dev": true, + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "dependencies": { + "domelementtype": "^2.0.1", + "domhandler": "^4.0.0", + "domutils": "^2.5.2", + "entities": "^2.0.0" + } + }, "node_modules/human-signals": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", @@ -4909,8 +5183,7 @@ "version": "4.18.1", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.18.1.tgz", "integrity": "sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==", - "dev": true, - "peer": true + "dev": true }, "node_modules/lodash.memoize": { "version": "4.1.2", @@ -4928,6 +5201,15 @@ "node": ">=0.10.0" } }, + "node_modules/lower-case": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", + "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", + "dev": true, + "dependencies": { + "tslib": "^2.0.3" + } + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -5154,6 +5436,16 @@ "@angular/platform-browser": ">=14.0.0-0" } }, + "node_modules/no-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", + "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", + "dev": true, + "dependencies": { + "lower-case": "^2.0.2", + "tslib": "^2.0.3" + } + }, "node_modules/node-addon-api": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", @@ -5195,6 +5487,18 @@ "node": ">=8" } }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "dev": true, + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -5266,6 +5570,16 @@ "node": ">=6" } }, + "node_modules/param-case": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/param-case/-/param-case-3.0.4.tgz", + "integrity": "sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==", + "dev": true, + "dependencies": { + "dot-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -5284,6 +5598,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/pascal-case": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pascal-case/-/pascal-case-3.1.2.tgz", + "integrity": "sha512-uWlGT3YSnK9x3BQJaOdcZwrnV6hPpd8jFH1/ucpiLRPh/2zCVJKS19E4GvYHvaCcACn3foXZ0cLB9Wrx1KGe5g==", + "dev": true, + "dependencies": { + "no-case": "^3.0.4", + "tslib": "^2.0.3" + } + }, "node_modules/path-exists": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-5.0.0.tgz", @@ -5463,6 +5787,16 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, + "node_modules/pretty-error": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", + "integrity": "sha512-AoJ5YMAcXKYxKhuJGdcvse+Voc6v1RgnsR3nWcYU7q4t6z0Q6T86sv5Zq8VIRbOWWFpvdGE83LtdSMNd+6Y0xw==", + "dev": true, + "dependencies": { + "lodash": "^4.17.20", + "renderkid": "^3.0.0" + } + }, "node_modules/pretty-format": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-29.7.0.tgz", @@ -5720,6 +6054,28 @@ "dev": true, "peer": true }, + "node_modules/relateurl": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/relateurl/-/relateurl-0.2.7.tgz", + "integrity": "sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/renderkid": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/renderkid/-/renderkid-3.0.0.tgz", + "integrity": "sha512-q/7VIQA8lmM1hF+jn+sFSPWGlMkSAeNYcPLmDQx2zzuiDfaLrOmumR8iaUKlenFgh0XRPIUeSPlH3A+AW3Z5pg==", + "dev": true, + "dependencies": { + "css-select": "^4.1.3", + "dom-converter": "^0.2.0", + "htmlparser2": "^6.1.0", + "lodash": "^4.17.21", + "strip-ansi": "^6.0.1" + } + }, "node_modules/repeat-string": { "version": "1.6.1", "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", @@ -6437,6 +6793,51 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/ts-loader": { + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.6.2.tgz", + "integrity": "sha512-R4iuczmtgxvtuI556s+hTZ6/7Ee03VCAk/l/M8LY1OAsUgB7YydsCxkgq9D9pKRaD7GJqUi2u8fp9zZP/ufjKA==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "picomatch": "^4.0.0", + "source-map": "^0.7.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "loader-utils": "*", + "typescript": "*", + "webpack": "^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "loader-utils": { + "optional": true + } + } + }, + "node_modules/ts-loader/node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "dev": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/ts-loader/node_modules/source-map": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.6.tgz", + "integrity": "sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==", + "dev": true, + "engines": { + "node": ">= 12" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -6573,6 +6974,12 @@ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", "dev": true }, + "node_modules/utila": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/utila/-/utila-0.4.0.tgz", + "integrity": "sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==", + "dev": true + }, "node_modules/v8-to-istanbul": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz", diff --git a/shared/src/mirrorController.ts b/shared/src/mirrorController.ts index 4778429..c17d507 100644 --- a/shared/src/mirrorController.ts +++ b/shared/src/mirrorController.ts @@ -38,12 +38,15 @@ export class MirrorController { }) } - /** Announce as a guest and join the room. Handlers are wired in the ctor so no frame is missed. */ - join(room: string, opts: { name?: string, kind?: ClientKind } = {}): void { + /** + * Announce as a guest and join, either by `room` code (Tabby desktop) or opaque `token` + * (browser magic-link). Handlers are wired in the ctor so no frame is missed. + */ + join(target: { room?: string, token?: string, name?: string, kind?: ClientKind }): void { this.transport.sendControl({ - t: 'hello', role: 'guest', kind: opts.kind ?? 'desktop', client: 'peershell', + t: 'hello', role: 'guest', kind: target.kind ?? 'desktop', client: 'peershell', }) - this.transport.sendControl({ t: 'join', room, name: opts.name }) + this.transport.sendControl({ t: 'join', room: target.room, token: target.token, name: target.name }) } private onControl(m: ControlMessage): void { diff --git a/shared/test/mirrorController.test.ts b/shared/test/mirrorController.test.ts index 002f69d..d4717f8 100644 --- a/shared/test/mirrorController.test.ts +++ b/shared/test/mirrorController.test.ts @@ -76,7 +76,7 @@ it('answers the PIN challenge with H(pin, nonce)', async () => { const t = new MockTransport() const s = mockSink() const c = new MirrorController(t, s.sink, async () => '424242') - c.join('ABC234') + c.join({ room: 'ABC234' }) expect(t.controlTypes()).toEqual(['hello', 'join']) t.emitControl({ t: 'pin-challenge', nonce: 'nonce-xyz' }) @@ -88,7 +88,7 @@ it('renders + acks the snapshot, renders output, forwards input', () => { const t = new MockTransport() const s = mockSink() const c = new MirrorController(t, s.sink, noPin) - c.join('ABC234') + c.join({ room: 'ABC234' }) t.emitControl({ t: 'snapshot', cols: 100, rows: 30, data: utf8ToBase64('SNAP') }) expect(dec(s.emits[0])).toBe('SNAP') @@ -107,7 +107,7 @@ it('ends on pin-fail with no attempts left, but not while attempts remain', () = const t = new MockTransport() const s = mockSink() const c = new MirrorController(t, s.sink, noPin) - c.join('ABC234') + c.join({ room: 'ABC234' }) t.emitControl({ t: 'pin-fail', left: 3 }) expect(s.getEnded()).toBeNull() @@ -120,7 +120,7 @@ it('surfaces a host resize and ends on peer-left (once)', () => { const t = new MockTransport() const s = mockSink() const c = new MirrorController(t, s.sink, noPin) - c.join('ABC234') + c.join({ room: 'ABC234' }) t.emitControl({ t: 'resize', cols: 132, rows: 43 }) expect(s.resizes.at(-1)).toEqual({ cols: 132, rows: 43 }) From bc9a80a2511fb4c25e51120d0717c2c54a5bf170 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 02:43:45 +0200 Subject: [PATCH 10/75] Stage 4: host serves the embedded web-client over the tunnel - PeershellService.startSharing attaches an HttpTunnelHandler to the host transport, serving the embedded web-client.html (asset/source import) on tunneled http-get. - shim: declare '*.html' module for the asset import. build:all green (plugin bundle embeds the 307 KB web-client); smoke-load PASS. --- clients/tabby/src/services/peershell.service.ts | 9 ++++++++- clients/tabby/src/types/tabby.d.ts | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index ffffa99..10af8fb 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -3,10 +3,13 @@ import { map } from 'rxjs' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { AppService, ConfigService, NotificationsService, BaseTabComponent, PromptModalComponent } from 'tabby-core' import { BaseTerminalTabComponent, ResizeEvent } from 'tabby-terminal' -import { WebSocketTransport, normalizeRoomCode, isValidRoomCode, generatePin, PinProvider } from '@peershell/protocol' +import { + WebSocketTransport, normalizeRoomCode, isValidRoomCode, generatePin, PinProvider, HttpTunnelHandler, +} from '@peershell/protocol' import { ShareController, HostTerminal } from '../host/shareController' import { MirrorTabComponent } from '../guest/mirrorTab.component' +import webClientHtml from '../../assets/web-client.html' /** Owns the active host shares and adapts a Tabby terminal tab to the transport-driven controller. */ @Injectable({ providedIn: 'root' }) @@ -47,6 +50,10 @@ export class PeershellService { // cleartext (challenge-response only). The host shares it with the intended guest out-of-band. const pin = generatePin(6) const transport = new WebSocketTransport() + // Serve the embedded web-client to browsers opening the magic-link, tunneled over this same + // outbound connection. Path is whitelisted inside HttpTunnelHandler (only '/'). + // eslint-disable-next-line no-new + new HttpTunnelHandler(transport, () => webClientHtml) const controller = new ShareController(transport, this.adapt(tab), pin, { onSession: h => this.notifications.info(`peershell: sharing — PIN ${pin}`, h.magicLink), onAuthenticated: () => this.notifications.notice('peershell: guest connected'), diff --git a/clients/tabby/src/types/tabby.d.ts b/clients/tabby/src/types/tabby.d.ts index e6c0fcd..cabcae3 100644 --- a/clients/tabby/src/types/tabby.d.ts +++ b/clients/tabby/src/types/tabby.d.ts @@ -4,6 +4,11 @@ * implementations are provided by Tabby at runtime (these modules are webpack externals). * Extend these declarations as later stages use more of the Tabby API. */ +declare module '*.html' { + const content: string + export default content +} + declare module 'tabby-core' { import { Observable } from 'rxjs' From aa51d85e3b09e07d82f6230cc23f3b51720fc2e0 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 13:25:14 +0200 Subject: [PATCH 11/75] Stage 5a: productionize relay into @peershell/server - server/src/index.cjs (was dev-relay.cjs): rendezvous + blind relay + reverse HTTP tunnel, now with magic-link TTL (15m, link-expired on join / 410 on GET), env config (PORT/BIND/PUBLIC_URL/TOKEN_TTL_MS), GET /health, keepalive (pong reply + idle reaper), host-close tears down the session while guest-close frees the slot for a retry. - env-driven standalone runner + startup log. - repoint the three integration tests to server/src/index.cjs; server/package.json (start=node src/index.cjs, dep ws). 32/32 tests green (integration tests run against the productionized server). --- .../tabby/test/hostGuest.integration.test.ts | 2 +- server/dev-relay.cjs | 192 ------------- server/package.json | 10 +- server/src/index.cjs | 263 ++++++++++++++++++ shared/test/transport.integration.test.ts | 2 +- shared/test/tunnel.integration.test.ts | 2 +- 6 files changed, 272 insertions(+), 199 deletions(-) delete mode 100644 server/dev-relay.cjs create mode 100644 server/src/index.cjs diff --git a/clients/tabby/test/hostGuest.integration.test.ts b/clients/tabby/test/hostGuest.integration.test.ts index 3308a78..838377b 100644 --- a/clients/tabby/test/hostGuest.integration.test.ts +++ b/clients/tabby/test/hostGuest.integration.test.ts @@ -9,7 +9,7 @@ import { WebSocketTransport, WebSocketCtor, MirrorController, MirrorSink } from import { ShareController, HostTerminal } from '../src/host/shareController' // eslint-disable-next-line @typescript-eslint/no-var-requires -const { startRelay } = require('../../../server/dev-relay.cjs') as { +const { startRelay } = require('../../../server/src/index.cjs') as { startRelay: (port?: number) => Promise<{ url: string, close: () => Promise }> } diff --git a/server/dev-relay.cjs b/server/dev-relay.cjs deleted file mode 100644 index 9e32d64..0000000 --- a/server/dev-relay.cjs +++ /dev/null @@ -1,192 +0,0 @@ -/** - * Throwaway dev rendezvous + blind relay (precursor of the real @peershell/server, Stage 5). - * Pairs one host + one guest by room/token, then forwards EVERY frame (text control + binary) - * verbatim between them. No auth, no TLS, no HTTP tunnel yet — just enough to exercise the wire. - * - * const { startRelay } = require('./dev-relay.cjs') - * const relay = await startRelay(0) // ephemeral port -> { port, url, close } - * - * Or run standalone: node server/dev-relay.cjs (PORT env, default 8787) - */ -const http = require('http') -const crypto = require('crypto') -const { WebSocketServer } = require('ws') - -const CODE_ALPHABET = '23456789ABCDEFGHJKMNPQRSTUVWXYZ' - -function genCode(n = 6) { - const bytes = crypto.randomBytes(n) - let out = '' - for (let i = 0; i < n; i++) { - out += CODE_ALPHABET[bytes[i] % CODE_ALPHABET.length] - } - return out -} - -const genToken = () => crypto.randomBytes(18).toString('base64url') - -function startRelay(port = 0) { - return new Promise(resolve => { - let boundPort = port - const rooms = new Map() // room -> { host, guest } - const tokens = new Map() // token -> room - const pendingHttp = new Map() // reqId -> http res (browser waiting for the tunneled page) - - function resolveHttp(msg) { - const res = pendingHttp.get(msg.reqId) - if (res) { - pendingHttp.delete(msg.reqId) - res.writeHead(msg.status || 200, msg.headers || {}) - res.end(Buffer.from(msg.bodyBase64 || '', 'base64')) - } - } - - // Reverse HTTP tunnel: GET /s/ is forwarded to the host as an http-get frame; the - // host answers with http-response (intercepted below) which we return to the browser. - const server = http.createServer((req, res) => { - const m = /^\/s\/([^/?#]+)/.exec(req.url || '') - if (!m) { - res.writeHead(200, { 'content-type': 'text/plain' }) - res.end('peershell dev relay\n') - return - } - const room = tokens.get(m[1]) - const entry = room && rooms.get(room) - if (!entry || !entry.host) { - res.writeHead(404) - res.end('unknown session') - return - } - const reqId = crypto.randomBytes(6).toString('hex') - pendingHttp.set(reqId, res) - entry.host.send(JSON.stringify({ v: 1, t: 'http-get', peerId: 0, reqId, path: '/' })) - const to = setTimeout(() => { - if (pendingHttp.has(reqId)) { - pendingHttp.delete(reqId) - res.writeHead(504) - res.end('tunnel timeout') - } - }, 5000) - if (typeof to.unref === 'function') { - to.unref() - } - }) - const wss = new WebSocketServer({ server }) - - function safeSend(sock, data, binary) { - if (sock && sock.readyState === sock.OPEN) { - sock.send(data, { binary: !!binary }) - } - } - - wss.on('connection', sock => { - sock._role = null - sock._room = null - sock._peer = null - - sock.on('message', (data, isBinary) => { - if (isBinary) { - if (sock._peer) { - safeSend(sock._peer, data, true) - } - return - } - const text = data.toString() - let msg = null - try { - msg = JSON.parse(text) - } catch { - /* ignore non-JSON text */ - } - // http-response is relay-directed (answers a tunneled page request), never forwarded. - if (msg && msg.t === 'http-response') { - resolveHttp(msg) - return - } - // Once paired, the relay is blind: forward everything else to the peer. - if (sock._peer) { - safeSend(sock._peer, text, false) - return - } - if (msg) { - handleSignal(sock, msg) - } - }) - - sock.on('close', () => { - const room = sock._room - if (room && rooms.has(room)) { - const entry = rooms.get(room) - const other = entry.host === sock ? entry.guest : entry.host - safeSend(other, JSON.stringify({ v: 1, t: 'peer-left', reason: 'socket-closed' }), false) - rooms.delete(room) - for (const [tok, r] of tokens) { - if (r === room) { - tokens.delete(tok) - } - } - } - }) - }) - - function handleSignal(sock, msg) { - switch (msg.t) { - case 'hello': - sock._role = msg.role - sock._kind = msg.kind || 'desktop' - break - case 'create-session': { - const room = genCode() - const token = genToken() - rooms.set(room, { host: sock, guest: null }) - tokens.set(token, room) - sock._room = room - const magicLink = `http://127.0.0.1:${boundPort}/s/${token}` - safeSend(sock, JSON.stringify({ v: 1, t: 'session-created', room, magicLink }), false) - break - } - case 'join': { - const room = msg.room ? String(msg.room).toUpperCase() : tokens.get(msg.token) - const entry = room && rooms.get(room) - if (!entry) { - safeSend(sock, JSON.stringify({ v: 1, t: 'error', code: 'no-such-room' }), false) - return - } - if (entry.guest) { - safeSend(sock, JSON.stringify({ v: 1, t: 'error', code: 'session-busy' }), false) - return - } - entry.guest = sock - sock._room = room - sock._peer = entry.host - entry.host._peer = sock - safeSend(entry.host, JSON.stringify({ v: 1, t: 'peer-joined', peerId: 0, kind: sock._kind }), false) - break - } - default: - break - } - } - - server.listen(port, '127.0.0.1', () => { - boundPort = server.address().port - resolve({ - port: boundPort, - url: `ws://127.0.0.1:${boundPort}`, - close: () => new Promise(res => { - for (const c of wss.clients) { - try { c.terminate() } catch { /* ignore */ } - } - wss.close(() => server.close(() => res())) - }), - }) - }) - }) -} - -module.exports = { startRelay } - -if (require.main === module) { - const port = Number(process.env.PORT || 8787) - startRelay(port).then(r => console.log(`[dev-relay] listening on ${r.url}`)) -} diff --git a/server/package.json b/server/package.json index e696fd9..c39b10a 100644 --- a/server/package.json +++ b/server/package.json @@ -2,13 +2,15 @@ "name": "@peershell/server", "version": "0.1.0", "private": true, - "description": "peershell rendezvous + relay + reverse-tunnel + accounts (implemented in Stage 5)", + "description": "peershell rendezvous + blind relay + reverse HTTP tunnel (MVP; accounts/dashboard in Stage 6)", "license": "Apache-2.0", + "main": "src/index.cjs", "scripts": { - "build": "echo \"(server: implemented in Stage 5)\"", - "test": "echo \"(server: implemented in Stage 5)\"" + "start": "node src/index.cjs", + "build": "echo \"(server: plain CJS, no build step)\"", + "test": "echo \"(server: covered by shared/ + clients/tabby integration tests)\"" }, "dependencies": { - "@peershell/protocol": "*" + "ws": "^8.18.0" } } diff --git a/server/src/index.cjs b/server/src/index.cjs new file mode 100644 index 0000000..8d554fc --- /dev/null +++ b/server/src/index.cjs @@ -0,0 +1,263 @@ +/** + * @peershell/server (MVP) — rendezvous + blind relay + reverse HTTP tunnel. + * + * Pairs one host + one guest by room-code or magic-link token, then forwards every frame (control + * text + binary terminal data) verbatim between them. Serves the host-embedded web-client to browsers + * that open the magic-link (GET /s/ -> http-get tunneled to the host -> http-response). + * + * MVP scope: no accounts/dashboard yet (Stage 6), no TLS (put cloudflared / a TLS reverse proxy in + * front for public use). The PIN (validated peer-to-peer) and the magic-link TTL are the guards. + * + * Library: const { startRelay } = require('./index.cjs'); const s = await startRelay(0) + * Standalone: node server/src/index.cjs (env: PORT, BIND, PUBLIC_URL, TOKEN_TTL_MS) + */ +const http = require('http') +const crypto = require('crypto') +const { WebSocketServer } = require('ws') + +const CODE_ALPHABET = '23456789ABCDEFGHJKMNPQRSTUVWXYZ' +const DEFAULT_TOKEN_TTL_MS = 15 * 60 * 1000 +const IDLE_TIMEOUT_MS = 90 * 1000 + +function genCode(n = 6) { + const bytes = crypto.randomBytes(n) + let out = '' + for (let i = 0; i < n; i++) { + out += CODE_ALPHABET[bytes[i] % CODE_ALPHABET.length] + } + return out +} + +const genToken = () => crypto.randomBytes(18).toString('base64url') +const j = obj => JSON.stringify({ v: 1, ...obj }) + +/** + * @param {number} port + * @param {{ host?: string, publicUrl?: string, tokenTtlMs?: number }} [opts] + */ +function startRelay(port = 0, opts = {}) { + return new Promise(resolve => { + const bindHost = opts.host || '127.0.0.1' + const tokenTtlMs = opts.tokenTtlMs || DEFAULT_TOKEN_TTL_MS + let boundPort = port + let publicUrl = opts.publicUrl || '' + + const rooms = new Map() // room -> { host, guest } + const tokens = new Map() // token -> { room, expiresAt } + const pendingHttp = new Map() // reqId -> http res + + const now = () => Date.now() + + function tokenRoom(token) { + const rec = tokens.get(token) + if (!rec) { + return null + } + if (rec.expiresAt < now()) { + tokens.delete(token) + return null + } + return rec.room + } + + function dropRoom(room) { + rooms.delete(room) + for (const [tok, rec] of tokens) { + if (rec.room === room) { + tokens.delete(tok) + } + } + } + + function safeSend(sock, data, binary) { + if (sock && sock.readyState === sock.OPEN) { + sock.send(data, { binary: !!binary }) + } + } + + function resolveHttp(msg) { + const res = pendingHttp.get(msg.reqId) + if (res) { + pendingHttp.delete(msg.reqId) + res.writeHead(msg.status || 200, msg.headers || {}) + res.end(Buffer.from(msg.bodyBase64 || '', 'base64')) + } + } + + const server = http.createServer((req, res) => { + if (req.url === '/health') { + res.writeHead(200, { 'content-type': 'application/json' }) + res.end(JSON.stringify({ ok: true, sessions: rooms.size })) + return + } + const m = /^\/s\/([^/?#]+)/.exec(req.url || '') + if (!m) { + res.writeHead(200, { 'content-type': 'text/plain' }) + res.end('peershell server\n') + return + } + const room = tokenRoom(m[1]) + const entry = room && rooms.get(room) + if (!entry || !entry.host) { + res.writeHead(410, { 'content-type': 'text/plain' }) + res.end('link expired or unknown session') + return + } + const reqId = crypto.randomBytes(6).toString('hex') + pendingHttp.set(reqId, res) + safeSend(entry.host, j({ t: 'http-get', peerId: 0, reqId, path: '/' }), false) + const to = setTimeout(() => { + if (pendingHttp.has(reqId)) { + pendingHttp.delete(reqId) + res.writeHead(504) + res.end('tunnel timeout') + } + }, 5000) + if (typeof to.unref === 'function') { + to.unref() + } + }) + + const wss = new WebSocketServer({ server }) + + wss.on('connection', sock => { + sock._room = null + sock._peer = null + sock._kind = 'desktop' + sock._lastSeen = now() + + sock.on('message', (data, isBinary) => { + sock._lastSeen = now() + if (isBinary) { + if (sock._peer) { + safeSend(sock._peer, data, true) + } + return + } + const text = data.toString() + let msg = null + try { + msg = JSON.parse(text) + } catch { + /* ignore non-JSON text */ + } + // Keepalive + relay-directed frames are handled here, never forwarded. + if (msg && msg.t === 'ping') { + safeSend(sock, j({ t: 'pong' }), false) + return + } + if (msg && msg.t === 'pong') { + return + } + if (msg && msg.t === 'http-response') { + resolveHttp(msg) + return + } + if (sock._peer) { + safeSend(sock._peer, text, false) + return + } + if (msg) { + handleSignal(sock, msg) + } + }) + + sock.on('close', () => { + const room = sock._room + if (room && rooms.has(room)) { + const entry = rooms.get(room) + const other = entry.host === sock ? entry.guest : entry.host + safeSend(other, j({ t: 'peer-left', reason: 'socket-closed' }), false) + if (entry.host === sock) { + dropRoom(room) // host gone: tear the session down + } else { + entry.guest = null + entry.host._peer = null // free the guest slot for a retry within TTL + } + } + }) + }) + + function handleSignal(sock, msg) { + switch (msg.t) { + case 'hello': + sock._kind = msg.kind || 'desktop' + break + case 'create-session': { + const room = genCode() + const token = genToken() + rooms.set(room, { host: sock, guest: null }) + tokens.set(token, { room, expiresAt: now() + tokenTtlMs }) + sock._room = room + const base = publicUrl || `http://127.0.0.1:${boundPort}` + safeSend(sock, j({ t: 'session-created', room, magicLink: `${base}/s/${token}` }), false) + break + } + case 'join': { + const room = msg.room ? String(msg.room).toUpperCase() : (msg.token ? tokenRoom(msg.token) : null) + const entry = room && rooms.get(room) + if (!entry) { + safeSend(sock, j({ t: 'error', code: msg.token ? 'link-expired' : 'no-such-room' }), false) + return + } + if (entry.guest) { + safeSend(sock, j({ t: 'error', code: 'session-busy' }), false) + return + } + entry.guest = sock + sock._room = room + sock._peer = entry.host + entry.host._peer = sock + safeSend(entry.host, j({ t: 'peer-joined', peerId: 0, kind: sock._kind }), false) + break + } + default: + break + } + } + + // Reap idle sockets (half-open connections the keepalive did not keep warm). + const reaper = setInterval(() => { + const cutoff = now() - IDLE_TIMEOUT_MS + for (const c of wss.clients) { + if (c._lastSeen < cutoff) { + try { c.terminate() } catch { /* ignore */ } + } + } + }, 30000) + if (typeof reaper.unref === 'function') { + reaper.unref() + } + + server.listen(port, bindHost, () => { + boundPort = server.address().port + if (!publicUrl) { + publicUrl = `http://${bindHost}:${boundPort}` + } + resolve({ + port: boundPort, + url: `ws://${bindHost === '0.0.0.0' ? '127.0.0.1' : bindHost}:${boundPort}`, + publicUrl, + close: () => new Promise(res => { + clearInterval(reaper) + for (const c of wss.clients) { + try { c.terminate() } catch { /* ignore */ } + } + wss.close(() => server.close(() => res())) + }), + }) + }) + }) +} + +module.exports = { startRelay } + +if (require.main === module) { + const port = Number(process.env.PORT || 8787) + const host = process.env.BIND || '0.0.0.0' + const publicUrl = process.env.PUBLIC_URL || '' + const tokenTtlMs = process.env.TOKEN_TTL_MS ? Number(process.env.TOKEN_TTL_MS) : undefined + startRelay(port, { host, publicUrl, tokenTtlMs }).then(s => { + console.log(`[peershell-server] listening ws://${host}:${s.port} public=${s.publicUrl || '(none)'}`) + }) +} diff --git a/shared/test/transport.integration.test.ts b/shared/test/transport.integration.test.ts index 9975745..58fb364 100644 --- a/shared/test/transport.integration.test.ts +++ b/shared/test/transport.integration.test.ts @@ -10,7 +10,7 @@ import { Channel } from '../src/protocol' import { hashPin, verifyPin, generateNonce } from '../src/pinAuth' // eslint-disable-next-line @typescript-eslint/no-var-requires -const { startRelay } = require('../../server/dev-relay.cjs') as { +const { startRelay } = require('../../server/src/index.cjs') as { startRelay: (port?: number) => Promise<{ port: number, url: string, close: () => Promise }> } diff --git a/shared/test/tunnel.integration.test.ts b/shared/test/tunnel.integration.test.ts index 683c8a4..834657e 100644 --- a/shared/test/tunnel.integration.test.ts +++ b/shared/test/tunnel.integration.test.ts @@ -8,7 +8,7 @@ import WebSocket from 'ws' import { WebSocketTransport, WebSocketCtor, HttpTunnelHandler } from '../src' // eslint-disable-next-line @typescript-eslint/no-var-requires -const { startRelay } = require('../../server/dev-relay.cjs') as { +const { startRelay } = require('../../server/src/index.cjs') as { startRelay: (port?: number) => Promise<{ url: string, close: () => Promise }> } From 32a406897acd219bbe9c85c57865093b85c37eb8 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 21:39:18 +0200 Subject: [PATCH 12/75] Stage 6 server: accounts + auth-gate on create-session - Accounts in server/src/index.cjs (still single CJS file, stdlib only): atomic JSON store (data/accounts.json, mode 0600, ephemeral fallback), pbkdf2 password hashing w/ timingSafeEqual, opaque bearer tokens (sha256-stored, 24h TTL, logout/refresh revocation), inline RFC-6238 TOTP. - REST: POST /register (+ mock-logged email verify code), /verify-email, /login (needsTotp branch), /2fa/{setup,verify,enable,disable}, /logout, /session/refresh; GET /sessions dashboard. - Security: WS create-session GATED on a valid account token (?token= on the upgrade URL) via requireAuth (default ON); anti-enumeration login, rate-limits (login lockout, register/IP, 2FA attempts), body-size cap. Rooms tagged w/ accountId for the dashboard. Guests unchanged (PIN). - Tests: new auth.integration suite (register/verify/login/enum+ratelimit/gate/TOTP/logout); existing relay/tunnel/hostGuest integration tests pass { requireAuth: false }. 38 tests green. --- .../tabby/test/hostGuest.integration.test.ts | 4 +- server/src/index.cjs | 512 ++++++++++++++++-- shared/test/auth.integration.test.ts | 169 ++++++ shared/test/transport.integration.test.ts | 4 +- shared/test/tunnel.integration.test.ts | 4 +- 5 files changed, 648 insertions(+), 45 deletions(-) create mode 100644 shared/test/auth.integration.test.ts diff --git a/clients/tabby/test/hostGuest.integration.test.ts b/clients/tabby/test/hostGuest.integration.test.ts index 838377b..d140802 100644 --- a/clients/tabby/test/hostGuest.integration.test.ts +++ b/clients/tabby/test/hostGuest.integration.test.ts @@ -10,7 +10,7 @@ import { ShareController, HostTerminal } from '../src/host/shareController' // eslint-disable-next-line @typescript-eslint/no-var-requires const { startRelay } = require('../../../server/src/index.cjs') as { - startRelay: (port?: number) => Promise<{ url: string, close: () => Promise }> + startRelay: (port?: number, opts?: any) => Promise<{ url: string, close: () => Promise }> } const WS = WebSocket as unknown as WebSocketCtor @@ -35,7 +35,7 @@ function waitFor(pred: () => boolean, timeoutMs = 12000): Promise { } let relay: { url: string, close: () => Promise } -beforeAll(async () => { relay = await startRelay(0) }) +beforeAll(async () => { relay = await startRelay(0, { requireAuth: false }) }) afterAll(async () => { await relay.close() }) function hostTerminal(output$: Subject, inputs: Uint8Array[]): HostTerminal { diff --git a/server/src/index.cjs b/server/src/index.cjs index 8d554fc..f38e845 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -1,23 +1,42 @@ /** - * @peershell/server (MVP) — rendezvous + blind relay + reverse HTTP tunnel. + * @peershell/server — rendezvous + blind relay + reverse HTTP tunnel + accounts. * - * Pairs one host + one guest by room-code or magic-link token, then forwards every frame (control - * text + binary terminal data) verbatim between them. Serves the host-embedded web-client to browsers - * that open the magic-link (GET /s/ -> http-get tunneled to the host -> http-response). + * Relay: pairs one host + one guest by room-code / magic-link token, forwards every frame verbatim, + * and serves the host-embedded web-client to browsers that open the magic-link (GET /s/). * - * MVP scope: no accounts/dashboard yet (Stage 6), no TLS (put cloudflared / a TLS reverse proxy in - * front for public use). The PIN (validated peer-to-peer) and the magic-link TTL are the guards. + * Accounts (Stage 6): open registration + email verification (mock-logged for MVP; SMTP = Stage 7), + * login -> opaque bearer token, optional TOTP 2FA, logout/refresh, dashboard (GET /sessions). + * create-session over WS is GATED behind a valid account token (?token= on the WS upgrade URL): + * without it, anyone reaching the public server could open sessions. Guests do NOT need an account + * (they authenticate to the host with the per-session PIN, peer-to-peer). * - * Library: const { startRelay } = require('./index.cjs'); const s = await startRelay(0) - * Standalone: node server/src/index.cjs (env: PORT, BIND, PUBLIC_URL, TOKEN_TTL_MS) + * Persistence: atomic JSON file (data/accounts.json, mode 0600). Falls back to in-memory (ephemeral) + * when the data dir is not writable, or when opts.ephemeral is set (tests). + * + * Library: const { startRelay } = require('./index.cjs'); const s = await startRelay(0, { requireAuth:false }) + * Standalone: node server/src/index.cjs (env: PORT, BIND, PUBLIC_URL, TOKEN_TTL_MS, PEERSHELL_DATA) */ const http = require('http') const crypto = require('crypto') +const fs = require('fs') +const path = require('path') const { WebSocketServer } = require('ws') const CODE_ALPHABET = '23456789ABCDEFGHJKMNPQRSTUVWXYZ' -const DEFAULT_TOKEN_TTL_MS = 15 * 60 * 1000 +const DEFAULT_TOKEN_TTL_MS = 15 * 60 * 1000 // magic-link +const DEFAULT_AUTH_TTL_MS = 24 * 60 * 60 * 1000 // account bearer token const IDLE_TIMEOUT_MS = 90 * 1000 +const PBKDF2_ITERS = 100000 +const MIN_PASSWORD = 8 +const MAX_BODY = 64 * 1024 +const LOGIN_MAX_FAILS = 5 +const LOGIN_LOCK_MS = 15 * 60 * 1000 +const REG_MAX_PER_IP = 5 +const REG_WINDOW_MS = 24 * 60 * 60 * 1000 +const TOTP_SESSION_TTL_MS = 5 * 60 * 1000 +const TOTP_MAX_FAILS = 3 +const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ +const B32 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' function genCode(n = 6) { const bytes = crypto.randomBytes(n) @@ -27,54 +46,233 @@ function genCode(n = 6) { } return out } - const genToken = () => crypto.randomBytes(18).toString('base64url') +const genAuthToken = () => crypto.randomBytes(32).toString('base64url') +const sha256hex = s => crypto.createHash('sha256').update(s).digest('hex') const j = obj => JSON.stringify({ v: 1, ...obj }) +function hashPassword(password, salt) { + const s = salt || crypto.randomBytes(16).toString('hex') + const hash = crypto.pbkdf2Sync(password, s, PBKDF2_ITERS, 32, 'sha256').toString('base64') + return { salt: s, hash } +} +function verifyPassword(password, salt, expected) { + const h = crypto.pbkdf2Sync(password, salt || '', PBKDF2_ITERS, 32, 'sha256').toString('base64') + const a = Buffer.from(h) + const b = Buffer.from(expected || '') + return a.length === b.length && crypto.timingSafeEqual(a, b) +} + +// --- TOTP (RFC 6238, SHA-1/30s/6-digit) — inline, zero deps --- +function base32Encode(buf) { + let bits = '' + for (const byte of buf) { + bits += byte.toString(2).padStart(8, '0') + } + let out = '' + for (let i = 0; i + 5 <= bits.length; i += 5) { + out += B32[parseInt(bits.slice(i, i + 5), 2)] + } + return out +} +function base32Decode(str) { + let bits = '' + for (const c of String(str).toUpperCase().replace(/=+$/, '')) { + const idx = B32.indexOf(c) + if (idx >= 0) { + bits += idx.toString(2).padStart(5, '0') + } + } + const bytes = [] + for (let i = 0; i + 8 <= bits.length; i += 8) { + bytes.push(parseInt(bits.slice(i, i + 8), 2)) + } + return Buffer.from(bytes) +} +function totpAt(secretB32, counter) { + const key = base32Decode(secretB32) + const buf = Buffer.alloc(8) + buf.writeBigUInt64BE(BigInt(counter)) + const hmac = crypto.createHmac('sha1', key).update(buf).digest() + const off = hmac[hmac.length - 1] & 0xf + const bin = hmac.readUInt32BE(off) & 0x7fffffff + return (bin % 1000000).toString().padStart(6, '0') +} +function verifyTOTP(secretB32, code, atMs, window = 1) { + if (!/^\d{6}$/.test(String(code || ''))) { + return false + } + const counter = Math.floor(atMs / 30000) + for (let i = -window; i <= window; i++) { + if (totpAt(secretB32, counter + i) === String(code)) { + return true + } + } + return false +} + /** * @param {number} port - * @param {{ host?: string, publicUrl?: string, tokenTtlMs?: number }} [opts] + * @param {{ host?, publicUrl?, tokenTtlMs?, authTtlMs?, requireAuth?, ephemeral?, dataDir? }} [opts] */ function startRelay(port = 0, opts = {}) { return new Promise(resolve => { const bindHost = opts.host || '127.0.0.1' const tokenTtlMs = opts.tokenTtlMs || DEFAULT_TOKEN_TTL_MS + const authTtlMs = opts.authTtlMs || DEFAULT_AUTH_TTL_MS + const requireAuth = opts.requireAuth !== false // default ON (production-safe) let boundPort = port let publicUrl = opts.publicUrl || '' - const rooms = new Map() // room -> { host, guest } - const tokens = new Map() // token -> { room, expiresAt } + const rooms = new Map() // room -> { host, guest, accountId, magicLink, createdAt } + const magicTokens = new Map() // magic-link token -> { room, expiresAt } const pendingHttp = new Map() // reqId -> http res + const loginFails = new Map() // email -> { count, until, blocks } + const regByIp = new Map() // ip -> { count, resetAt } + const totpSessions = new Map() // sessionKey -> { accountId, expiresAt, fails } const now = () => Date.now() - function tokenRoom(token) { - const rec = tokens.get(token) + // ---------- account store (atomic JSON, or ephemeral) ---------- + const dataDir = opts.dataDir || process.env.PEERSHELL_DATA || path.join(__dirname, '..', 'data') + const accountsFile = path.join(dataDir, 'accounts.json') + let store = { accounts: [], tokens: [] } + let ephemeral = !!opts.ephemeral + if (!ephemeral) { + try { + const raw = JSON.parse(fs.readFileSync(accountsFile, 'utf8')) + store = { accounts: raw.accounts || [], tokens: raw.tokens || [] } + } catch { /* fresh store */ } + try { + fs.mkdirSync(dataDir, { recursive: true, mode: 0o700 }) + fs.accessSync(dataDir, fs.constants.W_OK) + } catch { + ephemeral = true + console.warn('[peershell-server] data dir not writable -> ephemeral accounts (lost on restart)') + } + } + function saveStore() { + if (ephemeral) { + return + } + try { + const tmp = `${accountsFile}.tmp` + fs.writeFileSync(tmp, JSON.stringify(store), { mode: 0o600 }) + fs.renameSync(tmp, accountsFile) + } catch (e) { + console.warn('[peershell-server] saveStore failed:', e && e.message) + } + } + const findAccount = email => store.accounts.find(a => a.email === String(email || '').toLowerCase()) + function accountFromToken(token) { + if (!token) { + return null + } + const th = sha256hex(token) + const rec = store.tokens.find(t => t.tokenHash === th) + if (!rec || rec.revokedAt || rec.expiresAt < now()) { + return null + } + return store.accounts.find(a => a.id === rec.accountId && !a.revoked) || null + } + function issueAuthToken(accountId) { + const token = genAuthToken() + const expiresAt = now() + authTtlMs + store.tokens.push({ tokenHash: sha256hex(token), accountId, createdAt: now(), expiresAt, revokedAt: null }) + saveStore() + return { token, expiresAt } + } + + // ---------- rate-limit helpers ---------- + const loginLockedUntil = email => { + const r = loginFails.get(email) + return r && r.until > now() ? r.until : 0 + } + function recordLoginFail(email) { + const r = loginFails.get(email) || { count: 0, until: 0, blocks: 0 } + r.count++ + if (r.count >= LOGIN_MAX_FAILS) { + r.blocks++ + r.until = now() + LOGIN_LOCK_MS * Math.min(4, r.blocks) + r.count = 0 + } + loginFails.set(email, r) + } + function regAllowed(ip) { + const r = regByIp.get(ip) + if (!r || r.resetAt < now()) { + regByIp.set(ip, { count: 1, resetAt: now() + REG_WINDOW_MS }) + return true + } + if (r.count >= REG_MAX_PER_IP) { + return false + } + r.count++ + return true + } + const clientIp = req => + req.headers['cf-connecting-ip'] || + String(req.headers['x-forwarded-for'] || '').split(',')[0].trim() || + (req.socket && req.socket.remoteAddress) || 'unknown' + const failDelay = () => new Promise(r => setTimeout(r, 100 + (crypto.randomBytes(1)[0] / 255) * 400)) + + // ---------- HTTP helpers ---------- + function sendJson(res, status, obj) { + const b = Buffer.from(JSON.stringify(obj)) + res.writeHead(status, { 'content-type': 'application/json', 'content-length': b.length }) + res.end(b) + } + function readJson(req, cb) { + let body = '' + let bad = false + req.on('data', c => { + body += c + if (body.length > MAX_BODY) { + bad = true + req.destroy() + } + }) + req.on('end', () => { + if (bad) { + return cb(null) + } + try { + cb(JSON.parse(body || '{}')) + } catch { + cb(null) + } + }) + req.on('error', () => cb(null)) + } + const bearer = req => { + const h = req.headers.authorization || '' + return h.startsWith('Bearer ') ? h.slice(7) : null + } + + function magicRoom(token) { + const rec = magicTokens.get(token) if (!rec) { return null } if (rec.expiresAt < now()) { - tokens.delete(token) + magicTokens.delete(token) return null } return rec.room } - function dropRoom(room) { rooms.delete(room) - for (const [tok, rec] of tokens) { + for (const [tok, rec] of magicTokens) { if (rec.room === room) { - tokens.delete(tok) + magicTokens.delete(tok) } } } - function safeSend(sock, data, binary) { if (sock && sock.readyState === sock.OPEN) { sock.send(data, { binary: !!binary }) } } - function resolveHttp(msg) { const res = pendingHttp.get(msg.reqId) if (res) { @@ -84,10 +282,219 @@ function startRelay(port = 0, opts = {}) { } } + // ---------- REST endpoints ---------- + function handleRest(req, res) { + const url = (req.url || '').split('?')[0] + const method = req.method || 'GET' + + if (method === 'GET' && url === '/sessions') { + const acct = accountFromToken(bearer(req)) + if (!acct) { + return sendJson(res, 401, { error: 'unauthorized' }) + } + const sessions = [] + for (const [room, e] of rooms) { + if (e.accountId === acct.id) { + sessions.push({ room, magicLink: e.magicLink, createdAt: e.createdAt, hasGuest: !!e.guest }) + } + } + return sendJson(res, 200, { + account: { email: acct.email, totpEnabled: !!acct.totpEnabled }, + sessions, + }) + } + if (method !== 'POST') { + return sendJson(res, 404, { error: 'not-found' }) + } + + readJson(req, async body => { + if (!body) { + return sendJson(res, 400, { error: 'bad-request' }) + } + switch (url) { + case '/register': { + const ip = clientIp(req) + const email = String(body.email || '').toLowerCase().trim() + const password = String(body.password || '') + if (!EMAIL_RE.test(email)) { + return sendJson(res, 400, { error: 'invalid-email' }) + } + if (password.length < MIN_PASSWORD) { + return sendJson(res, 400, { error: 'password-too-weak', min: MIN_PASSWORD }) + } + if (!regAllowed(ip)) { + return sendJson(res, 429, { error: 'rate-limited', retryAfter: REG_WINDOW_MS / 1000 }) + } + const existing = findAccount(email) + const verifyCode = crypto.randomInt(0, 1000000).toString().padStart(6, '0') + if (existing) { + if (!existing.verified) { + existing.verifyCode = verifyCode + saveStore() + console.log(`[peershell] verify code for ${email}: ${verifyCode}`) + } + // anti-enumeration: same response whether new or existing + return sendJson(res, 200, { ok: true, needsVerification: true }) + } + const { salt, hash } = hashPassword(password) + store.accounts.push({ + id: crypto.randomUUID(), email, salt, hash, + verified: false, verifyCode, + totpSecret: null, totpEnabled: false, pendingTotpSecret: null, + createdAt: now(), lastLogin: null, revoked: false, + }) + saveStore() + console.log(`[peershell] verify code for ${email}: ${verifyCode}`) + return sendJson(res, 200, { ok: true, needsVerification: true }) + } + case '/verify-email': { + const email = String(body.email || '').toLowerCase().trim() + const code = String(body.code || '') + const acct = findAccount(email) + if (acct && !acct.verified && acct.verifyCode && + code.length === acct.verifyCode.length && + crypto.timingSafeEqual(Buffer.from(code), Buffer.from(acct.verifyCode))) { + acct.verified = true + acct.verifyCode = null + saveStore() + return sendJson(res, 200, { ok: true }) + } + return sendJson(res, 400, { error: 'invalid' }) + } + case '/login': { + const email = String(body.email || '').toLowerCase().trim() + const password = String(body.password || '') + const lockUntil = loginLockedUntil(email) + if (lockUntil) { + return sendJson(res, 429, { error: 'rate-limited', retryAfter: Math.ceil((lockUntil - now()) / 1000) }) + } + const acct = findAccount(email) + const ok = acct && verifyPassword(password, acct.salt, acct.hash) + if (!ok) { + recordLoginFail(email) + await failDelay() + return sendJson(res, 401, { error: 'invalid-credentials' }) + } + if (!acct.verified) { + return sendJson(res, 403, { error: 'needs-verification' }) + } + loginFails.delete(email) + acct.lastLogin = now() + if (acct.totpEnabled) { + const sessionKey = genAuthToken() + totpSessions.set(sessionKey, { accountId: acct.id, expiresAt: now() + TOTP_SESSION_TTL_MS, fails: 0 }) + saveStore() + return sendJson(res, 200, { needsTotp: true, sessionKey }) + } + saveStore() + const t = issueAuthToken(acct.id) + return sendJson(res, 200, { token: t.token, expiresAt: t.expiresAt }) + } + case '/2fa/verify': { + const sk = String(body.sessionKey || '') + const sess = totpSessions.get(sk) + if (!sess || sess.expiresAt < now()) { + totpSessions.delete(sk) + return sendJson(res, 401, { error: 'expired' }) + } + const acct = store.accounts.find(a => a.id === sess.accountId) + if (!acct || !verifyTOTP(acct.totpSecret, body.code, now())) { + sess.fails++ + if (sess.fails >= TOTP_MAX_FAILS) { + totpSessions.delete(sk) + if (acct) { + recordLoginFail(acct.email) + } + return sendJson(res, 429, { error: 'too-many-attempts' }) + } + return sendJson(res, 401, { error: 'invalid-code', remaining: TOTP_MAX_FAILS - sess.fails }) + } + totpSessions.delete(sk) + const t = issueAuthToken(acct.id) + return sendJson(res, 200, { token: t.token, expiresAt: t.expiresAt }) + } + case '/2fa/setup': { + const acct = accountFromToken(bearer(req)) + if (!acct) { + return sendJson(res, 401, { error: 'unauthorized' }) + } + const secret = base32Encode(crypto.randomBytes(20)) + acct.pendingTotpSecret = secret + saveStore() + const label = encodeURIComponent(`peershell:${acct.email}`) + const otpauthUrl = `otpauth://totp/${label}?secret=${secret}&issuer=peershell` + return sendJson(res, 200, { secret, otpauthUrl }) + } + case '/2fa/enable': { + const acct = accountFromToken(bearer(req)) + if (!acct) { + return sendJson(res, 401, { error: 'unauthorized' }) + } + if (!acct.pendingTotpSecret || !verifyTOTP(acct.pendingTotpSecret, body.code, now())) { + return sendJson(res, 400, { error: 'invalid-code' }) + } + acct.totpSecret = acct.pendingTotpSecret + acct.pendingTotpSecret = null + acct.totpEnabled = true + saveStore() + console.log(`[peershell] 2fa enabled for ${acct.email}`) + return sendJson(res, 200, { ok: true }) + } + case '/2fa/disable': { + const acct = accountFromToken(bearer(req)) + if (!acct) { + return sendJson(res, 401, { error: 'unauthorized' }) + } + if (!verifyPassword(String(body.password || ''), acct.salt, acct.hash)) { + return sendJson(res, 401, { error: 'invalid-credentials' }) + } + acct.totpEnabled = false + acct.totpSecret = null + acct.pendingTotpSecret = null + saveStore() + console.log(`[peershell] 2fa disabled for ${acct.email}`) + return sendJson(res, 200, { ok: true }) + } + case '/logout': { + const token = bearer(req) + const th = token && sha256hex(token) + const rec = th && store.tokens.find(t => t.tokenHash === th) + if (rec) { + rec.revokedAt = now() + saveStore() + } + return sendJson(res, 200, { ok: true }) + } + case '/session/refresh': { + const token = bearer(req) + const acct = accountFromToken(token) + if (!acct) { + return sendJson(res, 401, { error: 'unauthorized' }) + } + const rec = store.tokens.find(t => t.tokenHash === sha256hex(token)) + if (rec) { + rec.revokedAt = now() + } + const t = issueAuthToken(acct.id) + return sendJson(res, 200, { token: t.token, expiresAt: t.expiresAt }) + } + default: + return sendJson(res, 404, { error: 'not-found' }) + } + }) + } + + const REST_POST = new Set(['/register', '/verify-email', '/login', '/2fa/verify', '/2fa/setup', '/2fa/enable', '/2fa/disable', '/logout', '/session/refresh']) + const server = http.createServer((req, res) => { - if (req.url === '/health') { + const url = (req.url || '').split('?')[0] + const method = req.method || 'GET' + if ((method === 'GET' && url === '/sessions') || (method === 'POST' && REST_POST.has(url))) { + return handleRest(req, res) + } + if (url === '/health') { res.writeHead(200, { 'content-type': 'application/json' }) - res.end(JSON.stringify({ ok: true, sessions: rooms.size })) + res.end(JSON.stringify({ ok: true, sessions: rooms.size, accounts: store.accounts.length })) return } const m = /^\/s\/([^/?#]+)/.exec(req.url || '') @@ -96,7 +503,7 @@ function startRelay(port = 0, opts = {}) { res.end('peershell server\n') return } - const room = tokenRoom(m[1]) + const room = magicRoom(m[1]) const entry = room && rooms.get(room) if (!entry || !entry.host) { res.writeHead(410, { 'content-type': 'text/plain' }) @@ -120,11 +527,19 @@ function startRelay(port = 0, opts = {}) { const wss = new WebSocketServer({ server }) - wss.on('connection', sock => { + wss.on('connection', (sock, req) => { sock._room = null sock._peer = null sock._kind = 'desktop' + sock._role = 'guest' sock._lastSeen = now() + // account token (host) rides on the WS upgrade URL query: ?token= + let acct = null + try { + const q = new URL(req.url || '/', 'http://x').searchParams.get('token') + acct = q ? accountFromToken(q) : null + } catch { /* ignore */ } + sock._account = acct sock.on('message', (data, isBinary) => { sock._lastSeen = now() @@ -138,10 +553,7 @@ function startRelay(port = 0, opts = {}) { let msg = null try { msg = JSON.parse(text) - } catch { - /* ignore non-JSON text */ - } - // Keepalive + relay-directed frames are handled here, never forwarded. + } catch { /* ignore non-JSON text */ } if (msg && msg.t === 'ping') { safeSend(sock, j({ t: 'pong' }), false) return @@ -169,10 +581,10 @@ function startRelay(port = 0, opts = {}) { const other = entry.host === sock ? entry.guest : entry.host safeSend(other, j({ t: 'peer-left', reason: 'socket-closed' }), false) if (entry.host === sock) { - dropRoom(room) // host gone: tear the session down + dropRoom(room) } else { entry.guest = null - entry.host._peer = null // free the guest slot for a retry within TTL + entry.host._peer = null } } }) @@ -182,19 +594,29 @@ function startRelay(port = 0, opts = {}) { switch (msg.t) { case 'hello': sock._kind = msg.kind || 'desktop' + sock._role = msg.role || 'guest' break case 'create-session': { + if (requireAuth && !sock._account) { + safeSend(sock, j({ t: 'error', code: 'unauthorized', message: 'login required to share' }), false) + return + } const room = genCode() const token = genToken() - rooms.set(room, { host: sock, guest: null }) - tokens.set(token, { room, expiresAt: now() + tokenTtlMs }) - sock._room = room const base = publicUrl || `http://127.0.0.1:${boundPort}` - safeSend(sock, j({ t: 'session-created', room, magicLink: `${base}/s/${token}` }), false) + const magicLink = `${base}/s/${token}` + rooms.set(room, { + host: sock, guest: null, + accountId: sock._account ? sock._account.id : null, + magicLink, createdAt: now(), + }) + magicTokens.set(token, { room, expiresAt: now() + tokenTtlMs }) + sock._room = room + safeSend(sock, j({ t: 'session-created', room, magicLink }), false) break } case 'join': { - const room = msg.room ? String(msg.room).toUpperCase() : (msg.token ? tokenRoom(msg.token) : null) + const room = msg.room ? String(msg.room).toUpperCase() : (msg.token ? magicRoom(msg.token) : null) const entry = room && rooms.get(room) if (!entry) { safeSend(sock, j({ t: 'error', code: msg.token ? 'link-expired' : 'no-such-room' }), false) @@ -216,7 +638,7 @@ function startRelay(port = 0, opts = {}) { } } - // Reap idle sockets (half-open connections the keepalive did not keep warm). + // Reap idle sockets + prune expired auth tokens / totp sessions. const reaper = setInterval(() => { const cutoff = now() - IDLE_TIMEOUT_MS for (const c of wss.clients) { @@ -224,6 +646,16 @@ function startRelay(port = 0, opts = {}) { try { c.terminate() } catch { /* ignore */ } } } + const before = store.tokens.length + store.tokens = store.tokens.filter(t => t.expiresAt > now() && !t.revokedAt) + if (store.tokens.length !== before) { + saveStore() + } + for (const [k, s] of totpSessions) { + if (s.expiresAt < now()) { + totpSessions.delete(k) + } + } }, 30000) if (typeof reaper.unref === 'function') { reaper.unref() @@ -238,6 +670,8 @@ function startRelay(port = 0, opts = {}) { port: boundPort, url: `ws://${bindHost === '0.0.0.0' ? '127.0.0.1' : bindHost}:${boundPort}`, publicUrl, + requireAuth, + ephemeral, close: () => new Promise(res => { clearInterval(reaper) for (const c of wss.clients) { @@ -250,7 +684,7 @@ function startRelay(port = 0, opts = {}) { }) } -module.exports = { startRelay } +module.exports = { startRelay, hashPassword, verifyPassword, base32Encode, base32Decode, totpAt, verifyTOTP } if (require.main === module) { const port = Number(process.env.PORT || 8787) @@ -258,6 +692,6 @@ if (require.main === module) { const publicUrl = process.env.PUBLIC_URL || '' const tokenTtlMs = process.env.TOKEN_TTL_MS ? Number(process.env.TOKEN_TTL_MS) : undefined startRelay(port, { host, publicUrl, tokenTtlMs }).then(s => { - console.log(`[peershell-server] listening ws://${host}:${s.port} public=${s.publicUrl || '(none)'}`) + console.log(`[peershell-server] listening ws://${host}:${s.port} public=${s.publicUrl || '(none)'} auth=${s.requireAuth} ${s.ephemeral ? 'EPHEMERAL' : 'persisted'}`) }) } diff --git a/shared/test/auth.integration.test.ts b/shared/test/auth.integration.test.ts new file mode 100644 index 0000000..f091270 --- /dev/null +++ b/shared/test/auth.integration.test.ts @@ -0,0 +1,169 @@ +/** + * Stage 6 server: account REST (register/verify/login/2FA/logout/rate-limit) + WS auth-gate on + * create-session. Runs the real server ephemeral (in-memory store) with requireAuth ON. + */ +import * as http from 'http' +import WebSocket from 'ws' + +// eslint-disable-next-line @typescript-eslint/no-var-requires +const server = require('../../server/src/index.cjs') as { + startRelay: (port?: number, opts?: any) => Promise<{ url: string, publicUrl: string, close: () => Promise }> + totpAt: (secret: string, counter: number) => string +} + +let relay: { url: string, publicUrl: string, close: () => Promise } +let httpBase = '' +const logged: string[] = [] +let logSpy: jest.SpyInstance + +beforeAll(async () => { + logSpy = jest.spyOn(console, 'log').mockImplementation((...a: any[]) => { logged.push(a.join(' ')) }) + relay = await server.startRelay(0, { requireAuth: true, ephemeral: true }) + httpBase = relay.url.replace('ws://', 'http://') +}) +afterAll(async () => { await relay.close(); logSpy.mockRestore() }) + +function api(method: string, path: string, body?: any, token?: string): Promise<{ status: number, json: any }> { + return new Promise((resolve, reject) => { + const data = body ? Buffer.from(JSON.stringify(body)) : null + const u = new URL(httpBase + path) + const req = http.request({ + hostname: u.hostname, port: u.port, path: u.pathname, method, + headers: { + 'content-type': 'application/json', + ...(data ? { 'content-length': data.length } : {}), + ...(token ? { authorization: `Bearer ${token}` } : {}), + }, + }, res => { + let b = '' + res.setEncoding('utf-8') + res.on('data', c => { b += c }) + res.on('end', () => { try { resolve({ status: res.statusCode ?? 0, json: JSON.parse(b || '{}') }) } catch { resolve({ status: res.statusCode ?? 0, json: {} }) } }) + }) + req.on('error', reject) + if (data) { req.write(data) } + req.end() + }) +} + +const codeFor = (email: string): string => { + const line = [...logged].reverse().find(l => l.includes(`verify code for ${email}:`)) + return line ? line.split(':').pop()!.trim() : '' +} + +// Drive the WS create-session leg; resolves with the first control message the server sends back. +function createSessionWs(token?: string): Promise { + return new Promise((resolve, reject) => { + const ws = new WebSocket(relay.url + (token ? `?token=${token}` : '')) + const to = setTimeout(() => { ws.close(); reject(new Error('timeout')) }, 6000) + ws.on('open', () => { + ws.send(JSON.stringify({ v: 1, t: 'hello', role: 'host', kind: 'desktop' })) + ws.send(JSON.stringify({ v: 1, t: 'create-session' })) + }) + ws.on('message', d => { + let m: any = null + try { m = JSON.parse(d.toString()) } catch { /* ignore */ } + if (m && (m.t === 'session-created' || m.t === 'error')) { + clearTimeout(to) + ws.close() + resolve(m) + } + }) + ws.on('error', e => { clearTimeout(to); reject(e) }) + }) +} + +async function registerVerifyLogin(email: string, password = 'CorrectHorse9'): Promise { + await api('POST', '/register', { email, password }) + await api('POST', '/verify-email', { email, code: codeFor(email) }) + const r = await api('POST', '/login', { email, password }) + return r.json.token +} + +it('register -> verify -> login issues a token; login before verify is blocked', async () => { + const email = 'alice@example.com' + const reg = await api('POST', '/register', { email, password: 'CorrectHorse9' }) + expect(reg.status).toBe(200) + expect(reg.json.needsVerification).toBe(true) + + const early = await api('POST', '/login', { email, password: 'CorrectHorse9' }) + expect(early.status).toBe(403) + expect(early.json.error).toBe('needs-verification') + + const code = codeFor(email) + expect(code).toMatch(/^\d{6}$/) + const ver = await api('POST', '/verify-email', { email, code }) + expect(ver.status).toBe(200) + + const login = await api('POST', '/login', { email, password: 'CorrectHorse9' }) + expect(login.status).toBe(200) + expect(typeof login.json.token).toBe('string') + expect(login.json.expiresAt).toBeGreaterThan(Date.now()) +}, 20000) + +it('rejects weak password and invalid email at registration', async () => { + expect((await api('POST', '/register', { email: 'b@example.com', password: 'short' })).json.error).toBe('password-too-weak') + expect((await api('POST', '/register', { email: 'not-an-email', password: 'CorrectHorse9' })).json.error).toBe('invalid-email') +}) + +it('login failures are generic (no email enumeration) and rate-limited', async () => { + const email = 'carol@example.com' + await registerVerifyLogin(email) + // wrong password AND nonexistent email -> identical error + const bad = await api('POST', '/login', { email, password: 'WrongPassword1' }) + const ghost = await api('POST', '/login', { email: 'ghost@example.com', password: 'WhateverPass1' }) + expect(bad.status).toBe(401) + expect(bad.json.error).toBe('invalid-credentials') + expect(ghost.json.error).toBe('invalid-credentials') + // hammer to trip the limiter (5 fails already includes 'bad' above -> a few more) + let last = bad + for (let i = 0; i < 6; i++) { last = await api('POST', '/login', { email, password: 'WrongPassword1' }) } + expect(last.status).toBe(429) + expect(last.json.error).toBe('rate-limited') +}, 30000) + +it('WS create-session is gated: rejected without a token, accepted with one', async () => { + const noAuth = await createSessionWs() + expect(noAuth.t).toBe('error') + expect(noAuth.code).toBe('unauthorized') + + const token = await registerVerifyLogin('dave@example.com') + const ok = await createSessionWs(token) + expect(ok.t).toBe('session-created') + expect(ok.room).toMatch(/^[2-9A-HJ-NP-Z]{6}$/) + expect(ok.magicLink).toContain('/s/') +}, 20000) + +it('optional TOTP: setup -> enable -> login needs 2FA -> verify issues token', async () => { + const email = 'erin@example.com' + const token = await registerVerifyLogin(email) + + const setup = await api('POST', '/2fa/setup', {}, token) + expect(setup.status).toBe(200) + const secret = setup.json.secret as string + expect(secret.length).toBeGreaterThan(10) + + const enable = await api('POST', '/2fa/enable', { code: server.totpAt(secret, Math.floor(Date.now() / 30000)) }, token) + expect(enable.status).toBe(200) + + const login = await api('POST', '/login', { email, password: 'CorrectHorse9' }) + expect(login.json.needsTotp).toBe(true) + expect(typeof login.json.sessionKey).toBe('string') + + const verify = await api('POST', '/2fa/verify', { sessionKey: login.json.sessionKey, code: server.totpAt(secret, Math.floor(Date.now() / 30000)) }) + expect(verify.status).toBe(200) + expect(typeof verify.json.token).toBe('string') +}, 25000) + +it('logout revokes the token (dashboard then unauthorized)', async () => { + const token = await registerVerifyLogin('frank@example.com') + const before = await api('GET', '/sessions', undefined, token) + expect(before.status).toBe(200) + expect(before.json.account.email).toBe('frank@example.com') + + const out = await api('POST', '/logout', {}, token) + expect(out.status).toBe(200) + + const after = await api('GET', '/sessions', undefined, token) + expect(after.status).toBe(401) +}, 20000) diff --git a/shared/test/transport.integration.test.ts b/shared/test/transport.integration.test.ts index 58fb364..e9e9bee 100644 --- a/shared/test/transport.integration.test.ts +++ b/shared/test/transport.integration.test.ts @@ -11,7 +11,7 @@ import { hashPin, verifyPin, generateNonce } from '../src/pinAuth' // eslint-disable-next-line @typescript-eslint/no-var-requires const { startRelay } = require('../../server/src/index.cjs') as { - startRelay: (port?: number) => Promise<{ port: number, url: string, close: () => Promise }> + startRelay: (port?: number, opts?: any) => Promise<{ port: number, url: string, close: () => Promise }> } const WS = WebSocket as unknown as WebSocketCtor @@ -21,7 +21,7 @@ const dec = (b: Uint8Array) => new TextDecoder().decode(b) let relay: { url: string, close: () => Promise } beforeAll(async () => { - relay = await startRelay(0) + relay = await startRelay(0, { requireAuth: false }) }) afterAll(async () => { diff --git a/shared/test/tunnel.integration.test.ts b/shared/test/tunnel.integration.test.ts index 834657e..d8b00fc 100644 --- a/shared/test/tunnel.integration.test.ts +++ b/shared/test/tunnel.integration.test.ts @@ -9,7 +9,7 @@ import { WebSocketTransport, WebSocketCtor, HttpTunnelHandler } from '../src' // eslint-disable-next-line @typescript-eslint/no-var-requires const { startRelay } = require('../../server/src/index.cjs') as { - startRelay: (port?: number) => Promise<{ url: string, close: () => Promise }> + startRelay: (port?: number, opts?: any) => Promise<{ url: string, close: () => Promise }> } const WS = WebSocket as unknown as WebSocketCtor @@ -43,7 +43,7 @@ function httpGet(url: string): Promise<{ status: number, body: string }> { } let relay: { url: string, close: () => Promise } -beforeAll(async () => { relay = await startRelay(0) }) +beforeAll(async () => { relay = await startRelay(0, { requireAuth: false }) }) afterAll(async () => { await relay.close() }) it('serves the host-embedded web-client page over the tunnel', async () => { From 41de568bd6fc30fa8f840ffdd354e84a6d9a6fa9 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 21:49:27 +0200 Subject: [PATCH 13/75] Stage 6 client: account modal + gate sharing behind login - AccountService (clients/tabby): fetch-based REST client (register/verify-email/login/verify2fa/ logout), bearer token kept in the Tabby config store (getToken/persist/clearLocal); REST base derived from the ws(s):// server URL. (Vault storage is the documented follow-up hardening.) - LoginModalComponent: inline-template modal with login/register/verify-email/2FA/logout modes, friendly error mapping; resolves with the token on a successful login. - PeershellService.startSharing() now gates on a logged-in account: opens the login modal when there is no token, passes the account token to ShareController.start -> transport ?token=; on an 'unauthorized' error it clears the stale token and asks the user to log in again. - Toolbar gains a "peershell account (log in / out)" button (opens the modal); index.ts declares LoginModalComponent. Webpack build + smoke-load green; 38 tests still pass. --- clients/tabby/src/account/account.service.ts | 110 +++++++++++ .../src/account/login-modal.component.ts | 183 ++++++++++++++++++ clients/tabby/src/index.ts | 2 + .../src/providers/toolbarButtonProvider.ts | 8 + .../tabby/src/services/peershell.service.ts | 36 +++- 5 files changed, 337 insertions(+), 2 deletions(-) create mode 100644 clients/tabby/src/account/account.service.ts create mode 100644 clients/tabby/src/account/login-modal.component.ts diff --git a/clients/tabby/src/account/account.service.ts b/clients/tabby/src/account/account.service.ts new file mode 100644 index 0000000..768341f --- /dev/null +++ b/clients/tabby/src/account/account.service.ts @@ -0,0 +1,110 @@ +import { Injectable } from '@angular/core' +import { ConfigService } from 'tabby-core' + +export interface AccountApiResult { + status: number + token?: string + expiresAt?: number + needsTotp?: boolean + sessionKey?: string + needsVerification?: boolean + ok?: boolean + error?: string + [k: string]: unknown +} + +/** + * Client-neutral account layer: talks the server's REST API (fetch) and keeps the bearer token. + * + * Token storage: Tabby config store (`peershell.account`), persisted via ConfigService.save(). This is + * an MVP tradeoff — the Tabby vault (encrypted at rest) is the intended hardening and can replace this + * behind the same getToken/persist surface without touching callers. + */ +@Injectable({ providedIn: 'root' }) +export class AccountService { + constructor(private readonly config: ConfigService) {} + + get email(): string | null { + return this.config.store.peershell?.account?.email ?? null + } + + getToken(): string | null { + const a = this.config.store.peershell?.account + if (a?.token && (!a.expiresAt || a.expiresAt > Date.now())) { + return a.token + } + return null + } + + isLoggedIn(): boolean { + return !!this.getToken() + } + + /** REST base derived from the configured ws(s):// server URL. */ + private base(): string { + const url: string = this.config.store.peershell?.serverUrl || '' + return url.replace(/^wss:/, 'https:').replace(/^ws:/, 'http:').replace(/\/+$/, '') + } + + private async api(method: string, path: string, body?: unknown, auth = false): Promise { + const headers: Record = { 'content-type': 'application/json' } + if (auth) { + const t = this.getToken() + if (t) { + headers.authorization = `Bearer ${t}` + } + } + let res: Response + try { + res = await fetch(this.base() + path, { + method, + headers, + body: body === undefined ? undefined : JSON.stringify(body), + }) + } catch (err) { + return { status: 0, error: 'network-error', detail: String(err) } + } + let json: Record = {} + try { + json = await res.json() + } catch { /* empty/non-json body */ } + return { status: res.status, ...json } + } + + register(email: string, password: string): Promise { + return this.api('POST', '/register', { email, password }) + } + + verifyEmail(email: string, code: string): Promise { + return this.api('POST', '/verify-email', { email, code }) + } + + login(email: string, password: string): Promise { + return this.api('POST', '/login', { email, password }) + } + + verify2fa(sessionKey: string, code: string): Promise { + return this.api('POST', '/2fa/verify', { sessionKey, code }) + } + + /** Store the bearer token locally (config store). */ + async persist(email: string, token: string, expiresAt?: number): Promise { + this.config.store.peershell = this.config.store.peershell || {} + this.config.store.peershell.account = { email, token, expiresAt: expiresAt ?? null } + await this.config.save() + } + + async clearLocal(): Promise { + if (this.config.store.peershell) { + this.config.store.peershell.account = null + await this.config.save() + } + } + + async logout(): Promise { + try { + await this.api('POST', '/logout', {}, true) + } catch { /* revoke is best-effort */ } + await this.clearLocal() + } +} diff --git a/clients/tabby/src/account/login-modal.component.ts b/clients/tabby/src/account/login-modal.component.ts new file mode 100644 index 0000000..b68d61b --- /dev/null +++ b/clients/tabby/src/account/login-modal.component.ts @@ -0,0 +1,183 @@ +import { Component } from '@angular/core' +import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' +import { AccountService, AccountApiResult } from './account.service' + +type Mode = 'account' | 'login' | 'register' | 'verify' | '2fa' + +const ERRORS: Record = { + 'invalid-credentials': 'Email or password is not valid.', + 'needs-verification': 'Verify your email first (check the server log for the code).', + 'rate-limited': 'Too many attempts. Please try again later.', + 'password-too-weak': 'Password must be at least 8 characters.', + 'invalid-email': 'Enter a valid email address.', + 'invalid': 'Wrong or expired code.', + 'invalid-code': 'Wrong 2FA code.', + 'too-many-attempts': 'Too many 2FA attempts. Try logging in again.', + 'unauthorized': 'Session expired. Please log in again.', + 'network-error': 'Cannot reach the peershell server. Check the server URL in settings.', +} + +/** Register / verify / login / 2FA / logout modal. Resolves modal.close(token) on a successful login. */ +@Component({ + template: ` + + + + `, +}) +export class LoginModalComponent { + mode: Mode = 'login' + email = '' + password = '' + code = '' + sessionKey = '' + busy = false + error = '' + info = '' + + constructor(public readonly modal: NgbActiveModal, private readonly account: AccountService) { + if (this.account.isLoggedIn()) { + this.mode = 'account' + this.email = this.account.email ?? '' + } + } + + switch(mode: Mode): void { + this.mode = mode + this.error = '' + this.info = '' + this.code = '' + } + + private fail(r: AccountApiResult): void { + this.error = ERRORS[String(r.error)] ?? (r.error ? String(r.error) : `Request failed (${r.status})`) + } + + async submitRegister(): Promise { + this.busy = true + this.error = '' + try { + const r = await this.account.register(this.email.trim().toLowerCase(), this.password) + if (r.status === 200) { + this.switch('verify') + this.info = 'Registered. Find your 6-digit code in the server log, then verify.' + } else { + this.fail(r) + } + } finally { + this.busy = false + } + } + + async submitVerify(): Promise { + this.busy = true + this.error = '' + try { + const r = await this.account.verifyEmail(this.email.trim().toLowerCase(), this.code.trim()) + if (r.status === 200) { + this.switch('login') + this.info = 'Email verified. You can log in now.' + } else { + this.fail(r) + } + } finally { + this.busy = false + } + } + + async submitLogin(): Promise { + this.busy = true + this.error = '' + try { + const r = await this.account.login(this.email.trim().toLowerCase(), this.password) + if (r.needsTotp && r.sessionKey) { + this.sessionKey = r.sessionKey + this.switch('2fa') + return + } + if (r.status === 200 && r.token) { + await this.account.persist(this.email.trim().toLowerCase(), r.token, r.expiresAt) + this.modal.close(r.token) + return + } + if (r.error === 'needs-verification') { + this.switch('verify') + this.info = 'Please verify your email. The code is in the server log.' + return + } + this.fail(r) + } finally { + this.busy = false + } + } + + async submit2fa(): Promise { + this.busy = true + this.error = '' + try { + const r = await this.account.verify2fa(this.sessionKey, this.code.trim()) + if (r.status === 200 && r.token) { + await this.account.persist(this.email.trim().toLowerCase(), r.token, r.expiresAt) + this.modal.close(r.token) + return + } + this.fail(r) + } finally { + this.busy = false + } + } + + async doLogout(): Promise { + this.busy = true + try { + await this.account.logout() + this.modal.close(null) + } finally { + this.busy = false + } + } +} diff --git a/clients/tabby/src/index.ts b/clients/tabby/src/index.ts index a9cad66..82b09ab 100644 --- a/clients/tabby/src/index.ts +++ b/clients/tabby/src/index.ts @@ -13,6 +13,7 @@ import { PeershellService } from './services/peershell.service' import { PeershellToolbarButtonProvider } from './providers/toolbarButtonProvider' import { PeershellContextMenu } from './providers/tabContextMenu' import { MirrorTabComponent } from './guest/mirrorTab.component' +import { LoginModalComponent } from './account/login-modal.component' @NgModule({ imports: [ @@ -30,6 +31,7 @@ import { MirrorTabComponent } from './guest/mirrorTab.component' ], declarations: [ MirrorTabComponent, + LoginModalComponent, ], }) export default class PeershellModule { diff --git a/clients/tabby/src/providers/toolbarButtonProvider.ts b/clients/tabby/src/providers/toolbarButtonProvider.ts index 6c26ef6..c2e0c57 100644 --- a/clients/tabby/src/providers/toolbarButtonProvider.ts +++ b/clients/tabby/src/providers/toolbarButtonProvider.ts @@ -31,6 +31,14 @@ export class PeershellToolbarButtonProvider extends ToolbarButtonProvider { void this.peershell.joinShared() }, }, + { + icon: SHARE_ICON, + title: 'peershell account (log in / out)', + weight: 10, + click: () => { + this.peershell.openAccount() + }, + }, ] } } diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index 10af8fb..93928db 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -9,6 +9,8 @@ import { import { ShareController, HostTerminal } from '../host/shareController' import { MirrorTabComponent } from '../guest/mirrorTab.component' +import { AccountService } from '../account/account.service' +import { LoginModalComponent } from '../account/login-modal.component' import webClientHtml from '../../assets/web-client.html' /** Owns the active host shares and adapts a Tabby terminal tab to the transport-driven controller. */ @@ -21,6 +23,7 @@ export class PeershellService { private readonly config: ConfigService, private readonly notifications: NotificationsService, private readonly ngbModal: NgbModal, + private readonly account: AccountService, ) {} isSharing(tab: BaseTabComponent): boolean { @@ -46,6 +49,17 @@ export class PeershellService { return } + // Sharing is gated behind a logged-in account: the account token authenticates the outbound + // connection so the server accepts create-session (open servers must not let anyone share). + let token = this.account.getToken() + if (!token) { + token = await this.openLogin() + if (!token) { + this.notifications.error('peershell: log in to share a terminal') + return + } + } + // Per-session PIN, generated locally and shown to the host. Never sent to the server in // cleartext (challenge-response only). The host shares it with the intended guest out-of-band. const pin = generatePin(6) @@ -59,14 +73,21 @@ export class PeershellService { onAuthenticated: () => this.notifications.notice('peershell: guest connected'), onPinFailed: () => this.notifications.error('peershell: guest failed the PIN'), onPeerLeft: () => this.notifications.notice('peershell: peer disconnected'), - onError: (code, message) => this.notifications.error(`peershell: ${code}`, message), + onError: (code, message) => { + if (code === 'unauthorized') { + void this.account.clearLocal() + this.notifications.error('peershell: session expired — log in and share again') + } else { + this.notifications.error(`peershell: ${code}`, message) + } + }, }) this.shares.set(tab, controller) tab.destroyed$.subscribe(() => this.shares.delete(tab)) try { - await controller.start(serverUrl) + await controller.start(serverUrl, token) } catch (err) { this.shares.delete(tab) this.notifications.error('peershell: could not connect to the server', String(err)) @@ -127,6 +148,17 @@ export class PeershellService { return value ? value.trim() : null } + /** Opens the account modal (login / register / 2FA / logout). Used by the toolbar button. */ + openAccount(): void { + this.ngbModal.open(LoginModalComponent) + } + + /** Opens the login modal, resolving with the bearer token on success or null if cancelled. */ + private async openLogin(): Promise { + const modal = this.ngbModal.open(LoginModalComponent) + return await modal.result.catch(() => null) + } + stopSharing(tab: BaseTerminalTabComponent): void { const controller = this.shares.get(tab) if (controller) { From ae151604235051a2f4305fb8e875be68fcf62225 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 22:19:00 +0200 Subject: [PATCH 14/75] Stage 7: send verification codes via Brevo (relay, not VM SMTP) - server/src/index.cjs: deliverVerifyCode() posts the code through the Brevo transactional API (stdlib https, zero deps) when BREVO_API_KEY is set; falls back to logging the code when no key is configured, and to logging on a send failure (registration never blocks on email). Config via env: BREVO_API_KEY, EMAIL_FROM (default noreply@peershell.dev), EMAIL_FROM_NAME. brevoSend takes an injectable sendFn for tests. Relaying through Brevo keeps the VM IP out of the sending path (no blacklist risk) and lets DKIM/SPF authorise the domain. - Wired into POST /register (new + resend paths); exports deliverVerifyCode/brevoSend. - Unit test (email.test.ts): log fallback, injected-mailer send, send-failure fallback. 41 tests green. --- server/src/index.cjs | 74 +++++++++++++++++++++++++++++++++++++-- shared/test/email.test.ts | 42 ++++++++++++++++++++++ 2 files changed, 113 insertions(+), 3 deletions(-) create mode 100644 shared/test/email.test.ts diff --git a/server/src/index.cjs b/server/src/index.cjs index f38e845..48fd78a 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -17,6 +17,7 @@ * Standalone: node server/src/index.cjs (env: PORT, BIND, PUBLIC_URL, TOKEN_TTL_MS, PEERSHELL_DATA) */ const http = require('http') +const https = require('https') const crypto = require('crypto') const fs = require('fs') const path = require('path') @@ -51,6 +52,68 @@ const genAuthToken = () => crypto.randomBytes(32).toString('base64url') const sha256hex = s => crypto.createHash('sha256').update(s).digest('hex') const j = obj => JSON.stringify({ v: 1, ...obj }) +// --- email delivery (Brevo transactional API; stdlib https, zero deps) --- +// We relay through Brevo (not direct VM SMTP) so mail is DKIM/SPF-authoritative for the domain and +// the VM IP is never in the sending path (no blacklist risk). No key configured -> log the code. +function brevoSend(opts) { + return new Promise((resolve, reject) => { + const payload = JSON.stringify({ + sender: { email: opts.from, name: opts.fromName || 'peershell' }, + to: [{ email: opts.to }], + subject: opts.subject, + textContent: opts.text, + }) + const req = https.request({ + hostname: 'api.brevo.com', + path: '/v3/smtp/email', + method: 'POST', + headers: { + 'api-key': opts.apiKey, + accept: 'application/json', + 'content-type': 'application/json', + 'content-length': Buffer.byteLength(payload), + }, + }, res => { + let b = '' + res.on('data', c => { b += c }) + res.on('end', () => { + if ((res.statusCode || 500) < 300) { + resolve({ status: res.statusCode, body: b }) + } else { + reject(new Error(`brevo ${res.statusCode}: ${b.slice(0, 200)}`)) + } + }) + }) + req.on('error', reject) + req.setTimeout(10000, () => req.destroy(new Error('brevo timeout'))) + req.write(payload) + req.end() + }) +} + +async function deliverVerifyCode(email, code, cfg = {}) { + if (cfg.apiKey) { + const send = cfg.sendFn || brevoSend + try { + await send({ + apiKey: cfg.apiKey, + from: cfg.from || 'noreply@peershell.dev', + fromName: cfg.fromName || 'peershell', + to: email, + subject: 'Your peershell verification code', + text: `Your peershell verification code is: ${code}\n\nEnter it in the app to finish creating your account.\nIf you did not request this, you can ignore this email.`, + }) + return { delivered: 'email' } + } catch (e) { + console.warn(`[peershell] verify email to ${email} failed (${e.message}); logging code as fallback`) + console.log(`[peershell] verify code for ${email}: ${code}`) + return { delivered: 'log-fallback' } + } + } + console.log(`[peershell] verify code for ${email}: ${code}`) + return { delivered: 'log' } +} + function hashPassword(password, salt) { const s = salt || crypto.randomBytes(16).toString('hex') const hash = crypto.pbkdf2Sync(password, s, PBKDF2_ITERS, 32, 'sha256').toString('base64') @@ -121,6 +184,11 @@ function startRelay(port = 0, opts = {}) { const tokenTtlMs = opts.tokenTtlMs || DEFAULT_TOKEN_TTL_MS const authTtlMs = opts.authTtlMs || DEFAULT_AUTH_TTL_MS const requireAuth = opts.requireAuth !== false // default ON (production-safe) + const emailCfg = opts.email || { + apiKey: process.env.BREVO_API_KEY || '', + from: process.env.EMAIL_FROM || 'noreply@peershell.dev', + fromName: process.env.EMAIL_FROM_NAME || 'peershell', + } let boundPort = port let publicUrl = opts.publicUrl || '' @@ -331,7 +399,7 @@ function startRelay(port = 0, opts = {}) { if (!existing.verified) { existing.verifyCode = verifyCode saveStore() - console.log(`[peershell] verify code for ${email}: ${verifyCode}`) + await deliverVerifyCode(email, verifyCode, emailCfg) } // anti-enumeration: same response whether new or existing return sendJson(res, 200, { ok: true, needsVerification: true }) @@ -344,7 +412,7 @@ function startRelay(port = 0, opts = {}) { createdAt: now(), lastLogin: null, revoked: false, }) saveStore() - console.log(`[peershell] verify code for ${email}: ${verifyCode}`) + await deliverVerifyCode(email, verifyCode, emailCfg) return sendJson(res, 200, { ok: true, needsVerification: true }) } case '/verify-email': { @@ -684,7 +752,7 @@ function startRelay(port = 0, opts = {}) { }) } -module.exports = { startRelay, hashPassword, verifyPassword, base32Encode, base32Decode, totpAt, verifyTOTP } +module.exports = { startRelay, hashPassword, verifyPassword, base32Encode, base32Decode, totpAt, verifyTOTP, brevoSend, deliverVerifyCode } if (require.main === module) { const port = Number(process.env.PORT || 8787) diff --git a/shared/test/email.test.ts b/shared/test/email.test.ts new file mode 100644 index 0000000..1714ea8 --- /dev/null +++ b/shared/test/email.test.ts @@ -0,0 +1,42 @@ +/** Stage 7: verification-code delivery (Brevo relay) with a mock-log fallback. No network. */ +// eslint-disable-next-line @typescript-eslint/no-var-requires +const server = require('../../server/src/index.cjs') as { + deliverVerifyCode: (email: string, code: string, cfg?: any) => Promise<{ delivered: string }> +} + +describe('deliverVerifyCode', () => { + let logSpy: jest.SpyInstance + let warnSpy: jest.SpyInstance + beforeEach(() => { + logSpy = jest.spyOn(console, 'log').mockImplementation(() => {}) + warnSpy = jest.spyOn(console, 'warn').mockImplementation(() => {}) + }) + afterEach(() => { logSpy.mockRestore(); warnSpy.mockRestore() }) + + it('logs the code when no API key is configured', async () => { + const r = await server.deliverVerifyCode('a@example.com', '123456', {}) + expect(r.delivered).toBe('log') + expect(logSpy.mock.calls.some(c => String(c[0]).includes('verify code for a@example.com') && String(c[0]).includes('123456'))).toBe(true) + }) + + it('sends via the injected mailer when an API key is configured', async () => { + const sent: any[] = [] + const sendFn = async (opts: any) => { sent.push(opts) } + const r = await server.deliverVerifyCode('b@example.com', '654321', { apiKey: 'k', from: 'noreply@peershell.dev', sendFn }) + expect(r.delivered).toBe('email') + expect(sent).toHaveLength(1) + expect(sent[0].to).toBe('b@example.com') + expect(sent[0].apiKey).toBe('k') + expect(sent[0].text).toContain('654321') + // the code must NOT be logged when it went out by email + expect(logSpy.mock.calls.some(c => String(c[0]).includes('654321'))).toBe(false) + }) + + it('falls back to logging the code when the mailer fails', async () => { + const sendFn = async () => { throw new Error('brevo 401') } + const r = await server.deliverVerifyCode('c@example.com', '999000', { apiKey: 'k', sendFn }) + expect(r.delivered).toBe('log-fallback') + expect(warnSpy).toHaveBeenCalled() + expect(logSpy.mock.calls.some(c => String(c[0]).includes('verify code for c@example.com') && String(c[0]).includes('999000'))).toBe(true) + }) +}) From 9e65d6bece28b7f23c26b3f1d93e9045d921873e Mon Sep 17 00:00:00 2001 From: tis24dev Date: Wed, 8 Jul 2026 22:21:47 +0200 Subject: [PATCH 15/75] Stage 7: first-run no-E2E disclaimer dialog + server env docs - PeershellService.confirmDisclaimer(): one-time warning before the first share (via PlatformService.showMessageBox) that guests get a read-write shell and the relay sees traffic in clear text; acknowledged once (config peershell.disclaimerAck). Blocks the share on Cancel. - tabby.d.ts: shim PlatformService/showMessageBox; config defaults gain disclaimerAck + account. - README: document server env (PORT/PUBLIC_URL/PEERSHELL_DATA/TOKEN_TTL_MS/BREVO_API_KEY/EMAIL_FROM), Brevo relay rationale and the DNS to authorise the domain. Build + smoke green. --- README.md | 20 ++++++++++- clients/tabby/src/config.ts | 2 ++ .../tabby/src/services/peershell.service.ts | 33 ++++++++++++++++++- clients/tabby/src/types/tabby.d.ts | 18 ++++++++++ 4 files changed, 71 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 40a7c20..e9396f0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ planned behind the same transport interface. shared/ @peershell/protocol — TS-only, framework-neutral wire protocol (published to npm) clients/tabby/ tabby-peershell — the Tabby plugin (Angular/Electron); all Tabby-specific code clients/web/ @peershell/web-client — standalone browser client (xterm.js), embedded + served by host -server/ @peershell/server — rendezvous + relay + tunnel + accounts (implemented later) +server/ @peershell/server — rendezvous + relay + tunnel + accounts (register/login/2FA) ``` > This repo uses **npm workspaces** (npm >= 9). It is independent of Tabby's package manager: the plugin @@ -50,6 +50,24 @@ ln -s /opt/peershell/clients/tabby ~/.config/tabby/plugins/node_modules/tabby-pe TABBY_DEV=1 TABBY_PLUGINS=/opt/peershell/clients/tabby yarn start ``` +## Server configuration (env) + +`server/src/index.cjs` is a single stdlib file (only `ws`). Configure it via environment variables: + +| var | default | purpose | +|-----|---------|---------| +| `PORT` / `BIND` | `8787` / `0.0.0.0` | listen address | +| `PUBLIC_URL` | (derived) | base for minted magic-links, e.g. `https://panel.peershell.dev` | +| `PEERSHELL_DATA` | `server/data` | dir for `accounts.json` (atomic, mode 0600) | +| `TOKEN_TTL_MS` | 15 min | magic-link lifetime | +| `BREVO_API_KEY` | (unset) | Brevo transactional API key; unset ⇒ verification codes are logged instead of emailed | +| `EMAIL_FROM` / `EMAIL_FROM_NAME` | `noreply@peershell.dev` / `peershell` | verification sender | + +`create-session` is gated behind a valid account token; open registration requires email verification. +Email is relayed through **Brevo** (not direct VM SMTP) so the VM IP stays out of the sending path. +Authorise the domain in Brevo and add its **DKIM** records plus SPF (`include:spf.brevo.com`) and a +`_dmarc` policy to the domain's DNS so mail is authenticated. + ## Publishing `tabby-peershell` is published to npm from `clients/tabby/` (keyword `tabby-plugin`, so Tabby's plugin diff --git a/clients/tabby/src/config.ts b/clients/tabby/src/config.ts index ba68ea6..1f27e29 100644 --- a/clients/tabby/src/config.ts +++ b/clients/tabby/src/config.ts @@ -5,6 +5,8 @@ export class PeershellConfigProvider extends ConfigProvider { peershell: { serverUrl: null, magicLinkTtlMinutes: 15, + disclaimerAck: false, + account: null, }, } diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index 93928db..e6fde3a 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core' import { map } from 'rxjs' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' -import { AppService, ConfigService, NotificationsService, BaseTabComponent, PromptModalComponent } from 'tabby-core' +import { AppService, ConfigService, NotificationsService, BaseTabComponent, PromptModalComponent, PlatformService } from 'tabby-core' import { BaseTerminalTabComponent, ResizeEvent } from 'tabby-terminal' import { WebSocketTransport, normalizeRoomCode, isValidRoomCode, generatePin, PinProvider, HttpTunnelHandler, @@ -24,6 +24,7 @@ export class PeershellService { private readonly notifications: NotificationsService, private readonly ngbModal: NgbModal, private readonly account: AccountService, + private readonly platform: PlatformService, ) {} isSharing(tab: BaseTabComponent): boolean { @@ -43,6 +44,9 @@ export class PeershellService { if (this.shares.has(tab)) { return } + if (!(await this.confirmDisclaimer())) { + return + } const serverUrl: string | null = this.config.store.peershell?.serverUrl if (!serverUrl) { this.notifications.error('peershell: set the server URL in settings first') @@ -148,6 +152,33 @@ export class PeershellService { return value ? value.trim() : null } + /** + * One-time no-E2E disclosure before the first share: guests get a read-write shell and the relay + * sees traffic in clear text. Acknowledged once, remembered in config. + */ + private async confirmDisclaimer(): Promise { + if (this.config.store.peershell?.disclaimerAck) { + return true + } + const r = await this.platform.showMessageBox({ + type: 'warning', + message: 'Share this terminal with peershell?', + detail: 'Guests get full read-write access to this shell. The relay server sees all terminal ' + + 'traffic in clear text — there is no end-to-end encryption yet. Do not share sensitive ' + + 'sessions on a server you do not trust; self-host the server in production.', + buttons: ['Share', 'Cancel'], + defaultId: 1, + cancelId: 1, + }) + if (r.response === 0) { + this.config.store.peershell = this.config.store.peershell || {} + this.config.store.peershell.disclaimerAck = true + await this.config.save() + return true + } + return false + } + /** Opens the account modal (login / register / 2FA / logout). Used by the toolbar button. */ openAccount(): void { this.ngbModal.open(LoginModalComponent) diff --git a/clients/tabby/src/types/tabby.d.ts b/clients/tabby/src/types/tabby.d.ts index cabcae3..b22a324 100644 --- a/clients/tabby/src/types/tabby.d.ts +++ b/clients/tabby/src/types/tabby.d.ts @@ -82,6 +82,24 @@ declare module 'tabby-core' { value: string password: boolean } + + export interface MessageBoxOptions { + type?: string + message: string + detail?: string + buttons?: string[] + defaultId?: number + cancelId?: number + } + + export interface MessageBoxResult { + response: number + checkboxChecked?: boolean + } + + export class PlatformService { + showMessageBox(options: MessageBoxOptions): Promise + } } declare module 'tabby-terminal' { From 8201b8b9e79fd166b35a75f4fad8584e4498d1f8 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 00:18:36 +0200 Subject: [PATCH 16/75] Stage 7: settings tab with account management + live-shares dashboard - PeershellSettingsTabComponent (+ provider): configure the server URL, log in/out, and see the account's live shares (room / guest connected / magic-link) via GET /sessions. Prominent no-E2E security note at the top. Reachable from Tabby's Settings. - AccountService.getSessions(): GET /sessions (dashboard), clears the local token on 401. - tabby.d.ts: shim tabby-settings (SettingsTabProvider); index.ts wires the provider + declares the component. Webpack build + smoke-load green; 41 tests still pass. --- clients/tabby/src/account/account.service.ts | 13 ++ clients/tabby/src/index.ts | 5 + .../src/settings/settings-tab.component.ts | 116 ++++++++++++++++++ .../src/settings/settings-tab.provider.ts | 15 +++ clients/tabby/src/types/tabby.d.ts | 12 ++ 5 files changed, 161 insertions(+) create mode 100644 clients/tabby/src/settings/settings-tab.component.ts create mode 100644 clients/tabby/src/settings/settings-tab.provider.ts diff --git a/clients/tabby/src/account/account.service.ts b/clients/tabby/src/account/account.service.ts index 768341f..8232b33 100644 --- a/clients/tabby/src/account/account.service.ts +++ b/clients/tabby/src/account/account.service.ts @@ -87,6 +87,19 @@ export class AccountService { return this.api('POST', '/2fa/verify', { sessionKey, code }) } + /** Dashboard: the account's live shares. Clears the local token on 401 (expired). */ + async getSessions(): Promise<{ account?: { email: string, totpEnabled: boolean }, sessions: any[], error?: string }> { + const r = await this.api('GET', '/sessions', undefined, true) + if (r.status === 200) { + return { account: (r as any).account, sessions: (r as any).sessions ?? [] } + } + if (r.status === 401) { + await this.clearLocal() + return { sessions: [], error: 'unauthorized' } + } + return { sessions: [], error: String(r.error ?? r.status) } + } + /** Store the bearer token locally (config store). */ async persist(email: string, token: string, expiresAt?: number): Promise { this.config.store.peershell = this.config.store.peershell || {} diff --git a/clients/tabby/src/index.ts b/clients/tabby/src/index.ts index 82b09ab..33fb346 100644 --- a/clients/tabby/src/index.ts +++ b/clients/tabby/src/index.ts @@ -6,6 +6,7 @@ import { NgbModule } from '@ng-bootstrap/ng-bootstrap' import { ToastrModule } from 'ngx-toastr' import TabbyCorePlugin, { ConfigProvider, ToolbarButtonProvider, TabContextMenuItemProvider } from 'tabby-core' import TabbyTerminalModule from 'tabby-terminal' +import { SettingsTabProvider } from 'tabby-settings' import { PROTOCOL_VERSION } from '@peershell/protocol' import { PeershellConfigProvider } from './config' @@ -14,6 +15,8 @@ import { PeershellToolbarButtonProvider } from './providers/toolbarButtonProvide import { PeershellContextMenu } from './providers/tabContextMenu' import { MirrorTabComponent } from './guest/mirrorTab.component' import { LoginModalComponent } from './account/login-modal.component' +import { PeershellSettingsTabProvider } from './settings/settings-tab.provider' +import { PeershellSettingsTabComponent } from './settings/settings-tab.component' @NgModule({ imports: [ @@ -28,10 +31,12 @@ import { LoginModalComponent } from './account/login-modal.component' { provide: ConfigProvider, useClass: PeershellConfigProvider, multi: true }, { provide: ToolbarButtonProvider, useClass: PeershellToolbarButtonProvider, multi: true }, { provide: TabContextMenuItemProvider, useClass: PeershellContextMenu, multi: true }, + { provide: SettingsTabProvider, useClass: PeershellSettingsTabProvider, multi: true }, ], declarations: [ MirrorTabComponent, LoginModalComponent, + PeershellSettingsTabComponent, ], }) export default class PeershellModule { diff --git a/clients/tabby/src/settings/settings-tab.component.ts b/clients/tabby/src/settings/settings-tab.component.ts new file mode 100644 index 0000000..27ddf93 --- /dev/null +++ b/clients/tabby/src/settings/settings-tab.component.ts @@ -0,0 +1,116 @@ +import { Component } from '@angular/core' +import { NgbModal } from '@ng-bootstrap/ng-bootstrap' +import { ConfigService } from 'tabby-core' +import { AccountService } from '../account/account.service' +import { LoginModalComponent } from '../account/login-modal.component' + +interface LiveSession { room: string, magicLink: string, hasGuest: boolean, createdAt: number } + +/** peershell settings tab: server URL, account (login/logout), live-shares dashboard, security note. */ +@Component({ + template: ` +
+

peershell

+
+ No end-to-end encryption yet: the relay server sees all terminal traffic in clear text, and + guests get a full read-write shell. Do not share sensitive sessions on a server you do not + trust; self-host the server in production. Access needs both the magic-link and the per-session PIN. +
+
+ +
+
Server URL
+
Rendezvous server, e.g. wss://panel.peershell.dev
+ +
+ +
+
Account
+
{{ account.isLoggedIn() ? ('Signed in as ' + account.email) : 'Not signed in' }}
+
+ + +
+
+ +
+
+

Active shares

+ +
+
{{ error }}
+

No live shares.

+ + + + + + + + + +
RoomGuestMagic-link
{{ s.room }}{{ s.hasGuest ? 'connected' : '—' }}{{ s.magicLink }}
+
+ `, +}) +export class PeershellSettingsTabComponent { + serverUrl = '' + sessions: LiveSession[] = [] + busy = false + loaded = false + error = '' + + constructor( + private readonly config: ConfigService, + private readonly ngbModal: NgbModal, + readonly account: AccountService, + ) { + this.serverUrl = this.config.store.peershell?.serverUrl ?? '' + if (this.account.isLoggedIn()) { + void this.refresh() + } + } + + async saveServerUrl(): Promise { + this.config.store.peershell = this.config.store.peershell || {} + this.config.store.peershell.serverUrl = this.serverUrl.trim() || null + await this.config.save() + } + + async openLogin(): Promise { + const modal = this.ngbModal.open(LoginModalComponent) + await modal.result.catch(() => null) + if (this.account.isLoggedIn()) { + await this.refresh() + } + } + + async logout(): Promise { + this.busy = true + try { + await this.account.logout() + this.sessions = [] + this.loaded = false + } finally { + this.busy = false + } + } + + async refresh(): Promise { + this.busy = true + this.error = '' + try { + const r = await this.account.getSessions() + if (r.error) { + this.error = r.error === 'unauthorized' ? 'Session expired — log in again.' : `Could not load shares (${r.error}).` + this.sessions = [] + } else { + this.sessions = r.sessions as LiveSession[] + } + this.loaded = true + } finally { + this.busy = false + } + } +} diff --git a/clients/tabby/src/settings/settings-tab.provider.ts b/clients/tabby/src/settings/settings-tab.provider.ts new file mode 100644 index 0000000..8508d25 --- /dev/null +++ b/clients/tabby/src/settings/settings-tab.provider.ts @@ -0,0 +1,15 @@ +import { Injectable } from '@angular/core' +import { SettingsTabProvider } from 'tabby-settings' + +import { PeershellSettingsTabComponent } from './settings-tab.component' + +@Injectable() +export class PeershellSettingsTabProvider extends SettingsTabProvider { + id = 'peershell' + icon = 'share-nodes' + title = 'peershell' + + getComponentType(): any { + return PeershellSettingsTabComponent + } +} diff --git a/clients/tabby/src/types/tabby.d.ts b/clients/tabby/src/types/tabby.d.ts index b22a324..ebf6fa3 100644 --- a/clients/tabby/src/types/tabby.d.ts +++ b/clients/tabby/src/types/tabby.d.ts @@ -102,6 +102,18 @@ declare module 'tabby-core' { } } +declare module 'tabby-settings' { + const _default: any + export default _default + + export abstract class SettingsTabProvider { + id: string + icon: string + title: string + abstract getComponentType(): unknown + } +} + declare module 'tabby-terminal' { import { Observable } from 'rxjs' import { BaseTabComponent } from 'tabby-core' From 0c5f9d36530cd31b0027b6ea4150895d254acb79 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 01:13:56 +0200 Subject: [PATCH 17/75] Stage 7: single peershell toolbar button opening a popup menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - One toolbar button ("peershell"); click opens a native popup menu (PlatformService.popupContextMenu) with Share this terminal / Join a shared terminal / Account (label reflects login state). The toolbar renders provider buttons as Commands and only calls run() on click — it does not open a ToolbarButton submenu — so the dropdown is built via popupContextMenu instead. tabby.d.ts shims popupContextMenu. --- .../src/providers/toolbarButtonProvider.ts | 20 ++----------------- .../tabby/src/services/peershell.service.ts | 12 ++++++++++- clients/tabby/src/types/tabby.d.ts | 1 + 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/clients/tabby/src/providers/toolbarButtonProvider.ts b/clients/tabby/src/providers/toolbarButtonProvider.ts index c2e0c57..0f7d013 100644 --- a/clients/tabby/src/providers/toolbarButtonProvider.ts +++ b/clients/tabby/src/providers/toolbarButtonProvider.ts @@ -17,26 +17,10 @@ export class PeershellToolbarButtonProvider extends ToolbarButtonProvider { return [ { icon: SHARE_ICON, - title: 'Share terminal (peershell)', - weight: 8, - click: () => { - void this.peershell.shareActive() - }, - }, - { - icon: SHARE_ICON, - title: 'Join shared terminal (peershell)', - weight: 9, - click: () => { - void this.peershell.joinShared() - }, - }, - { - icon: SHARE_ICON, - title: 'peershell account (log in / out)', + title: 'peershell', weight: 10, click: () => { - this.peershell.openAccount() + this.peershell.openMenu() }, }, ] diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index e6fde3a..48a8218 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -179,7 +179,17 @@ export class PeershellService { return false } - /** Opens the account modal (login / register / 2FA / logout). Used by the toolbar button. */ + /** Toolbar entry: pops a native dropdown menu with the peershell actions. */ + openMenu(): void { + this.platform.popupContextMenu([ + { label: 'Share this terminal', click: () => { void this.shareActive() } }, + { label: 'Join a shared terminal', click: () => { void this.joinShared() } }, + { type: 'separator' }, + { label: this.account.isLoggedIn() ? 'Account / log out' : 'Log in', click: () => { this.openAccount() } }, + ]) + } + + /** Opens the account modal (login / register / 2FA / logout). */ openAccount(): void { this.ngbModal.open(LoginModalComponent) } diff --git a/clients/tabby/src/types/tabby.d.ts b/clients/tabby/src/types/tabby.d.ts index ebf6fa3..ff689c3 100644 --- a/clients/tabby/src/types/tabby.d.ts +++ b/clients/tabby/src/types/tabby.d.ts @@ -99,6 +99,7 @@ declare module 'tabby-core' { export class PlatformService { showMessageBox(options: MessageBoxOptions): Promise + popupContextMenu(menu: MenuItemOptions[], event?: MouseEvent): void } } From ecd2806b86c0c92b7dfa0723971b48a8d959ae8c Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 01:23:05 +0200 Subject: [PATCH 18/75] Stage 7: CORS on the account REST API (+ OPTIONS preflight) The account endpoints are called cross-origin from the Tabby/Electron renderer (and the browser web-client), so without CORS headers Chromium blocks the fetch ("cannot reach the server"). Add Access-Control-Allow-Origin: * (+ allow headers authorization/content-type, methods GET/POST/OPTIONS) to every response and answer preflight OPTIONS with 204. No cookies are used (bearer token in a header), so '*' is safe. Verified: OPTIONS -> 204 + headers; POST -> 400 with the CORS header. --- server/src/index.cjs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/src/index.cjs b/server/src/index.cjs index 48fd78a..c6504a1 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -557,6 +557,16 @@ function startRelay(port = 0, opts = {}) { const server = http.createServer((req, res) => { const url = (req.url || '').split('?')[0] const method = req.method || 'GET' + // CORS: the account REST API is called cross-origin from the Tabby/Electron renderer (and + // the browser web-client). No cookies are used (bearer token in a header), so '*' is safe. + res.setHeader('Access-Control-Allow-Origin', '*') + res.setHeader('Access-Control-Allow-Headers', 'authorization, content-type') + res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS') + if (method === 'OPTIONS') { + res.writeHead(204) + res.end() + return + } if ((method === 'GET' && url === '/sessions') || (method === 'POST' && REST_POST.has(url))) { return handleRest(req, res) } From c1f0c2f87d95661b17db8f11c195632fbdaa72cf Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 01:26:50 +0200 Subject: [PATCH 19/75] Stage 7: "Create account" registers directly (one less step) On the login form, "Create account" now calls register() with the entered email/password instead of switching to a separate register mode that required a second button press. Drops the standalone register mode; on success it goes straight to the email-verification step. --- .../tabby/src/account/login-modal.component.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/clients/tabby/src/account/login-modal.component.ts b/clients/tabby/src/account/login-modal.component.ts index b68d61b..29b73b0 100644 --- a/clients/tabby/src/account/login-modal.component.ts +++ b/clients/tabby/src/account/login-modal.component.ts @@ -2,7 +2,7 @@ import { Component } from '@angular/core' import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' import { AccountService, AccountApiResult } from './account.service' -type Mode = 'account' | 'login' | 'register' | 'verify' | '2fa' +type Mode = 'account' | 'login' | 'verify' | '2fa' const ERRORS: Record = { 'invalid-credentials': 'Email or password is not valid.', @@ -31,22 +31,13 @@ const ERRORS: Record = {
-
-
-
-
- - -
- -
- At least 8 characters.
- - + At least 8 characters (for a new account). + +
From 5babfbd012e29d7f800c434d44f583b3f59843a7 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 01:32:04 +0200 Subject: [PATCH 20/75] Stage 7: default serverUrl to wss://panel.peershell.dev Ship a working default so the plugin reaches the hosted server out of the box (no manual setup); the empty `peershell: {}` config now inherits this default. Overridable in Settings for self-hosting. --- clients/tabby/src/config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/tabby/src/config.ts b/clients/tabby/src/config.ts index 1f27e29..84d2ceb 100644 --- a/clients/tabby/src/config.ts +++ b/clients/tabby/src/config.ts @@ -3,7 +3,7 @@ import { ConfigProvider } from 'tabby-core' export class PeershellConfigProvider extends ConfigProvider { defaults = { peershell: { - serverUrl: null, + serverUrl: 'wss://panel.peershell.dev', magicLinkTtlMinutes: 15, disclaimerAck: false, account: null, From 5181178280c3194ac2d4e6667ba18742e1acb171 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 01:46:33 +0200 Subject: [PATCH 21/75] =?UTF-8?q?Stage=207:=20account=20UX=20=E2=80=94=20a?= =?UTF-8?q?uto-verify=20without=20email,=20close=20on=20register,=20logout?= =?UTF-8?q?=20menu,=20password=20reset?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Server: registration is adaptive — if the verification email cannot be delivered (no SMTP configured or send fails), the account is auto-verified and a token is returned immediately, so users aren't stranded behind a code they can't receive; when email works, the verify-then-login flow is kept. Existing verified email -> { alreadyRegistered }. New endpoints POST /request-password-reset + /reset-password (code via the same email/log path, 15-min TTL, timing-safe). deliverVerifyCode gains a 'reset' kind for the message. - Client: "Create account" now closes the modal and logs in on auto-verify, or goes to verify only when a code was emailed; "Forgot password?" link + reset-request/reset modes. Toolbar menu shows "Log out (email)" when signed in and "Log in" otherwise (direct logout); PeershellService.logout() added. - Tests: auth suite injects a mailer stub (keeps the verify flow) + a new auto-verify-without-email case. 42 tests green. Live-verified on the box: register -> { token, autoVerified: true }. --- clients/tabby/src/account/account.service.ts | 8 ++ .../src/account/login-modal.component.ts | 125 +++++++++++++----- .../tabby/src/services/peershell.service.ts | 12 +- server/src/index.cjs | 86 +++++++++--- shared/test/auth.integration.test.ts | 39 +++++- 5 files changed, 215 insertions(+), 55 deletions(-) diff --git a/clients/tabby/src/account/account.service.ts b/clients/tabby/src/account/account.service.ts index 8232b33..5062cde 100644 --- a/clients/tabby/src/account/account.service.ts +++ b/clients/tabby/src/account/account.service.ts @@ -87,6 +87,14 @@ export class AccountService { return this.api('POST', '/2fa/verify', { sessionKey, code }) } + requestPasswordReset(email: string): Promise { + return this.api('POST', '/request-password-reset', { email }) + } + + resetPassword(email: string, code: string, newPassword: string): Promise { + return this.api('POST', '/reset-password', { email, code, newPassword }) + } + /** Dashboard: the account's live shares. Clears the local token on 401 (expired). */ async getSessions(): Promise<{ account?: { email: string, totpEnabled: boolean }, sessions: any[], error?: string }> { const r = await this.api('GET', '/sessions', undefined, true) diff --git a/clients/tabby/src/account/login-modal.component.ts b/clients/tabby/src/account/login-modal.component.ts index 29b73b0..d904148 100644 --- a/clients/tabby/src/account/login-modal.component.ts +++ b/clients/tabby/src/account/login-modal.component.ts @@ -2,22 +2,22 @@ import { Component } from '@angular/core' import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' import { AccountService, AccountApiResult } from './account.service' -type Mode = 'account' | 'login' | 'verify' | '2fa' +type Mode = 'account' | 'login' | 'verify' | '2fa' | 'reset-request' | 'reset' const ERRORS: Record = { 'invalid-credentials': 'Email or password is not valid.', - 'needs-verification': 'Verify your email first (check the server log for the code).', + 'needs-verification': 'Verify your email first (check email or the server log for the code).', 'rate-limited': 'Too many attempts. Please try again later.', 'password-too-weak': 'Password must be at least 8 characters.', 'invalid-email': 'Enter a valid email address.', 'invalid': 'Wrong or expired code.', 'invalid-code': 'Wrong 2FA code.', - 'too-many-attempts': 'Too many 2FA attempts. Try logging in again.', + 'too-many-attempts': 'Too many attempts. Try again later.', 'unauthorized': 'Session expired. Please log in again.', 'network-error': 'Cannot reach the peershell server. Check the server URL in settings.', } -/** Register / verify / login / 2FA / logout modal. Resolves modal.close(token) on a successful login. */ +/** Login / create-account / verify / 2FA / password-reset / logout. Resolves modal.close(token) on login. */ @Component({ template: ` @@ -38,6 +38,7 @@ const ERRORS: Record = { At least 8 characters (for a new account). +
@@ -54,6 +55,25 @@ const ERRORS: Record = { + +
+

Enter your email to receive a password-reset code.

+
+
+ + +
+ +
+

Enter the reset code for {{ email }} and a new password.

+
+
+
+ + At least 8 characters.
+ + +

Settings

-
+

- +
` @@ -519,7 +519,7 @@ function startRelay(port = 0, opts = {}) { } }) return sendJson(res, 200, { - account: { email: acct.email, totpEnabled: !!acct.totpEnabled }, + account: { email: acct.email, totpEnabled: !!acct.totpEnabled, totpEnabledAt: acct.totpEnabledAt || null }, sessions, }) } @@ -670,6 +670,7 @@ function startRelay(port = 0, opts = {}) { acct.totpSecret = acct.pendingTotpSecret acct.pendingTotpSecret = null acct.totpEnabled = true + acct.totpEnabledAt = now() saveStore() console.log(`[peershell] 2fa enabled for ${acct.email}`) return sendJson(res, 200, { ok: true }) @@ -685,6 +686,7 @@ function startRelay(port = 0, opts = {}) { acct.totpEnabled = false acct.totpSecret = null acct.pendingTotpSecret = null + acct.totpEnabledAt = null saveStore() console.log(`[peershell] 2fa disabled for ${acct.email}`) return sendJson(res, 200, { ok: true }) From bf7c45eeb846cac0b9dea163efbdf73c6e8ee22e Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 13:51:23 +0200 Subject: [PATCH 46/75] ci/release: align to sibling repos (tag pipeline, main protection, artifacts) Port the addhOn/proxsave release pipeline to this Node monorepo: - .github/scripts/release-policy.sh: shared gate helpers; version helpers adapted to the 4 workspace package.json in lockstep (the "hybrid version-file", canonical = clients/tabby), via node. - Workflows: ci (lint/build/test/smoke/version-lockstep/audit), codeql (best-effort on private repo), release-intake (pr-v* -> version bump + PR dev->main with marker), release-guard (validate PR), post-merge-release (squash gate -> fast-forward dev -> create immutable v* tag + Release), release (build:all -> package-plugin.mjs zip -> SHA256SUMS -> ECDSA sign+verify against pinned pubkey -> upload -> npm publish tabby-peershell + @peershell/protocol). Secrets: PEERSHELL_RELEASE_BOT_TOKEN, PEERSHELL_NPM_TOKEN, PEERSHELL_KEY_SIGNATURE. Pinned pubkey at .github/keys/peershell_release.pub. - scripts/package-plugin.mjs (stage plugin + zip via python3), scripts/check-version-lockstep.mjs. - ESLint (@typescript-eslint) config + root lint script; lint is clean. --- .eslintrc.cjs | 34 + .github/keys/peershell_release.pub | 4 + .github/scripts/release-policy.sh | 156 +++ .github/workflows/ci.yml | 53 + .github/workflows/codeql.yml | 42 + .github/workflows/post-merge-release.yml | 109 ++ .github/workflows/release-guard.yml | 71 ++ .github/workflows/release-intake.yml | 139 +++ .github/workflows/release.yml | 81 ++ package-lock.json | 1241 +++++++++++++++++++++- package.json | 6 +- scripts/check-version-lockstep.mjs | 23 + scripts/package-plugin.mjs | 31 + 13 files changed, 1985 insertions(+), 5 deletions(-) create mode 100644 .eslintrc.cjs create mode 100644 .github/keys/peershell_release.pub create mode 100755 .github/scripts/release-policy.sh create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/codeql.yml create mode 100644 .github/workflows/post-merge-release.yml create mode 100644 .github/workflows/release-guard.yml create mode 100644 .github/workflows/release-intake.yml create mode 100644 .github/workflows/release.yml create mode 100644 scripts/check-version-lockstep.mjs create mode 100644 scripts/package-plugin.mjs diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..fb7ea14 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,34 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + parserOptions: { ecmaVersion: 2020, sourceType: 'module' }, + env: { node: true, browser: true, es2020: true }, + plugins: ['@typescript-eslint'], + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + ignorePatterns: [ + 'node_modules/', + '**/dist/', + 'build/', + 'coverage/', + '**/*.map', + '**/*.html', + 'server/src/qrcode.js', // vendored QR generator (third-party) + 'clients/tabby/assets/', // generated web-client asset + ], + rules: { + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/explicit-module-boundary-types': 'off', + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-this-alias': 'off', + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': ['error', { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_', + }], + }, + overrides: [ + // Ambient type shims mirror the host API and legitimately carry unused type params. + { files: ['**/*.d.ts'], rules: { '@typescript-eslint/no-unused-vars': 'off' } }, + ], +} diff --git a/.github/keys/peershell_release.pub b/.github/keys/peershell_release.pub new file mode 100644 index 0000000..47420af --- /dev/null +++ b/.github/keys/peershell_release.pub @@ -0,0 +1,4 @@ +-----BEGIN PUBLIC KEY----- +MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE58hHI/hgG1Hs4xxQPr/EMCFXKlPq +O9wMvIYPCFHqu+f66BKJ6VQEpnjQj+2q2Axk6PcvvDuhGktlAx/qHEqnRQ== +-----END PUBLIC KEY----- diff --git a/.github/scripts/release-policy.sh b/.github/scripts/release-policy.sh new file mode 100755 index 0000000..90dacdf --- /dev/null +++ b/.github/scripts/release-policy.sh @@ -0,0 +1,156 @@ +#!/usr/bin/env bash +# Shared release-gate helpers. Sourced by the release workflows. On write-credentialed +# jobs it is sourced from origin/main (the trusted base), never from the pushed tag tree. + +RELEASE_TAG_REGEX='^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$' +# Unprotected trigger tag that starts a release. It deliberately does NOT match the +# protected v*.*.* ruleset, so it can be created/deleted freely; the real vX.Y.Z tag +# is created once on the squash commit by post-merge-release. +PR_TAG_REGEX='^pr-v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z.-]+)?$' + +# Workspace package.json files kept in lockstep (the "hybrid version-file"). The root +# package.json stays private at 0.0.0 and is NOT bumped. clients/tabby is canonical +# (the primary published artifact, tabby-peershell). +WORKSPACE_PKGS=(shared/package.json clients/web/package.json clients/tabby/package.json server/package.json) +CANONICAL_PKG='clients/tabby/package.json' + +die() { + echo "::error::$*" >&2 + exit 1 +} + +notice() { + echo "::notice::$*" +} + +is_release_tag() { + [[ "${1:-}" =~ ${RELEASE_TAG_REGEX} ]] +} + +validate_release_tag() { + local tag="${1:-}" + if ! is_release_tag "${tag}"; then + die "Invalid release tag '${tag}'. Allowed formats are vX.Y.Z and vX.Y.Z-." + fi +} + +# Any prerelease suffix (-rc1, -beta1, ...) marks a prerelease. +is_beta_tag() { + [[ "${1:-}" == *-* ]] +} + +is_pr_tag() { + [[ "${1:-}" =~ ${PR_TAG_REGEX} ]] +} + +# pr-vX.Y.Z -> vX.Y.Z (the release tag that will be CREATED at merge). +release_tag_from_pr_tag() { + local pr_tag="${1:-}" + if ! is_pr_tag "${pr_tag}"; then + die "Invalid trigger tag '${pr_tag}'. Expected pr-vX.Y.Z or pr-vX.Y.Z-." + fi + printf '%s\n' "${pr_tag#pr-}" +} + +version_from_tag() { + local tag="${1:-}" + validate_release_tag "${tag}" + printf '%s\n' "${tag#v}" +} + +# Read the canonical workspace version at a git ref (via node, always present). +version_at_ref() { + local ref="${1:-}" + git show "${ref}:${CANONICAL_PKG}" \ + | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>process.stdout.write(String(JSON.parse(s).version)))' +} + +# Rewrite .version in each workspace package.json (2-space indent + trailing newline). +set_version() { + local version="${1:-}" + local pkg + for pkg in "${WORKSPACE_PKGS[@]}"; do + node -e ' + const fs = require("fs"); + const [file, version] = process.argv.slice(1); + const j = JSON.parse(fs.readFileSync(file, "utf8")); + j.version = version; + fs.writeFileSync(file, JSON.stringify(j, null, 2) + "\n"); + ' "${pkg}" "${version}" + done +} + +# Assert every workspace version at equals the tag version (the lockstep invariant). +assert_versions_match_tag() { + local ref="${1:-}" + local tag="${2:-}" + local expected pkg actual + expected="$(version_from_tag "${tag}")" + for pkg in "${WORKSPACE_PKGS[@]}"; do + actual="$(git show "${ref}:${pkg}" \ + | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>process.stdout.write(String(JSON.parse(s).version)))')" + if [[ "${actual}" != "${expected}" ]]; then + die "${pkg} version '${actual}' does not match tag '${tag}' (expected '${expected}')." + fi + done +} + +extract_pr_marker() { + local marker="${1:-}" + PR_MARKER="${marker}" node -e ' + const body = process.env.PR_BODY || ""; + const marker = process.env.PR_MARKER.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); + const re = new RegExp("^$", "m"); + const m = body.match(re); + if (!m) { process.exit(1); } + process.stdout.write(m[1].trim()); + ' +} + +delete_remote_tag() { + local tag="${1:-}" + git push origin ":refs/tags/${tag}" || \ + echo "::warning::Failed to delete tag ${tag} (non-fatal); it may need manual cleanup before this version can be re-released." +} + +# Existence probes that DISTINGUISH absent from error (fail closed on error). Echo: present|absent|error. +remote_tag_state() { + local tag="${1:-}" + local rc=0 + git ls-remote --exit-code --tags origin "refs/tags/${tag}" >/dev/null 2>&1 || rc=$? + case "${rc}" in + 0) echo "present" ;; + 2) echo "absent" ;; + *) echo "error" ;; + esac +} + +remote_release_state() { + local tag="${1:-}" + local out + local rc=0 + out="$(gh api "repos/${GITHUB_REPOSITORY}/releases/tags/${tag}" 2>&1)" || rc=$? + if [[ "${rc}" -eq 0 ]]; then + echo "present" + elif printf '%s' "${out}" | grep -qi 'HTTP 404\|Not Found'; then + echo "absent" + else + echo "error" + fi +} + +assert_release_tag_absent() { + local tag="${1:-}" + case "$(remote_tag_state "${tag}")" in + present) die "Tag ${tag} already exists and is immutable." ;; + error) die "Could not determine whether tag ${tag} exists (git ls-remote failed); aborting." ;; + esac +} + +assert_release_absent() { + local tag="${1:-}" + case "$(remote_release_state "${tag}")" in + present) die "Release ${tag} already exists." ;; + error) die "Could not determine whether release ${tag} exists (gh api failed); aborting." ;; + esac +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4b5321e --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI + +on: + pull_request: + branches: + - main + - dev + push: + branches: + - dev + +permissions: + contents: read + +concurrency: + group: ci-${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + ci: + name: ci + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install + run: npm ci || npm install + + - name: Lint + run: npm run lint + + - name: Build all (also typechecks every workspace) + run: npm run build:all + + - name: Test + run: npm test + + - name: Smoke + run: npm run test:smoke + + - name: Version lockstep + run: node scripts/check-version-lockstep.mjs + + - name: Dependency audit (advisory) + run: npm audit --audit-level=high || true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..b5ee678 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,42 @@ +name: CodeQL + +# Static security analysis. On a PRIVATE repo, code scanning requires GitHub Advanced +# Security; without it the analyze step fails, so this workflow is NOT a required check +# (it runs best-effort). Make it required once the repo is public or GHAS is enabled. +on: + push: + branches: + - dev + - main + pull_request: + branches: + - dev + - main + schedule: + - cron: "30 4 * * 1" + +permissions: + contents: read + security-events: write + +concurrency: + group: codeql-${{ github.ref }} + cancel-in-progress: true + +jobs: + codeql: + name: codeql + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: javascript-typescript + + - name: Analyze + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/post-merge-release.yml b/.github/workflows/post-merge-release.yml new file mode 100644 index 0000000..1282fa1 --- /dev/null +++ b/.github/workflows/post-merge-release.yml @@ -0,0 +1,109 @@ +name: Post Merge Release + +on: + pull_request: + branches: + - main + types: + - closed + +permissions: + contents: write + pull-requests: read + +concurrency: + group: post-merge-release + cancel-in-progress: false + +env: + GH_TOKEN: ${{ secrets.PEERSHELL_RELEASE_BOT_TOKEN || github.token }} + GITHUB_TOKEN: ${{ secrets.PEERSHELL_RELEASE_BOT_TOKEN || github.token }} + +jobs: + finalize-release: + name: finalize-release + if: > + github.event.pull_request.merged == true && + github.event.pull_request.base.ref == 'main' && + github.event.pull_request.head.ref == 'dev' && + github.event.pull_request.head.repo.full_name == github.repository + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + fetch-depth: 0 + token: ${{ secrets.PEERSHELL_RELEASE_BOT_TOKEN || github.token }} + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Finalize release + shell: bash + env: + MERGE_SHA: ${{ github.event.pull_request.merge_commit_sha }} + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + PR_BODY: ${{ github.event.pull_request.body }} + run: | + set -euo pipefail + source .github/scripts/release-policy.sh + + HAS_RELEASE_MARKER="false" + TAG="" + + if TAG="$(extract_pr_marker release-tag)"; then + HAS_RELEASE_MARKER="true" + validate_release_tag "${TAG}" + else + notice "No release marker found; syncing dev to the squash commit without publishing a release." + fi + + git fetch --force origin dev main + + MAIN_SHA="$(git rev-parse origin/main)" + DEV_SHA="$(git rev-parse origin/dev)" + + [[ "${MERGE_SHA}" == "${MAIN_SHA}" ]] || die "main (${MAIN_SHA}) does not point to the PR merge commit (${MERGE_SHA})." + + PARENT_COUNT="$(git show -s --format=%P "${MERGE_SHA}" | wc -w | tr -d ' ')" + [[ "${PARENT_COUNT}" == "1" ]] || die "The PR was not squash-merged; refusing to create a release." + + # The squash commit on main must capture EXACTLY the current dev tree (compare + # trees, so review fix commits are fine as long as content equals dev). + MERGE_TREE="$(git rev-parse "${MERGE_SHA}^{tree}")" + DEV_TREE="$(git rev-parse "origin/dev^{tree}")" + [[ "${MERGE_TREE}" == "${DEV_TREE}" ]] || die "origin/dev content differs from the merged release; refusing to overwrite dev. Reconcile dev with main manually." + + if [[ "${HAS_RELEASE_MARKER}" == "true" ]]; then + assert_versions_match_tag "${MERGE_SHA}" "${TAG}" + fi + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + # Fast-forward dev onto the squash commit (lease so a concurrent push aborts). + git push origin "${MERGE_SHA}:refs/heads/dev" --force-with-lease="refs/heads/dev:${DEV_SHA}" + + if [[ "${HAS_RELEASE_MARKER}" != "true" ]]; then + notice "dev synchronized to ${MERGE_SHA}; no release marker was present." + exit 0 + fi + + # The vX.Y.Z tag is immutable: it must NOT exist yet (we only CREATE it, once). + # Gates FAIL CLOSED on transient errors. + assert_release_absent "${TAG}" + assert_release_tag_absent "${TAG}" + + # Create the tag AND publish the release in one step. `gh release create` with a + # not-yet-existing tag CREATES it at --target (the squash commit) = a tag CREATION, + # which the immutable-tag ruleset allows. The `release: published` event then fires + # release.yml to build + attach assets + npm publish. (Must be created by the PAT so + # the downstream workflow triggers.) + RELEASE_ARGS=(release create "${TAG}" --target "${MERGE_SHA}" --title "${TAG}" --generate-notes) + if is_beta_tag "${TAG}"; then + RELEASE_ARGS+=(--prerelease) + fi + + gh "${RELEASE_ARGS[@]}" diff --git a/.github/workflows/release-guard.yml b/.github/workflows/release-guard.yml new file mode 100644 index 0000000..ccc9da2 --- /dev/null +++ b/.github/workflows/release-guard.yml @@ -0,0 +1,71 @@ +name: Release Guard + +on: + pull_request: + branches: + - main + types: + - opened + - reopened + - synchronize + - edited + - ready_for_review + +permissions: + contents: read + pull-requests: read + +jobs: + release-guard: + name: release-guard + runs-on: ubuntu-latest + steps: + - name: Checkout trusted base policy + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + fetch-depth: 0 + ref: ${{ github.event.pull_request.base.sha }} + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Validate release PR + shell: bash + env: + PR_BASE_REF: ${{ github.event.pull_request.base.ref }} + PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} + PR_HEAD_REPO: ${{ github.event.pull_request.head.repo.full_name }} + PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }} + PR_BODY: ${{ github.event.pull_request.body }} + REPOSITORY: ${{ github.repository }} + run: | + set -euo pipefail + + if [[ ! -f .github/scripts/release-policy.sh ]]; then + echo "::notice::Release policy is not present on base yet; allowing bootstrap PR." + exit 0 + fi + + source .github/scripts/release-policy.sh + + [[ "${PR_BASE_REF}" == "main" ]] || die "Release PRs must target main." + [[ "${PR_HEAD_REF}" == "dev" ]] || die "main only accepts release PRs from dev." + [[ "${PR_HEAD_REPO}" == "${REPOSITORY}" ]] || die "Release PRs must come from the same repository." + + # Maintenance (non-release) PRs dev -> main carry no release marker. Allow them: + # post-merge syncs dev without publishing a release. + if ! TAG="$(extract_pr_marker release-tag)"; then + notice "No release marker in PR body; treating as a maintenance dev -> main PR." + exit 0 + fi + + validate_release_tag "${TAG}" + + # Validate against the LIVE state of dev so review fix commits are fine as long + # as the workspace versions still match the release tag. + git fetch --force origin dev + DEV_SHA="$(git rev-parse origin/dev)" + + assert_versions_match_tag "${DEV_SHA}" "${TAG}" diff --git a/.github/workflows/release-intake.yml b/.github/workflows/release-intake.yml new file mode 100644 index 0000000..ac644cb --- /dev/null +++ b/.github/workflows/release-intake.yml @@ -0,0 +1,139 @@ +name: Release Intake + +# Started by pushing an UNPROTECTED pr-vX.Y.Z tag on dev. That tag does NOT match the +# protected v*.*.* ruleset, so it can be created/deleted freely. This workflow never +# creates or moves a v* tag: the authoritative vX.Y.Z tag is CREATED ONCE on the squash +# commit by post-merge-release (a tag creation, which the ruleset allows). +on: + push: + tags: + - "pr-v*" + +permissions: + contents: write + pull-requests: write + +concurrency: + group: release-intake-${{ github.ref_name }} + cancel-in-progress: false + +env: + GH_TOKEN: ${{ secrets.PEERSHELL_RELEASE_BOT_TOKEN || github.token }} + GITHUB_TOKEN: ${{ secrets.PEERSHELL_RELEASE_BOT_TOKEN || github.token }} + +jobs: + open-release-pr: + name: open-release-pr + if: ${{ github.event.deleted != true }} + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + fetch-depth: 0 + token: ${{ secrets.PEERSHELL_RELEASE_BOT_TOKEN || github.token }} + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Validate trigger tag and open release PR + shell: bash + run: | + set -euo pipefail + + # SECURITY: source the release policy from the TRUSTED base (origin/main), + # never from the checked-out tag tree (= dev HEAD, the to-be-released code). + # Bootstrap: fall back to the tag's policy only when main has no policy yet. + git fetch --force origin main + POLICY="$(mktemp)" + if git cat-file -e "origin/main:.github/scripts/release-policy.sh" 2>/dev/null; then + git show "origin/main:.github/scripts/release-policy.sh" > "${POLICY}" + else + echo "::notice::Release policy absent on origin/main; bootstrap release, using the tag's policy." + cp .github/scripts/release-policy.sh "${POLICY}" + fi + # shellcheck source=/dev/null + source "${POLICY}" + + TRIGGER="${GITHUB_REF_NAME}" + + if ! is_pr_tag "${TRIGGER}"; then + echo "::error::Invalid trigger '${TRIGGER}'. Push pr-vX.Y.Z (or pr-vX.Y.Z-) on dev to start a release." + delete_remote_tag "${TRIGGER}" + exit 1 + fi + + TAG="$(release_tag_from_pr_tag "${TRIGGER}")" + RELEASE_VERSION="$(version_from_tag "${TAG}")" + + git fetch --force origin dev main "refs/tags/${TRIGGER}:refs/tags/${TRIGGER}" + + TRIGGER_SHA="$(git rev-list -n 1 "${TRIGGER}")" + DEV_SHA="$(git rev-parse origin/dev)" + + if [[ "${TRIGGER_SHA}" != "${DEV_SHA}" ]]; then + echo "::error::${TRIGGER} must point to HEAD of dev (${DEV_SHA}), but points to ${TRIGGER_SHA}." + delete_remote_tag "${TRIGGER}" + exit 1 + fi + + # v* tags are immutable: refuse to start a release whose version is already + # published or tagged. Probes distinguish absent from error (fail closed). + REL_STATE="$(remote_release_state "${TAG}")" + TAG_STATE="$(remote_tag_state "${TAG}")" + if [[ "${REL_STATE}" == "present" || "${TAG_STATE}" == "present" ]]; then + delete_remote_tag "${TRIGGER}" + die "Version ${TAG} already exists (release=${REL_STATE}, tag=${TAG_STATE}); pick a new version." + fi + if [[ "${REL_STATE}" == "error" || "${TAG_STATE}" == "error" ]]; then + die "Could not verify whether ${TAG} already exists (release=${REL_STATE}, tag=${TAG_STATE}); aborting." + fi + + OPEN_PR="$(gh pr list --base main --head dev --state open --json number --jq '.[0].number // ""')" + if [[ -n "${OPEN_PR}" ]]; then + PR_BODY="$(gh pr view "${OPEN_PR}" --json body --jq '.body')" + export PR_BODY + if PR_TAG="$(extract_pr_marker release-tag)" && [[ "${PR_TAG}" == "${TAG}" ]]; then + notice "Release PR #${OPEN_PR} for ${TAG} already open." + delete_remote_tag "${TRIGGER}" + exit 0 + fi + delete_remote_tag "${TRIGGER}" + die "An open dev -> main PR already exists (#${OPEN_PR}). Close or merge it before starting a new release." + fi + + # Align the workspace versions on dev with the requested release. dev is not + # protected, so this normal commit + push is fine. + CURRENT_VERSION="$(version_at_ref "${DEV_SHA}")" + if [[ "${CURRENT_VERSION}" != "${RELEASE_VERSION}" ]]; then + notice "Updating workspace versions from ${CURRENT_VERSION} to ${RELEASE_VERSION} for ${TAG}." + git checkout -B dev origin/dev + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + set_version "${RELEASE_VERSION}" + if ! git diff --quiet -- "${WORKSPACE_PKGS[@]}"; then + git add "${WORKSPACE_PKGS[@]}" + git commit -m "chore: set version ${RELEASE_VERSION}" + git push origin HEAD:refs/heads/dev + fi + else + assert_versions_match_tag "${DEV_SHA}" "${TAG}" + fi + + # The trigger tag has done its job. Remove it (unprotected -> allowed). + delete_remote_tag "${TRIGGER}" + + BODY="$(cat < + EOF + )" + + gh pr create \ + --base main \ + --head dev \ + --title "Release ${TAG}" \ + --body "${BODY}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2af649e --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,81 @@ +name: Release Asset + +# Fires when post-merge-release publishes a vX.Y.Z release. Builds the Tabby plugin, +# attaches the signed artifact to the release, and publishes to npm. +on: + release: + types: + - published + +permissions: + contents: write + +concurrency: + group: release-asset-${{ github.event.release.tag_name }} + cancel-in-progress: false + +jobs: + build-publish: + name: build-publish + if: startsWith(github.event.release.tag_name, 'v') + runs-on: ubuntu-latest + steps: + - name: Checkout released tag + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + ref: ${{ github.event.release.tag_name }} + persist-credentials: false + + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version: "20" + registry-url: "https://registry.npmjs.org" + + - name: Install + run: npm ci || npm install + + - name: Build all + run: npm run build:all + + - name: Test + smoke + run: | + npm test + npm run test:smoke + + - name: Package plugin + run: node scripts/package-plugin.mjs + + - name: Checksums + run: sha256sum tabby-peershell.zip > SHA256SUMS + + - name: Sign checksums (ECDSA P-256) and verify against pinned key + env: + SIGNING_KEY: ${{ secrets.PEERSHELL_KEY_SIGNATURE }} + run: | + set -euo pipefail + [ -n "${SIGNING_KEY}" ] || { echo "::error::PEERSHELL_KEY_SIGNATURE is empty"; exit 1; } + printf '%s\n' "${SIGNING_KEY}" > "${RUNNER_TEMP}/sign.key" + openssl dgst -sha256 -sign "${RUNNER_TEMP}/sign.key" -out SHA256SUMS.sig SHA256SUMS + shred -u "${RUNNER_TEMP}/sign.key" 2>/dev/null || rm -f "${RUNNER_TEMP}/sign.key" + # Fail-closed: the signature MUST verify against the committed public key. + openssl dgst -sha256 -verify .github/keys/peershell_release.pub -signature SHA256SUMS.sig SHA256SUMS + + - name: Upload assets to release + env: + GH_TOKEN: ${{ github.token }} + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + set -euo pipefail + gh release upload "$RELEASE_TAG" tabby-peershell.zip SHA256SUMS SHA256SUMS.sig --clobber + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.PEERSHELL_NPM_TOKEN }} + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + set -euo pipefail + DIST_TAG=latest + case "$RELEASE_TAG" in *-*) DIST_TAG=next ;; esac + npm publish -w @peershell/protocol --access public --tag "$DIST_TAG" + npm publish -w tabby-peershell --access public --tag "$DIST_TAG" diff --git a/package-lock.json b/package-lock.json index 8a1066e..6f1d882 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,9 @@ ], "devDependencies": { "@types/ws": "^8.18.1", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "eslint": "^8.57.1", "typescript": "^4.9.5", "ws": "^8.21.0" }, @@ -823,6 +826,194 @@ "node": ">=10.0.0" } }, + "node_modules/@eslint-community/eslint-utils": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.9.1.tgz", + "integrity": "sha512-phrYmNiYppR7znFEdqgfWHXR6NCkZEK7hwWDHZUjit/2/U0r6XvkDl0SYnoM51Hq7FhCGdLDT6zxCCOY1hexsQ==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^3.4.3" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" + } + }, + "node_modules/@eslint-community/regexpp": { + "version": "4.12.2", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz", + "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==", + "dev": true, + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.4.tgz", + "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.6.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@eslint/eslintrc/node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@eslint/eslintrc/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/brace-expansion": { + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", + "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@eslint/eslintrc/node_modules/js-yaml": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/@eslint/eslintrc/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/@eslint/eslintrc/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@eslint/js": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.1.tgz", + "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.13.0.tgz", + "integrity": "sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==", + "deprecated": "Use @eslint/config-array instead", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^2.0.3", + "debug": "^4.3.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/brace-expansion": { + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", + "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.3.tgz", + "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", + "deprecated": "Use @eslint/object-schema instead", + "dev": true + }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1342,6 +1533,41 @@ "webpack": "^5.54.0" } }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/@parcel/watcher": { "version": "2.5.6", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.6.tgz", @@ -1831,6 +2057,12 @@ "integrity": "sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==", "dev": true }, + "node_modules/@types/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-FmgJfu+MOcQ370SD0ev7EI8TlCAfKYU+B4m5T3yXc1CiRN94g/SZPtsCkk506aUDtlMnFZvasDwHHUcZUEaYuA==", + "dev": true + }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -1861,6 +2093,217 @@ "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==", "dev": true }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", + "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "dev": true, + "dependencies": { + "@eslint-community/regexpp": "^4.5.1", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/type-utils": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.2.4", + "natural-compare": "^1.4.0", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", + "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/utils": "6.21.0", + "debug": "^4.3.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@ungap/structured-clone": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.3.2.tgz", + "integrity": "sha512-5jsZFwgR5rTdKwidH9Qmat75RKwqfpKlWWB1frDkljN127mwqBu8K0PYo7/hFpF03IEJpfVPpCQDY/eDx3iHvA==", + "dev": true + }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -2239,6 +2682,15 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/asap": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", @@ -2462,7 +2914,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.1.tgz", "integrity": "sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==", - "peer": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -3003,6 +3454,12 @@ } } }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -3048,6 +3505,30 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/doctypes": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/doctypes/-/doctypes-1.1.0.tgz", @@ -3273,6 +3754,62 @@ "node": ">=8" } }, + "node_modules/eslint": { + "version": "8.57.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.1.tgz", + "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", + "deprecated": "This version is no longer supported. Please see https://eslint.org/version-support for other options.", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.6.1", + "@eslint/eslintrc": "^2.1.4", + "@eslint/js": "8.57.1", + "@humanwhocodes/config-array": "^0.13.0", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", + "ajv": "^6.12.4", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.2", + "eslint-visitor-keys": "^3.4.3", + "espree": "^9.6.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "graphemer": "^1.4.0", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3", + "strip-ansi": "^6.0.1", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/eslint-scope": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", @@ -3286,6 +3823,259 @@ "node": ">=8.0.0" } }, + "node_modules/eslint-visitor-keys": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", + "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/ajv": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz", + "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/eslint/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/eslint/node_modules/brace-expansion": { + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", + "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", + "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/eslint/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/eslint/node_modules/js-yaml": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.3.0.tgz", + "integrity": "sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/eslint/node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/eslint/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/eslint/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/eslint/node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/espree": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", + "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", + "dev": true, + "dependencies": { + "acorn": "^8.9.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/espree/node_modules/acorn": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/espree/node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", @@ -3299,6 +4089,27 @@ "node": ">=4" } }, + "node_modules/esquery": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz", + "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, "node_modules/esrecurse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", @@ -3334,7 +4145,6 @@ "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, - "peer": true, "engines": { "node": ">=0.10.0" } @@ -3402,12 +4212,34 @@ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, + "node_modules/fast-glob": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz", + "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": ">=8.6.0" + } + }, "node_modules/fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, "node_modules/fast-uri": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.3.tgz", @@ -3433,6 +4265,15 @@ "node": ">= 4.9.1" } }, + "node_modules/fastq": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.1.tgz", + "integrity": "sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, "node_modules/fb-watchman": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz", @@ -3442,6 +4283,18 @@ "bser": "2.1.1" } }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -3494,6 +4347,26 @@ "flat": "cli.js" } }, + "node_modules/flat-cache": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.2.0.tgz", + "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", + "dev": true, + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.3", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3628,6 +4501,53 @@ "node": ">= 6" } }, + "node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globals/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/gopd": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", @@ -3647,6 +4567,12 @@ "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", "dev": true }, + "node_modules/graphemer": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz", + "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", + "dev": true + }, "node_modules/handlebars": { "version": "4.7.9", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz", @@ -3892,12 +4818,46 @@ "postcss": "^8.1.0" } }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, "node_modules/immutable": { "version": "5.1.9", "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.9.tgz", "integrity": "sha512-m8nVez3rwrgmWxtLMt1ZYXB2Lv7OKYn/disyxAlSDYAlKSlFoPPfIAmAM/M5xqL4m4C/wAPw7S2/CNaUii1Hxg==", "dev": true }, + "node_modules/import-fresh": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz", + "integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-fresh/node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/import-local": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.2.0.tgz", @@ -4117,6 +5077,15 @@ "node": ">=0.12.0" } }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -5048,6 +6017,12 @@ "node": ">=6" } }, + "node_modules/json-buffer": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", + "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==", + "dev": true + }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", @@ -5060,6 +6035,12 @@ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -5082,6 +6063,15 @@ "promise": "^7.0.1" } }, + "node_modules/keyv": { + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz", + "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==", + "dev": true, + "dependencies": { + "json-buffer": "3.0.1" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -5119,6 +6109,19 @@ "node": ">=6" } }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/lines-and-columns": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", @@ -5191,6 +6194,12 @@ "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==", "dev": true }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "node_modules/longest": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", @@ -5275,6 +6284,15 @@ "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", "dev": true }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, "node_modules/micromatch": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", @@ -5531,6 +6549,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/optionator": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz", + "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/p-limit": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-4.0.0.tgz", @@ -5580,6 +6615,18 @@ "tslib": "^2.0.3" } }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parse-json": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", @@ -5641,6 +6688,15 @@ "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -5787,6 +6843,15 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/pretty-error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", @@ -5997,6 +7062,15 @@ "integrity": "sha512-GMu3M5nUL3fju4/egXwZO0XLi6fW/K3T3VTgFQ14GxNi8btlxgT5qZL//JwZFm/2Fa64J/PNS8AZeys3wiMkVA==", "dev": true }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, "node_modules/pure-rand": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/pure-rand/-/pure-rand-6.1.0.tgz", @@ -6013,6 +7087,26 @@ } ] }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/react-is": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", @@ -6154,6 +7248,16 @@ "node": ">=10" } }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, "node_modules/right-align": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", @@ -6167,6 +7271,88 @@ "node": ">=0.10.0" } }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/brace-expansion": { + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.16.tgz", + "integrity": "sha512-IDw48K2/2kRkg9LdJxurvq3lV3aBgq0REY89duEqFRthjlPdXHKMj7EnQOXVckxzgisinf3nHfrcE2FufFLXMw==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/rimraf/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rimraf/node_modules/minimatch": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz", + "integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, "node_modules/rxjs": { "version": "7.8.2", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", @@ -6695,6 +7881,12 @@ "node": "*" } }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -6729,6 +7921,18 @@ "dev": true, "peer": true }, + "node_modules/ts-api-utils": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.4.3.tgz", + "integrity": "sha512-i3eMG77UTMD0hZhgRS562pv83RC6ukSAC2GMNWc+9dieh/+jDM5u5YG+NHX6VNDRHQcHwmsTHctP9LhbC3WxVw==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "typescript": ">=4.2.0" + } + }, "node_modules/ts-jest": { "version": "29.4.11", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.11.tgz", @@ -6843,6 +8047,18 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==" }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", @@ -6968,6 +8184,15 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -7232,6 +8457,15 @@ "node": ">=0.4.0" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wordwrap": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", @@ -7280,7 +8514,6 @@ "version": "8.21.0", "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz", "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==", - "dev": true, "engines": { "node": ">=10.0.0" }, @@ -7404,7 +8637,7 @@ "version": "0.1.0", "license": "Apache-2.0", "dependencies": { - "@peershell/protocol": "*" + "ws": "^8.18.0" } }, "shared": { diff --git a/package.json b/package.json index 4b678c0..c73d25c 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,9 @@ }, "devDependencies": { "@types/ws": "^8.18.1", + "@typescript-eslint/eslint-plugin": "^6.21.0", + "@typescript-eslint/parser": "^6.21.0", + "eslint": "^8.57.1", "typescript": "^4.9.5", "ws": "^8.21.0" }, @@ -28,6 +31,7 @@ "build:all": "npm run build:shared && npm run build:web && npm run copy:web-asset && npm run build:tabby && npm run build:server", "watch:tabby": "npm run watch -w tabby-peershell", "test": "jest", - "test:smoke": "node clients/tabby/test/smoke-load.cjs" + "test:smoke": "node clients/tabby/test/smoke-load.cjs", + "lint": "eslint . --ext .ts,.cjs,.mjs" } } diff --git a/scripts/check-version-lockstep.mjs b/scripts/check-version-lockstep.mjs new file mode 100644 index 0000000..528d970 --- /dev/null +++ b/scripts/check-version-lockstep.mjs @@ -0,0 +1,23 @@ +// The publishable/workspace package.json versions must stay in lockstep (the release +// pipeline bumps them together). Fails CI if they diverge. +import { readFileSync } from 'node:fs' + +const pkgs = [ + 'shared/package.json', + 'clients/web/package.json', + 'clients/tabby/package.json', + 'server/package.json', +] + +const versions = pkgs.map(p => [p, JSON.parse(readFileSync(p, 'utf8')).version]) +const distinct = [...new Set(versions.map(([, v]) => v))] + +if (distinct.length !== 1) { + console.error('Version lockstep FAILED — workspaces disagree:') + for (const [p, v] of versions) { + console.error(` ${p} = ${v}`) + } + process.exit(1) +} + +console.log(`version lockstep OK: all workspaces at ${distinct[0]}`) diff --git a/scripts/package-plugin.mjs b/scripts/package-plugin.mjs new file mode 100644 index 0000000..cc3e5e6 --- /dev/null +++ b/scripts/package-plugin.mjs @@ -0,0 +1,31 @@ +// Stage the loadable Tabby plugin (package.json + built dist/) and zip it to +// tabby-peershell.zip at the repo root. The web-client HTML is bundled into +// dist/index.js at build time, so only package.json + dist/ are needed. +// Uses python3 for the zip (the `zip` CLI is not present everywhere). +import { mkdirSync, rmSync, copyFileSync, existsSync } from 'node:fs' +import { execFileSync } from 'node:child_process' +import path from 'node:path' + +const root = process.cwd() +const tabby = path.join(root, 'clients', 'tabby') +const distIndex = path.join(tabby, 'dist', 'index.js') +if (!existsSync(distIndex)) { + throw new Error('build first: clients/tabby/dist/index.js missing (run `npm run build:all`)') +} + +const stage = path.join(root, 'build') +const pkgDir = path.join(stage, 'tabby-peershell') +rmSync(stage, { recursive: true, force: true }) +mkdirSync(path.join(pkgDir, 'dist'), { recursive: true }) + +copyFileSync(path.join(tabby, 'package.json'), path.join(pkgDir, 'package.json')) +copyFileSync(distIndex, path.join(pkgDir, 'dist', 'index.js')) +const map = path.join(tabby, 'dist', 'index.js.map') +if (existsSync(map)) { + copyFileSync(map, path.join(pkgDir, 'dist', 'index.js.map')) +} + +const outBase = path.join(root, 'tabby-peershell') +rmSync(`${outBase}.zip`, { force: true }) +execFileSync('python3', ['-c', `import shutil;shutil.make_archive(${JSON.stringify(outBase)},'zip',${JSON.stringify(stage)})`], { stdio: 'inherit' }) +console.log(`packaged ${outBase}.zip`) From c14aca71c79a370cb98c54b1863b6a1e3a112a9d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 9 Jul 2026 12:20:25 +0000 Subject: [PATCH 47/75] chore: set version 0.1.0-beta --- clients/tabby/package.json | 2 +- clients/web/package.json | 2 +- server/package.json | 2 +- shared/package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/clients/tabby/package.json b/clients/tabby/package.json index 9010775..da935bc 100644 --- a/clients/tabby/package.json +++ b/clients/tabby/package.json @@ -1,6 +1,6 @@ { "name": "tabby-peershell", - "version": "0.1.0", + "version": "0.1.0-beta", "description": "Share your terminal session anywhere (peershell) — collaborative terminal for Tabby", "keywords": [ "tabby-plugin" diff --git a/clients/web/package.json b/clients/web/package.json index 9b2e529..31da26a 100644 --- a/clients/web/package.json +++ b/clients/web/package.json @@ -1,6 +1,6 @@ { "name": "@peershell/web-client", - "version": "0.1.0", + "version": "0.1.0-beta", "private": true, "description": "peershell standalone browser client (xterm.js) — served by the host over the tunnel", "license": "Apache-2.0", diff --git a/server/package.json b/server/package.json index c39b10a..b5c5213 100644 --- a/server/package.json +++ b/server/package.json @@ -1,6 +1,6 @@ { "name": "@peershell/server", - "version": "0.1.0", + "version": "0.1.0-beta", "private": true, "description": "peershell rendezvous + blind relay + reverse HTTP tunnel (MVP; accounts/dashboard in Stage 6)", "license": "Apache-2.0", diff --git a/shared/package.json b/shared/package.json index c2a4ca7..c6a5a52 100644 --- a/shared/package.json +++ b/shared/package.json @@ -1,6 +1,6 @@ { "name": "@peershell/protocol", - "version": "0.1.0", + "version": "0.1.0-beta", "description": "peershell wire protocol — framework-neutral, shared by all clients and the server", "license": "Apache-2.0", "repository": "https://github.com/tis24dev/peershell", From 4c773941dc922d594bb08d0313336820e73fc1c5 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 14:28:01 +0200 Subject: [PATCH 48/75] server: fix CodeQL high alerts (biased-random + polynomial-redos) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - genCode: use crypto.randomInt (unbiased rejection sampling) instead of randomBytes % length, which biased the room-code/magic-link alphabet (js/biased-cryptographic-random). - base32Decode: drop the redundant `.replace(/=+$/, '')` — non-base32 chars (including '=') are already skipped by the decode loop, and the regex was flagged as polynomial ReDoS (js/polynomial-redos). Behavior unchanged; TOTP round-trip verified. 42 tests green, lint clean. --- server/src/index.cjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/index.cjs b/server/src/index.cjs index 2ad784b..2fa5656 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -40,10 +40,10 @@ const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ const B32 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' function genCode(n = 6) { - const bytes = crypto.randomBytes(n) let out = '' for (let i = 0; i < n; i++) { - out += CODE_ALPHABET[bytes[i] % CODE_ALPHABET.length] + // crypto.randomInt is unbiased (rejection sampling); avoids the modulo bias of randomBytes % len. + out += CODE_ALPHABET[crypto.randomInt(0, CODE_ALPHABET.length)] } return out } @@ -170,7 +170,8 @@ function base32Encode(buf) { } function base32Decode(str) { let bits = '' - for (const c of String(str).toUpperCase().replace(/=+$/, '')) { + // No padding strip needed: non-base32 chars (incl. '=') are skipped below (idx < 0). + for (const c of String(str).toUpperCase()) { const idx = B32.indexOf(c) if (idx >= 0) { bits += idx.toString(2).padStart(5, '0') From baed89740cc57c5252aa0bc7325ea67bbe77ed5f Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 14:51:53 +0200 Subject: [PATCH 49/75] ci: bump actions to Node24-compatible versions Silence the runner deprecation warnings: actions/checkout v4.3.1 -> v5, actions/setup-node v4 -> v5 (both run on Node 24), and github/codeql-action init+analyze v3 -> v4. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/codeql.yml | 6 +++--- .github/workflows/post-merge-release.yml | 4 ++-- .github/workflows/release-guard.yml | 4 ++-- .github/workflows/release-intake.yml | 4 ++-- .github/workflows/release.yml | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b5321e..bb06b83 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,12 +22,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@v5 with: persist-credentials: false - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: "20" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index b5ee678..0596e8a 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -29,14 +29,14 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@v5 with: persist-credentials: false - name: Initialize CodeQL - uses: github/codeql-action/init@v3 + uses: github/codeql-action/init@v4 with: languages: javascript-typescript - name: Analyze - uses: github/codeql-action/analyze@v3 + uses: github/codeql-action/analyze@v4 diff --git a/.github/workflows/post-merge-release.yml b/.github/workflows/post-merge-release.yml index 1282fa1..56384f7 100644 --- a/.github/workflows/post-merge-release.yml +++ b/.github/workflows/post-merge-release.yml @@ -30,13 +30,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@v5 with: fetch-depth: 0 token: ${{ secrets.PEERSHELL_RELEASE_BOT_TOKEN || github.token }} - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: "20" diff --git a/.github/workflows/release-guard.yml b/.github/workflows/release-guard.yml index ccc9da2..6b4c984 100644 --- a/.github/workflows/release-guard.yml +++ b/.github/workflows/release-guard.yml @@ -21,13 +21,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout trusted base policy - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@v5 with: fetch-depth: 0 ref: ${{ github.event.pull_request.base.sha }} - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: "20" diff --git a/.github/workflows/release-intake.yml b/.github/workflows/release-intake.yml index ac644cb..764fe4b 100644 --- a/.github/workflows/release-intake.yml +++ b/.github/workflows/release-intake.yml @@ -28,13 +28,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@v5 with: fetch-depth: 0 token: ${{ secrets.PEERSHELL_RELEASE_BOT_TOKEN || github.token }} - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: "20" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2af649e..1e44d9e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,13 +21,13 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout released tag - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + uses: actions/checkout@v5 with: ref: ${{ github.event.release.tag_name }} persist-credentials: false - name: Set up Node - uses: actions/setup-node@v4 + uses: actions/setup-node@v5 with: node-version: "20" registry-url: "https://registry.npmjs.org" From aa2974c01eb0de4016b34974bf2a4583a4efe29f Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 14:59:53 +0200 Subject: [PATCH 50/75] tabby: allow a user-set fixed session PIN in plugin settings The per-session PIN that authorizes incoming connections lives only on the host. Add an optional 'Fixed session PIN' field in the plugin settings: when set (>= 6 chars) every share reuses it, otherwise a fresh random PIN is generated per session as before. The PIN is never sent to the server in cleartext (challenge-response only). --- clients/tabby/src/config.ts | 1 + .../tabby/src/services/peershell.service.ts | 7 +++--- .../src/settings/settings-tab.component.ts | 23 +++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/clients/tabby/src/config.ts b/clients/tabby/src/config.ts index 84d2ceb..ca84563 100644 --- a/clients/tabby/src/config.ts +++ b/clients/tabby/src/config.ts @@ -7,6 +7,7 @@ export class PeershellConfigProvider extends ConfigProvider { magicLinkTtlMinutes: 15, disclaimerAck: false, account: null, + pin: null, }, } diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index 4e8b8d2..ed8a27c 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -94,9 +94,10 @@ export class PeershellService { } } - // Per-session PIN, generated locally and shown to the host. Never sent to the server in - // cleartext (challenge-response only). The host shares it with the intended guest out-of-band. - const pin = generatePin(6) + // Per-session PIN, local-only (challenge-response; never sent to the server in cleartext). Use the + // user's fixed PIN from settings if set (>= 6 chars), otherwise generate a fresh random one. + const configuredPin = String(this.config.store.peershell?.pin ?? '').trim() + const pin = configuredPin.length >= 6 ? configuredPin : generatePin(6) const transport = new WebSocketTransport() // Serve the embedded web-client to browsers opening the magic-link, tunneled over this same // outbound connection. Path is whitelisted inside HttpTunnelHandler (only '/'). diff --git a/clients/tabby/src/settings/settings-tab.component.ts b/clients/tabby/src/settings/settings-tab.component.ts index 219c5f0..6a1eaa6 100644 --- a/clients/tabby/src/settings/settings-tab.component.ts +++ b/clients/tabby/src/settings/settings-tab.component.ts @@ -25,6 +25,15 @@ interface LiveSession { room: string, magicLink: string, hasGuest: boolean, crea placeholder="wss://host"> +
+
Fixed session PIN (optional)
+
If set, every share uses this PIN. Leave empty to generate a fresh + random PIN each time. At least 6 characters.
+ +
+
{{ pinError }}
+
Account
{{ account.isLoggedIn() ? ('Signed in as ' + account.email) : 'Not signed in' }}
@@ -56,6 +65,8 @@ interface LiveSession { room: string, magicLink: string, hasGuest: boolean, crea }) export class PeershellSettingsTabComponent { serverUrl = '' + pin = '' + pinError = '' sessions: LiveSession[] = [] busy = false loaded = false @@ -67,6 +78,7 @@ export class PeershellSettingsTabComponent { readonly account: AccountService, ) { this.serverUrl = this.config.store.peershell?.serverUrl ?? '' + this.pin = this.config.store.peershell?.pin ?? '' if (this.account.isLoggedIn()) { void this.refresh() } @@ -77,6 +89,17 @@ export class PeershellSettingsTabComponent { await this.config.save() } + async savePin(): Promise { + const v = this.pin.trim() + if (v && v.length < 6) { + this.pinError = 'PIN must be at least 6 characters (or empty to auto-generate).' + return + } + this.pinError = '' + this.config.store.peershell.pin = v || null + await this.config.save() + } + async openLogin(): Promise { const modal = this.ngbModal.open(LoginModalComponent) await modal.result.catch(() => null) From 842a57969e3a83ddf5bb4332ad1ec952f371de71 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 15:15:10 +0200 Subject: [PATCH 51/75] server/pin: address Greptile review (rate-limit code endpoints, unbiased PIN) - Rate-limit /verify-email and /reset-password with the same per-email exponential lockout as /login: a 6-digit code (10^6 space) must not be brute-forceable within the expiry window. Adds a regression test on an isolated relay. - generatePin: rejection sampling to remove the tiny modulo bias of plain '% max' (same class as the CodeQL genCode fix). - Legacy hash upgrade guard: check the pwhash is a real scrypt string (typeof/startsWith) instead of a falsy check, so an empty pwhash cannot trigger a silent re-hash. --- server/src/index.cjs | 18 +++++++++- shared/src/pinAuth.ts | 11 ++++-- shared/test/auth.integration.test.ts | 52 ++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 4 deletions(-) diff --git a/server/src/index.cjs b/server/src/index.cjs index 2fa5656..e208f9d 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -580,15 +580,23 @@ function startRelay(port = 0, opts = {}) { case '/verify-email': { const email = String(body.email || '').toLowerCase().trim() const code = String(body.code || '') + // Rate-limit code guessing (6-digit code = 10^6 space): same per-email lockout as /login. + const lockUntil = loginLockedUntil(email) + if (lockUntil) { + return sendJson(res, 429, { error: 'rate-limited', retryAfter: Math.ceil((lockUntil - now()) / 1000) }) + } const acct = findAccount(email) if (acct && !acct.verified && acct.verifyCode && code.length === acct.verifyCode.length && crypto.timingSafeEqual(Buffer.from(code), Buffer.from(acct.verifyCode))) { acct.verified = true acct.verifyCode = null + loginFails.delete(email) saveStore() return sendJson(res, 200, { ok: true }) } + recordLoginFail(email) + await failDelay() return sendJson(res, 400, { error: 'invalid' }) } case '/login': { @@ -609,7 +617,7 @@ function startRelay(port = 0, opts = {}) { return sendJson(res, 403, { error: 'needs-verification' }) } loginFails.delete(email) - if (!acct.pwhash) { // upgrade a legacy pbkdf2 hash to scrypt on login + if (typeof acct.pwhash !== 'string' || !acct.pwhash.startsWith('scrypt$')) { // upgrade a legacy pbkdf2 hash to scrypt on login acct.pwhash = hashPassword(password) delete acct.salt delete acct.hash @@ -734,6 +742,11 @@ function startRelay(port = 0, opts = {}) { if (newPassword.length < MIN_PASSWORD) { return sendJson(res, 400, { error: 'password-too-weak', min: MIN_PASSWORD }) } + // Rate-limit code guessing (6-digit code = 10^6 space): same per-email lockout as /login. + const lockUntil = loginLockedUntil(email) + if (lockUntil) { + return sendJson(res, 429, { error: 'rate-limited', retryAfter: Math.ceil((lockUntil - now()) / 1000) }) + } const acct = findAccount(email) if (acct && acct.resetCode && acct.resetExpiresAt > now() && code.length === acct.resetCode.length && @@ -744,9 +757,12 @@ function startRelay(port = 0, opts = {}) { acct.resetCode = null acct.resetExpiresAt = null acct.verified = true + loginFails.delete(email) saveStore() return sendJson(res, 200, { ok: true }) } + recordLoginFail(email) + await failDelay() return sendJson(res, 400, { error: 'invalid' }) } case '/change-password': { diff --git a/shared/src/pinAuth.ts b/shared/src/pinAuth.ts index 9e15001..db6caa4 100644 --- a/shared/src/pinAuth.ts +++ b/shared/src/pinAuth.ts @@ -24,10 +24,15 @@ export function generateNonce(byteLength = 16): string { /** A random numeric PIN (default 6 digits) for a share. Kept local; never sent in cleartext. */ export function generatePin(digits = 6): string { + // Rejection sampling: reject the top slice of the 2^32 range that does not divide evenly by + // `max`, so every PIN is equiprobable (plain `% max` would bias the low codes). + const max = 10 ** digits + const limit = Math.floor(0x100000000 / max) * max const arr = new Uint32Array(1) - globalThis.crypto.getRandomValues(arr) - const n = arr[0] % (10 ** digits) - return n.toString().padStart(digits, '0') + do { + globalThis.crypto.getRandomValues(arr) + } while (arr[0] >= limit) + return (arr[0] % max).toString().padStart(digits, '0') } /** `H(pin, nonce)` as a hex string (SHA-256 over `nonce:pin`). */ diff --git a/shared/test/auth.integration.test.ts b/shared/test/auth.integration.test.ts index d6be64f..c23c10c 100644 --- a/shared/test/auth.integration.test.ts +++ b/shared/test/auth.integration.test.ts @@ -129,6 +129,58 @@ it('login failures are generic (no email enumeration) and rate-limited', async ( expect(last.json.error).toBe('rate-limited') }, 30000) +it('verify-email and reset-password rate-limit code brute-force (same per-email lockout as login)', async () => { + // Isolated relay: the extra registrations + lockouts must not touch the shared server's per-IP + // registration budget or rate-limiter state that later tests rely on. + const mails: any[] = [] + const r2 = await server.startRelay(0, { + requireAuth: true, ephemeral: true, + email: { apiKey: 'test', from: 'noreply@test', sendFn: async (o: any) => { mails.push(o) } }, + }) + const base2 = r2.url.replace('ws://', 'http://') + const post = (path: string, body: any): Promise<{ status: number, json: any }> => new Promise((resolve, reject) => { + const data = Buffer.from(JSON.stringify(body)) + const u = new URL(base2 + path) + const req = http.request({ hostname: u.hostname, port: u.port, path: u.pathname, method: 'POST', headers: { 'content-type': 'application/json', 'content-length': data.length } }, res => { + let b = '' + res.setEncoding('utf-8') + res.on('data', c => { b += c }) + res.on('end', () => { try { resolve({ status: res.statusCode ?? 0, json: JSON.parse(b || '{}') }) } catch { resolve({ status: res.statusCode ?? 0, json: {} }) } }) + }) + req.on('error', reject) + req.write(data) + req.end() + }) + const codeOf = (email: string): string => { + const mail = [...mails].reverse().find(m => m.to === email) + const m = mail && /(\d{6})/.exec(mail.text) + return m ? m[1] : '' + } + try { + // verify-email: a 6-digit code must not be brute-forceable, so wrong codes trip the limiter. + const ve = 'brute-verify@example.com' + expect((await post('/register', { email: ve, password: 'CorrectHorse9' })).status).toBe(200) + let v = await post('/verify-email', { email: ve, code: '000000' }) + expect(v.status).toBe(400) + for (let i = 0; i < 6; i++) { v = await post('/verify-email', { email: ve, code: '000000' }) } + expect(v.status).toBe(429) + expect(v.json.error).toBe('rate-limited') + + // reset-password: same protection on its 6-digit code (expiry window alone is not enough). + const rp = 'brute-reset@example.com' + await post('/register', { email: rp, password: 'CorrectHorse9' }) + await post('/verify-email', { email: rp, code: codeOf(rp) }) + await post('/request-password-reset', { email: rp }) + let r = await post('/reset-password', { email: rp, code: '000000', newPassword: 'BrandNewHorse9' }) + expect(r.status).toBe(400) + for (let i = 0; i < 6; i++) { r = await post('/reset-password', { email: rp, code: '000000', newPassword: 'BrandNewHorse9' }) } + expect(r.status).toBe(429) + expect(r.json.error).toBe('rate-limited') + } finally { + await r2.close() + } +}, 40000) + it('WS create-session is gated: rejected without a token, accepted with one', async () => { const noAuth = await createSessionWs() expect(noAuth.t).toBe('error') From 204b2677151586a4fafcc18a25a26a731c6c0fbd Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 16:16:08 +0200 Subject: [PATCH 52/75] ws-auth: carry the credential in Sec-WebSocket-Protocol, not the URL (+ Origin allowlist) Finding 4 (Greptile P2): the account bearer (host) and the magic-link token (web guest) rode on the WS upgrade URL as ?token=, where reverse-proxy/access logs capture them. - Client (WebSocketTransport): send the credential as a base64url subprotocol peershell.bearer.<...> alongside the non-secret sentinel peershell.v1, instead of appending ?token= to the URL. Widen the injected ctor to (url, protocols?) (satisfied by DOM WebSocket and the ws package). - Web guest: connect without a handshake credential; the magic-link token is already delivered in the join control frame (WS payload, never logged). - Server (ws): read the token from the Sec-WebSocket-Protocol header first, fall back to the legacy ?token= for one release; handleProtocols echoes ONLY the sentinel (never the token); verifyClient adds an Origin allowlist (CSWSH) that permits no-Origin/file:// clients (Node, Electron host) and the publicUrl origin (web guest), with '*' as an escape hatch. - Tests: account token via subprotocol authenticates create-session and the echoed subprotocol is the sentinel; cross-origin upgrade is rejected while the configured origin and no-Origin clients are allowed. Rollout is server-first (backward-compatible), then client. --- clients/web/src/index.ts | 4 +- server/src/index.cjs | 74 ++++++++++++++++++++++++++-- shared/src/base64.ts | 8 +++ shared/src/websocketTransport.ts | 16 ++++-- shared/test/auth.integration.test.ts | 49 ++++++++++++++++++ 5 files changed, 141 insertions(+), 10 deletions(-) diff --git a/clients/web/src/index.ts b/clients/web/src/index.ts index fa64fd5..222c8ef 100644 --- a/clients/web/src/index.ts +++ b/clients/web/src/index.ts @@ -202,7 +202,9 @@ async function main(): Promise { } const connectAndJoin = async (): Promise => { - await transport.connect(wsUrl(), token) + // Connect without a credential on the handshake: the magic-link token is delivered in the `join` + // control frame below (WS payload, never logged), so it must not ride the URL query. + await transport.connect(wsUrl()) setStatus('') controller.join({ token, kind: 'web' }) } diff --git a/server/src/index.cjs b/server/src/index.cjs index e208f9d..0d0104e 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -34,6 +34,29 @@ const LOGIN_MAX_FAILS = 5 const LOGIN_LOCK_MS = 15 * 60 * 1000 const REG_MAX_PER_IP = 5 const REG_WINDOW_MS = 24 * 60 * 60 * 1000 +// Auth credential carried in the WS handshake as Sec-WebSocket-Protocol: peershell.bearer., +// with the non-secret sentinel peershell.v1 echoed back. Keeps the token out of the logged URL query. +const AUTH_SENTINEL = 'peershell.v1' +const BEARER_PREFIX = 'peershell.bearer.' + +/** Decode the account token from the Sec-WebSocket-Protocol header, or null if absent/malformed. */ +function bearerFromProtocolHeader(header) { + if (!header) { + return null + } + for (const part of String(header).split(',')) { + const v = part.trim() + if (v.startsWith(BEARER_PREFIX)) { + const b64 = v.slice(BEARER_PREFIX.length).replace(/-/g, '+').replace(/_/g, '/') + try { + return Buffer.from(b64, 'base64').toString('utf8') || null + } catch { + return null + } + } + } + return null +} const TOTP_SESSION_TTL_MS = 5 * 60 * 1000 const TOTP_MAX_FAILS = 3 const EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ @@ -319,6 +342,32 @@ function startRelay(port = 0, opts = {}) { let boundPort = port let publicUrl = opts.publicUrl || '' + // CSWSH defense: reject cross-origin browser WS upgrades. Non-browser clients (Node, the Tabby + // Electron renderer whose origin is file://) send no browser origin and are allowed; the web + // guest is same-origin as publicUrl. '*' in opts.allowedOrigins disables the check (escape hatch). + const allowedOrigins = new Set((opts.allowedOrigins || []).map(String)) + try { + if (publicUrl) { + allowedOrigins.add(new URL(publicUrl).origin) + } + } catch { /* ignore malformed publicUrl */ } + const originAllowed = origin => { + if (allowedOrigins.has('*')) { + return true + } + if (!origin || origin === 'null' || origin === 'file://') { + return true // non-browser client or file:// (Electron renderer) — not a CSWSH vector + } + if (allowedOrigins.has(origin)) { + return true + } + try { + return !!publicUrl && new URL(publicUrl).origin === origin // picks up a post-bind publicUrl + } catch { + return false + } + } + const rooms = new Map() // room -> { host, guest, accountId, magicLink, createdAt } const magicTokens = new Map() // magic-link token -> { room, expiresAt } const pendingHttp = new Map() // reqId -> http res @@ -850,7 +899,22 @@ function startRelay(port = 0, opts = {}) { } }) - const wss = new WebSocketServer({ server }) + const wss = new WebSocketServer({ + server, + // Reject cross-origin browser upgrades before the socket opens (CSWSH). Note: verifyClient is + // a browser-only defense (non-browser clients can forge Origin); the PIN gate is the real lock. + verifyClient: (info, cb) => { + if (originAllowed(info.origin)) { + cb(true) + } else { + console.log(`[peershell] rejected WS upgrade from disallowed origin: ${info.origin}`) + cb(false, 403, 'Forbidden') + } + }, + // Echo ONLY the non-secret sentinel, never the credential-bearing subprotocol. The ws default + // echoes the FIRST offered protocol (= the token here), which would re-leak it in the 101. + handleProtocols: protocols => (protocols.has(AUTH_SENTINEL) ? AUTH_SENTINEL : false), + }) wss.on('connection', (sock, req) => { sock._room = null @@ -858,11 +922,13 @@ function startRelay(port = 0, opts = {}) { sock._kind = 'desktop' sock._role = 'guest' sock._lastSeen = now() - // account token (host) rides on the WS upgrade URL query: ?token= + // Account token (host) rides in the Sec-WebSocket-Protocol handshake header as + // peershell.bearer.. One-release fallback: the legacy ?token= query param. let acct = null try { - const q = new URL(req.url || '/', 'http://x').searchParams.get('token') - acct = q ? accountFromToken(q) : null + const fromHeader = bearerFromProtocolHeader(req.headers['sec-websocket-protocol']) + const raw = fromHeader || new URL(req.url || '/', 'http://x').searchParams.get('token') + acct = raw ? accountFromToken(raw) : null } catch { /* ignore */ } sock._account = acct diff --git a/shared/src/base64.ts b/shared/src/base64.ts index cfac1a7..b6c2a1e 100644 --- a/shared/src/base64.ts +++ b/shared/src/base64.ts @@ -21,3 +21,11 @@ export function base64ToBytes(b64: string): Uint8Array { export const utf8ToBase64 = (s: string): string => bytesToBase64(new TextEncoder().encode(s)) export const base64ToUtf8 = (b64: string): string => new TextDecoder().decode(base64ToBytes(b64)) + +/** + * base64url without padding (RFC 4648 section 5). Safe for URLs and, crucially, for WebSocket + * subprotocol names (RFC 6455 tokens forbid `+`, `/`, `=`, space, comma), so a credential can ride + * in the `Sec-WebSocket-Protocol` handshake header instead of the logged URL query. + */ +export const utf8ToBase64Url = (s: string): string => + utf8ToBase64(s).replace(/\+/g, '-').replace(/\//g, '_').replace(/=+$/, '') diff --git a/shared/src/websocketTransport.ts b/shared/src/websocketTransport.ts index 5c37d2d..686e69e 100644 --- a/shared/src/websocketTransport.ts +++ b/shared/src/websocketTransport.ts @@ -7,6 +7,12 @@ import { ControlMessage, Channel, encodeControl, decodeControl, encodeBinaryFrame, decodeBinaryFrame, } from './protocol' import { SessionTransport, TransportState, BinaryPayload } from './api' +import { utf8ToBase64Url } from './base64' + +/** Non-secret subprotocol the server echoes back; carries no credential. */ +const AUTH_SENTINEL = 'peershell.v1' +/** Prefix for the credential-bearing subprotocol offered by the client. Never echoed by the server. */ +const BEARER_PREFIX = 'peershell.bearer.' /** Minimal browser-WebSocket surface we rely on (satisfied by DOM WebSocket and the `ws` package). */ export interface WebSocketLike { @@ -19,7 +25,7 @@ export interface WebSocketLike { onerror: ((ev: unknown) => void) | null } -export type WebSocketCtor = new (url: string) => WebSocketLike +export type WebSocketCtor = new (url: string, protocols?: string | string[]) => WebSocketLike const KEEPALIVE_INTERVAL_MS = 20000 @@ -54,12 +60,12 @@ export class WebSocketTransport implements SessionTransport { connect(url: string, token?: string): Promise { return new Promise((resolve, reject) => { this.setState('connecting') - const full = token - ? `${url}${url.includes('?') ? '&' : '?'}token=${encodeURIComponent(token)}` - : url + // The credential rides in the Sec-WebSocket-Protocol handshake header (base64url), NOT the URL + // query, so it never lands in reverse-proxy/access logs. The server echoes only AUTH_SENTINEL. + const protocols = token ? [AUTH_SENTINEL, BEARER_PREFIX + utf8ToBase64Url(token)] : undefined let ws: WebSocketLike try { - ws = new this.WS(full) + ws = protocols ? new this.WS(url, protocols) : new this.WS(url) } catch (err) { this.setState('closed') reject(err instanceof Error ? err : new Error(String(err))) diff --git a/shared/test/auth.integration.test.ts b/shared/test/auth.integration.test.ts index c23c10c..e4deee7 100644 --- a/shared/test/auth.integration.test.ts +++ b/shared/test/auth.integration.test.ts @@ -80,6 +80,31 @@ function createSessionWs(token?: string): Promise { }) } +// Same create-session leg, but the account token rides in the Sec-WebSocket-Protocol subprotocol +// (peershell.bearer.) instead of the URL. Resolves with the message + negotiated subprotocol. +function createSessionWsSub(token: string): Promise<{ msg: any, proto: string }> { + return new Promise((resolve, reject) => { + const b64url = Buffer.from(token).toString('base64url') + const ws = new WebSocket(relay.url, ['peershell.v1', 'peershell.bearer.' + b64url]) + const to = setTimeout(() => { ws.close(); reject(new Error('timeout')) }, 6000) + ws.on('open', () => { + ws.send(JSON.stringify({ v: 1, t: 'hello', role: 'host', kind: 'desktop' })) + ws.send(JSON.stringify({ v: 1, t: 'create-session' })) + }) + ws.on('message', d => { + let m: any = null + try { m = JSON.parse(d.toString()) } catch { /* ignore */ } + if (m && (m.t === 'session-created' || m.t === 'error')) { + clearTimeout(to) + const proto = ws.protocol + ws.close() + resolve({ msg: m, proto }) + } + }) + ws.on('error', e => { clearTimeout(to); reject(e) }) + }) +} + async function registerVerifyLogin(email: string, password = 'CorrectHorse9'): Promise { await api('POST', '/register', { email, password }) await api('POST', '/verify-email', { email, code: codeFor(email) }) @@ -191,8 +216,32 @@ it('WS create-session is gated: rejected without a token, accepted with one', as expect(ok.t).toBe('session-created') expect(ok.room).toMatch(/^[2-9A-HJ-NP-Z]{6}$/) expect(ok.magicLink).toContain('/s/') + + // The same token is accepted via the Sec-WebSocket-Protocol subprotocol (not the URL), and the + // server echoes ONLY the non-secret sentinel back, never the token. + const sub = await createSessionWsSub(token) + expect(sub.msg.t).toBe('session-created') + expect(sub.proto).toBe('peershell.v1') }, 20000) +it('rejects a cross-origin WS upgrade (CSWSH) but allows the configured origin and no-origin clients', async () => { + const r3 = await server.startRelay(0, { requireAuth: false, ephemeral: true, allowedOrigins: ['https://panel.example'] }) + const dial = (origin?: string): Promise<'open' | 'rejected'> => new Promise(resolve => { + const ws = new WebSocket(r3.url, origin ? { origin } : undefined) + const to = setTimeout(() => { ws.close(); resolve('rejected') }, 6000) + ws.on('open', () => { clearTimeout(to); ws.close(); resolve('open') }) + ws.on('error', () => { clearTimeout(to); resolve('rejected') }) + ws.on('unexpected-response', () => { clearTimeout(to); resolve('rejected') }) + }) + try { + expect(await dial('https://evil.example')).toBe('rejected') + expect(await dial('https://panel.example')).toBe('open') + expect(await dial(undefined)).toBe('open') // non-browser client (no Origin) + } finally { + await r3.close() + } +}, 25000) + it('optional TOTP: setup -> enable -> login needs 2FA -> verify issues token', async () => { const email = 'erin@example.com' const token = await registerVerifyLogin(email) From 37e5dd675f4b24acbeb35ae28fb17e97628e4e80 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:06:50 +0200 Subject: [PATCH 53/75] fix(mirror): tear down transport on session end and route PIN-cancel through end() end() now closes the transport after notifying the sink so the web client's WebSocket + keepalive no longer leak until the server reaper reclaims them (#9). answerPin's cancel branch goes through end('guest-closed') so sink.ended fires (stops the web re-prompt loop, destroys the Tabby tab) while still closing the transport (#8). close() is unchanged and remains the Tabby kill() teardown entry. --- shared/src/mirrorController.ts | 7 ++++-- shared/test/mirrorController.test.ts | 32 +++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/shared/src/mirrorController.ts b/shared/src/mirrorController.ts index c17d507..2e97355 100644 --- a/shared/src/mirrorController.ts +++ b/shared/src/mirrorController.ts @@ -52,7 +52,7 @@ export class MirrorController { private onControl(m: ControlMessage): void { switch (m.t) { case 'pin-challenge': - void this.answerPin(m.nonce) + this.answerPin(m.nonce).catch(() => this.end('pin verification failed')) break case 'pin-fail': if (m.left <= 0) { @@ -82,7 +82,7 @@ export class MirrorController { private async answerPin(nonce: string): Promise { const pin = await this.pinProvider() if (!pin) { - this.close() + this.end('guest-closed') return } const hash = await hashPin(pin, nonce) @@ -99,7 +99,10 @@ export class MirrorController { return } this.endedFlag = true + // Notify the sink FIRST (the web client sets `stopped` in sink.ended, gating the reconnect + // loop), THEN tear down the transport so its `closed` state does not re-arm a reconnect. this.sink.ended(reason) + this.transport.close(1000, reason) } close(): void { diff --git a/shared/test/mirrorController.test.ts b/shared/test/mirrorController.test.ts index d4717f8..e967580 100644 --- a/shared/test/mirrorController.test.ts +++ b/shared/test/mirrorController.test.ts @@ -6,6 +6,7 @@ import { class MockTransport implements SessionTransport { sentControl: ControlMessage[] = [] sentData: Array<{ peerId: number, channel: Channel, data: Uint8Array }> = [] + closed: { code?: number, reason?: string } | null = null private controlCb?: (m: ControlMessage) => void private binaryCb?: (f: BinaryPayload) => void @@ -18,7 +19,9 @@ class MockTransport implements SessionTransport { sendData(peerId: number, channel: Channel, data: Uint8Array): void { this.sentData.push({ peerId, channel, data }) } - close(): void { /* noop */ } + close(code?: number, reason?: string): void { + this.closed = { code, reason } + } onControl(cb: (m: ControlMessage) => void): void { this.controlCb = cb } @@ -129,3 +132,30 @@ it('surfaces a host resize and ends on peer-left (once)', () => { t.emitControl({ t: 'peer-left', reason: 'again' }) expect(s.getEnded()).toBe('host-ended') }) + +it('cancelling the PIN prompt ends the session AND tears down the transport', async () => { + const t = new MockTransport() + const s = mockSink() + const c = new MirrorController(t, s.sink, noPin) + c.join({ room: 'ABC234' }) + + t.emitControl({ t: 'pin-challenge', nonce: 'n1' }) + await waitUntil(() => s.getEnded() !== null) + // Regression (#8): cancel must fire sink.ended (so the guest UI stops re-prompting) ... + expect(s.getEnded()).toBe('guest-closed') + // ... and still close the transport (its prior behavior). + expect(t.closed).not.toBeNull() +}) + +it('closes the transport whenever the session ends', () => { + const t = new MockTransport() + const s = mockSink() + const c = new MirrorController(t, s.sink, noPin) + c.join({ room: 'ABC234' }) + + // Regression (#9): end() must also close the transport so the web client's socket + keepalive + // do not leak until the server reaper reclaims them. + t.emitControl({ t: 'peer-left', reason: 'host-ended' }) + expect(s.getEnded()).toBe('host-ended') + expect(t.closed).not.toBeNull() +}) From 3121c5c4d2ad2775d0c2760460f97f9ceaf817f4 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:00 +0200 Subject: [PATCH 54/75] fix(web): re-prompt PIN on re-challenge and guard malformed magic-link token Gate the cached PIN on a sessionEstablished flag so a wrong PIN is re-prompted on the host's re-challenge instead of silently replayed until retries run out (#12); the cache is still reused for a genuine reconnect. Wrap decodeURIComponent in getToken so a malformed %-escape falls through to the missing-token path (#29). --- clients/web/src/index.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/clients/web/src/index.ts b/clients/web/src/index.ts index 222c8ef..1af2a90 100644 --- a/clients/web/src/index.ts +++ b/clients/web/src/index.ts @@ -12,7 +12,11 @@ const setStatus = (s: string): void => { el('status').textContent = s } function getToken(): string | null { const m = /\/s\/([^/?#]+)/.exec(location.pathname) if (m) { - return decodeURIComponent(m[1]) + try { + return decodeURIComponent(m[1]) + } catch { + return null // malformed %-escape -> treat as missing token + } } return new URLSearchParams(location.search).get('token') } @@ -73,17 +77,22 @@ async function main(): Promise { let stopped = false // host ended the session (or wrong PIN / cancelled) -> do not reconnect let cachedPin: string | null = null + // True once live output has flowed (i.e. the PIN was accepted). Gates cachedPin reuse so a wrong + // PIN is re-prompted on the host's re-challenge instead of silently replayed until retries run out. + let sessionEstablished = false let reconnectTimer: ReturnType | null = null let reconnectDeadline = 0 const RECONNECT_WINDOW_MS = 12000 // survive brief drops; a bit beyond the host's ~10s grace const sink: MirrorSink = { // Reassemble multibyte UTF-8 split across frames before writing to xterm. - emit: data => term.write(splitter.write(data)), + // Live/snapshot output only flows after pin-ok, so this marks the session as established. + emit: data => { sessionEstablished = true; term.write(splitter.write(data)) }, // Adopt the host's size (tmate model); the browser window does not drive the size. hostResize: (cols, rows) => term.resize(cols, rows), ended: reason => { stopped = true + sessionEstablished = false if (reconnectTimer) { clearTimeout(reconnectTimer) reconnectTimer = null @@ -94,7 +103,9 @@ async function main(): Promise { } // Cache the PIN so a reconnect re-authenticates without re-prompting the user. const pinProvider: PinProvider = async () => { - if (cachedPin) { + // Only reuse the cached PIN for a genuine reconnect (session was live); on a re-challenge + // within the same attempt (wrong PIN) re-prompt instead of replaying the bad PIN. + if (sessionEstablished && cachedPin) { return cachedPin } cachedPin = await askPin() From 8b4db7b19d0d8e0bf7ee562d8fbd2f17ec04c3d0 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:09 +0200 Subject: [PATCH 55/75] fix(tabby): tear down host share on peer-left re-join and unauthorized error Scope beginStream()'s output$/resize$ forwarders in a per-session Subscription torn down on peer-left, so a re-joining guest no longer stacks duplicate forwarders (also closes the guard-less resize$ leak) (#1). Route pin-response verification failures through onError instead of an unhandled rejection (#6). On an unauthorized onError, clear establishTimer and stopSharing immediately instead of leaving a dead session up until the 5-min timer (#10). --- clients/tabby/src/host/shareController.ts | 15 +++++++-- .../tabby/src/services/peershell.service.ts | 9 +++++- clients/tabby/test/shareController.test.ts | 31 +++++++++++++++++++ 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/clients/tabby/src/host/shareController.ts b/clients/tabby/src/host/shareController.ts index a4a0adc..a38268e 100644 --- a/clients/tabby/src/host/shareController.ts +++ b/clients/tabby/src/host/shareController.ts @@ -41,6 +41,9 @@ export class ShareController { magicLink: string | null = null private subs = new Subscription() + // Per-session output/resize forwarders, torn down on peer-left so a re-joining guest does not + // stack a second (duplicate-forwarding) pair. null when no guest is streaming. + private streamSubs: Subscription | null = null private streaming = false private authenticated = false private peerId = SINGLE_PEER @@ -85,7 +88,8 @@ export class ShareController { this.challenge() break case 'pin-response': - void this.verifyResponse(m.hash) + this.verifyResponse(m.hash).catch(err => + this.hooks.onError?.('pin-verify-failed', err instanceof Error ? err.message : String(err))) break case 'snapshot-ack': this.beginStream() @@ -93,6 +97,8 @@ export class ShareController { case 'peer-left': this.streaming = false this.authenticated = false + this.streamSubs?.unsubscribe() + this.streamSubs = null this.hooks.onPeerLeft?.(m.reason) break case 'error': @@ -142,12 +148,13 @@ export class ShareController { return } this.streaming = true - this.subs.add(this.tab.output$.subscribe(data => { + this.streamSubs = new Subscription() + this.streamSubs.add(this.tab.output$.subscribe(data => { if (this.streaming) { this.transport.sendData(this.peerId, Channel.Output, data) } })) - this.subs.add(this.tab.resize$.subscribe(sz => { + this.streamSubs.add(this.tab.resize$.subscribe(sz => { this.transport.sendControl({ t: 'resize', cols: sz.cols, rows: sz.rows }) })) } @@ -164,6 +171,8 @@ export class ShareController { this.streaming = false this.authenticated = false this.subs.unsubscribe() + this.streamSubs?.unsubscribe() + this.streamSubs = null this.transport.close(1000, reason) } } diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index ed8a27c..0148811 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -144,7 +144,14 @@ export class PeershellService { onError: (code, message) => { if (code === 'unauthorized') { void this.account.clearLocal() - this.notifications.error('peershell: session expired — log in and share again') + // Tear the share down now (closes the WS, drops the share entry) instead of leaving a + // dead session up until the 5-min establish timer fires. stopSharing does not touch + // establishTimer, so clear it here. + if (establishTimer) { + clearTimeout(establishTimer) + establishTimer = null + } + this.stopSharing(tab, 'peershell: session expired, log in and share again') } else { this.notifications.error(`peershell: ${code}`, message) } diff --git a/clients/tabby/test/shareController.test.ts b/clients/tabby/test/shareController.test.ts index b5a80e9..5b57539 100644 --- a/clients/tabby/test/shareController.test.ts +++ b/clients/tabby/test/shareController.test.ts @@ -153,3 +153,34 @@ it('tears down on tab close', async () => { expect(t.closed).toBe(true) expect(t.controlTypes()).toEqual(expect.arrayContaining(['peer-left', 'session-close'])) }) + +it('re-join after peer-left does not stack duplicate output/resize forwarders', async () => { + const t = new MockTransport() + const m = mockTab() + const c = new ShareController(t, m.tab, PIN) + await c.start('ws://relay') + t.emitControl({ t: 'session-created', room: 'ABC234', magicLink: 'http://x' }) + + const joinAndStream = async (): Promise => { + const before = t.sentControl.filter(x => x.t === 'snapshot').length + t.emitControl({ t: 'peer-joined', peerId: 0, kind: 'web' }) + await respond(t, t.last('pin-challenge')!.nonce, PIN) + await waitUntil(() => t.sentControl.filter(x => x.t === 'snapshot').length > before) + t.emitControl({ t: 'snapshot-ack' }) + } + + await joinAndStream() + m.output$.next(new Uint8Array([1])) + m.resize$.next({ cols: 90, rows: 30 }) + + t.emitControl({ t: 'peer-left', reason: 'gone' }) + + await joinAndStream() // fresh guest on the same controller (server keeps the host/room alive) + m.output$.next(new Uint8Array([2])) + m.resize$.next({ cols: 91, rows: 31 }) + + // Regression (#1): exactly one Output frame per push (2 total), not doubled by a leaked sub. + expect(t.sentData.filter(d => d.channel === Channel.Output)).toHaveLength(2) + // The resize$ handler has no streaming guard, so a leaked sub would surface here first. + expect(t.sentControl.filter(x => x.t === 'resize')).toHaveLength(2) +}) From 67ed9df6d71ad77038f3dba9a74c876500475ca4 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:17 +0200 Subject: [PATCH 56/75] fix(server): revoke tokens on password reset/change and reap idle rate-limit maps Password reset revokes all of the account's bearer tokens; password change revokes every token except the caller's current one, so other sessions are invalidated while the active session stays logged in (#21). The reaper now prunes loginFails and regByIp so they cannot grow unbounded (incl. a bogus-email flood), evicting a loginFails entry only when it has no active lock AND has been idle past 4x the lock window, so an in-progress bruteforce and the blocks escalation are never reset (#19). --- server/src/index.cjs | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/server/src/index.cjs b/server/src/index.cjs index 0d0104e..436987f 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -32,6 +32,10 @@ const MIN_PASSWORD = 8 const MAX_BODY = 64 * 1024 const LOGIN_MAX_FAILS = 5 const LOGIN_LOCK_MS = 15 * 60 * 1000 +// Keep a loginFails entry until it has been idle for the longest possible lock (4x). This lets the +// reaper bound the map (incl. a bogus-email flood) WITHOUT resetting an in-progress bruteforce or the +// blocks escalation: an actively-guessing attacker refreshes `at` and is never pruned mid-attack. +const LOGIN_FAILS_TTL_MS = LOGIN_LOCK_MS * 4 const REG_MAX_PER_IP = 5 const REG_WINDOW_MS = 24 * 60 * 60 * 1000 // Auth credential carried in the WS handshake as Sec-WebSocket-Protocol: peershell.bearer., @@ -433,8 +437,9 @@ function startRelay(port = 0, opts = {}) { return r && r.until > now() ? r.until : 0 } function recordLoginFail(email) { - const r = loginFails.get(email) || { count: 0, until: 0, blocks: 0 } + const r = loginFails.get(email) || { count: 0, until: 0, blocks: 0, at: 0 } r.count++ + r.at = now() // last activity, for idle-based reaping (never prune an active attack) if (r.count >= LOGIN_MAX_FAILS) { r.blocks++ r.until = now() + LOGIN_LOCK_MS * Math.min(4, r.blocks) @@ -807,6 +812,12 @@ function startRelay(port = 0, opts = {}) { acct.resetExpiresAt = null acct.verified = true loginFails.delete(email) + // Password was reset: revoke any bearer tokens still outstanding for this account. + for (const t of store.tokens) { + if (t.accountId === acct.id && !t.revokedAt) { + t.revokedAt = now() + } + } saveStore() return sendJson(res, 200, { ok: true }) } @@ -829,6 +840,15 @@ function startRelay(port = 0, opts = {}) { acct.pwhash = hashPassword(np) delete acct.salt delete acct.hash + // A password change invalidates the account's OTHER sessions, but keeps THIS one + // (the caller just proved the current password) so the client stays logged in + // without having to adopt a re-issued token. + const curHash = sha256hex(bearer(req)) + for (const t of store.tokens) { + if (t.accountId === acct.id && t.tokenHash !== curHash && !t.revokedAt) { + t.revokedAt = now() + } + } saveStore() return sendJson(res, 200, { ok: true }) } @@ -1048,6 +1068,20 @@ function startRelay(port = 0, opts = {}) { totpSessions.delete(k) } } + // Prune stale rate-limit entries so the maps do not grow unbounded. For loginFails, evict + // only entries with no active lock AND idle past LOGIN_FAILS_TTL_MS: an in-progress bruteforce + // (r.until > now(), or a recent fail refreshing r.at) is always retained, so pruning cannot + // reset an accumulating counter or the blocks escalation (a paced attacker still gets locked). + for (const [k, r] of loginFails) { + if (r.until <= now() && now() - (r.at || 0) >= LOGIN_FAILS_TTL_MS) { + loginFails.delete(k) + } + } + for (const [k, r] of regByIp) { + if (r.resetAt < now()) { + regByIp.delete(k) + } + } }, 30000) if (typeof reaper.unref === 'function') { reaper.unref() From 7072c7eb8ea670e748f56bd3815f03f6d9412f4c Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:28 +0200 Subject: [PATCH 57/75] ci: harden CI/release workflows Use lockfile-strict 'npm ci' (drop the '|| npm install' fallback) in ci and release so lockfile drift fails fast on a signed/published artifact (#15, #16). Add persist-credentials: false to the read-only release-guard checkout (#14). Source the release policy in post-merge-release from the pre-merge parent (MERGE_SHA^), the trusted ancestor, with a bootstrap fallback (#17). Validate the release tag and workspace version-lockstep before publishing (#18). CodeQL: the repo is public and code scanning runs, so keep analyze strict and correct the stale 'private' comment (#31). --- .github/workflows/ci.yml | 2 +- .github/workflows/codeql.yml | 6 +++--- .github/workflows/post-merge-release.yml | 13 ++++++++++++- .github/workflows/release-guard.yml | 1 + .github/workflows/release.yml | 11 ++++++++++- 5 files changed, 27 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb06b83..d966c28 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,7 +32,7 @@ jobs: node-version: "20" - name: Install - run: npm ci || npm install + run: npm ci - name: Lint run: npm run lint diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 0596e8a..969fe7d 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,8 +1,8 @@ name: CodeQL -# Static security analysis. On a PRIVATE repo, code scanning requires GitHub Advanced -# Security; without it the analyze step fails, so this workflow is NOT a required check -# (it runs best-effort). Make it required once the repo is public or GHAS is enabled. +# Static security analysis (CodeQL). The repo is public, so code scanning runs without +# GitHub Advanced Security. Runs on PRs + pushes to dev/main and weekly; the analyze step +# is expected to pass and can be promoted to a required check via branch protection. on: push: branches: diff --git a/.github/workflows/post-merge-release.yml b/.github/workflows/post-merge-release.yml index 56384f7..ee4d67f 100644 --- a/.github/workflows/post-merge-release.yml +++ b/.github/workflows/post-merge-release.yml @@ -48,7 +48,18 @@ jobs: PR_BODY: ${{ github.event.pull_request.body }} run: | set -euo pipefail - source .github/scripts/release-policy.sh + # Source the policy from the pre-merge main parent (MERGE_SHA^), the trusted ancestor. + # After merge origin/main == MERGE_SHA (the just-merged, to-be-released tree), so it is the + # UNtrusted tree; do NOT source from it. Bootstrap: fall back to the merged policy on the + # first-ever release when the parent carries no policy yet. + POLICY="$(mktemp)" + if git show "${MERGE_SHA}^:.github/scripts/release-policy.sh" > "${POLICY}" 2>/dev/null; then + # shellcheck source=/dev/null + source "${POLICY}" + else + echo "::notice::Release policy absent on previous main; bootstrap release, using merged policy." + source .github/scripts/release-policy.sh + fi HAS_RELEASE_MARKER="false" TAG="" diff --git a/.github/workflows/release-guard.yml b/.github/workflows/release-guard.yml index 6b4c984..37d6900 100644 --- a/.github/workflows/release-guard.yml +++ b/.github/workflows/release-guard.yml @@ -25,6 +25,7 @@ jobs: with: fetch-depth: 0 ref: ${{ github.event.pull_request.base.sha }} + persist-credentials: false - name: Set up Node uses: actions/setup-node@v5 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1e44d9e..8f2291d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,11 +33,20 @@ jobs: registry-url: "https://registry.npmjs.org" - name: Install - run: npm ci || npm install + run: npm ci - name: Build all run: npm run build:all + - name: Validate release version + env: + RELEASE_TAG: ${{ github.event.release.tag_name }} + run: | + set -euo pipefail + source .github/scripts/release-policy.sh + validate_release_tag "$RELEASE_TAG" + assert_versions_match_tag HEAD "$RELEASE_TAG" + - name: Test + smoke run: | npm test From b7713a02cf1c9d90c6435161c18560264784dadf Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:39 +0200 Subject: [PATCH 58/75] fix(resilience): bound WS connect() and account fetch() with a deadline connect() now settles exactly once and rejects on a pre-open close or a 15s connection timeout instead of hanging forever (#7). account.service fetch() uses an AbortController with a 20s timeout and returns a distinct 'timeout' error so the login modal recovers instead of staying stuck busy; add the matching ERRORS entry (#5). --- clients/tabby/src/account/account.service.ts | 10 +++- .../src/account/login-modal.component.ts | 1 + shared/src/websocketTransport.ts | 56 +++++++++++++++++-- shared/test/websocketTransport.test.ts | 17 ++++++ 4 files changed, 78 insertions(+), 6 deletions(-) diff --git a/clients/tabby/src/account/account.service.ts b/clients/tabby/src/account/account.service.ts index 2ecf270..0a53edc 100644 --- a/clients/tabby/src/account/account.service.ts +++ b/clients/tabby/src/account/account.service.ts @@ -54,17 +54,25 @@ export class AccountService { headers.authorization = `Bearer ${t}` } } + // Bound the request so an unresponsive server cannot strand the login modal in busy state + // (its Close button is [disabled]="busy"); on timeout return a distinct 'timeout' error. + const controller = new AbortController() + const timeout = setTimeout(() => controller.abort(), 20_000) let res: Response try { res = await fetch(this.base() + path, { method, headers, body: body === undefined ? undefined : JSON.stringify(body), + signal: controller.signal, }) } catch (err) { + const aborted = (err as Error)?.name === 'AbortError' // eslint-disable-next-line no-console console.error('[peershell] fetch failed:', method, this.base() + path, err) - return { status: 0, error: 'network-error', detail: String((err as any)?.message ?? err) } + return { status: 0, error: aborted ? 'timeout' : 'network-error', detail: String((err as any)?.message ?? err) } + } finally { + clearTimeout(timeout) } let json: Record = {} try { diff --git a/clients/tabby/src/account/login-modal.component.ts b/clients/tabby/src/account/login-modal.component.ts index 7813b8e..83d8dbd 100644 --- a/clients/tabby/src/account/login-modal.component.ts +++ b/clients/tabby/src/account/login-modal.component.ts @@ -15,6 +15,7 @@ const ERRORS: Record = { 'too-many-attempts': 'Too many attempts. Try again later.', 'unauthorized': 'Session expired. Please log in again.', 'network-error': 'Cannot reach the peershell server. Check the server URL in settings.', + 'timeout': 'The server did not respond in time. Try again.', } /** Login / create-account / verify / 2FA / password-reset / logout. Resolves modal.close(token) on login. */ diff --git a/shared/src/websocketTransport.ts b/shared/src/websocketTransport.ts index 686e69e..2fce1eb 100644 --- a/shared/src/websocketTransport.ts +++ b/shared/src/websocketTransport.ts @@ -28,6 +28,8 @@ export interface WebSocketLike { export type WebSocketCtor = new (url: string, protocols?: string | string[]) => WebSocketLike const KEEPALIVE_INTERVAL_MS = 20000 +/** Reject connect() if the handshake neither opens nor closes within this window (no silent hangs). */ +const CONNECT_TIMEOUT_MS = 15000 function toUint8(data: unknown): Uint8Array { if (data instanceof ArrayBuffer) { @@ -42,7 +44,6 @@ function toUint8(data: unknown): Uint8Array { export class WebSocketTransport implements SessionTransport { private ws: WebSocketLike | null = null - private state: TransportState = 'closed' private keepalive: ReturnType | null = null private readonly WS: WebSocketCtor private readonly controlCbs: Array<(m: ControlMessage) => void> = [] @@ -73,18 +74,64 @@ export class WebSocketTransport implements SessionTransport { } ws.binaryType = 'arraybuffer' this.ws = ws + // Settle the connect promise exactly once. Without this guard a close/error arriving before + // open (or a silent hang) would leave connect() pending forever. + let settled = false + let timer: ReturnType | null = null + const clear = (): void => { + if (timer !== null) { + clearTimeout(timer) + timer = null + } + } ws.onopen = () => { + if (settled) { + return + } + settled = true + clear() this.setState('open') this.startKeepalive() resolve() } ws.onerror = () => { - if (this.state === 'connecting') { - reject(new Error('peershell: WebSocket connection failed')) + if (settled) { + return + } + settled = true + clear() + this.setState('closed') + reject(new Error('peershell: WebSocket connection failed')) + } + ws.onclose = () => { + if (!settled) { + settled = true + clear() + this.setState('closed') + reject(new Error('peershell: WebSocket closed during connect')) + } else { + // Post-open close: normal teardown. setState('closed') stops the keepalive. + this.setState('closed') } } - ws.onclose = () => this.setState('closed') ws.onmessage = ev => this.dispatch(ev.data) + timer = setTimeout(() => { + if (settled) { + return + } + settled = true + timer = null + try { + ws.close() + } catch { /* ignore */ } + this.setState('closed') + reject(new Error('peershell: WebSocket connect timed out')) + }, CONNECT_TIMEOUT_MS) + // Don't let a pending connect timeout hold a Node process (or test runner) open. + const t = timer as unknown as { unref?: () => void } + if (typeof t.unref === 'function') { + t.unref() + } }) } @@ -163,7 +210,6 @@ export class WebSocketTransport implements SessionTransport { } private setState(s: TransportState): void { - this.state = s if (s === 'closed') { this.stopKeepalive() } diff --git a/shared/test/websocketTransport.test.ts b/shared/test/websocketTransport.test.ts index fb9fe42..a4ba5d5 100644 --- a/shared/test/websocketTransport.test.ts +++ b/shared/test/websocketTransport.test.ts @@ -82,3 +82,20 @@ it('stops the keepalive timer on close', async () => { jest.advanceTimersByTime(60000) expect(last.sent.length).toBe(before) }) + +it('rejects connect() if the socket closes before it opens (does not hang)', async () => { + jest.useFakeTimers() + const transport = new WebSocketTransport(WS) + const p = transport.connect('ws://x') + last.onclose?.(null) + await expect(p).rejects.toThrow(/closed during connect/) +}) + +it('rejects connect() if the handshake times out (does not hang)', async () => { + jest.useFakeTimers() + const transport = new WebSocketTransport(WS) + const p = transport.connect('ws://x') + jest.advanceTimersByTime(15000) + await expect(p).rejects.toThrow(/timed out/) + expect(last.closed).toBe(true) +}) From 8c2dcabc3db13631c12934a2d27d75c6ab5bd7a9 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:52 +0200 Subject: [PATCH 59/75] docs(protocol): align REST auth examples with the needsTotp/sessionKey flow (#4) --- PROTOCOL.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PROTOCOL.md b/PROTOCOL.md index e3fe92d..50016db 100644 --- a/PROTOCOL.md +++ b/PROTOCOL.md @@ -44,9 +44,9 @@ One WebSocket carries two frame kinds (`ws.binaryType = 'arraybuffer'`): ### REST (client -> server, not WebSocket) - `POST /register { email, password }` -- `POST /login { email, password } -> { token } | { needs2fa: true, challenge }` -- `POST /2fa/verify { challenge, code } -> { token }` -- `GET /sessions -> { sessions: [{ room, magicLink, createdAt }] }` (dashboard, authenticated) +- `POST /login { email, password } -> { token, expiresAt } | { needsTotp: true, sessionKey }` +- `POST /2fa/verify { sessionKey, code } -> { token, expiresAt }` +- `GET /sessions -> { account: { email, totpEnabled, totpEnabledAt }, sessions: [{ room, magicLink, createdAt, endedAt, live, hasGuest }] }` (dashboard, authenticated) ### Signaling (client <-> server, WS TEXT) - `hello { role: "host"|"guest", kind?: "desktop"|"web"|"mobile", client }` From 2da97de6917fc6eea65f71e1dc265670d45a31a9 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:52 +0200 Subject: [PATCH 60/75] fix(protocol): stamp PROTOCOL_VERSION authoritatively in encodeControl (#22) --- shared/src/protocol.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shared/src/protocol.ts b/shared/src/protocol.ts index f72faf2..d5ba35b 100644 --- a/shared/src/protocol.ts +++ b/shared/src/protocol.ts @@ -51,7 +51,7 @@ export type ControlType = ControlMessage['t'] /** Serialize a control message to a JSON string (stamps the protocol version). */ export function encodeControl(msg: ControlMessage): string { - return JSON.stringify({ v: PROTOCOL_VERSION, ...msg }) + return JSON.stringify({ ...msg, v: PROTOCOL_VERSION }) } /** Parse a JSON control message. Throws on malformed JSON or missing `t`. */ From a9681a13e5aff8ab716286c0c811a892dbc443df Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:52 +0200 Subject: [PATCH 61/75] test(tabby): clear the pump interval on waitFor timeout (#24) --- clients/tabby/test/hostGuest.integration.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clients/tabby/test/hostGuest.integration.test.ts b/clients/tabby/test/hostGuest.integration.test.ts index d140802..128f0b5 100644 --- a/clients/tabby/test/hostGuest.integration.test.ts +++ b/clients/tabby/test/hostGuest.integration.test.ts @@ -77,8 +77,11 @@ it('PIN handshake, then mirrors snapshot + live output host->guest and input gue await host.start(relay.url) const pump = setInterval(() => output$.next(enc('LIVE\r\n')), 15) - await waitFor(() => sawLive) - clearInterval(pump) + try { + await waitFor(() => sawLive) + } finally { + clearInterval(pump) + } guest.writeInput(enc('typed-by-guest\n')) await waitFor(() => inputs.some(i => dec(i).includes('typed-by-guest'))) From 6d7ac834a652277cb98906db529e742225d0e032 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 19:07:53 +0200 Subject: [PATCH 62/75] fix(tabby): show the copied indicator only when the clipboard write succeeds (#25) --- clients/tabby/src/host/share-info-modal.component.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/clients/tabby/src/host/share-info-modal.component.ts b/clients/tabby/src/host/share-info-modal.component.ts index 0569e9f..e12982f 100644 --- a/clients/tabby/src/host/share-info-modal.component.ts +++ b/clients/tabby/src/host/share-info-modal.component.ts @@ -42,8 +42,10 @@ export class ShareInfoModalComponent { copy(text: string, what: string): void { if (navigator.clipboard) { - void navigator.clipboard.writeText(text) + // Only show the confirmation if the write actually succeeded. + navigator.clipboard.writeText(text).then(() => { this.copied = what }).catch(() => { /* no-op */ }) + return } - this.copied = what + this.copied = what // no async clipboard: readonly inputs auto-select on focus for manual copy } } From ac7a1733063f01868138c9e8cfd218ab82971a76 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 21:20:24 +0200 Subject: [PATCH 63/75] test(auth): extract shared postTo() helper for isolated-relay requests The two isolated-relay test sections each re-implemented the same POST-JSON request logic; consolidate them into a single postTo(base, path, body) so future relay tests reuse it instead of copying. Behavior unchanged. --- shared/test/auth.integration.test.ts | 47 +++++++++++++--------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/shared/test/auth.integration.test.ts b/shared/test/auth.integration.test.ts index e4deee7..f681ad1 100644 --- a/shared/test/auth.integration.test.ts +++ b/shared/test/auth.integration.test.ts @@ -52,6 +52,26 @@ function api(method: string, path: string, body?: any, token?: string): Promise< }) } +/** POST JSON to an arbitrary relay base (isolated-relay tests reuse this instead of copying it). */ +function postTo(base: string, path: string, body: any): Promise<{ status: number, json: any }> { + return new Promise((resolve, reject) => { + const data = Buffer.from(JSON.stringify(body)) + const u = new URL(base + path) + const req = http.request({ + hostname: u.hostname, port: u.port, path: u.pathname, method: 'POST', + headers: { 'content-type': 'application/json', 'content-length': data.length }, + }, res => { + let b = '' + res.setEncoding('utf-8') + res.on('data', c => { b += c }) + res.on('end', () => { try { resolve({ status: res.statusCode ?? 0, json: JSON.parse(b || '{}') }) } catch { resolve({ status: res.statusCode ?? 0, json: {} }) } }) + }) + req.on('error', reject) + req.write(data) + req.end() + }) +} + const codeFor = (email: string): string => { const mail = [...sent].reverse().find(m => m.to === email) const m = mail && /(\d{6})/.exec(mail.text) @@ -163,19 +183,7 @@ it('verify-email and reset-password rate-limit code brute-force (same per-email email: { apiKey: 'test', from: 'noreply@test', sendFn: async (o: any) => { mails.push(o) } }, }) const base2 = r2.url.replace('ws://', 'http://') - const post = (path: string, body: any): Promise<{ status: number, json: any }> => new Promise((resolve, reject) => { - const data = Buffer.from(JSON.stringify(body)) - const u = new URL(base2 + path) - const req = http.request({ hostname: u.hostname, port: u.port, path: u.pathname, method: 'POST', headers: { 'content-type': 'application/json', 'content-length': data.length } }, res => { - let b = '' - res.setEncoding('utf-8') - res.on('data', c => { b += c }) - res.on('end', () => { try { resolve({ status: res.statusCode ?? 0, json: JSON.parse(b || '{}') }) } catch { resolve({ status: res.statusCode ?? 0, json: {} }) } }) - }) - req.on('error', reject) - req.write(data) - req.end() - }) + const post = (path: string, body: any): Promise<{ status: number, json: any }> => postTo(base2, path, body) const codeOf = (email: string): string => { const mail = [...mails].reverse().find(m => m.to === email) const m = mail && /(\d{6})/.exec(mail.text) @@ -266,18 +274,7 @@ it('optional TOTP: setup -> enable -> login needs 2FA -> verify issues token', a it('auto-verifies and returns a token when no email is configured', async () => { const r2 = await server.startRelay(0, { requireAuth: true, ephemeral: true }) // no email cfg -> log path const base2 = r2.url.replace('ws://', 'http://') - const post = (path: string, body: any): Promise<{ status: number, json: any }> => new Promise((resolve, reject) => { - const data = Buffer.from(JSON.stringify(body)) - const u = new URL(base2 + path) - const req = http.request({ hostname: u.hostname, port: u.port, path: u.pathname, method: 'POST', headers: { 'content-type': 'application/json', 'content-length': data.length } }, res => { - let b = '' - res.on('data', c => { b += c }) - res.on('end', () => resolve({ status: res.statusCode ?? 0, json: JSON.parse(b || '{}') })) - }) - req.on('error', reject) - req.write(data) - req.end() - }) + const post = (path: string, body: any): Promise<{ status: number, json: any }> => postTo(base2, path, body) const r = await post('/register', { email: 'noemail@example.com', password: 'CorrectHorse9' }) expect(r.status).toBe(200) expect(typeof r.json.token).toBe('string') From f4e81371bfc645ae6bc8573dd1faf2cc48476fb2 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 22:15:42 +0200 Subject: [PATCH 64/75] fix(transport): sever a superseded socket on reconnect to stop stale state The web guest reuses one WebSocketTransport across reconnects; connect() overwrote this.ws without unbinding the previous socket, so a stale onclose/onmessage (e.g. the async close that follows a connect-timeout ws.close()) kept driving setState()/ dispatch() on the new connection. Add teardownSocket() (detach handlers, then close, then null this.ws), call it at connect() start and in the timeout branch, and add a this.ws===ws identity guard on every socket handler. This also removes the duplicate setState('closed') the timeout branch used to emit. Addresses code-review finding D. --- shared/src/websocketTransport.ts | 47 +++++++++++++++++++++----- shared/test/websocketTransport.test.ts | 31 +++++++++++++++++ 2 files changed, 69 insertions(+), 9 deletions(-) diff --git a/shared/src/websocketTransport.ts b/shared/src/websocketTransport.ts index 2fce1eb..9892769 100644 --- a/shared/src/websocketTransport.ts +++ b/shared/src/websocketTransport.ts @@ -60,6 +60,10 @@ export class WebSocketTransport implements SessionTransport { connect(url: string, token?: string): Promise { return new Promise((resolve, reject) => { + // Sever any previous socket from this transport before attaching a new one. The web guest + // reuses one transport across reconnects, so an old ws's handlers still close over `this` + // and would otherwise keep driving setState()/dispatch() from a superseded socket. + this.teardownSocket() this.setState('connecting') // The credential rides in the Sec-WebSocket-Protocol handshake header (base64url), NOT the URL // query, so it never lands in reverse-proxy/access logs. The server echoes only AUTH_SENTINEL. @@ -74,8 +78,8 @@ export class WebSocketTransport implements SessionTransport { } ws.binaryType = 'arraybuffer' this.ws = ws - // Settle the connect promise exactly once. Without this guard a close/error arriving before - // open (or a silent hang) would leave connect() pending forever. + // Settle the connect promise exactly once. The `current()` identity guard additionally ignores + // any late event from a socket a newer connect() has already superseded (stale onclose/onmessage). let settled = false let timer: ReturnType | null = null const clear = (): void => { @@ -84,8 +88,9 @@ export class WebSocketTransport implements SessionTransport { timer = null } } + const current = (): boolean => this.ws === ws ws.onopen = () => { - if (settled) { + if (settled || !current()) { return } settled = true @@ -95,7 +100,7 @@ export class WebSocketTransport implements SessionTransport { resolve() } ws.onerror = () => { - if (settled) { + if (settled || !current()) { return } settled = true @@ -104,6 +109,9 @@ export class WebSocketTransport implements SessionTransport { reject(new Error('peershell: WebSocket connection failed')) } ws.onclose = () => { + if (!current()) { + return // a superseded socket closing: it no longer owns this transport + } if (!settled) { settled = true clear() @@ -114,16 +122,20 @@ export class WebSocketTransport implements SessionTransport { this.setState('closed') } } - ws.onmessage = ev => this.dispatch(ev.data) + ws.onmessage = ev => { + if (current()) { + this.dispatch(ev.data) + } + } timer = setTimeout(() => { - if (settled) { + if (settled || !current()) { return } settled = true timer = null - try { - ws.close() - } catch { /* ignore */ } + // Detach + close the stalled socket first (teardownSocket clears onclose before close()), + // so its close cannot re-enter here; then report the single 'closed' transition. + this.teardownSocket() this.setState('closed') reject(new Error('peershell: WebSocket connect timed out')) }, CONNECT_TIMEOUT_MS) @@ -135,6 +147,23 @@ export class WebSocketTransport implements SessionTransport { }) } + /** Detach a socket's handlers and close it so it can no longer drive this transport's state. */ + private teardownSocket(): void { + this.stopKeepalive() + const ws = this.ws + if (!ws) { + return + } + this.ws = null + ws.onopen = null + ws.onmessage = null + ws.onclose = null + ws.onerror = null + try { + ws.close() + } catch { /* already closing/closed */ } + } + private dispatch(data: unknown): void { if (typeof data === 'string') { let msg: ControlMessage diff --git a/shared/test/websocketTransport.test.ts b/shared/test/websocketTransport.test.ts index a4ba5d5..476c695 100644 --- a/shared/test/websocketTransport.test.ts +++ b/shared/test/websocketTransport.test.ts @@ -99,3 +99,34 @@ it('rejects connect() if the handshake times out (does not hang)', async () => { await expect(p).rejects.toThrow(/timed out/) expect(last.closed).toBe(true) }) + +it('ignores late events from a socket superseded by a reconnect', async () => { + jest.useFakeTimers() + const transport = new WebSocketTransport(WS) + const states: string[] = [] + const controls: string[] = [] + transport.onState(s => states.push(s)) + transport.onControl(m => controls.push(m.t)) + + // First connection opens, then the socket drops. + const p1 = transport.connect('ws://x') + const first = last + first.onopen?.(null) + await p1 + const staleClose = first.onclose // capture before the reconnect detaches it + const staleMsg = first.onmessage + first.onclose?.(null) + + // Reconnect on the SAME transport: a brand-new socket supersedes the first. + const p2 = transport.connect('ws://x') + expect(last).not.toBe(first) + last.onopen?.(null) + await p2 + + const stateCount = states.length + // A late close/message from the OLD socket must not drive the new transport. + staleClose?.(null) + staleMsg?.({ data: encodeControl({ t: 'pin-ok' }) }) + expect(states.length).toBe(stateCount) + expect(controls).toEqual([]) +}) From 9111b988b61b8767fd21d3fa40f19f0787378495 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 22:47:23 +0200 Subject: [PATCH 65/75] fix(server): terminate live host WS sessions on password reset/change Revoking bearer tokens only blocks FUTURE handshakes; a host WebSocket bound its account at connect time and kept streaming after a security-motivated password reset. Bind the authorizing token hash per socket (sock._tokenHash) and add terminateAccountSessions(): /reset-password drops ALL of the account's live host sessions (a reset is a lockout), /change-password drops all except the caller's current one. The socket's close handler notifies the guest and dropRoom()s. Addresses code-review finding A. --- server/src/index.cjs | 30 +++++++++++++++- shared/test/auth.integration.test.ts | 54 ++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/server/src/index.cjs b/server/src/index.cjs index 436987f..30c4f76 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -535,6 +535,25 @@ function startRelay(port = 0, opts = {}) { } } } + // Close any live host WS sessions for an account after its tokens are revoked (password + // reset/change): revoking a bearer only blocks FUTURE handshakes, but a socket bound its + // account at connect time and would otherwise keep streaming. exceptTokenHash spares the + // caller's current session (change-password). The socket's 'close' handler notifies the guest + // (peer-left) and dropRoom()s. Returns the number of sockets closed. + function terminateAccountSessions(accountId, exceptTokenHash) { + if (!accountId) { + return 0 + } + let n = 0 + for (const c of wss.clients) { + if (c._account && c._account.id === accountId && c._tokenHash !== exceptTokenHash) { + c._account = null // stop any in-flight create-session on this socket + try { c.close(4001, 'session revoked') } catch { /* ignore */ } + n++ + } + } + return n + } function safeSend(sock, data, binary) { if (sock && sock.readyState === sock.OPEN) { sock.send(data, { binary: !!binary }) @@ -812,13 +831,15 @@ function startRelay(port = 0, opts = {}) { acct.resetExpiresAt = null acct.verified = true loginFails.delete(email) - // Password was reset: revoke any bearer tokens still outstanding for this account. + // Password was reset: revoke any bearer tokens still outstanding for this + // account and drop its live host WS sessions (the reset is a lockout). for (const t of store.tokens) { if (t.accountId === acct.id && !t.revokedAt) { t.revokedAt = now() } } saveStore() + terminateAccountSessions(acct.id) return sendJson(res, 200, { ok: true }) } recordLoginFail(email) @@ -850,6 +871,8 @@ function startRelay(port = 0, opts = {}) { } } saveStore() + // Drop the account's OTHER live host sessions too, sparing the caller's current one. + terminateAccountSessions(acct.id, curHash) return sendJson(res, 200, { ok: true }) } default: @@ -945,12 +968,17 @@ function startRelay(port = 0, opts = {}) { // Account token (host) rides in the Sec-WebSocket-Protocol handshake header as // peershell.bearer.. One-release fallback: the legacy ?token= query param. let acct = null + let tokenHash = null try { const fromHeader = bearerFromProtocolHeader(req.headers['sec-websocket-protocol']) const raw = fromHeader || new URL(req.url || '/', 'http://x').searchParams.get('token') acct = raw ? accountFromToken(raw) : null + // Remember which token authorized this socket so a password change can drop the sessions + // whose token it revoked while keeping the caller's current one. + tokenHash = acct && raw ? sha256hex(raw) : null } catch { /* ignore */ } sock._account = acct + sock._tokenHash = tokenHash sock.on('message', (data, isBinary) => { sock._lastSeen = now() diff --git a/shared/test/auth.integration.test.ts b/shared/test/auth.integration.test.ts index f681ad1..1387f3e 100644 --- a/shared/test/auth.integration.test.ts +++ b/shared/test/auth.integration.test.ts @@ -214,6 +214,60 @@ it('verify-email and reset-password rate-limit code brute-force (same per-email } }, 40000) +it('password reset terminates the account live host WS sessions', async () => { + const mails: any[] = [] + const r2 = await server.startRelay(0, { + requireAuth: true, ephemeral: true, + email: { apiKey: 'test', from: 'noreply@test', sendFn: async (o: any) => { mails.push(o) } }, + }) + const base2 = r2.url.replace('ws://', 'http://') + const codeOf = (email: string): string => { + const mail = [...mails].reverse().find(m => m.to === email) + const m = mail && /(\d{6})/.exec(mail.text) + return m ? m[1] : '' + } + try { + const email = 'revoke-live@example.com' + await postTo(base2, '/register', { email, password: 'CorrectHorse9' }) + await postTo(base2, '/verify-email', { email, code: codeOf(email) }) + const login = await postTo(base2, '/login', { email, password: 'CorrectHorse9' }) + const token: string = login.json.token + expect(typeof token).toBe('string') + + // Open a live host share on that token and keep it open. + const b64url = Buffer.from(token).toString('base64url') + const ws = new WebSocket(r2.url, ['peershell.v1', 'peershell.bearer.' + b64url]) + const created = await new Promise((resolve, reject) => { + const to = setTimeout(() => reject(new Error('timeout')), 6000) + ws.on('open', () => { + ws.send(JSON.stringify({ v: 1, t: 'hello', role: 'host', kind: 'desktop' })) + ws.send(JSON.stringify({ v: 1, t: 'create-session' })) + }) + ws.on('message', d => { + const m = JSON.parse(d.toString()) + if (m.t === 'session-created') { clearTimeout(to); resolve(m) } + }) + ws.on('error', reject) + }) + expect(created.room).toBeTruthy() + + const serverClosed = new Promise(resolve => { + const to = setTimeout(() => resolve(false), 6000) + ws.on('close', () => { clearTimeout(to); resolve(true) }) + }) + + // Reset the password: revokes tokens AND must drop the already-open host session. + await postTo(base2, '/request-password-reset', { email }) + const rr = await postTo(base2, '/reset-password', { email, code: codeOf(email), newPassword: 'BrandNewHorse9' }) + expect(rr.status).toBe(200) + + expect(await serverClosed).toBe(true) + ws.close() + } finally { + await r2.close() + } +}, 40000) + it('WS create-session is gated: rejected without a token, accepted with one', async () => { const noAuth = await createSessionWs() expect(noAuth.t).toBe('error') From 71e487071b034d92c6d08fc389d6fd49b33fd285 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 23:01:32 +0200 Subject: [PATCH 66/75] fix(tabby): give stopSharing ownership of the per-share grace/establish timers The grace and establish timers were local closures, so any teardown that removed a share from the map (onError unauthorized, or either timer firing) could leave the sibling timer armed. Since startSharing() bails while shares.has(tab), the host can re-share the tab and the stale timer then fires stopSharing() on the NEW share. Store both timers per-tab in shareTimers and cancel them via clearShareTimers() from every teardown path (stopSharing, destroyed$, connect-failure catch), so no timer outlives its share. Addresses code-review finding C (and the scattered-timer-ownership nit). --- .../tabby/src/services/peershell.service.ts | 69 ++++++++++++------- 1 file changed, 45 insertions(+), 24 deletions(-) diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index 0148811..8d5975c 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -18,6 +18,9 @@ import webClientHtml from '../../assets/web-client.html' @Injectable({ providedIn: 'root' }) export class PeershellService { private readonly shares = new Map() + // Per-share grace/establish timers, keyed by tab so stopSharing() owns their teardown. + private readonly shareTimers = new Map | null, establish: ReturnType | null }>() constructor( private readonly app: AppService, @@ -105,10 +108,13 @@ export class PeershellService { new HttpTunnelHandler(transport, () => webClientHtml) // Grace window: a guest disconnect (closed tab or a brief network blip) does not kill the share // immediately — wait ~10s for a reconnect before tearing it down. - let graceTimer: ReturnType | null = null + // Per-share timers, owned by this tab so stopSharing() cancels them on teardown. Otherwise a + // stale grace/establish timer could later fire stopSharing() on a tab the host has re-shared. + const timers: { grace: ReturnType | null, establish: ReturnType | null } = + { grace: null, establish: null } + this.shareTimers.set(tab, timers) // Auto-kill a share that never gets a connected guest within 5 minutes of starting. let established = false - let establishTimer: ReturnType | null = null const controller = new ShareController(transport, this.adapt(tab), pin, { onSession: h => { const modal = this.ngbModal.open(ShareInfoModalComponent, { backdrop: 'static', size: 'lg' }) @@ -116,41 +122,36 @@ export class PeershellService { modal.componentInstance.pin = pin }, onPeerJoined: () => { - if (graceTimer) { - clearTimeout(graceTimer) - graceTimer = null + if (timers.grace) { + clearTimeout(timers.grace) + timers.grace = null this.notifications.notice('peershell: guest reconnected') } }, onAuthenticated: () => { established = true - if (establishTimer) { - clearTimeout(establishTimer) - establishTimer = null + if (timers.establish) { + clearTimeout(timers.establish) + timers.establish = null } this.notifications.notice('peershell: guest connected') }, onPinFailed: () => this.notifications.error('peershell: guest failed the PIN'), onPeerLeft: () => { - if (graceTimer) { + if (timers.grace) { return } this.notifications.notice('peershell: guest disconnected — closing in 10s unless they reconnect') - graceTimer = setTimeout(() => { - graceTimer = null + timers.grace = setTimeout(() => { + timers.grace = null this.stopSharing(tab, 'peershell: guest gone — sharing stopped') }, 10000) }, onError: (code, message) => { if (code === 'unauthorized') { void this.account.clearLocal() - // Tear the share down now (closes the WS, drops the share entry) instead of leaving a - // dead session up until the 5-min establish timer fires. stopSharing does not touch - // establishTimer, so clear it here. - if (establishTimer) { - clearTimeout(establishTimer) - establishTimer = null - } + // Tear the share down now (closes the WS, cancels this share's timers, drops the entry) + // instead of leaving a dead session up until the 5-min establish timer fires. this.stopSharing(tab, 'peershell: session expired, log in and share again') } else { this.notifications.error(`peershell: ${code}`, message) @@ -159,8 +160,12 @@ export class PeershellService { }) this.shares.set(tab, controller) - tab.destroyed$.subscribe(() => this.shares.delete(tab)) - establishTimer = setTimeout(() => { + tab.destroyed$.subscribe(() => { + this.shares.delete(tab) + this.clearShareTimers(tab) + }) + timers.establish = setTimeout(() => { + timers.establish = null if (!established) { this.notifications.error('peershell: no one connected in time — sharing stopped') this.stopSharing(tab) @@ -170,10 +175,7 @@ export class PeershellService { try { await controller.start(serverUrl, token) } catch (err) { - if (establishTimer) { - clearTimeout(establishTimer) - establishTimer = null - } + this.clearShareTimers(tab) this.shares.delete(tab) this.notifications.error('peershell: could not connect to the server', String(err)) } @@ -296,6 +298,9 @@ export class PeershellService { } stopSharing(tab: BaseTerminalTabComponent, note = 'peershell: sharing stopped'): void { + // Cancel this share's timers first so a pending grace/establish timer cannot later fire on a tab + // the host has since re-shared. + this.clearShareTimers(tab) const controller = this.shares.get(tab) if (controller) { controller.stop('stopped') @@ -304,6 +309,22 @@ export class PeershellService { } } + private clearShareTimers(tab: BaseTerminalTabComponent): void { + const t = this.shareTimers.get(tab) + if (!t) { + return + } + if (t.grace) { + clearTimeout(t.grace) + t.grace = null + } + if (t.establish) { + clearTimeout(t.establish) + t.establish = null + } + this.shareTimers.delete(tab) + } + private adapt(tab: BaseTerminalTabComponent): HostTerminal { return { output$: tab.binaryOutput$.pipe(map((b: Buffer) => new Uint8Array(b))), From a72babcc9ddc607612598c27ae706dbcee1fd721 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 23:14:45 +0200 Subject: [PATCH 67/75] fix(tabby): bound the account request body read with the deadline, not just the fetch The AbortController timeout was cleared in a finally wrapping only fetch(), so a server that streamed headers then stalled the body hung forever at res.json(), leaving the login modal stuck with busy=true and its Close button disabled. Move res.json() inside the timed try (a single finally clears the timer) so the signal bounds the body read too, and rethrow an AbortError from the body read as a timeout while still tolerating empty/non-json bodies. Addresses code-review finding B. --- clients/tabby/src/account/account.service.ts | 24 ++++++++++++-------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/clients/tabby/src/account/account.service.ts b/clients/tabby/src/account/account.service.ts index 0a53edc..c32599c 100644 --- a/clients/tabby/src/account/account.service.ts +++ b/clients/tabby/src/account/account.service.ts @@ -54,18 +54,29 @@ export class AccountService { headers.authorization = `Bearer ${t}` } } - // Bound the request so an unresponsive server cannot strand the login modal in busy state - // (its Close button is [disabled]="busy"); on timeout return a distinct 'timeout' error. + // Bound the WHOLE request, headers AND body read, so an unresponsive server cannot strand the + // login modal in busy state (its Close button is [disabled]="busy"). The AbortController signal + // covers res.json() too, so a server that streams headers then stalls the body still times out. const controller = new AbortController() const timeout = setTimeout(() => controller.abort(), 20_000) - let res: Response try { - res = await fetch(this.base() + path, { + const res = await fetch(this.base() + path, { method, headers, body: body === undefined ? undefined : JSON.stringify(body), signal: controller.signal, }) + let json: Record = {} + try { + json = await res.json() + } catch (err) { + // A stalled body aborts via the same signal; surface that as a timeout, not an empty body. + if ((err as Error)?.name === 'AbortError') { + throw err + } + /* otherwise: empty/non-json body -> keep json = {} */ + } + return { status: res.status, ...json } } catch (err) { const aborted = (err as Error)?.name === 'AbortError' // eslint-disable-next-line no-console @@ -74,11 +85,6 @@ export class AccountService { } finally { clearTimeout(timeout) } - let json: Record = {} - try { - json = await res.json() - } catch { /* empty/non-json body */ } - return { status: res.status, ...json } } register(email: string, password: string): Promise { From be35474f684bc067866472f7a595d7a17f93e958 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 23:27:00 +0200 Subject: [PATCH 68/75] docs(server): make the loginFails reaper comment honest about blocks escalation The comment claimed pruning cannot reset the blocks escalation; that only holds for an actively-guessing attacker (r.at refreshed). An entry left idle past the TTL is dropped and its escalation resets, an acceptable bound since the base 5-fail lock re-applies to any renewed attack. Comment only; no behavior change. (review nit E) --- server/src/index.cjs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/src/index.cjs b/server/src/index.cjs index 30c4f76..0ca6f1b 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -1096,10 +1096,11 @@ function startRelay(port = 0, opts = {}) { totpSessions.delete(k) } } - // Prune stale rate-limit entries so the maps do not grow unbounded. For loginFails, evict - // only entries with no active lock AND idle past LOGIN_FAILS_TTL_MS: an in-progress bruteforce - // (r.until > now(), or a recent fail refreshing r.at) is always retained, so pruning cannot - // reset an accumulating counter or the blocks escalation (a paced attacker still gets locked). + // Prune stale rate-limit entries so the maps do not grow unbounded. For loginFails, evict only + // entries with no active lock AND idle past LOGIN_FAILS_TTL_MS. An attacker who keeps guessing + // refreshes r.at and is never pruned mid-attack, so an accumulating counter or an active lock is + // never reset; only an entry left idle past the TTL is dropped (its blocks escalation resets, + // an acceptable bound since the base 5-fail lock still re-applies to any renewed attack). for (const [k, r] of loginFails) { if (r.until <= now() && now() - (r.at || 0) >= LOGIN_FAILS_TTL_MS) { loginFails.delete(k) From e4e705eee4adb1d41c294a89261b7bbe0b006a3a Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 23:27:00 +0200 Subject: [PATCH 69/75] fix(mirror): mark the session ended in close() so a late frame cannot re-enter end() close() (the Tabby tab-kill path) now sets endedFlag before tearing down the transport, so a control frame racing the kill cannot re-enter end() and drive sink.ended() on an already-destroyed guest. Addresses code-review finding F (#11). --- shared/src/mirrorController.ts | 3 +++ shared/test/mirrorController.test.ts | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/shared/src/mirrorController.ts b/shared/src/mirrorController.ts index 2e97355..4cd7018 100644 --- a/shared/src/mirrorController.ts +++ b/shared/src/mirrorController.ts @@ -106,6 +106,9 @@ export class MirrorController { } close(): void { + // Mark the session ended so a control frame racing the tab-kill cannot re-enter end() and drive + // sink.ended() on an already-torn-down guest. + this.endedFlag = true this.transport.close(1000, 'guest-closed') } } diff --git a/shared/test/mirrorController.test.ts b/shared/test/mirrorController.test.ts index e967580..36e37d6 100644 --- a/shared/test/mirrorController.test.ts +++ b/shared/test/mirrorController.test.ts @@ -159,3 +159,17 @@ it('closes the transport whenever the session ends', () => { expect(s.getEnded()).toBe('host-ended') expect(t.closed).not.toBeNull() }) + +it('close() marks the session ended so a late control frame cannot re-fire sink.ended', () => { + const t = new MockTransport() + const s = mockSink() + const c = new MirrorController(t, s.sink, noPin) + c.join({ room: 'ABC234' }) + + // Tab kill (mirrorSession) calls close(); a control frame racing that must not drive sink.ended + // on the already-torn-down session. + c.close() + expect(t.closed).not.toBeNull() + t.emitControl({ t: 'peer-left', reason: 'late' }) + expect(s.getEnded()).toBeNull() +}) From 47d97ce3341f56074ac9165044d0bda9c21e48dc Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 23:27:00 +0200 Subject: [PATCH 70/75] fix(tabby): treat a PIN-verify crash as a failed attempt, not a stranded session verifyResponse wraps verifyPin in try/catch so a verify error (e.g. crypto unavailable) counts as a failed attempt: the guest is told via pin-fail and eventually kicked instead of hanging on a silently un-joinable session, and the host is not stranded until the 5-min timer. Addresses code-review finding G. --- clients/tabby/src/host/shareController.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/clients/tabby/src/host/shareController.ts b/clients/tabby/src/host/shareController.ts index a38268e..71fd484 100644 --- a/clients/tabby/src/host/shareController.ts +++ b/clients/tabby/src/host/shareController.ts @@ -115,7 +115,14 @@ export class ShareController { } private async verifyResponse(hash: string): Promise { - const ok = await verifyPin(this.pin, this.nonce, hash) + let ok = false + try { + ok = await verifyPin(this.pin, this.nonce, hash) + } catch { + // A verify error (e.g. crypto unavailable) counts as a failed attempt: the guest is told via + // pin-fail and eventually kicked, rather than left hanging on a silently un-joinable session. + ok = false + } if (ok) { this.authenticated = true this.transport.sendControl({ t: 'pin-ok' }) From 92cc97a26d276a3f283a96cbf15e93e3dcf6b552 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 23:48:26 +0200 Subject: [PATCH 71/75] fix(transport): route every connect() failure through failConnect to sever the socket onerror, the reject-before-open onclose, and the connect timeout now all funnel through a single failConnect() that teardownSocket()s the failed socket (detach handlers, close, null this.ws). Previously only the timeout severed it, so a socket rejected before open stayed attached and a late onmessage could still reach dispatch(). Closes the code-review D nit; adds a regression test. --- shared/src/websocketTransport.ts | 36 ++++++++++++-------------- shared/test/websocketTransport.test.ts | 14 ++++++++++ 2 files changed, 31 insertions(+), 19 deletions(-) diff --git a/shared/src/websocketTransport.ts b/shared/src/websocketTransport.ts index 9892769..41715b9 100644 --- a/shared/src/websocketTransport.ts +++ b/shared/src/websocketTransport.ts @@ -89,6 +89,18 @@ export class WebSocketTransport implements SessionTransport { } } const current = (): boolean => this.ws === ws + // Fail the connect once: settle, cancel the timer, sever the socket (teardownSocket detaches + // its handlers so no late onmessage/onclose can reach dispatch/setState), mark closed, reject. + const failConnect = (message: string): void => { + if (settled) { + return + } + settled = true + clear() + this.teardownSocket() + this.setState('closed') + reject(new Error(message)) + } ws.onopen = () => { if (settled || !current()) { return @@ -100,23 +112,16 @@ export class WebSocketTransport implements SessionTransport { resolve() } ws.onerror = () => { - if (settled || !current()) { - return + if (current()) { + failConnect('peershell: WebSocket connection failed') } - settled = true - clear() - this.setState('closed') - reject(new Error('peershell: WebSocket connection failed')) } ws.onclose = () => { if (!current()) { return // a superseded socket closing: it no longer owns this transport } if (!settled) { - settled = true - clear() - this.setState('closed') - reject(new Error('peershell: WebSocket closed during connect')) + failConnect('peershell: WebSocket closed during connect') } else { // Post-open close: normal teardown. setState('closed') stops the keepalive. this.setState('closed') @@ -128,16 +133,9 @@ export class WebSocketTransport implements SessionTransport { } } timer = setTimeout(() => { - if (settled || !current()) { - return + if (current()) { + failConnect('peershell: WebSocket connect timed out') } - settled = true - timer = null - // Detach + close the stalled socket first (teardownSocket clears onclose before close()), - // so its close cannot re-enter here; then report the single 'closed' transition. - this.teardownSocket() - this.setState('closed') - reject(new Error('peershell: WebSocket connect timed out')) }, CONNECT_TIMEOUT_MS) // Don't let a pending connect timeout hold a Node process (or test runner) open. const t = timer as unknown as { unref?: () => void } diff --git a/shared/test/websocketTransport.test.ts b/shared/test/websocketTransport.test.ts index 476c695..9477909 100644 --- a/shared/test/websocketTransport.test.ts +++ b/shared/test/websocketTransport.test.ts @@ -130,3 +130,17 @@ it('ignores late events from a socket superseded by a reconnect', async () => { expect(states.length).toBe(stateCount) expect(controls).toEqual([]) }) + +it('a socket rejected before it opens cannot deliver a late message', async () => { + jest.useFakeTimers() + const transport = new WebSocketTransport(WS) + const controls: string[] = [] + transport.onControl(m => controls.push(m.t)) + const p = transport.connect('ws://x') + const staleMsg = last.onmessage // capture before the reject detaches it + last.onclose?.(null) // reject before open + await expect(p).rejects.toThrow(/closed during connect/) + // The rejected socket is severed, so a late frame from it must not reach the app. + staleMsg?.({ data: encodeControl({ t: 'pin-ok' }) }) + expect(controls).toEqual([]) +}) From 913ab7762e1caf00b35aebfd88820e913bab4c09 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Thu, 9 Jul 2026 23:48:26 +0200 Subject: [PATCH 72/75] fix(tabby): unsubscribe tab.destroyed$ on share teardown The destroyed$ subscription was created on every startSharing without being stored or unsubscribed, so re-sharing a tab accumulated stale subscribers on its Subject. Store it in the per-tab shareTimers record and unsubscribe it in clearShareTimers, so exactly one live subscription exists per active share. Closes the code-review C nit. --- .../tabby/src/services/peershell.service.ts | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/clients/tabby/src/services/peershell.service.ts b/clients/tabby/src/services/peershell.service.ts index 8d5975c..02640a9 100644 --- a/clients/tabby/src/services/peershell.service.ts +++ b/clients/tabby/src/services/peershell.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core' -import { map } from 'rxjs' +import { map, Subscription } from 'rxjs' import { NgbModal } from '@ng-bootstrap/ng-bootstrap' import { AppService, ConfigService, NotificationsService, BaseTabComponent, SplitTabComponent, PromptModalComponent, PlatformService } from 'tabby-core' import { BaseTerminalTabComponent, ResizeEvent } from 'tabby-terminal' @@ -18,9 +18,13 @@ import webClientHtml from '../../assets/web-client.html' @Injectable({ providedIn: 'root' }) export class PeershellService { private readonly shares = new Map() - // Per-share grace/establish timers, keyed by tab so stopSharing() owns their teardown. - private readonly shareTimers = new Map | null, establish: ReturnType | null }>() + // Per-share cleanup state, keyed by tab so stopSharing() owns its teardown: the grace/establish + // timers and the tab.destroyed$ subscription. + private readonly shareTimers = new Map | null, + establish: ReturnType | null, + destroyed: Subscription | null, + }>() constructor( private readonly app: AppService, @@ -110,8 +114,11 @@ export class PeershellService { // immediately — wait ~10s for a reconnect before tearing it down. // Per-share timers, owned by this tab so stopSharing() cancels them on teardown. Otherwise a // stale grace/establish timer could later fire stopSharing() on a tab the host has re-shared. - const timers: { grace: ReturnType | null, establish: ReturnType | null } = - { grace: null, establish: null } + const timers: { + grace: ReturnType | null, + establish: ReturnType | null, + destroyed: Subscription | null, + } = { grace: null, establish: null, destroyed: null } this.shareTimers.set(tab, timers) // Auto-kill a share that never gets a connected guest within 5 minutes of starting. let established = false @@ -160,7 +167,7 @@ export class PeershellService { }) this.shares.set(tab, controller) - tab.destroyed$.subscribe(() => { + timers.destroyed = tab.destroyed$.subscribe(() => { this.shares.delete(tab) this.clearShareTimers(tab) }) @@ -322,6 +329,10 @@ export class PeershellService { clearTimeout(t.establish) t.establish = null } + if (t.destroyed) { + t.destroyed.unsubscribe() + t.destroyed = null + } this.shareTimers.delete(tab) } From f766401e1c35c81f93d8f6bd3b420b464e770389 Mon Sep 17 00:00:00 2001 From: tis24dev Date: Fri, 10 Jul 2026 00:02:20 +0200 Subject: [PATCH 73/75] refactor(server): drop the legacy ?token= WS-upgrade fallback (subprotocol only) The account token now rides ONLY in the Sec-WebSocket-Protocol subprotocol, never the URL, so it stays out of reverse-proxy/access logs. No client used the URL fallback (the host sends the token in the subprotocol; the web guest sends no token on the handshake and delivers its magic-link token in the join frame). The gate test is migrated to the subprotocol and asserts a token in the URL is now rejected. Closes CodeRabbit #20 (removed after the one-release compat window). --- server/src/index.cjs | 17 ++++++++--------- shared/test/auth.integration.test.ts | 15 +++++++++------ 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/server/src/index.cjs b/server/src/index.cjs index 0ca6f1b..b9527ed 100644 --- a/server/src/index.cjs +++ b/server/src/index.cjs @@ -1,12 +1,12 @@ /** - * @peershell/server — rendezvous + blind relay + reverse HTTP tunnel + accounts. + * @peershell/server: rendezvous + blind relay + reverse HTTP tunnel + accounts. * * Relay: pairs one host + one guest by room-code / magic-link token, forwards every frame verbatim, * and serves the host-embedded web-client to browsers that open the magic-link (GET /s/). * * Accounts (Stage 6): open registration + email verification (mock-logged for MVP; SMTP = Stage 7), * login -> opaque bearer token, optional TOTP 2FA, logout/refresh, dashboard (GET /sessions). - * create-session over WS is GATED behind a valid account token (?token= on the WS upgrade URL): + * create-session over WS is GATED behind a valid account token (Sec-WebSocket-Protocol subprotocol): * without it, anyone reaching the public server could open sessions. Guests do NOT need an account * (they authenticate to the host with the per-session PIN, peer-to-peer). * @@ -147,7 +147,7 @@ async function deliverVerifyCode(email, code, cfg = {}, kind = 'verification') { return { delivered: 'log' } } -// Passwords are stored ONLY as a salted, one-way scrypt hash (memory-hard) — never plaintext, and not +// Passwords are stored ONLY as a salted, one-way scrypt hash (memory-hard), never plaintext, and not // recoverable by anyone (including us). Self-describing format: scrypt$N$r$p$saltHex$hashHex. Legacy // pbkdf2 accounts (salt+hash fields) still verify and are upgraded to scrypt on next successful login. const SCRYPT = { N: 16384, r: 8, p: 1, keylen: 32 } @@ -183,7 +183,7 @@ function verifyPassword(account, password) { return false } -// --- TOTP (RFC 6238, SHA-1/30s/6-digit) — inline, zero deps --- +// --- TOTP (RFC 6238, SHA-1/30s/6-digit), inline, zero deps --- function base32Encode(buf) { let bits = '' for (const byte of buf) { @@ -360,7 +360,7 @@ function startRelay(port = 0, opts = {}) { return true } if (!origin || origin === 'null' || origin === 'file://') { - return true // non-browser client or file:// (Electron renderer) — not a CSWSH vector + return true // non-browser client or file:// (Electron renderer), not a CSWSH vector } if (allowedOrigins.has(origin)) { return true @@ -643,7 +643,7 @@ function startRelay(port = 0, opts = {}) { return sendJson(res, 200, { ok: true, needsVerification: true }) } // Email not deliverable (no SMTP / send failed): don't strand the user behind a - // code they can't receive — auto-verify and log them in immediately. + // code they can't receive, auto-verify and log them in immediately. acct.verified = true acct.verifyCode = null acct.lastLogin = now() @@ -966,12 +966,11 @@ function startRelay(port = 0, opts = {}) { sock._role = 'guest' sock._lastSeen = now() // Account token (host) rides in the Sec-WebSocket-Protocol handshake header as - // peershell.bearer.. One-release fallback: the legacy ?token= query param. + // peershell.bearer., so it never lands in reverse-proxy/access logs. let acct = null let tokenHash = null try { - const fromHeader = bearerFromProtocolHeader(req.headers['sec-websocket-protocol']) - const raw = fromHeader || new URL(req.url || '/', 'http://x').searchParams.get('token') + const raw = bearerFromProtocolHeader(req.headers['sec-websocket-protocol']) acct = raw ? accountFromToken(raw) : null // Remember which token authorized this socket so a password change can drop the sessions // whose token it revoked while keeping the caller's current one. diff --git a/shared/test/auth.integration.test.ts b/shared/test/auth.integration.test.ts index 1387f3e..ca11320 100644 --- a/shared/test/auth.integration.test.ts +++ b/shared/test/auth.integration.test.ts @@ -268,22 +268,25 @@ it('password reset terminates the account live host WS sessions', async () => { } }, 40000) -it('WS create-session is gated: rejected without a token, accepted with one', async () => { +it('WS create-session is gated: rejected without a token, accepted via subprotocol', async () => { const noAuth = await createSessionWs() expect(noAuth.t).toBe('error') expect(noAuth.code).toBe('unauthorized') const token = await registerVerifyLogin('dave@example.com') - const ok = await createSessionWs(token) - expect(ok.t).toBe('session-created') - expect(ok.room).toMatch(/^[2-9A-HJ-NP-Z]{6}$/) - expect(ok.magicLink).toContain('/s/') - // The same token is accepted via the Sec-WebSocket-Protocol subprotocol (not the URL), and the + // The account token is accepted via the Sec-WebSocket-Protocol subprotocol (not the URL), and the // server echoes ONLY the non-secret sentinel back, never the token. const sub = await createSessionWsSub(token) expect(sub.msg.t).toBe('session-created') + expect(sub.msg.room).toMatch(/^[2-9A-HJ-NP-Z]{6}$/) + expect(sub.msg.magicLink).toContain('/s/') expect(sub.proto).toBe('peershell.v1') + + // The legacy ?token= URL fallback is gone: a valid token placed in the URL is now ignored. + const urlTok = await createSessionWs(token) + expect(urlTok.t).toBe('error') + expect(urlTok.code).toBe('unauthorized') }, 20000) it('rejects a cross-origin WS upgrade (CSWSH) but allows the configured origin and no-origin clients', async () => { From 332e5273818769ae7afa77c8a494cdc1526ae51d Mon Sep 17 00:00:00 2001 From: tis24dev Date: Fri, 10 Jul 2026 00:02:20 +0200 Subject: [PATCH 74/75] style: remove em/en dashes from UI strings, logs and comments Per the project no-em-dash convention, replace every em/en dash in source (notifications, modal/settings/login UI text, the plugin-loaded log line, and code comments) with plain punctuation. Display/comment-only; no behavior change. --- clients/tabby/src/account/account.service.ts | 2 +- clients/tabby/src/account/login-modal.component.ts | 2 +- clients/tabby/src/host/share-info-modal.component.ts | 4 ++-- clients/tabby/src/index.ts | 2 +- clients/tabby/src/services/peershell.service.ts | 10 +++++----- clients/tabby/src/settings/settings-tab.component.ts | 4 ++-- shared/src/httpTunnelHandler.ts | 2 +- shared/src/protocol.ts | 2 +- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/clients/tabby/src/account/account.service.ts b/clients/tabby/src/account/account.service.ts index c32599c..b346fb8 100644 --- a/clients/tabby/src/account/account.service.ts +++ b/clients/tabby/src/account/account.service.ts @@ -17,7 +17,7 @@ export interface AccountApiResult { * Client-neutral account layer: talks the server's REST API (fetch) and keeps the bearer token. * * Token storage: Tabby config store (`peershell.account`), persisted via ConfigService.save(). This is - * an MVP tradeoff — the Tabby vault (encrypted at rest) is the intended hardening and can replace this + * an MVP tradeoff: the Tabby vault (encrypted at rest) is the intended hardening and can replace this * behind the same getToken/persist surface without touching callers. */ @Injectable({ providedIn: 'root' }) diff --git a/clients/tabby/src/account/login-modal.component.ts b/clients/tabby/src/account/login-modal.component.ts index 83d8dbd..2b9d5c6 100644 --- a/clients/tabby/src/account/login-modal.component.ts +++ b/clients/tabby/src/account/login-modal.component.ts @@ -163,7 +163,7 @@ export class LoginModalComponent { } if (r.status === 200 && r.alreadyRegistered) { this.switch('login') - this.info = 'That email is already registered — please log in.' + this.info = 'That email is already registered. Please log in.' return } this.fail(r) diff --git a/clients/tabby/src/host/share-info-modal.component.ts b/clients/tabby/src/host/share-info-modal.component.ts index e12982f..a3816fc 100644 --- a/clients/tabby/src/host/share-info-modal.component.ts +++ b/clients/tabby/src/host/share-info-modal.component.ts @@ -4,7 +4,7 @@ import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap' /** Persistent, copyable display of a live share's magic-link + PIN (shown when sharing starts). */ @Component({ template: ` - +