diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index ba0e6fd..6ce8237 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -13,6 +13,9 @@ jobs: with: node-version: '18' - run: npm ci + - run: npm run lint + - run: npm run format:check + - run: npm run complexity:check - run: npm run typecheck - run: npm test - run: npm run build diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..cbeda7b --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,17 @@ +#!/bin/sh +# Pre-commit gate. Auto-fixes formatting/lint on staged source, then enforces +# lint + cognitive-complexity. Enabled via `git config core.hooksPath .githooks` +# (run automatically by the `prepare` npm script on install). +set -e + +# Auto-fix format + lint on staged TypeScript sources, then re-stage them. +staged=$(git diff --cached --name-only --diff-filter=ACM -- 'src/*.ts' 'src/**/*.ts') +if [ -n "$staged" ]; then + echo "$staged" | xargs npx prettier --write + echo "$staged" | xargs npx eslint --fix + echo "$staged" | xargs git add +fi + +# Enforce (no auto-fix): lint must be clean, and no function over the complexity gate. +npm run lint +npm run complexity:check diff --git a/.gitignore b/.gitignore index a64bd69..32206f8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,7 @@ coverage/ # Env .env .env.* + +# Astro (docs site) +.astro/ +website/dist/ diff --git a/.prettierrc.json b/.prettierrc.json new file mode 100644 index 0000000..f730360 --- /dev/null +++ b/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "printWidth": 120, + "tabWidth": 2, + "singleQuote": true, + "semi": true, + "trailingComma": "all", + "arrowParens": "always" +} diff --git a/README.md b/README.md index d7079d1..307be60 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,13 @@ > A calm, type-safe HTTP framework for Node. Your API is an explicit **dependency graph** you can see, slice, and trust — not a mutable bag threaded through positional middleware. -`@green-tea/core` — **beta**, RC-track. One runtime dependency: `reflect-metadata` (`ws` is an optional peer, only for WebSocket/mesh). +`@green-tea/core` — **beta**, RC-track. One runtime dependency: `reflect-metadata`. Two optional peers you install only if you use them: `ws` (WebSocket / mesh) and `busboy` (multipart uploads). ```bash npm install @green-tea/core reflect-metadata +# optional, only if you use them: +npm install ws # WebSocket routes (@Ws) and mesh +npm install busboy # multipart/form-data file uploads ``` --- @@ -77,9 +80,10 @@ Beta shipped the parts a real API needs, without growing the runtime dependency - **Secure by default.** `nosniff`, `X-Frame-Options`, `Referrer-Policy`, HSTS-when-secure — on every response, opt-out with one flag. - **CORS** with a guarded preflight and the credentials-never-`*` rule enforced for you. - **Validation via [Standard Schema](https://standardschema.dev).** `@body(schema)` accepts zod, valibot, or arktype — you bring the validator, the core stays zero-dep. Invalid input → `422` with per-field issues; the parsed value reaches your handler typed. -- **Real body parsing.** JSON, urlencoded, and `multipart/form-data` file uploads (`@body()` → `{ fields, files }`), size-capped (`413`) against DoS. +- **Real body parsing.** JSON and urlencoded out of the box; `multipart/form-data` file uploads (`@body()` → `{ fields, files }`) via the optional [`busboy`](https://github.com/mscdex/busboy) peer dependency (`npm i busboy`) — a multipart request without it returns a clear `501`. All size-capped (`413`) against DoS. - **Graceful shutdown.** `app.close()` drains in-flight requests, closes live streams and mesh links. - **Testable by construction.** `createApp({ overrides: { db: fakeDb } })` swaps any node in one line. +- **Dual ESM + CommonJS.** Ships both builds behind an `exports` map — `import` and `require` both resolve, with matching type declarations. ## Benchmarks @@ -103,7 +107,7 @@ Every framework here can serve `/users/:id`. The difference shows up as the app | **Real-time** | bolt on `ws`/`sse` libs | plugins | separate Gateway + adapter | separate engine | **return an `AsyncIterable`** — SSE, ndjson & WebSocket, one primitive | | **Cross-service calls** | HTTP client / gRPC by hand | HTTP client / gRPC | Microservices transport + message patterns | — | **`@needs('x')` resolves on another node** | | **Plugin can break your pipeline?** | yes (deletes your body parser) | encapsulated, but hooks are global | interceptor order matters | yes | **no** — plugins only `bus.on` + `scope.add` | -| **Runtime deps** | minimal | minimal | heavy (rxjs, reflect-metadata, …) | Express + InversifyJS | **`reflect-metadata` only** (`ws` optional) | +| **Runtime deps** | minimal | minimal | heavy (rxjs, reflect-metadata, …) | Express + InversifyJS | **`reflect-metadata` only** (`ws`, `busboy` optional) | ### Read it as a story @@ -170,18 +174,45 @@ The handler signature declares exactly what it wants — in any order, nothing m | `@param(...)` | route params | `()` · `('id')` · `('id', schema)` | | `@query(...)` | parsed query string | `()` · `('q')` · `(['a','b'])` · `(schema)` | | `@body(...)` | parsed body (JSON / urlencoded / multipart) | `()` · `('field')` · `(schema)` | -| `@headers(...)` | request headers | `()` · `('authorization')` · `(schema)` | +| `@headers(...)` | request headers (whole bag or picked) | `()` · `('authorization')` · `(['a','b'])` · `(schema)` | +| `@header('name')` | one request header (singular alias of `@headers`) | `('x-trace')` · `('x-count', schema)` | `@needs` keys are validated at boot: nothing provides the key → `createApp` throws with a clear error instead of serving `undefined`. Pass a Standard Schema (`@body(User)`) and the value is validated, coerced, and typed before your handler sees it. +> **Optional providers degrade, they don't crash.** A provider marked `optional: true` that throws on boot does **not** abort startup — it is left unregistered and logged. On `listen()` the app prints a one-line summary of what's running degraded, and the list is queryable via `app.degraded()`. Routes that actually need a degraded provider fail at request time, not at boot. This is deliberate (graceful degradation); wire an alert off `app.degraded()` or the `boot:provider:fail` bus event in production so a degraded start is never silent. + +## Routing + +Patterns match by segment: static, `:param` (one segment), and a trailing `:name*` **catch-all** that captures the rest of the path — slashes included — into `params.name`. When more than one route matches, the **most specific wins** (static ▸ `:param` ▸ catch-all), independent of registration order. A path that exists under a *different* method returns **`405` with an `Allow` header**, not `404`. + +```typescript +@Get('/files/:path*') // /files/img/2026/logo.png → params.path = "img/2026/logo.png" +``` + +**Not yet** (post-beta, on the roadmap): regex / typed param constraints like `:id(\d+)`, and route matching is a linear scan — fine for typical route tables, but a radix-tree matcher for very large ones isn't built. + ## Two layers 1. **Typed functional core (`flow`)** — `flow().step(...).step(...).handle(...)`; step outputs accumulate into the context type (`Acc & Out`). This is where the compile-time guarantee lives. 2. **Declarative decorator layer** — `@Provider/@Step/@Module/@Route/@Get/@Transformer` + argument decorators. Emits runtime metadata, builds and topologically sorts the graph, validates at boot. +## Why legacy decorators + +green-tea uses **legacy** (experimental) decorators — you set `experimentalDecorators: true` in your `tsconfig`. This is a design decision, not inertia. + +The framework's argument injection (`@param`, `@query`, `@body`, `@header`, `@needs`, `@ctx`, `@inbound`, `@abort`) relies on **parameter decorators** — and the TC39 standard decorators proposal (Stage 3) deliberately does **not** include them. There is no standards-track way to decorate a parameter today, so a handler like `handler(@param('id') id: string)` is only expressible with legacy decorators. + +"Stage 3" also means *not finalized*: the proposal can still change before engines ship it. We track it, and if parameter injection ever gets a viable standard path we'll revisit. Until then, legacy decorators are the right tool for this API — not a shortcut. (We don't rely on `emitDecoratorMetadata`/`design:type` reflection; argument positions are recorded explicitly, so this is the only legacy surface we depend on.) + ## Honest scope -green-tea is **beta**, on the road to a release candidate. Express and Fastify have a decade of ecosystem; NestJS has enterprise tooling and a huge plugin catalog. green-tea's mesh is a walking skeleton — distributed DI works, but discovery, load-balancing, and failover are not built yet. Pick green-tea for the model and the ergonomics, not the ecosystem — *yet*. +green-tea is **beta**, on the road to a release candidate. Express and Fastify have a decade of ecosystem; NestJS has enterprise tooling and a huge plugin catalog. Pick green-tea for the model and the ergonomics, not the ecosystem — *yet*. + +**Bring your own auth (and friends).** green-tea ships transport security — TLS/wss, secure-by-default headers, CORS — but **not** authentication, authorization, rate-limiting, CSRF, or sessions. You compose those as steps and plugins (the `Authenticate` step in the quick look is the pattern). Unlike Express/Fastify, there is no off-the-shelf plugin ecosystem for them yet. + +**Node only.** Runs on Node ≥ 18. Deno / Bun / edge runtimes (over web-standard `Request`/`Response`) are on the roadmap, not built — only `src/http/` is runtime-specific today. + +**mesh is alpha.** Distributed DI works, but discovery, load-balancing, and failover are not built, and its API and wire protocol may change between releases. It is gated behind an explicit opt-in — `createApp({ mesh, experimental: true })` — and `createApp` throws if you configure `mesh` without it. Don't ship mesh to production yet. ## Docs & development @@ -207,7 +238,9 @@ npm run bench # regenerate BENCHMARKS.md ## Versioning -green-tea uses **calendar versioning**: `YY.MM.PATCH` (e.g. `26.07.0` = the first release cut in July 2026, patch 0). A version tells you *when* it shipped; breaking changes are called out in the [CHANGELOG](./CHANGELOG.md). +green-tea uses **calendar versioning**: `YY.MM.PATCH` (e.g. `26.07.0` = the first release cut in July 2026, patch 0). A version tells you *when* it shipped, not how many breaking changes preceded it — those are always called out in the [CHANGELOG](./CHANGELOG.md). + +**While in beta**, releases carry a `-beta.N` pre-release suffix on the calendar version (e.g. `26.07.0-beta.0`) and publish under the npm `beta` dist-tag — so a plain `npm install @green-tea/core` won't pick one up until the first stable calendar release. The API can still change between betas. ## License diff --git a/docs/quickstart.md b/docs/quickstart.md index edd04ca..2077037 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -165,6 +165,9 @@ bounded buffer (`channel({ buffer: 100 })`, drop-oldest). A **teacup** can depend on a token that physically lives on a **teapot**. Exports are opt-in (`export: true`) and the control channel is gated by a shared secret. +> ⚠️ **mesh is alpha** — its API and wire protocol may change. It's gated behind `experimental: true`; +> `createApp` throws if you pass `mesh` without it. Don't ship it to production yet. + **Node A — teapot (exposes `config`, `auth`, and a route):** ```typescript @@ -180,7 +183,7 @@ class Svc { @Get('/ping', { export: true }) ping() { return { pong: true }; } } @Module({ mountpoint: '/api', providers: [Config], steps: [Auth], controllers: [Svc] }) class TeapotModule {} -const teapot = createApp({ modules: [TeapotModule], mesh: { secret: 'shh' } }); +const teapot = createApp({ modules: [TeapotModule], experimental: true, mesh: { secret: 'shh' } }); await teapot.listen(3002); ``` @@ -199,6 +202,7 @@ class TeacupModule {} const teacup = createApp({ modules: [TeacupModule], + experimental: true, mesh: { teapots: [{ url: 'ws://A-host:3002/__mesh__/control', secret: 'shh' }] }, }); await teacup.listen(3003); @@ -309,6 +313,8 @@ to the WebSocket handshake (101/upgrade) response. ## 8. File uploads / multipart +> Multipart parsing uses the optional [`busboy`](https://github.com/mscdex/busboy) peer dependency — install it with `npm i busboy`. A `multipart/form-data` request to a server without busboy installed returns `501`. (JSON and urlencoded need nothing extra.) + A request with `Content-Type: multipart/form-data` makes `@body()` resolve to `{ fields, files }` instead of a plain object: diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 0000000..565e909 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,26 @@ +import js from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import stylistic from '@stylistic/eslint-plugin'; + +export default tseslint.config( + { ignores: ['dist', 'node_modules', 'bench', 'coverage'] }, + js.configs.recommended, + ...tseslint.configs.recommended, + { + plugins: { '@stylistic': stylistic }, + rules: { + // The request pipeline accumulates a dynamic context object by design; + // `any` there is load-bearing, not laziness. Flag it as a warning so new + // uses are visible without failing the build. + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], + // Breathing room around multi-line blocks (for/while/if/function/class) so + // consecutive blocks don't read as one wall of code. Auto-fixable. + '@stylistic/padding-line-between-statements': [ + 'error', + { blankLine: 'always', prev: 'multiline-block-like', next: '*' }, + { blankLine: 'always', prev: '*', next: 'multiline-block-like' }, + ], + }, + }, +); diff --git a/example/server.ts b/example/server.ts index c9c1367..ed43747 100644 --- a/example/server.ts +++ b/example/server.ts @@ -101,7 +101,7 @@ class PingController { @Module({ mountpoint: '/mesh', providers: [ConfigProvider], steps: [AuthStep], controllers: [PingController] }) class TeapotModule {} -export const teapotApp = createApp({ modules: [TeapotModule], mesh: { secret: 'demo-secret' } }); +export const teapotApp = createApp({ modules: [TeapotModule], experimental: true, mesh: { secret: 'demo-secret' } }); @Route('/remote') class TeacupController { diff --git a/package-lock.json b/package-lock.json index 579edfa..a78fbe7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,28 +12,41 @@ "reflect-metadata": "0.2.2" }, "devDependencies": { + "@eslint/js": "^9.39.4", "@nestjs/common": "^11.1.27", "@nestjs/core": "^11.1.27", "@nestjs/platform-express": "^11.1.27", "@nestjs/platform-fastify": "^11.1.27", + "@stylistic/eslint-plugin": "^5.10.0", "@types/autocannon": "^7.12.7", + "@types/busboy": "^1.5.4", "@types/express": "^5.0.6", "@types/node": "^18.19.0", "@types/ws": "^8.18.1", "autocannon": "^8.0.0", + "busboy": "^1.6.0", + "cognitive-complexity-ts": "^0.8.2", + "eslint": "^9.39.4", "express": "^5.2.1", "fastify": "^5.10.0", "graphql": "^16.9.0", + "prettier": "^3.9.4", "rxjs": "^7.8.2", + "tsup": "^8.5.1", "tsx": "^4.23.0", "typescript": "^5.5.0", + "typescript-eslint": "^8.63.0", "vitest": "^2.0.0", "ws": "^8.21.0" }, "peerDependencies": { + "busboy": "^1.6.0", "ws": "^8.18.0" }, "peerDependenciesMeta": { + "busboy": { + "optional": true + }, "ws": { "optional": true } @@ -510,6 +523,174 @@ "node": ">=12" } }, + "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, + "license": "MIT", + "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/eslint-utils/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, + "license": "Apache-2.0", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "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, + "license": "MIT", + "engines": { + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" + } + }, + "node_modules/@eslint/config-array": { + "version": "0.21.2", + "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.2.tgz", + "integrity": "sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/object-schema": "^2.1.7", + "debug": "^4.3.1", + "minimatch": "^3.1.5" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/config-helpers": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.4.2.tgz", + "integrity": "sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/core": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.17.0.tgz", + "integrity": "sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@types/json-schema": "^7.0.15" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "3.3.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.5.tgz", + "integrity": "sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ajv": "^6.14.0", + "debug": "^4.3.2", + "espree": "^10.0.1", + "globals": "^14.0.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.1", + "minimatch": "^3.1.5", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.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, + "license": "MIT", + "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/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, + "license": "MIT" + }, + "node_modules/@eslint/js": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.4.tgz", + "integrity": "sha512-nE7DEIchvtiFTwBw4Lfbu59PG+kCofhjsKaCWzxTpt4lfRjRMqG6uMBzKXuEcyXhOHoUp9riAm7/aWYGhXZ9cw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + } + }, + "node_modules/@eslint/object-schema": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.7.tgz", + "integrity": "sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, + "node_modules/@eslint/plugin-kit": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.4.1.tgz", + "integrity": "sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@eslint/core": "^0.17.0", + "levn": "^0.4.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + } + }, "node_modules/@fastify/ajv-compiler": { "version": "4.0.5", "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-4.0.5.tgz", @@ -703,6 +884,165 @@ "ipaddr.js": "^2.1.0" } }, + "node_modules/@humanfs/core": { + "version": "0.19.2", + "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz", + "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/types": "^0.15.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/node": { + "version": "0.16.8", + "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz", + "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@humanfs/core": "^0.19.2", + "@humanfs/types": "^0.15.0", + "@humanwhocodes/retry": "^0.4.0" + }, + "engines": { + "node": ">=18.18.0" + } + }, + "node_modules/@humanfs/types": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz", + "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18.0" + } + }, + "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, + "license": "Apache-2.0", + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/retry": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz", + "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18.18" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@isaacs/cliui": { + "version": "8.0.2", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^5.1.2", + "string-width-cjs": "npm:string-width@^4.2.0", + "strip-ansi": "^7.0.1", + "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + "wrap-ansi": "^8.1.0", + "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@isaacs/cliui/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/@isaacs/cliui/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@isaacs/cliui/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@isaacs/cliui/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@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==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, "node_modules/@jridgewell/sourcemap-codec": { "version": "1.5.5", "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", @@ -710,6 +1050,17 @@ "dev": true, "license": "MIT" }, + "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, "node_modules/@lukeed/csprng": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", @@ -920,6 +1271,13 @@ "toad-cache": "^3.7.0" } }, + "node_modules/@one-ini/wasm": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@one-ini/wasm/-/wasm-0.1.1.tgz", + "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==", + "dev": true, + "license": "MIT" + }, "node_modules/@pinojs/redact": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/@pinojs/redact/-/redact-0.4.0.tgz", @@ -927,6 +1285,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@pkgjs/parseargs": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=14" + } + }, "node_modules/@rollup/rollup-android-arm-eabi": { "version": "4.62.2", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.62.2.tgz", @@ -1277,6 +1646,27 @@ "win32" ] }, + "node_modules/@stylistic/eslint-plugin": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.10.0.tgz", + "integrity": "sha512-nPK52ZHvot8Ju/0A4ucSX1dcPV2/1clx0kLcH5wDmrE4naKso7TUC/voUyU1O9OTKTrR6MYip6LP0ogEMQ9jPQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/types": "^8.56.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": "^9.0.0 || ^10.0.0" + } + }, "node_modules/@tokenizer/inflate": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/@tokenizer/inflate/-/inflate-0.4.1.tgz", @@ -1323,6 +1713,16 @@ "@types/node": "*" } }, + "node_modules/@types/busboy": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/@types/busboy/-/busboy-1.5.4.tgz", + "integrity": "sha512-kG7WrUuAKK0NoyxfQHsVE6j1m01s6kMma64E+OZenQABMQyTJop1DumUWcLwAQ2JzpefU7PDYoRDKl8uZosFjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/connect": { "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", @@ -1372,6 +1772,13 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT" + }, "node_modules/@types/node": { "version": "18.19.130", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.19.130.tgz", @@ -1427,6 +1834,288 @@ "@types/node": "*" } }, + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.63.0.tgz", + "integrity": "sha512-rvwSgqT+DHpWdzfSzPatRLm02a0GlESt++9iy3hLCDY4BgkaLcl8LBi9Yh7XGFBpwcBE/K3024QuXWTpbz4FfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/regexpp": "^4.12.2", + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/type-utils": "8.63.0", + "@typescript-eslint/utils": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "ignore": "^7.0.5", + "natural-compare": "^1.4.0", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^8.63.0", + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz", + "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "node_modules/@typescript-eslint/parser": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.63.0.tgz", + "integrity": "sha512-gwh4gvvlaVDKKxyfxMG+Gnu1u9X0OQBwyGLkbwB65dIzBKnxeRiJlNFqlI3zwVhNXJIs6qV7mlFCn/BIajlVig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/project-service": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.63.0.tgz", + "integrity": "sha512-e5dh0/UI0ok53AlZ5wRkXCB32z/f2jUZqPR/ygAw5WYaSw8j9EoJWlS7wQjr/dmOaqWjnPIn2m+HhVPCMWGZVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/tsconfig-utils": "^8.63.0", + "@typescript-eslint/types": "^8.63.0", + "debug": "^4.4.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.63.0.tgz", + "integrity": "sha512-uUyfMWCnDSN8bCpcrY8nGP2BLkQ9Xn0GsipcONcpIDWhwhO4ZSyHvyS14U3X75mzxWxL3I2UZIrenTzdzcJO8A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/tsconfig-utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.63.0.tgz", + "integrity": "sha512-sUAbkulqBAsncKnbRP3+7CtQFRKicexnj7ZwNC6ddCR7EmrXvjvdCYMJbUIqMd6lwoEriZjwLo08aS5tSjVMHg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.63.0.tgz", + "integrity": "sha512-Nzzh/OGxVCOjObjaj1CQF2RUasyYy2Jfuh+zZ3PjLzG2fYRriAiZLib9UKtO+CpQAS3YHiAS+ckZDclwqI1TPA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/utils": "8.63.0", + "debug": "^4.4.3", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/types": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.63.0.tgz", + "integrity": "sha512-xyLtl9DUBBFrcJS4x2pIqGLH68/tC2uOa4Z7pUteW09D3bXnnXUom4dyPikzWgB7llmIc1zoeI3aoUdC4rPK/Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.63.0.tgz", + "integrity": "sha512-ygBkU+B7ex5UI/gKhaqexWev79uISfIv7XQCRNYO/jmD8rGLPyWLAb3KMRT6nd8Gt9bmUBi9+iX6tBdYfOY81Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/project-service": "8.63.0", + "@typescript-eslint/tsconfig-utils": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/visitor-keys": "8.63.0", + "debug": "^4.4.3", + "minimatch": "^10.2.2", + "semver": "^7.7.3", + "tinyglobby": "^0.2.15", + "ts-api-utils": "^2.5.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "5.0.7", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.7.tgz", + "integrity": "sha512-7oFy703dxfY3/NLxC1fh2SUCQ0H9rmAY+5EpDVfXjUTTs+HEwR2nYaqLv+GWcTsumwxPfiz6CzCNkwXwBUwqCA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "10.2.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.5.tgz", + "integrity": "sha512-MULkVLfKGYDFYejP07QOurDLLQpcjk7Fw+7jXS2R2czRQzR56yHRveU5NDJEOviH+hETZKSkIk5c+T23GjFUMg==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "brace-expansion": "^5.0.5" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.63.0.tgz", + "integrity": "sha512-fUKaeAvrTuQg/Tgt3nliAUSZHJM6DlCcfyEmxCvlX8kieWSStBX+5O5Fnidtc3i2JrH+9c/GL4RY2iasd/GPTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.1", + "@typescript-eslint/scope-manager": "8.63.0", + "@typescript-eslint/types": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.63.0.tgz", + "integrity": "sha512-UexrHGnGTpbuQHct2ExOc2ZcFbGUS9FOesCxxqdBGcpI1BxYu/LZ6U8Aq6/72XtF/qRBk9nhuGHFJIXXMhPMdw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/types": "8.63.0", + "eslint-visitor-keys": "^5.0.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz", + "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=24" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, "node_modules/@vitest/expect": { "version": "2.1.9", "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-2.1.9.tgz", @@ -1540,6 +2229,16 @@ "url": "https://opencollective.com/vitest" } }, + "node_modules/abbrev": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", + "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", + "dev": true, + "license": "ISC", + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/abstract-logging": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", @@ -1561,6 +2260,29 @@ "node": ">= 0.6" } }, + "node_modules/acorn": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "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, + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/ajv": { "version": "8.20.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz", @@ -1622,6 +2344,13 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "dev": true, + "license": "MIT" + }, "node_modules/append-field": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", @@ -1629,6 +2358,13 @@ "dev": true, "license": "MIT" }, + "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, + "license": "Python-2.0" + }, "node_modules/assertion-error": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-2.0.1.tgz", @@ -1712,6 +2448,13 @@ "fastq": "^1.17.1" } }, + "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==", + "dev": true, + "license": "MIT" + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -1772,6 +2515,17 @@ "url": "https://opencollective.com/express" } }, + "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, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, "node_modules/buffer": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", @@ -1804,6 +2558,38 @@ "dev": true, "license": "MIT" }, + "node_modules/bundle-name": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.0.tgz", + "integrity": "sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/bundle-require": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/bundle-require/-/bundle-require-5.1.0.tgz", + "integrity": "sha512-3WrrOuZiyaaZPWiEt4G3+IffISVC9HYlWueJEBWED4ZH4aIAC2PnkdnuRrR94M+w6yGWn4AglWtJtBI8YqvgoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "load-tsconfig": "^0.2.3" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "peerDependencies": { + "esbuild": ">=0.18" + } + }, "node_modules/busboy": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", @@ -1867,6 +2653,16 @@ "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, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/chai": { "version": "5.3.3", "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", @@ -1918,6 +2714,22 @@ "node": ">= 16" } }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/cli-table3": { "version": "0.6.5", "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.5.tgz", @@ -1934,6 +2746,28 @@ "@colors/colors": "1.5.0" } }, + "node_modules/cognitive-complexity-ts": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/cognitive-complexity-ts/-/cognitive-complexity-ts-0.8.2.tgz", + "integrity": "sha512-2ituXHQsA4PjFI3ySEgrzc50Mz48If1QHrr4HxHqD3kNg2nM9klBtfcj5NFvc3x5ciObFcoIJ8OANB2Rt73Gkw==", + "dev": true, + "license": "GPL-3.0", + "dependencies": { + "js-beautify": "^1.15.4", + "minimist": "^1.2.8", + "open": "^11.0.0", + "source-map-support": "^0.5.21", + "typescript": "^5.9.3" + }, + "bin": { + "ccts": "bin/cognitive-complexity-ts", + "ccts-json": "bin/cognitive-complexity-ts-json", + "ccts-ui": "bin/cognitive-complexity-ts-ui", + "cognitive-complexity-ts": "bin/cognitive-complexity-ts", + "cognitive-complexity-ts-json": "bin/cognitive-complexity-ts-json", + "cognitive-complexity-ts-ui": "bin/cognitive-complexity-ts-ui" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", @@ -1977,6 +2811,23 @@ "node": ">= 0.8" } }, + "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, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "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, + "license": "MIT" + }, "node_modules/concat-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", @@ -1993,6 +2844,34 @@ "typedarray": "^0.0.6" } }, + "node_modules/confbox": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/confbox/-/confbox-0.1.8.tgz", + "integrity": "sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==", + "dev": true, + "license": "MIT" + }, + "node_modules/config-chain": { + "version": "1.1.13", + "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", + "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "^1.3.4", + "proto-list": "~1.2.1" + } + }, + "node_modules/consola": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/consola/-/consola-3.4.2.tgz", + "integrity": "sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^14.18.0 || >=16.10.0" + } + }, "node_modules/content-disposition": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz", @@ -2062,6 +2941,21 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/debug": { "version": "4.4.3", "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", @@ -2090,6 +2984,56 @@ "node": ">=6" } }, + "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, + "license": "MIT" + }, + "node_modules/default-browser": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.0.tgz", + "integrity": "sha512-H9LMLr5zwIbSxrmvikGuI/5KGhZ8E2zH3stkMgM5LpOWDutGM2JZaj460Udnf1a+946zc7YBgrqEWwbk7zHvGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz", + "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -2135,6 +3079,58 @@ "node": ">= 0.4" } }, + "node_modules/eastasianwidth": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + "dev": true, + "license": "MIT" + }, + "node_modules/editorconfig": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-1.0.7.tgz", + "integrity": "sha512-e0GOtq/aTQhVdNyDU9e02+wz9oDDM+SIOQxWME2QRjzRX5yyLAuHDE+0aE8vHb9XRC8XD37eO2u57+F09JqFhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@one-ini/wasm": "0.1.1", + "commander": "^10.0.0", + "minimatch": "^9.0.1", + "semver": "^7.5.3" + }, + "bin": { + "editorconfig": "bin/editorconfig" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/editorconfig/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==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/editorconfig/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", @@ -2261,6 +3257,187 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "9.39.4", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.4.tgz", + "integrity": "sha512-XoMjdBOwe/esVgEvLmNsD3IRHkm7fbKIUGvrleloJXUZgDHig2IPWNniv+GwjyJXzuNqVjlr5+4yVUZjycJwfQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.8.0", + "@eslint-community/regexpp": "^4.12.1", + "@eslint/config-array": "^0.21.2", + "@eslint/config-helpers": "^0.4.2", + "@eslint/core": "^0.17.0", + "@eslint/eslintrc": "^3.3.5", + "@eslint/js": "9.39.4", + "@eslint/plugin-kit": "^0.4.1", + "@humanfs/node": "^0.16.6", + "@humanwhocodes/module-importer": "^1.0.1", + "@humanwhocodes/retry": "^0.4.2", + "@types/estree": "^1.0.6", + "ajv": "^6.14.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.6", + "debug": "^4.3.2", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^8.4.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "esquery": "^1.5.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^8.0.0", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "ignore": "^5.2.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.5", + "natural-compare": "^1.4.0", + "optionator": "^0.9.3" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://eslint.org/donate" + }, + "peerDependencies": { + "jiti": "*" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz", + "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz", + "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.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, + "license": "MIT", + "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/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, + "license": "MIT" + }, + "node_modules/espree": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz", + "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "acorn": "^8.15.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^4.2.1" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "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, + "license": "BSD-3-Clause", + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "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, + "license": "BSD-2-Clause", + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "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, + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, "node_modules/estree-walker": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", @@ -2271,6 +3448,16 @@ "@types/estree": "^1.0.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, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/etag": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", @@ -2349,6 +3536,13 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT" + }, "node_modules/fast-json-stringify": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-7.0.0.tgz", @@ -2374,6 +3568,13 @@ "rfdc": "^1.2.0" } }, + "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, + "license": "MIT" + }, "node_modules/fast-querystring": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", @@ -2469,6 +3670,37 @@ "reusify": "^1.0.4" } }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/file-entry-cache": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz", + "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "flat-cache": "^4.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/file-type": { "version": "21.3.4", "resolved": "https://registry.npmjs.org/file-type/-/file-type-21.3.4.tgz", @@ -2525,6 +3757,73 @@ "node": ">=20" } }, + "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, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fix-dts-default-cjs-exports": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fix-dts-default-cjs-exports/-/fix-dts-default-cjs-exports-1.0.1.tgz", + "integrity": "sha512-pVIECanWFC61Hzl2+oOCtoJ3F17kglZC/6N94eRWycFgBH35hHx0Li604ZIzhseh97mf2p0cv7vVrOZGoqhlEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "magic-string": "^0.30.17", + "mlly": "^1.7.4", + "rollup": "^4.34.8" + } + }, + "node_modules/flat-cache": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz", + "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==", + "dev": true, + "license": "MIT", + "dependencies": { + "flatted": "^3.2.9", + "keyv": "^4.5.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/flatted": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.2.tgz", + "integrity": "sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==", + "dev": true, + "license": "ISC" + }, + "node_modules/foreground-child": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.1.tgz", + "integrity": "sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==", + "dev": true, + "license": "ISC", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/form-data": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.6.tgz", @@ -2649,6 +3948,80 @@ "node": ">= 0.4" } }, + "node_modules/glob": { + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-10.5.0.tgz", + "integrity": "sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==", + "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, + "license": "ISC", + "dependencies": { + "foreground-child": "^3.1.0", + "jackspeak": "^3.1.2", + "minimatch": "^9.0.4", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^1.11.1" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "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, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/glob/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==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/glob/node_modules/minimatch": { + "version": "9.0.9", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz", + "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.2" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz", + "integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "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", @@ -2831,6 +4204,43 @@ ], "license": "BSD-3-Clause" }, + "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, + "license": "MIT", + "engines": { + "node": ">= 4" + } + }, + "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, + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.19" + } + }, "node_modules/inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", @@ -2838,6 +4248,13 @@ "dev": true, "license": "ISC" }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC" + }, "node_modules/ipaddr.js": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.4.0.tgz", @@ -2848,6 +4265,32 @@ "node": ">= 10" } }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "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", @@ -2858,6 +4301,51 @@ "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==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-in-ssh": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-in-ssh/-/is-in-ssh-1.0.0.tgz", + "integrity": "sha512-jYa6Q9rH90kR1vKB6NM7qqd1mge3Fx4Dhw5TVlK1MUBqhEOuCagrEHMevNuCcbECmXZ0ThXkRm+Ymr51HwEPAw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-promise": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", @@ -2865,6 +4353,29 @@ "dev": true, "license": "MIT" }, + "node_modules/is-wsl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "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, + "license": "ISC" + }, "node_modules/iterare": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", @@ -2875,6 +4386,91 @@ "node": ">=6" } }, + "node_modules/jackspeak": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "@isaacs/cliui": "^8.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + }, + "optionalDependencies": { + "@pkgjs/parseargs": "^0.11.0" + } + }, + "node_modules/joycon": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/joycon/-/joycon-3.1.1.tgz", + "integrity": "sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "node_modules/js-beautify": { + "version": "1.15.4", + "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.15.4.tgz", + "integrity": "sha512-9/KXeZUKKJwqCXUdBxFJ3vPh467OCckSBmYDwSK/EtV090K+iMJ7zx2S3HLVDIWFQdqMIsZWbnaGiba18aWhaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "config-chain": "^1.1.13", + "editorconfig": "^1.0.4", + "glob": "^10.4.2", + "js-cookie": "^3.0.5", + "nopt": "^7.2.1" + }, + "bin": { + "css-beautify": "js/bin/css-beautify.js", + "html-beautify": "js/bin/html-beautify.js", + "js-beautify": "js/bin/js-beautify.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/js-cookie": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.8.tgz", + "integrity": "sha512-yeJd4aNAdYZQjaon2bpD/Gb0B/omw7HQOsynXXcOiWVCacbBcPlgn8S/d1X6blFSaHao7ozqtW7NZW19xpCtIw==", + "dev": true, + "license": "MIT" + }, + "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" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "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, + "license": "MIT" + }, "node_modules/json-schema-ref-resolver": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-3.0.0.tgz", @@ -2902,6 +4498,37 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT" + }, + "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, + "license": "MIT", + "dependencies": { + "json-buffer": "3.0.1" + } + }, + "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, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/light-my-request": { "version": "6.6.0", "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-6.6.0.tgz", @@ -2955,6 +4582,26 @@ ], "license": "MIT" }, + "node_modules/lilconfig": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.3.tgz", + "integrity": "sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" + } + }, + "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, + "license": "MIT" + }, "node_modules/load-esm": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/load-esm/-/load-esm-1.0.3.tgz", @@ -2975,6 +4622,32 @@ "node": ">=13.2.0" } }, + "node_modules/load-tsconfig": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/load-tsconfig/-/load-tsconfig-0.2.5.tgz", + "integrity": "sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + } + }, + "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, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lodash.chunk": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.chunk/-/lodash.chunk-4.2.0.tgz", @@ -2996,6 +4669,13 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT" + }, "node_modules/loupe": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", @@ -3003,6 +4683,13 @@ "dev": true, "license": "MIT" }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "dev": true, + "license": "ISC" + }, "node_modules/magic-string": { "version": "0.30.21", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", @@ -3080,6 +4767,19 @@ "url": "https://opencollective.com/express" } }, + "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, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, "node_modules/minimist": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", @@ -3090,6 +4790,36 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/minipass": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz", + "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==", + "dev": true, + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/mlly": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/mlly/-/mlly-1.8.2.tgz", + "integrity": "sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.16.0", + "pathe": "^2.0.3", + "pkg-types": "^1.3.1", + "ufo": "^1.6.3" + } + }, + "node_modules/mlly/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -3164,6 +4894,18 @@ "node": ">= 0.6" } }, + "node_modules/mz": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", + "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0", + "object-assign": "^4.0.1", + "thenify-all": "^1.0.0" + } + }, "node_modules/nanoid": { "version": "3.3.15", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.15.tgz", @@ -3183,6 +4925,13 @@ "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, + "license": "MIT" + }, "node_modules/negotiator": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", @@ -3193,6 +4942,22 @@ "node": ">= 0.6" } }, + "node_modules/nopt": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz", + "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==", + "dev": true, + "license": "ISC", + "dependencies": { + "abbrev": "^2.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" + } + }, "node_modules/object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", @@ -3259,6 +5024,84 @@ "wrappy": "1" } }, + "node_modules/open": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/open/-/open-11.0.0.tgz", + "integrity": "sha512-smsWv2LzFjP03xmvFoJ331ss6h+jixfA4UUV/Bsiyuu4YJPfN+FIQGOIiv4w9/+MoHkfkJ22UIaQWRVFRfH6Vw==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-browser": "^5.4.0", + "define-lazy-prop": "^3.0.0", + "is-in-ssh": "^1.0.0", + "is-inside-container": "^1.0.0", + "powershell-utils": "^0.1.0", + "wsl-utils": "^0.3.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "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, + "license": "MIT", + "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": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-json-from-dist": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + "dev": true, + "license": "BlueOak-1.0.0" + }, "node_modules/pako": { "version": "1.0.11", "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", @@ -3266,6 +5109,19 @@ "dev": true, "license": "(MIT AND Zlib)" }, + "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, + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -3276,6 +5132,43 @@ "node": ">= 0.8" } }, + "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, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + "dev": true, + "license": "BlueOak-1.0.0", + "dependencies": { + "lru-cache": "^10.2.0", + "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + }, + "engines": { + "node": ">=16 || 14 >=14.18" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/path-to-regexp": { "version": "8.4.2", "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.4.2.tgz", @@ -3311,6 +5204,19 @@ "dev": true, "license": "ISC" }, + "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, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, "node_modules/pino": { "version": "10.3.1", "resolved": "https://registry.npmjs.org/pino/-/pino-10.3.1.tgz", @@ -3351,6 +5257,35 @@ "dev": true, "license": "MIT" }, + "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, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-types": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/pkg-types/-/pkg-types-1.3.1.tgz", + "integrity": "sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "confbox": "^0.1.8", + "mlly": "^1.7.4", + "pathe": "^2.0.1" + } + }, + "node_modules/pkg-types/node_modules/pathe": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz", + "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==", + "dev": true, + "license": "MIT" + }, "node_modules/postcss": { "version": "8.5.15", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz", @@ -3380,6 +5315,88 @@ "node": "^10 || ^12 || >=14" } }, + "node_modules/postcss-load-config": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/postcss-load-config/-/postcss-load-config-6.0.1.tgz", + "integrity": "sha512-oPtTM4oerL+UXmx+93ytZVN82RrlY/wPUV8IeDxFrzIjXOLF1pN+EmKPLbubvKHT2HC20xXsCAH2Z+CKV6Oz/g==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "lilconfig": "^3.1.1" + }, + "engines": { + "node": ">= 18" + }, + "peerDependencies": { + "jiti": ">=1.21.0", + "postcss": ">=8.0.9", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "jiti": { + "optional": true + }, + "postcss": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/powershell-utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/powershell-utils/-/powershell-utils-0.1.0.tgz", + "integrity": "sha512-dM0jVuXJPsDN6DvRpea484tCUaMiXWjuCn++HGTqUWzGDjv5tZkEZldAJ/UMlqRYGFrD/etByo4/xOuC/snX2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "3.9.4", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.9.4.tgz", + "integrity": "sha512-yWG/o/4oJfo036EKAfK6ACAoDOfHeRHx4tuxkfBZiauURiaSmYwlpOr5LQqKtIkRD2z1PLteme2WoxEnj4tHTg==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-bytes": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", @@ -3420,6 +5437,13 @@ "node": ">=0.4.0" } }, + "node_modules/proto-list": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", + "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==", + "dev": true, + "license": "ISC" + }, "node_modules/proxy-addr": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", @@ -3444,6 +5468,16 @@ "node": ">= 0.10" } }, + "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, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/qs": { "version": "6.15.3", "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.3.tgz", @@ -3513,6 +5547,20 @@ "node": ">= 6" } }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/real-require": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/real-require/-/real-require-0.2.0.tgz", @@ -3546,6 +5594,16 @@ "node": ">=0.10.0" } }, + "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, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/ret": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz", @@ -3643,6 +5701,19 @@ "node": ">= 18" } }, + "node_modules/run-applescript": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", + "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/rxjs": { "version": "7.8.2", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", @@ -3805,6 +5876,29 @@ "dev": true, "license": "ISC" }, + "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, + "license": "MIT", + "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, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/side-channel": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.1.tgz", @@ -3888,6 +5982,19 @@ "dev": true, "license": "ISC" }, + "node_modules/signal-exit": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/sonic-boom": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.1.tgz", @@ -3898,6 +6005,16 @@ "atomic-sleep": "^1.0.0" } }, + "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, + "license": "BSD-3-Clause", + "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", @@ -3908,6 +6025,17 @@ "node": ">=0.10.0" } }, + "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, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -3976,6 +6104,22 @@ "node": ">=8" } }, + "node_modules/string-width-cjs": { + "name": "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==", + "dev": true, + "license": "MIT", + "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", @@ -3989,6 +6133,33 @@ "node": ">=8" } }, + "node_modules/strip-ansi-cjs": { + "name": "strip-ansi", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "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, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/strtok3": { "version": "10.3.5", "resolved": "https://registry.npmjs.org/strtok3/-/strtok3-10.3.5.tgz", @@ -4006,6 +6177,39 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/sucrase": { + "version": "3.35.1", + "resolved": "https://registry.npmjs.org/sucrase/-/sucrase-3.35.1.tgz", + "integrity": "sha512-DhuTmvZWux4H1UOnWMB3sk0sbaCVOoQZjv8u1rDoTV0HTdGem9hkAZtl4JZy8P2z4Bg0nT+YMeOFyVr4zcG5Tw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.2", + "commander": "^4.0.0", + "lines-and-columns": "^1.1.6", + "mz": "^2.7.0", + "pirates": "^4.0.1", + "tinyglobby": "^0.2.11", + "ts-interface-checker": "^0.1.9" + }, + "bin": { + "sucrase": "bin/sucrase", + "sucrase-node": "bin/sucrase-node" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/sucrase/node_modules/commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -4019,6 +6223,29 @@ "node": ">=8" } }, + "node_modules/thenify": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", + "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "dev": true, + "license": "MIT", + "dependencies": { + "any-promise": "^1.0.0" + } + }, + "node_modules/thenify-all": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", + "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "thenify": ">= 3.1.0 < 4" + }, + "engines": { + "node": ">=0.8" + } + }, "node_modules/thread-stream": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-4.2.0.tgz", @@ -4063,6 +6290,23 @@ "dev": true, "license": "MIT" }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, "node_modules/tinypool": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz", @@ -4132,6 +6376,36 @@ "url": "https://github.com/sponsors/Borewit" } }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/ts-api-utils": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.5.0.tgz", + "integrity": "sha512-OJ/ibxhPlqrMM0UiNHJ/0CKQkoKF243/AEmplt3qpRgkW8VG7IfOS41h7V8TjITqdByHzrjcS/2si+y4lIh8NA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.12" + }, + "peerDependencies": { + "typescript": ">=4.8.4" + } + }, + "node_modules/ts-interface-checker": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz", + "integrity": "sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==", + "dev": true, + "license": "Apache-2.0" + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -4139,6 +6413,563 @@ "dev": true, "license": "0BSD" }, + "node_modules/tsup": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/tsup/-/tsup-8.5.1.tgz", + "integrity": "sha512-xtgkqwdhpKWr3tKPmCkvYmS9xnQK3m3XgxZHwSUjvfTjp7YfXe5tT3GgWi0F2N+ZSMsOeWeZFh7ZZFg5iPhing==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-require": "^5.1.0", + "cac": "^6.7.14", + "chokidar": "^4.0.3", + "consola": "^3.4.0", + "debug": "^4.4.0", + "esbuild": "^0.27.0", + "fix-dts-default-cjs-exports": "^1.0.0", + "joycon": "^3.1.1", + "picocolors": "^1.1.1", + "postcss-load-config": "^6.0.1", + "resolve-from": "^5.0.0", + "rollup": "^4.34.8", + "source-map": "^0.7.6", + "sucrase": "^3.35.0", + "tinyexec": "^0.3.2", + "tinyglobby": "^0.2.11", + "tree-kill": "^1.2.2" + }, + "bin": { + "tsup": "dist/cli-default.js", + "tsup-node": "dist/cli-node.js" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@microsoft/api-extractor": "^7.36.0", + "@swc/core": "^1", + "postcss": "^8.4.12", + "typescript": ">=4.5.0" + }, + "peerDependenciesMeta": { + "@microsoft/api-extractor": { + "optional": true + }, + "@swc/core": { + "optional": true + }, + "postcss": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/tsup/node_modules/@esbuild/aix-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.27.7.tgz", + "integrity": "sha512-EKX3Qwmhz1eMdEJokhALr0YiD0lhQNwDqkPYyPhiSwKrh7/4KRjQc04sZ8db+5DVVnZ1LmbNDI1uAMPEUBnQPg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/android-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.27.7.tgz", + "integrity": "sha512-jbPXvB4Yj2yBV7HUfE2KHe4GJX51QplCN1pGbYjvsyCZbQmies29EoJbkEc+vYuU5o45AfQn37vZlyXy4YJ8RQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/android-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.27.7.tgz", + "integrity": "sha512-62dPZHpIXzvChfvfLJow3q5dDtiNMkwiRzPylSCfriLvZeq0a1bWChrGx/BbUbPwOrsWKMn8idSllklzBy+dgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/android-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.27.7.tgz", + "integrity": "sha512-x5VpMODneVDb70PYV2VQOmIUUiBtY3D3mPBG8NxVk5CogneYhkR7MmM3yR/uMdITLrC1ml/NV1rj4bMJuy9MCg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/darwin-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.27.7.tgz", + "integrity": "sha512-5lckdqeuBPlKUwvoCXIgI2D9/ABmPq3Rdp7IfL70393YgaASt7tbju3Ac+ePVi3KDH6N2RqePfHnXkaDtY9fkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/darwin-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.27.7.tgz", + "integrity": "sha512-rYnXrKcXuT7Z+WL5K980jVFdvVKhCHhUwid+dDYQpH+qu+TefcomiMAJpIiC2EM3Rjtq0sO3StMV/+3w3MyyqQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/freebsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.27.7.tgz", + "integrity": "sha512-B48PqeCsEgOtzME2GbNM2roU29AMTuOIN91dsMO30t+Ydis3z/3Ngoj5hhnsOSSwNzS+6JppqWsuhTp6E82l2w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/freebsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.27.7.tgz", + "integrity": "sha512-jOBDK5XEjA4m5IJK3bpAQF9/Lelu/Z9ZcdhTRLf4cajlB+8VEhFFRjWgfy3M1O4rO2GQ/b2dLwCUGpiF/eATNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-arm": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.27.7.tgz", + "integrity": "sha512-RkT/YXYBTSULo3+af8Ib0ykH8u2MBh57o7q/DAs3lTJlyVQkgQvlrPTnjIzzRPQyavxtPtfg0EopvDyIt0j1rA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.27.7.tgz", + "integrity": "sha512-RZPHBoxXuNnPQO9rvjh5jdkRmVizktkT7TCDkDmQ0W2SwHInKCAV95GRuvdSvA7w4VMwfCjUiPwDi0ZO6Nfe9A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.27.7.tgz", + "integrity": "sha512-GA48aKNkyQDbd3KtkplYWT102C5sn/EZTY4XROkxONgruHPU72l+gW+FfF8tf2cFjeHaRbWpOYa/uRBz/Xq1Pg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-loong64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.27.7.tgz", + "integrity": "sha512-a4POruNM2oWsD4WKvBSEKGIiWQF8fZOAsycHOt6JBpZ+JN2n2JH9WAv56SOyu9X5IqAjqSIPTaJkqN8F7XOQ5Q==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-mips64el": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.27.7.tgz", + "integrity": "sha512-KabT5I6StirGfIz0FMgl1I+R1H73Gp0ofL9A3nG3i/cYFJzKHhouBV5VWK1CSgKvVaG4q1RNpCTR2LuTVB3fIw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-ppc64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.27.7.tgz", + "integrity": "sha512-gRsL4x6wsGHGRqhtI+ifpN/vpOFTQtnbsupUF5R5YTAg+y/lKelYR1hXbnBdzDjGbMYjVJLJTd2OFmMewAgwlQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-riscv64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.27.7.tgz", + "integrity": "sha512-hL25LbxO1QOngGzu2U5xeXtxXcW+/GvMN3ejANqXkxZ/opySAZMrc+9LY/WyjAan41unrR3YrmtTsUpwT66InQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-s390x": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.27.7.tgz", + "integrity": "sha512-2k8go8Ycu1Kb46vEelhu1vqEP+UeRVj2zY1pSuPdgvbd5ykAw82Lrro28vXUrRmzEsUV0NzCf54yARIK8r0fdw==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/linux-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.27.7.tgz", + "integrity": "sha512-hzznmADPt+OmsYzw1EE33ccA+HPdIqiCRq7cQeL1Jlq2gb1+OyWBkMCrYGBJ+sxVzve2ZJEVeePbLM2iEIZSxA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/netbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.27.7.tgz", + "integrity": "sha512-b6pqtrQdigZBwZxAn1UpazEisvwaIDvdbMbmrly7cDTMFnw/+3lVxxCTGOrkPVnsYIosJJXAsILG9XcQS+Yu6w==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/netbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.27.7.tgz", + "integrity": "sha512-OfatkLojr6U+WN5EDYuoQhtM+1xco+/6FSzJJnuWiUw5eVcicbyK3dq5EeV/QHT1uy6GoDhGbFpprUiHUYggrw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/openbsd-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.27.7.tgz", + "integrity": "sha512-AFuojMQTxAz75Fo8idVcqoQWEHIXFRbOc1TrVcFSgCZtQfSdc1RXgB3tjOn/krRHENUB4j00bfGjyl2mJrU37A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/openbsd-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.27.7.tgz", + "integrity": "sha512-+A1NJmfM8WNDv5CLVQYJ5PshuRm/4cI6WMZRg1by1GwPIQPCTs1GLEUHwiiQGT5zDdyLiRM/l1G0Pv54gvtKIg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/openharmony-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.27.7.tgz", + "integrity": "sha512-+KrvYb/C8zA9CU/g0sR6w2RBw7IGc5J2BPnc3dYc5VJxHCSF1yNMxTV5LQ7GuKteQXZtspjFbiuW5/dOj7H4Yw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/sunos-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.27.7.tgz", + "integrity": "sha512-ikktIhFBzQNt/QDyOL580ti9+5mL/YZeUPKU2ivGtGjdTYoqz6jObj6nOMfhASpS4GU4Q/Clh1QtxWAvcYKamA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-arm64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.27.7.tgz", + "integrity": "sha512-7yRhbHvPqSpRUV7Q20VuDwbjW5kIMwTHpptuUzV+AA46kiPze5Z7qgt6CLCK3pWFrHeNfDd1VKgyP4O+ng17CA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-ia32": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.27.7.tgz", + "integrity": "sha512-SmwKXe6VHIyZYbBLJrhOoCJRB/Z1tckzmgTLfFYOfpMAx63BJEaL9ExI8x7v0oAO3Zh6D/Oi1gVxEYr5oUCFhw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/@esbuild/win32-x64": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.27.7.tgz", + "integrity": "sha512-56hiAJPhwQ1R4i+21FVF7V8kSD5zZTdHcVuRFMW0hn753vVfQN8xlx4uOPT4xoGH0Z/oVATuR82AiqSTDIpaHg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsup/node_modules/esbuild": { + "version": "0.27.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.27.7.tgz", + "integrity": "sha512-IxpibTjyVnmrIQo5aqNpCgoACA/dTKLTlhMHihVHhdkxKyPO1uBBthumT0rdHmcsk9uMonIWS0m4FljWzILh3w==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.27.7", + "@esbuild/android-arm": "0.27.7", + "@esbuild/android-arm64": "0.27.7", + "@esbuild/android-x64": "0.27.7", + "@esbuild/darwin-arm64": "0.27.7", + "@esbuild/darwin-x64": "0.27.7", + "@esbuild/freebsd-arm64": "0.27.7", + "@esbuild/freebsd-x64": "0.27.7", + "@esbuild/linux-arm": "0.27.7", + "@esbuild/linux-arm64": "0.27.7", + "@esbuild/linux-ia32": "0.27.7", + "@esbuild/linux-loong64": "0.27.7", + "@esbuild/linux-mips64el": "0.27.7", + "@esbuild/linux-ppc64": "0.27.7", + "@esbuild/linux-riscv64": "0.27.7", + "@esbuild/linux-s390x": "0.27.7", + "@esbuild/linux-x64": "0.27.7", + "@esbuild/netbsd-arm64": "0.27.7", + "@esbuild/netbsd-x64": "0.27.7", + "@esbuild/openbsd-arm64": "0.27.7", + "@esbuild/openbsd-x64": "0.27.7", + "@esbuild/openharmony-arm64": "0.27.7", + "@esbuild/sunos-x64": "0.27.7", + "@esbuild/win32-arm64": "0.27.7", + "@esbuild/win32-ia32": "0.27.7", + "@esbuild/win32-x64": "0.27.7" + } + }, + "node_modules/tsup/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, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/tsup/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, + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, "node_modules/tsx": { "version": "4.23.0", "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.0.tgz", @@ -4591,6 +7422,19 @@ "@esbuild/win32-x64": "0.28.1" } }, + "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, + "license": "MIT", + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/type-is": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz", @@ -4645,6 +7489,37 @@ "node": ">=14.17" } }, + "node_modules/typescript-eslint": { + "version": "8.63.0", + "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.63.0.tgz", + "integrity": "sha512-xgwXyzG4sK9ALkBxbyGkTMMOS+imnW65iPhxCQMK83KhxyoDNW7l+IDqEf9vMdoUidHpOoS967RCq4eMiTexwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@typescript-eslint/eslint-plugin": "8.63.0", + "@typescript-eslint/parser": "8.63.0", + "@typescript-eslint/typescript-estree": "8.63.0", + "@typescript-eslint/utils": "8.63.0" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0", + "typescript": ">=4.8.4 <6.1.0" + } + }, + "node_modules/ufo": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", + "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", + "dev": true, + "license": "MIT" + }, "node_modules/uid": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", @@ -4688,6 +7563,16 @@ "node": ">= 0.8" } }, + "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, + "license": "BSD-2-Clause", + "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", @@ -4872,6 +7757,22 @@ } } }, + "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, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, "node_modules/why-is-node-running": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-2.3.0.tgz", @@ -4889,6 +7790,120 @@ "node": ">=8" } }, + "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, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^6.1.0", + "string-width": "^5.0.1", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi-cjs": { + "name": "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==", + "dev": true, + "license": "MIT", + "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/wrap-ansi/node_modules/ansi-regex": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.2.2.tgz", + "integrity": "sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.3.tgz", + "integrity": "sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/emoji-regex": { + "version": "9.2.2", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + "dev": true, + "license": "MIT", + "dependencies": { + "eastasianwidth": "^0.2.0", + "emoji-regex": "^9.2.2", + "strip-ansi": "^7.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -4917,6 +7932,36 @@ "optional": true } } + }, + "node_modules/wsl-utils": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.3.1.tgz", + "integrity": "sha512-g/eziiSUNBSsdDJtCLB8bdYEUMj4jR7AGeUo96p/3dTafgjHhpF4RiCFPiRILwjQoDXx5MqkBr4fwWtR3Ky4Wg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-wsl": "^3.1.0", + "powershell-utils": "^0.1.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } } } } diff --git a/package.json b/package.json index faa53aa..21565dc 100644 --- a/package.json +++ b/package.json @@ -1,46 +1,89 @@ { "name": "@green-tea/core", - "version": "0.0.0", + "version": "26.07.0-beta.0", "description": "Declarative, type-safe HTTP framework. The pipeline is a graph, not a middleware chain.", "license": "MIT", "type": "commonjs", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "./dist/index.js", + "module": "./dist/index.mjs", + "types": "./dist/index.d.ts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + } + } + }, + "files": [ + "dist", + "README.md", + "CHANGELOG.md", + "LICENSE" + ], "scripts": { - "build": "tsc -p tsconfig.json", + "build": "tsup", "test": "vitest run", "test:dev": "vitest", "typecheck": "tsc --noEmit -p tsconfig.json", "typecheck:bench": "tsc --noEmit -p bench/tsconfig.json", - "bench": "tsx bench/run.ts" + "lint": "eslint src", + "lint:fix": "eslint src --fix", + "format": "prettier --write \"src/**/*.ts\"", + "format:check": "prettier --check \"src/**/*.ts\"", + "docs:dev": "npm --prefix website run dev", + "docs:build": "npm --prefix website run build", + "complexity": "ccts src", + "complexity:check": "node scripts/check-complexity.mjs", + "complexity:cyclomatic": "cyclomatic-complexity \"src/**/*.ts\" -tw 15 -te 25", + "bench": "tsx bench/run.ts", + "prepublishOnly": "npm run lint && npm run complexity:check && npm run typecheck && npm test && npm run build", + "prepare": "git config core.hooksPath .githooks || true" }, "dependencies": { "reflect-metadata": "0.2.2" }, "peerDependencies": { + "busboy": "^1.6.0", "ws": "^8.18.0" }, "peerDependenciesMeta": { + "busboy": { + "optional": true + }, "ws": { "optional": true } }, "devDependencies": { + "@eslint/js": "^9.39.4", "@nestjs/common": "^11.1.27", "@nestjs/core": "^11.1.27", "@nestjs/platform-express": "^11.1.27", "@nestjs/platform-fastify": "^11.1.27", + "@stylistic/eslint-plugin": "^5.10.0", "@types/autocannon": "^7.12.7", + "@types/busboy": "^1.5.4", "@types/express": "^5.0.6", "@types/node": "^18.19.0", "@types/ws": "^8.18.1", "autocannon": "^8.0.0", + "busboy": "^1.6.0", + "cognitive-complexity-ts": "^0.8.2", + "eslint": "^9.39.4", "express": "^5.2.1", "fastify": "^5.10.0", "graphql": "^16.9.0", + "prettier": "^3.9.4", "rxjs": "^7.8.2", + "tsup": "^8.5.1", "tsx": "^4.23.0", "typescript": "^5.5.0", + "typescript-eslint": "^8.63.0", "vitest": "^2.0.0", "ws": "^8.21.0" } diff --git a/scripts/check-complexity.mjs b/scripts/check-complexity.mjs new file mode 100755 index 0000000..e66958b --- /dev/null +++ b/scripts/check-complexity.mjs @@ -0,0 +1,42 @@ +#!/usr/bin/env node +// Cognitive-complexity gate. Fails (exit 1) if any named function in src/ exceeds +// the threshold, per cognitive-complexity-ts. Cyclomatic complexity is intentionally +// NOT gated here — its `??`-chain false positives make it advisory only (npm run complexity:cyclomatic). +import { execSync } from 'node:child_process'; + +const THRESHOLD = Number(process.env.COMPLEXITY_MAX ?? 25); + +let raw = ''; +try { + raw = execSync('npx ccts-json src', { encoding: 'utf8', stdio: ['ignore', 'pipe', 'ignore'] }); +} catch (error) { + raw = error.stdout?.toString() ?? ''; +} + +if (!raw.trim()) { + console.error('check-complexity: no output from ccts-json'); + process.exit(2); +} + +const offenders = []; +function walk(node) { + if (!node || typeof node !== 'object') return; + if (node.kind === 'function' && node.name && node.score > THRESHOLD) { + offenders.push({ score: node.score, name: node.name }); + } + for (const [key, value] of Object.entries(node)) { + if (key === 'inner' && Array.isArray(value)) value.forEach(walk); + else if (value && typeof value === 'object') walk(value); + } +} +walk(JSON.parse(raw)); + +if (offenders.length) { + offenders.sort((a, b) => b.score - a.score); + console.error(`\n✖ cognitive complexity: ${offenders.length} function(s) over ${THRESHOLD}\n`); + for (const o of offenders) console.error(` ${String(o.score).padStart(4)} ${o.name}`); + console.error('\nExtract helpers to bring them under the threshold (or raise COMPLEXITY_MAX).\n'); + process.exit(1); +} + +console.log(`✓ cognitive complexity: every function ≤ ${THRESHOLD}`); diff --git a/src/app.ts b/src/app.ts deleted file mode 100644 index 74ead24..0000000 --- a/src/app.ts +++ /dev/null @@ -1,387 +0,0 @@ -import http from 'http'; -import { Bus } from './bus'; -import { Container } from './container'; -import { topoSort, subgraphFor, GraphNode, nearest } from './graph'; -import { toMermaid, toDOT, graphHtml, type GraphView } from './graph-viz'; -import { runPipeline, PipelineStep } from './pipeline'; -import { createHttpServer, parseQuery, RouteDef, WsRouteDef, RequestLimits } from './http'; -import { isAsyncIterable } from './channel'; -import { JsonTransformer } from './transformers'; -import { mountPlugin, Plugin, ScopeApi, ScopeNode } from './plugin'; -import { - Ctor, HttpMethod, Transport, getModuleMeta, getProviderMeta, getStepMeta, getRoutes, getTransformer, joinPath, -} from './metadata'; -import { getArgs, getHandlerNeeds, resolveArgs } from './params'; -import { connectLink, type Link } from './mesh/link'; -import { Rooms } from './rooms'; -import type { TlsOptions, SecurityOptions, CorsOptions } from './security'; -import { buildRemote } from './mesh/teacup'; -import { buildManifest, createMeshControl } from './mesh/teapot'; -import type { MeshControl } from './http'; -import type { RequestEnvelope, RouteEntry } from './mesh/protocol'; - -export interface InspectLine { name: string; kind: 'provider' | 'step' | 'handler'; origin: string } -export interface ExplainNode { name: string; kind: 'provider' | 'step' | 'handler'; origin: string; needs: string[]; provides: string[] } -export interface Explain { pattern: string; method: HttpMethod; transport: Transport; chain: ExplainNode[] } -export interface App { - listen(port: number): Promise; - close(): Promise; - inspect(routePath: string): InspectLine[]; - graph(): GraphView; - toMermaid(): string; - toDOT(): string; - explain(routePath: string): Explain; - bus: Bus; -} - -interface RoutePlan { - pattern: string; - method: HttpMethod; - transport: Transport; - origin: string; - providers: GraphNode[]; - steps: GraphNode[]; - handlerName: string; - needs: string[]; - run: (ctx: any) => Promise; - transformer: typeof JsonTransformer; - duplicates?: 'array' | 'last'; -} - -export interface MeshConfig { - secret?: string; - teapots?: Array<{ url: string; secret: string }>; - timeoutMs?: number; -} - -export function createApp(opts: { modules: Ctor[]; plugins?: Plugin[]; mesh?: MeshConfig; limits?: RequestLimits; devGraph?: boolean; overrides?: Record; tls?: TlsOptions; trustProxy?: boolean; security?: boolean | SecurityOptions; cors?: CorsOptions; bodyDuplicates?: 'array' | 'last' }): App { - const bus = new Bus(); - const container = new Container(); - let server: http.Server | undefined; - const streams = new Set<() => void>(); - const extraSteps: ScopeNode[] = []; - const scope: ScopeApi = { add: (n) => extraSteps.push(n) }; - - // collect declarations from modules - const providerNodes: GraphNode[] = []; - const stepNodes: GraphNode[] = []; - const runners = new Map any>(); // node name -> runtime fn - const setRunner = (name: string, fn: (ctx: any) => any) => { - if (runners.has(name)) throw new Error(`duplicate provider/step name '${name}' — names must be unique across modules and plugins`); - runners.set(name, fn); - }; - const providerMeta = new Map(); - const routePlans: RoutePlan[] = []; - const exportedProviders: string[] = []; - const exportedSteps: string[] = []; - const exportedRoutes: RouteEntry[] = []; - - for (const mod of opts.modules) { - const m = getModuleMeta(mod); - if (!m) throw new Error(`${mod.name} is not a @Module`); - const origin = `module:${mod.name}`; - - for (const P of m.providers ?? []) { - const meta = getProviderMeta(P)!; - providerNodes.push({ name: meta.provides, needs: meta.needs, provides: [meta.provides], origin }); - providerMeta.set(meta.provides, { optional: meta.optional }); - if (meta.export) exportedProviders.push(meta.provides); - const inst: any = new P(); - setRunner(meta.provides, (ctx) => inst.provide(ctx)); - } - for (const S of m.steps ?? []) { - const meta = getStepMeta(S)!; - stepNodes.push({ name: meta.provides, needs: meta.needs, provides: [meta.provides], origin }); - if (meta.export) exportedSteps.push(meta.provides); - const inst: any = new S(); - setRunner(meta.provides, (ctx) => inst.run(ctx)); - } - for (const C of m.controllers ?? []) { - for (const route of getRoutes(C)) { - const inst: any = new C(); - const argSpecs = getArgs(C, route.handlerName); - const pattern = joinPath(m.mountpoint, route.path); - if (route.export) { - if (route.transport !== 'buffer') throw new Error(`cannot export streaming route ${pattern}`); - exportedRoutes.push({ method: route.method, pattern }); - } - routePlans.push({ - pattern, - method: route.method, - transport: route.transport, - origin, - providers: [], - steps: [], - handlerName: route.handlerName, - needs: getHandlerNeeds(argSpecs), - run: async (c: any) => inst[route.handlerName](...(await resolveArgs(argSpecs, c))), - transformer: getTransformer(C, route.handlerName) ?? JsonTransformer, - duplicates: route.duplicates, - }); - } - } - } - - // plugin-added steps join the graph as their own scope - for (const plugin of opts.plugins ?? []) mountPlugin(plugin, bus, scope); - for (const n of extraSteps) { - const node = { name: n.name, needs: n.needs, provides: n.provides, origin: 'plugin' }; - if (n.kind === 'provider') providerNodes.push(node); else stepNodes.push(node); - setRunner(n.name, n.run); - } - - // built-in: auto-provide a shared Rooms instance (unless the user declares one) - if (!runners.has('rooms')) { - const roomsInstance = new Rooms(); - providerNodes.push({ name: 'rooms', needs: [], provides: ['rooms'], origin: 'builtin' }); - providerMeta.set('rooms', { optional: false }); - setRunner('rooms', () => ({ rooms: roomsInstance })); // merge object -> ctx.rooms - } - - // For each route, resolve which providers/steps feed it via topo order. - // MVP: every route depends on every declared step + provider in the app graph. - // For mesh apps, finalize is DEFERRED to listen() so remote scopes can join the graph first. - let orderedProviders: GraphNode[] = []; - let orderedSteps: GraphNode[] = []; - let booted = false; - const finalizeGraph = (): void => { - const ordered = topoSort([...providerNodes, ...stepNodes], ['req', 'params']); - orderedProviders = ordered.filter((n) => providerNodes.includes(n)); - orderedSteps = ordered.filter((n) => stepNodes.includes(n)); - const alwaysSteps = stepNodes.filter((n) => n.provides.length === 0); // side-effect/observer steps (plugins) - const alwaysNeeds = alwaysSteps.flatMap((n) => n.needs); // pull observers' deps into every route - for (const plan of routePlans) { - const closure = subgraphFor([...plan.needs, ...alwaysNeeds], ordered); - plan.providers = closure.filter((n) => providerNodes.includes(n)); - const sliced = new Set([...closure.filter((n) => stepNodes.includes(n)), ...alwaysSteps]); - plan.steps = ordered.filter((n) => stepNodes.includes(n) && sliced.has(n)); // topo order, deduped - } - - const producedKeys = new Set([ - ...providerNodes.flatMap((n) => n.provides), - ...stepNodes.flatMap((n) => n.provides), - ]); - const allowed = new Set([...producedKeys, 'req', 'params', 'query', 'body', 'headers', 'inbound', 'abort']); - for (const plan of routePlans) { - for (const need of plan.needs) { - if (!allowed.has(need)) { - const hint = nearest(need, allowed); - throw new Error(`handler '${plan.handlerName}' needs '${need}' but nothing (local or mesh) provides it${hint ? ` — did you mean '${hint}'?` : ''}`); - } - } - } - booted = true; - }; - if (!opts.mesh) finalizeGraph(); - - const inspect = (routePath: string): InspectLine[] => { - if (!booted) throw new Error('inspect() unavailable before listen() for mesh apps'); - const plan = routePlans.find((p) => p.pattern === routePath); - if (!plan) throw new Error(`no route: ${routePath}`); - return [ - ...plan.providers.map((p) => ({ name: p.name, kind: 'provider' as const, origin: p.origin })), - ...plan.steps.map((s) => ({ name: s.name, kind: 'step' as const, origin: s.origin })), - { name: plan.handlerName, kind: 'handler' as const, origin: plan.origin }, - ]; - }; - - const graph = (): GraphView => { - if (!booted) throw new Error('graph() unavailable before listen() for mesh apps'); - return { - nodes: [ - ...providerNodes.map((n) => ({ name: n.name, kind: 'provider' as const, origin: n.origin, needs: n.needs, provides: n.provides })), - ...stepNodes.map((n) => ({ name: n.name, kind: 'step' as const, origin: n.origin, needs: n.needs, provides: n.provides })), - ], - routes: routePlans.map((p) => ({ - pattern: p.pattern, method: p.method, transport: p.transport, - chain: [...p.providers.map((n) => n.name), ...p.steps.map((n) => n.name), p.handlerName], - })), - }; - }; - - const explain = (routePath: string): Explain => { - if (!booted) throw new Error('explain() unavailable before listen() for mesh apps'); - const plan = routePlans.find((p) => p.pattern === routePath); - if (!plan) throw new Error(`no route: ${routePath}`); - const nv = (n: GraphNode, kind: 'provider' | 'step'): ExplainNode => ({ name: n.name, kind, origin: n.origin, needs: n.needs, provides: n.provides }); - return { - pattern: plan.pattern, method: plan.method, transport: plan.transport, - chain: [ - ...plan.providers.map((n) => nv(n, 'provider')), - ...plan.steps.map((n) => nv(n, 'step')), - { name: plan.handlerName, kind: 'handler', origin: plan.origin, needs: plan.needs, provides: [] }, - ], - }; - }; - - const providedSeed = async (plan: RoutePlan): Promise> => { - const provided: Record = {}; - for (const p of plan.providers) { - if (container.has(p.name)) Object.assign(provided, (await container.resolve(p.name)) as Record); - } - return provided; - }; - const planSteps = (plan: RoutePlan): PipelineStep[] => plan.steps.map((s) => { - const fn = runners.get(s.name); - if (!fn) throw new Error(`no runner registered for step '${s.name}'`); - return { name: s.name, origin: s.origin, run: fn }; - }); - - const listen = async (port: number): Promise => { - // mesh teacup: connect remote teapots, splice their scopes/routes into the graph, then finalize - const remoteRoutes: RouteDef[] = []; - const meshLinks: Link[] = []; - let meshControl: MeshControl | undefined; - if (opts.mesh && !booted) { - try { - for (const t of opts.mesh.teapots ?? []) { - const link = await connectLink({ url: t.url, secret: t.secret, timeoutMs: opts.mesh.timeoutMs, bus }); - meshLinks.push(link); - const { providers, steps, routes } = buildRemote(link, t.url); - for (const p of providers) { - providerNodes.push({ name: p.name, needs: [], provides: [p.name], origin: `mesh:${t.url}` }); - providerMeta.set(p.name, { optional: false }); - setRunner(p.name, p.run); - } - for (const s of steps) { - stepNodes.push({ name: s.name, needs: [], provides: [s.name], origin: `mesh:${t.url}` }); - setRunner(s.name, s.run); - } - for (const r of routes) { - remoteRoutes.push({ - method: r.method, pattern: r.pattern, transport: 'buffer', - handler: async (req) => r.handler(req as RequestEnvelope), - }); - } - } - finalizeGraph(); - } catch (err) { - for (const l of meshLinks) { try { l.close(); } catch { /* */ } } - throw err; - } - } - - // apply overrides: swap any provider/step runner by token in one line - if (opts.overrides) { - const produced = new Set([...providerNodes, ...stepNodes].flatMap((n) => n.provides)); - for (const [token, val] of Object.entries(opts.overrides)) { - if (!produced.has(token)) throw new Error(`override for unknown token '${token}'`); - const fn = typeof val === 'function' ? (val as (ctx: any) => any) : () => ({ [token]: val }); - runners.set(token, fn); // direct set (setRunner throws on dup); replaces the real runner - } - } - - // run app-scoped providers in order (fail-fast for required) - for (const node of orderedProviders) { - bus.emit('boot:provider:start', { name: node.name, scope: node.origin }); - try { - const value = await runners.get(node.name)!(await snapshot(container, node.needs)); - container.register(node.name, 'app', () => value); - await container.resolve(node.name); // warm the cache - bus.emit('boot:provider:ok', { name: node.name }); - } catch (error) { - bus.emit('boot:provider:fail', { name: node.name, error }); - if (!providerMeta.get(node.name)?.optional) { - throw new Error(`provider '${node.name}' failed: ${(error as Error).message}`); - } - // optional: warn, leave it unregistered; routes needing it fail at request time - // ponytail: full partial-degradation is out of scope (spec §10); warn is enough here - console.warn(`[green-tea] optional provider '${node.name}' failed: ${(error as Error).message}`); - } - } - - // mesh teapot: expose declared exports over the control channel (lazy resolvers read live state) - const hasExports = exportedProviders.length || exportedSteps.length || exportedRoutes.length; - if (hasExports && !opts.mesh?.secret) { - throw new Error('mesh: exports declared (export: true) but no mesh.secret configured to gate the control channel'); - } - if (opts.mesh?.secret && hasExports) { - const manifest = buildManifest({ providers: exportedProviders, steps: exportedSteps, routes: exportedRoutes }); - const resolveScope = async (name: string, env: RequestEnvelope): Promise => { - let ctx: any = { req: env, params: env.params, query: env.query, body: env.body, headers: env.headers }; - for (const p of orderedProviders) if (container.has(p.name)) Object.assign(ctx, await container.resolve(p.name)); - for (const s of orderedSteps) { const fn = runners.get(s.name)!; ctx = { ...ctx, ...(await fn(ctx)) }; } - return ctx[name]; - }; - const resolveRoute = async (name: string, env: RequestEnvelope) => { - const plan = routePlans.find((p) => p.pattern === name && p.method === env.method); - if (!plan) { const e: any = new Error(`no route ${name}`); e.status = 404; throw e; } - const provided = await providedSeed(plan); - const result = await runPipeline({ - steps: planSteps(plan), handler: plan.run, transformer: plan.transformer, bus, - seed: { ...provided, req: env, params: env.params, query: env.query, body: env.body, headers: env.headers }, - }); - if ('stream' in result) { const e: any = new Error('cannot proxy a streaming route'); e.status = 500; throw e; } - return result; - }; - meshControl = createMeshControl({ secret: opts.mesh.secret, manifest, resolveScope, resolveRoute, bus }); - } - - const httpRoutes: RouteDef[] = [ - ...routePlans - .filter((plan) => plan.transport !== 'ws') // buffer | sse | ndjson | negotiate - .map((plan): RouteDef => ({ - method: plan.method, pattern: plan.pattern, transport: plan.transport, bodyDuplicates: plan.duplicates, - handler: async (req) => { - const provided = await providedSeed(plan); - return runPipeline({ - steps: planSteps(plan), handler: plan.run, transformer: plan.transformer, bus, - seed: { ...provided, req, params: req.params, query: req.query, body: req.body, headers: req.headers, - protocol: req.protocol, ip: req.ip }, - }); - }, - })), - ...remoteRoutes, - ]; - - if (opts.devGraph) { - httpRoutes.push({ - method: 'GET', pattern: '/__graph__', transport: 'buffer', - handler: async (req) => { - const mermaid = toMermaid(graph()); - const accept = String(req.headers['accept'] ?? ''); - return accept.includes('text/plain') - ? { status: 200, headers: { 'content-type': 'text/plain' }, body: mermaid } - : { status: 200, headers: { 'content-type': 'text/html' }, body: graphHtml(mermaid) }; - }, - }); - } - - const wsRoutes: WsRouteDef[] = routePlans - .filter((plan) => plan.transport === 'ws' || plan.transport === 'negotiate') - .map((plan) => ({ - pattern: plan.pattern, - open: async ({ params, inbound, abort, req }) => { - const provided = await providedSeed(plan); - // ws upgrades come in on the raw Node req; trustProxy derivation for ws is out of scope here - let ctx: any = { ...provided, req, params, query: parseQuery(req.url ?? ''), body: undefined, - headers: req.headers, inbound, abort, - protocol: (req.socket as any).encrypted ? 'https' : 'http', ip: req.socket.remoteAddress ?? '' }; - for (const s of planSteps(plan)) { ctx = { ...ctx, ...(await s.run(ctx)) }; } - const out = await plan.run(ctx); - if (!isAsyncIterable(out)) throw new Error(`@Ws handler '${plan.handlerName}' must return an AsyncIterable`); - return out as AsyncIterable; - }, - })); - - server = createHttpServer(httpRoutes, wsRoutes, bus, meshControl, { limits: opts.limits, streams, tls: opts.tls, trustProxy: opts.trustProxy, security: opts.security ?? true, cors: opts.cors, bodyDuplicates: opts.bodyDuplicates }); - server.on('close', () => { for (const l of meshLinks) { try { l.close(); } catch { /* */ } } }); - await new Promise((resolve) => server!.listen(port, resolve)); - return server; - }; - - const close = (): Promise => new Promise((resolve) => { - if (!server) return resolve(); - server.close(() => resolve()); // waits for in-flight buffered to drain - for (const closeStream of streams) closeStream(); // force-close long-lived SSE/WS so close() resolves - server.closeIdleConnections(); // Node >=18.2: drop idle keep-alive - }); - - return { listen, close, inspect, graph, toMermaid: () => toMermaid(graph()), toDOT: () => toDOT(graph()), explain, bus }; -} - -async function snapshot(c: Container, needs: string[]): Promise> { - const out: Record = {}; - for (const key of needs) if (c.has(key)) Object.assign(out, (await c.resolve(key)) as Record); - return out; -} diff --git a/src/app/index.ts b/src/app/index.ts new file mode 100644 index 0000000..4073e14 --- /dev/null +++ b/src/app/index.ts @@ -0,0 +1,625 @@ +import http from 'http'; +import { Bus } from '../bus'; +import { Container } from '../container'; +import { topoSort, subgraphFor, GraphNode, nearest } from '../graph'; +import { toMermaid, toDOT, graphHtml, type GraphView } from '../graph-viz'; +import { runPipeline, PipelineStep } from '../pipeline'; +import { createHttpServer, parseQuery, RouteDef, WsRouteDef, RequestLimits } from '../http'; +import { isAsyncIterable } from '../channel'; +import { JsonTransformer } from '../transformers'; +import { mountPlugin, Plugin, ScopeApi, ScopeNode } from '../plugin'; +import { Ctor, getModuleMeta, getProviderMeta, getStepMeta, getRoutes, getTransformer, joinPath } from '../metadata'; +import { getArgs, getHandlerNeeds, resolveArgs } from '../params'; +import { connectLink, type Link } from '../mesh/link'; +import { Rooms } from '../rooms'; +import type { TlsOptions, SecurityOptions, CorsOptions } from '../security'; +import { buildRemote } from '../mesh/teacup'; +import { buildManifest, createMeshControl } from '../mesh/teapot'; +import type { MeshControl } from '../http'; +import type { RequestEnvelope, RouteEntry } from '../mesh/protocol'; +import type { App, InspectLine, Explain, RoutePlan, MeshConfig } from './types'; +import { inspectRoute, buildGraphView, explainRoute } from './introspect'; + +export type { App, InspectLine, ExplainNode, Explain, MeshConfig } from './types'; + +type Runner = (ctx: any) => any; + +/** Mutable graph state assembled from modules/plugins and later spliced with remote mesh scopes. */ +interface Registry { + providerNodes: GraphNode[]; + stepNodes: GraphNode[]; + runners: Map; + providerMeta: Map; + routePlans: RoutePlan[]; + exportedProviders: string[]; + exportedSteps: string[]; + exportedRoutes: RouteEntry[]; + setRunner(name: string, runner: Runner): void; +} + +/** Request-time helpers shared by the HTTP, WS and mesh route builders. */ +interface PipelineDeps { + providedSeed(plan: RoutePlan): Promise>; + planSteps(plan: RoutePlan): PipelineStep[]; + bus: Bus; +} + +/** + * Build an {@link App} from the given modules and options. + * Wires providers, steps, controllers and plugins into a dependency graph; for non-mesh apps + * the graph is finalized eagerly, otherwise finalization is deferred to {@link App.listen}. + */ +export function createApp(opts: { + modules: Ctor[]; + plugins?: Plugin[]; + mesh?: MeshConfig; + limits?: RequestLimits; + devGraph?: boolean; + overrides?: Record; + tls?: TlsOptions; + trustProxy?: boolean; + security?: boolean | SecurityOptions; + cors?: CorsOptions; + bodyDuplicates?: 'array' | 'last'; + /** Opt in to alpha features whose API may still change. Currently gates `mesh`. */ + experimental?: boolean; +}): App { + // mesh is alpha: its API and wire protocol may change. Require an explicit opt-in. + if (opts.mesh && !opts.experimental) { + throw new Error( + 'mesh is an alpha feature — pass `experimental: true` to createApp to enable it (its API may change between releases)', + ); + } + + const bus = new Bus(); + const container = new Container(); + let server: http.Server | undefined; + const streams = new Set<() => void>(); + const degradedProviders: string[] = []; // optional providers that failed to boot (running degraded) + + // Collect declarations from modules, then splice in plugin- and built-in-provided nodes. + const registry = collectModules(opts.modules); + const { providerNodes, stepNodes, runners, providerMeta, routePlans } = registry; + mountPlugins(opts.plugins, bus, registry); + provideBuiltins(registry); + + // For each route, resolve which providers/steps feed it via topo order. + // MVP: every route depends on every declared step + provider in the app graph. + // For mesh apps, finalize is DEFERRED to listen() so remote scopes can join the graph first. + let orderedProviders: GraphNode[] = []; + let orderedSteps: GraphNode[] = []; + let booted = false; + + const finalize = (): void => { + ({ orderedProviders, orderedSteps } = finalizeGraph(registry)); + booted = true; + }; + + if (!opts.mesh) finalize(); + + const inspect = (routePath: string): InspectLine[] => inspectRoute(routePlans, routePath, booted); + const graph = (): GraphView => buildGraphView(providerNodes, stepNodes, routePlans, booted); + const explain = (routePath: string): Explain => explainRoute(routePlans, routePath, booted); + + const providedSeed = (plan: RoutePlan) => seedProviders(container, plan); + const planSteps = (plan: RoutePlan) => compilePlanSteps(runners, plan); + + const listen = async (port: number): Promise => { + const deps: PipelineDeps = { providedSeed, planSteps, bus }; + + // mesh teacup: connect remote teapots, splice their scopes/routes into the graph, then finalize + let remoteRoutes: RouteDef[] = []; + const meshLinks: Link[] = []; + + if (opts.mesh && !booted) { + const spliced = await spliceRemoteScopes(opts.mesh, bus, registry); + remoteRoutes = spliced.remoteRoutes; + meshLinks.push(...spliced.meshLinks); + finalize(); + } + + applyOverrides(opts.overrides, registry); + degradedProviders.length = 0; + degradedProviders.push(...(await bootProviders(orderedProviders, { runners, container, providerMeta, bus }))); + + if (degradedProviders.length) { + console.warn( + `[green-tea] started with ${degradedProviders.length} degraded optional provider(s): ${degradedProviders.join(', ')} — routes that need them will fail at request time.`, + ); + } + + const meshControl = buildMeshControl(opts.mesh, registry, { + container, + orderedProviders, + orderedSteps, + deps, + }); + + const httpRoutes = buildHttpRoutes(routePlans, remoteRoutes, deps); + if (opts.devGraph) httpRoutes.push(devGraphRoute(graph)); + const wsRoutes = buildWsRoutes(routePlans, deps); + + server = createHttpServer(httpRoutes, wsRoutes, bus, meshControl, { + limits: opts.limits, + streams, + tls: opts.tls, + trustProxy: opts.trustProxy, + security: opts.security ?? true, + cors: opts.cors, + bodyDuplicates: opts.bodyDuplicates, + }); + server.on('close', () => closeLinks(meshLinks)); + await new Promise((resolve) => server!.listen(port, resolve)); + return server; + }; + + const close = (): Promise => + new Promise((resolve) => { + if (!server) return resolve(); + server.close(() => resolve()); // waits for in-flight buffered to drain + for (const closeStream of streams) closeStream(); // force-close long-lived SSE/WS so close() resolves + server.closeIdleConnections(); // Node >=18.2: drop idle keep-alive + }); + + return { + listen, + close, + inspect, + graph, + toMermaid: () => toMermaid(graph()), + toDOT: () => toDOT(graph()), + explain, + degraded: () => [...degradedProviders], + bus, + }; +} + +/** Creates an empty {@link Registry} whose `setRunner` enforces globally-unique provider/step names. */ +function emptyRegistry(): Registry { + const runners = new Map(); // node name -> runtime fn + + const setRunner = (name: string, runner: Runner) => { + if (runners.has(name)) + throw new Error(`duplicate provider/step name '${name}' — names must be unique across modules and plugins`); + runners.set(name, runner); + }; + + return { + providerNodes: [], + stepNodes: [], + runners, + providerMeta: new Map(), + routePlans: [], + exportedProviders: [], + exportedSteps: [], + exportedRoutes: [], + setRunner, + }; +} + +/** Registers a module's `@Provider` classes as app-scope provider nodes. */ +function collectProviders(providers: Ctor[], origin: string, registry: Registry): void { + for (const ProviderClass of providers) { + const meta = getProviderMeta(ProviderClass)!; + registry.providerNodes.push({ name: meta.provides, needs: meta.needs, provides: [meta.provides], origin }); + registry.providerMeta.set(meta.provides, { optional: meta.optional }); + if (meta.export) registry.exportedProviders.push(meta.provides); + const instance: any = new ProviderClass(); + registry.setRunner(meta.provides, (ctx) => instance.provide(ctx)); + } +} + +/** Registers a module's `@Step` classes as request-scope step nodes. */ +function collectSteps(steps: Ctor[], origin: string, registry: Registry): void { + for (const StepClass of steps) { + const meta = getStepMeta(StepClass)!; + registry.stepNodes.push({ name: meta.provides, needs: meta.needs, provides: [meta.provides], origin }); + if (meta.export) registry.exportedSteps.push(meta.provides); + const instance: any = new StepClass(); + registry.setRunner(meta.provides, (ctx) => instance.run(ctx)); + } +} + +/** Registers each `@Route` handler on a module's controllers as a {@link RoutePlan}. */ +function collectControllers(controllers: Ctor[], mountpoint: string, origin: string, registry: Registry): void { + for (const ControllerClass of controllers) { + for (const route of getRoutes(ControllerClass)) { + const instance: any = new ControllerClass(); + const argSpecs = getArgs(ControllerClass, route.handlerName); + const pattern = joinPath(mountpoint, route.path); + + if (route.export) { + if (route.transport !== 'buffer') throw new Error(`cannot export streaming route ${pattern}`); + registry.exportedRoutes.push({ method: route.method, pattern }); + } + + registry.routePlans.push({ + pattern, + method: route.method, + transport: route.transport, + origin, + providers: [], + steps: [], + handlerName: route.handlerName, + needs: getHandlerNeeds(argSpecs), + run: async (context: any) => instance[route.handlerName](...(await resolveArgs(argSpecs, context))), + transformer: getTransformer(ControllerClass, route.handlerName) ?? JsonTransformer, + duplicates: route.duplicates, + }); + } + } +} + +/** Reads every module's metadata into a fresh {@link Registry} of graph nodes, runners and exports. */ +function collectModules(modules: Ctor[]): Registry { + const registry = emptyRegistry(); + + for (const mod of modules) { + const moduleMeta = getModuleMeta(mod); + if (!moduleMeta) throw new Error(`${mod.name} is not a @Module`); + const origin = `module:${mod.name}`; + collectProviders(moduleMeta.providers ?? [], origin, registry); + collectSteps(moduleMeta.steps ?? [], origin, registry); + collectControllers(moduleMeta.controllers ?? [], moduleMeta.mountpoint, origin, registry); + } + + return registry; +} + +/** Mounts plugins and splices any steps/providers they add into the registry as their own scope. */ +function mountPlugins(plugins: Plugin[] | undefined, bus: Bus, registry: Registry): void { + const extraSteps: ScopeNode[] = []; + const scope: ScopeApi = { add: (node) => extraSteps.push(node) }; + + for (const plugin of plugins ?? []) mountPlugin(plugin, bus, scope); + + for (const scopeNode of extraSteps) { + const node = { name: scopeNode.name, needs: scopeNode.needs, provides: scopeNode.provides, origin: 'plugin' }; + if (scopeNode.kind === 'provider') registry.providerNodes.push(node); + else registry.stepNodes.push(node); + registry.setRunner(scopeNode.name, scopeNode.run); + } +} + +/** Auto-provides a shared {@link Rooms} instance unless the user already declared a `rooms` provider. */ +function provideBuiltins(registry: Registry): void { + if (registry.runners.has('rooms')) return; + const roomsInstance = new Rooms(); + registry.providerNodes.push({ name: 'rooms', needs: [], provides: ['rooms'], origin: 'builtin' }); + registry.providerMeta.set('rooms', { optional: false }); + registry.setRunner('rooms', () => ({ rooms: roomsInstance })); // merge object -> ctx.rooms +} + +/** + * Topo-sorts the graph, slices each route's provider/step closure into its plan, and validates every need. + * @returns The app-scope providers and request-scope steps in execution order. + */ +function finalizeGraph(registry: Registry): { orderedProviders: GraphNode[]; orderedSteps: GraphNode[] } { + const { providerNodes, stepNodes, routePlans } = registry; + const ordered = topoSort([...providerNodes, ...stepNodes], ['req', 'params']); + const orderedProviders = ordered.filter((node) => providerNodes.includes(node)); + const orderedSteps = ordered.filter((node) => stepNodes.includes(node)); + const alwaysSteps = stepNodes.filter((node) => node.provides.length === 0); // side-effect/observer steps (plugins) + const alwaysNeeds = alwaysSteps.flatMap((node) => node.needs); // pull observers' deps into every route + + for (const plan of routePlans) { + const closure = subgraphFor([...plan.needs, ...alwaysNeeds], ordered); + plan.providers = closure.filter((node) => providerNodes.includes(node)); + const sliced = new Set([...closure.filter((node) => stepNodes.includes(node)), ...alwaysSteps]); + plan.steps = ordered.filter((node) => stepNodes.includes(node) && sliced.has(node)); // topo order, deduped + } + + assertNeedsSatisfiable(routePlans, providerNodes, stepNodes); + return { orderedProviders, orderedSteps }; +} + +/** Throws if any route needs a key that nothing (local or mesh) provides, suggesting the nearest match. */ +function assertNeedsSatisfiable(routePlans: RoutePlan[], providerNodes: GraphNode[], stepNodes: GraphNode[]): void { + const producedKeys = new Set([ + ...providerNodes.flatMap((node) => node.provides), + ...stepNodes.flatMap((node) => node.provides), + ]); + const allowed = new Set([...producedKeys, 'req', 'params', 'query', 'body', 'headers', 'inbound', 'abort']); + + for (const plan of routePlans) { + for (const need of plan.needs) { + if (allowed.has(need)) continue; + const hint = nearest(need, allowed); + throw new Error( + `handler '${plan.handlerName}' needs '${need}' but nothing (local or mesh) provides it${hint ? ` — did you mean '${hint}'?` : ''}`, + ); + } + } +} + +/** Connects the configured teapots, splices their remote providers/steps into the registry, and returns their routes. */ +async function spliceRemoteScopes( + mesh: MeshConfig, + bus: Bus, + registry: Registry, +): Promise<{ remoteRoutes: RouteDef[]; meshLinks: Link[] }> { + const remoteRoutes: RouteDef[] = []; + const meshLinks: Link[] = []; + + try { + for (const teapot of mesh.teapots ?? []) { + const link = await connectLink({ url: teapot.url, secret: teapot.secret, timeoutMs: mesh.timeoutMs, bus }); + meshLinks.push(link); + const { providers, steps, routes } = buildRemote(link); + const origin = `mesh:${teapot.url}`; + + for (const provider of providers) { + registry.providerNodes.push({ name: provider.name, needs: [], provides: [provider.name], origin }); + registry.providerMeta.set(provider.name, { optional: false }); + registry.setRunner(provider.name, provider.run); + } + + for (const step of steps) { + registry.stepNodes.push({ name: step.name, needs: [], provides: [step.name], origin }); + registry.setRunner(step.name, step.run); + } + + for (const route of routes) { + remoteRoutes.push({ + method: route.method, + pattern: route.pattern, + transport: 'buffer', + handler: async (req) => route.handler(req as RequestEnvelope), + }); + } + } + } catch (err) { + closeLinks(meshLinks); + throw err; + } + + return { remoteRoutes, meshLinks }; +} + +/** Swaps provider/step runners by token — a value replaces the runner, a function becomes it. */ +function applyOverrides(overrides: Record | undefined, registry: Registry): void { + if (!overrides) return; + const produced = new Set([...registry.providerNodes, ...registry.stepNodes].flatMap((node) => node.provides)); + + for (const [token, val] of Object.entries(overrides)) { + if (!produced.has(token)) throw new Error(`override for unknown token '${token}'`); + const runner: Runner = typeof val === 'function' ? (val as Runner) : () => ({ [token]: val }); + registry.runners.set(token, runner); // direct set (setRunner throws on dup); replaces the real runner + } +} + +/** + * Runs app-scoped providers in topo order, caching each result; required failures abort, optional ones warn. + * @returns The names of optional providers that failed and are running degraded (unregistered). + */ +async function bootProviders( + orderedProviders: GraphNode[], + deps: { + runners: Map; + container: Container; + providerMeta: Map; + bus: Bus; + }, +): Promise { + const { runners, container, providerMeta, bus } = deps; + const degraded: string[] = []; + + for (const node of orderedProviders) { + bus.emit('boot:provider:start', { name: node.name, scope: node.origin }); + + try { + const value = await runners.get(node.name)!(await snapshot(container, node.needs)); + container.register(node.name, 'app', () => value); + await container.resolve(node.name); // warm the cache + bus.emit('boot:provider:ok', { name: node.name }); + } catch (error) { + bus.emit('boot:provider:fail', { name: node.name, error }); + + if (!providerMeta.get(node.name)?.optional) { + throw new Error(`provider '${node.name}' failed: ${(error as Error).message}`); + } + + // optional: warn, leave it unregistered; routes needing it fail at request time + // ponytail: full partial-degradation is out of scope (spec §10); warn is enough here + degraded.push(node.name); + console.warn(`[green-tea] optional provider '${node.name}' failed: ${(error as Error).message}`); + } + } + + return degraded; +} + +/** + * Builds the mesh control gateway that exposes this node's declared exports over the control channel. + * Returns undefined when there is nothing to export; throws if exports are declared without a gating secret. + */ +function buildMeshControl( + mesh: MeshConfig | undefined, + registry: Registry, + deps: { container: Container; orderedProviders: GraphNode[]; orderedSteps: GraphNode[]; deps: PipelineDeps }, +): MeshControl | undefined { + const { exportedProviders, exportedSteps, exportedRoutes, routePlans, runners } = registry; + const hasExports = exportedProviders.length || exportedSteps.length || exportedRoutes.length; + + if (hasExports && !mesh?.secret) { + throw new Error('mesh: exports declared (export: true) but no mesh.secret configured to gate the control channel'); + } + + if (!mesh?.secret || !hasExports) return undefined; + const { container, orderedProviders, orderedSteps } = deps; + const { bus, providedSeed, planSteps } = deps.deps; + const manifest = buildManifest({ providers: exportedProviders, steps: exportedSteps, routes: exportedRoutes }); + + const resolveScope = async (name: string, env: RequestEnvelope): Promise => { + // context is intentionally `any`: providers and steps merge arbitrary keys into it + let context: any = { req: env, params: env.params, query: env.query, body: env.body, headers: env.headers }; + + for (const provider of orderedProviders) + if (container.has(provider.name)) Object.assign(context, await container.resolve(provider.name)); + + for (const step of orderedSteps) { + const runner = runners.get(step.name)!; + context = { ...context, ...(await runner(context)) }; + } + + return context[name]; + }; + + const resolveRoute = async (name: string, env: RequestEnvelope) => { + const plan = routePlans.find((candidate) => candidate.pattern === name && candidate.method === env.method); + + if (!plan) { + const error: any = new Error(`no route ${name}`); + error.status = 404; + throw error; + } + + const provided = await providedSeed(plan); + const result = await runPipeline({ + steps: planSteps(plan), + handler: plan.run, + transformer: plan.transformer, + bus, + seed: { ...provided, req: env, params: env.params, query: env.query, body: env.body, headers: env.headers }, + }); + + if ('stream' in result) { + const error: any = new Error('cannot proxy a streaming route'); + error.status = 500; + throw error; + } + + return result; + }; + + return createMeshControl({ secret: mesh.secret, manifest, resolveScope, resolveRoute, bus }); +} + +/** Compiles every non-ws route plan into an HTTP route that seeds and runs the pipeline, plus any remote routes. */ +function buildHttpRoutes(routePlans: RoutePlan[], remoteRoutes: RouteDef[], deps: PipelineDeps): RouteDef[] { + const { providedSeed, planSteps, bus } = deps; + + const local = routePlans + .filter((plan) => plan.transport !== 'ws') // buffer | sse | ndjson | negotiate + .map((plan): RouteDef => ({ + method: plan.method, + pattern: plan.pattern, + transport: plan.transport, + bodyDuplicates: plan.duplicates, + handler: async (req) => { + const provided = await providedSeed(plan); + return runPipeline({ + steps: planSteps(plan), + handler: plan.run, + transformer: plan.transformer, + bus, + seed: { + ...provided, + req, + params: req.params, + query: req.query, + body: req.body, + headers: req.headers, + protocol: req.protocol, + ip: req.ip, + }, + }); + }, + })); + + return [...local, ...remoteRoutes]; +} + +/** The dev-only `/__graph__` route: serves the dependency graph as Mermaid text or an HTML viewer. */ +function devGraphRoute(graph: () => GraphView): RouteDef { + return { + method: 'GET', + pattern: '/__graph__', + transport: 'buffer', + handler: async (req) => { + const mermaid = toMermaid(graph()); + const accept = String(req.headers['accept'] ?? ''); + return accept.includes('text/plain') + ? { status: 200, headers: { 'content-type': 'text/plain' }, body: mermaid } + : { status: 200, headers: { 'content-type': 'text/html' }, body: graphHtml(mermaid) }; + }, + }; +} + +/** Compiles every ws/negotiate route plan into a WebSocket route that seeds context and runs its steps + handler. */ +function buildWsRoutes(routePlans: RoutePlan[], deps: PipelineDeps): WsRouteDef[] { + const { providedSeed, planSteps } = deps; + + return routePlans + .filter((plan) => plan.transport === 'ws' || plan.transport === 'negotiate') + .map((plan) => ({ + pattern: plan.pattern, + open: async ({ params, inbound, abort, req }) => { + const provided = await providedSeed(plan); + // ws upgrades come in on the raw Node req; trustProxy derivation for ws is out of scope here + // context is intentionally `any`: each step merges arbitrary keys into it + let context: any = { + ...provided, + req, + params, + query: parseQuery(req.url ?? ''), + body: undefined, + headers: req.headers, + inbound, + abort, + protocol: (req.socket as any).encrypted ? 'https' : 'http', + ip: req.socket.remoteAddress ?? '', + }; + + for (const step of planSteps(plan)) { + context = { ...context, ...(await step.run(context)) }; + } + + const result = await plan.run(context); + if (!isAsyncIterable(result)) throw new Error(`@Ws handler '${plan.handlerName}' must return an AsyncIterable`); + return result as AsyncIterable; + }, + })); +} + +/** Best-effort close of every mesh link, ignoring individual failures. */ +function closeLinks(links: Link[]): void { + for (const link of links) { + try { + link.close(); + } catch { + /* */ + } + } +} + +/** Merges every app-scope provider bound to a route into a request seed (skips unresolved providers). */ +async function seedProviders(container: Container, plan: RoutePlan): Promise> { + const provided: Record = {}; + + for (const provider of plan.providers) { + if (container.has(provider.name)) + Object.assign(provided, (await container.resolve(provider.name)) as Record); + } + + return provided; +} + +/** Resolves a route's step nodes into runnable pipeline steps, failing if any runner is missing. */ +function compilePlanSteps(runners: Map, plan: RoutePlan): PipelineStep[] { + return plan.steps.map((step) => { + const runner = runners.get(step.name); + if (!runner) throw new Error(`no runner registered for step '${step.name}'`); + return { name: step.name, origin: step.origin, run: runner }; + }); +} + +/** Resolves the given need-keys from the container into a merged snapshot (skips unregistered keys). */ +async function snapshot(container: Container, needs: string[]): Promise> { + const resolved: Record = {}; + + for (const key of needs) + if (container.has(key)) Object.assign(resolved, (await container.resolve(key)) as Record); + + return resolved; +} diff --git a/src/app/introspect.ts b/src/app/introspect.ts new file mode 100644 index 0000000..7607c3d --- /dev/null +++ b/src/app/introspect.ts @@ -0,0 +1,77 @@ +import type { GraphNode } from '../graph'; +import type { GraphView } from '../graph-viz'; +import type { InspectLine, Explain, ExplainNode, RoutePlan } from './types'; + +/** Lists the provider/step/handler chain for a route, in execution order. */ +export function inspectRoute(routePlans: RoutePlan[], routePath: string, booted: boolean): InspectLine[] { + if (!booted) throw new Error('inspect() unavailable before listen() for mesh apps'); + const plan = routePlans.find((candidate) => candidate.pattern === routePath); + if (!plan) throw new Error(`no route: ${routePath}`); + return [ + ...plan.providers.map((provider) => ({ + name: provider.name, + kind: 'provider' as const, + origin: provider.origin, + })), + ...plan.steps.map((step) => ({ name: step.name, kind: 'step' as const, origin: step.origin })), + { name: plan.handlerName, kind: 'handler' as const, origin: plan.origin }, + ]; +} + +/** Builds the full dependency-graph view: every provider/step node plus each route's chain. */ +export function buildGraphView( + providerNodes: GraphNode[], + stepNodes: GraphNode[], + routePlans: RoutePlan[], + booted: boolean, +): GraphView { + if (!booted) throw new Error('graph() unavailable before listen() for mesh apps'); + return { + nodes: [ + ...providerNodes.map((node) => ({ + name: node.name, + kind: 'provider' as const, + origin: node.origin, + needs: node.needs, + provides: node.provides, + })), + ...stepNodes.map((node) => ({ + name: node.name, + kind: 'step' as const, + origin: node.origin, + needs: node.needs, + provides: node.provides, + })), + ], + routes: routePlans.map((plan) => ({ + pattern: plan.pattern, + method: plan.method, + transport: plan.transport, + chain: [...plan.providers.map((node) => node.name), ...plan.steps.map((node) => node.name), plan.handlerName], + })), + }; +} + +/** Explains a single route: its match criteria and the ordered chain with each node's needs/provides. */ +export function explainRoute(routePlans: RoutePlan[], routePath: string, booted: boolean): Explain { + if (!booted) throw new Error('explain() unavailable before listen() for mesh apps'); + const plan = routePlans.find((candidate) => candidate.pattern === routePath); + if (!plan) throw new Error(`no route: ${routePath}`); + const toExplainNode = (node: GraphNode, kind: 'provider' | 'step'): ExplainNode => ({ + name: node.name, + kind, + origin: node.origin, + needs: node.needs, + provides: node.provides, + }); + return { + pattern: plan.pattern, + method: plan.method, + transport: plan.transport, + chain: [ + ...plan.providers.map((node) => toExplainNode(node, 'provider')), + ...plan.steps.map((node) => toExplainNode(node, 'step')), + { name: plan.handlerName, kind: 'handler', origin: plan.origin, needs: plan.needs, provides: [] }, + ], + }; +} diff --git a/src/app/types.ts b/src/app/types.ts new file mode 100644 index 0000000..8876f44 --- /dev/null +++ b/src/app/types.ts @@ -0,0 +1,66 @@ +import type http from 'http'; +import type { Bus } from '../bus'; +import type { GraphNode } from '../graph'; +import type { GraphView } from '../graph-viz'; +import type { HttpMethod, Transport } from '../metadata'; +import { JsonTransformer } from '../transformers'; + +/** One entry in an {@link App.inspect} listing: a provider, step or handler and where it came from. */ +export interface InspectLine { + name: string; + kind: 'provider' | 'step' | 'handler'; + origin: string; +} + +/** A node in an {@link Explain} chain, annotated with the keys it needs and provides. */ +export interface ExplainNode { + name: string; + kind: 'provider' | 'step' | 'handler'; + origin: string; + needs: string[]; + provides: string[]; +} + +/** A full route explanation: its match criteria and the ordered provider/step/handler chain. */ +export interface Explain { + pattern: string; + method: HttpMethod; + transport: Transport; + chain: ExplainNode[]; +} + +/** A running application instance with lifecycle, introspection and graph-export methods. */ +export interface App { + listen(port: number): Promise; + close(): Promise; + inspect(routePath: string): InspectLine[]; + graph(): GraphView; + toMermaid(): string; + toDOT(): string; + explain(routePath: string): Explain; + /** Names of optional providers that failed to boot and are running degraded (empty until {@link App.listen}). */ + degraded(): string[]; + bus: Bus; +} + +/** Internal per-route plan: match criteria, its resolved provider/step closure, and the compiled handler. */ +export interface RoutePlan { + pattern: string; + method: HttpMethod; + transport: Transport; + origin: string; + providers: GraphNode[]; + steps: GraphNode[]; + handlerName: string; + needs: string[]; + run: (ctx: any) => Promise; + transformer: typeof JsonTransformer; + duplicates?: 'array' | 'last'; +} + +/** Mesh networking options: a secret to gate this node's exports and/or remote teapots to connect to. */ +export interface MeshConfig { + secret?: string; + teapots?: Array<{ url: string; secret: string }>; + timeoutMs?: number; +} diff --git a/src/bus.ts b/src/bus.ts index 9143d9e..149b890 100644 --- a/src/bus.ts +++ b/src/bus.ts @@ -1,10 +1,20 @@ +/** Names of every lifecycle event the framework emits over the {@link Bus}. */ export type LifecycleEvent = - | 'boot:provider:start' | 'boot:provider:ok' | 'boot:provider:fail' - | 'request:step:enter' | 'request:step:leave' | 'request:step:error' - | 'stream:open' | 'stream:close' | 'stream:error' - | 'mesh:connect' | 'mesh:disconnect' | 'mesh:rpc:error' + | 'boot:provider:start' + | 'boot:provider:ok' + | 'boot:provider:fail' + | 'request:step:enter' + | 'request:step:leave' + | 'request:step:error' + | 'stream:open' + | 'stream:close' + | 'stream:error' + | 'mesh:connect' + | 'mesh:disconnect' + | 'mesh:rpc:error' | 'plugin:mounted'; +/** Data carried by a lifecycle event: the subject's name plus optional scope, error and timing. */ export interface EventPayload { name: string; scope?: string; @@ -12,19 +22,26 @@ export interface EventPayload { durationMs?: number; } +/** In-process pub/sub for framework lifecycle events; observer failures are swallowed so they never break the pipeline. */ export class Bus { private readonly listeners = new Map void>>(); - on(event: LifecycleEvent, fn: (p: EventPayload) => void): () => void { - const set = this.listeners.get(event) ?? new Set(); - set.add(fn); - this.listeners.set(event, set); - return () => set.delete(fn); + /** Subscribe `listener` to `event`; returns an unsubscribe function. */ + on(event: LifecycleEvent, listener: (p: EventPayload) => void): () => void { + const listenerSet = this.listeners.get(event) ?? new Set(); + listenerSet.add(listener); + this.listeners.set(event, listenerSet); + return () => listenerSet.delete(listener); } - emit(event: LifecycleEvent, p: EventPayload): void { - for (const fn of this.listeners.get(event) ?? []) { - try { fn(p); } catch { /* observers must never break the pipeline */ } + /** Dispatch `payload` to every listener of `event`; a throwing listener is isolated and does not affect the others. */ + emit(event: LifecycleEvent, payload: EventPayload): void { + for (const listener of this.listeners.get(event) ?? []) { + try { + listener(payload); + } catch { + /* observers must never break the pipeline */ + } } } } diff --git a/src/channel.ts b/src/channel.ts index def9077..7f71793 100644 --- a/src/channel.ts +++ b/src/channel.ts @@ -1,3 +1,7 @@ +/** + * A push-driven async stream: producers call `push`/`close`/`fail`, consumers use `for await`. + * Each `for await` gets its own independent subscription (fan-out). + */ export interface Channel extends AsyncIterable { push(value: T): void; close(): void; @@ -5,15 +9,16 @@ export interface Channel extends AsyncIterable { readonly closed: boolean; } +/** Type guard: true when `x` implements the async-iterable protocol. */ export function isAsyncIterable(x: unknown): x is AsyncIterable { return x != null && typeof (x as { [Symbol.asyncIterator]?: unknown })[Symbol.asyncIterator] === 'function'; } interface Sub { iterator: AsyncIterator; - push(v: T, cap: number): void; + push(value: T, cap: number): void; end(): void; - fail(e: unknown): void; + fail(err: unknown): void; } function newSub(onReturn: () => void): Sub { @@ -23,29 +28,48 @@ function newSub(onReturn: () => void): Sub { let failure: { err: unknown } | null = null; return { - push(v, cap) { + push(value, cap) { if (ended) return; - if (pending) { const p = pending; pending = null; p.resolve({ value: v, done: false }); return; } - queue.push(v); + + if (pending) { + const waiter = pending; + pending = null; + waiter.resolve({ value, done: false }); + return; + } + + queue.push(value); if (queue.length > cap) queue.shift(); // drop-oldest when buffer is full }, end() { if (ended) return; ended = true; - if (pending) { const p = pending; pending = null; p.resolve({ value: undefined as never, done: true }); } + + if (pending) { + const waiter = pending; + pending = null; + waiter.resolve({ value: undefined as never, done: true }); + } }, - fail(e) { + fail(err) { if (ended) return; ended = true; - failure = { err: e }; - if (pending) { const p = pending; pending = null; p.reject(e); } + failure = { err }; + + if (pending) { + const waiter = pending; + pending = null; + waiter.reject(err); + } }, iterator: { next(): Promise> { if (queue.length) return Promise.resolve({ value: queue.shift() as T, done: false }); if (failure) return Promise.reject(failure.err); if (ended) return Promise.resolve({ value: undefined as never, done: true }); - return new Promise>((resolve, reject) => { pending = { resolve, reject }; }); + return new Promise>((resolve, reject) => { + pending = { resolve, reject }; + }); }, return(): Promise> { ended = true; @@ -56,6 +80,10 @@ function newSub(onReturn: () => void): Sub { }; } +/** + * Creates a fan-out {@link Channel}. Values pushed are delivered to every active subscriber. + * @param opts.buffer Per-subscriber queue cap; drops oldest when exceeded (default: unbounded). + */ export function channel(opts: { buffer?: number } = {}): Channel { const cap = opts.buffer ?? Infinity; const subs = new Set>(); @@ -63,27 +91,31 @@ export function channel(opts: { buffer?: number } = {}): Channel { let closedFlag = false; return { - get closed() { return closedFlag; }, + get closed() { + return closedFlag; + }, push(value) { if (done) return; - for (const s of subs) s.push(value, cap); + for (const sub of subs) sub.push(value, cap); }, close() { if (done) return; - done = true; closedFlag = true; - for (const s of subs) s.end(); + done = true; + closedFlag = true; + for (const sub of subs) sub.end(); subs.clear(); }, fail(err) { if (done) return; - done = true; closedFlag = true; - for (const s of subs) s.fail(err); + done = true; + closedFlag = true; + for (const sub of subs) sub.fail(err); subs.clear(); }, [Symbol.asyncIterator](): AsyncIterator { - const s = newSub(() => subs.delete(s)); - subs.add(s); - return s.iterator; + const sub = newSub(() => subs.delete(sub)); + subs.add(sub); + return sub.iterator; }, }; } diff --git a/src/container.ts b/src/container.ts index d376eeb..af53dd0 100644 --- a/src/container.ts +++ b/src/container.ts @@ -1,27 +1,43 @@ +/** Lifetime of a binding: `app` values are memoized for the process, `request` values are recomputed per resolve. */ export type Scope = 'app' | 'request'; +/** Produces a bound value from the current context; may be async. */ export type Factory = (ctx: Record) => unknown | Promise; -interface Binding { scope: Scope; factory: Factory; cached?: unknown; resolved?: boolean } +interface Binding { + scope: Scope; + factory: Factory; + cached?: unknown; + resolved?: boolean; +} +/** Minimal token-keyed dependency container with app-scoped memoization and async, mesh-ready resolution. */ export class Container { private readonly bindings = new Map(); + /** Bind `token` to `factory` under `scope`, replacing any existing binding. */ register(token: string, scope: Scope, factory: Factory): void { this.bindings.set(token, { scope, factory }); } + /** Whether `token` currently has a binding. */ has(token: string): boolean { return this.bindings.has(token); } + /** Resolve `token`'s value; app-scoped results are cached, request-scoped ones re-run the factory. Throws on unknown tokens. */ // ponytail: app-scope memoizes; request-scope always re-runs. resolve is async // so a future remote transport (mesh) slots in without changing callers. async resolve(token: string, ctx: Record = {}): Promise { - const b = this.bindings.get(token); - if (!b) throw new Error(`unknown token: ${token}`); - if (b.scope === 'app' && b.resolved) return b.cached; - const value = await b.factory(ctx); - if (b.scope === 'app') { b.cached = value; b.resolved = true; } + const binding = this.bindings.get(token); + if (!binding) throw new Error(`unknown token: ${token}`); + if (binding.scope === 'app' && binding.resolved) return binding.cached; + const value = await binding.factory(ctx); + + if (binding.scope === 'app') { + binding.cached = value; + binding.resolved = true; + } + return value; } } diff --git a/src/encoders.ts b/src/encoders.ts index e5642e3..9819a88 100644 --- a/src/encoders.ts +++ b/src/encoders.ts @@ -1,3 +1,7 @@ +/** + * Serializes stream items into wire frames for a streaming transport (SSE, NDJSON). + * `headers` is written once before the first frame; `ping` (if present) is sent periodically to keep the connection alive. + */ export interface StreamEncoder { headers: Record; encode(item: unknown): string | Buffer; @@ -5,17 +9,19 @@ export interface StreamEncoder { ping?(): string; } -const msgOf = (e: unknown): string => (e instanceof Error ? e.message : String(e)); +const messageOf = (error: unknown): string => (error instanceof Error ? error.message : String(error)); +/** Server-Sent Events encoder: one JSON payload per `data:` event, with comment-line pings. */ export const sseEncoder: StreamEncoder = { headers: { 'content-type': 'text/event-stream', 'cache-control': 'no-cache', connection: 'keep-alive' }, encode: (item) => `data: ${JSON.stringify(item)}\n\n`, - encodeError: (err) => `event: error\ndata: ${JSON.stringify({ error: msgOf(err) })}\n\n`, + encodeError: (err) => `event: error\ndata: ${JSON.stringify({ error: messageOf(err) })}\n\n`, ping: () => ': ping\n\n', }; +/** Newline-delimited JSON encoder: one JSON object per line. */ export const ndjsonEncoder: StreamEncoder = { headers: { 'content-type': 'application/x-ndjson' }, encode: (item) => `${JSON.stringify(item)}\n`, - encodeError: (err) => `${JSON.stringify({ error: msgOf(err) })}\n`, + encodeError: (err) => `${JSON.stringify({ error: messageOf(err) })}\n`, }; diff --git a/src/flow.ts b/src/flow.ts index 263af84..1728083 100644 --- a/src/flow.ts +++ b/src/flow.ts @@ -1,18 +1,23 @@ +/** A single flow step: receives the accumulated context and returns the fields it contributes. */ export type StepFn = (ctx: In) => Out | Promise; +/** A built flow ready to execute: its ordered steps, terminal handler, and a `run` entry point. */ export interface CompiledFlow { steps: { name: string; fn: StepFn }[]; handler: (ctx: Acc) => unknown; run(seed: Seed): Promise; } +/** Immutable builder that chains typed steps, each widening the accumulated context type. */ export class Flow { constructor(private readonly steps: { name: string; fn: StepFn }[] = []) {} + /** Appends a step and returns a new Flow whose context now includes the step's output. */ step(name: string, fn: StepFn): Flow { return new Flow([...this.steps, { name, fn }]); } + /** Seals the flow with a terminal handler, producing a runnable CompiledFlow. */ handle(handler: (ctx: Acc) => unknown): CompiledFlow { const steps = this.steps; return { @@ -20,16 +25,19 @@ export class Flow { handler, async run(seed: Seed): Promise { let ctx: any = { ...seed }; - for (const s of steps) { - const out = await s.fn(ctx); - ctx = { ...ctx, ...out }; + + for (const step of steps) { + const output = await step.fn(ctx); + ctx = { ...ctx, ...output }; } + return handler(ctx); }, }; } } +/** Starts a new flow whose seed and initial context are the same type. */ export function flow(): Flow { return new Flow(); } diff --git a/src/graph-viz.ts b/src/graph-viz.ts index f981962..686c2eb 100644 --- a/src/graph-viz.ts +++ b/src/graph-viz.ts @@ -1,45 +1,81 @@ -export interface GraphNodeView { name: string; kind: 'provider' | 'step'; origin: string; needs: string[]; provides: string[] } -export interface GraphRouteView { pattern: string; method: string; transport: string; chain: string[] } -export interface GraphView { nodes: GraphNodeView[]; routes: GraphRouteView[] } +/** Renderable view of a graph node (provider or step). */ +export interface GraphNodeView { + name: string; + kind: 'provider' | 'step'; + origin: string; + needs: string[]; + provides: string[]; +} +/** Renderable view of a route and the chain of nodes feeding its handler. */ +export interface GraphRouteView { + pattern: string; + method: string; + transport: string; + chain: string[]; +} +/** Full graph payload consumed by the diagram renderers. */ +export interface GraphView { + nodes: GraphNodeView[]; + routes: GraphRouteView[]; +} -const nid = (s: string) => 'n_' + s.replace(/[^a-zA-Z0-9]/g, '_'); -const rid = (s: string) => 'r_' + s.replace(/[^a-zA-Z0-9]/g, '_'); +/** Sanitizes a node name into a Mermaid/DOT-safe node id. */ +const nid = (name: string) => 'n_' + name.replace(/[^a-zA-Z0-9]/g, '_'); +/** Sanitizes a route pattern into a Mermaid/DOT-safe node id. */ +const rid = (pattern: string) => 'r_' + pattern.replace(/[^a-zA-Z0-9]/g, '_'); +/** Renders the graph view as Mermaid `flowchart` source. */ export function toMermaid(view: GraphView): string { - const known = new Set(view.nodes.map((n) => n.name)); + const known = new Set(view.nodes.map((node) => node.name)); const out: string[] = ['flowchart LR']; - for (const n of view.nodes) { - out.push(n.kind === 'provider' ? ` ${nid(n.name)}(["${n.name}"])` : ` ${nid(n.name)}["${n.name}"]`); + + for (const node of view.nodes) { + out.push( + node.kind === 'provider' ? ` ${nid(node.name)}(["${node.name}"])` : ` ${nid(node.name)}["${node.name}"]`, + ); } - for (const n of view.nodes) for (const need of n.needs) if (known.has(need)) out.push(` ${nid(need)} --> ${nid(n.name)}`); - for (const r of view.routes) { - out.push(` ${rid(r.pattern)}{{"${r.method} ${r.pattern}"}}`); - for (const c of r.chain) if (known.has(c)) out.push(` ${nid(c)} --> ${rid(r.pattern)}`); + + for (const node of view.nodes) + for (const need of node.needs) if (known.has(need)) out.push(` ${nid(need)} --> ${nid(node.name)}`); + + for (const route of view.routes) { + out.push(` ${rid(route.pattern)}{{"${route.method} ${route.pattern}"}}`); + for (const link of route.chain) if (known.has(link)) out.push(` ${nid(link)} --> ${rid(route.pattern)}`); } + return out.join('\n'); } +/** Renders the graph view as Graphviz DOT source. */ export function toDOT(view: GraphView): string { - const known = new Set(view.nodes.map((n) => n.name)); + const known = new Set(view.nodes.map((node) => node.name)); const out: string[] = ['digraph green_tea {', ' rankdir=LR;']; - for (const n of view.nodes) { - out.push(` "${n.name}" [shape=${n.kind === 'provider' ? 'ellipse' : 'box'}];`); + + for (const node of view.nodes) { + out.push(` "${node.name}" [shape=${node.kind === 'provider' ? 'ellipse' : 'box'}];`); } - for (const n of view.nodes) for (const need of n.needs) if (known.has(need)) out.push(` "${need}" -> "${n.name}";`); - for (const r of view.routes) { - const label = `${r.method} ${r.pattern}`; + + for (const node of view.nodes) + for (const need of node.needs) if (known.has(need)) out.push(` "${need}" -> "${node.name}";`); + + for (const route of view.routes) { + const label = `${route.method} ${route.pattern}`; out.push(` "${label}" [shape=hexagon];`); - for (const c of r.chain) if (known.has(c)) out.push(` "${c}" -> "${label}";`); + for (const link of route.chain) if (known.has(link)) out.push(` "${link}" -> "${label}";`); } + out.push('}'); return out.join('\n'); } +/** Wraps Mermaid source in a self-contained HTML page that renders it in the browser. */ export function graphHtml(mermaid: string): string { return [ 'green-tea graph', '', - '
', mermaid, '
', + '
',
+    mermaid,
+    '
', '', ].join('\n'); } diff --git a/src/graph.ts b/src/graph.ts index 1e992d1..b576dfd 100644 --- a/src/graph.ts +++ b/src/graph.ts @@ -1,21 +1,40 @@ function levenshtein(a: string, b: string): number { - const m = a.length, n = b.length; - const d: number[][] = Array.from({ length: m + 1 }, () => Array(n + 1).fill(0)); - for (let i = 0; i <= m; i++) d[i][0] = i; - for (let j = 0; j <= n; j++) d[0][j] = j; - for (let i = 1; i <= m; i++) for (let j = 1; j <= n; j++) { - d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1)); - } - return d[m][n]; + const aLen = a.length, + bLen = b.length; + const matrix: number[][] = Array.from({ length: aLen + 1 }, () => Array(bLen + 1).fill(0)); + for (let i = 0; i <= aLen; i++) matrix[i][0] = i; + for (let j = 0; j <= bLen; j++) matrix[0][j] = j; + + for (let i = 1; i <= aLen; i++) + for (let j = 1; j <= bLen; j++) { + matrix[i][j] = Math.min( + matrix[i - 1][j] + 1, + matrix[i][j - 1] + 1, + matrix[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1), + ); + } + + return matrix[aLen][bLen]; } +/** Returns the candidate within edit distance 2 of `token`, for "did you mean?" hints. */ export function nearest(token: string, candidates: Iterable): string | undefined { let best: string | undefined; - let bestD = 3; // only suggest edit distance <= 2 - for (const c of candidates) { const dist = levenshtein(token, c); if (dist < bestD) { bestD = dist; best = c; } } + let bestDistance = 3; // only suggest edit distance <= 2 + + for (const candidate of candidates) { + const distance = levenshtein(token, candidate); + + if (distance < bestDistance) { + bestDistance = distance; + best = candidate; + } + } + return best; } +/** A node in the dependency graph: what it provides, what it needs, and where it came from. */ export interface GraphNode { name: string; needs: string[]; @@ -23,15 +42,16 @@ export interface GraphNode { origin: string; } +/** Orders nodes so every dependency precedes its dependents; throws on missing keys or cycles. */ export function topoSort(nodes: GraphNode[], seedKeys: string[]): GraphNode[] { const producedBy = new Map(); - for (const n of nodes) for (const key of n.provides) producedBy.set(key, n); + for (const node of nodes) for (const key of node.provides) producedBy.set(key, node); // validate dependencies exist - for (const n of nodes) { - for (const key of n.needs) { + for (const node of nodes) { + for (const key of node.needs) { if (!seedKeys.includes(key) && !producedBy.has(key)) { - throw new Error(`missing dependency: ${key} needed by ${n.name}`); + throw new Error(`missing dependency: ${key} needed by ${node.name}`); } } } @@ -39,28 +59,32 @@ export function topoSort(nodes: GraphNode[], seedKeys: string[]): GraphNode[] { const ordered: GraphNode[] = []; const state = new Map(); - const visit = (n: GraphNode, trail: string[]): void => { - const s = state.get(n); - if (s === 'done') return; - if (s === 'visiting') throw new Error(`cycle detected: ${[...trail, n.name].join(' -> ')}`); - state.set(n, 'visiting'); - for (const key of n.needs) { - const dep = producedBy.get(key); - if (dep && dep !== n) visit(dep, [...trail, n.name]); + const visit = (node: GraphNode, trail: string[]): void => { + const visitState = state.get(node); + if (visitState === 'done') return; + if (visitState === 'visiting') throw new Error(`cycle detected: ${[...trail, node.name].join(' -> ')}`); + state.set(node, 'visiting'); + + for (const key of node.needs) { + const dependency = producedBy.get(key); + if (dependency && dependency !== node) visit(dependency, [...trail, node.name]); } - state.set(n, 'done'); - ordered.push(n); + + state.set(node, 'done'); + ordered.push(node); }; - for (const n of nodes) visit(n, []); + for (const node of nodes) visit(node, []); return ordered; } +/** Filters `ordered` down to the transitive closure of producers reachable from `needs`. */ export function subgraphFor(needs: string[], ordered: GraphNode[]): GraphNode[] { const producedBy = new Map(); - for (const n of ordered) for (const k of n.provides) producedBy.set(k, n); + for (const node of ordered) for (const key of node.provides) producedBy.set(key, node); const inClosure = new Set(); const work = [...needs]; + while (work.length) { const token = work.pop() as string; const node = producedBy.get(token); @@ -68,5 +92,6 @@ export function subgraphFor(needs: string[], ordered: GraphNode[]): GraphNode[] inClosure.add(node); work.push(...node.needs); } - return ordered.filter((n) => inClosure.has(n)); + + return ordered.filter((node) => inClosure.has(node)); } diff --git a/src/http.ts b/src/http.ts deleted file mode 100644 index 4b28355..0000000 --- a/src/http.ts +++ /dev/null @@ -1,316 +0,0 @@ -import http from 'http'; -import https from 'https'; -import { once } from 'events'; -import { channel } from './channel'; -import { errorToResponse } from './transformers'; -import { HttpError, isHttpError } from './signals'; -import { sseEncoder, ndjsonEncoder, StreamEncoder } from './encoders'; -import { isStreamResult, type PipelineResult, type ResponseShape } from './pipeline'; -import type { Transport } from './metadata'; -import type { Bus } from './bus'; -import { buildSecurityHeaders, mergeVary, resolveCors, corsPreflightHeaders } from './security'; -import type { TlsOptions, SecurityOptions, CorsOptions } from './security'; -import { parseMultipart, extractBoundary, collapseDuplicates } from './multipart'; - -export interface RequestLimits { - maxBodyBytes?: number; // default 1_000_000 - requestTimeoutMs?: number; // default 30_000 - headersTimeoutMs?: number; // default 10_000 - keepAliveTimeoutMs?: number; // default 5_000 - maxParts?: number; // default 1000 -} -export interface HttpOptions { limits?: RequestLimits; streams?: Set<() => void>; tls?: TlsOptions; trustProxy?: boolean; security?: boolean | SecurityOptions; cors?: CorsOptions; bodyDuplicates?: 'array' | 'last' } - -export type RouteHandler = (req: { - method: string; url: string; - headers: Record; - params: Record; - query: Record; - body: unknown; - protocol: 'http' | 'https'; - ip: string; -}) => Promise; - -export interface RouteDef { method: string; pattern: string; transport: Transport; handler: RouteHandler; bodyDuplicates?: 'array' | 'last' } -export interface MatchedRoute { params: Record; def: RouteDef } - -export interface WsOpenCtx { - params: Record; - inbound: AsyncIterable; - abort: AbortSignal; - req: http.IncomingMessage; -} -export interface WsRouteDef { pattern: string; open: (ctx: WsOpenCtx) => Promise> } - -export interface MeshControl { path: string; handle(ws: any, req: http.IncomingMessage): void } - -const PING_MS = 15_000; - -export function matchPattern(pattern: string, path: string): Record | undefined { - const segs = path.split('/').filter(Boolean); - const pat = pattern.split('/').filter(Boolean); - if (pat.length !== segs.length) return undefined; - const params: Record = {}; - for (let i = 0; i < pat.length; i++) { - if (pat[i].startsWith(':')) params[pat[i].slice(1)] = decodeURIComponent(segs[i]); - else if (pat[i] !== segs[i]) return undefined; - } - return params; -} - -export function matchRoute(routes: RouteDef[], method: string, path: string): MatchedRoute | undefined { - for (const r of routes) { - if (r.method !== method) continue; - const params = matchPattern(r.pattern, path); - if (params) return { params, def: r }; - } - return undefined; -} - -export function parseQuery(url: string): Record { - const qs = url.split('?')[1] ?? ''; - const out: Record = {}; - for (const [k, v] of new URLSearchParams(qs)) out[k] = v; - return out; -} - -async function readBody(req: http.IncomingMessage, maxBodyBytes: number): Promise { - const chunks: Buffer[] = []; - let total = 0; - for await (const chunk of req) { - total += (chunk as Buffer).length; - if (total > maxBodyBytes) throw new HttpError(413, 'Payload Too Large'); - chunks.push(chunk as Buffer); - } - return chunks.length === 0 ? undefined : Buffer.concat(chunks); -} - -function firstToken(v: string | string[] | undefined): string | undefined { - const s = Array.isArray(v) ? v[0] : v; - return s?.split(',')[0].trim(); -} -function deriveSecure(req: http.IncomingMessage, trustProxy: boolean): boolean { - if (trustProxy) { const p = firstToken(req.headers['x-forwarded-proto']); if (p) return p === 'https'; } - return (req.socket as any).encrypted === true; -} -function deriveIp(req: http.IncomingMessage, trustProxy: boolean): string { - if (trustProxy) { const f = firstToken(req.headers['x-forwarded-for']); if (f) return f; } - return req.socket.remoteAddress ?? ''; -} - -function pickEncoder(transport: Transport, accept: string): StreamEncoder { - if (transport === 'sse') return sseEncoder; - if (transport === 'ndjson') return ndjsonEncoder; - return accept.includes('text/event-stream') ? sseEncoder : ndjsonEncoder; -} - -async function pipeStream( - res: http.ServerResponse, stream: AsyncIterable, encoder: StreamEncoder, - bus?: Bus, name = '', streams?: Set<() => void>, -): Promise { - res.writeHead(200, encoder.headers); - res.flushHeaders(); // establish the stream immediately so idle-until-event sources (e.g. subscriptions) don't deadlock clients awaiting headers - bus?.emit('stream:open', { name }); - const it = stream[Symbol.asyncIterator](); - let ping: ReturnType | undefined; - if (encoder.ping) { ping = setInterval(() => res.write(encoder.ping!()), PING_MS); ping.unref?.(); } - const stop = () => { if (ping) clearInterval(ping); void Promise.resolve(it.return?.()).catch(() => {}); }; - res.on('close', stop); - const closer = () => { try { res.destroy(); } catch { /* */ } }; - streams?.add(closer); - const onClose = once(res, 'close'); - try { - while (true) { - const { value, done } = await it.next(); - if (done) break; - if (!res.write(encoder.encode(value))) { - await Promise.race([once(res, 'drain'), onClose]); - if (res.destroyed) break; // let finally clean up - } - } - } catch (err) { - bus?.emit('stream:error', { name, error: err }); - const frame = encoder.encodeError(err); - if (frame && !res.writableEnded) res.write(frame); - } finally { - if (ping) clearInterval(ping); - streams?.delete(closer); - if (!res.writableEnded && !res.destroyed) res.end(); - bus?.emit('stream:close', { name }); - } -} - -function loadWss(): any | null { - try { return require('ws').WebSocketServer; } catch { return null; } -} - -function attachWs( - server: http.Server, wsRoutes: WsRouteDef[], bus?: Bus, meshControl?: MeshControl, streams?: Set<() => void>, -): void { - if (wsRoutes.length === 0 && !meshControl) return; - const WSS = loadWss(); - const wss = WSS ? new WSS({ noServer: true }) : null; - server.on('upgrade', (req, socket, head) => { - const path = (req.url ?? '/').split('?')[0]; - if (meshControl && path === meshControl.path) { - if (!wss) { socket.write('HTTP/1.1 501 Not Implemented\r\n\r\n'); socket.destroy(); return; } - wss.handleUpgrade(req, socket, head, (ws: any) => meshControl.handle(ws, req)); - return; - } - const route = wsRoutes.map((r) => ({ r, params: matchPattern(r.pattern, path) })).find((x) => x.params); - if (!route) { socket.destroy(); return; } - if (!wss) { socket.write('HTTP/1.1 501 Not Implemented\r\n\r\n'); socket.destroy(); return; } - wss.handleUpgrade(req, socket, head, async (ws: any) => { - const closer = () => { try { (ws.terminate ?? ws.close).call(ws); } catch { /* */ } }; - streams?.add(closer); - ws.on('close', () => streams?.delete(closer)); - const inbound = channel(); - const ac = new AbortController(); - ws.on('message', (d: Buffer) => inbound.push(d.toString())); - ws.on('close', () => { inbound.close(); ac.abort(); }); - ws.on('error', (e: unknown) => inbound.fail(e)); - - const name = route.r.pattern; - let it: AsyncIterator | undefined; - ws.on('close', () => { void Promise.resolve(it?.return?.()).catch(() => {}); }); // force-cancel outbound - bus?.emit('stream:open', { name }); - try { - const out = await route.r.open({ params: route.params!, inbound, abort: ac.signal, req }); - it = out[Symbol.asyncIterator](); - while (true) { - const { value, done } = await it.next(); - if (done) break; - if (ws.readyState !== 1) break; // 1 = OPEN; stop if socket gone - ws.send(typeof value === 'string' ? value : JSON.stringify(value)); - } - try { ws.close(); } catch { /* already closed */ } - } catch (err) { - bus?.emit('stream:error', { name, error: err }); - if (isHttpError(err)) { - const reason = Buffer.from(String(err.message)).subarray(0, 120).toString(); - try { ws.close(4000 + err.status, reason); } catch { /* already closed */ } - } else { - try { ws.close(1011); } catch { /* already closed */ } - } - } finally { - ac.abort(); - bus?.emit('stream:close', { name }); - } - }); - }); -} - -export function createHttpServer( - routes: RouteDef[], wsRoutes: WsRouteDef[] = [], bus?: Bus, meshControl?: MeshControl, opts?: HttpOptions, -): http.Server { - const maxBody = opts?.limits?.maxBodyBytes ?? 1_000_000; - const trustProxy = opts?.trustProxy ?? false; - const handler = async (req: http.IncomingMessage, res: http.ServerResponse): Promise => { - const url = req.url ?? '/'; - const path = url.split('?')[0]; - // Install the security-header patch BEFORE any routing/response so every path - // (200, 404, error, stream) writes headers through the same patched writeHead. - const secure = deriveSecure(req, trustProxy); - const injected: Record = { ...buildSecurityHeaders(opts?.security ?? true, secure) }; - const orig = res.writeHead.bind(res); - (res as any).writeHead = (status: number, arg2?: any, arg3?: any) => { - // normalize (statusMessage?, headers?) overloads - const hdrs = (typeof arg2 === 'string' ? arg3 : arg2) as Record | undefined; - // injected (security/CORS) is authoritative. Node's writeHead does NOT dedupe case-variant - // keys — both lines would ship and a browser honors the first — so drop any handler header - // whose name case-insensitively collides with an injected one before merging. - const merged: Record = {}; - const injectedLower = new Set(Object.keys(injected).map((k) => k.toLowerCase())); - let handlerVary: string | undefined; - if (hdrs) for (const k of Object.keys(hdrs)) { - const lk = k.toLowerCase(); - if (lk === 'vary') { handlerVary = hdrs[k]; continue; } // merged separately below - if (!injectedLower.has(lk)) merged[k] = hdrs[k]; - } - Object.assign(merged, injected); - if (injected['vary']) merged['vary'] = mergeVary(handlerVary, injected['vary']); - else if (handlerVary !== undefined) merged['vary'] = handlerVary; // preserve handler Vary when no CORS - return typeof arg2 === 'string' ? orig(status, arg2, merged) : orig(status, merged); - }; - // CORS is added to `injected` AFTER the patch is installed — the patch reads it lazily - // by reference at writeHead time, so keys added here still land on every response. - if (opts?.cors) Object.assign(injected, resolveCors(opts.cors, req)); - if (opts?.cors && req.method === 'OPTIONS' && req.headers['access-control-request-method']) { - const pf = corsPreflightHeaders(opts.cors, req); - res.writeHead(204, pf); - res.end(); - return; - } - const matched = matchRoute(routes, req.method ?? 'GET', path); - if (!matched) { - res.writeHead(404, { 'content-type': 'application/json' }); - res.end(JSON.stringify({ error: 'Not Found' })); - return; - } - let buf: Buffer | undefined; - try { - buf = await readBody(req, maxBody); - } catch (error) { - const r = errorToResponse(error); - res.writeHead(r.status, { ...r.headers, connection: 'close' }); - res.end(r.body); - return; - } - let body: unknown; - const ct = String(req.headers['content-type'] ?? ''); - const duplicates = matched.def.bodyDuplicates ?? opts?.bodyDuplicates ?? 'last'; - if (buf !== undefined && ct.includes('application/json')) { - try { body = JSON.parse(buf.toString('utf8')); } - catch { - res.writeHead(400, { 'content-type': 'application/json' }); - res.end(JSON.stringify({ error: 'Invalid JSON body' })); - return; - } - } else if (buf !== undefined && ct.includes('application/x-www-form-urlencoded')) { - body = collapseDuplicates(new URLSearchParams(buf.toString('utf8')), duplicates); - } else if (buf !== undefined && ct.includes('multipart/form-data')) { - const boundary = extractBoundary(ct); - if (!boundary) { - res.writeHead(400, { 'content-type': 'application/json' }); - res.end(JSON.stringify({ error: 'Invalid multipart body' })); - return; - } - try { body = parseMultipart(buf, boundary, { maxParts: opts?.limits?.maxParts ?? 1000, duplicates }); } - catch { - res.writeHead(400, { 'content-type': 'application/json' }); - res.end(JSON.stringify({ error: 'Invalid multipart body' })); - return; - } - } else { - const s = buf?.toString('utf8'); - body = s === '' ? undefined : s; - } - let result: PipelineResult; - try { - result = await matched.def.handler({ - method: req.method ?? 'GET', url, headers: req.headers, - params: matched.params, query: parseQuery(url), body, - protocol: secure ? 'https' : 'http', ip: deriveIp(req, trustProxy), - }); - } catch (error) { - result = errorToResponse(error); - } - if (isStreamResult(result)) { - const encoder = pickEncoder(matched.def.transport, String(req.headers.accept ?? '')); - await pipeStream(res, result.stream, encoder, bus, matched.def.pattern, opts?.streams); - return; - } - const r: ResponseShape = result; - res.writeHead(r.status, r.headers); - res.end(r.body); - }; - // runtime-compatible; only @types differ (https.Server lacks the http-only timeout props) - const server: http.Server = (opts?.tls - ? https.createServer(opts.tls as https.ServerOptions, handler) - : http.createServer(handler)) as unknown as http.Server; - server.requestTimeout = opts?.limits?.requestTimeoutMs ?? 30_000; - server.headersTimeout = opts?.limits?.headersTimeoutMs ?? 10_000; - server.keepAliveTimeout = opts?.limits?.keepAliveTimeoutMs ?? 5_000; - attachWs(server, wsRoutes, bus, meshControl, opts?.streams); - return server; -} diff --git a/src/http/index.ts b/src/http/index.ts new file mode 100644 index 0000000..afea4d6 --- /dev/null +++ b/src/http/index.ts @@ -0,0 +1,14 @@ +// Public surface of the HTTP module. Internal helpers (request parsing, streaming, +// ws upgrade) live in sibling files and are composed by ./server. +export type { + RequestLimits, + HttpOptions, + RouteHandler, + RouteDef, + MatchedRoute, + WsOpenCtx, + WsRouteDef, + MeshControl, +} from './types'; +export { matchPattern, matchRoute, parseQuery } from './router'; +export { createHttpServer } from './server'; diff --git a/src/http/request.ts b/src/http/request.ts new file mode 100644 index 0000000..2eef0cd --- /dev/null +++ b/src/http/request.ts @@ -0,0 +1,42 @@ +import http from 'http'; +import { HttpError } from '../signals'; + +/** Reads the full request body, enforcing the max-bytes ceiling (throws 413 if exceeded). */ +export async function readBody(req: http.IncomingMessage, maxBodyBytes: number): Promise { + const chunks: Buffer[] = []; + let total = 0; + + for await (const chunk of req) { + total += (chunk as Buffer).length; + if (total > maxBodyBytes) throw new HttpError(413, 'Payload Too Large'); + chunks.push(chunk as Buffer); + } + + return chunks.length === 0 ? undefined : Buffer.concat(chunks); +} + +/** Returns the first comma-separated token of a header value (handles array-valued headers). */ +function firstToken(value: string | string[] | undefined): string | undefined { + const first = Array.isArray(value) ? value[0] : value; + return first?.split(',')[0].trim(); +} + +/** Determines whether the request arrived over HTTPS, honoring `x-forwarded-proto` when proxy is trusted. */ +export function deriveSecure(req: http.IncomingMessage, trustProxy: boolean): boolean { + if (trustProxy) { + const proto = firstToken(req.headers['x-forwarded-proto']); + if (proto) return proto === 'https'; + } + + return (req.socket as any).encrypted === true; +} + +/** Resolves the client IP, honoring `x-forwarded-for` when proxy is trusted. */ +export function deriveIp(req: http.IncomingMessage, trustProxy: boolean): string { + if (trustProxy) { + const forwarded = firstToken(req.headers['x-forwarded-for']); + if (forwarded) return forwarded; + } + + return req.socket.remoteAddress ?? ''; +} diff --git a/src/http/router.ts b/src/http/router.ts new file mode 100644 index 0000000..6b7aedf --- /dev/null +++ b/src/http/router.ts @@ -0,0 +1,92 @@ +import type { RouteDef, MatchedRoute } from './types'; + +/** + * Matches a route pattern against a request path. Supports static segments, `:param` (one segment), + * and a trailing `:name*` catch-all that captures the rest of the path (slashes included) into `params.name`. + * @returns Extracted params (decoded) when the path matches, otherwise undefined. + */ +export function matchPattern(pattern: string, path: string): Record | undefined { + const pathSegs = path.split('/').filter(Boolean); + const patternSegs = pattern.split('/').filter(Boolean); + const params: Record = {}; + + for (let i = 0; i < patternSegs.length; i++) { + const seg = patternSegs[i]; + + // Trailing catch-all: capture every remaining segment (possibly none) as one decoded value. + if (seg.startsWith(':') && seg.endsWith('*')) { + params[seg.slice(1, -1)] = pathSegs.slice(i).map(decodeURIComponent).join('/'); + return params; + } + + if (i >= pathSegs.length) return undefined; // pattern longer than path + + if (seg.startsWith(':')) params[seg.slice(1)] = decodeURIComponent(pathSegs[i]); + else if (seg !== pathSegs[i]) return undefined; + } + + // No catch-all consumed the tail, so the lengths must match exactly. + return patternSegs.length === pathSegs.length ? params : undefined; +} + +/** Splits a pattern into its fixed-prefix segment kinds (2 = static, 1 = param) and whether it ends in a catch-all. */ +function segScores(pattern: string): { catchAll: boolean; kinds: number[] } { + const kinds: number[] = []; + + for (const seg of pattern.split('/').filter(Boolean)) { + if (seg.startsWith(':') && seg.endsWith('*')) return { catchAll: true, kinds }; + kinds.push(seg.startsWith(':') ? 1 : 2); + } + + return { catchAll: false, kinds }; +} + +/** Orders two matching patterns by specificity: exact beats catch-all, then static beats param, then longer wins. */ +function moreSpecific(a: string, b: string): number { + const scoreA = segScores(a); + const scoreB = segScores(b); + if (scoreA.catchAll !== scoreB.catchAll) return scoreA.catchAll ? -1 : 1; + const length = Math.max(scoreA.kinds.length, scoreB.kinds.length); + + for (let i = 0; i < length; i++) { + const kindA = scoreA.kinds[i] ?? -1; + const kindB = scoreB.kinds[i] ?? -1; + if (kindA !== kindB) return kindA - kindB; + } + + return 0; +} + +/** Finds the most specific route matching both method and path (static > param > catch-all; ties keep registration order). */ +export function matchRoute(routes: RouteDef[], method: string, path: string): MatchedRoute | undefined { + let best: MatchedRoute | undefined; + let bestPattern = ''; + + for (const route of routes) { + if (route.method !== method) continue; + const params = matchPattern(route.pattern, path); + if (!params) continue; + + if (!best || moreSpecific(route.pattern, bestPattern) > 0) { + best = { params, def: route }; + bestPattern = route.pattern; + } + } + + return best; +} + +/** Lists the distinct HTTP methods whose pattern matches the path — used to build a 405 `Allow` header. */ +export function allowedMethods(routes: RouteDef[], path: string): string[] { + const methods = new Set(); + for (const route of routes) if (matchPattern(route.pattern, path)) methods.add(route.method); + return [...methods]; +} + +/** Parses a URL's query string into a flat string map (last value wins for repeated keys). */ +export function parseQuery(url: string): Record { + const queryString = url.split('?')[1] ?? ''; + const out: Record = {}; + for (const [key, value] of new URLSearchParams(queryString)) out[key] = value; + return out; +} diff --git a/src/http/server.ts b/src/http/server.ts new file mode 100644 index 0000000..eb3a327 --- /dev/null +++ b/src/http/server.ts @@ -0,0 +1,242 @@ +import http from 'http'; +import https from 'https'; +import { errorToResponse } from '../transformers'; +import { isHttpError } from '../signals'; +import { isStreamResult, type PipelineResult, type ResponseShape } from '../pipeline'; +import type { Bus } from '../bus'; +import { buildSecurityHeaders, mergeVary, resolveCors, corsPreflightHeaders } from '../security'; +import { parseMultipart, extractBoundary, collapseDuplicates } from '../multipart'; +import { matchRoute, allowedMethods, parseQuery } from './router'; +import { readBody, deriveSecure, deriveIp } from './request'; +import { pickEncoder, pipeStream } from './stream'; +import { attachWs } from './ws'; +import type { RouteDef, WsRouteDef, MatchedRoute, MeshControl, HttpOptions } from './types'; + +interface HandlerConfig { + routes: RouteDef[]; + bus?: Bus; + opts?: HttpOptions; + maxBody: number; + trustProxy: boolean; +} + +/** A ready-to-send error response produced while acquiring the request body. */ +type BodyFailure = { fail: { status: number; headers: Record; body: string } }; + +/** + * Builds an HTTP/HTTPS server that routes requests, parses bodies, streams results, and handles WebSocket upgrades. + * @param routes HTTP route definitions. + * @param wsRoutes WebSocket route definitions (requires the optional `ws` peer dependency). + * @param bus Optional event bus for stream lifecycle events. + * @param meshControl Optional mesh gateway hook for a reserved upgrade path. + * @param opts Limits, TLS, security, CORS, and body-parsing options. + */ +export function createHttpServer( + routes: RouteDef[], + wsRoutes: WsRouteDef[] = [], + bus?: Bus, + meshControl?: MeshControl, + opts?: HttpOptions, +): http.Server { + const maxBody = opts?.limits?.maxBodyBytes ?? 1_000_000; + const trustProxy = opts?.trustProxy ?? false; + const handler = createRequestHandler({ routes, bus, opts, maxBody, trustProxy }); + + // runtime-compatible; only @types differ (https.Server lacks the http-only timeout props) + const server: http.Server = (opts?.tls + ? https.createServer(opts.tls as https.ServerOptions, handler) + : http.createServer(handler)) as unknown as http.Server; + server.requestTimeout = opts?.limits?.requestTimeoutMs ?? 30_000; + server.headersTimeout = opts?.limits?.headersTimeoutMs ?? 10_000; + server.keepAliveTimeout = opts?.limits?.keepAliveTimeoutMs ?? 5_000; + attachWs(server, wsRoutes, bus, meshControl, opts?.streams); + return server; +} + +/** Builds the request listener: security/CORS headers, routing, body parsing, then buffered or streamed response. */ +function createRequestHandler(cfg: HandlerConfig) { + const { routes, bus, opts, maxBody, trustProxy } = cfg; + + return async (req: http.IncomingMessage, res: http.ServerResponse): Promise => { + const url = req.url ?? '/'; + const path = url.split('?')[0]; + // Install the security-header patch BEFORE any routing/response so every path + // (200, 404, error, stream) writes headers through the same patched writeHead. + const secure = deriveSecure(req, trustProxy); + const injected: Record = { ...buildSecurityHeaders(opts?.security ?? true, secure) }; + patchResponseHeaders(res, injected); + + // CORS is added to `injected` AFTER the patch is installed — the patch reads it lazily + // by reference at writeHead time, so keys added here still land on every response. + if (opts?.cors) Object.assign(injected, resolveCors(opts.cors, req)); + + if (opts?.cors && req.method === 'OPTIONS' && req.headers['access-control-request-method']) { + res.writeHead(204, corsPreflightHeaders(opts.cors, req)); + res.end(); + return; + } + + const matched = matchRoute(routes, req.method ?? 'GET', path); + + if (!matched) { + // Path matches a route under a different method → 405 with Allow; otherwise 404. + const allow = allowedMethods(routes, path); + + if (allow.length) { + res.writeHead(405, { 'content-type': 'application/json', allow: allow.join(', ') }); + res.end(JSON.stringify({ error: 'Method Not Allowed' })); + return; + } + + res.writeHead(404, { 'content-type': 'application/json' }); + res.end(JSON.stringify({ error: 'Not Found' })); + return; + } + + const acquired = await acquireBody(req, matched, opts, maxBody); + + if ('fail' in acquired) { + res.writeHead(acquired.fail.status, acquired.fail.headers); + res.end(acquired.fail.body); + return; + } + + let result: PipelineResult; + + try { + result = await matched.def.handler({ + method: req.method ?? 'GET', + url, + headers: req.headers, + params: matched.params, + query: parseQuery(url), + body: acquired.body, + protocol: secure ? 'https' : 'http', + ip: deriveIp(req, trustProxy), + }); + } catch (error) { + result = errorToResponse(error); + } + + if (isStreamResult(result)) { + const encoder = pickEncoder(matched.def.transport, String(req.headers.accept ?? '')); + await pipeStream(res, result.stream, encoder, bus, matched.def.pattern, opts?.streams); + return; + } + + const response: ResponseShape = result; + res.writeHead(response.status, response.headers); + res.end(response.body); + }; +} + +/** Reads and parses the request body, returning `{ body }` or a ready-to-send `{ fail }` error response. */ +async function acquireBody( + req: http.IncomingMessage, + matched: MatchedRoute, + opts: HttpOptions | undefined, + maxBody: number, +): Promise<{ body: unknown } | BodyFailure> { + let buf: Buffer | undefined; + + try { + buf = await readBody(req, maxBody); + } catch (error) { + const response = errorToResponse(error); + return { + fail: { status: response.status, headers: { ...response.headers, connection: 'close' }, body: response.body }, + }; + } + + const contentType = String(req.headers['content-type'] ?? ''); + const duplicates = matched.def.bodyDuplicates ?? opts?.bodyDuplicates ?? 'last'; + const parsed = await parseRequestBody(buf, contentType, duplicates, opts?.limits?.maxParts ?? 1000); + + if ('error' in parsed) { + return { + fail: { + status: parsed.status ?? 400, + headers: { 'content-type': 'application/json' }, + body: JSON.stringify({ error: parsed.error }), + }, + }; + } + + return { body: parsed.body }; +} + +/** + * Monkey-patches `res.writeHead` so injected (security/CORS) headers are authoritative on every response. + * Handler headers that case-insensitively collide with an injected key are dropped; `Vary` is merged. + * Reads `injected` by reference, so CORS keys added after installation still land. + */ +function patchResponseHeaders(res: http.ServerResponse, injected: Record): void { + const origWriteHead = res.writeHead.bind(res); + + (res as any).writeHead = (status: number, arg2?: any, arg3?: any) => { + // normalize (statusMessage?, headers?) overloads + const handlerHeaders = (typeof arg2 === 'string' ? arg3 : arg2) as Record | undefined; + const merged: Record = {}; + const injectedLower = new Set(Object.keys(injected).map((key) => key.toLowerCase())); + let handlerVary: string | undefined; + + if (handlerHeaders) + for (const key of Object.keys(handlerHeaders)) { + const lowerKey = key.toLowerCase(); + + if (lowerKey === 'vary') { + handlerVary = handlerHeaders[key]; + continue; + } // merged separately below + + if (!injectedLower.has(lowerKey)) merged[key] = handlerHeaders[key]; + } + + Object.assign(merged, injected); + if (injected['vary']) merged['vary'] = mergeVary(handlerVary, injected['vary']); + else if (handlerVary !== undefined) merged['vary'] = handlerVary; // preserve handler Vary when no CORS + return typeof arg2 === 'string' ? origWriteHead(status, arg2, merged) : origWriteHead(status, merged); + }; +} + +/** Parse outcome: the decoded body, or an error message plus the status to send (400 unless set). */ +type ParseResult = { body: unknown } | { error: string; status?: number }; + +/** + * Parses a raw request body by content type (JSON, urlencoded, multipart, or plain text). + * @returns `{ body }` on success, or `{ error, status? }` on malformed input / missing multipart support. + */ +async function parseRequestBody( + buf: Buffer | undefined, + contentType: string, + duplicates: 'array' | 'last', + maxParts: number, +): Promise { + if (buf !== undefined && contentType.includes('application/json')) { + try { + return { body: JSON.parse(buf.toString('utf8')) }; + } catch { + return { error: 'Invalid JSON body' }; + } + } + + if (buf !== undefined && contentType.includes('application/x-www-form-urlencoded')) { + return { body: collapseDuplicates(new URLSearchParams(buf.toString('utf8')), duplicates) }; + } + + if (buf !== undefined && contentType.includes('multipart/form-data')) { + const boundary = extractBoundary(contentType); + if (!boundary) return { error: 'Invalid multipart body' }; + + try { + return { body: await parseMultipart(buf, boundary, { maxParts, duplicates }) }; + } catch (error) { + // HttpError = the busboy peer dep is missing (501); anything else = malformed input (400). + if (isHttpError(error)) return { error: error.message, status: error.status }; + return { error: 'Invalid multipart body' }; + } + } + + const text = buf?.toString('utf8'); + return { body: text === '' ? undefined : text }; +} diff --git a/src/http/stream.ts b/src/http/stream.ts new file mode 100644 index 0000000..1239459 --- /dev/null +++ b/src/http/stream.ts @@ -0,0 +1,74 @@ +import http from 'http'; +import { once } from 'events'; +import { sseEncoder, ndjsonEncoder, StreamEncoder } from '../encoders'; +import type { Transport } from '../metadata'; +import type { Bus } from '../bus'; + +const PING_MS = 15_000; + +/** Selects the stream encoder for a transport, falling back to the client's `Accept` header for `stream`. */ +export function pickEncoder(transport: Transport, accept: string): StreamEncoder { + if (transport === 'sse') return sseEncoder; + if (transport === 'ndjson') return ndjsonEncoder; + return accept.includes('text/event-stream') ? sseEncoder : ndjsonEncoder; +} + +/** Pipes an async-iterable result to the response as an HTTP stream, with keep-alive pings and backpressure handling. */ +export async function pipeStream( + res: http.ServerResponse, + stream: AsyncIterable, + encoder: StreamEncoder, + bus?: Bus, + name = '', + streams?: Set<() => void>, +): Promise { + res.writeHead(200, encoder.headers); + res.flushHeaders(); // establish the stream immediately so idle-until-event sources (e.g. subscriptions) don't deadlock clients awaiting headers + bus?.emit('stream:open', { name }); + const iterator = stream[Symbol.asyncIterator](); + let ping: ReturnType | undefined; + + if (encoder.ping) { + ping = setInterval(() => res.write(encoder.ping!()), PING_MS); + ping.unref?.(); + } + + const stop = () => { + if (ping) clearInterval(ping); + void Promise.resolve(iterator.return?.()).catch(() => {}); + }; + + res.on('close', stop); + + const closer = () => { + try { + res.destroy(); + } catch { + /* */ + } + }; + + streams?.add(closer); + const onClose = once(res, 'close'); + + try { + while (true) { + const { value, done } = await iterator.next(); + if (done) break; + + if (!res.write(encoder.encode(value))) { + await Promise.race([once(res, 'drain'), onClose]); + if (res.destroyed) break; // let finally clean up + } + } + } catch (err) { + bus?.emit('stream:error', { name, error: err }); + const frame = encoder.encodeError(err); + if (frame && !res.writableEnded) res.write(frame); + } finally { + if (ping) clearInterval(ping); + streams?.delete(closer); + if (!res.writableEnded && !res.destroyed) res.end(); + bus?.emit('stream:close', { name }); + } +} diff --git a/src/http/types.ts b/src/http/types.ts new file mode 100644 index 0000000..2afa1a0 --- /dev/null +++ b/src/http/types.ts @@ -0,0 +1,71 @@ +import http from 'http'; +import type { Transport } from '../metadata'; +import type { PipelineResult } from '../pipeline'; +import type { TlsOptions, SecurityOptions, CorsOptions } from '../security'; + +/** Per-request size and timeout ceilings applied by the server. */ +export interface RequestLimits { + maxBodyBytes?: number; // default 1_000_000 + requestTimeoutMs?: number; // default 30_000 + headersTimeoutMs?: number; // default 10_000 + keepAliveTimeoutMs?: number; // default 5_000 + maxParts?: number; // default 1000 +} + +/** Options controlling server construction: limits, TLS, proxy trust, security headers, CORS, and body parsing. */ +export interface HttpOptions { + limits?: RequestLimits; + streams?: Set<() => void>; + tls?: TlsOptions; + trustProxy?: boolean; + security?: boolean | SecurityOptions; + cors?: CorsOptions; + bodyDuplicates?: 'array' | 'last'; +} + +/** Handler for a matched HTTP route; receives a normalized request and resolves to a pipeline result. */ +export type RouteHandler = (req: { + method: string; + url: string; + headers: Record; + params: Record; + query: Record; + body: unknown; + protocol: 'http' | 'https'; + ip: string; +}) => Promise; + +/** A registered HTTP route: method, path pattern, streaming transport, and handler. */ +export interface RouteDef { + method: string; + pattern: string; + transport: Transport; + handler: RouteHandler; + bodyDuplicates?: 'array' | 'last'; +} + +/** Result of matching a request path against a route: extracted params plus the matched definition. */ +export interface MatchedRoute { + params: Record; + def: RouteDef; +} + +/** Context passed to a WebSocket route's `open`: path params, inbound message stream, abort signal, and raw request. */ +export interface WsOpenCtx { + params: Record; + inbound: AsyncIterable; + abort: AbortSignal; + req: http.IncomingMessage; +} + +/** A registered WebSocket route: path pattern and an `open` that returns the outbound message stream. */ +export interface WsRouteDef { + pattern: string; + open: (ctx: WsOpenCtx) => Promise>; +} + +/** Hook for a mesh gateway to take over WebSocket upgrades on a fixed path. */ +export interface MeshControl { + path: string; + handle(ws: any, req: http.IncomingMessage): void; +} diff --git a/src/http/ws.ts b/src/http/ws.ts new file mode 100644 index 0000000..a2736fe --- /dev/null +++ b/src/http/ws.ts @@ -0,0 +1,180 @@ +import http from 'http'; +import { channel } from '../channel'; +import { isHttpError } from '../signals'; +import type { Bus } from '../bus'; +import { matchPattern } from './router'; +import type { WsRouteDef, MeshControl } from './types'; + +/** Lazily loads the optional `ws` peer dependency's `WebSocketServer`, or null when it is not installed. */ +function loadWss(): any | null { + try { + // `ws` is an OPTIONAL peer dependency: lazy-required so installs without WebSocket + // support don't fail. When absent this throws and we fall back to null (501 on upgrade). + // eslint-disable-next-line @typescript-eslint/no-require-imports + return require('ws').WebSocketServer; + } catch { + return null; + } +} + +/** Writes a 501 Not Implemented status to the raw socket and destroys it. */ +function reject501(socket: any): void { + socket.write('HTTP/1.1 501 Not Implemented\r\n\r\n'); + socket.destroy(); +} + +/** Handles the mesh-control upgrade path; returns true when the request was for the mesh control endpoint. */ +function handleMeshUpgrade( + wss: any, + meshControl: MeshControl, + path: string, + req: http.IncomingMessage, + socket: any, + head: Buffer, +): boolean { + if (path !== meshControl.path) return false; + + if (!wss) { + reject501(socket); + return true; + } + + wss.handleUpgrade(req, socket, head, (ws: any) => meshControl.handle(ws, req)); + return true; +} + +/** Finds the first ws route whose pattern matches `path`, capturing its params. */ +function matchWsRoute( + wsRoutes: WsRouteDef[], + path: string, +): { def: WsRouteDef; params: Record | undefined } | undefined { + return wsRoutes + .map((candidate) => ({ def: candidate, params: matchPattern(candidate.pattern, path) })) + .find((entry) => entry.params); +} + +/** Wires inbound message/close/error events into a channel and returns the channel plus its abort controller. */ +function wireInbound(ws: any): { inbound: ReturnType>; abortController: AbortController } { + const inbound = channel(); + const abortController = new AbortController(); + ws.on('message', (data: Buffer) => inbound.push(data.toString())); + ws.on('close', () => { + inbound.close(); + abortController.abort(); + }); + ws.on('error', (err: unknown) => inbound.fail(err)); + + return { inbound, abortController }; +} + +/** Registers the connection with the stream registry so it can be force-closed on shutdown. */ +function trackConnection(ws: any, streams?: Set<() => void>): void { + const closer = () => { + try { + (ws.terminate ?? ws.close).call(ws); + } catch { + /* */ + } + }; + + streams?.add(closer); + ws.on('close', () => streams?.delete(closer)); +} + +/** Drives the outbound async iterator, sending each yielded value over the socket until done or closed. */ +async function pumpOutbound(ws: any, iterator: AsyncIterator): Promise { + while (true) { + const { value, done } = await iterator.next(); + if (done) break; + if (ws.readyState !== 1) break; // 1 = OPEN; stop if socket gone + ws.send(typeof value === 'string' ? value : JSON.stringify(value)); + } + + try { + ws.close(); + } catch { + /* already closed */ + } +} + +/** Closes the socket with the appropriate code after an outbound error (4000+status for HTTP errors, 1011 otherwise). */ +function closeOnError(ws: any, err: unknown): void { + if (isHttpError(err)) { + const reason = Buffer.from(String(err.message)).subarray(0, 120).toString(); + + try { + ws.close(4000 + err.status, reason); + } catch { + /* already closed */ + } + } else { + try { + ws.close(1011); + } catch { + /* already closed */ + } + } +} + +/** Runs the full per-connection lifecycle: inbound wiring, opening the route stream, and pumping outbound values. */ +async function openWsConnection( + ws: any, + route: { def: WsRouteDef; params: Record | undefined }, + req: http.IncomingMessage, + bus?: Bus, + streams?: Set<() => void>, +): Promise { + trackConnection(ws, streams); + const { inbound, abortController } = wireInbound(ws); + + const name = route.def.pattern; + let iterator: AsyncIterator | undefined; + ws.on('close', () => { + void Promise.resolve(iterator?.return?.()).catch(() => {}); + }); // force-cancel outbound + bus?.emit('stream:open', { name }); + + try { + const outbound = await route.def.open({ params: route.params!, inbound, abort: abortController.signal, req }); + iterator = outbound[Symbol.asyncIterator](); + await pumpOutbound(ws, iterator); + } catch (err) { + bus?.emit('stream:error', { name, error: err }); + closeOnError(ws, err); + } finally { + abortController.abort(); + bus?.emit('stream:close', { name }); + } +} + +/** Attaches WebSocket upgrade handling to the server: routes to `wsRoutes` or a mesh control path. */ +export function attachWs( + server: http.Server, + wsRoutes: WsRouteDef[], + bus?: Bus, + meshControl?: MeshControl, + streams?: Set<() => void>, +): void { + if (wsRoutes.length === 0 && !meshControl) return; + const WebSocketServer = loadWss(); + const wss = WebSocketServer ? new WebSocketServer({ noServer: true }) : null; + server.on('upgrade', (req, socket, head) => { + const path = (req.url ?? '/').split('?')[0]; + + if (meshControl && handleMeshUpgrade(wss, meshControl, path, req, socket, head)) return; + + const route = matchWsRoute(wsRoutes, path); + + if (!route) { + socket.destroy(); + return; + } + + if (!wss) { + reject501(socket); + return; + } + + wss.handleUpgrade(req, socket, head, (ws: any) => openWsConnection(ws, route, req, bus, streams)); + }); +} diff --git a/src/index.ts b/src/index.ts index b7e7be5..162f748 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,32 +1,53 @@ +/** + * @green-tea/core — a decorator-driven, type-safe HTTP framework. + * Public API barrel: application bootstrap, routing/DI decorators, streaming, + * request validation, security helpers, and the cross-server mesh. + */ import 'reflect-metadata'; -export const VERSION = '0.0.0'; +/** Package version, replaced at publish time. */ +export const VERSION = '26.07.0-beta.0'; + +// Application export { createApp } from './app'; -export type { App, InspectLine, Explain } from './app'; +export type { App, InspectLine, Explain, MeshConfig } from './app'; + +// Graph visualization export { toMermaid, toDOT } from './graph-viz'; export type { GraphView } from './graph-viz'; -export { Provider, Step, Route, Get, Module, Transformer } from './metadata'; + +// Routing & decorators +export { Provider, Step, Route, Get, Module, Transformer, Sse, Ws, Stream, Post, Put, Patch, Delete } from './metadata'; +export type { Transport, HttpMethod } from './metadata'; export type { Plugin } from './plugin'; + +// Transformers & error signals export { JsonTransformer } from './transformers'; export { HttpError, Unauthorized, NotFound, Redirect, NotModified, ValidationError } from './signals'; + +// Bus & flow export { Bus } from './bus'; export { flow, Flow } from './flow'; export type { StepFn, CompiledFlow } from './flow'; -export { needs, ctx, param, query, body, headers } from './params'; + +// Parameter decorators +export { needs, ctx, param, query, body, headers, header, inbound, abort } from './params'; export type { Query, Headers, Context, ArgSpec } from './params'; + +// Streaming export { channel, isAsyncIterable } from './channel'; export type { Channel } from './channel'; export { Rooms } from './rooms'; -export { Sse, Ws, Stream, Post, Put, Patch, Delete } from './metadata'; -export type { Transport, HttpMethod } from './metadata'; -export { inbound, abort } from './params'; export { sseEncoder, ndjsonEncoder } from './encoders'; export type { StreamEncoder } from './encoders'; -export type { MeshConfig } from './app'; + +// HTTP, security & validation export type { RequestLimits } from './http'; export type { TlsOptions, CorsOptions, SecurityOptions } from './security'; export type { UploadedFile, MultipartBody } from './multipart'; export type { StandardSchemaV1 } from './standard-schema'; + +// Mesh export { connectLink } from './mesh/link'; export { buildRemote, envelopeFrom } from './mesh/teacup'; export { buildManifest, createMeshControl, MESH_CONTROL_PATH } from './mesh/teapot'; diff --git a/src/mesh/link.ts b/src/mesh/link.ts index 10105d6..397364a 100644 --- a/src/mesh/link.ts +++ b/src/mesh/link.ts @@ -4,30 +4,105 @@ import { encode, decode, type Manifest, type RequestEnvelope, type Frame } from let connSeq = 0; // module-level: deterministic unique connection-id prefix (no Date.now/Math.random) +/** Client handle to a remote mesh server: its manifest, an RPC caller, and a close(). */ export interface Link { manifest: Manifest; rpc(kind: 'scope' | 'route', name: string, ctx: RequestEnvelope): Promise; close(): void; } +/** An in-flight RPC awaiting its `rpc-res`, keyed by id in the pending map. */ +type PendingEntry = { + resolve: (v: unknown) => void; + reject: (e: unknown) => void; + timer: ReturnType; +}; + function loadWs(): any { - return require('ws'); // lazy/optional, like streams; the ws CJS export is the WebSocket class + // lazy/optional, like streams; the ws CJS export is the WebSocket class + // eslint-disable-next-line @typescript-eslint/no-require-imports + return require('ws'); } -export function connectLink(args: { - url: string; - secret: string; - timeoutMs?: number; - bus?: Bus; -}): Promise { +/** Reject and clear every in-flight RPC — used when the link closes. */ +function rejectAllPending(pending: Map, reason: string): void { + for (const [, entry] of pending) { + clearTimeout(entry.timer); + entry.reject(new Error(reason)); + } + + pending.clear(); +} + +/** Register one RPC in `pending` by id, send its request, and reject it on timeout. */ +function sendRpc( + ws: any, + pending: Map, + id: string, + kind: 'scope' | 'route', + name: string, + ctx: RequestEnvelope, + timeoutMs: number, +): Promise { + return new Promise((resolveCall, rejectCall) => { + const timer = setTimeout(() => { + pending.delete(id); + rejectCall(new Error(`mesh rpc timeout: ${name}`)); + }, timeoutMs); + + pending.set(id, { resolve: resolveCall, reject: rejectCall, timer }); + ws.send(encode({ type: 'rpc-req', id, kind, name, ctx })); + }); +} + +/** Assemble the client-facing Link once the manifest arrives. */ +function buildLink( + ws: any, + pending: Map, + manifest: Manifest, + connId: string, + timeoutMs: number, +): Link { + let counter = 0; + + return { + manifest, + rpc(kind, name, ctx) { + const id = `${connId}:${counter++}`; + + return sendRpc(ws, pending, id, kind, name, ctx, timeoutMs); + }, + close() { + ws.close(); + }, + }; +} + +/** Settle a pending RPC from its `rpc-res` frame — resolve on ok, reject (and emit) on error. */ +function settleRpcResponse( + pending: Map, + frame: Extract, + bus?: Bus, +): void { + const entry = pending.get(frame.id); + if (!entry) return; + pending.delete(frame.id); + clearTimeout(entry.timer); + + if (frame.ok) { + entry.resolve(frame.result); + } else { + bus?.emit('mesh:rpc:error', { name: frame.id, error: frame.error }); + entry.reject(new HttpError(frame.error.status ?? 500, frame.error.message)); + } +} + +/** Open a WebSocket link to a mesh server, handshake with `secret`, and resolve once its manifest arrives. */ +export function connectLink(args: { url: string; secret: string; timeoutMs?: number; bus?: Bus }): Promise { const timeoutMs = args.timeoutMs ?? 30_000; const WS = loadWs(); const ws = new WS(args.url); - const pending = new Map< - string, - { resolve: (v: unknown) => void; reject: (e: unknown) => void; timer: ReturnType } - >(); - let counter = 0; + const pending = new Map(); const connId = `c${connSeq++}`; let manifest: Manifest | undefined; @@ -38,20 +113,17 @@ export function connectLink(args: { }, timeoutMs); ws.on('open', () => ws.send(encode({ type: 'hello', secret: args.secret }))); - ws.on('error', (e: unknown) => reject(e)); + ws.on('error', (error: unknown) => reject(error)); ws.on('close', () => { clearTimeout(connectTimer); args.bus?.emit('mesh:disconnect', { name: args.url }); - for (const [, p] of pending) { - clearTimeout(p.timer); - p.reject(new Error('mesh link closed')); - } - pending.clear(); + rejectAllPending(pending, 'mesh link closed'); if (!manifest) reject(new Error(`mesh handshake failed: ${args.url}`)); }); ws.on('message', (data: unknown) => { let frame: Frame; + try { frame = decode(String(data)); } catch { @@ -62,37 +134,12 @@ export function connectLink(args: { manifest = { scopes: frame.scopes, routes: frame.routes }; clearTimeout(connectTimer); args.bus?.emit('mesh:connect', { name: args.url }); - resolve({ - manifest, - rpc(kind, name, ctx) { - const id = `${connId}:${counter++}`; - return new Promise((res, rej) => { - const timer = setTimeout(() => { - pending.delete(id); - rej(new Error(`mesh rpc timeout: ${name}`)); - }, timeoutMs); - pending.set(id, { resolve: res, reject: rej, timer }); - ws.send(encode({ type: 'rpc-req', id, kind, name, ctx })); - }); - }, - close() { - ws.close(); - }, - }); + resolve(buildLink(ws, pending, manifest, connId, timeoutMs)); return; } if (frame.type === 'rpc-res') { - const p = pending.get(frame.id); - if (!p) return; - pending.delete(frame.id); - clearTimeout(p.timer); - if (frame.ok) { - p.resolve(frame.result); - } else { - args.bus?.emit('mesh:rpc:error', { name: frame.id, error: frame.error }); - p.reject(new HttpError(frame.error.status ?? 500, frame.error.message)); - } + settleRpcResponse(pending, frame, args.bus); } }); }); diff --git a/src/mesh/protocol.ts b/src/mesh/protocol.ts index b37d242..e2731b2 100644 --- a/src/mesh/protocol.ts +++ b/src/mesh/protocol.ts @@ -1,3 +1,4 @@ +/** Serialized request context sent across the mesh for a scope or route RPC. */ export interface RequestEnvelope { method: string; params: Record; @@ -6,10 +7,23 @@ export interface RequestEnvelope { headers: Record; } -export interface ScopeEntry { token: string; scope: 'app' | 'request' } -export interface RouteEntry { method: string; pattern: string } -export interface Manifest { scopes: ScopeEntry[]; routes: RouteEntry[] } +/** Manifest entry for an exported scope token and its lifetime. */ +export interface ScopeEntry { + token: string; + scope: 'app' | 'request'; +} +/** Manifest entry for an exported route. */ +export interface RouteEntry { + method: string; + pattern: string; +} +/** A mesh server's advertised scopes and routes. */ +export interface Manifest { + scopes: ScopeEntry[]; + routes: RouteEntry[]; +} +/** Discriminated union of every message on the mesh wire. */ export type Frame = | { type: 'hello'; secret: string } | { type: 'manifest'; scopes: ScopeEntry[]; routes: RouteEntry[] } @@ -19,14 +33,18 @@ export type Frame = const TYPES = new Set(['hello', 'manifest', 'rpc-req', 'rpc-res']); -export function encode(f: Frame): string { - return JSON.stringify(f); +/** Serialize a frame to a JSON wire string. */ +export function encode(frame: Frame): string { + return JSON.stringify(frame); } -export function decode(s: string): Frame { - const f = JSON.parse(s) as { type?: unknown }; - if (typeof f.type !== 'string' || !TYPES.has(f.type)) { - throw new Error(`unknown frame type: ${String(f.type)}`); +/** Parse a wire string into a frame, throwing if the `type` tag is unknown. */ +export function decode(json: string): Frame { + const parsed = JSON.parse(json) as { type?: unknown }; + + if (typeof parsed.type !== 'string' || !TYPES.has(parsed.type)) { + throw new Error(`unknown frame type: ${String(parsed.type)}`); } - return f as Frame; + + return parsed as Frame; } diff --git a/src/mesh/teacup.ts b/src/mesh/teacup.ts index 39fe36c..0e0870e 100644 --- a/src/mesh/teacup.ts +++ b/src/mesh/teacup.ts @@ -2,9 +2,19 @@ import type { Link } from './link'; import type { RequestEnvelope } from './protocol'; import type { ResponseShape } from '../pipeline'; -export interface RemoteScopeNode { name: string; run: (ctx: any) => Promise> } -export interface RemoteRoute { method: string; pattern: string; handler: (req: RequestEnvelope) => Promise } +/** Local proxy for a remote scope: runs the RPC and returns its token→value binding. */ +export interface RemoteScopeNode { + name: string; + run: (ctx: any) => Promise>; +} +/** Local proxy for a remote route: forwards the request envelope over the link. */ +export interface RemoteRoute { + method: string; + pattern: string; + handler: (req: RequestEnvelope) => Promise; +} +/** Extract a {@link RequestEnvelope} from a local request context for transmission over the mesh. */ export function envelopeFrom(ctx: any): RequestEnvelope { return { method: ctx?.req?.method ?? ctx?.method ?? 'GET', @@ -15,21 +25,27 @@ export function envelopeFrom(ctx: any): RequestEnvelope { }; } -export function buildRemote(link: Link, origin: string): { - providers: RemoteScopeNode[]; steps: RemoteScopeNode[]; routes: RemoteRoute[]; +/** Turn a link's manifest into local proxy nodes: app-scope providers, request-scope steps, and routes. */ +export function buildRemote(link: Link): { + providers: RemoteScopeNode[]; + steps: RemoteScopeNode[]; + routes: RemoteRoute[]; } { const providers: RemoteScopeNode[] = []; const steps: RemoteScopeNode[] = []; - for (const s of link.manifest.scopes) { + + for (const scope of link.manifest.scopes) { const node: RemoteScopeNode = { - name: s.token, - run: async (ctx: any) => ({ [s.token]: await link.rpc('scope', s.token, envelopeFrom(ctx)) }), + name: scope.token, + run: async (ctx: any) => ({ [scope.token]: await link.rpc('scope', scope.token, envelopeFrom(ctx)) }), }; - (s.scope === 'app' ? providers : steps).push(node); + (scope.scope === 'app' ? providers : steps).push(node); } - const routes: RemoteRoute[] = link.manifest.routes.map((r) => ({ - method: r.method, pattern: r.pattern, - handler: async (req: RequestEnvelope) => (await link.rpc('route', r.pattern, req)) as ResponseShape, + + const routes: RemoteRoute[] = link.manifest.routes.map((route) => ({ + method: route.method, + pattern: route.pattern, + handler: async (req: RequestEnvelope) => (await link.rpc('route', route.pattern, req)) as ResponseShape, })); return { providers, steps, routes }; } diff --git a/src/mesh/teapot.ts b/src/mesh/teapot.ts index e0e5496..b7922fa 100644 --- a/src/mesh/teapot.ts +++ b/src/mesh/teapot.ts @@ -4,12 +4,14 @@ import type { ResponseShape } from '../pipeline'; import { isHttpError } from '../signals'; import { encode, decode, type Manifest, type RequestEnvelope, type RouteEntry, type Frame } from './protocol'; +/** WebSocket path where a teapot exposes its mesh control channel. */ export const MESH_CONTROL_PATH = '/__mesh__/control'; +/** Assemble a {@link Manifest} from exported provider/step tokens and buffered routes. */ export function buildManifest(args: { - providers: string[]; // exported provider tokens (app-scope) - steps: string[]; // exported step tokens (request-scope) - routes: RouteEntry[]; // exported buffered routes + providers: string[]; // exported provider tokens (app-scope) + steps: string[]; // exported step tokens (request-scope) + routes: RouteEntry[]; // exported buffered routes }): Manifest { return { scopes: [ @@ -20,13 +22,14 @@ export function buildManifest(args: { }; } -function safeEqual(a: string, b: string): boolean { - const ba = Buffer.from(a); - const bb = Buffer.from(b); - if (ba.length !== bb.length) return false; - return crypto.timingSafeEqual(ba, bb); +function safeEqual(left: string, right: string): boolean { + const leftBuf = Buffer.from(left); + const rightBuf = Buffer.from(right); + if (leftBuf.length !== rightBuf.length) return false; + return crypto.timingSafeEqual(leftBuf, rightBuf); } +/** Dependencies for the mesh control handler: shared secret, manifest, and scope/route resolvers. */ export interface MeshControlDeps { secret: string; manifest: Manifest; @@ -35,9 +38,77 @@ export interface MeshControlDeps { bus?: Bus; } +/** The rpc-req member of the {@link Frame} union. */ +type RpcReqFrame = Extract; + +/** Build a 403 "not exported" error for an unknown scope/route token. */ +function notExported(name: string): Error { + const error: any = new Error(`not exported: ${name}`); + error.status = 403; + + return error; +} + +/** Validate an unauthenticated hello frame; reply with the manifest on success or close on mismatch. */ +function handleHandshake(ws: any, frame: Frame, deps: MeshControlDeps): boolean { + if (frame.type === 'hello' && safeEqual(frame.secret, deps.secret)) { + ws.send(encode({ type: 'manifest', scopes: deps.manifest.scopes, routes: deps.manifest.routes })); + deps.bus?.emit('mesh:connect', { name: 'teapot' }); + + return true; + } + + ws.close(1008); + + return false; +} + +/** Resolve an authenticated rpc-req against the exported scopes/routes, enforcing export gating. */ +function resolveRpc( + frame: RpcReqFrame, + deps: MeshControlDeps, + exportedScopes: Set, + exportedRoutes: Set, +): Promise { + const { kind, name, ctx } = frame; + + if (kind === 'scope') { + if (!exportedScopes.has(name)) throw notExported(name); + + return deps.resolveScope(name, ctx); + } + + if (![...exportedRoutes].some((key) => key.endsWith(` ${name}`))) throw notExported(name); + + return deps.resolveRoute(name, ctx); +} + +/** Serve one authenticated rpc-req: resolve it and frame the ok/error response back to the peer. */ +async function handleRpc( + ws: any, + frame: RpcReqFrame, + deps: MeshControlDeps, + exportedScopes: Set, + exportedRoutes: Set, +): Promise { + const { id, name } = frame; + + try { + const result = await resolveRpc(frame, deps, exportedScopes, exportedRoutes); + + ws.send(encode({ type: 'rpc-res', id, ok: true, result })); + } catch (err) { + const status = isHttpError(err) ? err.status : ((err as any)?.status ?? 500); + + deps.bus?.emit('mesh:rpc:error', { name, error: err }); + ws.send(encode({ type: 'rpc-res', id, ok: false, error: { message: (err as Error).message, status } })); + } +} + +/** Build a WebSocket handler that authenticates peers and serves scope/route RPCs from the manifest. */ export function createMeshControl(deps: MeshControlDeps): { path: string; handle: (ws: any) => void } { - const exportedScopes = new Set(deps.manifest.scopes.map((s) => s.token)); - const exportedRoutes = new Set(deps.manifest.routes.map((r) => `${r.method} ${r.pattern}`)); + const exportedScopes = new Set(deps.manifest.scopes.map((scope) => scope.token)); + const exportedRoutes = new Set(deps.manifest.routes.map((route) => `${route.method} ${route.pattern}`)); return { path: MESH_CONTROL_PATH, @@ -45,36 +116,22 @@ export function createMeshControl(deps: MeshControlDeps): { path: string; handle let authed = false; ws.on('message', async (data: unknown) => { let frame: Frame; - try { frame = decode(String(data)); } catch { return; } + + try { + frame = decode(String(data)); + } catch { + return; + } if (!authed) { - if (frame.type === 'hello' && safeEqual(frame.secret, deps.secret)) { - authed = true; - ws.send(encode({ type: 'manifest', scopes: deps.manifest.scopes, routes: deps.manifest.routes })); - deps.bus?.emit('mesh:connect', { name: 'teapot' }); - } else { - ws.close(1008); - } + authed = handleHandshake(ws, frame, deps); + return; } if (frame.type !== 'rpc-req') return; - const { id, kind, name, ctx } = frame; - try { - let result: unknown; - if (kind === 'scope') { - if (!exportedScopes.has(name)) { const e: any = new Error(`not exported: ${name}`); e.status = 403; throw e; } - result = await deps.resolveScope(name, ctx); - } else { - if (![...exportedRoutes].some((k) => k.endsWith(` ${name}`))) { const e: any = new Error(`not exported: ${name}`); e.status = 403; throw e; } - result = await deps.resolveRoute(name, ctx); - } - ws.send(encode({ type: 'rpc-res', id, ok: true, result })); - } catch (err) { - const status = isHttpError(err) ? err.status : (err as any)?.status ?? 500; - deps.bus?.emit('mesh:rpc:error', { name, error: err }); - ws.send(encode({ type: 'rpc-res', id, ok: false, error: { message: (err as Error).message, status } })); - } + + await handleRpc(ws, frame, deps, exportedScopes, exportedRoutes); }); ws.on('close', () => deps.bus?.emit('mesh:disconnect', { name: 'teapot' })); }, diff --git a/src/metadata.ts b/src/metadata.ts index be4efce..9d47050 100644 --- a/src/metadata.ts +++ b/src/metadata.ts @@ -1,15 +1,43 @@ import 'reflect-metadata'; +/** Any class constructor. Kept `any` because decorators must accept every target shape. */ export type Ctor = new (...args: any[]) => any; +/** Serializes a handler's return value into an HTTP response envelope. */ export type TransformerFn = (value: unknown) => { status?: number; headers?: Record; body: string }; -export interface ProviderMeta { provides: string; needs: string[]; optional: boolean; export: boolean } -export interface StepMeta { provides: string; needs: string[]; optional: boolean; export: boolean } +/** Metadata attached by `@Provider`: what it provides, what it needs, and its visibility. */ +export interface ProviderMeta { + provides: string; + needs: string[]; + optional: boolean; + export: boolean; +} +/** Metadata attached by `@Step`: what it provides, what it needs, and its visibility. */ +export interface StepMeta { + provides: string; + needs: string[]; + optional: boolean; + export: boolean; +} +/** HTTP verbs supported by the route decorators. */ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'; +/** Wire transport a route responds with. */ export type Transport = 'buffer' | 'sse' | 'ndjson' | 'negotiate' | 'ws'; -export interface RouteMeta { method: HttpMethod; path: string; handlerName: string; transport: Transport; export: boolean; duplicates?: 'array' | 'last' } +/** Metadata attached by a route decorator to a single handler method. */ +export interface RouteMeta { + method: HttpMethod; + path: string; + handlerName: string; + transport: Transport; + export: boolean; + duplicates?: 'array' | 'last'; +} +/** Options accepted by the `@Module` decorator. */ export interface ModuleOptions { - mountpoint: string; providers?: Ctor[]; steps?: Ctor[]; controllers?: Ctor[]; + mountpoint: string; + providers?: Ctor[]; + steps?: Ctor[]; + controllers?: Ctor[]; } const K = { @@ -21,22 +49,47 @@ const K = { transformer: Symbol('gt:transformer'), }; -export function Provider(opts: { provides: string; needs?: string[]; optional?: boolean; export?: boolean }): ClassDecorator { +/** Marks a class as a provider: a lazily-built dependency addressable by its `provides` key. */ +export function Provider(opts: { + provides: string; + needs?: string[]; + optional?: boolean; + export?: boolean; +}): ClassDecorator { return (target) => { - const meta: ProviderMeta = { provides: opts.provides, needs: opts.needs ?? [], optional: opts.optional ?? false, export: opts.export ?? false }; + const meta: ProviderMeta = { + provides: opts.provides, + needs: opts.needs ?? [], + optional: opts.optional ?? false, + export: opts.export ?? false, + }; Reflect.defineMetadata(K.provider, meta, target); }; } -export function Step(opts: { provides: string; needs?: string[]; optional?: boolean; export?: boolean }): ClassDecorator { +/** Marks a class as a step: a per-request unit that runs in dependency order and contributes to the context. */ +export function Step(opts: { + provides: string; + needs?: string[]; + optional?: boolean; + export?: boolean; +}): ClassDecorator { return (target) => { - const meta: StepMeta = { provides: opts.provides, needs: opts.needs ?? [], optional: opts.optional ?? false, export: opts.export ?? false }; + const meta: StepMeta = { + provides: opts.provides, + needs: opts.needs ?? [], + optional: opts.optional ?? false, + export: opts.export ?? false, + }; Reflect.defineMetadata(K.step, meta, target); }; } +/** Sets the shared path prefix for every route declared on the decorated controller. */ export function Route(prefix: string): ClassDecorator { - return (target) => { Reflect.defineMetadata(K.routePrefix, prefix, target); }; + return (target) => { + Reflect.defineMetadata(K.routePrefix, prefix, target); + }; } function routeDecorator(method: HttpMethod, transport: Transport) { @@ -44,48 +97,77 @@ function routeDecorator(method: HttpMethod, transport: Transport) { (target, propertyKey) => { const ctor = target.constructor; const routes = (Reflect.getMetadata(K.routes, ctor) as RouteMeta[]) ?? []; - routes.push({ method, path, handlerName: String(propertyKey), transport, export: opts?.export ?? false, duplicates: opts?.duplicates }); + routes.push({ + method, + path, + handlerName: String(propertyKey), + transport, + export: opts?.export ?? false, + duplicates: opts?.duplicates, + }); Reflect.defineMetadata(K.routes, routes, ctor); }; } +/** Declares a buffered `GET` route. */ export const Get = routeDecorator('GET', 'buffer'); +/** Declares a buffered `POST` route. */ export const Post = routeDecorator('POST', 'buffer'); +/** Declares a buffered `PUT` route. */ export const Put = routeDecorator('PUT', 'buffer'); +/** Declares a buffered `PATCH` route. */ export const Patch = routeDecorator('PATCH', 'buffer'); +/** Declares a buffered `DELETE` route. */ export const Delete = routeDecorator('DELETE', 'buffer'); +/** Declares a `GET` route streamed as Server-Sent Events. */ export const Sse = routeDecorator('GET', 'sse'); +/** Declares a `GET` route whose transport is content-negotiated at request time. */ export const Stream = routeDecorator('GET', 'negotiate'); +/** Declares a `GET` route upgraded to a WebSocket. */ export const Ws = routeDecorator('GET', 'ws'); +/** Attaches a response transformer to a handler method. */ export function Transformer(fn: TransformerFn): MethodDecorator { return (target, propertyKey) => { Reflect.defineMetadata(K.transformer, fn, target.constructor, String(propertyKey)); }; } +/** Marks a class as a module and records its providers, steps, controllers, and mountpoint. */ export function Module(opts: ModuleOptions): ClassDecorator { - return (target) => { Reflect.defineMetadata(K.module, opts, target); }; + return (target) => { + Reflect.defineMetadata(K.module, opts, target); + }; } +/** Reads the `@Provider` metadata off a class, if any. */ export function getProviderMeta(cls: Ctor): ProviderMeta | undefined { return Reflect.getMetadata(K.provider, cls); } + +/** Reads the `@Step` metadata off a class, if any. */ export function getStepMeta(cls: Ctor): StepMeta | undefined { return Reflect.getMetadata(K.step, cls); } + +/** Reads the `@Module` metadata off a class, if any. */ export function getModuleMeta(cls: Ctor): ModuleOptions | undefined { return Reflect.getMetadata(K.module, cls); } + +/** Reads the response transformer registered for a handler method, if any. */ export function getTransformer(cls: Ctor, methodName: string): TransformerFn | undefined { return Reflect.getMetadata(K.transformer, cls, methodName); } + +/** Returns every route on a controller with its path resolved against the class prefix. */ export function getRoutes(cls: Ctor): RouteMeta[] { const prefix: string = Reflect.getMetadata(K.routePrefix, cls) ?? ''; const routes: RouteMeta[] = Reflect.getMetadata(K.routes, cls) ?? []; - return routes.map((r) => ({ ...r, path: joinPath(prefix, r.path) })); + return routes.map((route) => ({ ...route, path: joinPath(prefix, route.path) })); } -export function joinPath(a: string, b: string): string { - return `${a.replace(/\/$/, '')}/${b.replace(/^\//, '')}`.replace(/\/+/g, '/'); +/** Joins two path segments with exactly one slash, collapsing any duplicates. */ +export function joinPath(base: string, segment: string): string { + return `${base.replace(/\/$/, '')}/${segment.replace(/^\//, '')}`.replace(/\/+/g, '/'); } diff --git a/src/multipart.ts b/src/multipart.ts index 02fad20..3e03cab 100644 --- a/src/multipart.ts +++ b/src/multipart.ts @@ -1,122 +1,130 @@ -// src/multipart.ts — pure, binary-safe multipart/form-data parser. No server deps. -export interface UploadedFile { filename: string; contentType: string; data: Buffer; size: number } +// src/multipart.ts — multipart/form-data parsing on top of the optional `busboy` peer dependency. +import { Readable } from 'stream'; +import { HttpError } from './signals'; + +/** A single uploaded file part decoded from a multipart body. */ +export interface UploadedFile { + filename: string; + contentType: string; + data: Buffer; + size: number; +} + +/** Decoded multipart body: text fields and file uploads, keyed by part name. */ export interface MultipartBody { fields: Record; files: Record; } -export interface MultipartOpts { maxParts: number; duplicates: 'array' | 'last' } -const CRLF = Buffer.from('\r\n'); +/** Parser limits and duplicate-key policy for {@link parseMultipart}. */ +export interface MultipartOpts { + maxParts: number; + duplicates: 'array' | 'last'; +} -// boundary token from a Content-Type value; supports quoted form. +/** + * Extracts the boundary token from a Content-Type value (supports the quoted form). + * @returns The boundary, or undefined when absent. + */ export function extractBoundary(contentType: string): string | undefined { - const m = /boundary=(?:"([^"]+)"|([^;]+))/i.exec(contentType); - const b = (m?.[1] ?? m?.[2])?.trim(); - return b || undefined; + const match = /boundary=(?:"([^"]+)"|([^;]+))/i.exec(contentType); + const boundary = (match?.[1] ?? match?.[2])?.trim(); + return boundary || undefined; } -// order-independent, quoted-or-unquoted param lookup within a header value. -// The `(?:^|[;\s])` prefix anchors the key to a param boundary so `name=` does NOT -// match the tail of `filename=`, and `filename=` does not match `filename*=`. -function param(header: string, key: string): string | undefined { - const q = new RegExp(`(?:^|[;\\s])${key}="([^"]*)"`, 'i').exec(header); - if (q) return q[1]; - const u = new RegExp(`(?:^|[;\\s])${key}=([^";]+)`, 'i').exec(header); - return u ? u[1].trim() : undefined; -} - -function addField(fields: MultipartBody['fields'], name: string, value: string, dup: 'array' | 'last'): void { - if (dup === 'array') { - const ex = fields[name]; - if (Array.isArray(ex)) ex.push(value); +function addField(fields: MultipartBody['fields'], name: string, value: string, duplicates: 'array' | 'last'): void { + if (duplicates === 'array') { + const existing = fields[name]; + if (Array.isArray(existing)) existing.push(value); else fields[name] = [value]; } else { fields[name] = value; // last-wins } } -// Reusable accumulator for any iterable of [key, value] pairs (e.g. URLSearchParams) -// so urlencoded bodies collapse duplicates with the exact same policy as multipart fields. +/** + * Collapses an iterable of [key, value] pairs (e.g. URLSearchParams) into an object, + * applying the same duplicate-key policy as multipart fields so urlencoded bodies behave identically. + */ export function collapseDuplicates( - pairs: Iterable<[string, string]>, dup: 'array' | 'last', + pairs: Iterable<[string, string]>, + duplicates: 'array' | 'last', ): Record { const out: Record = {}; - for (const [k, v] of pairs) addField(out, k, v, dup); + for (const [key, value] of pairs) addField(out, key, value, duplicates); return out; } function addFile(files: MultipartBody['files'], name: string, file: UploadedFile): void { - const ex = files[name]; - if (ex === undefined) files[name] = file; - else if (Array.isArray(ex)) ex.push(file); - else files[name] = [ex, file]; + const existing = files[name]; + if (existing === undefined) files[name] = file; + else if (Array.isArray(existing)) existing.push(file); + else files[name] = [existing, file]; } -// Find the next REAL delimiter at/after `from`: a `\r\n--boundary` occurrence that is -// followed by `\r\n` (a part) or `--` (the terminator). This skips false hits where the -// exact `\r\n--boundary` byte sequence appears INSIDE a file body — the data-integrity case. -function findDelim(buf: Buffer, delim: Buffer, from: number): number { - let i = buf.indexOf(delim, from); - while (i !== -1) { - const a = i + delim.length; - if ((buf[a] === 0x0d && buf[a + 1] === 0x0a) || (buf[a] === 0x2d && buf[a + 1] === 0x2d)) return i; - i = buf.indexOf(delim, i + delim.length); // false hit inside a body — keep searching +/** Lazily loads the optional `busboy` peer dependency, or null when it is not installed. */ +function loadBusboy(): ((cfg: unknown) => NodeJS.WritableStream & NodeJS.EventEmitter) | null { + try { + // `busboy` is an OPTIONAL peer dependency: only multipart uploads need it, so it is + // lazy-required and its absence surfaces as a clear 501 rather than a load-time crash. + // eslint-disable-next-line @typescript-eslint/no-require-imports + return require('busboy'); + } catch { + return null; } - return -1; } -export function parseMultipart(raw: Buffer, boundary: string, opts: MultipartOpts): MultipartBody { - const fields: MultipartBody['fields'] = {}; - const files: MultipartBody['files'] = {}; - const delim = Buffer.concat([CRLF, Buffer.from(`--${boundary}`)]); // \r\n--boundary - // Normalize: prepend CRLF so the FIRST boundary (which a browser sends with no - // leading CRLF) is also preceded by the delimiter and isn't dropped as preamble. - const buf = Buffer.concat([CRLF, raw]); +/** + * Parses a raw multipart/form-data buffer into decoded fields and files, using `busboy`. + * @param raw The full (already size-capped) request body. + * @param boundary The boundary token (see {@link extractBoundary}). + * @throws HttpError 501 when the optional `busboy` peer dependency is not installed. + * @throws Error 'Invalid multipart body' on malformed input or when `maxParts` is exceeded. + */ +export function parseMultipart(raw: Buffer, boundary: string, opts: MultipartOpts): Promise { + const busboy = loadBusboy(); - let pos = findDelim(buf, delim, 0); - if (pos === -1) throw new Error('Invalid multipart body'); - let count = 0; - while (true) { - let start = pos + delim.length; - // terminator "--" immediately after the boundary → done - if (buf[start] === 0x2d && buf[start + 1] === 0x2d) break; - // skip the CRLF that ends the boundary line - if (buf[start] === 0x0d && buf[start + 1] === 0x0a) start += 2; - const next = findDelim(buf, delim, start); - if (next === -1) throw new Error('Invalid multipart body'); - if (++count > opts.maxParts) throw new Error('Invalid multipart body'); - const part = buf.subarray(start, next); - const sep = part.indexOf('\r\n\r\n'); - if (sep === -1) throw new Error('Invalid multipart body'); - const headerText = part.subarray(0, sep).toString('utf8'); - const partBody = part.subarray(sep + 4); + if (!busboy) { + throw new HttpError(501, 'multipart/form-data requires the optional "busboy" peer dependency — run `npm i busboy`'); + } - let disposition = ''; - let contentType = ''; - for (const line of headerText.split('\r\n')) { - const c = line.indexOf(':'); - if (c === -1) continue; - const k = line.slice(0, c).trim().toLowerCase(); - const v = line.slice(c + 1).trim(); - if (k === 'content-disposition') disposition = v; - else if (k === 'content-type') contentType = v; - } + return new Promise((resolve, reject) => { + const body: MultipartBody = { fields: {}, files: {} }; + const fail = () => reject(new Error('Invalid multipart body')); + let bb: NodeJS.WritableStream & NodeJS.EventEmitter; - const name = param(disposition, 'name'); - if (name === undefined) throw new Error('Invalid multipart body'); - const filename = param(disposition, 'filename'); - if (filename !== undefined) { - if (filename === '' && partBody.length === 0) { pos = next; continue; } // unselected file input - addFile(files, name, { - filename, - contentType: contentType || 'application/octet-stream', - data: Buffer.from(partBody), // copy out of the shared buffer - size: partBody.length, + try { + bb = busboy({ + headers: { 'content-type': `multipart/form-data; boundary=${boundary}` }, + limits: { parts: opts.maxParts }, }); - } else { - addField(fields, name, partBody.toString('utf8'), opts.duplicates); + } catch { + return fail(); } - pos = next; - } - return { fields, files }; + + bb.on('field', (name: string, value: string) => addField(body.fields, name, value, opts.duplicates)); + + bb.on('file', (name: string, stream: Readable, info: { filename?: string; mimeType?: string }) => { + const chunks: Buffer[] = []; + stream.on('data', (chunk: Buffer) => chunks.push(chunk)); + stream.on('close', () => { + const data = Buffer.concat(chunks); + const filename = info.filename ?? ''; + if (filename === '' && data.length === 0) return; // unselected file input + + addFile(body.files, name, { + filename, + contentType: info.mimeType || 'application/octet-stream', + data, + size: data.length, + }); + }); + }); + + bb.on('partsLimit', fail); // more parts than maxParts → treat as malformed (matches prior behavior) + bb.on('error', fail); + bb.on('close', () => resolve(body)); + + Readable.from(raw).pipe(bb); + }); } diff --git a/src/params.ts b/src/params.ts index a431de3..495bca9 100644 --- a/src/params.ts +++ b/src/params.ts @@ -3,12 +3,22 @@ import type { Ctor } from './metadata'; import { isStandardSchema, type StandardSchemaV1 } from './standard-schema'; import { ValidationError } from './signals'; +/** Parsed URL query string as flat key/value pairs. */ export type Query = Record; +/** Incoming request headers; a header may repeat, hence the array variant. */ export type Headers = Record; +/** Per-request bag that accumulates values produced by steps and providers. */ export type Context = Record; type ArgSource = 'ctx' | 'needs' | 'params' | 'query' | 'body' | 'headers' | 'inbound' | 'abort'; -export interface ArgSpec { index: number; source: ArgSource; key?: string; keys?: string[]; schema?: StandardSchemaV1 } +/** Describes how a single handler parameter is sourced and (optionally) validated. */ +export interface ArgSpec { + index: number; + source: ArgSource; + key?: string; + keys?: string[]; + schema?: StandardSchemaV1; +} const ARGS = Symbol('gt:args'); @@ -30,73 +40,94 @@ function envelope(source: ArgSource) { else if (typeof arg === 'string') spec.key = arg; else if (isStandardSchema(arg)) spec.schema = arg; else if (arg !== undefined) throw new Error(`@${source}: expected a Standard Schema or a string/array key`); + if (schema !== undefined) { if (!isStandardSchema(schema)) throw new Error(`@${source}: second argument must be a Standard Schema`); spec.schema = schema; } + record(target, methodKey, spec); }; } +/** Inject a route path parameter; pass a key to pick one, or a schema/array to shape it. */ export const param = envelope('params'); +/** Inject a query-string value; pass a key to pick one, or a schema/array to shape it. */ export const query = envelope('query'); +/** Inject the request body; pass a schema to validate it. */ export const body = envelope('body'); +/** Inject request headers; pass a key to pick one, an array to pick several, or no arg for the whole bag. */ export const headers = envelope('headers'); +/** Inject a single request header by name (singular alias of {@link headers}); accepts a schema to validate it. */ +export const header = envelope('headers'); +/** Inject a value produced upstream by a step or provider, addressed by key. */ export function needs(key: string): ParameterDecorator { return (target, methodKey, index) => record(target, methodKey, { index, source: 'needs', key }); } +/** Inject the whole request context bag. */ export function ctx(): ParameterDecorator { return (target, methodKey, index) => record(target, methodKey, { index, source: 'ctx' }); } +/** Inject the inbound stream (for streaming/upload handlers). */ export function inbound(): ParameterDecorator { return (target, methodKey, index) => record(target, methodKey, { index, source: 'inbound' }); } +/** Inject the request's abort signal. */ export function abort(): ParameterDecorator { return (target, methodKey, index) => record(target, methodKey, { index, source: 'abort' }); } +/** Read the recorded parameter specs for a handler method, ordered by parameter index. */ export function getArgs(cls: Ctor, methodName: string): ArgSpec[] { const map: Record = Reflect.getMetadata(ARGS, cls) ?? {}; return [...(map[methodName] ?? [])].sort((a, b) => a.index - b.index); } +/** Extract the `@needs` keys a handler depends on, for dependency resolution. */ export function getHandlerNeeds(specs: ArgSpec[]): string[] { - return specs.filter((s) => s.source === 'needs' && s.key).map((s) => s.key as string); + return specs.filter((spec) => spec.source === 'needs' && spec.key).map((spec) => spec.key as string); } +/** Build the positional argument array for a handler by sourcing and validating each spec. */ export async function resolveArgs(specs: ArgSpec[], context: Context): Promise { if (specs.length === 0) return []; - const max = Math.max(...specs.map((s) => s.index)); - const args: unknown[] = new Array(max + 1).fill(undefined); - for (const s of specs) { - let value = resolveOne(s, context); - if (s.schema) { - const result = await s.schema['~standard'].validate(value); - if (result.issues) throw new ValidationError([...result.issues], s.source); + const maxIndex = Math.max(...specs.map((spec) => spec.index)); + const args: unknown[] = new Array(maxIndex + 1).fill(undefined); + + for (const spec of specs) { + let value = resolveOne(spec, context); + + if (spec.schema) { + const result = await spec.schema['~standard'].validate(value); + if (result.issues) throw new ValidationError([...result.issues], spec.source); value = result.value; } - args[s.index] = value; + + args[spec.index] = value; } + return args; } -function resolveOne(s: ArgSpec, context: Context): unknown { - if (s.source === 'ctx') return context; - if (s.source === 'needs') return context[s.key as string]; - if (s.source === 'inbound') return context.inbound; - if (s.source === 'abort') return context.abort; - const bag = context[s.source]; +function resolveOne(spec: ArgSpec, context: Context): unknown { + if (spec.source === 'ctx') return context; + if (spec.source === 'needs') return context[spec.key as string]; + if (spec.source === 'inbound') return context.inbound; + if (spec.source === 'abort') return context.abort; + const bag = context[spec.source]; if (typeof bag !== 'object' || bag === null) return bag; // can't pick from a non-object; return as-is - const record = bag as Record; - if (s.keys) { - const out: Record = {}; - for (const k of s.keys) out[k] = record[k]; - return out; + const values = bag as Record; + + if (spec.keys) { + const picked: Record = {}; + for (const key of spec.keys) picked[key] = values[key]; + return picked; } - if (s.key !== undefined) return record[s.key]; - return record; + + if (spec.key !== undefined) return values[spec.key]; + return values; } diff --git a/src/pipeline.ts b/src/pipeline.ts index e719b1a..d2ec969 100644 --- a/src/pipeline.ts +++ b/src/pipeline.ts @@ -3,15 +3,35 @@ import { errorToResponse } from './transformers'; import { isAsyncIterable } from './channel'; import type { TransformerFn } from './metadata'; -export interface PipelineStep { name: string; origin: string; run: (ctx: any) => any } -export interface ResponseShape { status: number; headers: Record; body: string } -export interface StreamResult { stream: AsyncIterable } +/** A single step in a request pipeline: a named unit whose `run` merges its output into the shared context. */ +export interface PipelineStep { + name: string; + origin: string; + run: (ctx: any) => any; +} +/** A fully materialized HTTP response produced by a transformer. */ +export interface ResponseShape { + status: number; + headers: Record; + body: string; +} +/** A streaming response; the async iterable is written to the socket and bypasses the transformer. */ +export interface StreamResult { + stream: AsyncIterable; +} +/** The outcome of {@link runPipeline}: either a buffered response or a stream. */ export type PipelineResult = ResponseShape | StreamResult; -export function isStreamResult(r: PipelineResult): r is StreamResult { - return 'stream' in r; +/** Type guard narrowing a {@link PipelineResult} to a {@link StreamResult}. */ +export function isStreamResult(result: PipelineResult): result is StreamResult { + return 'stream' in result; } +/** + * Run `steps` in order over a context seeded from `seed`, then invoke `handler`. + * An async-iterable handler result becomes a stream; anything else is run through `transformer`. + * Errors are caught, emitted on `bus`, and converted to an error response. + */ export async function runPipeline(args: { steps: PipelineStep[]; handler: (ctx: any) => unknown; @@ -20,18 +40,21 @@ export async function runPipeline(args: { bus: Bus; }): Promise { const { steps, handler, transformer, seed, bus } = args; - let ctx: any = { ...seed }; + // context is intentionally `any`: each step merges arbitrary keys into the accumulator + let context: any = { ...seed }; + try { - for (const s of steps) { - bus.emit('request:step:enter', { name: s.name, scope: s.origin }); - const out = await s.run(ctx); - ctx = { ...ctx, ...out }; - bus.emit('request:step:leave', { name: s.name, scope: s.origin }); + for (const step of steps) { + bus.emit('request:step:enter', { name: step.name, scope: step.origin }); + const output = await step.run(context); + context = { ...context, ...output }; + bus.emit('request:step:leave', { name: step.name, scope: step.origin }); } - const result = await handler(ctx); - if (isAsyncIterable(result)) return { stream: result }; // stream path: transformer bypassed - const r = transformer(result); - return { status: r.status ?? 200, headers: r.headers ?? {}, body: r.body }; + + const result = await handler(context); + if (isAsyncIterable(result)) return { stream: result }; // stream path: transformer bypassed + const transformed = transformer(result); + return { status: transformed.status ?? 200, headers: transformed.headers ?? {}, body: transformed.body }; } catch (error) { bus.emit('request:step:error', { name: 'pipeline', error }); return errorToResponse(error); diff --git a/src/plugin.ts b/src/plugin.ts index d0c25d8..2a0eb6f 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,5 +1,6 @@ import { Bus } from './bus'; +/** A step or provider a plugin contributes to the graph. */ export interface ScopeNode { kind: 'step' | 'provider'; name: string; @@ -8,10 +9,19 @@ export interface ScopeNode { run: (ctx: any) => any; } -export interface ScopeApi { add(node: ScopeNode): void } -export interface PluginApi { bus: { on: Bus['on'] }; scope: ScopeApi } +/** The narrow surface a plugin uses to register nodes into the host graph. */ +export interface ScopeApi { + add(node: ScopeNode): void; +} +/** The capabilities handed to a plugin: event subscription and node registration only. */ +export interface PluginApi { + bus: { on: Bus['on'] }; + scope: ScopeApi; +} +/** A plugin: a function that wires itself up through the provided PluginApi. */ export type Plugin = (api: PluginApi) => void; +/** Runs a plugin against a restricted API, then emits `plugin:mounted`. */ export function mountPlugin(plugin: Plugin, bus: Bus, scope: ScopeApi): void { // Hand the plugin ONLY on() and add(). No emit, no other scope. Isolation is structural. const api: PluginApi = { bus: { on: bus.on.bind(bus) }, scope }; diff --git a/src/rooms.ts b/src/rooms.ts index 7eee41b..aa5b5a3 100644 --- a/src/rooms.ts +++ b/src/rooms.ts @@ -1,11 +1,21 @@ import { channel, type Channel } from './channel'; +/** Registry of named broadcast channels, lazily created and shared by name. */ export class Rooms { private readonly hubs = new Map>(); + /** Returns the channel for `name`, creating it on first access. */ room(name: string): Channel { let hub = this.hubs.get(name); - if (!hub) { hub = channel(); this.hubs.set(name, hub); } + + if (!hub) { + hub = channel(); + this.hubs.set(name, hub); + } + return hub as unknown as Channel; } - names(): string[] { return [...this.hubs.keys()]; } + /** Lists the names of all rooms created so far. */ + names(): string[] { + return [...this.hubs.keys()]; + } } diff --git a/src/security.ts b/src/security.ts index 18c58b8..c48023d 100644 --- a/src/security.ts +++ b/src/security.ts @@ -1,6 +1,14 @@ // src/security.ts — pure header computation, no server deps -export interface TlsOptions { key: Buffer | string; cert: Buffer | string; ca?: Buffer | string; passphrase?: string } +/** TLS material for an HTTPS server. */ +export interface TlsOptions { + key: Buffer | string; + cert: Buffer | string; + ca?: Buffer | string; + passphrase?: string; +} + +/** CORS policy. `origins` may be a literal, list, `'*'`, or a predicate. */ export interface CorsOptions { origins: string | string[] | '*' | ((origin: string) => boolean); methods?: string[]; @@ -10,6 +18,7 @@ export interface CorsOptions { maxAge?: number; } +/** Security header policy. Each field toggles or configures one response header. */ export interface SecurityOptions { hsts?: boolean | { maxAge?: number; includeSubDomains?: boolean; preload?: boolean }; frameOptions?: 'SAMEORIGIN' | 'DENY' | false; @@ -23,32 +32,47 @@ type Headers = Record; const HSTS_DEFAULT_MAXAGE = 15552000; // 180 days // scheme "://" host [":" port], or literal "null". Rejects control chars/whitespace. +// Control-char ranges (\x00-\x1f\x7f) are intentional: reject control chars in Origin headers. +// eslint-disable-next-line no-control-regex const ORIGIN_RE = /^(?:null|[a-z][a-z0-9+.-]*:\/\/[^\s/?#\x00-\x1f\x7f]+)$/i; -export function isValidOrigin(o: string): boolean { return ORIGIN_RE.test(o); } +/** True if `origin` is a well-formed Origin header value (scheme://host or literal `null`). */ +export function isValidOrigin(origin: string): boolean { + return ORIGIN_RE.test(origin); +} + +/** Append `add` to a `Vary` header value, case-insensitively deduplicated. */ export function mergeVary(existing: string | undefined, add: string): string { - const parts = (existing ? existing.split(',').map((s) => s.trim()).filter(Boolean) : []); - if (!parts.some((p) => p.toLowerCase() === add.toLowerCase())) parts.push(add); + const parts = existing + ? existing + .split(',') + .map((segment) => segment.trim()) + .filter(Boolean) + : []; + if (!parts.some((part) => part.toLowerCase() === add.toLowerCase())) parts.push(add); return parts.join(', '); } +/** Build security response headers (HSTS, frame options, CSP, etc.). `secure` gates HSTS. */ export function buildSecurityHeaders(opts: boolean | SecurityOptions, secure: boolean): Headers { if (opts === false) return {}; - const o: SecurityOptions = opts === true ? {} : opts; - const h: Headers = {}; - if (o.noSniff !== false) h['x-content-type-options'] = 'nosniff'; - if (o.frameOptions !== false) h['x-frame-options'] = o.frameOptions ?? 'SAMEORIGIN'; - if (o.referrerPolicy !== false) h['referrer-policy'] = o.referrerPolicy ?? 'no-referrer'; - if (o.dnsPrefetchControl !== false) h['x-dns-prefetch-control'] = 'off'; - if (o.csp) h['content-security-policy'] = o.csp; - if (secure && o.hsts !== false) { - const hs = o.hsts && o.hsts !== true ? o.hsts : {}; - let v = `max-age=${hs.maxAge ?? HSTS_DEFAULT_MAXAGE}`; - if (hs.includeSubDomains) v += '; includeSubDomains'; - if (hs.preload) v += '; preload'; - h['strict-transport-security'] = v; + const options: SecurityOptions = opts === true ? {} : opts; + const headers: Headers = {}; + if (options.noSniff !== false) headers['x-content-type-options'] = 'nosniff'; + if (options.frameOptions !== false) headers['x-frame-options'] = options.frameOptions ?? 'SAMEORIGIN'; + if (options.referrerPolicy !== false) headers['referrer-policy'] = options.referrerPolicy ?? 'no-referrer'; + if (options.dnsPrefetchControl !== false) headers['x-dns-prefetch-control'] = 'off'; + if (options.csp) headers['content-security-policy'] = options.csp; + + if (secure && options.hsts !== false) { + const hsts = options.hsts && options.hsts !== true ? options.hsts : {}; + let value = `max-age=${hsts.maxAge ?? HSTS_DEFAULT_MAXAGE}`; + if (hsts.includeSubDomains) value += '; includeSubDomains'; + if (hsts.preload) value += '; preload'; + headers['strict-transport-security'] = value; } - return h; + + return headers; } function originAllowed(spec: CorsOptions['origins'], origin: string): boolean { @@ -58,36 +82,46 @@ function originAllowed(spec: CorsOptions['origins'], origin: string): boolean { return spec === origin; } -// req: minimal shape { headers: { origin? } } -export function resolveCors(opts: CorsOptions, req: { headers: Record }): Headers { - const h: Headers = {}; - const raw = req.headers['origin']; - const origin = Array.isArray(raw) ? raw[0] : raw; - if (!origin || !isValidOrigin(origin) || !originAllowed(opts.origins, origin)) return h; +/** Compute CORS response headers for a request. Returns `{}` when the origin is not allowed. */ +export function resolveCors( + opts: CorsOptions, + req: { headers: Record }, +): Headers { + const headers: Headers = {}; + const rawOrigin = req.headers['origin']; + const origin = Array.isArray(rawOrigin) ? rawOrigin[0] : rawOrigin; + if (!origin || !isValidOrigin(origin) || !originAllowed(opts.origins, origin)) return headers; // credentials => never '*'; echo concrete origin. Also echo when allowlist is dynamic. if (opts.credentials) { - h['access-control-allow-origin'] = origin; - h['access-control-allow-credentials'] = 'true'; - h['vary'] = mergeVary(h['vary'], 'Origin'); + headers['access-control-allow-origin'] = origin; + headers['access-control-allow-credentials'] = 'true'; + headers['vary'] = mergeVary(headers['vary'], 'Origin'); } else if (opts.origins === '*') { - h['access-control-allow-origin'] = '*'; + headers['access-control-allow-origin'] = '*'; } else { - h['access-control-allow-origin'] = origin; - h['vary'] = mergeVary(h['vary'], 'Origin'); + headers['access-control-allow-origin'] = origin; + headers['vary'] = mergeVary(headers['vary'], 'Origin'); } - if (opts.exposedHeaders?.length) h['access-control-expose-headers'] = opts.exposedHeaders.join(', '); - return h; + + if (opts.exposedHeaders?.length) headers['access-control-expose-headers'] = opts.exposedHeaders.join(', '); + return headers; } -// Preflight-specific headers (methods/allowed-headers/max-age). Call only for OPTIONS+ACRM. -export function corsPreflightHeaders(opts: CorsOptions, req: { headers: Record }): Headers { - const h = resolveCors(opts, req); - if (!h['access-control-allow-origin']) return h; // origin not allowed → bare 204 - h['access-control-allow-methods'] = (opts.methods ?? ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS']).join(', '); - const reqHdrs = req.headers['access-control-request-headers']; - h['access-control-allow-headers'] = opts.allowedHeaders?.join(', ') - ?? (Array.isArray(reqHdrs) ? reqHdrs.join(', ') : reqHdrs ?? '*'); - if (opts.maxAge != null) h['access-control-max-age'] = String(opts.maxAge); - return h; +/** Preflight-specific headers (methods/allowed-headers/max-age). Call only for OPTIONS+ACRM. */ +export function corsPreflightHeaders( + opts: CorsOptions, + req: { headers: Record }, +): Headers { + const headers = resolveCors(opts, req); + if (!headers['access-control-allow-origin']) return headers; // origin not allowed → bare 204 + headers['access-control-allow-methods'] = (opts.methods ?? ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS']).join( + ', ', + ); + const requestedHeaders = req.headers['access-control-request-headers']; + headers['access-control-allow-headers'] = + opts.allowedHeaders?.join(', ') ?? + (Array.isArray(requestedHeaders) ? requestedHeaders.join(', ') : (requestedHeaders ?? '*')); + if (opts.maxAge != null) headers['access-control-max-age'] = String(opts.maxAge); + return headers; } diff --git a/src/signals.ts b/src/signals.ts index 3b47c24..e7556bb 100644 --- a/src/signals.ts +++ b/src/signals.ts @@ -1,34 +1,56 @@ import type { StandardIssue } from './standard-schema'; +/** Error carrying an HTTP status code and optional response body. Base of all signals. */ export class HttpError extends Error { - constructor(readonly status: number, message?: string, readonly body?: unknown) { + constructor( + readonly status: number, + message?: string, + readonly body?: unknown, + ) { super(message ?? `HTTP ${status}`); this.name = new.target.name; } } +/** 401 Unauthorized. */ export class Unauthorized extends HttpError { - constructor(message?: string) { super(401, message); } + constructor(message?: string) { + super(401, message); + } } +/** 404 Not Found. */ export class NotFound extends HttpError { - constructor(message?: string) { super(404, message); } + constructor(message?: string) { + super(404, message); + } } +/** 304 Not Modified. */ export class NotModified extends HttpError { - constructor() { super(304); } + constructor() { + super(304); + } } +/** 302 redirect to `location`. */ export class Redirect extends HttpError { - constructor(readonly location: string) { super(302); } + constructor(readonly location: string) { + super(302); + } } +/** 422 raised when request input fails Standard Schema validation. */ export class ValidationError extends HttpError { - constructor(public issues: StandardIssue[], public source: string) { + constructor( + public issues: StandardIssue[], + public source: string, + ) { super(422, 'Validation failed'); } } -export function isHttpError(e: unknown): e is HttpError { - return e instanceof HttpError; +/** Type guard: true if `error` is an {@link HttpError}. */ +export function isHttpError(error: unknown): error is HttpError { + return error instanceof HttpError; } diff --git a/src/standard-schema.ts b/src/standard-schema.ts index dde28c1..c899c84 100644 --- a/src/standard-schema.ts +++ b/src/standard-schema.ts @@ -1,4 +1,6 @@ // src/standard-schema.ts — vendored Standard Schema (~standard) types + helpers. No imports. + +/** Standard Schema v1 interface (spec.standardschema.dev): a validator under the `~standard` key. */ export interface StandardSchemaV1 { readonly '~standard': { readonly version: 1; @@ -8,27 +10,31 @@ export interface StandardSchemaV1 { }; } +/** Validation outcome: either a parsed `value` or a list of `issues`. */ export type StandardResult = - | { readonly value: T; readonly issues?: undefined } - | { readonly issues: ReadonlyArray }; + { readonly value: T; readonly issues?: undefined } | { readonly issues: ReadonlyArray }; +/** A single validation issue with a message and optional path to the offending field. */ export interface StandardIssue { readonly message: string; readonly path?: ReadonlyArray; } -export function isStandardSchema(x: unknown): x is StandardSchemaV1 { +/** Type guard: true if `value` implements Standard Schema v1 (has a callable `~standard.validate`). */ +export function isStandardSchema(value: unknown): value is StandardSchemaV1 { return ( - typeof x === 'object' && x !== null && - '~standard' in x && - typeof (x as { ['~standard']?: { validate?: unknown } })['~standard']?.validate === 'function' + typeof value === 'object' && + value !== null && + '~standard' in value && + typeof (value as { ['~standard']?: { validate?: unknown } })['~standard']?.validate === 'function' ); } +/** Render an issue's path as a dotted string (e.g. `user.email`); empty if pathless. */ export function flattenPath(issue: StandardIssue): string { if (!issue.path) return ''; return issue.path - .map((seg) => (typeof seg === 'object' && seg !== null && 'key' in seg ? seg.key : seg)) - .map((k) => String(k)) + .map((segment) => (typeof segment === 'object' && segment !== null && 'key' in segment ? segment.key : segment)) + .map((key) => String(key)) .join('.'); } diff --git a/src/transformers.ts b/src/transformers.ts index 57c5989..e7aaf5a 100644 --- a/src/transformers.ts +++ b/src/transformers.ts @@ -2,29 +2,33 @@ import { isHttpError, Redirect, ValidationError } from './signals'; import type { TransformerFn } from './metadata'; import { flattenPath } from './standard-schema'; +/** Default transformer: serialize a handler's return value as a JSON `200` response. */ export const JsonTransformer: TransformerFn = (value) => ({ status: 200, headers: { 'content-type': 'application/json' }, body: JSON.stringify(value), }); -export function errorToResponse(e: unknown): { status: number; headers: Record; body: string } { - if (e instanceof ValidationError) { +/** Map a thrown value to a JSON error response (422 for validation, HttpError status, else 500). */ +export function errorToResponse(error: unknown): { status: number; headers: Record; body: string } { + if (error instanceof ValidationError) { return { status: 422, headers: { 'content-type': 'application/json' }, body: JSON.stringify({ error: 'Validation failed', - source: e.source, - issues: e.issues.map((i) => ({ path: flattenPath(i), message: i.message })), + source: error.source, + issues: error.issues.map((issue) => ({ path: flattenPath(issue), message: issue.message })), }), }; } - if (isHttpError(e)) { + + if (isHttpError(error)) { const headers: Record = { 'content-type': 'application/json' }; - if (e instanceof Redirect) headers.location = e.location; - return { status: e.status, headers, body: JSON.stringify({ error: e.message }) }; + if (error instanceof Redirect) headers.location = error.location; + return { status: error.status, headers, body: JSON.stringify({ error: error.message }) }; } + return { status: 500, headers: { 'content-type': 'application/json' }, diff --git a/test/app.test.ts b/test/app.test.ts index 6ed9190..616c996 100644 --- a/test/app.test.ts +++ b/test/app.test.ts @@ -72,8 +72,12 @@ test('optional provider failure warns but does not abort boot', async () => { class SysModule {} const app = createApp({ modules: [SysModule] }); + expect(app.degraded()).toEqual([]); // nothing degraded until boot runs const server = await app.listen(0); // must NOT throw expect(warn).toHaveBeenCalledWith(expect.stringContaining("optional provider 'cache' failed")); + // boot ends with a summary of everything running degraded, and it is queryable on the app + expect(warn).toHaveBeenCalledWith(expect.stringContaining('started with 1 degraded optional provider(s): cache')); + expect(app.degraded()).toEqual(['cache']); server.close(); warn.mockRestore(); }); diff --git a/test/mesh/integration.test.ts b/test/mesh/integration.test.ts index 8f6ee37..98bbf37 100644 --- a/test/mesh/integration.test.ts +++ b/test/mesh/integration.test.ts @@ -25,12 +25,12 @@ class TeacupModule {} describe('mesh skeleton integration', () => { it('teacup resolves remote app-scope + request-scope into a local handler', async () => { - const teapot = createApp({ modules: [TeapotModule], mesh: { secret: SECRET } }); + const teapot = createApp({ modules: [TeapotModule], experimental: true, mesh: { secret: SECRET } }); const tServer = await teapot.listen(0); const tPort = (tServer.address() as any).port; const url = `ws://127.0.0.1:${tPort}/__mesh__/control`; - const teacup = createApp({ modules: [TeacupModule], mesh: { teapots: [{ url, secret: SECRET }] } }); + const teacup = createApp({ modules: [TeacupModule], experimental: true, mesh: { teapots: [{ url, secret: SECRET }] } }); const cServer = await teacup.listen(0); const cPort = (cServer.address() as any).port; @@ -40,8 +40,12 @@ describe('mesh skeleton integration', () => { tServer.close(); cServer.close(); }); + it('mesh is gated behind experimental: true', () => { + expect(() => createApp({ modules: [TeapotModule], mesh: { secret: SECRET } })).toThrow(/alpha feature/); + }); + it('teapot still serves its own local route (regression)', async () => { - const app = createApp({ modules: [TeapotModule], mesh: { secret: SECRET } }); + const app = createApp({ modules: [TeapotModule], experimental: true, mesh: { secret: SECRET } }); const s = await app.listen(0); const p = (s.address() as any).port; const res = await fetch(`http://127.0.0.1:${p}/api/remote/ping`); expect(await res.json()).toEqual({ pong: true }); @@ -49,9 +53,9 @@ describe('mesh skeleton integration', () => { }); it('rejects a bad secret (teacup boot fails)', async () => { - const teapot = createApp({ modules: [TeapotModule], mesh: { secret: SECRET } }); + const teapot = createApp({ modules: [TeapotModule], experimental: true, mesh: { secret: SECRET } }); const tServer = await teapot.listen(0); const tPort = (tServer.address() as any).port; - const teacup = createApp({ modules: [TeacupModule], mesh: { teapots: [{ url: `ws://127.0.0.1:${tPort}/__mesh__/control`, secret: 'WRONG' }], timeoutMs: 800 } }); + const teacup = createApp({ modules: [TeacupModule], experimental: true, mesh: { teapots: [{ url: `ws://127.0.0.1:${tPort}/__mesh__/control`, secret: 'WRONG' }], timeoutMs: 800 } }); await expect(teacup.listen(0)).rejects.toThrow(); tServer.close(); }); diff --git a/test/mesh/teacup.test.ts b/test/mesh/teacup.test.ts index fa46063..81f026c 100644 --- a/test/mesh/teacup.test.ts +++ b/test/mesh/teacup.test.ts @@ -11,7 +11,7 @@ const fakeLink = (calls: any[]): Link => ({ describe('teacup buildRemote', () => { it('makes a provider node (app) and a step node (request) with RPC runners returning merge objects', async () => { const calls: any[] = []; - const { providers, steps } = buildRemote(fakeLink(calls), 'ws://t'); + const { providers, steps } = buildRemote(fakeLink(calls)); expect(providers.map((p) => p.name)).toEqual(['config']); expect(steps.map((s) => s.name)).toEqual(['auth']); expect(await providers[0].run({})).toEqual({ config: { url: 'db://x' } }); @@ -22,7 +22,7 @@ describe('teacup buildRemote', () => { it('makes a proxy route entry with method+pattern', async () => { const calls: any[] = []; - const { routes } = buildRemote(fakeLink(calls), 'ws://t'); + const { routes } = buildRemote(fakeLink(calls)); expect(routes[0]).toMatchObject({ method: 'GET', pattern: '/u/:id' }); }); diff --git a/test/multipart.test.ts b/test/multipart.test.ts index e90366c..fa92033 100644 --- a/test/multipart.test.ts +++ b/test/multipart.test.ts @@ -3,10 +3,7 @@ import { parseMultipart, extractBoundary } from '../src/multipart'; const B = 'X-BOUND'; function body(parts: string[]): Buffer { - return Buffer.concat([ - ...parts.map((p) => Buffer.from(`--${B}\r\n${p}\r\n`)), - Buffer.from(`--${B}--\r\n`), - ]); + return Buffer.concat([...parts.map((p) => Buffer.from(`--${B}\r\n${p}\r\n`)), Buffer.from(`--${B}--\r\n`)]); } const field = (name: string, val: string) => `Content-Disposition: form-data; name="${name}"\r\n\r\n${val}`; const file = (name: string, fn: string, ct: string, data: string) => @@ -22,61 +19,67 @@ describe('extractBoundary', () => { }); describe('parseMultipart', () => { - it('single text field is NOT lost (first-part off-by-one guard)', () => { - const r = parseMultipart(body([field('title', 'hello')]), B, opts); + it('single text field is decoded', async () => { + const r = await parseMultipart(body([field('title', 'hello')]), B, opts); expect(r.fields.title).toBe('hello'); }); - it('multiple distinct fields', () => { - const r = parseMultipart(body([field('a', '1'), field('b', '2')]), B, opts); + + it('multiple distinct fields', async () => { + const r = await parseMultipart(body([field('a', '1'), field('b', '2')]), B, opts); expect(r.fields).toEqual({ a: '1', b: '2' }); }); - it("duplicates 'last' vs 'array'", () => { + + it("duplicates 'last' vs 'array'", async () => { const b = body([field('t', 'x'), field('t', 'y')]); - expect(parseMultipart(b, B, { maxParts: 1000, duplicates: 'last' }).fields.t).toBe('y'); - expect(parseMultipart(b, B, { maxParts: 1000, duplicates: 'array' }).fields.t).toEqual(['x', 'y']); + expect((await parseMultipart(b, B, { maxParts: 1000, duplicates: 'last' })).fields.t).toBe('y'); + expect((await parseMultipart(b, B, { maxParts: 1000, duplicates: 'array' })).fields.t).toEqual(['x', 'y']); }); - it('single file: metadata + exact bytes incl. embedded CRLF and boundary-like text', () => { - const payload = 'ab\r\n--X-BOUNDnope\r\ncd'; - const r = parseMultipart(body([file('doc', 'a.txt', 'text/plain', payload)]), B, opts); + + it('single file: metadata + exact bytes incl. embedded CRLF and dashes', async () => { + // A real boundary is a random token that never appears in content; this exercises CRLF + `--` runs. + const payload = 'ab\r\ncd\r\n--decoy--\r\nef'; + const r = await parseMultipart(body([file('doc', 'a.txt', 'text/plain', payload)]), B, opts); const f = r.files.doc as any; expect(f.filename).toBe('a.txt'); expect(f.contentType).toBe('text/plain'); expect(f.size).toBe(Buffer.byteLength(payload)); expect(f.data.toString()).toBe(payload); }); - it('multiple files same name → array', () => { - const r = parseMultipart(body([file('f', '1', 'text/plain', 'a'), file('f', '2', 'text/plain', 'b')]), B, opts); + + it('multiple files same name → array', async () => { + const r = await parseMultipart( + body([file('f', '1', 'text/plain', 'a'), file('f', '2', 'text/plain', 'b')]), + B, + opts, + ); expect(Array.isArray(r.files.f)).toBe(true); expect((r.files.f as any).length).toBe(2); }); - it('mixed fields + files', () => { - const r = parseMultipart(body([field('name', 'joe'), file('avatar', 'p.png', 'image/png', 'PNG')]), B, opts); + + it('mixed fields + files', async () => { + const r = await parseMultipart(body([field('name', 'joe'), file('avatar', 'p.png', 'image/png', 'PNG')]), B, opts); expect(r.fields.name).toBe('joe'); expect((r.files.avatar as any).filename).toBe('p.png'); }); - it('case-insensitive headers + filename-before-name (order independent)', () => { + + it('case-insensitive headers + filename-before-name (order independent)', async () => { const part = `content-disposition: form-data; filename="z.bin"; name="up"\r\ncontent-type: application/octet-stream\r\n\r\nDATA`; - const r = parseMultipart(body([part]), B, opts); + const r = await parseMultipart(body([part]), B, opts); expect((r.files.up as any).filename).toBe('z.bin'); }); - it('filename="" with empty body is skipped', () => { + + it('filename="" with empty body is skipped', async () => { const part = `Content-Disposition: form-data; name="up"; filename=""\r\n\r\n`; - const r = parseMultipart(body([part]), B, opts); + const r = await parseMultipart(body([part]), B, opts); expect(r.files.up).toBeUndefined(); }); - it('malformed → throws: no boundary present', () => { - expect(() => parseMultipart(Buffer.from('garbage'), B, opts)).toThrow(); - }); - it('malformed → throws: part without name', () => { - const part = `Content-Disposition: form-data\r\n\r\nx`; - expect(() => parseMultipart(body([part]), B, opts)).toThrow(); - }); - it('malformed → throws: part with no header/body separator', () => { - const raw = Buffer.from(`--${B}\r\nContent-Disposition: form-data; name="a"\r\n--${B}--\r\n`); - expect(() => parseMultipart(raw, B, opts)).toThrow(); - }); - it('parts over maxParts → throws', () => { + + it('more parts than maxParts → rejects', async () => { const b = body([field('a', '1'), field('b', '2'), field('c', '3')]); - expect(() => parseMultipart(b, B, { maxParts: 2, duplicates: 'last' })).toThrow(); + await expect(parseMultipart(b, B, { maxParts: 2, duplicates: 'last' })).rejects.toThrow(); + }); + + it('malformed input with no matching boundary → rejects', async () => { + await expect(parseMultipart(Buffer.from('garbage'), B, opts)).rejects.toThrow(); }); }); diff --git a/test/params.test.ts b/test/params.test.ts index 7de01ec..4dd1b7b 100644 --- a/test/params.test.ts +++ b/test/params.test.ts @@ -1,6 +1,19 @@ import 'reflect-metadata'; import { expect, test, describe, it } from 'vitest'; -import { needs, ctx, param, query, body, inbound, abort, getArgs, getHandlerNeeds, resolveArgs } from '../src/params'; +import { + needs, + ctx, + param, + query, + body, + headers, + header, + inbound, + abort, + getArgs, + getHandlerNeeds, + resolveArgs, +} from '../src/params'; import { ValidationError } from '../src/signals'; class Ctl { @@ -10,7 +23,9 @@ class Ctl { @query() _q: unknown, @query(['a', 'b']) _sub: unknown, @ctx() _c: unknown, - ) { return null; } + ) { + return null; + } } test('getArgs returns specs sorted by parameter index', () => { @@ -43,13 +58,21 @@ test('resolveArgs builds positional args from context', async () => { }); test('a handler with no arg decorators resolves to no args', async () => { - class Bare { ping() { return 1; } } + class Bare { + ping() { + return 1; + } + } expect(await resolveArgs(getArgs(Bare, 'ping'), {})).toEqual([]); }); describe('@inbound / @abort', () => { it('resolves inbound and abort from reserved context keys, not as bags', async () => { - class Ctl { handle(@inbound() inc: AsyncIterable, @abort() sig: AbortSignal) { return [inc, sig]; } } + class Ctl { + handle(@inbound() inc: AsyncIterable, @abort() sig: AbortSignal) { + return [inc, sig]; + } + } const specs = getArgs(Ctl, 'handle'); const ac = new AbortController(); const inc = (async function* () {})(); @@ -59,14 +82,47 @@ describe('@inbound / @abort', () => { }); it('inbound/abort do not count as graph needs', () => { - class Ctl { handle(@inbound() _i: AsyncIterable, @abort() _a: AbortSignal) {} } + class Ctl { + handle(@inbound() _i: AsyncIterable, @abort() _a: AbortSignal) {} + } expect(getHandlerNeeds(getArgs(Ctl, 'handle'))).toEqual([]); }); }); +describe('@headers / @header', () => { + const reqHeaders = { authorization: 'Bearer t0ken', 'x-trace': 'abc', 'x-count': '5' }; + + it('@header(name) and @headers(name) both pick a single header', async () => { + class Ctl { + handle(@header('authorization') _auth: string, @headers('x-trace') _trace: string) {} + } + const args = await resolveArgs(getArgs(Ctl, 'handle'), { headers: reqHeaders }); + expect(args[0]).toBe('Bearer t0ken'); + expect(args[1]).toBe('abc'); + }); + + it('@headers() returns the whole bag and @headers([...]) picks several', async () => { + class Ctl { + handle(@headers() _all: unknown, @headers(['authorization', 'x-trace']) _some: unknown) {} + } + const args = await resolveArgs(getArgs(Ctl, 'handle'), { headers: reqHeaders }); + expect(args[0]).toEqual(reqHeaders); + expect(args[1]).toEqual({ authorization: 'Bearer t0ken', 'x-trace': 'abc' }); + }); + + it('@header(name, schema) validates the picked header', async () => { + class Ctl { + handle(@header('x-count', numFromStr) _count: number) {} + } + const args = await resolveArgs(getArgs(Ctl, 'handle'), { headers: reqHeaders }); + expect(args[0]).toBe(5); + }); +}); + const numFromStr = { '~standard': { - version: 1 as const, vendor: 'test', + version: 1 as const, + vendor: 'test', validate: (v: unknown) => { const n = Number(v); return Number.isNaN(n) ? { issues: [{ message: 'not a number', path: ['n'] }] } : { value: n }; @@ -79,7 +135,9 @@ const asyncSchema = { describe('resolveArgs validation', () => { it('valid: substitutes the parsed/coerced value; ctx source untouched', async () => { - class C { m(@query(numFromStr) _q: number) {} } + class C { + m(@query(numFromStr) _q: number) {} + } const specs = getArgs(C, 'm'); const ctx: any = { query: '42' }; const args = await resolveArgs(specs, ctx); @@ -87,29 +145,45 @@ describe('resolveArgs validation', () => { expect(ctx.query).toBe('42'); }); it('invalid: throws ValidationError with source', async () => { - class C { m(@body(numFromStr) _b: number) {} } + class C { + m(@body(numFromStr) _b: number) {} + } const specs = getArgs(C, 'm'); await expect(resolveArgs(specs, { body: 'nope' })).rejects.toBeInstanceOf(ValidationError); - await resolveArgs(specs, { body: 'nope' }).catch((e) => { expect(e.source).toBe('body'); expect(e.issues[0].message).toBe('not a number'); }); + await resolveArgs(specs, { body: 'nope' }).catch((e) => { + expect(e.source).toBe('body'); + expect(e.issues[0].message).toBe('not a number'); + }); }); it('async schema is awaited', async () => { - class C { m(@body(asyncSchema) _b: string) {} } + class C { + m(@body(asyncSchema) _b: string) {} + } const args = await resolveArgs(getArgs(C, 'm'), { body: 'x' }); expect(args[0]).toBe('async:x'); }); it('@param(name, schema) validates the named param (slot-2 schema)', async () => { - class C { m(@param('id', numFromStr) _id: number) {} } + class C { + m(@param('id', numFromStr) _id: number) {} + } const args = await resolveArgs(getArgs(C, 'm'), { params: { id: '7' } }); expect(args[0]).toBe(7); }); it('non-schema decorators unchanged: @body("key"), @body(), @query(["a","b"])', async () => { - class C { m(@body('x') _x: any, @body() _b: any, @query(['a', 'b']) _q: any) {} } + class C { + m(@body('x') _x: any, @body() _b: any, @query(['a', 'b']) _q: any) {} + } const args = await resolveArgs(getArgs(C, 'm'), { body: { x: 1, y: 2 }, query: { a: 'A', b: 'B', c: 'C' } }); expect(args[0]).toBe(1); expect(args[1]).toEqual({ x: 1, y: 2 }); expect(args[2]).toEqual({ a: 'A', b: 'B' }); }); it('decoration-time guard: a non-schema object throws', () => { - expect(() => { class C { m(@body({} as any) _b: any) {} } return C; }).toThrow(); + expect(() => { + class C { + m(@body({} as any) _b: any) {} + } + return C; + }).toThrow(); }); }); diff --git a/test/router.test.ts b/test/router.test.ts new file mode 100644 index 0000000..8211960 --- /dev/null +++ b/test/router.test.ts @@ -0,0 +1,52 @@ +import { describe, it, expect } from 'vitest'; +import { matchPattern, matchRoute, allowedMethods } from '../src/http/router'; +import type { RouteDef } from '../src/http/types'; + +const route = (method: string, pattern: string): RouteDef => ({ + method, + pattern, + transport: 'buffer', + handler: async () => ({ status: 200, headers: {}, body: '' }), +}); + +describe('matchPattern', () => { + it('matches static and :param segments, decoding params', () => { + expect(matchPattern('/users/:id', '/users/a%20b')).toEqual({ id: 'a b' }); + expect(matchPattern('/users/:id', '/users')).toBeUndefined(); + expect(matchPattern('/users', '/users/1')).toBeUndefined(); + }); + + it(':name* captures the rest of the path, slashes included', () => { + expect(matchPattern('/files/:path*', '/files/img/2026/logo.png')).toEqual({ path: 'img/2026/logo.png' }); + expect(matchPattern('/files/:path*', '/files/a%2Fb')).toEqual({ path: 'a/b' }); + }); + + it(':name* matches zero remaining segments as an empty string', () => { + expect(matchPattern('/files/:path*', '/files')).toEqual({ path: '' }); + }); +}); + +describe('matchRoute precedence', () => { + it('static beats :param beats catch-all regardless of registration order', () => { + const routes = [route('GET', '/a/:rest*'), route('GET', '/a/:id'), route('GET', '/a/b')]; + expect(matchRoute(routes, 'GET', '/a/b')?.def.pattern).toBe('/a/b'); + expect(matchRoute(routes, 'GET', '/a/x')?.def.pattern).toBe('/a/:id'); + expect(matchRoute(routes, 'GET', '/a/x/y')?.def.pattern).toBe('/a/:rest*'); + }); + + it('returns undefined when no pattern matches the path', () => { + expect(matchRoute([route('GET', '/a')], 'GET', '/b')).toBeUndefined(); + }); + + it('does not match a route registered under a different method', () => { + expect(matchRoute([route('POST', '/a')], 'GET', '/a')).toBeUndefined(); + }); +}); + +describe('allowedMethods (405 support)', () => { + it('lists distinct methods whose pattern matches the path', () => { + const routes = [route('GET', '/a'), route('POST', '/a'), route('GET', '/b')]; + expect(allowedMethods(routes, '/a').sort()).toEqual(['GET', 'POST']); + expect(allowedMethods(routes, '/nope')).toEqual([]); + }); +}); diff --git a/test/smoke.test.ts b/test/smoke.test.ts index 76a7aa3..4267eb2 100644 --- a/test/smoke.test.ts +++ b/test/smoke.test.ts @@ -1,6 +1,6 @@ import { expect, test } from 'vitest'; import { VERSION } from '../src/index'; -test('package loads and exposes VERSION', () => { - expect(VERSION).toBe('0.0.0'); +test('package loads and exposes a CalVer VERSION', () => { + expect(VERSION).toMatch(/^\d{2}\.\d{2}\.\d+(-beta\.\d+)?$/); }); diff --git a/test/transport-security.test.ts b/test/transport-security.test.ts index 7f880d9..3228f5a 100644 --- a/test/transport-security.test.ts +++ b/test/transport-security.test.ts @@ -187,7 +187,7 @@ describe('CORS', () => { expect(r.headers.get('access-control-allow-credentials')).toBe('true'); }); - it('disallowed origin → no allow-origin; bare OPTIONS (no ACRM) falls through to 404', async () => { + it('disallowed origin → no allow-origin; bare OPTIONS (no ACRM) → 405 Allow for an existing path', async () => { @Route('/') class C { @Get('/x') x() { return { ok: 1 }; } } @Module({ mountpoint: '/', controllers: [C] }) class CMod {} app = createApp({ modules: [CMod], cors: { origins: 'https://a.com' } }); @@ -195,8 +195,11 @@ describe('CORS', () => { const port = (server.address() as any).port; const r = await fetch(`http://127.0.0.1:${port}/x`, { headers: { origin: 'https://evil.com' } }); expect(r.headers.get('access-control-allow-origin')).toBeNull(); - const bare = await fetch(`http://127.0.0.1:${port}/x`, { method: 'OPTIONS' }); // no ACRM - expect(bare.status).toBe(404); + // A bare OPTIONS (no Access-Control-Request-Method) isn't a CORS preflight; the path exists + // under GET, so the router answers 405 with an Allow header rather than 404. + const bare = await fetch(`http://127.0.0.1:${port}/x`, { method: 'OPTIONS' }); + expect(bare.status).toBe(405); + expect(bare.headers.get('allow')).toContain('GET'); }); it("merges a handler's Title-Case Vary with CORS's Origin", async () => { diff --git a/tsup.config.ts b/tsup.config.ts new file mode 100644 index 0000000..20e97ef --- /dev/null +++ b/tsup.config.ts @@ -0,0 +1,22 @@ +import { defineConfig } from 'tsup'; + +// Dual build: CJS (dist/index.js) + ESM (dist/index.mjs) + type declarations, from one entry. +// tsup injects a createRequire shim into the ESM output so the lazy require('ws') / require('busboy') +// (optional peer deps) keep working there. reflect-metadata and the peer deps stay external. +export default defineConfig({ + entry: ['src/index.ts'], + format: ['cjs', 'esm'], + dts: true, + clean: true, + sourcemap: true, + target: 'node18', + // Give the ESM output a real `require` (via createRequire) so the lazy require('ws') / require('busboy') + // (optional peer deps) resolve instead of hitting esbuild's "Dynamic require not supported" stub. + esbuildOptions(options, context) { + if (context.format === 'esm') { + options.banner = { + js: "import { createRequire as _createRequire } from 'node:module'; const require = _createRequire(import.meta.url);", + }; + } + }, +}); diff --git a/website/astro.config.mjs b/website/astro.config.mjs new file mode 100644 index 0000000..ad5f45a --- /dev/null +++ b/website/astro.config.mjs @@ -0,0 +1,53 @@ +import { defineConfig } from 'astro/config'; +import starlight from '@astrojs/starlight'; + +// Docs site for @green-tea/core. Content lives in src/content/docs/**. +export default defineConfig({ + site: 'https://green-tea.dev', + integrations: [ + starlight({ + title: 'green-tea', + description: 'A calm, type-safe HTTP framework for Node — your API is an explicit dependency graph.', + tableOfContents: { minHeadingLevel: 2, maxHeadingLevel: 3 }, + sidebar: [ + { + label: 'Start here', + items: [ + { label: 'Introduction', link: '/' }, + { label: 'Getting started', slug: 'getting-started' }, + ], + }, + { + label: 'Concepts', + items: [ + { label: 'The dependency graph', slug: 'concepts/the-graph' }, + { label: 'The typed flow core', slug: 'concepts/flow' }, + ], + }, + { + label: 'Guides', + items: [ + { label: 'Routing', slug: 'guides/routing' }, + { label: 'Dependency injection', slug: 'guides/dependency-injection' }, + { label: 'Argument decorators', slug: 'guides/arguments' }, + { label: 'Validation', slug: 'guides/validation' }, + { label: 'Streaming & real-time', slug: 'guides/streaming' }, + { label: 'File uploads', slug: 'guides/uploads' }, + { label: 'Transport security', slug: 'guides/security' }, + { label: 'Plugins & observability', slug: 'guides/plugins' }, + { label: 'Graph introspection', slug: 'guides/introspection' }, + { label: 'Testing', slug: 'guides/testing' }, + { label: 'Mesh (alpha)', slug: 'guides/mesh', badge: { text: 'alpha', variant: 'caution' } }, + ], + }, + { + label: 'Reference', + items: [ + { label: 'Decorators', slug: 'reference/decorators' }, + { label: 'createApp options', slug: 'reference/createapp' }, + ], + }, + ], + }), + ], +}); diff --git a/website/package-lock.json b/website/package-lock.json new file mode 100644 index 0000000..25266d2 --- /dev/null +++ b/website/package-lock.json @@ -0,0 +1,6866 @@ +{ + "name": "green-tea-docs", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "green-tea-docs", + "dependencies": { + "@astrojs/starlight": "^0.41.3", + "astro": "^7.0.6", + "sharp": "^0.35.3" + } + }, + "node_modules/@astrojs/compiler-binding": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding/-/compiler-binding-0.3.0.tgz", + "integrity": "sha512-zlsOT5COD9hRwplJCgQhS21unxON5AKirf0vgt1ijXwuseYIaZdm2ZOpF8fsz+DY9EyXx+I/ukxtg7uoBep68A==", + "license": "MIT", + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@astrojs/compiler-binding-darwin-arm64": "0.3.0", + "@astrojs/compiler-binding-darwin-x64": "0.3.0", + "@astrojs/compiler-binding-linux-arm64-gnu": "0.3.0", + "@astrojs/compiler-binding-linux-arm64-musl": "0.3.0", + "@astrojs/compiler-binding-linux-x64-gnu": "0.3.0", + "@astrojs/compiler-binding-linux-x64-musl": "0.3.0", + "@astrojs/compiler-binding-wasm32-wasi": "0.3.0", + "@astrojs/compiler-binding-win32-arm64-msvc": "0.3.0", + "@astrojs/compiler-binding-win32-x64-msvc": "0.3.0" + } + }, + "node_modules/@astrojs/compiler-binding-darwin-arm64": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-darwin-arm64/-/compiler-binding-darwin-arm64-0.3.0.tgz", + "integrity": "sha512-3n0uu+uJpnCq8b4JFi3uGDsIisAvHctxSmH+cIO9Gbei1H1Y1QXaYboXyiWJugUmprr3OEYP7+LdodzpVFzLMQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@astrojs/compiler-binding-darwin-x64": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-darwin-x64/-/compiler-binding-darwin-x64-0.3.0.tgz", + "integrity": "sha512-scxNGKjOBydMo1QR4LtK0FMgh7ubQomJDv953nz2msQFkPKke/0FpPv/cQM0T/kuZdReZQFU8Oz3iOrP/6WHEg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@astrojs/compiler-binding-linux-arm64-gnu": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-arm64-gnu/-/compiler-binding-linux-arm64-gnu-0.3.0.tgz", + "integrity": "sha512-NZrWLolVUANmrnl0zrFK/Sx5Sock1gEUT49ALfMTTCA5Ya2ec/BoJXMIg4KgE+wZcrdXJ8e+WyEhM7YLk/FJkA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@astrojs/compiler-binding-linux-arm64-musl": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-arm64-musl/-/compiler-binding-linux-arm64-musl-0.3.0.tgz", + "integrity": "sha512-PjwRmKgMFDsFhg82g0poXlIY8Qn3fMA3hXjaR0coJWJzTJsRH9ATU0j2ocigjtU1h3vL/yR7yLUxGj/lTCq73g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@astrojs/compiler-binding-linux-x64-gnu": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-x64-gnu/-/compiler-binding-linux-x64-gnu-0.3.0.tgz", + "integrity": "sha512-Dr69VJYlnSfyL8gzELW6S4mE41P7TDPn1IKjwMnjdZ7+dxgJI50oMLFSk1LVe26bHmWB3ktuh8fDVK1THI9e9A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@astrojs/compiler-binding-linux-x64-musl": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-linux-x64-musl/-/compiler-binding-linux-x64-musl-0.3.0.tgz", + "integrity": "sha512-AEt+bRw8PfImCcyRH1lpXVB8CdmQ1K/wPo5u99iec4/U/XdNvQZ715YVuNzIJpbJXelgQeZ5H2+Ea7XwRyWY5g==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@astrojs/compiler-binding-wasm32-wasi": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-wasm32-wasi/-/compiler-binding-wasm32-wasi-0.3.0.tgz", + "integrity": "sha512-U80tA1j8V6LjhiTZzVCtG4E8hrNVVNXDGV5fCgJ94q8FU9CPH+XwdDDhLzBybfWhKfyItXmQiZNRPTiPCYTpVg==", + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@napi-rs/wasm-runtime": "^1.1.6" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@astrojs/compiler-binding-win32-arm64-msvc": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-win32-arm64-msvc/-/compiler-binding-win32-arm64-msvc-0.3.0.tgz", + "integrity": "sha512-CpY1RII2r1XMpOUVD1VR/F2wtuRsiOCkFULS10Khyj8/DFZMtxVuUCAWGw+CW2Ka0h6eP3Xc1CA+glFlvXMPxA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@astrojs/compiler-binding-win32-x64-msvc": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-binding-win32-x64-msvc/-/compiler-binding-win32-x64-msvc-0.3.0.tgz", + "integrity": "sha512-qmFbs769oeeGrRebAnCW7aBk8m71vf85W/dX/jddfx5Z06/w0wf7TZCfJPOX1Fld2t+4N+iXzfGEJG+zJQ+bzg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@astrojs/compiler-rs": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@astrojs/compiler-rs/-/compiler-rs-0.3.0.tgz", + "integrity": "sha512-J2qEVHtIDjEM9TxwmwuebOGmZNwhKu/dR7P7qBpnJKGmBBX0vdweQ/4cEXhj8fBbWVUB5V12xWChri3CgKNULQ==", + "license": "MIT", + "dependencies": { + "@astrojs/compiler-binding": "0.3.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@astrojs/internal-helpers": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/@astrojs/internal-helpers/-/internal-helpers-0.10.1.tgz", + "integrity": "sha512-5phcroT/vmOOrYuuAxtkbPixy5hePtlz9i8K4OeDv3dNK6/UQRuXPOSRTxIOBbUY5Sonw2UaxjbuVc43Mcir6Q==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.4", + "@types/mdast": "^4.0.4", + "js-yaml": "^4.1.1", + "picomatch": "^4.0.4", + "retext-smartypants": "^6.2.0", + "shiki": "^4.0.2", + "smol-toml": "^1.6.0", + "unified": "^11.0.5" + } + }, + "node_modules/@astrojs/markdown-remark": { + "version": "7.2.1", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-remark/-/markdown-remark-7.2.1.tgz", + "integrity": "sha512-jPVNIqTvk+yKviikszv/Y1U4jGUSKpp/Nw48QZV4qjWgp70j4Lkq3lhSDRbWwCfgKvEyO9GHuVbV1dM2WYXy1w==", + "license": "MIT", + "dependencies": { + "@astrojs/internal-helpers": "0.10.1", + "@astrojs/prism": "4.0.2", + "github-slugger": "^2.0.0", + "hast-util-from-html": "^2.0.3", + "hast-util-to-text": "^4.0.2", + "mdast-util-definitions": "^6.0.0", + "rehype-raw": "^7.0.0", + "rehype-stringify": "^10.0.1", + "remark-gfm": "^4.0.1", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.1.2", + "remark-smartypants": "^3.0.2", + "unified": "^11.0.5", + "unist-util-remove-position": "^5.0.0", + "unist-util-visit": "^5.1.0", + "unist-util-visit-parents": "^6.0.2", + "vfile": "^6.0.3" + } + }, + "node_modules/@astrojs/markdown-satteri": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/@astrojs/markdown-satteri/-/markdown-satteri-0.3.3.tgz", + "integrity": "sha512-Lje33Ittd8UQGgbIIWQvhPkj5X5c4b1sZnZWX3JQV/AWpfbuQGxVi2ONt6+ScydcwfR4egilslEWyczMclrJ1g==", + "license": "MIT", + "dependencies": { + "@astrojs/internal-helpers": "0.10.1", + "@astrojs/prism": "4.0.2", + "github-slugger": "^2.0.0", + "satteri": "^0.9.1" + } + }, + "node_modules/@astrojs/mdx": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@astrojs/mdx/-/mdx-7.0.2.tgz", + "integrity": "sha512-l+sJY5U1KkGZUdr+bIL4Y6BefeS549qoSHVSkUSs6A9INwdCND+/0+vN0NroPBXwl5Vcg5u78t7VQRsJjePxbw==", + "license": "MIT", + "dependencies": { + "@astrojs/internal-helpers": "0.10.1", + "@astrojs/markdown-remark": "7.2.1", + "@mdx-js/mdx": "^3.1.1", + "acorn": "^8.16.0", + "es-module-lexer": "^2.0.0", + "estree-util-visit": "^2.0.0", + "hast-util-to-html": "^9.0.5", + "piccolore": "^0.1.3", + "rehype-raw": "^7.0.0", + "remark-gfm": "^4.0.1", + "remark-smartypants": "^3.0.2", + "source-map": "^0.7.6", + "unist-util-visit": "^5.1.0", + "vfile": "^6.0.3" + }, + "engines": { + "node": ">=22.12.0" + }, + "peerDependencies": { + "@astrojs/markdown-satteri": "^0.3.1", + "astro": "^7.0.0" + }, + "peerDependenciesMeta": { + "@astrojs/markdown-satteri": { + "optional": true + } + } + }, + "node_modules/@astrojs/prism": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@astrojs/prism/-/prism-4.0.2.tgz", + "integrity": "sha512-KTivpmnz6lDsC6o9H4+DNm2SrE/GHzw8cNAvEJwAvUT+eoaEnn/4NtbDNfRRaxaJHdp15gf+tfHAWiXR4wB3BA==", + "license": "MIT", + "dependencies": { + "prismjs": "^1.30.0" + }, + "engines": { + "node": ">=22.12.0" + } + }, + "node_modules/@astrojs/sitemap": { + "version": "3.7.3", + "resolved": "https://registry.npmjs.org/@astrojs/sitemap/-/sitemap-3.7.3.tgz", + "integrity": "sha512-f8euLVsyeAmAkSm/1M2Kb8sL8byQmfgbvBNaHFItCheTj/IpiJYSEWVcqDHZ/yEHxiS7+w87mQkzwZaPHmk5GA==", + "license": "MIT", + "dependencies": { + "sitemap": "^9.0.0", + "stream-replace-string": "^2.0.0", + "zod": "^4.3.6" + } + }, + "node_modules/@astrojs/starlight": { + "version": "0.41.3", + "resolved": "https://registry.npmjs.org/@astrojs/starlight/-/starlight-0.41.3.tgz", + "integrity": "sha512-8xsG6UpK581TJmtOc7/pnxHKEbP16rV06VLWaVa7FOyE/VEwnaHOsLtL+miifCEfuiuv0Wn+j8u3JSluRQesMQ==", + "license": "MIT", + "dependencies": { + "@astrojs/markdown-satteri": "^0.3.2", + "@astrojs/mdx": "^7.0.0", + "@astrojs/sitemap": "^3.7.2", + "@pagefind/default-ui": "^1.3.0", + "@types/hast": "^3.0.4", + "@types/js-yaml": "^4.0.9", + "@types/mdast": "^4.0.4", + "astro-expressive-code": "^0.44.0", + "bcp-47": "^2.1.0", + "hast-util-from-html": "^2.0.3", + "hast-util-select": "^6.0.4", + "hast-util-to-string": "^3.0.1", + "hastscript": "^9.0.1", + "i18next": "^26.0.7", + "js-yaml": "^4.1.1", + "klona": "^2.0.6", + "magic-string": "^0.30.21", + "mdast-util-directive": "^3.1.0", + "mdast-util-to-markdown": "^2.1.2", + "mdast-util-to-string": "^4.0.0", + "pagefind": "^1.5.2", + "rehype": "^13.0.2", + "rehype-format": "^5.0.1", + "remark-directive": "^4.0.0", + "satteri": "^0.9.1", + "ultrahtml": "^1.6.0", + "unified": "^11.0.5", + "unist-util-visit": "^5.1.0", + "vfile": "^6.0.3" + }, + "peerDependencies": { + "@astrojs/markdown-remark": "^7.2.0", + "astro": "^7.0.2" + }, + "peerDependenciesMeta": { + "@astrojs/markdown-remark": { + "optional": true + } + } + }, + "node_modules/@astrojs/telemetry": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/@astrojs/telemetry/-/telemetry-3.3.2.tgz", + "integrity": "sha512-j8DNruA8ors99Al39RYZPJK4DC1bKkoNm93mAMuBhY9TCNC4R8n1q7ovFnJ5qhGh5Lsh7pa1gpQVpYpsJPeTHQ==", + "license": "MIT", + "dependencies": { + "ci-info": "^4.4.0", + "dset": "^3.1.4", + "is-docker": "^4.0.0", + "is-wsl": "^3.1.1", + "which-pm-runs": "^1.1.0" + }, + "engines": { + "node": "18.20.8 || ^20.3.0 || >=22.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==", + "license": "MIT", + "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==", + "license": "MIT", + "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==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.7" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.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==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@bruits/satteri-darwin-arm64": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-darwin-arm64/-/satteri-darwin-arm64-0.9.4.tgz", + "integrity": "sha512-W3MSUkr2mZRR8Stoe+lqNAyzQzRuFMU8WffV9IvFSxTok0LGWR0ZZQPLELU4QTRiUbhL2Y4VUP9vV7pj8rHjgg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@bruits/satteri-darwin-x64": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-darwin-x64/-/satteri-darwin-x64-0.9.4.tgz", + "integrity": "sha512-DXOuuaE1lsv7mpk2mOvGrzqoEWEvOIZEO/fXVa7zfM23Iob+CBjBkRAMwpHA4pmZ3j6Gj7WJzPKw0kQ7w741AQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@bruits/satteri-linux-arm64-gnu": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-arm64-gnu/-/satteri-linux-arm64-gnu-0.9.4.tgz", + "integrity": "sha512-gJxU9rGGoqIznSEgEzpjxkry24jeHuMpoo1tCIAhHYh7WaD3j5F8zt3jmHxEaN1Uwa+K5+wFgIR2uIGOnMzEmw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@bruits/satteri-linux-arm64-musl": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-arm64-musl/-/satteri-linux-arm64-musl-0.9.4.tgz", + "integrity": "sha512-Wjzu9hmmAbfmDkBfPI1VdZygJtYz9uYZQnkEyrXi6S2JFi+2pXQ1A5irj38bqm0IZmWcTbk0cVG4NZnPdtVNJA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@bruits/satteri-linux-x64-gnu": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-x64-gnu/-/satteri-linux-x64-gnu-0.9.4.tgz", + "integrity": "sha512-MR1Q+wMx65FQlbSV7cRqWW87Knp0zkoaIV55Dt+xZl028wJABXEPEEmG3670SLq7lVZvcGIDwCgSg2kCYxvRwA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@bruits/satteri-linux-x64-musl": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-linux-x64-musl/-/satteri-linux-x64-musl-0.9.4.tgz", + "integrity": "sha512-T4gxhXve3zyNAZesrXAd/rDZOGRkbfFIUFld4TGsw6BsjoIteCcDji6IMqeXyaWEVSykY2X8Eid2hr6aXGYAaw==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@bruits/satteri-wasm32-wasi": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-wasm32-wasi/-/satteri-wasm32-wasi-0.9.4.tgz", + "integrity": "sha512-/CEG8LUlpaBEnhFnYVn0UnlHFLs51UhrkJBUPDUXLzkadzAcnR88iRA/nOl7Zwhjb4WhfBV4p3P5qeOJMtH0iA==", + "cpu": [ + "wasm32" + ], + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.1", + "@emnapi/runtime": "1.11.1", + "@napi-rs/wasm-runtime": "^1.1.6" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@bruits/satteri-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@bruits/satteri-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@bruits/satteri-win32-arm64-msvc": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-win32-arm64-msvc/-/satteri-win32-arm64-msvc-0.9.4.tgz", + "integrity": "sha512-E1ZPQbgCtFKiU7pFYVndynvY7ne4coeVDUgnVThErSFlJ2ceQCBZrfRTD1lzrIDy63Bbqo+g/cZY9duw+JYjIw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@bruits/satteri-win32-x64-msvc": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/@bruits/satteri-win32-x64-msvc/-/satteri-win32-x64-msvc-0.9.4.tgz", + "integrity": "sha512-5I7SiarsNdAUuhJb50CXJPTwr/ECVrBoU+fymoLjChK5fW//+srhY4lstcNTzgFRtQSYfVtm4OQZz16CVMeTeA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@capsizecss/unpack": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@capsizecss/unpack/-/unpack-4.0.1.tgz", + "integrity": "sha512-CuNiSqg7+e1cO/GjffyMOm5Tt2jUF9CWHHnvQ/UkqvtkGfHdgwEC0wpmq7fkN3gxwpRnrAN0WzO3vREKmNolMQ==", + "license": "MIT", + "dependencies": { + "fontkitten": "^1.0.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@clack/core": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/@clack/core/-/core-1.4.3.tgz", + "integrity": "sha512-/kr3UWNtdJfxZtPgDqUOmG2pvwlmcLGheex5yiZKdwbzZJxhV+HMNR9QNmyY5cGwTNV6LrR7Jtp+KjhUAP1qBQ==", + "license": "MIT", + "dependencies": { + "fast-wrap-ansi": "^0.2.0", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 20.12.0" + } + }, + "node_modules/@clack/prompts": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@clack/prompts/-/prompts-1.7.0.tgz", + "integrity": "sha512-y7/yvZ2TPAnR9+jnc00klvNNLkJiXFFrQA/hlLCcxA9a2A4zQIOimyFQ9XfwYKiGD1fb5GY8vbKIIgO8d5Tb2A==", + "license": "MIT", + "dependencies": { + "@clack/core": "1.4.3", + "fast-string-width": "^3.0.2", + "fast-wrap-ansi": "^0.2.0", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 20.12.0" + } + }, + "node_modules/@ctrl/tinycolor": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-4.2.0.tgz", + "integrity": "sha512-kzyuwOAQnXJNLS9PSyrk0CWk35nWJW/zl/6KvnTBMFK65gm7U1/Z5BqjxeapjZCIhQcM/DsrEmcbRwDyXyXK4A==", + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@emnapi/core": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.2.tgz", + "integrity": "sha512-TC8MkTuZUtcTSiFeuC0ksCh9QIJ5+F21MvZ4Wn4ORfYaFJ/0dsiudv5tVkejgwZlwQ39jL9WWDe2lz8x0WglOA==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.2.tgz", + "integrity": "sha512-kyOl3X0DuTiT1h2ft8r2fYO8JYtU9a9Xis/zBSiGArNaagCOWx90N1k2wxp18czFDH+OgcWGb5ZP/XMt3dcyPA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.1.tgz", + "integrity": "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.1.tgz", + "integrity": "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.1.tgz", + "integrity": "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.1.tgz", + "integrity": "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.1.tgz", + "integrity": "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.1.tgz", + "integrity": "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.1.tgz", + "integrity": "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.1.tgz", + "integrity": "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.1.tgz", + "integrity": "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.1.tgz", + "integrity": "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.1.tgz", + "integrity": "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.1.tgz", + "integrity": "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg==", + "cpu": [ + "loong64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.1.tgz", + "integrity": "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ==", + "cpu": [ + "mips64el" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.1.tgz", + "integrity": "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.1.tgz", + "integrity": "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ==", + "cpu": [ + "riscv64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.1.tgz", + "integrity": "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.1.tgz", + "integrity": "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.1.tgz", + "integrity": "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.1.tgz", + "integrity": "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.1.tgz", + "integrity": "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.1.tgz", + "integrity": "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.1.tgz", + "integrity": "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.1.tgz", + "integrity": "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.1.tgz", + "integrity": "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.1.tgz", + "integrity": "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg==", + "cpu": [ + "ia32" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.1.tgz", + "integrity": "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@expressive-code/core": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@expressive-code/core/-/core-0.44.0.tgz", + "integrity": "sha512-xgiF2P6tYUbrhi3+x0S8xHZWT1t3Bvb3U91tAtRbLb9HLejLvYc5GZUqKICKLaUN4iSGhhNJu2fM/aH8e5yCMg==", + "license": "MIT", + "dependencies": { + "@ctrl/tinycolor": "^4.0.4", + "hast-util-select": "^6.0.2", + "hast-util-to-html": "^9.0.1", + "hast-util-to-text": "^4.0.1", + "hastscript": "^9.0.0", + "postcss": "^8.4.38", + "postcss-nested": "^6.0.1", + "unist-util-visit": "^5.0.0", + "unist-util-visit-parents": "^6.0.1" + } + }, + "node_modules/@expressive-code/plugin-frames": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-frames/-/plugin-frames-0.44.0.tgz", + "integrity": "sha512-V6M6+zVc1GzqCvXkQHc2m5rcFOIVzJgMq5gnfrMnVf2gwtj/sg4H93c1f/mGeqHycubwkHFUDyParAOiGeDZeA==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.44.0" + } + }, + "node_modules/@expressive-code/plugin-shiki": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.44.0.tgz", + "integrity": "sha512-RZsdaqlbGqyAQKuoX4myQXxjmiE2l5KBpJ/gKPh62tCdIdpWyjbzVqSo8+5XsezZxkfi8AJ/J6EUaBTPROFX/Q==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.44.0", + "shiki": "^4.0.2" + } + }, + "node_modules/@expressive-code/plugin-text-markers": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/@expressive-code/plugin-text-markers/-/plugin-text-markers-0.44.0.tgz", + "integrity": "sha512-0/m3A5b+lz2upyNq+wzZ1S69HRoJmyFs5LsR42lVZ9pmGRlBiSBYQpvqlji4DBj1+Riamxc0AvcCr5kuzOQeWA==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.44.0" + } + }, + "node_modules/@img/colour": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz", + "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.3.tgz", + "integrity": "sha512-RMnFX7YQsMoh7lWfcM4NEHHymBX/rLuKNPVM84XE9ONPcaSCDgE7CHIHpSgPcO2xcRthgBy1HfNO319mwhIAkg==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.3.2" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.3.tgz", + "integrity": "sha512-Xo+5uFBtLN0BKqieTxiFzFPQAUlBbbH5iBKyRX/z1JrbnYsHTfKJnUfL8+p2TPXr1pXqao4eeL4Rl144uDpK9w==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.3.2" + } + }, + "node_modules/@img/sharp-freebsd-wasm32": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.3.tgz", + "integrity": "sha512-lUxcqWIj2wMQ9BrwNjngcr1gWUr5xgaGThBRqPPalIC2n67Cqj1uPh8NnA/ZhAg8hUbKl+kVHKwgUIwe6ZYPrg==", + "license": "Apache-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "dependencies": { + "@img/sharp-wasm32": "0.35.3" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.2.tgz", + "integrity": "sha512-9J6ypZFpQBj4YnePGoq/S38w6nz+vqg5WZLrLGY4YuSemdMq47GMLBPO42MzwdGwpg/agZ7xzZcFHa48xlywfg==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.2.tgz", + "integrity": "sha512-m2pW1n6cns9VaubNwsZ+c3CRYjxNQWgJ5gPlnL1nbBcpkBvFm6SCFN5o0psFHI8w9n11NKhFkeEDns98tiqbEw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.2.tgz", + "integrity": "sha512-1eMLzy92I4J6rmi4mAT8yC3HxOtniyGELlzGbNMLLeqe052ahFQ0h6LFq+lh5DsDIdYViIDst08abvSbcEdLXQ==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.2.tgz", + "integrity": "sha512-dqVSFynCox4C/J8kT16V7SIFAns0IjgLwkvYT7p8LQVmJ5OS5b6tI9IGflxTeuBS//zXeFIUbwt5dwxyZ17cnA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-ppc64": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.2.tgz", + "integrity": "sha512-3z0NHDxD6n5I9gc05U1eW1AyRm+Gznzq3naMrthPNqE6oYykcogW0l/jfpJdjYnuNl8R7yI9pNbE1XiUeyq0Aw==", + "cpu": [ + "ppc64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-riscv64": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.2.tgz", + "integrity": "sha512-bsb4rI+NldGOsXuej2r8OdSS8+zXDVaCWxyWrcv6kneTOlgAHtZABRzBBCwdsPiD90J4myNJuHpg6kA20ImW/w==", + "cpu": [ + "riscv64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.2.tgz", + "integrity": "sha512-/ABshyj8gCpyIrNXnHn4LorDJ0HHm1VhXPBlxZ8zAtfVPAaSafXPGn+sUSIRiwaSBy0mmFjSjiXI5mkcwdChKQ==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.2.tgz", + "integrity": "sha512-ITPEtgffGJ0S6G9dRyw/366tJQqFRcHWPHhC+Stpg3Z8AEMrDrTr2lhdz4f/Y/HMbRh//7Z5mBzEpVdi62Oc3w==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.2.tgz", + "integrity": "sha512-zE9EdiUzUmg5mDT5a1rk5fYJ6GWPloTwWBYDS14naqHsL+EaMpDj1AWnpLgh3u0YCORv2Tt50wrcrpYqkP97Kw==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.2.tgz", + "integrity": "sha512-m0lrLiUt+lBYnCFr8qV/65yMR4E/c7/wf78I5eKTdkEakFAlZ9QlzEM3QIhhAwVeUhLAHLcCq7a7Vszq/oFNZQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.3.tgz", + "integrity": "sha512-affVWCTLooy8TSxbDx2qkzuDeaWLNVBA+P//FNBirHsXpP2fuBhk5AuboYUnrDnzoXes8GFjpTx0SBFOCRg+FA==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.3.2" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.3.tgz", + "integrity": "sha512-QgKDspHPnrU+GQ55XPhGwyhC8acLVOOSyAvo1oVfFmrIXLkDNmGWzAfDZ4xK8oSA1qBQrALcHX0G5UZni/SuFQ==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.3.2" + } + }, + "node_modules/@img/sharp-linux-ppc64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.3.tgz", + "integrity": "sha512-sMd8rDxmpLOwv/7N44klFjOD5DUO7FLdjiXDI0hoxYaf7Ar262dQIEkosE98bps+5HPLtp/EvNqeqQtOycP/IA==", + "cpu": [ + "ppc64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-ppc64": "1.3.2" + } + }, + "node_modules/@img/sharp-linux-riscv64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.3.tgz", + "integrity": "sha512-0Eob78yjlYPfL5vMNWAW55l3R9Y6BQS/gOfe0ZcP9mEz9ohhKSt4im1hayiknXgf8AWrFqMvJcKIdmLmEe7yeQ==", + "cpu": [ + "riscv64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-riscv64": "1.3.2" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.3.tgz", + "integrity": "sha512-KgAxQ0DxpNOq1rG2t5cgTgShJFGSuU7XO45cqC+1NVOuZnP6tlgZRuSYOfNupGkHID0o3cJOsw4DVeJpMovcGw==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.3.2" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.3.tgz", + "integrity": "sha512-8pqvxubL2PGdhlPy6GLqzDYMUjyRmKAwKHYKixpdJYBUK7PJ0C029XdsnpFIdgRZG68fZiGdHVWcKPvtiPB4cA==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.3.2" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.3.tgz", + "integrity": "sha512-Vz0iQjzzcSX3HCbfwFfCSG/9SCIqyO0mH2sXyiHaAYfBk0cRsCWXRyQYX0ovCK/PAQBbTzQ0dsPQHh5MAFL59w==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.3.2" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.3.tgz", + "integrity": "sha512-6O1NPKcDVj9QEdg7Hx549EX8U0rp6yXQERqru6yRN7fGBn32UvIRJUlWnk+8xDCiG76hXVBbX82NZ/ZKr0euIg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.3.2" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.3.tgz", + "integrity": "sha512-cZ0XkcYGpHZkqW6iCkqTcmUC0CD9DhD5d/qeZlZkfRBn6GnHniZXLUo5+9xw8Iv76YE6LQFN9YNBlKREcCG76w==", + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.11.1" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-webcontainers-wasm32": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.3.tgz", + "integrity": "sha512-2rnq7bX3NzeR2T4YWgz8qiG4h3TSdMe+vN1iQXpJleSJ3SM5zQ8Fy2SyyXAWlbxpEZ2Y+Z4u1BePgJEYbSy80Q==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "@img/sharp-wasm32": "0.35.3" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-arm64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.3.tgz", + "integrity": "sha512-4bPwFdMbeC4JQ8L8LOyWp6nsHcboP5fxkp6iPOXz2Vg49R42TuMs2whkJ5OAP4/Ul035qOzy0AecOF9VOscn4w==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.3.tgz", + "integrity": "sha512-r53mXsBN6lFUDiST764SvgwUdHAqM4rPAiDzAmf4fLoB6X/rkfyTrLCg6+g17wJJiCmB3JYgHuUldCWUIRFSXw==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.3.tgz", + "integrity": "sha512-D4y1vNeZrIIJCN+uHaWVtH86B+aCrdMYYjicy9pXHvbGZeGYLLSd3wdVuC37FxVXlU1ARsk84eKWfWMXGYEqvA==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "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==", + "license": "MIT" + }, + "node_modules/@mdx-js/mdx": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-3.1.1.tgz", + "integrity": "sha512-f6ZO2ifpwAQIpzGWaBQT2TXxPv6z3RBzQKpVftEWN78Vl/YweF1uwussDx8ECAXVtr3Rs89fKyG9YlzUs9DyGQ==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdx": "^2.0.0", + "acorn": "^8.0.0", + "collapse-white-space": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-util-scope": "^1.0.0", + "estree-walker": "^3.0.0", + "hast-util-to-jsx-runtime": "^2.0.0", + "markdown-extensions": "^2.0.0", + "recma-build-jsx": "^1.0.0", + "recma-jsx": "^1.0.0", + "recma-stringify": "^1.0.0", + "rehype-recma": "^1.0.0", + "remark-mdx": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-rehype": "^11.0.0", + "source-map": "^0.7.0", + "unified": "^11.0.0", + "unist-util-position-from-estree": "^2.0.0", + "unist-util-stringify-position": "^4.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.6.tgz", + "integrity": "sha512-ZLv/JdUfkvOy9eCnnBaGfiO+XimbjebAeO+MRQqD/B+FR1tnRN0tpKSJHRbE8sFfS6aqsXZ67TQjfwfsxULVbg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oslojs/encoding": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@oslojs/encoding/-/encoding-1.1.0.tgz", + "integrity": "sha512-70wQhgYmndg4GCPxPPxPGevRKqTIJ2Nh4OkiMWmDAVYsTQ+Ta7Sq+rPevXyXGdzr30/qZBnyOalCszoMxlyldQ==", + "license": "MIT" + }, + "node_modules/@oxc-project/types": { + "version": "0.138.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.138.0.tgz", + "integrity": "sha512-1a7ZKmrRTCoN1XMZ4L0PyyqrMnrNlLyPuOkdSX2MZg7IiIGRUyurNhAm73ptDOraoBcIordsIGKNPKUzy3ZmfA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@pagefind/darwin-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-arm64/-/darwin-arm64-1.5.2.tgz", + "integrity": "sha512-MXpI+7HsAdPkvJ0gk9xj9g541BCqBZOBbdwj9g6lB5LCj6kSV6nqDSjzcAJwvOsfu0fjwvC8hQU+ecfhp+MpiQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/darwin-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/darwin-x64/-/darwin-x64-1.5.2.tgz", + "integrity": "sha512-IojxFWMEJe0RQ7PQ3KXQsPIImNsbpPYpoZ+QUDrL8fAl/O27IX+LVLs74/UzEZy5uA2LD8Nz1AiwKr72vrkZQw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@pagefind/default-ui": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/default-ui/-/default-ui-1.5.2.tgz", + "integrity": "sha512-pm1LMnQg8N2B3n2TnjKlhaFihpz6zTiA4HiGQ6/slKO/+8K9CAU5kcjdSSPgpuk1PMuuN4hxLipUIifnrkl3Sg==", + "license": "MIT" + }, + "node_modules/@pagefind/freebsd-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/freebsd-x64/-/freebsd-x64-1.5.2.tgz", + "integrity": "sha512-7EVzo9+0w+2cbe671BtMj10UlNo83I+HrLVLfRxO731svHRJKUfJ/mo05gU14pe9PCfpKNQT8FS3Xc/oDN6pOA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@pagefind/linux-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/linux-arm64/-/linux-arm64-1.5.2.tgz", + "integrity": "sha512-Ovt9+K35sqzn8H3ZMXGwls4TD/wMJuvRtShHIsmUQREmaxjrDEX7gHckRCrwYJ4XE1H1p6HkLz3wukrAnsfXQw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/linux-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/linux-x64/-/linux-x64-1.5.2.tgz", + "integrity": "sha512-V+tFqHKXhQKq/WqPBD67AFy7scn1/aZID00ws4fSDd+1daSi5UHR9VVlRrOUYKxn3VuFQYRD7lYXdZK1WED1YA==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@pagefind/windows-arm64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/windows-arm64/-/windows-arm64-1.5.2.tgz", + "integrity": "sha512-hN9Nh90fNW61nNRCW9ZyQrAj/mD0eRvmJ8NlTUzkbuW8kIzGJUi3cxjFkEcMZ5h/8FsKWD/VcouZl4yo1F7B6g==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@pagefind/windows-x64": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@pagefind/windows-x64/-/windows-x64-1.5.2.tgz", + "integrity": "sha512-Fa2Iyw7kaDRzGMfNYNUXNW2zbL5FQVDgSOcbDHdzBrDEdpqOqg8TcZ68F22ol6NJ9IGzvUdmeyZypLW5dyhqsg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.1.4.tgz", + "integrity": "sha512-EZLpf/8y7GXkkra90ML47kzik/GMP3EMcE9bPyHmRfxLC6z9+aW5A8poCsoxjrT5GfEcNAAvWwUHjvP1pUQkfw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.1.4.tgz", + "integrity": "sha512-aUi+HBvmYb7j8krl1+qJgkG8C17fO79gk3c+jPw4S8glRFc1DTija9S3EyaTSQUm5GJXYKDAsugBEhFHH2vYiQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.1.4.tgz", + "integrity": "sha512-F7hHC3gwY11+vByKPRWqwGbeXWVgKmL+pTGCinaEhdihzBV2aQ0fvZOch9cXYUOKuKKq429HeYXOqQLc7wFCEg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.1.4.tgz", + "integrity": "sha512-sI5yw+7s92SK6odiEhD5lKCBlWcpjHS5qyqpVQbZAJ0fIzEUXrmbl3DH2ybR3PZogulNJF+COLtmA8hUfvkCCQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.1.4.tgz", + "integrity": "sha512-mCi0OKgEieFircrtVYmQAFGszRtMnZ6fpZAXrxanXAu7lqZcsK1E1RAaZNG0uKAnxox3B1f4EyQNnoyMfN1vAA==", + "cpu": [ + "arm" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.1.4.tgz", + "integrity": "sha512-B9Ial3Kv5sh0SHnB1g/QWcUQCEvCF6QKGAl4zXypYj65mVI+B4AhFBwPtSN7pDrJeIx8Z7zdy4ntx+wQABom7w==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.1.4.tgz", + "integrity": "sha512-lZVym0PuHE1KZ22gmFTC15lAkrg9iTszR617oYRB/iPY1A56ywoJzVKOJBKaot5RiikCObmur6pogpse3gRcng==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.1.4.tgz", + "integrity": "sha512-t2DNiLJWNTbnEHyUzTumldML6ET4/g16467LZoDDJ3tSxGvguL5/NyC2lCsNKuyRycg9XeDQF5SSv+TNOhQEXg==", + "cpu": [ + "ppc64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.1.4.tgz", + "integrity": "sha512-0WIRnL1Uw4BvTZRLQt+PVgo6ZKTJadlC2btP+/EOXv2f/DWbY0rEgl+y834mIVwP1FkTlWVTrGGJXf12lru7EQ==", + "cpu": [ + "s390x" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.1.4.tgz", + "integrity": "sha512-JWtGshGfX+oENAKonoNkqEJX+7hC8yfhi9GUyPX1VX4mdh1y5r+ZiJLR5XzAB0aoP6s/PcILsGjKq8O0mm24bw==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.1.4.tgz", + "integrity": "sha512-rT6yQcxUuXs4CnbofqwHRRV0iem349rLMYpTjkgQGLjrY4ado/eDzwPZPTCgTOlF6Nkp8NEv70yLMTn6qkWxsQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.1.4.tgz", + "integrity": "sha512-KXMGoboq5cyaCQjDA4GLuRiOwBQ0EyFnJoVViLeZ45/3rFItRODEr+NdsBcVpll40hhNArlm/speWGRvj08LzA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.1.4.tgz", + "integrity": "sha512-5K83rb36oJiY7BCyE9zLZtGcPV4g5wvq+xwdO0XPIwDVZI8cyB/AUjkNXGb92/rnmezEkjMOpgY61rtwjQtFwg==", + "cpu": [ + "wasm32" + ], + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.1", + "@emnapi/runtime": "1.11.1", + "@napi-rs/wasm-runtime": "^1.1.6" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.1.tgz", + "integrity": "sha512-RSvbQmHzdKzNsLYa/wHrbc3KN4sYLKAdPZxqiM2HATqv/SBk2/ENSHpvXGaLOMcsAyz0poEGqkmmKYG3OWiJEQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.1.tgz", + "integrity": "sha512-vgj7R3y3Wgx24IQaGPA/R6YFXLHVMOZ0uVEyIQPaWs+rd1AzfEMXlAC22FYwO1XkKR6NPsq7mUandH8oIRdZFw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.1.4.tgz", + "integrity": "sha512-PnWBtw3TV5KOg69HQQDR0mnQuyCmSGR2pAB4DC1rPF808fgKeTUMj2EOEyKATpgiuxuR5APQmiDO7PDgEjTFSA==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.1.4.tgz", + "integrity": "sha512-M1lpniBePobTfsa7Ks9a199e1akxsXn+GYBUKsEzv3YFzOm1HJAMNwKI3qr0Zq+mxwx9gOZoTdP1yXRYsZUocQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "license": "MIT" + }, + "node_modules/@rollup/pluginutils": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-5.4.0.tgz", + "integrity": "sha512-MfPp06CjRLfXQ3wY0R8vJDYBy/MvVcc9OulEfR0B8Iv9ko+GCNaRZ+EpJYFl27LhKsZK0o420sYCRHCjfCgeUg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-walker": "^2.0.2", + "picomatch": "^4.0.2" + }, + "engines": { + "node": ">=14.0.0" + }, + "peerDependencies": { + "rollup": "^1.20.0||^2.0.0||^3.0.0||^4.0.0" + }, + "peerDependenciesMeta": { + "rollup": { + "optional": true + } + } + }, + "node_modules/@rollup/pluginutils/node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/@shikijs/core": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/core/-/core-4.3.1.tgz", + "integrity": "sha512-ANMDxuaPsNMdDC1m4vfvhlDmJweMwkE5XitTwrq2rWHx5jM+dlm4MmHt2PP6t0uejfR77SuhrhJ0zEijIF/uhA==", + "license": "MIT", + "dependencies": { + "@shikijs/primitive": "4.3.1", + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4", + "hast-util-to-html": "^9.0.5" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/engine-javascript": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-javascript/-/engine-javascript-4.3.1.tgz", + "integrity": "sha512-JBItcnPuYq7jVJdZo/vMj94r+szT7XEjHFX+mvFDGSEIbVAXAGyHAHzhbWzpGOwYidCZrErJLLgn2PVeiokHnQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2", + "oniguruma-to-es": "^4.3.6" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-4.3.1.tgz", + "integrity": "sha512-OXyNMzg0pews+msMj4cHeqT4xiYKKvbnn6VbdAXxfoFl3SSx4fJTc8FadECuc5/H9p3BzhNAoAUXKwAu9rWYhg==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/langs": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-4.3.1.tgz", + "integrity": "sha512-m0l9nsDqgBHvbZbk7A0/kXz/impK3uB/c6rAn6Gpg/uPtdZRQ+alsN/17MU5thb68XTj/4DxkZAotrM0GGSpDQ==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/primitive": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/primitive/-/primitive-4.3.1.tgz", + "integrity": "sha512-CXQRQOYy1leqQ8ceTeJdmXv/bsUY++6QyLpXJ94LZAAYj5X2SKRdc5ipguv4NPyGVKItB2PPwUpRNe0Sjh5S1A==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/themes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-4.3.1.tgz", + "integrity": "sha512-dgpoJ4WqNi2yTmizQHBJ5zcX6j2lE6icN/0yt4l1kkf16jrY/pwPLoTb1ETsWMz0OBLf9ZNvwmxft+cH+N9qSA==", + "license": "MIT", + "dependencies": { + "@shikijs/types": "4.3.1" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/types": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-4.3.1.tgz", + "integrity": "sha512-CHFxE0jztBIZRHH6gxXE7DXUCFXjReEGxZ/j0rfSLGKZuwp2xBYycEP14875DSa9KLL/6700oxIq6oO6ef9K2g==", + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "license": "MIT" + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.3.tgz", + "integrity": "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/debug": { + "version": "4.1.13", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz", + "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "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==", + "license": "MIT" + }, + "node_modules/@types/estree-jsx": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@types/estree-jsx/-/estree-jsx-1.0.5.tgz", + "integrity": "sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==", + "license": "MIT", + "dependencies": { + "@types/estree": "*" + } + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/js-yaml": { + "version": "4.0.9", + "resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-4.0.9.tgz", + "integrity": "sha512-k4MGaQl5TGo/iipqb2UDG2UwjXziSWkh0uysQelTlJpX1qGlpUZYm8PnO4DxG1qBomtJUdYJ6qR6xdIah10JLg==", + "license": "MIT" + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mdx": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.14.tgz", + "integrity": "sha512-T48PeuJtvLosNTPVhfnIp3i/n3a4g4Bad7YCq5k64D4u7NwDrAotikQ+5+sjtUvBmxCMlbo3dVL+C2dP0rWHzg==", + "license": "MIT" + }, + "node_modules/@types/ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz", + "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==", + "license": "MIT" + }, + "node_modules/@types/nlcst": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/nlcst/-/nlcst-2.0.3.tgz", + "integrity": "sha512-vSYNSDe6Ix3q+6Z7ri9lyWqgGhJTmzRjZRqyq15N0Z/1/UnVsno9G/N40NBijoYx2seFDIl0+B2mgAb9mezUCA==", + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/node": { + "version": "24.13.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.13.2.tgz", + "integrity": "sha512-fRa09kZTgu8o71KFcDjUFuc7F+dEbZYZmkI0mg5YBTRs0yMKjYHsq/c0urDKeDb+D5qVgXOdFcuu+DZPKOITwA==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/@types/sax": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@types/sax/-/sax-1.2.7.tgz", + "integrity": "sha512-rO73L89PJxeYM3s3pPPjiPgVVcymqU490g0YO5n5By0k2Erzj6tay/4lr1CHAAU4JyOWd1rpQ8bCf6cZfHU96A==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "license": "MIT" + }, + "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==", + "license": "ISC" + }, + "node_modules/acorn": { + "version": "8.17.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.17.0.tgz", + "integrity": "sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg==", + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "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==", + "license": "MIT", + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/am-i-vibing": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/am-i-vibing/-/am-i-vibing-0.4.0.tgz", + "integrity": "sha512-MxT4XZL7pzLHpuvhDKdMaQHMGGkJDLluKBLsbstn+8wv9sWcFT6h+0ve9qkml95amVTZtZV83gQe2hY+ojgHLg==", + "license": "MIT", + "dependencies": { + "process-ancestry": "^0.1.0" + }, + "bin": { + "am-i-vibing": "dist/cli.mjs" + } + }, + "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==", + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/anymatch/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==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/arg": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", + "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", + "license": "MIT" + }, + "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==", + "license": "Python-2.0" + }, + "node_modules/aria-query": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.2.tgz", + "integrity": "sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/array-iterate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/array-iterate/-/array-iterate-2.0.1.tgz", + "integrity": "sha512-I1jXZMjAgCMmxT4qxXfPXa6SthSoE8h6gkSI9BGGNv8mP8G/v0blc+qFnZu6K42vTOiuME596QaLO0TP3Lk0xg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/astring": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/astring/-/astring-1.9.0.tgz", + "integrity": "sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==", + "license": "MIT", + "bin": { + "astring": "bin/astring" + } + }, + "node_modules/astro": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/astro/-/astro-7.0.6.tgz", + "integrity": "sha512-Myw0sFia+zs/Y0yqfZEsUYXfDPh3ELcLf1f0Q/qQzVXBh/af1qO62WNT+P89DCcfGVV51nMoQhEfkBYqJmoUOQ==", + "license": "MIT", + "dependencies": { + "@astrojs/compiler-rs": "^0.3.0", + "@astrojs/internal-helpers": "0.10.1", + "@astrojs/markdown-satteri": "0.3.3", + "@astrojs/telemetry": "3.3.2", + "@capsizecss/unpack": "^4.0.0", + "@clack/prompts": "^1.1.0", + "@oslojs/encoding": "^1.1.0", + "@rollup/pluginutils": "^5.3.0", + "am-i-vibing": "^0.4.0", + "aria-query": "^5.3.2", + "axobject-query": "^4.1.0", + "ci-info": "^4.4.0", + "clsx": "^2.1.1", + "common-ancestor-path": "^2.0.0", + "cookie": "^1.1.1", + "devalue": "^5.8.1", + "diff": "^8.0.3", + "dset": "^3.1.4", + "es-module-lexer": "^2.0.0", + "esbuild": "^0.28.0", + "flattie": "^1.1.1", + "fontace": "~0.4.1", + "get-tsconfig": "5.0.0-beta.4", + "github-slugger": "^2.0.0", + "html-escaper": "3.0.3", + "http-cache-semantics": "^4.2.0", + "js-yaml": "^4.1.1", + "jsonc-parser": "^3.3.1", + "magic-string": "^0.30.21", + "magicast": "^0.5.2", + "mrmime": "^2.0.1", + "neotraverse": "^0.6.18", + "obug": "^2.1.1", + "p-limit": "^7.3.0", + "p-queue": "^9.1.0", + "package-manager-detector": "^1.6.0", + "piccolore": "^0.1.3", + "picomatch": "^4.0.4", + "semver": "^7.7.4", + "shiki": "^4.0.2", + "smol-toml": "^1.6.0", + "svgo": "^4.0.1", + "tinyclip": "^0.1.12", + "tinyexec": "^1.0.4", + "tinyglobby": "^0.2.15", + "ultrahtml": "^1.6.0", + "unifont": "~0.7.4", + "unstorage": "^1.17.5", + "vite": "^8.0.13", + "vitefu": "^1.1.2", + "xxhash-wasm": "^1.1.0", + "yargs-parser": "^22.0.0", + "zod": "^4.3.6" + }, + "bin": { + "astro": "bin/astro.mjs" + }, + "engines": { + "node": ">=22.12.0", + "npm": ">=9.6.5", + "pnpm": ">=7.1.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/astrodotbuild" + }, + "optionalDependencies": { + "sharp": "^0.34.0 || ^0.35.0" + }, + "peerDependencies": { + "@astrojs/markdown-remark": "7.2.1" + }, + "peerDependenciesMeta": { + "@astrojs/markdown-remark": { + "optional": true + } + } + }, + "node_modules/astro-expressive-code": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/astro-expressive-code/-/astro-expressive-code-0.44.0.tgz", + "integrity": "sha512-b1wN/ZvbJprzxlGKIpIes2kQrCY5KRLwys2tWbZAZyjGZcW5ZtgneZnBwzNRiBna9/48d4mQl19KLjcRuhO1hw==", + "license": "MIT", + "dependencies": { + "rehype-expressive-code": "^0.44.0", + "url-extras": "^0.1.0" + }, + "peerDependencies": { + "astro": "^4.0.0-beta || ^5.0.0-beta || ^3.3.0 || ^6.0.0-beta || ^7.0.0" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/bail": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", + "integrity": "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/bcp-47": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bcp-47/-/bcp-47-2.1.1.tgz", + "integrity": "sha512-KLw+H/gd2p4zly1X7Yh/qziuyae5/w/QFnvTng9eZL5fvszL7Whl3MBoWF8yxL7ksUjBfOD+OxkytiqbBpG+Fw==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/bcp-47-match": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/bcp-47-match/-/bcp-47-match-2.0.3.tgz", + "integrity": "sha512-JtTezzbAibu8G0R9op9zb3vcWZd9JF6M0xOYGPn0fNCd7wOpRB1mU2mH9T8gaBGbAAyIIVgB2G7xG0GP98zMAQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "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==", + "license": "ISC" + }, + "node_modules/ccount": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz", + "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz", + "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-html4": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-2.1.0.tgz", + "integrity": "sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-entities-legacy": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz", + "integrity": "sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/character-reference-invalid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz", + "integrity": "sha512-iBZ4F4wRbyORVsu0jPV7gXkOsGYjGHPmAyv+HiHG8gi5PtC9KI2j1+v8/tlibRvjoWX027ypmG/n0HtO5t7unw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/chokidar": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", + "integrity": "sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==", + "license": "MIT", + "dependencies": { + "readdirp": "^5.0.0" + }, + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ci-info": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.4.0.tgz", + "integrity": "sha512-77PSwercCZU2Fc4sX94eF8k8Pxte6JAwL4/ICZLFjJLqegs7kCuAsqqj/70NQF6TvDpgFjkubQB2FW2ZZddvQg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/collapse-white-space": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-2.1.0.tgz", + "integrity": "sha512-loKTxY1zCOuG4j9f6EPnuyyYkf58RnhhWTvRoZEokgB+WbdXehfjFviyOVYkqzEWz1Q5kRiZdBYS5SwxbQYwzw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/comma-separated-tokens": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-2.0.3.tgz", + "integrity": "sha512-Fu4hJdvzeylCfQPp9SGWidpzrMs7tTrlu6Vb8XGaRGck8QSNZJJp538Wrb60Lax4fPwR64ViY468OIUTbRlGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/commander": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", + "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", + "license": "MIT", + "engines": { + "node": ">=16" + } + }, + "node_modules/common-ancestor-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/common-ancestor-path/-/common-ancestor-path-2.0.0.tgz", + "integrity": "sha512-dnN3ibLeoRf2HNC+OlCiNc5d2zxbLJXOtiZUudNFSXZrNSydxcCsSpRzXwfu7BBWCIfHPw+xTayeBvJCP/D8Ng==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">= 18" + } + }, + "node_modules/cookie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz", + "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cookie-es": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/cookie-es/-/cookie-es-1.2.3.tgz", + "integrity": "sha512-lXVyvUvrNXblMqzIRrxHb57UUVmqsSWlxqt3XIjCkUP0wDAf6uicO6KMbEgYrMNtEvWgWHwe42CKxPu9MYAnWw==", + "license": "MIT" + }, + "node_modules/crossws": { + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.3.5.tgz", + "integrity": "sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==", + "license": "MIT", + "dependencies": { + "uncrypto": "^0.1.3" + } + }, + "node_modules/css-select": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.2.2.tgz", + "integrity": "sha512-TizTzUddG/xYLA3NXodFM0fSbNizXjOKhqiQQwvhlspadZokn1KDy0NZFS0wuEubIYAV5/c1/lAr0TaaFXEXzw==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-selector-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/css-selector-parser/-/css-selector-parser-3.3.0.tgz", + "integrity": "sha512-Y2asgMGFqJKF4fq4xHDSlFYIkeVfRsm69lQC1q9kbEsH5XtnINTMrweLkjYMeaUgiXBy/uvKeO/a1JHTNnmB2g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/mdevils" + }, + { + "type": "patreon", + "url": "https://patreon.com/mdevils" + } + ], + "license": "MIT" + }, + "node_modules/css-tree": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-3.2.1.tgz", + "integrity": "sha512-X7sjQzceUhu1u7Y/ylrRZFU2FS6LRiFVp6rKLPg23y3x3c3DOKAwuXGDp+PAGjh6CSnCjYeAul8pcT8bAl+lSA==", + "license": "MIT", + "dependencies": { + "mdn-data": "2.27.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0" + } + }, + "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==", + "license": "BSD-2-Clause", + "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", + "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==", + "license": "MIT", + "bin": { + "cssesc": "bin/cssesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/csso": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/csso/-/csso-5.0.5.tgz", + "integrity": "sha512-0LrrStPOdJj+SPCCrGhzryycLjwcgUSHBtxNA8aIDxf0GLsRh1cKYhB00Gd1lDOS4yGH69+SNn13+TWbVHETFQ==", + "license": "MIT", + "dependencies": { + "css-tree": "~2.2.0" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/css-tree": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/css-tree/-/css-tree-2.2.1.tgz", + "integrity": "sha512-OA0mILzGc1kCOCSJerOeqDxDQ4HOh+G8NbOJFOTgOCzpw7fCBubk0fEyxp8AgOL/jvLgYA/uV0cMbe43ElF1JA==", + "license": "MIT", + "dependencies": { + "mdn-data": "2.0.28", + "source-map-js": "^1.0.1" + }, + "engines": { + "node": "^10 || ^12.20.0 || ^14.13.0 || >=15.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/csso/node_modules/mdn-data": { + "version": "2.0.28", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.0.28.tgz", + "integrity": "sha512-aylIc7Z9y4yzHYAJNuESG3hfhC+0Ibp/MAMiaOZgNv4pmEdFyfZhhhny4MNiAfWdBQ1RQ2mfDWmM1x8SvGyp8g==", + "license": "CC0-1.0" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decode-named-character-reference": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz", + "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==", + "license": "MIT", + "dependencies": { + "character-entities": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/defu": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.7.tgz", + "integrity": "sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==", + "license": "MIT" + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/destr": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", + "license": "MIT" + }, + "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==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/devalue": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.8.1.tgz", + "integrity": "sha512-4CXDYRBGqN+57wVJkuXBYmpAVUSg3L6JAQa/DFqm238G73E1wuyc/JhGQJzN7vUf/CMphYau2zXbfWzDR5aTEw==", + "license": "MIT" + }, + "node_modules/devlop": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz", + "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==", + "license": "MIT", + "dependencies": { + "dequal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/diff": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-8.0.4.tgz", + "integrity": "sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/direction": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/direction/-/direction-2.0.1.tgz", + "integrity": "sha512-9S6m9Sukh1cZNknO1CWAr2QAWsbKLafQiyM5gZ7VgXHeuaoUwffKN4q6NC4A/Mf9iiPlOXQEKW/Mv/mh9/3YFA==", + "license": "MIT", + "bin": { + "direction": "cli.js" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/dom-serializer/node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?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==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.2.2.tgz", + "integrity": "sha512-6kZKyUajlDuqlHKVX1w7gyslj9MPIXzIFiz/rGu35uC1wMi+kMhQwGhl4lt9unC9Vb9INnY9Z3/ZA3+FhASLaw==", + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dset": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.4.tgz", + "integrity": "sha512-2QF/g9/zTaPDc3BjNcVTGoBbXBgYfMTTceLaYcFJ/W9kggFUkhxD/hMEeuLKbugyef9SqAx8cpgwlIP/jinUTA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/entities": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-6.0.1.tgz", + "integrity": "sha512-aN97NXWF6AWBTahfVOIrB/NShkzi5H7F9r1s9mD3cDj4Ko5f2qhhVoYMibXF7GlLveb/D2ioWay8lxI97Ven3g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "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==", + "license": "MIT" + }, + "node_modules/esast-util-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/esast-util-from-estree/-/esast-util-from-estree-2.0.0.tgz", + "integrity": "sha512-4CyanoAudUSBAn5K13H4JhsMH6L9ZP7XbLVe/dKybkxMO7eDyLsT8UHl9TRNrU2Gr9nz+FovfSIjuXWJ81uVwQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esast-util-from-js": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/esast-util-from-js/-/esast-util-from-js-2.0.1.tgz", + "integrity": "sha512-8Ja+rNJ0Lt56Pcf3TAmpBZjmx8ZcK5Ts4cAzIOjsjevg9oSXJnl6SUQ2EevU8tv3h6ZLWmoKL5H4fgWvdvfETw==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "acorn": "^8.0.0", + "esast-util-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/esbuild": { + "version": "0.28.1", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.1.tgz", + "integrity": "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw==", + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.1", + "@esbuild/android-arm": "0.28.1", + "@esbuild/android-arm64": "0.28.1", + "@esbuild/android-x64": "0.28.1", + "@esbuild/darwin-arm64": "0.28.1", + "@esbuild/darwin-x64": "0.28.1", + "@esbuild/freebsd-arm64": "0.28.1", + "@esbuild/freebsd-x64": "0.28.1", + "@esbuild/linux-arm": "0.28.1", + "@esbuild/linux-arm64": "0.28.1", + "@esbuild/linux-ia32": "0.28.1", + "@esbuild/linux-loong64": "0.28.1", + "@esbuild/linux-mips64el": "0.28.1", + "@esbuild/linux-ppc64": "0.28.1", + "@esbuild/linux-riscv64": "0.28.1", + "@esbuild/linux-s390x": "0.28.1", + "@esbuild/linux-x64": "0.28.1", + "@esbuild/netbsd-arm64": "0.28.1", + "@esbuild/netbsd-x64": "0.28.1", + "@esbuild/openbsd-arm64": "0.28.1", + "@esbuild/openbsd-x64": "0.28.1", + "@esbuild/openharmony-arm64": "0.28.1", + "@esbuild/sunos-x64": "0.28.1", + "@esbuild/win32-arm64": "0.28.1", + "@esbuild/win32-ia32": "0.28.1", + "@esbuild/win32-x64": "0.28.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz", + "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/estree-util-attach-comments": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-attach-comments/-/estree-util-attach-comments-3.0.0.tgz", + "integrity": "sha512-cKUwm/HUcTDsYh/9FgnuFqpfquUbwIqwKM26BVCGDPVgvaCl/nDCCjUfiLlx6lsEZ3Z4RFxNbOQ60pkaEwFxGw==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-build-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/estree-util-build-jsx/-/estree-util-build-jsx-3.0.1.tgz", + "integrity": "sha512-8U5eiL6BTrPxp/CHbs2yMgP8ftMhR5ww1eIKoWRMlqvltHF8fZn5LRDvTKuxD3DUn+shRbLGqXemcP51oFCsGQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "estree-walker": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-is-identifier-name": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/estree-util-is-identifier-name/-/estree-util-is-identifier-name-3.0.0.tgz", + "integrity": "sha512-hFtqIDZTIUZ9BXLb8y4pYGyk6+wekIivNVTcmvk8NoOh+VeRn5y6cEHzbURrWbfp1fIqdVipilzj+lfaadNZmg==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-scope": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/estree-util-scope/-/estree-util-scope-1.0.0.tgz", + "integrity": "sha512-2CAASclonf+JFWBNJPndcOpA8EMJwa0Q8LUFJEKqXLW6+qBvbFZuF5gItbQOs/umBUkjviCSDCbBwU2cXbmrhQ==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-to-js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-to-js/-/estree-util-to-js-2.0.0.tgz", + "integrity": "sha512-WDF+xj5rRWmD5tj6bIqRi6CkLIXbbNQUcxQHzGysQzvHmdYG2G7p/Tf0J0gpxGgkeMZNTIjT/AoSvC9Xehcgdg==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "astring": "^1.8.0", + "source-map": "^0.7.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-util-visit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/estree-util-visit/-/estree-util-visit-2.0.0.tgz", + "integrity": "sha512-m5KgiH85xAhhW8Wta0vShLcUvOsh3LLPI2YVwcbio1l7E09NTLL1EyMZFM1OyWowoH0skScNbhOPl4kcBgzTww==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/estree-walker": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-3.0.3.tgz", + "integrity": "sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT" + }, + "node_modules/expressive-code": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/expressive-code/-/expressive-code-0.44.0.tgz", + "integrity": "sha512-JXVWVNCKlLuZLMQH8cOiDUSosT0Bb+elwE/dbAkpwFwDFmyFyWlECoWZIohh2FkIF1iI67TQJ+Ts9k7oNDh2qA==", + "license": "MIT", + "dependencies": { + "@expressive-code/core": "^0.44.0", + "@expressive-code/plugin-frames": "^0.44.0", + "@expressive-code/plugin-shiki": "^0.44.0", + "@expressive-code/plugin-text-markers": "^0.44.0" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/fast-string-truncated-width": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/fast-string-truncated-width/-/fast-string-truncated-width-3.0.3.tgz", + "integrity": "sha512-0jjjIEL6+0jag3l2XWWizO64/aZVtpiGE3t0Zgqxv0DPuxiMjvB3M24fCyhZUO4KomJQPj3LTSUnDP3GpdwC0g==", + "license": "MIT" + }, + "node_modules/fast-string-width": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/fast-string-width/-/fast-string-width-3.0.2.tgz", + "integrity": "sha512-gX8LrtNEI5hq8DVUfRQMbr5lpaS4nMIWV+7XEbXk2b8kiQIizgnlr12B4dA3ZEx3308ze0O4Q1R+cHts8kyUJg==", + "license": "MIT", + "dependencies": { + "fast-string-truncated-width": "^3.0.2" + } + }, + "node_modules/fast-wrap-ansi": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/fast-wrap-ansi/-/fast-wrap-ansi-0.2.2.tgz", + "integrity": "sha512-7F2Fl+TjRSenLqlU3UjSH0iyqopqoZIu7eZVpEirP2g1GtWa2G/ecEmBdgz31+Mxr+ELclgg6sokpSFIQiZ02Q==", + "license": "MIT", + "dependencies": { + "fast-string-width": "^3.0.2" + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/flattie": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/flattie/-/flattie-1.1.1.tgz", + "integrity": "sha512-9UbaD6XdAL97+k/n+N7JwX46K/M6Zc6KcFYskrYL8wbBV/Uyk0CTAMY0VT+qiK5PM7AIc9aTWYtq65U7T+aCNQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/fontace": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/fontace/-/fontace-0.4.1.tgz", + "integrity": "sha512-lDMvbAzSnHmbYMTEld5qdtvNH2/pWpICOqpean9IgC7vUbUJc3k+k5Dokp85CegamqQpFbXf0rAVkbzpyTA8aw==", + "license": "MIT", + "dependencies": { + "fontkitten": "^1.0.2" + } + }, + "node_modules/fontkitten": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fontkitten/-/fontkitten-1.0.3.tgz", + "integrity": "sha512-Wp1zXWPVUPBmfoa3Cqc9ctaKuzKAV6uLstRqlR56kSjplf5uAce+qeyYym7F+PHbGTk+tCEdkCW6RD7DX/gBZw==", + "license": "MIT", + "dependencies": { + "tiny-inflate": "^1.0.3" + }, + "engines": { + "node": ">=20" + } + }, + "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, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/get-tsconfig": { + "version": "5.0.0-beta.4", + "resolved": "https://registry.npmjs.org/get-tsconfig/-/get-tsconfig-5.0.0-beta.4.tgz", + "integrity": "sha512-7nF7C9fIPFEMHgEMEfgIlO9wDdZ8CyHw27rWciFZfHvHDReIiPhsYuzPRXsfvBCqFy1l8RRyyWV7QLM+ZhUJsQ==", + "license": "MIT", + "dependencies": { + "resolve-pkg-maps": "^1.0.0" + }, + "engines": { + "node": ">=20.20.0" + }, + "funding": { + "url": "https://github.com/privatenumber/get-tsconfig?sponsor=1" + } + }, + "node_modules/github-slugger": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz", + "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==", + "license": "ISC" + }, + "node_modules/h3": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.11.tgz", + "integrity": "sha512-L3THSe2MPeBwgIZVSH5zLdBBU90TOxarvhK9d04IDY2AmVS8j2Jz2LIWtwsGOU3lu2I5jCN7FNvVfY2+XyF+mg==", + "license": "MIT", + "dependencies": { + "cookie-es": "^1.2.3", + "crossws": "^0.3.5", + "defu": "^6.1.6", + "destr": "^2.0.5", + "iron-webcrypto": "^1.2.1", + "node-mock-http": "^1.0.4", + "radix3": "^1.1.2", + "ufo": "^1.6.3", + "uncrypto": "^0.1.3" + } + }, + "node_modules/hast-util-embedded": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-embedded/-/hast-util-embedded-3.0.0.tgz", + "integrity": "sha512-naH8sld4Pe2ep03qqULEtvYr7EjrLK2QHY8KJR6RJkTUjPGObe1vnx585uzem2hGra+s1q08DZZpfgDVYRbaXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-is-element": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-format": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/hast-util-format/-/hast-util-format-1.1.0.tgz", + "integrity": "sha512-yY1UDz6bC9rDvCWHpx12aIBGRG7krurX0p0Fm6pT547LwDIZZiNr8a+IHDogorAdreULSEzP82Nlv5SZkHZcjA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-embedded": "^3.0.0", + "hast-util-minify-whitespace": "^1.0.0", + "hast-util-phrasing": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "html-whitespace-sensitive-tag-names": "^3.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-html": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/hast-util-from-html/-/hast-util-from-html-2.0.3.tgz", + "integrity": "sha512-CUSRHXyKjzHov8yKsQjGOElXy/3EKpyX56ELnkHH34vDVw1N1XSQ1ZcAvTyAPtGqLTuKP/uxM+aLkSPqF/EtMw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "devlop": "^1.1.0", + "hast-util-from-parse5": "^8.0.0", + "parse5": "^7.0.0", + "vfile": "^6.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-from-parse5": { + "version": "8.0.3", + "resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-8.0.3.tgz", + "integrity": "sha512-3kxEVkEKt0zvcZ3hCRYI8rqrgwtlIOFMWkbclACvjlDw8Li9S2hk/d51OI0nr/gIpdMHNepwgOKqZ/sy0Clpyg==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "hastscript": "^9.0.0", + "property-information": "^7.0.0", + "vfile": "^6.0.0", + "vfile-location": "^5.0.0", + "web-namespaces": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-has-property": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-has-property/-/hast-util-has-property-3.0.0.tgz", + "integrity": "sha512-MNilsvEKLFpV604hwfhVStK0usFY/QmM5zX16bo7EjnAEGofr5YyI37kzopBlZJkHD4t887i+q/C8/tr5Q94cA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-is-body-ok-link": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/hast-util-is-body-ok-link/-/hast-util-is-body-ok-link-3.0.1.tgz", + "integrity": "sha512-0qpnzOBLztXHbHQenVB8uNuxTnm/QBFUOmdOSsEn7GnBtyY07+ENTWVFBAnXd/zEgd9/SUG3lRY7hSIBWRgGpQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-is-element": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-3.0.0.tgz", + "integrity": "sha512-Val9mnv2IWpLbNPqc/pUem+a7Ipj2aHacCwgNfTiK0vJKl0LF+4Ba4+v1oPHFpf3bLYmreq0/l3Gud9S5OH42g==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-minify-whitespace": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hast-util-minify-whitespace/-/hast-util-minify-whitespace-1.0.1.tgz", + "integrity": "sha512-L96fPOVpnclQE0xzdWb/D12VT5FabA7SnZOUMtL1DbXmYiHJMXZvFkIZfiMmTCNJHUeO2K9UYNXoVyfz+QHuOw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-embedded": "^3.0.0", + "hast-util-is-element": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-parse-selector": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-4.0.0.tgz", + "integrity": "sha512-wkQCkSYoOGCRKERFWcxMVMOcYE2K1AaNLU8DXS9arxnLOUEWbOXKXiJUNzEpqZ3JOKpnha3jkFrumEjVliDe7A==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-phrasing": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/hast-util-phrasing/-/hast-util-phrasing-3.0.1.tgz", + "integrity": "sha512-6h60VfI3uBQUxHqTyMymMZnEbNl1XmEGtOxxKYL7stY2o601COo62AWAYBQR9lZbYXYSBoxag8UpPRXK+9fqSQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-embedded": "^3.0.0", + "hast-util-has-property": "^3.0.0", + "hast-util-is-body-ok-link": "^3.0.0", + "hast-util-is-element": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-raw": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-9.1.0.tgz", + "integrity": "sha512-Y8/SBAHkZGoNkpzqqfCldijcuUKh7/su31kEBp67cFY09Wy0mTRgtsLYsiIxMJxlu0f6AA5SUTbDR8K0rxnbUw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "@ungap/structured-clone": "^1.0.0", + "hast-util-from-parse5": "^8.0.0", + "hast-util-to-parse5": "^8.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "parse5": "^7.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-select": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/hast-util-select/-/hast-util-select-6.0.4.tgz", + "integrity": "sha512-RqGS1ZgI0MwxLaKLDxjprynNzINEkRHY2i8ln4DDjgv9ZhcYVIHN9rlpiYsqtFwrgpYU361SyWDQcGNIBVu3lw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "bcp-47-match": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "css-selector-parser": "^3.0.0", + "devlop": "^1.0.0", + "direction": "^2.0.0", + "hast-util-has-property": "^3.0.0", + "hast-util-to-string": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "nth-check": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-estree": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/hast-util-to-estree/-/hast-util-to-estree-3.1.3.tgz", + "integrity": "sha512-48+B/rJWAp0jamNbAAf9M7Uf//UVqAoMmgXhBdxTDJLGKY+LRnZ99qcG+Qjl5HfMpYNzS5v4EAwVEF34LeAj7w==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-attach-comments": "^3.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-html": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-9.0.5.tgz", + "integrity": "sha512-OguPdidb+fbHQSU4Q4ZiLKnzWo8Wwsf5bZfbvu7//a9oTYoqD/fWpe96NuHkoS9h0ccGOTe0C4NGXdtS0iObOw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-whitespace": "^3.0.0", + "html-void-elements": "^3.0.0", + "mdast-util-to-hast": "^13.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "stringify-entities": "^4.0.0", + "zwitch": "^2.0.4" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-jsx-runtime": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/hast-util-to-jsx-runtime/-/hast-util-to-jsx-runtime-2.3.6.tgz", + "integrity": "sha512-zl6s8LwNyo1P9uw+XJGvZtdFF1GdAkOg8ujOw+4Pyb76874fLps4ueHXDhXWdk6YHQ6OgUtinliG7RsYvCbbBg==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "hast-util-whitespace": "^3.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "style-to-js": "^1.0.0", + "unist-util-position": "^5.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-parse5": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-8.0.1.tgz", + "integrity": "sha512-MlWT6Pjt4CG9lFCjiz4BH7l9wmrMkfkJYCxFwKQic8+RTZgWPuWxwAfjJElsXkex7DJjfSJsQIt931ilUgmwdA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "devlop": "^1.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0", + "web-namespaces": "^2.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-string": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/hast-util-to-string/-/hast-util-to-string-3.0.1.tgz", + "integrity": "sha512-XelQVTDWvqcl3axRfI0xSeoVKzyIFPwsAGSLIsKdJKQMXDYJS4WYrBNF/8J7RdhIcFI2BOHgAifggsvsxp/3+A==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-to-text": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/hast-util-to-text/-/hast-util-to-text-4.0.2.tgz", + "integrity": "sha512-KK6y/BN8lbaq654j7JgBydev7wuNMcID54lkRav1P0CaE1e47P72AWWPiGKXTJU271ooYzcvTAn/Zt0REnvc7A==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/unist": "^3.0.0", + "hast-util-is-element": "^3.0.0", + "unist-util-find-after": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hast-util-whitespace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-3.0.0.tgz", + "integrity": "sha512-88JUN06ipLwsnv+dVn+OIYOvAuvBMy/Qoi6O7mQHxdPXpjy+Cd6xRkWwux7DKO+4sYILtLBRIKgsdpS2gQc7qw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/hastscript": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/hastscript/-/hastscript-9.0.1.tgz", + "integrity": "sha512-g7df9rMFX/SPi34tyGCyUBREQoKkapwdY/T04Qn9TDWfHhAYt4/I0gMVirzK5wEzeUqIjEB+LXC/ypb7Aqno5w==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "comma-separated-tokens": "^2.0.0", + "hast-util-parse-selector": "^4.0.0", + "property-information": "^7.0.0", + "space-separated-tokens": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/html-escaper": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-3.0.3.tgz", + "integrity": "sha512-RuMffC89BOWQoY0WKGpIhn5gX3iI54O6nRA0yC124NYVtzjmFWBIiFd8M0x+ZdX0P9R4lADg1mgP8C7PxGOWuQ==", + "license": "MIT" + }, + "node_modules/html-void-elements": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-3.0.0.tgz", + "integrity": "sha512-bEqo66MRXsUGxWHV5IP0PUiAWwoEjba4VCzg0LjFJBpchPaTfyfCKTG6bc5F8ucKec3q5y6qOdGyYTSBEvhCrg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/html-whitespace-sensitive-tag-names": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/html-whitespace-sensitive-tag-names/-/html-whitespace-sensitive-tag-names-3.0.1.tgz", + "integrity": "sha512-q+310vW8zmymYHALr1da4HyXUQ0zgiIwIicEfotYPWGN0OJVEN/58IJ3A4GBYcEq3LGAZqKb+ugvP0GNB9CEAA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.2.0.tgz", + "integrity": "sha512-dTxcvPXqPvXBQpq5dUr6mEMJX4oIEFv6bwom3FDwKRDsuIjjJGANqhBuoAn9c1RQJIdAKav33ED65E2ys+87QQ==", + "license": "BSD-2-Clause" + }, + "node_modules/i18next": { + "version": "26.3.4", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-26.3.4.tgz", + "integrity": "sha512-pa7m0d7pBDqGHZxljT+WPFeyFgQ7P7SciPPo1tTqYuO0z4sqADYhwnBESmmGp/wEof1inwdls/k8ZgTg8rxFHA==", + "funding": [ + { + "type": "individual", + "url": "https://www.locize.com/i18next" + }, + { + "type": "individual", + "url": "https://www.i18next.com/how-to/faq#i18next-is-awesome.-how-can-i-support-the-project" + }, + { + "type": "individual", + "url": "https://www.locize.com" + } + ], + "license": "MIT", + "peerDependencies": { + "typescript": "^5 || ^6" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/inline-style-parser": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", + "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", + "license": "MIT" + }, + "node_modules/iron-webcrypto": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/iron-webcrypto/-/iron-webcrypto-1.2.1.tgz", + "integrity": "sha512-feOM6FaSr6rEABp/eDfVseKyTMDt+KGpeB35SkVn9Tyn0CqvVsY3EwI0v5i8nMHyJnzCIQf7nsy3p41TPkJZhg==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/brc-dd" + } + }, + "node_modules/is-alphabetical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-2.0.1.tgz", + "integrity": "sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-alphanumerical": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz", + "integrity": "sha512-hmbYhX/9MUMF5uh7tOXyK/n0ZvWpad5caBA17GsC6vyuCqaWliRG5K1qS9inmUhEMaOBIW7/whAnSwveW/LtZw==", + "license": "MIT", + "dependencies": { + "is-alphabetical": "^2.0.0", + "is-decimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-decimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-decimal/-/is-decimal-2.0.1.tgz", + "integrity": "sha512-AAB9hiomQs5DXWcRB1rqsxGUstbRroFOPPVAomNk/3XHR5JyEZChOyTWe2oayKnsSsr/kcGqF+z6yuH6HHpN0A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-docker": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-4.0.0.tgz", + "integrity": "sha512-LHE+wROyG/Y/0ZnbktRCoTix2c1RhgWaZraMZ8o1Q7zCh0VSrICJQO5oqIIISrcSBtrXv0o233w1IYwsWCjTzA==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-hexadecimal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz", + "integrity": "sha512-DgZQp241c8oO6cA1SbTEWiXeoxV42vlcJxgH+B3hi1AiqqKruZR3ZGF8In3fj4+/y/7rHvlOZLZtgJ/4ttYGZg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container/node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-plain-obj": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-4.1.0.tgz", + "integrity": "sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-wsl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/puzrin" + }, + { + "type": "github", + "url": "https://github.com/sponsors/nodeca" + } + ], + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "license": "MIT" + }, + "node_modules/klona": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/klona/-/klona-2.0.6.tgz", + "integrity": "sha512-dhG34DXATL5hSxJbIexCft8FChFXtmskoZYnoPWjXQuebWYCNkVeV3KkGegCK9CP1oswI/vQibS2GY7Em/sJJA==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/longest-streak": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz", + "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/lru-cache": { + "version": "11.5.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.1.tgz", + "integrity": "sha512-RPimw/7aMdv2oqRrxKwvZXcPfwBrn/JZ2xYcY9Hus/6LaS3VOAKVWKWgNLCFSiOm1ESXinjsDlidVU7JlnCN2A==", + "license": "BlueOak-1.0.0", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/magicast": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/magicast/-/magicast-0.5.3.tgz", + "integrity": "sha512-pVKE4UdSQ7DvHzivsCIFx2BJn1mHG6KsyrFcaxFx6tONdneEuThrDx0Cj3AMg58KyN4pzYT+LHOotxDQDjNvkw==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.3", + "@babel/types": "^7.29.0", + "source-map-js": "^1.2.1" + } + }, + "node_modules/markdown-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/markdown-extensions/-/markdown-extensions-2.0.0.tgz", + "integrity": "sha512-o5vL7aDWatOTX8LzaS1WMoaoxIiLRQJuIKKe2wAw6IeULDHaqbiqiggmx+pKvZDb1Sj+pE46Sn1T7lCqfFtg1Q==", + "license": "MIT", + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/markdown-table": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz", + "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/mdast-util-definitions": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-6.0.0.tgz", + "integrity": "sha512-scTllyX6pnYNZH/AIp/0ePz6s4cZtARxImwoPJ7kS42n+MnVsI4XbnG6d4ibehRIldYMWM2LD7ImQblVhUejVQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-directive": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-directive/-/mdast-util-directive-3.1.0.tgz", + "integrity": "sha512-I3fNFt+DHmpWCYAT7quoM6lHf9wuqtI+oCOfvILnoicNIqjh5E3dEJWiXuYME2gNe8vl1iMQwyUHa7bgFmak6Q==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-find-and-replace": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz", + "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "escape-string-regexp": "^5.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-from-markdown": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz", + "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark": "^4.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz", + "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==", + "license": "MIT", + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm-autolink-literal": "^2.0.0", + "mdast-util-gfm-footnote": "^2.0.0", + "mdast-util-gfm-strikethrough": "^2.0.0", + "mdast-util-gfm-table": "^2.0.0", + "mdast-util-gfm-task-list-item": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-autolink-literal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz", + "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "ccount": "^2.0.0", + "devlop": "^1.0.0", + "mdast-util-find-and-replace": "^3.0.0", + "micromark-util-character": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-strikethrough": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz", + "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-table": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz", + "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "markdown-table": "^3.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-gfm-task-list-item": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz", + "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx/-/mdast-util-mdx-3.0.0.tgz", + "integrity": "sha512-JfbYLAW7XnYTTbUsmpu0kdBUVe+yKVJZBItEjwyYJiDJuZ9w4eeaqks4HQO+R7objWgS2ymV60GYpI14Ug554w==", + "license": "MIT", + "dependencies": { + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-mdx-expression": "^2.0.0", + "mdast-util-mdx-jsx": "^3.0.0", + "mdast-util-mdxjs-esm": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-expression": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-expression/-/mdast-util-mdx-expression-2.0.1.tgz", + "integrity": "sha512-J6f+9hUp+ldTZqKRSg7Vw5V6MqjATc+3E4gf3CFNcuZNWD8XdyI6zQ8GqH7f8169MM6P7hMBRDVGnn7oHB9kXQ==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdx-jsx": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/mdast-util-mdx-jsx/-/mdast-util-mdx-jsx-3.2.0.tgz", + "integrity": "sha512-lj/z8v0r6ZtsN/cGNNtemmmfoLAFZnjMbNyLzBafjzikOM+glrjNHPlf6lQDOTccj9n5b0PPihEBbhneMyGs1Q==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "ccount": "^2.0.0", + "devlop": "^1.1.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0", + "parse-entities": "^4.0.0", + "stringify-entities": "^4.0.0", + "unist-util-stringify-position": "^4.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-mdxjs-esm": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mdast-util-mdxjs-esm/-/mdast-util-mdxjs-esm-2.0.1.tgz", + "integrity": "sha512-EcmOpxsZ96CvlP03NghtH1EsLtr0n9Tm4lPUJUBccV9RwUOneqSycg19n5HGzCf+10LozMRSObtVr3ee1WoHtg==", + "license": "MIT", + "dependencies": { + "@types/estree-jsx": "^1.0.0", + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "devlop": "^1.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-to-markdown": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-phrasing": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz", + "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-hast": { + "version": "13.2.1", + "resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-13.2.1.tgz", + "integrity": "sha512-cctsq2wp5vTsLIcaymblUriiTcZd0CwWtCbLvrOzYCDZoWyMNV8sZ7krj09FSnsiJi3WVsHLM4k6Dq/yaPyCXA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@ungap/structured-clone": "^1.0.0", + "devlop": "^1.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "trim-lines": "^3.0.0", + "unist-util-position": "^5.0.0", + "unist-util-visit": "^5.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-markdown": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz", + "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "@types/unist": "^3.0.0", + "longest-streak": "^3.0.0", + "mdast-util-phrasing": "^4.0.0", + "mdast-util-to-string": "^4.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-decode-string": "^2.0.0", + "unist-util-visit": "^5.0.0", + "zwitch": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdast-util-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz", + "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/mdn-data": { + "version": "2.27.1", + "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.27.1.tgz", + "integrity": "sha512-9Yubnt3e8A0OKwxYSXyhLymGW4sCufcLG6VdiDdUGVkPhpqLxlvP5vl1983gQjJl3tqbrM731mjaZaP68AgosQ==", + "license": "CC0-1.0" + }, + "node_modules/micromark": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz", + "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.0.0", + "debug": "^4.0.0", + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-core-commonmark": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz", + "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-destination": "^2.0.0", + "micromark-factory-label": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-title": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-html-tag-name": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-subtokenize": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-directive": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-directive/-/micromark-extension-directive-4.0.0.tgz", + "integrity": "sha512-/C2nqVmXXmiseSSuCdItCMho7ybwwop6RrrRPk0KbOHW21JKoCldC+8rFOaundDoRBUWBnJJcxeA/Kvi34WQXg==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-factory-whitespace": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "parse-entities": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz", + "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==", + "license": "MIT", + "dependencies": { + "micromark-extension-gfm-autolink-literal": "^2.0.0", + "micromark-extension-gfm-footnote": "^2.0.0", + "micromark-extension-gfm-strikethrough": "^2.0.0", + "micromark-extension-gfm-table": "^2.0.0", + "micromark-extension-gfm-tagfilter": "^2.0.0", + "micromark-extension-gfm-task-list-item": "^2.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-autolink-literal": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz", + "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==", + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-footnote": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz", + "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-normalize-identifier": "^2.0.0", + "micromark-util-sanitize-uri": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-strikethrough": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz", + "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-classify-character": "^2.0.0", + "micromark-util-resolve-all": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-table": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz", + "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-tagfilter": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz", + "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==", + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-gfm-task-list-item": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz", + "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==", + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdx-expression": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-expression/-/micromark-extension-mdx-expression-3.0.1.tgz", + "integrity": "sha512-dD/ADLJ1AeMvSAKBwO22zG22N4ybhe7kFIZ3LsDI0GlsNr2A3KYxb0LdC1u5rj4Nw+CHKY0RVdnHX8vj8ejm4Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-extension-mdx-jsx": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-jsx/-/micromark-extension-mdx-jsx-3.0.2.tgz", + "integrity": "sha512-e5+q1DjMh62LZAJOnDraSSbDMvGJ8x3cbjygy2qFEi7HCeUT4BDKCvMozPozcD6WmOt6sVvYDNBKhFSz3kjOVQ==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "estree-util-is-identifier-name": "^3.0.0", + "micromark-factory-mdx-expression": "^2.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdx-md": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdx-md/-/micromark-extension-mdx-md-2.0.0.tgz", + "integrity": "sha512-EpAiszsB3blw4Rpba7xTOUptcFeBFi+6PY8VnJ2hhimH+vCQDirWgsMpz7w1XcZE7LVrSAUGb9VJpG9ghlYvYQ==", + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs/-/micromark-extension-mdxjs-3.0.0.tgz", + "integrity": "sha512-A873fJfhnJ2siZyUrJ31l34Uqwy4xIFmvPY1oj+Ean5PHcPBYzEsvqvWGaWcfEIr11O5Dlw3p2y0tZWpKHDejQ==", + "license": "MIT", + "dependencies": { + "acorn": "^8.0.0", + "acorn-jsx": "^5.0.0", + "micromark-extension-mdx-expression": "^3.0.0", + "micromark-extension-mdx-jsx": "^3.0.0", + "micromark-extension-mdx-md": "^2.0.0", + "micromark-extension-mdxjs-esm": "^3.0.0", + "micromark-util-combine-extensions": "^2.0.0", + "micromark-util-types": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-extension-mdxjs-esm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/micromark-extension-mdxjs-esm/-/micromark-extension-mdxjs-esm-3.0.0.tgz", + "integrity": "sha512-DJFl4ZqkErRpq/dAPyeWp15tGrcrrJho1hKK5uBS70BCtfrIFg81sqcTVu3Ta+KD1Tk5vAtBNElWxtAa+m8K9A==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-core-commonmark": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/micromark-factory-destination": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz", + "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-label": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz", + "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-mdx-expression": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-factory-mdx-expression/-/micromark-factory-mdx-expression-2.0.3.tgz", + "integrity": "sha512-kQnEtA3vzucU2BkrIa8/VaSAsP+EJ3CKOvhMuJgOEGg9KDC6OAY6nSnNDVRiVNRqj7Y4SlSzcStaH/5jge8JdQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "devlop": "^1.0.0", + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-events-to-acorn": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unist-util-position-from-estree": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "node_modules/micromark-factory-space": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz", + "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-title": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz", + "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-factory-whitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz", + "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-factory-space": "^2.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-character": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz", + "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-chunked": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz", + "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-classify-character": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz", + "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-combine-extensions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz", + "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-chunked": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-numeric-character-reference": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz", + "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-decode-string": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz", + "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "decode-named-character-reference": "^1.0.0", + "micromark-util-character": "^2.0.0", + "micromark-util-decode-numeric-character-reference": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-encode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz", + "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-events-to-acorn": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/micromark-util-events-to-acorn/-/micromark-util-events-to-acorn-2.0.3.tgz", + "integrity": "sha512-jmsiEIiZ1n7X1Rr5k8wVExBQCg5jy4UXVADItHmNk1zkwEVhBuIUKRu3fqv+hs4nxLISi2DQGlqIOGiFxgbfHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/unist": "^3.0.0", + "devlop": "^1.0.0", + "estree-util-visit": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0", + "vfile-message": "^4.0.0" + } + }, + "node_modules/micromark-util-html-tag-name": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz", + "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-normalize-identifier": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz", + "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-resolve-all": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz", + "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-sanitize-uri": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz", + "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "micromark-util-character": "^2.0.0", + "micromark-util-encode": "^2.0.0", + "micromark-util-symbol": "^2.0.0" + } + }, + "node_modules/micromark-util-subtokenize": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz", + "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT", + "dependencies": { + "devlop": "^1.0.0", + "micromark-util-chunked": "^2.0.0", + "micromark-util-symbol": "^2.0.0", + "micromark-util-types": "^2.0.0" + } + }, + "node_modules/micromark-util-symbol": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz", + "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/micromark-util-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz", + "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==", + "funding": [ + { + "type": "GitHub Sponsors", + "url": "https://github.com/sponsors/unifiedjs" + }, + { + "type": "OpenCollective", + "url": "https://opencollective.com/unified" + } + ], + "license": "MIT" + }, + "node_modules/mrmime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mrmime/-/mrmime-2.0.1.tgz", + "integrity": "sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==", + "license": "MIT", + "engines": { + "node": ">=10" + } + }, + "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==", + "license": "MIT" + }, + "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==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/neotraverse": { + "version": "0.6.18", + "resolved": "https://registry.npmjs.org/neotraverse/-/neotraverse-0.6.18.tgz", + "integrity": "sha512-Z4SmBUweYa09+o6pG+eASabEpP6QkQ70yHj351pQoEXIs8uHbaU2DWVmzBANKgflPa47A50PtB2+NgRpQvr7vA==", + "license": "MIT", + "engines": { + "node": ">= 10" + } + }, + "node_modules/nlcst-to-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/nlcst-to-string/-/nlcst-to-string-4.0.0.tgz", + "integrity": "sha512-YKLBCcUYKAg0FNlOBT6aI91qFmSiFKiluk655WzPF+DDMA02qIyy8uiRqI8QXtcFpEvll12LpL5MXqEmAZ+dcA==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/node-fetch-native": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/node-fetch-native/-/node-fetch-native-1.6.7.tgz", + "integrity": "sha512-g9yhqoedzIUm0nTnTqAQvueMPVOuIY16bqgAJJC8XOOubYFNwz6IER9qs0Gq2Xd0+CecCKFjtdDTMA4u4xG06Q==", + "license": "MIT" + }, + "node_modules/node-mock-http": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/node-mock-http/-/node-mock-http-1.0.4.tgz", + "integrity": "sha512-8DY+kFsDkNXy1sJglUfuODx1/opAGJGyrTuFqEoN90oRc2Vk0ZbD4K2qmKXBBEhZQzdKHIVfEJpDU8Ak2NJEvQ==", + "license": "MIT" + }, + "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==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "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==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/obug": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.3.tgz", + "integrity": "sha512-9miFgM2OFba7hB+pRgvtV84pYTBaoTHohvmIgiRt6dRIzbwEOIaNaP+dIlGs2fNFoB0SeISs0Jz5WFVRid6Xyg==", + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/ofetch": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.5.1.tgz", + "integrity": "sha512-2W4oUZlVaqAPAil6FUg/difl6YhqhUR7x2eZY4bQCko22UXg3hptq9KLQdqFClV+Wu85UX7hNtdGTngi/1BxcA==", + "license": "MIT", + "dependencies": { + "destr": "^2.0.5", + "node-fetch-native": "^1.6.7", + "ufo": "^1.6.1" + } + }, + "node_modules/ohash": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/ohash/-/ohash-2.0.11.tgz", + "integrity": "sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==", + "license": "MIT" + }, + "node_modules/oniguruma-parser": { + "version": "0.12.2", + "resolved": "https://registry.npmjs.org/oniguruma-parser/-/oniguruma-parser-0.12.2.tgz", + "integrity": "sha512-6HVa5oIrgMC6aA6WF6XyyqbhRPJrKR02L20+2+zpDtO5QAzGHAUGw5TKQvwi5vctNnRHkJYmjAhRVQF2EKdTQw==", + "license": "MIT" + }, + "node_modules/oniguruma-to-es": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/oniguruma-to-es/-/oniguruma-to-es-4.3.6.tgz", + "integrity": "sha512-csuQ9x3Yr0cEIs/Zgx/OEt9iBw9vqIunAPQkx19R/fiMq2oGVTgcMqO/V3Ybqefr1TBvosI6jU539ksaBULJyA==", + "license": "MIT", + "dependencies": { + "oniguruma-parser": "^0.12.2", + "regex": "^6.1.0", + "regex-recursion": "^6.0.2" + } + }, + "node_modules/p-limit": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-7.3.0.tgz", + "integrity": "sha512-7cIXg/Z0M5WZRblrsOla88S4wAK+zOQQWeBYfV3qJuJXMr+LnbYjaadrFaS0JILfEDPVqHyKnZ1Z/1d6J9VVUw==", + "license": "MIT", + "dependencies": { + "yocto-queue": "^1.2.1" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-queue": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-9.3.1.tgz", + "integrity": "sha512-POWdiIPmsUPGwb4FeQ4OBg46aqmcInSWe45CKDsGHiOBiVQM9chqfQTuqhuTzcg2Vz9faTI65at0KkVyVEiCHw==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^5.0.4", + "p-timeout": "^7.0.0" + }, + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-timeout": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-7.0.1.tgz", + "integrity": "sha512-AxTM2wDGORHGEkPCt8yqxOTMgpfbEHqF51f/5fJCmwFC3C/zNcGT63SymH2ttOAaiIws2zVg4+izQCjrakcwHg==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/package-manager-detector": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/package-manager-detector/-/package-manager-detector-1.7.0.tgz", + "integrity": "sha512-xg1eHpwYL/D/HEdWw2goFZP6vV0FH7W+PZ5rFkGjdIDLtxq7EkzBUeT3m+lndYCt8wKbmofUu1MUdMCXkCk9ZQ==", + "license": "MIT" + }, + "node_modules/pagefind": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/pagefind/-/pagefind-1.5.2.tgz", + "integrity": "sha512-XTUaK0hXMCu2jszWE584JGQT7y284TmMV9l/HX3rnG5uo3rHI/uHU56XTyyyPFjeWEBxECbAi0CaFDJOONtG0Q==", + "license": "MIT", + "bin": { + "pagefind": "lib/runner/bin.cjs" + }, + "optionalDependencies": { + "@pagefind/darwin-arm64": "1.5.2", + "@pagefind/darwin-x64": "1.5.2", + "@pagefind/freebsd-x64": "1.5.2", + "@pagefind/linux-arm64": "1.5.2", + "@pagefind/linux-x64": "1.5.2", + "@pagefind/windows-arm64": "1.5.2", + "@pagefind/windows-x64": "1.5.2" + } + }, + "node_modules/parse-entities": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-4.0.2.tgz", + "integrity": "sha512-GG2AQYWoLgL877gQIKeRPGO1xF9+eG1ujIb5soS5gPvLQ1y2o8FL90w2QWNdf9I361Mpp7726c+lj3U0qK1uGw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "character-entities-legacy": "^3.0.0", + "character-reference-invalid": "^2.0.0", + "decode-named-character-reference": "^1.0.0", + "is-alphanumerical": "^2.0.0", + "is-decimal": "^2.0.0", + "is-hexadecimal": "^2.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse-entities/node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "license": "MIT" + }, + "node_modules/parse-latin": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse-latin/-/parse-latin-7.0.0.tgz", + "integrity": "sha512-mhHgobPPua5kZ98EF4HWiH167JWBfl4pvAIXXdbaVohtK7a6YBOy56kvhCqduqyo/f3yrHFWmqmiMg/BkBkYYQ==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "@types/unist": "^3.0.0", + "nlcst-to-string": "^4.0.0", + "unist-util-modify-children": "^4.0.0", + "unist-util-visit-children": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/parse5": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.3.0.tgz", + "integrity": "sha512-IInvU7fabl34qmi9gY8XOVxhYyMyuH2xUNpb2q8/Y+7552KlejkRvqvD19nMoUW/uQGGbqNpA6Tufu5FL5BZgw==", + "license": "MIT", + "dependencies": { + "entities": "^6.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/piccolore": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/piccolore/-/piccolore-0.1.3.tgz", + "integrity": "sha512-o8bTeDWjE086iwKrROaDf31K0qC/BENdm15/uH9usSC/uZjJOKb2YGiVHfLY4GhwsERiPI1jmwI2XrA7ACOxVw==", + "license": "ISC" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.5.tgz", + "integrity": "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A==", + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.16", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz", + "integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==", + "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" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.12", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/postcss-nested": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/postcss-nested/-/postcss-nested-6.2.0.tgz", + "integrity": "sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "postcss-selector-parser": "^6.1.1" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "postcss": "^8.2.14" + } + }, + "node_modules/postcss-selector-parser": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-6.1.4.tgz", + "integrity": "sha512-bIoJLOmjCO1S9XdY/DcnR5hJxvrDir1PbGChrzXG3vw0/FOliy/fA3dmdhQ441kah4gKv+TwckGzex6wNS5cnQ==", + "license": "MIT", + "dependencies": { + "cssesc": "^3.0.0", + "util-deprecate": "^1.0.2" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/process-ancestry": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/process-ancestry/-/process-ancestry-0.1.0.tgz", + "integrity": "sha512-tGqJW/UnclpYASFcM6Xh8D8l/BMtaQ9+CSG0vlJSJTcdMM4lDRv4c6H0Pdcsfted+bVczdYSfk2fdukg2gQkZg==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + } + }, + "node_modules/property-information": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/property-information/-/property-information-7.2.0.tgz", + "integrity": "sha512-IAtzIB6sUiWaJYrX9smp3V46pBGbBeLFRGdh25kg1334VcBlD8HzhPeNIWQH9zhGmo2itIe25EHt9dQP7G5hmg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/radix3": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz", + "integrity": "sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==", + "license": "MIT" + }, + "node_modules/readdirp": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-5.0.0.tgz", + "integrity": "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==", + "license": "MIT", + "engines": { + "node": ">= 20.19.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/recma-build-jsx": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-build-jsx/-/recma-build-jsx-1.0.0.tgz", + "integrity": "sha512-8GtdyqaBcDfva+GUKDr3nev3VpKAhup1+RvkMvUxURHpW7QyIvk9F5wz7Vzo06CEMSilw6uArgRqhpiUcWp8ew==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-util-build-jsx": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/recma-jsx": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/recma-jsx/-/recma-jsx-1.0.1.tgz", + "integrity": "sha512-huSIy7VU2Z5OLv6oFLosQGGDqPqdO1iq6bWNAdhzMxSJP7RAso4fCZ1cKu8j9YHCZf3TPrq4dw3okhrylgcd7w==", + "license": "MIT", + "dependencies": { + "acorn-jsx": "^5.0.0", + "estree-util-to-js": "^2.0.0", + "recma-parse": "^1.0.0", + "recma-stringify": "^1.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/recma-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-parse/-/recma-parse-1.0.0.tgz", + "integrity": "sha512-OYLsIGBB5Y5wjnSnQW6t3Xg7q3fQ7FWbw/vcXtORTnyaSFscOtABg+7Pnz6YZ6c27fG1/aN8CjfwoUEUIdwqWQ==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "esast-util-from-js": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/recma-stringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/recma-stringify/-/recma-stringify-1.0.0.tgz", + "integrity": "sha512-cjwII1MdIIVloKvC9ErQ+OgAtwHBmcZ0Bg4ciz78FtbT8In39aAYbaA7zvxQ61xVMSPE8WxhLwLbhif4Js2C+g==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "estree-util-to-js": "^2.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/regex": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/regex/-/regex-6.1.0.tgz", + "integrity": "sha512-6VwtthbV4o/7+OaAF9I5L5V3llLEsoPyq9P1JVXkedTP33c7MfCG0/5NOPcSJn0TzXcG9YUrR0gQSWioew3LDg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-recursion": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/regex-recursion/-/regex-recursion-6.0.2.tgz", + "integrity": "sha512-0YCaSCq2VRIebiaUviZNs0cBz1kg5kVS2UKUfNIx8YVs1cN3AV7NTctO5FOKBA+UT2BPJIWZauYHPqJODG50cg==", + "license": "MIT", + "dependencies": { + "regex-utilities": "^2.3.0" + } + }, + "node_modules/regex-utilities": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/regex-utilities/-/regex-utilities-2.3.0.tgz", + "integrity": "sha512-8VhliFJAWRaUiVvREIiW2NXXTmHs4vMNnSzuJVhscgmGav3g9VDxLrQndI3dZZVVdp0ZO/5v0xmX516/7M9cng==", + "license": "MIT" + }, + "node_modules/rehype": { + "version": "13.0.2", + "resolved": "https://registry.npmjs.org/rehype/-/rehype-13.0.2.tgz", + "integrity": "sha512-j31mdaRFrwFRUIlxGeuPXXKWQxet52RBQRvCmzl5eCefn/KGbomK5GMHNMsOJf55fgo3qw5tST5neDuarDYR2A==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "rehype-parse": "^9.0.0", + "rehype-stringify": "^10.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-expressive-code": { + "version": "0.44.0", + "resolved": "https://registry.npmjs.org/rehype-expressive-code/-/rehype-expressive-code-0.44.0.tgz", + "integrity": "sha512-5r74C5F2sMR3X+QJH8OKWgZBO/cqRw5W1fLT6GVlSfLqepk+4j8tGFkyPqZYWjwntsBHzKPDH2zI68sZ7ScLfA==", + "license": "MIT", + "dependencies": { + "expressive-code": "^0.44.0" + } + }, + "node_modules/rehype-format": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/rehype-format/-/rehype-format-5.0.1.tgz", + "integrity": "sha512-zvmVru9uB0josBVpr946OR8ui7nJEdzZobwLOOqHb/OOD88W0Vk2SqLwoVOj0fM6IPCCO6TaV9CvQvJMWwukFQ==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-format": "^1.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-parse": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/rehype-parse/-/rehype-parse-9.0.1.tgz", + "integrity": "sha512-ksCzCD0Fgfh7trPDxr2rSylbwq9iYDkSn8TCDmEJ49ljEUBxDVCzCHv7QNzZOfODanX4+bWQ4WZqLCRWYLfhag==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-from-html": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-raw": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/rehype-raw/-/rehype-raw-7.0.0.tgz", + "integrity": "sha512-/aE8hCfKlQeA8LmyeyQvQF3eBiLRGNlfBJEvWH7ivp9sBqs7TNqBL5X3v157rM4IFETqDnIOO+z5M/biZbo9Ww==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-raw": "^9.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-recma": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/rehype-recma/-/rehype-recma-1.0.0.tgz", + "integrity": "sha512-lqA4rGUf1JmacCNWWZx0Wv1dHqMwxzsDWYMTowuplHF3xH0N/MmrZ/G3BDZnzAkRmxDadujCjaKM2hqYdCBOGw==", + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.0", + "@types/hast": "^3.0.0", + "hast-util-to-estree": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rehype-stringify": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/rehype-stringify/-/rehype-stringify-10.0.1.tgz", + "integrity": "sha512-k9ecfXHmIPuFVI61B9DeLPN0qFHfawM6RsuX48hoqlaKSF61RskNjSm1lI8PhBEM0MRdLxVVm4WmTqJQccH9mA==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "hast-util-to-html": "^9.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-directive": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/remark-directive/-/remark-directive-4.0.0.tgz", + "integrity": "sha512-7sxn4RfF1o3izevPV1DheyGDD6X4c9hrGpfdUpm7uC++dqrnJxIZVkk7CoKqcLm0VUMAuOol7Mno3m6g8cfMuA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-directive": "^3.0.0", + "micromark-extension-directive": "^4.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-gfm": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/remark-gfm/-/remark-gfm-4.0.1.tgz", + "integrity": "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "remark-parse": "^11.0.0", + "remark-stringify": "^11.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-mdx": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/remark-mdx/-/remark-mdx-3.1.1.tgz", + "integrity": "sha512-Pjj2IYlUY3+D8x00UJsIOg5BEvfMyeI+2uLPn9VO9Wg4MEtN/VTIq2NEJQfde9PnX15KgtHyl9S0BcTnWrIuWg==", + "license": "MIT", + "dependencies": { + "mdast-util-mdx": "^3.0.0", + "micromark-extension-mdxjs": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-parse": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-11.0.0.tgz", + "integrity": "sha512-FCxlKLNGknS5ba/1lmpYijMUzX2esxW5xQqjWxw2eHFfS2MSdaHVINFmhjo+qN1WhZhNimq0dZATN9pH0IDrpA==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-from-markdown": "^2.0.0", + "micromark-util-types": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-rehype": { + "version": "11.1.2", + "resolved": "https://registry.npmjs.org/remark-rehype/-/remark-rehype-11.1.2.tgz", + "integrity": "sha512-Dh7l57ianaEoIpzbp0PC9UKAdCSVklD8E5Rpw7ETfbTl3FqcOOgq5q2LVDhgGCkaBv7p24JXikPdvhhmHvKMsw==", + "license": "MIT", + "dependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "mdast-util-to-hast": "^13.0.0", + "unified": "^11.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/remark-smartypants": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/remark-smartypants/-/remark-smartypants-3.0.2.tgz", + "integrity": "sha512-ILTWeOriIluwEvPjv67v7Blgrcx+LZOkAUVtKI3putuhlZm84FnqDORNXPPm+HY3NdZOMhyDwZ1E+eZB/Df5dA==", + "license": "MIT", + "dependencies": { + "retext": "^9.0.0", + "retext-smartypants": "^6.0.0", + "unified": "^11.0.4", + "unist-util-visit": "^5.0.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/remark-stringify": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-11.0.0.tgz", + "integrity": "sha512-1OSmLd3awB/t8qdoEOMazZkNsfVTeY4fTsgzcQFdXNq8ToTN4ZGwrMnlda4K6smTFKD+GRV6O48i6Z4iKgPPpw==", + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.0", + "mdast-util-to-markdown": "^2.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/resolve-pkg-maps": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/resolve-pkg-maps/-/resolve-pkg-maps-1.0.0.tgz", + "integrity": "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==", + "license": "MIT", + "funding": { + "url": "https://github.com/privatenumber/resolve-pkg-maps?sponsor=1" + } + }, + "node_modules/retext": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/retext/-/retext-9.0.0.tgz", + "integrity": "sha512-sbMDcpHCNjvlheSgMfEcVrZko3cDzdbe1x/e7G66dFp0Ff7Mldvi2uv6JkJQzdRcvLYE8CA8Oe8siQx8ZOgTcA==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "retext-latin": "^4.0.0", + "retext-stringify": "^4.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-latin": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retext-latin/-/retext-latin-4.0.0.tgz", + "integrity": "sha512-hv9woG7Fy0M9IlRQloq/N6atV82NxLGveq+3H2WOi79dtIYWN8OaxogDm77f8YnVXJL2VD3bbqowu5E3EMhBYA==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "parse-latin": "^7.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-smartypants": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/retext-smartypants/-/retext-smartypants-6.2.0.tgz", + "integrity": "sha512-kk0jOU7+zGv//kfjXEBjdIryL1Acl4i9XNkHxtM7Tm5lFiCog576fjNC9hjoR7LTKQ0DsPWy09JummSsH1uqfQ==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "nlcst-to-string": "^4.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/retext-stringify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/retext-stringify/-/retext-stringify-4.0.0.tgz", + "integrity": "sha512-rtfN/0o8kL1e+78+uxPTqu1Klt0yPzKuQ2BfWwwfgIUSayyzxpM1PJzkKt4V8803uB9qSy32MvI7Xep9khTpiA==", + "license": "MIT", + "dependencies": { + "@types/nlcst": "^2.0.0", + "nlcst-to-string": "^4.0.0", + "unified": "^11.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/rolldown": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.1.4.tgz", + "integrity": "sha512-IjZYiLxZwpnhwhdBH2ugdTGVSdhCQUmLxLoqyjiL0JxYjyRst+5a0P3xfrTxJ5F638j4Mvvw5FAX5XE6eHpXbA==", + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.138.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.1.4", + "@rolldown/binding-darwin-arm64": "1.1.4", + "@rolldown/binding-darwin-x64": "1.1.4", + "@rolldown/binding-freebsd-x64": "1.1.4", + "@rolldown/binding-linux-arm-gnueabihf": "1.1.4", + "@rolldown/binding-linux-arm64-gnu": "1.1.4", + "@rolldown/binding-linux-arm64-musl": "1.1.4", + "@rolldown/binding-linux-ppc64-gnu": "1.1.4", + "@rolldown/binding-linux-s390x-gnu": "1.1.4", + "@rolldown/binding-linux-x64-gnu": "1.1.4", + "@rolldown/binding-linux-x64-musl": "1.1.4", + "@rolldown/binding-openharmony-arm64": "1.1.4", + "@rolldown/binding-wasm32-wasi": "1.1.4", + "@rolldown/binding-win32-arm64-msvc": "1.1.4", + "@rolldown/binding-win32-x64-msvc": "1.1.4" + } + }, + "node_modules/satteri": { + "version": "0.9.4", + "resolved": "https://registry.npmjs.org/satteri/-/satteri-0.9.4.tgz", + "integrity": "sha512-BKob126Tay84diOZsnVNH/Q/c+3njPJTCad3w5zLKa6j8bVjxskPNHDtxrMwYK4bN/RlqUSdMnPwKY4k65EMOQ==", + "dependencies": { + "@types/estree-jsx": "^1.0.5", + "@types/hast": "^3.0.4", + "@types/mdast": "^4.0.4", + "@types/unist": "^3.0.3" + }, + "optionalDependencies": { + "@bruits/satteri-darwin-arm64": "0.9.4", + "@bruits/satteri-darwin-x64": "0.9.4", + "@bruits/satteri-linux-arm64-gnu": "0.9.4", + "@bruits/satteri-linux-arm64-musl": "0.9.4", + "@bruits/satteri-linux-x64-gnu": "0.9.4", + "@bruits/satteri-linux-x64-musl": "0.9.4", + "@bruits/satteri-wasm32-wasi": "0.9.4", + "@bruits/satteri-win32-arm64-msvc": "0.9.4", + "@bruits/satteri-win32-x64-msvc": "0.9.4" + } + }, + "node_modules/sax": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.6.0.tgz", + "integrity": "sha512-6R3J5M4AcbtLUdZmRv2SygeVaM7IhrLXu9BmnOGmmACak8fiUtOsYNWUS4uK7upbmHIBbLBeFeI//477BKLBzA==", + "license": "BlueOak-1.0.0", + "engines": { + "node": ">=11.0.0" + } + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/sharp": { + "version": "0.35.3", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.3.tgz", + "integrity": "sha512-ej0zVHuZGHCiABXcNxeYhpRnPNPAcvbG8RMdBAhDAxLKkCRVSpK3Iyu7qbqw3JMzoj0REeM6f3tJLtVwl0023Q==", + "license": "Apache-2.0", + "dependencies": { + "@img/colour": "^1.1.0", + "detect-libc": "^2.1.2", + "semver": "^7.8.5" + }, + "engines": { + "node": ">=20.9.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.35.3", + "@img/sharp-darwin-x64": "0.35.3", + "@img/sharp-freebsd-wasm32": "0.35.3", + "@img/sharp-libvips-darwin-arm64": "1.3.2", + "@img/sharp-libvips-darwin-x64": "1.3.2", + "@img/sharp-libvips-linux-arm": "1.3.2", + "@img/sharp-libvips-linux-arm64": "1.3.2", + "@img/sharp-libvips-linux-ppc64": "1.3.2", + "@img/sharp-libvips-linux-riscv64": "1.3.2", + "@img/sharp-libvips-linux-s390x": "1.3.2", + "@img/sharp-libvips-linux-x64": "1.3.2", + "@img/sharp-libvips-linuxmusl-arm64": "1.3.2", + "@img/sharp-libvips-linuxmusl-x64": "1.3.2", + "@img/sharp-linux-arm": "0.35.3", + "@img/sharp-linux-arm64": "0.35.3", + "@img/sharp-linux-ppc64": "0.35.3", + "@img/sharp-linux-riscv64": "0.35.3", + "@img/sharp-linux-s390x": "0.35.3", + "@img/sharp-linux-x64": "0.35.3", + "@img/sharp-linuxmusl-arm64": "0.35.3", + "@img/sharp-linuxmusl-x64": "0.35.3", + "@img/sharp-webcontainers-wasm32": "0.35.3", + "@img/sharp-win32-arm64": "0.35.3", + "@img/sharp-win32-ia32": "0.35.3", + "@img/sharp-win32-x64": "0.35.3" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + } + }, + "node_modules/shiki": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/shiki/-/shiki-4.3.1.tgz", + "integrity": "sha512-oR+qDVi2OjX1tmDpyv+3KviX01KzO6Af+0NNnKnsp9491UEGz2YpxTuJboS/6VhYpTdqzmuJBuiTlrAWWJAssw==", + "license": "MIT", + "dependencies": { + "@shikijs/core": "4.3.1", + "@shikijs/engine-javascript": "4.3.1", + "@shikijs/engine-oniguruma": "4.3.1", + "@shikijs/langs": "4.3.1", + "@shikijs/themes": "4.3.1", + "@shikijs/types": "4.3.1", + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "license": "MIT" + }, + "node_modules/sitemap": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/sitemap/-/sitemap-9.0.1.tgz", + "integrity": "sha512-S6hzjGJSG3d6if0YoF5kTyeRJvia6FSTBroE5fQ0bu1QNxyJqhhinfUsXi9fH3MgtXODWvwo2BDyQSnhPQ88uQ==", + "license": "MIT", + "dependencies": { + "@types/node": "^24.9.2", + "@types/sax": "^1.2.1", + "arg": "^5.0.0", + "sax": "^1.4.1" + }, + "bin": { + "sitemap": "dist/esm/cli.js" + }, + "engines": { + "node": ">=20.19.5", + "npm": ">=10.8.2" + } + }, + "node_modules/smol-toml": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/smol-toml/-/smol-toml-1.7.0.tgz", + "integrity": "sha512-aqVvWoyO21L23mb+drl4RmMXbf6N7FdHjAhTRA9ZBL7apWBgfWC16KjrASI+1p9GAroljyMHj6fK67i0UiTNvQ==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 18" + }, + "funding": { + "url": "https://github.com/sponsors/cyyynthia" + } + }, + "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==", + "license": "BSD-3-Clause", + "engines": { + "node": ">= 12" + } + }, + "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==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/space-separated-tokens": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-2.0.2.tgz", + "integrity": "sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/stream-replace-string": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stream-replace-string/-/stream-replace-string-2.0.0.tgz", + "integrity": "sha512-TlnjJ1C0QrmxRNrON00JvaFFlNh5TTG00APw23j74ET7gkQpTASi6/L2fuiav8pzK715HXtUeClpBTw2NPSn6w==", + "license": "MIT" + }, + "node_modules/stringify-entities": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-4.0.4.tgz", + "integrity": "sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==", + "license": "MIT", + "dependencies": { + "character-entities-html4": "^2.0.0", + "character-entities-legacy": "^3.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/style-to-js": { + "version": "1.1.21", + "resolved": "https://registry.npmjs.org/style-to-js/-/style-to-js-1.1.21.tgz", + "integrity": "sha512-RjQetxJrrUJLQPHbLku6U/ocGtzyjbJMP9lCNK7Ag0CNh690nSH8woqWH9u16nMjYBAok+i7JO1NP2pOy8IsPQ==", + "license": "MIT", + "dependencies": { + "style-to-object": "1.0.14" + } + }, + "node_modules/style-to-object": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", + "integrity": "sha512-LIN7rULI0jBscWQYaSswptyderlarFkjQ+t79nzty8tcIAceVomEVlLzH5VP4Cmsv6MtKhs7qaAiwlcp+Mgaxw==", + "license": "MIT", + "dependencies": { + "inline-style-parser": "0.2.7" + } + }, + "node_modules/svgo": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-4.0.1.tgz", + "integrity": "sha512-XDpWUOPC6FEibaLzjfe0ucaV0YrOjYotGJO1WpF0Zd+n6ZGEQUsSugaoLq9QkEZtAfQIxT42UChcssDVPP3+/w==", + "license": "MIT", + "dependencies": { + "commander": "^11.1.0", + "css-select": "^5.1.0", + "css-tree": "^3.0.1", + "css-what": "^6.1.0", + "csso": "^5.0.5", + "picocolors": "^1.1.1", + "sax": "^1.5.0" + }, + "bin": { + "svgo": "bin/svgo.js" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/svgo" + } + }, + "node_modules/tiny-inflate": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-inflate/-/tiny-inflate-1.0.3.tgz", + "integrity": "sha512-pkY1fj1cKHb2seWDy0B16HeWyczlJA9/WW3u3c4z/NiWDsO3DOU5D7nhTLE9CF0yXv/QZFY7sEJmj24dK+Rrqw==", + "license": "MIT" + }, + "node_modules/tinyclip": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/tinyclip/-/tinyclip-0.1.15.tgz", + "integrity": "sha512-uo33abH+Ays0xYaDysoBt494Hb3hsEczMpcC0MwFl773pazORx4fmvKhclhR1wonUbB6vvpRsvVMwnhfqeMc+A==", + "license": "MIT", + "engines": { + "node": "^16.14.0 || >= 17.3.0" + } + }, + "node_modules/tinyexec": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/tinyexec/-/tinyexec-1.2.4.tgz", + "integrity": "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.17", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz", + "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==", + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/trim-lines": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/trim-lines/-/trim-lines-3.0.1.tgz", + "integrity": "sha512-kRj8B+YHZCc9kQYdWfJB2/oUl9rA99qbowYYBtr4ui4mZyAQ2JpvVBd/6U2YloATfqBhBTSMhTpgBHtU0Mf3Rg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/trough": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", + "integrity": "sha512-tmMpK00BjZiUyVyvrBK7knerNgmgvcV/KLVyuma/SC+TQN167GrMRciANTz09+k3zW8L8t60jWO1GpfkZdjTaw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "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==", + "license": "0BSD", + "optional": true + }, + "node_modules/ufo": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.4.tgz", + "integrity": "sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==", + "license": "MIT" + }, + "node_modules/ultrahtml": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ultrahtml/-/ultrahtml-1.6.0.tgz", + "integrity": "sha512-R9fBn90VTJrqqLDwyMph+HGne8eqY1iPfYhPzZrvKpIfwkWZbcYlfpsb8B9dTvBfpy1/hqAD7Wi8EKfP9e8zdw==", + "license": "MIT" + }, + "node_modules/uncrypto": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/uncrypto/-/uncrypto-0.1.3.tgz", + "integrity": "sha512-Ql87qFHB3s/De2ClA9e0gsnS6zXG27SkTiSJwjCc9MebbfapQfuPzumMIUMi38ezPZVNFcHI9sUIepeQfw8J8Q==", + "license": "MIT" + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "license": "MIT" + }, + "node_modules/unified": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/unified/-/unified-11.0.5.tgz", + "integrity": "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "bail": "^2.0.0", + "devlop": "^1.0.0", + "extend": "^3.0.0", + "is-plain-obj": "^4.0.0", + "trough": "^2.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unifont": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/unifont/-/unifont-0.7.4.tgz", + "integrity": "sha512-oHeis4/xl42HUIeHuNZRGEvxj5AaIKR+bHPNegRq5LV1gdc3jundpONbjglKpihmJf+dswygdMJn3eftGIMemg==", + "license": "MIT", + "dependencies": { + "css-tree": "^3.1.0", + "ofetch": "^1.5.1", + "ohash": "^2.0.11" + } + }, + "node_modules/unist-util-find-after": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-find-after/-/unist-util-find-after-5.0.0.tgz", + "integrity": "sha512-amQa0Ep2m6hE2g72AugUItjbuM8X8cGQnFoHk0pGfrFeT9GZhzN5SW8nRsiGKK7Aif4CrACPENkA6P/Lw6fHGQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-is": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz", + "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-modify-children": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-modify-children/-/unist-util-modify-children-4.0.0.tgz", + "integrity": "sha512-+tdN5fGNddvsQdIzUF3Xx82CU9sMM+fA0dLgR9vOmT0oPT2jH+P1nd5lSqfCfXAw+93NhcXNY2qqvTUtE4cQkw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "array-iterate": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-5.0.0.tgz", + "integrity": "sha512-fucsC7HjXvkB5R3kTCO7kUjRdrS0BJt3M/FPxmHMBOm8JQi2BsHAHFsy27E0EolP8rp0NzXsJ+jNPyDWvOJZPA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-position-from-estree": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unist-util-position-from-estree/-/unist-util-position-from-estree-2.0.0.tgz", + "integrity": "sha512-KaFVRjoqLyF6YXCbVLNad/eS4+OfPQQn2yOd7zF/h5T/CSL2v8NpN6a5TPvtbXthAGw5nG+PuTtq+DdIZr+cRQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-remove-position": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz", + "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz", + "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz", + "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-children": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/unist-util-visit-children/-/unist-util-visit-children-3.0.0.tgz", + "integrity": "sha512-RgmdTfSBOg04sdPcpTSD1jzoNBjt9a80/ZCzp5cI9n1qPzLZWF9YdvWGN2zmTumP1HWhXKdUWexjy/Wy/lJ7tA==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz", + "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unstorage": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.17.5.tgz", + "integrity": "sha512-0i3iqvRfx29hkNntHyQvJTpf5W9dQ9ZadSoRU8+xVlhVtT7jAX57fazYO9EHvcRCfBCyi5YRya7XCDOsbTgkPg==", + "license": "MIT", + "dependencies": { + "anymatch": "^3.1.3", + "chokidar": "^5.0.0", + "destr": "^2.0.5", + "h3": "^1.15.10", + "lru-cache": "^11.2.7", + "node-fetch-native": "^1.6.7", + "ofetch": "^1.5.1", + "ufo": "^1.6.3" + }, + "peerDependencies": { + "@azure/app-configuration": "^1.8.0", + "@azure/cosmos": "^4.2.0", + "@azure/data-tables": "^13.3.0", + "@azure/identity": "^4.6.0", + "@azure/keyvault-secrets": "^4.9.0", + "@azure/storage-blob": "^12.26.0", + "@capacitor/preferences": "^6 || ^7 || ^8", + "@deno/kv": ">=0.9.0", + "@netlify/blobs": "^6.5.0 || ^7.0.0 || ^8.1.0 || ^9.0.0 || ^10.0.0", + "@planetscale/database": "^1.19.0", + "@upstash/redis": "^1.34.3", + "@vercel/blob": ">=0.27.1", + "@vercel/functions": "^2.2.12 || ^3.0.0", + "@vercel/kv": "^1 || ^2 || ^3", + "aws4fetch": "^1.0.20", + "db0": ">=0.2.1", + "idb-keyval": "^6.2.1", + "ioredis": "^5.4.2", + "uploadthing": "^7.4.4" + }, + "peerDependenciesMeta": { + "@azure/app-configuration": { + "optional": true + }, + "@azure/cosmos": { + "optional": true + }, + "@azure/data-tables": { + "optional": true + }, + "@azure/identity": { + "optional": true + }, + "@azure/keyvault-secrets": { + "optional": true + }, + "@azure/storage-blob": { + "optional": true + }, + "@capacitor/preferences": { + "optional": true + }, + "@deno/kv": { + "optional": true + }, + "@netlify/blobs": { + "optional": true + }, + "@planetscale/database": { + "optional": true + }, + "@upstash/redis": { + "optional": true + }, + "@vercel/blob": { + "optional": true + }, + "@vercel/functions": { + "optional": true + }, + "@vercel/kv": { + "optional": true + }, + "aws4fetch": { + "optional": true + }, + "db0": { + "optional": true + }, + "idb-keyval": { + "optional": true + }, + "ioredis": { + "optional": true + }, + "uploadthing": { + "optional": true + } + } + }, + "node_modules/url-extras": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/url-extras/-/url-extras-0.1.0.tgz", + "integrity": "sha512-8tzwTeXFPuX/5PHuCDQE5Dd9Ts4rwoq2t9aIT+HS4iAVpmj5l4Ao7Q+BuuFjvWRqrLswBhQDk8O96ZicgCqQqw==", + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "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==", + "license": "MIT" + }, + "node_modules/vfile": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/vfile/-/vfile-6.0.3.tgz", + "integrity": "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-location": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/vfile-location/-/vfile-location-5.0.3.tgz", + "integrity": "sha512-5yXvWDEgqeiYiBe1lbxYF7UMAIm/IcopxMHrMQDq3nvKcjPKIhZklUKL+AE7J7uApI4kwe2snsK+eI6UTj9EHg==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vfile-message": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-4.0.3.tgz", + "integrity": "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw==", + "license": "MIT", + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/vite": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.1.3.tgz", + "integrity": "sha512-Ds+gBRbj0lwRO2Y5hwnUBdxSwlAve9LeRyU4sNnAr0ewW0gWF0n5bgXgUzbgZ49MV9BVUAQUFYVcDUcilUExMA==", + "license": "MIT", + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.16", + "rolldown": "~1.1.3", + "tinyglobby": "^0.2.17" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.3.0", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitefu": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz", + "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==", + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/web-namespaces": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-2.0.1.tgz", + "integrity": "sha512-bKr1DkiNa2krS7qxNtdrtHAmzuYGFQLiQ13TsorsdT6ULTkPLKuu5+GsFpDlg6JFjUTwX2DyhMPG2be8uPrqsQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + }, + "node_modules/which-pm-runs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.1.0.tgz", + "integrity": "sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/xxhash-wasm": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xxhash-wasm/-/xxhash-wasm-1.1.0.tgz", + "integrity": "sha512-147y/6YNh+tlp6nd/2pWq38i9h6mz/EuQ6njIrmW8D1BS5nCqs0P6DG+m6zTGnNz5I+uhZ0SHxBs9BsPrwcKDA==", + "license": "MIT" + }, + "node_modules/yargs-parser": { + "version": "22.0.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-22.0.0.tgz", + "integrity": "sha512-rwu/ClNdSMpkSrUb+d6BRsSkLUq1fmfsY6TOpYzTwvwkg1/NRG85KBy3kq++A8LKQwX6lsu+aWad+2khvuXrqw==", + "license": "ISC", + "engines": { + "node": "^20.19.0 || ^22.12.0 || >=23" + } + }, + "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==", + "license": "MIT", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/zod": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/zod/-/zod-4.4.3.tgz", + "integrity": "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/zwitch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz", + "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + } + } + } +} diff --git a/website/package.json b/website/package.json new file mode 100644 index 0000000..b7414c3 --- /dev/null +++ b/website/package.json @@ -0,0 +1,15 @@ +{ + "name": "green-tea-docs", + "type": "module", + "private": true, + "scripts": { + "dev": "astro dev", + "build": "astro build", + "preview": "astro preview" + }, + "dependencies": { + "@astrojs/starlight": "^0.41.3", + "astro": "^7.0.6", + "sharp": "^0.35.3" + } +} diff --git a/website/src/content.config.ts b/website/src/content.config.ts new file mode 100644 index 0000000..6a7b7a0 --- /dev/null +++ b/website/src/content.config.ts @@ -0,0 +1,7 @@ +import { defineCollection } from 'astro:content'; +import { docsLoader } from '@astrojs/starlight/loaders'; +import { docsSchema } from '@astrojs/starlight/schema'; + +export const collections = { + docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }), +}; diff --git a/website/src/content/docs/concepts/flow.md b/website/src/content/docs/concepts/flow.md new file mode 100644 index 0000000..5f1b466 --- /dev/null +++ b/website/src/content/docs/concepts/flow.md @@ -0,0 +1,24 @@ +--- +title: The typed flow core +description: "The functional flow API where the compile-time dependency guarantee lives." +--- + +The [decorator layer](/guides/dependency-injection/) validates the graph at **boot**. The functional core, `flow`, validates it in the **type checker** — before the program ever runs. + +```typescript +import { flow } from '@green-tea/core'; + +const pipeline = flow() + .step('db', () => ({ find: (id: string) => id })) + .step('user', (ctx) => ctx.db.find('u1')); // referencing a missing 'db' would not compile +``` + +Each `.step(name, fn)` adds its output to the accumulated context **type** (`Acc & Out`). The next step's `ctx` is typed with everything produced so far — so reading `ctx.db` compiles only because a previous step provided `db`. Reference a key nothing produced and it is a **compile error**, not a runtime `undefined`. + +This is the strongest guarantee green-tea offers: the type *is* the dependency contract, checked statically. The decorator layer gives you the same graph with boot-time validation and the ergonomics of classes and decorators; `flow` gives you compile-time proof. + +:::note +`npm run typecheck` in the repo includes a type-level test that asserts this accumulation behaves — a step that reads a missing key is expected to fail compilation. +::: + +See [The dependency graph](/concepts/the-graph/) for how both layers describe the same model. diff --git a/website/src/content/docs/concepts/the-graph.md b/website/src/content/docs/concepts/the-graph.md new file mode 100644 index 0000000..22c1bc7 --- /dev/null +++ b/website/src/content/docs/concepts/the-graph.md @@ -0,0 +1,47 @@ +--- +title: The dependency graph +description: "How green-tea models the request and boot pipeline as an explicit dependency graph." +--- + +Most frameworks make you keep the whole request in your head: which middleware ran, whether `req.user` exists by now, what order things fire in, which plugin quietly deleted your body parser. That bookkeeping is where bugs live. + +green-tea puts the request **on the page**. You declare what each unit **needs** and **produces**; the framework computes the order, checks the wiring, and can print the whole thing. + +## needs / provides + +Every node declares its inputs and outputs: + +- A **provider** produces an app-scope value (a database handle, a config object) — resolved once at boot and cached. +- A **step** reads the request context and merges new keys into it (authentication producing `user`, say) — runs per request. +- A **handler** (a route method) declares, through its argument decorators, exactly which keys it depends on. + +green-tea builds a directed graph from these declarations and **topologically sorts** it. You never write "put this before that" — order is derived from `needs`/`provides`. + +```typescript +@Step({ provides: 'user', needs: ['db', 'req'] }) // user depends on db and req +class Authenticate { /* ... */ } +``` + +## Why it matters + +- **No ordering bugs.** There's no positional `app.use()` sequence to get wrong; the sort is the order. +- **Each route runs only its slice.** A route runs the transitive closure of what its handler `@needs` (plus always-run observer steps) — an auth step doesn't run on a public route. +- **Boot fails loudly.** If a handler needs a key nothing provides, `createApp` throws at boot with a "did you mean…?" hint — you never serve `undefined`. +- **You can read it.** `app.explain(route)` prints the ordered chain with origins; `app.graph()` / `GET /__graph__` render it as a diagram. See [Graph introspection](/guides/introspection/). + +## Two layers + +green-tea exposes the graph two ways: + +1. **The typed functional core, [`flow`](/concepts/flow/)** — the compile-time guarantee. A handler that reads `ctx.user` fails to **compile** if no step produces `user`. +2. **The declarative decorator layer** — `@Provider` / `@Step` / `@Module` / `@Route` / `@Get` plus [argument decorators](/guides/arguments/). Emits runtime metadata, builds and sorts the graph, and validates at boot. + +Both describe the same graph; pick the ergonomics you want. + +## Why legacy decorators + +green-tea uses **legacy** (experimental) TypeScript decorators — set `experimentalDecorators: true` in your `tsconfig`. This is a design decision, not inertia. + +The argument-injection API (`@param`, `@query`, `@body`, `@header`, `@needs`, `@ctx`, `@inbound`, `@abort`) relies on **parameter decorators**, and the TC39 standard decorators proposal (Stage 3) deliberately does **not** include them. There is no standards-track way to decorate a parameter today, so `handler(@param('id') id: string)` is only expressible with legacy decorators. + +"Stage 3" also means *not finalized* — the proposal can still change before engines ship it. green-tea tracks it and will revisit if parameter injection ever gets a standard path. It does **not** rely on `emitDecoratorMetadata` / `design:type` reflection — argument positions are recorded explicitly — so this is the only legacy surface it depends on. diff --git a/website/src/content/docs/getting-started.md b/website/src/content/docs/getting-started.md new file mode 100644 index 0000000..70defac --- /dev/null +++ b/website/src/content/docs/getting-started.md @@ -0,0 +1,84 @@ +--- +title: Getting started +description: Install green-tea, configure TypeScript decorators, and build your first graph-based route. +--- + +## Install + +```bash +npm install @green-tea/core reflect-metadata +# optional, only if you use them: +npm install ws # WebSocket routes (@Ws) and mesh +npm install busboy # multipart/form-data file uploads +``` + +green-tea targets **Node ≥ 18** and uses **legacy** TypeScript decorators. Enable them in your `tsconfig.json`: + +```json +{ + "compilerOptions": { + "experimentalDecorators": true, + "target": "es2020", + "moduleResolution": "node" + } +} +``` + +You do **not** need `emitDecoratorMetadata` — green-tea records argument positions explicitly. See [Why legacy decorators](/concepts/the-graph/#why-legacy-decorators) for the rationale. + +## Your first app + +A provider produces a value, a step transforms the request context, and a controller handler declares exactly what it needs: + +```typescript +import { + createApp, Provider, Step, Route, Get, Module, + Unauthorized, needs, param, +} from '@green-tea/core'; + +@Provider({ provides: 'db' }) +class Database { + provide() { + const users = { u1: { id: 'u1', name: 'Diego' } }; + return { db: { find: (token: string) => users[token] ?? null } }; + } +} + +@Step({ provides: 'user', needs: ['db', 'req'] }) +class Authenticate { + run(ctx) { + const user = ctx.db.find(ctx.req.headers['x-token']); + if (!user) throw new Unauthorized('invalid token'); // cut the request + return { user }; // continue + } +} + +@Route('/users') +class UserController { + @Get('/:id') + getUser(@needs('user') user, @param('id') id) { // the signature IS the contract + return { requested: id, you: user }; + } +} + +@Module({ mountpoint: '/api', providers: [Database], steps: [Authenticate], controllers: [UserController] }) +class ApiModule {} + +const app = createApp({ modules: [ApiModule] }); +console.log(app.explain('/api/users/:id')); // auditable: the ordered chain, with origins +app.listen(3000); +``` + +```bash +curl -H 'x-token: u1' http://localhost:3000/api/users/9 +# {"requested":"9","you":{"id":"u1","name":"Diego"}} +``` + +The handler asked for `user` via `@needs('user')`. If nothing in the graph produced `user`, `createApp` would **throw at boot** with a "did you mean…" hint — you never serve `undefined`. + +## Where to next + +- [The dependency graph](/concepts/the-graph/) — the mental model behind everything. +- [Dependency injection](/guides/dependency-injection/) — providers, steps, and modules in depth. +- [Argument decorators](/guides/arguments/) — everything a handler can inject. +- [Streaming & real-time](/guides/streaming/) — SSE, WebSocket, and ndjson from one primitive. diff --git a/website/src/content/docs/guides/arguments.md b/website/src/content/docs/guides/arguments.md new file mode 100644 index 0000000..2ac8081 --- /dev/null +++ b/website/src/content/docs/guides/arguments.md @@ -0,0 +1,148 @@ +--- +title: Argument decorators +description: "Everything a handler can inject with needs, ctx, param, query, body, header, inbound, and abort." +--- + +A handler's signature declares exactly what it wants — in any order, nothing more. Each +parameter decorator injects one thing: a graph-produced value, part of the request envelope, +or a stream handle. Some decorators add a **dependency edge** to the graph (boot-validated); +most just read from the request. + +## The decorators at a glance + +| Decorator | Injects | Adds a graph dependency? | Forms | +|---|---|---|---| +| `@needs('user')` | a value produced by a provider/step (boot-validated) | **yes** | `('key')` | +| `@ctx()` | the whole accumulated context | no | `()` | +| `@param(...)` | route params | no | `()` · `('id')` · `('id', schema)` | +| `@query(...)` | parsed query string | no | `()` · `('q')` · `(['a','b'])` · `(schema)` | +| `@body(...)` | parsed body (JSON / urlencoded / multipart) | no | `()` · `('field')` · `(schema)` | +| `@headers(...)` | request headers (whole bag or picked) | no | `()` · `('authorization')` · `(['a','b'])` · `(schema)` | +| `@header('name')` | one request header (singular alias of `@headers`) | no | `('x-trace')` · `('x-count', schema)` | +| `@inbound()` | the incoming WS message channel | no (WS only) | `()` | +| `@abort()` | an `AbortSignal` that fires on disconnect | no (stream/WS) | `()` | + +## `@needs` — a graph-produced value + +`@needs('token')` injects a value a provider or step produces, and declares a dependency edge +in the graph. Its keys are **validated at boot**: if nothing provides the token, `createApp` +throws with a clear error instead of serving `undefined`. + +```typescript +getUser(@needs('user') user: any, @param('id') id: string) { + return { requested: id, you: user }; +} +``` + +See [Dependency injection](/guides/dependency-injection/) for how `needs`/`provides` build the +graph. + +## `@ctx` — the whole context + +`@ctx()` hands you the entire accumulated context — everything providers and steps have merged +in, plus built-ins. Use it to read values like `ctx.protocol` and `ctx.ip` (populated when +`trustProxy` is on). + +## Envelope decorators — `@param`, `@query`, `@body`, `@headers` + +These read from the parsed request. Each envelope decorator has **three access forms**: + +- `@query()` — the whole object +- `@query('q')` — one key +- `@query(['q','date'])` — a subset + +```typescript +@Get('/:id') +getUser(@param('id') id: string) { /* ... */ } +``` + +- **`@param`** reads route params. It always needs a name to say which param it binds + (`@param('id')`). +- **`@query`** reads the parsed query string. Query values are always strings on the wire — a + schema is often the coercion point (see below). +- **`@body`** reads the parsed body. It handles `application/json`, + `application/x-www-form-urlencoded`, and `multipart/form-data` (see the multipart note). +- **`@headers`** reads request headers — the whole bag (`@headers()`), one key + (`@headers('authorization')`), or a subset (`@headers(['a','b'])`). + +## `@header` — one header, singular alias + +`@header('name')` is the singular alias of `@headers`: it picks exactly one request header. + +```typescript +who(@header('x-trace') trace: string) { /* ... */ } +``` + +It also accepts a schema in slot 2 — `@header('x-count', schema)`. + +## Schema forms — validation & coercion + +`@body`, `@query`, `@headers`, and `@param` accept an optional **Standard Schema** (zod, +valibot, arktype, …). The value the handler receives is the schema's **parsed/coerced output**, +already typed: + +```typescript +create(@body(CreateUser) user: { email: string }) { + return { created: user.email }; +} +``` + +:::note[Access shape (asymmetry)] +`@param('id', Schema)` takes the **key in slot 1** and the schema in slot 2 — `@param` always +needs a name to say which route param it binds. `@body(Schema)`, `@query(Schema)`, and +`@headers(Schema)` take the schema as their **only** argument, validating the whole parsed +object. +::: + +A failing schema short-circuits the request with **422**. See [Validation](/guides/validation/) +for the full contract (fail-fast order, error shape, async schemas, and caveats). + +## Multipart access asymmetry + +A request with `Content-Type: multipart/form-data` makes `@body()` resolve to `{ fields, files }` +instead of a plain object. + +:::caution[Access note] +For multipart, `@body('title')` returns `undefined` — the value lives at `body.fields.title`, +not `body.title`, unlike JSON/urlencoded where `@body('title')` picks the value directly. Use +`@body()` and read `.fields` / `.files`, or key into the envelope itself with `@body('fields')` +/ `@body('files')`. +::: + +```typescript +upload(@body() form: MultipartBody) { + const name = form.fields.name; // string | string[] + const avatar = form.files.avatar; // UploadedFile | UploadedFile[] + return { name, size: Array.isArray(avatar) ? undefined : avatar?.size }; +} +``` + +## Stream decorators — `@inbound` and `@abort` + +These are for streaming handlers: + +- **`@inbound()`** (WS only) gives you the incoming WebSocket message channel — the client's + messages to consume. A `@Ws` handler returns the **outbound** channel. +- **`@abort()`** (stream / WS) hands you an `AbortSignal` that fires on disconnect, so you can + tear down work when the client goes away. + +```typescript +@Ws('/echo') +echo(@inbound() incoming: AsyncIterable) { + const out = channel(); + (async () => { + for await (const msg of incoming) out.push(`echo: ${msg}`); + out.close(); + })(); + return out; +} +``` + +See [Streaming](/guides/streaming/) for SSE, WebSocket duplex, and channels. + +## Where to go next + +- How injected values are produced: [Dependency injection](/guides/dependency-injection/). +- The mental model: [The graph](/concepts/the-graph/). +- Validating and coercing injected values: [Validation](/guides/validation/). +- The full API surface: [Decorator reference](/reference/decorators/). diff --git a/website/src/content/docs/guides/dependency-injection.md b/website/src/content/docs/guides/dependency-injection.md new file mode 100644 index 0000000..e785640 --- /dev/null +++ b/website/src/content/docs/guides/dependency-injection.md @@ -0,0 +1,146 @@ +--- +title: Dependency injection +description: "Providers, steps, and modules, and how values flow through the graph." +--- + +In green-tea the request pipeline is an explicit **dependency graph**. You declare what each +piece needs and produces; the framework computes the order, validates the wiring at boot, and +runs only the slice a route actually depends on. You never write "put this before that." + +There are three building blocks: + +- A **provider** is an app-scope singleton — constructed once, its value memoized for the + lifetime of the app. +- A **step** runs per request and transforms the context. +- A **module** sets a mountpoint and wires providers, steps, and controllers together. + +A handler's **argument decorators are its dependency declaration** — ask for what you want, in +any order. If you `@needs` a token nothing produces, you get a **boot error**, not an +`undefined` at runtime. + +## The full example + +```typescript +import 'reflect-metadata'; +import { createApp, Provider, Step, Route, Get, Module, Unauthorized, needs, param } from '@green-tea/core'; + +@Provider({ provides: 'db' }) +class Database { + provide() { return { db: { find: (id: string) => ({ id, name: 'Diego' }) } }; } +} + +@Step({ provides: 'user', needs: ['db', 'req'] }) +class Authenticate { + run(ctx: any) { + const user = ctx.db.find(ctx.req.headers['x-token']); + if (!user) throw new Unauthorized('bad token'); // throw = short-circuit the pipeline + return { user }; // return = continue, merge into ctx + } +} + +@Route('/users') +class UserController { + @Get('/:id') + getUser(@needs('user') user: any, @param('id') id: string) { + return { requested: id, you: user }; // auto-serialized as JSON + } +} + +@Module({ mountpoint: '/api', providers: [Database], steps: [Authenticate], controllers: [UserController] }) +class ApiModule {} + +const app = createApp({ modules: [ApiModule] }); +await app.listen(3000); +// GET /api/users/9 (header x-token) → { "requested": "9", "you": { "id": "...", "name": "Diego" } } + +await app.close(); // graceful shutdown: drains in-flight requests, closes streams + mesh links +``` + +## `@Provider` — app-scope, memoized + +A provider produces a value once, when the app boots, and reuses it for every request. Its +`provide()` method returns an object whose keys become tokens in the graph — here `db`. + +```typescript +@Provider({ provides: 'db' }) +class Database { + provide() { return { db: { find: (id: string) => ({ id, name: 'Diego' }) } }; } +} +``` + +Because it's app-scope, a provider is the right home for things you build once and share: +database clients, config, connection pools. + +:::note +An optional provider (`optional: true`) that throws on boot does **not** abort startup — it is +left unregistered and logged, and the failure surfaces at request time for routes that need it. +Query the degraded set with `app.degraded()` or listen for the `boot:provider:fail` bus event. +::: + +## `@Step` — request-scope, transforms the context + +A step runs once per request. Its `run(ctx)` receives the accumulated context and either: + +- **returns an object** → the pipeline continues and the object is merged into `ctx`, or +- **throws** → the request short-circuits (here `Unauthorized` becomes a `401`). + +```typescript +@Step({ provides: 'user', needs: ['db', 'req'] }) +class Authenticate { + run(ctx: any) { + const user = ctx.db.find(ctx.req.headers['x-token']); + if (!user) throw new Unauthorized('bad token'); // throw = short-circuit the pipeline + return { user }; // return = continue, merge into ctx + } +} +``` + +This step `provides: 'user'` and `needs: ['db', 'req']` — so green-tea knows the `db` provider +and the built-in `req` must resolve before it runs, and it topologically sorts accordingly. + +## How `needs` / `provides` build the graph + +Every node declares what it **produces** (`provides`) and what it **consumes** (`needs`). The +framework reads those declarations and computes a topological order — you never specify +ordering by hand. A handler's argument decorators extend the same graph: `@needs('user')` on a +parameter is a dependency edge exactly like a step's `needs`. + +Because the graph is explicit, **each route runs only the transitive closure of its handler's +`@needs`** — nothing else. + +:::caution[Per-route execution] +A route that doesn't `@needs('user')` does **not** run the `Authenticate` step. A cross-cutting +*enforcement* step (e.g. auth that throws `401`) only protects routes that actually `@needs` +its token. To run something on **every** route regardless of needs (logging, audit, a global +guard), add it as a **plugin step** via `scope.add({ ..., provides: [] })` — steps that produce +nothing run unconditionally. Don't rely on a token-providing step to guard routes that don't +declare it. +::: + +## `@Module` — mountpoint and wiring + +A module ties everything together: a `mountpoint` prefix for the routes, and the lists of +`providers`, `steps`, and `controllers` that belong to it. + +```typescript +@Module({ mountpoint: '/api', providers: [Database], steps: [Authenticate], controllers: [UserController] }) +class ApiModule {} +``` + +Pass modules to `createApp({ modules: [ApiModule] })` to assemble the app. + +## Boot validation of `@needs` + +The payoff of declaring dependencies is that the wiring is checked before a single request is +served. When you `@needs` a token, green-tea verifies some provider or step actually produces +it. If nothing does, **`createApp` throws with a clear error** instead of letting your handler +receive `undefined`. Boot fails loudly, so you never serve `undefined`. + +## Where to go next + +- New to green-tea? Start with [Getting started](/getting-started/). +- The mental model behind all of this: [The graph](/concepts/the-graph/). +- Everything a handler can inject: [Argument decorators](/guides/arguments/) and the + [decorator reference](/reference/decorators/). +- Coerce and validate injected values with Standard Schema: [Validation](/guides/validation/). +- Return an `AsyncIterable` to push data over time: [Streaming](/guides/streaming/). diff --git a/website/src/content/docs/guides/introspection.md b/website/src/content/docs/guides/introspection.md new file mode 100644 index 0000000..ebda170 --- /dev/null +++ b/website/src/content/docs/guides/introspection.md @@ -0,0 +1,55 @@ +--- +title: Graph introspection +description: "explain, graph, toMermaid, and the graph endpoint." +--- + +Because the request/boot pipeline is an explicit [dependency graph](/concepts/the-graph/), +you can inspect it directly — visualize the whole thing, or explain exactly which nodes a +single route runs. + +## Visualize with Mermaid + +`app.toMermaid()` renders a flowchart of every node and route. `app.toDOT()` produces the +same graph as Graphviz DOT. + +```typescript +console.log(app.toMermaid()); // flowchart diagram of all nodes and routes +``` + +Enable a live `GET /__graph__` endpoint — it renders an HTML viewer with Mermaid, or the +raw Mermaid source with `Accept: text/plain`: + +```typescript +const app = createApp({ modules: [ApiModule], devGraph: true }); +// GET /__graph__ → HTML viewer +// GET /__graph__ (text/plain) → raw Mermaid source +``` + +:::caution +`devGraph` exposes your graph structure over HTTP. Keep it on in development; leave it off +in production. +::: + +## Explain a route + +`app.explain(route)` returns the exact execution chain for one route — the ordered nodes, +each with its kind, origin, and declared `needs`/`provides`: + +```typescript +const e = app.explain('/api/users/:id'); +// { pattern, method, transport, chain: [{ name, kind, origin, needs, provides }, ...] } +console.log(e.chain.map((n) => `${n.kind}:${n.name}`)); +// → ['provider:db', 'step:user', 'handler:getUser'] +``` + +The chain is the transitive closure of the handler's `@needs` — the same set the framework +actually runs for that route, and nothing more. + +`app.graph()` returns the underlying graph structure programmatically if you'd rather walk +it yourself than render it. + +## Degraded optional providers + +`app.degraded()` returns the names of optional providers that are running in a **degraded** +state — for example, an optional dependency that failed to initialize but didn't abort boot. +Use it as a health signal to surface partial availability. diff --git a/website/src/content/docs/guides/mesh.md b/website/src/content/docs/guides/mesh.md new file mode 100644 index 0000000..fe9bfae --- /dev/null +++ b/website/src/content/docs/guides/mesh.md @@ -0,0 +1,67 @@ +--- +title: Mesh (alpha) +description: "Distributed dependency injection over a secret-gated WebSocket control channel." +--- + +:::caution[Alpha] +Mesh is **alpha** — its API and wire protocol may change between releases, and discovery, load-balancing, and failover are not built. It is gated behind an explicit opt-in: `createApp({ mesh, experimental: true })`, and `createApp` **throws** if you configure `mesh` without `experimental: true`. **Don't ship mesh to production yet.** +::: + +A **teacup** can depend on a token that physically lives on another node — a **teapot**. `@needs('billing')` resolves the same whether `billing` runs in this process or on a remote one. There's no gRPC layer or message-pattern DSL: there's the [graph](/concepts/the-graph/), and some nodes happen to live elsewhere. + +Exports are opt-in (`export: true`) and the control channel is gated by a shared secret. + +## Node A — teapot (exposes `config`, `auth`, and a route) + +```typescript +@Provider({ provides: 'config', export: true }) +class Config { provide() { return { config: { region: 'mx', tier: 'pro' } }; } } + +@Step({ provides: 'auth', needs: [], export: true }) +class Auth { run(ctx: any) { return { auth: { token: ctx.headers?.['x-token'] ?? 'anon' } }; } } + +@Route('/svc') +class Svc { @Get('/ping', { export: true }) ping() { return { pong: true }; } } + +@Module({ mountpoint: '/api', providers: [Config], steps: [Auth], controllers: [Svc] }) +class TeapotModule {} + +const teapot = createApp({ modules: [TeapotModule], experimental: true, mesh: { secret: 'shh' } }); +await teapot.listen(3002); +``` + +## Node B — teacup (uses `config` + `auth` with no local providers) + +```typescript +@Route('/local') +class LocalCtl { + @Get('/who') + who(@needs('config') config: any, @needs('auth') auth: any) { + return { config, auth }; // both resolved by RPC to the teapot + } +} +@Module({ mountpoint: '/api', controllers: [LocalCtl] }) +class TeacupModule {} + +const teacup = createApp({ + modules: [TeacupModule], + experimental: true, + mesh: { teapots: [{ url: 'ws://A-host:3002/__mesh__/control', secret: 'shh' }] }, +}); +await teacup.listen(3003); +// GET B:3003/api/local/who (x-token: abc) +// → { "config": { "region": "mx", "tier": "pro" }, "auth": { "token": "abc" } } +``` + +## How it resolves + +`@needs('config' | 'auth')` validates at boot because the teapot announced them in its **manifest** on connect. Scope determines the RPC cost: + +- A **provider** export is **app-scope** — resolved once and cached. +- A **step** export is **request-scope** — one RPC per request, carrying the request envelope. + +Remote tokens become synthetic nodes in the local graph with RPC-backed runners, so the rest of the pipeline is unchanged. For non-mesh apps `createApp` stays synchronous; mesh apps defer graph finalization to `listen()` so remote scopes can join first. + +:::note[Skeleton limitations (by design)] +No discovery, load-balancing, or failover yet; app-scope remote values are not reconciled on reconnect; the request envelope omits `req.url`. +::: diff --git a/website/src/content/docs/guides/plugins.md b/website/src/content/docs/guides/plugins.md new file mode 100644 index 0000000..f3b647a --- /dev/null +++ b/website/src/content/docs/guides/plugins.md @@ -0,0 +1,58 @@ +--- +title: Plugins & observability +description: "Extending the app safely via bus.on and scope.add." +--- + +A plugin is a function that receives the app's API at boot. It gets exactly two +capabilities: **observe** the running system through `bus.on(...)`, and **extend its own +scope** through `scope.add(...)`. That's the whole surface — and it's deliberately narrow. + +```typescript +const logger = (api: any) => { + api.bus.on('request:step:enter', (p: any) => console.log(`→ ${p.name}`)); + api.bus.on('stream:open', (p: any) => console.log(`stream open ${p.name}`)); + api.bus.on('mesh:rpc:error', (p: any) => console.error('mesh rpc failed', p.error)); +}; + +const app = createApp({ modules: [ApiModule], plugins: [logger] }); +``` + +## Isolation is structural + +A plugin can add steps and providers to **its own scope** via `scope.add(...)`. It +**cannot** reorder or delete another scope's steps. The graph — not a policy check — +enforces this: each scope owns its nodes, and a plugin has no handle on anyone else's. +There's no ordering hook to abuse and no step registry to mutate. If you want a plugin to +influence execution, it does so by contributing a node with declared `needs`/`provides`, +and the framework computes where that node lands. + +:::note +Because execution is per-route (a route runs only the transitive closure of its handler's +`@needs`), a plugin step that should run on **every** route must produce nothing — add it +with `provides: []`. A step that produces no token has nothing to gate on, so the framework +runs it unconditionally. See [The graph](/concepts/the-graph/) for how the closure is +computed. +::: + +## Lifecycle & request events + +Subscribe to events on the `Bus` to observe boot, per-request execution, streaming, and +mesh activity without touching the pipeline itself: + +```typescript +api.bus.on('boot:provider:ready', (p: any) => { /* ... */ }); +api.bus.on('request:step:enter', (p: any) => { /* ... */ }); +api.bus.on('request:step:exit', (p: any) => { /* ... */ }); +``` + +The full event vocabulary: + +- `boot:provider:*` — provider lifecycle during boot +- `request:step:*` — a step entering/exiting during a request +- `stream:open | stream:close | stream:error` — SSE/WS stream lifecycle +- `mesh:connect | mesh:disconnect | mesh:rpc:error` — mesh link and RPC activity +- `plugin:mounted` — a plugin finished mounting + +Observation is read-only: handlers see the event payload but can't alter control flow. To +change behavior, contribute a node to your scope — see +[Dependency injection](/guides/dependency-injection/). diff --git a/website/src/content/docs/guides/routing.md b/website/src/content/docs/guides/routing.md new file mode 100644 index 0000000..ea4145f --- /dev/null +++ b/website/src/content/docs/guides/routing.md @@ -0,0 +1,64 @@ +--- +title: Routing +description: "Route patterns, the catch-all, specificity precedence, and 405 handling." +--- + +Routes are declared with method decorators on a `@Route`-prefixed controller. Patterns are matched **by segment**. + +## Method decorators + +| Decorator | Method / transport | +|---|---| +| `@Get` `@Post` `@Put` `@Patch` `@Delete` | buffered HTTP response | +| `@Sse` | server-sent events (`text/event-stream`) | +| `@Ws` | WebSocket duplex | +| `@Stream` | negotiated — SSE / ndjson / WS, picked from the client's `Accept` / `Upgrade` | + +```typescript +@Route('/users') +class Users { + @Get('/:id') get(@param('id') id: string) { /* ... */ } + @Post('/') create(@body() data: unknown) { /* ... */ } +} +``` + +The path a route matches is `joinPath(module.mountpoint, route.path)` — a controller under `@Module({ mountpoint: '/api' })` with `@Route('/users')` + `@Get('/:id')` serves `/api/users/:id`. + +## Pattern segments + +- **Static** — `users` matches exactly. +- **`:param`** — matches exactly one segment; the decoded value lands in `params.name` (`@param('id')`). +- **`:name*` catch-all** — a trailing segment that captures the **rest of the path, slashes included**, into `params.name`. + +```typescript +@Get('/files/:path*') // /files/img/2026/logo.png → params.path = "img/2026/logo.png" +``` + +A catch-all also matches zero remaining segments (`/files` → `params.path = ""`). + +## Precedence + +When more than one route matches the same path, the **most specific wins** — `static ▸ :param ▸ catch-all` — compared segment by segment, **independent of registration order**. Genuine ties (two equally-specific patterns) fall back to registration order. + +```typescript +@Get('/a/b') // wins for /a/b +@Get('/a/:id') // wins for /a/x +@Get('/a/:rest*') // wins for /a/x/y +``` + +## 404 vs 405 + +A path that no route matches returns `404`. A path that **does** exist but under a different method returns **`405 Method Not Allowed`** with an `Allow` header listing the methods that do match — not a `404`. + +:::note +A bare `OPTIONS` request (without an `Access-Control-Request-Method` header — i.e. not a CORS preflight) to an existing path therefore returns `405` with `Allow`. CORS preflights are handled separately; see [Transport security](/guides/security/). +::: + +## Not yet + +The matcher is intentionally small for beta. **Not built** (on the roadmap): + +- Regex / typed param constraints such as `:id(\d+)`. +- Route matching is a **linear scan** — fine for typical route tables, but a radix-tree matcher for very large ones isn't implemented. + +See [Streaming & real-time](/guides/streaming/) for `@Sse` / `@Ws` / `@Stream`, and [Argument decorators](/guides/arguments/) for everything a handler can read from a request. diff --git a/website/src/content/docs/guides/security.md b/website/src/content/docs/guides/security.md new file mode 100644 index 0000000..a883a57 --- /dev/null +++ b/website/src/content/docs/guides/security.md @@ -0,0 +1,101 @@ +--- +title: Transport security +description: "TLS and wss, secure-by-default headers, CORS, and trustProxy." +--- + +Four `createApp` options cover TLS, proxying, CORS, and response headers: `tls`, +`trustProxy`, `cors`, and `security`. See the [`createApp` reference](/reference/createapp/) +for the full option list. + +## TLS (native https/wss) + +```typescript +import { readFileSync } from 'fs'; + +const app = createApp({ + modules: [App], + tls: { key: readFileSync('key.pem'), cert: readFileSync('cert.pem') }, +}); +``` + +When `tls` is set the server serves https, and WebSocket upgrades become wss on the same +port — no other changes. + +## `trustProxy` + +```typescript +const app = createApp({ modules: [App], trustProxy: true }); +``` + +Behind a reverse proxy, reads `X-Forwarded-Proto` / `X-Forwarded-For` to populate +`ctx.protocol` (`'http' | 'https'`) and `ctx.ip` (read via `@ctx()`). Off by default — +forwarded headers are ignored (and spoofable) until you opt in. It trusts the immediate hop +unconditionally; there's no CIDR allowlist yet. + +## CORS + +Off unless `origins` is set. + +```typescript +const app = createApp({ + modules: [App], + cors: { origins: 'https://app.example.com', credentials: true }, +}); +``` + +`origins` accepts `string | string[] | '*' | (origin) => boolean`. A preflight `OPTIONS` +request (with `Access-Control-Request-Method`) is auto-answered with 204. + +- With `credentials: true`, the server **never** sends `Access-Control-Allow-Origin: *` — it + echoes the concrete allowed origin (or blocks the request). + +:::caution[Reflect-any foot-gun] +`origins: '*'` together with `credentials: true` reflects *any* origin with credentials +attached. Only combine them if you truly intend an open credentialed API; prefer an explicit +allowlist. +::: + +## `security` (headers, ON by default) + +Applied to every HTTP response. Disable everything with `security: false`, or override +individual headers with an options object. + +| Header | Default | +|---|---| +| `X-Content-Type-Options` | `nosniff` | +| `X-Frame-Options` | `SAMEORIGIN` | +| `Referrer-Policy` | `no-referrer` | +| `X-DNS-Prefetch-Control` | `off` | +| `Strict-Transport-Security` | `max-age=15552000` (180d) — **only when the connection is secure** (native TLS, or `trustProxy` + `X-Forwarded-Proto: https`); no `includeSubDomains`/`preload` | +| `Content-Security-Policy` | not set — pass `security: { csp: "..." }` | + +```typescript +const app = createApp({ modules: [App], security: { csp: "default-src 'self'" } }); +``` + +:::note[Scope caveat] +`security` and `cors` headers apply to HTTP responses; they do **not** apply to the +WebSocket handshake (101/upgrade) response. +::: + +:::caution[TLS + trustProxy] +HSTS is emitted only when the connection is judged secure. With `trustProxy: true` that +judgement trusts the incoming `X-Forwarded-Proto` header — so a client that spoofs +`X-Forwarded-Proto: http` past a permissive proxy can make the server treat the request as +insecure and **suppress the HSTS header**. Only enable `trustProxy` behind a proxy that +strips and sets forwarded headers itself, and terminate TLS where you control that hop. +::: + +## Defaults + +| Option | Default | +|---|---| +| `tls` | off (plain http/ws) | +| `trustProxy` | off | +| `cors` | off (same-origin only) | +| `security` | ON (HSTS only when the connection is secure) | + +## Related + +- [`createApp` reference](/reference/createapp/) — every construction option +- [File uploads / multipart](/guides/uploads/) — request-body handling diff --git a/website/src/content/docs/guides/streaming.md b/website/src/content/docs/guides/streaming.md new file mode 100644 index 0000000..2f6e296 --- /dev/null +++ b/website/src/content/docs/guides/streaming.md @@ -0,0 +1,114 @@ +--- +title: Streaming & real-time +description: "SSE, ndjson, and WebSocket duplex from one AsyncIterable primitive." +--- + +Most stacks treat "push data over time" as a bolt-on: Express reaches for a `ws` or SSE library, Fastify for a plugin, NestJS for a separate **WebSocket Gateway** with its own adapter and decorators. That's a second mental model, a second error surface, glued to your HTTP app. + +green-tea has one model: an **`AsyncIterable`**. A handler that returns a sequence of values over time *is* a stream — the same shape you'd return from any function. You **declare the mode** with a decorator; the framework handles framing, backpressure, cleanup, and disconnects. + +## One primitive, four modes + +| Declare | Direction | Transport | Reach for it when | +|---|---|---|---| +| `@Sse` | server → client | `text/event-stream` | live updates to a browser (`EventSource`) | +| `@Ws` | duplex | WebSocket | chat, collaboration — anything two-way | +| `@Stream` | negotiated | SSE / ndjson / WS, picked from the client's `Accept` / `Upgrade` | one handler, the client chooses | +| *(plain return)* | server → client | SSE or ndjson by `Accept` | programmatic streaming over `fetch` | + +The primitive never changes — it's always an `AsyncIterable`. What changes is **direction and framing**, and you declare which. That's the difference between each iterable green-tea hands you: + +- **`@Sse` / plain return** — you return **one** iterable: the *outbound* stream. Each `yield` becomes an SSE event, or an ndjson line. +- **`@Ws` (duplex)** — **two** iterables. `@inbound()` gives you the client's *incoming* messages to consume; the one you **return** is the *outbound* stream to the client. `@abort()` hands you an `AbortSignal` for teardown. +- **`@Stream`** — you write the handler once; the client's request decides whether it arrives as SSE, ndjson, or a WebSocket. No branching in your code. + +:::note +Streaming bypasses the response transformer — the transport frames each value directly, handles backpressure, and cleans up on disconnect. See [arguments](/guides/arguments/) for the full list of argument decorators, including the stream-only `@inbound()` and `@abort()`. +::: + +## Streaming — SSE + +Return an `AsyncIterable` and the pipeline streams it (the transformer is bypassed; the transport frames it, handles backpressure, and cleans up on disconnect). + +```typescript +import { Route, Sse } from '@green-tea/core'; + +@Route('/feed') +class FeedController { + @Sse('/ticks') + ticks() { + return (async function* () { + for (let n = 1; n <= 3; n++) yield { tick: n }; + })(); + } +} +// GET /feed/ticks (Accept: text/event-stream) +// data: {"tick":1} +// data: {"tick":2} +// data: {"tick":3} +``` + +`@Stream(path)` negotiates the transport by header (`Accept: text/event-stream` → SSE, `Upgrade: websocket` → WS, else ndjson chunked). + +## Streaming — WebSocket duplex + +A WS handler receives the **inbound** channel and returns the **outbound** channel — a step that consumes one channel and produces another. + +```typescript +import { Route, Ws, inbound, channel } from '@green-tea/core'; + +@Route('/chat') +class ChatController { + @Ws('/echo') + echo(@inbound() incoming: AsyncIterable) { + const out = channel(); + (async () => { + for await (const msg of incoming) out.push(`echo: ${msg}`); + out.close(); + })(); + return out; + } +} +``` + +`channel()` is a multicast `AsyncIterable` with `push` / `close` / `fail` and an optional bounded buffer (`channel({ buffer: 100 })`, drop-oldest). + +:::note[WebSocket needs the `ws` peer] +`@Ws` (and mesh) require the optional [`ws`](https://github.com/websockets/ws) peer dependency — `npm i ws`. SSE, ndjson, and plain HTTP need nothing extra. +::: + +## Fan-out — `channel()` and `rooms` + +Fan-out is a primitive too: `channel()` is a **multicast** `AsyncIterable` (bounded, drop-oldest) so one source feeds many subscribers, and `rooms` are named broadcast hubs — publish once, every connection in the room receives it. + +```typescript +@Route('/live') +class Live { + @Sse('/prices') // one iterable out — each yield is an event + prices() { + return (async function* () { + while (true) { yield { btc: await getPrice() }; await sleep(1000); } + })(); + } + + @Ws('/echo') // duplex — consume @inbound, return the outbound stream + echo(@inbound() incoming: AsyncIterable) { + const out = channel(); + (async () => { for await (const m of incoming) out.push(`echo: ${m}`); out.close(); })(); + return out; + } +} +``` + +Same `@Route`, same handler shape, same `AsyncIterable` — real-time is not a separate framework you also have to learn. + +`rooms` is the built-in shared `Rooms` primitive (one instance app-wide). A typical chat handler pumps the `@inbound()` channel into `rooms.room(name)` and returns that same room as its outbound channel, so every joined socket multicasts to the others. A handshake `@Step` can read `?token=` and throw `Unauthorized` — which closes the socket with code **4401** (`4000 + status`). See [security](/guides/security/) for handshake authentication. + +## The one rule to remember + +``` +return a VALUE → buffered response (transformer → JSON) +return an AsyncIterable → stream (SSE / WS) +``` + +Return a value and you get a buffered JSON response; return an `AsyncIterable` and you get a stream. That's the whole contract. diff --git a/website/src/content/docs/guides/testing.md b/website/src/content/docs/guides/testing.md new file mode 100644 index 0000000..709e5aa --- /dev/null +++ b/website/src/content/docs/guides/testing.md @@ -0,0 +1,33 @@ +--- +title: Testing +description: "Swap any node with createApp overrides for fast, isolated tests." +--- + +Any provider or step is addressable by its **token**, so you can swap it for a test double +at construction time — no monkey-patching, no module rewiring. + +## Override tokens in tests + +Pass `overrides` to `createApp`. Each key is a token; each value is either a plain object +(wrapped as `{ token: value }`) or a function runner: + +```typescript +const app = createApp({ + modules: [ApiModule], + overrides: { + db: { find: () => ({ id: 'test-user' }) }, // plain object — wrapped as { db: value } + user: () => ({ user: { id: 'stub' } }), // function runner + }, +}); +``` + +Overrides replace **only** the named token's runner; the rest of the graph is untouched. The +route still runs its full closure — you've just substituted what one node produces. + +:::note +An override for an unknown token throws. The set of tokens is validated against the real +graph, so a typo'd or stale override is a construction-time error, not a silent no-op. +::: + +This pairs well with [`app.explain(route)`](/guides/introspection/) — explain the chain to +see which tokens a route actually depends on, then override exactly those. diff --git a/website/src/content/docs/guides/uploads.md b/website/src/content/docs/guides/uploads.md new file mode 100644 index 0000000..f5939f0 --- /dev/null +++ b/website/src/content/docs/guides/uploads.md @@ -0,0 +1,64 @@ +--- +title: File uploads +description: "multipart parsing via the optional busboy peer dependency." +--- + +A request with `Content-Type: multipart/form-data` makes `@body()` resolve to `{ fields, files }` instead of a plain object. + +:::caution[multipart needs the optional `busboy` peer] +Multipart parsing uses the optional [`busboy`](https://github.com/mscdex/busboy) peer dependency — install it with `npm i busboy`. A `multipart/form-data` request to a server without busboy installed returns **`501`**. (JSON and urlencoded need nothing extra.) +::: + +```typescript +import { Route, Post, body } from '@green-tea/core'; +import type { MultipartBody } from '@green-tea/core'; + +@Route('/profile') +class ProfileController { + @Post('/avatar') + upload(@body() form: MultipartBody) { + const name = form.fields.name; // string | string[] + const avatar = form.files.avatar; // UploadedFile | UploadedFile[] + return { name, size: Array.isArray(avatar) ? undefined : avatar?.size }; + } +} +``` + +`UploadedFile` is `{ filename, contentType, data: Buffer, size }` — the whole file is buffered in memory, no temp files. + +:::note[Access asymmetry] +For multipart, `@body('title')` returns `undefined` — the value lives at `body.fields.title`, not `body.title`, unlike JSON/urlencoded where `@body('title')` picks the value directly. Use `@body()` and read `.fields`/`.files`, or key into the envelope itself with `@body('fields')` / `@body('files')`. See [arguments](/guides/arguments/) for how `@body()` behaves across content types. +::: + +## Repeated fields — `bodyDuplicates` + +By default, a repeated field name keeps the **last** value (`'last'`, matching urlencoded). Set `bodyDuplicates: 'array'` on `createApp` to accumulate repeats into a `string[]` instead — this applies to **both** urlencoded and multipart text fields: + +```typescript +const app = createApp({ modules: [ApiModule], bodyDuplicates: 'array' }); +``` + +Files under a repeated field name always become an array (`UploadedFile[]`), regardless of `bodyDuplicates`. + +## Per-endpoint override + +```typescript +@Post('/upload', { duplicates: 'array' }) +upload(@body() form: MultipartBody) { /* ... */ } +``` + +Precedence: route `duplicates` → app `bodyDuplicates` → `'last'`. + +## Limits + +Uploaded files are held in memory, so they're bounded by the same `maxBodyBytes` limit as any other request body (over the limit → **413**). `maxParts` (default `1000`) caps the number of multipart parts per request: + +```typescript +const app = createApp({ modules: [ApiModule], limits: { maxParts: 500 } }); +``` + +A malformed multipart body (bad boundary, missing headers, truncated part) → **400**. + +:::note +To validate parsed fields against a schema, pass a Standard Schema to `@body()` — see [validation](/guides/validation/). +::: diff --git a/website/src/content/docs/guides/validation.md b/website/src/content/docs/guides/validation.md new file mode 100644 index 0000000..1927e36 --- /dev/null +++ b/website/src/content/docs/guides/validation.md @@ -0,0 +1,84 @@ +--- +title: Validation +description: "Validate and coerce input with Standard Schema (zod, valibot, arktype)." +--- + +`@body`, `@query`, `@headers`, and `@param` accept an optional **Standard Schema** +(the [`~standard` interface](https://standardschema.dev) shared by zod, valibot, arktype, +and others). green-tea's core has **zero runtime dependency** on any of them — bring +whichever validator you already use. + +```typescript +import { z } from 'zod'; +import { Route, Post, body } from '@green-tea/core'; + +const CreateUser = z.object({ email: z.string().email() }); + +@Route('/users') +class UserController { + @Post('/') + create(@body(CreateUser) user: { email: string }) { + return { created: user.email }; + } +} +``` + +## Parsed value replaces the argument; `ctx` stays raw + +The value the handler receives is the schema's **parsed/coerced output**, not the raw +input — `ctx.body` (via `@ctx()` or a `@needs`-fed step) stays exactly what the transport +parsed. Query strings are always strings on the wire, so a schema is often the coercion +point: + +```typescript +const ListQuery = z.object({ page: z.coerce.number() }); + +@Get('/list') +list(@query(ListQuery) q: { page: number }) { + return { page: q.page, isNum: typeof q.page === 'number' }; // GET /list?page=2 → true +} +``` + +## Where the schema goes (the one asymmetry) + +:::note[Access shape] +`@param('id', Schema)` takes the key in slot 1 and the schema in slot 2 — `@param` always +needs a name to say which route param it binds. `@body(Schema)`, `@query(Schema)`, and +`@headers(Schema)` take the schema as their **only** argument, validating the whole parsed +object (all of `body`/`query`/`headers`). +::: + +See [Argument decorators](/guides/arguments/) for the full slot semantics of each decorator. + +## Failure: 422 with per-field issues + +A failing schema short-circuits the request with **422**: + +```json +{ "error": "Validation failed", "source": "body", "issues": [{ "path": "email", "message": "Invalid email" }] } +``` + +`source` is which envelope failed (`'body' | 'query' | 'params' | 'headers'`); `issues` is +the schema's issues flattened to `{ path, message }` (`path` is dot-joined). + +## Caveats + +- **Fail-fast.** Arguments validate in order; the **first** failing one throws — later args in + the same handler are not checked in that request. +- **Steps see raw input.** Only the resolved handler argument is coerced/validated; a `@Step` + reading the same data via `ctx.body`/`ctx.query`/etc. always sees the untouched value. +- **A throwing schema is a 500, not a 422.** The Standard Schema contract says `validate()` + returns `{ issues }` on failure — it isn't supposed to throw. If it does anyway, that + propagates as an uncaught error (→ 500), since it signals a bug in the schema, not user input. +- **Async schemas are awaited** — `validate()` returning a `Promise` works transparently. + +:::note[Not covered yet] +Response/output validation, validating a `@Step`'s own inputs, and mesh remote-route +validation are all out of scope for this feature. +::: + +## Related + +- [Argument decorators](/guides/arguments/) — every slot decorator and its parsing rules +- [File uploads / multipart](/guides/uploads/) — how multipart bodies are parsed before validation +- [`createApp` reference](/reference/createapp/) — app construction options diff --git a/website/src/content/docs/index.mdx b/website/src/content/docs/index.mdx new file mode 100644 index 0000000..e3be954 --- /dev/null +++ b/website/src/content/docs/index.mdx @@ -0,0 +1,41 @@ +--- +title: green-tea +description: A calm, type-safe HTTP framework for Node — your API is an explicit dependency graph you can see, slice, and trust. +template: splash +hero: + tagline: Your API is an explicit dependency graph you can see, slice, and trust — not a mutable bag threaded through positional middleware. + actions: + - text: Get started + link: /getting-started/ + icon: right-arrow + variant: primary + - text: The idea + link: /concepts/the-graph/ + icon: open-book + variant: minimal +--- + +import { Card, CardGrid } from '@astrojs/starlight/components'; + +## Less to hold in your head + +Most frameworks make you keep the whole request in your head: which middleware ran, whether `req.user` exists by now, what fired in what order. green-tea puts the request **on the page** — you declare what each step _needs_ and _produces_, and the framework computes the order, type-checks the wiring, and can print the whole thing. + + + + Declare `needs`/`provides`; green-tea topologically sorts it. No ordering bugs, no positional guesswork — each route runs only its slice of the graph. + + + In the typed `flow` core, a handler that reads `ctx.user` **fails to compile** if no step produces `user`. "It was undefined in prod" disappears at build time. + + + `app.explain('/users/:id')` prints the ordered chain; `GET /__graph__` renders it as a live diagram. Onboarding and audits are reading, not archaeology. + + + Return an `AsyncIterable` and the transport streams it — SSE, ndjson, or a WebSocket duplex — with backpressure and cleanup handled. No separate gateway. + + + +:::note[Beta] +green-tea is **beta**, on the RC track. One runtime dependency (`reflect-metadata`); `ws` and `busboy` are optional peers. [mesh](/guides/mesh/) is alpha and gated behind an explicit opt-in. +::: diff --git a/website/src/content/docs/reference/createapp.md b/website/src/content/docs/reference/createapp.md new file mode 100644 index 0000000..518f4ab --- /dev/null +++ b/website/src/content/docs/reference/createapp.md @@ -0,0 +1,70 @@ +--- +title: createApp options +description: "Every option accepted by createApp and every method on the App it returns." +--- + +```typescript +const app = createApp(options); +``` + +## Options + +| Option | Type | Default | Meaning | +|---|---|---|---| +| `modules` | `Ctor[]` | — | the `@Module` classes to wire (required) | +| `plugins` | `Plugin[]` | `[]` | plugins, each limited to `bus.on` + `scope.add` ([plugins](/guides/plugins/)) | +| `limits` | `RequestLimits` | see below | body-size and timeout ceilings | +| `devGraph` | `boolean` | `false` | mount `GET /__graph__` ([introspection](/guides/introspection/)) | +| `overrides` | `Record` | — | swap any node by token ([testing](/guides/testing/)) | +| `tls` | `TlsOptions` | — | serve over https/wss | +| `trustProxy` | `boolean` | `false` | honor `X-Forwarded-*` for `ctx.protocol` / `ctx.ip` | +| `security` | `boolean \| SecurityOptions` | `true` | secure-by-default headers ([security](/guides/security/)) | +| `cors` | `CorsOptions` | — | CORS handling | +| `bodyDuplicates` | `'array' \| 'last'` | `'last'` | policy for repeated form fields | +| `mesh` | `MeshConfig` | — | distributed DI — **requires `experimental: true`** ([mesh](/guides/mesh/)) | +| `experimental` | `boolean` | `false` | opt in to alpha features (currently gates `mesh`) | + +### `RequestLimits` + +| Field | Default | +|---|---| +| `maxBodyBytes` | `1_000_000` (→ `413` when exceeded) | +| `requestTimeoutMs` | `30_000` | +| `headersTimeoutMs` | `10_000` | +| `keepAliveTimeoutMs` | `5_000` | +| `maxParts` | `1000` (multipart) | + +### `TlsOptions` + +`{ key, cert, ca?, passphrase? }` — `key`/`cert` are `Buffer | string`. + +### `CorsOptions` + +`{ origins, methods?, allowedHeaders?, exposedHeaders?, credentials?, maxAge? }`. `origins` is a string, array, `'*'`, or a `(origin) => boolean` predicate. `credentials: true` is never combined with `'*'`. + +### `SecurityOptions` + +`{ hsts?, frameOptions?, referrerPolicy?, noSniff?, dnsPrefetchControl?, csp? }`. HSTS is only emitted on secure connections. `csp` is opt-in. + +### `MeshConfig` + +`{ secret?, teapots?, timeoutMs? }` — `teapots` is `{ url, secret }[]`. See [Mesh](/guides/mesh/). + +## The `App` + +`createApp` returns an `App`: + +| Member | Returns | Notes | +|---|---|---| +| `listen(port)` | `Promise` | boots providers, then serves | +| `close()` | `Promise` | drains in-flight, closes streams + mesh links | +| `inspect(route)` | `InspectLine[]` | the provider/step/handler chain for a route | +| `explain(route)` | `Explain` | the chain annotated with each node's needs/provides | +| `graph()` | `GraphView` | the full node + route graph | +| `toMermaid()` / `toDOT()` | `string` | render the graph | +| `degraded()` | `string[]` | optional providers running degraded (empty until `listen()`) | +| `bus` | `Bus` | lifecycle + request event bus | + +:::note +On mesh apps, `graph` / `explain` / `inspect` / `degraded` are only available **after** `listen()` — the graph is finalized once remote scopes connect. +::: diff --git a/website/src/content/docs/reference/decorators.md b/website/src/content/docs/reference/decorators.md new file mode 100644 index 0000000..5e26430 --- /dev/null +++ b/website/src/content/docs/reference/decorators.md @@ -0,0 +1,83 @@ +--- +title: Decorators +description: "Full reference for every class, method, and argument decorator." +--- + +Every decorator green-tea exports, grouped by where it applies. All require `experimentalDecorators: true` in your `tsconfig` — see [Why legacy decorators](/concepts/the-graph/#why-legacy-decorators). + +## Structure + +### `@Module(options)` + +Marks a class as a module and records what it wires together. + +```typescript +@Module({ + mountpoint: '/api', // path prefix for this module's controllers (required) + providers: [Database], // app-scope @Provider classes + steps: [Authenticate], // request-scope @Step classes + controllers: [UserCtl], // @Route classes +}) +class ApiModule {} +``` + +### `@Route(prefix)` + +Marks a class as a controller; `prefix` is prepended to each route path. + +## Providers & steps + +### `@Provider(options)` + +An app-scope value, built once at boot and cached, addressable by `provides`. + +| Option | Type | Default | Meaning | +|---|---|---|---| +| `provides` | `string` | — | the token this provider produces (required) | +| `needs` | `string[]` | `[]` | tokens it depends on | +| `optional` | `boolean` | `false` | if it throws on boot, degrade instead of aborting ([details](/guides/dependency-injection/)) | +| `export` | `boolean` | `false` | expose over the mesh control channel ([mesh](/guides/mesh/)) | + +### `@Step(options)` + +A request-scope transform that merges keys into the context. Same options as `@Provider`. + +### `@Transformer(fn)` + +Method decorator. Turns a handler's return value into `{ status?, headers?, body }`. `JsonTransformer` is the default. + +## Routes + +Method decorators on a controller. All accept `(path, opts?)` where `opts = { export?: boolean, duplicates?: 'array' | 'last' }`. + +| Decorator | Method | Transport | +|---|---|---| +| `@Get` `@Post` `@Put` `@Patch` `@Delete` | as named | buffered response | +| `@Sse` | GET | `text/event-stream` | +| `@Ws` | GET | WebSocket duplex | +| `@Stream` | GET | negotiated (SSE / ndjson / WS) | + +```typescript +@Get('/ping', { export: true }) // exportable over mesh +@Post('/upload', { duplicates: 'array' }) // repeated form fields → arrays +``` + +See [Routing](/guides/routing/) for pattern matching and [Streaming](/guides/streaming/) for the transports. + +## Arguments + +A handler's signature declares exactly what it wants, in any order. + +| Decorator | Injects | Forms | +|---|---|---| +| `@needs('user')` | a graph-produced value (boot-validated) | `('key')` | +| `@ctx()` | the whole accumulated context | `()` | +| `@param(...)` | route params | `()` · `('id')` · `('id', schema)` | +| `@query(...)` | parsed query string | `()` · `('q')` · `(['a','b'])` · `(schema)` | +| `@body(...)` | parsed body (JSON / urlencoded / multipart) | `()` · `('field')` · `(schema)` | +| `@headers(...)` | request headers (whole bag or picked) | `()` · `('authorization')` · `(['a','b'])` · `(schema)` | +| `@header('name')` | one request header (singular alias of `@headers`) | `('x-trace')` · `('x-count', schema)` | +| `@inbound()` | the incoming message stream (WebSocket) | `()` | +| `@abort()` | the request's `AbortSignal` | `()` | + +Passing a [Standard Schema](/guides/validation/) validates and coerces the value before the handler sees it. Full details in [Argument decorators](/guides/arguments/). diff --git a/website/tsconfig.json b/website/tsconfig.json new file mode 100644 index 0000000..8bf91d3 --- /dev/null +++ b/website/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "astro/tsconfigs/strict", + "include": [".astro/types.d.ts", "**/*"], + "exclude": ["dist"] +}