trueline-mcp 2.0.5 → 2.0.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/INSTALL.md CHANGED
@@ -173,9 +173,11 @@ npm i -g trueline-mcp
173
173
 
174
174
  ## Path access
175
175
 
176
- By default, trueline tools can access files inside the project directory and
177
- `~/.claude/`. To allow additional directories, set `TRUELINE_ALLOWED_DIRS` to
178
- a colon-separated list of paths (semicolon-separated on Windows).
176
+ By default, trueline tools can access files inside the project directory.
177
+ When running under Claude Code, `~/.claude/` is also allowed (it stores
178
+ plans, memory, and settings). To allow additional directories on any
179
+ platform, set `TRUELINE_ALLOWED_DIRS` to a colon-separated list of paths
180
+ (semicolon-separated on Windows).
179
181
 
180
182
  ## Platform detection
181
183
 
@@ -184,7 +186,6 @@ The hook dispatcher auto-detects the platform from environment variables:
184
186
  | Env var | Platform |
185
187
  |------------------------|----------------|
186
188
  | `GEMINI_PROJECT_DIR` | gemini-cli |
187
- | `OPENCODE_PROJECT_DIR` | opencode |
188
189
  | `CLAUDE_PROJECT_DIR` | claude-code |
189
190
 
190
191
  Override with `TRUELINE_PLATFORM=<platform>` if auto-detection doesn't work.
package/README.md CHANGED
@@ -171,9 +171,10 @@ are available via the `trueline-hook` CLI dispatcher — see
171
171
 
172
172
  ## Path access
173
173
 
174
- By default, trueline tools can access files inside the project directory
175
- and `~/.claude/`. To allow additional directories, set
176
- `TRUELINE_ALLOWED_DIRS` to a colon-separated list of paths
174
+ By default, trueline tools can access files inside the project directory.
175
+ When running under Claude Code, `~/.claude/` is also allowed (it stores
176
+ plans, memory, and settings). To allow additional directories on any
177
+ platform, set `TRUELINE_ALLOWED_DIRS` to a colon-separated list of paths
177
178
  (semicolon-separated on Windows).
178
179
 
179
180
  ## Development
package/dist/server.js CHANGED
@@ -22353,7 +22353,7 @@ class StdioServerTransport {
22353
22353
  // package.json
22354
22354
  var package_default = {
22355
22355
  name: "trueline-mcp",
22356
- version: "2.0.5",
22356
+ version: "2.0.6",
22357
22357
  type: "module",
22358
22358
  description: "Truth-verified file editing for AI coding agents via MCP",
22359
22359
  license: "Apache-2.0",
@@ -23949,11 +23949,13 @@ var rawProjectDir = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
23949
23949
  var projectDir = await realpath2(rawProjectDir).catch(() => rawProjectDir);
23950
23950
  async function resolveAllowedDirs() {
23951
23951
  const dirs = [];
23952
- const claudeDir = join(homedir2(), ".claude");
23953
- await mkdir(claudeDir, { recursive: true }).catch(() => {});
23954
- const realClaudeDir = await realpath2(claudeDir).catch(() => null);
23955
- if (realClaudeDir)
23956
- dirs.push(realClaudeDir);
23952
+ if (process.env.CLAUDE_PROJECT_DIR) {
23953
+ const claudeDir = join(homedir2(), ".claude");
23954
+ await mkdir(claudeDir, { recursive: true }).catch(() => {});
23955
+ const realClaudeDir = await realpath2(claudeDir).catch(() => null);
23956
+ if (realClaudeDir)
23957
+ dirs.push(realClaudeDir);
23958
+ }
23957
23959
  const extra = process.env.TRUELINE_ALLOWED_DIRS;
23958
23960
  if (extra) {
23959
23961
  for (const raw of extra.split(delimiter).filter(Boolean)) {
@@ -23970,9 +23972,9 @@ server.registerTool("trueline_read", {
23970
23972
  inputSchema: exports_external.object({
23971
23973
  file_path: exports_external.string(),
23972
23974
  ranges: exports_external.array(exports_external.object({
23973
- start: exports_external.number().int().positive().optional(),
23974
- end: exports_external.number().int().positive().optional()
23975
- })).optional(),
23975
+ start: exports_external.number().int().positive().describe("First line to read (1-based).").optional(),
23976
+ end: exports_external.number().int().positive().describe("Last line to read (1-based, inclusive).").optional()
23977
+ })).describe("Line ranges to read. Omit to read the whole file. Example: [{start: 10, end: 25}] or [{start: 1, end: 50}, {start: 200, end: 220}] for disjoint ranges. Each range gets its own checksum.").optional(),
23976
23978
  encoding: exports_external.string().describe("File encoding. Defaults to utf-8. Supported: utf-8, ascii, latin1.").optional()
23977
23979
  })
23978
23980
  }, async (params) => {
@@ -30,9 +30,13 @@ export async function createAccessChecker(projectDir) {
30
30
 
31
31
  // Build allowed dirs list (same logic as server.ts).
32
32
  const allowedBases = [realBase];
33
- try {
34
- allowedBases.push(await realpath(resolve(homedir(), ".claude")));
35
- } catch {}
33
+
34
+ // ~/.claude/ — only relevant when running under Claude Code.
35
+ if (process.env.CLAUDE_PROJECT_DIR) {
36
+ try {
37
+ allowedBases.push(await realpath(resolve(homedir(), ".claude")));
38
+ } catch {}
39
+ }
36
40
 
37
41
  const extraDirs = process.env.TRUELINE_ALLOWED_DIRS;
38
42
  if (extraDirs) {
@@ -8,7 +8,6 @@
8
8
 
9
9
  const PLATFORM_ENV_VARS = {
10
10
  "gemini-cli": "GEMINI_PROJECT_DIR",
11
- opencode: "OPENCODE_PROJECT_DIR",
12
11
  // claude-code and vscode-copilot both use CLAUDE_PROJECT_DIR, so we can't
13
12
  // distinguish them by env var alone. VS Code Copilot detection would need
14
13
  // an additional signal (e.g. VSCODE_PID). For now, both default to
@@ -26,7 +25,6 @@ export function detectPlatform() {
26
25
 
27
26
  // Check unique env vars first, then fall back to shared ones.
28
27
  if (process.env.GEMINI_PROJECT_DIR) return "gemini-cli";
29
- if (process.env.OPENCODE_PROJECT_DIR) return "opencode";
30
28
  if (process.env.CLAUDE_PROJECT_DIR) return "claude-code";
31
29
 
32
30
  return "claude-code";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trueline-mcp",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "type": "module",
5
5
  "description": "Truth-verified file editing for AI coding agents via MCP",
6
6
  "license": "Apache-2.0",