@fusengine/harness 0.1.88 → 0.1.89

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/dist/cli/bin.mjs CHANGED
@@ -3,7 +3,7 @@ import { o as resolveStdinMaxBytes } from "../limits-DG5pl-5s.mjs";
3
3
  import { c as resolveTtlSec, r as loadDotenv } from "../dotenv-BLBkBTww.mjs";
4
4
  import { t as detectHarness } from "../harness-BMuLJ9lm.mjs";
5
5
  import { t as claudeHome } from "../home-state-oUGFB4ds.mjs";
6
- import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-DdWG0Meg.mjs";
6
+ import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-CdIlUtjv.mjs";
7
7
  import { n as writeInitFile, t as initFor } from "../run-TAXNRSpD.mjs";
8
8
  import { $ as runningVersion, Q as runDoctor, Z as notify, et as versionBanner, i as respond, t as handleHook, zt as todayUtc } from "../handle-DHhukRdh.mjs";
9
9
  import { delimiter, join } from "node:path";
@@ -1,7 +1,12 @@
1
1
  //#region src/cli/run.d.ts
2
2
  /** Staged files (Added/Copied/Modified/Renamed). Uses `node:child_process` (Bun shell can hang on `git show`). */
3
3
  declare function stagedFiles(): string[];
4
- /** Read a file's staged (index) content — not the working-tree version. */
4
+ /**
5
+ * Read a file's staged (index) content — not the working-tree version.
6
+ * Uses `execFileSync` with an argv array (never a shell), so a staged
7
+ * filename containing shell metacharacters (backticks, `$(...)`, quotes)
8
+ * reaches `git show` as a single literal argument — see issue #87.
9
+ */
5
10
  declare function stagedContent(path: string): string;
6
11
  /**
7
12
  * Evaluate staged code files against the policy core; return violation blocks.
@@ -1,2 +1,2 @@
1
- import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-DdWG0Meg.mjs";
1
+ import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-CdIlUtjv.mjs";
2
2
  export { checkStaged, stagedContent, stagedFiles };
@@ -1,15 +1,25 @@
1
1
  import { t as isCodeFile } from "./project-root-3kk7gCOp.mjs";
2
2
  import { t as evaluate } from "./evaluate-C1VSI5pb.mjs";
3
3
  import { t as formatPrompt } from "./types-ernB1Dy3.mjs";
4
- import { execSync } from "node:child_process";
4
+ import { execFileSync } from "node:child_process";
5
5
  //#region src/cli/run.ts
6
6
  /** Staged files (Added/Copied/Modified/Renamed). Uses `node:child_process` (Bun shell can hang on `git show`). */
7
7
  function stagedFiles() {
8
- return execSync("git diff --cached --name-only --diff-filter=ACMR", { encoding: "utf8" }).trim().split("\n").filter(Boolean);
8
+ return execFileSync("git", [
9
+ "diff",
10
+ "--cached",
11
+ "--name-only",
12
+ "--diff-filter=ACMR"
13
+ ], { encoding: "utf8" }).trim().split("\n").filter(Boolean);
9
14
  }
10
- /** Read a file's staged (index) content — not the working-tree version. */
15
+ /**
16
+ * Read a file's staged (index) content — not the working-tree version.
17
+ * Uses `execFileSync` with an argv array (never a shell), so a staged
18
+ * filename containing shell metacharacters (backticks, `$(...)`, quotes)
19
+ * reaches `git show` as a single literal argument — see issue #87.
20
+ */
11
21
  function stagedContent(path) {
12
- return execSync(`git show ":${path}"`, { encoding: "utf8" });
22
+ return execFileSync("git", ["show", `:${path}`], { encoding: "utf8" });
13
23
  }
14
24
  /**
15
25
  * Evaluate staged code files against the policy core; return violation blocks.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fusengine/harness",
3
- "version": "0.1.88",
3
+ "version": "0.1.89",
4
4
  "description": "Harness-agnostic toolkit for AI coding agents: runtime harness detection (Claude Code, Codex, Cursor, Cline, Gemini, Aider...), pure policy core (env config, project/framework detection, SOLID/file-size limits, APEX freshness, guard patterns, portable prompts), cache, project memory, ref routing, state/locks, statusline, per-harness adapters (Claude/Cursor/Cline/Gemini) and a cli-mode harness-check binary. Bun-native, with a built dist for Node + bundlers.",
5
5
  "type": "module",
6
6
  "module": "src/index.ts",