fix(cli): add star headline to demo completion summary per spec

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Luca Martial 2026-05-11 15:57:45 -07:00
parent 8cb6324655
commit 04e9f962af
2 changed files with 22 additions and 14 deletions

View file

@ -84,7 +84,7 @@ describe('renderDemoCompletionSummary', () => {
it('includes a temp directory warning', () => {
const plain = stripAnsi(renderDemoCompletionSummary(projectDir, true));
expect(plain).toContain('temporary demo directory');
expect(plain).toContain('temporary directory');
});
it('points to ktx setup for real data', () => {
@ -97,9 +97,13 @@ describe('renderDemoCompletionSummary', () => {
expect(plain).toContain('agent is connected');
});
it('includes star headline', () => {
const plain = stripAnsi(renderDemoCompletionSummary(projectDir, true));
expect(plain).toContain('★ KTX demo is ready');
});
it('shows manual instructions when agent not installed', () => {
const plain = stripAnsi(renderDemoCompletionSummary(projectDir, false));
expect(plain).toContain('agent not installed');
expect(plain).toContain('--agents');
expect(plain).toContain(`--project-dir ${projectDir}`);
});

View file

@ -94,23 +94,27 @@ export function renderDemoAgentTransition(): string {
}
export function renderDemoCompletionSummary(projectDir: string, agentInstalled: boolean): string {
const lines: string[] = [''];
const lines: string[] = [
'',
`${cyan('★')} KTX demo is ready`,
'',
];
if (agentInstalled) {
lines.push('┌ Your agent is connected to a demo KTX project.');
lines.push(' Your agent is connected to a demo KTX project.');
} else {
lines.push('┌ Demo project created (agent not installed).');
lines.push('│');
lines.push(`│ To connect an agent manually, run:`);
lines.push(`${cyan(`ktx setup --agents --project-dir ${projectDir}`)}`);
lines.push(' Demo project created. Connect an agent to start using it:');
lines.push(` $ ${cyan(`ktx setup --agents --project-dir ${projectDir}`)}`);
}
lines.push('│');
lines.push(`${dim('This is a temporary demo directory — data will not persist across sessions.')}`);
lines.push(`│ Run ${cyan('ktx setup')} to connect your own data sources.`);
lines.push('│');
lines.push(`│ Project: ${projectDir}`);
lines.push('└');
lines.push(
'',
` ${dim('⚠')} This project is in a temporary directory and will be`,
' cleaned up by your system. To set up KTX with your own',
' data, run: ktx setup',
'',
` Project: ${projectDir}`,
);
return lines.join('\n');
}