@henryqw/pi-session-recall 0.1.6 → 0.1.8

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/README.md CHANGED
@@ -27,7 +27,7 @@ pi install npm:@henryqw/pi-session-recall
27
27
 
28
28
  **Browse** — recent sessions: path, name, cwd, started date, preview.
29
29
 
30
- Query syntax: FTS5 over a trigram index — multi-word = AND by default, `OR` for breadth, quoted phrases for exact match, `NOT` to exclude. Wildcards only help stems ≥3 chars. Only user/assistant text is indexed; thinking blocks and tool output are not searchable. For message text over the 20,000-character indexing budget, only first/last regions are indexed and the middle is omitted; phrases and `NEAR` cannot cross those regions, but ordinary AND terms can. `sessionId` must be a `.jsonl` file under the Pi sessions directory.
30
+ Query syntax: Prefer distinctive identifiers, package names, issue numbers, or uncommon terms; use quoted phrases only when exact wording is known. FTS5 over a trigram index — multi-word = AND by default, `OR` for breadth, quoted phrases for exact match, `NOT` to exclude. Wildcards only help stems ≥3 chars. Only user/assistant text is indexed; thinking blocks and tool output are not searchable. For message text over the 20,000-character indexing budget, only first/last regions are indexed and the middle is omitted; phrases and `NEAR` cannot cross those regions, but ordinary AND terms can. `sessionId` must be a `.jsonl` file under the Pi sessions directory.
31
31
 
32
32
  Hits inside the current session's live context are suppressed; compacted-away or inactive-branch history stays discoverable. Forked sessions collapse into their parent when both match.
33
33
 
@@ -85,30 +85,12 @@ interface ToolParams {
85
85
  detail?: "adaptive" | "full";
86
86
  }
87
87
 
88
- const DESCRIPTION = `Search past Pi sessions stored on disk (FTS5-backed over a local SQLite index), or inspect one session in detail. No LLM calls — every shape returns actual messages.
88
+ const DESCRIPTION = `Search past Pi sessions locally with FTS5; returns stored messages.
89
89
 
90
- FOUR CALLING SHAPES
91
-
92
- 1) DISCOVERY pass \`query\`:
93
- session_search(query="auth refactor", limit=3)
94
- Runs FTS5 search and returns the top N sessions with metadata, match snippet, and messages around each match. Adaptive detail (default): the top-ranked result carries a ±5 message window plus first/last bookend messages; lower-ranked results carry only the anchor message. Pass \`detail="full"\` to hydrate every result fully.
95
-
96
- 2) SCROLL — pass \`sessionId\` + \`aroundMessageId\`:
97
- session_search(sessionId="...", aroundMessageId="e07", window=10)
98
- Returns ±window messages centered on the anchor (clamped to [1,20]). Use after discovery when you need more context than the default ±5 window. To scroll forward/backward, pass the last/first message entryId of the previous window back as aroundMessageId; messagesBefore/messagesAfter tell you where you are. Across forks, re-anchoring on a shared ancestor can jump branches — pass the previous response's branchTip as the branchTip argument (aroundMessageId only moves the center) to stay on that branch.
99
-
100
- 3) READ — pass \`sessionId\` only:
101
- session_search(sessionId="...")
102
- Returns the session's active branch (first 20 + last 10 messages when large).
103
-
104
- 4) BROWSE — no args:
105
- session_search()
106
- Returns recent sessions: name, cwd, start time, first-user-message preview. Use when asked "what was I working on" without a topic.
107
-
108
- Mode is inferred from args; precedence: scroll > read > browse > discovery.
109
-
110
- FTS5 SYNTAX
111
- AND is the default — multi-word queries require all terms. Use OR for broader recall (\`alpha OR beta\`), quoted phrases for exact match (\`"docker networking"\`), NOT to exclude (\`python NOT java\`). Wildcards work only as stem expansion of tokens ≥3 chars (trigram tokenizer); very short terms fall back to substring matching. The index covers user/assistant message text only — thinking, tool calls/results are not searchable.`;
90
+ - \`query\`: discover matches. Prefer distinctive identifiers or uncommon terms; multi-word queries are AND. Use \`OR\`/\`NOT\` for Boolean queries and quotes only when exact wording is known.
91
+ - \`sessionId\` + \`aroundMessageId\`: scroll ±\`window\`; retain \`branchTip\` across forks.
92
+ - \`sessionId\` alone: read; no args: browse recent sessions.
93
+ - Discovery is adaptive; use \`detail: "full"\` to hydrate every result.`;
112
94
 
113
95
  export default function (pi: ExtensionAPI): void {
114
96
  // Best-effort sync at startup, deferred so the synchronous walk + SQLite
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@henryqw/pi-session-recall",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "description": "FTS5 search over past Pi sessions: single tool, four arg-inferred modes (discovery/scroll/read/browse), zero LLM calls.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -25,8 +25,8 @@
25
25
  "pack:check": "npm pack --dry-run"
26
26
  },
27
27
  "peerDependencies": {
28
- "@earendil-works/pi-ai": "^0.84.2",
29
- "@earendil-works/pi-coding-agent": "^0.84.2",
28
+ "@earendil-works/pi-ai": "^0.84.4",
29
+ "@earendil-works/pi-coding-agent": "^0.84.4",
30
30
  "typebox": "^1.3.15"
31
31
  },
32
32
  "repository": {