Skip to content

armgit / ruflo

Public Imported from GitHub
0

🌊 The original agent harness. Deploy intelligent multi-player swarms, coordinate autonomous workflows, and build conversational AI systems. Features adaptive memory, self-learning intelligence, federation, vector RAG integration, and native Claude Code / Codex / Hermes and many more Integrated

feat(federation): add guarded public registration and release 3.47.0

ruve69bc340cf0f
diff --git a/.github/workflows/stable-npm-release.yml b/.github/workflows/stable-npm-release.yml
index a1b478547e..72e965d1b9 100644
--- a/.github/workflows/stable-npm-release.yml
+++ b/.github/workflows/stable-npm-release.yml
@@ -55,7 +55,7 @@ jobs:
- name: Setup Node.js and npm authentication
uses: actions/setup-node@v4
with:
- node-version: 20
+ node-version: 22
registry-url: https://registry.npmjs.org
cache: pnpm
cache-dependency-path: v3/pnpm-lock.yaml
@@ -112,12 +112,20 @@ jobs:
run: |
pnpm --dir @claude-flow/cli exec vitest run \
__tests__/guidance-brain.test.ts \
- __tests__/mcp-client-guardrail.test.ts
+ __tests__/mcp-client-guardrail.test.ts \
+ __tests__/x-federation-join.test.ts
pnpm --dir @claude-flow/codex exec vitest run
pnpm --dir @claude-flow/security exec vitest run
pnpm --dir @claude-flow/plugin-agent-federation exec vitest run
node ../scripts/__tests__/stage-internal-runtime-bundles.test.mjs
+ - name: Validate public registration gateway
+ working-directory: plugins/ruflo-x-gateway
+ run: |
+ npm ci --ignore-scripts --no-audit --no-fund --workspaces=false
+ npm test
+ npm audit --omit=dev
+
- name: Verify signed helper manifest
working-directory: v3/@claude-flow/cli
run: node scripts/verify-helpers.mjs
diff --git a/package.json b/package.json
index 31e154e1ac..e765b15dfb 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "claude-flow",
- "version": "3.46.1",
+ "version": "3.47.0",
"workspaces": [
"v3/@claude-flow/codex",
"v3/@claude-flow/mcp",
diff --git a/plugins/ruflo-x-gateway/.dockerignore b/plugins/ruflo-x-gateway/.dockerignore
index 74c0f514e3..0e0e9175dc 100644
--- a/plugins/ruflo-x-gateway/.dockerignore
+++ b/plugins/ruflo-x-gateway/.dockerignore
@@ -1,4 +1,3 @@
node_modules
*.key
-package-lock.json
.gitignore
diff --git a/plugins/ruflo-x-gateway/.gitignore b/plugins/ruflo-x-gateway/.gitignore
index 458e69f695..3b89e845e6 100644
--- a/plugins/ruflo-x-gateway/.gitignore
+++ b/plugins/ruflo-x-gateway/.gitignore
@@ -1,4 +1,3 @@
node_modules/
*.key
-package-lock.json
/data/
diff --git a/plugins/ruflo-x-gateway/Dockerfile b/plugins/ruflo-x-gateway/Dockerfile
index 6482726464..d823fe4ce0 100644
--- a/plugins/ruflo-x-gateway/Dockerfile
+++ b/plugins/ruflo-x-gateway/Dockerfile
@@ -1,7 +1,7 @@
FROM node:22-slim
WORKDIR /app
-COPY package.json ./
-RUN npm install --omit=dev --no-audit --no-fund
+COPY package.json package-lock.json ./
+RUN npm ci --omit=dev --no-audit --no-fund
COPY src ./src
ENV PORT=8080
# persistent Nostr identity; mount a volume at /data in prod, ephemeral otherwise
diff --git a/plugins/ruflo-x-gateway/README.md b/plugins/ruflo-x-gateway/README.md
index c480fd56a5..8eb257179b 100644
--- a/plugins/ruflo-x-gateway/README.md
+++ b/plugins/ruflo-x-gateway/README.md
@@ -48,3 +48,102 @@ content as data, not privileged commands.
the proposed strict NIP-98 profile, signed machine messages, governance and validation
evidence. Proposed requirements are distinguished from this gateway's current behavior.
The draft is not a claim of full implementation conformance or industry ratification.
+
+## Public registration (operator enabled)
+
+The updated local client supports `npx ruflo federation join` without a code.
+It preserves an existing key, signs a NIP-98 request to the gateway and verifies
+NIP-42 authentication using that same key. `--code` remains supported for private
+invites. This source change needs a gateway deployment and CLI release before
+that command works for new users against production.
+
+`GET /api/registration` discovers the configured endpoint and limits.
+`POST /api/registration` accepts exactly `{}` and a NIP-98 Authorization header.
+The signer is the only key that can be admitted, always as `member`. No caller
+can request an admin role or redirect the admission to another relay. Gateway
+publishing, admin membership operations and private channel access keep their
+existing authorization requirements. Registration does not publish a user event.
+
+Proposed starting limits are **3 new admissions per client network per hour**
+(IPv4 address or IPv6 /64), **100 per UTC day globally**, and **4 in-flight
+admissions per gateway instance**. The first two limits use atomic Firestore
+transactions shared across replicas and restarts. Failed or ambiguous admissions
+consume quota and leave a permanent pending record for operator reconciliation.
+A new valid request for an already processed key does not grant it again.
+These limits bound enrollment, not posting volume or unique humans. Relay posting
+quotas and suspension must remain enforced at the relay; key ownership alone
+cannot prevent distributed account farming.
+
+### Production enablement
+
+Registration defaults to disabled. Prepare and verify all of the following:
+
+1. Configure `RUFLO_OPEN_REGISTRATION=true`, `RUFLO_PUBLIC_URL` as the exact HTTPS
+ gateway origin, `RUFLO_REGISTRATION_PROJECT`, and optionally
+ `RUFLO_REGISTRATION_DATABASE` (default `(default)`). Use a dedicated Firestore
+ database and service account where practical. The runtime needs Firestore
+ read/write permissions and its existing relay admin signing identity; callers
+ never receive that identity or its secret.
+2. Mount a stable random `RUFLO_REGISTRATION_IP_SALT` of at least 32 characters
+ from Secret Manager. Only HMAC network identifiers are stored, not raw IPs.
+ Changing the salt resets the per-network quota identity, so treat rotation as
+ an intentional quota reset. The global daily cap remains unchanged.
+3. Set `RUFLO_REGISTRATION_PROXY_HOPS` only after verifying the ingress chain.
+ Default `0` uses the socket address and ignores forwarded headers. Values
+ `1..3` walk from the right across exactly that many trusted proxies. An origin
+ reachable outside that trusted chain must not use proxy trust. Shared egress
+ can group legitimate users together; confirm this in staging.
+4. Import every existing revoked/banned key as a permanent
+ `rufloRegistration/key_<pubkey>` document with `status: "blocked"`. Do not
+ assume an unconditional relay admission preserves bans. Import existing
+ members as `status: "admitted"` to avoid changing their roles on enrollment.
+ Ordinary removals are not durable bans in Buzz: deleted rows and best effort
+ deltas cannot prove a complete historical removal list. If that history is
+ unavailable, keep registration paused until the operator explicitly permits
+ reapplication for keys without an active ban. Record that policy in the control
+ document. Current durable bans must always be imported. Every new grant also
+ checks the live `/moderation/restricted` endpoint; a ban or lookup failure
+ prevents admission, including bans created after rollout.
+5. Only after that import is verified, create `rufloRegistration/control` with
+ `enabled: true` and `revocationsImported: true`, plus the recorded historical
+ removal policy. Missing fields or a datastore
+ failure refuse enrollment. Changing `enabled` to false pauses new reservations
+ across replicas. GET discovery reports the environment configuration; a runtime
+ pause can still return 503. Both the environment switch and control document
+ must permit registration.
+6. Configure Firestore TTL on `expiresAt` for old IP/hour and daily counter
+ documents. Key and control documents deliberately have no TTL. Enforce access
+ through server IAM; clients must never write this collection directly.
+7. Test from an unadmitted local key: register without an invite, authenticate to
+ the canonical relay and publish a signed event. Require matching event IDs and
+ boolean `true` acknowledgments. Replays, foreign signatures, role overrides,
+ exhausted quotas and blocked keys must produce no admission event.
+
+Do not reuse gateway instance memory or an ephemeral filesystem as the production
+quota/replay store. Bound Cloud Run instance counts and apply an ingress request
+rate limit before activation: rejected signed requests can still cause database
+reads, and the admission quota is not a total request or billing ceiling.
+The Firestore SDK requires Node 22 or newer, matching the existing Docker image.
+One enrollment uses four transactional document reads, three
+reservation writes and one completion read/write, plus contention retries; no
+model call is involved. This is an operation count, not a cloud price quote.
+
+### Suspension and uncertain outcomes
+
+For revocation: pause registrations in the control document, drain or stop all
+in-flight registration handlers across every serving revision, set the key record
+to `blocked`, revoke it on the relay, and verify NIP-42 is refused before resuming.
+A database transaction and a relay grant are not one atomic transaction. Blocking
+a key while an earlier grant is in flight is insufficient: that grant can finish
+after the block. Never delete a pending/admitted record to retry blindly, since
+that can restore a revoked identity. If an admission acknowledgment was lost,
+first check relay membership with the user's local key and reconcile the record.
+
+### Validation
+
+`npm test` runs gateway and security regressions, including a local relay that
+requires matching signer/authentication identity. The registration store tests
+exercise the Firestore transaction adapter through a serialized test database;
+they are not proof of production IAM, ingress topology, TTL or emulator behavior.
+The CLI suite is `x-federation-join.test.ts`. A production activation must add a
+staging Firestore and live relay check before opening registration.
diff --git a/plugins/ruflo-x-gateway/package-lock.json b/plugins/ruflo-x-gateway/package-lock.json
new file mode 100644
index 0000000000..abf0d1c166
--- /dev/null
+++ b/plugins/ruflo-x-gateway/package-lock.json
@@ -0,0 +1,2562 @@
+{
+ "name": "@ruflo/x-gateway",
+ "version": "0.8.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "@ruflo/x-gateway",
+ "version": "0.8.0",
+ "license": "MIT",
+ "dependencies": {
+ "@google-cloud/firestore": "^9.2.0",
+ "@modelcontextprotocol/sdk": "^1.0.0",
+ "jose": "^6.2.12",
+ "nostr-tools": "^2.7.0",
+ "ws": "^8.18.0",
+ "zod": "^3.23.0"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/@google-cloud/firestore": {
+ "version": "9.2.0",
+ "resolved": "https://registry.npmjs.org/@google-cloud/firestore/-/firestore-9.2.0.tgz",
+ "integrity": "sha512-4BI2686ygMkef0Pe4QnX9hnWeGCUjaAP5m+Ow5/yNWwGxGadO741Ct28MRXW9czg0pnvz919INKbQdCgUMcfeA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@google-cloud/firestore-api": "^0.2.0",
+ "@opentelemetry/api": "^1.9.0",
+ "fast-deep-equal": "^3.1.3",
+ "functional-red-black-tree": "^1.0.1",
+ "google-gax": "^6.0.1",
+ "protobufjs": "^7.5.3"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/@google-cloud/firestore-api/-/firestore-api-0.2.0.tgz",
+ "integrity": "sha512-wfHJPZmLqzpy6FN6U+7HkkP/AKhGsbHSpEy/qL2TyI3/pKRAvpamQxZ2qvps5hMRgAjfuHCim+oeJj9RveCaqg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "google-gax": "^5.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api/node_modules/gaxios": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.1.3.tgz",
+ "integrity": "sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "extend": "^3.0.2",
+ "https-proxy-agent": "^7.0.1",
+ "node-fetch": "^3.3.2",
+ "rimraf": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api/node_modules/gcp-metadata": {
+ "version": "8.1.4",
+ "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-8.1.4.tgz",
+ "integrity": "sha512-iJ9KMsiu+xKtNRX0PmGLSaIU3bUBAyzWTyqKemKPzNPsmmsBCQYmlNg+brEbES7IHSXtdVwzBPzx1vz3FAaipw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "gaxios": "7.1.3",
+ "google-logging-utils": "1.1.3",
+ "json-bigint": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api/node_modules/google-auth-library": {
+ "version": "10.5.0",
+ "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-10.5.0.tgz",
+ "integrity": "sha512-7ABviyMOlX5hIVD60YOfHw4/CxOfBhyduaYB+wbFWCWoni4N7SLcV46hrVRktuBbZjFC9ONyqamZITN7q3n32w==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "base64-js": "^1.3.0",
+ "ecdsa-sig-formatter": "^1.0.11",
+ "gaxios": "^7.0.0",
+ "gcp-metadata": "^8.0.0",
+ "google-logging-utils": "^1.0.0",
+ "gtoken": "^8.0.0",
+ "jws": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api/node_modules/google-gax": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-5.0.8.tgz",
+ "integrity": "sha512-M4vpZcXQIC1gqIVGQ7eaU3jXQA6zecStyTXu514TYfThlgSurYJOxHZo9fzU6hAgwPWvuEynAVHWyaIk80VeEA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@grpc/grpc-js": "^1.12.6",
+ "@grpc/proto-loader": "^0.8.0",
+ "duplexify": "^4.1.3",
+ "google-auth-library": "10.5.0",
+ "google-logging-utils": "1.1.3",
+ "node-fetch": "^3.3.2",
+ "object-hash": "^3.0.0",
+ "proto3-json-serializer": "3.0.4",
+ "protobufjs": "^7.5.4",
+ "retry-request": "^8.0.2",
+ "rimraf": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api/node_modules/google-logging-utils": {
+ "version": "1.1.3",
+ "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-1.1.3.tgz",
+ "integrity": "sha512-eAmLkjDjAFCVXg7A1unxHsLf961m6y17QFqXqAXGj/gVkKFrEICfStRfwUlGNfeCEjNRa32JEWOUTlYXPyyKvA==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api/node_modules/proto3-json-serializer": {
+ "version": "3.0.4",
+ "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-3.0.4.tgz",
+ "integrity": "sha512-E1sbAYg3aEbXrq0n1ojJkRHQJGE1kaE/O6GLA94y8rnJBfgvOPTOd1b9hOceQK1FFZI9qMh1vBERCyO2ifubcw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "protobufjs": "^7.4.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api/node_modules/retry-request": {
+ "version": "8.0.4",
+ "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-8.0.4.tgz",
+ "integrity": "sha512-pI6/7eabUYkZxamkOq0g0uMxKLLGnjzhefY+vL8bVXag5rto4OU2YBTPytWLuHH7aEKD6fn7kJycQfid0Mwnkw==",
+ "license": "MIT",
+ "dependencies": {
+ "extend": "^3.0.2",
+ "teeny-request": "^10.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@google-cloud/firestore-api/node_modules/teeny-request": {
+ "version": "10.1.4",
+ "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-10.1.4.tgz",
+ "integrity": "sha512-R1Cg4Vu0UULeDfHL/kjABLaTW++9yD/B6n2g48y5dJ04hsEaxcfmAqbNDzNsbqAYJyIpZafjklLG9YxRu9uzOg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "http-proxy-agent": "^7.0.0",
+ "https-proxy-agent": "^7.0.1",
+ "node-fetch": "^3.3.2",
+ "stream-events": "^1.0.5"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/@grpc/grpc-js": {
+ "version": "1.14.5",
+ "resolved": "https://registry.npmjs.org/@grpc/grpc-js/-/grpc-js-1.14.5.tgz",
+ "integrity": "sha512-7VZM+SVdEcUUqSQeNI3zM8Qs/BhQKZndPo2h5VkYkAM8Iz0wJIa8mKV5ekQGqG8UUsnkQ0NMxIxwkIHYvj0qOw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@grpc/proto-loader": "^0.8.0",
+ "@js-sdsl/ordered-map": "^4.4.2"
+ },
+ "engines": {
+ "node": ">=12.10.0"
+ }
+ },
+ "node_modules/@grpc/proto-loader": {
+ "version": "0.8.1",
+ "resolved": "https://registry.npmjs.org/@grpc/proto-loader/-/proto-loader-0.8.1.tgz",
+ "integrity": "sha512-wtF6h+DY6M3YaDBPAmvuuA6jV8Sif9MjtOI5euKFWRgCDl5PeDpPsHR9u2l6St5ceY8AZgoNDww5+HvEsXFsGg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "lodash.camelcase": "^4.3.0",
+ "long": "^5.0.0",
+ "protobufjs": "^7.5.5",
+ "yargs": "^17.7.2"
+ },
+ "bin": {
+ "proto-loader-gen-types": "build/bin/proto-loader-gen-types.js"
+ },
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/@hono/node-server": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-2.1.1.tgz",
+ "integrity": "sha512-ELuehkj5VCBdgEw9zs+ivkKwyzzUCSQuE96YmiPvn1ECBoZCczbFXJLeEGMTYjphP6gydh4pHMqEYPVMYUVgQg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=20"
+ },
+ "peerDependencies": {
+ "hono": "^4"
+ }
+ },
+ "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==",
+ "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.4.0",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz",
+ "integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+ }
+ },
+ "node_modules/@isaacs/cliui/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==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?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==",
+ "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==",
+ "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==",
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^6.2.2"
+ },
+ "engines": {
+ "node": ">=12"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+ }
+ },
+ "node_modules/@isaacs/cliui/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==",
+ "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/@js-sdsl/ordered-map": {
+ "version": "4.4.2",
+ "resolved": "https://registry.npmjs.org/@js-sdsl/ordered-map/-/ordered-map-4.4.2.tgz",
+ "integrity": "sha512-iUKgm52T8HOE/makSxjqoWhe95ZJA1/G1sYsGev2JDKUSS14KAgg1LHb+Ba+IPow0xflbnSkOsZcO08C7w1gYw==",
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/js-sdsl"
+ }
+ },
+ "node_modules/@modelcontextprotocol/sdk": {
+ "version": "1.30.1",
+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.30.1.tgz",
+ "integrity": "sha512-H2HxLvC3HDNybePJaLdSrU1hhUK5iQw+WvV1b01myFyI7sdVGe1u/IPTE5D9fGCiJDVtgMV/lmFkQXLmQyIFYA==",
+ "license": "MIT",
+ "dependencies": {
+ "@hono/node-server": "^1.19.9 || ^2.0.5",
+ "ajv": "^8.17.1",
+ "ajv-formats": "^3.0.1",
+ "content-type": "^1.0.5",
+ "cors": "^2.8.5",
+ "cross-spawn": "^7.0.5",
+ "eventsource": "^3.0.2",
+ "eventsource-parser": "^3.0.0",
+ "express": "^5.2.1",
+ "express-rate-limit": "^8.2.1",
+ "hono": "^4.11.4",
+ "jose": "^6.1.3",
+ "json-schema-typed": "^8.0.2",
+ "pkce-challenge": "^5.0.0",
+ "raw-body": "^3.0.0",
+ "zod": "^3.25 || ^4.0",
+ "zod-to-json-schema": "^3.25.1"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "peerDependencies": {
+ "@cfworker/json-schema": "^4.1.1",
+ "zod": "^3.25 || ^4.0"
+ },
+ "peerDependenciesMeta": {
+ "@cfworker/json-schema": {
+ "optional": true
+ },
+ "zod": {
+ "optional": false
+ }
+ }
+ },
+ "node_modules/@noble/ciphers": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-2.1.1.tgz",
+ "integrity": "sha512-bysYuiVfhxNJuldNXlFEitTVdNnYUc+XNJZd7Qm2a5j1vZHgY+fazadNFWFaMK/2vye0JVlxV3gHmC0WDfAOQw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20.19.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/curves": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-2.0.1.tgz",
+ "integrity": "sha512-vs1Az2OOTBiP4q0pwjW5aF0xp9n4MxVrmkFBxc6EKZc6ddYx5gaZiAsZoq0uRRXWbi3AT/sBqn05eRPtn1JCPw==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "2.0.1"
+ },
+ "engines": {
+ "node": ">= 20.19.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@noble/hashes": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.0.1.tgz",
+ "integrity": "sha512-XlOlEbQcE9fmuXxrVTXCTlG2nlRXa9Rj3rr5Ue/+tX+nmkgbX720YHh0VR3hBF9xDvwnb8D2shVGOwNx+ulArw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 20.19.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@opentelemetry/api": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/@opentelemetry/api/-/api-1.9.1.tgz",
+ "integrity": "sha512-gLyJlPHPZYdAk1JENA9LeHejZe1Ti77/pTeFm/nMXmQH/HFZlcS/O2XJB+L8fkbrNSqhdtlvjBVjxwUYanNH5Q==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=8.0.0"
+ }
+ },
+ "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==",
+ "license": "MIT",
+ "optional": true,
+ "engines": {
+ "node": ">=14"
+ }
+ },
+ "node_modules/@protobufjs/aspromise": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/base64": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/codegen": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.5.tgz",
+ "integrity": "sha512-zgXFLzW3Ap33e6d0Wlj4MGIm6Ce8O89n/apUaGNB/jx+hw+ruWEp7EwGUshdLKVRCxZW12fp9r40E1mQrf/34g==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/eventemitter": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.1.tgz",
+ "integrity": "sha512-vW1GmwMZNnL+gMRaovlh9yZX74kc+TTU3FObkkurpMaRtBfLP3ldjS9KQWlwZgraRE0+dheEEoAxdzcJQ8eXZg==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/fetch": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.1.tgz",
+ "integrity": "sha512-GpptLrs57adMSuHi3VNj0mAF8dwh36LMaYF6XyJ6JMWlVsc+t42tm1HSEDmOs3A8fC9yyeisgLhsTVQokOZ0zw==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "@protobufjs/aspromise": "^1.1.1"
+ }
+ },
+ "node_modules/@protobufjs/float": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/path": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/pool": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@protobufjs/utf8": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.2.tgz",
+ "integrity": "sha512-b1UQwcEZ4yCnMCD8DAL1VlbvBJE9/IX4FTIp7BG1xYpf29SLazLSrqUkj4w7Y5y7cCVP6E5tcqqcI0xemPkHug==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/@scure/base": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/@scure/base/-/base-2.0.0.tgz",
+ "integrity": "sha512-3E1kpuZginKkek01ovG8krQ0Z44E3DHPjc5S2rjJw9lZn3KSQOs8S7wqikF/AH7iRanHypj85uGyxk0XAyC37w==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip32": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-2.0.1.tgz",
+ "integrity": "sha512-4Md1NI5BzoVP+bhyJaY3K6yMesEFzNS1sE/cP+9nuvE7p/b0kx9XbpDHHFl8dHtufcbdHRUUQdRqLIPHN/s7yA==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/curves": "2.0.1",
+ "@noble/hashes": "2.0.1",
+ "@scure/base": "2.0.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@scure/bip39": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-2.0.1.tgz",
+ "integrity": "sha512-PsxdFj/d2AcJcZDX1FXN3dDgitDDTmwf78rKZq1a6c1P1Nan1X/Sxc7667zU3U+AN60g7SxxP0YCVw2H/hBycg==",
+ "license": "MIT",
+ "dependencies": {
+ "@noble/hashes": "2.0.1",
+ "@scure/base": "2.0.0"
+ },
+ "funding": {
+ "url": "https://paulmillr.com/funding/"
+ }
+ },
+ "node_modules/@types/node": {
+ "version": "26.6.3",
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.3.tgz",
+ "integrity": "sha512-dsqMQQoeTLqu9wynDD00q573mNzso3IdQOAfHRJqLCcmCFPoGo9A1bDpUcv/9tnKpErQWv9uKeGfl37EIS02Yg==",
+ "license": "MIT",
+ "dependencies": {
+ "undici-types": "~8.9.0"
+ }
+ },
+ "node_modules/accepts": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",
+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-types": "^3.0.0",
+ "negotiator": "^1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/agent-base": {
+ "version": "7.1.4",
+ "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.4.tgz",
+ "integrity": "sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/ajv": {
+ "version": "8.20.0",
+ "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.20.0.tgz",
+ "integrity": "sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA==",
+ "license": "MIT",
+ "dependencies": {
+ "fast-deep-equal": "^3.1.3",
+ "fast-uri": "^3.0.1",
+ "json-schema-traverse": "^1.0.0",
+ "require-from-string": "^2.0.2"
+ },
+ "funding": {
+ "type": "github",
+ "url": "https://github.com/sponsors/epoberezkin"
+ }
+ },
+ "node_modules/ajv-formats": {
+ "version": "3.0.1",
+ "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-3.0.1.tgz",
+ "integrity": "sha512-8iUql50EUR+uUcdRQ3HDqa6EVyo3docL8g5WJ3FNcWmu62IbkGUue/pEyLBW8VGKKucTPgqeks4fIU1DA4yowQ==",
+ "license": "MIT",
+ "dependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependencies": {
+ "ajv": "^8.0.0"
+ },
+ "peerDependenciesMeta": {
+ "ajv": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/ansi-regex": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz",
+ "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/ansi-styles": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz",
+ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==",
+ "license": "MIT",
+ "dependencies": {
+ "color-convert": "^2.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ },
+ "funding": {
+ "url": "https://github.com/chalk/ansi-styles?sponsor=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==",
+ "license": "MIT"
+ },
+ "node_modules/base64-js": {
+ "version": "1.5.1",
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/bignumber.js": {
+ "version": "9.3.1",
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.3.1.tgz",
+ "integrity": "sha512-Ko0uX15oIUS7wJ3Rb30Fs6SkVbLmPBAKdlm7q9+ak9bbIeFf0MwuBsQV6z7+X768/cHsfg+WlysDWJcmthjsjQ==",
+ "license": "MIT",
+ "engines": {
+ "node": "*"
+ }
+ },
+ "node_modules/body-parser": {
+ "version": "2.3.0",
+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.3.0.tgz",
+ "integrity": "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "^3.1.2",
+ "content-type": "^2.0.0",
+ "debug": "^4.4.3",
+ "http-errors": "^2.0.1",
+ "iconv-lite": "^0.7.2",
+ "on-finished": "^2.4.1",
+ "qs": "^6.15.2",
+ "raw-body": "^3.0.2",
+ "type-is": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/body-parser/node_modules/content-type": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz",
+ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/brace-expansion": {
+ "version": "2.1.7",
+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.1.7.tgz",
+ "integrity": "sha512-uZbew1NqdmPDTMJ8ah1y+b+9QEJrfkXFk3RcTQw3X0jW/xRUvFKsg1CfQdSYGdTbXZWExtU3J3ccxtnfw1Fi0g==",
+ "license": "MIT",
+ "dependencies": {
+ "balanced-match": "^1.0.0"
+ }
+ },
+ "node_modules/buffer-equal-constant-time": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz",
+ "integrity": "sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==",
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/bytes": {
+ "version": "3.1.2",
+ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
+ "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/call-bind-apply-helpers": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
+ "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/call-bound": {
+ "version": "1.0.4",
+ "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz",
+ "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "get-intrinsic": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/cliui": {
+ "version": "8.0.1",
+ "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz",
+ "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==",
+ "license": "ISC",
+ "dependencies": {
+ "string-width": "^4.2.0",
+ "strip-ansi": "^6.0.1",
+ "wrap-ansi": "^7.0.0"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/color-convert": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
+ "license": "MIT",
+ "dependencies": {
+ "color-name": "~1.1.4"
+ },
+ "engines": {
+ "node": ">=7.0.0"
+ }
+ },
+ "node_modules/color-name": {
+ "version": "1.1.4",
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
+ "license": "MIT"
+ },
+ "node_modules/content-disposition": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.1.0.tgz",
+ "integrity": "sha512-5jRCH9Z/+DRP7rkvY83B+yGIGX96OYdJmzngqnw2SBSxqCFPd0w2km3s5iawpGX8krnwSGmF0FW5Nhr0Hfai3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/content-type": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz",
+ "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie": {
+ "version": "0.7.2",
+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",
+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/cookie-signature": {
+ "version": "1.2.2",
+ "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz",
+ "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6.6.0"
+ }
+ },
+ "node_modules/cors": {
+ "version": "2.8.6",
+ "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz",
+ "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==",
+ "license": "MIT",
+ "dependencies": {
+ "object-assign": "^4",
+ "vary": "^1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/cross-spawn": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
+ "license": "MIT",
+ "dependencies": {
+ "path-key": "^3.1.0",
+ "shebang-command": "^2.0.0",
+ "which": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/data-uri-to-buffer": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz",
+ "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "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/depd": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
+ "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/dunder-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
+ "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "gopd": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/duplexify": {
+ "version": "4.1.3",
+ "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-4.1.3.tgz",
+ "integrity": "sha512-M3BmBhwJRZsSx38lZyhE53Csddgzl5R7xGJNk7CVddZD6CcmwMCH8J+7AprIrQKH7TonKxaCjcv27Qmf+sQ+oA==",
+ "license": "MIT",
+ "dependencies": {
+ "end-of-stream": "^1.4.1",
+ "inherits": "^2.0.3",
+ "readable-stream": "^3.1.1",
+ "stream-shift": "^1.0.2"
+ }
+ },
+ "node_modules/eastasianwidth": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz",
+ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==",
+ "license": "MIT"
+ },
+ "node_modules/ecdsa-sig-formatter": {
+ "version": "1.0.11",
+ "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz",
+ "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/ee-first": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
+ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==",
+ "license": "MIT"
+ },
+ "node_modules/emoji-regex": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
+ "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
+ "license": "MIT"
+ },
+ "node_modules/encodeurl": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz",
+ "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/end-of-stream": {
+ "version": "1.4.5",
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz",
+ "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==",
+ "license": "MIT",
+ "dependencies": {
+ "once": "^1.4.0"
+ }
+ },
+ "node_modules/es-define-property": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz",
+ "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-errors": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz",
+ "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/es-object-atoms": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.2.tgz",
+ "integrity": "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/escalade": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz",
+ "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=6"
+ }
+ },
+ "node_modules/escape-html": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
+ "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==",
+ "license": "MIT"
+ },
+ "node_modules/etag": {
+ "version": "1.8.1",
+ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
+ "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/eventsource": {
+ "version": "3.0.7",
+ "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-3.0.7.tgz",
+ "integrity": "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA==",
+ "license": "MIT",
+ "dependencies": {
+ "eventsource-parser": "^3.0.1"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/eventsource-parser": {
+ "version": "3.1.1",
+ "resolved": "https://registry.npmjs.org/eventsource-parser/-/eventsource-parser-3.1.1.tgz",
+ "integrity": "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18.0.0"
+ }
+ },
+ "node_modules/express": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz",
+ "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==",
+ "license": "MIT",
+ "dependencies": {
+ "accepts": "^2.0.0",
+ "body-parser": "^2.2.1",
+ "content-disposition": "^1.0.0",
+ "content-type": "^1.0.5",
+ "cookie": "^0.7.1",
+ "cookie-signature": "^1.2.1",
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "finalhandler": "^2.1.0",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.0",
+ "merge-descriptors": "^2.0.0",
+ "mime-types": "^3.0.0",
+ "on-finished": "^2.4.1",
+ "once": "^1.4.0",
+ "parseurl": "^1.3.3",
+ "proxy-addr": "^2.0.7",
+ "qs": "^6.14.0",
+ "range-parser": "^1.2.1",
+ "router": "^2.2.0",
+ "send": "^1.1.0",
+ "serve-static": "^2.2.0",
+ "statuses": "^2.0.1",
+ "type-is": "^2.0.1",
+ "vary": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/express-rate-limit": {
+ "version": "8.7.0",
+ "resolved": "https://registry.npmjs.org/express-rate-limit/-/express-rate-limit-8.7.0.tgz",
+ "integrity": "sha512-hOwV7WOxXfjRpAM1DSJWZDXx3GhplwD8IfwuwvogD8i1Qnkgosw/H45s4ZnFAUHDAhPjlY9hLBvJhKmGMyY26g==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.3",
+ "ip-address": "^10.2.0"
+ },
+ "engines": {
+ "node": ">= 16"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/express-rate-limit"
+ },
+ "peerDependencies": {
+ "express": ">= 4.11"
+ }
+ },
+ "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-deep-equal": {
+ "version": "3.1.3",
+ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+ "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
+ "license": "MIT"
+ },
+ "node_modules/fast-uri": {
+ "version": "3.1.8",
+ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.8.tgz",
+ "integrity": "sha512-GZMtZUTNRpOVIECoXwLNZS5xUGE+mVNbTB8h/7Rwh2TFWcBQiPzTgyZi05BF9UMZKkLJv8XBRJTlU7zg8+ZfMg==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/fastify"
+ },
+ {
+ "type": "opencollective",
+ "url": "https://opencollective.com/fastify"
+ }
+ ],
+ "license": "BSD-3-Clause"
+ },
+ "node_modules/fetch-blob": {
+ "version": "3.2.0",
+ "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz",
+ "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "paypal",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "license": "MIT",
+ "dependencies": {
+ "node-domexception": "^1.0.0",
+ "web-streams-polyfill": "^3.0.3"
+ },
+ "engines": {
+ "node": "^12.20 || >= 14.13"
+ }
+ },
+ "node_modules/finalhandler": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz",
+ "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "on-finished": "^2.4.1",
+ "parseurl": "^1.3.3",
+ "statuses": "^2.0.1"
+ },
+ "engines": {
+ "node": ">= 18.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "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==",
+ "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/formdata-polyfill": {
+ "version": "4.0.10",
+ "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
+ "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==",
+ "license": "MIT",
+ "dependencies": {
+ "fetch-blob": "^3.1.2"
+ },
+ "engines": {
+ "node": ">=12.20.0"
+ }
+ },
+ "node_modules/forwarded": {
+ "version": "0.2.0",
+ "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
+ "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/fresh": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",
+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/function-bind": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz",
+ "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/functional-red-black-tree": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+ "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==",
+ "license": "MIT"
+ },
+ "node_modules/gaxios": {
+ "version": "7.3.1",
+ "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-7.3.1.tgz",
+ "integrity": "sha512-kB3rzJV7d9juLZh8/56QTXCwQfxyhdOMdyYk1HdQKFtF8TJTDTZQJtixWIwXdE9Jji91mC41DUNpjleo4L4eAQ==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "extend": "^3.0.2",
+ "https-proxy-agent": "^7.0.1",
+ "node-fetch": "^3.3.2"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/gcp-metadata": {
+ "version": "9.0.4",
+ "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-9.0.4.tgz",
+ "integrity": "sha512-p6WvbXOhfwnVtv/MyPq5kBiVhfV/qglMIxwwTVNEI1Ha1HmOgz5uHYHtYO6SfGckFaXe8blA11IJJ3wqXmvmBA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "gaxios": "^7.1.3",
+ "google-logging-utils": "^2.0.0",
+ "json-bigint": "^1.0.0"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/get-caller-file": {
+ "version": "2.0.5",
+ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+ "license": "ISC",
+ "engines": {
+ "node": "6.* || 8.* || >= 10.*"
+ }
+ },
+ "node_modules/get-intrinsic": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
+ "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bind-apply-helpers": "^1.0.2",
+ "es-define-property": "^1.0.1",
+ "es-errors": "^1.3.0",
+ "es-object-atoms": "^1.1.1",
+ "function-bind": "^1.1.2",
+ "get-proto": "^1.0.1",
+ "gopd": "^1.2.0",
+ "has-symbols": "^1.1.0",
+ "hasown": "^2.0.2",
+ "math-intrinsics": "^1.1.0"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/get-proto": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz",
+ "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
+ "license": "MIT",
+ "dependencies": {
+ "dunder-proto": "^1.0.1",
+ "es-object-atoms": "^1.0.0"
+ },
+ "engines": {
+ "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 [email protected]",
+ "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/google-auth-library": {
+ "version": "11.1.0",
+ "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-11.1.0.tgz",
+ "integrity": "sha512-YIBq5KNoHQrZ9PM4PeodDBqqBGlSTIxh1zibN8u3zNIO9UJg8gvKuCpdKV7fWXhsZ2zRkU6FhGrgKNgLJ2IRgw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "base64-js": "^1.3.0",
+ "ecdsa-sig-formatter": "^1.0.11",
+ "gaxios": "^7.1.4",
+ "gcp-metadata": "^9.0.0",
+ "google-logging-utils": "^2.0.0",
+ "jws": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/google-gax": {
+ "version": "6.7.0",
+ "resolved": "https://registry.npmjs.org/google-gax/-/google-gax-6.7.0.tgz",
+ "integrity": "sha512-v9QQ0c3MFCqG5K0/wfao7Bkk3knNxfnBHRb0UAssQvZJsf9DitRrguMrrSAfFcaEf3L6DHflbUyfW2NUt9aKFw==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@grpc/grpc-js": "^1.12.6",
+ "@grpc/proto-loader": "^0.8.0",
+ "@opentelemetry/api": "^1.9.0",
+ "duplexify": "^4.1.3",
+ "google-auth-library": "^11.0.0",
+ "google-logging-utils": "^2.0.0",
+ "node-fetch": "^3.3.2",
+ "object-hash": "^3.0.0",
+ "proto3-json-serializer": "^4.0.0",
+ "protobufjs": "^7.5.4",
+ "retry-request": "^9.0.0"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/google-logging-utils": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/google-logging-utils/-/google-logging-utils-2.0.1.tgz",
+ "integrity": "sha512-HMhaQghlOTvbcb3c4T5jmmOMtG3JUF1iOQMezaJXL86CDS+Tm2vHd0IeLFRAx3+ewd+bo9E1HFHoy17X5aJa9A==",
+ "license": "Apache-2.0",
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/gopd": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz",
+ "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/gtoken": {
+ "version": "8.0.0",
+ "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-8.0.0.tgz",
+ "integrity": "sha512-+CqsMbHPiSTdtSO14O51eMNlrp9N79gmeqmXeouJOhfucAedHw9noVe/n5uJk3tbKE6a+6ZCQg3RPhVhHByAIw==",
+ "license": "MIT",
+ "dependencies": {
+ "gaxios": "^7.0.0",
+ "jws": "^4.0.0"
+ },
+ "engines": {
+ "node": ">=18"
+ }
+ },
+ "node_modules/has-symbols": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz",
+ "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/hasown": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.4.tgz",
+ "integrity": "sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==",
+ "license": "MIT",
+ "dependencies": {
+ "function-bind": "^1.1.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/hono": {
+ "version": "4.13.9",
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.13.9.tgz",
+ "integrity": "sha512-7dMkQmZoC4E6F7AtaQSPhlWAdnBti+j7rreMZl8QB4jFiEhP9TWbGWUMi8WYzBCgmgulxuvLQupKqo+Co6Omyg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=16.9.0"
+ }
+ },
+ "node_modules/http-errors": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz",
+ "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==",
+ "license": "MIT",
+ "dependencies": {
+ "depd": "~2.0.0",
+ "inherits": "~2.0.4",
+ "setprototypeof": "~1.2.0",
+ "statuses": "~2.0.2",
+ "toidentifier": "~1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/http-proxy-agent": {
+ "version": "7.0.2",
+ "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
+ "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
+ "license": "MIT",
+ "dependencies": {
+ "agent-base": "^7.1.0",
+ "debug": "^4.3.4"
+ },
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/https-proxy-agent": {
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.6.tgz",
+ "integrity": "sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==",
+ "license": "MIT",
+ "dependencies": {
+ "agent-base": "^7.1.2",
+ "debug": "4"
+ },
+ "engines": {
+ "node": ">= 14"
+ }
+ },
+ "node_modules/iconv-lite": {
+ "version": "0.7.3",
+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.3.tgz",
+ "integrity": "sha512-IKXpvIzjnC9XTAUbVBcMfGS0EPaIXtW6v+zr+RRp+hqULEpo0owZax6wyRwPOJbWbzjYspQwusTsfVr0ifh4uQ==",
+ "license": "MIT",
+ "dependencies": {
+ "safer-buffer": ">= 2.1.2 < 3.0.0"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/inherits": {
+ "version": "2.0.4",
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+ "license": "ISC"
+ },
+ "node_modules/ip-address": {
+ "version": "10.7.2",
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.7.2.tgz",
+ "integrity": "sha512-7H/2gFSIitxc0hG3nOI1glS8QLo/EHBFFLk8vEUjXY/xu0AdL8jZ9U1IzO2PUm0d2D/ofQcAifb0g6OBkt8U7w==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 12"
+ }
+ },
+ "node_modules/ipaddr.js": {
+ "version": "1.9.1",
+ "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
+ "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/is-fullwidth-code-point": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
+ "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/is-promise": {
+ "version": "4.0.0",
+ "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz",
+ "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==",
+ "license": "MIT"
+ },
+ "node_modules/isexe": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+ "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+ "license": "ISC"
+ },
+ "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==",
+ "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/jose": {
+ "version": "6.2.12",
+ "resolved": "https://registry.npmjs.org/jose/-/jose-6.2.12.tgz",
+ "integrity": "sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/panva"
+ }
+ },
+ "node_modules/json-bigint": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz",
+ "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==",
+ "license": "MIT",
+ "dependencies": {
+ "bignumber.js": "^9.0.0"
+ }
+ },
+ "node_modules/json-schema-traverse": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz",
+ "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==",
+ "license": "MIT"
+ },
+ "node_modules/json-schema-typed": {
+ "version": "8.0.2",
+ "resolved": "https://registry.npmjs.org/json-schema-typed/-/json-schema-typed-8.0.2.tgz",
+ "integrity": "sha512-fQhoXdcvc3V28x7C7BMs4P5+kNlgUURe2jmUT1T//oBRMDrqy1QPelJimwZGo7Hg9VPV3EQV5Bnq4hbFy2vetA==",
+ "license": "BSD-2-Clause"
+ },
+ "node_modules/jwa": {
+ "version": "2.0.1",
+ "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.1.tgz",
+ "integrity": "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg==",
+ "license": "MIT",
+ "dependencies": {
+ "buffer-equal-constant-time": "^1.0.1",
+ "ecdsa-sig-formatter": "1.0.11",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/jws": {
+ "version": "4.0.1",
+ "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.1.tgz",
+ "integrity": "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA==",
+ "license": "MIT",
+ "dependencies": {
+ "jwa": "^2.0.1",
+ "safe-buffer": "^5.0.1"
+ }
+ },
+ "node_modules/lodash.camelcase": {
+ "version": "4.3.0",
+ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz",
+ "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==",
+ "license": "MIT"
+ },
+ "node_modules/long": {
+ "version": "5.3.2",
+ "resolved": "https://registry.npmjs.org/long/-/long-5.3.2.tgz",
+ "integrity": "sha512-mNAgZ1GmyNhD7AuqnTG3/VQ26o760+ZYBPKjPvugO8+nLbYfX6TVpJPseBvopbdY+qpZ/lKUnmEc1LeZYS3QAA==",
+ "license": "Apache-2.0"
+ },
+ "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==",
+ "license": "ISC"
+ },
+ "node_modules/math-intrinsics": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
+ "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ }
+ },
+ "node_modules/media-typer": {
+ "version": "1.1.1",
+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.1.tgz",
+ "integrity": "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/merge-descriptors": {
+ "version": "2.0.0",
+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",
+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/sindresorhus"
+ }
+ },
+ "node_modules/mime-db": {
+ "version": "1.54.0",
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz",
+ "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ }
+ },
+ "node_modules/mime-types": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz",
+ "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==",
+ "license": "MIT",
+ "dependencies": {
+ "mime-db": "^1.54.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/minimatch": {
+ "version": "9.0.9",
+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.9.tgz",
+ "integrity": "sha512-OBwBN9AL4dqmETlpS2zasx+vTeWclWzkblfZk7KTA5j3jeOONz/tRCnZomUyvNg83wL5Zv9Ss6HMJXAgL8R2Yg==",
+ "license": "ISC",
+ "dependencies": {
+ "brace-expansion": "^2.0.2"
+ },
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/minipass": {
+ "version": "7.1.3",
+ "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.3.tgz",
+ "integrity": "sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==",
+ "license": "BlueOak-1.0.0",
+ "engines": {
+ "node": ">=16 || 14 >=14.17"
+ }
+ },
+ "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/negotiator": {
+ "version": "1.1.0",
+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.1.0.tgz",
+ "integrity": "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg==",
+ "license": "MIT",
+ "dependencies": {
+ "content-type": "^2.1.0"
+ },
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/negotiator/node_modules/content-type": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz",
+ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/node-domexception": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz",
+ "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==",
+ "deprecated": "Use your platform's native DOMException instead",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/jimmywarting"
+ },
+ {
+ "type": "github",
+ "url": "https://paypal.me/jimmywarting"
+ }
+ ],
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.5.0"
+ }
+ },
+ "node_modules/node-fetch": {
+ "version": "3.3.2",
+ "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz",
+ "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==",
+ "license": "MIT",
+ "dependencies": {
+ "data-uri-to-buffer": "^4.0.0",
+ "fetch-blob": "^3.1.4",
+ "formdata-polyfill": "^4.0.10"
+ },
+ "engines": {
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/node-fetch"
+ }
+ },
+ "node_modules/nostr-tools": {
+ "version": "2.25.2",
+ "resolved": "https://registry.npmjs.org/nostr-tools/-/nostr-tools-2.25.2.tgz",
+ "integrity": "sha512-7JAx+brEPmqGz1yzaK9MOxvis/Nl1B38j9hVsBSRDMRmxk5XSc0+5LlPEYbzeiUyk41RURBDcfuMzmaT754HAg==",
+ "license": "Unlicense",
+ "dependencies": {
+ "@noble/ciphers": "2.1.1",
+ "@noble/curves": "2.0.1",
+ "@noble/hashes": "2.0.1",
+ "@scure/base": "2.0.0",
+ "@scure/bip32": "2.0.1",
+ "@scure/bip39": "2.0.1",
+ "nostr-wasm": "0.1.0"
+ },
+ "peerDependencies": {
+ "typescript": ">=5.0.0"
+ },
+ "peerDependenciesMeta": {
+ "typescript": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/nostr-wasm": {
+ "version": "0.1.0",
+ "resolved": "https://registry.npmjs.org/nostr-wasm/-/nostr-wasm-0.1.0.tgz",
+ "integrity": "sha512-78BTryCLcLYv96ONU8Ws3Q1JzjlAt+43pWQhIl86xZmWeegYCNLPml7yQ+gG3vR6V5h4XGj+TxO+SS5dsThQIA==",
+ "license": "MIT"
+ },
+ "node_modules/object-assign": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+ "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/object-hash": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz",
+ "integrity": "sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/object-inspect": {
+ "version": "1.13.4",
+ "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz",
+ "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/on-finished": {
+ "version": "2.4.1",
+ "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
+ "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
+ "license": "MIT",
+ "dependencies": {
+ "ee-first": "1.1.1"
+ },
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/once": {
+ "version": "1.4.0",
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+ "license": "ISC",
+ "dependencies": {
+ "wrappy": "1"
+ }
+ },
+ "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==",
+ "license": "BlueOak-1.0.0"
+ },
+ "node_modules/parseurl": {
+ "version": "1.3.3",
+ "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
+ "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.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==",
+ "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==",
+ "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",
+ "integrity": "sha512-qRcuIdP69NPm4qbACK+aDogI5CBDMi1jKe0ry5rSQJz8JVLsC7jV8XpiJjGRLLol3N+R5ihGYcrPLTno6pAdBA==",
+ "license": "MIT",
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/pkce-challenge": {
+ "version": "5.0.1",
+ "resolved": "https://registry.npmjs.org/pkce-challenge/-/pkce-challenge-5.0.1.tgz",
+ "integrity": "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=16.20.0"
+ }
+ },
+ "node_modules/proto3-json-serializer": {
+ "version": "4.0.2",
+ "resolved": "https://registry.npmjs.org/proto3-json-serializer/-/proto3-json-serializer-4.0.2.tgz",
+ "integrity": "sha512-VUQlb/J2WjOG8BKhdLwJUz+MKxSMtBGYh+TaNmRtiYVhlIzXjzeAGIx7gtc3lXlA2iURzfF2+cXaQvC2ofwzpg==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "protobufjs": "^7.5.4"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/protobufjs": {
+ "version": "7.6.6",
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.6.6.tgz",
+ "integrity": "sha512-dYDWdjSl5RNb7SgPxGQcRU+GtvP7s2fpkrY0r432PcOIaZ0/rBcxEZnQN67iJhFuQiVw754JDoPruPCNdGsbjg==",
+ "hasInstallScript": true,
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "@protobufjs/aspromise": "^1.1.2",
+ "@protobufjs/base64": "^1.1.2",
+ "@protobufjs/codegen": "^2.0.5",
+ "@protobufjs/eventemitter": "^1.1.1",
+ "@protobufjs/fetch": "^1.1.1",
+ "@protobufjs/float": "^1.0.2",
+ "@protobufjs/path": "^1.1.2",
+ "@protobufjs/pool": "^1.1.0",
+ "@protobufjs/utf8": "^1.1.1",
+ "@types/node": ">=13.7.0",
+ "long": "^5.3.2"
+ },
+ "engines": {
+ "node": ">=12.0.0"
+ }
+ },
+ "node_modules/proxy-addr": {
+ "version": "2.0.8",
+ "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.8.tgz",
+ "integrity": "sha512-5nnx0yGyVUcY6t9RnWcARWtwT9F1D8O9rt08htPvnd49W1IgZtmLkhu9WfMzQj1cFxjHIO6connUNVW5k7AVyQ==",
+ "license": "MIT",
+ "dependencies": {
+ "forwarded": "0.2.0",
+ "ipaddr.js": "1.9.1"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/qs": {
+ "version": "6.16.0",
+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.16.0.tgz",
+ "integrity": "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA==",
+ "license": "BSD-3-Clause",
+ "dependencies": {
+ "es-define-property": "^1.0.1",
+ "side-channel": "^1.1.1"
+ },
+ "engines": {
+ "node": ">=0.6"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/range-parser": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.3.0.tgz",
+ "integrity": "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.6"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/raw-body": {
+ "version": "3.0.2",
+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz",
+ "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==",
+ "license": "MIT",
+ "dependencies": {
+ "bytes": "~3.1.2",
+ "http-errors": "~2.0.1",
+ "iconv-lite": "~0.7.0",
+ "unpipe": "~1.0.0"
+ },
+ "engines": {
+ "node": ">= 0.10"
+ }
+ },
+ "node_modules/readable-stream": {
+ "version": "3.6.2",
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
+ "license": "MIT",
+ "dependencies": {
+ "inherits": "^2.0.3",
+ "string_decoder": "^1.1.1",
+ "util-deprecate": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 6"
+ }
+ },
+ "node_modules/require-directory": {
+ "version": "2.1.1",
+ "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+ "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/require-from-string": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz",
+ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.10.0"
+ }
+ },
+ "node_modules/retry-request": {
+ "version": "9.0.1",
+ "resolved": "https://registry.npmjs.org/retry-request/-/retry-request-9.0.1.tgz",
+ "integrity": "sha512-4kGHEBl0ME6gR+8QB1sPMyg58jUxLUcCZNeqLDrfqzk0eWQN8XJFmeu7fmZCjlZCRW0S2u64Ik1HkO/0sWgCYQ==",
+ "license": "MIT",
+ "dependencies": {
+ "extend": "^3.0.2",
+ "teeny-request": "^11.0.0"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/rimraf": {
+ "version": "5.0.10",
+ "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz",
+ "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==",
+ "license": "ISC",
+ "dependencies": {
+ "glob": "^10.3.7"
+ },
+ "bin": {
+ "rimraf": "dist/esm/bin.mjs"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/router": {
+ "version": "2.2.0",
+ "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz",
+ "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.0",
+ "depd": "^2.0.0",
+ "is-promise": "^4.0.0",
+ "parseurl": "^1.3.3",
+ "path-to-regexp": "^8.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ }
+ },
+ "node_modules/safe-buffer": {
+ "version": "5.2.1",
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+ "funding": [
+ {
+ "type": "github",
+ "url": "https://github.com/sponsors/feross"
+ },
+ {
+ "type": "patreon",
+ "url": "https://www.patreon.com/feross"
+ },
+ {
+ "type": "consulting",
+ "url": "https://feross.org/support"
+ }
+ ],
+ "license": "MIT"
+ },
+ "node_modules/safer-buffer": {
+ "version": "2.1.2",
+ "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+ "license": "MIT"
+ },
+ "node_modules/send": {
+ "version": "1.2.1",
+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz",
+ "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==",
+ "license": "MIT",
+ "dependencies": {
+ "debug": "^4.4.3",
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "etag": "^1.8.1",
+ "fresh": "^2.0.0",
+ "http-errors": "^2.0.1",
+ "mime-types": "^3.0.2",
+ "ms": "^2.1.3",
+ "on-finished": "^2.4.1",
+ "range-parser": "^1.2.1",
+ "statuses": "^2.0.2"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/serve-static": {
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz",
+ "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==",
+ "license": "MIT",
+ "dependencies": {
+ "encodeurl": "^2.0.0",
+ "escape-html": "^1.0.3",
+ "parseurl": "^1.3.3",
+ "send": "^1.2.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/setprototypeof": {
+ "version": "1.2.0",
+ "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
+ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==",
+ "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==",
+ "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==",
+ "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",
+ "integrity": "sha512-6x6dK6zJdpTzF4sQeNYxwtvBzf6Eg4GtlesS94HOvTudUeyK2WXAaIfmDgsyslYrRBeFIlsi54AYsFGUuhmvrQ==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4",
+ "side-channel-list": "^1.0.1",
+ "side-channel-map": "^1.0.1",
+ "side-channel-weakmap": "^1.0.2"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-list": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.1.tgz",
+ "integrity": "sha512-mjn/0bi/oUURjc5Xl7IaWi/OJJJumuoJFQJfDDyO46+hBWsfaVM65TBHq2eoZBhzl9EchxOijpkbRC8SVBQU0w==",
+ "license": "MIT",
+ "dependencies": {
+ "es-errors": "^1.3.0",
+ "object-inspect": "^1.13.4"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-map": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz",
+ "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "node_modules/side-channel-weakmap": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz",
+ "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==",
+ "license": "MIT",
+ "dependencies": {
+ "call-bound": "^1.0.2",
+ "es-errors": "^1.3.0",
+ "get-intrinsic": "^1.2.5",
+ "object-inspect": "^1.13.3",
+ "side-channel-map": "^1.0.1"
+ },
+ "engines": {
+ "node": ">= 0.4"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/ljharb"
+ }
+ },
+ "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==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=14"
+ },
+ "funding": {
+ "url": "https://github.com/sponsors/isaacs"
+ }
+ },
+ "node_modules/statuses": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz",
+ "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/stream-events": {
+ "version": "1.0.5",
+ "resolved": "https://registry.npmjs.org/stream-events/-/stream-events-1.0.5.tgz",
+ "integrity": "sha512-E1GUzBSgvct8Jsb3v2X15pjzN1tYebtbLaMg+eBOUOAxgbLoSbT2NS91ckc5lJD1KfLjId+jXJRgo0qnV5Nerg==",
+ "license": "MIT",
+ "dependencies": {
+ "stubs": "^3.0.0"
+ }
+ },
+ "node_modules/stream-shift": {
+ "version": "1.0.3",
+ "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz",
+ "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==",
+ "license": "MIT"
+ },
+ "node_modules/string_decoder": {
+ "version": "1.3.0",
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+ "license": "MIT",
+ "dependencies": {
+ "safe-buffer": "~5.2.0"
+ }
+ },
+ "node_modules/string-width": {
+ "version": "4.2.3",
+ "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz",
+ "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==",
+ "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/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==",
+ "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",
+ "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==",
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "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==",
+ "license": "MIT",
+ "dependencies": {
+ "ansi-regex": "^5.0.1"
+ },
+ "engines": {
+ "node": ">=8"
+ }
+ },
+ "node_modules/stubs": {
+ "version": "3.0.0",
+ "resolved": "https://registry.npmjs.org/stubs/-/stubs-3.0.0.tgz",
+ "integrity": "sha512-PdHt7hHUJKxvTCgbKX9C1V/ftOcjJQgz8BZwNfV5c4B6dcGqlpelTbJ999jBGZ2jYiPAwcX5dP6oBwVlBlUbxw==",
+ "license": "MIT"
+ },
+ "node_modules/teeny-request": {
+ "version": "11.0.1",
+ "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-11.0.1.tgz",
+ "integrity": "sha512-bNr5j2YjSdajgCVsp+8JVjRf1uHIbpNISLeKp/7V1NnVMX3Gh6H/kECNGlm2Q3I68ACODQ0iv6aZ3Rvm8WgLGA==",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "http-proxy-agent": "^7.0.0",
+ "https-proxy-agent": "^7.0.1",
+ "node-fetch": "^3.3.2",
+ "stream-events": "^1.0.5"
+ },
+ "engines": {
+ "node": ">=22"
+ }
+ },
+ "node_modules/toidentifier": {
+ "version": "1.0.1",
+ "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
+ "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.6"
+ }
+ },
+ "node_modules/type-is": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.1.0.tgz",
+ "integrity": "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA==",
+ "license": "MIT",
+ "dependencies": {
+ "content-type": "^2.0.0",
+ "media-typer": "^1.1.0",
+ "mime-types": "^3.0.0"
+ },
+ "engines": {
+ "node": ">= 18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/type-is/node_modules/content-type": {
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/content-type/-/content-type-2.1.0.tgz",
+ "integrity": "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=18"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/express"
+ }
+ },
+ "node_modules/undici-types": {
+ "version": "8.9.0",
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz",
+ "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==",
+ "license": "MIT"
+ },
+ "node_modules/unpipe": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
+ "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "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/vary": {
+ "version": "1.1.2",
+ "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
+ "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 0.8"
+ }
+ },
+ "node_modules/web-streams-polyfill": {
+ "version": "3.3.3",
+ "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz",
+ "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==",
+ "license": "MIT",
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/which": {
+ "version": "2.0.2",
+ "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
+ "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
+ "license": "ISC",
+ "dependencies": {
+ "isexe": "^2.0.0"
+ },
+ "bin": {
+ "node-which": "bin/node-which"
+ },
+ "engines": {
+ "node": ">= 8"
+ }
+ },
+ "node_modules/wrap-ansi": {
+ "version": "7.0.0",
+ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
+ "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
+ "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-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==",
+ "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/wrappy": {
+ "version": "1.0.2",
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+ "license": "ISC"
+ },
+ "node_modules/ws": {
+ "version": "8.22.0",
+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.22.0.tgz",
+ "integrity": "sha512-Ydggc987+RO0AnWtZ/7Wq9FtNvcrL1b/RO0ud9mWjUPgDrsAAwQSF51sm2hm1XofbU/4jkpGEsLFsZZxU+1DOg==",
+ "license": "MIT",
+ "engines": {
+ "node": ">=10.0.0"
+ },
+ "peerDependencies": {
+ "bufferutil": "^4.0.1",
+ "utf-8-validate": ">=5.0.2"
+ },
+ "peerDependenciesMeta": {
+ "bufferutil": {
+ "optional": true
+ },
+ "utf-8-validate": {
+ "optional": true
+ }
+ }
+ },
+ "node_modules/y18n": {
+ "version": "5.0.8",
+ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz",
+ "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=10"
+ }
+ },
+ "node_modules/yargs": {
+ "version": "17.7.3",
+ "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.3.tgz",
+ "integrity": "sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==",
+ "license": "MIT",
+ "dependencies": {
+ "cliui": "^8.0.1",
+ "escalade": "^3.1.1",
+ "get-caller-file": "^2.0.5",
+ "require-directory": "^2.1.1",
+ "string-width": "^4.2.3",
+ "y18n": "^5.0.5",
+ "yargs-parser": "^21.1.1"
+ },
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/yargs-parser": {
+ "version": "21.1.1",
+ "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz",
+ "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==",
+ "license": "ISC",
+ "engines": {
+ "node": ">=12"
+ }
+ },
+ "node_modules/zod": {
+ "version": "3.25.76",
+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
+ "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
+ "license": "MIT",
+ "funding": {
+ "url": "https://github.com/sponsors/colinhacks"
+ }
+ },
+ "node_modules/zod-to-json-schema": {
+ "version": "3.25.2",
+ "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.25.2.tgz",
+ "integrity": "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA==",
+ "license": "ISC",
+ "peerDependencies": {
+ "zod": "^3.25.28 || ^4"
+ }
+ }
+ }
+}
diff --git a/plugins/ruflo-x-gateway/package.json b/plugins/ruflo-x-gateway/package.json
index 8d2ffed431..37a71f2a87 100644
--- a/plugins/ruflo-x-gateway/package.json
+++ b/plugins/ruflo-x-gateway/package.json
@@ -1,6 +1,6 @@
{
"name": "@ruflo/x-gateway",
- "version": "0.7.3",
+ "version": "0.8.0",
"private": true,
"type": "module",
"description": "x.ruv.io gateway β€” MCP server for ruflo swarm federation + claims over a signed, membership-gated Nostr relay. Exposes /mcp tools and ruv:// resources.",
@@ -14,10 +14,11 @@
"jose": "^6.2.12",
"nostr-tools": "^2.7.0",
"ws": "^8.18.0",
- "zod": "^3.23.0"
+ "zod": "^3.23.0",
+ "@google-cloud/firestore": "^9.2.0"
},
"engines": {
- "node": ">=20"
+ "node": ">=22"
},
"license": "MIT"
}
diff --git a/plugins/ruflo-x-gateway/src/nostr-federation.mjs b/plugins/ruflo-x-gateway/src/nostr-federation.mjs
index 99083215cd..c7b9daa8d6 100644
--- a/plugins/ruflo-x-gateway/src/nostr-federation.mjs
+++ b/plugins/ruflo-x-gateway/src/nostr-federation.mjs
@@ -32,19 +32,19 @@ export function loadIdentity(keyFile) {
// relay's reason (e.g. "restricted: not a relay member").
export function connectAuthed(relayUrl, sk, { timeoutMs = 15000 } = {}) {
return new Promise((resolve, reject) => {
- const ws = new WebSocket(relayUrl, { perMessageDeflate: false });
- let settled = false;
+ const ws = new WebSocket(relayUrl, { perMessageDeflate: false, maxPayload: 256 * 1024 });
+ let settled = false, authId;
const done = (fn, arg) => { if (settled) return; settled = true; fn(arg); };
const timer = setTimeout(() => { try { ws.close(); } catch {} done(reject, new Error('auth timeout')); }, timeoutMs);
ws.on('message', (data) => {
let m; try { m = JSON.parse(data.toString()); } catch { return; }
- if (m[0] === 'AUTH' && typeof m[1] === 'string') {
+ if (Array.isArray(m) && m[0] === 'AUTH' && typeof m[1] === 'string' && m[1].length <= 1024 && !authId) {
const ev = finalizeEvent({ kind: 22242, created_at: Math.floor(Date.now() / 1000),
tags: [['relay', relayUrl], ['challenge', m[1]]], content: '' }, sk);
- ws.send(JSON.stringify(['AUTH', ev]));
- } else if (m[0] === 'OK') {
+ authId = ev.id; ws.send(JSON.stringify(['AUTH', ev]));
+ } else if (Array.isArray(m) && m[0] === 'OK' && authId && m[1] === authId) {
clearTimeout(timer);
- if (m[2]) done(resolve, ws);
+ if (m[2] === true) done(resolve, ws);
else { try { ws.close(); } catch {} done(reject, new Error(m[3] || 'auth rejected')); }
}
});
diff --git a/plugins/ruflo-x-gateway/src/onboarding.mjs b/plugins/ruflo-x-gateway/src/onboarding.mjs
index 522b5f3a05..2ae6fc4b13 100644
--- a/plugins/ruflo-x-gateway/src/onboarding.mjs
+++ b/plugins/ruflo-x-gateway/src/onboarding.mjs
@@ -13,7 +13,7 @@
* an admin token in a browser, inverted. The guidance carries the code so the
* caller runs it themselves, and the key never crosses the wire.
*/
-export function onboardingGuide({ relay, httpBase, gatewayPubkey, defaultChannels }) {
+export function onboardingGuide({ relay, httpBase, gatewayPubkey, defaultChannels, registration }) {
return {
readThisFirst:
'There are two identities on this service, and almost every confusion comes from mixing them up. ' +
@@ -33,10 +33,11 @@ export function onboardingGuide({ relay, httpBase, gatewayPubkey, defaultChannel
},
},
+ registration: registration || { enabled: false },
steps: [
- { n: 1, do: 'Get an invite code from someone already in. It is a bearer secret β€” anyone holding it can join, so it goes in a direct message, never a channel or a public page.' },
- { n: 2, do: 'Generate your keypair locally. Easiest path: `npx ruflo federation join --code <v2.…>`, which generates the key, stores it at ~/.ruflo/nostr.key with 0600, redeems the invite and verifies membership in one step.' },
- { n: 3, do: `In a browser or any other client, do the same three things yourself: generate, redeem at ${httpBase}/api/invites/claim with a NIP-98 signature, then authenticate over NIP-42.`, code: browserSnippet(relay, httpBase) },
+ { n: 1, do: registration?.enabled ? 'Run `npx ruflo federation join` with a client that supports public registration. No invite code is needed. Your local key proves ownership; public admission grants only member participation.' : 'Get an invite code from someone already in. It is a bearer secret β€” anyone holding it can join, so it goes in a direct message, never a channel or a public page.' },
+ { n: 2, do: registration?.enabled ? 'The command reuses your local key or creates one at ~/.ruflo/nostr.key with 0600 permissions, registers it and verifies relay authentication. Rate limits may require trying later.' : 'Generate your keypair locally. Easiest path: `npx ruflo federation join --code <v2.…>`, which generates the key, stores it at ~/.ruflo/nostr.key with 0600, redeems the invite and verifies membership in one step.' },
+ { n: 3, do: `In a local client, sign a NIP-98 request to ${registration?.enabled ? registration.endpoint : httpBase + '/api/invites/claim'}, then authenticate over NIP-42.`, code: browserSnippet(relay, httpBase, registration) },
{ n: 4, do: 'Publish. Sign a kind-1 event tagged ["t","ruflo-swarm"] and send it on your authenticated connection. Add ["c","pub:<name>"] to scope it to a channel.' },
{ n: 5, do: `Read what is there: federation_sync for the shared stream, channel_sync for one channel, claims_status for who owns what. Those are open β€” no token.`, channels: defaultChannels },
],
@@ -57,7 +58,7 @@ export function onboardingGuide({ relay, httpBase, gatewayPubkey, defaultChannel
}
/** Client-side key generation. Runs in the caller's browser or Node β€” not here. */
-function browserSnippet(relay, httpBase) {
+function browserSnippet(relay, httpBase, registration) {
return [
"import { generateSecretKey, getPublicKey, finalizeEvent } from 'nostr-tools/pure';",
"import { sha256 } from '@noble/hashes/sha256';",
@@ -66,22 +67,24 @@ function browserSnippet(relay, httpBase) {
'const sk = generateSecretKey();',
'const pubkey = getPublicKey(sk);',
'',
- '// 2. Redeem the invite with a NIP-98 signature proving you hold this key.',
- `const url = '${httpBase}/api/invites/claim';`,
- "const body = JSON.stringify({ code });",
+ registration?.enabled ? '// 2. Register with a NIP-98 signature proving you hold this key.' : '// 2. Redeem the invite with a NIP-98 signature proving you hold this key.',
+ `const url = '${registration?.enabled ? registration.endpoint : httpBase + '/api/invites/claim'}';`,
+ registration?.enabled ? "const body = '{}';" : "const body = JSON.stringify({ code });",
"const payloadHash = [...new Uint8Array(sha256(new TextEncoder().encode(body)))].map(b=>b.toString(16).padStart(2,'0')).join('');",
"const auth = finalizeEvent({ kind: 27235, created_at: Math.floor(Date.now()/1000),",
" tags: [['u', url], ['method','POST'], ['payload', payloadHash]], content: '' }, sk);",
- "await fetch(url, { method:'POST', headers:{ 'content-type':'application/json',",
+ "const joined = await fetch(url, { method:'POST', headers:{ 'content-type':'application/json',",
" authorization: 'Nostr ' + btoa(JSON.stringify(auth)) }, body });",
+ "if (!joined.ok) throw new Error('Registration refused: ' + joined.status);",
'',
'// 3. Authenticate over NIP-42, then publish as yourself.',
`const ws = new WebSocket('${relay}');`,
+ "let authId, published = false;",
"ws.onmessage = (m) => { const msg = JSON.parse(m.data);",
- " if (msg[0] === 'AUTH') ws.send(JSON.stringify(['AUTH', finalizeEvent({ kind: 22242,",
- ` created_at: Math.floor(Date.now()/1000), tags: [['relay','${relay}'], ['challenge', msg[1]]], content: '' }, sk)]));`,
- " if (msg[0] === 'OK') ws.send(JSON.stringify(['EVENT', finalizeEvent({ kind: 1,",
+ " if (msg[0] === 'AUTH') { const ev = finalizeEvent({ kind: 22242,",
+ ` created_at: Math.floor(Date.now()/1000), tags: [['relay','${relay}'], ['challenge', msg[1]]], content: '' }, sk); authId = ev.id; ws.send(JSON.stringify(['AUTH', ev])); }`,
+ " if (msg[0] === 'OK' && msg[1] === authId && msg[2] === true && !published) { published = true; ws.send(JSON.stringify(['EVENT', finalizeEvent({ kind: 1,",
" created_at: Math.floor(Date.now()/1000), tags: [['t','ruflo-swarm'],['k','Status']],",
- " content: JSON.stringify({ type:'Status', note:'hello' }) }, sk)])); };",
+ " content: JSON.stringify({ type:'Status', note:'hello' }) }, sk)])); } };",
].join('\n');
}
diff --git a/plugins/ruflo-x-gateway/src/registration.mjs b/plugins/ruflo-x-gateway/src/registration.mjs
new file mode 100644
index 0000000000..e921a31875
--- /dev/null
+++ b/plugins/ruflo-x-gateway/src/registration.mjs
@@ -0,0 +1,130 @@
+// Public member enrollment. Durable reservations precede every relay side effect.
+import { createHash, createHmac } from 'node:crypto';
+import { isIP } from 'node:net';
+import { verifyEvent } from 'nostr-tools/pure';
+import { Firestore } from '@google-cloud/firestore';
+
+export class RegistrationError extends Error {
+ constructor(status, message) { super(message); this.status = status; }
+}
+const fail = (status, message) => { throw new RegistrationError(status, message); };
+export const REGISTRATION_LIMITS = Object.freeze({ ipHourly: 3, daily: 100, maxConcurrent: 4 });
+
+export function registrationIp(req, trustedProxyHops = 0) {
+ const raw = req.headers['x-forwarded-for'] || '';
+ if (typeof raw !== 'string' || raw.length > 1024) fail(400, 'invalid forwarding chain');
+ const chain = [...raw.split(',').map(x => x.trim()).filter(Boolean), req.socket.remoteAddress];
+ const address = chain[chain.length - 1 - trustedProxyHops];
+ if (!address || !isIP(address)) fail(400, 'client address unavailable');
+ if (address.startsWith('::ffff:') && isIP(address.slice(7)) === 4) return address.slice(7);
+ // URL canonicalization removes alternate IPv6 spellings. Limit IPv6 by /64
+ // so rotating interface identifiers does not create a fresh quota.
+ if (isIP(address) === 6) {
+ const canonical = new URL(`http://[${address}]/`).hostname.slice(1, -1);
+ const [left, right = ''] = canonical.split('::');
+ const a = left ? left.split(':') : [], b = right ? right.split(':') : [];
+ return [...a, ...Array(8 - a.length - b.length).fill('0'), ...b].slice(0, 4).join(':') + '::/64';
+ }
+ return address;
+}
+
+export function verifyRegistration(header, body, url, now = Date.now()) {
+ if (body !== '{}') fail(400, 'registration body must be {}');
+ if (typeof header !== 'string' || header.length > 4096 || !/^Nostr [A-Za-z0-9+/]+={0,2}$/.test(header)) fail(401, 'signed NIP-98 authorization required');
+ let event;
+ try { event = JSON.parse(Buffer.from(header.slice(6), 'base64').toString('utf8')); } catch { fail(401, 'invalid authorization'); }
+ const seconds = Math.floor(now / 1000);
+ const hash = createHash('sha256').update(body).digest('hex');
+ const expected = new Map([['u', url], ['method', 'POST'], ['payload', hash]]);
+ if (!event || event.kind !== 27235 || event.content !== '' || !Number.isSafeInteger(event.created_at)
+ || event.created_at < seconds - 60 || event.created_at > seconds + 5
+ || !Array.isArray(event.tags) || event.tags.length !== 3) fail(401, 'invalid or expired authorization');
+ for (const tag of event.tags) {
+ if (!Array.isArray(tag) || tag.length !== 2 || !expected.has(tag[0]) || expected.get(tag[0]) !== tag[1]) fail(401, 'authorization binding mismatch');
+ expected.delete(tag[0]);
+ }
+ try { if (!verifyEvent(event)) fail(401, 'invalid signature'); } catch { fail(401, 'invalid signature'); }
+ return event;
+}
+
+// Firestore transactions serialize reservations across instances and restarts.
+// Control and key documents are permanent; expired counter documents can use TTL.
+export function createRegistrationStore(db, collection = 'rufloRegistration') {
+ const ref = id => db.collection(collection).doc(id);
+ return {
+ async reserve({ pubkey, eventId, ipHash, now, limits }) {
+ const hour = Math.floor(now / 3600000), day = Math.floor(now / 86400000);
+ return db.runTransaction(async tx => {
+ const controlRef = ref('control'), keyRef = ref(`key_${pubkey}`);
+ const ipRef = ref(`ip_${hour}_${ipHash}`), dayRef = ref(`day_${day}`);
+ const [control, key, ip, global] = await Promise.all([controlRef, keyRef, ipRef, dayRef].map(r => tx.get(r)));
+ const policy = control.data();
+ if (policy?.enabled !== true || policy?.revocationsImported !== true) fail(503, 'registration paused');
+ const previous = key.data();
+ if (previous?.status === 'blocked') fail(403, 'registration denied');
+ if (previous?.eventId === eventId) fail(409, 'authorization already used');
+ if (previous?.status === 'admitted') return { existing: true };
+ if (previous) fail(409, 'admission pending operator reconciliation');
+ if ((ip.data()?.count || 0) >= limits.ipHourly || (global.data()?.count || 0) >= limits.daily) fail(429, 'registration limit reached; try later');
+ tx.set(keyRef, { status: 'pending', eventId, createdAt: new Date(now) });
+ tx.set(ipRef, { count: (ip.data()?.count || 0) + 1, expiresAt: new Date((hour + 2) * 3600000) });
+ tx.set(dayRef, { count: (global.data()?.count || 0) + 1, expiresAt: new Date((day + 2) * 86400000) });
+ return { existing: false };
+ });
+ },
+ async complete(pubkey, eventId) {
+ await db.runTransaction(async tx => {
+ const keyRef = ref(`key_${pubkey}`), doc = await tx.get(keyRef);
+ if (doc.data()?.status !== 'pending' || doc.data()?.eventId !== eventId) fail(409, 'admission state changed; operator reconciliation required');
+ tx.update(keyRef, { status: 'admitted' });
+ });
+ },
+ };
+}
+
+export function createRegistration({ enabled = false, publicUrl, admit, store, ipSalt, checkAllowed = async () => {}, trustedProxyHops = 0,
+ now = Date.now, limits = REGISTRATION_LIMITS } = {}) {
+ if (!Number.isInteger(trustedProxyHops) || trustedProxyHops < 0 || trustedProxyHops > 3) throw new Error('registration proxy hops must be 0..3');
+ if (enabled && (!store || typeof ipSalt !== 'string' || ipSalt.length < 32)) throw new Error('public registration requires durable store and stable IP salt');
+ const endpoint = `${publicUrl}/api/registration`;
+ let inFlight = 0, tokens = 30, last = now();
+ return {
+ info: () => ({ enabled, endpoint, role: 'member', authentication: 'NIP-98', limits }),
+ async register(req, body) {
+ if (!enabled) fail(503, 'registration paused');
+ // Cheap instance-wide shedding before signature verification or database work.
+ const time = now(); tokens = Math.min(30, tokens + (time - last) / 1000); last = time;
+ if (tokens < 1 || inFlight >= limits.maxConcurrent) fail(429, 'registration busy; try later');
+ tokens--; inFlight++;
+ try {
+ const ip = registrationIp(req, trustedProxyHops);
+ const event = verifyRegistration(req.headers.authorization, body, endpoint, time);
+ const ipHash = createHmac('sha256', ipSalt).update(ip).digest('hex');
+ const reservation = await store.reserve({ pubkey: event.pubkey, eventId: event.id, ipHash, now: time, limits });
+ if (!reservation.existing) {
+ // Never accept a requested role, target key or relay from the caller.
+ await checkAllowed(event.pubkey);
+ await admit(event.pubkey, 'member');
+ await store.complete(event.pubkey, event.id);
+ }
+ return { ok: true, pubkey: event.pubkey, role: 'member', alreadyRegistered: reservation.existing,
+ membershipVerified: false, next: 'Authenticate to the relay with this key to verify current membership.' };
+ } catch (e) {
+ if (e instanceof RegistrationError) throw e;
+ // Do not echo relay/SDK errors or credentials. A timeout may have admitted
+ // the key: keep the reservation so retry cannot undo a later revocation.
+ fail(503, 'admission unavailable; verify relay membership before retrying');
+ } finally { inFlight--; }
+ },
+ };
+}
+
+export function registrationFromEnv({ publicUrl, admit, checkAllowed }) {
+ const enabled = process.env.RUFLO_OPEN_REGISTRATION === 'true';
+ const projectId = process.env.RUFLO_REGISTRATION_PROJECT;
+ if (enabled && !projectId) throw new Error('RUFLO_REGISTRATION_PROJECT required');
+ return createRegistration({ enabled, publicUrl, admit, checkAllowed,
+ store: enabled ? createRegistrationStore(new Firestore({ projectId, databaseId: process.env.RUFLO_REGISTRATION_DATABASE || '(default)' })) : undefined,
+ ipSalt: process.env.RUFLO_REGISTRATION_IP_SALT,
+ trustedProxyHops: Number(process.env.RUFLO_REGISTRATION_PROXY_HOPS || 0) });
+}
diff --git a/plugins/ruflo-x-gateway/src/relay-admin.mjs b/plugins/ruflo-x-gateway/src/relay-admin.mjs
index 7540255ca0..07ace02eee 100644
--- a/plugins/ruflo-x-gateway/src/relay-admin.mjs
+++ b/plugins/ruflo-x-gateway/src/relay-admin.mjs
@@ -1,9 +1,9 @@
import { finalizeEvent } from 'nostr-tools/pure';
-import { createHash } from 'node:crypto';
+import { createHash, randomUUID } from 'node:crypto';
import { connectAuthed } from './nostr-federation.mjs';
function nip98(sk, url, method, body) {
const ev = finalizeEvent({ kind: 27235, created_at: Math.floor(Date.now() / 1000),
- tags: [['u', url], ['method', method], ...(body ? [['payload', createHash('sha256').update(body).digest('hex')]] : [])], content: '' }, sk);
+ tags: [['u', url], ['method', method], ['nonce', randomUUID()], ...(body ? [['payload', createHash('sha256').update(body).digest('hex')]] : [])], content: '' }, sk);
return 'Nostr ' + Buffer.from(JSON.stringify(ev)).toString('base64');
}
// Mint a v2 invite (caller must be relay admin/owner). Returns {code, expires_at, max_uses}.
@@ -19,8 +19,31 @@ export async function admitMember(relayUrl, sk, pubkey, role = 'member') {
const ws = await connectAuthed(relayUrl, sk);
const ev = finalizeEvent({ kind: 9030, created_at: Math.floor(Date.now() / 1000), tags: [['p', pubkey], ['role', role]], content: '' }, sk);
return new Promise((resolve, reject) => {
- const t = setTimeout(() => { try { ws.close(); } catch {} reject(new Error('admit timeout')); }, 15000);
- ws.on('message', (d) => { const m = JSON.parse(d.toString()); if (m[0] === 'OK' && m[1] === ev.id) { clearTimeout(t); try { ws.close(); } catch {} m[2] ? resolve({ pubkey, role }) : reject(new Error(m[3] || 'admit rejected')); } });
+ let settled = false;
+ const finish = (error) => {
+ if (settled) return; settled = true; clearTimeout(timer);
+ try { ws.close(); } catch {}
+ error ? reject(error) : resolve({ pubkey, role });
+ };
+ const timer = setTimeout(() => finish(new Error('admit timeout')), 15000);
+ ws.on('message', d => {
+ let m; try { m = JSON.parse(d.toString()); } catch { return; }
+ if (Array.isArray(m) && m[0] === 'OK' && m[1] === ev.id) finish(m[2] === true ? null : new Error('admit rejected'));
+ });
+ ws.on('error', () => finish(new Error('admit connection error')));
+ ws.on('close', () => finish(new Error('closed before admission acknowledgment')));
ws.send(JSON.stringify(['EVENT', ev]));
});
}
+
+// Read live durable restrictions before each new automatic grant. The relay
+// remains authoritative for bans created after the initial import as well.
+export async function isMemberBanned(httpBase, sk, pubkey) {
+ const url = `${httpBase}/moderation/restricted`;
+ const r = await fetch(url, { headers: { Authorization: nip98(sk, url, 'GET') },
+ redirect: 'error', signal: AbortSignal.timeout(10000) });
+ if (!r.ok) throw new Error('relay restrictions unavailable');
+ const rows = await r.json();
+ if (!Array.isArray(rows) || rows.some(x => !x || typeof x.pubkey !== 'string' || typeof x.banned !== 'boolean')) throw new Error('invalid relay restrictions');
+ return rows.some(x => x.pubkey === pubkey && x.banned);
+}
diff --git a/plugins/ruflo-x-gateway/src/server.mjs b/plugins/ruflo-x-gateway/src/server.mjs
index a08f9c806a..e562775585 100644
--- a/plugins/ruflo-x-gateway/src/server.mjs
+++ b/plugins/ruflo-x-gateway/src/server.mjs
@@ -19,7 +19,7 @@ import { loadIdentity, publish, fetchRecent, fetchManyOn, cached, publishTagged,
import { publicChannelId, channelTags, isPrivateChannel, CHANNEL_ID_RE, DEFAULT_CHANNELS } from './channels.mjs';
import { reduceClaims } from './claims.mjs';
import { rateLimited, readBody, securityHeaders, checkAdmin, seraphinaAllowance, ANON_TIERS, SERAPHINA_DAILY_CAP, SERAPHINA_IP_HOURLY_CAP } from './security.mjs';
-import { mintInvite, admitMember } from './relay-admin.mjs';
+import { mintInvite, admitMember, isMemberBanned } from './relay-admin.mjs';
import { attachWsProxy } from './ws-proxy.mjs';
import { onboardingGuide } from './onboarding.mjs';
import { askSeraphina } from './seraphina.mjs';
@@ -27,6 +27,7 @@ import { privacyPage, termsPage, supportPage } from './public-pages.mjs';
import { fenceUntrusted, untrustedToolResult } from './untrusted.mjs';
import { protectedResourceMetadata, challengeHeader, verifyAccessToken, hasScope, SCOPE_READ, SCOPE_PUBLISH } from './oauth.mjs';
import { createHash } from 'node:crypto';
+import { registrationFromEnv, RegistrationError } from './registration.mjs';
// Static public pages the OpenAI app review requires. Rendered once at module
// load β€” they have no per-request state.
@@ -47,7 +48,7 @@ const PUBLIC_PAGES = {
// truth; read it rather than keeping a fourth copy in sync by hand.
export const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
-export function createGateway({ relay, keyFile, port } = {}) {
+export function createGateway({ relay, keyFile, port, registration } = {}) {
const RELAY = relay || process.env.RUFLO_RELAY_URL || 'wss://relay.ruv.io';
const HTTP_BASE = RELAY.replace(/^wss:/, 'https:').replace(/^ws:/, 'http:');
// Pre-0.3.2 clients pinned the raw Cloud Run host; it stays routable, but relay.ruv.io is canonical.
@@ -60,6 +61,9 @@ export function createGateway({ relay, keyFile, port } = {}) {
const OAUTH_JWKS = process.env.RUFLO_OAUTH_JWKS_URI || `${OAUTH_ISSUER}/.well-known/jwks.json`;
const OAUTH_CLIENT_ID = (process.env.RUFLO_OAUTH_CLIENT_ID || '').trim();
const PUBLIC_URL = (process.env.RUFLO_PUBLIC_URL || 'https://x.ruv.io').replace(/\/$/, '');
+ const enrollment = registration || registrationFromEnv({ publicUrl: PUBLIC_URL,
+ admit: (pk, role) => admitMember(RELAY, sk, pk, role),
+ checkAllowed: async pk => { if (await isMemberBanned(HTTP_BASE, sk, pk)) throw new RegistrationError(403, 'registration denied'); } });
const OAUTH_ENABLED = OAUTH_CLIENT_ID.length > 0;
if (!OAUTH_ENABLED && String(process.env.RUFLO_OAUTH_REQUIRE || '') === 'true') {
throw new Error('RUFLO_OAUTH_REQUIRE=true needs RUFLO_OAUTH_CLIENT_ID β€” refusing to enforce OAuth without an audience to bind to');
@@ -278,7 +282,7 @@ export function createGateway({ relay, keyFile, port } = {}) {
"How to join and publish as yourself, and which identity signs what. Open β€” no token. Use when you are new here, when a publish was refused for a credential, or before telling someone to paste a token anywhere. Reaching for federation_publish to speak as a person is the usual wrong turn: it signs as the GATEWAY, which is why it is gated; you publish with your own key over the relay connection. This never generates or asks for a secret key β€” it returns the code for you to run locally, because a service that mints your key has seen it.",
{},
READ('Joining guide'),
- async () => text(onboardingGuide({ relay: RELAY, httpBase: HTTP_BASE, gatewayPubkey: pubkey, defaultChannels: DEFAULT_CHANNELS })));
+ async () => text(onboardingGuide({ relay: RELAY, httpBase: HTTP_BASE, gatewayPubkey: pubkey, defaultChannels: DEFAULT_CHANNELS, registration: enrollment.info() })));
// ---- Seraphina: swarm queen guidance (admin-gated: it spends meta-llm budget) ----
mcp.tool('seraphina_guidance', 'Ask Seraphina for guidance on a goal. The admin token is OPTIONAL: anonymous and OAuth callers use a shared budget, while an operator token lifts the cap and unlocks high-cost tiers.',
// The OPTIONAL adminToken is still a secret-bearing field, so it leaves the
@@ -323,7 +327,7 @@ export function createGateway({ relay, keyFile, port } = {}) {
// ---- ruv:// resources (open) ----
mcp.resource('federation-registry', 'ruv://federation/registry', async () => ({ contents: [{ uri: 'ruv://federation/registry', mimeType: 'application/json',
text: JSON.stringify({ relay: RELAY, legacyRelay: LEGACY_RELAY, httpBase: HTTP_BASE, gatewayPubkey: pubkey, swarmTag: 'ruflo-swarm',
- join: ['1. generate a Nostr keypair (secp256k1)', `2. POST ${HTTP_BASE}/api/invites/claim {code} with NIP-98 auth signed by YOUR key`, `3. connect wss://x.ruv.io (proxied) or ${RELAY}; answer the NIP-42 AUTH challenge signing tags [["relay","${RELAY}"],["challenge",…]] β€” the relay tag MUST be the canonical relay URL, not x.ruv.io`, '4. publish kind-1 events tagged ["t","ruflo-swarm"] with JSON content'],
+ registration: enrollment.info(), join: ['1. generate a Nostr keypair (secp256k1)', enrollment.info().enabled ? `2. POST ${PUBLIC_URL}/api/registration {} with NIP-98 auth signed by YOUR key (no invite)` : `2. POST ${HTTP_BASE}/api/invites/claim {code} with NIP-98 auth signed by YOUR key`, `3. connect wss://x.ruv.io (proxied) or ${RELAY}; answer the NIP-42 AUTH challenge signing tags [["relay","${RELAY}"],["challenge",…]] β€” the relay tag MUST be the canonical relay URL, not x.ruv.io`, '4. publish kind-1 events tagged ["t","ruflo-swarm"] with JSON content'],
onboarding: 'ruv://federation/onboarding β€” the full guide: which identity signs what, client-side key generation, and the gotchas. Start there.',
defaultChannels: DEFAULT_CHANNELS,
channels: 'Read one with channel_sync, or `ruflo federation channel --action read --channel pub:<name>`. Public channels are plaintext and readable by any member; private ones are prv:<hex> and the gateway cannot decrypt them.',
@@ -332,7 +336,7 @@ export function createGateway({ relay, keyFile, port } = {}) {
mcp.resource('claims-board', 'ruv://claims/board', async () => { const ev = await cached('claims', 5000, () => fetchRecent(RELAY, sk, { sinceSeconds: 86400, limit: 500 })); return { contents: [{ uri: 'ruv://claims/board', mimeType: 'text/plain', text: fenceUntrusted(reduceClaims(ev.filter((e) => String(e.type).startsWith('Claim'))), { relay: RELAY }) }] }; });
mcp.resource('swarm-channels', 'ruv://swarm/channels', async () => { const c = await cached('channels', 5000, () => listChannels(RELAY, sk, { sinceSeconds: 86400, limit: 500 })); return { contents: [{ uri: 'ruv://swarm/channels', mimeType: 'text/plain', text: fenceUntrusted(c, { relay: RELAY }) }] }; });
mcp.resource('federation-onboarding', 'ruv://federation/onboarding', async () => ({ contents: [{ uri: 'ruv://federation/onboarding', mimeType: 'application/json',
- text: JSON.stringify(onboardingGuide({ relay: RELAY, httpBase: HTTP_BASE, gatewayPubkey: pubkey, defaultChannels: DEFAULT_CHANNELS })) }] }));
+ text: JSON.stringify(onboardingGuide({ relay: RELAY, httpBase: HTTP_BASE, gatewayPubkey: pubkey, defaultChannels: DEFAULT_CHANNELS, registration: enrollment.info() })) }] }));
return mcp;
}
@@ -377,10 +381,24 @@ export function createGateway({ relay, keyFile, port } = {}) {
issuer: OAUTH_ISSUER,
})));
}
+ if (url.pathname === '/api/registration') {
+ if (url.search) return res.writeHead(400).end('query parameters are not accepted');
+ if (req.method === 'GET') return res.writeHead(200, { 'content-type': 'application/json' }).end(JSON.stringify(enrollment.info()));
+ if (req.method !== 'POST') return res.writeHead(405, { allow: 'GET, POST' }).end();
+ try {
+ const body = await readBody(req, 1024);
+ const result = await enrollment.register(req, body);
+ return res.writeHead(200, { 'content-type': 'application/json' }).end(JSON.stringify(result));
+ } catch (e) {
+ const status = e instanceof RegistrationError ? e.status : 413;
+ return res.writeHead(status, { 'content-type': 'application/json', ...(status === 429 ? { 'retry-after': '3600' } : {}) })
+ .end(JSON.stringify({ error: e instanceof RegistrationError ? e.message : 'invalid request body' }));
+ }
+ }
if (url.pathname === '/health') return res.writeHead(200).end('ok');
if (url.pathname === '/' && req.method === 'GET') { res.writeHead(200, { 'content-type': 'application/json' });
return res.end(JSON.stringify({ service: 'ruflo-x-gateway', version: VERSION, mcp: '/mcp', publicMcp: '/chatgpt/mcp',
- pages: { privacy: '/privacy', terms: '/terms', support: '/support' }, ws: ['/', '/relay'], relay: RELAY, canonicalRelay: RELAY, legacyRelay: LEGACY_RELAY, authNote: 'When connecting via wss://x.ruv.io, sign the NIP-42 AUTH `relay` tag with canonicalRelay (the relay verifies it strictly).', gatewayPubkey: pubkey, resources: ['ruv://federation/registry', 'ruv://federation/onboarding', 'ruv://swarm/roster', 'ruv://claims/board', 'ruv://swarm/channels'],
+ registration: enrollment.info(), pages: { privacy: '/privacy', terms: '/terms', support: '/support' }, ws: ['/', '/relay'], relay: RELAY, canonicalRelay: RELAY, legacyRelay: LEGACY_RELAY, authNote: 'When connecting via wss://x.ruv.io, sign the NIP-42 AUTH `relay` tag with canonicalRelay (the relay verifies it strictly).', gatewayPubkey: pubkey, resources: ['ruv://federation/registry', 'ruv://federation/onboarding', 'ruv://swarm/roster', 'ruv://claims/board', 'ruv://swarm/channels'],
authorization: { type: 'oauth2', issuer: OAUTH_ISSUER, clientId: OAUTH_CLIENT_ID || null,
scopes: [SCOPE_READ, SCOPE_PUBLISH], protectedResourceMetadata: prmUrl('/chatgpt/mcp') } })); }
// ---- OpenAI app-review surface ----
diff --git a/plugins/ruflo-x-gateway/test/registration.test.mjs b/plugins/ruflo-x-gateway/test/registration.test.mjs
new file mode 100644
index 0000000000..5c2d5f6640
--- /dev/null
+++ b/plugins/ruflo-x-gateway/test/registration.test.mjs
@@ -0,0 +1,205 @@
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { createHash } from 'node:crypto';
+import { mkdtempSync, rmSync } from 'node:fs';
+import { tmpdir } from 'node:os';
+import { join } from 'node:path';
+import { generateSecretKey, getPublicKey, finalizeEvent, verifyEvent } from 'nostr-tools/pure';
+import { WebSocketServer } from 'ws';
+import { createRegistration, createRegistrationStore, verifyRegistration, registrationIp } from '../src/registration.mjs';
+import { createGateway } from '../src/server.mjs';
+import { admitMember } from '../src/relay-admin.mjs';
+import { connectAuthed, publish } from '../src/nostr-federation.mjs';
+
+const endpoint = 'https://x.ruv.io/api/registration', time = 1800000000000;
+function proof(sk, { url = endpoint, body = '{}', created_at = time / 1000, tags, ...rest } = {}) {
+ const ev = finalizeEvent({ kind: 27235, created_at, content: '',
+ tags: tags || [['u', url], ['method', 'POST'], ['payload', createHash('sha256').update(body).digest('hex')]], ...rest }, sk);
+ return { ev, header: 'Nostr ' + Buffer.from(JSON.stringify(ev)).toString('base64') };
+}
+const req = (header, ip = '203.0.113.1') => ({ headers: { authorization: header }, socket: { remoteAddress: ip } });
+// Transactional test adapter, not a production storage backend. The same store
+// implementation is exercised with atomic serialization and rollback on throws.
+function database() {
+ const docs = new Map([['control', { enabled: true, revocationsImported: true }]]);
+ let tail = Promise.resolve();
+ return { docs, collection: () => ({ doc: id => id }), runTransaction(fn) {
+ const result = tail.then(async () => {
+ const next = structuredClone(docs);
+ const value = await fn({ get: async id => ({ data: () => next.get(id) }),
+ set: (id, val) => next.set(id, val), update: (id, val) => next.set(id, { ...next.get(id), ...val }) });
+ docs.clear(); for (const [k, v] of next) docs.set(k, v);
+ return value;
+ }); tail = result.catch(() => {}); return result;
+ } };
+}
+function service(extra = {}) {
+ const db = database(), admissions = [];
+ const options = { enabled: true, publicUrl: 'https://x.ruv.io', ipSalt: 'test-only-salt-'.repeat(3),
+ store: createRegistrationStore(db), admit: async (...a) => admissions.push(a), now: () => time, ...extra };
+ return { db, admissions, options, registration: createRegistration(options) };
+}
+
+test('registration verifies ownership and all exact NIP-98 bindings', () => {
+ const sk = generateSecretKey(), good = proof(sk);
+ assert.equal(verifyRegistration(good.header, '{}', endpoint, time).pubkey, getPublicKey(sk));
+ for (const changed of [{ url: 'https://attacker.test/api/registration' }, { body: '{"role":"admin"}' },
+ { kind: 1 }, { content: 'not empty' }, { created_at: time / 1000 - 61 }, { created_at: time / 1000 + 6 },
+ { tags: [['u', endpoint], ['u', endpoint], ['method', 'POST']] }]) {
+ assert.throws(() => verifyRegistration(proof(sk, changed).header, '{}', endpoint, time));
+ }
+ const forged = { ...good.ev, pubkey: getPublicKey(generateSecretKey()) };
+ assert.throws(() => verifyRegistration('Nostr ' + Buffer.from(JSON.stringify(forged)).toString('base64'), '{}', endpoint, time), /signature/);
+ for (const header of ['', 'Bearer token', 'Nostr ####', 'Nostr ' + 'A'.repeat(4096)]) assert.throws(() => verifyRegistration(header, '{}', endpoint, time));
+ assert.throws(() => verifyRegistration(good.header, '{"pubkey":"other"}', endpoint, time), /body/);
+});
+
+test('proxy trust is explicit; spoofed leftmost address never selects quota identity', () => {
+ const r = req(''); r.headers['x-forwarded-for'] = '198.51.100.99, 203.0.113.4';
+ assert.equal(registrationIp(r), '203.0.113.1');
+ assert.equal(registrationIp(r, 1), '203.0.113.4');
+ assert.equal(registrationIp(req('', '::ffff:127.0.0.1')), '127.0.0.1');
+ assert.equal(registrationIp(req('', '2001:0db8:0000:0001::1')), registrationIp(req('', '2001:db8:0:1::abcd')));
+ assert.throws(() => registrationIp({ headers: {}, socket: {} }, 1));
+ assert.throws(() => createRegistration({ trustedProxyHops: -1 }));
+});
+
+test('grants exactly the signer as member; replay and concurrent retry produce one effect', async () => {
+ const s = service(), sk = generateSecretKey(), p = proof(sk);
+ const results = await Promise.allSettled([s.registration.register(req(p.header), '{}'), s.registration.register(req(p.header), '{}')]);
+ assert.equal(results.filter(r => r.status === 'fulfilled').length, 1);
+ assert.deepEqual(s.admissions, [[getPublicKey(sk), 'member']]);
+ assert.equal(results.find(r => r.status === 'fulfilled').value.membershipVerified, false);
+ assert.equal(results.find(r => r.status === 'rejected').reason.status, 409);
+ // New process, same database: quota/replay state survives. A new signed request
+ // for the same key never re-grants membership after a relay-side revocation.
+ const restarted = createRegistration(s.options);
+ const r = await restarted.register(req(proof(sk, { created_at: time / 1000 + 1 }).header), '{}');
+ assert.equal(r.alreadyRegistered, true); assert.equal(s.admissions.length, 1);
+ const keyDoc = s.db.docs.get('key_' + getPublicKey(sk)); keyDoc.status = 'blocked';
+ await assert.rejects(restarted.register(req(proof(sk, { created_at: time / 1000 + 2 }).header), '{}'), { status: 403 });
+});
+
+test('invalid requests, pause, unimported revocations and missing durable config fail closed', async () => {
+ const s = service(), p = proof(generateSecretKey());
+ await assert.rejects(s.registration.register(req(p.header), '{"role":"admin"}'), { status: 400 });
+ await assert.rejects(s.registration.register(req(''), '{}'), { status: 401 });
+ s.db.docs.set('control', { enabled: false, revocationsImported: true });
+ await assert.rejects(s.registration.register(req(p.header), '{}'), { status: 503 });
+ s.db.docs.set('control', { enabled: true });
+ await assert.rejects(s.registration.register(req(p.header), '{}'), { status: 503 });
+ await assert.rejects(createRegistration({ publicUrl: 'https://x.ruv.io' }).register(req(p.header), '{}'), { status: 503 });
+ assert.throws(() => createRegistration({ enabled: true }), /durable store/);
+ assert.equal(s.admissions.length, 0);
+});
+
+test('IP and global quotas are atomic across independent service instances', async () => {
+ const s = service({ limits: { ipHourly: 2, daily: 3, maxConcurrent: 4 } });
+ const other = createRegistration(s.options);
+ await s.registration.register(req(proof(generateSecretKey()).header), '{}');
+ await other.register(req(proof(generateSecretKey()).header), '{}');
+ await assert.rejects(other.register(req(proof(generateSecretKey()).header), '{}'), { status: 429 });
+ await other.register(req(proof(generateSecretKey()).header, '203.0.113.2'), '{}');
+ await assert.rejects(s.registration.register(req(proof(generateSecretKey()).header, '203.0.113.3'), '{}'), { status: 429 });
+ assert.equal(s.admissions.length, 3);
+ assert.ok(!JSON.stringify([...s.db.docs]).includes('203.0.113'), 'raw IPs are never persisted');
+});
+
+test('relay failure keeps reservation and suppresses errors; retry cannot re-admit', async () => {
+ let effects = 0;
+ const s = service({ admit: async () => { effects++; throw new Error('private backend detail'); } }), sk = generateSecretKey();
+ await assert.rejects(s.registration.register(req(proof(sk).header), '{}'), e => e.status === 503 && !e.message.includes('private'));
+ await assert.rejects(s.registration.register(req(proof(sk, { created_at: time / 1000 + 1 }).header), '{}'), { status: 409 });
+ assert.equal(effects, 1);
+});
+
+test('in-flight shedding bounds relay work before reservations', async () => {
+ let release;
+ const s = service({ limits: { ipHourly: 3, daily: 100, maxConcurrent: 1 }, admit: () => new Promise(r => { release = r; }) });
+ const pending = s.registration.register(req(proof(generateSecretKey()).header), '{}');
+ while (!release) await new Promise(r => setImmediate(r));
+ await assert.rejects(s.registration.register(req(proof(generateSecretKey()).header), '{}'), { status: 429 });
+ release(); await pending;
+});
+
+test('HTTP enrollment -> relay admission -> same-key AUTH and signed event acknowledgment', async t => {
+ const dir = mkdtempSync(join(tmpdir(), 'registration-e2e-'));
+ const admin = generateSecretKey(), user = generateSecretKey(), members = new Set([getPublicKey(admin)]), events = [];
+ const wss = new WebSocketServer({ port: 0 }); await new Promise(r => wss.once('listening', r));
+ const relay = `ws://127.0.0.1:${wss.address().port}`;
+ wss.on('connection', ws => {
+ let authenticated;
+ ws.send(JSON.stringify(['AUTH', 'e2e-challenge']));
+ ws.on('message', data => {
+ const [type, event] = JSON.parse(data);
+ assert.ok(verifyEvent(event));
+ if (type === 'AUTH') {
+ const ok = members.has(event.pubkey) && event.kind === 22242 && event.tags.some(x => x[0] === 'relay' && x[1] === relay);
+ if (ok) authenticated = event.pubkey;
+ ws.send(JSON.stringify(['OK', event.id, ok, ok ? '' : 'not a member']));
+ } else if (type === 'EVENT') {
+ let ok = authenticated === event.pubkey;
+ if (event.kind === 9030) {
+ ok &&= authenticated === getPublicKey(admin) && event.tags.some(x => x[0] === 'role' && x[1] === 'member');
+ if (ok) members.add(event.tags.find(x => x[0] === 'p')[1]);
+ } else if (ok) events.push(event);
+ ws.send(JSON.stringify(['OK', event.id, ok, '']));
+ }
+ });
+ });
+ let reg;
+ const gw = createGateway({ relay, keyFile: join(dir, 'gateway.key'), registration: { info: () => reg.info(), register: (...a) => reg.register(...a) } });
+ const port = await gw.listen(0), base = `http://127.0.0.1:${port}`;
+ reg = service({ publicUrl: base, now: Date.now, admit: (pk, role) => admitMember(relay, admin, pk, role) }).registration;
+ t.after(async () => { gw.server.closeAllConnections(); await new Promise(r => gw.server.close(r)); for (const c of wss.clients) c.terminate(); await new Promise(r => wss.close(r)); rmSync(dir, { recursive: true, force: true }); });
+ const meta = await (await fetch(base + '/api/registration')).json(); assert.equal(meta.role, 'member');
+ await assert.rejects(connectAuthed(relay, user), /not a member/);
+ const p = proof(user, { url: base + '/api/registration', created_at: Math.floor(Date.now() / 1000) });
+ const response = await fetch(base + '/api/registration', { method: 'POST', headers: { authorization: p.header }, body: '{}' });
+ assert.equal(response.status, 200); assert.equal((await response.json()).pubkey, getPublicKey(user));
+ const ws = await connectAuthed(relay, user); ws.close();
+ const id = await publish(relay, user, 'Status', { note: 'local registration acceptance test' });
+ assert.equal(events.length, 1); assert.equal(events[0].pubkey, getPublicKey(user)); assert.equal(events[0].id, id);
+ const replay = await fetch(base + '/api/registration', { method: 'POST', headers: { authorization: p.header }, body: '{}' }); assert.equal(replay.status, 409);
+ assert.equal((await fetch(base + '/api/registration', { method: 'PUT' })).status, 405);
+ assert.equal((await fetch(base + '/api/registration?target=other')).status, 400);
+});
+
+test('revocation procedure pauses, drains, blocks, revokes, then refuses reenrollment', async () => {
+ let release;
+ const members = new Set(), sk = generateSecretKey(), pk = getPublicKey(sk);
+ const s = service({ admit: () => new Promise(r => { release = () => { members.add(pk); r(); }; }) });
+ const inFlight = s.registration.register(req(proof(sk).header), '{}');
+ while (!release) await new Promise(r => setImmediate(r));
+ s.db.docs.set('control', { enabled: false, revocationsImported: true });
+ await assert.rejects(s.registration.register(req(proof(generateSecretKey()).header), '{}'), { status: 503 });
+ release(); await inFlight; // Drain before revoking; earlier admission can finish.
+ s.db.docs.set('key_' + pk, { status: 'blocked' });
+ members.delete(pk); // Operator's relay revocation, after the drain.
+ s.db.docs.set('control', { enabled: true, revocationsImported: true });
+ await assert.rejects(s.registration.register(req(proof(sk, { created_at: time / 1000 + 1 }).header), '{}'), { status: 403 });
+ assert.equal(members.has(pk), false);
+});
+
+test('an unrelated relay OK cannot authenticate the gateway signer', async () => {
+ const wss = new WebSocketServer({ port: 0 }); await new Promise(r => wss.once('listening', r));
+ wss.on('connection', ws => {
+ ws.send(JSON.stringify(['AUTH', 'challenge']));
+ ws.on('message', data => {
+ const [, ev] = JSON.parse(data);
+ ws.send(JSON.stringify(['OK', 'unrelated', true, '']));
+ ws.send(JSON.stringify(['OK', ev.id, false, 'denied']));
+ });
+ });
+ try { await assert.rejects(connectAuthed(`ws://127.0.0.1:${wss.address().port}`, generateSecretKey()), /denied/); }
+ finally { for (const c of wss.clients) c.terminate(); await new Promise(r => wss.close(r)); }
+});
+
+test('a live ban or unavailable restrictions blocks the grant after reservation', async () => {
+ const { RegistrationError } = await import('../src/registration.mjs');
+ for (const error of [new RegistrationError(403, 'registration denied'), new Error('backend detail')]) {
+ const s = service({ checkAllowed: async () => { throw error; } });
+ await assert.rejects(s.registration.register(req(proof(generateSecretKey()).header), '{}'), { status: error.status || 503 });
+ assert.equal(s.admissions.length, 0);
+ }
+});
diff --git a/ruflo/package.json b/ruflo/package.json
index a693c4dbc1..67bfef5b70 100644
--- a/ruflo/package.json
+++ b/ruflo/package.json
@@ -1,6 +1,6 @@
{
"name": "ruflo",
- "version": "3.46.1",
+ "version": "3.47.0",
"description": "Ruflo - Enterprise AI agent orchestration platform. Deploy 60+ specialized agents in coordinated swarms with self-learning, fault-tolerant consensus, vector memory, and MCP integration",
"main": "bin/ruflo.js",
"type": "module",
@@ -40,7 +40,7 @@
"package:rvf": "bash src/scripts/package-rvf.sh"
},
"dependencies": {
- "@claude-flow/cli": "^3.33.0"
+ "@claude-flow/cli": "^3.47.0"
},
"optionalDependencies": {},
"overrides": {
diff --git a/v3/@claude-flow/cli/__tests__/x-federation-join.test.ts b/v3/@claude-flow/cli/__tests__/x-federation-join.test.ts
index e425ede1db..1181f1e2cb 100644
--- a/v3/@claude-flow/cli/__tests__/x-federation-join.test.ts
+++ b/v3/@claude-flow/cli/__tests__/x-federation-join.test.ts
@@ -28,8 +28,84 @@ describe('x_federation_join (self-service invite path)', () => {
await expect(xFederationJoinTools[0].handler({ code: 'not-a-code' }, {} as any)).rejects.toThrow(/v2\./);
expect(f).not.toHaveBeenCalled();
});
- it('is registered with an ADR-112 description and requires code', () => {
+ it('is registered with an ADR-112 description and makes invite code optional', () => {
const t = xFederationJoinTools[0]; expect(t.name).toBe('x_federation_join');
- expect(t.description).toMatch(/Use when/); expect(t.description).toMatch(/wrong/); expect((t.inputSchema as any).required).toEqual(['code']);
+ expect(t.description).toMatch(/Use when/); expect(t.description).toMatch(/wrong/); expect((t.inputSchema as any).required).toEqual([]);
+ });
+});
+
+// Real local WebSocket authentication; HTTP is intercepted to inspect exact
+// signed registration bytes and simulate loss of an admission response.
+import { WebSocketServer } from 'ws';
+import { verifyMembership } from '../src/mcp-tools/x-federation-join.js';
+import { rmSync } from 'node:fs';
+async function localRelay() {
+ const members = new Set<string>();
+ const server = new WebSocketServer({ port: 0 });
+ await new Promise<void>(r => server.once('listening', r));
+ const url = `ws://127.0.0.1:${(server.address() as any).port}`;
+ server.on('connection', ws => {
+ ws.send(JSON.stringify(['AUTH', 'local-test']));
+ ws.on('message', bytes => {
+ const [kind, ev] = JSON.parse(bytes.toString());
+ expect(kind).toBe('AUTH'); expect(verifyEvent(ev)).toBe(true);
+ ws.send('malformed');
+ ws.send(JSON.stringify(['OK', 'unrelated-event', true, '']));
+ ws.send(JSON.stringify(['OK', ev.id, members.has(ev.pubkey), 'not a member']));
+ });
+ });
+ return { url, members, close: async () => { for (const ws of server.clients) ws.terminate(); await new Promise<void>(r => server.close(() => r())); } };
+}
+describe.skipIf(!nt)('public self registration', () => {
+ afterEach(() => vi.unstubAllGlobals());
+ it('ignores unrelated OK and requires acceptance of the signed AUTH event', async () => {
+ const relay = await localRelay();
+ try { expect((await verifyMembership(nt, generateSecretKey(), relay.url)).ok).toBe(false); }
+ finally { await relay.close(); }
+ });
+ for (const lostResponse of [false, true]) {
+ it(`joins without an invite with local key ownership (lost response: ${lostResponse})`, async () => {
+ const relay = await localRelay(), dir = mkdtempSync(join(tmpdir(), 'xj-public-')), keyFile = join(dir, 'nostr.key');
+ const key = loadOrCreateKey(nt, keyFile);
+ const f = vi.fn(async (url: string, options: any) => {
+ expect(url).toBe('https://x.ruv.io/api/registration'); expect(options.body).toBe('{}'); expect(options.redirect).toBe('error');
+ const ev = JSON.parse(Buffer.from(options.headers.Authorization.slice(6), 'base64').toString());
+ expect(verifyEvent(ev)).toBe(true); expect(ev.pubkey).toBe(key.pubkey);
+ expect(ev.tags).toContainEqual(['u', url]);
+ relay.members.add(ev.pubkey);
+ if (lostResponse) throw new Error('response lost');
+ return { ok: true, json: async () => ({ ok: true, role: 'member' }) };
+ });
+ vi.stubGlobal('fetch', f);
+ try {
+ const result: any = await xFederationJoinTools[0].handler({ keyFile, relayWs: relay.url }, {} as any);
+ expect(result.ok).toBe(true); expect(result.pubkey).toBe(key.pubkey); expect(result.keyCreated).toBe(false); expect(result.membershipVerified).toBe(true);
+ const again: any = await xFederationJoinTools[0].handler({ keyFile, relayWs: relay.url }, {} as any);
+ expect(again.alreadyMember).toBe(true); expect(f).toHaveBeenCalledTimes(1);
+ } finally { await relay.close(); rmSync(dir, { recursive: true, force: true }); }
+ });
+ }
+ it('retains the invite claim path', async () => {
+ const relay = await localRelay(), dir = mkdtempSync(join(tmpdir(), 'xj-invite-'));
+ vi.stubGlobal('fetch', vi.fn(async (url: string, opts: any) => {
+ expect(url).toBe('https://relay.ruv.io/api/invites/claim'); expect(JSON.parse(opts.body).code).toBe('v2.test-invite');
+ const ev = JSON.parse(Buffer.from(opts.headers.Authorization.slice(6), 'base64').toString());
+ relay.members.add(ev.pubkey); return { ok: true, json: async () => ({ role: 'member' }) };
+ }));
+ try { expect((await xFederationJoinTools[0].handler({ code: 'v2.test-invite', relayWs: relay.url, keyFile: join(dir, 'key') }, {} as any) as any).ok).toBe(true); }
+ finally { await relay.close(); rmSync(dir, { recursive: true, force: true }); }
+ });
+ it('refuses a server success when the relay refuses membership', async () => {
+ const relay = await localRelay(), dir = mkdtempSync(join(tmpdir(), 'xj-denied-'));
+ vi.stubGlobal('fetch', vi.fn(async () => ({ ok: true, json: async () => ({ role: 'member' }) })));
+ try { const r: any = await xFederationJoinTools[0].handler({ relayWs: relay.url, keyFile: join(dir, 'key') }, {} as any); expect(r.ok).toBe(false); expect(r.membershipVerified).toBe(false); }
+ finally { await relay.close(); rmSync(dir, { recursive: true, force: true }); }
+ });
+ it('rejects an insecure public registration origin before creating a key', async () => {
+ const dir = mkdtempSync(join(tmpdir(), 'xj-invalid-')), keyFile = join(dir, 'key');
+ try {
+ await expect(xFederationJoinTools[0].handler({ gatewayUrl: 'http://example.com', keyFile }, {} as any)).rejects.toThrow(/HTTPS/);
+ expect(existsSync(keyFile)).toBe(false);
+ } finally { rmSync(dir, { recursive: true, force: true }); }
});
});
diff --git a/v3/@claude-flow/cli/package.json b/v3/@claude-flow/cli/package.json
index a5c0d5e195..1a0ceca797 100644
--- a/v3/@claude-flow/cli/package.json
+++ b/v3/@claude-flow/cli/package.json
@@ -1,6 +1,6 @@
{
"name": "@claude-flow/cli",
- "version": "3.46.1",
+ "version": "3.47.0",
"type": "module",
"description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
"main": "dist/src/index.js",
diff --git a/v3/@claude-flow/cli/src/commands/federation.ts b/v3/@claude-flow/cli/src/commands/federation.ts
index ac14f1aba4..4ffd0d8a63 100644
--- a/v3/@claude-flow/cli/src/commands/federation.ts
+++ b/v3/@claude-flow/cli/src/commands/federation.ts
@@ -17,6 +17,7 @@ async function run(ctx: CommandContext, tool: string, args: Record<string, unkno
// CLI flag --gateway takes precedence over the RUFLO_X_GATEWAY_URL env var (ADR-125).
const data = await callMCPTool(tool, { gatewayUrl: ctx.flags.gateway, ...args });
printJsonOrTable(ctx, data, title);
+ if (data && typeof data === 'object' && (('ok' in data && data.ok === false) || ('degraded' in data && data.degraded === true))) return { success: false, exitCode: 1, data };
return { success: true, data };
} catch (e) {
output.printError(`${title} failed: ${(e as Error).message}`);
@@ -32,8 +33,8 @@ export const federationCommand: Command = {
{ name: 'gateway', description: 'Gateway base URL (takes precedence over RUFLO_X_GATEWAY_URL; default https://x.ruv.io)', type: 'string' },
],
subcommands: [
- { name: 'join', description: 'Join the open swarm with YOUR OWN key using an invite code (generates ~/.ruflo/nostr.key if absent, claims via NIP-98, verifies via NIP-42)',
- options: [{ name: 'code', description: 'Invite code (v2.…) β€” a bearer secret, keep it private', type: 'string', required: true }],
+ { name: 'join', description: 'Join the open swarm with YOUR OWN key without an invite on open relays (generates ~/.ruflo/nostr.key if absent, registers via NIP-98, verifies via NIP-42)',
+ options: [{ name: 'code', description: 'Invite code (v2.…) β€” a bearer secret, keep it private', type: 'string' }],
action: (ctx) => run(ctx, 'x_federation_join', { code: ctx.flags.code }, 'Join federation') },
{ name: 'sync', description: 'Fetch recent verified swarm messages',
options: [{ name: 'since', description: 'Look-back seconds (default 3600)', type: 'number' }, { name: 'limit', description: 'Max messages', type: 'number' }, { name: 'type', description: 'Filter by message type', type: 'string' }],
diff --git a/v3/@claude-flow/cli/src/mcp-tools/x-federation-join.ts b/v3/@claude-flow/cli/src/mcp-tools/x-federation-join.ts
index f5280feb9d..a1fe52bb6d 100644
--- a/v3/@claude-flow/cli/src/mcp-tools/x-federation-join.ts
+++ b/v3/@claude-flow/cli/src/mcp-tools/x-federation-join.ts
@@ -1,8 +1,8 @@
/**
- * Self-service join for the open swarm federation β€” the user-facing invite path.
+ * Self-service federation join with a local key: public registration or a private invite.
*
* Decentralized by design: the user generates/holds THEIR OWN Nostr key locally,
- * redeems an invite code with a NIP-98-signed claim (no admin in the loop), proves
+ * registers with a NIP-98-signed request (no admin in the user flow), proves
* membership with NIP-42, and announces themselves. The gateway never signs for them.
*
* `nostr-tools` is an optional dependency (secp256k1/Schnorr is not in node:crypto):
@@ -41,37 +41,73 @@ export function nip98Header(nt: NostrTools, sk: Uint8Array, url: string, method:
export async function verifyMembership(nt: NostrTools, sk: Uint8Array, relayWs: string): Promise<{ ok: boolean; reason?: string }> {
const { default: WebSocket } = await import('ws');
return new Promise((resolve) => {
- const ws = new WebSocket(relayWs, { perMessageDeflate: false }); let done = false;
- const fin = (r: { ok: boolean; reason?: string }) => { if (done) return; done = true; try { ws.close(); } catch { /* */ } resolve(r); };
- ws.on('message', (d: Buffer) => { const m = JSON.parse(d.toString());
- if (m[0] === 'AUTH' && typeof m[1] === 'string') ws.send(JSON.stringify(['AUTH', nt.finalizeEvent({ kind: 22242, created_at: Math.floor(Date.now() / 1000), tags: [['relay', relayWs], ['challenge', m[1]]], content: '' }, sk)]));
- else if (m[0] === 'OK') fin({ ok: !!m[2], reason: m[3] }); });
+ const ws = new WebSocket(relayWs, { perMessageDeflate: false, maxPayload: 64 * 1024 });
+ let done = false, authId: string | undefined;
+ const fin = (r: { ok: boolean; reason?: string }) => { if (done) return; done = true; clearTimeout(timer); try { ws.close(); } catch { /* */ } resolve(r); };
+ const timer = setTimeout(() => fin({ ok: false, reason: 'timeout' }), 15000);
+ ws.on('message', (d: Buffer) => {
+ let m: any; try { m = JSON.parse(d.toString()); } catch { return; }
+ if (!Array.isArray(m)) return;
+ if (m[0] === 'AUTH' && typeof m[1] === 'string' && m[1].length <= 1024 && !authId) {
+ const ev = nt.finalizeEvent({ kind: 22242, created_at: Math.floor(Date.now() / 1000), tags: [['relay', relayWs], ['challenge', m[1]]], content: '' }, sk);
+ authId = ev.id; ws.send(JSON.stringify(['AUTH', ev]));
+ } else if (m[0] === 'OK' && authId && m[1] === authId) fin({ ok: m[2] === true, reason: m[3] });
+ });
ws.on('error', (e: Error) => fin({ ok: false, reason: e.message }));
- setTimeout(() => fin({ ok: false, reason: 'timeout' }), 15000);
+ ws.on('close', () => fin({ ok: false, reason: 'closed before authentication' }));
});
}
+function secureBase(value: string): string {
+ const u = new URL(value);
+ if ((u.protocol !== 'https:' && !(u.protocol === 'http:' && ['127.0.0.1', 'localhost', '[::1]'].includes(u.hostname)))
+ || u.username || u.password || u.search || u.hash || u.pathname !== '/') throw new Error('gateway must be an HTTPS origin (HTTP allowed only for loopback tests)');
+ return u.origin;
+}
+
export const xFederationJoinTools: MCPTool[] = [{
name: 'x_federation_join',
description:
- 'Join the open swarm federation with YOUR OWN key using an invite code: generates (or reuses) a local Nostr key at ~/.ruflo/nostr.key (0600), redeems the code with a NIP-98-signed claim directly against the relay, proves membership via NIP-42, and returns your pubkey. Use when you have been handed an invite code and want to participate as yourself. Asking an admin to `federation_admit` you instead is wrong for an open swarm because it centralizes onboarding and requires trusting a pubkey out of band; the invite claim binds membership to the key you hold. Never share the invite code publicly β€” it is a bearer secret.',
+ 'Join the federation with YOUR OWN local key, without an invite when public registration is enabled. Reuses ~/.ruflo/nostr.key (0600), proves key ownership with NIP-98, and verifies membership with NIP-42. Use when a user wants to join as themselves. Publishing as the gateway is wrong for personal identity. Optional private invite codes remain supported; never share keys or codes in chat.',
inputSchema: { type: 'object', properties: {
- code: { type: 'string', description: 'Invite code (v2.…) received privately from a member/admin.' },
+ code: { type: 'string', description: 'Optional private invite code (v2.…), for invite-only relays.' },
+ gatewayUrl: { type: 'string', description: 'Public registration gateway origin; defaults to https://x.ruv.io.' },
relayHttp: { type: 'string', description: 'Relay HTTPS base for the claim; takes precedence over RUFLO_X_RELAY_HTTP.' },
relayWs: { type: 'string', description: 'Relay wss URL for NIP-42; takes precedence over RUFLO_X_RELAY_WS.' },
- keyFile: { type: 'string', description: 'Key file path; takes precedence over RUFLO_NOSTR_KEY_FILE (default ~/.ruflo/nostr.key).' } }, required: ['code'] },
+ keyFile: { type: 'string', description: 'Key file path; takes precedence over RUFLO_NOSTR_KEY_FILE (default ~/.ruflo/nostr.key).' } }, required: [] },
handler: async (input) => {
- const i = input as { code: string; relayHttp?: string; relayWs?: string; keyFile?: string };
+ const i = input as { code?: string; gatewayUrl?: string; relayHttp?: string; relayWs?: string; keyFile?: string };
const nt = await loadNostrTools();
// Validate input before the optional-dependency check so a bad code fails fast and identically
// whether or not nostr-tools is present.
- if (!/^v2\.[A-Za-z0-9._-]{8,}$/.test(i.code)) throw new Error('invite code must look like v2.<token>');
+ if (i.code !== undefined && !/^v2\.[A-Za-z0-9._-]{8,}$/.test(i.code)) throw new Error('invite code must look like v2.<token>');
if (!nt) return { degraded: true, reason: 'nostr-tools not installed', hint: 'npm i -g nostr-tools (secp256k1 signing is not in node:crypto)' };
+ const registrationBase = i.code ? undefined : secureBase(i.gatewayUrl || process.env.RUFLO_X_GATEWAY_URL || 'https://x.ruv.io');
const { sk, pubkey, created } = loadOrCreateKey(nt, i.keyFile);
- const url = `${HTTP_BASE(i.relayHttp)}/api/invites/claim`; const body = JSON.stringify({ code: i.code });
- const r = await fetch(url, { method: 'POST', headers: { Authorization: nip98Header(nt, sk, url, 'POST', body), 'Content-Type': 'application/json' }, body, signal: AbortSignal.timeout(20_000) });
+ // Existing members need no new grant. In particular never downgrade/re-admit
+ // their key just because they run join again.
+ if (!i.code) {
+ const existing = await verifyMembership(nt, sk, RELAY_WS(i.relayWs));
+ if (existing.ok) return { ok: true, pubkey, keyCreated: created, membershipVerified: true, alreadyMember: true };
+ }
+ const url = i.code ? `${secureBase(HTTP_BASE(i.relayHttp))}/api/invites/claim` : `${registrationBase}/api/registration`;
+ const body = i.code ? JSON.stringify({ code: i.code }) : '{}';
+ let r: Response;
+ try {
+ r = await fetch(url, { method: 'POST', redirect: 'error', headers: { Authorization: nip98Header(nt, sk, url, 'POST', body), 'Content-Type': 'application/json' }, body, signal: AbortSignal.timeout(20_000) });
+ } catch {
+ const check = await verifyMembership(nt, sk, RELAY_WS(i.relayWs));
+ if (check.ok) return { ok: true, pubkey, keyCreated: created, membershipVerified: true };
+ throw new Error('Admission response unavailable and relay membership unverified. Keep your local key and retry; do not create another identity.');
+ }
const claim = (await r.json().catch(() => ({}))) as { role?: string; error?: string; message?: string };
- if (!r.ok) throw new Error(`claim rejected (${r.status}): ${claim.error ?? claim.message ?? 'unknown'}`);
+ if (!r.ok) {
+ // A lost acknowledgment can follow a successful grant. Check with the
+ // relay before declaring failure; never silently generate a second key.
+ const check = await verifyMembership(nt, sk, RELAY_WS(i.relayWs));
+ if (check.ok) return { ok: true, pubkey, keyCreated: created, membershipVerified: true };
+ throw new Error(`join rejected (${r.status}): ${claim.error ?? claim.message ?? 'unknown'}`);
+ }
const auth = await verifyMembership(nt, sk, RELAY_WS(i.relayWs));
return { ok: auth.ok, pubkey, keyCreated: created, role: claim.role ?? 'member', membershipVerified: auth.ok, ...(auth.ok ? {} : { reason: auth.reason }),
next: 'Publish kind-1 events tagged ["t","ruflo-swarm"] β€” or run `ruflo federation sync` to read the swarm.' };