@levnikolaevich/hex-line-mcp 1.1.2 → 1.2.0
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/hook.mjs +2 -2
- package/lib/search.mjs +1 -0
- package/package.json +1 -1
- package/server.mjs +6 -5
package/hook.mjs
CHANGED
|
@@ -43,13 +43,13 @@ const TOOL_HINTS = {
|
|
|
43
43
|
Read: "mcp__hex-line__read_file (not Read). For writing: write_file (no prior Read needed)",
|
|
44
44
|
Edit: "mcp__hex-line__edit_file (not Edit, not sed -i). read_file first for hashes",
|
|
45
45
|
Write: "mcp__hex-line__write_file (not Write). No prior Read needed",
|
|
46
|
-
Grep: "mcp__hex-line__grep_search (not Grep,
|
|
46
|
+
Grep: "mcp__hex-line__grep_search (not Grep). Params: case_insensitive, smart_case",
|
|
47
47
|
cat: "mcp__hex-line__read_file (not cat/head/tail/less/more)",
|
|
48
48
|
head: "mcp__hex-line__read_file with limit param (not head)",
|
|
49
49
|
tail: "mcp__hex-line__read_file with offset param (not tail)",
|
|
50
50
|
ls: "mcp__hex-line__directory_tree with pattern param (not ls/find/tree). E.g. pattern='*-mcp' type='dir'",
|
|
51
51
|
stat: "mcp__hex-line__get_file_info (not stat/wc/file)",
|
|
52
|
-
grep: "mcp__hex-line__grep_search (not grep/rg)",
|
|
52
|
+
grep: "mcp__hex-line__grep_search (not grep/rg). Params: case_insensitive, smart_case",
|
|
53
53
|
sed: "mcp__hex-line__edit_file (not sed -i). read_file first for hashes",
|
|
54
54
|
diff: "mcp__hex-line__changes (not diff). Git-based semantic diff",
|
|
55
55
|
outline: "mcp__hex-line__outline (before reading large code files)",
|
package/lib/search.mjs
CHANGED
|
@@ -30,6 +30,7 @@ export function grepSearch(pattern, opts = {}) {
|
|
|
30
30
|
const plain = !!opts.plain;
|
|
31
31
|
|
|
32
32
|
if (opts.caseInsensitive) args.push("-i");
|
|
33
|
+
else if (opts.smartCase) args.push("-S");
|
|
33
34
|
if (opts.context && opts.context > 0) args.push("-C", String(opts.context));
|
|
34
35
|
if (opts.glob) args.push("--glob", opts.glob);
|
|
35
36
|
if (opts.type) args.push("--type", opts.type);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levnikolaevich/hex-line-mcp",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Hash-verified file editing MCP + token efficiency hook for AI coding agents. 11 tools: read, edit, write, grep, outline, verify, directory_tree, file_info, setup_hooks, changes, bulk_replace.",
|
|
6
6
|
"main": "server.mjs",
|
package/server.mjs
CHANGED
|
@@ -54,7 +54,7 @@ try {
|
|
|
54
54
|
process.exit(1);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
const server = new McpServer({ name: "hex-line-mcp", version: "1.
|
|
57
|
+
const server = new McpServer({ name: "hex-line-mcp", version: "1.2.0" });
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
// ==================== read_file ====================
|
|
@@ -166,17 +166,18 @@ server.registerTool("grep_search", {
|
|
|
166
166
|
path: z.string().optional().describe("Search dir/file (default: cwd)"),
|
|
167
167
|
glob: z.string().optional().describe('Glob filter (e.g. "*.ts")'),
|
|
168
168
|
type: z.string().optional().describe('File type (e.g. "js", "py")'),
|
|
169
|
-
case_insensitive: flexBool().describe("Ignore case"),
|
|
169
|
+
case_insensitive: flexBool().describe("Ignore case (-i)"),
|
|
170
|
+
smart_case: flexBool().describe("CI when pattern is all lowercase, CS if it has uppercase (-S)"),
|
|
170
171
|
context: flexNum().describe("Context lines around matches"),
|
|
171
172
|
limit: flexNum().describe("Max matches per file (default: 100)"),
|
|
172
173
|
plain: flexBool().describe("Omit hash tags, return file:line:content"),
|
|
173
174
|
}),
|
|
174
175
|
annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },
|
|
175
176
|
}, async (rawParams) => {
|
|
176
|
-
const { pattern, path: p, glob, type, case_insensitive, context, limit, plain } = coerceParams(rawParams);
|
|
177
|
+
const { pattern, path: p, glob, type, case_insensitive, smart_case, context, limit, plain } = coerceParams(rawParams);
|
|
177
178
|
try {
|
|
178
179
|
const result = await grepSearch(pattern, {
|
|
179
|
-
path: p, glob, type, caseInsensitive: case_insensitive, context, limit, plain,
|
|
180
|
+
path: p, glob, type, caseInsensitive: case_insensitive, smartCase: smart_case, context, limit, plain,
|
|
180
181
|
});
|
|
181
182
|
return { content: [{ type: "text", text: result }] };
|
|
182
183
|
} catch (e) {
|
|
@@ -364,4 +365,4 @@ server.registerTool("bulk_replace", {
|
|
|
364
365
|
|
|
365
366
|
const transport = new StdioServerTransport();
|
|
366
367
|
await server.connect(transport);
|
|
367
|
-
void checkForUpdates("@levnikolaevich/hex-line-mcp", "1.
|
|
368
|
+
void checkForUpdates("@levnikolaevich/hex-line-mcp", "1.2.0");
|