fix: switch gateway to ESM + explicit @Inject for tsx compatibility

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 <[email protected]>
This commit is contained in:
2026-03-12 20:43:08 -05:00
co-authored by Claude Opus 4.6
parent c58003e5e3
commit 15352448d5
4 changed files with 7 additions and 6 deletions
+2 -2
View File
@@ -5,8 +5,8 @@
"rootDir": "src",
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"module": "CommonJS",
"moduleResolution": "Node"
"module": "NodeNext",
"moduleResolution": "NodeNext"
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]