@ekkos/cli 0.2.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/dist/cache/LocalSessionStore.d.ts +129 -0
- package/dist/cache/LocalSessionStore.js +688 -0
- package/dist/cache/capture.d.ts +26 -0
- package/dist/cache/capture.js +461 -0
- package/dist/cache/index.d.ts +7 -0
- package/dist/cache/index.js +23 -0
- package/dist/cache/types.d.ts +147 -0
- package/dist/cache/types.js +40 -0
- package/dist/commands/init.d.ts +9 -0
- package/dist/commands/init.js +478 -0
- package/dist/commands/run.d.ts +12 -0
- package/dist/commands/run.js +829 -0
- package/dist/commands/setup.d.ts +6 -0
- package/dist/commands/setup.js +658 -0
- package/dist/commands/status.d.ts +1 -0
- package/dist/commands/status.js +109 -0
- package/dist/commands/test.d.ts +1 -0
- package/dist/commands/test.js +157 -0
- package/dist/deploy/agents.d.ts +15 -0
- package/dist/deploy/agents.js +72 -0
- package/dist/deploy/hooks.d.ts +16 -0
- package/dist/deploy/hooks.js +121 -0
- package/dist/deploy/index.d.ts +7 -0
- package/dist/deploy/index.js +24 -0
- package/dist/deploy/instructions.d.ts +12 -0
- package/dist/deploy/instructions.js +36 -0
- package/dist/deploy/mcp.d.ts +19 -0
- package/dist/deploy/mcp.js +109 -0
- package/dist/deploy/plugins.d.ts +19 -0
- package/dist/deploy/plugins.js +62 -0
- package/dist/deploy/settings.d.ts +8 -0
- package/dist/deploy/settings.js +84 -0
- package/dist/deploy/skills.d.ts +19 -0
- package/dist/deploy/skills.js +60 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +71 -0
- package/dist/restore/RestoreOrchestrator.d.ts +48 -0
- package/dist/restore/RestoreOrchestrator.js +481 -0
- package/dist/restore/index.d.ts +4 -0
- package/dist/restore/index.js +20 -0
- package/dist/utils/platform.d.ts +29 -0
- package/dist/utils/platform.js +65 -0
- package/dist/utils/session-words.json +119 -0
- package/dist/utils/state.d.ts +57 -0
- package/dist/utils/state.js +186 -0
- package/dist/utils/templates.d.ts +24 -0
- package/dist/utils/templates.js +118 -0
- package/package.json +48 -0
- package/templates/CLAUDE.md +287 -0
- package/templates/README.md +378 -0
- package/templates/agents/README.md +182 -0
- package/templates/agents/code-reviewer.md +166 -0
- package/templates/agents/debug-detective.md +169 -0
- package/templates/agents/ekkOS_Vercel.md +99 -0
- package/templates/agents/extension-manager.md +229 -0
- package/templates/agents/git-companion.md +185 -0
- package/templates/agents/github-test-agent.md +321 -0
- package/templates/agents/railway-manager.md +179 -0
- package/templates/claude-plugins/PHASE2_COMPLETION.md +346 -0
- package/templates/claude-plugins/PLUGIN_PROPOSALS.md +1776 -0
- package/templates/claude-plugins/README.md +587 -0
- package/templates/claude-plugins/agents/code-reviewer.json +14 -0
- package/templates/claude-plugins/agents/debug-detective.json +15 -0
- package/templates/claude-plugins/agents/git-companion.json +14 -0
- package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/blog-manager/commands/blog.md +691 -0
- package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +434 -0
- package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +282 -0
- package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/memory-lens/commands/memory-search.md +181 -0
- package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/pattern-coach/commands/forge.md +365 -0
- package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +582 -0
- package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +819 -0
- package/templates/claude-plugins-admin/README.md +446 -0
- package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +595 -0
- package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/backend-agent/commands/backend.md +798 -0
- package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +554 -0
- package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +881 -0
- package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +85 -0
- package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +569 -0
- package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/qa-agent/commands/qa.md +863 -0
- package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +8 -0
- package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +732 -0
- package/templates/commands/continue.md +47 -0
- package/templates/cursor-hooks/after-agent-response.sh +117 -0
- package/templates/cursor-hooks/before-submit-prompt.sh +419 -0
- package/templates/cursor-hooks/hooks.json +20 -0
- package/templates/cursor-hooks/lib/contract.sh +320 -0
- package/templates/cursor-hooks/stop.sh +75 -0
- package/templates/cursor-rules/ekkos-memory.md +187 -0
- package/templates/hooks/assistant-response.sh +96 -0
- package/templates/hooks/hooks.json +28 -0
- package/templates/hooks/lib/contract.sh +320 -0
- package/templates/hooks/lib/state.sh +158 -0
- package/templates/hooks/session-start.ps1 +41 -0
- package/templates/hooks/session-start.sh +318 -0
- package/templates/hooks/stop.ps1 +16 -0
- package/templates/hooks/stop.sh +989 -0
- package/templates/hooks/user-prompt-submit.ps1 +174 -0
- package/templates/hooks/user-prompt-submit.sh +587 -0
- package/templates/hooks-node/lib/state.js +187 -0
- package/templates/hooks-node/stop.js +416 -0
- package/templates/hooks-node/user-prompt-submit.js +337 -0
- package/templates/plan-template.md +306 -0
- package/templates/rules/00-hooks-contract.mdc +89 -0
- package/templates/rules/30-ekkos-core.mdc +188 -0
- package/templates/rules/31-ekkos-messages.mdc +78 -0
- package/templates/skills/continue/SKILL.md +169 -0
- package/templates/skills/ekkOS_Deep_Recall/Skill.md +282 -0
- package/templates/skills/ekkOS_Learn/Skill.md +265 -0
- package/templates/skills/ekkOS_Memory_First/Skill.md +206 -0
- package/templates/skills/ekkOS_Plan_Assist/Skill.md +302 -0
- package/templates/skills/ekkOS_Preferences/Skill.md +247 -0
- package/templates/skills/ekkOS_Reflect/Skill.md +257 -0
- package/templates/skills/ekkOS_Safety/Skill.md +265 -0
- package/templates/skills/ekkOS_Schema/Skill.md +251 -0
- package/templates/skills/ekkOS_Summary/Skill.md +257 -0
- package/templates/skills/ekkOS_Vault/Skill.md +287 -0
- package/templates/skills/permissions/Skill.md +322 -0
- package/templates/spec-template.md +159 -0
- package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
- package/templates/windsurf-hooks/hooks.json +10 -0
- package/templates/windsurf-hooks/lib/contract.sh +320 -0
- package/templates/windsurf-rules/ekkos-memory.md +129 -0
|
@@ -0,0 +1,109 @@
|
|
|
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.status = status;
|
|
7
|
+
const os_1 = require("os");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const ora_1 = __importDefault(require("ora"));
|
|
12
|
+
const EKKOS_API_URL = 'https://mcp.ekkos.dev';
|
|
13
|
+
const CONFIG_FILE = (0, path_1.join)((0, os_1.homedir)(), '.ekkos', 'config.json');
|
|
14
|
+
async function status() {
|
|
15
|
+
console.log('');
|
|
16
|
+
console.log(chalk_1.default.cyan.bold('📊 ekkOS Memory Status'));
|
|
17
|
+
console.log(chalk_1.default.gray('─'.repeat(50)));
|
|
18
|
+
console.log('');
|
|
19
|
+
// Check config exists
|
|
20
|
+
if (!(0, fs_1.existsSync)(CONFIG_FILE)) {
|
|
21
|
+
console.log(chalk_1.default.red('✗ Not configured'));
|
|
22
|
+
console.log(chalk_1.default.gray(' Run: npx @ekkos/cli setup'));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
let config;
|
|
26
|
+
try {
|
|
27
|
+
config = JSON.parse((0, fs_1.readFileSync)(CONFIG_FILE, 'utf-8'));
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
console.log(chalk_1.default.red('✗ Invalid configuration'));
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
const apiKey = config.apiKey || process.env.EKKOS_API_KEY;
|
|
34
|
+
if (!apiKey) {
|
|
35
|
+
console.log(chalk_1.default.red('✗ No API key'));
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
const spinner = (0, ora_1.default)('Fetching memory stats...').start();
|
|
39
|
+
try {
|
|
40
|
+
// Get pattern stats
|
|
41
|
+
const patternsResponse = await fetch(`${EKKOS_API_URL}/api/v1/patterns/query`, {
|
|
42
|
+
method: 'POST',
|
|
43
|
+
headers: {
|
|
44
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
45
|
+
'Content-Type': 'application/json'
|
|
46
|
+
},
|
|
47
|
+
body: JSON.stringify({ query: '', k: 100 })
|
|
48
|
+
});
|
|
49
|
+
let patternCount = 0;
|
|
50
|
+
let avgSuccessRate = 0;
|
|
51
|
+
let totalApplications = 0;
|
|
52
|
+
if (patternsResponse.ok) {
|
|
53
|
+
const data = await patternsResponse.json();
|
|
54
|
+
const patterns = data.patterns || [];
|
|
55
|
+
patternCount = patterns.length;
|
|
56
|
+
if (patterns.length > 0) {
|
|
57
|
+
const rates = patterns.map((p) => p.success_rate || 0.5);
|
|
58
|
+
avgSuccessRate = rates.reduce((a, b) => a + b, 0) / rates.length;
|
|
59
|
+
totalApplications = patterns.reduce((sum, p) => sum + (p.applied_count || 0), 0);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
spinner.stop();
|
|
63
|
+
// Display stats
|
|
64
|
+
console.log(chalk_1.default.cyan('Patterns:'));
|
|
65
|
+
console.log(` Total: ${chalk_1.default.bold(patternCount)}`);
|
|
66
|
+
console.log(` Success Rate: ${chalk_1.default.bold((avgSuccessRate * 100).toFixed(1) + '%')}`);
|
|
67
|
+
console.log(` Applications: ${chalk_1.default.bold(totalApplications)}`);
|
|
68
|
+
console.log('');
|
|
69
|
+
// IDE status
|
|
70
|
+
console.log(chalk_1.default.cyan('Connected IDEs:'));
|
|
71
|
+
const ides = config.installedIDEs || [];
|
|
72
|
+
if (ides.length === 0) {
|
|
73
|
+
console.log(chalk_1.default.gray(' No IDEs configured'));
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
for (const ide of ides) {
|
|
77
|
+
console.log(chalk_1.default.green(` ✓ ${ide}`));
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
console.log('');
|
|
81
|
+
// Config info
|
|
82
|
+
console.log(chalk_1.default.cyan('Configuration:'));
|
|
83
|
+
console.log(` Config File: ${chalk_1.default.gray(CONFIG_FILE)}`);
|
|
84
|
+
console.log(` Installed: ${chalk_1.default.gray(config.installedAt || 'Unknown')}`);
|
|
85
|
+
console.log(` API Key: ${chalk_1.default.gray(apiKey.substring(0, 10) + '...')}`);
|
|
86
|
+
console.log('');
|
|
87
|
+
// Golden Loop status
|
|
88
|
+
console.log(chalk_1.default.cyan('Golden Loop:'));
|
|
89
|
+
const loopActive = patternCount > 0 || totalApplications > 0;
|
|
90
|
+
if (loopActive) {
|
|
91
|
+
console.log(chalk_1.default.green(' ✓ ACTIVE - Memory system learning'));
|
|
92
|
+
console.log(chalk_1.default.gray(' RETRIEVE → INJECT → APPLY → CAPTURE → MEASURE'));
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
console.log(chalk_1.default.yellow(' ○ INITIALIZING - Start coding to build memory'));
|
|
96
|
+
}
|
|
97
|
+
console.log('');
|
|
98
|
+
// Footer
|
|
99
|
+
console.log(chalk_1.default.gray('─'.repeat(50)));
|
|
100
|
+
console.log('');
|
|
101
|
+
console.log(`Dashboard: ${chalk_1.default.cyan('https://ekkos.dev/dashboard')}`);
|
|
102
|
+
console.log('');
|
|
103
|
+
}
|
|
104
|
+
catch (error) {
|
|
105
|
+
spinner.fail('Failed to fetch stats');
|
|
106
|
+
console.log(chalk_1.default.red(`Error: ${error}`));
|
|
107
|
+
process.exit(1);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function test(): Promise<void>;
|
|
@@ -0,0 +1,157 @@
|
|
|
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.test = test;
|
|
7
|
+
const os_1 = require("os");
|
|
8
|
+
const path_1 = require("path");
|
|
9
|
+
const fs_1 = require("fs");
|
|
10
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
11
|
+
const ora_1 = __importDefault(require("ora"));
|
|
12
|
+
const EKKOS_API_URL = 'https://mcp.ekkos.dev';
|
|
13
|
+
const CONFIG_FILE = (0, path_1.join)((0, os_1.homedir)(), '.ekkos', 'config.json');
|
|
14
|
+
async function test() {
|
|
15
|
+
console.log('');
|
|
16
|
+
console.log(chalk_1.default.cyan.bold('🧪 ekkOS Connection Test'));
|
|
17
|
+
console.log(chalk_1.default.gray('─'.repeat(50)));
|
|
18
|
+
console.log('');
|
|
19
|
+
// Check config exists
|
|
20
|
+
if (!(0, fs_1.existsSync)(CONFIG_FILE)) {
|
|
21
|
+
console.log(chalk_1.default.red('✗ No configuration found'));
|
|
22
|
+
console.log(chalk_1.default.gray(' Run: npx @ekkos/cli setup'));
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
let config;
|
|
26
|
+
try {
|
|
27
|
+
config = JSON.parse((0, fs_1.readFileSync)(CONFIG_FILE, 'utf-8'));
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
console.log(chalk_1.default.red('✗ Invalid configuration file'));
|
|
31
|
+
console.log(chalk_1.default.gray(' Run: npx @ekkos/cli setup'));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
const apiKey = config.apiKey || process.env.EKKOS_API_KEY;
|
|
35
|
+
if (!apiKey) {
|
|
36
|
+
console.log(chalk_1.default.red('✗ No API key found'));
|
|
37
|
+
console.log(chalk_1.default.gray(' Run: npx @ekkos/cli setup'));
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
// Test 1: API Connection
|
|
41
|
+
const spinner1 = (0, ora_1.default)('Testing API connection...').start();
|
|
42
|
+
try {
|
|
43
|
+
const response = await fetch(`${EKKOS_API_URL}/health`, {
|
|
44
|
+
method: 'GET',
|
|
45
|
+
headers: {
|
|
46
|
+
'Authorization': `Bearer ${apiKey}`
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
if (response.ok) {
|
|
50
|
+
spinner1.succeed('API connection OK');
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
spinner1.fail(`API returned ${response.status}`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
spinner1.fail('Cannot reach ekkOS API');
|
|
58
|
+
console.log(chalk_1.default.gray(` Error: ${error}`));
|
|
59
|
+
}
|
|
60
|
+
// Test 2: Pattern Query
|
|
61
|
+
const spinner2 = (0, ora_1.default)('Testing pattern retrieval...').start();
|
|
62
|
+
try {
|
|
63
|
+
const response = await fetch(`${EKKOS_API_URL}/api/v1/patterns/query`, {
|
|
64
|
+
method: 'POST',
|
|
65
|
+
headers: {
|
|
66
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
67
|
+
'Content-Type': 'application/json'
|
|
68
|
+
},
|
|
69
|
+
body: JSON.stringify({ query: 'test connection', k: 1 })
|
|
70
|
+
});
|
|
71
|
+
if (response.ok) {
|
|
72
|
+
const data = await response.json();
|
|
73
|
+
const count = data.patterns?.length || 0;
|
|
74
|
+
spinner2.succeed(`Pattern query OK (${count} result${count !== 1 ? 's' : ''})`);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
spinner2.fail(`Pattern query failed: ${response.status}`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
spinner2.fail('Pattern query failed');
|
|
82
|
+
console.log(chalk_1.default.gray(` Error: ${error}`));
|
|
83
|
+
}
|
|
84
|
+
// Test 3: Memory Capture Endpoint
|
|
85
|
+
const spinner3 = (0, ora_1.default)('Testing memory capture...').start();
|
|
86
|
+
try {
|
|
87
|
+
const response = await fetch(`${EKKOS_API_URL}/api/v1/memory/capture`, {
|
|
88
|
+
method: 'POST',
|
|
89
|
+
headers: {
|
|
90
|
+
'Authorization': `Bearer ${apiKey}`,
|
|
91
|
+
'Content-Type': 'application/json'
|
|
92
|
+
},
|
|
93
|
+
body: JSON.stringify({
|
|
94
|
+
user_query: 'CLI test query',
|
|
95
|
+
assistant_response: 'CLI test response',
|
|
96
|
+
session_id: `cli-test-${Date.now()}`,
|
|
97
|
+
patterns_used: [],
|
|
98
|
+
success_rating: 5,
|
|
99
|
+
metadata: { source: 'cli-test', dry_run: true }
|
|
100
|
+
})
|
|
101
|
+
});
|
|
102
|
+
if (response.ok || response.status === 201) {
|
|
103
|
+
spinner3.succeed('Memory capture endpoint OK');
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
spinner3.warn(`Memory capture returned ${response.status}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
spinner3.warn('Memory capture test skipped');
|
|
111
|
+
}
|
|
112
|
+
// Test 4: Check IDE Configurations
|
|
113
|
+
console.log('');
|
|
114
|
+
console.log(chalk_1.default.cyan('IDE Configurations:'));
|
|
115
|
+
const ides = [
|
|
116
|
+
{ name: 'Claude Code', check: () => (0, fs_1.existsSync)((0, path_1.join)((0, os_1.homedir)(), '.claude', 'hooks', 'user-prompt-submit.sh')) || (0, fs_1.existsSync)((0, path_1.join)((0, os_1.homedir)(), '.claude', 'hooks', 'user-prompt-submit.ps1')) },
|
|
117
|
+
{ name: 'Cursor', check: () => {
|
|
118
|
+
const mcpPath = (0, path_1.join)((0, os_1.homedir)(), '.cursor', 'mcp.json');
|
|
119
|
+
if (!(0, fs_1.existsSync)(mcpPath))
|
|
120
|
+
return false;
|
|
121
|
+
try {
|
|
122
|
+
const mcp = JSON.parse((0, fs_1.readFileSync)(mcpPath, 'utf-8'));
|
|
123
|
+
return !!mcp.mcpServers?.['ekkos-memory'];
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
} },
|
|
129
|
+
{ name: 'Windsurf', check: () => {
|
|
130
|
+
const mcpPath = (0, path_1.join)((0, os_1.homedir)(), '.codeium', 'windsurf', 'mcp_config.json');
|
|
131
|
+
if (!(0, fs_1.existsSync)(mcpPath))
|
|
132
|
+
return false;
|
|
133
|
+
try {
|
|
134
|
+
const mcp = JSON.parse((0, fs_1.readFileSync)(mcpPath, 'utf-8'));
|
|
135
|
+
return !!mcp.mcpServers?.['ekkos-memory'];
|
|
136
|
+
}
|
|
137
|
+
catch {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
} },
|
|
141
|
+
{ name: 'VSCode', check: () => (0, fs_1.existsSync)((0, path_1.join)((0, os_1.homedir)(), '.vscode', 'ekkos.json')) }
|
|
142
|
+
];
|
|
143
|
+
for (const ide of ides) {
|
|
144
|
+
const configured = ide.check();
|
|
145
|
+
if (configured) {
|
|
146
|
+
console.log(chalk_1.default.green(` ✓ ${ide.name}`));
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
console.log(chalk_1.default.gray(` - ${ide.name} (not configured)`));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
console.log('');
|
|
153
|
+
console.log(chalk_1.default.gray('─'.repeat(50)));
|
|
154
|
+
console.log('');
|
|
155
|
+
console.log(chalk_1.default.green('Connection test complete!'));
|
|
156
|
+
console.log('');
|
|
157
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deploy all agents to ~/.claude/agents/
|
|
3
|
+
*/
|
|
4
|
+
export declare function deployAgents(): {
|
|
5
|
+
count: number;
|
|
6
|
+
agents: string[];
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Check if agents are deployed
|
|
10
|
+
*/
|
|
11
|
+
export declare function areAgentsDeployed(): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Count deployed agents
|
|
14
|
+
*/
|
|
15
|
+
export declare function countDeployedAgents(): number;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployAgents = deployAgents;
|
|
4
|
+
exports.areAgentsDeployed = areAgentsDeployed;
|
|
5
|
+
exports.countDeployedAgents = countDeployedAgents;
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const platform_1 = require("../utils/platform");
|
|
8
|
+
const templates_1 = require("../utils/templates");
|
|
9
|
+
const fs_2 = require("fs");
|
|
10
|
+
const path_1 = require("path");
|
|
11
|
+
/**
|
|
12
|
+
* Deploy all agents to ~/.claude/agents/
|
|
13
|
+
*/
|
|
14
|
+
function deployAgents() {
|
|
15
|
+
// Create agents directory
|
|
16
|
+
if (!(0, fs_1.existsSync)(platform_1.CLAUDE_AGENTS_DIR)) {
|
|
17
|
+
(0, fs_1.mkdirSync)(platform_1.CLAUDE_AGENTS_DIR, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
const deployedAgents = [];
|
|
20
|
+
const agentsPath = (0, templates_1.getTemplatePath)('agents');
|
|
21
|
+
if (!(0, fs_1.existsSync)(agentsPath)) {
|
|
22
|
+
return { count: 0, agents: [] };
|
|
23
|
+
}
|
|
24
|
+
// Agents are .md files in the templates/agents/ directory
|
|
25
|
+
const entries = (0, fs_1.readdirSync)(agentsPath);
|
|
26
|
+
for (const entry of entries) {
|
|
27
|
+
// Skip hidden files
|
|
28
|
+
if (entry.startsWith('.'))
|
|
29
|
+
continue;
|
|
30
|
+
const sourcePath = (0, path_1.join)(agentsPath, entry);
|
|
31
|
+
const destPath = (0, path_1.join)(platform_1.CLAUDE_AGENTS_DIR, entry);
|
|
32
|
+
const stat = (0, fs_2.statSync)(sourcePath);
|
|
33
|
+
try {
|
|
34
|
+
if (stat.isFile() && (entry.endsWith('.md') || entry.endsWith('.json'))) {
|
|
35
|
+
(0, fs_2.copyFileSync)(sourcePath, destPath);
|
|
36
|
+
deployedAgents.push(entry.replace(/\.(md|json)$/, ''));
|
|
37
|
+
}
|
|
38
|
+
else if (stat.isDirectory()) {
|
|
39
|
+
// Copy directory-based agents
|
|
40
|
+
(0, templates_1.copyTemplateDir)(`agents/${entry}`, destPath);
|
|
41
|
+
deployedAgents.push(entry);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.warn(`Warning: Could not deploy agent ${entry}`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
count: deployedAgents.length,
|
|
50
|
+
agents: deployedAgents
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Check if agents are deployed
|
|
55
|
+
*/
|
|
56
|
+
function areAgentsDeployed() {
|
|
57
|
+
if (!(0, fs_1.existsSync)(platform_1.CLAUDE_AGENTS_DIR))
|
|
58
|
+
return false;
|
|
59
|
+
const deployed = (0, fs_1.readdirSync)(platform_1.CLAUDE_AGENTS_DIR);
|
|
60
|
+
return deployed.filter(f => f.endsWith('.md') || f.endsWith('.json')).length >= 3;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Count deployed agents
|
|
64
|
+
*/
|
|
65
|
+
function countDeployedAgents() {
|
|
66
|
+
if (!(0, fs_1.existsSync)(platform_1.CLAUDE_AGENTS_DIR))
|
|
67
|
+
return 0;
|
|
68
|
+
return (0, fs_1.readdirSync)(platform_1.CLAUDE_AGENTS_DIR)
|
|
69
|
+
.filter(entry => !entry.startsWith('.'))
|
|
70
|
+
.filter(entry => entry.endsWith('.md') || entry.endsWith('.json'))
|
|
71
|
+
.length;
|
|
72
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deploy all hook scripts to ~/.claude/hooks/
|
|
3
|
+
* Deploys .sh scripts on Unix, .ps1 scripts on Windows
|
|
4
|
+
*/
|
|
5
|
+
export declare function deployHooks(apiKey: string): {
|
|
6
|
+
count: number;
|
|
7
|
+
files: string[];
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Check if hooks are deployed
|
|
11
|
+
*/
|
|
12
|
+
export declare function areHooksDeployed(): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Count deployed hook files
|
|
15
|
+
*/
|
|
16
|
+
export declare function countDeployedHooks(): number;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployHooks = deployHooks;
|
|
4
|
+
exports.areHooksDeployed = areHooksDeployed;
|
|
5
|
+
exports.countDeployedHooks = countDeployedHooks;
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
const platform_1 = require("../utils/platform");
|
|
9
|
+
const templates_1 = require("../utils/templates");
|
|
10
|
+
/**
|
|
11
|
+
* Deploy all hook scripts to ~/.claude/hooks/
|
|
12
|
+
* Deploys .sh scripts on Unix, .ps1 scripts on Windows
|
|
13
|
+
*/
|
|
14
|
+
function deployHooks(apiKey) {
|
|
15
|
+
// Create directories
|
|
16
|
+
if (!(0, fs_1.existsSync)(platform_1.CLAUDE_HOOKS_DIR)) {
|
|
17
|
+
(0, fs_1.mkdirSync)(platform_1.CLAUDE_HOOKS_DIR, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
if (!(0, fs_1.existsSync)(platform_1.CLAUDE_STATE_DIR)) {
|
|
20
|
+
(0, fs_1.mkdirSync)(platform_1.CLAUDE_STATE_DIR, { recursive: true });
|
|
21
|
+
}
|
|
22
|
+
// Create lib directory
|
|
23
|
+
const libDir = (0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'lib');
|
|
24
|
+
if (!(0, fs_1.existsSync)(libDir)) {
|
|
25
|
+
(0, fs_1.mkdirSync)(libDir, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
const deployedFiles = [];
|
|
28
|
+
// Transform function to inject API key
|
|
29
|
+
const transformHook = (content) => {
|
|
30
|
+
// Replace placeholder API key with actual key (works for both bash and PowerShell)
|
|
31
|
+
return content
|
|
32
|
+
.replace(/EKKOS_API_KEY="[^"]*"/g, `EKKOS_API_KEY="${apiKey}"`)
|
|
33
|
+
.replace(/\$env:EKKOS_API_KEY\s*=\s*"[^"]*"/g, `$env:EKKOS_API_KEY = "${apiKey}"`);
|
|
34
|
+
};
|
|
35
|
+
// Hook extension based on platform
|
|
36
|
+
const hookExt = platform_1.isWindows ? '.ps1' : '.sh';
|
|
37
|
+
// Main hook files to deploy
|
|
38
|
+
const hookNames = [
|
|
39
|
+
'session-start',
|
|
40
|
+
'user-prompt-submit',
|
|
41
|
+
'stop'
|
|
42
|
+
];
|
|
43
|
+
// Copy main hook files (platform-specific)
|
|
44
|
+
for (const hookName of hookNames) {
|
|
45
|
+
const hookFile = `${hookName}${hookExt}`;
|
|
46
|
+
const templatePath = `hooks/${hookFile}`;
|
|
47
|
+
const destPath = (0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, hookFile);
|
|
48
|
+
try {
|
|
49
|
+
(0, templates_1.copyTemplateFile)(templatePath, destPath, transformHook);
|
|
50
|
+
deployedFiles.push(hookFile);
|
|
51
|
+
// Make executable on Unix
|
|
52
|
+
if (!platform_1.isWindows) {
|
|
53
|
+
(0, fs_1.chmodSync)(destPath, '755');
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
// Skip if template doesn't exist
|
|
58
|
+
console.warn(`Warning: Template ${templatePath} not found`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Also deploy assistant-response.sh on Unix (optional hook)
|
|
62
|
+
if (!platform_1.isWindows) {
|
|
63
|
+
try {
|
|
64
|
+
const templatePath = 'hooks/assistant-response.sh';
|
|
65
|
+
const destPath = (0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'assistant-response.sh');
|
|
66
|
+
(0, templates_1.copyTemplateFile)(templatePath, destPath, transformHook);
|
|
67
|
+
deployedFiles.push('assistant-response.sh');
|
|
68
|
+
(0, fs_1.chmodSync)(destPath, '755');
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
// Optional hook, skip silently
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Copy lib files (only for Unix - PowerShell doesn't need them)
|
|
75
|
+
if (!platform_1.isWindows) {
|
|
76
|
+
const libFiles = ['contract.sh', 'state.sh'];
|
|
77
|
+
for (const libFile of libFiles) {
|
|
78
|
+
const templatePath = `hooks/lib/${libFile}`;
|
|
79
|
+
const destPath = (0, path_1.join)(libDir, libFile);
|
|
80
|
+
try {
|
|
81
|
+
(0, templates_1.copyTemplateFile)(templatePath, destPath);
|
|
82
|
+
deployedFiles.push(`lib/${libFile}`);
|
|
83
|
+
(0, fs_1.chmodSync)(destPath, '755');
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
// Skip if template doesn't exist
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
count: deployedFiles.length,
|
|
92
|
+
files: deployedFiles
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Check if hooks are deployed
|
|
97
|
+
*/
|
|
98
|
+
function areHooksDeployed() {
|
|
99
|
+
const hookExt = platform_1.isWindows ? '.ps1' : '.sh';
|
|
100
|
+
const requiredHooks = [
|
|
101
|
+
`session-start${hookExt}`,
|
|
102
|
+
`user-prompt-submit${hookExt}`,
|
|
103
|
+
`stop${hookExt}`
|
|
104
|
+
];
|
|
105
|
+
for (const hook of requiredHooks) {
|
|
106
|
+
if (!(0, fs_1.existsSync)((0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, hook))) {
|
|
107
|
+
return false;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Count deployed hook files
|
|
114
|
+
*/
|
|
115
|
+
function countDeployedHooks() {
|
|
116
|
+
if (!(0, fs_1.existsSync)(platform_1.CLAUDE_HOOKS_DIR))
|
|
117
|
+
return 0;
|
|
118
|
+
const hookExt = platform_1.isWindows ? '.ps1' : '.sh';
|
|
119
|
+
const files = (0, fs_1.readdirSync)(platform_1.CLAUDE_HOOKS_DIR);
|
|
120
|
+
return files.filter(f => f.endsWith(hookExt)).length;
|
|
121
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// Deploy modules for ekkOS CLI
|
|
18
|
+
__exportStar(require("./mcp"), exports);
|
|
19
|
+
__exportStar(require("./settings"), exports);
|
|
20
|
+
__exportStar(require("./hooks"), exports);
|
|
21
|
+
__exportStar(require("./skills"), exports);
|
|
22
|
+
__exportStar(require("./agents"), exports);
|
|
23
|
+
__exportStar(require("./plugins"), exports);
|
|
24
|
+
__exportStar(require("./instructions"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deploy CLAUDE.md to ~/.claude/CLAUDE.md
|
|
3
|
+
*/
|
|
4
|
+
export declare function deployInstructions(): void;
|
|
5
|
+
/**
|
|
6
|
+
* Check if CLAUDE.md is deployed
|
|
7
|
+
*/
|
|
8
|
+
export declare function isInstructionsDeployed(): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Get the CLAUDE.md content (for preview)
|
|
11
|
+
*/
|
|
12
|
+
export declare function getInstructionsContent(): string;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deployInstructions = deployInstructions;
|
|
4
|
+
exports.isInstructionsDeployed = isInstructionsDeployed;
|
|
5
|
+
exports.getInstructionsContent = getInstructionsContent;
|
|
6
|
+
const fs_1 = require("fs");
|
|
7
|
+
const platform_1 = require("../utils/platform");
|
|
8
|
+
const templates_1 = require("../utils/templates");
|
|
9
|
+
/**
|
|
10
|
+
* Deploy CLAUDE.md to ~/.claude/CLAUDE.md
|
|
11
|
+
*/
|
|
12
|
+
function deployInstructions() {
|
|
13
|
+
// Ensure .claude directory exists
|
|
14
|
+
if (!(0, fs_1.existsSync)(platform_1.CLAUDE_DIR)) {
|
|
15
|
+
(0, fs_1.mkdirSync)(platform_1.CLAUDE_DIR, { recursive: true });
|
|
16
|
+
}
|
|
17
|
+
// Copy CLAUDE.md template
|
|
18
|
+
(0, templates_1.copyTemplateFile)('CLAUDE.md', platform_1.CLAUDE_MD);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Check if CLAUDE.md is deployed
|
|
22
|
+
*/
|
|
23
|
+
function isInstructionsDeployed() {
|
|
24
|
+
return (0, fs_1.existsSync)(platform_1.CLAUDE_MD);
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the CLAUDE.md content (for preview)
|
|
28
|
+
*/
|
|
29
|
+
function getInstructionsContent() {
|
|
30
|
+
try {
|
|
31
|
+
return (0, templates_1.readTemplate)('CLAUDE.md');
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return '';
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deploy MCP configuration for Claude Code
|
|
3
|
+
* File: ~/.claude.json
|
|
4
|
+
*/
|
|
5
|
+
export declare function deployClaudeMcp(apiKey: string, userId: string): void;
|
|
6
|
+
/**
|
|
7
|
+
* Deploy MCP configuration for Cursor
|
|
8
|
+
* File: ~/.cursor/mcp.json
|
|
9
|
+
*/
|
|
10
|
+
export declare function deployCursorMcp(apiKey: string, userId: string): void;
|
|
11
|
+
/**
|
|
12
|
+
* Deploy MCP configuration for Windsurf
|
|
13
|
+
* File: ~/.codeium/windsurf/mcp_config.json
|
|
14
|
+
*/
|
|
15
|
+
export declare function deployWindsurfMcp(apiKey: string, userId: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Check if ekkOS MCP is already configured
|
|
18
|
+
*/
|
|
19
|
+
export declare function isMcpConfigured(ide: 'claude' | 'cursor' | 'windsurf'): boolean;
|