diff --git a/README.md b/README.md index bd2f339..505cf33 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ |---|---|---| | M0 기술 검증 | DAVE 음성 연결, faster-whisper STT·음량·잡음·사전, 게임 로컬 API 처리, 게임 PC 진단 기능 | ✅ 완료 ([결과](docs/dev/M0-verification.md)) | | M1 녹음 + STT 기본 | 따라가기·명령 참여, TTS 안내, 유저별 녹음, 대기열 STT, /녹음제외·참여 | ✅ 완료 ([실음성 테스트](docs/dev/test-results.md)) | -| M2 사이트 서버 · 사이트 v1 | 디스코드 로그인, 연결 확인·잠금, 타임라인·따라 읽기·필터·검색·실시간 | ⏳ | +| M2 사이트 서버 · 사이트 v1 | 디스코드 로그인, 연결 확인·잠금, 타임라인·따라 읽기·필터·검색·실시간 | ✅ 완료 · https://gvr.tkrmagid.kr 배포 | | M3 발로란트 연동 | 경기 감지, 킬·라운드·채팅, 라운드 시간 + 경기 경과 시간, 경기 상세 | ⏳ | | M4 롤 연동 · 채팅 OCR | 게임 API 이벤트, LCU 결과·타임라인, 채팅 OCR·로그, 롤 경기 상세 | ⏳ | | M5 exe · 설정 · 모델 | 포터블 exe, 첫 실행 마법사, GPU 감지·모델 다운로드, 암호화 저장, 7일 삭제 | ⏳ | @@ -42,6 +42,11 @@ assets/ 앱·사이트 아이콘·배너 cd worker && uv venv --python 3.11 .venv && uv pip install --python .venv/bin/python -r requirements-dev.txt .venv/bin/python -m pytest -q +# 사이트 (가짜 데이터로 화면 개발: http://127.0.0.1:5173) +cd site/web && npm install && npm run dev +cd site/server && npm install && npm test +deploy/site/deploy.sh # .5 배포 (deploy/README.md) + # 앱 코어 (헤드리스) cd app && npm install && npm test npm run core -- --diagnose # 게임 PC 진단 (GPU·STT 속도·Riot API·OCR) diff --git a/app/scripts/site-e2e.mts b/app/scripts/site-e2e.mts new file mode 100644 index 0000000..c9b8d8d --- /dev/null +++ b/app/scripts/site-e2e.mts @@ -0,0 +1,24 @@ +// M2 실서버 확인: 등록 코드로 이 코어를 https://gvr.tkrmagid.kr 에 등록하고 연결·중계가 되는지 본다. +// node --import tsx scripts/site-e2e.mts <등록코드> +import fs from 'node:fs'; +import os from 'node:os'; +import path from 'node:path'; +import { registerDevice } from '../src/core/relay/client.ts'; + +const code = process.argv[2]; +const root = path.resolve(import.meta.dirname, '..', '..'); +const work = fs.mkdtempSync(path.join(process.env.TMPDIR || os.tmpdir(), 'gvr-site-e2e-')); +const reg = await registerDevice('https://gvr.tkrmagid.kr', code, 'DEV-TEST'); +console.log('등록 완료 deviceId', reg.deviceId); +fs.writeFileSync(path.join(work, 'settings.json'), JSON.stringify({ site: { deviceId: reg.deviceId, deviceName: 'DEV-TEST' }, games: { valorant: false, lol: false } })); +const { startCore } = await import('../src/core/index.ts'); +const core = await startCore({ dataDir: work, resourcesDir: path.join(root, 'app', 'resources'), worker: { cmd: path.join(root, 'worker/.venv/bin/python'), args: ['-m', 'gvr_worker'], cwd: path.join(root, 'worker') }, version: 'site-e2e' }); +core.settings.setSecret('deviceKey', reg.deviceKey); +core.relay.restart(); +const t = Date.now(); +while (core.relay.status.state !== 'online' && Date.now() - t < 15000) await new Promise((r) => setTimeout(r, 200)); +console.log('relay', core.relay.status.state, core.relay.status.error ?? ''); +const online = core.relay.status.state === 'online'; +await new Promise((r) => setTimeout(r, 7000)); // ping 한 번 이상 +await core.stop(); +process.exit(online ? 0 : 1); diff --git a/app/src/core/index.ts b/app/src/core/index.ts index 7d59348..9899f53 100644 --- a/app/src/core/index.ts +++ b/app/src/core/index.ts @@ -98,6 +98,7 @@ export async function startCore(opts: CoreOptions) { deviceKey: settings.getSecret('deviceKey') ?? null, name: S().site.deviceName, version: opts.version, + guildId: S().discord.guildId, })); const retention = new Retention(store, () => S().storage.retentionDays, () => paths().audio); diff --git a/app/src/core/relay/client.ts b/app/src/core/relay/client.ts index e94bf6d..6cce66f 100644 --- a/app/src/core/relay/client.ts +++ b/app/src/core/relay/client.ts @@ -29,7 +29,7 @@ export class RelayClient { constructor( private api: FastifyInstance, private bus: Bus, - private cfg: () => { serverUrl: string; deviceId: string | null; deviceKey: string | null; name: string; version: string }, + private cfg: () => { serverUrl: string; deviceId: string | null; deviceKey: string | null; name: string; version: string; guildId: string | null }, ) { bus.on('live', (ev: LiveEvent) => this.send({ t: 'event', event: ev })); } @@ -69,7 +69,7 @@ export class RelayClient { this.lastPong = Date.now(); this.status = { state: 'online', error: null, since: Date.now(), serverUrl: c.serverUrl }; log.info(`사이트 서버 연결됨: ${c.serverUrl}`); - this.send({ t: 'hello', name: c.name, version: c.version }); + this.send({ t: 'hello', name: c.name, version: c.version, guildId: c.guildId }); this.pingTimer = setInterval(() => { if (Date.now() - this.lastPong > 20000) { log.warn('사이트 서버 응답 없음, 다시 연결'); diff --git a/app/src/core/timeline.ts b/app/src/core/timeline.ts index b47a177..daab7f9 100644 --- a/app/src/core/timeline.ts +++ b/app/src/core/timeline.ts @@ -98,9 +98,14 @@ export class Timeline { const cur = q.cursor ? parseCursor(q.cursor) : null; const types = q.types && q.types.length ? new Set(q.types) : null; const wantUtt = !types || types.has('utterance'); - const eventTypes = types - ? [...types].flatMap((t) => (t === 'round' ? ['round_end'] : t === 'match' ? ['match_start', 'match_end'] : t === 'utterance' ? [] : [t])) - : null; + // 사이트 필터 묶음: 킬 = 킬·멀티킬·에이스, 라운드 = 라운드 종료·경기 시작/종료·스파이크 + const GROUPS: Record = { + kill: ['kill', 'multikill', 'ace'], + round: ['round_end', 'match_start', 'match_end', 'spike'], + match: ['match_start', 'match_end'], + utterance: [], + }; + const eventTypes = types ? [...new Set([...types].flatMap((t) => GROUPS[t] ?? [t]))] : null; const wantEvents = (!types || (eventTypes && eventTypes.length > 0)) && q.game !== 'none'; const cmp = desc ? '<' : '>'; const ord = desc ? 'DESC' : 'ASC'; @@ -172,15 +177,14 @@ export class Timeline { args.push(q.game); } if (q.users?.length) { - const puuids = this.store + // 선택하지 않은 (디스코드에 연결된) 유저가 주인공인 이벤트만 뺀다. 라운드·오브젝트·상대 킬처럼 유저가 없는 이벤트는 남긴다. + const others = this.store .listAccounts() - .filter((a) => q.users!.includes(a.user_id)) + .filter((a) => a.puuid && !q.users!.includes(a.user_id)) .map((a) => a.puuid); - if (!puuids.length) where.push('0'); - else { - const ph = puuids.map(() => '?').join(','); - where.push(`(e.actor_puuid IN (${ph}) OR e.target_puuid IN (${ph}))`); - args.push(...puuids, ...puuids); + if (others.length) { + where.push(`(e.actor_puuid IS NULL OR e.actor_puuid NOT IN (${others.map(() => '?').join(',')}))`); + args.push(...others); } } if (q.from) { diff --git a/deploy/README.md b/deploy/README.md index 96d9b61..1eca4bb 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -1,8 +1,14 @@ -# Deploy (site server) +# Deploy (사이트 서버) -- Host: .5 Docker (`root@192.168.10.5:/root/other/game-voice-recorder`), container `gvr-web`, port **2972**. -- Domain: `gvr.tkrmagid.kr` → NPMplus on 192.168.10.3 (proxy host id 13, websocket upgrade on) → `192.168.10.5:2972`. -- DNS: A record `gvr` → 211.213.11.141 must be added at hosting.co.kr (user). Then run `./cert.sh` (LE cert + force SSL). -- `placeholder/` is a static "준비 중" page until the real site server replaces it (same port, same compose project name). - Update: `scp -r placeholder/* root@192.168.10.5:/root/other/game-voice-recorder/ && ssh root@192.168.10.5 'cd /root/other/game-voice-recorder && docker compose up -d'` -- Secrets (Discord bot token / OAuth client secret) live in `~/.config/ejclaw/secrets.json` under `discord.com/bot/game-voice-recorder`; inject via `.env` on the host, never commit. +- 위치: .5 Docker `root@192.168.10.5:/root/other/game-voice-recorder` (compose 프로젝트 `game-voice-recorder`, 컨테이너 `gvr-web`), 포트 **2972 → 8080** +- 도메인: `gvr.tkrmagid.kr` → NPMplus(192.168.10.3, proxy host 13, WebSocket 허용) → `192.168.10.5:2972`. Let's Encrypt 인증서는 NPMplus 가 자동 갱신 (`cert.sh`) +- 배포: 저장소 루트에서 `deploy/site/deploy.sh` (소스를 tar 로 보내 `.5` 에서 이미지 빌드 → 재시작 → healthz 확인) +- 비밀값: `.5` 의 `.env` 에만 있다. 처음 한 번 `deploy/site/make-env.sh` (secrets.json 에서 읽어 원격에 바로 씀) + - `DISCORD_CLIENT_ID/SECRET` (OAuth 로그인), `DISCORD_BOT_TOKEN` (서버 멤버 확인), `SESSION_SECRET` + - `ALLOWED_GUILD_IDS=457514742940958731` (M&L), `OWNER_DISCORD_IDS=293719842274541579` (등록 코드를 만들 수 있는 관리자) +- 관리 명령 (컨테이너 안): + - `docker exec gvr-web node dist/cli.js code [분]` — 게임 PC 1회용 등록 코드 (사이트에서 관리자도 만들 수 있음) + - `docker exec gvr-web node dist/cli.js device` — 등록된 게임 PC + - `docker exec gvr-web node dist/cli.js unregister && docker restart gvr-web` — 등록 해제 +- 서버 데이터(`data/`): `server.json`(기기 키 해시·세션), `codes.json`(등록 코드), `asset-cache/`(게임 이미지). 기록 내용은 저장하지 않는다. +- `placeholder/` 는 M2 이전 "준비 중" 페이지 (기록용으로 남김) diff --git a/deploy/site/Dockerfile b/deploy/site/Dockerfile new file mode 100644 index 0000000..d15e544 --- /dev/null +++ b/deploy/site/Dockerfile @@ -0,0 +1,24 @@ +# 겜녹이 사이트 서버 (디스코드 로그인 · 게임 PC 중계 · 사이트 화면 · 게임 이미지 캐시) +# 빌드 컨텍스트 = 저장소 루트 구조 (packages/shared, site/web, site/server) +FROM node:22-alpine AS build +WORKDIR /src +COPY packages/shared packages/shared +COPY site/web/package.json site/web/package-lock.json site/web/ +RUN cd site/web && npm ci --no-audit --no-fund +COPY site/server/package.json site/server/package-lock.json site/server/ +RUN cd site/server && npm ci --no-audit --no-fund +COPY site/web site/web +COPY site/server site/server +RUN cd site/web && npm run build && cd ../server && npm run build + +FROM node:22-alpine +WORKDIR /app +ENV NODE_ENV=production WEB_DIR=/app/web DATA_DIR=/data PORT=8080 +COPY site/server/package.json site/server/package-lock.json ./ +RUN npm ci --omit=dev --no-audit --no-fund && npm cache clean --force +COPY --from=build /src/site/server/dist ./dist +COPY --from=build /src/site/web/dist ./web +VOLUME /data +EXPOSE 8080 +HEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://127.0.0.1:8080/healthz || exit 1 +CMD ["node", "dist/main.js"] diff --git a/deploy/site/deploy.sh b/deploy/site/deploy.sh new file mode 100755 index 0000000..ca35d1d --- /dev/null +++ b/deploy/site/deploy.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# 사이트 서버를 .5 에 배포한다. 저장소 루트에서: deploy/site/deploy.sh +# 비밀값(.env)은 .5 에만 있다. 처음이면 deploy/site/make-env.sh 로 만든다. +set -euo pipefail +cd "$(dirname "$0")/../.." +HOST=root@192.168.10.5 +DIR=/root/other/game-voice-recorder +ssh -o BatchMode=yes $HOST "mkdir -p $DIR/src $DIR/data" +# .5 에는 rsync 가 없어서 tar 로 보낸다 (src 는 매번 새로) +tar czf - --exclude node_modules --exclude dist --exclude screenshots --exclude 'site/server/data' \ + packages site deploy/site | ssh $HOST "rm -rf $DIR/src && mkdir -p $DIR/src && tar xzf - -C $DIR/src" +scp -q deploy/site/docker-compose.yml "$HOST:$DIR/docker-compose.yml" +ssh $HOST "cd $DIR && test -f .env || { echo '.env 없음 (make-env.sh 먼저)'; exit 1; } && docker compose up -d --build 2>&1 | tail -5 && sleep 3 && docker compose ps" +for i in 1 2 3 4 5 6 7 8 9 10; do + if curl -fsS https://gvr.tkrmagid.kr/healthz >/dev/null 2>&1; then echo "https://gvr.tkrmagid.kr 정상"; exit 0; fi + sleep 3 +done +echo "healthz 응답 없음"; exit 1 diff --git a/deploy/site/docker-compose.yml b/deploy/site/docker-compose.yml new file mode 100644 index 0000000..beb49d2 --- /dev/null +++ b/deploy/site/docker-compose.yml @@ -0,0 +1,15 @@ +# .5:/root/other/game-voice-recorder (NPMplus 가 gvr.tkrmagid.kr → 192.168.10.5:2972 로 넘긴다, WebSocket 허용) +name: game-voice-recorder +services: + web: + build: + context: ./src + dockerfile: deploy/site/Dockerfile + image: gvr-site:latest + container_name: gvr-web + restart: unless-stopped + env_file: .env + ports: + - "2972:8080" + volumes: + - ./data:/data diff --git a/deploy/site/make-env.sh b/deploy/site/make-env.sh new file mode 100755 index 0000000..e6d5097 --- /dev/null +++ b/deploy/site/make-env.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +# .5 에 사이트 서버 .env 를 만든다 (secrets.json 에서 읽어 바로 원격에 씀, 로컬에 남기지 않음) +set -euo pipefail +HOST=root@192.168.10.5 +DIR=/root/other/game-voice-recorder +python3 - <<'PY' | ssh -o BatchMode=yes $HOST "mkdir -p $DIR && umask 077 && cat > $DIR/.env" +import json, secrets +c = json.load(open('/home/claude/.config/ejclaw/secrets.json'))['credentials']['discord.com/bot/game-voice-recorder'] +print(f"PUBLIC_URL=https://gvr.tkrmagid.kr") +print(f"DISCORD_CLIENT_ID={c['client_id']}") +print(f"DISCORD_CLIENT_SECRET={c['client_secret']}") +print(f"DISCORD_BOT_TOKEN={c['token']}") +print(f"SESSION_SECRET={secrets.token_urlsafe(48)}") +print("ALLOWED_GUILD_IDS=457514742940958731") +print("OWNER_DISCORD_IDS=293719842274541579") +PY +echo ".env 작성 완료" diff --git a/docs/dev/live-login.png b/docs/dev/live-login.png new file mode 100644 index 0000000..a8c5ef0 Binary files /dev/null and b/docs/dev/live-login.png differ diff --git a/docs/dev/test-results.md b/docs/dev/test-results.md index 2c87ede..d470875 100644 --- a/docs/dev/test-results.md +++ b/docs/dev/test-results.md @@ -26,3 +26,10 @@ VOICE E2E PASS - `cd app && npm test` — 9개 통과 (Ogg 쓰기, 사전·diff, 경기 상세·시간 표시, 타임라인 조회, 7일 삭제, STT E2E, 가짜 Riot 서버 통합) - `cd worker && .venv/bin/python -m pytest -q` — 39개 통과 + +## M2 사이트 서버 · 사이트 v1 (2026-10-15) + +- `cd site/server && npm test` — 통합 테스트 통과: OAuth(state 쿠키) → 서버 멤버 확인 → 세션 → 기기 등록(1회용 코드, 잘못된 키 거절) → 실제 앱 `RelayClient` 연결 → JSON·음성(바이너리) 중계 → 다른 Origin 쓰기 거절 → 실시간 이벤트 → 연결 끊김 시 잠금(503) → 멤버 아니면 로그인 거절 +- `cd site/web && npm run typecheck && npm run build` — 오류 0. 가짜 서버로 18개 동작(무한 스크롤, 필터 URL, 검색, 재생·단어 강조, 이어듣기, 단축키, 교정, 잠금/해제, 경기 상세) 헤드리스 확인 +- 실서버: https://gvr.tkrmagid.kr 배포. 등록 코드로 개발 서버의 코어를 등록 → `wss://gvr.tkrmagid.kr/device/ws` 로 연결·ping 확인 (`app/scripts/site-e2e.mts`) 후 테스트 기기는 등록 해제 +- 화면: `site/web/screenshots/` (가짜 데이터), `docs/dev/live-login.png` (실서버 로그인 화면) diff --git a/packages/shared/src/protocol.ts b/packages/shared/src/protocol.ts index c3309f5..b850b4c 100644 --- a/packages/shared/src/protocol.ts +++ b/packages/shared/src/protocol.ts @@ -218,7 +218,7 @@ export type RelayToDevice = | { t: 'welcome'; deviceId: string }; export type RelayFromDevice = - | { t: 'hello'; name: string; version: string } + | { t: 'hello'; name: string; version: string; guildId?: string | null } | { t: 'ping'; ts: number } | { t: 'res'; id: string; status: number; headers: Record; body: string | null } | { t: 'res_head'; id: string; status: number; headers: Record } diff --git a/site/server/.gitignore b/site/server/.gitignore new file mode 100644 index 0000000..e129183 --- /dev/null +++ b/site/server/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +dist/ +data/ diff --git a/site/server/package-lock.json b/site/server/package-lock.json new file mode 100644 index 0000000..cd5c3dd --- /dev/null +++ b/site/server/package-lock.json @@ -0,0 +1,2019 @@ +{ + "name": "gvr-site-server", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "gvr-site-server", + "version": "1.0.0", + "dependencies": { + "@fastify/cookie": "^11.0.2", + "@fastify/static": "^8.2.0", + "fastify": "^5.6.1", + "ws": "^8.18.3" + }, + "devDependencies": { + "@types/node": "^22.18.0", + "@types/ws": "^8.18.1", + "esbuild": "^0.25.10", + "tsx": "^4.20.6", + "typescript": "^5.9.3" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz", + "integrity": "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.25.12.tgz", + "integrity": "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.25.12.tgz", + "integrity": "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.25.12.tgz", + "integrity": "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.25.12.tgz", + "integrity": "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.25.12.tgz", + "integrity": "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.25.12.tgz", + "integrity": "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.25.12.tgz", + "integrity": "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.25.12.tgz", + "integrity": "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.25.12.tgz", + "integrity": "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.25.12.tgz", + "integrity": "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.25.12.tgz", + "integrity": "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.25.12.tgz", + "integrity": "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.25.12.tgz", + "integrity": "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.25.12.tgz", + "integrity": "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.25.12.tgz", + "integrity": "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.25.12.tgz", + "integrity": "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.25.12.tgz", + "integrity": "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.25.12.tgz", + "integrity": "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.25.12.tgz", + "integrity": "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.25.12.tgz", + "integrity": "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.25.12.tgz", + "integrity": "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.25.12.tgz", + "integrity": "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.25.12.tgz", + "integrity": "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.25.12.tgz", + "integrity": "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.25.12.tgz", + "integrity": "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@fastify/accept-negotiator": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/accept-negotiator/-/accept-negotiator-2.1.1.tgz", + "integrity": "sha512-gO48sJ/4+P9hYE24tEoWQF4fZvCfRmStf6NFhuT5hwXkH+3JXGdemoE/7ympeQZglieeLJx256rbg8e58IrCyA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/ajv-compiler": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/@fastify/ajv-compiler/-/ajv-compiler-4.0.7.tgz", + "integrity": "sha512-VP0yIfwlc1ohj733keYDqyHm1VWeP9VQxYomunhr90jkC4aNNibbkrRiaNgPgqj1ORxUenILR4qzA/ppYBNAtQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^4.0.0" + } + }, + "node_modules/@fastify/cookie": { + "version": "11.1.3", + "resolved": "https://registry.npmjs.org/@fastify/cookie/-/cookie-11.1.3.tgz", + "integrity": "sha512-RBhlMNsmSG6C5KGiTkhSXBF75xIrUMSytDDBcpnVewhJ8XVYnJTu+SV6FYKXClIRsBuRjOfKbBSULvnPD3X/mg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "cookie": "^2.0.0", + "fastify-plugin": "^6.0.0" + } + }, + "node_modules/@fastify/deepmerge": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/@fastify/deepmerge/-/deepmerge-3.2.2.tgz", + "integrity": "sha512-155eqA/WMQdN6gUD4RrhS2K0Pcz2Ou9pQ86L0sipOpP9ONbTA6oYw/hW4VdBjR4egcDHqmWUK9x80oUX7S1mDQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/error": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/@fastify/error/-/error-4.2.1.tgz", + "integrity": "sha512-MYBumuIwP+5MIpXSyKm6/o1Eigcoij186lWUssX3LH5U8KWqU0ktZhzC4CErIX9EJeQeRGI+zJZQWakBlFbUcg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/fast-json-stringify-compiler": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-5.1.1.tgz", + "integrity": "sha512-pyxRKk7UpUnnrztP9pF4+ZYxusEQ4LifTyzRdiXmyql1QezNHxO02D25MVU2o4kMeAMYWAjG6RKRlojgkbiDAw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "fast-json-stringify": "^7.0.0" + } + }, + "node_modules/@fastify/forwarded": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@fastify/forwarded/-/forwarded-3.1.1.tgz", + "integrity": "sha512-XfDtW2Icvhqi6DP1YHFK4q/E8WpNd3+raBdzAyVZxmTInbFTtnEEKvEAMMOVdFuRyv+ynYipaA9D8FvjPqACkw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@fastify/merge-json-schemas": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@fastify/merge-json-schemas/-/merge-json-schemas-0.2.2.tgz", + "integrity": "sha512-d/gx9sRbUCVgGRGzma46wLcwiY8noTqO2Nmjg/vbTARxHRE5bdh5PIL8s97Lt1X7ScRWRW52eVYxwIoPwIdVUA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "dequal": "^2.0.3" + } + }, + "node_modules/@fastify/proxy-addr": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@fastify/proxy-addr/-/proxy-addr-5.1.2.tgz", + "integrity": "sha512-uqB4QsgVoro0XDC+DIftIMGXHdBPn+lK6Ek3xXAIxPMCJfqxnbtyEoMCm2KPUVOuIosd7Cyw9HawEqMFM/UA+g==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "@fastify/forwarded": "^3.0.0", + "ipaddr.js": "^2.1.0" + } + }, + "node_modules/@fastify/send": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/@fastify/send/-/send-4.1.2.tgz", + "integrity": "sha512-PitRBXg/N4IrE5ToLuP7lITI5Mz8MmP13dv2aMtMNfaGfc5W5hNOwHqcsdQdqu0Lwm5cpDiYLkiOsZTgmhyt2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "@lukeed/ms": "^2.0.2", + "escape-html": "~1.0.3", + "fast-decode-uri-component": "^1.0.1", + "http-errors": "^2.0.0", + "mime": "^3" + } + }, + "node_modules/@fastify/static": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/@fastify/static/-/static-8.3.0.tgz", + "integrity": "sha512-yKxviR5PH1OKNnisIzZKmgZSus0r2OZb8qCSbqmw34aolT4g3UlzYfeBRym+HJ1J471CR8e2ldNub4PubD1coA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "@fastify/accept-negotiator": "^2.0.0", + "@fastify/send": "^4.0.0", + "content-disposition": "^0.5.4", + "fastify-plugin": "^5.0.0", + "fastq": "^1.17.1", + "glob": "^11.0.0" + } + }, + "node_modules/@fastify/static/node_modules/fastify-plugin": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-5.1.0.tgz", + "integrity": "sha512-FAIDA8eovSt5qcDgcBvDuX/v0Cjz0ohGhENZ/wpc3y+oZCY2afZ9Baqql3g/lC+OHRnciQol4ww7tuthOb9idw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/@isaacs/cliui": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-9.0.0.tgz", + "integrity": "sha512-AokJm4tuBHillT+FpMtxQ60n8ObyXBatq7jD2/JA9dxbDDokKQm8KMht5ibGzLVU9IJDIKK4TPKgMHEYMn3lMg==", + "engines": { + "node": ">=18" + } + }, + "node_modules/@lukeed/ms": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@lukeed/ms/-/ms-2.0.2.tgz", + "integrity": "sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==", + "engines": { + "node": ">=8" + } + }, + "node_modules/@pinojs/redact": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/@pinojs/redact/-/redact-0.4.0.tgz", + "integrity": "sha512-k2ENnmBugE/rzQfEcdWHcCY+/FM3VLzH9cYEsbdsoqrvzAKRhUZeRNhAZvB8OitQJ1TBed3yqWtdjzS6wJKBwg==" + }, + "node_modules/@types/node": { + "version": "22.20.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.20.5.tgz", + "integrity": "sha512-U2+DNr+wSjpsTS/wZGYHq7GcwfuSmKiKvoPvK22zwTlRhU91yOniN4qRR5KhIjvif7ysw/dz/hKmfDH0Ris4aA==", + "dev": true, + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/ws": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-67MQl+fpWKVTT1NYdnmo3U4sc/xPo/zQBncVnI74qmQa0z/b+1g6iYqNmGCPbxO+zz2aklb08a0oHfegiVd0/w==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/abstract-logging": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz", + "integrity": "sha512-2BjRTZxTPvheOvGbBslFSYOUkr+SjPtOnrLP33f+VIWLzezQpZcqVg7ja3L4dBXmzzgwT+a029jRx5PCi3JuiA==" + }, + "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==", + "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==", + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/ajv/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" + } + ] + }, + "node_modules/atomic-sleep": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/atomic-sleep/-/atomic-sleep-1.0.0.tgz", + "integrity": "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ==", + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/avvio": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/avvio/-/avvio-9.3.1.tgz", + "integrity": "sha512-QyTKW61/qlba+cUQBm/sT9X8lri4UdomqSDwCnrnj1IvLVDRRiXRkz4CgBRWB+/cmfC7SK5WQc8T1vSdGvaUcQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "@fastify/error": "^4.0.0", + "fastq": "^1.17.1" + } + }, + "node_modules/balanced-match": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz", + "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==", + "engines": { + "node": "18 || 20 || >=22" + } + }, + "node_modules/brace-expansion": { + "version": "5.0.12", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", + "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "dependencies": { + "balanced-match": "^4.0.2" + }, + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-2.0.1.tgz", + "integrity": "sha512-yuToqVvRrj6pfDXREyQAAv8SkAEk/8GS3jQRTiUMm66TVtBYmqQeoEjL2Lmq8Rpo6271vH76InTChTitEAm65w==", + "engines": { + "node": ">=22" + }, + "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==", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "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==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dequal": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", + "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==", + "engines": { + "node": ">=6" + } + }, + "node_modules/esbuild": { + "version": "0.25.12", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.12.tgz", + "integrity": "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.25.12", + "@esbuild/android-arm": "0.25.12", + "@esbuild/android-arm64": "0.25.12", + "@esbuild/android-x64": "0.25.12", + "@esbuild/darwin-arm64": "0.25.12", + "@esbuild/darwin-x64": "0.25.12", + "@esbuild/freebsd-arm64": "0.25.12", + "@esbuild/freebsd-x64": "0.25.12", + "@esbuild/linux-arm": "0.25.12", + "@esbuild/linux-arm64": "0.25.12", + "@esbuild/linux-ia32": "0.25.12", + "@esbuild/linux-loong64": "0.25.12", + "@esbuild/linux-mips64el": "0.25.12", + "@esbuild/linux-ppc64": "0.25.12", + "@esbuild/linux-riscv64": "0.25.12", + "@esbuild/linux-s390x": "0.25.12", + "@esbuild/linux-x64": "0.25.12", + "@esbuild/netbsd-arm64": "0.25.12", + "@esbuild/netbsd-x64": "0.25.12", + "@esbuild/openbsd-arm64": "0.25.12", + "@esbuild/openbsd-x64": "0.25.12", + "@esbuild/openharmony-arm64": "0.25.12", + "@esbuild/sunos-x64": "0.25.12", + "@esbuild/win32-arm64": "0.25.12", + "@esbuild/win32-ia32": "0.25.12", + "@esbuild/win32-x64": "0.25.12" + } + }, + "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==" + }, + "node_modules/fast-decode-uri-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fast-decode-uri-component/-/fast-decode-uri-component-1.0.1.tgz", + "integrity": "sha512-WKgKWg5eUxvRZGwW8FvfbaH7AXSh2cL+3j5fMGzUMCxWBJ3dV3a7Wz8y2f/uQ0e3B6WmodD3oS54jTQ9HVTIIg==" + }, + "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==" + }, + "node_modules/fast-json-stringify": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stringify/-/fast-json-stringify-7.1.0.tgz", + "integrity": "sha512-wAhAQ+es0aH+x5OofdCHlZZFdqwtiM6lpEosaRIwfg271WYeEQ/tPcXdu5vpzlqZpbJ4WNqaW4QR5UjfG4Dc2w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "@fastify/merge-json-schemas": "^0.2.0", + "ajv": "^8.12.0", + "ajv-formats": "^3.0.1", + "fast-uri": "^4.0.0", + "json-schema-ref-resolver": "^3.0.0", + "rfdc": "^1.2.0" + } + }, + "node_modules/fast-querystring": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fast-querystring/-/fast-querystring-1.1.2.tgz", + "integrity": "sha512-g6KuKWmFXc0fID8WWH0jit4g0AGBoJhCkJMb1RmbsSEUNvQ+ZC8D6CUZ+GtF8nMzSPXnhiePyyqqipzNNEnHjg==", + "dependencies": { + "fast-decode-uri-component": "^1.0.1" + } + }, + "node_modules/fast-uri": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-4.2.2.tgz", + "integrity": "sha512-EwVpUMzLVNOmcWW0zi5G3JJwkopB6XXjnVvNBGfqrMMsVew2hkQWl5e/pe/CfYUeS6jt4cIO2MnamEW7v/7wPw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/fastify": { + "version": "5.12.7", + "resolved": "https://registry.npmjs.org/fastify/-/fastify-5.12.7.tgz", + "integrity": "sha512-v4pEPsTRPuqlDIYiQFB+BHjVN4SdHX9u0ABk0ZDUKbbdY1vsNryUd1j4Z+jQEZajvYIVk047Kimva9/AJ79GYw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "@fastify/ajv-compiler": "^4.0.5", + "@fastify/error": "^4.0.0", + "@fastify/fast-json-stringify-compiler": "^5.0.0", + "@fastify/proxy-addr": "^5.0.0", + "abstract-logging": "^2.0.1", + "avvio": "^9.0.0", + "fast-json-stringify": "^7.0.0", + "find-my-way": "^9.6.0", + "light-my-request": "^6.0.0", + "pino": "^9.14.0 || ^10.1.0", + "process-warning": "^5.1.0", + "rfdc": "^1.3.1", + "secure-json-parse": "^4.0.0", + "semver": "^7.6.0", + "toad-cache": "^3.7.0" + } + }, + "node_modules/fastify-plugin": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/fastify-plugin/-/fastify-plugin-6.0.1.tgz", + "integrity": "sha512-4wW4RxSmvPXLrh5mgQEiu43qU3bw44N2ss4FTkTkQIbprUhE+/s43QX0j/ttcztdWK7PEkHqVthdc5GdEGDvjA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/fastq": { + "version": "1.20.3", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.20.3.tgz", + "integrity": "sha512-XKv5nnLs6nLF71NgiKJLIZFLkPyIEuOselLG7ujZnGrRfQK8HpvY+WqKhAJUAdLomwVHErVS4LfxFlPq0/FTAw==", + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/find-my-way": { + "version": "9.10.0", + "resolved": "https://registry.npmjs.org/find-my-way/-/find-my-way-9.10.0.tgz", + "integrity": "sha512-eru+uCPQ2g+nLBkf84MHP/KyNNMar0BDy0j+i8Fb72GF9/YHBZ58q7FODUtfVV7XU9nfRUHXSmaM8NmZcIbZ4Q==", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-querystring": "^1.0.0", + "safe-regex2": "^5.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "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==", + "dependencies": { + "cross-spawn": "^7.0.6", + "signal-exit": "^4.0.1" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/glob": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-11.1.0.tgz", + "integrity": "sha512-vuNwKSaKiqm7g0THUBu2x7ckSs3XJLXE+2ssL7/MfTGPLLcrJQ/4Uq1CjPTtO5cCIiRxqvN6Twy1qOwhL0Xjcw==", + "deprecated": "Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting i@izs.me", + "dependencies": { + "foreground-child": "^3.3.1", + "jackspeak": "^4.1.1", + "minimatch": "^10.1.1", + "minipass": "^7.1.2", + "package-json-from-dist": "^1.0.0", + "path-scurry": "^2.0.0" + }, + "bin": { + "glob": "dist/esm/bin.mjs" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "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==", + "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/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/ipaddr.js": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.5.0.tgz", + "integrity": "sha512-aq+t5NAc+cS6rZQQVWC2x98CPqGtKKTMDd4Gaodv0wShnItdKg/51djkGJ1hqH+Oy0ivDftCbSLCQob8zso01w==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" + }, + "node_modules/jackspeak": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-4.2.3.tgz", + "integrity": "sha512-ykkVRwrYvFm1nb2AJfKKYPr0emF6IiXDYUaFx4Zn9ZuIH7MrzEZ3sD5RlqGXNRpHtvUHJyOnCEFxOlNDtGo7wg==", + "dependencies": { + "@isaacs/cliui": "^9.0.0" + }, + "engines": { + "node": "20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/json-schema-ref-resolver": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/json-schema-ref-resolver/-/json-schema-ref-resolver-3.0.1.tgz", + "integrity": "sha512-w+HwgljXpVwZ3IidoUR1qPZxSOQ+NRQWuVe6a5pe8XbHsNZE4UAwVPUvzZagn7yBKbJtt6UJnRFYbNTRPZI45Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "dequal": "^2.0.3" + } + }, + "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==" + }, + "node_modules/light-my-request": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/light-my-request/-/light-my-request-6.8.0.tgz", + "integrity": "sha512-5Q8PjoSEdtGIB8fikZsTem5vgRo4F2mR6vUKTDW/H1g6MtAt8e3duQbg/QxL5yzg6BZhor2KOUm3hhWMWLTZwg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "@fastify/deepmerge": "^3.1.0", + "cookie": "^2.0.0", + "process-warning": "^5.0.0", + "set-cookie-parser": "^3.0.1" + } + }, + "node_modules/lru-cache": { + "version": "11.5.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-11.5.3.tgz", + "integrity": "sha512-U4N8FgzmWxc8k1VH8Kr6lQg18U7Fjvby6wXHVRX/ZZ7IwWbRMgrRbP0Wrb5q5NVinryp4SQampHKdvtecItxUg==", + "engines": { + "node": "20 || >=22" + } + }, + "node_modules/mime": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-3.0.0.tgz", + "integrity": "sha512-jSCU7/VB1loIWBZe14aEYHU/+1UMEHoaO7qxCOVJOw9GgH72VAWppxNcjU+x9a2k3GSIBXNKxXQFqRvvZ7vr3A==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/minimatch": { + "version": "10.2.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz", + "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==", + "dependencies": { + "brace-expansion": "^5.0.8" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "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==", + "engines": { + "node": ">=16 || 14 >=14.17" + } + }, + "node_modules/on-exit-leak-free": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-2.1.2.tgz", + "integrity": "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==", + "engines": { + "node": ">=14.0.0" + } + }, + "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==" + }, + "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==", + "engines": { + "node": ">=8" + } + }, + "node_modules/path-scurry": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-2.0.2.tgz", + "integrity": "sha512-3O/iVVsJAPsOnpwWIeD+d6z/7PmqApyQePUtCndjatj/9I5LylHvt5qluFaBT3I5h3r1ejfR056c+FCv+NnNXg==", + "dependencies": { + "lru-cache": "^11.0.0", + "minipass": "^7.1.2" + }, + "engines": { + "node": "18 || 20 || >=22" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/pino": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/pino/-/pino-10.4.0.tgz", + "integrity": "sha512-bk1ZMTwG/Vymx+zPoa28MhNzucFvXJWp3csrSuxuHPSMeUettaCoQ5Jvg07mtC4JGNpcfTwz41oVCnNgBK9+vA==", + "dependencies": { + "@pinojs/redact": "^0.4.0", + "atomic-sleep": "^1.0.0", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^3.0.0", + "pino-std-serializers": "^7.0.0", + "process-warning": "^5.0.0", + "quick-format-unescaped": "^4.0.3", + "real-require": "^1.0.0", + "safe-stable-stringify": "^2.3.1", + "sonic-boom": "^4.0.1", + "thread-stream": "^4.0.0" + }, + "bin": { + "pino": "bin.js" + } + }, + "node_modules/pino-abstract-transport": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pino-abstract-transport/-/pino-abstract-transport-3.0.0.tgz", + "integrity": "sha512-wlfUczU+n7Hy/Ha5j9a/gZNy7We5+cXp8YL+X+PG8S0KXxw7n/JXA3c46Y0zQznIJ83URJiwy7Lh56WLokNuxg==", + "dependencies": { + "split2": "^4.0.0" + } + }, + "node_modules/pino-std-serializers": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-7.1.0.tgz", + "integrity": "sha512-BndPH67/JxGExRgiX1dX0w1FvZck5Wa4aal9198SrRhZjH3GxKQUKIBnYJTdj2HDN3UQAS06HlfcSbQj2OHmaw==" + }, + "node_modules/process-warning": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/process-warning/-/process-warning-5.1.1.tgz", + "integrity": "sha512-oCkNVj4OKnKEcocVBcDfiIugN1/cE6rgfT3nCtzeqZPA8+rIxMaQ0xXzIkGP8Gj2qUaP1UR7uhJ1VD8lUCpzCg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/quick-format-unescaped": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz", + "integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg==" + }, + "node_modules/real-require": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/real-require/-/real-require-1.0.0.tgz", + "integrity": "sha512-P4nbQYQfePJxRSmY+v/KINxVucm4NF3p3s7pJveMTtom52FR4YGltUQLB8idDXwDDWW+eYrWDFbuzUnjoWHF7g==" + }, + "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==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ret": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.5.0.tgz", + "integrity": "sha512-I1XxrZSQ+oErkRR4jYbAyEEu2I0avBvvMM5JN+6EBprOGRCs63ENqZ3vjavq8fBw2+62G5LF5XelKwuJpcvcxw==", + "engines": { + "node": ">=10" + } + }, + "node_modules/reusify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz", + "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==", + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==" + }, + "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" + } + ] + }, + "node_modules/safe-regex2": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-regex2/-/safe-regex2-5.1.2.tgz", + "integrity": "sha512-tAtCGFPPP02VroDVzp4daGi6bC7jWG+41D47GKf18FeH/ubvKQHT9VmhAkvtjNOmJwqtApzWeUpEhkyEYULvmw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ], + "dependencies": { + "ret": "~0.5.0" + }, + "bin": { + "safe-regex2": "bin/safe-regex2.js" + } + }, + "node_modules/safe-stable-stringify": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.5.0.tgz", + "integrity": "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/secure-json-parse": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-4.1.1.tgz", + "integrity": "sha512-lnd81MQEZKjhW/Gd2TQqdd4XP6QYNdDW/EP+I7nTrFHP9y2LmaGPIHk9xsnzcOiEr1c39c/e84xFgGviQKBTRw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fastify" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/fastify" + } + ] + }, + "node_modules/semver": { + "version": "7.8.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", + "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/set-cookie-parser": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/set-cookie-parser/-/set-cookie-parser-3.1.3.tgz", + "integrity": "sha512-xletSdAI5efyVJjsatBbzDkXl3M/Zmad3xfnQe7ZXuBB0yNwW7C2WFsNGjdRNfZunmNHQuX79xs/ACMTLCdcew==" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + }, + "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==", + "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==", + "engines": { + "node": ">=8" + } + }, + "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==", + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/sonic-boom": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/sonic-boom/-/sonic-boom-4.2.1.tgz", + "integrity": "sha512-w6AxtubXa2wTXAUsZMMWERrsIRAdrK0Sc+FUytWvYAhBJLyuI4llrMIC1DtlNSdI99EI86KZum2MMq3EAZlF9Q==", + "dependencies": { + "atomic-sleep": "^1.0.0" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/thread-stream": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/thread-stream/-/thread-stream-4.2.0.tgz", + "integrity": "sha512-e2zZ96wSChazBsbENf/Pcm/4swHt2cEKQ92rhUjkL9GCKiTDJIaTBenjE/m9DXi0QBmTMDkFDdOomUy20A1tDQ==", + "dependencies": { + "real-require": "^1.0.0" + }, + "engines": { + "node": ">=20" + } + }, + "node_modules/toad-cache": { + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/toad-cache/-/toad-cache-3.7.4.tgz", + "integrity": "sha512-m1TdR/rvT7kgGJZhspNtXdsdYk0fddFpJJFlG5s+UkPFo6lkLoZ3YLOaovPYjq1R75NP5JfeTlSHaOsE09peCg==", + "engines": { + "node": ">=20" + } + }, + "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==", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tsx": { + "version": "4.23.15", + "resolved": "https://registry.npmjs.org/tsx/-/tsx-4.23.15.tgz", + "integrity": "sha512-Yiex1Ovn8z2xPpOWckIiysV1SSyRMY9BkLF++q0yKiDxCqRhosKfMg3janKkiLBwZ5c/YryloKwGZcrEmtwxKw==", + "dev": true, + "dependencies": { + "esbuild": "~0.28.0" + }, + "bin": { + "tsx": "dist/cli.mjs" + }, + "engines": { + "node": ">=18.0.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + } + }, + "node_modules/tsx/node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/tsx/node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "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==", + "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 + } + } + } + } +} diff --git a/site/server/package.json b/site/server/package.json new file mode 100644 index 0000000..55cbb19 --- /dev/null +++ b/site/server/package.json @@ -0,0 +1,27 @@ +{ + "name": "gvr-site-server", + "version": "1.0.0", + "private": true, + "type": "module", + "description": "겜녹이 사이트 서버: 디스코드 로그인, 게임 PC 연결 확인·중계, 게임 이미지 캐시", + "scripts": { + "build": "esbuild src/main.ts src/cli.ts --bundle --platform=node --format=esm --target=node22 --outdir=dist --packages=external --alias:@gvr/shared=../../packages/shared/src/index.ts", + "start": "node dist/main.js", + "dev": "node --import tsx src/main.ts", + "typecheck": "tsc --noEmit -p .", + "test": "node --import tsx --test test/*.test.ts" + }, + "dependencies": { + "@fastify/cookie": "^11.0.2", + "@fastify/static": "^8.2.0", + "fastify": "^5.6.1", + "ws": "^8.18.3" + }, + "devDependencies": { + "@types/node": "^22.18.0", + "@types/ws": "^8.18.1", + "esbuild": "^0.25.10", + "tsx": "^4.20.6", + "typescript": "^5.9.3" + } +} diff --git a/site/server/src/app.ts b/site/server/src/app.ts new file mode 100644 index 0000000..57a0006 --- /dev/null +++ b/site/server/src/app.ts @@ -0,0 +1,225 @@ +import cookie from '@fastify/cookie'; +import fastifyStatic from '@fastify/static'; +import Fastify, { type FastifyReply, type FastifyRequest } from 'fastify'; +import crypto from 'node:crypto'; +import fs from 'node:fs'; +import path from 'node:path'; +import type { Config } from './config.js'; +import { avatarUrl, DiscordApi } from './discord.js'; +import { RelayHub } from './relay.js'; +import { ServerStore, type Session } from './store.js'; + +const SID = 'gvr_sid'; +const RECHECK_MS = 10 * 60000; + +export async function buildServer(cfg: Config) { + const app = Fastify({ logger: { level: process.env.LOG_LEVEL || 'info' }, trustProxy: true, bodyLimit: 1024 * 1024 }); + const store = new ServerStore(cfg.dataDir); + const hub = new RelayHub(store); + const discord = new DiscordApi(cfg); + await app.register(cookie, { secret: cfg.sessionSecret }); + const secure = cfg.publicUrl.startsWith('https://'); + + const allowedGuilds = (): string[] => { + const g = new Set(cfg.allowedGuilds); + const dg = store.device()?.guildId; + if (dg) g.add(dg); + return [...g]; + }; + + /** 세션 확인. 10분마다 서버 멤버인지 다시 확인 (서버에서 나가면 바로 막힘) */ + async function getSession(req: FastifyRequest): Promise { + const raw = req.cookies[SID]; + if (!raw) return null; + const un = req.unsignCookie(raw); + if (!un.valid || !un.value) return null; + const s = store.session(un.value); + if (!s) return null; + if (Date.now() - s.checkedAt > RECHECK_MS && !cfg.owners.includes(s.user.id)) { + try { + let ok = false; + for (const g of allowedGuilds()) if (await discord.memberOf(g, s.user.id)) ok = true; + if (!ok) { + store.deleteSession(s.id); + return null; + } + store.touchSession(s.id); + } catch { + /* 디스코드 API 장애면 기존 세션 유지 */ + } + } + return s; + } + + const requireSession = async (req: FastifyRequest, reply: FastifyReply): Promise => { + const s = await getSession(req); + if (!s) { + reply.code(401).send({ error: 'unauthorized' }); + return null; + } + return s; + }; + + // ------------------------------------------------------------------ 로그인 + app.get('/auth/discord', async (req, reply) => { + const state = crypto.randomBytes(16).toString('base64url'); + reply.setCookie('gvr_state', state, { path: '/auth', httpOnly: true, secure, sameSite: 'lax', maxAge: 600, signed: true }); + return reply.redirect(discord.authorizeUrl(state)); + }); + + app.get<{ Querystring: { code?: string; state?: string; error?: string } }>('/auth/discord/callback', async (req, reply) => { + const st = req.cookies.gvr_state ? req.unsignCookie(req.cookies.gvr_state) : null; + reply.clearCookie('gvr_state', { path: '/auth' }); + if (req.query.error) return reply.redirect('/?login=cancelled'); + if (!req.query.code || !st?.valid || st.value !== req.query.state) return reply.redirect('/?login=invalid'); + try { + const tok = await discord.exchange(req.query.code); + const u = await discord.me(tok.access_token); + let member: { nick: string | null } | null = null; + for (const g of allowedGuilds()) { + member = await discord.memberOf(g, u.id); + if (member) break; + } + if (!member && !cfg.owners.includes(u.id)) { + req.log.info({ user: u.id }, '서버 멤버가 아니라 로그인 거절'); + return reply.redirect('/?login=not_member'); + } + const s = store.createSession({ id: u.id, name: member?.nick || u.global_name || u.username, avatar: avatarUrl(u) }); + reply.setCookie(SID, s.id, { path: '/', httpOnly: true, secure, sameSite: 'lax', maxAge: 30 * 24 * 3600, signed: true }); + return reply.redirect('/'); + } catch (e) { + req.log.error(e, 'OAuth 실패'); + return reply.redirect('/?login=error'); + } + }); + + app.post('/auth/logout', async (req, reply) => { + const raw = req.cookies[SID]; + const un = raw ? req.unsignCookie(raw) : null; + if (un?.valid && un.value) store.deleteSession(un.value); + reply.clearCookie(SID, { path: '/' }); + return { ok: true }; + }); + + app.get('/auth/me', async (req, reply) => { + const s = await requireSession(req, reply); + if (!s) return; + return { user: s.user, isOwner: cfg.owners.includes(s.user.id) }; + }); + + // ------------------------------------------------------------------ 상태 · 관리 + app.get('/api/status', async (req, reply) => { + const s = await requireSession(req, reply); + if (!s) return; + return { device: hub.status(), server: { version: cfg.version } }; + }); + + app.post('/admin/registration-code', async (req, reply) => { + const s = await requireSession(req, reply); + if (!s) return; + if (!cfg.owners.includes(s.user.id)) return reply.code(403).send({ error: 'forbidden' }); + return store.createCode(s.user.id); + }); + + app.post<{ Body: { code?: string; name?: string } }>('/device/register', async (req, reply) => { + const r = store.redeem(String(req.body?.code ?? ''), String(req.body?.name ?? 'GAME-PC')); + if (!r) return reply.code(400).send({ error: 'invalid_code', message: '등록 코드가 올바르지 않거나 만료되었습니다' }); + req.log.info('게임 PC 등록'); + return r; + }); + + // ------------------------------------------------------------------ 기록 API 중계 + const relay = async (req: FastifyRequest, reply: FastifyReply) => { + const s = await requireSession(req, reply); + if (!s) return; + // 쓰기 요청은 같은 사이트에서 온 것만 (CSRF) + if (req.method !== 'GET') { + const origin = String(req.headers.origin || ''); + if (origin && origin !== cfg.publicUrl) return reply.code(403).send({ error: 'bad_origin' }); + } + const headers: Record = {}; + for (const k of ['range', 'content-type', 'accept']) if (req.headers[k]) headers[k] = String(req.headers[k]); + const body = req.body === undefined || req.body === null ? null : typeof req.body === 'string' ? req.body : JSON.stringify(req.body); + try { + const r = await hub.request(req.method, req.url, headers, s.user, body); + for (const [k, v] of Object.entries(r.headers)) if (k !== 'content-length') reply.header(k, v); + return reply.code(r.status).send(r.body); + } catch (e: any) { + if (e.message === 'device_offline') return reply.code(503).send({ error: 'device_offline' }); + return reply.code(504).send({ error: 'timeout' }); + } + }; + app.route({ method: ['GET', 'POST', 'PATCH', 'PUT', 'DELETE'], url: '/api/*', handler: relay }); + + // ------------------------------------------------------------------ 게임 이미지 캐시 (보고서 7-7) + const cacheDir = path.join(cfg.dataDir, 'asset-cache'); + app.get<{ Params: { src: string; '*': string } }>('/game-assets/:src/*', async (req, reply) => { + const base = cfg.assetUpstream[req.params.src]; + const rel = req.params['*']; + if (!base || !/^[\w\-./]+\.(png|jpg|jpeg|webp)$/i.test(rel) || rel.includes('..')) return reply.code(404).send(); + const file = path.join(cacheDir, req.params.src, rel); + const type = rel.endsWith('.png') ? 'image/png' : rel.endsWith('.webp') ? 'image/webp' : 'image/jpeg'; + reply.header('cache-control', 'public, max-age=604800').type(type); + if (fs.existsSync(file)) return reply.send(fs.createReadStream(file)); + const r = await fetch(base + rel).catch(() => null); + if (!r || !r.ok) return reply.code(r?.status === 404 ? 404 : 502).send(); + const buf = Buffer.from(await r.arrayBuffer()); + fs.mkdirSync(path.dirname(file), { recursive: true }); + fs.writeFileSync(file, buf); + return reply.send(buf); + }); + + app.get('/healthz', async () => 'ok\n'); + + // ------------------------------------------------------------------ 사이트 화면 + if (fs.existsSync(cfg.webDir)) { + await app.register(fastifyStatic, { root: cfg.webDir, wildcard: false, index: ['index.html'] }); + app.setNotFoundHandler((req, reply) => { + if (req.method === 'GET' && !req.url.startsWith('/api/') && !req.url.startsWith('/auth/') && !req.url.startsWith('/game-assets/')) + return reply.type('text/html').send(fs.readFileSync(path.join(cfg.webDir, 'index.html'))); + return reply.code(404).send({ error: 'not_found' }); + }); + } + + // ------------------------------------------------------------------ WebSocket + app.server.on('upgrade', async (req, socket, head) => { + const url = new URL(req.url || '/', 'http://x'); + if (url.pathname === '/device/ws') { + const d = hub.authenticateDevice(req); + if (!d) { + socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n'); + return socket.destroy(); + } + hub.deviceWss.handleUpgrade(req, socket, head, (ws) => hub.attachDevice(ws, d.id)); + return; + } + if (url.pathname === '/ws') { + const fakeReq: any = { cookies: parseCookies(String(req.headers.cookie || '')), unsignCookie: (v: string) => app.unsignCookie(v), log: app.log }; + const s = await getSession(fakeReq); + if (!s) { + socket.write('HTTP/1.1 401 Unauthorized\r\n\r\n'); + return socket.destroy(); + } + hub.browserWss.handleUpgrade(req, socket, head, (ws) => hub.attachBrowser(ws)); + return; + } + socket.destroy(); + }); + + app.addHook('onClose', async () => { + hub.close(); + store.flush(); + }); + + return { app, store, hub }; +} + +function parseCookies(h: string): Record { + const out: Record = {}; + for (const part of h.split(';')) { + const i = part.indexOf('='); + if (i < 0) continue; + out[part.slice(0, i).trim()] = decodeURIComponent(part.slice(i + 1).trim()); + } + return out; +} diff --git a/site/server/src/cli.ts b/site/server/src/cli.ts new file mode 100644 index 0000000..1cdcad2 --- /dev/null +++ b/site/server/src/cli.ts @@ -0,0 +1,26 @@ +// 관리 명령 (컨테이너 안에서): node dist/cli.js code → 게임 PC 1회용 등록 코드 (10분) +import { loadConfig } from './config.js'; +import { ServerStore } from './store.js'; + +const cmd = process.argv[2]; +const dataDir = process.env.DATA_DIR || loadConfigSafe()?.dataDir || 'data'; +const store = new ServerStore(dataDir); +if (cmd === 'code') { + const c = store.createCode('cli', Number(process.argv[3] || 10) * 60000); + console.log(`등록 코드: ${c.code} (만료 ${new Date(c.expiresAt).toLocaleString('ko-KR', { timeZone: 'Asia/Seoul' })})`); +} else if (cmd === 'device') { + console.log(JSON.stringify(store.device(), (k, v) => (k === 'keyHash' ? undefined : v), 2)); +} else if (cmd === 'unregister') { + console.log(`등록 해제: ${store.removeDevices()}대 (서버를 다시 시작하면 연결도 끊긴다)`); +} else { + console.log('사용법: node dist/cli.js code [분] | device | unregister'); +} +store.flush(); + +function loadConfigSafe() { + try { + return loadConfig(); + } catch { + return null; + } +} diff --git a/site/server/src/config.ts b/site/server/src/config.ts new file mode 100644 index 0000000..ec6e2f6 --- /dev/null +++ b/site/server/src/config.ts @@ -0,0 +1,48 @@ +import path from 'node:path'; + +export interface Config { + port: number; + host: string; + publicUrl: string; + clientId: string; + clientSecret: string; + botToken: string; + /** 로그인 허용 디스코드 서버 (기본: M&L). 게임 PC 가 알려 준 서버도 함께 허용 */ + allowedGuilds: string[]; + owners: string[]; + sessionSecret: string; + dataDir: string; + webDir: string; + version: string; + /** 테스트용: 디스코드 API 주소 바꾸기 */ + discordApi: string; + assetUpstream: Record; +} + +export function loadConfig(env = process.env): Config { + const need = (k: string) => { + const v = env[k]; + if (!v) throw new Error(`환경변수 ${k} 가 필요합니다`); + return v; + }; + return { + port: Number(env.PORT || 8080), + host: env.HOST || '0.0.0.0', + publicUrl: (env.PUBLIC_URL || 'https://gvr.tkrmagid.kr').replace(/\/$/, ''), + clientId: need('DISCORD_CLIENT_ID'), + clientSecret: need('DISCORD_CLIENT_SECRET'), + botToken: need('DISCORD_BOT_TOKEN'), + allowedGuilds: (env.ALLOWED_GUILD_IDS || '').split(',').map((s) => s.trim()).filter(Boolean), + owners: (env.OWNER_DISCORD_IDS || '').split(',').map((s) => s.trim()).filter(Boolean), + sessionSecret: need('SESSION_SECRET'), + dataDir: env.DATA_DIR || path.resolve('data'), + webDir: env.WEB_DIR || path.resolve('../web/dist'), + version: env.GVR_VERSION || '1.0.0', + discordApi: env.DISCORD_API || 'https://discord.com/api/v10', + assetUpstream: { + valmedia: 'https://media.valorant-api.com/', + ddragon: 'https://ddragon.leagueoflegends.com/', + cdragon: 'https://raw.communitydragon.org/', + }, + }; +} diff --git a/site/server/src/discord.ts b/site/server/src/discord.ts new file mode 100644 index 0000000..b7a0689 --- /dev/null +++ b/site/server/src/discord.ts @@ -0,0 +1,59 @@ +import type { Config } from './config.js'; + +export interface DiscordUser { + id: string; + username: string; + global_name: string | null; + avatar: string | null; +} + +export class DiscordApi { + constructor(private cfg: Config) {} + + authorizeUrl(state: string): string { + const p = new URLSearchParams({ + client_id: this.cfg.clientId, + response_type: 'code', + redirect_uri: `${this.cfg.publicUrl}/auth/discord/callback`, + scope: 'identify guilds', + state, + prompt: 'none', + }); + return `https://discord.com/oauth2/authorize?${p}`; + } + + async exchange(code: string): Promise<{ access_token: string }> { + const r = await fetch(`${this.cfg.discordApi}/oauth2/token`, { + method: 'POST', + headers: { 'content-type': 'application/x-www-form-urlencoded' }, + body: new URLSearchParams({ + client_id: this.cfg.clientId, + client_secret: this.cfg.clientSecret, + grant_type: 'authorization_code', + code, + redirect_uri: `${this.cfg.publicUrl}/auth/discord/callback`, + }), + }); + if (!r.ok) throw new Error(`token ${r.status} ${await r.text()}`); + return (await r.json()) as { access_token: string }; + } + + async me(accessToken: string): Promise { + const r = await fetch(`${this.cfg.discordApi}/users/@me`, { headers: { authorization: `Bearer ${accessToken}` } }); + if (!r.ok) throw new Error(`users/@me ${r.status}`); + return (await r.json()) as DiscordUser; + } + + /** 봇 토큰으로 서버 멤버인지 확인 (OAuth guilds 목록보다 확실하고, 나중에 다시 확인할 때 사용자 토큰이 필요 없다) */ + async memberOf(guildId: string, userId: string): Promise<{ nick: string | null; avatar: string | null } | null> { + const r = await fetch(`${this.cfg.discordApi}/guilds/${guildId}/members/${userId}`, { headers: { authorization: `Bot ${this.cfg.botToken}` } }); + if (r.status === 404) return null; + if (!r.ok) throw new Error(`member ${r.status}`); + const m: any = await r.json(); + return { nick: m.nick ?? null, avatar: m.avatar ?? null }; + } +} + +export function avatarUrl(u: DiscordUser): string | null { + return u.avatar ? `https://cdn.discordapp.com/avatars/${u.id}/${u.avatar}.png?size=128` : null; +} diff --git a/site/server/src/main.ts b/site/server/src/main.ts new file mode 100644 index 0000000..39e40dc --- /dev/null +++ b/site/server/src/main.ts @@ -0,0 +1,12 @@ +import { buildServer } from './app.js'; +import { loadConfig } from './config.js'; + +const cfg = loadConfig(); +const { app } = await buildServer(cfg); +await app.listen({ host: cfg.host, port: cfg.port }); +const stop = async () => { + await app.close(); + process.exit(0); +}; +process.on('SIGTERM', stop); +process.on('SIGINT', stop); diff --git a/site/server/src/relay.ts b/site/server/src/relay.ts new file mode 100644 index 0000000..473ec67 --- /dev/null +++ b/site/server/src/relay.ts @@ -0,0 +1,205 @@ +import crypto from 'node:crypto'; +import type { IncomingMessage } from 'node:http'; +import { WebSocket, WebSocketServer } from 'ws'; +import type { BrowserMessage, DeviceStatus, LiveEvent, RelayFromDevice, RelayToDevice } from '@gvr/shared'; +import type { ServerStore } from './store.js'; + +const OFFLINE_AFTER_MS = 15000; + +interface Pending { + resolve: (r: RelayResponse) => void; + reject: (e: Error) => void; + timer: NodeJS.Timeout; + head?: { status: number; headers: Record }; + chunks: Buffer[]; +} +export interface RelayResponse { + status: number; + headers: Record; + body: Buffer; +} + +/** + * 게임 PC 연결 하나와 브라우저 연결 여러 개를 잇는다. + * - 게임 PC 가 먼저 연결 (기기 키 인증), 5초마다 ping. 15초 동안 소식이 없으면 오프라인 → 모든 브라우저에 잠금 상태 전송 (Q2) + * - 브라우저의 /api 요청을 게임 PC 로 넘기고 응답을 돌려준다 + */ +export class RelayHub { + private device: { ws: WebSocket; id: string; name: string; version: string | null; lastMsg: number } | null = null; + private browsers = new Set(); + private pending = new Map(); + readonly deviceWss = new WebSocketServer({ noServer: true, maxPayload: 16 * 1024 * 1024 }); + readonly browserWss = new WebSocketServer({ noServer: true, maxPayload: 64 * 1024 }); + private watchdog: NodeJS.Timeout; + private lastStatus = ''; + + constructor(private store: ServerStore) { + this.watchdog = setInterval(() => this.checkAlive(), 2000); + } + + close(): void { + clearInterval(this.watchdog); + this.device?.ws.terminate(); + for (const b of this.browsers) b.terminate(); + } + + status(): DeviceStatus { + const d = this.store.device(); + return { + registered: !!d, + online: !!this.device && Date.now() - this.device.lastMsg < OFFLINE_AFTER_MS, + name: d?.name ?? null, + lastSeen: this.device ? this.device.lastMsg : (d?.lastSeen ?? null), + version: this.device?.version ?? d?.version ?? null, + }; + } + + private broadcastStatus(force = false): void { + const st = this.status(); + const key = `${st.registered}|${st.online}|${st.name}`; + if (!force && key === this.lastStatus) return; + this.lastStatus = key; + this.broadcast({ type: 'status', data: { device: st } }); + } + + private broadcast(m: BrowserMessage): void { + const txt = JSON.stringify(m); + for (const b of this.browsers) if (b.readyState === WebSocket.OPEN) b.send(txt); + } + + private checkAlive(): void { + if (this.device && Date.now() - this.device.lastMsg > OFFLINE_AFTER_MS) { + this.device.ws.terminate(); + this.dropDevice(this.device.ws); + } + this.broadcastStatus(); + } + + // ------------------------------------------------------------------ 게임 PC + authenticateDevice(req: IncomingMessage): { id: string } | null { + const h = String(req.headers.authorization || ''); + const m = /^Device ([0-9a-f]+)\.([\w-]+)$/.exec(h); + if (!m) return null; + const d = this.store.verifyDevice(m[1], m[2]); + return d ? { id: d.id } : null; + } + + attachDevice(ws: WebSocket, id: string): void { + if (this.device) { + // 같은 기기가 다시 연결 (네트워크 재연결) → 이전 연결을 끊는다 + this.device.ws.close(4000, 'replaced'); + this.dropDevice(this.device.ws); + } + const dev = this.store.device(); + this.device = { ws, id, name: dev?.name ?? 'GAME-PC', version: null, lastMsg: Date.now() }; + this.store.touchDevice(id, { lastSeen: Date.now() }); + ws.send(JSON.stringify({ t: 'welcome', deviceId: id } satisfies RelayToDevice)); + ws.on('message', (data, isBinary) => { + if (!this.device || this.device.ws !== ws) return; + this.device.lastMsg = Date.now(); + if (isBinary) return this.onBinary(data as Buffer); + let m: RelayFromDevice; + try { + m = JSON.parse(String(data)); + } catch { + return; + } + this.onDeviceMessage(m); + }); + ws.on('close', () => this.dropDevice(ws)); + ws.on('error', () => this.dropDevice(ws)); + this.broadcastStatus(true); + } + + private dropDevice(ws: WebSocket): void { + if (!this.device || this.device.ws !== ws) return; + this.store.touchDevice(this.device.id, { lastSeen: this.device.lastMsg }); + this.device = null; + for (const [id, p] of this.pending) { + clearTimeout(p.timer); + p.reject(new Error('device_offline')); + this.pending.delete(id); + } + this.broadcastStatus(true); + } + + private onDeviceMessage(m: RelayFromDevice): void { + const dev = this.device!; + switch (m.t) { + case 'hello': + dev.name = m.name; + dev.version = m.version; + this.store.touchDevice(dev.id, { name: m.name, version: m.version, guildId: m.guildId ?? null, lastSeen: Date.now() }); + this.broadcastStatus(true); + break; + case 'ping': + dev.ws.send(JSON.stringify({ t: 'pong', ts: m.ts } satisfies RelayToDevice)); + this.store.touchDevice(dev.id, { lastSeen: Date.now() }); + break; + case 'res': { + const p = this.pending.get(m.id); + if (!p) return; + this.pending.delete(m.id); + clearTimeout(p.timer); + p.resolve({ status: m.status, headers: m.headers, body: Buffer.from(m.body ?? '', 'utf8') }); + break; + } + case 'res_head': { + const p = this.pending.get(m.id); + if (p) p.head = { status: m.status, headers: m.headers }; + break; + } + case 'res_end': { + const p = this.pending.get(m.id); + if (!p || !p.head) return; + this.pending.delete(m.id); + clearTimeout(p.timer); + p.resolve({ status: p.head.status, headers: p.head.headers, body: Buffer.concat(p.chunks) }); + break; + } + case 'event': + this.broadcast(m.event as LiveEvent); + break; + } + } + + private onBinary(buf: Buffer): void { + if (buf.length < 4) return; + const n = buf.readUInt32BE(0); + const id = buf.subarray(4, 4 + n).toString('utf8'); + const p = this.pending.get(id); + if (p) p.chunks.push(buf.subarray(4 + n)); + } + + /** 브라우저 요청 하나를 게임 PC 로 넘긴다 */ + request(method: string, path: string, headers: Record, user: { id: string; name: string; avatar: string | null }, body: string | null, timeoutMs = 20000): Promise { + const dev = this.device; + if (!dev || !this.status().online) return Promise.reject(new Error('device_offline')); + const id = crypto.randomBytes(8).toString('hex'); + return new Promise((resolve, reject) => { + const timer = setTimeout(() => { + if (this.pending.delete(id)) reject(new Error('timeout')); + }, timeoutMs); + this.pending.set(id, { resolve, reject, timer, chunks: [] }); + const msg: RelayToDevice = { t: 'req', id, method, path, headers, user, body }; + dev.ws.send(JSON.stringify(msg)); + }); + } + + // ------------------------------------------------------------------ 브라우저 + attachBrowser(ws: WebSocket): void { + this.browsers.add(ws); + ws.send(JSON.stringify({ type: 'status', data: { device: this.status() } } satisfies BrowserMessage)); + const ping = setInterval(() => ws.readyState === WebSocket.OPEN && ws.ping(), 25000); + ws.on('close', () => { + clearInterval(ping); + this.browsers.delete(ws); + }); + ws.on('message', () => undefined); + } + + /** 로그아웃·세션 만료 시 해당 브라우저 연결 끊기용 */ + get browserCount(): number { + return this.browsers.size; + } +} diff --git a/site/server/src/store.ts b/site/server/src/store.ts new file mode 100644 index 0000000..d25804c --- /dev/null +++ b/site/server/src/store.ts @@ -0,0 +1,152 @@ +import crypto from 'node:crypto'; +import fs from 'node:fs'; +import path from 'node:path'; + +export interface Device { + id: string; + keyHash: string; + name: string; + createdAt: number; + lastSeen: number | null; + version: string | null; + guildId: string | null; +} +export interface Session { + id: string; + user: { id: string; name: string; avatar: string | null }; + createdAt: number; + checkedAt: number; + expiresAt: number; +} +interface Data { + devices: Device[]; + codes: { code: string; expiresAt: number; createdBy: string }[]; + sessions: Session[]; +} +// codes 는 server.json 에 두지 않는다 (codes.json) + +const sha256 = (s: string) => crypto.createHash('sha256').update(s).digest('hex'); + +/** + * 사이트 서버가 저장하는 것은 이것뿐이다: 등록된 게임 PC(기기 키 해시), 1회용 등록 코드, 로그인 세션. + * 기록 내용은 저장하지 않는다 (보고서 3장). + */ +export class ServerStore { + private file: string; + private codesFile: string; + private d: Data; + private saveTimer: NodeJS.Timeout | null = null; + + constructor(dir: string) { + fs.mkdirSync(dir, { recursive: true }); + this.file = path.join(dir, 'server.json'); + this.codesFile = path.join(dir, 'codes.json'); + try { + this.d = JSON.parse(fs.readFileSync(this.file, 'utf8')); + } catch { + this.d = { devices: [], codes: [], sessions: [] }; + } + this.d.devices ||= []; + this.d.sessions ||= []; + } + + private save(now = false): void { + const write = () => { + this.saveTimer = null; + const tmp = this.file + '.tmp'; + fs.writeFileSync(tmp, JSON.stringify(this.d), { mode: 0o600 }); + fs.renameSync(tmp, this.file); + }; + if (now) return write(); + if (!this.saveTimer) this.saveTimer = setTimeout(write, 500); + } + flush(): void { + if (this.saveTimer) { + clearTimeout(this.saveTimer); + this.save(true); + } + } + + // ---- 등록 코드: 관리 CLI(다른 프로세스)도 만들 수 있게 codes.json 을 매번 디스크에서 읽고 쓴다 + private readCodes(): Data['codes'] { + try { + return JSON.parse(fs.readFileSync(this.codesFile, 'utf8')).filter((c: any) => c.expiresAt > Date.now()); + } catch { + return []; + } + } + private writeCodes(codes: Data['codes']): void { + const tmp = this.codesFile + '.tmp'; + fs.writeFileSync(tmp, JSON.stringify(codes), { mode: 0o600 }); + fs.renameSync(tmp, this.codesFile); + } + createCode(createdBy: string, ttlMs = 10 * 60000): { code: string; expiresAt: number } { + const alphabet = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789'; + let code = ''; + for (const b of crypto.randomBytes(8)) code += alphabet[b % alphabet.length]; + code = `${code.slice(0, 4)}-${code.slice(4)}`; + const expiresAt = Date.now() + ttlMs; + this.writeCodes([...this.readCodes(), { code, expiresAt, createdBy }]); + return { code, expiresAt }; + } + /** 코드 확인 후 기기 등록. 한 게임 PC 만 쓰므로 새로 등록하면 이전 기기는 지운다. */ + redeem(code: string, name: string): { deviceId: string; deviceKey: string } | null { + const norm = code.trim().toUpperCase(); + const codes = this.readCodes(); + const c = codes.find((x) => x.code === norm); + if (!c) return null; + this.writeCodes(codes.filter((x) => x !== c)); + const deviceId = crypto.randomBytes(8).toString('hex'); + const deviceKey = crypto.randomBytes(32).toString('base64url'); + this.d.devices = [{ id: deviceId, keyHash: sha256(deviceKey), name: name.slice(0, 40) || 'GAME-PC', createdAt: Date.now(), lastSeen: null, version: null, guildId: null }]; + this.save(true); + return { deviceId, deviceKey }; + } + verifyDevice(id: string, key: string): Device | null { + const d = this.d.devices.find((x) => x.id === id); + if (!d) return null; + const a = Buffer.from(d.keyHash, 'hex'); + const b = Buffer.from(sha256(key), 'hex'); + return a.length === b.length && crypto.timingSafeEqual(a, b) ? d : null; + } + removeDevices(): number { + const n = this.d.devices.length; + this.d.devices = []; + this.save(true); + return n; + } + device(): Device | null { + return this.d.devices[0] ?? null; + } + touchDevice(id: string, patch: Partial>): void { + const d = this.d.devices.find((x) => x.id === id); + if (!d) return; + Object.assign(d, patch); + this.save(); + } + + // ---- 세션 + createSession(user: Session['user'], ttlMs = 30 * 24 * 3600 * 1000): Session { + const s: Session = { id: crypto.randomBytes(24).toString('base64url'), user, createdAt: Date.now(), checkedAt: Date.now(), expiresAt: Date.now() + ttlMs }; + this.d.sessions = this.d.sessions.filter((x) => x.expiresAt > Date.now()); + this.d.sessions.push(s); + this.save(); + return s; + } + session(id: string | undefined): Session | null { + if (!id) return null; + const s = this.d.sessions.find((x) => x.id === id); + return s && s.expiresAt > Date.now() ? s : null; + } + touchSession(id: string): void { + const s = this.d.sessions.find((x) => x.id === id); + if (s) { + s.checkedAt = Date.now(); + this.save(); + } + } + deleteSession(id: string): void { + this.d.sessions = this.d.sessions.filter((x) => x.id !== id); + this.save(); + } +} diff --git a/site/server/test/relay.test.ts b/site/server/test/relay.test.ts new file mode 100644 index 0000000..2ad4042 --- /dev/null +++ b/site/server/test/relay.test.ts @@ -0,0 +1,148 @@ +import { test } from 'node:test'; +import assert from 'node:assert/strict'; +import fs from 'node:fs'; +import http from 'node:http'; +import os from 'node:os'; +import path from 'node:path'; +import WebSocket from 'ws'; +import { buildServer } from '../src/app.ts'; +import type { Config } from '../src/config.ts'; + +const tmp = () => fs.mkdtempSync(path.join(process.env.TMPDIR || os.tmpdir(), 'gvr-site-')); + +/** 가짜 디스코드 API: OAuth 토큰 교환, users/@me, 길드 멤버 */ +async function fakeDiscord(members: Set) { + const srv = http.createServer((req, res) => { + const u = new URL(req.url!, 'http://x'); + res.setHeader('content-type', 'application/json'); + if (u.pathname === '/oauth2/token') return res.end(JSON.stringify({ access_token: 'at-' + 'member1' })); + if (u.pathname === '/users/@me') return res.end(JSON.stringify({ id: 'member1', username: 'seunghan', global_name: '승한', avatar: null })); + const m = /\/guilds\/(\d+)\/members\/(\w+)/.exec(u.pathname); + if (m) { + if (members.has(m[2])) return res.end(JSON.stringify({ nick: '승한', avatar: null })); + res.statusCode = 404; + return res.end('{}'); + } + res.statusCode = 404; + res.end('{}'); + }); + await new Promise((r) => srv.listen(0, '127.0.0.1', () => r())); + return { url: `http://127.0.0.1:${(srv.address() as any).port}`, close: () => srv.close() }; +} + +test('사이트 서버: 로그인 → 기기 등록·연결 → 중계(JSON·음성) → 실시간 이벤트 → 연결 끊김 잠금', async () => { + const members = new Set(['member1']); + const dc = await fakeDiscord(members); + const cfg: Config = { + port: 0, + host: '127.0.0.1', + publicUrl: 'http://127.0.0.1', + clientId: 'cid', + clientSecret: 'secret', + botToken: 'bot', + allowedGuilds: ['111'], + owners: ['owner1'], + sessionSecret: 'x'.repeat(32), + dataDir: tmp(), + webDir: '/nonexistent', + version: 'test', + discordApi: dc.url, + assetUpstream: {}, + }; + const { app, store } = await buildServer(cfg); + await app.listen({ host: '127.0.0.1', port: 0 }); + const base = `http://127.0.0.1:${(app.server.address() as any).port}`; + try { + // 로그인 안 하면 401 + assert.equal((await fetch(base + '/api/status')).status, 401); + // OAuth: state 쿠키 → callback + const start = await fetch(base + '/auth/discord', { redirect: 'manual' }); + assert.equal(start.status, 302); + const loc = new URL(start.headers.get('location')!); + assert.equal(loc.searchParams.get('scope'), 'identify guilds'); + const stateCookie = start.headers.getSetCookie()[0].split(';')[0]; + const cb = await fetch(`${base}/auth/discord/callback?code=abc&state=${loc.searchParams.get('state')}`, { headers: { cookie: stateCookie }, redirect: 'manual' }); + assert.equal(cb.headers.get('location'), '/'); + const sid = cb.headers.getSetCookie().find((c) => c.startsWith('gvr_sid='))!.split(';')[0]; + const me = (await (await fetch(base + '/auth/me', { headers: { cookie: sid } })).json()) as any; + assert.equal(me.user.name, '승한'); + // 기기 없음 → 상태 registered:false, /api 는 503 + let st = (await (await fetch(base + '/api/status', { headers: { cookie: sid } })).json()) as any; + assert.equal(st.device.registered, false); + assert.equal((await fetch(base + '/api/timeline', { headers: { cookie: sid } })).status, 503); + // 등록 코드 → 기기 등록 + const code = store.createCode('test'); + assert.equal((await fetch(base + '/device/register', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ code: 'WRONG', name: 'x' }) })).status, 400); + const reg = (await (await fetch(base + '/device/register', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ code: code.code, name: 'GAME-PC' }) })).json()) as any; + assert.ok(reg.deviceKey); + // 코드는 1회용 + assert.equal((await fetch(base + '/device/register', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ code: code.code, name: 'x' }) })).status, 400); + // 잘못된 키는 거절 + await assert.rejects( + new Promise((res, rej) => { + const w = new WebSocket(base.replace('http', 'ws') + '/device/ws', { headers: { authorization: `Device ${reg.deviceId}.wrong` } }); + w.on('open', res); + w.on('error', rej); + }), + ); + // 브라우저 WS + const bws = new WebSocket(base.replace('http', 'ws') + '/ws', { headers: { cookie: sid } }); + const bmsgs: any[] = []; + bws.on('message', (d) => bmsgs.push(JSON.parse(String(d)))); + await new Promise((r) => bws.on('open', r)); + // 앱 코어 쪽 (실제 RelayClient + Fastify inject) + const { RelayClient } = await import('../../../app/src/core/relay/client.ts'); + const { Bus } = await import('../../../app/src/core/util/events.ts'); + const Fastify = (await import('fastify')).default; + const local = Fastify(); + local.get('/api/timeline', async (req) => ({ items: [], next: null, user: req.headers['x-gvr-user'] })); + local.get('/api/audio/:id', async (_req, reply) => reply.header('content-type', 'audio/ogg').send(Buffer.from('OggS' + 'x'.repeat(5000)))); + local.patch('/api/utterances/:id', async (req) => ({ ok: true, body: req.body })); + const bus = new Bus(); + const rc = new RelayClient(local as any, bus, () => ({ serverUrl: base, deviceId: reg.deviceId, deviceKey: reg.deviceKey, name: 'GAME-PC', version: '1.0.0', guildId: '222' })); + rc.start(); + const wait = async (fn: () => boolean, ms = 5000) => { + const t = Date.now(); + while (!fn()) { + if (Date.now() - t > ms) throw new Error('timeout'); + await new Promise((r) => setTimeout(r, 50)); + } + }; + await wait(() => rc.status.state === 'online'); + await wait(() => bmsgs.some((m) => m.type === 'status' && m.data.device.online)); + st = (await (await fetch(base + '/api/status', { headers: { cookie: sid } })).json()) as any; + assert.equal(st.device.online, true); + // JSON 중계 + const tl = (await (await fetch(base + '/api/timeline?limit=5', { headers: { cookie: sid } })).json()) as any; + assert.deepEqual(tl.items, []); + assert.equal(JSON.parse(decodeURIComponent(tl.user)).id, 'member1'); + // 음성(바이너리) 중계 + const au = await fetch(base + '/api/audio/abc', { headers: { cookie: sid } }); + assert.equal(au.headers.get('content-type'), 'audio/ogg'); + assert.equal((await au.arrayBuffer()).byteLength, 5004); + // 쓰기 요청: 다른 사이트 Origin 은 거절 + assert.equal((await fetch(base + '/api/utterances/a', { method: 'PATCH', headers: { cookie: sid, 'content-type': 'application/json', origin: 'https://evil.example' }, body: '{"text":"x"}' })).status, 403); + const pr = (await (await fetch(base + '/api/utterances/a', { method: 'PATCH', headers: { cookie: sid, 'content-type': 'application/json', origin: cfg.publicUrl }, body: '{"text":"고침"}' })).json()) as any; + assert.equal(pr.body.text, '고침'); + // 실시간 이벤트 → 브라우저 + bus.live({ type: 'recording.state', data: { active: true, channel: '음성', since: 1, participants: [] } }); + await wait(() => bmsgs.some((m) => m.type === 'recording.state')); + // 기기가 알려 준 서버(222) 멤버도 로그인 허용 + assert.equal(store.device()!.guildId, '222'); + // 연결 끊김 → 잠금 + rc.stop(); + await wait(() => bmsgs.some((m) => m.type === 'status' && m.data.device.registered && !m.data.device.online)); + assert.equal((await fetch(base + '/api/timeline', { headers: { cookie: sid } })).status, 503); + // 서버 멤버가 아니면 로그인 거절 + members.clear(); + const s2 = await fetch(base + '/auth/discord', { redirect: 'manual' }); + const l2 = new URL(s2.headers.get('location')!); + const cb2 = await fetch(`${base}/auth/discord/callback?code=abc&state=${l2.searchParams.get('state')}`, { headers: { cookie: s2.headers.getSetCookie()[0].split(';')[0] }, redirect: 'manual' }); + assert.equal(cb2.headers.get('location'), '/?login=not_member'); + bws.close(); + await local.close(); + } finally { + await app.close(); + dc.close(); + } +}); diff --git a/site/server/tsconfig.json b/site/server/tsconfig.json new file mode 100644 index 0000000..a12469a --- /dev/null +++ b/site/server/tsconfig.json @@ -0,0 +1,17 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "esModuleInterop": true, + "skipLibCheck": true, + "noEmit": true, + "allowImportingTsExtensions": true, + "types": ["node"], + "lib": ["ES2023"], + "baseUrl": ".", + "paths": { "@gvr/shared": ["../../packages/shared/src/index.ts"] } + }, + "include": ["src/**/*.ts", "test/**/*.ts", "../../packages/shared/src/**/*.ts"] +} diff --git a/site/web/.gitignore b/site/web/.gitignore new file mode 100644 index 0000000..d4d7e3f --- /dev/null +++ b/site/web/.gitignore @@ -0,0 +1,3 @@ +node_modules +dist +*.log diff --git a/site/web/index.html b/site/web/index.html new file mode 100644 index 0000000..f4c31ac --- /dev/null +++ b/site/web/index.html @@ -0,0 +1,19 @@ + + + + + + + 겜녹이 · Game Voice Recorder + + + + + + + + +
+ + + diff --git a/site/web/mock/audio.mjs b/site/web/mock/audio.mjs new file mode 100644 index 0000000..a289394 --- /dev/null +++ b/site/web/mock/audio.mjs @@ -0,0 +1,109 @@ +// 목 음성: 단어 타이밍(words s/e)에 맞춰 음절마다 모음 비슷한 소리를 합성한 16bit WAV. +// 실제 앱은 Ogg Opus 를 주지만 브라우저 입장에서는 둘 다