()
| 62 | // Lazy-initialized router (needs API key from env) |
| 63 | let addieRouter: AddieRouter | null = null; |
| 64 | function getAddieRouter(): AddieRouter { |
| 65 | if (!addieRouter) { |
| 66 | const apiKey = process.env.ANTHROPIC_API_KEY; |
| 67 | if (!apiKey) { |
| 68 | throw new Error("ANTHROPIC_API_KEY not configured"); |
| 69 | } |
| 70 | addieRouter = new AddieRouter(apiKey); |
| 71 | } |
| 72 | return addieRouter; |
| 73 | } |
| 74 | |
| 75 | /** |
| 76 | * Helper to parse and validate a numeric ID parameter |
no outgoing calls
no test coverage detected