pi-readseek 0.3.19 → 0.3.21

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/index.ts CHANGED
@@ -5,22 +5,22 @@ import { registerGrepTool } from "./src/grep.js";
5
5
  import { registerSgTool, isSgAvailable } from "./src/sg.js";
6
6
  import { registerRefsTool } from "./src/refs.js";
7
7
  import { registerWriteTool } from "./src/write.js";
8
+ import { SessionAnchors } from "./src/session-anchors.js";
9
+
8
10
  export default function piReadseekExtension(pi: ExtensionAPI): void {
9
- const readPaths = new Set<string>();
10
- const noteRead = (absolutePath: string) => {
11
- readPaths.add(absolutePath);
12
- };
13
- const wasReadInSession = (absolutePath: string) => readPaths.has(absolutePath);
11
+ const sessionAnchors = new SessionAnchors();
12
+ const markAnchored = (absolutePath: string) => sessionAnchors.markAnchored(absolutePath);
13
+ const hasFreshAnchors = (absolutePath: string) => sessionAnchors.hasFreshAnchors(absolutePath);
14
14
 
15
- registerReadTool(pi, { onSuccessfulRead: noteRead });
16
- registerEditTool(pi, { wasReadInSession });
15
+ registerReadTool(pi, { onSuccessfulRead: markAnchored });
16
+ registerEditTool(pi, { wasReadInSession: hasFreshAnchors });
17
17
  const sgAvailable = isSgAvailable();
18
18
  const searchGuideline = sgAvailable
19
19
  ? "Use grep summary for counts; use search for structural code patterns."
20
20
  : "Use grep summary for counts; install @jarkkojs/readseek to enable search.";
21
21
 
22
- registerGrepTool(pi, { searchGuideline, onFileAnchored: noteRead });
23
- registerSgTool(pi, { onFileAnchored: noteRead });
24
- registerRefsTool(pi, { onFileAnchored: noteRead });
25
- registerWriteTool(pi, { onFileAnchored: noteRead });
22
+ registerGrepTool(pi, { searchGuideline, onFileAnchored: markAnchored });
23
+ registerSgTool(pi, { onFileAnchored: markAnchored });
24
+ registerRefsTool(pi, { onFileAnchored: markAnchored });
25
+ registerWriteTool(pi, { onFileAnchored: markAnchored });
26
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-readseek",
3
- "version": "0.3.19",
3
+ "version": "0.3.21",
4
4
  "description": "Pi extension for readseek-backed hash-anchored read/edit/grep, structural code maps, structural search, and file exploration",
5
5
  "type": "module",
6
6
  "exports": {