pi-repoprompt-mcp 0.2.1 → 0.2.6
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 +11 -1
- package/extensions/repoprompt-mcp/src/config.ts +6 -2
- package/extensions/repoprompt-mcp/src/index.ts +278 -117
- package/extensions/repoprompt-mcp/src/readcache/LICENSE +23 -0
- package/extensions/repoprompt-mcp/src/readcache/constants.ts +39 -0
- package/extensions/repoprompt-mcp/src/readcache/diff.ts +142 -0
- package/extensions/repoprompt-mcp/src/readcache/meta.ts +248 -0
- package/extensions/repoprompt-mcp/src/readcache/object-store.ts +195 -0
- package/extensions/repoprompt-mcp/src/readcache/read-file.ts +451 -0
- package/extensions/repoprompt-mcp/src/readcache/replay.ts +366 -0
- package/extensions/repoprompt-mcp/src/readcache/resolve.ts +183 -0
- package/extensions/repoprompt-mcp/src/readcache/text.ts +50 -0
- package/extensions/repoprompt-mcp/src/readcache/types.ts +80 -0
- package/extensions/repoprompt-mcp/src/types.ts +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -6,6 +6,7 @@ Exposes a single `rp` tool (RepoPrompt MCP proxy) plus `/rp …` commands, with:
|
|
|
6
6
|
- window/tab binding (auto-detect by `cwd`, optional persistence)
|
|
7
7
|
- output rendering (syntax + diff highlighting)
|
|
8
8
|
- safety guardrails (deletes blocked unless explicitly allowed; optional edit confirmation)
|
|
9
|
+
- optional [Gurpartap/pi-readcache](https://github.com/Gurpartap/pi-readcache)-like caching for RepoPrompt `read_file` results (unchanged markers + diffs) to save on tokens
|
|
9
10
|
|
|
10
11
|
## Install
|
|
11
12
|
|
|
@@ -47,6 +48,8 @@ Commands:
|
|
|
47
48
|
- `/rp windows`
|
|
48
49
|
- `/rp bind`
|
|
49
50
|
- `/rp reconnect`
|
|
51
|
+
- `/rp readcache-status`
|
|
52
|
+
- `/rp readcache-refresh <path> [start-end]`
|
|
50
53
|
|
|
51
54
|
Tool:
|
|
52
55
|
```ts
|
|
@@ -64,7 +67,8 @@ Create `~/.pi/agent/extensions/repoprompt-mcp.json`:
|
|
|
64
67
|
"autoBindOnStart": true,
|
|
65
68
|
"persistBinding": true,
|
|
66
69
|
"confirmDeletes": true,
|
|
67
|
-
"confirmEdits": false
|
|
70
|
+
"confirmEdits": false,
|
|
71
|
+
"readcacheReadFile": false
|
|
68
72
|
}
|
|
69
73
|
```
|
|
70
74
|
|
|
@@ -80,3 +84,9 @@ If the MCP server is not auto-detected, set `command` explicitly:
|
|
|
80
84
|
(Alternatively, configure RepoPrompt in `~/.pi/agent/mcp.json`)
|
|
81
85
|
|
|
82
86
|
For more detail, see: `extensions/repoprompt-mcp/README.md` in the dot314 repo.
|
|
87
|
+
|
|
88
|
+
## Readcache gotchas
|
|
89
|
+
|
|
90
|
+
- `raw: true` disables readcache (and rendering). Don't use unless debugging
|
|
91
|
+
- Need full content? use `bypass_cache: true` in `read_file` args
|
|
92
|
+
- Multi-root: use absolute or specific relative paths (MCP `read_file` has no `RootName:` disambiguation)
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import * as fs from "node:fs";
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import * as os from "node:os";
|
|
6
|
-
import {
|
|
6
|
+
import { execFileSync } from "node:child_process";
|
|
7
7
|
import type { RpConfig } from "./types.js";
|
|
8
8
|
|
|
9
9
|
// Default configuration
|
|
@@ -14,6 +14,9 @@ const DEFAULT_CONFIG: RpConfig = {
|
|
|
14
14
|
confirmEdits: false,
|
|
15
15
|
collapsedMaxLines: 15,
|
|
16
16
|
suppressHostDisconnectedLog: true,
|
|
17
|
+
|
|
18
|
+
// Off by default: preserves RepoPrompt's default read_file behavior unless explicitly enabled
|
|
19
|
+
readcacheReadFile: false,
|
|
17
20
|
};
|
|
18
21
|
|
|
19
22
|
// Common locations for MCP config files
|
|
@@ -93,7 +96,8 @@ function commandExists(command: string): boolean {
|
|
|
93
96
|
if (!/^[\w./-]+$/.test(command)) {
|
|
94
97
|
return false;
|
|
95
98
|
}
|
|
96
|
-
|
|
99
|
+
const whichCommand = process.platform === "win32" ? "where" : "which";
|
|
100
|
+
execFileSync(whichCommand, [command], { stdio: "ignore" });
|
|
97
101
|
return true;
|
|
98
102
|
} catch {
|
|
99
103
|
return false;
|