b5c600ad81
Carve the platform super-admin API (/admin-api) and plaza operations console API (/api/ops/v1) out of the public server.mjs into their own process, so the user-facing fleet can no longer be taken down or scaled by back-office traffic. Architecture (split-ready, single process for now): - admin-routes.mjs: createAdminApi / createOpsApi route factories (DI, single source of truth; the route logic moved verbatim out of server.mjs). - admin-bootstrap.mjs: lean service container (user-auth, LLM providers, minimal plaza graph) with no user-facing daemons. - admin-server.mjs: standalone entry with a console registry. ADMIN_CONSOLES selects which consoles a process mounts (default both), so splitting into two processes later is a config change, not a code change. - admin-guard.mjs (+ tests): per-console host / IP-CIDR allowlists, letting the super-admin surface be locked down harder than moderation. server.mjs no longer serves or mounts either surface. user-auth.mjs gains pagination on listUsers/listUsageRecords/listBillingLedger to back the admin dashboards. dev.mjs launches memind_adm; the ops SPA proxies /api to it while /auth stays on the portal. Sessions are read from the shared cookie (H5_COOKIE_DOMAIN=.tkmind.cn); login stays on the main domain. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
66 lines
3.6 KiB
JSON
66 lines
3.6 KiB
JSON
{
|
|
"name": "tkmind-h5",
|
|
"private": true,
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "node scripts/dev.mjs",
|
|
"dev:plaza": "node scripts/dev-plaza.mjs",
|
|
"start:plaza": "node scripts/start-plaza-prod.mjs",
|
|
"dev:plaza-proxy": "node scripts/plaza-local-proxy.mjs",
|
|
"setup:plaza-dns": "node scripts/setup-plaza-local-dns.mjs",
|
|
"setup:plaza-dns:remove": "node scripts/setup-plaza-local-dns.mjs --remove",
|
|
"dev:plaza-dns": "node scripts/plaza-local-dns-server.mjs",
|
|
"open:plaza": "node scripts/open-plaza-local.mjs",
|
|
"check:plaza": "node scripts/check-plaza-local.mjs",
|
|
"setup:plaza-local": "node scripts/setup-plaza-local.mjs",
|
|
"setup:plaza-tunnel": "bash scripts/install-plaza-tunnel.sh",
|
|
"setup:plaza-tls": "node scripts/plaza-local-tls.mjs",
|
|
"dev:vite": "vite",
|
|
"dev:server": "node server.mjs",
|
|
"dev:adm": "node admin-server.mjs",
|
|
"dev:plaza-express": "node plaza-server.mjs",
|
|
"dev:ops": "cd ops && npm run dev",
|
|
"ops:grant": "node scripts/grant-ops-role.mjs",
|
|
"seed:plaza": "node scripts/seed-plaza-demo.mjs",
|
|
"seed:plaza-covers": "node scripts/seed-plaza-covers.mjs",
|
|
"enrich:plaza": "node scripts/enrich-plaza-posts.mjs",
|
|
"build": "vite build",
|
|
"test": "node --test auth.test.mjs asr-proxy.test.mjs billing.test.mjs billing-recharge.test.mjs wechat-pay.test.mjs wechat-oauth.test.mjs capabilities.test.mjs policies.test.mjs chat-skills.test.mjs user-publish.test.mjs user-memory-profile.test.mjs skills-registry.test.mjs mindspace.test.mjs mindspace-scan.test.mjs mindspace-assets.test.mjs mindspace-pages.test.mjs mindspace-publications.test.mjs mindspace-chat-save.test.mjs mindspace-chat-context.test.mjs mindspace-content-scan.test.mjs mindspace-html-localize.test.mjs mindspace-visual-editor.test.mjs mindspace-cleanup.test.mjs mindspace-thumbnails.test.mjs mindspace-workspace-thumbnails.test.mjs mindspace-workspace-sync.test.mjs mindspace-asset-preview.test.mjs mindspace-agent-jobs.test.mjs mindspace-agent-runner.test.mjs message-stream.test.mjs plaza-posts.test.mjs plaza-interactions.test.mjs plaza-algorithm.test.mjs plaza-seo.test.mjs plaza-ops.test.mjs user-auth.test.mjs llm-providers.test.mjs admin-guard.test.mjs",
|
|
"test:mindspace-e2e": "node scripts/mindspace-e2e.mjs",
|
|
"test:mindspace-pages-e2e": "node scripts/mindspace-pages-e2e.mjs",
|
|
"test:mindspace-publications-e2e": "node scripts/mindspace-publications-e2e.mjs",
|
|
"test:mindspace-agent-jobs-e2e": "node scripts/mindspace-agent-jobs-e2e.mjs",
|
|
"test:fruit-john-e2e": "node scripts/fruit-theme-john-e2e.mjs",
|
|
"generate:openapi": "node scripts/generate-openapi.mjs",
|
|
"check:openapi": "node scripts/generate-openapi.mjs && git diff --ignore-space-change --exit-code openapi.json",
|
|
"test:local": "vite build && node server.mjs",
|
|
"preview": "node server.mjs",
|
|
"start": "pnpm run build && node server.mjs",
|
|
"deploy:prod": "bash ../../deploy/deploy-h5-prod.sh",
|
|
"deploy:105": "bash scripts/sync-to-105.sh",
|
|
"deploy:plaza-105": "bash scripts/deploy-plaza-105.sh"
|
|
},
|
|
"dependencies": {
|
|
"debug": "^4.4.3",
|
|
"express": "^4.21.2",
|
|
"http-proxy-middleware": "^3.0.3",
|
|
"jsonrepair": "^3.14.0",
|
|
"mysql2": "^3.22.5",
|
|
"qrcode": "^1.5.4",
|
|
"react": "^19.0.0",
|
|
"react-dom": "^19.0.0",
|
|
"react-router-dom": "^7.13.1",
|
|
"redis": "^4.7.1",
|
|
"undici": "^6.26.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/react": "^19.0.10",
|
|
"@types/react-dom": "^19.0.4",
|
|
"@vitejs/plugin-react": "^4.3.4",
|
|
"happy-dom": "^20.10.2",
|
|
"typescript": "^5.8.2",
|
|
"vite": "^6.2.0"
|
|
}
|
|
}
|