@esotech/contextuate 2.1.0 → 2.1.2
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/dist/commands/doctor.d.ts +6 -0
- package/dist/commands/doctor.js +131 -0
- package/dist/commands/init.d.ts +0 -2
- package/dist/commands/init.js +164 -228
- package/dist/commands/install.js +8 -24
- package/dist/index.js +7 -0
- package/dist/templates/agents/aegis.md +1 -1
- package/dist/templates/agents/archon.md +116 -8
- package/dist/templates/agents/atlas.md +17 -17
- package/dist/templates/agents/canvas.md +1 -1
- package/dist/templates/agents/chronicle.md +1 -1
- package/dist/templates/agents/chronos.md +1 -1
- package/dist/templates/agents/cipher.md +1 -1
- package/dist/templates/agents/crucible.md +1 -1
- package/dist/templates/agents/echo.md +1 -1
- package/dist/templates/agents/forge.md +1 -1
- package/dist/templates/agents/ledger.md +34 -3
- package/dist/templates/agents/meridian.md +1 -1
- package/dist/templates/agents/nexus.md +1 -1
- package/dist/templates/agents/pythia.md +1 -1
- package/dist/templates/agents/scribe.md +1 -1
- package/dist/templates/agents/sentinel.md +1 -1
- package/dist/templates/agents/thoth.md +1 -1
- package/dist/templates/agents/unity.md +1 -1
- package/dist/templates/agents/vox.md +1 -1
- package/dist/templates/agents/weaver.md +1 -1
- package/dist/templates/{skills → commands}/consult.md +1 -1
- package/dist/templates/commands/orchestrate.md +49 -0
- package/dist/templates/framework-agents/documentation-expert.md +3 -3
- package/dist/templates/framework-agents/tools-expert.md +3 -3
- package/dist/templates/templates/contextuate.md +1 -1
- package/dist/templates/tools/agent-creator.md +4 -4
- package/dist/templates/tools/standards-detector.md +1 -1
- package/dist/utils/tools.d.ts +60 -0
- package/dist/utils/tools.js +260 -0
- package/package.json +2 -2
- package/dist/templates/skills/orchestrate.md +0 -173
- package/dist/templates/skills/pythia.md +0 -37
- package/dist/templates/templates/standards/go.standards.md +0 -167
- package/dist/templates/templates/standards/java.standards.md +0 -167
- package/dist/templates/templates/standards/javascript.standards.md +0 -292
- package/dist/templates/templates/standards/php.standards.md +0 -181
- package/dist/templates/templates/standards/python.standards.md +0 -175
- package/dist/templates/tools/agent-creator.tool.md +0 -252
- package/dist/templates/tools/quickref.tool.md +0 -216
- package/dist/templates/tools/spawn.tool.md +0 -31
- package/dist/templates/tools/standards-detector.tool.md +0 -301
- package/dist/templates/version.json +0 -8
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.doctorCommand = doctorCommand;
|
|
7
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
8
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
const tools_1 = require("../utils/tools");
|
|
11
|
+
async function doctorCommand(options = {}) {
|
|
12
|
+
console.log(chalk_1.default.blue('╔════════════════════════════════════════╗'));
|
|
13
|
+
console.log(chalk_1.default.blue('║ Contextuate Doctor ║'));
|
|
14
|
+
console.log(chalk_1.default.blue('╚════════════════════════════════════════╝'));
|
|
15
|
+
console.log('');
|
|
16
|
+
const installDir = 'docs/ai/.contextuate';
|
|
17
|
+
// Check if Contextuate is installed
|
|
18
|
+
if (!fs_extra_1.default.existsSync(installDir)) {
|
|
19
|
+
console.log(chalk_1.default.red('[ERROR] Contextuate is not installed in this project.'));
|
|
20
|
+
console.log(chalk_1.default.gray(' Run: contextuate init'));
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
// Read existing config
|
|
24
|
+
let config = await (0, tools_1.readContextuateConfig)(installDir);
|
|
25
|
+
const configExists = config !== null;
|
|
26
|
+
if (!configExists) {
|
|
27
|
+
console.log(chalk_1.default.yellow('[WARN] contextuate.json not found. Will create one.'));
|
|
28
|
+
}
|
|
29
|
+
// Detect tools
|
|
30
|
+
console.log(chalk_1.default.blue('[INFO] Checking tool availability...'));
|
|
31
|
+
let tools = (0, tools_1.detectTools)();
|
|
32
|
+
(0, tools_1.printToolStatus)(tools);
|
|
33
|
+
// Offer to install missing tools if --install flag or interactive
|
|
34
|
+
if (options.install || options.fix) {
|
|
35
|
+
tools = await (0, tools_1.promptInstallTools)(tools, false);
|
|
36
|
+
}
|
|
37
|
+
else if (!tools.ripgrep.installed) {
|
|
38
|
+
console.log('');
|
|
39
|
+
console.log(chalk_1.default.gray(' Tip: Run "contextuate doctor --install" to install missing tools'));
|
|
40
|
+
}
|
|
41
|
+
// Update or create config
|
|
42
|
+
console.log('');
|
|
43
|
+
console.log(chalk_1.default.blue('[INFO] Updating contextuate.json...'));
|
|
44
|
+
const now = new Date().toISOString();
|
|
45
|
+
if (config) {
|
|
46
|
+
// Update existing config
|
|
47
|
+
config.tools = tools;
|
|
48
|
+
config.updated = now;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
// Create new config - try to read version.json for migration
|
|
52
|
+
const versionJsonPath = path_1.default.join(installDir, 'version.json');
|
|
53
|
+
let pkgInfo = {
|
|
54
|
+
name: '@esotech/contextuate',
|
|
55
|
+
version: '0.0.0',
|
|
56
|
+
description: 'AI Context Framework',
|
|
57
|
+
repository: 'https://github.com/esotech/contextuate'
|
|
58
|
+
};
|
|
59
|
+
if (fs_extra_1.default.existsSync(versionJsonPath)) {
|
|
60
|
+
try {
|
|
61
|
+
const versionData = JSON.parse(await fs_extra_1.default.readFile(versionJsonPath, 'utf-8'));
|
|
62
|
+
pkgInfo = {
|
|
63
|
+
name: versionData.name || pkgInfo.name,
|
|
64
|
+
version: versionData.version || pkgInfo.version,
|
|
65
|
+
description: versionData.description || pkgInfo.description,
|
|
66
|
+
repository: versionData.repository || pkgInfo.repository
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
// Use defaults
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
config = {
|
|
74
|
+
...pkgInfo,
|
|
75
|
+
initialized: now,
|
|
76
|
+
updated: now,
|
|
77
|
+
tools
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
await (0, tools_1.writeContextuateConfig)(installDir, config);
|
|
81
|
+
console.log(chalk_1.default.green('[OK] contextuate.json updated'));
|
|
82
|
+
// Remove old version.json if it exists (migration)
|
|
83
|
+
const versionJsonPath = path_1.default.join(installDir, 'version.json');
|
|
84
|
+
if (fs_extra_1.default.existsSync(versionJsonPath)) {
|
|
85
|
+
await fs_extra_1.default.remove(versionJsonPath);
|
|
86
|
+
console.log(chalk_1.default.yellow('[CLEANUP] Removed legacy version.json (migrated to contextuate.json)'));
|
|
87
|
+
}
|
|
88
|
+
// Process template variables if --fix flag
|
|
89
|
+
if (options.fix) {
|
|
90
|
+
console.log('');
|
|
91
|
+
console.log(chalk_1.default.blue('[INFO] Processing template variables...'));
|
|
92
|
+
const agentsDir = 'docs/ai/agents';
|
|
93
|
+
const frameworkAgentsDir = path_1.default.join(installDir, 'agents');
|
|
94
|
+
let totalProcessed = 0;
|
|
95
|
+
if (fs_extra_1.default.existsSync(agentsDir)) {
|
|
96
|
+
const count = await (0, tools_1.processTemplateDirectory)(agentsDir, tools);
|
|
97
|
+
totalProcessed += count;
|
|
98
|
+
}
|
|
99
|
+
if (fs_extra_1.default.existsSync(frameworkAgentsDir)) {
|
|
100
|
+
const count = await (0, tools_1.processTemplateDirectory)(frameworkAgentsDir, tools);
|
|
101
|
+
totalProcessed += count;
|
|
102
|
+
}
|
|
103
|
+
if (totalProcessed > 0) {
|
|
104
|
+
console.log(chalk_1.default.green(`[OK] Updated template variables in ${totalProcessed} file(s)`));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
console.log(chalk_1.default.gray('[--] No template variables to update'));
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
// Summary
|
|
111
|
+
console.log('');
|
|
112
|
+
console.log(chalk_1.default.green('╔════════════════════════════════════════╗'));
|
|
113
|
+
console.log(chalk_1.default.green('║ Doctor Check Complete ║'));
|
|
114
|
+
console.log(chalk_1.default.green('╚════════════════════════════════════════╝'));
|
|
115
|
+
console.log('');
|
|
116
|
+
// Report issues
|
|
117
|
+
const issues = [];
|
|
118
|
+
if (!tools.ripgrep.installed) {
|
|
119
|
+
issues.push('ripgrep not installed (code search will use slower grep)');
|
|
120
|
+
}
|
|
121
|
+
if (issues.length > 0) {
|
|
122
|
+
console.log(chalk_1.default.yellow('Issues found:'));
|
|
123
|
+
issues.forEach(issue => console.log(chalk_1.default.yellow(` - ${issue}`)));
|
|
124
|
+
console.log('');
|
|
125
|
+
console.log(chalk_1.default.gray('Run "contextuate doctor --fix" to attempt automatic fixes'));
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
console.log(chalk_1.default.green('All checks passed!'));
|
|
129
|
+
}
|
|
130
|
+
console.log('');
|
|
131
|
+
}
|