()
| 83 | |
| 84 | let _app: ReturnType<typeof betterAgent> | null = null; |
| 85 | function getApp() { |
| 86 | if (_app) return _app; |
| 87 | const agent = defineAgent({ |
| 88 | name: 'insight-enrich', |
| 89 | description: |
| 90 | 'Scores and summarizes analytics insights (one-shot, no persistence).', |
| 91 | model: enrichModel(), |
| 92 | contextSchema: z.object({}), |
| 93 | outputSchema: { |
| 94 | schema: enrichmentOutputJsonSchema, |
| 95 | name: 'insight_enrichment', |
| 96 | strict: true, |
| 97 | }, |
| 98 | instruction: () => INSTRUCTION, |
| 99 | tools: () => [], |
| 100 | maxSteps: 1, |
| 101 | // biome-ignore lint/suspicious/noExplicitAny: same dodge as filter-command.ts |
| 102 | } as any); |
| 103 | _app = betterAgent({ agents: [agent] }); |
| 104 | return _app; |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Enrich a batch of insights in a single model call. Returns one entry per |
no test coverage detected