@levnikolaevich/hex-line-mcp 1.14.0 → 1.14.1

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.
Files changed (2) hide show
  1. package/dist/server.mjs +23 -11
  2. package/package.json +1 -1
package/dist/server.mjs CHANGED
@@ -3572,7 +3572,7 @@ function inspectPath(inputPath, opts = {}) {
3572
3572
  }
3573
3573
 
3574
3574
  // lib/setup.mjs
3575
- import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as existsSync6, mkdirSync, copyFileSync } from "node:fs";
3575
+ import { readFileSync as readFileSync5, writeFileSync as writeFileSync2, existsSync as existsSync6, mkdirSync, copyFileSync, renameSync, unlinkSync } from "node:fs";
3576
3576
  import { resolve as resolve7, dirname as dirname4, join as join5 } from "node:path";
3577
3577
  import { fileURLToPath as fileURLToPath2 } from "node:url";
3578
3578
  import { homedir } from "node:os";
@@ -3603,11 +3603,27 @@ var CLAUDE_HOOKS = {
3603
3603
  };
3604
3604
  function readJson(filePath) {
3605
3605
  if (!existsSync6(filePath)) return null;
3606
- return JSON.parse(readFileSync5(filePath, "utf-8"));
3606
+ try {
3607
+ return JSON.parse(readFileSync5(filePath, "utf-8"));
3608
+ } catch {
3609
+ process.stderr.write(`hex-line: warning \u2014 failed to parse ${filePath}, skipping
3610
+ `);
3611
+ return null;
3612
+ }
3607
3613
  }
3608
3614
  function writeJson(filePath, data) {
3609
3615
  mkdirSync(dirname4(filePath), { recursive: true });
3610
- writeFileSync2(filePath, JSON.stringify(data, null, 2) + "\n", "utf-8");
3616
+ const tmp = `${filePath}.hexline-tmp-${process.pid}`;
3617
+ try {
3618
+ writeFileSync2(tmp, JSON.stringify(data, null, 2) + "\n", "utf-8");
3619
+ renameSync(tmp, filePath);
3620
+ } catch (err) {
3621
+ try {
3622
+ unlinkSync(tmp);
3623
+ } catch {
3624
+ }
3625
+ throw err;
3626
+ }
3611
3627
  }
3612
3628
  function findEntryByCommand(entries) {
3613
3629
  return entries.findIndex(
@@ -3643,10 +3659,6 @@ function writeHooksToFile(settingsPath) {
3643
3659
  changed = true;
3644
3660
  }
3645
3661
  }
3646
- if (config.disableAllHooks !== false) {
3647
- config.disableAllHooks = false;
3648
- changed = true;
3649
- }
3650
3662
  if (changed) writeJson(settingsPath, config);
3651
3663
  return changed;
3652
3664
  }
@@ -4115,7 +4127,7 @@ async function fileChanges(filePath, compareAgainst = "HEAD") {
4115
4127
  }
4116
4128
 
4117
4129
  // lib/bulk-replace.mjs
4118
- import { writeFileSync as writeFileSync3, readdirSync as readdirSync3, renameSync, unlinkSync } from "node:fs";
4130
+ import { writeFileSync as writeFileSync3, readdirSync as readdirSync3, renameSync as renameSync2, unlinkSync as unlinkSync2 } from "node:fs";
4119
4131
  import { resolve as resolve9, relative as relative4, join as join7 } from "node:path";
4120
4132
  var ignoreMod;
4121
4133
  try {
@@ -4191,10 +4203,10 @@ function bulkReplace(rootDir, globPattern, replacements, opts = {}) {
4191
4203
  const tempPath = `${file}.hexline-tmp-${process.pid}`;
4192
4204
  try {
4193
4205
  writeFileSync3(tempPath, content, "utf-8");
4194
- renameSync(tempPath, file);
4206
+ renameSync2(tempPath, file);
4195
4207
  } catch (error) {
4196
4208
  try {
4197
- unlinkSync(tempPath);
4209
+ unlinkSync2(tempPath);
4198
4210
  } catch {
4199
4211
  }
4200
4212
  throw error;
@@ -4234,7 +4246,7 @@ OUTPUT_CAPPED: Output exceeded ${MAX_BULK_OUTPUT_CHARS} chars.`;
4234
4246
  }
4235
4247
 
4236
4248
  // server.mjs
4237
- var version = true ? "1.14.0" : (await null).createRequire(import.meta.url)("./package.json").version;
4249
+ var version = true ? "1.14.1" : (await null).createRequire(import.meta.url)("./package.json").version;
4238
4250
  var { server, StdioServerTransport } = await createServerRuntime({
4239
4251
  name: "hex-line-mcp",
4240
4252
  version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@levnikolaevich/hex-line-mcp",
3
- "version": "1.14.0",
3
+ "version": "1.14.1",
4
4
  "mcpName": "io.github.levnikolaevich/hex-line-mcp",
5
5
  "type": "module",
6
6
  "description": "Hash-verified file editing MCP + token efficiency hook for AI coding agents. 9 tools: inspect_path, read, edit, write, grep, outline, verify, changes, bulk_replace.",