@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.
Files changed (135) hide show
  1. package/dist/cache/LocalSessionStore.d.ts +129 -0
  2. package/dist/cache/LocalSessionStore.js +688 -0
  3. package/dist/cache/capture.d.ts +26 -0
  4. package/dist/cache/capture.js +461 -0
  5. package/dist/cache/index.d.ts +7 -0
  6. package/dist/cache/index.js +23 -0
  7. package/dist/cache/types.d.ts +147 -0
  8. package/dist/cache/types.js +40 -0
  9. package/dist/commands/init.d.ts +9 -0
  10. package/dist/commands/init.js +478 -0
  11. package/dist/commands/run.d.ts +12 -0
  12. package/dist/commands/run.js +829 -0
  13. package/dist/commands/setup.d.ts +6 -0
  14. package/dist/commands/setup.js +658 -0
  15. package/dist/commands/status.d.ts +1 -0
  16. package/dist/commands/status.js +109 -0
  17. package/dist/commands/test.d.ts +1 -0
  18. package/dist/commands/test.js +157 -0
  19. package/dist/deploy/agents.d.ts +15 -0
  20. package/dist/deploy/agents.js +72 -0
  21. package/dist/deploy/hooks.d.ts +16 -0
  22. package/dist/deploy/hooks.js +121 -0
  23. package/dist/deploy/index.d.ts +7 -0
  24. package/dist/deploy/index.js +24 -0
  25. package/dist/deploy/instructions.d.ts +12 -0
  26. package/dist/deploy/instructions.js +36 -0
  27. package/dist/deploy/mcp.d.ts +19 -0
  28. package/dist/deploy/mcp.js +109 -0
  29. package/dist/deploy/plugins.d.ts +19 -0
  30. package/dist/deploy/plugins.js +62 -0
  31. package/dist/deploy/settings.d.ts +8 -0
  32. package/dist/deploy/settings.js +84 -0
  33. package/dist/deploy/skills.d.ts +19 -0
  34. package/dist/deploy/skills.js +60 -0
  35. package/dist/index.d.ts +2 -0
  36. package/dist/index.js +71 -0
  37. package/dist/restore/RestoreOrchestrator.d.ts +48 -0
  38. package/dist/restore/RestoreOrchestrator.js +481 -0
  39. package/dist/restore/index.d.ts +4 -0
  40. package/dist/restore/index.js +20 -0
  41. package/dist/utils/platform.d.ts +29 -0
  42. package/dist/utils/platform.js +65 -0
  43. package/dist/utils/session-words.json +119 -0
  44. package/dist/utils/state.d.ts +57 -0
  45. package/dist/utils/state.js +186 -0
  46. package/dist/utils/templates.d.ts +24 -0
  47. package/dist/utils/templates.js +118 -0
  48. package/package.json +48 -0
  49. package/templates/CLAUDE.md +287 -0
  50. package/templates/README.md +378 -0
  51. package/templates/agents/README.md +182 -0
  52. package/templates/agents/code-reviewer.md +166 -0
  53. package/templates/agents/debug-detective.md +169 -0
  54. package/templates/agents/ekkOS_Vercel.md +99 -0
  55. package/templates/agents/extension-manager.md +229 -0
  56. package/templates/agents/git-companion.md +185 -0
  57. package/templates/agents/github-test-agent.md +321 -0
  58. package/templates/agents/railway-manager.md +179 -0
  59. package/templates/claude-plugins/PHASE2_COMPLETION.md +346 -0
  60. package/templates/claude-plugins/PLUGIN_PROPOSALS.md +1776 -0
  61. package/templates/claude-plugins/README.md +587 -0
  62. package/templates/claude-plugins/agents/code-reviewer.json +14 -0
  63. package/templates/claude-plugins/agents/debug-detective.json +15 -0
  64. package/templates/claude-plugins/agents/git-companion.json +14 -0
  65. package/templates/claude-plugins/blog-manager/.claude-plugin/plugin.json +8 -0
  66. package/templates/claude-plugins/blog-manager/commands/blog.md +691 -0
  67. package/templates/claude-plugins/golden-loop-monitor/.claude-plugin/plugin.json +8 -0
  68. package/templates/claude-plugins/golden-loop-monitor/commands/loop-status.md +434 -0
  69. package/templates/claude-plugins/learning-tracker/.claude-plugin/plugin.json +8 -0
  70. package/templates/claude-plugins/learning-tracker/commands/my-patterns.md +282 -0
  71. package/templates/claude-plugins/memory-lens/.claude-plugin/plugin.json +8 -0
  72. package/templates/claude-plugins/memory-lens/commands/memory-search.md +181 -0
  73. package/templates/claude-plugins/pattern-coach/.claude-plugin/plugin.json +8 -0
  74. package/templates/claude-plugins/pattern-coach/commands/forge.md +365 -0
  75. package/templates/claude-plugins/project-schema-validator/.claude-plugin/plugin.json +8 -0
  76. package/templates/claude-plugins/project-schema-validator/commands/validate-schema.md +582 -0
  77. package/templates/claude-plugins-admin/AGENT_TEAM_PROPOSALS.md +819 -0
  78. package/templates/claude-plugins-admin/README.md +446 -0
  79. package/templates/claude-plugins-admin/autonomous-admin-agent/.claude-plugin/plugin.json +8 -0
  80. package/templates/claude-plugins-admin/autonomous-admin-agent/commands/agent.md +595 -0
  81. package/templates/claude-plugins-admin/backend-agent/.claude-plugin/plugin.json +8 -0
  82. package/templates/claude-plugins-admin/backend-agent/commands/backend.md +798 -0
  83. package/templates/claude-plugins-admin/deploy-guardian/.claude-plugin/plugin.json +8 -0
  84. package/templates/claude-plugins-admin/deploy-guardian/commands/deploy.md +554 -0
  85. package/templates/claude-plugins-admin/frontend-agent/.claude-plugin/plugin.json +8 -0
  86. package/templates/claude-plugins-admin/frontend-agent/commands/frontend.md +881 -0
  87. package/templates/claude-plugins-admin/mcp-server-manager/.claude-plugin/plugin.json +8 -0
  88. package/templates/claude-plugins-admin/mcp-server-manager/commands/mcp.md +85 -0
  89. package/templates/claude-plugins-admin/memory-system-monitor/.claude-plugin/plugin.json +8 -0
  90. package/templates/claude-plugins-admin/memory-system-monitor/commands/memory-health.md +569 -0
  91. package/templates/claude-plugins-admin/qa-agent/.claude-plugin/plugin.json +8 -0
  92. package/templates/claude-plugins-admin/qa-agent/commands/qa.md +863 -0
  93. package/templates/claude-plugins-admin/tech-lead-agent/.claude-plugin/plugin.json +8 -0
  94. package/templates/claude-plugins-admin/tech-lead-agent/commands/lead.md +732 -0
  95. package/templates/commands/continue.md +47 -0
  96. package/templates/cursor-hooks/after-agent-response.sh +117 -0
  97. package/templates/cursor-hooks/before-submit-prompt.sh +419 -0
  98. package/templates/cursor-hooks/hooks.json +20 -0
  99. package/templates/cursor-hooks/lib/contract.sh +320 -0
  100. package/templates/cursor-hooks/stop.sh +75 -0
  101. package/templates/cursor-rules/ekkos-memory.md +187 -0
  102. package/templates/hooks/assistant-response.sh +96 -0
  103. package/templates/hooks/hooks.json +28 -0
  104. package/templates/hooks/lib/contract.sh +320 -0
  105. package/templates/hooks/lib/state.sh +158 -0
  106. package/templates/hooks/session-start.ps1 +41 -0
  107. package/templates/hooks/session-start.sh +318 -0
  108. package/templates/hooks/stop.ps1 +16 -0
  109. package/templates/hooks/stop.sh +989 -0
  110. package/templates/hooks/user-prompt-submit.ps1 +174 -0
  111. package/templates/hooks/user-prompt-submit.sh +587 -0
  112. package/templates/hooks-node/lib/state.js +187 -0
  113. package/templates/hooks-node/stop.js +416 -0
  114. package/templates/hooks-node/user-prompt-submit.js +337 -0
  115. package/templates/plan-template.md +306 -0
  116. package/templates/rules/00-hooks-contract.mdc +89 -0
  117. package/templates/rules/30-ekkos-core.mdc +188 -0
  118. package/templates/rules/31-ekkos-messages.mdc +78 -0
  119. package/templates/skills/continue/SKILL.md +169 -0
  120. package/templates/skills/ekkOS_Deep_Recall/Skill.md +282 -0
  121. package/templates/skills/ekkOS_Learn/Skill.md +265 -0
  122. package/templates/skills/ekkOS_Memory_First/Skill.md +206 -0
  123. package/templates/skills/ekkOS_Plan_Assist/Skill.md +302 -0
  124. package/templates/skills/ekkOS_Preferences/Skill.md +247 -0
  125. package/templates/skills/ekkOS_Reflect/Skill.md +257 -0
  126. package/templates/skills/ekkOS_Safety/Skill.md +265 -0
  127. package/templates/skills/ekkOS_Schema/Skill.md +251 -0
  128. package/templates/skills/ekkOS_Summary/Skill.md +257 -0
  129. package/templates/skills/ekkOS_Vault/Skill.md +287 -0
  130. package/templates/skills/permissions/Skill.md +322 -0
  131. package/templates/spec-template.md +159 -0
  132. package/templates/windsurf-hooks/before-submit-prompt.sh +238 -0
  133. package/templates/windsurf-hooks/hooks.json +10 -0
  134. package/templates/windsurf-hooks/lib/contract.sh +320 -0
  135. package/templates/windsurf-rules/ekkos-memory.md +129 -0
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deployClaudeMcp = deployClaudeMcp;
4
+ exports.deployCursorMcp = deployCursorMcp;
5
+ exports.deployWindsurfMcp = deployWindsurfMcp;
6
+ exports.isMcpConfigured = isMcpConfigured;
7
+ const fs_1 = require("fs");
8
+ const path_1 = require("path");
9
+ const platform_1 = require("../utils/platform");
10
+ /**
11
+ * Create the ekkOS MCP server configuration
12
+ */
13
+ function createEkkosMcpServer(apiKey, userId) {
14
+ return {
15
+ command: 'npx',
16
+ args: ['-y', '@ekkos/mcp-server@latest'],
17
+ env: {
18
+ EKKOS_API_KEY: apiKey,
19
+ EKKOS_USER_ID: userId
20
+ }
21
+ };
22
+ }
23
+ /**
24
+ * Read existing MCP config or return default structure
25
+ */
26
+ function readMcpConfig(path) {
27
+ if ((0, fs_1.existsSync)(path)) {
28
+ try {
29
+ const content = (0, fs_1.readFileSync)(path, 'utf-8');
30
+ const config = JSON.parse(content);
31
+ return {
32
+ ...config,
33
+ mcpServers: config.mcpServers || {}
34
+ };
35
+ }
36
+ catch {
37
+ // Invalid JSON, start fresh but preserve raw content comment
38
+ }
39
+ }
40
+ return { mcpServers: {} };
41
+ }
42
+ /**
43
+ * Write MCP config to file
44
+ */
45
+ function writeMcpConfig(path, config) {
46
+ const dir = (0, path_1.dirname)(path);
47
+ if (!(0, fs_1.existsSync)(dir)) {
48
+ (0, fs_1.mkdirSync)(dir, { recursive: true });
49
+ }
50
+ (0, fs_1.writeFileSync)(path, JSON.stringify(config, null, 2));
51
+ }
52
+ /**
53
+ * Deploy MCP configuration for Claude Code
54
+ * File: ~/.claude.json
55
+ */
56
+ function deployClaudeMcp(apiKey, userId) {
57
+ const config = readMcpConfig(platform_1.CLAUDE_CONFIG);
58
+ config.mcpServers['ekkos-memory'] = createEkkosMcpServer(apiKey, userId);
59
+ writeMcpConfig(platform_1.CLAUDE_CONFIG, config);
60
+ }
61
+ /**
62
+ * Deploy MCP configuration for Cursor
63
+ * File: ~/.cursor/mcp.json
64
+ */
65
+ function deployCursorMcp(apiKey, userId) {
66
+ if (!(0, fs_1.existsSync)(platform_1.CURSOR_DIR)) {
67
+ (0, fs_1.mkdirSync)(platform_1.CURSOR_DIR, { recursive: true });
68
+ }
69
+ const config = readMcpConfig(platform_1.CURSOR_MCP);
70
+ config.mcpServers['ekkos-memory'] = createEkkosMcpServer(apiKey, userId);
71
+ writeMcpConfig(platform_1.CURSOR_MCP, config);
72
+ }
73
+ /**
74
+ * Deploy MCP configuration for Windsurf
75
+ * File: ~/.codeium/windsurf/mcp_config.json
76
+ */
77
+ function deployWindsurfMcp(apiKey, userId) {
78
+ if (!(0, fs_1.existsSync)(platform_1.WINDSURF_DIR)) {
79
+ (0, fs_1.mkdirSync)(platform_1.WINDSURF_DIR, { recursive: true });
80
+ }
81
+ const config = readMcpConfig(platform_1.WINDSURF_MCP);
82
+ // Windsurf uses HTTP transport with serverUrl
83
+ config.mcpServers['ekkos-memory'] = {
84
+ command: 'npx',
85
+ args: ['-y', '@ekkos/mcp-server@latest'],
86
+ env: {
87
+ EKKOS_API_KEY: apiKey,
88
+ EKKOS_USER_ID: userId
89
+ }
90
+ };
91
+ writeMcpConfig(platform_1.WINDSURF_MCP, config);
92
+ }
93
+ /**
94
+ * Check if ekkOS MCP is already configured
95
+ */
96
+ function isMcpConfigured(ide) {
97
+ const configPath = ide === 'claude' ? platform_1.CLAUDE_CONFIG
98
+ : ide === 'cursor' ? platform_1.CURSOR_MCP
99
+ : platform_1.WINDSURF_MCP;
100
+ if (!(0, fs_1.existsSync)(configPath))
101
+ return false;
102
+ try {
103
+ const config = JSON.parse((0, fs_1.readFileSync)(configPath, 'utf-8'));
104
+ return 'ekkos-memory' in (config.mcpServers || {});
105
+ }
106
+ catch {
107
+ return false;
108
+ }
109
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Deploy all plugins to ~/.claude/plugins/ekkos/
3
+ */
4
+ export declare function deployPlugins(): {
5
+ count: number;
6
+ plugins: string[];
7
+ };
8
+ /**
9
+ * Check if plugins are deployed
10
+ */
11
+ export declare function arePluginsDeployed(): boolean;
12
+ /**
13
+ * Count deployed plugins
14
+ */
15
+ export declare function countDeployedPlugins(): number;
16
+ /**
17
+ * List expected plugins from templates
18
+ */
19
+ export declare function listExpectedPlugins(): string[];
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deployPlugins = deployPlugins;
4
+ exports.arePluginsDeployed = arePluginsDeployed;
5
+ exports.countDeployedPlugins = countDeployedPlugins;
6
+ exports.listExpectedPlugins = listExpectedPlugins;
7
+ const fs_1 = require("fs");
8
+ const platform_1 = require("../utils/platform");
9
+ const templates_1 = require("../utils/templates");
10
+ /**
11
+ * Deploy all plugins to ~/.claude/plugins/ekkos/
12
+ */
13
+ function deployPlugins() {
14
+ // Create plugins directory (including parent)
15
+ if (!(0, fs_1.existsSync)(platform_1.CLAUDE_PLUGINS_DIR)) {
16
+ (0, fs_1.mkdirSync)(platform_1.CLAUDE_PLUGINS_DIR, { recursive: true });
17
+ }
18
+ const pluginNames = (0, templates_1.listTemplateDirs)('claude-plugins');
19
+ const deployedPlugins = [];
20
+ for (const pluginName of pluginNames) {
21
+ // Skip agent subdirectory
22
+ if (pluginName === 'agents')
23
+ continue;
24
+ try {
25
+ const destPath = `${platform_1.CLAUDE_PLUGINS_DIR}/${pluginName}`;
26
+ (0, templates_1.copyTemplateDir)(`claude-plugins/${pluginName}`, destPath);
27
+ deployedPlugins.push(pluginName);
28
+ }
29
+ catch (error) {
30
+ console.warn(`Warning: Could not deploy plugin ${pluginName}`);
31
+ }
32
+ }
33
+ return {
34
+ count: deployedPlugins.length,
35
+ plugins: deployedPlugins
36
+ };
37
+ }
38
+ /**
39
+ * Check if plugins are deployed
40
+ */
41
+ function arePluginsDeployed() {
42
+ if (!(0, fs_1.existsSync)(platform_1.CLAUDE_PLUGINS_DIR))
43
+ return false;
44
+ const deployed = (0, fs_1.readdirSync)(platform_1.CLAUDE_PLUGINS_DIR);
45
+ return deployed.filter(d => !d.startsWith('.')).length >= 3;
46
+ }
47
+ /**
48
+ * Count deployed plugins
49
+ */
50
+ function countDeployedPlugins() {
51
+ if (!(0, fs_1.existsSync)(platform_1.CLAUDE_PLUGINS_DIR))
52
+ return 0;
53
+ return (0, fs_1.readdirSync)(platform_1.CLAUDE_PLUGINS_DIR)
54
+ .filter(entry => !entry.startsWith('.'))
55
+ .length;
56
+ }
57
+ /**
58
+ * List expected plugins from templates
59
+ */
60
+ function listExpectedPlugins() {
61
+ return (0, templates_1.listTemplateDirs)('claude-plugins').filter(p => p !== 'agents');
62
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Deploy Claude Code settings.json with hooks configuration
3
+ */
4
+ export declare function deployClaudeSettings(): void;
5
+ /**
6
+ * Check if hooks are configured in settings.json
7
+ */
8
+ export declare function areHooksConfigured(): boolean;
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deployClaudeSettings = deployClaudeSettings;
4
+ exports.areHooksConfigured = areHooksConfigured;
5
+ const fs_1 = require("fs");
6
+ const platform_1 = require("../utils/platform");
7
+ /**
8
+ * Generate the hooks configuration for Claude Code settings.json
9
+ */
10
+ function generateHooksConfig() {
11
+ const hooksDir = `${platform_1.HOME_DIR}/.claude/hooks`;
12
+ if (platform_1.isWindows) {
13
+ // Windows uses PowerShell
14
+ return {
15
+ SessionStart: [
16
+ { type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/session-start.ps1"` }
17
+ ],
18
+ UserPromptSubmit: [
19
+ { type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/user-prompt-submit.ps1"` }
20
+ ],
21
+ Stop: [
22
+ { type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/stop.ps1"` }
23
+ ],
24
+ AssistantResponse: [
25
+ { type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${hooksDir}/assistant-response.ps1"` }
26
+ ]
27
+ };
28
+ }
29
+ // Unix uses bash
30
+ return {
31
+ SessionStart: [
32
+ { type: 'command', command: `bash ${hooksDir}/session-start.sh` }
33
+ ],
34
+ UserPromptSubmit: [
35
+ { type: 'command', command: `bash ${hooksDir}/user-prompt-submit.sh` }
36
+ ],
37
+ Stop: [
38
+ { type: 'command', command: `bash ${hooksDir}/stop.sh` }
39
+ ],
40
+ AssistantResponse: [
41
+ { type: 'command', command: `bash ${hooksDir}/assistant-response.sh` }
42
+ ]
43
+ };
44
+ }
45
+ /**
46
+ * Deploy Claude Code settings.json with hooks configuration
47
+ */
48
+ function deployClaudeSettings() {
49
+ // Ensure .claude directory exists
50
+ if (!(0, fs_1.existsSync)(platform_1.CLAUDE_DIR)) {
51
+ (0, fs_1.mkdirSync)(platform_1.CLAUDE_DIR, { recursive: true });
52
+ }
53
+ // Read existing settings or create new
54
+ let settings = {};
55
+ if ((0, fs_1.existsSync)(platform_1.CLAUDE_SETTINGS)) {
56
+ try {
57
+ settings = JSON.parse((0, fs_1.readFileSync)(platform_1.CLAUDE_SETTINGS, 'utf-8'));
58
+ }
59
+ catch {
60
+ // Invalid JSON, start fresh
61
+ }
62
+ }
63
+ // Merge hooks config (preserving other settings)
64
+ settings.hooks = generateHooksConfig();
65
+ // Write settings
66
+ (0, fs_1.writeFileSync)(platform_1.CLAUDE_SETTINGS, JSON.stringify(settings, null, 2));
67
+ }
68
+ /**
69
+ * Check if hooks are configured in settings.json
70
+ */
71
+ function areHooksConfigured() {
72
+ if (!(0, fs_1.existsSync)(platform_1.CLAUDE_SETTINGS))
73
+ return false;
74
+ try {
75
+ const settings = JSON.parse((0, fs_1.readFileSync)(platform_1.CLAUDE_SETTINGS, 'utf-8'));
76
+ const hooks = settings.hooks || {};
77
+ return Boolean(hooks.SessionStart?.length &&
78
+ hooks.UserPromptSubmit?.length &&
79
+ hooks.Stop?.length);
80
+ }
81
+ catch {
82
+ return false;
83
+ }
84
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Deploy all skills to ~/.claude/skills/
3
+ */
4
+ export declare function deploySkills(): {
5
+ count: number;
6
+ skills: string[];
7
+ };
8
+ /**
9
+ * Check if skills are deployed
10
+ */
11
+ export declare function areSkillsDeployed(): boolean;
12
+ /**
13
+ * Count deployed skills
14
+ */
15
+ export declare function countDeployedSkills(): number;
16
+ /**
17
+ * List expected skills from templates
18
+ */
19
+ export declare function listExpectedSkills(): string[];
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deploySkills = deploySkills;
4
+ exports.areSkillsDeployed = areSkillsDeployed;
5
+ exports.countDeployedSkills = countDeployedSkills;
6
+ exports.listExpectedSkills = listExpectedSkills;
7
+ const fs_1 = require("fs");
8
+ const platform_1 = require("../utils/platform");
9
+ const templates_1 = require("../utils/templates");
10
+ /**
11
+ * Deploy all skills to ~/.claude/skills/
12
+ */
13
+ function deploySkills() {
14
+ // Create skills directory
15
+ if (!(0, fs_1.existsSync)(platform_1.CLAUDE_SKILLS_DIR)) {
16
+ (0, fs_1.mkdirSync)(platform_1.CLAUDE_SKILLS_DIR, { recursive: true });
17
+ }
18
+ const skillNames = (0, templates_1.listTemplateDirs)('skills');
19
+ const deployedSkills = [];
20
+ for (const skillName of skillNames) {
21
+ try {
22
+ const destPath = `${platform_1.CLAUDE_SKILLS_DIR}/${skillName}`;
23
+ (0, templates_1.copyTemplateDir)(`skills/${skillName}`, destPath);
24
+ deployedSkills.push(skillName);
25
+ }
26
+ catch (error) {
27
+ console.warn(`Warning: Could not deploy skill ${skillName}`);
28
+ }
29
+ }
30
+ return {
31
+ count: deployedSkills.length,
32
+ skills: deployedSkills
33
+ };
34
+ }
35
+ /**
36
+ * Check if skills are deployed
37
+ */
38
+ function areSkillsDeployed() {
39
+ if (!(0, fs_1.existsSync)(platform_1.CLAUDE_SKILLS_DIR))
40
+ return false;
41
+ const deployed = (0, fs_1.readdirSync)(platform_1.CLAUDE_SKILLS_DIR);
42
+ // Check for at least some core skills
43
+ return deployed.length >= 5;
44
+ }
45
+ /**
46
+ * Count deployed skills
47
+ */
48
+ function countDeployedSkills() {
49
+ if (!(0, fs_1.existsSync)(platform_1.CLAUDE_SKILLS_DIR))
50
+ return 0;
51
+ return (0, fs_1.readdirSync)(platform_1.CLAUDE_SKILLS_DIR)
52
+ .filter(entry => !entry.startsWith('.'))
53
+ .length;
54
+ }
55
+ /**
56
+ * List expected skills from templates
57
+ */
58
+ function listExpectedSkills() {
59
+ return (0, templates_1.listTemplateDirs)('skills');
60
+ }
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,71 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ const commander_1 = require("commander");
8
+ const init_1 = require("./commands/init");
9
+ const test_1 = require("./commands/test");
10
+ const status_1 = require("./commands/status");
11
+ const run_1 = require("./commands/run");
12
+ const chalk_1 = __importDefault(require("chalk"));
13
+ commander_1.program
14
+ .name('ekkos')
15
+ .description('ekkOS memory CLI for AI coding assistants')
16
+ .version('0.2.0')
17
+ .addHelpText('beforeAll', chalk_1.default.cyan('\n made by ekkOS_ with ❤️\n'));
18
+ // Main init command (combined auth + setup)
19
+ commander_1.program
20
+ .command('init')
21
+ .description('Initialize ekkOS with device authentication and IDE setup')
22
+ .option('-i, --ide <ide>', 'IDE to setup (claude, cursor, windsurf, all)')
23
+ .option('-k, --key <key>', 'Use API key instead of device auth')
24
+ .option('-f, --force', 'Force re-authentication and overwrite existing config')
25
+ .option('--skip-hooks', 'Skip hook deployment')
26
+ .option('--skip-skills', 'Skip skills deployment')
27
+ .action(init_1.init);
28
+ // Status command
29
+ commander_1.program
30
+ .command('status')
31
+ .description('Show your ekkOS memory status and installation info')
32
+ .action(status_1.status);
33
+ // Test command
34
+ commander_1.program
35
+ .command('test')
36
+ .description('Test connection to ekkOS memory')
37
+ .action(test_1.test);
38
+ // Run command - launches Claude with auto-continue wrapper
39
+ commander_1.program
40
+ .command('run')
41
+ .description('Launch Claude Code with auto-continue (auto /clear + /continue when context is high)')
42
+ .option('-s, --session <name>', 'Session name to restore on clear')
43
+ .option('-b, --bypass', 'Enable bypass permissions mode (dangerously skip all permission checks)')
44
+ .option('-v, --verbose', 'Show debug output')
45
+ .action((options) => {
46
+ (0, run_1.run)({
47
+ session: options.session,
48
+ bypass: options.bypass,
49
+ verbose: options.verbose
50
+ });
51
+ });
52
+ // Deprecated setup command (redirects to init)
53
+ commander_1.program
54
+ .command('setup')
55
+ .description('[DEPRECATED] Use "ekkos init" instead')
56
+ .option('-i, --ide <ide>', 'IDE to setup')
57
+ .option('-k, --key <key>', 'ekkOS API key')
58
+ .action(async (options) => {
59
+ console.log('');
60
+ console.log(chalk_1.default.yellow('⚠️ The "setup" command is deprecated.'));
61
+ console.log(chalk_1.default.yellow(' Please use "ekkos init" instead.'));
62
+ console.log('');
63
+ console.log(chalk_1.default.gray('Running init with your options...'));
64
+ console.log('');
65
+ // Forward to init
66
+ await (0, init_1.init)({
67
+ ide: options.ide,
68
+ key: options.key
69
+ });
70
+ });
71
+ commander_1.program.parse();
@@ -0,0 +1,48 @@
1
+ /**
2
+ * ekkOS Fast /continue - Restore Orchestrator
3
+ *
4
+ * Implements the 3-tier restore chain for near-zero context loss:
5
+ * - Tier 0: Local JSONL cache (~20ms)
6
+ * - Tier 1: Redis hot cache (~150ms)
7
+ * - Tier 2: Supabase cold store (~500ms)
8
+ *
9
+ * Falls back through tiers on miss, tracks which tier succeeded.
10
+ */
11
+ import { RestorePayload, RestoreOptions, CacheResult } from '../cache/types.js';
12
+ /**
13
+ * RestoreOrchestrator - Tiered restore for /continue
14
+ */
15
+ export declare class RestoreOrchestrator {
16
+ private localStore;
17
+ private authToken;
18
+ constructor();
19
+ /**
20
+ * Main restore function - attempts tiers in order
21
+ */
22
+ restore(options?: RestoreOptions): Promise<CacheResult<RestorePayload>>;
23
+ /**
24
+ * Tier 0: Restore from local JSONL cache
25
+ */
26
+ private restoreFromLocal;
27
+ /**
28
+ * Tier 1: Restore from Redis via API
29
+ */
30
+ private restoreFromRedis;
31
+ /**
32
+ * Tier 2: Restore from Supabase via API
33
+ */
34
+ private restoreFromSupabase;
35
+ /**
36
+ * Format RestorePayload as system-reminder markdown
37
+ */
38
+ formatAsSystemReminder(payload: RestorePayload): string;
39
+ /**
40
+ * Get restore statistics
41
+ */
42
+ getStats(): {
43
+ local_sessions: number;
44
+ local_turns: number;
45
+ local_size_bytes: number;
46
+ };
47
+ }
48
+ export declare const restoreOrchestrator: RestoreOrchestrator;