diff --git a/README.md b/README.md index 23ba773..7839e06 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,25 @@ Ключ выпускается на странице «MCP-ключи» сервиса; показывается один раз. Статический `TGCLIENT_ADMIN_TOKEN` — супер-бэкдор для скриптов (роль superadmin). +## События в Synapse (`10-platform/notifications.md`) + +Конверты v1, fire-and-forget, клиент `gnexus-synapse`; конфиг — +`TGCLIENT_SYNAPSE_URL/_API_KEY` (+ `_DEFAULT_SOURCE=tgclient-mcp`). +Кому и куда доставить — решает маршрутизация Synapse; в конверте только +факт. `payload.user_id` — `sub` gnexus-auth. + +| событие | subject/action | prio | dedup | когда | +|---|---|---|---|---| +| `tg_account_logged_in` | account/logged_in | high | день+аккаунт | Telegram-сессия добавлена (новая или повторная) | +| `tg_account_logged_out` | account/logged_out | normal | — | логаут аккаунта из SPA | +| `tg_account_auth_lost` | account/auth_lost | high | день+аккаунт | MTProto-ключ умер (сессия отозвана в ТГ) | +| `tg_login_failed` | account/login_failed | normal | день+логин | 3 неверных кода / 2 пароля — логин отменён | +| `tg_flood_wait` | api/flood_wait | high | день+аккаунт | длинный FloodWait (>60 с) в Telethon | +| `mcp_token_issued` | token/issued | normal | — | выпуск персонального MCP-ключа | +| `mcp_token_revoked` | token/revoked | normal | — | ревок ключа (свой или админский) | + +Plaintext MCP-ключа никогда не уходит в конверты (только hint и метаданные). + ## Разработка (без docker) ```bash diff --git a/backend/app/api/mcp_tokens.py b/backend/app/api/mcp_tokens.py index 257da33..4a68e4c 100644 --- a/backend/app/api/mcp_tokens.py +++ b/backend/app/api/mcp_tokens.py @@ -36,6 +36,16 @@ _create_log: dict[str, list[float]] = {} +def _report_revoked(token_id: int, session_email: str = "") -> None: + from app.synapse_report import report + + report("mcp_token_revoked", { + "entity": f"token-{token_id}", + "token_id": token_id, + "user_email": session_email, + }) + + class TokenCreate(BaseModel): name: str = Field(default="", max_length=120) @@ -86,6 +96,18 @@ ) await db.commit() token_id = cursor.lastrowid + from app.synapse_report import report + + # plaintext ключа наружу не идёт — только метаданные выпуска + report("mcp_token_issued", { + "user_id": user_id, + "user_email": session.get("email", ""), + "entity": f"token-{token_id}", + "token_id": token_id, + "token_hint": mcp_token_hint(token), + "name": name or "agent", + "system_role": role, + }) return { "id": token_id, "name": name or "agent", @@ -143,6 +165,7 @@ "UPDATE mcp_tokens SET revoked_at = ? WHERE id = ?", (now_iso(), token_id) ) await db.commit() + _report_revoked(token_id, session.get("email", "")) return {"status": "ok"} @@ -162,7 +185,9 @@ @admin_router.post("/mcp_tokens/{token_id}/revoke") async def admin_revoke_mcp_token(token_id: int) -> dict: db = get_db() - cursor = await db.execute("SELECT id, revoked_at FROM mcp_tokens WHERE id = ?", (token_id,)) + cursor = await db.execute( + "SELECT id, revoked_at, user_email FROM mcp_tokens WHERE id = ?", (token_id,) + ) row = await cursor.fetchone() if row is None: raise HTTPException(status_code=404, detail="token not found") @@ -171,4 +196,5 @@ "UPDATE mcp_tokens SET revoked_at = ? WHERE id = ?", (now_iso(), token_id) ) await db.commit() + _report_revoked(token_id, row["user_email"] or "") return {"status": "ok"} \ No newline at end of file diff --git a/backend/app/synapse_report.py b/backend/app/synapse_report.py index dc5bc23..0f105d0 100644 --- a/backend/app/synapse_report.py +++ b/backend/app/synapse_report.py @@ -4,6 +4,23 @@ gn-synapse-client-py): свой ретрай не строим — доставку маршрутизирует Synapse. Конфиг только env (TGCLIENT_SYNAPSE_*); пустой api_key — интеграция выключена, код ничего не блокирует и не логирует спамом. + +Каталог событий tgclient-mcp (subject/action — для маршрутизации Synapse, +payload.user_id = sub gnexus-auth — конвенция адресации): + +| событие | subject/action | prio | dedup | где эмитится | +|----------------------|-----------------------|--------|----------|--------------| +| tg_account_logged_in | account/logged_in | high | д.+акк | login_flow._finalize (новая и повторная сессия) | +| tg_account_logged_out| account/logged_out | normal | нет | DELETE /accounts/{id} (логаут) | +| tg_account_auth_lost | account/auth_lost | high | д.+акк | manager.note_auth_lost (MTProto-ключ умер) | +| tg_login_failed | account/login_failed | normal | д.+login | login_flow: 3 кода/2 пароля — логин отменён | +| tg_flood_wait | api/flood_wait | high | д.+акк | call_with_flood_guard (длинный FloodWait) | +| mcp_token_issued | token/issued | normal | нет | POST /me/mcp_tokens (plaintext НЕ уходит) | +| mcp_token_revoked | token/revoked | normal | нет | ревок (свой и админский) | + +В конверте нет получателей/каналов/топиков — кому доставить, решает +маршрутизация Synapse. Secrets: plaintext mcp_* только в ответе 201 и +gnexus-creds, никогда в payload. """ import asyncio @@ -29,6 +46,8 @@ "tg_account_auth_lost": Sink("account", "auth_lost", "high", True), "tg_login_failed": Sink("account", "login_failed", "normal", True), "tg_flood_wait": Sink("api", "flood_wait", "high", True), + "mcp_token_issued": Sink("token", "issued", "normal", False), + "mcp_token_revoked": Sink("token", "revoked", "normal", False), } _client = None diff --git a/frontend/package-lock.json b/frontend/package-lock.json new file mode 100644 index 0000000..d2c277c --- /dev/null +++ b/frontend/package-lock.json @@ -0,0 +1,1301 @@ +{ + "name": "tgclient-frontend", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "tgclient-frontend", + "version": "0.1.0", + "dependencies": { + "gnexus-ui-kit": "git+https://git.gnexus.space/git/root/gnexus-ui-kit.git#master", + "vue": "^3.5.0", + "vue-router": "^4.4.0" + }, + "devDependencies": { + "@vitejs/plugin-vue": "^5.1.0", + "vite": "^5.4.0" + } + }, + "node_modules/@babel/helper-string-parser": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz", + "integrity": "sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.29.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz", + "integrity": "sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/parser": { + "version": "7.29.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.9.tgz", + "integrity": "sha512-CjXrNHTnvqBVqHgdBysY3vk2T8tpJHb5/RMeHJBTyVa9xgugCB0CJTx/3oO8RV2QRQP391RWpB7D6hLjm8V9uA==", + "license": "MIT", + "dependencies": { + "@babel/types": "^7.29.8" + }, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/types": { + "version": "7.29.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.8.tgz", + "integrity": "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg==", + "license": "MIT", + "dependencies": { + "@babel/helper-string-parser": "^7.29.7", + "@babel/helper-validator-identifier": "^7.29.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@esbuild/aix-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.21.5.tgz", + "integrity": "sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.21.5.tgz", + "integrity": "sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.21.5.tgz", + "integrity": "sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.21.5.tgz", + "integrity": "sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz", + "integrity": "sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.21.5.tgz", + "integrity": "sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.21.5.tgz", + "integrity": "sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.21.5.tgz", + "integrity": "sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.21.5.tgz", + "integrity": "sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.21.5.tgz", + "integrity": "sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.21.5.tgz", + "integrity": "sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.21.5.tgz", + "integrity": "sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.21.5.tgz", + "integrity": "sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.21.5.tgz", + "integrity": "sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.21.5.tgz", + "integrity": "sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.21.5.tgz", + "integrity": "sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz", + "integrity": "sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.21.5.tgz", + "integrity": "sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.21.5.tgz", + "integrity": "sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.21.5.tgz", + "integrity": "sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.21.5.tgz", + "integrity": "sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.21.5.tgz", + "integrity": "sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.21.5.tgz", + "integrity": "sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "license": "MIT" + }, + "node_modules/@napi-rs/lzma-linux-x64-gnu": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/@napi-rs/lzma-linux-x64-gnu/-/lzma-linux-x64-gnu-1.5.1.tgz", + "integrity": "sha512-oTXEIha4SsuXdTA4Iyskj0kpdx2yVXdhd75c2v3xGrHFfVMsbhTPZU/nMPL4sWKo4pBHm3aucLaqGlF696dTyQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^22.20 || ^24.12 || >=25" + } + }, + "node_modules/@rollup/rollup-android-arm-eabi": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.64.0.tgz", + "integrity": "sha512-FLLpX941CD/7aBvX3GqLGBM9OvY5PGXTryPJkG5r5/OuBpZpV5k45Uo3RxAvqd35tsyc3hH1bhtz921IKzoIzg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-android-arm64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.64.0.tgz", + "integrity": "sha512-iI32XM/jnDYJsvx5ai/za/7gWO9XoSeFFtU06/ZCaRgyilfJOjaopD3nOpk2WrTCGOyeDt4hleUiGOAnd5tHNg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@rollup/rollup-darwin-arm64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.64.0.tgz", + "integrity": "sha512-dRBZlbt2sEtF8Mn4MODThze9fIPdDoOhVSlXMAKy5dQbOYK9pOOoPY4Fat3OTtr0+8zbJo5TTZwlsfxY/kDNJg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-darwin-x64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.64.0.tgz", + "integrity": "sha512-Y3whrJOMucfkhgNkvcM93M6j8C53iEAMmPMYD99C6G1kUy4ELigLWk9ar2/4aCBSRgsql0zdlOemLgW2m5GZgQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@rollup/rollup-freebsd-arm64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.64.0.tgz", + "integrity": "sha512-S6S1GEzPjFF6IONYJX3AKt/799+8RgBgCcwRnUo+Ep1IvBxUbw5M51iU0TDdK2NWWVnSvCQ8yi6Em0fGASMOng==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-freebsd-x64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.64.0.tgz", + "integrity": "sha512-Ed1DPoFENkXj4IGzSB12SesV40iP6LxCCrbTIkSGIQBpOOxpBM+0kj62lmaeIHfMWTDoddqTOtqc7s8LYfn+Pw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@rollup/rollup-linux-arm-gnueabihf": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.64.0.tgz", + "integrity": "sha512-J/6xhutJPtFyIkmHdf4olOdHHKH5kOJNumojdWn+Elv5ICEYTVOa362Vw27TxsK0BLzb1le3EDlO3UbvFK1lnQ==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm-musleabihf": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.64.0.tgz", + "integrity": "sha512-G4L/Nnx59d2LvDoV/P4S5lZ7oVLT6hodOHMacqjiq2LL2gts86KbkEBTYL53+fBt0odhf7XPIbIATGoYiJctxg==", + "cpu": [ + "arm" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.64.0.tgz", + "integrity": "sha512-zF16pvJDEUksGYRbfnXne7pdklAyj2XDmJeYKgP93oq0cUyX9Y8O7lUo1R+IY1GagP/YBvCEDCe7eEcAKpw//g==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-arm64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.64.0.tgz", + "integrity": "sha512-nIggWn8n+w12+R5lsV+PYYoUY8vuObxPAQqJI7WES+9v0qspYuAHoZMfYM0yLxlipasT5BY9ht5W8t5c/rSCkg==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.64.0.tgz", + "integrity": "sha512-WLOTiHPzszP0dxIMsHpFeDSOSB5I49Mj8K4+yKE3H1X/D0JRG5XZ5jrctJLMjnUc/LUzaKiwq6EHWNJ8pup8PA==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-loong64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.64.0.tgz", + "integrity": "sha512-35RK9aRhh7g7Pmeu5gQ01aCvrhXzj9LoBE6xtUcEH1ns+nyTaSzxSpADmBQINu4QiTDGvmQYwo1j5hlg1rRXFw==", + "cpu": [ + "loong64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.64.0.tgz", + "integrity": "sha512-RqTfnpoTjuWfPAmqK5p2edt2AMCDJWm6oTn7sKfmyx+6tRga0ip05SJ977o6udTcIiDeF/CJMUfkaN4gtWt6Aw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-ppc64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.64.0.tgz", + "integrity": "sha512-RQjZPigjxFvFZDijG6rjlSXxhRaTf9zLYVpGK+lVcga64oMqP1GbgVqCb46eHTTceSIgp89Ja0y5aPe3GFBYHg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.64.0.tgz", + "integrity": "sha512-tjL58mgQcTRnDRpeky+Sth1MKQeYi2Ct6r3Luq9E5aTSjnM/i/JbozqZkKqp9thM5+oDSZxo+05f9kdQedfTGA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-riscv64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.64.0.tgz", + "integrity": "sha512-ictoRyVaoZ8C67myHef+8hhCa6IplXJJ/xUCkVCxziV4zxMZh+jvhkhGsPBLqj1S72fnqD0QH5zL4lcaa4X7DQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-s390x-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.64.0.tgz", + "integrity": "sha512-8aVvZ2hfr9RLFzBQkQNmYeHLDja8fLeQAmLt757zdKN/B+8L809KlLJKctQjS22wZotptV8G6o7fVPuAs8S1tQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.64.0.tgz", + "integrity": "sha512-2dEF8GAcDKwshUfydD+GhosppNyBzhVUHkdFF3CXd3FpOkzj/RZzF5aoEtzklujklT5qFVRU2GK/cFeLaTNKVg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-linux-x64-musl": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.64.0.tgz", + "integrity": "sha512-3XHTvoo2hKkh0MiOfS7SkhHjMaaWF7P4F3drocZZaho/Z8w7h/jpnuBHm91BOQLfvrKHs1yR+zir4E8RI3XzTQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@rollup/rollup-openbsd-x64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.64.0.tgz", + "integrity": "sha512-HKtkzodL4a3KFWDXDoO61cRynAWTR3LnAE0oGtfG9lcNFpNuVYUFOByxDgNqEvic9rvaQbAj+SFwTEWDptRaIw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ] + }, + "node_modules/@rollup/rollup-openharmony-arm64": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.64.0.tgz", + "integrity": "sha512-JBsxqiY16uyyCujtoC3s7zL+SrYyNElptD7K4V+KUoJ2V8/XG3hPWpheK+SuPwNh1cikJvIZmIdsrYXvD6PLJw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@rollup/rollup-win32-arm64-msvc": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.64.0.tgz", + "integrity": "sha512-S5Qrijh37qhnUYQ0ay8WN3LuWeKjow7wTUyCOPMZtnXiBXYXdsZETI6ZLfYnQAKovltckPLBFdNeD61P2rJc7g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-ia32-msvc": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.64.0.tgz", + "integrity": "sha512-zbZ6iMmLFEsCtTdc2/y1F/cDFVNNCPF7Ae8PCT/wdPE//hGwYp6r+MyCLMFX+kOeIe09Pz6ASfnnfpSTN1FJQQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-gnu": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.64.0.tgz", + "integrity": "sha512-L6Hw69oNpuYaOr1zCG30v0/DqKYCSRwodPGwIcVZ/6f8SOzq9rxtL/xNVI5MO4wjli+Ko0ErK9uHJL3mNPt8wQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@rollup/rollup-win32-x64-msvc": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.64.0.tgz", + "integrity": "sha512-nl+CTWIgOGszQmUz/kanfgrfFZ4qiwxKIfT/ryl3N3Ewk5tqizmYtNXiqb7Bu/fDtNgu1kyxdFiAUJNur3iysg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@vitejs/plugin-vue": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.2.4.tgz", + "integrity": "sha512-7Yx/SXSOcQq5HiiV3orevHUFn+pmMB4cgbEkDYgnkUWb0WfeQ/wa2yFv6D5ICiCQOVpjA7vYDXrC7AGO8yjDHA==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "peerDependencies": { + "vite": "^5.0.0 || ^6.0.0", + "vue": "^3.2.25" + } + }, + "node_modules/@vue/compiler-core": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.43.tgz", + "integrity": "sha512-zdiLhnbe1QQqgDT8xZMpNmyqZ3qlI+/Q/FHQco57Kwl/b05HhCzN6eVGN9QU9rbga4CrS0H5SYY8VGHZCt/1Hg==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@vue/shared": "3.5.43", + "entities": "^7.0.1", + "estree-walker": "^2.0.2", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-dom": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.43.tgz", + "integrity": "sha512-PEZoAk3NQmsn/ejMzSOCyTYqwGqczrWm70PuhBKjjv1+TCoQAaO/zOqNwjV+honlNstT5ILxtc+8r8UUfj+iEQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-core": "3.5.43", + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/compiler-sfc": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.43.tgz", + "integrity": "sha512-FCbrG3XNCRl+js3huuKx4IVHBLTvMkJhVepjbxSPu1gn4yWLaYtGNQdjJGZaMytXB6qb76qQDDmDSLy/vkmleQ==", + "license": "MIT", + "dependencies": { + "@babel/parser": "^7.29.8", + "@vue/compiler-core": "3.5.43", + "@vue/compiler-dom": "3.5.43", + "@vue/compiler-ssr": "3.5.43", + "@vue/shared": "3.5.43", + "estree-walker": "^2.0.2", + "magic-string": "^0.30.21", + "postcss": "^8.5.28", + "source-map-js": "^1.2.1" + } + }, + "node_modules/@vue/compiler-ssr": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.43.tgz", + "integrity": "sha512-GF62orf7KiJX9RqrHNGrYBudsQGD0OhJ5nDs90O8UiDuS40+YMYomiXu6w6EuvtXuRDc3MSNis3EaaSKAVSWpg==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.43", + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/devtools-api": { + "version": "6.6.4", + "resolved": "https://registry.npmjs.org/@vue/devtools-api/-/devtools-api-6.6.4.tgz", + "integrity": "sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==", + "license": "MIT" + }, + "node_modules/@vue/reactivity": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.43.tgz", + "integrity": "sha512-G/c9GyOZNI2jVaaS6OX1EF1SSFSv7H0ERqNTl4+DTFMlZmB5eVAB53aLQNam/7NL2NPtaDD7RdVrzf8uJzMuOA==", + "license": "MIT", + "dependencies": { + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/runtime-core": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.43.tgz", + "integrity": "sha512-hU6U6VnVhBGQDpvlnnDlIB8ZGJBiOcgk2lh/0InltHiz3D8oSkluvuvY+do1G2H3+udeKFsmaBlgVYP7gXQzEw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.43", + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/runtime-dom": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.43.tgz", + "integrity": "sha512-Bb2Jc0YjjJdMt1SJmb9b2L/IWd3I8lIT9x9eS/xvvP9CiVgna0ffua74xKRmt4/uSJ+0r4iN8ex1jrqkhQGWQw==", + "license": "MIT", + "dependencies": { + "@vue/reactivity": "3.5.43", + "@vue/runtime-core": "3.5.43", + "@vue/shared": "3.5.43", + "csstype": "^3.2.3" + } + }, + "node_modules/@vue/server-renderer": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.43.tgz", + "integrity": "sha512-l2Ygjv9NehV94PSBxNWsAHC0j/eIIKbn92mBuWXAPGLnn6HfJ6MH5ubsd+Nk0YoZ5FRuxWI1P2VSoh+dbPQhCQ==", + "license": "MIT", + "dependencies": { + "@vue/compiler-ssr": "3.5.43", + "@vue/runtime-dom": "3.5.43", + "@vue/shared": "3.5.43" + } + }, + "node_modules/@vue/shared": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.43.tgz", + "integrity": "sha512-uksS7YGMR5NZyr4JNq0Rp+QyLns0ueaz20KwzIPW9R0LH1Vnt4E+XUM29PNseEbf1www2gOuhuDi5AKOIXag9Q==", + "license": "MIT" + }, + "node_modules/csstype": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz", + "integrity": "sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==", + "license": "MIT" + }, + "node_modules/entities": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-7.0.1.tgz", + "integrity": "sha512-TWrgLOFUQTH994YUyl1yT4uyavY5nNB5muff+RtWaqNVCAK408b5ZnnbNAUEWLTCpum9w6arT70i1XdQ4UeOPA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/esbuild": { + "version": "0.21.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", + "integrity": "sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.21.5", + "@esbuild/android-arm": "0.21.5", + "@esbuild/android-arm64": "0.21.5", + "@esbuild/android-x64": "0.21.5", + "@esbuild/darwin-arm64": "0.21.5", + "@esbuild/darwin-x64": "0.21.5", + "@esbuild/freebsd-arm64": "0.21.5", + "@esbuild/freebsd-x64": "0.21.5", + "@esbuild/linux-arm": "0.21.5", + "@esbuild/linux-arm64": "0.21.5", + "@esbuild/linux-ia32": "0.21.5", + "@esbuild/linux-loong64": "0.21.5", + "@esbuild/linux-mips64el": "0.21.5", + "@esbuild/linux-ppc64": "0.21.5", + "@esbuild/linux-riscv64": "0.21.5", + "@esbuild/linux-s390x": "0.21.5", + "@esbuild/linux-x64": "0.21.5", + "@esbuild/netbsd-x64": "0.21.5", + "@esbuild/openbsd-x64": "0.21.5", + "@esbuild/sunos-x64": "0.21.5", + "@esbuild/win32-arm64": "0.21.5", + "@esbuild/win32-ia32": "0.21.5", + "@esbuild/win32-x64": "0.21.5" + } + }, + "node_modules/estree-walker": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz", + "integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==", + "license": "MIT" + }, + "node_modules/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, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/gnexus-ui-kit": { + "version": "1.0.0", + "resolved": "git+https://git.gnexus.space/git/root/gnexus-ui-kit.git#e28f382b7bbf405f9f33e9f5d5b53ad64c1aabf3", + "license": "UNLICENSED", + "peerDependencies": { + "vue": "^3.4.0" + }, + "peerDependenciesMeta": { + "vue": { + "optional": true + } + } + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/nanoid": { + "version": "3.3.20", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz", + "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, + "node_modules/postcss": { + "version": "8.5.29", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.29.tgz", + "integrity": "sha512-49cGhUbXj8Qenv0iTMxA1cFBzxXoctpC9Ujd77t1WcbJIr6nF/eI7g/8MgxrYldFRuAXvja7xQRwavoW7kgrxQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.19", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/rollup": { + "version": "4.64.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.64.0.tgz", + "integrity": "sha512-gjA/kFeDfffII8COoPsvLPvE16hWDTEc1+0QKQNKUkuV8iJjqsC4xXs8/FzuL0v9EV39kuxTbAgcFoTRyy2TGQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "1.0.9" + }, + "bin": { + "rollup": "dist/bin/rollup" + }, + "engines": { + "node": ">=18.0.0", + "npm": ">=8.0.0" + }, + "optionalDependencies": { + "@napi-rs/lzma-linux-x64-gnu": "1.5.1", + "@rollup/rollup-android-arm-eabi": "4.64.0", + "@rollup/rollup-android-arm64": "4.64.0", + "@rollup/rollup-darwin-arm64": "4.64.0", + "@rollup/rollup-darwin-x64": "4.64.0", + "@rollup/rollup-freebsd-arm64": "4.64.0", + "@rollup/rollup-freebsd-x64": "4.64.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.64.0", + "@rollup/rollup-linux-arm-musleabihf": "4.64.0", + "@rollup/rollup-linux-arm64-gnu": "4.64.0", + "@rollup/rollup-linux-arm64-musl": "4.64.0", + "@rollup/rollup-linux-loong64-gnu": "4.64.0", + "@rollup/rollup-linux-loong64-musl": "4.64.0", + "@rollup/rollup-linux-ppc64-gnu": "4.64.0", + "@rollup/rollup-linux-ppc64-musl": "4.64.0", + "@rollup/rollup-linux-riscv64-gnu": "4.64.0", + "@rollup/rollup-linux-riscv64-musl": "4.64.0", + "@rollup/rollup-linux-s390x-gnu": "4.64.0", + "@rollup/rollup-linux-x64-gnu": "4.64.0", + "@rollup/rollup-linux-x64-musl": "4.64.0", + "@rollup/rollup-openbsd-x64": "4.64.0", + "@rollup/rollup-openharmony-arm64": "4.64.0", + "@rollup/rollup-win32-arm64-msvc": "4.64.0", + "@rollup/rollup-win32-ia32-msvc": "4.64.0", + "@rollup/rollup-win32-x64-gnu": "4.64.0", + "@rollup/rollup-win32-x64-msvc": "4.64.0", + "fsevents": "~2.3.2" + } + }, + "node_modules/source-map-js": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", + "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/vite": { + "version": "5.4.21", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.21.tgz", + "integrity": "sha512-o5a9xKjbtuhY6Bi5S3+HvbRERmouabWbyUcpXXUA1u+GNUKoROi9byOJ8M0nHbHYHkYICiMlqxkg1KkYmm25Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "esbuild": "^0.21.3", + "postcss": "^8.4.43", + "rollup": "^4.20.0" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^18.0.0 || >=20.0.0", + "less": "*", + "lightningcss": "^1.21.0", + "sass": "*", + "sass-embedded": "*", + "stylus": "*", + "sugarss": "*", + "terser": "^5.4.0" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "less": { + "optional": true + }, + "lightningcss": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + } + } + }, + "node_modules/vue": { + "version": "3.5.43", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.43.tgz", + "integrity": "sha512-o5qZoksdnjIKvW1srZ3ab7pcDNYAerBjRe54D0LBLfRdCYFrSgBHVXokMas35czQc0//lmx4/tuY4ZNQ+Rf2Ng==", + "license": "MIT", + "dependencies": { + "@vue/compiler-dom": "3.5.43", + "@vue/compiler-sfc": "3.5.43", + "@vue/runtime-dom": "3.5.43", + "@vue/server-renderer": "3.5.43", + "@vue/shared": "3.5.43" + }, + "peerDependencies": { + "typescript": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/vue-router": { + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-4.6.4.tgz", + "integrity": "sha512-Hz9q5sa33Yhduglwz6g9skT8OBPii+4bFn88w6J+J4MfEo4KRRpmiNG/hHHkdbRFlLBOqxN8y8gf2Fb0MTUgVg==", + "license": "MIT", + "dependencies": { + "@vue/devtools-api": "^6.6.4" + }, + "funding": { + "url": "https://github.com/sponsors/posva" + }, + "peerDependencies": { + "vue": "^3.5.0" + } + } + } +} diff --git a/frontend/src/App.vue b/frontend/src/App.vue new file mode 100644 index 0000000..109debc --- /dev/null +++ b/frontend/src/App.vue @@ -0,0 +1,226 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/api.js b/frontend/src/api.js new file mode 100644 index 0000000..4e8b328 --- /dev/null +++ b/frontend/src/api.js @@ -0,0 +1,80 @@ +// API-клиент tgclient. Доступ к API: браузерная cookie-сессия gnexus-auth +// (сервис закрыт SSO) или открытый режим без аутентификации (auth-off); +// TGCLIENT_ADMIN_TOKEN на бэкенде опционален — им подписывают запросы скрипты. + +export class ApiError extends Error { + constructor(status, message) { + super(message) + this.status = status + } +} + +async function request(path, { method = 'GET', body } = {}) { + const response = await fetch('/api/v1' + path, { + method, + headers: { + 'Content-Type': 'application/json', + }, + ...(body !== undefined ? { body: JSON.stringify(body) } : {}), + }) + if (!response.ok) { + let detail = response.statusText + try { + const data = await response.json() + detail = data.detail || detail + } catch { /* не-JSON ответ */ } + // сессия кончилась, пока SPA открыт — сообщаем гейту в App.vue + if (response.status === 401) { + window.dispatchEvent(new CustomEvent('tgclient:unauthenticated')) + } + throw new ApiError(response.status, detail) + } + if (response.status === 204) return null + return response.json() +} + +export const api = { + // Профиль текущего пользователя / флаг режима авторизации: + // { auth_enabled: false, user: null } (сервис открыт) или + // { auth_enabled: true, user: {...}, locale_effective: 'ru' } | 401 (нужно войти) + me: () => request('/me'), + // PATCH /me — только cookie-сессия (у Bearer-токена нет личности для настроек). + // locale: 'en'|'uk'|'ru' или 'auto' (сброс override) + updateMe: (fields) => request('/me', { method: 'PATCH', body: fields }), + + // Аккаунты Telegram (владелец — sub текущего SSO-юзера) + accounts: () => request('/accounts'), + startLogin: (phone, label = '') => + request('/accounts/logins', { method: 'POST', body: { phone, label } }), + loginState: (loginId) => request(`/accounts/logins/${loginId}`), + submitLoginCode: (loginId, code) => + request(`/accounts/logins/${loginId}/code`, { method: 'POST', body: { code } }), + submitLoginPassword: (loginId, password) => + request(`/accounts/logins/${loginId}/password`, { method: 'POST', body: { password } }), + cancelLogin: (loginId) => request(`/accounts/logins/${loginId}`, { method: 'DELETE' }), + connectAccount: (id) => request(`/accounts/${id}/connect`, { method: 'POST' }), + disconnectAccount: (id) => request(`/accounts/${id}/disconnect`, { method: 'POST' }), + // логаут Telegram: отзыв MTProto-ключа + удаление строки аккаунта (необратимо) + logoutAccount: (id) => request(`/accounts/${id}`, { method: 'DELETE' }), + + // Персональные MCP-ключи (только cookie-сессия, как /me PATCH); + // createMcpToken возвращает plaintext-ключ ровно один раз + mcpTokens: () => request('/me/mcp_tokens'), + createMcpToken: (name) => request('/me/mcp_tokens', { method: 'POST', body: { name } }), + revokeMcpToken: (id) => request(`/me/mcp_tokens/${id}/revoke`, { method: 'POST' }), + + // Админка (роль admin/superadmin) + adminOverview: () => request('/admin/overview'), + adminRevokeSession: (id) => request(`/admin/accounts/${id}/revoke_session`, { method: 'POST' }), + + // Служебное + health: async () => { + const r = await fetch('/api/v1/health') + if (!r.ok) throw new ApiError(r.status, r.statusText) + return r.json() + }, + // OAuth не под /api/v1 — служебные пути + logout: async () => { + return fetch('/auth/logout', { method: 'POST' }) + }, +} \ No newline at end of file diff --git a/frontend/src/format.js b/frontend/src/format.js new file mode 100644 index 0000000..75cfbdd --- /dev/null +++ b/frontend/src/format.js @@ -0,0 +1,25 @@ +// Panel formatters. Формат времени локаль-чувствителен (t() читает locale ref +// из i18n — вызовы в computed/шаблонах перерисовываются сами). +import { t } from './i18n/index.js' + +export function fmtAgo(iso) { + if (!iso) return t('time.never') + const seconds = Math.floor((Date.now() - new Date(iso).getTime()) / 1000) + if (seconds < 5) return t('time.now') + if (seconds < 60) return t('time.secondsAgo', { n: seconds }) + if (seconds < 3600) return t('time.minutesAgo', { n: Math.floor(seconds / 60) }) + if (seconds < 86400) return t('time.hoursAgo', { n: Math.floor(seconds / 3600) }) + return t('time.daysAgo', { n: Math.floor(seconds / 86400) }) +} + +// Маска телефона +7***123 — как держит бэкенд (коды/номера не светим в списках) +export function maskPhone(phone) { + if (!phone) return t('time.never') + if (phone.length < 8) return phone + return phone.slice(0, 3) + '***' + phone.slice(-3) +} + +export function fmtDateTime(iso) { + if (!iso) return '—' + return new Date(iso).toLocaleString() +} \ No newline at end of file diff --git a/frontend/src/i18n/index.js b/frontend/src/i18n/index.js new file mode 100644 index 0000000..6f7b35a --- /dev/null +++ b/frontend/src/i18n/index.js @@ -0,0 +1,63 @@ +// Tiny reactive i18n for the SPA (vue-i18n deliberately not pulled in) — +// копия hard-panel: locale ref, t() с {param} и славянскими плюралями, +// плоские словари. Дефолт ставится из backend locale_effective. +import { ref, watch } from 'vue' + +import en from './messages/en.js' +import uk from './messages/uk.js' +import ru from './messages/ru.js' + +const messages = { en, uk, ru } + +// "en-US" -> "en"; отсутствие локали в словарях откатывается на en +export const SUPPORTED_LOCALES = Object.keys(messages) + +export const locale = ref('en') + +function normalizeTag(tag) { + const prefix = String(tag || '').trim().toLowerCase().split(/[-_]/)[0] + return messages[prefix] ? prefix : null +} + +export function setLocale(tag) { + locale.value = normalizeTag(tag) || 'en' +} + +watch(locale, (lang) => { + if (typeof document !== 'undefined') { + document.documentElement.lang = lang + document.title = t('app.docTitle') + } +}) + +function pluralCategory(lang, n) { + // ru/uk: n%10==1 (кроме 11) -> one; 2-4 (кроме 12-14) -> few; иначе many + const mod10 = n % 10 + const mod100 = n % 100 + if (lang === 'ru' || lang === 'uk') { + if (mod10 === 1 && mod100 !== 11) return 'one' + if (mod10 >= 2 && mod10 <= 4 && !(mod100 >= 12 && mod100 <= 14)) return 'few' + return 'many' + } + return n === 1 ? 'one' : 'other' +} + +function interpolate(text, params) { + return text.replace(/\{(\w+)\}/g, (match, key) => + params && key in params ? String(params[key]) : match + ) +} + +function lookup(slug) { + return messages[locale.value]?.[slug] ?? messages.en[slug] +} + +export function t(slug, params) { + let text = lookup(slug) + if (text != null && typeof text === 'object') { + // плюраль {one, few, many, other}; отсутствующая форма падает в other + const n = Number(params?.n ?? 0) + text = text[pluralCategory(locale.value, n)] ?? text.other + } + return text != null ? interpolate(String(text), params) : slug +} \ No newline at end of file diff --git a/frontend/src/i18n/messages/en.js b/frontend/src/i18n/messages/en.js new file mode 100644 index 0000000..9061ddf --- /dev/null +++ b/frontend/src/i18n/messages/en.js @@ -0,0 +1,165 @@ +// English — canonical key set; ru/uk mirror it (missing slug falls back to en). +export default { + // app / shell / nav + 'app.docTitle': 'tgclient', + 'shell.title': 'Telegram accounts', + 'shell.subtitle': 'tgclient', + 'nav.accounts': 'Accounts', + 'nav.mcpKeys': 'MCP keys', + 'nav.admin': 'Admin', + 'nav.settings': 'Settings', + 'nav.signOut': 'Sign out', + + // login screen + 'login.title': 'Sign in', + 'login.subtitle': 'tgclient is protected by gnexus-auth', + 'login.offline': 'No connection — sign-in needs the service to be reachable', + 'login.action': 'Sign in', + + // common + 'common.copy': 'Copy', + 'common.cancel': 'Cancel', + 'common.close': 'Close', + 'common.delete': 'Delete', + 'common.failed': 'Failed', + 'common.loading': 'Loading', + + // time + 'time.never': 'never', + 'time.now': 'just now', + 'time.secondsAgo': '{n} s ago', + 'time.minutesAgo': '{n} min ago', + 'time.hoursAgo': '{n} h ago', + 'time.daysAgo': '{n} d ago', + + // accounts page + 'accounts.title': 'Telegram accounts', + 'accounts.addAccount': 'Add account', + 'accounts.emptyTitle': 'No accounts yet', + 'accounts.emptyText': 'Add your first Telegram account — the code will arrive in the app.', + 'accounts.maxAccounts': 'Accounts: {n} / {limit}', + 'accounts.colPhone': 'Phone', + 'accounts.colUser': 'Telegram user', + 'accounts.colLabel': 'Label', + 'accounts.colStatus': 'Status', + 'accounts.colConnected': 'Connected', + 'accounts.colLastUsed': 'Last used', + 'accounts.colActions': '', + 'accounts.statusActive': 'active', + 'accounts.statusLoggedOut': 'logged out', + 'accounts.statusError': 'error', + 'accounts.connectedYes': 'connected', + 'accounts.connectedNo': 'idle', + 'accounts.connect': 'Connect', + 'accounts.disconnect': 'Disconnect', + 'accounts.delete': 'Log out', + 'accounts.deleteTitle': 'Log out of Telegram?', + 'accounts.deleteMessage': + 'The Telegram session will be revoked (log_out) and the account will be removed from tgclient. This cannot be undone.', + 'accounts.deleted': 'Account removed', + 'accounts.connectFailed': 'Connect failed', + 'accounts.loginAgain': 'Log in again', + + // login wizard + 'wizard.title': 'Add Telegram account', + 'wizard.subtitle': 'Enter the phone number — a login code will arrive in Telegram', + 'wizard.phone': 'Phone (E.164, e.g. +15551234567)', + 'wizard.label': 'Label (optional)', + 'wizard.labelPlaceholder': 'e.g. work', + 'wizard.sendCode': 'Send code', + 'wizard.codeStep': 'Code from Telegram', + 'wizard.codeHint': 'Code sent to {phone} — valid until {until}', + 'wizard.code': 'Code', + 'wizard.submitCode': 'Confirm code', + 'wizard.passwordStep': 'Cloud password (2FA)', + 'wizard.passwordHint': 'This account is protected with a Telegram cloud password', + 'wizard.password': 'Password', + 'wizard.submitPassword': 'Confirm password', + 'wizard.success': 'Account added', + 'wizard.done': 'Done — closing…', + 'wizard.reused': 'A pending login for this number already exists — code already sent', + 'wizard.attemptsLeft': 'Attempts left: {n}', + 'wizard.wrongCode': 'Invalid code', + 'wizard.wrongPassword': 'Invalid password', + 'wizard.cancel': 'Cancel login', + 'wizard.expired': 'Login window expired — start again', + + // mcp keys page + 'mcpKeys.title': 'MCP keys', + 'mcpKeys.myKeys': 'My keys', + 'mcpKeys.myKeysNote': + 'Personal MCP keys let AI agents work with your Telegram accounts. Key role is a snapshot of your role at issue time.', + 'mcpKeys.limits': 'Active: {count} / {limit}', + 'mcpKeys.generate': 'Create key', + 'mcpKeys.newKey': 'New key', + 'mcpKeys.plaintextOnceName': 'The new key will be shown once — right after creation.', + 'mcpKeys.plaintextHint': 'The key is shown once. Save it now — it will not be shown again.', + 'mcpKeys.createdTitle': 'Key created', + 'mcpKeys.keyName': 'Key name', + 'mcpKeys.namePlaceholder': 'e.g. work-agent', + 'mcpKeys.defaultName': 'agent', + 'mcpKeys.authOff': + 'The service is open (gnexus-auth is not configured): personal MCP keys are not issued here — use the static admin token.', + 'mcpKeys.loading': 'Loading keys', + 'mcpKeys.colKey': 'Name', + 'mcpKeys.colTail': 'Tail', + 'mcpKeys.colRole': 'Role', + 'mcpKeys.colCreated': 'Created', + 'mcpKeys.colUsed': 'Last used', + 'mcpKeys.colStatus': 'Status', + 'mcpKeys.colOwner': 'Owner', + 'mcpKeys.badgeActive': 'active', + 'mcpKeys.badgeRevoked': 'revoked', + 'mcpKeys.revoke': 'Revoke', + 'mcpKeys.revokeTitle': 'Revoke key?', + 'mcpKeys.revokeMessage': 'Key "{name}" will stop working immediately. Revocation is permanent.', + 'mcpKeys.revokedTitle': 'Key revoked', + 'mcpKeys.emptyOwn': 'No keys yet', + 'mcpKeys.emptyAll': 'No keys', + 'mcpKeys.allKeysAdmin': 'All keys (admin)', + 'mcpKeys.allKeysNote': 'Every key in the service, including revoked ones.', + 'mcpKeys.howToConnect': 'Connect an agent', + 'mcpKeys.connectNote': + 'Point the agent at the MCP endpoint; account access is limited to your own accounts.', + 'mcpKeys.endpoint': 'MCP endpoint', + + // admin page + 'admin.title': 'Admin', + 'admin.tabUsers': 'Users', + 'admin.tabAccounts': 'Accounts', + 'admin.tabTokens': 'Tokens', + 'admin.notAllowed': 'Admin role required', + 'admin.colUser': 'User', + 'admin.colEmail': 'E-mail', + 'admin.colRole': 'Role', + 'admin.colBlocked': 'Blocked', + 'admin.colOwner': 'Owner', + 'admin.colName': 'Name', + 'admin.colPhone': 'Phone', + 'admin.colStatus': 'Status', + 'admin.colConnected': 'Connected', + 'admin.colLastUsed': 'Last used', + 'admin.colHint': 'Tail', + 'admin.colCreatedAt': 'Created', + 'admin.colActions': '', + 'admin.revokeSession': 'Disconnect', + 'admin.revokeSessionTitle': 'Disconnect client?', + 'admin.revokeSessionMessage': + 'The connected client will be dropped (the session stays in the database — this is not a Telegram logout).', + 'admin.revokeSessionDone': 'Client disconnected', + 'admin.pendingLogins': 'Pending logins: {n} · account limit: {max}', + 'admin.colPendingLabel': 'Label', + 'admin.yes': 'yes', + 'admin.no': 'no', + + // settings page + 'settings.title': 'Settings', + 'settings.locale': 'Language', + 'settings.localeOff': 'default (from account)', + 'settings.localeSaved': 'Language saved', + 'settings.statusTitle': 'Service status', + 'settings.statusVersion': 'Version', + 'settings.statusAccounts': 'Accounts (active / connected / pending logins)', + 'settings.statusDb': 'Database', + 'settings.statusMaxAccounts': 'Account cap per user', +} \ No newline at end of file diff --git a/frontend/src/i18n/messages/ru.js b/frontend/src/i18n/messages/ru.js new file mode 100644 index 0000000..0a27370 --- /dev/null +++ b/frontend/src/i18n/messages/ru.js @@ -0,0 +1,165 @@ +// Русский — полный словарь (тот же набор ключей, что en.js); нет ключа — падает en. +export default { + // app / shell / nav + 'app.docTitle': 'tgclient', + 'shell.title': 'Аккаунты Telegram', + 'shell.subtitle': 'tgclient', + 'nav.accounts': 'Аккаунты', + 'nav.mcpKeys': 'MCP-ключи', + 'nav.admin': 'Админка', + 'nav.settings': 'Настройки', + 'nav.signOut': 'Выйти', + + // login screen + 'login.title': 'Вход', + 'login.subtitle': 'tgclient закрыт gnexus-auth', + 'login.offline': 'Нет соединения — вход требует доступности сервиса', + 'login.action': 'Войти', + + // common + 'common.copy': 'Копировать', + 'common.cancel': 'Отмена', + 'common.close': 'Закрыть', + 'common.delete': 'Удалить', + 'common.failed': 'Не получилось', + 'common.loading': 'Загрузка', + + // time + 'time.never': 'никогда', + 'time.now': 'только что', + 'time.secondsAgo': '{n} с назад', + 'time.minutesAgo': '{n} мин назад', + 'time.hoursAgo': '{n} ч назад', + 'time.daysAgo': '{n} дн назад', + + // accounts page + 'accounts.title': 'Аккаунты Telegram', + 'accounts.addAccount': 'Добавить аккаунт', + 'accounts.emptyTitle': 'Аккаунтов пока нет', + 'accounts.emptyText': 'Добавьте первый Telegram-аккаунт — код придёт в приложение.', + 'accounts.maxAccounts': 'Аккаунты: {n} / {limit}', + 'accounts.colPhone': 'Телефон', + 'accounts.colUser': 'Пользователь ТГ', + 'accounts.colLabel': 'Заметка', + 'accounts.colStatus': 'Статус', + 'accounts.colConnected': 'Подключён', + 'accounts.colLastUsed': 'Использован', + 'accounts.colActions': '', + 'accounts.statusActive': 'активен', + 'accounts.statusLoggedOut': 'вышел', + 'accounts.statusError': 'ошибка', + 'accounts.connectedYes': 'подключён', + 'accounts.connectedNo': 'не активен', + 'accounts.connect': 'Подключить', + 'accounts.disconnect': 'Отключить', + 'accounts.delete': 'Выйти из ТГ', + 'accounts.deleteTitle': 'Выйти из Telegram?', + 'accounts.deleteMessage': + 'Сессия Telegram будет отозвана (log_out), аккаунт удалён из tgclient. Действие необратимо.', + 'accounts.deleted': 'Аккаунт удалён', + 'accounts.connectFailed': 'Не удалось подключить', + 'accounts.loginAgain': 'Перелогиниться', + + // login wizard + 'wizard.title': 'Добавить Telegram-аккаунт', + 'wizard.subtitle': 'Введите номер телефона — код придёт в Telegram', + 'wizard.phone': 'Телефон (E.164, например +79991234567)', + 'wizard.label': 'Заметка (необязательно)', + 'wizard.labelPlaceholder': 'например, рабочий', + 'wizard.sendCode': 'Отправить код', + 'wizard.codeStep': 'Код из Telegram', + 'wizard.codeHint': 'Код отправлен на {phone} — действует до {until}', + 'wizard.code': 'Код', + 'wizard.submitCode': 'Подтвердить код', + 'wizard.passwordStep': 'Cloud-пароль (2FA)', + 'wizard.passwordHint': 'Аккаунт защищён облачным паролем Telegram', + 'wizard.password': 'Пароль', + 'wizard.submitPassword': 'Подтвердить пароль', + 'wizard.success': 'Аккаунт добавлен', + 'wizard.done': 'Готово — закрываю…', + 'wizard.reused': 'По этому номеру уже ждут код — код уже отправлен', + 'wizard.attemptsLeft': 'Осталось попыток: {n}', + 'wizard.wrongCode': 'Неверный код', + 'wizard.wrongPassword': 'Неверный пароль', + 'wizard.cancel': 'Отменить логин', + 'wizard.expired': 'Время логина истекло — начните заново', + + // mcp keys page + 'mcpKeys.title': 'MCP-ключи', + 'mcpKeys.myKeys': 'Мои ключи', + 'mcpKeys.myKeysNote': + 'Персональные MCP-ключи открывают ИИ-агентам ваши Telegram-аккаунты. Роль ключа — снейпшот вашей роли на момент выпуска.', + 'mcpKeys.limits': 'Активных: {count} / {limit}', + 'mcpKeys.generate': 'Выдать ключ', + 'mcpKeys.newKey': 'Новый ключ', + 'mcpKeys.plaintextOnceName': 'Новый ключ будет показан один раз — сразу после создания.', + 'mcpKeys.plaintextHint': 'Ключ показывается один раз. Сохраните его — повторно показан не будет.', + 'mcpKeys.createdTitle': 'Ключ создан', + 'mcpKeys.keyName': 'Имя ключа', + 'mcpKeys.namePlaceholder': 'например, рабочий-агент', + 'mcpKeys.defaultName': 'agent', + 'mcpKeys.authOff': + 'Сервис открыт (gnexus-auth не настроен): персональные ключи не выдаются — используйте статический админ-токен.', + 'mcpKeys.loading': 'Загрузка ключей', + 'mcpKeys.colKey': 'Имя', + 'mcpKeys.colTail': 'Хвост', + 'mcpKeys.colRole': 'Роль', + 'mcpKeys.colCreated': 'Создан', + 'mcpKeys.colUsed': 'Использован', + 'mcpKeys.colStatus': 'Статус', + 'mcpKeys.colOwner': 'Владелец', + 'mcpKeys.badgeActive': 'активен', + 'mcpKeys.badgeRevoked': 'отозван', + 'mcpKeys.revoke': 'Отозвать', + 'mcpKeys.revokeTitle': 'Отозвать ключ?', + 'mcpKeys.revokeMessage': 'Ключ «{name}» перестанет работать сразу. Отзыв необратим.', + 'mcpKeys.revokedTitle': 'Ключ отозван', + 'mcpKeys.emptyOwn': 'Ключей пока нет', + 'mcpKeys.emptyAll': 'Ключей нет', + 'mcpKeys.allKeysAdmin': 'Все ключи (админ)', + 'mcpKeys.allKeysNote': 'Все ключи сервиса, включая отозванные.', + 'mcpKeys.howToConnect': 'Подключение агента', + 'mcpKeys.connectNote': + 'Агент ходит в MCP-эндпоинт; доступ — только к вашим аккаунтам.', + 'mcpKeys.endpoint': 'MCP-эндпоинт', + + // admin page + 'admin.title': 'Админка', + 'admin.tabUsers': 'Пользователи', + 'admin.tabAccounts': 'Аккаунты', + 'admin.tabTokens': 'Ключи', + 'admin.notAllowed': 'Нужна роль admin/superadmin', + 'admin.colUser': 'Пользователь', + 'admin.colEmail': 'E-mail', + 'admin.colRole': 'Роль', + 'admin.colBlocked': 'Заблокирован', + 'admin.colOwner': 'Владелец', + 'admin.colName': 'Имя', + 'admin.colPhone': 'Телефон', + 'admin.colStatus': 'Статус', + 'admin.colConnected': 'Подключён', + 'admin.colLastUsed': 'Использован', + 'admin.colHint': 'Хвост', + 'admin.colCreatedAt': 'Создан', + 'admin.colActions': '', + 'admin.revokeSession': 'Отключить', + 'admin.revokeSessionTitle': 'Отключить клиент?', + 'admin.revokeSessionMessage': + 'Живой клиент аккаунта будет снят с пула (сессия остаётся в БД — это не логаут Telegram).', + 'admin.revokeSessionDone': 'Клиент отключён', + 'admin.pendingLogins': 'Ожидают логина: {n} · лимит аккаунтов: {max}', + 'admin.colPendingLabel': 'Заметка', + 'admin.yes': 'да', + 'admin.no': 'нет', + + // settings page + 'settings.title': 'Настройки', + 'settings.locale': 'Язык', + 'settings.localeOff': 'по умолчанию (из аккаунта)', + 'settings.localeSaved': 'Язык сохранён', + 'settings.statusTitle': 'Состояние сервиса', + 'settings.statusVersion': 'Версия', + 'settings.statusAccounts': 'Аккаунты (активных / подключено / логинов в процессе)', + 'settings.statusDb': 'База данных', + 'settings.statusMaxAccounts': 'Лимит аккаунтов на пользователя', +} \ No newline at end of file diff --git a/frontend/src/i18n/messages/uk.js b/frontend/src/i18n/messages/uk.js new file mode 100644 index 0000000..f96458c --- /dev/null +++ b/frontend/src/i18n/messages/uk.js @@ -0,0 +1,165 @@ +// Українська — повний словник (набір ключів як en.js); немає ключа — падає en. +export default { + // app / shell / nav + 'app.docTitle': 'tgclient', + 'shell.title': 'Акаунти Telegram', + 'shell.subtitle': 'tgclient', + 'nav.accounts': 'Акаунти', + 'nav.mcpKeys': 'MCP-ключі', + 'nav.admin': 'Адмінка', + 'nav.settings': 'Налаштування', + 'nav.signOut': 'Вийти', + + // login screen + 'login.title': 'Вхід', + 'login.subtitle': 'tgclient закрито gnexus-auth', + 'login.offline': 'Немає з\'єднання — вхід вимагає доступності сервісу', + 'login.action': 'Увійти', + + // common + 'common.copy': 'Копіювати', + 'common.cancel': 'Скасувати', + 'common.close': 'Закрити', + 'common.delete': 'Видалити', + 'common.failed': 'Не вийшло', + 'common.loading': 'Завантаження', + + // time + 'time.never': 'ніколи', + 'time.now': 'щойно', + 'time.secondsAgo': '{n} с тому', + 'time.minutesAgo': '{n} хв тому', + 'time.hoursAgo': '{n} год тому', + 'time.daysAgo': '{n} дн тому', + + // accounts page + 'accounts.title': 'Акаунти Telegram', + 'accounts.addAccount': 'Додати акаунт', + 'accounts.emptyTitle': 'Акаунтів ще немає', + 'accounts.emptyText': 'Додайте перший Telegram-акаунт — код прийде в застосунок.', + 'accounts.maxAccounts': 'Акаунти: {n} / {limit}', + 'accounts.colPhone': 'Телефон', + 'accounts.colUser': 'Користувач ТГ', + 'accounts.colLabel': 'Нотатка', + 'accounts.colStatus': 'Статус', + 'accounts.colConnected': 'Підключено', + 'accounts.colLastUsed': 'Використано', + 'accounts.colActions': '', + 'accounts.statusActive': 'активний', + 'accounts.statusLoggedOut': 'вийшов', + 'accounts.statusError': 'помилка', + 'accounts.connectedYes': 'підключено', + 'accounts.connectedNo': 'не активний', + 'accounts.connect': 'Підключити', + 'accounts.disconnect': 'Відключити', + 'accounts.delete': 'Вийти з ТГ', + 'accounts.deleteTitle': 'Вийти з Telegram?', + 'accounts.deleteMessage': + 'Сесію Telegram буде відкликано (log_out), акаунт видалено з tgclient. Дія незворотна.', + 'accounts.deleted': 'Акаунт видалено', + 'accounts.connectFailed': 'Не вдалося підключити', + 'accounts.loginAgain': 'Перелогінитись', + + // login wizard + 'wizard.title': 'Додати Telegram-акаунт', + 'wizard.subtitle': 'Введіть номер телефону — код прийде в Telegram', + 'wizard.phone': 'Телефон (E.164, наприклад +380445551234)', + 'wizard.label': 'Нотатка (необов\'язково)', + 'wizard.labelPlaceholder': 'наприклад, робочий', + 'wizard.sendCode': 'Надіслати код', + 'wizard.codeStep': 'Код з Telegram', + 'wizard.codeHint': 'Код надіслано на {phone} — діє до {until}', + 'wizard.code': 'Код', + 'wizard.submitCode': 'Підтвердити код', + 'wizard.passwordStep': 'Cloud-пароль (2FA)', + 'wizard.passwordHint': 'Акаунт захищено хмарним паролем Telegram', + 'wizard.password': 'Пароль', + 'wizard.submitPassword': 'Підтвердити пароль', + 'wizard.success': 'Акаунт додано', + 'wizard.done': 'Готово — зачиняю…', + 'wizard.reused': 'Для цього номера вже чекають код — код уже надіслано', + 'wizard.attemptsLeft': 'Залишилось спроб: {n}', + 'wizard.wrongCode': 'Невірний код', + 'wizard.wrongPassword': 'Невірний пароль', + 'wizard.cancel': 'Скасувати логін', + 'wizard.expired': 'Час логіна минув — почніть знову', + + // mcp keys page + 'mcpKeys.title': 'MCP-ключі', + 'mcpKeys.myKeys': 'Мої ключі', + 'mcpKeys.myKeysNote': + 'Персональні MCP-ключі відкривають ІІ-агентам ваші Telegram-акаунти. Роль ключа — знімок вашої ролі на момент випуску.', + 'mcpKeys.limits': 'Активних: {count} / {limit}', + 'mcpKeys.generate': 'Видати ключ', + 'mcpKeys.newKey': 'Новий ключ', + 'mcpKeys.plaintextOnceName': 'Новий ключ буде показано один раз — одразу після створення.', + 'mcpKeys.plaintextHint': 'Ключ показується один раз. Збережіть його — повторно показаний не буде.', + 'mcpKeys.createdTitle': 'Ключ створено', + 'mcpKeys.keyName': 'Ім\'я ключа', + 'mcpKeys.namePlaceholder': 'наприклад, робочий-агент', + 'mcpKeys.defaultName': 'agent', + 'mcpKeys.authOff': + 'Сервіс відкритий (gnexus-auth не налаштовано): персональні ключі не видаються — використовуйте статичний адмін-токен.', + 'mcpKeys.loading': 'Завантаження ключів', + 'mcpKeys.colKey': 'Ім\'я', + 'mcpKeys.colTail': 'Хвіст', + 'mcpKeys.colRole': 'Роль', + 'mcpKeys.colCreated': 'Створено', + 'mcpKeys.colUsed': 'Використано', + 'mcpKeys.colStatus': 'Статус', + 'mcpKeys.colOwner': 'Власник', + 'mcpKeys.badgeActive': 'активний', + 'mcpKeys.badgeRevoked': 'відкликаний', + 'mcpKeys.revoke': 'Відкликати', + 'mcpKeys.revokeTitle': 'Відкликати ключ?', + 'mcpKeys.revokeMessage': 'Ключ «{name}» перестане працювати одразу. Відкликання незворотне.', + 'mcpKeys.revokedTitle': 'Ключ відкликано', + 'mcpKeys.emptyOwn': 'Ключів ще немає', + 'mcpKeys.emptyAll': 'Ключів немає', + 'mcpKeys.allKeysAdmin': 'Усі ключі (адмін)', + 'mcpKeys.allKeysNote': 'Усі ключі сервісу, включно з відкликаними.', + 'mcpKeys.howToConnect': 'Підключення агента', + 'mcpKeys.connectNote': + 'Агент ходить на MCP-ендпоінт; доступ — лише до ваших акаунтів.', + 'mcpKeys.endpoint': 'MCP-ендпоінт', + + // admin page + 'admin.title': 'Адмінка', + 'admin.tabUsers': 'Користувачі', + 'admin.tabAccounts': 'Акаунти', + 'admin.tabTokens': 'Ключі', + 'admin.notAllowed': 'Потрібна роль admin/superadmin', + 'admin.colUser': 'Користувач', + 'admin.colEmail': 'E-mail', + 'admin.colRole': 'Роль', + 'admin.colBlocked': 'Заблоковано', + 'admin.colOwner': 'Власник', + 'admin.colName': 'Ім\'я', + 'admin.colPhone': 'Телефон', + 'admin.colStatus': 'Статус', + 'admin.colConnected': 'Підключено', + 'admin.colLastUsed': 'Використано', + 'admin.colHint': 'Хвіст', + 'admin.colCreatedAt': 'Створено', + 'admin.colActions': '', + 'admin.revokeSession': 'Відключити', + 'admin.revokeSessionTitle': 'Відключити клієнт?', + 'admin.revokeSessionMessage': + 'Живий клієнт акаунта буде знято з пулу (сесія залишається в БД — це не логаут Telegram).', + 'admin.revokeSessionDone': 'Клієнт відключено', + 'admin.pendingLogins': 'Чекають логіна: {n} · ліміт акаунтів: {max}', + 'admin.colPendingLabel': 'Нотатка', + 'admin.yes': 'так', + 'admin.no': 'ні', + + // settings page + 'settings.title': 'Налаштування', + 'settings.locale': 'Мова', + 'settings.localeOff': 'за замовчуванням (з акаунта)', + 'settings.localeSaved': 'Мову збережено', + 'settings.statusTitle': 'Стан сервісу', + 'settings.statusVersion': 'Версія', + 'settings.statusAccounts': 'Акаунти (активних / підключено / логінів у процесі)', + 'settings.statusDb': 'База даних', + 'settings.statusMaxAccounts': 'Ліміт акаунтів на користувача', +} \ No newline at end of file diff --git a/frontend/src/main.js b/frontend/src/main.js new file mode 100644 index 0000000..998c561 --- /dev/null +++ b/frontend/src/main.js @@ -0,0 +1,11 @@ +// Точки входа. Стили кита обязательно подключаются в корне приложения. +// Цветовая тема — Verdant (kit-verdant.css из gnexus-ui-kit 1.0). +import 'gnexus-ui-kit/dist/css/kit-verdant.css' +import 'gnexus-ui-kit/dist/assets/fonts/phosphor-icons/src/css/icons.css' + +import { createApp } from 'vue' + +import App from './App.vue' +import { router } from './router.js' + +createApp(App).use(router).mount('#app') \ No newline at end of file diff --git a/frontend/src/pages/AccountsPage.vue b/frontend/src/pages/AccountsPage.vue new file mode 100644 index 0000000..11dd364 --- /dev/null +++ b/frontend/src/pages/AccountsPage.vue @@ -0,0 +1,250 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/pages/AdminPage.vue b/frontend/src/pages/AdminPage.vue new file mode 100644 index 0000000..a776b8e --- /dev/null +++ b/frontend/src/pages/AdminPage.vue @@ -0,0 +1,249 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/pages/LoginWizard.vue b/frontend/src/pages/LoginWizard.vue new file mode 100644 index 0000000..067e895 --- /dev/null +++ b/frontend/src/pages/LoginWizard.vue @@ -0,0 +1,319 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/pages/McpKeysPage.vue b/frontend/src/pages/McpKeysPage.vue new file mode 100644 index 0000000..26b4503 --- /dev/null +++ b/frontend/src/pages/McpKeysPage.vue @@ -0,0 +1,346 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/pages/SettingsPage.vue b/frontend/src/pages/SettingsPage.vue new file mode 100644 index 0000000..5bb5f58 --- /dev/null +++ b/frontend/src/pages/SettingsPage.vue @@ -0,0 +1,118 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/router.js b/frontend/src/router.js new file mode 100644 index 0000000..d55b6cd --- /dev/null +++ b/frontend/src/router.js @@ -0,0 +1,35 @@ +import { createRouter, createWebHistory } from 'vue-router' + +export const router = createRouter({ + history: createWebHistory(), + routes: [ + { + path: '/', + redirect: '/accounts', + }, + { + path: '/accounts', + name: 'accounts', + component: () => import('./pages/AccountsPage.vue'), + }, + { + path: '/keys', + name: 'mcpKeys', + component: () => import('./pages/McpKeysPage.vue'), + }, + { + path: '/admin', + name: 'admin', + component: () => import('./pages/AdminPage.vue'), + }, + { + path: '/settings', + name: 'settings', + component: () => import('./pages/SettingsPage.vue'), + }, + { + path: '/:pathMatch(.*)*', + redirect: '/accounts', + }, + ], +}) \ No newline at end of file diff --git a/frontend/vite.config.js b/frontend/vite.config.js index b12a4e0..648a750 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -18,9 +18,9 @@ // в dev фронт на :5173, API и auth проксируются на локальный бэкенд // (порт наружу tgclient — TGCLIENT_PORT, по умолчанию 8710) proxy: { - '/api': 'http://127.0.0.1:8710', - '/auth': 'http://127.0.0.1:8710', - '/webhooks': 'http://127.0.0.1:8710', + '/api': 'http://127.0.0.1:8044', + '/auth': 'http://127.0.0.1:8044', + '/webhooks': 'http://127.0.0.1:8044', }, }, build: {