feat(agiliton-account): Phase 1 service scaffold

TypeScript + Fastify service implementing:
- Google + Microsoft SSO (POST /v1/auth/sso/{google,microsoft})
- JWT issuance + LiteLLM virtual key provisioning on first login
- AES-256-GCM encrypted virtual key storage in Postgres
- Conversation CRUD (GET/POST/DELETE /v1/conversations, /messages)
- GDPR export + soft-delete (/v1/me/export, /v1/me/delete)
- WebSocket MCP bridge (/v1/mcp-bridge) with JWT auth
- MCP demux endpoint (/mcp/demux/:customer_id/mcp) for LiteLLM tool routing
- DB migration script creating sb_customers, sb_conversations, sb_messages
- 9 unit tests (bridge + crypto), all passing
- Dockerfile + docker-compose targeting port 4100

CF-3032

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Christian Gick
2026-04-10 16:06:16 +03:00
commit 7ab23554c0
26 changed files with 4855 additions and 0 deletions

35
package.json Normal file
View File

@@ -0,0 +1,35 @@
{
"name": "agiliton-account",
"version": "1.0.0",
"description": "Agiliton customer account service — SSO auth, conversation history, MCP WebSocket bridge",
"type": "module",
"main": "dist/index.js",
"scripts": {
"build": "tsc",
"start": "node dist/index.js",
"dev": "tsx watch src/index.ts",
"test": "vitest run",
"test:watch": "vitest",
"migrate": "node dist/db/migrate.js",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"@fastify/cors": "^9.0.0",
"@fastify/jwt": "^8.0.0",
"@fastify/websocket": "^10.0.0",
"fastify": "^4.28.0",
"google-auth-library": "^9.14.0",
"pg": "^8.12.0",
"redis": "^4.7.0",
"uuid": "^10.0.0",
"@mswjs/interceptors": "^0.37.0"
},
"devDependencies": {
"@types/node": "^22.0.0",
"@types/pg": "^8.11.0",
"@types/uuid": "^10.0.0",
"tsx": "^4.19.0",
"typescript": "^5.5.0",
"vitest": "^2.0.0"
}
}