@ekkos/cli 1.2.17 → 1.3.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/capture.js +0 -0
- package/dist/commands/dashboard.js +57 -49
- package/dist/commands/hooks.d.ts +25 -36
- package/dist/commands/hooks.js +43 -615
- package/dist/commands/init.js +7 -23
- package/dist/commands/run.js +97 -11
- package/dist/commands/setup.js +10 -352
- package/dist/deploy/hooks.d.ts +8 -5
- package/dist/deploy/hooks.js +12 -105
- package/dist/deploy/settings.d.ts +8 -2
- package/dist/deploy/settings.js +22 -51
- package/dist/index.js +17 -39
- package/dist/utils/state.js +7 -2
- package/package.json +1 -1
- package/templates/CLAUDE.md +82 -292
- package/templates/cursor-rules/ekkos-memory.md +48 -108
- package/templates/windsurf-rules/ekkos-memory.md +62 -64
- package/templates/cursor-hooks/after-agent-response.sh +0 -117
- package/templates/cursor-hooks/before-submit-prompt.sh +0 -419
- package/templates/cursor-hooks/hooks.json +0 -20
- package/templates/cursor-hooks/lib/contract.sh +0 -320
- package/templates/cursor-hooks/stop.sh +0 -75
- package/templates/hooks/assistant-response.ps1 +0 -256
- package/templates/hooks/assistant-response.sh +0 -160
- package/templates/hooks/hooks.json +0 -40
- package/templates/hooks/lib/contract.sh +0 -332
- package/templates/hooks/lib/count-tokens.cjs +0 -86
- package/templates/hooks/lib/ekkos-reminders.sh +0 -98
- package/templates/hooks/lib/state.sh +0 -210
- package/templates/hooks/session-start.ps1 +0 -146
- package/templates/hooks/session-start.sh +0 -353
- package/templates/hooks/stop.ps1 +0 -349
- package/templates/hooks/stop.sh +0 -382
- package/templates/hooks/user-prompt-submit.ps1 +0 -419
- package/templates/hooks/user-prompt-submit.sh +0 -516
- package/templates/project-stubs/session-start.ps1 +0 -63
- package/templates/project-stubs/session-start.sh +0 -55
- package/templates/project-stubs/stop.ps1 +0 -63
- package/templates/project-stubs/stop.sh +0 -55
- package/templates/project-stubs/user-prompt-submit.ps1 +0 -63
- package/templates/project-stubs/user-prompt-submit.sh +0 -55
- package/templates/windsurf-hooks/README.md +0 -212
- package/templates/windsurf-hooks/hooks.json +0 -17
- package/templates/windsurf-hooks/install.sh +0 -148
- package/templates/windsurf-hooks/lib/contract.sh +0 -322
- package/templates/windsurf-hooks/post-cascade-response.sh +0 -251
- package/templates/windsurf-hooks/pre-user-prompt.sh +0 -435
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "ekkOS Memory
|
|
2
|
+
description: "ekkOS Memory — 11-layer cognitive memory with 29 MCP tools"
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ekkOS Memory System
|
|
7
7
|
|
|
8
|
-
You have access to **ekkOS memory** via
|
|
8
|
+
You have access to **ekkOS memory** via 29 MCP tools. This is an 11-layer cognitive memory system that makes AI smarter over time by learning from past sessions.
|
|
9
9
|
|
|
10
10
|
## MANDATORY RULES
|
|
11
11
|
|
|
12
12
|
### RULE 1: SEARCH BEFORE ANSWERING
|
|
13
13
|
Before answering ANY technical question, call `ekkOS_Search` first.
|
|
14
|
-
Do not skip this. Do not assume you know the answer.
|
|
15
14
|
|
|
16
15
|
### RULE 2: ACKNOWLEDGE RETRIEVED PATTERNS
|
|
17
16
|
When patterns are retrieved, acknowledge each one:
|
|
18
17
|
```
|
|
19
18
|
[ekkOS_SELECT]
|
|
20
19
|
- id: <pattern_id>
|
|
21
|
-
reason: <why using
|
|
20
|
+
reason: <why using>
|
|
22
21
|
confidence: <0.0-1.0>
|
|
23
22
|
[/ekkOS_SELECT]
|
|
24
23
|
|
|
@@ -28,64 +27,66 @@ When patterns are retrieved, acknowledge each one:
|
|
|
28
27
|
[/ekkOS_SKIP]
|
|
29
28
|
```
|
|
30
29
|
|
|
30
|
+
Suppress SELECT/SKIP blocks for non-technical turns (acknowledgments, affirmations).
|
|
31
|
+
|
|
31
32
|
### RULE 3: FORGE WHAT YOU LEARN
|
|
32
33
|
When you fix a bug, get corrected, or learn something new, call `ekkOS_Forge` immediately.
|
|
34
|
+
When something DOESN'T work, forge it as an anti-pattern.
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
When something DOES NOT work, forge it as an anti-pattern.
|
|
36
|
-
|
|
37
|
-
## MCP Tools (31 Total)
|
|
36
|
+
## MCP Tools — 29 Visible
|
|
38
37
|
|
|
39
|
-
### Core Memory
|
|
38
|
+
### Core Memory (6)
|
|
40
39
|
| Tool | Description |
|
|
41
40
|
|------|-------------|
|
|
42
41
|
| `ekkOS_Search` | Search across all 11 memory layers |
|
|
43
|
-
| `ekkOS_Context` | Get relevant context for a task |
|
|
44
|
-
| `ekkOS_Capture` | Capture memory events |
|
|
45
42
|
| `ekkOS_Forge` | Create pattern from learned solution |
|
|
46
|
-
| `
|
|
47
|
-
| `ekkOS_Outcome` |
|
|
48
|
-
| `ekkOS_Detect` | Auto-detect which patterns were used |
|
|
49
|
-
| `ekkOS_Summary` | Get summary of recent MCP activity |
|
|
50
|
-
| `ekkOS_Conflict` | Check for directive/pattern conflicts |
|
|
51
|
-
| `ekkOS_Recall` | Recall past conversations by time |
|
|
52
|
-
| `ekkOS_Codebase` | Search project code embeddings |
|
|
43
|
+
| `ekkOS_Track` | Track when a pattern is applied |
|
|
44
|
+
| `ekkOS_Outcome` | Record if pattern worked or failed |
|
|
53
45
|
| `ekkOS_Stats` | Get statistics for all layers |
|
|
54
|
-
| `
|
|
55
|
-
|
|
46
|
+
| `ekkOS_Context` | Get relevant context for a task |
|
|
47
|
+
|
|
48
|
+
### Retrieval (4)
|
|
49
|
+
| Tool | Description |
|
|
50
|
+
|------|-------------|
|
|
51
|
+
| `ekkOS_Codebase` | Search project code embeddings |
|
|
52
|
+
| `ekkOS_Recall` | Recall past conversations by time |
|
|
53
|
+
| `ekkOS_PreserveContext` | Preserve working memory before compaction |
|
|
54
|
+
| `ekkOS_RestoreContext` | Restore context after compaction |
|
|
56
55
|
|
|
57
|
-
###
|
|
56
|
+
### Directives (4)
|
|
58
57
|
| Tool | Description |
|
|
59
58
|
|------|-------------|
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
59
|
+
| `ekkOS_Directive` | Create MUST/NEVER/PREFER/AVOID rules |
|
|
60
|
+
| `ekkOS_UpdateDirective` | Update an existing directive |
|
|
61
|
+
| `ekkOS_DeleteDirective` | Remove a directive |
|
|
62
|
+
| `ekkOS_UniversalDirectives` | Get directives that apply across all projects |
|
|
62
63
|
|
|
63
|
-
###
|
|
64
|
+
### Utility (5)
|
|
64
65
|
| Tool | Description |
|
|
65
66
|
|------|-------------|
|
|
66
|
-
| `
|
|
67
|
+
| `ekkOS_Summary` | Get summary of recent memory activity |
|
|
68
|
+
| `ekkOS_Conflict` | Check for conflicts before destructive actions |
|
|
69
|
+
| `ekkOS_Export` | Export patterns, directives, plans as JSON backup |
|
|
67
70
|
| `ekkOS_Import` | Import memory from backup (auto-deduplication) |
|
|
71
|
+
| `ekkOS_Health` | System health check |
|
|
68
72
|
|
|
69
|
-
###
|
|
73
|
+
### Plans (5)
|
|
70
74
|
| Tool | Description |
|
|
71
75
|
|------|-------------|
|
|
72
76
|
| `ekkOS_Plan` | Create structured task plan |
|
|
73
|
-
| `ekkOS_Plans` | List
|
|
77
|
+
| `ekkOS_Plans` | List your plans |
|
|
74
78
|
| `ekkOS_PlanStatus` | Update plan status |
|
|
75
79
|
| `ekkOS_PlanStep` | Mark step complete/incomplete |
|
|
76
80
|
| `ekkOS_Generate` | AI-generate plan from context |
|
|
77
|
-
| `ekkOS_SaveTemplate` | Save plan as reusable template |
|
|
78
|
-
| `ekkOS_Templates` | List available templates |
|
|
79
|
-
| `ekkOS_FromTemplate` | Create plan from template |
|
|
80
81
|
|
|
81
|
-
### Secrets
|
|
82
|
+
### Secrets (5)
|
|
82
83
|
| Tool | Description |
|
|
83
84
|
|------|-------------|
|
|
84
85
|
| `ekkOS_StoreSecret` | Encrypt and store sensitive data |
|
|
85
86
|
| `ekkOS_GetSecret` | Retrieve and decrypt a secret |
|
|
86
|
-
| `ekkOS_ListSecrets` | List secrets metadata (no values) |
|
|
87
|
+
| `ekkOS_ListSecrets` | List secrets metadata (no values exposed) |
|
|
87
88
|
| `ekkOS_DeleteSecret` | Permanently delete a secret |
|
|
88
|
-
| `ekkOS_RotateSecret` | Update secret with new value |
|
|
89
|
+
| `ekkOS_RotateSecret` | Update a secret with a new value |
|
|
89
90
|
|
|
90
91
|
## 11-Layer Architecture
|
|
91
92
|
|
|
@@ -93,33 +94,27 @@ When something DOES NOT work, forge it as an anti-pattern.
|
|
|
93
94
|
|---|-------|---------|
|
|
94
95
|
| 1 | Working | Current session state |
|
|
95
96
|
| 2 | Episodic | Past conversations |
|
|
96
|
-
| 3 | Semantic | Embeddings
|
|
97
|
+
| 3 | Semantic | Embeddings & knowledge |
|
|
97
98
|
| 4 | Patterns | Proven solutions |
|
|
98
99
|
| 5 | Procedural | Step-by-step guides |
|
|
99
100
|
| 6 | Collective | Cross-project wisdom |
|
|
100
101
|
| 7 | Meta | Pattern effectiveness |
|
|
101
102
|
| 8 | Codebase | Project-specific code |
|
|
102
|
-
| 9 | Directives | MUST/NEVER/PREFER/AVOID
|
|
103
|
-
| 10 | Conflict
|
|
103
|
+
| 9 | Directives | User rules (MUST/NEVER/PREFER/AVOID) |
|
|
104
|
+
| 10 | Conflict | Auto-resolves contradictions |
|
|
104
105
|
| 11 | Secrets | Encrypted credentials (AES-256-GCM) |
|
|
105
106
|
|
|
106
|
-
##
|
|
107
|
-
|
|
108
|
-
Call `ekkOS_Forge` when you:
|
|
109
|
-
- Fix a bug (especially non-obvious)
|
|
110
|
-
- Discover a better approach
|
|
111
|
-
- Find a pitfall or gotcha
|
|
112
|
-
- Get corrected by the user
|
|
113
|
-
- Solve auth/config issues
|
|
114
|
-
- Make architectural decisions
|
|
115
|
-
- Debug non-trivially
|
|
116
|
-
- Find something that DOESN'T work
|
|
107
|
+
## When To Use What
|
|
117
108
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
109
|
+
| Tool | Trigger |
|
|
110
|
+
|------|---------|
|
|
111
|
+
| `ekkOS_Search` | Technical question, past discussion, architecture, debugging |
|
|
112
|
+
| `ekkOS_Forge` | Bug fixed, better approach, gotcha, correction, anti-pattern |
|
|
113
|
+
| `ekkOS_Directive` | User says "always" → MUST, "never" → NEVER, "prefer" → PREFER, "avoid" → AVOID |
|
|
114
|
+
| `ekkOS_Conflict` | Before delete, deploy, config change, destructive commands |
|
|
115
|
+
| Plan tools | Task has 3+ steps, complex feature request |
|
|
116
|
+
| Secret tools | User shares API key/token/password, need stored credentials |
|
|
117
|
+
| `ekkOS_Recall` | "yesterday", "last week", "remember when", "what did we discuss" |
|
|
123
118
|
|
|
124
119
|
## Response Format
|
|
125
120
|
|
|
@@ -129,59 +124,4 @@ End every response with:
|
|
|
129
124
|
🧠 **ekkOS_™** · 📅 YYYY-MM-DD H:MM AM/PM TZ
|
|
130
125
|
```
|
|
131
126
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
127
|
+
For more info: https://docs.ekkos.dev
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
trigger: always_on
|
|
3
|
-
description: ekkOS Memory
|
|
3
|
+
description: ekkOS Memory — 11-layer cognitive memory with 29 MCP tools
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ekkOS Memory System
|
|
7
7
|
|
|
8
|
-
You have access to **ekkOS memory** via
|
|
8
|
+
You have access to **ekkOS memory** via 29 MCP tools. This is an 11-layer cognitive memory system that makes AI smarter over time by learning from past sessions.
|
|
9
9
|
|
|
10
10
|
## MANDATORY RULES
|
|
11
11
|
|
|
@@ -13,7 +13,7 @@ You have access to **ekkOS memory** via 31 MCP tools. This is an 11-layer cognit
|
|
|
13
13
|
Before answering ANY technical question, call `ekkOS_Search` first.
|
|
14
14
|
|
|
15
15
|
### RULE 2: ACKNOWLEDGE RETRIEVED PATTERNS
|
|
16
|
-
When patterns are retrieved:
|
|
16
|
+
When patterns are retrieved, acknowledge each one:
|
|
17
17
|
```
|
|
18
18
|
[ekkOS_SELECT]
|
|
19
19
|
- id: <pattern_id>
|
|
@@ -27,98 +27,94 @@ When patterns are retrieved:
|
|
|
27
27
|
[/ekkOS_SKIP]
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
When you fix a bug or learn something new, call `ekkOS_Forge` immediately.
|
|
30
|
+
Suppress SELECT/SKIP blocks for non-technical turns (acknowledgments, affirmations).
|
|
32
31
|
|
|
33
|
-
### RULE
|
|
32
|
+
### RULE 3: FORGE WHAT YOU LEARN
|
|
33
|
+
When you fix a bug, get corrected, or learn something new, call `ekkOS_Forge` immediately.
|
|
34
34
|
When something DOESN'T work, forge it as an anti-pattern.
|
|
35
35
|
|
|
36
|
-
## MCP Tools
|
|
36
|
+
## MCP Tools — 29 Visible
|
|
37
37
|
|
|
38
|
-
### Core Memory
|
|
38
|
+
### Core Memory (6)
|
|
39
39
|
| Tool | Description |
|
|
40
40
|
|------|-------------|
|
|
41
|
-
| `ekkOS_Search` | Search all 11 memory layers |
|
|
42
|
-
| `
|
|
43
|
-
| `
|
|
44
|
-
| `
|
|
45
|
-
| `
|
|
46
|
-
| `
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| `ekkOS_Conflict` | Check for conflicts |
|
|
50
|
-
| `ekkOS_Recall` | Recall past conversations |
|
|
51
|
-
| `ekkOS_Codebase` | Search code embeddings |
|
|
52
|
-
| `ekkOS_Stats` | Get layer statistics |
|
|
53
|
-
| `ekkOS_Track` | Track pattern application |
|
|
54
|
-
| `ekkOS_Reflect` | Analyze response for improvements |
|
|
55
|
-
|
|
56
|
-
### Schema Awareness Tools
|
|
41
|
+
| `ekkOS_Search` | Search across all 11 memory layers |
|
|
42
|
+
| `ekkOS_Forge` | Create pattern from learned solution |
|
|
43
|
+
| `ekkOS_Track` | Track when a pattern is applied |
|
|
44
|
+
| `ekkOS_Outcome` | Record if pattern worked or failed |
|
|
45
|
+
| `ekkOS_Stats` | Get statistics for all layers |
|
|
46
|
+
| `ekkOS_Context` | Get relevant context for a task |
|
|
47
|
+
|
|
48
|
+
### Retrieval (4)
|
|
57
49
|
| Tool | Description |
|
|
58
50
|
|------|-------------|
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
51
|
+
| `ekkOS_Codebase` | Search project code embeddings |
|
|
52
|
+
| `ekkOS_Recall` | Recall past conversations by time |
|
|
53
|
+
| `ekkOS_PreserveContext` | Preserve working memory before compaction |
|
|
54
|
+
| `ekkOS_RestoreContext` | Restore context after compaction |
|
|
61
55
|
|
|
62
|
-
###
|
|
56
|
+
### Directives (4)
|
|
63
57
|
| Tool | Description |
|
|
64
58
|
|------|-------------|
|
|
65
|
-
| `
|
|
66
|
-
| `
|
|
59
|
+
| `ekkOS_Directive` | Create MUST/NEVER/PREFER/AVOID rules |
|
|
60
|
+
| `ekkOS_UpdateDirective` | Update an existing directive |
|
|
61
|
+
| `ekkOS_DeleteDirective` | Remove a directive |
|
|
62
|
+
| `ekkOS_UniversalDirectives` | Get directives that apply across all projects |
|
|
67
63
|
|
|
68
|
-
###
|
|
64
|
+
### Utility (5)
|
|
69
65
|
| Tool | Description |
|
|
70
66
|
|------|-------------|
|
|
71
|
-
| `
|
|
72
|
-
| `
|
|
67
|
+
| `ekkOS_Summary` | Get summary of recent memory activity |
|
|
68
|
+
| `ekkOS_Conflict` | Check for conflicts before destructive actions |
|
|
69
|
+
| `ekkOS_Export` | Export patterns, directives, plans as JSON backup |
|
|
70
|
+
| `ekkOS_Import` | Import memory from backup (auto-deduplication) |
|
|
71
|
+
| `ekkOS_Health` | System health check |
|
|
72
|
+
|
|
73
|
+
### Plans (5)
|
|
74
|
+
| Tool | Description |
|
|
75
|
+
|------|-------------|
|
|
76
|
+
| `ekkOS_Plan` | Create structured task plan |
|
|
77
|
+
| `ekkOS_Plans` | List your plans |
|
|
73
78
|
| `ekkOS_PlanStatus` | Update plan status |
|
|
74
|
-
| `ekkOS_PlanStep` | Mark step
|
|
75
|
-
| `ekkOS_Generate` | AI-generate plan |
|
|
76
|
-
| `ekkOS_SaveTemplate` | Save as template |
|
|
77
|
-
| `ekkOS_Templates` | List templates |
|
|
78
|
-
| `ekkOS_FromTemplate` | Create from template |
|
|
79
|
+
| `ekkOS_PlanStep` | Mark step complete/incomplete |
|
|
80
|
+
| `ekkOS_Generate` | AI-generate plan from context |
|
|
79
81
|
|
|
80
|
-
### Secrets (
|
|
82
|
+
### Secrets (5)
|
|
81
83
|
| Tool | Description |
|
|
82
84
|
|------|-------------|
|
|
83
|
-
| `ekkOS_StoreSecret` | Encrypt and store |
|
|
84
|
-
| `ekkOS_GetSecret` | Retrieve and decrypt |
|
|
85
|
-
| `ekkOS_ListSecrets` | List metadata |
|
|
86
|
-
| `ekkOS_DeleteSecret` |
|
|
87
|
-
| `ekkOS_RotateSecret` |
|
|
85
|
+
| `ekkOS_StoreSecret` | Encrypt and store sensitive data |
|
|
86
|
+
| `ekkOS_GetSecret` | Retrieve and decrypt a secret |
|
|
87
|
+
| `ekkOS_ListSecrets` | List secrets metadata (no values exposed) |
|
|
88
|
+
| `ekkOS_DeleteSecret` | Permanently delete a secret |
|
|
89
|
+
| `ekkOS_RotateSecret` | Update a secret with a new value |
|
|
88
90
|
|
|
89
91
|
## 11-Layer Architecture
|
|
90
92
|
|
|
91
93
|
| # | Layer | Purpose |
|
|
92
94
|
|---|-------|---------|
|
|
93
|
-
| 1 | Working | Current session |
|
|
95
|
+
| 1 | Working | Current session state |
|
|
94
96
|
| 2 | Episodic | Past conversations |
|
|
95
|
-
| 3 | Semantic | Embeddings |
|
|
97
|
+
| 3 | Semantic | Embeddings & knowledge |
|
|
96
98
|
| 4 | Patterns | Proven solutions |
|
|
97
99
|
| 5 | Procedural | Step-by-step guides |
|
|
98
100
|
| 6 | Collective | Cross-project wisdom |
|
|
99
101
|
| 7 | Meta | Pattern effectiveness |
|
|
100
|
-
| 8 | Codebase | Project code |
|
|
101
|
-
| 9 | Directives | User rules |
|
|
102
|
-
| 10 | Conflict | Auto-
|
|
102
|
+
| 8 | Codebase | Project-specific code |
|
|
103
|
+
| 9 | Directives | User rules (MUST/NEVER/PREFER/AVOID) |
|
|
104
|
+
| 10 | Conflict | Auto-resolves contradictions |
|
|
103
105
|
| 11 | Secrets | Encrypted credentials (AES-256-GCM) |
|
|
104
106
|
|
|
105
|
-
##
|
|
107
|
+
## When To Use What
|
|
106
108
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
**forge_directive** when user says:
|
|
118
|
-
- "always..." → MUST
|
|
119
|
-
- "never..." → NEVER
|
|
120
|
-
- "I prefer..." → PREFER
|
|
121
|
-
- "don't..." → AVOID
|
|
109
|
+
| Tool | Trigger |
|
|
110
|
+
|------|---------|
|
|
111
|
+
| `ekkOS_Search` | Technical question, past discussion, architecture, debugging |
|
|
112
|
+
| `ekkOS_Forge` | Bug fixed, better approach, gotcha, correction, anti-pattern |
|
|
113
|
+
| `ekkOS_Directive` | User says "always" → MUST, "never" → NEVER, "prefer" → PREFER, "avoid" → AVOID |
|
|
114
|
+
| `ekkOS_Conflict` | Before delete, deploy, config change, destructive commands |
|
|
115
|
+
| Plan tools | Task has 3+ steps, complex feature request |
|
|
116
|
+
| Secret tools | User shares API key/token/password, need stored credentials |
|
|
117
|
+
| `ekkOS_Recall` | "yesterday", "last week", "remember when", "what did we discuss" |
|
|
122
118
|
|
|
123
119
|
## Response Format
|
|
124
120
|
|
|
@@ -127,3 +123,5 @@ End every response with:
|
|
|
127
123
|
---
|
|
128
124
|
🧠 **ekkOS_™** · 📅 YYYY-MM-DD H:MM AM/PM TZ
|
|
129
125
|
```
|
|
126
|
+
|
|
127
|
+
For more info: https://docs.ekkos.dev
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
3
|
-
# ekkOS_ Hook: AfterAgentResponse (Cursor Agent Mode)
|
|
4
|
-
#
|
|
5
|
-
# Captures agent responses for turn storage in ekkOS L2 (episodic memory)
|
|
6
|
-
# This enables Time Machine to work with Cursor Agent conversations
|
|
7
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
8
|
-
|
|
9
|
-
set +e
|
|
10
|
-
|
|
11
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
12
|
-
PROJECT_ROOT="$(dirname "$(dirname "$SCRIPT_DIR")")"
|
|
13
|
-
STATE_DIR="$PROJECT_ROOT/.cursor/state"
|
|
14
|
-
mkdir -p "$STATE_DIR" 2>/dev/null || true
|
|
15
|
-
|
|
16
|
-
# Read JSON input
|
|
17
|
-
INPUT=$(cat)
|
|
18
|
-
|
|
19
|
-
# Extract response text
|
|
20
|
-
RESPONSE_TEXT=$(echo "$INPUT" | jq -r '.text // ""' 2>/dev/null || echo "")
|
|
21
|
-
|
|
22
|
-
# Skip if empty
|
|
23
|
-
if [ -z "$RESPONSE_TEXT" ] || [ "$RESPONSE_TEXT" = "null" ]; then
|
|
24
|
-
exit 0
|
|
25
|
-
fi
|
|
26
|
-
|
|
27
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
28
|
-
# Load auth
|
|
29
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
30
|
-
EKKOS_CONFIG="$HOME/.ekkos/config.json"
|
|
31
|
-
AUTH_TOKEN=""
|
|
32
|
-
USER_ID=""
|
|
33
|
-
|
|
34
|
-
if [ -f "$EKKOS_CONFIG" ]; then
|
|
35
|
-
AUTH_TOKEN=$(jq -r '.hookApiKey // .apiKey // ""' "$EKKOS_CONFIG" 2>/dev/null || echo "")
|
|
36
|
-
USER_ID=$(jq -r '.userId // ""' "$EKKOS_CONFIG" 2>/dev/null || echo "")
|
|
37
|
-
fi
|
|
38
|
-
|
|
39
|
-
if [ -z "$AUTH_TOKEN" ] && [ -f "$PROJECT_ROOT/.env.local" ]; then
|
|
40
|
-
AUTH_TOKEN=$(grep -E "^SUPABASE_SECRET_KEY=" "$PROJECT_ROOT/.env.local" | cut -d'=' -f2- | tr -d '"' | tr -d "'" | tr -d '\r')
|
|
41
|
-
fi
|
|
42
|
-
|
|
43
|
-
[ -z "$AUTH_TOKEN" ] && exit 0
|
|
44
|
-
|
|
45
|
-
MEMORY_API_URL="https://mcp.ekkos.dev"
|
|
46
|
-
|
|
47
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
48
|
-
# Load session state
|
|
49
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
50
|
-
SESSION_ID=""
|
|
51
|
-
LAST_QUERY=""
|
|
52
|
-
|
|
53
|
-
if [ -f "$STATE_DIR/current_session_id.txt" ]; then
|
|
54
|
-
SESSION_ID=$(cat "$STATE_DIR/current_session_id.txt" 2>/dev/null || echo "")
|
|
55
|
-
fi
|
|
56
|
-
|
|
57
|
-
if [ -f "$STATE_DIR/last_query.txt" ]; then
|
|
58
|
-
LAST_QUERY=$(cat "$STATE_DIR/last_query.txt" 2>/dev/null || echo "")
|
|
59
|
-
fi
|
|
60
|
-
|
|
61
|
-
# Generate session ID if missing
|
|
62
|
-
if [ -z "$SESSION_ID" ]; then
|
|
63
|
-
SESSION_ID="cursor-agent-$(date +%s)-$$"
|
|
64
|
-
echo "$SESSION_ID" > "$STATE_DIR/current_session_id.txt"
|
|
65
|
-
fi
|
|
66
|
-
|
|
67
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
68
|
-
# Get turn number
|
|
69
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
70
|
-
TURN_FILE="$STATE_DIR/turn_${SESSION_ID}.txt"
|
|
71
|
-
TURN_NUMBER=1
|
|
72
|
-
if [ -f "$TURN_FILE" ]; then
|
|
73
|
-
TURN_NUMBER=$(cat "$TURN_FILE" 2>/dev/null || echo "0")
|
|
74
|
-
TURN_NUMBER=$((TURN_NUMBER + 1))
|
|
75
|
-
fi
|
|
76
|
-
echo "$TURN_NUMBER" > "$TURN_FILE"
|
|
77
|
-
|
|
78
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
79
|
-
# Capture turn to ekkOS L2
|
|
80
|
-
# ═══════════════════════════════════════════════════════════════════════════
|
|
81
|
-
# Only capture if we have a query to pair with
|
|
82
|
-
if [ -n "$LAST_QUERY" ]; then
|
|
83
|
-
# Truncate for API limits
|
|
84
|
-
QUERY_TRUNCATED="${LAST_QUERY:0:10000}"
|
|
85
|
-
RESPONSE_TRUNCATED="${RESPONSE_TEXT:0:50000}"
|
|
86
|
-
|
|
87
|
-
CAPTURE_PAYLOAD=$(jq -n \
|
|
88
|
-
--arg session_id "cursor-agent-$SESSION_ID" \
|
|
89
|
-
--arg user_id "${USER_ID:-system}" \
|
|
90
|
-
--arg user_query "$QUERY_TRUNCATED" \
|
|
91
|
-
--arg assistant_response "$RESPONSE_TRUNCATED" \
|
|
92
|
-
--argjson turn_number "$TURN_NUMBER" \
|
|
93
|
-
'{
|
|
94
|
-
session_id: $session_id,
|
|
95
|
-
user_id: $user_id,
|
|
96
|
-
user_query: $user_query,
|
|
97
|
-
assistant_response: $assistant_response,
|
|
98
|
-
metadata: {
|
|
99
|
-
source: "cursor-agent",
|
|
100
|
-
turn_number: $turn_number,
|
|
101
|
-
agent_mode: true
|
|
102
|
-
}
|
|
103
|
-
}' 2>/dev/null || echo '{}')
|
|
104
|
-
|
|
105
|
-
# Fire and forget - don't block agent
|
|
106
|
-
curl -s -X POST "$MEMORY_API_URL/api/v1/capture" \
|
|
107
|
-
-H "Authorization: Bearer $AUTH_TOKEN" \
|
|
108
|
-
-H "Content-Type: application/json" \
|
|
109
|
-
-d "$CAPTURE_PAYLOAD" \
|
|
110
|
-
--connect-timeout 2 \
|
|
111
|
-
--max-time 3 >/dev/null 2>&1 &
|
|
112
|
-
|
|
113
|
-
# Clear last query
|
|
114
|
-
rm -f "$STATE_DIR/last_query.txt" 2>/dev/null || true
|
|
115
|
-
fi
|
|
116
|
-
|
|
117
|
-
exit 0
|