Files
stack/apps/api/package.json
Jason Woltje fd38fc94d0
Some checks failed
ci/woodpecker/push/orchestrator Pipeline failed
ci/woodpecker/push/web Pipeline failed
ci/woodpecker/push/api Pipeline failed
feat(api): add terminal WebSocket gateway with PTY session management
Implements CT-TERM-001: WebSocket-based terminal service that spawns real
shell sessions via node-pty and streams I/O to connected clients.

- Add node-pty dependency and configure pnpm build permissions
- Create TerminalModule with Gateway, Service, and DTOs
- TerminalGateway: /terminal namespace, auth via handshake token,
  workspace-scoped rooms, handles terminal:create/input/resize/close events
- TerminalService: manages IPty sessions per workspace with max 10 session
  limit, cleanup on disconnect
- DTOs: CreateTerminalDto, TerminalInputDto, TerminalResizeDto, CloseTerminalDto
  with class-validator decorators
- Unit tests: 25 gateway tests + 23 service tests (all passing)
- Register TerminalModule in AppModule

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-25 20:26:31 -06:00

105 lines
3.3 KiB
JSON

{
"name": "@mosaic/api",
"version": "0.0.1",
"private": true,
"scripts": {
"build": "nest build",
"dev": "nest start --watch",
"start": "node dist/main",
"start:debug": "nest start --debug --watch",
"start:prod": "node dist/main",
"lint": "eslint \"src/**/*.ts\"",
"lint:fix": "eslint \"src/**/*.ts\" --fix",
"typecheck": "tsc --noEmit",
"clean": "rm -rf dist",
"test": "vitest run",
"test:watch": "vitest",
"test:coverage": "vitest run --coverage",
"test:e2e": "vitest run --config ./vitest.e2e.config.ts",
"prisma:generate": "prisma generate",
"prisma:migrate": "prisma migrate dev",
"prisma:migrate:prod": "prisma migrate deploy",
"prisma:studio": "prisma studio",
"prisma:seed": "prisma db seed",
"prisma:reset": "prisma migrate reset",
"migrate:encrypt-llm-keys": "tsx scripts/encrypt-llm-keys.ts"
},
"dependencies": {
"@anthropic-ai/sdk": "^0.72.1",
"@mosaic/shared": "workspace:*",
"@mosaicstack/telemetry-client": "^0.1.1",
"@nestjs/axios": "^4.0.1",
"@nestjs/bullmq": "^11.0.4",
"@nestjs/common": "^11.1.12",
"@nestjs/config": "^4.0.2",
"@nestjs/core": "^11.1.12",
"@nestjs/mapped-types": "^2.1.0",
"@nestjs/platform-express": "^11.1.12",
"@nestjs/platform-socket.io": "^11.1.12",
"@nestjs/throttler": "^6.5.0",
"@nestjs/websockets": "^11.1.12",
"@opentelemetry/api": "^1.9.0",
"@opentelemetry/auto-instrumentations-node": "^0.55.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.56.0",
"@opentelemetry/instrumentation-nestjs-core": "^0.44.0",
"@opentelemetry/resources": "^1.30.1",
"@opentelemetry/sdk-node": "^0.56.0",
"@opentelemetry/sdk-trace-base": "^2.5.0",
"@opentelemetry/semantic-conventions": "^1.28.0",
"@prisma/client": "^6.19.2",
"@types/marked": "^6.0.0",
"@types/multer": "^2.0.0",
"adm-zip": "^0.5.16",
"archiver": "^7.0.1",
"axios": "^1.13.5",
"better-auth": "^1.4.17",
"bullmq": "^5.67.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.3",
"cookie-parser": "^1.4.7",
"discord.js": "^14.25.1",
"gray-matter": "^4.0.3",
"highlight.js": "^11.11.1",
"ioredis": "^5.9.2",
"jose": "^6.1.3",
"marked": "^17.0.1",
"marked-gfm-heading-id": "^4.1.3",
"marked-highlight": "^2.2.3",
"matrix-bot-sdk": "^0.8.0",
"node-pty": "^1.0.0",
"ollama": "^0.6.3",
"openai": "^6.17.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1",
"sanitize-html": "^2.17.0",
"slugify": "^1.6.6",
"socket.io": "^4.8.3"
},
"devDependencies": {
"@better-auth/cli": "^1.4.17",
"@mosaic/config": "workspace:*",
"@nestjs/cli": "^11.0.6",
"@nestjs/schematics": "^11.0.1",
"@nestjs/testing": "^11.1.12",
"@opentelemetry/context-async-hooks": "^2.5.0",
"@swc/core": "^1.10.18",
"@types/adm-zip": "^0.5.7",
"@types/archiver": "^7.0.0",
"@types/cookie-parser": "^1.4.10",
"@types/express": "^5.0.1",
"@types/highlight.js": "^10.1.0",
"@types/node": "^22.13.4",
"@types/sanitize-html": "^2.16.0",
"@types/supertest": "^6.0.3",
"@vitest/coverage-v8": "^4.0.18",
"dotenv": "^17.2.4",
"express": "^5.2.1",
"prisma": "^6.19.2",
"supertest": "^7.2.2",
"tsx": "^4.21.0",
"typescript": "^5.8.2",
"unplugin-swc": "^1.5.2",
"vitest": "^4.0.18"
}
}