clavix 2.7.1 → 2.8.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 +18 -4
- package/bin/clavix.js +12 -5
- package/dist/cli/commands/archive.d.ts +5 -4
- package/dist/cli/commands/archive.js +135 -161
- package/dist/cli/commands/config.d.ts +4 -4
- package/dist/cli/commands/config.js +66 -105
- package/dist/cli/commands/deep.d.ts +3 -3
- package/dist/cli/commands/deep.js +97 -103
- package/dist/cli/commands/execute.d.ts +4 -4
- package/dist/cli/commands/execute.js +57 -63
- package/dist/cli/commands/fast.d.ts +3 -3
- package/dist/cli/commands/fast.js +122 -128
- package/dist/cli/commands/implement.d.ts +4 -4
- package/dist/cli/commands/implement.js +84 -148
- package/dist/cli/commands/init.js +87 -126
- package/dist/cli/commands/list.d.ts +5 -5
- package/dist/cli/commands/list.js +72 -111
- package/dist/cli/commands/plan.d.ts +7 -7
- package/dist/cli/commands/plan.js +92 -131
- package/dist/cli/commands/prd.d.ts +4 -4
- package/dist/cli/commands/prd.js +76 -111
- package/dist/cli/commands/prompts/clear.d.ts +6 -6
- package/dist/cli/commands/prompts/clear.js +70 -76
- package/dist/cli/commands/prompts/list.js +37 -43
- package/dist/cli/commands/show.d.ts +4 -4
- package/dist/cli/commands/show.js +72 -111
- package/dist/cli/commands/start.d.ts +3 -3
- package/dist/cli/commands/start.js +63 -101
- package/dist/cli/commands/summarize.d.ts +4 -4
- package/dist/cli/commands/summarize.js +81 -120
- package/dist/cli/commands/task-complete.d.ts +4 -4
- package/dist/cli/commands/task-complete.js +86 -123
- package/dist/cli/commands/update.d.ts +3 -3
- package/dist/cli/commands/update.js +97 -130
- package/dist/cli/commands/version.js +13 -48
- package/dist/core/adapters/agents-md-generator.js +17 -50
- package/dist/core/adapters/amp-adapter.d.ts +1 -1
- package/dist/core/adapters/amp-adapter.js +13 -21
- package/dist/core/adapters/augment-adapter.d.ts +2 -2
- package/dist/core/adapters/augment-adapter.js +16 -56
- package/dist/core/adapters/base-adapter.d.ts +1 -1
- package/dist/core/adapters/base-adapter.js +11 -47
- package/dist/core/adapters/claude-code-adapter.d.ts +2 -2
- package/dist/core/adapters/claude-code-adapter.js +19 -60
- package/dist/core/adapters/cline-adapter.d.ts +1 -1
- package/dist/core/adapters/cline-adapter.js +13 -21
- package/dist/core/adapters/codebuddy-adapter.d.ts +2 -2
- package/dist/core/adapters/codebuddy-adapter.js +17 -57
- package/dist/core/adapters/codex-adapter.d.ts +2 -2
- package/dist/core/adapters/codex-adapter.js +16 -56
- package/dist/core/adapters/copilot-instructions-generator.js +18 -51
- package/dist/core/adapters/crush-adapter.d.ts +2 -2
- package/dist/core/adapters/crush-adapter.js +13 -20
- package/dist/core/adapters/cursor-adapter.d.ts +1 -1
- package/dist/core/adapters/cursor-adapter.js +12 -20
- package/dist/core/adapters/droid-adapter.d.ts +2 -2
- package/dist/core/adapters/droid-adapter.js +14 -21
- package/dist/core/adapters/gemini-adapter.d.ts +2 -2
- package/dist/core/adapters/gemini-adapter.js +16 -52
- package/dist/core/adapters/kilocode-adapter.d.ts +1 -1
- package/dist/core/adapters/kilocode-adapter.js +12 -20
- package/dist/core/adapters/octo-md-generator.js +17 -50
- package/dist/core/adapters/opencode-adapter.d.ts +2 -2
- package/dist/core/adapters/opencode-adapter.js +14 -21
- package/dist/core/adapters/qwen-adapter.d.ts +2 -2
- package/dist/core/adapters/qwen-adapter.js +16 -52
- package/dist/core/adapters/roocode-adapter.d.ts +2 -2
- package/dist/core/adapters/roocode-adapter.js +12 -19
- package/dist/core/adapters/warp-md-generator.js +17 -50
- package/dist/core/adapters/windsurf-adapter.d.ts +1 -1
- package/dist/core/adapters/windsurf-adapter.js +12 -20
- package/dist/core/agent-manager.d.ts +1 -1
- package/dist/core/agent-manager.js +34 -38
- package/dist/core/archive-manager.js +10 -46
- package/dist/core/config-manager.d.ts +2 -2
- package/dist/core/config-manager.js +3 -40
- package/dist/core/conversation-analyzer.d.ts +1 -1
- package/dist/core/conversation-analyzer.js +1 -5
- package/dist/core/doc-injector.js +23 -60
- package/dist/core/git-manager.js +11 -48
- package/dist/core/prd-generator.js +16 -51
- package/dist/core/prompt-manager.js +6 -42
- package/dist/core/prompt-optimizer.js +1 -5
- package/dist/core/question-engine.js +6 -45
- package/dist/core/session-manager.d.ts +1 -1
- package/dist/core/session-manager.js +11 -49
- package/dist/core/task-manager.d.ts +26 -0
- package/dist/core/task-manager.js +243 -101
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -12
- package/dist/templates/agents/agents.md +31 -2
- package/dist/templates/agents/copilot-instructions.md +1 -1
- package/dist/templates/agents/octo.md +20 -1
- package/dist/templates/agents/warp.md +1 -1
- package/dist/templates/slash-commands/_canonical/implement.md +33 -11
- package/dist/types/agent.js +1 -2
- package/dist/types/config.js +3 -8
- package/dist/types/errors.js +7 -13
- package/dist/types/session.js +1 -2
- package/dist/utils/agent-error-messages.js +1 -5
- package/dist/utils/error-utils.js +5 -12
- package/dist/utils/file-system.js +20 -57
- package/dist/utils/legacy-command-cleanup.d.ts +1 -1
- package/dist/utils/legacy-command-cleanup.js +9 -45
- package/dist/utils/template-loader.d.ts +1 -1
- package/dist/utils/template-loader.js +9 -41
- package/dist/utils/toml-templates.js +1 -4
- package/package.json +9 -4
- package/dist/core/adapters 2/agents-md-generator.d.ts +0 -26
- package/dist/core/adapters 2/agents-md-generator.js +0 -102
- package/dist/core/adapters 2/amp-adapter.d.ts +0 -27
- package/dist/core/adapters 2/amp-adapter.js +0 -42
- package/dist/core/adapters 2/augment-adapter.d.ts +0 -22
- package/dist/core/adapters 2/augment-adapter.js +0 -77
- package/dist/core/adapters 2/base-adapter.d.ts +0 -45
- package/dist/core/adapters 2/base-adapter.js +0 -142
- package/dist/core/adapters 2/claude-code-adapter.d.ts +0 -32
- package/dist/core/adapters 2/claude-code-adapter.js +0 -116
- package/dist/core/adapters 2/cline-adapter.d.ts +0 -34
- package/dist/core/adapters 2/cline-adapter.js +0 -52
- package/dist/core/adapters 2/codebuddy-adapter.d.ts +0 -24
- package/dist/core/adapters 2/codebuddy-adapter.js +0 -82
- package/dist/core/adapters 2/codex-adapter.d.ts +0 -24
- package/dist/core/adapters 2/codex-adapter.js +0 -79
- package/dist/core/adapters 2/copilot-instructions-generator.d.ts +0 -26
- package/dist/core/adapters 2/copilot-instructions-generator.js +0 -104
- package/dist/core/adapters 2/crush-adapter.d.ts +0 -35
- package/dist/core/adapters 2/crush-adapter.js +0 -49
- package/dist/core/adapters 2/cursor-adapter.d.ts +0 -25
- package/dist/core/adapters 2/cursor-adapter.js +0 -40
- package/dist/core/adapters 2/droid-adapter.d.ts +0 -33
- package/dist/core/adapters 2/droid-adapter.js +0 -57
- package/dist/core/adapters 2/gemini-adapter.d.ts +0 -27
- package/dist/core/adapters 2/gemini-adapter.js +0 -90
- package/dist/core/adapters 2/kilocode-adapter.d.ts +0 -34
- package/dist/core/adapters 2/kilocode-adapter.js +0 -49
- package/dist/core/adapters 2/octo-md-generator.d.ts +0 -26
- package/dist/core/adapters 2/octo-md-generator.js +0 -102
- package/dist/core/adapters 2/opencode-adapter.d.ts +0 -33
- package/dist/core/adapters 2/opencode-adapter.js +0 -56
- package/dist/core/adapters 2/qwen-adapter.d.ts +0 -27
- package/dist/core/adapters 2/qwen-adapter.js +0 -90
- package/dist/core/adapters 2/roocode-adapter.d.ts +0 -40
- package/dist/core/adapters 2/roocode-adapter.js +0 -68
- package/dist/core/adapters 2/warp-md-generator.d.ts +0 -17
- package/dist/core/adapters 2/warp-md-generator.js +0 -88
- package/dist/core/adapters 2/windsurf-adapter.d.ts +0 -34
- package/dist/core/adapters 2/windsurf-adapter.js +0 -49
- package/dist/core/agent-manager 2.js +0 -126
- package/dist/core/agent-manager.d 2.ts +0 -51
- package/dist/core/archive-manager 2.js +0 -338
- package/dist/core/archive-manager.d 2.ts +0 -100
- package/dist/core/conversation-analyzer.d 2.ts +0 -86
- package/dist/core/doc-injector 2.js +0 -236
- package/dist/core/doc-injector.d 2.ts +0 -51
- package/dist/core/git-manager 2.js +0 -214
- package/dist/core/git-manager.d 2.ts +0 -100
- package/dist/core/prompt-optimizer 2.js +0 -963
- package/dist/core/prompt-optimizer.d 2.ts +0 -268
- package/dist/core/question-engine 2.js +0 -395
- package/dist/core/question-engine.d 2.ts +0 -167
- package/dist/core/session-manager 2.js +0 -403
- package/dist/core/session-manager.d 2.ts +0 -139
- package/dist/core/task-manager 2.js +0 -689
- package/dist/core/task-manager.d 2.ts +0 -155
|
@@ -1,70 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
1
|
+
import { Command, Flags } from '@oclif/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import inquirer from 'inquirer';
|
|
4
|
+
import fs from 'fs-extra';
|
|
5
|
+
import * as path from 'path';
|
|
6
|
+
import { fileURLToPath } from 'url';
|
|
7
|
+
import { dirname } from 'path';
|
|
8
|
+
import JSON5 from 'json5';
|
|
9
|
+
import { DocInjector } from '../../core/doc-injector.js';
|
|
10
|
+
import { AgentManager } from '../../core/agent-manager.js';
|
|
11
|
+
import { AgentsMdGenerator } from '../../core/adapters/agents-md-generator.js';
|
|
12
|
+
import { OctoMdGenerator } from '../../core/adapters/octo-md-generator.js';
|
|
13
|
+
import { WarpMdGenerator } from '../../core/adapters/warp-md-generator.js';
|
|
14
|
+
import { collectLegacyCommandFiles } from '../../utils/legacy-command-cleanup.js';
|
|
15
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
16
|
+
const __dirname = dirname(__filename);
|
|
17
|
+
export default class Update extends Command {
|
|
18
|
+
static description = 'Update managed blocks and slash commands';
|
|
19
|
+
static examples = [
|
|
20
|
+
'<%= config.bin %> <%= command.id %>',
|
|
21
|
+
'<%= config.bin %> <%= command.id %> --docs-only',
|
|
22
|
+
'<%= config.bin %> <%= command.id %> --commands-only',
|
|
23
|
+
];
|
|
24
|
+
static flags = {
|
|
25
|
+
'docs-only': Flags.boolean({
|
|
26
|
+
description: 'Update only documentation blocks (AGENTS.md, CLAUDE.md, OCTO.md, WARP.md)',
|
|
27
|
+
default: false,
|
|
28
|
+
}),
|
|
29
|
+
'commands-only': Flags.boolean({
|
|
30
|
+
description: 'Update only slash command files',
|
|
31
|
+
default: false,
|
|
32
|
+
}),
|
|
33
|
+
force: Flags.boolean({
|
|
34
|
+
char: 'f',
|
|
35
|
+
description: 'Force update even if files haven\'t changed',
|
|
36
|
+
default: false,
|
|
37
|
+
}),
|
|
33
38
|
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const core_1 = require("@oclif/core");
|
|
40
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
41
|
-
const inquirer_1 = __importDefault(require("inquirer"));
|
|
42
|
-
const fs = __importStar(require("fs-extra"));
|
|
43
|
-
const path = __importStar(require("path"));
|
|
44
|
-
const json5_1 = __importDefault(require("json5"));
|
|
45
|
-
const doc_injector_1 = require("../../core/doc-injector");
|
|
46
|
-
const agent_manager_1 = require("../../core/agent-manager");
|
|
47
|
-
const agents_md_generator_1 = require("../../core/adapters/agents-md-generator");
|
|
48
|
-
const octo_md_generator_1 = require("../../core/adapters/octo-md-generator");
|
|
49
|
-
const warp_md_generator_1 = require("../../core/adapters/warp-md-generator");
|
|
50
|
-
const legacy_command_cleanup_1 = require("../../utils/legacy-command-cleanup");
|
|
51
|
-
class Update extends core_1.Command {
|
|
52
39
|
async run() {
|
|
53
40
|
const { flags } = await this.parse(Update);
|
|
54
41
|
const clavixDir = path.join(process.cwd(), '.clavix');
|
|
55
42
|
const configPath = path.join(clavixDir, 'config.json');
|
|
56
43
|
if (!fs.existsSync(clavixDir) || !fs.existsSync(configPath)) {
|
|
57
|
-
this.error(
|
|
44
|
+
this.error(chalk.red('No .clavix directory found.') +
|
|
58
45
|
'\n' +
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
46
|
+
chalk.yellow('Run ') +
|
|
47
|
+
chalk.cyan('clavix init') +
|
|
48
|
+
chalk.yellow(' to initialize Clavix in this project.'));
|
|
62
49
|
}
|
|
63
|
-
this.log(
|
|
50
|
+
this.log(chalk.bold.cyan('🔄 Updating Clavix integration...\n'));
|
|
64
51
|
// Load config to determine providers
|
|
65
|
-
const config =
|
|
52
|
+
const config = JSON5.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
66
53
|
const providers = config.providers || ['claude-code'];
|
|
67
|
-
const agentManager = new
|
|
54
|
+
const agentManager = new AgentManager();
|
|
68
55
|
const updateDocs = flags['docs-only'] || (!flags['docs-only'] && !flags['commands-only']);
|
|
69
56
|
const updateCommands = flags['commands-only'] || (!flags['docs-only'] && !flags['commands-only']);
|
|
70
57
|
let updatedCount = 0;
|
|
@@ -93,7 +80,7 @@ class Update extends core_1.Command {
|
|
|
93
80
|
}
|
|
94
81
|
const adapter = agentManager.getAdapter(providerName);
|
|
95
82
|
if (!adapter) {
|
|
96
|
-
this.log(
|
|
83
|
+
this.log(chalk.yellow(` ⚠ Unknown provider: ${providerName}, skipping...`));
|
|
97
84
|
continue;
|
|
98
85
|
}
|
|
99
86
|
// Update documentation blocks (Claude Code only)
|
|
@@ -107,14 +94,14 @@ class Update extends core_1.Command {
|
|
|
107
94
|
}
|
|
108
95
|
this.log('');
|
|
109
96
|
if (updatedCount > 0) {
|
|
110
|
-
this.log(
|
|
97
|
+
this.log(chalk.green(`✅ Successfully updated ${updatedCount} file(s)`));
|
|
111
98
|
}
|
|
112
99
|
else {
|
|
113
|
-
this.log(
|
|
100
|
+
this.log(chalk.gray('✓ All files are up to date'));
|
|
114
101
|
}
|
|
115
102
|
}
|
|
116
103
|
async updateDocumentation(_adapter, agentType, force) {
|
|
117
|
-
this.log(
|
|
104
|
+
this.log(chalk.cyan('📝 Updating documentation blocks...'));
|
|
118
105
|
let updated = 0;
|
|
119
106
|
// Update AGENTS.md
|
|
120
107
|
const agentsPath = path.join(process.cwd(), 'AGENTS.md');
|
|
@@ -122,16 +109,16 @@ class Update extends core_1.Command {
|
|
|
122
109
|
const agentsContent = this.getAgentsContent();
|
|
123
110
|
const currentContent = fs.readFileSync(agentsPath, 'utf-8');
|
|
124
111
|
if (force || !this.hasUpToDateBlock(currentContent, agentsContent)) {
|
|
125
|
-
await
|
|
126
|
-
this.log(
|
|
112
|
+
await DocInjector.injectBlock(agentsPath, agentsContent);
|
|
113
|
+
this.log(chalk.gray(' ✓ Updated AGENTS.md'));
|
|
127
114
|
updated++;
|
|
128
115
|
}
|
|
129
116
|
else {
|
|
130
|
-
this.log(
|
|
117
|
+
this.log(chalk.gray(' • AGENTS.md already up to date'));
|
|
131
118
|
}
|
|
132
119
|
}
|
|
133
120
|
else {
|
|
134
|
-
this.log(
|
|
121
|
+
this.log(chalk.yellow(' ⚠ AGENTS.md not found, skipping'));
|
|
135
122
|
}
|
|
136
123
|
// Update agent-specific docs (e.g., CLAUDE.md for Claude Code)
|
|
137
124
|
if (agentType === 'claude-code') {
|
|
@@ -140,32 +127,32 @@ class Update extends core_1.Command {
|
|
|
140
127
|
const claudeContent = this.getClaudeContent();
|
|
141
128
|
const currentContent = fs.readFileSync(claudePath, 'utf-8');
|
|
142
129
|
if (force || !this.hasUpToDateBlock(currentContent, claudeContent)) {
|
|
143
|
-
await
|
|
130
|
+
await DocInjector.injectBlock(claudePath, claudeContent, {
|
|
144
131
|
startMarker: '<!-- CLAVIX:START -->',
|
|
145
132
|
endMarker: '<!-- CLAVIX:END -->',
|
|
146
133
|
});
|
|
147
|
-
this.log(
|
|
134
|
+
this.log(chalk.gray(' ✓ Updated CLAUDE.md'));
|
|
148
135
|
updated++;
|
|
149
136
|
}
|
|
150
137
|
else {
|
|
151
|
-
this.log(
|
|
138
|
+
this.log(chalk.gray(' • CLAUDE.md already up to date'));
|
|
152
139
|
}
|
|
153
140
|
}
|
|
154
141
|
else {
|
|
155
|
-
this.log(
|
|
142
|
+
this.log(chalk.yellow(' ⚠ CLAUDE.md not found, skipping'));
|
|
156
143
|
}
|
|
157
144
|
}
|
|
158
145
|
return updated;
|
|
159
146
|
}
|
|
160
147
|
async updateCommands(adapter, force) {
|
|
161
|
-
this.log(
|
|
148
|
+
this.log(chalk.cyan(`\n🔧 Updating slash commands for ${adapter.displayName}...`));
|
|
162
149
|
const commandsDir = adapter.getCommandPath();
|
|
163
150
|
const commandsPath = path.join(process.cwd(), commandsDir);
|
|
164
151
|
const extension = adapter.fileExtension;
|
|
165
152
|
// Dynamically scan template directory for all command templates
|
|
166
153
|
const templatesDir = path.join(__dirname, '..', '..', 'templates', 'slash-commands', adapter.name);
|
|
167
154
|
if (!fs.existsSync(templatesDir)) {
|
|
168
|
-
this.log(
|
|
155
|
+
this.log(chalk.yellow(` ⚠ Templates directory not found: ${templatesDir}`));
|
|
169
156
|
return 0;
|
|
170
157
|
}
|
|
171
158
|
// Get all .md template files
|
|
@@ -173,13 +160,13 @@ class Update extends core_1.Command {
|
|
|
173
160
|
.filter(file => file.endsWith(extension))
|
|
174
161
|
.map(file => file.slice(0, -extension.length));
|
|
175
162
|
if (templateFiles.length === 0) {
|
|
176
|
-
this.log(
|
|
163
|
+
this.log(chalk.yellow(' ⚠ No command templates found'));
|
|
177
164
|
return 0;
|
|
178
165
|
}
|
|
179
166
|
// Ensure commands directory exists
|
|
180
167
|
if (!fs.existsSync(commandsPath)) {
|
|
181
168
|
fs.mkdirpSync(commandsPath);
|
|
182
|
-
this.log(
|
|
169
|
+
this.log(chalk.gray(` ✓ Created commands directory: ${commandsDir}`));
|
|
183
170
|
}
|
|
184
171
|
let updated = 0;
|
|
185
172
|
for (const command of templateFiles) {
|
|
@@ -191,53 +178,55 @@ class Update extends core_1.Command {
|
|
|
191
178
|
const currentContent = fs.readFileSync(commandFile, 'utf-8');
|
|
192
179
|
if (force || currentContent !== newContent) {
|
|
193
180
|
fs.writeFileSync(commandFile, newContent);
|
|
194
|
-
this.log(
|
|
181
|
+
this.log(chalk.gray(` ✓ Updated ${filename}`));
|
|
195
182
|
updated++;
|
|
196
183
|
}
|
|
197
184
|
else {
|
|
198
|
-
this.log(
|
|
185
|
+
this.log(chalk.gray(` • ${filename} already up to date`));
|
|
199
186
|
}
|
|
200
187
|
}
|
|
201
188
|
else {
|
|
202
189
|
fs.writeFileSync(commandFile, newContent);
|
|
203
|
-
this.log(
|
|
190
|
+
this.log(chalk.gray(` ✓ Created ${filename}`));
|
|
204
191
|
updated++;
|
|
205
192
|
}
|
|
206
193
|
}
|
|
207
|
-
updated += await this.handleLegacyCommands(adapter, templateFiles);
|
|
194
|
+
updated += await this.handleLegacyCommands(adapter, templateFiles, force);
|
|
208
195
|
return updated;
|
|
209
196
|
}
|
|
210
|
-
async handleLegacyCommands(adapter, commandNames) {
|
|
197
|
+
async handleLegacyCommands(adapter, commandNames, force) {
|
|
211
198
|
if (commandNames.length === 0) {
|
|
212
199
|
return 0;
|
|
213
200
|
}
|
|
214
|
-
const legacyFiles = await
|
|
201
|
+
const legacyFiles = await collectLegacyCommandFiles(adapter, commandNames);
|
|
215
202
|
if (legacyFiles.length === 0) {
|
|
216
203
|
return 0;
|
|
217
204
|
}
|
|
218
205
|
const relativePaths = legacyFiles
|
|
219
206
|
.map((file) => path.relative(process.cwd(), file))
|
|
220
207
|
.sort((a, b) => a.localeCompare(b));
|
|
221
|
-
this.log(
|
|
208
|
+
this.log(chalk.gray(` ⚠ Found ${relativePaths.length} deprecated command file(s):`));
|
|
222
209
|
for (const file of relativePaths) {
|
|
223
|
-
this.log(
|
|
210
|
+
this.log(chalk.gray(` • ${file}`));
|
|
224
211
|
}
|
|
225
|
-
|
|
226
|
-
{
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
212
|
+
if (!force) {
|
|
213
|
+
const { removeLegacy } = await inquirer.prompt([
|
|
214
|
+
{
|
|
215
|
+
type: 'confirm',
|
|
216
|
+
name: 'removeLegacy',
|
|
217
|
+
message: `Remove deprecated files for ${adapter.displayName}? Functionality is unchanged; filenames are being standardized.`,
|
|
218
|
+
default: true,
|
|
219
|
+
},
|
|
220
|
+
]);
|
|
221
|
+
if (!removeLegacy) {
|
|
222
|
+
this.log(chalk.gray(' ⊗ Kept legacy files (deprecated naming retained)'));
|
|
223
|
+
return 0;
|
|
224
|
+
}
|
|
236
225
|
}
|
|
237
226
|
let removed = 0;
|
|
238
227
|
for (const file of legacyFiles) {
|
|
239
228
|
await fs.remove(file);
|
|
240
|
-
this.log(
|
|
229
|
+
this.log(chalk.gray(` ✓ Removed ${path.relative(process.cwd(), file)}`));
|
|
241
230
|
removed++;
|
|
242
231
|
}
|
|
243
232
|
return removed;
|
|
@@ -305,65 +294,43 @@ Analyze the current conversation and extract key requirements into a structured
|
|
|
305
294
|
return currentContent.includes(newContent.trim());
|
|
306
295
|
}
|
|
307
296
|
async updateAgentsMd(_force) {
|
|
308
|
-
this.log(
|
|
297
|
+
this.log(chalk.cyan('📝 Updating AGENTS.md...'));
|
|
309
298
|
try {
|
|
310
|
-
await
|
|
311
|
-
this.log(
|
|
299
|
+
await AgentsMdGenerator.generate();
|
|
300
|
+
this.log(chalk.gray(' ✓ Updated AGENTS.md'));
|
|
312
301
|
return 1;
|
|
313
302
|
}
|
|
314
303
|
catch (error) {
|
|
315
|
-
const { getErrorMessage } = await
|
|
316
|
-
this.log(
|
|
304
|
+
const { getErrorMessage } = await import('../../utils/error-utils.js');
|
|
305
|
+
this.log(chalk.yellow(` ⚠ Failed to update AGENTS.md: ${getErrorMessage(error)}`));
|
|
317
306
|
return 0;
|
|
318
307
|
}
|
|
319
308
|
}
|
|
320
309
|
async updateOctoMd(_force) {
|
|
321
|
-
this.log(
|
|
310
|
+
this.log(chalk.cyan('📝 Updating OCTO.md...'));
|
|
322
311
|
try {
|
|
323
|
-
await
|
|
324
|
-
this.log(
|
|
312
|
+
await OctoMdGenerator.generate();
|
|
313
|
+
this.log(chalk.gray(' ✓ Updated OCTO.md'));
|
|
325
314
|
return 1;
|
|
326
315
|
}
|
|
327
316
|
catch (error) {
|
|
328
|
-
const { getErrorMessage } = await
|
|
329
|
-
this.log(
|
|
317
|
+
const { getErrorMessage } = await import('../../utils/error-utils.js');
|
|
318
|
+
this.log(chalk.yellow(` ⚠ Failed to update OCTO.md: ${getErrorMessage(error)}`));
|
|
330
319
|
return 0;
|
|
331
320
|
}
|
|
332
321
|
}
|
|
333
322
|
async updateWarpMd(_force) {
|
|
334
|
-
this.log(
|
|
323
|
+
this.log(chalk.cyan('📝 Updating WARP.md...'));
|
|
335
324
|
try {
|
|
336
|
-
await
|
|
337
|
-
this.log(
|
|
325
|
+
await WarpMdGenerator.generate();
|
|
326
|
+
this.log(chalk.gray(' ✓ Updated WARP.md'));
|
|
338
327
|
return 1;
|
|
339
328
|
}
|
|
340
329
|
catch (error) {
|
|
341
|
-
const { getErrorMessage } = await
|
|
342
|
-
this.log(
|
|
330
|
+
const { getErrorMessage } = await import('../../utils/error-utils.js');
|
|
331
|
+
this.log(chalk.yellow(` ⚠ Failed to update WARP.md: ${getErrorMessage(error)}`));
|
|
343
332
|
return 0;
|
|
344
333
|
}
|
|
345
334
|
}
|
|
346
335
|
}
|
|
347
|
-
Update.description = 'Update managed blocks and slash commands';
|
|
348
|
-
Update.examples = [
|
|
349
|
-
'<%= config.bin %> <%= command.id %>',
|
|
350
|
-
'<%= config.bin %> <%= command.id %> --docs-only',
|
|
351
|
-
'<%= config.bin %> <%= command.id %> --commands-only',
|
|
352
|
-
];
|
|
353
|
-
Update.flags = {
|
|
354
|
-
'docs-only': core_1.Flags.boolean({
|
|
355
|
-
description: 'Update only documentation blocks (AGENTS.md, CLAUDE.md, OCTO.md, WARP.md)',
|
|
356
|
-
default: false,
|
|
357
|
-
}),
|
|
358
|
-
'commands-only': core_1.Flags.boolean({
|
|
359
|
-
description: 'Update only slash command files',
|
|
360
|
-
default: false,
|
|
361
|
-
}),
|
|
362
|
-
force: core_1.Flags.boolean({
|
|
363
|
-
char: 'f',
|
|
364
|
-
description: 'Force update even if files haven\'t changed',
|
|
365
|
-
default: false,
|
|
366
|
-
}),
|
|
367
|
-
};
|
|
368
|
-
exports.default = Update;
|
|
369
336
|
//# sourceMappingURL=update.js.map
|
|
@@ -1,58 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
const core_1 = require("@oclif/core");
|
|
40
|
-
const chalk_1 = __importDefault(require("chalk"));
|
|
41
|
-
const path = __importStar(require("path"));
|
|
42
|
-
const fs = __importStar(require("fs-extra"));
|
|
43
|
-
class Version extends core_1.Command {
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import * as path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname } from 'path';
|
|
6
|
+
import fs from 'fs-extra';
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
export default class Version extends Command {
|
|
10
|
+
static description = 'Display Clavix version';
|
|
11
|
+
static examples = ['<%= config.bin %> <%= command.id %>'];
|
|
44
12
|
async run() {
|
|
45
13
|
try {
|
|
46
14
|
const packageJsonPath = path.join(__dirname, '../../../package.json');
|
|
47
15
|
const packageJson = await fs.readJson(packageJsonPath);
|
|
48
|
-
console.log(
|
|
16
|
+
console.log(chalk.cyan(`\nClavix v${packageJson.version}\n`));
|
|
49
17
|
}
|
|
50
18
|
catch {
|
|
51
|
-
console.log(
|
|
19
|
+
console.log(chalk.red('\n✗ Could not determine version\n'));
|
|
52
20
|
}
|
|
53
21
|
}
|
|
54
22
|
}
|
|
55
|
-
Version.description = 'Display Clavix version';
|
|
56
|
-
Version.examples = ['<%= config.bin %> <%= command.id %>'];
|
|
57
|
-
exports.default = Version;
|
|
58
23
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,56 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.AgentsMdGenerator = void 0;
|
|
37
|
-
const file_system_1 = require("../../utils/file-system");
|
|
38
|
-
const path = __importStar(require("path"));
|
|
1
|
+
import { FileSystem } from '../../utils/file-system.js';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import { dirname } from 'path';
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = dirname(__filename);
|
|
39
7
|
/**
|
|
40
8
|
* Generator for universal AGENTS.md file
|
|
41
9
|
* Provides workflow instructions for AI tools without slash command support
|
|
42
10
|
*/
|
|
43
|
-
class AgentsMdGenerator {
|
|
11
|
+
export class AgentsMdGenerator {
|
|
12
|
+
static TARGET_FILE = 'AGENTS.md';
|
|
13
|
+
static START_MARKER = '<!-- CLAVIX:START -->';
|
|
14
|
+
static END_MARKER = '<!-- CLAVIX:END -->';
|
|
44
15
|
/**
|
|
45
16
|
* Generate or update AGENTS.md with Clavix workflows
|
|
46
17
|
*/
|
|
47
18
|
static async generate() {
|
|
48
19
|
const templatePath = path.join(__dirname, '../../templates/agents/agents.md');
|
|
49
20
|
// Check if template exists
|
|
50
|
-
if (!(await
|
|
21
|
+
if (!(await FileSystem.exists(templatePath))) {
|
|
51
22
|
throw new Error(`AGENTS.md template not found at ${templatePath}`);
|
|
52
23
|
}
|
|
53
|
-
const template = await
|
|
24
|
+
const template = await FileSystem.readFile(templatePath);
|
|
54
25
|
// Inject into AGENTS.md using managed blocks
|
|
55
26
|
await this.injectManagedBlock(this.TARGET_FILE, template);
|
|
56
27
|
}
|
|
@@ -60,8 +31,8 @@ class AgentsMdGenerator {
|
|
|
60
31
|
static async injectManagedBlock(filePath, content) {
|
|
61
32
|
let fileContent = '';
|
|
62
33
|
// Read existing file or start with empty content
|
|
63
|
-
if (await
|
|
64
|
-
fileContent = await
|
|
34
|
+
if (await FileSystem.exists(filePath)) {
|
|
35
|
+
fileContent = await FileSystem.readFile(filePath);
|
|
65
36
|
}
|
|
66
37
|
const blockRegex = new RegExp(`${this.escapeRegex(this.START_MARKER)}[\\s\\S]*?${this.escapeRegex(this.END_MARKER)}`, 'g');
|
|
67
38
|
const wrappedContent = `${this.START_MARKER}\n${content}\n${this.END_MARKER}`;
|
|
@@ -76,7 +47,7 @@ class AgentsMdGenerator {
|
|
|
76
47
|
}
|
|
77
48
|
fileContent += wrappedContent + '\n';
|
|
78
49
|
}
|
|
79
|
-
await
|
|
50
|
+
await FileSystem.writeFileAtomic(filePath, fileContent);
|
|
80
51
|
}
|
|
81
52
|
/**
|
|
82
53
|
* Escape special regex characters
|
|
@@ -88,15 +59,11 @@ class AgentsMdGenerator {
|
|
|
88
59
|
* Check if AGENTS.md has Clavix block
|
|
89
60
|
*/
|
|
90
61
|
static async hasClavixBlock() {
|
|
91
|
-
if (!(await
|
|
62
|
+
if (!(await FileSystem.exists(this.TARGET_FILE))) {
|
|
92
63
|
return false;
|
|
93
64
|
}
|
|
94
|
-
const content = await
|
|
65
|
+
const content = await FileSystem.readFile(this.TARGET_FILE);
|
|
95
66
|
return content.includes(this.START_MARKER);
|
|
96
67
|
}
|
|
97
68
|
}
|
|
98
|
-
exports.AgentsMdGenerator = AgentsMdGenerator;
|
|
99
|
-
AgentsMdGenerator.TARGET_FILE = 'AGENTS.md';
|
|
100
|
-
AgentsMdGenerator.START_MARKER = '<!-- CLAVIX:START -->';
|
|
101
|
-
AgentsMdGenerator.END_MARKER = '<!-- CLAVIX:END -->';
|
|
102
69
|
//# sourceMappingURL=agents-md-generator.js.map
|
|
@@ -1,32 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.AmpAdapter = void 0;
|
|
4
|
-
const base_adapter_1 = require("./base-adapter");
|
|
5
|
-
const file_system_1 = require("../../utils/file-system");
|
|
1
|
+
import { BaseAdapter } from './base-adapter.js';
|
|
2
|
+
import { FileSystem } from '../../utils/file-system.js';
|
|
6
3
|
/**
|
|
7
4
|
* Amp adapter
|
|
8
5
|
* Commands stored in .agents/commands/ (simple markdown, no frontmatter)
|
|
9
6
|
* Supports executable commands (experimental)
|
|
10
7
|
*/
|
|
11
|
-
class AmpAdapter extends
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
supportsExecutableCommands: true,
|
|
22
|
-
};
|
|
23
|
-
// Uses default formatCommand from BaseAdapter (no special formatting)
|
|
24
|
-
}
|
|
8
|
+
export class AmpAdapter extends BaseAdapter {
|
|
9
|
+
name = 'amp';
|
|
10
|
+
displayName = 'Amp';
|
|
11
|
+
directory = '.agents/commands';
|
|
12
|
+
fileExtension = '.md';
|
|
13
|
+
features = {
|
|
14
|
+
supportsSubdirectories: false,
|
|
15
|
+
supportsFrontmatter: false,
|
|
16
|
+
supportsExecutableCommands: true,
|
|
17
|
+
};
|
|
25
18
|
/**
|
|
26
19
|
* Detect if Amp is available in the project
|
|
27
20
|
*/
|
|
28
21
|
async detectProject() {
|
|
29
|
-
return await
|
|
22
|
+
return await FileSystem.exists('.agents');
|
|
30
23
|
}
|
|
31
24
|
/**
|
|
32
25
|
* Get command path for Amp
|
|
@@ -38,5 +31,4 @@ class AmpAdapter extends base_adapter_1.BaseAdapter {
|
|
|
38
31
|
return `clavix-${name}${this.fileExtension}`;
|
|
39
32
|
}
|
|
40
33
|
}
|
|
41
|
-
exports.AmpAdapter = AmpAdapter;
|
|
42
34
|
//# sourceMappingURL=amp-adapter.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseAdapter } from './base-adapter';
|
|
2
|
-
import { CommandTemplate } from '../../types/agent';
|
|
1
|
+
import { BaseAdapter } from './base-adapter.js';
|
|
2
|
+
import { CommandTemplate } from '../../types/agent.js';
|
|
3
3
|
/**
|
|
4
4
|
* Augment CLI adapter
|
|
5
5
|
* Commands stored in .augment/commands/clavix with optional subdirectories
|