context-mode 1.0.119 → 1.0.121

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/skills/.ignore ADDED
@@ -0,0 +1,7 @@
1
+ # Files in this directory that are NOT skills.
2
+ # Pi's skill loader (@mariozechner/pi-coding-agent) reads `.ignore`, `.gitignore`,
3
+ # and `.fdignore` while scanning skill directories with includeRootFiles=true,
4
+ # and skips matching entries. Keeping this list in-package guarantees Pi will not
5
+ # attempt to parse non-skill markdown as a skill — even if a stale copy of the
6
+ # file ever slips into a published tarball (see issue #496 / v1.0.120 regression).
7
+ UPSTREAM-CREDITS.md
@@ -9,23 +9,37 @@ user-invocable: true
9
9
 
10
10
  # Context Mode Purge
11
11
 
12
- Permanently deletes ALL session data for this project: knowledge base, session events, analytics, and stats.
12
+ Permanently deletes session data for this project. Two scopes are supported (issue #520):
13
+
14
+ - **Project scope** (`scope: "project"`): wipes EVERYTHING — knowledge base, all session DB rows for every session, events markdown, and stats.
15
+ - **Session scope** (`sessionId: "<id>"` or `scope: "session"`): wipes ONLY the matching session's rows + FTS5 chunks. Sibling sessions, project stats, and the FTS5 store file are preserved.
13
16
 
14
17
  ## Instructions
15
18
 
16
- 1. **Warn the user**: This is irreversible. Everything will be deleted:
19
+ 1. **Decide the scope first** with the user:
20
+ - "Wipe just one session?" → ask for the `sessionId`.
21
+ - "Wipe the whole project?" → confirm scope:'project' (this is the destructive, irreversible default).
22
+ 2. **Warn the user about scope:'project'**. Everything will be deleted:
17
23
  - FTS5 knowledge base (all indexed content from `ctx_index`, `ctx_fetch_and_index`, `ctx_batch_execute`)
18
- - Session events DB (analytics, metadata, resume snapshots)
24
+ - Session events DB (analytics, metadata, resume snapshots) for ALL sessions in the project
19
25
  - Session events markdown file
20
- - In-memory session stats
21
- 2. Call the `mcp__context-mode__ctx_purge` MCP tool with `confirm: true`.
22
- 3. Report the result to the userthe response lists exactly what was deleted.
26
+ - In-memory session stats + persisted stats file
27
+ 3. Call the `mcp__context-mode__ctx_purge` MCP tool with the chosen parameters:
28
+ - Scoped: `{ confirm: true, sessionId: "<id>" }` implies scope:'session'.
29
+ - Project: `{ confirm: true, scope: "project" }` — explicit destructive form.
30
+ - Bare `{ confirm: true }` still works but emits a deprecation warning. Prefer the explicit forms.
31
+ 4. Report the result to the user — the response lists exactly what was deleted and (for scoped purges) confirms that other sessions and project stats were preserved.
32
+
33
+ ## Schema rules
34
+
35
+ - `confirm: true` is always required.
36
+ - `sessionId` and `scope: "project"` together is REJECTED as ambiguous (the sessionId implies session scope; combining with project scope contradicts intent).
37
+ - `scope: "session"` without `sessionId` throws — sessionId is required.
23
38
 
24
39
  ## When to Use
25
40
 
26
- - When the KB contains stale or incorrect content polluting search results.
27
- - When switching between unrelated projects in the same session.
28
- - When you want a completely fresh start for this project.
41
+ - **Scoped (per-session)**: scratch acceptance scenarios, drill replays, isolating a polluted session without losing the main working session's stats.
42
+ - **Project**: KB contains stale or incorrect content polluting search results, switching between unrelated projects in the same session, completely fresh start.
29
43
 
30
44
  ## Important
31
45