cast-code 1.0.6 → 1.0.8

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.
Files changed (33) hide show
  1. package/dist/common/services/multi-llm.service.js +19 -0
  2. package/dist/common/services/multi-llm.service.js.map +1 -1
  3. package/dist/modules/config/services/config-commands.service.js +86 -6
  4. package/dist/modules/config/services/config-commands.service.js.map +1 -1
  5. package/dist/modules/config/types/config.types.js +5 -0
  6. package/dist/modules/config/types/config.types.js.map +1 -1
  7. package/dist/modules/config/types/config.types.spec.js +60 -0
  8. package/dist/modules/config/types/config.types.spec.js.map +1 -0
  9. package/dist/modules/core/services/deep-agent.service.js +46 -5
  10. package/dist/modules/core/services/deep-agent.service.js.map +1 -1
  11. package/dist/modules/git/git.module.js +5 -2
  12. package/dist/modules/git/git.module.js.map +1 -1
  13. package/dist/modules/git/git.module.spec.js +54 -0
  14. package/dist/modules/git/git.module.spec.js.map +1 -0
  15. package/dist/modules/git/services/unit-test-generator.service.js +557 -0
  16. package/dist/modules/git/services/unit-test-generator.service.js.map +1 -0
  17. package/dist/modules/git/services/unit-test-generator.service.spec.js +119 -0
  18. package/dist/modules/git/services/unit-test-generator.service.spec.js.map +1 -0
  19. package/dist/modules/repl/services/commands/git-commands.service.js +97 -2
  20. package/dist/modules/repl/services/commands/git-commands.service.js.map +1 -1
  21. package/dist/modules/repl/services/commands/repl-commands.service.js +1 -0
  22. package/dist/modules/repl/services/commands/repl-commands.service.js.map +1 -1
  23. package/dist/modules/repl/services/commands/repl-commands.service.spec.js +69 -0
  24. package/dist/modules/repl/services/commands/repl-commands.service.spec.js.map +1 -0
  25. package/dist/modules/repl/services/repl.service.js +11 -1
  26. package/dist/modules/repl/services/repl.service.js.map +1 -1
  27. package/dist/modules/repl/services/repl.service.spec.js +137 -0
  28. package/dist/modules/repl/services/repl.service.spec.js.map +1 -0
  29. package/dist/modules/tasks/services/plan-mode.service.js +33 -25
  30. package/dist/modules/tasks/services/plan-mode.service.js.map +1 -1
  31. package/dist/modules/tasks/services/task-tools.service.js +3 -3
  32. package/dist/modules/tasks/services/task-tools.service.js.map +1 -1
  33. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/modules/repl/services/commands/repl-commands.service.ts"],"sourcesContent":["import { Injectable } from '@nestjs/common';\nimport { Colors, colorize, Box, Icons } from '../../utils/theme';\nimport { ConfigService } from '../../../../common/services/config.service';\nimport { DeepAgentService } from '../../../core/services/deep-agent.service';\nimport { McpRegistryService } from '../../../mcp/services/mcp-registry.service';\nimport { AgentLoaderService } from '../../../agents/services/agent-loader.service';\nimport { SkillRegistryService } from '../../../skills/services/skill-registry.service';\nimport { ProjectContextService } from '../../../project/services/project-context.service';\nimport { MemoryService } from '../../../memory/services/memory.service';\n\n@Injectable()\nexport class ReplCommandsService {\n constructor(\n private readonly deepAgent: DeepAgentService,\n private readonly configService: ConfigService,\n private readonly mcpRegistry: McpRegistryService,\n private readonly agentLoader: AgentLoaderService,\n private readonly skillRegistry: SkillRegistryService,\n private readonly projectContext: ProjectContextService,\n private readonly memoryService: MemoryService,\n ) {}\n\n printHelp(): void {\n const header = (text: string, icon?: string) => {\n const iconStr = icon ? colorize(icon + ' ', 'accent') : '';\n return '\\n' + iconStr + colorize(text, 'bold') + '\\n' + colorize(Box.horizontal.repeat(text.length + (icon ? 2 : 0)), 'subtle') + '\\n';\n };\n\n const cmd = (name: string, desc: string, nameWidth = 16) => {\n const paddedName = name.padEnd(nameWidth);\n return ` ${colorize(paddedName, 'cyan')} ${colorize(desc, 'muted')}\\r\\n`;\n };\n\n process.stdout.write('\\r\\n');\n \n process.stdout.write(header('Commands', Icons.diamond));\n process.stdout.write(cmd('/help', 'Show this help'));\n process.stdout.write(cmd('/clear', 'Clear conversation'));\n process.stdout.write(cmd('/compact', 'Compact history'));\n process.stdout.write(cmd('/exit', 'Exit'));\n\n process.stdout.write(header('Git', Icons.branch));\n process.stdout.write(cmd('/status', 'Git status'));\n process.stdout.write(cmd('/diff', 'Git diff'));\n process.stdout.write(cmd('/log', 'Git log (recent 15)'));\n process.stdout.write(cmd('/commit [msg]', 'Commit (AI-assisted or manual)'));\n process.stdout.write(cmd('/up', 'Smart commit & push'));\n process.stdout.write(cmd('/split-up', 'Split into multiple commits'));\n process.stdout.write(cmd('/pr', 'Create PR with AI description'));\n process.stdout.write(cmd('/review [files]', 'Code review'));\n process.stdout.write(cmd('/fix <file>', 'Auto-fix code issues'));\n process.stdout.write(cmd('/ident', 'Format all code files'));\n process.stdout.write(cmd('/release [tag]', 'Generate release notes'));\n\n process.stdout.write(header('Agents & Skills', Icons.robot));\n process.stdout.write(cmd('/agents', 'List agents'));\n process.stdout.write(cmd('/agents create', 'Create new agent'));\n process.stdout.write(cmd('/skills', 'List skills'));\n process.stdout.write(cmd('/skills create', 'Create new skill'));\n\n process.stdout.write(header('Info', Icons.search));\n process.stdout.write(cmd('/tools', 'List available tools'));\n process.stdout.write(cmd('/context', 'Session info'));\n process.stdout.write(cmd('/mentions', 'Mentions help (@)'));\n\n process.stdout.write(header('Config', Icons.gear));\n process.stdout.write(cmd('/model', 'Show/change model'));\n process.stdout.write(cmd('/config', 'Show configuration'));\n process.stdout.write(cmd('/init', 'Analyze project and generate context'));\n process.stdout.write(cmd('/project-deep', 'Generate deep context + agent brief'));\n\n process.stdout.write(header('MCP', Icons.cloud));\n process.stdout.write(cmd('/mcp list', 'List MCP servers'));\n process.stdout.write(cmd('/mcp tools', 'List MCP tools'));\n process.stdout.write(cmd('/mcp add', 'Add new MCP server'));\n process.stdout.write(cmd('/mcp help', 'MCP setup guide'));\n\n process.stdout.write(header('Frontend Flow', Icons.lightbulb));\n process.stdout.write(cmd('1) /mcp add', 'Connect Figma MCP'));\n process.stdout.write(cmd('2) /init', 'Map project and create context'));\n process.stdout.write(cmd('3) /agents', 'Ensure frontend agent is loaded'));\n process.stdout.write(cmd('4) prompt', 'Ask to scaffold screens/components from Figma'));\n\n process.stdout.write(header('Mentions', Icons.file));\n process.stdout.write(cmd('@file.ts', 'Inject file content'));\n process.stdout.write(cmd('@dir/', 'Inject directory listing'));\n process.stdout.write(cmd('@git:status', 'Inject git status'));\n\n process.stdout.write(header('Tips', Icons.lightbulb));\n process.stdout.write(` ${colorize('Type /', 'dim')} Commands appear as you type\\r\\n`);\n process.stdout.write(` ${colorize('Type @', 'dim')} File suggestions appear\\r\\n`);\n process.stdout.write(` ${colorize('Tab', 'dim')} Accept suggestion\\r\\n`);\n process.stdout.write(` ${colorize('↑↓', 'dim')} Navigate suggestions\\r\\n`);\n process.stdout.write(` ${colorize('Ctrl+C', 'dim')} Cancel operation\\r\\n`);\n process.stdout.write(` ${colorize('Ctrl+D', 'dim')} Exit\\r\\n`);\n \n process.stdout.write('\\r\\n');\n }\n\n cmdClear(welcomeScreen: { printBanner: () => void }): void {\n this.deepAgent.clearHistory();\n process.stdout.write('\\x1b[2J\\x1b[H');\n welcomeScreen.printBanner();\n process.stdout.write(`${Colors.green} Conversation cleared${Colors.reset}\\r\\n`);\n }\n\n cmdContext(): void {\n const w = (s: string) => process.stdout.write(s);\n\n w('\\r\\n');\n w(colorize(Icons.circle + ' ', 'accent') + colorize('Session Info', 'bold') + '\\r\\n');\n w(colorize(Box.horizontal.repeat(40), 'subtle') + '\\r\\n\\r\\n');\n\n w(` ${colorize('Messages:', 'muted')} ${this.deepAgent.getMessageCount()}\\r\\n`);\n w(` ${colorize('Tokens:', 'muted')} ${colorize(this.deepAgent.getTokenCount().toLocaleString(), 'cyan')}\\r\\n`);\n w(` ${colorize('CWD:', 'muted')} ${colorize(process.cwd(), 'accent')}\\r\\n`);\n w(` ${colorize('Model:', 'muted')} ${colorize(this.configService.getProvider() + '/' + this.configService.getModel(), 'cyan')}\\r\\n\\r\\n`);\n\n const mcpSummaries = this.mcpRegistry.getServerSummaries();\n const mcpConnected = mcpSummaries.filter(s => s.status === 'connected').length;\n const mcpTotal = mcpSummaries.length;\n const mcpTools = mcpSummaries.reduce((sum, s) => sum + s.toolCount, 0);\n\n w(` ${colorize('MCP Servers:', 'muted')} ${colorize(mcpConnected.toString(), mcpConnected > 0 ? 'success' : 'muted')}/${mcpTotal}`);\n if (mcpTools > 0) {\n w(` ${colorize(`(${mcpTools} tools)`, 'muted')}`);\n }\n w('\\r\\n');\n\n if (mcpSummaries.length > 0) {\n mcpSummaries.forEach(s => {\n const icon = s.status === 'connected' ? colorize('●', 'success') : colorize('○', 'error');\n w(` ${icon} ${colorize(s.name, 'cyan')} ${colorize(`(${s.toolCount} tools)`, 'muted')}\\r\\n`);\n });\n w('\\r\\n');\n }\n\n const agents = this.agentLoader.getAllAgents();\n w(` ${colorize('Agents:', 'muted')} ${colorize(agents.length.toString(), 'cyan')}\\r\\n`);\n if (agents.length > 0) {\n const agentNames = agents.slice(0, 5).map(a => a.name).join(', ');\n const more = agents.length > 5 ? ` +${agents.length - 5}` : '';\n w(` ${colorize(agentNames + more, 'muted')}\\r\\n\\r\\n`);\n } else {\n w('\\r\\n');\n }\n\n const skills = this.skillRegistry.getAllSkills();\n w(` ${colorize('Skills:', 'muted')} ${colorize(skills.length.toString(), 'cyan')}\\r\\n`);\n if (skills.length > 0) {\n const skillNames = skills.slice(0, 5).map(s => s.name).join(', ');\n const more = skills.length > 5 ? ` +${skills.length - 5}` : '';\n w(` ${colorize(skillNames + more, 'muted')}\\r\\n\\r\\n`);\n } else {\n w('\\r\\n');\n }\n\n const hasContext = this.projectContext.hasContext();\n w(` ${colorize('Project:', 'muted')} ${hasContext ? colorize('✓ loaded', 'success') : colorize('not loaded', 'muted')}\\r\\n`);\n\n try {\n const memoryPath = this.memoryService['memoryPath'];\n if (memoryPath) {\n w(` ${colorize('Memory:', 'muted')} ${colorize('✓ enabled', 'success')}\\r\\n`);\n }\n } catch {\n w(` ${colorize('Memory:', 'muted')} ${colorize('not configured', 'muted')}\\r\\n`);\n }\n\n w('\\r\\n');\n }\n\n cmdConfig(): void {\n const fs = require('fs');\n const path = require('path');\n const castDir = path.join(process.cwd(), '.cast');\n const hasCastDir = fs.existsSync(castDir);\n \n process.stdout.write('\\r\\n');\n process.stdout.write(colorize(Icons.gear + ' ', 'accent') + colorize('Configuration', 'bold') + '\\r\\n');\n process.stdout.write(colorize(Box.horizontal.repeat(25), 'subtle') + '\\r\\n');\n process.stdout.write(` ${colorize('Provider:', 'muted')} ${colorize(this.configService.getProvider(), 'cyan')}\\r\\n`);\n process.stdout.write(` ${colorize('Model:', 'muted')} ${colorize(this.configService.getModel(), 'cyan')}\\r\\n`);\n process.stdout.write(` ${colorize('CWD:', 'muted')} ${colorize(process.cwd(), 'accent')}\\r\\n`);\n process.stdout.write(` ${colorize('Messages:', 'muted')} ${this.deepAgent.getMessageCount()}\\r\\n`);\n process.stdout.write(` ${colorize('.cast/:', 'muted')} ${hasCastDir ? colorize('✓ found', 'success') : colorize('not found (use /project)', 'warning')}\\r\\n`);\n process.stdout.write('\\r\\n');\n }\n\n cmdModel(args: string[]): void {\n if (args.length === 0) {\n process.stdout.write('\\r\\n' + colorize(Icons.robot + ' ', 'accent') + colorize('Current Model', 'bold') + '\\r\\n');\n process.stdout.write(colorize(Box.horizontal.repeat(20), 'subtle') + '\\r\\n');\n process.stdout.write(` Provider: ${colorize(this.configService.getProvider(), 'cyan')}\\r\\n`);\n process.stdout.write(` Model: ${colorize(this.configService.getModel(), 'cyan')}\\r\\n\\r\\n`);\n process.stdout.write(` ${colorize('Tip:', 'muted')} Set via env vars or .cast/config.md\\r\\n\\r\\n`);\n return;\n }\n process.stdout.write(`${Colors.yellow} Model change requires restart${Colors.reset}\\r\\n`);\n }\n\n cmdInit(): void {\n const fs = require('fs');\n const path = require('path');\n const castDir = path.join(process.cwd(), '.cast');\n\n if (fs.existsSync(castDir)) {\n process.stdout.write(` ${Colors.dim}.cast/ already exists${Colors.reset}\\r\\n`);\n return;\n }\n\n fs.mkdirSync(castDir, { recursive: true });\n fs.mkdirSync(path.join(castDir, 'agents'), { recursive: true });\n fs.mkdirSync(path.join(castDir, 'skills'), { recursive: true });\n fs.mkdirSync(path.join(castDir, 'mcp'), { recursive: true });\n\n fs.writeFileSync(\n path.join(castDir, 'config.md'),\n [\n '---',\n 'model: gpt-4.1',\n '---',\n '',\n '# Project Context',\n '',\n 'Describe your project here.',\n '',\n ].join('\\n'),\n );\n\n process.stdout.write(`${Colors.green} Initialized .cast/ directory${Colors.reset}\\r\\n`);\n process.stdout.write(` ${Colors.dim}Created: config.md, agents/, skills/, mcp/${Colors.reset}\\r\\n\\r\\n`);\n }\n\n cmdMentionsHelp(): void {\n process.stdout.write('\\r\\n');\n process.stdout.write(colorize(Icons.file + ' ', 'accent') + colorize('Mentions — inject context with @', 'bold') + '\\r\\n');\n process.stdout.write(colorize(Box.horizontal.repeat(35), 'subtle') + '\\r\\n');\n process.stdout.write(` ${colorize('@path/to/file.ts', 'cyan')} Read file content\\r\\n`);\n process.stdout.write(` ${colorize('@path/to/dir/', 'cyan')} List directory\\r\\n`);\n process.stdout.write(` ${colorize('@https://url.com', 'cyan')} Fetch URL\\r\\n`);\n process.stdout.write(` ${colorize('@git:status', 'cyan')} Git status\\r\\n`);\n process.stdout.write(` ${colorize('@git:diff', 'cyan')} Git diff\\r\\n`);\n process.stdout.write(` ${colorize('@git:log', 'cyan')} Git log\\r\\n`);\n process.stdout.write(` ${colorize('@git:branch', 'cyan')} List branches\\r\\n`);\n process.stdout.write('\\r\\n');\n process.stdout.write(` ${colorize('Example:', 'muted')} \"Explain this @src/main.ts\"\\r\\n`);\n process.stdout.write(` ${colorize('Tip:', 'muted')} Type @ and suggestions will appear\\r\\n`);\n process.stdout.write('\\r\\n');\n }\n}\n"],"names":["ReplCommandsService","printHelp","header","text","icon","iconStr","colorize","Box","horizontal","repeat","length","cmd","name","desc","nameWidth","paddedName","padEnd","process","stdout","write","Icons","diamond","branch","robot","search","gear","cloud","lightbulb","file","cmdClear","welcomeScreen","deepAgent","clearHistory","printBanner","Colors","green","reset","cmdContext","w","s","circle","getMessageCount","getTokenCount","toLocaleString","cwd","configService","getProvider","getModel","mcpSummaries","mcpRegistry","getServerSummaries","mcpConnected","filter","status","mcpTotal","mcpTools","reduce","sum","toolCount","toString","forEach","agents","agentLoader","getAllAgents","agentNames","slice","map","a","join","more","skills","skillRegistry","getAllSkills","skillNames","hasContext","projectContext","memoryPath","memoryService","cmdConfig","fs","require","path","castDir","hasCastDir","existsSync","cmdModel","args","yellow","cmdInit","dim","mkdirSync","recursive","writeFileSync","cmdMentionsHelp"],"mappings":";;;;+BAWaA;;;eAAAA;;;wBAXc;uBACkB;+BACf;kCACG;oCACE;oCACA;sCACE;uCACC;+BACR;;;;;;;;;;AAGvB,IAAA,AAAMA,sBAAN,MAAMA;IAWXC,YAAkB;QAChB,MAAMC,SAAS,CAACC,MAAcC;YAC5B,MAAMC,UAAUD,OAAOE,IAAAA,eAAQ,EAACF,OAAO,KAAK,YAAY;YACxD,OAAO,OAAOC,UAAUC,IAAAA,eAAQ,EAACH,MAAM,UAAU,OAAOG,IAAAA,eAAQ,EAACC,UAAG,CAACC,UAAU,CAACC,MAAM,CAACN,KAAKO,MAAM,GAAIN,CAAAA,OAAO,IAAI,CAAA,IAAK,YAAY;QACpI;QAEA,MAAMO,MAAM,CAACC,MAAcC,MAAcC,YAAY,EAAE;YACrD,MAAMC,aAAaH,KAAKI,MAAM,CAACF;YAC/B,OAAO,CAAC,EAAE,EAAER,IAAAA,eAAQ,EAACS,YAAY,QAAQ,CAAC,EAAET,IAAAA,eAAQ,EAACO,MAAM,SAAS,IAAI,CAAC;QAC3E;QAEAI,QAAQC,MAAM,CAACC,KAAK,CAAC;QAErBF,QAAQC,MAAM,CAACC,KAAK,CAACjB,OAAO,YAAYkB,YAAK,CAACC,OAAO;QACrDJ,QAAQC,MAAM,CAACC,KAAK,CAACR,IAAI,SAAS;QAClCM,QAAQC,MAAM,CAACC,KAAK,CAACR,IAAI,UAAU;QACnCM,QAAQC,MAAM,CAACC,KAAK,CAACR,IAAI,YAAY;QACrCM,QAAQC,MAAM,CAACC,KAAK,CAAC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sBAAsB,CAAC;QAC9EW,QAAQC,MAAM,CAACC,KAAK,CAAC,CAAC,EAAE,EAAEb,IAAAA,eAAQ,EAAC,eAAe,QAAQ,yBAAyB,CAAC;QACpFW,QAAQC,MAAM,CAACC,KAAK,CAAC;QACrBF,QAAQC,MAAM,CAACC,KAAK,CAAC,CAAC,EAAE,EAAEb,IAAAA,eAAQ,EAAC,YAAY,SAAS,gCAAgC,CAAC;QACzFW,QAAQC,MAAM,CAACC,KAAK,CAAC,CAAC,EAAE,EAAEb,IAAAA,eAAQ,EAAC,QAAQ,SAAS,uCAAuC,CAAC;QAC5FW,QAAQC,MAAM,CAACC,KAAK,CAAC;IACvB;IA7OA,YACE,AAAiBY,SAA2B,EAC5C,AAAiBc,aAA4B,EAC7C,AAAiBI,WAA+B,EAChD,AAAiBa,WAA+B,EAChD,AAAiBS,aAAmC,EACpD,AAAiBI,cAAqC,EACtD,AAAiBE,aAA4B,CAC7C;aAPiB9C,YAAAA;aACAc,gBAAAA;aACAI,cAAAA;aACAa,cAAAA;aACAS,gBAAAA;aACAI,iBAAAA;aACAE,gBAAAA;IAChB;AAsOL"}
1
+ {"version":3,"sources":["../../../../../src/modules/repl/services/commands/repl-commands.service.ts"],"sourcesContent":["import { Injectable } from '@nestjs/common';\nimport { Colors, colorize, Box, Icons } from '../../utils/theme';\nimport { ConfigService } from '../../../../common/services/config.service';\nimport { DeepAgentService } from '../../../core/services/deep-agent.service';\nimport { McpRegistryService } from '../../../mcp/services/mcp-registry.service';\nimport { AgentLoaderService } from '../../../agents/services/agent-loader.service';\nimport { SkillRegistryService } from '../../../skills/services/skill-registry.service';\nimport { ProjectContextService } from '../../../project/services/project-context.service';\nimport { MemoryService } from '../../../memory/services/memory.service';\n\n@Injectable()\nexport class ReplCommandsService {\n constructor(\n private readonly deepAgent: DeepAgentService,\n private readonly configService: ConfigService,\n private readonly mcpRegistry: McpRegistryService,\n private readonly agentLoader: AgentLoaderService,\n private readonly skillRegistry: SkillRegistryService,\n private readonly projectContext: ProjectContextService,\n private readonly memoryService: MemoryService,\n ) {}\n\n printHelp(): void {\n const header = (text: string, icon?: string) => {\n const iconStr = icon ? colorize(icon + ' ', 'accent') : '';\n return '\\n' + iconStr + colorize(text, 'bold') + '\\n' + colorize(Box.horizontal.repeat(text.length + (icon ? 2 : 0)), 'subtle') + '\\n';\n };\n\n const cmd = (name: string, desc: string, nameWidth = 16) => {\n const paddedName = name.padEnd(nameWidth);\n return ` ${colorize(paddedName, 'cyan')} ${colorize(desc, 'muted')}\\r\\n`;\n };\n\n process.stdout.write('\\r\\n');\n \n process.stdout.write(header('Commands', Icons.diamond));\n process.stdout.write(cmd('/help', 'Show this help'));\n process.stdout.write(cmd('/clear', 'Clear conversation'));\n process.stdout.write(cmd('/compact', 'Compact history'));\n process.stdout.write(cmd('/exit', 'Exit'));\n\n process.stdout.write(header('Git', Icons.branch));\n process.stdout.write(cmd('/status', 'Git status'));\n process.stdout.write(cmd('/diff', 'Git diff'));\n process.stdout.write(cmd('/log', 'Git log (recent 15)'));\n process.stdout.write(cmd('/commit [msg]', 'Commit (AI-assisted or manual)'));\n process.stdout.write(cmd('/up', 'Smart commit & push'));\n process.stdout.write(cmd('/split-up', 'Split into multiple commits'));\n process.stdout.write(cmd('/pr', 'Create PR with AI description'));\n process.stdout.write(cmd('/unit-test', 'Generate unit tests for branch changes'));\n process.stdout.write(cmd('/review [files]', 'Code review'));\n process.stdout.write(cmd('/fix <file>', 'Auto-fix code issues'));\n process.stdout.write(cmd('/ident', 'Format all code files'));\n process.stdout.write(cmd('/release [tag]', 'Generate release notes'));\n\n process.stdout.write(header('Agents & Skills', Icons.robot));\n process.stdout.write(cmd('/agents', 'List agents'));\n process.stdout.write(cmd('/agents create', 'Create new agent'));\n process.stdout.write(cmd('/skills', 'List skills'));\n process.stdout.write(cmd('/skills create', 'Create new skill'));\n\n process.stdout.write(header('Info', Icons.search));\n process.stdout.write(cmd('/tools', 'List available tools'));\n process.stdout.write(cmd('/context', 'Session info'));\n process.stdout.write(cmd('/mentions', 'Mentions help (@)'));\n\n process.stdout.write(header('Config', Icons.gear));\n process.stdout.write(cmd('/model', 'Show/change model'));\n process.stdout.write(cmd('/config', 'Show configuration'));\n process.stdout.write(cmd('/init', 'Analyze project and generate context'));\n process.stdout.write(cmd('/project-deep', 'Generate deep context + agent brief'));\n\n process.stdout.write(header('MCP', Icons.cloud));\n process.stdout.write(cmd('/mcp list', 'List MCP servers'));\n process.stdout.write(cmd('/mcp tools', 'List MCP tools'));\n process.stdout.write(cmd('/mcp add', 'Add new MCP server'));\n process.stdout.write(cmd('/mcp help', 'MCP setup guide'));\n\n process.stdout.write(header('Frontend Flow', Icons.lightbulb));\n process.stdout.write(cmd('1) /mcp add', 'Connect Figma MCP'));\n process.stdout.write(cmd('2) /init', 'Map project and create context'));\n process.stdout.write(cmd('3) /agents', 'Ensure frontend agent is loaded'));\n process.stdout.write(cmd('4) prompt', 'Ask to scaffold screens/components from Figma'));\n\n process.stdout.write(header('Mentions', Icons.file));\n process.stdout.write(cmd('@file.ts', 'Inject file content'));\n process.stdout.write(cmd('@dir/', 'Inject directory listing'));\n process.stdout.write(cmd('@git:status', 'Inject git status'));\n\n process.stdout.write(header('Tips', Icons.lightbulb));\n process.stdout.write(` ${colorize('Type /', 'dim')} Commands appear as you type\\r\\n`);\n process.stdout.write(` ${colorize('Type @', 'dim')} File suggestions appear\\r\\n`);\n process.stdout.write(` ${colorize('Tab', 'dim')} Accept suggestion\\r\\n`);\n process.stdout.write(` ${colorize('↑↓', 'dim')} Navigate suggestions\\r\\n`);\n process.stdout.write(` ${colorize('Ctrl+C', 'dim')} Cancel operation\\r\\n`);\n process.stdout.write(` ${colorize('Ctrl+D', 'dim')} Exit\\r\\n`);\n \n process.stdout.write('\\r\\n');\n }\n\n cmdClear(welcomeScreen: { printBanner: () => void }): void {\n this.deepAgent.clearHistory();\n process.stdout.write('\\x1b[2J\\x1b[H');\n welcomeScreen.printBanner();\n process.stdout.write(`${Colors.green} Conversation cleared${Colors.reset}\\r\\n`);\n }\n\n cmdContext(): void {\n const w = (s: string) => process.stdout.write(s);\n\n w('\\r\\n');\n w(colorize(Icons.circle + ' ', 'accent') + colorize('Session Info', 'bold') + '\\r\\n');\n w(colorize(Box.horizontal.repeat(40), 'subtle') + '\\r\\n\\r\\n');\n\n w(` ${colorize('Messages:', 'muted')} ${this.deepAgent.getMessageCount()}\\r\\n`);\n w(` ${colorize('Tokens:', 'muted')} ${colorize(this.deepAgent.getTokenCount().toLocaleString(), 'cyan')}\\r\\n`);\n w(` ${colorize('CWD:', 'muted')} ${colorize(process.cwd(), 'accent')}\\r\\n`);\n w(` ${colorize('Model:', 'muted')} ${colorize(this.configService.getProvider() + '/' + this.configService.getModel(), 'cyan')}\\r\\n\\r\\n`);\n\n const mcpSummaries = this.mcpRegistry.getServerSummaries();\n const mcpConnected = mcpSummaries.filter(s => s.status === 'connected').length;\n const mcpTotal = mcpSummaries.length;\n const mcpTools = mcpSummaries.reduce((sum, s) => sum + s.toolCount, 0);\n\n w(` ${colorize('MCP Servers:', 'muted')} ${colorize(mcpConnected.toString(), mcpConnected > 0 ? 'success' : 'muted')}/${mcpTotal}`);\n if (mcpTools > 0) {\n w(` ${colorize(`(${mcpTools} tools)`, 'muted')}`);\n }\n w('\\r\\n');\n\n if (mcpSummaries.length > 0) {\n mcpSummaries.forEach(s => {\n const icon = s.status === 'connected' ? colorize('●', 'success') : colorize('○', 'error');\n w(` ${icon} ${colorize(s.name, 'cyan')} ${colorize(`(${s.toolCount} tools)`, 'muted')}\\r\\n`);\n });\n w('\\r\\n');\n }\n\n const agents = this.agentLoader.getAllAgents();\n w(` ${colorize('Agents:', 'muted')} ${colorize(agents.length.toString(), 'cyan')}\\r\\n`);\n if (agents.length > 0) {\n const agentNames = agents.slice(0, 5).map(a => a.name).join(', ');\n const more = agents.length > 5 ? ` +${agents.length - 5}` : '';\n w(` ${colorize(agentNames + more, 'muted')}\\r\\n\\r\\n`);\n } else {\n w('\\r\\n');\n }\n\n const skills = this.skillRegistry.getAllSkills();\n w(` ${colorize('Skills:', 'muted')} ${colorize(skills.length.toString(), 'cyan')}\\r\\n`);\n if (skills.length > 0) {\n const skillNames = skills.slice(0, 5).map(s => s.name).join(', ');\n const more = skills.length > 5 ? ` +${skills.length - 5}` : '';\n w(` ${colorize(skillNames + more, 'muted')}\\r\\n\\r\\n`);\n } else {\n w('\\r\\n');\n }\n\n const hasContext = this.projectContext.hasContext();\n w(` ${colorize('Project:', 'muted')} ${hasContext ? colorize('✓ loaded', 'success') : colorize('not loaded', 'muted')}\\r\\n`);\n\n try {\n const memoryPath = this.memoryService['memoryPath'];\n if (memoryPath) {\n w(` ${colorize('Memory:', 'muted')} ${colorize('✓ enabled', 'success')}\\r\\n`);\n }\n } catch {\n w(` ${colorize('Memory:', 'muted')} ${colorize('not configured', 'muted')}\\r\\n`);\n }\n\n w('\\r\\n');\n }\n\n cmdConfig(): void {\n const fs = require('fs');\n const path = require('path');\n const castDir = path.join(process.cwd(), '.cast');\n const hasCastDir = fs.existsSync(castDir);\n \n process.stdout.write('\\r\\n');\n process.stdout.write(colorize(Icons.gear + ' ', 'accent') + colorize('Configuration', 'bold') + '\\r\\n');\n process.stdout.write(colorize(Box.horizontal.repeat(25), 'subtle') + '\\r\\n');\n process.stdout.write(` ${colorize('Provider:', 'muted')} ${colorize(this.configService.getProvider(), 'cyan')}\\r\\n`);\n process.stdout.write(` ${colorize('Model:', 'muted')} ${colorize(this.configService.getModel(), 'cyan')}\\r\\n`);\n process.stdout.write(` ${colorize('CWD:', 'muted')} ${colorize(process.cwd(), 'accent')}\\r\\n`);\n process.stdout.write(` ${colorize('Messages:', 'muted')} ${this.deepAgent.getMessageCount()}\\r\\n`);\n process.stdout.write(` ${colorize('.cast/:', 'muted')} ${hasCastDir ? colorize('✓ found', 'success') : colorize('not found (use /project)', 'warning')}\\r\\n`);\n process.stdout.write('\\r\\n');\n }\n\n cmdModel(args: string[]): void {\n if (args.length === 0) {\n process.stdout.write('\\r\\n' + colorize(Icons.robot + ' ', 'accent') + colorize('Current Model', 'bold') + '\\r\\n');\n process.stdout.write(colorize(Box.horizontal.repeat(20), 'subtle') + '\\r\\n');\n process.stdout.write(` Provider: ${colorize(this.configService.getProvider(), 'cyan')}\\r\\n`);\n process.stdout.write(` Model: ${colorize(this.configService.getModel(), 'cyan')}\\r\\n\\r\\n`);\n process.stdout.write(` ${colorize('Tip:', 'muted')} Set via env vars or .cast/config.md\\r\\n\\r\\n`);\n return;\n }\n process.stdout.write(`${Colors.yellow} Model change requires restart${Colors.reset}\\r\\n`);\n }\n\n cmdInit(): void {\n const fs = require('fs');\n const path = require('path');\n const castDir = path.join(process.cwd(), '.cast');\n\n if (fs.existsSync(castDir)) {\n process.stdout.write(` ${Colors.dim}.cast/ already exists${Colors.reset}\\r\\n`);\n return;\n }\n\n fs.mkdirSync(castDir, { recursive: true });\n fs.mkdirSync(path.join(castDir, 'agents'), { recursive: true });\n fs.mkdirSync(path.join(castDir, 'skills'), { recursive: true });\n fs.mkdirSync(path.join(castDir, 'mcp'), { recursive: true });\n\n fs.writeFileSync(\n path.join(castDir, 'config.md'),\n [\n '---',\n 'model: gpt-4.1',\n '---',\n '',\n '# Project Context',\n '',\n 'Describe your project here.',\n '',\n ].join('\\n'),\n );\n\n process.stdout.write(`${Colors.green} Initialized .cast/ directory${Colors.reset}\\r\\n`);\n process.stdout.write(` ${Colors.dim}Created: config.md, agents/, skills/, mcp/${Colors.reset}\\r\\n\\r\\n`);\n }\n\n cmdMentionsHelp(): void {\n process.stdout.write('\\r\\n');\n process.stdout.write(colorize(Icons.file + ' ', 'accent') + colorize('Mentions — inject context with @', 'bold') + '\\r\\n');\n process.stdout.write(colorize(Box.horizontal.repeat(35), 'subtle') + '\\r\\n');\n process.stdout.write(` ${colorize('@path/to/file.ts', 'cyan')} Read file content\\r\\n`);\n process.stdout.write(` ${colorize('@path/to/dir/', 'cyan')} List directory\\r\\n`);\n process.stdout.write(` ${colorize('@https://url.com', 'cyan')} Fetch URL\\r\\n`);\n process.stdout.write(` ${colorize('@git:status', 'cyan')} Git status\\r\\n`);\n process.stdout.write(` ${colorize('@git:diff', 'cyan')} Git diff\\r\\n`);\n process.stdout.write(` ${colorize('@git:log', 'cyan')} Git log\\r\\n`);\n process.stdout.write(` ${colorize('@git:branch', 'cyan')} List branches\\r\\n`);\n process.stdout.write('\\r\\n');\n process.stdout.write(` ${colorize('Example:', 'muted')} \"Explain this @src/main.ts\"\\r\\n`);\n process.stdout.write(` ${colorize('Tip:', 'muted')} Type @ and suggestions will appear\\r\\n`);\n process.stdout.write('\\r\\n');\n }\n}\n"],"names":["ReplCommandsService","printHelp","header","text","icon","iconStr","colorize","Box","horizontal","repeat","length","cmd","name","desc","nameWidth","paddedName","padEnd","process","stdout","write","Icons","diamond","branch","robot","search","gear","cloud","lightbulb","file","cmdClear","welcomeScreen","deepAgent","clearHistory","printBanner","Colors","green","reset","cmdContext","w","s","circle","getMessageCount","getTokenCount","toLocaleString","cwd","configService","getProvider","getModel","mcpSummaries","mcpRegistry","getServerSummaries","mcpConnected","filter","status","mcpTotal","mcpTools","reduce","sum","toolCount","toString","forEach","agents","agentLoader","getAllAgents","agentNames","slice","map","a","join","more","skills","skillRegistry","getAllSkills","skillNames","hasContext","projectContext","memoryPath","memoryService","cmdConfig","fs","require","path","castDir","hasCastDir","existsSync","cmdModel","args","yellow","cmdInit","dim","mkdirSync","recursive","writeFileSync","cmdMentionsHelp"],"mappings":";;;;+BAWaA;;;eAAAA;;;wBAXc;uBACkB;+BACf;kCACG;oCACE;oCACA;sCACE;uCACC;+BACR;;;;;;;;;;AAGvB,IAAA,AAAMA,sBAAN,MAAMA;IAWXC,YAAkB;QAChB,MAAMC,SAAS,CAACC,MAAcC;YAC5B,MAAMC,UAAUD,OAAOE,IAAAA,eAAQ,EAACF,OAAO,KAAK,YAAY;YACxD,OAAO,OAAOC,UAAUC,IAAAA,eAAQ,EAACH,MAAM,UAAU,OAAOG,IAAAA,eAAQ,EAACC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AAAiBE,aAA4B,CAC7C;aAPiB9C,YAAAA;aACAc,gBAAAA;aACAI,cAAAA;aACAa,cAAAA;aACAS,gBAAAA;aACAI,iBAAAA;aACAE,gBAAAA;IAChB;AAuOL"}
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _strict = /*#__PURE__*/ _interop_require_default(require("node:assert/strict"));
6
+ const _nodetest = require("node:test");
7
+ const _replcommandsservice = require("./repl-commands.service");
8
+ function _interop_require_default(obj) {
9
+ return obj && obj.__esModule ? obj : {
10
+ default: obj
11
+ };
12
+ }
13
+ const createService = ()=>new _replcommandsservice.ReplCommandsService({
14
+ clearHistory: ()=>{},
15
+ getMessageCount: ()=>0,
16
+ getTokenCount: ()=>0
17
+ }, {
18
+ getProvider: ()=>'test-provider',
19
+ getModel: ()=>'test-model'
20
+ }, {
21
+ getServerSummaries: ()=>[]
22
+ }, {
23
+ getAllAgents: ()=>[]
24
+ }, {
25
+ getAllSkills: ()=>[]
26
+ }, {
27
+ hasContext: ()=>false
28
+ }, {});
29
+ (0, _nodetest.describe)('ReplCommandsService printHelp', ()=>{
30
+ let service;
31
+ let capturedWrites = [];
32
+ let originalStdoutWrite;
33
+ (0, _nodetest.beforeEach)(()=>{
34
+ capturedWrites = [];
35
+ originalStdoutWrite = process.stdout.write;
36
+ process.stdout.write = (chunk)=>{
37
+ capturedWrites.push(typeof chunk === 'string' ? chunk : chunk.toString());
38
+ return true;
39
+ };
40
+ service = createService();
41
+ });
42
+ (0, _nodetest.afterEach)(()=>{
43
+ process.stdout.write = originalStdoutWrite;
44
+ });
45
+ // Ensures the /unit-test entry appears exactly once with its description in the help output.
46
+ (0, _nodetest.test)('/unit-test command is listed with full description', ()=>{
47
+ service.printHelp();
48
+ const combined = capturedWrites.join('');
49
+ _strict.default.ok(combined.includes('/unit-test'), 'Help output should mention the /unit-test command');
50
+ _strict.default.ok(combined.includes('Generate unit tests for branch changes'), 'Help output should describe what /unit-test does');
51
+ const occurrences = (combined.match(/\/unit-test/g) ?? []).length;
52
+ _strict.default.strictEqual(occurrences, 1, 'The /unit-test entry should only appear once');
53
+ });
54
+ // Confirms the /unit-test command remains ordered between /pr and /review commands in the commands section.
55
+ (0, _nodetest.test)('/unit-test is positioned between /pr and /review entries', ()=>{
56
+ service.printHelp();
57
+ const combined = capturedWrites.join('');
58
+ const prIndex = combined.indexOf('/pr');
59
+ const unitTestIndex = combined.indexOf('/unit-test');
60
+ const reviewIndex = combined.indexOf('/review');
61
+ _strict.default.ok(prIndex >= 0, 'Help output must contain /pr entry');
62
+ _strict.default.ok(unitTestIndex >= 0, 'Help output must contain /unit-test entry');
63
+ _strict.default.ok(reviewIndex >= 0, 'Help output must contain /review entry');
64
+ _strict.default.ok(prIndex < unitTestIndex, '/unit-test should appear after /pr');
65
+ _strict.default.ok(unitTestIndex < reviewIndex, '/unit-test should appear before /review');
66
+ });
67
+ });
68
+
69
+ //# sourceMappingURL=repl-commands.service.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/modules/repl/services/commands/repl-commands.service.spec.ts"],"sourcesContent":["import assert from 'node:assert/strict';\nimport { afterEach, beforeEach, describe, test } from 'node:test';\nimport { ReplCommandsService } from './repl-commands.service';\n\nconst createService = () =>\n new ReplCommandsService(\n { clearHistory: () => {}, getMessageCount: () => 0, getTokenCount: () => 0 } as any,\n { getProvider: () => 'test-provider', getModel: () => 'test-model' } as any,\n { getServerSummaries: () => [] } as any,\n { getAllAgents: () => [] } as any,\n { getAllSkills: () => [] } as any,\n { hasContext: () => false } as any,\n {} as any,\n );\n\ndescribe('ReplCommandsService printHelp', () => {\n let service: ReplCommandsService;\n let capturedWrites: string[] = [];\n let originalStdoutWrite: typeof process.stdout.write;\n\n beforeEach(() => {\n capturedWrites = [];\n originalStdoutWrite = process.stdout.write;\n process.stdout.write = ((chunk: string | Buffer) => {\n capturedWrites.push(typeof chunk === 'string' ? chunk : chunk.toString());\n return true;\n }) as typeof process.stdout.write;\n service = createService();\n });\n\n afterEach(() => {\n process.stdout.write = originalStdoutWrite;\n });\n\n // Ensures the /unit-test entry appears exactly once with its description in the help output.\n test('/unit-test command is listed with full description', () => {\n service.printHelp();\n const combined = capturedWrites.join('');\n assert.ok(combined.includes('/unit-test'), 'Help output should mention the /unit-test command');\n assert.ok(\n combined.includes('Generate unit tests for branch changes'),\n 'Help output should describe what /unit-test does',\n );\n const occurrences = (combined.match(/\\/unit-test/g) ?? []).length;\n assert.strictEqual(occurrences, 1, 'The /unit-test entry should only appear once');\n });\n\n // Confirms the /unit-test command remains ordered between /pr and /review commands in the commands section.\n test('/unit-test is positioned between /pr and /review entries', () => {\n service.printHelp();\n const combined = capturedWrites.join('');\n const prIndex = combined.indexOf('/pr');\n const unitTestIndex = combined.indexOf('/unit-test');\n const reviewIndex = combined.indexOf('/review');\n assert.ok(prIndex >= 0, 'Help output must contain /pr entry');\n assert.ok(unitTestIndex >= 0, 'Help output must contain /unit-test entry');\n assert.ok(reviewIndex >= 0, 'Help output must contain /review entry');\n assert.ok(prIndex < unitTestIndex, '/unit-test should appear after /pr');\n assert.ok(unitTestIndex < reviewIndex, '/unit-test should appear before /review');\n });\n});\n"],"names":["createService","ReplCommandsService","clearHistory","getMessageCount","getTokenCount","getProvider","getModel","getServerSummaries","getAllAgents","getAllSkills","hasContext","describe","service","capturedWrites","originalStdoutWrite","beforeEach","process","stdout","write","chunk","push","toString","afterEach","test","printHelp","combined","join","assert","ok","includes","occurrences","match","length","strictEqual","prIndex","indexOf","unitTestIndex","reviewIndex"],"mappings":";;;;+DAAmB;0BACmC;qCAClB;;;;;;AAEpC,MAAMA,gBAAgB,IACpB,IAAIC,wCAAmB,CACrB;QAAEC,cAAc,KAAO;QAAGC,iBAAiB,IAAM;QAAGC,eAAe,IAAM;IAAE,GAC3E;QAAEC,aAAa,IAAM;QAAiBC,UAAU,IAAM;IAAa,GACnE;QAAEC,oBAAoB,IAAM,EAAE;IAAC,GA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CAACS,eAAe,GAAG;QAC5BV,eAAM,CAACC,EAAE,CAACM,UAAUE,eAAe;QACnCT,eAAM,CAACC,EAAE,CAACQ,gBAAgBC,aAAa;IACzC;AACF"}
@@ -114,6 +114,11 @@ let ReplService = class ReplService {
114
114
  display: '/pr',
115
115
  description: 'Create Pull Request'
116
116
  },
117
+ {
118
+ text: '/unit-test',
119
+ display: '/unit-test',
120
+ description: 'Generate unit tests'
121
+ },
117
122
  {
118
123
  text: '/review',
119
124
  display: '/review',
@@ -359,6 +364,9 @@ let ReplService = class ReplService {
359
364
  case 'pr':
360
365
  await this.gitCommands.cmdPr(this.smartInput);
361
366
  break;
367
+ case 'unit-test':
368
+ await this.gitCommands.cmdUnitTest(this.smartInput);
369
+ break;
362
370
  case 'review':
363
371
  await this.gitCommands.cmdReview(args);
364
372
  break;
@@ -554,7 +562,9 @@ let ReplService = class ReplService {
554
562
  startSpinner(label) {
555
563
  let i = 0;
556
564
  this.spinnerTimer = setInterval(()=>{
557
- process.stdout.write(`\r${_theme.Colors.cyan}${_theme.Icons.thinkingChestnut[i++ % _theme.Icons.thinkingChestnut.length]}${_theme.Colors.reset} ${_theme.Colors.dim}${label}...${_theme.Colors.reset}`);
565
+ const spinner = _theme.Icons.spinner[i % _theme.Icons.spinner.length];
566
+ i++;
567
+ process.stdout.write(`\r${_theme.Colors.cyan}${spinner}${_theme.Colors.reset} ${_theme.Colors.dim}${label}...${_theme.Colors.reset}`);
558
568
  }, 80);
559
569
  }
560
570
  stopSpinner() {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/modules/repl/services/repl.service.ts"],"sourcesContent":["import { Injectable } from '@nestjs/common';\nimport { DeepAgentService } from '../../core/services/deep-agent.service';\nimport { ConfigService } from '../../../common/services/config.service';\nimport { ConfigManagerService } from '../../config/services/config-manager.service';\nimport { MentionsService } from '../../mentions/services/mentions.service';\nimport { McpRegistryService } from '../../mcp/services/mcp-registry.service';\nimport { AgentRegistryService } from '../../agents/services/agent-registry.service';\nimport { SkillRegistryService } from '../../skills/services/skill-registry.service';\nimport { PlanModeService } from '../../core/services/plan-mode.service';\nimport { SmartInput } from './smart-input';\nimport { WelcomeScreenService } from './welcome-screen.service';\nimport { ReplCommandsService } from './commands/repl-commands.service';\nimport { GitCommandsService } from './commands/git-commands.service';\nimport { AgentCommandsService } from './commands/agent-commands.service';\nimport { McpCommandsService } from './commands/mcp-commands.service';\nimport { ConfigCommandsService } from '../../config/services/config-commands.service';\nimport { ProjectCommandsService } from './commands/project-commands.service';\nimport { ToolsRegistryService } from '../../tools/services/tools-registry.service';\nimport { Colors, Icons } from '../utils/theme';\n\n@Injectable()\nexport class ReplService {\n private smartInput: SmartInput | null = null;\n private abortController: AbortController | null = null;\n private isProcessing = false;\n private spinnerTimer: ReturnType<typeof setInterval> | null = null;\n\n constructor(\n private readonly deepAgent: DeepAgentService,\n private readonly configService: ConfigService,\n private readonly configManager: ConfigManagerService,\n private readonly mentionsService: MentionsService,\n private readonly mcpRegistry: McpRegistryService,\n private readonly agentRegistry: AgentRegistryService,\n private readonly skillRegistry: SkillRegistryService,\n private readonly welcomeScreen: WelcomeScreenService,\n private readonly planMode: PlanModeService,\n private readonly replCommands: ReplCommandsService,\n private readonly gitCommands: GitCommandsService,\n private readonly agentCommands: AgentCommandsService,\n private readonly mcpCommands: McpCommandsService,\n private readonly configCommands: ConfigCommandsService,\n private readonly projectCommands: ProjectCommandsService,\n private readonly toolsRegistry: ToolsRegistryService,\n ) {}\n\n async start(): Promise<void> {\n const initResult = await this.deepAgent.initialize();\n const agentCount = this.agentRegistry.resolveAllAgents().length;\n\n this.welcomeScreen.printWelcomeScreen({\n projectPath: initResult.projectPath || undefined,\n model: this.getModelDisplayName(),\n toolCount: initResult.toolCount,\n agentCount,\n });\n\n this.smartInput = new SmartInput({\n prompt: `${Colors.cyan}${Colors.bold}>${Colors.reset} `,\n promptVisibleLen: 2,\n getCommandSuggestions: (input) => this.getCommandSuggestions(input),\n getMentionSuggestions: (partial) => this.getMentionSuggestions(partial),\n onSubmit: (line) => this.handleLine(line),\n onCancel: () => this.handleCancel(),\n onExit: () => this.handleExit(),\n });\n\n this.smartInput.start();\n }\n\n private getCommandSuggestions(input: string): Array<{ text: string; display: string; description: string }> {\n const commands = [\n { text: '/help', display: '/help', description: 'Show help' },\n { text: '/clear', display: '/clear', description: 'Clear conversation' },\n { text: '/compact', display: '/compact', description: 'Compact history' },\n { text: '/exit', display: '/exit', description: 'Exit' },\n { text: '/status', display: '/status', description: 'Git status' },\n { text: '/diff', display: '/diff', description: 'Git diff' },\n { text: '/log', display: '/log', description: 'Git log' },\n { text: '/commit', display: '/commit', description: 'Commit changes' },\n { text: '/up', display: '/up', description: 'Smart commit & push' },\n { text: '/split-up', display: '/split-up', description: 'Split commits' },\n { text: '/pr', display: '/pr', description: 'Create Pull Request' },\n { text: '/review', display: '/review', description: 'Code review' },\n { text: '/fix', display: '/fix', description: 'Auto-fix code' },\n { text: '/ident', display: '/ident', description: 'Format code' },\n { text: '/release', display: '/release', description: 'Release notes' },\n { text: '/tools', display: '/tools', description: 'List tools' },\n { text: '/agents', display: '/agents', description: 'List agents' },\n { text: '/skills', display: '/skills', description: 'List skills' },\n { text: '/context', display: '/context', description: 'Session info' },\n { text: '/mentions', display: '/mentions', description: 'Mentions help' },\n { text: '/model', display: '/model', description: 'Show model' },\n { text: '/config', display: '/config', description: 'Configuration' },\n { text: '/project', display: '/project', description: 'Project context' },\n { text: '/project-deep', display: '/project-deep', description: 'Deep project analysis' },\n { text: '/init', display: '/init', description: 'Analyze project and generate context' },\n { text: '/mcp', display: '/mcp', description: 'MCP servers' },\n ];\n\n return commands.filter(c => c.text.startsWith(input));\n }\n\n private getMentionSuggestions(partial: string): Array<{ text: string; display: string; description: string }> {\n const fs = require('fs');\n const path = require('path');\n\n const gitOpts = [\n { text: '@git:status', display: '@git:status', description: 'Git status' },\n { text: '@git:diff', display: '@git:diff', description: 'Git diff' },\n { text: '@git:log', display: '@git:log', description: 'Git log' },\n { text: '@git:branch', display: '@git:branch', description: 'Branches' },\n ];\n\n if (partial === '') return [...gitOpts, ...this.getFileEntries('')];\n if (partial.startsWith('git:')) return gitOpts.filter(o => o.text.startsWith('@' + partial));\n\n return [...gitOpts.filter(o => o.text.startsWith('@' + partial)), ...this.getFileEntries(partial)].slice(0, 30);\n }\n\n private getFileEntries(partial: string): Array<{ text: string; display: string; description: string }> {\n const fs = require('fs');\n const path = require('path');\n\n try {\n let dir: string;\n let prefix: string;\n\n if (partial.endsWith('/')) {\n dir = partial.slice(0, -1) || '.';\n prefix = '';\n } else if (partial.includes('/')) {\n dir = path.dirname(partial);\n prefix = path.basename(partial);\n } else {\n dir = '.';\n prefix = partial;\n }\n\n const resolved = path.resolve(process.cwd(), dir);\n if (!fs.existsSync(resolved) || !fs.statSync(resolved).isDirectory()) return [];\n\n const entries = fs.readdirSync(resolved, { withFileTypes: true });\n const ignore = ['node_modules', '.git', 'dist', 'coverage', '.next', '__pycache__'];\n\n return entries\n .filter(e => !ignore.includes(e.name))\n .filter(e => !e.name.startsWith('.') || prefix.startsWith('.'))\n .filter(e => prefix === '' || e.name.toLowerCase().startsWith(prefix.toLowerCase()))\n .map(e => {\n const relDir = dir === '.' ? '' : dir + '/';\n const isDir = e.isDirectory();\n return {\n text: '@' + relDir + e.name + (isDir ? '/' : ''),\n display: '@' + relDir + e.name + (isDir ? '/' : ''),\n description: isDir ? 'dir' : '',\n };\n })\n .slice(0, 20);\n } catch {\n return [];\n }\n }\n\n private handleCancel(): void {\n if (this.isProcessing && this.abortController) {\n this.abortController.abort();\n this.stopSpinner();\n process.stdout.write(`\\r\\n${Colors.yellow} Cancelled${Colors.reset}\\r\\n\\r\\n`);\n this.isProcessing = false;\n } else {\n process.stdout.write(`${Colors.dim} (Use /exit to quit)${Colors.reset}\\r\\n`);\n this.smartInput?.showPrompt();\n }\n }\n\n private handleExit(): void {\n process.stdout.write(`${Colors.dim} Goodbye!${Colors.reset}\\r\\n`);\n this.stop();\n process.exit(0);\n }\n\n private async handleLine(input: string): Promise<void> {\n const trimmed = input.trim();\n\n if (!trimmed) {\n this.smartInput?.showPrompt();\n return;\n }\n\n if (trimmed.startsWith('/')) {\n await this.handleCommand(trimmed);\n } else {\n await this.handleMessage(trimmed);\n }\n\n this.smartInput?.showPrompt();\n }\n\n private async handleCommand(command: string): Promise<void> {\n const parts = command.slice(1).split(/\\s+/);\n const cmd = parts[0].toLowerCase();\n const args = parts.slice(1);\n\n switch (cmd) {\n case 'help': this.replCommands.printHelp(); break;\n case 'clear': this.replCommands.cmdClear(this.welcomeScreen); break;\n case 'exit':\n case 'quit': this.handleExit(); return;\n case 'compact': await this.handleCompact(); break;\n case 'context': this.replCommands.cmdContext(); break;\n case 'config':\n await this.configCommands.handleConfigCommand(args, this.smartInput!);\n await this.configManager.loadConfig();\n await this.deepAgent.reinitializeModel();\n break;\n case 'model': this.replCommands.cmdModel(args); break;\n case 'init':\n await this.projectCommands.cmdProject(['analyze'], this.smartInput!);\n break;\n case 'mentions': this.replCommands.cmdMentionsHelp(); break;\n case 'tools': this.cmdTools(); break;\n\n case 'status': this.gitCommands.runGit('git status'); break;\n case 'diff': this.gitCommands.runGit(args.length ? `git diff ${args.join(' ')}` : 'git diff'); break;\n case 'log': this.gitCommands.runGit('git log --oneline -15'); break;\n case 'commit': \n await this.gitCommands.cmdCommit(args, this.smartInput!); \n break;\n case 'up': \n await this.gitCommands.cmdUp(this.smartInput!); \n break;\n case 'split-up': \n await this.gitCommands.cmdSplitUp(this.smartInput!); \n break;\n case 'pr': \n await this.gitCommands.cmdPr(this.smartInput!); \n break;\n case 'review': await this.gitCommands.cmdReview(args); break;\n case 'fix': await this.gitCommands.cmdFix(args); break;\n case 'ident': await this.gitCommands.cmdIdent(); break;\n case 'release': await this.gitCommands.cmdRelease(args); break;\n\n case 'agents': \n await this.agentCommands.cmdAgents(args, this.smartInput!); \n break;\n case 'skills': \n await this.agentCommands.cmdSkills(args, this.smartInput!); \n break;\n\n case 'mcp': \n await this.mcpCommands.cmdMcp(args, this.smartInput!); \n break;\n\n case 'project':\n await this.projectCommands.cmdProject(args, this.smartInput!);\n break;\n case 'project-deep':\n await this.projectCommands.cmdProject(['deep'], this.smartInput!);\n break;\n\n default:\n process.stdout.write(`${Colors.red} Unknown: /${cmd}${Colors.reset} ${Colors.dim}Try /help${Colors.reset}\\r\\n`);\n }\n }\n\n private async handleCompact(): Promise<void> {\n const msgCount = this.deepAgent.getMessageCount();\n if (msgCount < 4) {\n process.stdout.write(`${Colors.dim} Nothing to compact (${msgCount} messages)${Colors.reset}\\r\\n`);\n return;\n }\n process.stdout.write(`${Colors.dim} Summarizing ${msgCount} messages...${Colors.reset}\\r\\n`);\n const result = await this.deepAgent.compactHistory();\n if (result.compacted) {\n process.stdout.write(`${Colors.green} Compacted: ${result.messagesBefore} → ${result.messagesAfter} messages${Colors.reset}\\r\\n`);\n } else {\n process.stdout.write(`${Colors.yellow} Could not compact (summarization failed)${Colors.reset}\\r\\n`);\n }\n }\n\n private async handleMessage(message: string): Promise<void> {\n this.isProcessing = true;\n this.abortController = new AbortController();\n this.smartInput?.enterPassiveMode();\n\n try {\n let messageToProcess = message;\n\n const planCheck = await this.planMode.shouldEnterPlanMode(message);\n if (planCheck.shouldPlan) {\n const usePlan = await this.smartInput!.askChoice(\n '📝 Complex task. Create a plan?',\n [\n { key: 'y', label: 'yes', description: 'Create structured plan' },\n { key: 'n', label: 'no', description: 'Proceed without plan' },\n ]\n );\n \n if (usePlan === 'y') {\n const plannedMessage = await this.runInteractivePlanMode(message);\n if (!plannedMessage) {\n this.isProcessing = false;\n this.smartInput?.exitPassiveMode();\n return;\n }\n messageToProcess = plannedMessage;\n }\n }\n\n const mentionResult = await this.mentionsService.processMessage(messageToProcess);\n if (mentionResult.mentions.length > 0) {\n const summary = this.mentionsService.getMentionsSummary(mentionResult.mentions);\n for (const line of summary) {\n process.stdout.write(`${Colors.dim}${line}${Colors.reset}\\r\\n`);\n }\n process.stdout.write('\\r\\n');\n }\n\n this.startSpinner('Thinking');\n\n let firstChunk = true;\n let fullResponse = '';\n\n for await (const chunk of this.deepAgent.chat(mentionResult.expandedMessage)) {\n if (this.abortController?.signal.aborted) break;\n\n const isToolOutput = chunk.includes('\\x1b[') && (\n chunk.includes('⏿') ||\n chunk.includes('tokens:') ||\n chunk.includes('conversation compacted')\n );\n\n if (firstChunk && !isToolOutput) {\n this.stopSpinner();\n process.stdout.write(`\\r\\n${Colors.magenta}${Colors.bold}${Icons.chestnut} Cast${Colors.reset}\\r\\n`);\n firstChunk = false;\n }\n\n if (!isToolOutput) {\n fullResponse += chunk;\n }\n process.stdout.write(chunk);\n }\n\n if (!firstChunk) {\n process.stdout.write('\\r\\n');\n } else {\n this.stopSpinner();\n }\n } catch (error) {\n this.stopSpinner();\n const msg = (error as Error).message;\n if (!msg.includes('abort')) {\n process.stdout.write(`\\r\\n${Colors.red} Error: ${msg}${Colors.reset}\\r\\n\\r\\n`);\n }\n } finally {\n this.isProcessing = false;\n this.abortController = null;\n this.smartInput?.exitPassiveMode();\n }\n }\n\n private async runInteractivePlanMode(userMessage: string): Promise<string | null> {\n process.stdout.write(`\\r\\n${Colors.cyan}${Colors.bold}📋 PLAN MODE${Colors.reset}\\r\\n`);\n process.stdout.write(`${Colors.dim}Build plan first, execute after approval${Colors.reset}\\r\\n\\r\\n`);\n\n const clarifyingQuestions = await this.planMode.generateClarifyingQuestions(userMessage);\n const answers: string[] = [];\n\n if (clarifyingQuestions.length > 0) {\n process.stdout.write(`${Colors.dim}I need a few quick clarifications:${Colors.reset}\\r\\n`);\n for (let i = 0; i < clarifyingQuestions.length; i++) {\n const q = clarifyingQuestions[i];\n const answer = await this.smartInput!.question(`${Colors.yellow}Q${i + 1}:${Colors.reset} ${q} `);\n if (answer.trim()) {\n answers.push(`- ${q} => ${answer.trim()}`);\n }\n }\n process.stdout.write('\\r\\n');\n }\n\n const context = answers.length > 0 ? `User clarifications:\\n${answers.join('\\n')}` : undefined;\n let plan = await this.planMode.generatePlan(userMessage, context);\n\n while (true) {\n process.stdout.write(this.planMode.formatPlanForDisplay(plan));\n\n const action = await this.smartInput!.askChoice('Plan options', [\n { key: 'a', label: 'accept', description: 'Use this plan and continue' },\n { key: 'r', label: 'refine', description: 'Refine plan with extra feedback' },\n { key: 'c', label: 'cancel', description: 'Cancel and return to prompt' },\n ]);\n\n if (action === 'c') {\n process.stdout.write(`${Colors.dim} Plan cancelled${Colors.reset}\\r\\n\\r\\n`);\n return null;\n }\n\n if (action === 'r') {\n const feedback = await this.smartInput!.question(`${Colors.cyan}Refinement feedback:${Colors.reset} `);\n if (!feedback.trim()) {\n process.stdout.write(`${Colors.dim} No feedback provided. Keeping current plan.${Colors.reset}\\r\\n\\r\\n`);\n continue;\n }\n plan = await this.planMode.refinePlan(plan, feedback.trim());\n continue;\n }\n\n return this.buildPlanExecutionPrompt(userMessage, plan, answers);\n }\n }\n\n private buildPlanExecutionPrompt(userMessage: string, plan: { title: string; overview: string; steps: Array<{ id: number; description: string; files: string[] }> }, clarifications: string[]): string {\n const lines: string[] = [];\n lines.push(userMessage);\n lines.push('');\n lines.push('Approved execution plan:');\n lines.push(`Title: ${plan.title}`);\n lines.push(`Overview: ${plan.overview}`);\n lines.push('Steps:');\n for (const step of plan.steps) {\n const files = step.files.length > 0 ? ` | files: ${step.files.join(', ')}` : '';\n lines.push(`${step.id}. ${step.description}${files}`);\n }\n if (clarifications.length > 0) {\n lines.push('');\n lines.push('User clarifications:');\n lines.push(...clarifications);\n }\n lines.push('');\n lines.push('Execute the task following this approved plan and report progress by step.');\n return lines.join('\\n');\n }\n\n private startSpinner(label: string): void {\n let i = 0;\n this.spinnerTimer = setInterval(() => {\n process.stdout.write(`\\r${Colors.cyan}${Icons.thinkingChestnut[i++ % Icons.thinkingChestnut.length]}${Colors.reset} ${Colors.dim}${label}...${Colors.reset}`);\n }, 80);\n }\n\n private stopSpinner(): void {\n if (this.spinnerTimer) {\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n process.stdout.write('\\r\\x1b[K');\n }\n }\n\n private cmdTools(): void {\n const allTools = this.toolsRegistry.getAllTools();\n const tools: [string, string][] = allTools.map(t => [t.name, t.description.slice(0, 60)]);\n\n if (tools.length > 0) {\n const maxLen = Math.max(...tools.map(([n]) => n.length));\n\n process.stdout.write('\\r\\n');\n process.stdout.write(`${Colors.bold}Built-in Tools (${tools.length}):${Colors.reset}\\r\\n`);\n for (const [name, desc] of tools) {\n process.stdout.write(` ${Colors.cyan}${name.padEnd(maxLen)}${Colors.reset} ${Colors.dim}${desc}${Colors.reset}\\r\\n`);\n }\n }\n\n const mcpTools = this.mcpRegistry.getAllMcpTools();\n if (mcpTools.length > 0) {\n process.stdout.write(`\\r\\n${Colors.bold}MCP Tools (${mcpTools.length}):${Colors.reset}\\r\\n`);\n for (const t of mcpTools.slice(0, 10)) {\n process.stdout.write(` ${Colors.cyan}${t.name}${Colors.reset} ${Colors.dim}${t.description.slice(0, 50)}${Colors.reset}\\r\\n`);\n }\n }\n process.stdout.write('\\r\\n');\n }\n\n private getModelDisplayName(): string {\n try {\n const modelConfig = this.configManager.getModelConfig('default');\n if (modelConfig) {\n return `${modelConfig.provider}/${modelConfig.model}`;\n }\n } catch {\n }\n return `${this.configService.getProvider()}/${this.configService.getModel()}`;\n }\n\n stop(): void {\n this.stopSpinner();\n this.smartInput?.destroy();\n }\n}\n"],"names":["ReplService","start","initResult","deepAgent","initialize","agentCount","agentRegistry","resolveAllAgents","length","welcomeScreen","printWelcomeScreen","projectPath","undefined","model","getModelDisplayName","toolCount","smartInput","SmartInput","prompt","Colors","cyan","bold","reset","promptVisibleLen","getCommandSuggestions","input","getMentionSuggestions","partial","onSubmit","line","handleLine","onCancel","handleCancel","onExit","handleExit","commands","text","display","description","filter","c","startsWith","fs","require","path","gitOpts","getFileEntries","o","slice","dir","prefix","endsWith","includes","dirname","basename","resolved","resolve","process","cwd","existsSync","statSync","isDirectory","entries","readdirSync","withFileTypes","ignore","e","name","toLowerCase","map","relDir","isDir","isProcessing","abortController","abort","stopSpinner","stdout","write","yellow","dim","showPrompt","stop","exit","trimmed","trim","handleCommand","handleMessage","command","parts","split","cmd","args","replCommands","printHelp","cmdClear","handleCompact","cmdContext","configCommands","handleConfigCommand","configManager","loadConfig","reinitializeModel","cmdModel","projectCommands","cmdProject","cmdMentionsHelp","cmdTools","gitCommands","runGit","join","cmdCommit","cmdUp","cmdSplitUp","cmdPr","cmdReview","cmdFix","cmdIdent","cmdRelease","agentCommands","cmdAgents","cmdSkills","mcpCommands","cmdMcp","red","msgCount","getMessageCount","result","compactHistory","compacted","green","messagesBefore","messagesAfter","message","AbortController","enterPassiveMode","messageToProcess","planCheck","planMode","shouldEnterPlanMode","shouldPlan","usePlan","askChoice","key","label","plannedMessage","runInteractivePlanMode","exitPassiveMode","mentionResult","mentionsService","processMessage","mentions","summary","getMentionsSummary","startSpinner","firstChunk","fullResponse","chunk","chat","expandedMessage","signal","aborted","isToolOutput","magenta","Icons","chestnut","error","msg","userMessage","clarifyingQuestions","generateClarifyingQuestions","answers","i","q","answer","question","push","context","plan","generatePlan","formatPlanForDisplay","action","feedback","refinePlan","buildPlanExecutionPrompt","clarifications","lines","title","overview","step","steps","files","id","spinnerTimer","setInterval","thinkingChestnut","clearInterval","allTools","toolsRegistry","getAllTools","tools","t","maxLen","Math","max","n","desc","padEnd","mcpTools","mcpRegistry","getAllMcpTools","modelConfig","getModelConfig","provider","configService","getProvider","getModel","destroy","skillRegistry"],"mappings":";;;;+BAqBaA;;;eAAAA;;;wBArBc;kCACM;+BACH;sCACO;iCACL;oCACG;sCACE;sCACA;iCACL;4BACL;sCACU;qCACD;oCACD;sCACE;oCACF;uCACG;wCACC;sCACF;uBACP;;;;;;;;;;AAGvB,IAAA,AAAMA,cAAN,MAAMA;IAyBX,MAAMC,QAAuB;QAC3B,MAAMC,aAAa,MAAM,IAAI,CAACC,SAAS,CAACC,UAAU;QAClD,MAAMC,aAAa,IAAI,CAACC,aAAa,CAACC,gBAAgB,GAAGC,MAAM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ACAhN,gBAAAA;aACAgI,WAAAA;aACA7C,eAAAA;aACAe,cAAAA;aACAW,gBAAAA;aACAG,cAAAA;aACAxB,iBAAAA;aACAM,kBAAAA;aACA8F,gBAAAA;aArBXrL,aAAgC;aAChCyD,kBAA0C;aAC1CD,eAAe;aACfwH,eAAsD;IAmB3D;AA6bL"}
1
+ {"version":3,"sources":["../../../../src/modules/repl/services/repl.service.ts"],"sourcesContent":["import { Injectable } from '@nestjs/common';\nimport { DeepAgentService } from '../../core/services/deep-agent.service';\nimport { ConfigService } from '../../../common/services/config.service';\nimport { ConfigManagerService } from '../../config/services/config-manager.service';\nimport { MentionsService } from '../../mentions/services/mentions.service';\nimport { McpRegistryService } from '../../mcp/services/mcp-registry.service';\nimport { AgentRegistryService } from '../../agents/services/agent-registry.service';\nimport { SkillRegistryService } from '../../skills/services/skill-registry.service';\nimport { PlanModeService } from '../../core/services/plan-mode.service';\nimport { SmartInput } from './smart-input';\nimport { WelcomeScreenService } from './welcome-screen.service';\nimport { ReplCommandsService } from './commands/repl-commands.service';\nimport { GitCommandsService } from './commands/git-commands.service';\nimport { AgentCommandsService } from './commands/agent-commands.service';\nimport { McpCommandsService } from './commands/mcp-commands.service';\nimport { ConfigCommandsService } from '../../config/services/config-commands.service';\nimport { ProjectCommandsService } from './commands/project-commands.service';\nimport { ToolsRegistryService } from '../../tools/services/tools-registry.service';\nimport { Colors, Icons } from '../utils/theme';\n\n@Injectable()\nexport class ReplService {\n private smartInput: SmartInput | null = null;\n private abortController: AbortController | null = null;\n private isProcessing = false;\n private spinnerTimer: ReturnType<typeof setInterval> | null = null;\n\n constructor(\n private readonly deepAgent: DeepAgentService,\n private readonly configService: ConfigService,\n private readonly configManager: ConfigManagerService,\n private readonly mentionsService: MentionsService,\n private readonly mcpRegistry: McpRegistryService,\n private readonly agentRegistry: AgentRegistryService,\n private readonly skillRegistry: SkillRegistryService,\n private readonly welcomeScreen: WelcomeScreenService,\n private readonly planMode: PlanModeService,\n private readonly replCommands: ReplCommandsService,\n private readonly gitCommands: GitCommandsService,\n private readonly agentCommands: AgentCommandsService,\n private readonly mcpCommands: McpCommandsService,\n private readonly configCommands: ConfigCommandsService,\n private readonly projectCommands: ProjectCommandsService,\n private readonly toolsRegistry: ToolsRegistryService,\n ) {}\n\n async start(): Promise<void> {\n const initResult = await this.deepAgent.initialize();\n const agentCount = this.agentRegistry.resolveAllAgents().length;\n\n this.welcomeScreen.printWelcomeScreen({\n projectPath: initResult.projectPath || undefined,\n model: this.getModelDisplayName(),\n toolCount: initResult.toolCount,\n agentCount,\n });\n\n this.smartInput = new SmartInput({\n prompt: `${Colors.cyan}${Colors.bold}>${Colors.reset} `,\n promptVisibleLen: 2,\n getCommandSuggestions: (input) => this.getCommandSuggestions(input),\n getMentionSuggestions: (partial) => this.getMentionSuggestions(partial),\n onSubmit: (line) => this.handleLine(line),\n onCancel: () => this.handleCancel(),\n onExit: () => this.handleExit(),\n });\n\n this.smartInput.start();\n }\n\n private getCommandSuggestions(input: string): Array<{ text: string; display: string; description: string }> {\n const commands = [\n { text: '/help', display: '/help', description: 'Show help' },\n { text: '/clear', display: '/clear', description: 'Clear conversation' },\n { text: '/compact', display: '/compact', description: 'Compact history' },\n { text: '/exit', display: '/exit', description: 'Exit' },\n { text: '/status', display: '/status', description: 'Git status' },\n { text: '/diff', display: '/diff', description: 'Git diff' },\n { text: '/log', display: '/log', description: 'Git log' },\n { text: '/commit', display: '/commit', description: 'Commit changes' },\n { text: '/up', display: '/up', description: 'Smart commit & push' },\n { text: '/split-up', display: '/split-up', description: 'Split commits' },\n { text: '/pr', display: '/pr', description: 'Create Pull Request' },\n { text: '/unit-test', display: '/unit-test', description: 'Generate unit tests' },\n { text: '/review', display: '/review', description: 'Code review' },\n { text: '/fix', display: '/fix', description: 'Auto-fix code' },\n { text: '/ident', display: '/ident', description: 'Format code' },\n { text: '/release', display: '/release', description: 'Release notes' },\n { text: '/tools', display: '/tools', description: 'List tools' },\n { text: '/agents', display: '/agents', description: 'List agents' },\n { text: '/skills', display: '/skills', description: 'List skills' },\n { text: '/context', display: '/context', description: 'Session info' },\n { text: '/mentions', display: '/mentions', description: 'Mentions help' },\n { text: '/model', display: '/model', description: 'Show model' },\n { text: '/config', display: '/config', description: 'Configuration' },\n { text: '/project', display: '/project', description: 'Project context' },\n { text: '/project-deep', display: '/project-deep', description: 'Deep project analysis' },\n { text: '/init', display: '/init', description: 'Analyze project and generate context' },\n { text: '/mcp', display: '/mcp', description: 'MCP servers' },\n ];\n\n return commands.filter(c => c.text.startsWith(input));\n }\n\n private getMentionSuggestions(partial: string): Array<{ text: string; display: string; description: string }> {\n const fs = require('fs');\n const path = require('path');\n\n const gitOpts = [\n { text: '@git:status', display: '@git:status', description: 'Git status' },\n { text: '@git:diff', display: '@git:diff', description: 'Git diff' },\n { text: '@git:log', display: '@git:log', description: 'Git log' },\n { text: '@git:branch', display: '@git:branch', description: 'Branches' },\n ];\n\n if (partial === '') return [...gitOpts, ...this.getFileEntries('')];\n if (partial.startsWith('git:')) return gitOpts.filter(o => o.text.startsWith('@' + partial));\n\n return [...gitOpts.filter(o => o.text.startsWith('@' + partial)), ...this.getFileEntries(partial)].slice(0, 30);\n }\n\n private getFileEntries(partial: string): Array<{ text: string; display: string; description: string }> {\n const fs = require('fs');\n const path = require('path');\n\n try {\n let dir: string;\n let prefix: string;\n\n if (partial.endsWith('/')) {\n dir = partial.slice(0, -1) || '.';\n prefix = '';\n } else if (partial.includes('/')) {\n dir = path.dirname(partial);\n prefix = path.basename(partial);\n } else {\n dir = '.';\n prefix = partial;\n }\n\n const resolved = path.resolve(process.cwd(), dir);\n if (!fs.existsSync(resolved) || !fs.statSync(resolved).isDirectory()) return [];\n\n const entries = fs.readdirSync(resolved, { withFileTypes: true });\n const ignore = ['node_modules', '.git', 'dist', 'coverage', '.next', '__pycache__'];\n\n return entries\n .filter(e => !ignore.includes(e.name))\n .filter(e => !e.name.startsWith('.') || prefix.startsWith('.'))\n .filter(e => prefix === '' || e.name.toLowerCase().startsWith(prefix.toLowerCase()))\n .map(e => {\n const relDir = dir === '.' ? '' : dir + '/';\n const isDir = e.isDirectory();\n return {\n text: '@' + relDir + e.name + (isDir ? '/' : ''),\n display: '@' + relDir + e.name + (isDir ? '/' : ''),\n description: isDir ? 'dir' : '',\n };\n })\n .slice(0, 20);\n } catch {\n return [];\n }\n }\n\n private handleCancel(): void {\n if (this.isProcessing && this.abortController) {\n this.abortController.abort();\n this.stopSpinner();\n process.stdout.write(`\\r\\n${Colors.yellow} Cancelled${Colors.reset}\\r\\n\\r\\n`);\n this.isProcessing = false;\n } else {\n process.stdout.write(`${Colors.dim} (Use /exit to quit)${Colors.reset}\\r\\n`);\n this.smartInput?.showPrompt();\n }\n }\n\n private handleExit(): void {\n process.stdout.write(`${Colors.dim} Goodbye!${Colors.reset}\\r\\n`);\n this.stop();\n process.exit(0);\n }\n\n private async handleLine(input: string): Promise<void> {\n const trimmed = input.trim();\n\n if (!trimmed) {\n this.smartInput?.showPrompt();\n return;\n }\n\n if (trimmed.startsWith('/')) {\n await this.handleCommand(trimmed);\n } else {\n await this.handleMessage(trimmed);\n }\n\n this.smartInput?.showPrompt();\n }\n\n private async handleCommand(command: string): Promise<void> {\n const parts = command.slice(1).split(/\\s+/);\n const cmd = parts[0].toLowerCase();\n const args = parts.slice(1);\n\n switch (cmd) {\n case 'help': this.replCommands.printHelp(); break;\n case 'clear': this.replCommands.cmdClear(this.welcomeScreen); break;\n case 'exit':\n case 'quit': this.handleExit(); return;\n case 'compact': await this.handleCompact(); break;\n case 'context': this.replCommands.cmdContext(); break;\n case 'config':\n await this.configCommands.handleConfigCommand(args, this.smartInput!);\n await this.configManager.loadConfig();\n await this.deepAgent.reinitializeModel();\n break;\n case 'model': this.replCommands.cmdModel(args); break;\n case 'init':\n await this.projectCommands.cmdProject(['analyze'], this.smartInput!);\n break;\n case 'mentions': this.replCommands.cmdMentionsHelp(); break;\n case 'tools': this.cmdTools(); break;\n\n case 'status': this.gitCommands.runGit('git status'); break;\n case 'diff': this.gitCommands.runGit(args.length ? `git diff ${args.join(' ')}` : 'git diff'); break;\n case 'log': this.gitCommands.runGit('git log --oneline -15'); break;\n case 'commit': \n await this.gitCommands.cmdCommit(args, this.smartInput!); \n break;\n case 'up': \n await this.gitCommands.cmdUp(this.smartInput!); \n break;\n case 'split-up': \n await this.gitCommands.cmdSplitUp(this.smartInput!); \n break;\n case 'pr': \n await this.gitCommands.cmdPr(this.smartInput!); \n break;\n case 'unit-test':\n await this.gitCommands.cmdUnitTest(this.smartInput!);\n break;\n case 'review': await this.gitCommands.cmdReview(args); break;\n case 'fix': await this.gitCommands.cmdFix(args); break;\n case 'ident': await this.gitCommands.cmdIdent(); break;\n case 'release': await this.gitCommands.cmdRelease(args); break;\n\n case 'agents': \n await this.agentCommands.cmdAgents(args, this.smartInput!); \n break;\n case 'skills': \n await this.agentCommands.cmdSkills(args, this.smartInput!); \n break;\n\n case 'mcp': \n await this.mcpCommands.cmdMcp(args, this.smartInput!); \n break;\n\n case 'project':\n await this.projectCommands.cmdProject(args, this.smartInput!);\n break;\n case 'project-deep':\n await this.projectCommands.cmdProject(['deep'], this.smartInput!);\n break;\n\n default:\n process.stdout.write(`${Colors.red} Unknown: /${cmd}${Colors.reset} ${Colors.dim}Try /help${Colors.reset}\\r\\n`);\n }\n }\n\n private async handleCompact(): Promise<void> {\n const msgCount = this.deepAgent.getMessageCount();\n if (msgCount < 4) {\n process.stdout.write(`${Colors.dim} Nothing to compact (${msgCount} messages)${Colors.reset}\\r\\n`);\n return;\n }\n process.stdout.write(`${Colors.dim} Summarizing ${msgCount} messages...${Colors.reset}\\r\\n`);\n const result = await this.deepAgent.compactHistory();\n if (result.compacted) {\n process.stdout.write(`${Colors.green} Compacted: ${result.messagesBefore} → ${result.messagesAfter} messages${Colors.reset}\\r\\n`);\n } else {\n process.stdout.write(`${Colors.yellow} Could not compact (summarization failed)${Colors.reset}\\r\\n`);\n }\n }\n\n private async handleMessage(message: string): Promise<void> {\n this.isProcessing = true;\n this.abortController = new AbortController();\n this.smartInput?.enterPassiveMode();\n\n try {\n let messageToProcess = message;\n\n const planCheck = await this.planMode.shouldEnterPlanMode(message);\n if (planCheck.shouldPlan) {\n const usePlan = await this.smartInput!.askChoice(\n '📝 Complex task. Create a plan?',\n [\n { key: 'y', label: 'yes', description: 'Create structured plan' },\n { key: 'n', label: 'no', description: 'Proceed without plan' },\n ]\n );\n \n if (usePlan === 'y') {\n const plannedMessage = await this.runInteractivePlanMode(message);\n if (!plannedMessage) {\n this.isProcessing = false;\n this.smartInput?.exitPassiveMode();\n return;\n }\n messageToProcess = plannedMessage;\n }\n }\n\n const mentionResult = await this.mentionsService.processMessage(messageToProcess);\n if (mentionResult.mentions.length > 0) {\n const summary = this.mentionsService.getMentionsSummary(mentionResult.mentions);\n for (const line of summary) {\n process.stdout.write(`${Colors.dim}${line}${Colors.reset}\\r\\n`);\n }\n process.stdout.write('\\r\\n');\n }\n\n this.startSpinner('Thinking');\n\n let firstChunk = true;\n let fullResponse = '';\n\n for await (const chunk of this.deepAgent.chat(mentionResult.expandedMessage)) {\n if (this.abortController?.signal.aborted) break;\n\n const isToolOutput = chunk.includes('\\x1b[') && (\n chunk.includes('⏿') ||\n chunk.includes('tokens:') ||\n chunk.includes('conversation compacted')\n );\n\n if (firstChunk && !isToolOutput) {\n this.stopSpinner();\n process.stdout.write(`\\r\\n${Colors.magenta}${Colors.bold}${Icons.chestnut} Cast${Colors.reset}\\r\\n`);\n firstChunk = false;\n }\n\n if (!isToolOutput) {\n fullResponse += chunk;\n }\n process.stdout.write(chunk);\n }\n\n if (!firstChunk) {\n process.stdout.write('\\r\\n');\n } else {\n this.stopSpinner();\n }\n } catch (error) {\n this.stopSpinner();\n const msg = (error as Error).message;\n if (!msg.includes('abort')) {\n process.stdout.write(`\\r\\n${Colors.red} Error: ${msg}${Colors.reset}\\r\\n\\r\\n`);\n }\n } finally {\n this.isProcessing = false;\n this.abortController = null;\n this.smartInput?.exitPassiveMode();\n }\n }\n\n private async runInteractivePlanMode(userMessage: string): Promise<string | null> {\n process.stdout.write(`\\r\\n${Colors.cyan}${Colors.bold}📋 PLAN MODE${Colors.reset}\\r\\n`);\n process.stdout.write(`${Colors.dim}Build plan first, execute after approval${Colors.reset}\\r\\n\\r\\n`);\n\n const clarifyingQuestions = await this.planMode.generateClarifyingQuestions(userMessage);\n const answers: string[] = [];\n\n if (clarifyingQuestions.length > 0) {\n process.stdout.write(`${Colors.dim}I need a few quick clarifications:${Colors.reset}\\r\\n`);\n for (let i = 0; i < clarifyingQuestions.length; i++) {\n const q = clarifyingQuestions[i];\n const answer = await this.smartInput!.question(`${Colors.yellow}Q${i + 1}:${Colors.reset} ${q} `);\n if (answer.trim()) {\n answers.push(`- ${q} => ${answer.trim()}`);\n }\n }\n process.stdout.write('\\r\\n');\n }\n\n const context = answers.length > 0 ? `User clarifications:\\n${answers.join('\\n')}` : undefined;\n let plan = await this.planMode.generatePlan(userMessage, context);\n\n while (true) {\n process.stdout.write(this.planMode.formatPlanForDisplay(plan));\n\n const action = await this.smartInput!.askChoice('Plan options', [\n { key: 'a', label: 'accept', description: 'Use this plan and continue' },\n { key: 'r', label: 'refine', description: 'Refine plan with extra feedback' },\n { key: 'c', label: 'cancel', description: 'Cancel and return to prompt' },\n ]);\n\n if (action === 'c') {\n process.stdout.write(`${Colors.dim} Plan cancelled${Colors.reset}\\r\\n\\r\\n`);\n return null;\n }\n\n if (action === 'r') {\n const feedback = await this.smartInput!.question(`${Colors.cyan}Refinement feedback:${Colors.reset} `);\n if (!feedback.trim()) {\n process.stdout.write(`${Colors.dim} No feedback provided. Keeping current plan.${Colors.reset}\\r\\n\\r\\n`);\n continue;\n }\n plan = await this.planMode.refinePlan(plan, feedback.trim());\n continue;\n }\n\n return this.buildPlanExecutionPrompt(userMessage, plan, answers);\n }\n }\n\n private buildPlanExecutionPrompt(userMessage: string, plan: { title: string; overview: string; steps: Array<{ id: number; description: string; files: string[] }> }, clarifications: string[]): string {\n const lines: string[] = [];\n lines.push(userMessage);\n lines.push('');\n lines.push('Approved execution plan:');\n lines.push(`Title: ${plan.title}`);\n lines.push(`Overview: ${plan.overview}`);\n lines.push('Steps:');\n for (const step of plan.steps) {\n const files = step.files.length > 0 ? ` | files: ${step.files.join(', ')}` : '';\n lines.push(`${step.id}. ${step.description}${files}`);\n }\n if (clarifications.length > 0) {\n lines.push('');\n lines.push('User clarifications:');\n lines.push(...clarifications);\n }\n lines.push('');\n lines.push('Execute the task following this approved plan and report progress by step.');\n return lines.join('\\n');\n }\n\n private startSpinner(label: string): void {\n let i = 0;\n this.spinnerTimer = setInterval(() => {\n const spinner = Icons.spinner[i % Icons.spinner.length];\n i++;\n process.stdout.write(\n `\\r${Colors.cyan}${spinner}${Colors.reset} ${Colors.dim}${label}...${Colors.reset}`\n );\n }, 80);\n }\n\n private stopSpinner(): void {\n if (this.spinnerTimer) {\n clearInterval(this.spinnerTimer);\n this.spinnerTimer = null;\n process.stdout.write('\\r\\x1b[K');\n }\n }\n\n private cmdTools(): void {\n const allTools = this.toolsRegistry.getAllTools();\n const tools: [string, string][] = allTools.map(t => [t.name, t.description.slice(0, 60)]);\n\n if (tools.length > 0) {\n const maxLen = Math.max(...tools.map(([n]) => n.length));\n\n process.stdout.write('\\r\\n');\n process.stdout.write(`${Colors.bold}Built-in Tools (${tools.length}):${Colors.reset}\\r\\n`);\n for (const [name, desc] of tools) {\n process.stdout.write(` ${Colors.cyan}${name.padEnd(maxLen)}${Colors.reset} ${Colors.dim}${desc}${Colors.reset}\\r\\n`);\n }\n }\n\n const mcpTools = this.mcpRegistry.getAllMcpTools();\n if (mcpTools.length > 0) {\n process.stdout.write(`\\r\\n${Colors.bold}MCP Tools (${mcpTools.length}):${Colors.reset}\\r\\n`);\n for (const t of mcpTools.slice(0, 10)) {\n process.stdout.write(` ${Colors.cyan}${t.name}${Colors.reset} ${Colors.dim}${t.description.slice(0, 50)}${Colors.reset}\\r\\n`);\n }\n }\n process.stdout.write('\\r\\n');\n }\n\n private getModelDisplayName(): string {\n try {\n const modelConfig = this.configManager.getModelConfig('default');\n if (modelConfig) {\n return `${modelConfig.provider}/${modelConfig.model}`;\n }\n } catch {\n }\n return `${this.configService.getProvider()}/${this.configService.getModel()}`;\n }\n\n stop(): void {\n this.stopSpinner();\n this.smartInput?.destroy();\n }\n}\n"],"names":["ReplService","start","initResult","deepAgent","initialize","agentCount","agentRegistry","resolveAllAgents","length","welcomeScreen","printWelcomeScreen","projectPath","undefined","model","getModelDisplayName","toolCount","smartInput","SmartInput","prompt","Colors","cyan","bold","reset","promptVisibleLen","getCommandSuggestions","input","getMentionSuggestions","partial","onSubmit","line","handleLine","onCancel","handleCancel","onExit","handleExit","commands","text","display","description","filter","c","startsWith","fs","require","path","gitOpts","getFileEntries","o","slice","dir","prefix","endsWith","includes","dirname","basename","resolved","resolve","process","cwd","existsSync","statSync","isDirectory","entries","readdirSync","withFileTypes","ignore","e","name","toLowerCase","map","relDir","isDir","isProcessing","abortController","abort","stopSpinner","stdout","write","yellow","dim","showPrompt","stop","exit","trimmed","trim","handleCommand","handleMessage","command","parts","split","cmd","args","replCommands","printHelp","cmdClear","handleCompact","cmdContext","configCommands","handleConfigCommand","configManager","loadConfig","reinitializeModel","cmdModel","projectCommands","cmdProject","cmdMentionsHelp","cmdTools","gitCommands","runGit","join","cmdCommit","cmdUp","cmdSplitUp","cmdPr","cmdUnitTest","cmdReview","cmdFix","cmdIdent","cmdRelease","agentCommands","cmdAgents","cmdSkills","mcpCommands","cmdMcp","red","msgCount","getMessageCount","result","compactHistory","compacted","green","messagesBefore","messagesAfter","message","AbortController","enterPassiveMode","messageToProcess","planCheck","planMode","shouldEnterPlanMode","shouldPlan","usePlan","askChoice","key","label","plannedMessage","runInteractivePlanMode","exitPassiveMode","mentionResult","mentionsService","processMessage","mentions","summary","getMentionsSummary","startSpinner","firstChunk","fullResponse","chunk","chat","expandedMessage","signal","aborted","isToolOutput","magenta","Icons","chestnut","error","msg","userMessage","clarifyingQuestions","generateClarifyingQuestions","answers","i","q","answer","question","push","context","plan","generatePlan","formatPlanForDisplay","action","feedback","refinePlan","buildPlanExecutionPrompt","clarifications","lines","title","overview","step","steps","files","id","spinnerTimer","setInterval","spinner","clearInterval","allTools","toolsRegistry","getAllTools","tools","t","maxLen","Math","max","n","desc","padEnd","mcpTools","mcpRegistry","getAllMcpTools","modelConfig","getModelConfig","provider","configService","getProvider","getModel","destroy","skillRegistry"],"mappings":";;;;+BAqBaA;;;eAAAA;;;wBArBc;kCACM;+BACH;sCACO;iCACL;oCACG;sCACE;sCACA;iCACL;4BACL;sCACU;qCACD;oCACD;sCACE;oCACF;uCACG;wCACC;sCACF;uBACP;;;;;;;;;;AAGvB,IAAA,AAAMA,cAAN,MAAMA;IAyBX,MAAMC,QAAuB;QAC3B,MAAMC,aAAa,MAAM,IAAI,CAACC,SAAS,CAACC,UAAU;QAClD,MAAMC,aAAa,IAAI,CAACC,aAAa,CAACC,gBAAgB,GAAGC,MAAM;QAE/D,IAAI,CAACC,aAAa,CAACC,kBAAkB,CAAC;YACpCC,aAAaT,WAAWS,WAAW,IAAIC;YACvCC,OAAO,IAAI,CAACC,mBAAmB;YAC/BC,WAAWb,WAAWa,SAAS;YAC/BV;QACF;QAEA,IAAI,CAACW,UAAU,GAAG,IAAIC,sBAAU,CAAC;YAC/BC,QAAQ,GAAGC,aAAM,CAACC,IAAI,GAAGD,aAAM,CAACE,IAAI,CAAC,CAAC,EAAEF,aAAM,CAACG,KAAK,CAAC,CAAC,CAAC;YACvDC,kBAAkB;YAClBC,uBAAuB,CAACC,QAAU,IAAI,CAACD,qBAAqB,CAACC;YAC7DC,uBAAuB,CAACC,UAAY,IAAI,CAACD,qBAAqB,CAACC;YAC/DC,UAAU,CAACC,OAAS,IAAI,CAACC,UAAU,CAACD;YACpCE,UAAU,IAAM,IAAI,CAACC,YAAY;YACjCC,QAAQ,IAAM,IAAI,CAACC,UAAU;QAC/B;QAEA,IAAI,CAAClB,UAAU,CAACf,KAAK;IACvB;IA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AGA,YAAYE,QAAQ,CAAC,CAAC,EAAEF,YAAYtM,KAAK,EAAE;YACvD;QACF,EAAE,OAAM,CACR;QACA,OAAO,GAAG,IAAI,CAACyM,aAAa,CAACC,WAAW,GAAG,CAAC,EAAE,IAAI,CAACD,aAAa,CAACE,QAAQ,IAAI;IAC/E;IAEAvI,OAAa;QACX,IAAI,CAACN,WAAW;QAChB,IAAI,CAAC3D,UAAU,EAAEyM;IACnB;IArdA,YACE,AAAiBtN,SAA2B,EAC5C,AAAiBmN,aAA4B,EAC7C,AAAiBnH,aAAmC,EACpD,AAAiBkD,eAAgC,EACjD,AAAiB4D,WAA+B,EAChD,AAAiB3M,aAAmC,EACpD,AAAiBoN,aAAmC,EACpD,AAAiBjN,aAAmC,EACpD,AAAiBiI,QAAyB,EAC1C,AAAiB9C,YAAiC,EAClD,AAAiBe,WAA+B,EAChD,AAAiBY,aAAmC,EACpD,AAAiBG,WAA+B,EAChD,AAAiBzB,cAAqC,EACtD,AAAiBM,eAAuC,EACxD,AAAiB+F,aAAmC,CACpD;aAhBiBnM,YAAAA;aACAmN,gBAAAA;aACAnH,gBAAAA;aACAkD,kBAAAA;aACA4D,cAAAA;aACA3M,gBAAAA;aACAoN,gBAAAA;aACAjN,gBAAAA;aACAiI,WAAAA;aACA9C,eAAAA;aACAe,cAAAA;aACAY,gBAAAA;aACAG,cAAAA;aACAzB,iBAAAA;aACAM,kBAAAA;aACA+F,gBAAAA;aArBXtL,aAAgC;aAChCyD,kBAA0C;aAC1CD,eAAe;aACfyH,eAAsD;IAmB3D;AAqcL"}
@@ -0,0 +1,137 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ const _strict = /*#__PURE__*/ _interop_require_default(require("node:assert/strict"));
6
+ const _nodetest = require("node:test");
7
+ const _replservice = require("./repl.service");
8
+ const _theme = require("../utils/theme");
9
+ function _interop_require_default(obj) {
10
+ return obj && obj.__esModule ? obj : {
11
+ default: obj
12
+ };
13
+ }
14
+ const buildReplService = (overrides = {})=>{
15
+ const defaults = {
16
+ deepAgent: {
17
+ initialize: async ()=>({
18
+ toolCount: 0,
19
+ projectPath: ''
20
+ }),
21
+ reinitializeModel: async ()=>{}
22
+ },
23
+ configService: {},
24
+ configManager: {
25
+ loadConfig: async ()=>{}
26
+ },
27
+ mentionsService: {},
28
+ mcpRegistry: {},
29
+ agentRegistry: {
30
+ resolveAllAgents: ()=>[]
31
+ },
32
+ skillRegistry: {},
33
+ welcomeScreen: {
34
+ printWelcomeScreen: ()=>{}
35
+ },
36
+ planMode: {},
37
+ replCommands: {
38
+ printHelp: ()=>{},
39
+ cmdClear: ()=>{},
40
+ cmdContext: ()=>{},
41
+ cmdModel: ()=>{},
42
+ cmdMentionsHelp: ()=>{}
43
+ },
44
+ gitCommands: {
45
+ runGit: ()=>{},
46
+ cmdPr: async ()=>{},
47
+ cmdUnitTest: async ()=>{},
48
+ cmdReview: async ()=>{},
49
+ cmdFix: async ()=>{},
50
+ cmdIdent: async ()=>{}
51
+ },
52
+ agentCommands: {},
53
+ mcpCommands: {},
54
+ configCommands: {
55
+ handleConfigCommand: async ()=>{}
56
+ },
57
+ projectCommands: {
58
+ cmdProject: async ()=>{}
59
+ },
60
+ toolsRegistry: {}
61
+ };
62
+ const deps = {
63
+ ...defaults,
64
+ ...overrides
65
+ };
66
+ return new _replservice.ReplService(deps.deepAgent, deps.configService, deps.configManager, deps.mentionsService, deps.mcpRegistry, deps.agentRegistry, deps.skillRegistry, deps.welcomeScreen, deps.planMode, deps.replCommands, deps.gitCommands, deps.agentCommands, deps.mcpCommands, deps.configCommands, deps.projectCommands, deps.toolsRegistry);
67
+ };
68
+ (0, _nodetest.describe)('ReplService', ()=>{
69
+ // Ensures command suggestions honor filtering and include the recently added /unit-test command.
70
+ (0, _nodetest.test)('filters command suggestions and exposes the /unit-test option', ()=>{
71
+ const service = buildReplService();
72
+ const suggestions = service.getCommandSuggestions('/unit');
73
+ (0, _strict.default)(Array.isArray(suggestions), 'command suggestions should be an array');
74
+ const texts = suggestions.map((s)=>s.text);
75
+ _strict.default.deepStrictEqual(texts, [
76
+ '/unit-test'
77
+ ], 'only the /unit-test command starts with /unit');
78
+ });
79
+ // Verifies the /unit-test command routes to gitCommands.cmdUnitTest with the active smart input.
80
+ (0, _nodetest.test)('routes the /unit-test command to gitCommands.cmdUnitTest', async ()=>{
81
+ const recorded = [];
82
+ const gitCommands = {
83
+ runGit: ()=>{},
84
+ cmdPr: async ()=>{},
85
+ cmdUnitTest: async (input)=>recorded.push(input),
86
+ cmdReview: async ()=>{},
87
+ cmdFix: async ()=>{},
88
+ cmdIdent: async ()=>{}
89
+ };
90
+ const service = buildReplService({
91
+ gitCommands
92
+ });
93
+ const smartInputStub = {
94
+ showPrompt: ()=>{}
95
+ };
96
+ service.smartInput = smartInputStub;
97
+ await service.handleCommand('/unit-test');
98
+ _strict.default.strictEqual(recorded.length, 1, 'cmdUnitTest should be invoked exactly once');
99
+ _strict.default.strictEqual(recorded[0], smartInputStub, 'cmdUnitTest receives the current smart input instance');
100
+ });
101
+ // Confirms spinner output rotates icons and extends dot sequences on each interval tick.
102
+ (0, _nodetest.test)('startSpinner writes updated label and dot count on each tick', ()=>{
103
+ const service = buildReplService();
104
+ const writes = [];
105
+ const originalStdout = process.stdout.write;
106
+ const originalSetInterval = global.setInterval;
107
+ const originalClearInterval = global.clearInterval;
108
+ const fakeTimer = Symbol('spinner-timer');
109
+ let capturedCallback = null;
110
+ try {
111
+ process.stdout.write = (chunk)=>{
112
+ writes.push(String(chunk));
113
+ return true;
114
+ };
115
+ global.setInterval = (callback)=>{
116
+ capturedCallback = callback;
117
+ return fakeTimer;
118
+ };
119
+ global.clearInterval = ()=>{};
120
+ service.startSpinner('testing');
121
+ (0, _strict.default)(capturedCallback, 'spinner setInterval callback should be captured');
122
+ capturedCallback();
123
+ capturedCallback();
124
+ _strict.default.strictEqual(writes.length, 2, 'spinner should have written twice after two ticks');
125
+ (0, _strict.default)(writes[0].startsWith('\r' + _theme.Colors.cyan), 'spinner output should start with the cyan color code');
126
+ (0, _strict.default)(writes[0].includes(`${_theme.Colors.dim}testing.${_theme.Colors.reset}`), 'first tick should append a single dot');
127
+ (0, _strict.default)(writes[1].includes(`${_theme.Colors.dim}testing..${_theme.Colors.reset}`), 'second tick should append two dots');
128
+ _strict.default.notStrictEqual(writes[0], writes[1], 'consecutive spinner ticks should produce different output');
129
+ } finally{
130
+ process.stdout.write = originalStdout;
131
+ global.setInterval = originalSetInterval;
132
+ global.clearInterval = originalClearInterval;
133
+ }
134
+ });
135
+ });
136
+
137
+ //# sourceMappingURL=repl.service.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/modules/repl/services/repl.service.spec.ts"],"sourcesContent":["import assert from 'node:assert/strict';\nimport { describe, test } from 'node:test';\nimport { ReplService } from './repl.service';\nimport { Colors } from '../utils/theme';\n\nconst buildReplService = (overrides: Record<string, any> = {}) => {\n const defaults = {\n deepAgent: {\n initialize: async () => ({ toolCount: 0, projectPath: '' }),\n reinitializeModel: async () => {},\n },\n configService: {},\n configManager: { loadConfig: async () => {} },\n mentionsService: {},\n mcpRegistry: {},\n agentRegistry: { resolveAllAgents: () => [] },\n skillRegistry: {},\n welcomeScreen: { printWelcomeScreen: () => {} },\n planMode: {},\n replCommands: {\n printHelp: () => {},\n cmdClear: () => {},\n cmdContext: () => {},\n cmdModel: () => {},\n cmdMentionsHelp: () => {},\n },\n gitCommands: {\n runGit: () => {},\n cmdPr: async () => {},\n cmdUnitTest: async () => {},\n cmdReview: async () => {},\n cmdFix: async () => {},\n cmdIdent: async () => {},\n },\n agentCommands: {},\n mcpCommands: {},\n configCommands: { handleConfigCommand: async () => {} },\n projectCommands: { cmdProject: async () => {} },\n toolsRegistry: {},\n };\n\n const deps = { ...defaults, ...overrides };\n\n return new ReplService(\n deps.deepAgent,\n deps.configService,\n deps.configManager,\n deps.mentionsService,\n deps.mcpRegistry,\n deps.agentRegistry,\n deps.skillRegistry,\n deps.welcomeScreen,\n deps.planMode,\n deps.replCommands,\n deps.gitCommands,\n deps.agentCommands,\n deps.mcpCommands,\n deps.configCommands,\n deps.projectCommands,\n deps.toolsRegistry,\n );\n};\n\ndescribe('ReplService', () => {\n // Ensures command suggestions honor filtering and include the recently added /unit-test command.\n test('filters command suggestions and exposes the /unit-test option', () => {\n const service = buildReplService();\n const suggestions = (service as any).getCommandSuggestions('/unit');\n\n assert(Array.isArray(suggestions), 'command suggestions should be an array');\n const texts = suggestions.map((s: { text: string }) => s.text);\n assert.deepStrictEqual(texts, ['/unit-test'], 'only the /unit-test command starts with /unit');\n });\n\n // Verifies the /unit-test command routes to gitCommands.cmdUnitTest with the active smart input.\n test('routes the /unit-test command to gitCommands.cmdUnitTest', async () => {\n const recorded: Array<unknown> = [];\n const gitCommands = {\n runGit: () => {},\n cmdPr: async () => {},\n cmdUnitTest: async (input: unknown) => recorded.push(input),\n cmdReview: async () => {},\n cmdFix: async () => {},\n cmdIdent: async () => {},\n };\n\n const service = buildReplService({ gitCommands });\n const smartInputStub = { showPrompt: () => {} };\n (service as any).smartInput = smartInputStub;\n\n await (service as any).handleCommand('/unit-test');\n\n assert.strictEqual(recorded.length, 1, 'cmdUnitTest should be invoked exactly once');\n assert.strictEqual(recorded[0], smartInputStub, 'cmdUnitTest receives the current smart input instance');\n });\n\n // Confirms spinner output rotates icons and extends dot sequences on each interval tick.\n test('startSpinner writes updated label and dot count on each tick', () => {\n const service = buildReplService();\n const writes: string[] = [];\n const originalStdout = process.stdout.write;\n const originalSetInterval = global.setInterval;\n const originalClearInterval = global.clearInterval;\n const fakeTimer = Symbol('spinner-timer');\n let capturedCallback: (() => void) | null = null;\n\n try {\n (process.stdout as any).write = (chunk: string) => {\n writes.push(String(chunk));\n return true;\n };\n\n (global as any).setInterval = (callback: () => void) => {\n capturedCallback = callback;\n return fakeTimer as unknown as NodeJS.Timer;\n };\n\n (global as any).clearInterval = () => {};\n\n (service as any).startSpinner('testing');\n assert(capturedCallback, 'spinner setInterval callback should be captured');\n\n capturedCallback!();\n capturedCallback!();\n\n assert.strictEqual(writes.length, 2, 'spinner should have written twice after two ticks');\n assert(writes[0].startsWith('\\r' + Colors.cyan), 'spinner output should start with the cyan color code');\n assert(writes[0].includes(`${Colors.dim}testing.${Colors.reset}`), 'first tick should append a single dot');\n assert(writes[1].includes(`${Colors.dim}testing..${Colors.reset}`), 'second tick should append two dots');\n assert.notStrictEqual(writes[0], writes[1], 'consecutive spinner ticks should produce different output');\n } finally {\n (process.stdout as any).write = originalStdout;\n (global as any).setInterval = originalSetInterval;\n (global as any).clearInterval = originalClearInterval;\n }\n });\n});\n"],"names":["buildReplService","overrides","defaults","deepAgent","initialize","toolCount","projectPath","reinitializeModel","configService","configManager","loadConfig","mentionsService","mcpRegistry","agentRegistry","resolveAllAgents","skillRegistry","welcomeScreen","printWelcomeScreen","planMode","replCommands","printHelp","cmdClear","cmdContext","cmdModel","cmdMentionsHelp","gitCommands","runGit","cmdPr","cmdUnitTest","cmdReview","cmdFix","cmdIdent","agentCommands","mcpCommands","configCommands","handleConfigCommand","projectCommands","cmdProject","toolsRegistry","deps","ReplService","describe","test","service","suggestions","getCommandSuggestions","assert","Array","isArray","texts","map","s","text","deepStrictEqual","recorded","input","push","smartInputStub","showPrompt","smartInput","handleCommand","strictEqual","length","writes","originalStdout","process","stdout","write","originalSetInterval","global","setInterval","originalClearInterval","clearInterval","fakeTimer","Symbol","capturedCallback","chunk","String","callback","startSpinner","startsWith","Colors","cyan","includes","dim","reset","notStrictEqual"],"mappings":";;;;+DAAmB;0BACY;6BACH;uBACL;;;;;;AAEvB,MAAMA,mBAAmB,CAACC,YAAiC,CAAC,CAAC;IAC3D,MAAMC,WAAW;QACfC,WAAW;YACTC,YAAY,UAAa,CAAA;oBAAEC,WAAW;oBAAGC,aAAa;gBAAG,CAAA;YACzDC,mBAAmB,WAAa;QAClC;QACAC,eAAe,CAAC;QAChBC,eAAe;YAAEC,YAAY,WAAa;QAAE;QAC5C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