ai-development-protocol 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/cli.ts","../src/core/init.ts","../src/core/constants.ts","../src/utils/fs.ts","../src/templates/readme.ts","../src/templates/project.ts","../src/templates/requirements.ts","../src/templates/architecture.ts","../src/templates/development.ts","../src/templates/operations.ts","../src/templates/agentBridge.ts","../src/core/status.ts","../src/core/adr.ts","../src/templates/adr.ts","../src/core/task.ts","../src/templates/task.ts","../src/core/question.ts","../src/core/validate.ts","../src/utils/format.ts","../bin/cli.ts"],"sourcesContent":["import path from 'node:path';\nimport { initProtocol } from './core/init.ts';\nimport { getProjectStatus } from './core/status.ts';\nimport { validateProtocol } from './core/validate.ts';\nimport { createAdr, listAdrs } from './core/adr.ts';\nimport { createTask, listTasks, moveTask } from './core/task.ts';\nimport { addOpenQuestion, listOpenQuestions } from './core/question.ts';\nimport { findProjectRoot } from './utils/fs.ts';\nimport { colors, success, info, warn, error, title } from './utils/format.ts';\nimport type { TaskStatus } from './core/constants.ts';\n\nexport function runCli(argv: string[]): void {\n const args = argv.slice(2);\n const command = args[0] || 'help';\n\n switch (command) {\n case 'init': {\n handleInit(args.slice(1));\n break;\n }\n case 'status': {\n handleStatus(args.slice(1));\n break;\n }\n case 'validate': {\n handleValidate(args.slice(1));\n break;\n }\n case 'adr': {\n handleAdr(args.slice(1));\n break;\n }\n case 'task': {\n handleTask(args.slice(1));\n break;\n }\n case 'question': {\n handleQuestion(args.slice(1));\n break;\n }\n case 'help':\n case '--help':\n case '-h':\n printHelp();\n break;\n case 'version':\n case '--version':\n case '-v':\n console.log('aidp (AI Development Protocol CLI) v1.0.0');\n break;\n default:\n console.error(error(`Unknown command: \"${command}\"`));\n console.log(info('Run `aidp help` for a list of available commands.'));\n process.exit(1);\n }\n}\n\nfunction handleInit(args: string[]): void {\n let targetDir = process.cwd();\n let projectName: string | undefined;\n let force = false;\n\n for (let i = 0; i < args.length; i++) {\n if (args[i] === '--force' || args[i] === '-f') {\n force = true;\n } else if (args[i] === '--name' || args[i] === '-n') {\n projectName = args[++i];\n } else if (!args[i].startsWith('-')) {\n targetDir = path.resolve(args[i]);\n }\n }\n\n console.log(title('Initializing AI Project Development Protocol...'));\n const res = initProtocol({ targetDir, projectName, force });\n\n if (res.createdFiles.length > 0) {\n console.log(success(`Created ${res.createdFiles.length} file(s) in ${res.aiPath}:`));\n for (const f of res.createdFiles) {\n console.log(` + ${f}`);\n }\n }\n\n if (res.skippedFiles.length > 0) {\n console.log(warn(`Skipped ${res.skippedFiles.length} existing file(s) (use --force to overwrite):`));\n for (const f of res.skippedFiles) {\n console.log(` ~ ${f}`);\n }\n }\n\n console.log(success('Initialization complete!'));\n}\n\nfunction handleStatus(args: string[]): void {\n const targetDir = args[0] ? path.resolve(args[0]) : findProjectRoot();\n const status = getProjectStatus(targetDir);\n\n if (!status.isInitialized) {\n console.log(warn(`No AI Project Development Protocol found at ${targetDir}`));\n console.log(info('Run `aidp init` to set up the protocol.'));\n return;\n }\n\n console.log(title(`=== ${status.name} ===`));\n console.log(`${colors.bold}Current Phase:${colors.reset} ${status.currentPhase}`);\n console.log(`${colors.bold}Current Goal:${colors.reset} ${status.currentGoal}`);\n console.log();\n\n // Tasks summary\n const totalTasks = status.tasks.planned.length + status.tasks.active.length + status.tasks.completed.length;\n console.log(`${colors.bold}Tasks (${totalTasks}):${colors.reset}`);\n console.log(` ${colors.blue}Active (${status.tasks.active.length}):${colors.reset}`);\n for (const t of status.tasks.active) {\n console.log(` * [${t.id}] ${t.title}`);\n }\n console.log(` ${colors.yellow}Planned (${status.tasks.planned.length}):${colors.reset}`);\n for (const t of status.tasks.planned) {\n console.log(` * [${t.id}] ${t.title}`);\n }\n console.log(` ${colors.green}Completed (${status.tasks.completed.length}):${colors.reset}`);\n for (const t of status.tasks.completed) {\n console.log(` * [${t.id}] ${t.title}`);\n }\n console.log();\n\n // ADRs summary\n console.log(`${colors.bold}Architectural Decisions (${status.adrs.length}):${colors.reset}`);\n if (status.adrs.length === 0) {\n console.log(' (None recorded yet)');\n } else {\n for (const adr of status.adrs) {\n console.log(` * ADR-${adr.formattedId}: ${adr.title} [${adr.status}] (${adr.date})`);\n }\n }\n console.log();\n\n // Open questions\n console.log(`${colors.bold}Open Questions (${status.openQuestions.length}):${colors.reset}`);\n if (status.openQuestions.length === 0) {\n console.log(' (No open questions)');\n } else {\n for (const q of status.openQuestions) {\n console.log(` ? ${q}`);\n }\n }\n}\n\nfunction handleValidate(args: string[]): void {\n const targetDir = args[0] ? path.resolve(args[0]) : findProjectRoot();\n console.log(title('Validating AI Project Development Protocol structure...'));\n\n const report = validateProtocol(targetDir);\n\n if (report.warnings.length > 0) {\n console.log(warn(`Warnings (${report.warnings.length}):`));\n for (const w of report.warnings) {\n console.log(` ⚠ ${w}`);\n }\n }\n\n if (report.errors.length > 0) {\n console.log(error(`Errors (${report.errors.length}):`));\n for (const e of report.errors) {\n console.log(` ✖ ${e}`);\n }\n console.log(error(`Validation FAILED with ${report.errors.length} error(s).`));\n process.exit(1);\n } else {\n console.log(success(`Validation PASSED! Checked ${report.checkedItems} items.`));\n }\n}\n\nfunction handleAdr(args: string[]): void {\n const sub = args[0];\n if (sub === 'list') {\n const root = findProjectRoot();\n const adrs = listAdrs(root);\n console.log(title(`Architecture Decision Records (${adrs.length}):`));\n if (adrs.length === 0) {\n console.log(info('No ADRs found. Create one with `aidp adr new <title>`.'));\n return;\n }\n for (const adr of adrs) {\n console.log(` ADR-${adr.formattedId} [${adr.status}] - ${adr.title} (${adr.date})`);\n }\n return;\n }\n\n if (sub === 'new') {\n const titleParts: string[] = [];\n let status: 'Proposed' | 'Accepted' | 'Rejected' | 'Superseded' = 'Accepted';\n\n for (let i = 1; i < args.length; i++) {\n if (args[i] === '--status' && args[i + 1]) {\n status = args[++i] as any;\n } else {\n titleParts.push(args[i]);\n }\n }\n\n const titleStr = titleParts.join(' ').trim();\n if (!titleStr) {\n console.error(error('Please provide a title for the ADR: `aidp adr new <title>`'));\n process.exit(1);\n }\n\n const record = createAdr({ title: titleStr, status });\n console.log(success(`Created ADR-${record.formattedId}: ${record.title}`));\n console.log(info(`File saved to: ${record.filePath}`));\n return;\n }\n\n console.error(error(`Unknown adr subcommand: \"${sub}\"`));\n console.log(info('Available subcommands: `aidp adr list`, `aidp adr new <title>`'));\n process.exit(1);\n}\n\nfunction handleTask(args: string[]): void {\n const sub = args[0];\n if (sub === 'list') {\n const root = findProjectRoot();\n const tasks = listTasks(root);\n console.log(title('Project Tasks:'));\n for (const s of ['active', 'planned', 'completed'] as TaskStatus[]) {\n console.log(`\\n${colors.bold}${s.toUpperCase()} (${tasks[s].length}):${colors.reset}`);\n if (tasks[s].length === 0) {\n console.log(' (None)');\n } else {\n for (const t of tasks[s]) {\n console.log(` * [${t.id}] ${t.title}`);\n }\n }\n }\n return;\n }\n\n if (sub === 'new') {\n const titleParts: string[] = [];\n let status: TaskStatus = 'planned';\n let goal: string | undefined;\n\n for (let i = 1; i < args.length; i++) {\n if (args[i] === '--status' && args[i + 1]) {\n status = args[++i] as TaskStatus;\n } else if (args[i] === '--active') {\n status = 'active';\n } else if (args[i] === '--goal' && args[i + 1]) {\n goal = args[++i];\n } else {\n titleParts.push(args[i]);\n }\n }\n\n const titleStr = titleParts.join(' ').trim();\n if (!titleStr) {\n console.error(error('Please provide a title for the task: `aidp task new <title>`'));\n process.exit(1);\n }\n\n const task = createTask({ title: titleStr, status, goal });\n console.log(success(`Created task [${task.id}] in ${task.status}: ${task.title}`));\n console.log(info(`File saved to: ${task.filePath}`));\n return;\n }\n\n if (sub === 'move') {\n const taskId = args[1];\n const targetStatus = args[2] as TaskStatus;\n\n if (!taskId || !targetStatus) {\n console.error(error('Usage: `aidp task move <taskId> <planned|active|completed>`'));\n process.exit(1);\n }\n\n if (!['planned', 'active', 'completed'].includes(targetStatus)) {\n console.error(error(`Invalid status \"${targetStatus}\". Must be planned, active, or completed.`));\n process.exit(1);\n }\n\n try {\n const moved = moveTask(taskId, targetStatus);\n console.log(success(`Moved [${moved.id}] \"${moved.title}\" to ${moved.status}`));\n } catch (err: any) {\n console.error(error(err.message));\n process.exit(1);\n }\n return;\n }\n\n console.error(error(`Unknown task subcommand: \"${sub}\"`));\n console.log(info('Available subcommands: `aidp task list`, `aidp task new <title>`, `aidp task move <id> <status>`'));\n process.exit(1);\n}\n\nfunction handleQuestion(args: string[]): void {\n const sub = args[0];\n if (sub === 'list') {\n const root = findProjectRoot();\n const questions = listOpenQuestions(root);\n console.log(title(`Open Questions (${questions.length}):`));\n if (questions.length === 0) {\n console.log(info('No open questions tracked.'));\n return;\n }\n for (const q of questions) {\n console.log(` ? ${q}`);\n }\n return;\n }\n\n if (sub === 'add') {\n const qStr = args.slice(1).join(' ').trim();\n if (!qStr) {\n console.error(error('Please provide a question: `aidp question add <question>`'));\n process.exit(1);\n }\n\n addOpenQuestion(qStr);\n console.log(success(`Added open question to requirements.md: \"${qStr}\"`));\n return;\n }\n\n console.error(error(`Unknown question subcommand: \"${sub}\"`));\n console.log(info('Available subcommands: `aidp question list`, `aidp question add <question>`'));\n process.exit(1);\n}\n\nfunction printHelp(): void {\n console.log(`\n${colors.bold}${colors.cyan}AI Project Development Protocol (AIDP) CLI${colors.reset}\nVersion 1.0.0 — Tool-agnostic protocol automation and management\n\n${colors.bold}USAGE:${colors.reset}\n aidp <command> [options]\n\n${colors.bold}COMMANDS:${colors.reset}\n ${colors.green}init [path]${colors.reset} Scaffold the .ai/ protocol directory & context files\n --name, -n <name> Set project name\n --force, -f Overwrite existing files\n\n ${colors.green}status [path]${colors.reset} Show project state, active tasks, ADRs, questions\n ${colors.green}validate [path]${colors.reset} Verify protocol directory structure & context\n\n ${colors.green}adr list${colors.reset} List all Architecture Decision Records\n ${colors.green}adr new <title> [options]${colors.reset} Create a new numbered ADR\n --status <status> Status (Proposed | Accepted | Rejected | Superseded)\n\n ${colors.green}task list${colors.reset} List all tasks by lifecycle status\n ${colors.green}task new <title> [options]${colors.reset} Create a new task specification\n --active Set status to active (default: planned)\n --goal <text> Set task goal\n ${colors.green}task move <id> <status>${colors.reset} Move task between planned | active | completed\n\n ${colors.green}question list${colors.reset} List open questions from requirements.md\n ${colors.green}question add <question>${colors.reset} Add a new open question to requirements.md\n\n ${colors.green}help, --help${colors.reset} Show this help message\n ${colors.green}version, --version${colors.reset} Display version number\n`);\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport {\n AI_DIR,\n CONTEXT_DIR,\n DECISIONS_DIR,\n TASKS_DIR,\n REPORTS_DIR,\n TASKS_SUBDIRS,\n REPORTS_SUBDIRS\n} from './constants.ts';\nimport { ensureDir, writeFileAtomic } from '../utils/fs.ts';\nimport { generateReadme } from '../templates/readme.ts';\nimport { generateProjectContext } from '../templates/project.ts';\nimport type { ProjectMeta } from '../templates/project.ts';\nimport { generateRequirementsContext } from '../templates/requirements.ts';\nimport { generateArchitectureContext } from '../templates/architecture.ts';\nimport { generateDevelopmentContext } from '../templates/development.ts';\nimport { generateOperationsContext } from '../templates/operations.ts';\nimport { generateAgentBridge } from '../templates/agentBridge.ts';\nimport { fileURLToPath } from 'node:url';\n\nexport interface InitOptions {\n targetDir?: string;\n projectName?: string;\n force?: boolean;\n meta?: ProjectMeta;\n includeBridges?: boolean;\n}\n\nexport interface InitResult {\n aiPath: string;\n createdFiles: string[];\n skippedFiles: string[];\n alreadyInitialized: boolean;\n}\n\nexport function initProtocol(options: InitOptions = {}): InitResult {\n const root = path.resolve(options.targetDir || process.cwd());\n const aiPath = path.join(root, AI_DIR);\n const isAlreadyInit = fs.existsSync(aiPath);\n\n const createdFiles: string[] = [];\n const skippedFiles: string[] = [];\n\n // Create core directories\n ensureDir(aiPath);\n ensureDir(path.join(root, CONTEXT_DIR));\n ensureDir(path.join(root, DECISIONS_DIR));\n\n for (const sub of TASKS_SUBDIRS) {\n ensureDir(path.join(root, TASKS_DIR, sub));\n }\n\n for (const sub of REPORTS_SUBDIRS) {\n ensureDir(path.join(root, REPORTS_DIR, sub));\n }\n\n const projectName = options.projectName || path.basename(root);\n const bridgeContent = generateAgentBridge(projectName);\n\n // Define files to create\n const files: Record<string, string> = {\n [path.join(root, AI_DIR, 'README.md')]: generateReadme(projectName),\n [path.join(root, CONTEXT_DIR, 'project.md')]: generateProjectContext({\n name: projectName,\n ...options.meta\n }),\n [path.join(root, CONTEXT_DIR, 'requirements.md')]: generateRequirementsContext(),\n [path.join(root, CONTEXT_DIR, 'architecture.md')]: generateArchitectureContext(),\n [path.join(root, CONTEXT_DIR, 'development.md')]: generateDevelopmentContext(),\n [path.join(root, CONTEXT_DIR, 'operations.md')]: generateOperationsContext()\n };\n\n // Add agent bridges and agent.md protocol specification\n if (options.includeBridges !== false) {\n files[path.join(root, 'AGENTS.md')] = bridgeContent;\n files[path.join(root, 'CLAUDE.md')] = bridgeContent;\n files[path.join(root, '.cursorrules')] = bridgeContent;\n files[path.join(root, '.github', 'copilot-instructions.md')] = bridgeContent;\n\n const rootAgentMd = path.join(root, 'agent.md');\n if (!fs.existsSync(rootAgentMd) || options.force) {\n try {\n const sourceAgentMd = fileURLToPath(new URL('../../agent.md', import.meta.url));\n if (fs.existsSync(sourceAgentMd)) {\n files[rootAgentMd] = fs.readFileSync(sourceAgentMd, 'utf-8');\n }\n } catch {\n // Fallback if URL resolution fails\n }\n }\n }\n\n for (const [filePath, content] of Object.entries(files)) {\n if (fs.existsSync(filePath) && !options.force) {\n skippedFiles.push(path.relative(root, filePath));\n } else {\n writeFileAtomic(filePath, content);\n createdFiles.push(path.relative(root, filePath));\n }\n }\n\n // Create .gitkeep in empty directories if empty\n const emptyDirs = [\n path.join(root, DECISIONS_DIR),\n ...TASKS_SUBDIRS.map(s => path.join(root, TASKS_DIR, s)),\n ...REPORTS_SUBDIRS.map(s => path.join(root, REPORTS_DIR, s))\n ];\n\n for (const dir of emptyDirs) {\n const keepPath = path.join(dir, '.gitkeep');\n if (!fs.existsSync(keepPath) && fs.readdirSync(dir).length === 0) {\n writeFileAtomic(keepPath, '');\n }\n }\n\n return {\n aiPath,\n createdFiles,\n skippedFiles,\n alreadyInitialized: isAlreadyInit && !options.force\n };\n}\n","import path from 'node:path';\n\nexport const AI_DIR = '.ai';\n\nexport const CONTEXT_DIR = path.join(AI_DIR, 'context');\nexport const DECISIONS_DIR = path.join(AI_DIR, 'decisions');\nexport const TASKS_DIR = path.join(AI_DIR, 'tasks');\nexport const REPORTS_DIR = path.join(AI_DIR, 'reports');\n\nexport const TASKS_SUBDIRS = ['planned', 'active', 'completed'] as const;\nexport const REPORTS_SUBDIRS = ['reviews', 'security', 'testing'] as const;\n\nexport const REQUIRED_CONTEXT_FILES = [\n 'project.md',\n 'requirements.md',\n 'architecture.md',\n 'development.md',\n 'operations.md'\n] as const;\n\nexport const MATURITY_LEVELS = [\n { level: 0, name: 'IDEA', description: 'A rough concept exists.' },\n { level: 1, name: 'DISCOVERY', description: 'Problem and users are becoming clear.' },\n { level: 2, name: 'PRODUCT DEFINITION', description: 'Core workflow and MVP are defined.' },\n { level: 3, name: 'ARCHITECTURE', description: 'Technical architecture is established.' },\n { level: 4, name: 'IMPLEMENTATION', description: 'The system is actively being built.' },\n { level: 5, name: 'VALIDATION', description: 'The implementation is being tested and refined.' },\n { level: 6, name: 'OPERATIONS', description: 'The system is deployed and maintained.' },\n { level: 7, name: 'EVOLUTION', description: 'The system continues to change based on new requirements.' }\n] as const;\n\nexport type TaskStatus = typeof TASKS_SUBDIRS[number];\nexport type ReportType = typeof REPORTS_SUBDIRS[number];\n","import fs from 'node:fs';\nimport path from 'node:path';\n\nexport function findProjectRoot(startDir: string = process.cwd()): string {\n let current = path.resolve(startDir);\n while (true) {\n if (fs.existsSync(path.join(current, '.ai'))) {\n return current;\n }\n if (fs.existsSync(path.join(current, 'agent.md'))) {\n return current;\n }\n if (fs.existsSync(path.join(current, '.git'))) {\n return current;\n }\n const parent = path.dirname(current);\n if (parent === current) {\n // Reached filesystem root\n return path.resolve(startDir);\n }\n current = parent;\n }\n}\n\nexport function ensureDir(dirPath: string): void {\n if (!fs.existsSync(dirPath)) {\n fs.mkdirSync(dirPath, { recursive: true });\n }\n}\n\nexport function slugify(text: string): string {\n return text\n .toLowerCase()\n .trim()\n .replace(/[^\\w\\s-]/g, '')\n .replace(/[\\s_-]+/g, '-')\n .replace(/^-+|-+$/g, '');\n}\n\nexport function readFileSafe(filePath: string): string | null {\n try {\n return fs.readFileSync(filePath, 'utf-8');\n } catch {\n return null;\n }\n}\n\nexport function writeFileAtomic(filePath: string, content: string): void {\n ensureDir(path.dirname(filePath));\n fs.writeFileSync(filePath, content, 'utf-8');\n}\n","export function generateReadme(projectName: string = 'Project'): string {\n return `# AI Project Knowledge Base (${projectName})\n\nThis directory maintains the living engineering knowledge for **${projectName}**, following the **AI Project Development Protocol (v1.0.0)**.\n\n## How This Works\n\n1. **Conversation is the Primary Interface**: The project owner interacts through natural dialogue.\n2. **AI-Maintained**: The AI agent creates, updates, and synchronizes these artifacts progressively as decisions are confirmed.\n3. **Living Knowledge**: Designed to be accumulative, preserving context, architectural decisions, and tasks without documentation drift.\n\n## Directory Structure\n\n\\`\\`\\`text\n.ai/\n├── README.md # This guide\n├── context/ # Authoritative system context\n│ ├── project.md # Identity, scope, state, and goals\n│ ├── requirements.md # Requirements, assumptions, and open questions\n│ ├── architecture.md # System structure, components, boundaries\n│ ├── development.md # Conventions, workflows, testing rules\n│ └── operations.md # Deployment, environments, runbooks\n├── decisions/ # Architecture Decision Records (ADRs)\n├── tasks/ # Actionable work breakdown\n│ ├── planned/ # Ready to be started\n│ ├── active/ # Currently in progress\n│ └── completed/ # Done and validated\n└── reports/ # Periodic evaluation records\n ├── reviews/ # Code and design reviews\n ├── security/ # Security audits\n └── testing/ # Test summaries\n\\`\\`\\`\n\n## Protocol Reference\n\nSee \\`agent.md\\` in the project root for the complete specification.\n`;\n}\n","export interface ProjectMeta {\n name?: string;\n purpose?: string;\n problem?: string;\n targetUsers?: string;\n valueProposition?: string;\n}\n\nexport function generateProjectContext(meta: ProjectMeta = {}): string {\n const name = meta.name || 'My Project';\n const purpose = meta.purpose || 'To be defined through discovery.';\n const problem = meta.problem || 'To be identified through conversation.';\n const targetUsers = meta.targetUsers || 'To be determined.';\n const valueProposition = meta.valueProposition || 'To be articulated.';\n\n return `# Project Identity & State\n\n## 1. Project Identity\n\n* **Project Name:** ${name}\n* **Purpose:** ${purpose}\n* **Problem:** ${problem}\n* **Target Users:** ${targetUsers}\n* **Value Proposition:** ${valueProposition}\n\n---\n\n## 2. Product Scope\n\n### Current Goals\n- [ ] Initialize project foundation and requirements discovery.\n\n### MVP Scope\n*To be defined.*\n\n### Future Possibilities\n*To be explored.*\n\n### Out of Scope\n*To be established.*\n\n---\n\n## 3. Project State\n\n* **Current Goal:** Establish problem and user requirements.\n* **Current Phase:** Level 1 — DISCOVERY\n* **Confirmed Decisions:** Initial protocol structure established.\n* **Active Work:** Initial discovery.\n* **Open Questions:** See \\`requirements.md\\`.\n* **Deferred Work:** None yet.\n* **Known Constraints:** None yet.\n* **Known Risks:** None identified.\n`;\n}\n","export function generateRequirementsContext(): string {\n return `# Requirements & Discovery\n\n## 1. Functional Requirements\n\n*Each requirement should preserve rationale (Reason) and confirmation status.*\n\n*No confirmed functional requirements yet.*\n\n---\n\n## 2. Non-Functional Requirements\n\n* **Performance:** Standard expectations.\n* **Security:** Secure by default.\n* **Maintainability:** Modular and clean code standards.\n\n---\n\n## 3. Constraints & Assumptions\n\n### Constraints\n* None established.\n\n### Assumptions\n* None established.\n\n---\n\n## 4. Open Questions\n\n<!-- Questions being explored. When answered, move to confirmed decisions and remove from here. -->\n\n- What is the primary problem this project solves?\n- Who is the initial target audience?\n- What are the absolute minimum features required for the MVP?\n`;\n}\n","export function generateArchitectureContext(): string {\n return `# Architecture & System Design\n\n## 1. System Overview\n\n*A high-level summary of the architecture once established.*\n\n---\n\n## 2. Core Components & Boundaries\n\n*To be defined.*\n\n---\n\n## 3. Technology Stack\n\n* **Runtime / Language:** To be determined.\n* **Storage / Database:** To be determined.\n* **Frameworks / Libraries:** To be determined.\n\n---\n\n## 4. Architectural Decisions Index\n\n*See \\`.ai/decisions/\\` for detailed ADRs.*\n\n| ID | Title | Status | Date |\n|---|---|---|---|\n| - | No ADRs created yet | - | - |\n`;\n}\n","export function generateDevelopmentContext(): string {\n return `# Development Workflow & Conventions\n\n## 1. Environment & Setup\n\n*Prerequisites and commands to get started.*\n\n---\n\n## 2. Coding Conventions\n\n* Code style, linting, formatting rules, and naming conventions.\n\n---\n\n## 3. Implementation Workflow\n\nBefore implementing significant features:\n1. Understand the requirement.\n2. Inspect existing implementation.\n3. Identify affected components and boundaries.\n4. Check relevant architecture and ADRs.\n5. Identify dependencies and risks.\n6. Produce a concise implementation approach.\n7. Implement cleanly.\n8. Validate (tests, build, type checks).\n\n---\n\n## 4. Testing & Validation Strategy\n\n* Test commands, coverage expectations, and verification steps.\n`;\n}\n","export function generateOperationsContext(): string {\n return `# Operations & Deployment\n\n## 1. Deployment Strategy\n\n*Target hosting, CI/CD pipelines, containerization, and release process.*\n\n---\n\n## 2. Environment Configuration\n\n*Required environment variables and secret management.*\n\n---\n\n## 3. Observability & Monitoring\n\n*Logging standards, health checks, metrics, and error alerting.*\n`;\n}\n","export function generateAgentBridge(projectName: string = 'Project'): string {\n return `# AI Coding Assistant Instructions\n\nYou are the AI engineering partner for **${projectName}**, operating under the **AI Project Development Protocol** specified in \\`agent.md\\`.\n\n---\n\n## 🚀 Session Initialization (Every Fresh Session)\n\nWhenever a new conversation session starts:\n\n1. **Check Project State First**:\n - Inspect \\`.ai/context/project.md\\` and \\`.ai/context/requirements.md\\` (or run \\`npx aidp status\\`).\n - Identify: Current Phase, Current Goal, Active Tasks, and Open Questions.\n\n2. **If This Is a Brand New / Greenfield Project (Level 0 or Level 1)**:\n - Proactively greet the project owner:\n > *\"Tell me what you're thinking about. It doesn't need to be fully defined. We'll progressively turn the idea into a product, requirements, architecture, and implementation plan.\"*\n - Guide the owner through discovery: problem, target users, core workflow, and MVP boundary.\n - Do NOT start generating large boilerplate code until the core idea and architecture are confirmed.\n\n3. **If the Project Is Already Underway (Level 2+)**:\n - Briefly summarize where the project currently stands based on \\`.ai/context/project.md\\` and active tasks.\n - Ask how the owner would like to proceed with the active or planned tasks.\n\n---\n\n## 📋 Core Operating Rules (from \\`agent.md\\`)\n\n* **Conversation is the Primary Interface**: The project owner interacts through chat; you (the AI) maintain the \\`.ai/\\` artifacts automatically.\n* **Brainstorming vs. Decisions**: Treat exploratory ideas as proposals. Only record ADRs when the owner explicitly confirms a technical choice.\n* **Preserve Reasoning**: Every architectural choice must be recorded as an ADR with Problem, Options, Decision, and Consequences.\n* **Implementation Boundary**: Do not write production code until the owner signals clear implementation intent (e.g. *\"Build it\"*, *\"Let's implement this\"*).\n* **Validation Truth**: Always run real tests and build commands in the terminal before marking any task as complete. Never claim validation that was not run.\n`;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { CONTEXT_DIR, MATURITY_LEVELS } from './constants.ts';\nimport { findProjectRoot } from '../utils/fs.ts';\nimport { listAdrs } from './adr.ts';\nimport type { AdrRecord } from './adr.ts';\nimport { listTasks } from './task.ts';\nimport type { TaskRecord } from './task.ts';\nimport { listOpenQuestions } from './question.ts';\n\nexport interface ProjectStatus {\n isInitialized: boolean;\n name: string;\n currentGoal: string;\n currentPhase: string;\n adrs: AdrRecord[];\n tasks: {\n planned: TaskRecord[];\n active: TaskRecord[];\n completed: TaskRecord[];\n };\n openQuestions: string[];\n}\n\nexport function getProjectStatus(projectRoot: string = findProjectRoot()): ProjectStatus {\n const projectFile = path.join(projectRoot, CONTEXT_DIR, 'project.md');\n const isInitialized = fs.existsSync(projectFile);\n\n if (!isInitialized) {\n return {\n isInitialized: false,\n name: path.basename(projectRoot),\n currentGoal: 'Not initialized',\n currentPhase: 'Unknown',\n adrs: [],\n tasks: { planned: [], active: [], completed: [] },\n openQuestions: []\n };\n }\n\n const projectContent = fs.readFileSync(projectFile, 'utf-8');\n\n const nameMatch = projectContent.match(/\\*\\s*\\*\\*Project Name:\\*\\*\\s*(.+)$/m);\n const name = nameMatch ? nameMatch[1].trim() : path.basename(projectRoot);\n\n const goalMatch = projectContent.match(/\\*\\s*\\*\\*Current Goal:\\*\\*\\s*(.+)$/m);\n const currentGoal = goalMatch ? goalMatch[1].trim() : 'Unspecified';\n\n const phaseMatch = projectContent.match(/\\*\\s*\\*\\*Current Phase:\\*\\*\\s*(.+)$/m);\n const currentPhase = phaseMatch ? phaseMatch[1].trim() : 'Unknown';\n\n const adrs = listAdrs(projectRoot);\n const tasks = listTasks(projectRoot);\n const openQuestions = listOpenQuestions(projectRoot);\n\n return {\n isInitialized: true,\n name,\n currentGoal,\n currentPhase,\n adrs,\n tasks,\n openQuestions\n };\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { DECISIONS_DIR, CONTEXT_DIR } from './constants.ts';\nimport { ensureDir, findProjectRoot, slugify, writeFileAtomic } from '../utils/fs.ts';\nimport { generateAdr } from '../templates/adr.ts';\nimport type { AdrOptions } from '../templates/adr.ts';\n\nexport interface AdrRecord {\n id: number;\n formattedId: string;\n title: string;\n status: string;\n date: string;\n filename: string;\n filePath: string;\n}\n\nexport function listAdrs(projectRoot: string = findProjectRoot()): AdrRecord[] {\n const decisionsPath = path.join(projectRoot, DECISIONS_DIR);\n if (!fs.existsSync(decisionsPath)) {\n return [];\n }\n\n const files = fs.readdirSync(decisionsPath)\n .filter(f => f.endsWith('.md') && /^\\d{4}-/.test(f))\n .sort();\n\n const records: AdrRecord[] = [];\n\n for (const filename of files) {\n const filePath = path.join(decisionsPath, filename);\n const content = fs.readFileSync(filePath, 'utf-8');\n\n const idMatch = filename.match(/^(\\d{4})/);\n const id = idMatch ? parseInt(idMatch[1], 10) : 0;\n const formattedId = idMatch ? idMatch[1] : '0000';\n\n const titleMatch = content.match(/^#\\s+ADR-\\d+:\\s*(.+)$/m);\n const title = titleMatch ? titleMatch[1].trim() : filename.replace(/^\\d{4}-|\\.md$/g, '');\n\n const statusMatch = content.match(/\\*\\s*\\*\\*Status:\\*\\*\\s*(.+)$/m);\n const status = statusMatch ? statusMatch[1].trim() : 'Unknown';\n\n const dateMatch = content.match(/\\*\\s*\\*\\*Date:\\*\\*\\s*(.+)$/m);\n const date = dateMatch ? dateMatch[1].trim() : '';\n\n records.push({\n id,\n formattedId,\n title,\n status,\n date,\n filename,\n filePath\n });\n }\n\n return records;\n}\n\nexport function getNextAdrId(projectRoot: string = findProjectRoot()): number {\n const adrs = listAdrs(projectRoot);\n if (adrs.length === 0) return 1;\n const maxId = Math.max(...adrs.map(a => a.id));\n return maxId + 1;\n}\n\nexport function createAdr(\n options: Omit<AdrOptions, 'id'> & { projectRoot?: string }\n): AdrRecord {\n const root = options.projectRoot || findProjectRoot();\n const nextId = getNextAdrId(root);\n const formattedId = String(nextId).padStart(4, '0');\n const slug = slugify(options.title);\n const filename = `${formattedId}-${slug}.md`;\n const decisionsPath = path.join(root, DECISIONS_DIR);\n ensureDir(decisionsPath);\n\n const filePath = path.join(decisionsPath, filename);\n const content = generateAdr({\n ...options,\n id: nextId\n });\n\n writeFileAtomic(filePath, content);\n\n // Synchronize with architecture.md index table (Section 27: Synchronization)\n syncAdrWithArchitecture(root, {\n formattedId,\n title: options.title,\n status: options.status || 'Accepted',\n date: options.date || new Date().toISOString().slice(0, 10),\n filename\n });\n\n return {\n id: nextId,\n formattedId,\n title: options.title,\n status: options.status || 'Accepted',\n date: options.date || new Date().toISOString().slice(0, 10),\n filename,\n filePath\n };\n}\n\nfunction syncAdrWithArchitecture(\n projectRoot: string,\n adr: { formattedId: string; title: string; status: string; date: string; filename: string }\n): void {\n const archFile = path.join(projectRoot, CONTEXT_DIR, 'architecture.md');\n if (!fs.existsSync(archFile)) return;\n\n let content = fs.readFileSync(archFile, 'utf-8');\n const tableHeaderRegex = /(\\| ID \\| Title \\| Status \\| Date \\|\\r?\\n\\|---\\|---\\|---\\|---\\|\\r?\\n)([\\s\\S]*?)(?=\\r?\\n#|$)/;\n\n const row = `| [ADR-${adr.formattedId}](../decisions/${adr.filename}) | ${adr.title} | ${adr.status} | ${adr.date} |`;\n\n if (tableHeaderRegex.test(content)) {\n content = content.replace(tableHeaderRegex, (match, header, body) => {\n let rows = body\n .split(/\\r?\\n/)\n .map((r: string) => r.trim())\n .filter((r: string) => r.length > 0 && !r.includes('No ADRs created yet'));\n rows.push(row);\n return `${header}${rows.join('\\n')}\\n`;\n });\n writeFileAtomic(archFile, content);\n }\n}\n","export interface AdrOptions {\n id: number;\n title: string;\n status?: 'Proposed' | 'Accepted' | 'Rejected' | 'Superseded';\n date?: string;\n problem?: string;\n options?: string[];\n decision?: string;\n consequences?: string;\n}\n\nexport function generateAdr(options: AdrOptions): string {\n const padId = String(options.id).padStart(4, '0');\n const dateStr = options.date || new Date().toISOString().slice(0, 10);\n const status = options.status || 'Accepted';\n const problem = options.problem || 'Describe the architectural context and problem here.';\n const optionsList = options.options && options.options.length > 0\n ? options.options.map((opt, i) => `${i + 1}. **${opt}**`).join('\\n')\n : '1. **Option 1:** Description\\n2. **Option 2:** Description';\n const decision = options.decision || 'Describe the decision made and rationale.';\n const consequences = options.consequences || 'Describe positive and negative implications.';\n\n return `# ADR-${padId}: ${options.title}\n\n* **Status:** ${status}\n* **Date:** ${dateStr}\n* **Deciders:** AI & Project Owner\n\n## 1. Problem\n${problem}\n\n## 2. Options Considered\n${optionsList}\n\n## 3. Trade-offs\n*Pros and cons evaluated during discussion.*\n\n## 4. Decision\n${decision}\n\n## 5. Consequences\n${consequences}\n`;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { TASKS_DIR, TASKS_SUBDIRS } from './constants.ts';\nimport type { TaskStatus } from './constants.ts';\nimport { ensureDir, findProjectRoot, slugify, writeFileAtomic } from '../utils/fs.ts';\nimport { generateTask } from '../templates/task.ts';\nimport type { TaskOptions } from '../templates/task.ts';\n\nexport interface TaskRecord {\n id: string;\n title: string;\n status: TaskStatus;\n filename: string;\n filePath: string;\n}\n\nexport function listTasks(projectRoot: string = findProjectRoot()): Record<TaskStatus, TaskRecord[]> {\n const result: Record<TaskStatus, TaskRecord[]> = {\n planned: [],\n active: [],\n completed: []\n };\n\n const tasksBase = path.join(projectRoot, TASKS_DIR);\n if (!fs.existsSync(tasksBase)) {\n return result;\n }\n\n for (const status of TASKS_SUBDIRS) {\n const dir = path.join(tasksBase, status);\n if (!fs.existsSync(dir)) continue;\n\n const files = fs.readdirSync(dir).filter(f => f.endsWith('.md'));\n for (const filename of files) {\n const filePath = path.join(dir, filename);\n const content = fs.readFileSync(filePath, 'utf-8');\n\n const titleMatch = content.match(/^#\\s+([^:]+):\\s*(.+)$/m);\n const id = titleMatch ? titleMatch[1].trim() : filename.replace(/\\.md$/, '');\n const title = titleMatch ? titleMatch[2].trim() : filename.replace(/\\.md$/, '');\n\n result[status].push({\n id,\n title,\n status,\n filename,\n filePath\n });\n }\n }\n\n return result;\n}\n\nexport function getNextTaskId(projectRoot: string = findProjectRoot()): string {\n const all = listTasks(projectRoot);\n const allTasks = [...all.planned, ...all.active, ...all.completed];\n let maxNum = 0;\n\n for (const t of allTasks) {\n const m = t.filename.match(/task-(\\d+)/i) || t.id.match(/task-(\\d+)/i);\n if (m) {\n const num = parseInt(m[1], 10);\n if (num > maxNum) maxNum = num;\n }\n }\n\n return `TASK-${String(maxNum + 1).padStart(4, '0')}`;\n}\n\nexport function createTask(\n options: Omit<TaskOptions, 'id'> & { id?: string; status?: TaskStatus; projectRoot?: string }\n): TaskRecord {\n const root = options.projectRoot || findProjectRoot();\n const id = options.id || getNextTaskId(root);\n const status: TaskStatus = options.status || 'planned';\n const slug = slugify(options.title);\n const filename = `${id.toLowerCase()}-${slug}.md`;\n\n const destDir = path.join(root, TASKS_DIR, status);\n ensureDir(destDir);\n\n const filePath = path.join(destDir, filename);\n const content = generateTask({\n ...options,\n id,\n status\n });\n\n writeFileAtomic(filePath, content);\n\n return {\n id,\n title: options.title,\n status,\n filename,\n filePath\n };\n}\n\nexport function moveTask(\n taskIdOrName: string,\n newStatus: TaskStatus,\n projectRoot: string = findProjectRoot()\n): TaskRecord {\n const all = listTasks(projectRoot);\n let found: TaskRecord | null = null;\n const search = taskIdOrName.toLowerCase();\n\n for (const status of TASKS_SUBDIRS) {\n const match = all[status].find(\n t => t.id.toLowerCase() === search || t.filename.toLowerCase().includes(search)\n );\n if (match) {\n found = match;\n break;\n }\n }\n\n if (!found) {\n throw new Error(`Task matching \"${taskIdOrName}\" was not found.`);\n }\n\n if (found.status === newStatus) {\n return found;\n }\n\n const oldPath = found.filePath;\n const newDir = path.join(projectRoot, TASKS_DIR, newStatus);\n ensureDir(newDir);\n const newPath = path.join(newDir, found.filename);\n\n let content = fs.readFileSync(oldPath, 'utf-8');\n content = content.replace(/\\*\\s*\\*\\*Status:\\*\\*\\s*(.+)$/m, `* **Status:** ${newStatus.toUpperCase()}`);\n\n fs.unlinkSync(oldPath);\n writeFileAtomic(newPath, content);\n\n return {\n ...found,\n status: newStatus,\n filePath: newPath\n };\n}\n","export interface TaskOptions {\n id: string;\n title: string;\n status?: 'planned' | 'active' | 'completed';\n goal?: string;\n requirementsRef?: string;\n architectureRef?: string;\n steps?: string[];\n validation?: string[];\n}\n\nexport function generateTask(options: TaskOptions): string {\n const status = options.status || 'planned';\n const createdDate = new Date().toISOString().slice(0, 10);\n const goal = options.goal || 'Describe the objective of this task.';\n const reqRef = options.requirementsRef || 'Refer to requirements.md';\n const archRef = options.architectureRef || 'Refer to architecture.md';\n const stepsList = options.steps && options.steps.length > 0\n ? options.steps.map(s => `- [ ] ${s}`).join('\\n')\n : '- [ ] Step 1: Design and setup\\n- [ ] Step 2: Implementation\\n- [ ] Step 3: Tests';\n const validationList = options.validation && options.validation.length > 0\n ? options.validation.map(v => `- [ ] ${v}`).join('\\n')\n : '- [ ] Unit and integration tests pass\\n- [ ] Working behavior validated';\n\n return `# ${options.id.toUpperCase()}: ${options.title}\n\n* **Status:** ${status.toUpperCase()}\n* **Created:** ${createdDate}\n* **Category:** Implementation\n\n## Goal\n${goal}\n\n## Requirements Reference\n${reqRef}\n\n## Architecture Reference\n${archRef}\n\n## Implementation Steps\n${stepsList}\n\n## Validation Criteria\n${validationList}\n`;\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport { CONTEXT_DIR } from './constants.ts';\nimport { findProjectRoot, writeFileAtomic } from '../utils/fs.ts';\n\nexport function listOpenQuestions(projectRoot: string = findProjectRoot()): string[] {\n const reqPath = path.join(projectRoot, CONTEXT_DIR, 'requirements.md');\n if (!fs.existsSync(reqPath)) return [];\n\n const content = fs.readFileSync(reqPath, 'utf-8');\n const sectionMatch = content.match(/## 4\\. Open Questions([\\s\\S]*?)(?=\\r?\\n##|$)/);\n if (!sectionMatch) return [];\n\n const lines = sectionMatch[1].split(/\\r?\\n/);\n const questions: string[] = [];\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (trimmed.startsWith('- ') || trimmed.startsWith('* ')) {\n questions.push(trimmed.slice(2).trim());\n }\n }\n\n return questions;\n}\n\nexport function addOpenQuestion(\n question: string,\n projectRoot: string = findProjectRoot()\n): void {\n const reqPath = path.join(projectRoot, CONTEXT_DIR, 'requirements.md');\n if (!fs.existsSync(reqPath)) {\n throw new Error(`requirements.md not found at ${reqPath}`);\n }\n\n let content = fs.readFileSync(reqPath, 'utf-8');\n const sectionHeader = '## 4. Open Questions';\n const idx = content.indexOf(sectionHeader);\n\n if (idx === -1) {\n content += `\\n\\n${sectionHeader}\\n\\n- ${question}\\n`;\n } else {\n // Append to the list\n content = content.replace(/(## 4\\. Open Questions[\\s\\S]*?)(\\r?\\n\\r?\\n##|\\r?\\n?$)/, (match, prefix, suffix) => {\n return `${prefix.trimEnd()}\\n- ${question}\\n${suffix}`;\n });\n }\n\n writeFileAtomic(reqPath, content);\n}\n","import fs from 'node:fs';\nimport path from 'node:path';\nimport {\n AI_DIR,\n CONTEXT_DIR,\n DECISIONS_DIR,\n TASKS_DIR,\n REPORTS_DIR,\n REQUIRED_CONTEXT_FILES,\n TASKS_SUBDIRS,\n REPORTS_SUBDIRS\n} from './constants.ts';\nimport { findProjectRoot } from '../utils/fs.ts';\n\nexport interface ValidationReport {\n valid: boolean;\n errors: string[];\n warnings: string[];\n checkedItems: number;\n}\n\nexport function validateProtocol(projectRoot: string = findProjectRoot()): ValidationReport {\n const errors: string[] = [];\n const warnings: string[] = [];\n let checkedItems = 0;\n\n const aiPath = path.join(projectRoot, AI_DIR);\n checkedItems++;\n if (!fs.existsSync(aiPath)) {\n return {\n valid: false,\n errors: [`AI protocol directory '${AI_DIR}' does not exist at ${projectRoot}`],\n warnings: [],\n checkedItems\n };\n }\n\n // Check README.md\n checkedItems++;\n const readmePath = path.join(aiPath, 'README.md');\n if (!fs.existsSync(readmePath)) {\n warnings.push(`Missing '${AI_DIR}/README.md' guide.`);\n }\n\n // Check required context files\n const contextPath = path.join(projectRoot, CONTEXT_DIR);\n checkedItems++;\n if (!fs.existsSync(contextPath)) {\n errors.push(`Missing context directory at '${CONTEXT_DIR}'.`);\n } else {\n for (const file of REQUIRED_CONTEXT_FILES) {\n checkedItems++;\n const filePath = path.join(contextPath, file);\n if (!fs.existsSync(filePath)) {\n errors.push(`Missing required context file: '${path.join(CONTEXT_DIR, file)}'.`);\n }\n }\n }\n\n // Check decisions directory & ADR naming\n const decisionsPath = path.join(projectRoot, DECISIONS_DIR);\n checkedItems++;\n if (!fs.existsSync(decisionsPath)) {\n errors.push(`Missing decisions directory at '${DECISIONS_DIR}'.`);\n } else {\n const files = fs.readdirSync(decisionsPath).filter(f => f.endsWith('.md'));\n for (const f of files) {\n checkedItems++;\n if (!/^\\d{4}-[\\w-]+\\.md$/.test(f)) {\n warnings.push(`ADR file '${f}' does not follow the naming convention: '0001-slug-title.md'.`);\n }\n }\n }\n\n // Check tasks directory and subdirectories\n const tasksPath = path.join(projectRoot, TASKS_DIR);\n checkedItems++;\n if (!fs.existsSync(tasksPath)) {\n errors.push(`Missing tasks directory at '${TASKS_DIR}'.`);\n } else {\n for (const sub of TASKS_SUBDIRS) {\n checkedItems++;\n const subPath = path.join(tasksPath, sub);\n if (!fs.existsSync(subPath)) {\n errors.push(`Missing task subfolder: '${path.join(TASKS_DIR, sub)}'.`);\n }\n }\n }\n\n // Check reports directory and subdirectories\n const reportsPath = path.join(projectRoot, REPORTS_DIR);\n checkedItems++;\n if (!fs.existsSync(reportsPath)) {\n warnings.push(`Missing reports directory at '${REPORTS_DIR}'.`);\n } else {\n for (const sub of REPORTS_SUBDIRS) {\n checkedItems++;\n const subPath = path.join(reportsPath, sub);\n if (!fs.existsSync(subPath)) {\n warnings.push(`Missing report subfolder: '${path.join(REPORTS_DIR, sub)}'.`);\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n warnings,\n checkedItems\n };\n}\n","const isColorSupported = !process.env.NO_COLOR && (process.stdout?.isTTY ?? false);\n\nexport const colors = {\n reset: isColorSupported ? '\\x1b[0m' : '',\n bold: isColorSupported ? '\\x1b[1m' : '',\n dim: isColorSupported ? '\\x1b[2m' : '',\n italic: isColorSupported ? '\\x1b[3m' : '',\n underline: isColorSupported ? '\\x1b[4m' : '',\n red: isColorSupported ? '\\x1b[31m' : '',\n green: isColorSupported ? '\\x1b[32m' : '',\n yellow: isColorSupported ? '\\x1b[33m' : '',\n blue: isColorSupported ? '\\x1b[34m' : '',\n magenta: isColorSupported ? '\\x1b[35m' : '',\n cyan: isColorSupported ? '\\x1b[36m' : '',\n gray: isColorSupported ? '\\x1b[90m' : ''\n};\n\nexport function success(msg: string): string {\n return `${colors.green}✔${colors.reset} ${msg}`;\n}\n\nexport function info(msg: string): string {\n return `${colors.cyan}ℹ${colors.reset} ${msg}`;\n}\n\nexport function warn(msg: string): string {\n return `${colors.yellow}⚠${colors.reset} ${msg}`;\n}\n\nexport function error(msg: string): string {\n return `${colors.red}✖${colors.reset} ${msg}`;\n}\n\nexport function title(msg: string): string {\n return `${colors.bold}${colors.cyan}${msg}${colors.reset}`;\n}\n","#!/usr/bin/env node\nimport {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AAAA;AAAA,EAGlF,OAAO,IAAI,SAAS,OAAO,KAAK;AAAA;AAAA;AAAA,EAGhC,OAAO,IAAI,YAAY,OAAO,KAAK;AAAA,IACjC,OAAO,KAAK,cAAc,OAAO,KAAK;AAAA;AAAA;AAAA;AAAA,IAItC,OAAO,KAAK,gBAAgB,OAAO,KAAK;AAAA,IACxC,OAAO,KAAK,kBAAkB,OAAO,KAAK;AAAA;AAAA,IAE1C,OAAO,KAAK,WAAW,OAAO,KAAK;AAAA,IACnC,OAAO,KAAK,4BAA4B,OAAO,KAAK;AAAA;AAAA;AAAA,IAGpD,OAAO,KAAK,YAAY,OAAO,KAAK;AAAA,IACpC,OAAO,KAAK,6BAA6B,OAAO,KAAK;AAAA;AAAA;AAAA,IAGrD,OAAO,KAAK,0BAA0B,OAAO,KAAK;AAAA;AAAA,IAElD,OAAO,KAAK,gBAAgB,OAAO,KAAK;AAAA,IACxC,OAAO,KAAK,0BAA0B,OAAO,KAAK;AAAA;AAAA,IAElD,OAAO,KAAK,eAAe,OAAO,KAAK;AAAA,IACvC,OAAO,KAAK,qBAAqB,OAAO,KAAK;AAAA,CAChD;AACD;;;AmBnWA,OAAO,QAAQ,IAAI;","names":["path","fs","path","path","path","path","fs","fs","path","fs","path","path","fs","title","fs","path","path","fs","title","fs","path","path","fs","path","fs","fs","path","path","fs","path"]}