@ogulcancelik/pi-session-recall 1.0.3 → 1.0.4
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 +2 -2
- package/package.json +1 -1
- package/session-recall.ts +23 -5
package/README.md
CHANGED
|
@@ -22,9 +22,9 @@ Two tools that let the agent recall past sessions:
|
|
|
22
22
|
|
|
23
23
|
### `session_search`
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
Literal text search across all past sessions using ripgrep-style fixed-string matching. It is not semantic search. The agent should search for one distinctive token or exact phrase at a time, such as a filename, package name, error string, function name, issue id, or remembered wording.
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Spaces mean exact spaces in an exact phrase. For unrelated concepts, the agent should call `session_search` multiple times instead of combining them into one query.
|
|
28
28
|
|
|
29
29
|
### `session_query`
|
|
30
30
|
|
package/package.json
CHANGED
package/session-recall.ts
CHANGED
|
@@ -664,8 +664,12 @@ export default function sessionRecallExtension(pi: ExtensionAPI) {
|
|
|
664
664
|
name: "session_search",
|
|
665
665
|
label: (params) => `Session Search: ${params.query}`,
|
|
666
666
|
description:
|
|
667
|
-
"
|
|
668
|
-
"
|
|
667
|
+
"Find past sessions by literal text search. This is essentially `rg -i -F` over session JSONL files, not semantic search. " +
|
|
668
|
+
"Use one exact token or phrase. Spaces are exact spaces in an exact phrase, so only use spaces for wording you expect appeared in the session, such as an error message. " +
|
|
669
|
+
"Good examples: `libc++abi`, `Cannot find module '@sinclair/typebox'`, `Blender VAT bake`. " +
|
|
670
|
+
"Bad example: `build ci c lib dependency ghostty` because that searches for one exact phrase, not separate keywords. " +
|
|
671
|
+
"Do not combine independent keywords into one search string. If you need multiple unrelated terms, call session_search multiple times. " +
|
|
672
|
+
"After finding a likely session, use session_query for semantic questions.",
|
|
669
673
|
renderResult: (result, options, theme) => {
|
|
670
674
|
const container = new Container();
|
|
671
675
|
const text = result.content?.[0]?.type === "text" ? result.content[0].text : "";
|
|
@@ -694,7 +698,7 @@ export default function sessionRecallExtension(pi: ExtensionAPI) {
|
|
|
694
698
|
parameters: Type.Object({
|
|
695
699
|
query: Type.String({
|
|
696
700
|
description:
|
|
697
|
-
"
|
|
701
|
+
"Literal search pattern passed to fixed-string ripgrep-style search. Use one distinctive token or exact phrase, not a bag of unrelated keywords. Spaces mean exact spaces in an exact phrase.",
|
|
698
702
|
}),
|
|
699
703
|
}),
|
|
700
704
|
|
|
@@ -715,7 +719,14 @@ export default function sessionRecallExtension(pi: ExtensionAPI) {
|
|
|
715
719
|
|
|
716
720
|
if (allMatches.length === 0) {
|
|
717
721
|
return {
|
|
718
|
-
content: [
|
|
722
|
+
content: [
|
|
723
|
+
{
|
|
724
|
+
type: "text" as const,
|
|
725
|
+
text:
|
|
726
|
+
`No sessions found matching "${query}".\n\n` +
|
|
727
|
+
"session_search is literal fixed-string search, not semantic search. Retry with one exact distinctive token or phrase, such as a filename, package name, error text, function name, issue id, or unique term.",
|
|
728
|
+
},
|
|
729
|
+
],
|
|
719
730
|
details: { matchCount: 0 },
|
|
720
731
|
};
|
|
721
732
|
}
|
|
@@ -754,7 +765,14 @@ export default function sessionRecallExtension(pi: ExtensionAPI) {
|
|
|
754
765
|
|
|
755
766
|
if (results.length === 0) {
|
|
756
767
|
return {
|
|
757
|
-
content: [
|
|
768
|
+
content: [
|
|
769
|
+
{
|
|
770
|
+
type: "text" as const,
|
|
771
|
+
text:
|
|
772
|
+
`No readable matches found for "${query}".\n\n` +
|
|
773
|
+
"session_search is literal fixed-string search, not semantic search. Retry with one exact distinctive token or phrase, such as a filename, package name, error text, function name, issue id, or unique term.",
|
|
774
|
+
},
|
|
775
|
+
],
|
|
758
776
|
details: { matchCount: 0 },
|
|
759
777
|
};
|
|
760
778
|
}
|