clavix 4.11.2 ā 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -60
- package/dist/cli/commands/update.js +9 -10
- package/dist/templates/agents/agents.md +14 -8
- package/dist/templates/agents/copilot-instructions.md +1 -1
- package/dist/templates/instructions/core/verification.md +2 -2
- package/dist/templates/slash-commands/_canonical/archive.md +83 -121
- package/dist/templates/slash-commands/_canonical/execute.md +32 -42
- package/dist/templates/slash-commands/_canonical/implement.md +32 -44
- package/dist/templates/slash-commands/_canonical/improve.md +14 -53
- package/dist/templates/slash-commands/_canonical/start.md +1 -1
- package/dist/templates/slash-commands/_canonical/summarize.md +8 -8
- package/dist/templates/slash-commands/_components/agent-protocols/cli-reference.md +84 -180
- package/dist/templates/slash-commands/_components/agent-protocols/error-handling.md +2 -2
- package/dist/templates/slash-commands/_components/agent-protocols/file-formats.md +41 -59
- package/dist/templates/slash-commands/_components/agent-protocols/state-assertion.md +1 -1
- package/dist/templates/slash-commands/_components/references/intent-types.md +1 -1
- package/dist/templates/slash-commands/_components/sections/file-saving-protocol.md +20 -27
- package/dist/templates/slash-commands/_components/sections/pattern-visibility.md +29 -46
- package/dist/templates/slash-commands/_components/troubleshooting/file-not-saved.md +4 -5
- package/dist/types/config.d.ts +57 -0
- package/dist/utils/legacy-command-cleanup.js +31 -4
- package/package.json +5 -4
- package/dist/cli/commands/analyze.d.ts +0 -17
- package/dist/cli/commands/analyze.js +0 -133
- package/dist/cli/commands/archive.d.ts +0 -36
- package/dist/cli/commands/archive.js +0 -266
- package/dist/cli/commands/deep.d.ts +0 -17
- package/dist/cli/commands/deep.js +0 -170
- package/dist/cli/commands/execute.d.ts +0 -15
- package/dist/cli/commands/execute.js +0 -168
- package/dist/cli/commands/fast.d.ts +0 -18
- package/dist/cli/commands/fast.js +0 -219
- package/dist/cli/commands/implement.d.ts +0 -24
- package/dist/cli/commands/implement.js +0 -289
- package/dist/cli/commands/improve.d.ts +0 -32
- package/dist/cli/commands/improve.js +0 -250
- package/dist/cli/commands/list.d.ts +0 -17
- package/dist/cli/commands/list.js +0 -217
- package/dist/cli/commands/plan.d.ts +0 -21
- package/dist/cli/commands/plan.js +0 -297
- package/dist/cli/commands/prd.d.ts +0 -24
- package/dist/cli/commands/prd.js +0 -321
- package/dist/cli/commands/prompts/clear.d.ts +0 -16
- package/dist/cli/commands/prompts/clear.js +0 -222
- package/dist/cli/commands/prompts/list.d.ts +0 -8
- package/dist/cli/commands/prompts/list.js +0 -88
- package/dist/cli/commands/show.d.ts +0 -21
- package/dist/cli/commands/show.js +0 -191
- package/dist/cli/commands/start.d.ts +0 -40
- package/dist/cli/commands/start.js +0 -210
- package/dist/cli/commands/summarize.d.ts +0 -17
- package/dist/cli/commands/summarize.js +0 -196
- package/dist/cli/commands/task-complete.d.ts +0 -27
- package/dist/cli/commands/task-complete.js +0 -269
- package/dist/cli/commands/verify.d.ts +0 -28
- package/dist/cli/commands/verify.js +0 -349
- package/dist/core/archive-manager.d.ts +0 -100
- package/dist/core/archive-manager.js +0 -302
- package/dist/core/basic-checklist-generator.d.ts +0 -35
- package/dist/core/basic-checklist-generator.js +0 -344
- package/dist/core/checklist-parser.d.ts +0 -48
- package/dist/core/checklist-parser.js +0 -238
- package/dist/core/config-manager.d.ts +0 -149
- package/dist/core/config-manager.js +0 -230
- package/dist/core/conversation-analyzer.d.ts +0 -86
- package/dist/core/conversation-analyzer.js +0 -387
- package/dist/core/conversation-quality-tracker.d.ts +0 -81
- package/dist/core/conversation-quality-tracker.js +0 -195
- package/dist/core/git-manager.d.ts +0 -126
- package/dist/core/git-manager.js +0 -282
- package/dist/core/intelligence/confidence-calculator.d.ts +0 -93
- package/dist/core/intelligence/confidence-calculator.js +0 -124
- package/dist/core/intelligence/index.d.ts +0 -11
- package/dist/core/intelligence/index.js +0 -15
- package/dist/core/intelligence/intent-detector.d.ts +0 -54
- package/dist/core/intelligence/intent-detector.js +0 -723
- package/dist/core/intelligence/pattern-library.d.ts +0 -104
- package/dist/core/intelligence/pattern-library.js +0 -339
- package/dist/core/intelligence/patterns/actionability-enhancer.d.ts +0 -27
- package/dist/core/intelligence/patterns/actionability-enhancer.js +0 -192
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.d.ts +0 -29
- package/dist/core/intelligence/patterns/alternative-phrasing-generator.js +0 -239
- package/dist/core/intelligence/patterns/ambiguity-detector.d.ts +0 -22
- package/dist/core/intelligence/patterns/ambiguity-detector.js +0 -196
- package/dist/core/intelligence/patterns/assumption-explicitizer.d.ts +0 -30
- package/dist/core/intelligence/patterns/assumption-explicitizer.js +0 -296
- package/dist/core/intelligence/patterns/base-pattern.d.ts +0 -192
- package/dist/core/intelligence/patterns/base-pattern.js +0 -103
- package/dist/core/intelligence/patterns/completeness-validator.d.ts +0 -27
- package/dist/core/intelligence/patterns/completeness-validator.js +0 -221
- package/dist/core/intelligence/patterns/conciseness-filter.d.ts +0 -20
- package/dist/core/intelligence/patterns/conciseness-filter.js +0 -92
- package/dist/core/intelligence/patterns/context-precision.d.ts +0 -32
- package/dist/core/intelligence/patterns/context-precision.js +0 -389
- package/dist/core/intelligence/patterns/conversation-summarizer.d.ts +0 -30
- package/dist/core/intelligence/patterns/conversation-summarizer.js +0 -277
- package/dist/core/intelligence/patterns/dependency-identifier.d.ts +0 -23
- package/dist/core/intelligence/patterns/dependency-identifier.js +0 -166
- package/dist/core/intelligence/patterns/domain-context-enricher.d.ts +0 -21
- package/dist/core/intelligence/patterns/domain-context-enricher.js +0 -198
- package/dist/core/intelligence/patterns/edge-case-identifier.d.ts +0 -30
- package/dist/core/intelligence/patterns/edge-case-identifier.js +0 -269
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.d.ts +0 -22
- package/dist/core/intelligence/patterns/error-tolerance-enhancer.js +0 -179
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.d.ts +0 -24
- package/dist/core/intelligence/patterns/implicit-requirement-extractor.js +0 -259
- package/dist/core/intelligence/patterns/objective-clarifier.d.ts +0 -22
- package/dist/core/intelligence/patterns/objective-clarifier.js +0 -126
- package/dist/core/intelligence/patterns/output-format-enforcer.d.ts +0 -22
- package/dist/core/intelligence/patterns/output-format-enforcer.js +0 -151
- package/dist/core/intelligence/patterns/prd-structure-enforcer.d.ts +0 -23
- package/dist/core/intelligence/patterns/prd-structure-enforcer.js +0 -183
- package/dist/core/intelligence/patterns/prerequisite-identifier.d.ts +0 -23
- package/dist/core/intelligence/patterns/prerequisite-identifier.js +0 -221
- package/dist/core/intelligence/patterns/requirement-prioritizer.d.ts +0 -24
- package/dist/core/intelligence/patterns/requirement-prioritizer.js +0 -134
- package/dist/core/intelligence/patterns/scope-definer.d.ts +0 -26
- package/dist/core/intelligence/patterns/scope-definer.js +0 -236
- package/dist/core/intelligence/patterns/step-decomposer.d.ts +0 -31
- package/dist/core/intelligence/patterns/step-decomposer.js +0 -242
- package/dist/core/intelligence/patterns/structure-organizer.d.ts +0 -31
- package/dist/core/intelligence/patterns/structure-organizer.js +0 -218
- package/dist/core/intelligence/patterns/success-criteria-enforcer.d.ts +0 -22
- package/dist/core/intelligence/patterns/success-criteria-enforcer.js +0 -165
- package/dist/core/intelligence/patterns/success-metrics-enforcer.d.ts +0 -24
- package/dist/core/intelligence/patterns/success-metrics-enforcer.js +0 -165
- package/dist/core/intelligence/patterns/technical-context-enricher.d.ts +0 -25
- package/dist/core/intelligence/patterns/technical-context-enricher.js +0 -165
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.d.ts +0 -26
- package/dist/core/intelligence/patterns/topic-coherence-analyzer.js +0 -300
- package/dist/core/intelligence/patterns/user-persona-enricher.d.ts +0 -24
- package/dist/core/intelligence/patterns/user-persona-enricher.js +0 -141
- package/dist/core/intelligence/patterns/validation-checklist-creator.d.ts +0 -31
- package/dist/core/intelligence/patterns/validation-checklist-creator.js +0 -242
- package/dist/core/intelligence/quality-assessor.d.ts +0 -51
- package/dist/core/intelligence/quality-assessor.js +0 -505
- package/dist/core/intelligence/types.d.ts +0 -111
- package/dist/core/intelligence/types.js +0 -3
- package/dist/core/intelligence/universal-optimizer.d.ts +0 -84
- package/dist/core/intelligence/universal-optimizer.js +0 -371
- package/dist/core/prd-generator.d.ts +0 -76
- package/dist/core/prd-generator.js +0 -173
- package/dist/core/prompt-manager.d.ts +0 -110
- package/dist/core/prompt-manager.js +0 -274
- package/dist/core/prompt-optimizer.d.ts +0 -268
- package/dist/core/prompt-optimizer.js +0 -959
- package/dist/core/question-engine.d.ts +0 -167
- package/dist/core/question-engine.js +0 -356
- package/dist/core/session-manager.d.ts +0 -139
- package/dist/core/session-manager.js +0 -365
- package/dist/core/task-manager.d.ts +0 -211
- package/dist/core/task-manager.js +0 -981
- package/dist/core/verification-hooks.d.ts +0 -67
- package/dist/core/verification-hooks.js +0 -309
- package/dist/core/verification-manager.d.ts +0 -107
- package/dist/core/verification-manager.js +0 -415
- package/dist/index 2.js +0 -13
- package/dist/index.d 2.ts +0 -4
- package/dist/types/session.d.ts +0 -78
- package/dist/types/session.js +0 -8
- package/dist/types/verification.d.ts +0 -205
- package/dist/types/verification.js +0 -9
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { Command, Flags } from '@oclif/core';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import inquirer from 'inquirer';
|
|
4
|
-
import { PromptManager } from '../../../core/prompt-manager.js';
|
|
5
|
-
export default class PromptsClear extends Command {
|
|
6
|
-
static description = 'Clear saved prompts with safety checks';
|
|
7
|
-
static examples = [
|
|
8
|
-
'<%= config.bin %> <%= command.id %>',
|
|
9
|
-
'<%= config.bin %> <%= command.id %> --standard',
|
|
10
|
-
'<%= config.bin %> <%= command.id %> --comprehensive',
|
|
11
|
-
'<%= config.bin %> <%= command.id %> --executed',
|
|
12
|
-
'<%= config.bin %> <%= command.id %> --stale',
|
|
13
|
-
'<%= config.bin %> <%= command.id %> --all',
|
|
14
|
-
];
|
|
15
|
-
static flags = {
|
|
16
|
-
standard: Flags.boolean({
|
|
17
|
-
char: 's',
|
|
18
|
-
description: 'Clear all standard depth prompts',
|
|
19
|
-
default: false,
|
|
20
|
-
}),
|
|
21
|
-
comprehensive: Flags.boolean({
|
|
22
|
-
char: 'c',
|
|
23
|
-
description: 'Clear all comprehensive depth prompts',
|
|
24
|
-
default: false,
|
|
25
|
-
}),
|
|
26
|
-
executed: Flags.boolean({
|
|
27
|
-
description: 'Clear executed prompts only (safe)',
|
|
28
|
-
default: false,
|
|
29
|
-
}),
|
|
30
|
-
stale: Flags.boolean({
|
|
31
|
-
description: 'Clear stale prompts (>30 days old)',
|
|
32
|
-
default: false,
|
|
33
|
-
}),
|
|
34
|
-
all: Flags.boolean({
|
|
35
|
-
description: 'Clear all prompts (with confirmation)',
|
|
36
|
-
default: false,
|
|
37
|
-
}),
|
|
38
|
-
force: Flags.boolean({
|
|
39
|
-
description: 'Skip confirmation prompts',
|
|
40
|
-
default: false,
|
|
41
|
-
}),
|
|
42
|
-
};
|
|
43
|
-
async run() {
|
|
44
|
-
const { flags } = await this.parse(PromptsClear);
|
|
45
|
-
const promptManager = new PromptManager();
|
|
46
|
-
try {
|
|
47
|
-
// Build filters
|
|
48
|
-
const filters = {};
|
|
49
|
-
if (flags.standard && !flags.comprehensive) {
|
|
50
|
-
filters.depthUsed = 'standard';
|
|
51
|
-
}
|
|
52
|
-
else if (flags.comprehensive && !flags.standard) {
|
|
53
|
-
filters.depthUsed = 'comprehensive';
|
|
54
|
-
}
|
|
55
|
-
if (flags.executed) {
|
|
56
|
-
filters.executed = true;
|
|
57
|
-
}
|
|
58
|
-
if (flags.stale) {
|
|
59
|
-
filters.stale = true;
|
|
60
|
-
}
|
|
61
|
-
// Interactive mode
|
|
62
|
-
if (!flags.standard &&
|
|
63
|
-
!flags.comprehensive &&
|
|
64
|
-
!flags.executed &&
|
|
65
|
-
!flags.stale &&
|
|
66
|
-
!flags.all) {
|
|
67
|
-
await this.interactiveClear(promptManager);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
// Get prompts that will be deleted
|
|
71
|
-
const toDelete = await promptManager.listPrompts(filters);
|
|
72
|
-
if (toDelete.length === 0) {
|
|
73
|
-
console.log(chalk.yellow('\nā ļø No prompts match the specified criteria\n'));
|
|
74
|
-
return;
|
|
75
|
-
}
|
|
76
|
-
// Display what will be deleted
|
|
77
|
-
console.log(chalk.bold.cyan(`\nš Prompts to Delete (${toDelete.length}):\n`));
|
|
78
|
-
toDelete.forEach((p) => {
|
|
79
|
-
const status = p.executed ? chalk.green('ā') : chalk.gray('ā');
|
|
80
|
-
const age = p.ageInDays === 0 ? 'today' : `${p.ageInDays}d ago`;
|
|
81
|
-
const depthLabel = p.depthUsed === 'comprehensive' ? 'comp' : 'std';
|
|
82
|
-
console.log(` ${status} [${depthLabel}] ${p.id} (${age})`);
|
|
83
|
-
console.log(` ${chalk.gray(p.originalPrompt.substring(0, 60))}...`);
|
|
84
|
-
});
|
|
85
|
-
console.log();
|
|
86
|
-
// Safety check for unexecuted prompts
|
|
87
|
-
const unexecuted = toDelete.filter((p) => !p.executed);
|
|
88
|
-
if (unexecuted.length > 0 && !flags.force) {
|
|
89
|
-
console.log(chalk.yellow(`ā ļø Warning: ${unexecuted.length} unexecuted prompts will be deleted\n`));
|
|
90
|
-
const { proceed } = await inquirer.prompt([
|
|
91
|
-
{
|
|
92
|
-
type: 'confirm',
|
|
93
|
-
name: 'proceed',
|
|
94
|
-
message: 'Delete unexecuted prompts?',
|
|
95
|
-
default: false,
|
|
96
|
-
},
|
|
97
|
-
]);
|
|
98
|
-
if (!proceed) {
|
|
99
|
-
console.log(chalk.gray('\nCancelled. No prompts were deleted.\n'));
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
// Final confirmation for --all
|
|
104
|
-
if (flags.all && !flags.force) {
|
|
105
|
-
const { confirm } = await inquirer.prompt([
|
|
106
|
-
{
|
|
107
|
-
type: 'confirm',
|
|
108
|
-
name: 'confirm',
|
|
109
|
-
message: chalk.red('Delete ALL prompts? This cannot be undone.'),
|
|
110
|
-
default: false,
|
|
111
|
-
},
|
|
112
|
-
]);
|
|
113
|
-
if (!confirm) {
|
|
114
|
-
console.log(chalk.gray('\nCancelled. No prompts were deleted.\n'));
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
// Delete prompts
|
|
119
|
-
const deleted = await promptManager.deletePrompts(filters);
|
|
120
|
-
console.log(chalk.green(`\nā Deleted ${deleted} prompt(s)\n`));
|
|
121
|
-
// Show remaining stats
|
|
122
|
-
const stats = await promptManager.getStorageStats();
|
|
123
|
-
if (stats.totalPrompts > 0) {
|
|
124
|
-
console.log(chalk.gray(`Remaining prompts: ${stats.totalPrompts}`));
|
|
125
|
-
console.log(chalk.gray(` Standard: ${stats.standardPrompts} | Comprehensive: ${stats.comprehensivePrompts}`));
|
|
126
|
-
console.log(chalk.gray(` Executed: ${stats.executedPrompts} | Pending: ${stats.pendingPrompts}\n`));
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
catch (error) {
|
|
130
|
-
console.log(chalk.red(`\nā Error: ${error}\n`));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
async interactiveClear(manager) {
|
|
134
|
-
const allPrompts = await manager.listPrompts();
|
|
135
|
-
if (allPrompts.length === 0) {
|
|
136
|
-
console.log(chalk.yellow('\nā ļø No prompts to clear\n'));
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
console.log(chalk.bold.cyan(`\nš Clear Saved Prompts\n`));
|
|
140
|
-
const choices = [
|
|
141
|
-
{ name: 'Executed prompts only (safe)', value: 'executed' },
|
|
142
|
-
{ name: 'Stale prompts (>30 days old)', value: 'stale' },
|
|
143
|
-
{ name: 'Old prompts (>7 days old)', value: 'old' },
|
|
144
|
-
{ name: 'Standard depth prompts only', value: 'standard' },
|
|
145
|
-
{ name: 'Comprehensive depth prompts only', value: 'comprehensive' },
|
|
146
|
-
{ name: chalk.red('All prompts (dangerous)'), value: 'all' },
|
|
147
|
-
{ name: 'Cancel', value: 'cancel' },
|
|
148
|
-
];
|
|
149
|
-
const { selection } = await inquirer.prompt([
|
|
150
|
-
{
|
|
151
|
-
type: 'list',
|
|
152
|
-
name: 'selection',
|
|
153
|
-
message: 'What would you like to clear?',
|
|
154
|
-
choices,
|
|
155
|
-
},
|
|
156
|
-
]);
|
|
157
|
-
if (selection === 'cancel') {
|
|
158
|
-
console.log(chalk.gray('\nCancelled.\n'));
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
// Build filters based on selection
|
|
162
|
-
const filters = {};
|
|
163
|
-
if (selection === 'executed') {
|
|
164
|
-
filters.executed = true;
|
|
165
|
-
}
|
|
166
|
-
else if (selection === 'stale') {
|
|
167
|
-
filters.stale = true;
|
|
168
|
-
}
|
|
169
|
-
else if (selection === 'old') {
|
|
170
|
-
filters.old = true;
|
|
171
|
-
}
|
|
172
|
-
else if (selection === 'standard') {
|
|
173
|
-
filters.depthUsed = 'standard';
|
|
174
|
-
}
|
|
175
|
-
else if (selection === 'comprehensive') {
|
|
176
|
-
filters.depthUsed = 'comprehensive';
|
|
177
|
-
}
|
|
178
|
-
// 'all' means no filters
|
|
179
|
-
// Get matching prompts
|
|
180
|
-
const toDelete = selection === 'all' ? allPrompts : await manager.listPrompts(filters);
|
|
181
|
-
if (toDelete.length === 0) {
|
|
182
|
-
console.log(chalk.yellow('\nā ļø No prompts match the selected criteria\n'));
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
// Show preview
|
|
186
|
-
console.log(chalk.cyan(`\nWill delete ${toDelete.length} prompt(s):\n`));
|
|
187
|
-
toDelete.slice(0, 5).forEach((p) => {
|
|
188
|
-
const status = p.executed ? chalk.green('ā') : chalk.gray('ā');
|
|
189
|
-
const depthLabel = p.depthUsed === 'comprehensive' ? 'comp' : 'std';
|
|
190
|
-
console.log(` ${status} [${depthLabel}] ${p.id}`);
|
|
191
|
-
});
|
|
192
|
-
if (toDelete.length > 5) {
|
|
193
|
-
console.log(chalk.gray(` ... and ${toDelete.length - 5} more`));
|
|
194
|
-
}
|
|
195
|
-
console.log();
|
|
196
|
-
// Confirm deletion
|
|
197
|
-
const { confirm } = await inquirer.prompt([
|
|
198
|
-
{
|
|
199
|
-
type: 'confirm',
|
|
200
|
-
name: 'confirm',
|
|
201
|
-
message: `Delete ${toDelete.length} prompt(s)?`,
|
|
202
|
-
default: false,
|
|
203
|
-
},
|
|
204
|
-
]);
|
|
205
|
-
if (!confirm) {
|
|
206
|
-
console.log(chalk.gray('\nCancelled. No prompts were deleted.\n'));
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
// Delete
|
|
210
|
-
const deleted = await manager.deletePrompts(filters);
|
|
211
|
-
console.log(chalk.green(`\nā Deleted ${deleted} prompt(s)\n`));
|
|
212
|
-
// Show remaining
|
|
213
|
-
const stats = await manager.getStorageStats();
|
|
214
|
-
if (stats.totalPrompts > 0) {
|
|
215
|
-
console.log(chalk.gray(`Remaining: ${stats.totalPrompts} prompt(s)\n`));
|
|
216
|
-
}
|
|
217
|
-
else {
|
|
218
|
-
console.log(chalk.gray('All prompts cleared.\n'));
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
//# sourceMappingURL=clear.js.map
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import { PromptManager } from '../../../core/prompt-manager.js';
|
|
4
|
-
export default class PromptsList extends Command {
|
|
5
|
-
static description = 'List all saved prompts with age warnings and storage statistics';
|
|
6
|
-
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
7
|
-
async run() {
|
|
8
|
-
const promptManager = new PromptManager();
|
|
9
|
-
try {
|
|
10
|
-
const prompts = await promptManager.listPrompts();
|
|
11
|
-
const stats = await promptManager.getStorageStats();
|
|
12
|
-
console.log(chalk.bold.cyan(`\nš Saved Prompts (${prompts.length} total)\n`));
|
|
13
|
-
if (prompts.length === 0) {
|
|
14
|
-
console.log(chalk.gray('No prompts saved yet.\n'));
|
|
15
|
-
console.log(chalk.cyan('Generate an optimized prompt:'));
|
|
16
|
-
console.log(chalk.cyan(' /clavix:improve "your requirement"'));
|
|
17
|
-
console.log();
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
// Display prompts grouped by depth
|
|
21
|
-
const standardPrompts = prompts.filter((p) => p.depthUsed === 'standard');
|
|
22
|
-
const comprehensivePrompts = prompts.filter((p) => p.depthUsed === 'comprehensive');
|
|
23
|
-
if (standardPrompts.length > 0) {
|
|
24
|
-
console.log(chalk.bold('Standard Depth Prompts:'));
|
|
25
|
-
this.displayPrompts(standardPrompts);
|
|
26
|
-
console.log();
|
|
27
|
-
}
|
|
28
|
-
if (comprehensivePrompts.length > 0) {
|
|
29
|
-
console.log(chalk.bold('Comprehensive Depth Prompts:'));
|
|
30
|
-
this.displayPrompts(comprehensivePrompts);
|
|
31
|
-
console.log();
|
|
32
|
-
}
|
|
33
|
-
// Display storage statistics
|
|
34
|
-
console.log(chalk.bold('š Storage Statistics:\n'));
|
|
35
|
-
console.log(chalk.gray(` Total Prompts: ${stats.totalPrompts}`));
|
|
36
|
-
console.log(chalk.gray(` Standard: ${stats.standardPrompts} | Comprehensive: ${stats.comprehensivePrompts}`));
|
|
37
|
-
console.log(chalk.gray(` Executed: ${stats.executedPrompts} | Pending: ${stats.pendingPrompts}`));
|
|
38
|
-
if (stats.oldestPromptAge > 0) {
|
|
39
|
-
console.log(chalk.gray(` Oldest: ${stats.oldestPromptAge} days`));
|
|
40
|
-
}
|
|
41
|
-
console.log();
|
|
42
|
-
// Storage hygiene recommendations
|
|
43
|
-
if (stats.stalePrompts > 0) {
|
|
44
|
-
console.log(chalk.yellow(`ā ļø ${stats.stalePrompts} stale prompts (>30 days old)`));
|
|
45
|
-
console.log(chalk.yellow(` Recommend: clavix prompts clear --stale\n`));
|
|
46
|
-
}
|
|
47
|
-
if (stats.executedPrompts >= 10) {
|
|
48
|
-
console.log(chalk.cyan(`š” ${stats.executedPrompts} executed prompts`));
|
|
49
|
-
console.log(chalk.cyan(` Recommend: clavix prompts clear --executed\n`));
|
|
50
|
-
}
|
|
51
|
-
if (stats.totalPrompts >= 20) {
|
|
52
|
-
console.log(chalk.yellow(`ā ļø Storage approaching limit (${stats.totalPrompts}/recommended 20)`));
|
|
53
|
-
console.log(chalk.yellow(` Consider cleanup: clavix prompts clear\n`));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch (error) {
|
|
57
|
-
console.log(chalk.red(`\nā Error: ${error}\n`));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
displayPrompts(prompts) {
|
|
61
|
-
prompts.forEach((p) => {
|
|
62
|
-
const status = p.executed ? chalk.green('ā') : chalk.gray('ā');
|
|
63
|
-
const ageInDays = p.ageInDays || 0;
|
|
64
|
-
// Age warning coloring
|
|
65
|
-
let ageWarning = '';
|
|
66
|
-
let ageStr = '';
|
|
67
|
-
if (ageInDays === 0) {
|
|
68
|
-
ageStr = chalk.gray('today');
|
|
69
|
-
}
|
|
70
|
-
else if (ageInDays > 30) {
|
|
71
|
-
ageStr = chalk.red(`${ageInDays}d`);
|
|
72
|
-
ageWarning = chalk.red(' [STALE]');
|
|
73
|
-
}
|
|
74
|
-
else if (ageInDays > 7) {
|
|
75
|
-
ageStr = chalk.yellow(`${ageInDays}d`);
|
|
76
|
-
ageWarning = chalk.yellow(' [OLD]');
|
|
77
|
-
}
|
|
78
|
-
else {
|
|
79
|
-
ageStr = chalk.gray(`${ageInDays}d`);
|
|
80
|
-
}
|
|
81
|
-
// Truncate original prompt for display
|
|
82
|
-
const promptPreview = p.originalPrompt.length > 50 ? p.originalPrompt.substring(0, 50) + '...' : p.originalPrompt;
|
|
83
|
-
console.log(` ${status} ${chalk.dim(p.id)} (${ageStr})${ageWarning}`);
|
|
84
|
-
console.log(` ${chalk.gray(promptPreview)}`);
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=list.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Command } from '@oclif/core';
|
|
2
|
-
export default class Show extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static args: {
|
|
6
|
-
sessionId: import("@oclif/core/interfaces").Arg<string | undefined, Record<string, unknown>>;
|
|
7
|
-
};
|
|
8
|
-
static flags: {
|
|
9
|
-
output: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
-
full: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
11
|
-
limit: import("@oclif/core/interfaces").OptionFlag<number, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
-
};
|
|
13
|
-
run(): Promise<void>;
|
|
14
|
-
private showSession;
|
|
15
|
-
private displaySessionHeader;
|
|
16
|
-
private showAssociatedOutputs;
|
|
17
|
-
private showOutput;
|
|
18
|
-
private wrapText;
|
|
19
|
-
private formatFileSize;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=show.d.ts.map
|
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
import { Command, Args, Flags } from '@oclif/core';
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import fs from 'fs-extra';
|
|
4
|
-
import * as path from 'path';
|
|
5
|
-
import { SessionManager } from '../../core/session-manager.js';
|
|
6
|
-
export default class Show extends Command {
|
|
7
|
-
static description = 'Show detailed information about a session or output';
|
|
8
|
-
static examples = [
|
|
9
|
-
'<%= config.bin %> <%= command.id %> session-id',
|
|
10
|
-
'<%= config.bin %> <%= command.id %> session-id --full',
|
|
11
|
-
'<%= config.bin %> <%= command.id %> --output project-name',
|
|
12
|
-
];
|
|
13
|
-
static args = {
|
|
14
|
-
sessionId: Args.string({
|
|
15
|
-
description: 'Session ID to show',
|
|
16
|
-
required: false,
|
|
17
|
-
}),
|
|
18
|
-
};
|
|
19
|
-
static flags = {
|
|
20
|
-
output: Flags.string({
|
|
21
|
-
char: 'o',
|
|
22
|
-
description: 'Show output directory contents',
|
|
23
|
-
}),
|
|
24
|
-
full: Flags.boolean({
|
|
25
|
-
char: 'f',
|
|
26
|
-
description: 'Show full conversation history',
|
|
27
|
-
default: false,
|
|
28
|
-
}),
|
|
29
|
-
limit: Flags.integer({
|
|
30
|
-
char: 'l',
|
|
31
|
-
description: 'Limit number of messages to show',
|
|
32
|
-
default: 10,
|
|
33
|
-
}),
|
|
34
|
-
};
|
|
35
|
-
async run() {
|
|
36
|
-
const { args, flags } = await this.parse(Show);
|
|
37
|
-
const clavixDir = path.join(process.cwd(), '.clavix');
|
|
38
|
-
if (!fs.existsSync(clavixDir)) {
|
|
39
|
-
this.error(chalk.red('No .clavix directory found.') +
|
|
40
|
-
'\n' +
|
|
41
|
-
chalk.yellow('Run ') +
|
|
42
|
-
chalk.cyan('clavix init') +
|
|
43
|
-
chalk.yellow(' to initialize Clavix in this project.'));
|
|
44
|
-
}
|
|
45
|
-
// Show output directory if --output flag is used
|
|
46
|
-
if (flags.output) {
|
|
47
|
-
await this.showOutput(flags.output);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
// Show session if session ID is provided
|
|
51
|
-
if (args.sessionId) {
|
|
52
|
-
await this.showSession(args.sessionId, flags.full, flags.limit);
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
// If no arguments, show most recent session
|
|
56
|
-
const sessionManager = new SessionManager();
|
|
57
|
-
const sessions = await sessionManager.listSessions();
|
|
58
|
-
if (sessions.length === 0) {
|
|
59
|
-
this.error(chalk.yellow('No sessions found.') +
|
|
60
|
-
'\n' +
|
|
61
|
-
chalk.gray('Run ') +
|
|
62
|
-
chalk.cyan('clavix start') +
|
|
63
|
-
chalk.gray(' to create a new session.'));
|
|
64
|
-
}
|
|
65
|
-
// Get most recent session
|
|
66
|
-
const mostRecent = sessions.sort((a, b) => new Date(b.updated).getTime() - new Date(a.updated).getTime())[0];
|
|
67
|
-
this.log(chalk.gray('Showing most recent session:\n'));
|
|
68
|
-
await this.showSession(mostRecent.id, flags.full, flags.limit);
|
|
69
|
-
}
|
|
70
|
-
async showSession(sessionId, showFull, limit) {
|
|
71
|
-
const sessionManager = new SessionManager();
|
|
72
|
-
try {
|
|
73
|
-
const session = await sessionManager.getSession(sessionId);
|
|
74
|
-
if (!session) {
|
|
75
|
-
this.error(chalk.red(`Session "${sessionId}" not found.`));
|
|
76
|
-
}
|
|
77
|
-
this.displaySessionHeader(session);
|
|
78
|
-
// Show conversation history
|
|
79
|
-
const messages = session.messages || [];
|
|
80
|
-
if (messages.length === 0) {
|
|
81
|
-
this.log(chalk.gray(' No messages in this session yet.'));
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
this.log(chalk.bold.cyan('\nš¬ Conversation History\n'));
|
|
85
|
-
const messagesToShow = showFull ? messages : messages.slice(0, limit);
|
|
86
|
-
messagesToShow.forEach((msg, index) => {
|
|
87
|
-
const timestamp = new Date(msg.timestamp).toLocaleTimeString();
|
|
88
|
-
const roleColor = msg.role === 'user' ? chalk.blue : chalk.green;
|
|
89
|
-
const roleLabel = msg.role === 'user' ? 'User' : 'Assistant';
|
|
90
|
-
this.log(` ${roleColor.bold(roleLabel)} ${chalk.gray(`[${timestamp}]`)}` +
|
|
91
|
-
`\n ${this.wrapText(msg.content, 80)}` +
|
|
92
|
-
(index < messagesToShow.length - 1 ? '\n' : ''));
|
|
93
|
-
});
|
|
94
|
-
if (!showFull && messages.length > limit) {
|
|
95
|
-
this.log('');
|
|
96
|
-
this.log(chalk.gray(` ... ${messages.length - limit} more messages`) +
|
|
97
|
-
'\n' +
|
|
98
|
-
chalk.gray(` Use ${chalk.cyan('--full')} to see the complete conversation`));
|
|
99
|
-
}
|
|
100
|
-
// Show associated outputs if any
|
|
101
|
-
this.showAssociatedOutputs(session);
|
|
102
|
-
}
|
|
103
|
-
catch (error) {
|
|
104
|
-
this.error(chalk.red(`Error loading session: ${error.message}`));
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
displaySessionHeader(session) {
|
|
108
|
-
const statusIcon = session.status === 'active' ? 'š¢' : 'āŖ';
|
|
109
|
-
const projectName = session.projectName || 'untitled';
|
|
110
|
-
this.log(chalk.bold.cyan('š Session Details\n'));
|
|
111
|
-
this.log(` ${statusIcon} ${chalk.bold(projectName)}`);
|
|
112
|
-
this.log(` ${chalk.gray('ID:')} ${session.id}`);
|
|
113
|
-
this.log(` ${chalk.gray('Agent:')} ${session.agent || 'unknown'}`);
|
|
114
|
-
this.log(` ${chalk.gray('Created:')} ${new Date(session.created).toLocaleString()}`);
|
|
115
|
-
this.log(` ${chalk.gray('Updated:')} ${new Date(session.updated).toLocaleString()}`);
|
|
116
|
-
this.log(` ${chalk.gray('Status:')} ${session.status === 'active' ? chalk.green('active') : chalk.gray('completed')}`);
|
|
117
|
-
this.log(` ${chalk.gray('Messages:')} ${session.messages?.length || 0}`);
|
|
118
|
-
}
|
|
119
|
-
showAssociatedOutputs(session) {
|
|
120
|
-
const outputsDir = path.join(process.cwd(), '.clavix', 'outputs');
|
|
121
|
-
const projectName = session.projectName || 'untitled';
|
|
122
|
-
const projectOutputDir = path.join(outputsDir, projectName);
|
|
123
|
-
if (!fs.existsSync(projectOutputDir)) {
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
const files = fs.readdirSync(projectOutputDir).filter(f => f.endsWith('.md'));
|
|
127
|
-
if (files.length === 0) {
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
this.log(chalk.bold.cyan('\nš Associated Outputs\n'));
|
|
131
|
-
this.log(` ${chalk.gray('Path:')} ${chalk.dim(path.relative(process.cwd(), projectOutputDir))}`);
|
|
132
|
-
this.log(` ${chalk.gray('Files:')}`);
|
|
133
|
-
files.forEach(file => {
|
|
134
|
-
const filePath = path.join(projectOutputDir, file);
|
|
135
|
-
const stats = fs.statSync(filePath);
|
|
136
|
-
const size = this.formatFileSize(stats.size);
|
|
137
|
-
this.log(` ⢠${chalk.cyan(file)} ${chalk.gray(`(${size})`)}`);
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
async showOutput(projectName) {
|
|
141
|
-
const outputsDir = path.join(process.cwd(), '.clavix', 'outputs', projectName);
|
|
142
|
-
if (!fs.existsSync(outputsDir)) {
|
|
143
|
-
this.error(chalk.red(`Output directory "${projectName}" not found.`));
|
|
144
|
-
}
|
|
145
|
-
this.log(chalk.bold.cyan(`š Output: ${projectName}\n`));
|
|
146
|
-
this.log(` ${chalk.gray('Path:')} ${chalk.dim(path.relative(process.cwd(), outputsDir))}`);
|
|
147
|
-
const files = fs.readdirSync(outputsDir).filter(f => f.endsWith('.md'));
|
|
148
|
-
if (files.length === 0) {
|
|
149
|
-
this.log(chalk.gray(' No output files found.'));
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
this.log(`\n ${chalk.gray('Files:')}`);
|
|
153
|
-
files.forEach(file => {
|
|
154
|
-
const filePath = path.join(outputsDir, file);
|
|
155
|
-
const stats = fs.statSync(filePath);
|
|
156
|
-
const size = this.formatFileSize(stats.size);
|
|
157
|
-
const modified = stats.mtime.toLocaleString();
|
|
158
|
-
this.log(` ⢠${chalk.cyan(file)}` +
|
|
159
|
-
`\n ${chalk.gray('Size:')} ${size} ${chalk.gray('ā')} ` +
|
|
160
|
-
`${chalk.gray('Modified:')} ${modified}`);
|
|
161
|
-
});
|
|
162
|
-
this.log('');
|
|
163
|
-
this.log(chalk.gray(` Use ${chalk.cyan(`cat ${path.relative(process.cwd(), outputsDir)}/<file>`)} to view file contents`));
|
|
164
|
-
}
|
|
165
|
-
wrapText(text, maxWidth) {
|
|
166
|
-
const words = text.split(' ');
|
|
167
|
-
const lines = [];
|
|
168
|
-
let currentLine = ' ';
|
|
169
|
-
words.forEach(word => {
|
|
170
|
-
if ((currentLine + word).length > maxWidth) {
|
|
171
|
-
lines.push(currentLine);
|
|
172
|
-
currentLine = ' ' + word + ' ';
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
currentLine += word + ' ';
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
if (currentLine.trim()) {
|
|
179
|
-
lines.push(currentLine);
|
|
180
|
-
}
|
|
181
|
-
return lines.join('\n');
|
|
182
|
-
}
|
|
183
|
-
formatFileSize(bytes) {
|
|
184
|
-
if (bytes < 1024)
|
|
185
|
-
return `${bytes} B`;
|
|
186
|
-
if (bytes < 1024 * 1024)
|
|
187
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
188
|
-
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
//# sourceMappingURL=show.js.map
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Command, Config } from '@oclif/core';
|
|
2
|
-
export default class Start extends Command {
|
|
3
|
-
static description: string;
|
|
4
|
-
static examples: string[];
|
|
5
|
-
static flags: {
|
|
6
|
-
project: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
|
-
description: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
-
tags: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
-
};
|
|
10
|
-
private sessionManager;
|
|
11
|
-
private sessionId;
|
|
12
|
-
private isExiting;
|
|
13
|
-
constructor(argv: string[], config: Config);
|
|
14
|
-
run(): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Display introduction and instructions
|
|
17
|
-
*/
|
|
18
|
-
private displayIntroduction;
|
|
19
|
-
/**
|
|
20
|
-
* Main conversation loop
|
|
21
|
-
*/
|
|
22
|
-
private conversationLoop;
|
|
23
|
-
/**
|
|
24
|
-
* Display acknowledgment after user input
|
|
25
|
-
*/
|
|
26
|
-
private displayAcknowledgment;
|
|
27
|
-
/**
|
|
28
|
-
* Check if message is an exit command
|
|
29
|
-
*/
|
|
30
|
-
private isExitCommand;
|
|
31
|
-
/**
|
|
32
|
-
* Set up handler for Ctrl+C and other exit signals
|
|
33
|
-
*/
|
|
34
|
-
private setupExitHandler;
|
|
35
|
-
/**
|
|
36
|
-
* Display session information on exit
|
|
37
|
-
*/
|
|
38
|
-
private displayExitInfo;
|
|
39
|
-
}
|
|
40
|
-
//# sourceMappingURL=start.d.ts.map
|