trueline-mcp 2.9.0 → 2.10.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 +20 -8
- package/dist/cli.js +78 -65
- package/dist/server.js +97 -118
- package/hooks/core/formatters.js +17 -10
- package/hooks/core/instructions.js +9 -17
- package/hooks/core/routing.js +31 -141
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -58,11 +58,17 @@ source file, that's 10-20 lines instead of hundreds.
|
|
|
58
58
|
```
|
|
59
59
|
|
|
60
60
|
The agent sees the full structure, then uses `trueline_read` to fetch only
|
|
61
|
-
the ranges it needs.
|
|
62
|
-
|
|
61
|
+
the ranges it needs. Ranges are specified inline on each path:
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
file_paths: ["src/server.ts:25-45", "src/utils.ts:1-10,80-90"]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
A 500-line file where the agent needs one 20-line function? It reads 20
|
|
68
|
+
lines, not 500. Multiple files with different ranges in a single call.
|
|
63
69
|
|
|
64
70
|
`trueline_search` finds lines by literal string or regex and returns them
|
|
65
|
-
with edit-ready
|
|
71
|
+
with edit-ready refs, no outline or read step needed. For targeted
|
|
66
72
|
edits where the agent knows what it's looking for, this is the fastest path.
|
|
67
73
|
|
|
68
74
|
### Edit: compact and verified
|
|
@@ -96,7 +102,7 @@ content that doesn't match what's on disk, the edit is rejected. If the
|
|
|
96
102
|
agent targets the wrong lines, the edit is rejected. Nothing hits disk
|
|
97
103
|
unless the hashes match.
|
|
98
104
|
|
|
99
|
-
`trueline_verify` checks whether held
|
|
105
|
+
`trueline_verify` checks whether held refs are still valid without
|
|
100
106
|
re-reading the file. When nothing changed (the common case), the response
|
|
101
107
|
is a single line.
|
|
102
108
|
|
|
@@ -108,8 +114,9 @@ workflow:
|
|
|
108
114
|
|
|
109
115
|
- **SessionStart** injects instructions telling the agent how and when
|
|
110
116
|
to use each trueline tool, calibrated per platform.
|
|
111
|
-
- **PreToolUse** intercepts calls to the built-in
|
|
112
|
-
|
|
117
|
+
- **PreToolUse** intercepts calls to the built-in read and edit tools,
|
|
118
|
+
redirecting reads of files over 3 KB to trueline and blocking
|
|
119
|
+
unverified edits entirely.
|
|
113
120
|
|
|
114
121
|
With hooks, agent compliance is ~98%. Without hooks (instruction-only
|
|
115
122
|
platforms like OpenCode and Codex CLI), compliance is ~60%. The
|
|
@@ -123,13 +130,18 @@ adapt advice accordingly.
|
|
|
123
130
|
## Where it helps most
|
|
124
131
|
|
|
125
132
|
trueline's overhead is an MCP round-trip per tool call. For small files
|
|
126
|
-
(under ~
|
|
127
|
-
|
|
133
|
+
(under ~3 KB), the built-in tools are perfectly fine and pass through
|
|
134
|
+
without interception.
|
|
128
135
|
|
|
129
136
|
The payoff comes on larger files and multi-file editing sessions, where
|
|
130
137
|
targeted reads and compact edits avoid sending hundreds or thousands of
|
|
131
138
|
redundant lines through the context window.
|
|
132
139
|
|
|
140
|
+
In a typical 20-turn session exploring 8 files and editing 3, trueline
|
|
141
|
+
saves roughly 11,000 tokens of mid-session context plus 623 tokens per
|
|
142
|
+
turn from leaner instructions, for an estimated $1.58 per session in
|
|
143
|
+
reduced API cost.
|
|
144
|
+
|
|
133
145
|
## Design
|
|
134
146
|
|
|
135
147
|
See [DESIGN.md](DESIGN.md) for the protocol specification, hash
|