| 1 | import fs from 'fs' |
| 2 | import path from 'path' |
| 3 | import { describe, expect, it } from 'vitest' |
| 4 | |
| 5 | const readSource = (filePath: string): string => fs.readFileSync(path.resolve(filePath), 'utf8') |
| 6 | |
| 7 | describe('Runtime prompt inventory', () => { |
| 8 | it('records every discovered non-Thinking model builder that is still intentionally inline', () => { |
| 9 | const inventory = readSource('docs/design/node-agent-runtime-prompt-inventory.md') |
| 10 | const expectedEntries = [ |
| 11 | ['add-page-plan', 'planNewPage'], |
| 12 | ['document-image-plan', 'buildImageDocumentPlanPrompt'], |
| 13 | ['style-import-json-repair', 'retryFixJson'] |
| 14 | ] |
| 15 | |
| 16 | for (const [id, builder] of expectedEntries) { |
| 17 | expect(inventory).toContain(`| \`${id}\``) |
| 18 | expect(inventory).toContain(builder) |
| 19 | } |
| 20 | }) |
| 21 | |
| 22 | it('keeps each inventory builder present in its documented Runtime source file', () => { |
| 23 | expect(readSource('src/main/generation/agent-runner.ts')).toContain('planNewPage') |
| 24 | expect(readSource('src/main/io/document-parse-handlers.ts')).toContain( |
| 25 | 'buildImageDocumentPlanPrompt' |
| 26 | ) |
| 27 | expect(readSource('src/main/styles/import/pptx.ts')).toContain('retryFixJson') |
| 28 | }) |
| 29 | }) |
| 30 |