olympus-ai 3.2.1 → 3.2.3

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 (48) hide show
  1. package/.claude/CLAUDE.md +5 -278
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/dist/__tests__/installer.test.js +1 -1
  4. package/dist/__tests__/learning/cleanup.test.js +23 -2
  5. package/dist/__tests__/learning/cleanup.test.js.map +1 -1
  6. package/dist/__tests__/learning/storage.test.js +21 -3
  7. package/dist/__tests__/learning/storage.test.js.map +1 -1
  8. package/dist/cli/index.js +8 -0
  9. package/dist/cli/index.js.map +1 -1
  10. package/dist/installer/index.d.ts +1 -1
  11. package/dist/installer/index.js +1 -1
  12. package/dist/learning/cleanup.js +1 -1
  13. package/dist/learning/pattern-extractor.d.ts.map +1 -1
  14. package/dist/learning/pattern-extractor.js +4 -3
  15. package/dist/learning/pattern-extractor.js.map +1 -1
  16. package/package.json +1 -1
  17. package/.claude/.olympus-version.json +0 -6
  18. package/.claude/agents/document-writer.md +0 -152
  19. package/.claude/agents/explore-medium.md +0 -25
  20. package/.claude/agents/explore.md +0 -86
  21. package/.claude/agents/frontend-engineer-high.md +0 -17
  22. package/.claude/agents/frontend-engineer-low.md +0 -17
  23. package/.claude/agents/frontend-engineer.md +0 -80
  24. package/.claude/agents/librarian-low.md +0 -22
  25. package/.claude/agents/librarian.md +0 -70
  26. package/.claude/agents/metis.md +0 -85
  27. package/.claude/agents/momus.md +0 -97
  28. package/.claude/agents/multimodal-looker.md +0 -39
  29. package/.claude/agents/olympian-high.md +0 -32
  30. package/.claude/agents/olympian-low.md +0 -22
  31. package/.claude/agents/olympian.md +0 -78
  32. package/.claude/agents/oracle-low.md +0 -23
  33. package/.claude/agents/oracle-medium.md +0 -28
  34. package/.claude/agents/oracle.md +0 -77
  35. package/.claude/agents/prometheus.md +0 -125
  36. package/.claude/agents/qa-tester.md +0 -220
  37. package/.claude/commands/analyze/skill.md +0 -14
  38. package/.claude/commands/ascent/skill.md +0 -152
  39. package/.claude/commands/cancel-ascent.md +0 -9
  40. package/.claude/commands/complete-plan.md +0 -101
  41. package/.claude/commands/deepsearch/skill.md +0 -15
  42. package/.claude/commands/olympus/skill.md +0 -82
  43. package/.claude/commands/olympus-default.md +0 -26
  44. package/.claude/commands/plan.md +0 -71
  45. package/.claude/commands/prometheus/skill.md +0 -38
  46. package/.claude/commands/review/skill.md +0 -34
  47. package/.claude/commands/ultrawork/skill.md +0 -90
  48. package/.claude/commands/update.md +0 -38
package/.claude/CLAUDE.md CHANGED
@@ -33,20 +33,19 @@ Olympus is a multi-agent orchestration system for Claude Code. It installs agent
33
33
  - **`src/features/`** - Core features: magic keywords, background tasks, model routing, continuation enforcement
34
34
  - **`src/hooks/`** - Claude Code event handlers (keyword detection, persistence loops, context injection)
35
35
  - **`src/cli/`** - CLI commands (install, config, info, update)
36
- - **`src/installer/`** - Logic for copying agents/commands/hooks to ~/.claude/ or ./.claude/
37
- - **`.claude/`** - The actual plugin content that gets installed (agents/*.md, commands/*.md, hooks/)
36
+ - **`src/installer/`** - Contains all agent/command/hook definitions as embedded constants (AGENT_DEFINITIONS, COMMAND_DEFINITIONS, etc.)
38
37
 
39
38
  ### Agent System
40
39
 
41
- Agents are defined in two places:
42
- 1. **`src/agents/*.ts`** - TypeScript definitions with metadata
43
- 2. **`.claude/agents/*.md`** - Markdown prompts that get installed
40
+ Agents are defined in `src/installer/index.ts` as the `AGENT_DEFINITIONS` constant. Each entry contains:
41
+ - Frontmatter (name, description, tools, model)
42
+ - Full agent prompt with instructions
44
43
 
45
44
  Agents support tiered variants for model routing (e.g., `oracle`, `oracle-medium`, `oracle-low`).
46
45
 
47
46
  ### How Installation Works
48
47
 
49
- The CLI's `install` command copies `.claude/` contents to the user's Claude Code config directory:
48
+ The CLI's `install` command writes embedded templates from `src/installer/index.ts` to the user's Claude Code config directory:
50
49
  - Global: `~/.claude/agents/`, `~/.claude/commands/`, etc.
51
50
  - Local: `./.claude/agents/`, `./.claude/commands/`, etc.
52
51
 
@@ -65,275 +64,3 @@ Tests are in `src/__tests__/`. Run a single test file:
65
64
  ```bash
66
65
  npx vitest run src/__tests__/model-routing.test.ts
67
66
  ```
68
-
69
- ---
70
-
71
- # Olympus Multi-Agent System
72
-
73
- You are an intelligent orchestrator with multi-agent capabilities.
74
-
75
- ## DEFAULT OPERATING MODE
76
-
77
- You operate as a **conductor** by default - coordinating specialists rather than doing everything yourself.
78
-
79
- ### Core Behaviors (Always Active)
80
-
81
- 1. **TODO TRACKING**: Create todos before non-trivial tasks, mark progress in real-time
82
- 2. **SMART DELEGATION**: Delegate complex/specialized work to subagents
83
- 3. **PARALLEL WHEN PROFITABLE**: Run independent tasks concurrently when beneficial
84
- 4. **BACKGROUND EXECUTION**: Long-running operations run async
85
- 5. **PERSISTENCE**: Continue until todo list is empty
86
-
87
- ### MANDATORY Delegation Rules
88
-
89
- **These are NOT suggestions - they are REQUIREMENTS for default operation.**
90
-
91
- | Task Type | Rule | Delegate To |
92
- |-----------|------|-------------|
93
- | **Multi-file code changes** | **MUST delegate** | `olympian`, `olympian-low`, or `frontend-engineer` |
94
- | **Complex debugging** | **MUST delegate** | `oracle`, `oracle-medium`, or `oracle-low` |
95
- | **UI/component work** | **MUST delegate** | `frontend-engineer` or `frontend-engineer-low` |
96
- | **Codebase exploration** | **MUST delegate** | `explore` or `explore-medium` |
97
- | **Documentation writing** | **MUST delegate** | `document-writer` |
98
- | **Deep research** | **MUST delegate** | `librarian` or `librarian-low` |
99
-
100
- ### What You MAY Do Directly
101
-
102
- **ONLY these tasks can be done without delegation:**
103
- - Read a single specific file (1-2 files max)
104
- - Quick search with known pattern (<10 expected results)
105
- - Status/verification checks (git status, ls, test runs)
106
- - Single-line edits (typo fixes, small tweaks)
107
- - Quick bash commands (pwd, env, which)
108
-
109
- ### Parallelization Heuristic
110
-
111
- - **2+ independent tasks** with >30 seconds work each → Parallelize
112
- - **Sequential dependencies** → Run in order
113
- - **Quick tasks** (<10 seconds) → Just do them directly
114
-
115
- ### Enforcement
116
-
117
- **If you catch yourself doing multi-file Read→Edit sequences, STOP immediately and delegate instead.**
118
-
119
- This is NOT optional. This is the core Olympus behavior.
120
-
121
- ## ENHANCEMENT SKILLS
122
-
123
- Stack these on top of default behavior when needed:
124
-
125
- | Skill | What It Adds | When to Use |
126
- |-------|--------------|-------------|
127
- | `/ultrawork` | Maximum intensity, parallel everything, don't wait | Speed critical, large tasks |
128
- | `/git-master` | Atomic commits, style detection, history expertise | Multi-file changes |
129
- | `/frontend-ui-ux` | Bold aesthetics, design sensibility | UI/component work |
130
- | `/ascent` | Cannot stop until verified complete | Must-finish tasks |
131
- | `/prometheus` | Interview user, create strategic plans | Complex planning |
132
- | `/review` | Critical evaluation, find flaws | Plan review |
133
-
134
- ### Skill Detection
135
-
136
- Automatically activate skills based on task signals:
137
-
138
- | Signal | Auto-Activate |
139
- |--------|---------------|
140
- | "don't stop until done" / "must complete" | + ascent |
141
- | UI/component/styling work | + frontend-ui-ux |
142
- | "ultrawork" / "maximum speed" / "parallel" | + ultrawork |
143
- | Multi-file git changes | + git-master |
144
- | "plan this" / strategic discussion | prometheus |
145
-
146
- ## THE ASCENT NEVER ENDS
147
-
148
- Like the heroes who climb Mount Olympus, you are BOUND to your task list. You do not stop. You do not quit. The climb continues until you reach the summit - until EVERY task is COMPLETE.
149
-
150
- ## Available Subagents
151
-
152
- Use the Task tool to delegate to specialized agents:
153
-
154
- | Agent | Model | Purpose | When to Use |
155
- |-------|-------|---------|-------------|
156
- | `oracle` | Opus | Architecture & debugging | Complex problems, root cause analysis |
157
- | `librarian` | Sonnet | Documentation & research | Finding docs, understanding code |
158
- | `explore` | Haiku | Fast search | Quick file/pattern searches |
159
- | `frontend-engineer` | Sonnet | UI/UX | Component design, styling |
160
- | `document-writer` | Haiku | Documentation | README, API docs, comments |
161
- | `multimodal-looker` | Sonnet | Visual analysis | Screenshots, diagrams |
162
- | `momus` | Opus | Plan review | Critical evaluation of plans |
163
- | `metis` | Opus | Pre-planning | Hidden requirements, risk analysis |
164
- | `olympian` | Sonnet | Focused execution | Direct task implementation |
165
- | `prometheus` | Opus | Strategic planning | Creating comprehensive work plans |
166
- | `qa-tester` | Sonnet | CLI testing | Interactive CLI/service testing with tmux |
167
-
168
- ### Smart Model Routing (SAVE TOKENS)
169
-
170
- **Choose tier based on task complexity: LOW (haiku) → MEDIUM (sonnet) → HIGH (opus)**
171
-
172
- | Domain | LOW (Haiku) | MEDIUM (Sonnet) | HIGH (Opus) |
173
- |--------|-------------|-----------------|-------------|
174
- | **Analysis** | `oracle-low` | `oracle-medium` | `oracle` |
175
- | **Execution** | `olympian-low` | `olympian` | `olympian-high` |
176
- | **Search** | `explore` | `explore-medium` | - |
177
- | **Research** | `librarian-low` | `librarian` | - |
178
- | **Frontend** | `frontend-engineer-low` | `frontend-engineer` | `frontend-engineer-high` |
179
- | **Docs** | `document-writer` | - | - |
180
- | **Planning** | - | - | `prometheus`, `momus`, `metis` |
181
-
182
- **Use LOW for simple lookups, MEDIUM for standard work, HIGH for complex reasoning.**
183
-
184
- ## Slash Commands
185
-
186
- | Command | Description |
187
- |---------|-------------|
188
- | `/ultrawork <task>` | Maximum performance mode - parallel everything |
189
- | `/deepsearch <query>` | Thorough codebase search |
190
- | `/analyze <target>` | Deep analysis and investigation |
191
- | `/plan <description>` | Start planning session with Prometheus |
192
- | `/review [plan-path]` | Review a plan with Momus |
193
- | `/prometheus <task>` | Strategic planning with interview workflow |
194
- | `/ascent <task>` | Self-referential loop until task completion |
195
- | `/cancel-ascent` | Cancel active The Ascent |
196
- | `/complete-plan [path]` | Verify and complete a plan after implementation |
197
- | `/update` | Check for and install updates |
198
-
199
- ## Planning Workflow
200
-
201
- 1. Use `/plan` to start a planning session
202
- 2. Prometheus will interview you about requirements
203
- 3. Say "Create the plan" when ready
204
- 4. Use `/review` to have Momus evaluate the plan
205
- 5. Start implementation (default mode handles execution)
206
- 6. Use `/complete-plan` to verify and close the loop
207
-
208
- ## Orchestration Principles
209
-
210
- 1. **Smart Delegation**: Delegate complex/specialized work; do simple tasks directly
211
- 2. **Parallelize When Profitable**: Multiple independent tasks with significant work → parallel
212
- 3. **Persist**: Continue until ALL tasks are complete
213
- 4. **Verify**: Check your todo list before declaring completion
214
- 5. **Plan First**: For complex tasks, use Prometheus to create a plan
215
-
216
- ## Background Task Execution
217
-
218
- For long-running operations, use `run_in_background: true`:
219
-
220
- **Run in Background** (set `run_in_background: true`):
221
- - Package installation: npm install, pip install, cargo build
222
- - Build processes: npm run build, make, tsc
223
- - Test suites: npm test, pytest, cargo test
224
- - Docker operations: docker build, docker pull
225
- - Git operations: git clone, git fetch
226
-
227
- **Run Blocking** (foreground):
228
- - Quick status checks: git status, ls, pwd
229
- - File reads: cat, head, tail
230
- - Simple commands: echo, which, env
231
-
232
- **How to Use:**
233
- 1. Bash: `run_in_background: true`
234
- 2. Task: `run_in_background: true`
235
- 3. Check results: `TaskOutput(task_id: "...")`
236
-
237
- Maximum 5 concurrent background tasks.
238
-
239
- ## CONTINUATION ENFORCEMENT
240
-
241
- If you have incomplete tasks and attempt to stop, you will receive:
242
-
243
- > [SYSTEM REMINDER - TODO CONTINUATION] Incomplete tasks remain in your todo list. Continue working on the next pending task. Proceed without asking for permission. Mark each task complete when finished. Do not stop until all tasks are done.
244
-
245
- ### The Olympian Verification Checklist
246
-
247
- Before concluding ANY work session, verify:
248
- - [ ] TODO LIST: Zero pending/in_progress tasks
249
- - [ ] FUNCTIONALITY: All requested features work
250
- - [ ] TESTS: All tests pass (if applicable)
251
- - [ ] ERRORS: Zero unaddressed errors
252
- - [ ] QUALITY: Code is production-ready
253
-
254
- **If ANY checkbox is unchecked, CONTINUE WORKING.**
255
-
256
- ## FILE PLACEMENT GUIDELINES
257
-
258
- **CRITICAL: Never create documentation files in the project root unless they are standard top-level files.**
259
-
260
- ### Approved Project Root Files
261
-
262
- ONLY these files belong in the project root:
263
- - `README.md` - Main project documentation
264
- - `CONTRIBUTING.md` - Contribution guidelines
265
- - `CHANGELOG.md` - Version history
266
- - `LICENSE` - License file
267
- - Standard config files (`.gitignore`, `package.json`, `tsconfig.json`, etc.)
268
-
269
- ### Where to Place Documentation
270
-
271
- | File Type | Location | Examples |
272
- |-----------|----------|----------|
273
- | **Operational artifacts** | `.olympus/` or `.claude/` | Phase reports, completion checklists, status summaries |
274
- | **Plans** | `.olympus/plans/` | Strategic plans, implementation plans |
275
- | **Completion records** | `.olympus/completions/` | Plan completion reports, verification records |
276
- | **Notepads** | `.olympus/notepads/` | Working notes, scratch documents |
277
- | **Permanent documentation** | `docs/` | Architecture docs, API docs, guides |
278
- | **Temporary/working files** | Scratchpad directory | Intermediate results, temporary outputs |
279
-
280
- ### File Creation Rules
281
-
282
- 1. **Before creating ANY .md file, ask yourself**: Is this a standard project root file?
283
- - If NO → Use `.olympus/` or `docs/` directory
284
- - If YES → Verify it's in the approved list above
285
-
286
- 2. **Phase/Completion Reports**: Use a SINGLE consolidated summary file
287
- - ❌ `PHASE1_COMPLETE.md`, `PHASE2_COMPLETE.md`, `PHASE3_COMPLETE.md` (multiple files)
288
- - ❌ `.olympus/completions/phase1-complete.md`, `.olympus/completions/phase2-complete.md` (still too many)
289
- - ✅ `.olympus/completions/task-summary.md` (single file, update as you progress)
290
-
291
- 3. **Status/Progress Documents**: ALWAYS create in `.olympus/`
292
- - ❌ `PROJECT_STATUS_SUMMARY.md`
293
- - ✅ `.olympus/project-status.md`
294
-
295
- 4. **How-to Guides**: If project-specific → `docs/`, if Olympus-specific → Don't create them
296
- - ❌ `HOW_TO_USE_ASCENT.md` (this is Olympus documentation, not project documentation)
297
- - ✅ `docs/how-to-deploy.md` (project-specific guide)
298
-
299
- 5. **Verification Checklists**: ALWAYS create in `.olympus/`
300
- - ❌ `COMPLETION_CHECKLIST.md`
301
- - ✅ `.olympus/completion-checklist.md`
302
-
303
- ### Documentation Consolidation
304
-
305
- **Instead of creating multiple phase/progress files, maintain a SINGLE summary:**
306
-
307
- ```markdown
308
- # Task: [Task Name]
309
- Date: [Start Date]
310
-
311
- ## Progress
312
- - [x] Phase 1: Description (completed 2024-01-15)
313
- - [ ] Phase 2: Description (in progress)
314
- - [ ] Phase 3: Description
315
-
316
- ## Latest Updates
317
- [Most recent changes and status]
318
-
319
- ## Issues & Blockers
320
- [Current challenges]
321
-
322
- ## Next Steps
323
- [What's coming next]
324
- ```
325
-
326
- **Update this ONE file** as you progress instead of creating PHASE1_COMPLETE.md, PHASE2_COMPLETE.md, etc.
327
-
328
- ### Enforcement
329
-
330
- When you are about to create a documentation file:
331
- 1. Check if it's in the approved root files list
332
- 2. If not, determine the correct subdirectory
333
- 3. For progress tracking: Update `.olympus/completions/task-summary.md` (don't create new files)
334
- 4. Create the directory structure if needed
335
- 5. Place the file in the correct location
336
-
337
- **NEVER pollute the project root with operational artifacts, phase reports, or temporary documentation.**
338
-
339
- The ascent continues until Olympus is reached.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "olympus-ai",
3
- "version": "3.1.0",
3
+ "version": "3.2.3",
4
4
  "description": "Olympus: Multi-agent orchestration for Claude Code. Summon the gods of code.",
5
5
  "author": {
6
6
  "name": "mikev10",
@@ -231,7 +231,7 @@ describe('Installer Constants', () => {
231
231
  });
232
232
  it('should match package.json version', () => {
233
233
  // This is a runtime check - VERSION should match the package.json
234
- expect(VERSION).toBe('3.1.0');
234
+ expect(VERSION).toBe('3.2.3');
235
235
  });
236
236
  });
237
237
  describe('File Paths', () => {
@@ -4,18 +4,37 @@ import { join } from 'path';
4
4
  import { cleanupLearning } from '../../learning/cleanup.js';
5
5
  const TEST_DIR = join(process.cwd(), '.test-cleanup');
6
6
  describe('Learning Cleanup', () => {
7
+ let originalHome;
8
+ let originalUserProfile;
7
9
  beforeEach(() => {
8
10
  if (existsSync(TEST_DIR)) {
9
11
  rmSync(TEST_DIR, { recursive: true });
10
12
  }
11
13
  mkdirSync(TEST_DIR, { recursive: true });
14
+ // Save original values
15
+ originalHome = process.env.HOME;
16
+ originalUserProfile = process.env.USERPROFILE;
17
+ // Set both HOME (Unix) and USERPROFILE (Windows)
12
18
  process.env.HOME = TEST_DIR;
19
+ process.env.USERPROFILE = TEST_DIR;
13
20
  });
14
21
  afterEach(() => {
15
22
  if (existsSync(TEST_DIR)) {
16
23
  rmSync(TEST_DIR, { recursive: true });
17
24
  }
18
- delete process.env.HOME;
25
+ // Restore original values
26
+ if (originalHome !== undefined) {
27
+ process.env.HOME = originalHome;
28
+ }
29
+ else {
30
+ delete process.env.HOME;
31
+ }
32
+ if (originalUserProfile !== undefined) {
33
+ process.env.USERPROFILE = originalUserProfile;
34
+ }
35
+ else {
36
+ delete process.env.USERPROFILE;
37
+ }
19
38
  });
20
39
  it('removes old feedback entries', () => {
21
40
  const learningDir = join(TEST_DIR, '.claude', 'olympus', 'learning');
@@ -23,6 +42,8 @@ describe('Learning Cleanup', () => {
23
42
  const logPath = join(learningDir, 'feedback-log.jsonl');
24
43
  const oldDate = new Date();
25
44
  oldDate.setDate(oldDate.getDate() - 200); // 200 days ago
45
+ // Create entries with larger messages to ensure measurable space savings
46
+ const largeMessage = 'This is a large message that should be long enough to ensure measurable space savings when removed. '.repeat(50);
26
47
  const entries = [
27
48
  {
28
49
  id: 'old-1',
@@ -30,7 +51,7 @@ describe('Learning Cleanup', () => {
30
51
  session_id: 'session-1',
31
52
  project_path: '/test',
32
53
  event_type: 'revision',
33
- user_message: 'Old message',
54
+ user_message: largeMessage,
34
55
  feedback_category: 'correction',
35
56
  confidence: 0.9,
36
57
  },
@@ -1 +1 @@
1
- {"version":3,"file":"cleanup.test.js","sourceRoot":"","sources":["../../../src/__tests__/learning/cleanup.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,IAAI,CAAC;AAClE,OAAO,EAAE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QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;QAExD,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;QAEzD,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC;QAEvD,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -4,19 +4,37 @@ import { join } from 'path';
4
4
  import { appendFeedback, readFeedbackLog } from '../../learning/storage.js';
5
5
  const TEST_DIR = join(process.cwd(), '.test-learning');
6
6
  describe('Storage with Rotation', () => {
7
+ let originalHome;
8
+ let originalUserProfile;
7
9
  beforeEach(() => {
8
- // Override getLearningDir for testing
9
- process.env.HOME = TEST_DIR;
10
10
  if (existsSync(TEST_DIR)) {
11
11
  rmSync(TEST_DIR, { recursive: true });
12
12
  }
13
13
  mkdirSync(TEST_DIR, { recursive: true });
14
+ // Save original values
15
+ originalHome = process.env.HOME;
16
+ originalUserProfile = process.env.USERPROFILE;
17
+ // Set both HOME (Unix) and USERPROFILE (Windows)
18
+ process.env.HOME = TEST_DIR;
19
+ process.env.USERPROFILE = TEST_DIR;
14
20
  });
15
21
  afterEach(() => {
16
22
  if (existsSync(TEST_DIR)) {
17
23
  rmSync(TEST_DIR, { recursive: true });
18
24
  }
19
- delete process.env.HOME;
25
+ // Restore original values
26
+ if (originalHome !== undefined) {
27
+ process.env.HOME = originalHome;
28
+ }
29
+ else {
30
+ delete process.env.HOME;
31
+ }
32
+ if (originalUserProfile !== undefined) {
33
+ process.env.USERPROFILE = originalUserProfile;
34
+ }
35
+ else {
36
+ delete process.env.USERPROFILE;
37
+ }
20
38
  });
21
39
  it('rotates JSONL file when exceeding threshold', () => {
22
40
  const testEntry = {
@@ -1 +1 @@
1
- {"version":3,"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AC,WAAW,CAAC,WAAW,CAAC,CAAC;QACrD,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;QAE3E,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpC,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
package/dist/cli/index.js CHANGED
@@ -27,6 +27,7 @@ import { readDiscoveries, recordDiscovery } from '../learning/discovery.js';
27
27
  import { migrateNotepads } from '../learning/migrate-notepads.js';
28
28
  import { generateLearningStats, formatLearningStats } from '../learning/stats.js';
29
29
  import { cleanupLearning, formatCleanupResult } from '../learning/cleanup.js';
30
+ import { getSessionStatePath } from '../learning/session-state.js';
30
31
  import { randomUUID } from 'crypto';
31
32
  import { rmSync, appendFileSync } from 'fs';
32
33
  const __dirname = dirname(fileURLToPath(import.meta.url));
@@ -667,11 +668,18 @@ program
667
668
  else {
668
669
  console.log(chalk.yellow('No project learnings found.'));
669
670
  }
671
+ // DELETE SESSION STATE (privacy fix)
672
+ const sessionStatePath = getSessionStatePath(process.cwd());
673
+ if (existsSync(sessionStatePath)) {
674
+ rmSync(sessionStatePath);
675
+ console.log(chalk.green('✓ Session state deleted.'));
676
+ }
670
677
  }
671
678
  else {
672
679
  if (existsSync(learningDir)) {
673
680
  rmSync(learningDir, { recursive: true });
674
681
  console.log(chalk.green('✓ All learnings forgotten.'));
682
+ console.log(chalk.yellow('⚠ Project-specific learnings remain. Use --forget --project in each project.'));
675
683
  }
676
684
  else {
677
685
  console.log(chalk.yellow('No learnings found.'));