Pi SDK is ESM-only. tsx (esbuild) doesn't emit decorator metadata, so NestJS constructor injection fails without explicit @Inject(). - Set "type": "module" in gateway package.json - Switch tsconfig to NodeNext module resolution - Add @Inject(AgentService) to ChatController and ChatGateway Tested end-to-end: REST /api/chat → Pi SDK → Anthropic → response OK. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
35 lines
831 B
JSON
35 lines
831 B
JSON
{
|
|
"name": "@mosaic/gateway",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"type": "module",
|
|
"main": "dist/main.js",
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"dev": "tsx watch src/main.ts",
|
|
"lint": "eslint src",
|
|
"typecheck": "tsc --noEmit",
|
|
"test": "vitest run"
|
|
},
|
|
"dependencies": {
|
|
"@nestjs/common": "^11.0.0",
|
|
"@nestjs/core": "^11.0.0",
|
|
"@nestjs/platform-fastify": "^11.0.0",
|
|
"@nestjs/platform-socket.io": "^11.0.0",
|
|
"@nestjs/websockets": "^11.0.0",
|
|
"@mariozechner/pi-coding-agent": "~0.57.1",
|
|
"fastify": "^5.0.0",
|
|
"reflect-metadata": "^0.2.0",
|
|
"rxjs": "^7.8.0",
|
|
"socket.io": "^4.8.0",
|
|
"uuid": "^11.0.0"
|
|
},
|
|
"devDependencies": {
|
|
"@types/node": "^22.0.0",
|
|
"@types/uuid": "^10.0.0",
|
|
"tsx": "^4.0.0",
|
|
"typescript": "^5.8.0",
|
|
"vitest": "^2.0.0"
|
|
}
|
|
}
|