@esotech/contextuate 2.0.0 → 2.1.1
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 +169 -1
- package/dist/commands/claude.d.ts +21 -0
- package/dist/commands/claude.js +213 -0
- package/dist/commands/context.d.ts +1 -0
- package/dist/commands/create.d.ts +3 -0
- package/dist/commands/index.d.ts +4 -0
- package/dist/commands/init.d.ts +7 -0
- package/dist/commands/init.js +67 -6
- package/dist/commands/install.d.ts +28 -0
- package/dist/commands/install.js +100 -11
- package/dist/commands/monitor.d.ts +55 -0
- package/dist/commands/monitor.js +1007 -0
- package/dist/commands/remove.d.ts +3 -0
- package/dist/commands/run.d.ts +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +113 -1
- package/dist/monitor/daemon/circuit-breaker.d.ts +121 -0
- package/dist/monitor/daemon/circuit-breaker.js +552 -0
- package/dist/monitor/daemon/cli.d.ts +8 -0
- package/dist/monitor/daemon/cli.js +82 -0
- package/dist/monitor/daemon/index.d.ts +137 -0
- package/dist/monitor/daemon/index.js +695 -0
- package/dist/monitor/daemon/notifier.d.ts +25 -0
- package/dist/monitor/daemon/notifier.js +98 -0
- package/dist/monitor/daemon/processor.d.ts +89 -0
- package/dist/monitor/daemon/processor.js +455 -0
- package/dist/monitor/daemon/state.d.ts +80 -0
- package/dist/monitor/daemon/state.js +162 -0
- package/dist/monitor/daemon/watcher.d.ts +47 -0
- package/dist/monitor/daemon/watcher.js +171 -0
- package/dist/monitor/daemon/wrapper-manager.d.ts +106 -0
- package/dist/monitor/daemon/wrapper-manager.js +374 -0
- package/dist/monitor/hooks/emit-event.js +652 -0
- package/dist/monitor/persistence/file-store.d.ts +88 -0
- package/dist/monitor/persistence/file-store.js +335 -0
- package/dist/monitor/persistence/index.d.ts +7 -0
- package/dist/monitor/persistence/index.js +10 -0
- package/dist/monitor/server/adapters/redis.d.ts +38 -0
- package/dist/monitor/server/adapters/redis.js +213 -0
- package/dist/monitor/server/adapters/unix-socket.d.ts +33 -0
- package/dist/monitor/server/adapters/unix-socket.js +182 -0
- package/dist/monitor/server/broker.d.ts +135 -0
- package/dist/monitor/server/broker.js +475 -0
- package/dist/monitor/server/cli.d.ts +8 -0
- package/dist/monitor/server/cli.js +98 -0
- package/dist/monitor/server/fastify.d.ts +16 -0
- package/dist/monitor/server/fastify.js +184 -0
- package/dist/monitor/server/index.d.ts +36 -0
- package/dist/monitor/server/index.js +153 -0
- package/dist/monitor/server/websocket.d.ts +80 -0
- package/dist/monitor/server/websocket.js +453 -0
- package/dist/monitor/ui/assets/index-4IssW9On.js +59 -0
- package/dist/monitor/ui/assets/index-vo9hLe5R.css +32 -0
- package/dist/monitor/ui/favicon.png +0 -0
- package/dist/monitor/ui/index.html +14 -0
- package/dist/monitor/ui/logo.png +0 -0
- package/dist/monitor/ui/logo.svg +1 -0
- package/dist/runtime/driver.d.ts +16 -0
- package/dist/runtime/tools.d.ts +10 -0
- package/dist/templates/README.md +33 -7
- package/dist/templates/agents/aegis.md +4 -0
- package/dist/templates/agents/archon.md +13 -22
- package/dist/templates/agents/atlas.md +4 -0
- package/dist/templates/agents/canvas.md +4 -0
- package/dist/templates/agents/chronicle.md +4 -0
- package/dist/templates/agents/chronos.md +4 -0
- package/dist/templates/agents/cipher.md +4 -0
- package/dist/templates/agents/crucible.md +4 -0
- package/dist/templates/agents/echo.md +4 -0
- package/dist/templates/agents/forge.md +4 -0
- package/dist/templates/agents/ledger.md +4 -0
- package/dist/templates/agents/meridian.md +4 -0
- package/dist/templates/agents/nexus.md +4 -0
- package/dist/templates/agents/pythia.md +217 -0
- package/dist/templates/agents/scribe.md +4 -0
- package/dist/templates/agents/sentinel.md +4 -0
- package/dist/templates/agents/{oracle.md → thoth.md} +11 -7
- package/dist/templates/agents/unity.md +4 -0
- package/dist/templates/agents/vox.md +4 -0
- package/dist/templates/agents/weaver.md +4 -0
- package/dist/templates/commands/consult.md +138 -0
- package/dist/templates/commands/orchestrate.md +173 -0
- package/dist/templates/framework-agents/documentation-expert.md +3 -3
- package/dist/templates/framework-agents/tools-expert.md +8 -8
- package/dist/templates/standards/agent-roles.md +68 -21
- package/dist/templates/standards/coding-standards.md +9 -26
- package/dist/templates/templates/context.md +17 -2
- package/dist/templates/templates/contextuate.md +21 -28
- package/dist/templates/tools/{agent-creator.tool.md → agent-creator.md} +3 -3
- package/dist/types/monitor.d.ts +660 -0
- package/dist/types/monitor.js +75 -0
- package/dist/utils/git.d.ts +9 -0
- package/dist/utils/tokens.d.ts +10 -0
- package/package.json +18 -5
- package/dist/templates/version.json +0 -8
- /package/dist/templates/templates/standards/{go.standards.md → go.md} +0 -0
- /package/dist/templates/templates/standards/{java.standards.md → java.md} +0 -0
- /package/dist/templates/templates/standards/{javascript.standards.md → javascript.md} +0 -0
- /package/dist/templates/templates/standards/{php.standards.md → php.md} +0 -0
- /package/dist/templates/templates/standards/{python.standards.md → python.md} +0 -0
- /package/dist/templates/tools/{quickref.tool.md → quickref.md} +0 -0
- /package/dist/templates/tools/{spawn.tool.md → spawn.md} +0 -0
- /package/dist/templates/tools/{standards-detector.tool.md → standards-detector.md} +0 -0
package/dist/commands/install.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.installAgentsCommand = installAgentsCommand;
|
|
7
7
|
exports.installStandardsCommand = installStandardsCommand;
|
|
8
8
|
exports.installToolsCommand = installToolsCommand;
|
|
9
|
+
exports.installSkillsCommand = installSkillsCommand;
|
|
9
10
|
exports.installCommand = installCommand;
|
|
10
11
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
11
12
|
const chalk_1 = __importDefault(require("chalk"));
|
|
@@ -33,6 +34,7 @@ async function discoverTemplates() {
|
|
|
33
34
|
agents: [],
|
|
34
35
|
standards: [],
|
|
35
36
|
tools: [],
|
|
37
|
+
skills: [],
|
|
36
38
|
};
|
|
37
39
|
// Discover agents
|
|
38
40
|
const agentDir = path_1.default.join(templateSource, 'agents');
|
|
@@ -47,16 +49,24 @@ async function discoverTemplates() {
|
|
|
47
49
|
if (fs_extra_1.default.existsSync(standardsDir)) {
|
|
48
50
|
const files = await fs_extra_1.default.readdir(standardsDir);
|
|
49
51
|
result.standards = files
|
|
50
|
-
.filter(f => f.endsWith('.
|
|
51
|
-
.map(f => f.replace('.
|
|
52
|
+
.filter(f => f.endsWith('.md'))
|
|
53
|
+
.map(f => f.replace('.md', ''));
|
|
52
54
|
}
|
|
53
55
|
// Discover tools
|
|
54
56
|
const toolsDir = path_1.default.join(templateSource, 'tools');
|
|
55
57
|
if (fs_extra_1.default.existsSync(toolsDir)) {
|
|
56
58
|
const files = await fs_extra_1.default.readdir(toolsDir);
|
|
57
59
|
result.tools = files
|
|
58
|
-
.filter(f => f.endsWith('.
|
|
59
|
-
.map(f => f.replace('.
|
|
60
|
+
.filter(f => f.endsWith('.md'))
|
|
61
|
+
.map(f => f.replace('.md', ''));
|
|
62
|
+
}
|
|
63
|
+
// Discover skills (stored in commands/ directory)
|
|
64
|
+
const commandsDir = path_1.default.join(templateSource, 'commands');
|
|
65
|
+
if (fs_extra_1.default.existsSync(commandsDir)) {
|
|
66
|
+
const files = await fs_extra_1.default.readdir(commandsDir);
|
|
67
|
+
result.skills = files
|
|
68
|
+
.filter(f => f.endsWith('.md'))
|
|
69
|
+
.map(f => f.replace('.md', ''));
|
|
60
70
|
}
|
|
61
71
|
return result;
|
|
62
72
|
}
|
|
@@ -85,6 +95,13 @@ async function listTemplates() {
|
|
|
85
95
|
else {
|
|
86
96
|
console.log(' (none found)');
|
|
87
97
|
}
|
|
98
|
+
console.log(chalk_1.default.cyan('\nSkills (Slash Commands):'));
|
|
99
|
+
if (templates.skills.length > 0) {
|
|
100
|
+
templates.skills.forEach(s => console.log(` - /${s}`));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
console.log(' (none found)');
|
|
104
|
+
}
|
|
88
105
|
console.log('');
|
|
89
106
|
}
|
|
90
107
|
// Copy helper
|
|
@@ -137,8 +154,8 @@ async function installStandards(names, force) {
|
|
|
137
154
|
const normalized = name.toLowerCase().trim();
|
|
138
155
|
const matched = templates.standards.find(s => s.toLowerCase() === normalized);
|
|
139
156
|
if (matched) {
|
|
140
|
-
const src = path_1.default.join(templateSource, 'templates/standards', `${matched}.
|
|
141
|
-
const dest = path_1.default.join('docs/ai/standards', `${matched}.
|
|
157
|
+
const src = path_1.default.join(templateSource, 'templates/standards', `${matched}.md`);
|
|
158
|
+
const dest = path_1.default.join('docs/ai/standards', `${matched}.md`);
|
|
142
159
|
if (await copyFile(src, dest, force)) {
|
|
143
160
|
installed++;
|
|
144
161
|
}
|
|
@@ -158,8 +175,8 @@ async function installTools(names, force) {
|
|
|
158
175
|
const normalized = name.toLowerCase().trim();
|
|
159
176
|
const matched = templates.tools.find(t => t.toLowerCase() === normalized);
|
|
160
177
|
if (matched) {
|
|
161
|
-
const src = path_1.default.join(templateSource, 'tools', `${matched}.
|
|
162
|
-
const dest = path_1.default.join('docs/ai/.contextuate/tools', `${matched}.
|
|
178
|
+
const src = path_1.default.join(templateSource, 'tools', `${matched}.md`);
|
|
179
|
+
const dest = path_1.default.join('docs/ai/.contextuate/tools', `${matched}.md`);
|
|
163
180
|
if (await copyFile(src, dest, force)) {
|
|
164
181
|
installed++;
|
|
165
182
|
}
|
|
@@ -170,6 +187,28 @@ async function installTools(names, force) {
|
|
|
170
187
|
}
|
|
171
188
|
return installed;
|
|
172
189
|
}
|
|
190
|
+
// Install skills (slash commands)
|
|
191
|
+
// Skills are installed directly to docs/ai/commands/ for Claude Code
|
|
192
|
+
async function installSkills(names, force) {
|
|
193
|
+
const templateSource = getTemplateSource();
|
|
194
|
+
const templates = await discoverTemplates();
|
|
195
|
+
let installed = 0;
|
|
196
|
+
for (const name of names) {
|
|
197
|
+
const normalized = name.toLowerCase().trim().replace(/^\//, ''); // Remove leading slash if present
|
|
198
|
+
const matched = templates.skills.find(s => s.toLowerCase() === normalized);
|
|
199
|
+
if (matched) {
|
|
200
|
+
const src = path_1.default.join(templateSource, 'commands', `${matched}.md`);
|
|
201
|
+
const dest = path_1.default.join('docs/ai/commands', `${matched}.md`);
|
|
202
|
+
if (await copyFile(src, dest, force)) {
|
|
203
|
+
installed++;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
console.log(chalk_1.default.yellow(`[WARN] Skill "${name}" not found. Use --list to see available skills.`));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return installed;
|
|
211
|
+
}
|
|
173
212
|
// Subcommand handlers
|
|
174
213
|
async function installAgentsCommand(names, options) {
|
|
175
214
|
const templates = await discoverTemplates();
|
|
@@ -182,8 +221,14 @@ async function installAgentsCommand(names, options) {
|
|
|
182
221
|
return;
|
|
183
222
|
}
|
|
184
223
|
console.log(chalk_1.default.blue('\n[INFO] Installing agents...\n'));
|
|
185
|
-
const
|
|
186
|
-
|
|
224
|
+
const agentCount = await installAgents(agentsToInstall, options.force || false);
|
|
225
|
+
// By default, also install skills when installing agents (unless explicitly disabled)
|
|
226
|
+
let skillCount = 0;
|
|
227
|
+
if (options.includeSkills !== false && templates.skills.length > 0) {
|
|
228
|
+
console.log(chalk_1.default.blue('\n[INFO] Installing skills (slash commands)...\n'));
|
|
229
|
+
skillCount = await installSkills(templates.skills, options.force || false);
|
|
230
|
+
}
|
|
231
|
+
console.log(chalk_1.default.green(`\n[OK] Installed ${agentCount} agent(s) and ${skillCount} skill(s)\n`));
|
|
187
232
|
}
|
|
188
233
|
async function installStandardsCommand(names, options) {
|
|
189
234
|
const templates = await discoverTemplates();
|
|
@@ -213,6 +258,20 @@ async function installToolsCommand(names, options) {
|
|
|
213
258
|
const count = await installTools(toolsToInstall, options.force || false);
|
|
214
259
|
console.log(chalk_1.default.green(`\n[OK] Installed ${count} tool(s)\n`));
|
|
215
260
|
}
|
|
261
|
+
async function installSkillsCommand(names, options) {
|
|
262
|
+
const templates = await discoverTemplates();
|
|
263
|
+
const useAll = options.all || names.includes('all');
|
|
264
|
+
const skillsToInstall = useAll ? templates.skills : names;
|
|
265
|
+
if (skillsToInstall.length === 0) {
|
|
266
|
+
console.log(chalk_1.default.yellow('No skills specified. Use "all" or provide skill names.'));
|
|
267
|
+
console.log(chalk_1.default.gray('Available skills:'));
|
|
268
|
+
templates.skills.forEach(s => console.log(` - /${s}`));
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
console.log(chalk_1.default.blue('\n[INFO] Installing skills (slash commands)...\n'));
|
|
272
|
+
const count = await installSkills(skillsToInstall, options.force || false);
|
|
273
|
+
console.log(chalk_1.default.green(`\n[OK] Installed ${count} skill(s)\n`));
|
|
274
|
+
}
|
|
216
275
|
// Main install command (flag style or interactive)
|
|
217
276
|
async function installCommand(options) {
|
|
218
277
|
// Handle --list flag
|
|
@@ -223,7 +282,7 @@ async function installCommand(options) {
|
|
|
223
282
|
const templates = await discoverTemplates();
|
|
224
283
|
const force = options.force || false;
|
|
225
284
|
// Check if any flags were provided
|
|
226
|
-
const hasFlags = options.agents || options.standards || options.tools || options.all;
|
|
285
|
+
const hasFlags = options.agents || options.standards || options.tools || options.skills || options.all;
|
|
227
286
|
if (!hasFlags) {
|
|
228
287
|
// Interactive mode
|
|
229
288
|
try {
|
|
@@ -234,6 +293,7 @@ async function installCommand(options) {
|
|
|
234
293
|
message: 'What would you like to install?',
|
|
235
294
|
choices: [
|
|
236
295
|
{ name: 'Agents (AI persona definitions)', value: 'agents' },
|
|
296
|
+
{ name: 'Skills (Slash commands like /orchestrate)', value: 'skills' },
|
|
237
297
|
{ name: 'Language Standards (coding guidelines)', value: 'standards' },
|
|
238
298
|
{ name: 'Tools (AI tool guides)', value: 'tools' },
|
|
239
299
|
],
|
|
@@ -248,6 +308,7 @@ async function installCommand(options) {
|
|
|
248
308
|
let selectedAgents = [];
|
|
249
309
|
let selectedStandards = [];
|
|
250
310
|
let selectedTools = [];
|
|
311
|
+
let selectedSkills = [];
|
|
251
312
|
if (categories.includes('agents') && templates.agents.length > 0) {
|
|
252
313
|
const { agents } = await inquirer_1.default.prompt([
|
|
253
314
|
{
|
|
@@ -302,6 +363,24 @@ async function installCommand(options) {
|
|
|
302
363
|
]);
|
|
303
364
|
selectedTools = tools.includes('__all__') ? templates.tools : tools;
|
|
304
365
|
}
|
|
366
|
+
if (categories.includes('skills') && templates.skills.length > 0) {
|
|
367
|
+
const { skills } = await inquirer_1.default.prompt([
|
|
368
|
+
{
|
|
369
|
+
type: 'checkbox',
|
|
370
|
+
name: 'skills',
|
|
371
|
+
message: 'Select skills (slash commands) to install:',
|
|
372
|
+
choices: [
|
|
373
|
+
{ name: 'Select All', value: '__all__' },
|
|
374
|
+
new inquirer_1.default.Separator(),
|
|
375
|
+
...templates.skills.map(s => ({
|
|
376
|
+
name: `/${s}`,
|
|
377
|
+
value: s,
|
|
378
|
+
})),
|
|
379
|
+
],
|
|
380
|
+
},
|
|
381
|
+
]);
|
|
382
|
+
selectedSkills = skills.includes('__all__') ? templates.skills : skills;
|
|
383
|
+
}
|
|
305
384
|
// Install selected items
|
|
306
385
|
let totalInstalled = 0;
|
|
307
386
|
if (selectedAgents.length > 0) {
|
|
@@ -316,6 +395,10 @@ async function installCommand(options) {
|
|
|
316
395
|
console.log(chalk_1.default.blue('\n[INFO] Installing tools...'));
|
|
317
396
|
totalInstalled += await installTools(selectedTools, force);
|
|
318
397
|
}
|
|
398
|
+
if (selectedSkills.length > 0) {
|
|
399
|
+
console.log(chalk_1.default.blue('\n[INFO] Installing skills...'));
|
|
400
|
+
totalInstalled += await installSkills(selectedSkills, force);
|
|
401
|
+
}
|
|
319
402
|
console.log(chalk_1.default.green(`\n[OK] Installation complete. ${totalInstalled} file(s) installed.\n`));
|
|
320
403
|
}
|
|
321
404
|
catch (error) {
|
|
@@ -335,6 +418,7 @@ async function installCommand(options) {
|
|
|
335
418
|
totalInstalled += await installAgents(templates.agents, force);
|
|
336
419
|
totalInstalled += await installStandards(templates.standards, force);
|
|
337
420
|
totalInstalled += await installTools(templates.tools, force);
|
|
421
|
+
totalInstalled += await installSkills(templates.skills, force);
|
|
338
422
|
}
|
|
339
423
|
else {
|
|
340
424
|
// Handle individual flags
|
|
@@ -353,6 +437,11 @@ async function installCommand(options) {
|
|
|
353
437
|
console.log(chalk_1.default.blue('\n[INFO] Installing tools...'));
|
|
354
438
|
totalInstalled += await installTools(toolsToInstall, force);
|
|
355
439
|
}
|
|
440
|
+
if (options.skills && options.skills.length > 0) {
|
|
441
|
+
const skillsToInstall = options.skills.includes('all') ? templates.skills : options.skills;
|
|
442
|
+
console.log(chalk_1.default.blue('\n[INFO] Installing skills...'));
|
|
443
|
+
totalInstalled += await installSkills(skillsToInstall, force);
|
|
444
|
+
}
|
|
356
445
|
}
|
|
357
446
|
console.log(chalk_1.default.green(`\n[OK] Installation complete. ${totalInstalled} file(s) installed.\n`));
|
|
358
447
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Monitor Command
|
|
3
|
+
*
|
|
4
|
+
* CLI commands for the Contextuate Monitor feature.
|
|
5
|
+
* - contextuate monitor init: Interactive setup
|
|
6
|
+
* - contextuate monitor [start]: Start the monitor server
|
|
7
|
+
* - contextuate monitor status: Show server status
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Initialize monitor command
|
|
11
|
+
*/
|
|
12
|
+
export declare function monitorInitCommand(options?: {
|
|
13
|
+
global?: boolean;
|
|
14
|
+
project?: boolean;
|
|
15
|
+
}): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Start monitor server command
|
|
18
|
+
*/
|
|
19
|
+
export declare function monitorStartCommand(options: {
|
|
20
|
+
port?: number;
|
|
21
|
+
wsPort?: number;
|
|
22
|
+
noOpen?: boolean;
|
|
23
|
+
foreground?: boolean;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Stop monitor server command
|
|
27
|
+
*/
|
|
28
|
+
export declare function monitorStopCommand(options: {
|
|
29
|
+
all?: boolean;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Show monitor status command
|
|
33
|
+
*/
|
|
34
|
+
export declare function monitorStatusCommand(): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Start daemon command
|
|
37
|
+
*/
|
|
38
|
+
export declare function monitorDaemonStartCommand(options: {
|
|
39
|
+
detach?: boolean;
|
|
40
|
+
}): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Stop daemon command
|
|
43
|
+
*/
|
|
44
|
+
export declare function monitorDaemonStopCommand(): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Show daemon status command
|
|
47
|
+
*/
|
|
48
|
+
export declare function monitorDaemonStatusCommand(): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* View daemon logs command
|
|
51
|
+
*/
|
|
52
|
+
export declare function monitorDaemonLogsCommand(options: {
|
|
53
|
+
follow?: boolean;
|
|
54
|
+
lines?: number;
|
|
55
|
+
}): Promise<void>;
|