@pratikgajjar/pi-recall 0.1.1 → 0.1.2

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
@@ -43,13 +43,18 @@ All tools accept `repo` (pass `"."` for the current project), `source` (`cursor`
43
43
 
44
44
  ### Navigating large sessions
45
45
 
46
- Some sessions are huge (thousands of messages). `recall_transcript` takes two
47
- extra params to slice instead of dumping everything:
46
+ Some sessions are huge (thousands of messages). `recall_transcript` takes
47
+ three extra params to slice instead of dumping everything:
48
48
 
49
49
  - `range` — Python-style slice over the message list: `":100"` first 100,
50
50
  `"-50:"` last 50, `"305:315"` window. Negative indices count from the end.
51
51
  - `outline` — one line per message: `[N] role: first-line`. A cheap table of
52
52
  contents you can scan before slicing in.
53
+ - `role` — comma-separated allowlist: `"user,assistant"` (skip tool noise),
54
+ `"user"` (just the prompts), `"tool"`. Tool-related labels (`toolResult`,
55
+ `toolCall`, `function_call`, …) all collapse to `tool`. In long agent loops,
56
+ ~50% of messages are tool noise; in some, 98% — a 30k-msg session shrinks to
57
+ ~600 with `role="user"`.
53
58
 
54
59
  Every rendered message carries its own `## msg N/TOTAL role` header so any
55
60
  slice is self-locating. **Default-cap:** if a session has more than 200
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pratikgajjar/pi-recall",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "pi extension: search your past AI chat history (Cursor, Claude Code, Codex, pi) via the recall CLI",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -350,6 +350,12 @@ export default function recallExtension(pi: ExtensionAPI) {
350
350
  "One line per message ([N] role: first-line). Use to navigate a large session before slicing in with 'range'.",
351
351
  }),
352
352
  ),
353
+ role: Type.Optional(
354
+ Type.String({
355
+ description:
356
+ "Comma-separated roles to keep: 'user', 'assistant', 'tool'. Tool-related roles (toolResult, toolCall, function_call, etc.) collapse to 'tool'. Use 'user,assistant' to skip tool noise (~50% of long agent loops are tool messages).",
357
+ }),
358
+ ),
353
359
  });
354
360
 
355
361
  // Above this many messages, recall_transcript called without 'range' or
@@ -384,10 +390,11 @@ export default function recallExtension(pi: ExtensionAPI) {
384
390
  });
385
391
  const cmd = params.session_id ? ["show", params.session_id] : ["last", ...filterArgs];
386
392
 
387
- // Honor an explicit slice as-is.
388
- if (params.range || params.outline) {
393
+ // Honor an explicit slice as-is (range / outline / role all count).
394
+ if (params.range || params.outline || params.role) {
389
395
  if (params.range) cmd.push("--range", params.range);
390
396
  if (params.outline) cmd.push("--outline");
397
+ if (params.role) cmd.push("--role", params.role);
391
398
  const res = await runRecall(cmd, signal);
392
399
  if (!res.ok) {
393
400
  const msg = res.stderr || res.stdout.trim() || `recall exited with code ${res.code}`;