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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/adapters/openclaw/mcp-tools.js +10 -1
- package/build/cli.js +18 -0
- package/build/server.js +79 -22
- package/build/session/purge.d.ts +27 -0
- package/build/session/purge.js +105 -3
- package/cli.bundle.mjs +171 -149
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
- package/scripts/postinstall.mjs +19 -8
- package/server.bundle.mjs +132 -110
- package/skills/.ignore +7 -0
- package/skills/ctx-purge/SKILL.md +23 -9
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
|
|
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. **
|
|
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
|
-
|
|
22
|
-
|
|
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
|
-
-
|
|
27
|
-
-
|
|
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
|
|