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 +11 -11
- package/package.json +1 -1
- package/src/edit.ts +427 -410
- package/src/grep.ts +338 -475
- package/src/read.ts +360 -357
- package/src/readseek-value.ts +10 -2
- package/src/refs.ts +88 -97
- package/src/session-anchors.ts +20 -0
- package/src/sg.ts +128 -139
- package/src/tool-types.ts +9 -0
- package/src/tui-render-utils.ts +55 -1
- package/src/write.ts +2 -1
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
|
|
10
|
-
const
|
|
11
|
-
|
|
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:
|
|
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:
|
|
23
|
-
registerSgTool(pi, { onFileAnchored:
|
|
24
|
-
registerRefsTool(pi, { onFileAnchored:
|
|
25
|
-
registerWriteTool(pi, { onFileAnchored:
|
|
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