@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,174 @@
1
+ # ═══════════════════════════════════════════════════════════════════════════
2
+ # ekkOS_ Hook: UserPromptSubmit - SEAMLESS CONTEXT CONTINUITY (Windows)
3
+ # ═══════════════════════════════════════════════════════════════════════════
4
+ # PowerShell version for Windows users
5
+ # ═══════════════════════════════════════════════════════════════════════════
6
+
7
+ $ErrorActionPreference = "SilentlyContinue"
8
+
9
+ # Read input from stdin
10
+ $inputJson = [Console]::In.ReadToEnd()
11
+ if (-not $inputJson) { exit 0 }
12
+
13
+ try {
14
+ $input = $inputJson | ConvertFrom-Json
15
+ } catch {
16
+ exit 0
17
+ }
18
+
19
+ $userQuery = $input.query
20
+ if (-not $userQuery) { $userQuery = $input.message }
21
+ if (-not $userQuery) { $userQuery = $input.prompt }
22
+ if (-not $userQuery) { exit 0 }
23
+
24
+ $rawSessionId = $input.session_id
25
+ if (-not $rawSessionId -or $rawSessionId -eq "null") { $rawSessionId = "unknown" }
26
+
27
+ # Fallback: read session_id from saved state
28
+ if ($rawSessionId -eq "unknown") {
29
+ $stateFile = Join-Path $env:USERPROFILE ".claude\state\current-session.json"
30
+ if (Test-Path $stateFile) {
31
+ try {
32
+ $state = Get-Content $stateFile -Raw | ConvertFrom-Json
33
+ $rawSessionId = $state.session_id
34
+ } catch {}
35
+ }
36
+ }
37
+
38
+ # ═══════════════════════════════════════════════════════════════════════════
39
+ # INTELLIGENT TOOL ROUTER: Multi-trigger skill detection
40
+ # ═══════════════════════════════════════════════════════════════════════════
41
+ $skillReminders = @()
42
+ $queryLower = $userQuery.ToLower()
43
+
44
+ # Memory First - Debug/Error/Problem solving
45
+ if ($queryLower -match '(how do i|debug|error|bug|fix|not working|broken|fails|issue|problem|wrong|crash)') {
46
+ $skillReminders += "🔧 SKILL REQUIRED: Call Skill(skill: `"ekkOS_Memory_First`") FIRST before debugging"
47
+ }
48
+
49
+ # Recall Triggers - Time-based memory
50
+ if ($queryLower -match '(yesterday|last week|last month|remember when|what did we|where did we leave|before|earlier|previous|ago)') {
51
+ $skillReminders += "📅 SKILL REQUIRED: Call Skill(skill: `"ekkOS_Deep_Recall`") for time-based memory"
52
+ }
53
+
54
+ # Directive Triggers - User preferences
55
+ if ($queryLower -match '(always |never |i prefer|i like |dont |don.t |avoid |remember that |from now on)') {
56
+ $skillReminders += "⚙️ SKILL REQUIRED: Call Skill(skill: `"ekkOS_Preferences`") to capture directive"
57
+ }
58
+
59
+ # Safety Triggers - Destructive actions
60
+ if ($queryLower -match '(delete|drop |rm -rf|deploy|push.*main|push.*master|production|migrate|rollback)') {
61
+ $skillReminders += "⚠️ SAFETY REQUIRED: Call ekkOS_Conflict before this destructive action"
62
+ }
63
+
64
+ # Schema Triggers - Database operations
65
+ if ($queryLower -match '(sql|query|supabase|prisma|database|table|column|select |insert |update |where )') {
66
+ $skillReminders += "🗄️ SCHEMA REQUIRED: Call ekkOS_GetSchema for correct field names"
67
+ }
68
+
69
+ # ═══════════════════════════════════════════════════════════════════════════
70
+ # TURN TRACKING & STATE MANAGEMENT
71
+ # ═══════════════════════════════════════════════════════════════════════════
72
+ $stateDir = Join-Path $env:USERPROFILE ".claude\state"
73
+ if (-not (Test-Path $stateDir)) {
74
+ New-Item -ItemType Directory -Path $stateDir -Force | Out-Null
75
+ }
76
+
77
+ $stateFile = Join-Path $stateDir "hook-state.json"
78
+ $turn = 0
79
+ $contextPercent = ""
80
+
81
+ if (Test-Path $stateFile) {
82
+ try {
83
+ $hookState = Get-Content $stateFile -Raw | ConvertFrom-Json
84
+ $turn = [int]$hookState.turn + 1
85
+ } catch {
86
+ $turn = 0
87
+ }
88
+ }
89
+
90
+ # Save updated state
91
+ $newState = @{
92
+ turn = $turn
93
+ session_id = $rawSessionId
94
+ last_query = $userQuery.Substring(0, [Math]::Min(100, $userQuery.Length))
95
+ timestamp = (Get-Date).ToString("o")
96
+ } | ConvertTo-Json
97
+
98
+ Set-Content -Path $stateFile -Value $newState -Force
99
+
100
+ # ═══════════════════════════════════════════════════════════════════════════
101
+ # WORKING MEMORY: Fast capture each turn (async, non-blocking)
102
+ # ═══════════════════════════════════════════════════════════════════════════
103
+ $configFile = Join-Path $env:USERPROFILE ".ekkos\config.json"
104
+ if (Test-Path $configFile) {
105
+ try {
106
+ $config = Get-Content $configFile -Raw | ConvertFrom-Json
107
+ $captureToken = $config.hookApiKey
108
+ if (-not $captureToken) { $captureToken = $config.apiKey }
109
+
110
+ if ($captureToken) {
111
+ # Async capture using Start-Job (non-blocking)
112
+ Start-Job -ScriptBlock {
113
+ param($token, $sessionId, $turnNum, $query)
114
+ $body = @{
115
+ session_id = $sessionId
116
+ turn = $turnNum
117
+ query = $query
118
+ } | ConvertTo-Json
119
+
120
+ Invoke-RestMethod -Uri "https://mcp.ekkos.dev/api/v1/working/fast-capture" `
121
+ -Method POST `
122
+ -Headers @{ Authorization = "Bearer $token" } `
123
+ -ContentType "application/json" `
124
+ -Body $body -ErrorAction SilentlyContinue
125
+ } -ArgumentList $captureToken, $rawSessionId, $turn, $userQuery | Out-Null
126
+ }
127
+ } catch {}
128
+ }
129
+
130
+ # ═══════════════════════════════════════════════════════════════════════════
131
+ # SESSION NAME (UUID to words)
132
+ # ═══════════════════════════════════════════════════════════════════════════
133
+ function Convert-UuidToWords {
134
+ param([string]$uuid)
135
+
136
+ $adjectives = @("alpha","beta","gamma","delta","echo","foxtrot","golf","hotel","india","juliet","kilo","lima","mike","november","oscar","papa")
137
+ $nouns = @("apple","banana","cherry","dragon","eagle","falcon","grape","hawk","iris","jasper","koala","lemon","mango","nebula","orange","panda")
138
+ $animals = @("ants","bats","cats","dogs","eels","foxes","goats","hares","ibis","jays","kites","lynx","mice","newts","owls","pigs")
139
+
140
+ if (-not $uuid -or $uuid -eq "unknown") { return "unknown-session" }
141
+
142
+ $clean = $uuid -replace "-", ""
143
+ if ($clean.Length -lt 6) { return "unknown-session" }
144
+
145
+ $a = [Convert]::ToInt32($clean.Substring(0,2), 16) % $adjectives.Length
146
+ $n = [Convert]::ToInt32($clean.Substring(2,2), 16) % $nouns.Length
147
+ $an = [Convert]::ToInt32($clean.Substring(4,2), 16) % $animals.Length
148
+
149
+ return "$($adjectives[$a])-$($nouns[$n])-$($animals[$an])"
150
+ }
151
+
152
+ $sessionName = Convert-UuidToWords $rawSessionId
153
+ $timestamp = (Get-Date).ToString("yyyy-MM-dd hh:mm:ss tt") + " EST"
154
+
155
+ # ═══════════════════════════════════════════════════════════════════════════
156
+ # OUTPUT SYSTEM REMINDER
157
+ # ═══════════════════════════════════════════════════════════════════════════
158
+ $header = "[0;36m[1m🧠 ekkOS Memory[0m [2m| Turn $turn | $contextPercent | $sessionName | $timestamp[0m"
159
+
160
+ $output = @"
161
+ $header
162
+
163
+ "@
164
+
165
+ if ($skillReminders.Count -gt 0) {
166
+ $output += "[0;35m[1m" + ($skillReminders -join "`n") + "[0m`n"
167
+ }
168
+
169
+ $output += @"
170
+
171
+ <footer-format>End responses with: Claude Code ({Model}) · 🧠 **ekkOS_™** · Turn $turn · $sessionName · 📅 $timestamp</footer-format>
172
+ "@
173
+
174
+ Write-Output $output