@fusengine/harness 0.1.27 → 0.1.29
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/adapters/claude/index.mjs +1 -1
- package/dist/adapters/cline/index.mjs +1 -1
- package/dist/adapters/codex/index.mjs +1 -1
- package/dist/adapters/cursor/index.mjs +1 -1
- package/dist/adapters/gemini/index.mjs +1 -1
- package/dist/{claude-CeNVUGku.mjs → claude-B9FYp0Yw.mjs} +1 -1
- package/dist/cli/bin.mjs +2 -2
- package/dist/cli/index.mjs +1 -1
- package/dist/{evaluate-BIK60lOR.mjs → evaluate-j3gRJ_ng.mjs} +34 -5
- package/dist/handle-nu3GYVek.mjs +1090 -0
- package/dist/{index-DNAzITvw.d.mts → index-BqdCjaT9.d.mts} +71 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -4
- package/dist/policy/index.d.mts +2 -2
- package/dist/policy/index.mjs +4 -4
- package/dist/policy-la_KkjCS.mjs +1 -0
- package/dist/{run-BdcSLer0.mjs → run-CXsV-wIJ.mjs} +1 -1
- package/dist/runtime/index.d.mts +33 -8
- package/dist/runtime/index.mjs +2 -2
- package/dist/skill-triggers-BZxov1es.mjs +676 -0
- package/package.json +1 -1
- package/dist/handle-BJ2xdeA-.mjs +0 -347
- package/dist/policy-EuVJ_5hS.mjs +0 -33
- package/dist/verbosity-CXpf3aQQ.mjs +0 -98
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readClaudeInput, i as guard, n as denyResponse, o as toClaudeResponse, r as fileSizeGuard, t as contextResponse } from "../../claude-
|
|
1
|
+
import { a as readClaudeInput, i as guard, n as denyResponse, o as toClaudeResponse, r as fileSizeGuard, t as contextResponse } from "../../claude-B9FYp0Yw.mjs";
|
|
2
2
|
export { contextResponse, denyResponse, fileSizeGuard, guard, readClaudeInput, toClaudeResponse };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as readClaudeInput, i as guard, n as denyResponse, t as contextResponse } from "../../claude-
|
|
1
|
+
import { a as readClaudeInput, i as guard, n as denyResponse, t as contextResponse } from "../../claude-B9FYp0Yw.mjs";
|
|
2
2
|
export { contextResponse, denyResponse, guard, readClaudeInput as readCodexInput };
|
package/dist/cli/bin.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { r as resolveTtlSec } from "../ttl-BG55s6HZ.mjs";
|
|
3
3
|
import { t as detectHarness } from "../harness-C8Nxxyn_.mjs";
|
|
4
|
-
import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-
|
|
4
|
+
import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-CXsV-wIJ.mjs";
|
|
5
5
|
import { n as writeInitFile, t as initFor } from "../run-D91N4ul1.mjs";
|
|
6
|
-
import { t as handleHook } from "../handle-
|
|
6
|
+
import { t as handleHook } from "../handle-nu3GYVek.mjs";
|
|
7
7
|
//#region src/cli/bin.ts
|
|
8
8
|
/**
|
|
9
9
|
* harness — CLI for @fusengine/harness.
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-
|
|
1
|
+
import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-CXsV-wIJ.mjs";
|
|
2
2
|
export { checkStaged, stagedContent, stagedFiles };
|
|
@@ -22,9 +22,21 @@ function detectFramework(filePath, content) {
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
//#region src/policy/file-size.ts
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* Count substantive (code-only) lines — blank lines and comment-only lines
|
|
27
|
+
* (`//`, `*`, `/*` block-comment bodies) don't count toward the SOLID limit, so a
|
|
28
|
+
* well-documented file isn't penalized for its JSDoc. (`#` is intentionally NOT
|
|
29
|
+
* skipped: it is code in Rust `#[derive]` and C `#include`, not a comment.)
|
|
30
|
+
*/
|
|
26
31
|
function countLines(content) {
|
|
27
|
-
|
|
32
|
+
if (content === "") return 0;
|
|
33
|
+
let n = 0;
|
|
34
|
+
for (const line of content.split("\n")) {
|
|
35
|
+
const s = line.trim();
|
|
36
|
+
if (!s || s.startsWith("//") || s.startsWith("*") || s.startsWith("/*")) continue;
|
|
37
|
+
n++;
|
|
38
|
+
}
|
|
39
|
+
return n;
|
|
28
40
|
}
|
|
29
41
|
/**
|
|
30
42
|
* Evaluate a file's line count against the SOLID limit.
|
|
@@ -118,7 +130,7 @@ const CRITICAL_PATTERNS = [
|
|
|
118
130
|
/\b(?:curl|wget)\b[^|]*\|\s*(?:sudo\s+)?(?:ba|z|da|k)?sh\b/,
|
|
119
131
|
/\bchmod\s+(?:-[a-zA-Z]+\s+)*777\s+\//,
|
|
120
132
|
/\bmkfs(?:\.[a-z0-9]+)?\b/,
|
|
121
|
-
/\bdd\b[^\n]*\bof=\/dev\/(?:disk|sd|hd|nvme|mmcblk|vd)/i,
|
|
133
|
+
/\bdd\b[^\n]*\bof=\/dev\/(?:r?disk|sd|hd|nvme|mmcblk|vd|xvd)/i,
|
|
122
134
|
/\bshred\b/,
|
|
123
135
|
/\bfdisk\b/,
|
|
124
136
|
/\bdiskutil\s+(?:erase|partitionDisk)/i,
|
|
@@ -139,9 +151,26 @@ const ASK_PATTERNS = [
|
|
|
139
151
|
/\bunlink\s/,
|
|
140
152
|
/\bdel\s/
|
|
141
153
|
];
|
|
142
|
-
/**
|
|
154
|
+
/**
|
|
155
|
+
* Strip heredoc bodies so their content isn't matched as a command (false positives).
|
|
156
|
+
* Two-phase scan: a backreference-free opener regex finds `<<[-]DELIM`, then the body
|
|
157
|
+
* is cut up to the closing delimiter via `indexOf` — O(n), no catastrophic backtracking.
|
|
158
|
+
*/
|
|
143
159
|
function stripHeredoc(cmd) {
|
|
144
|
-
|
|
160
|
+
const opener = /<<-?\s*['"]?(\w+)['"]?/g;
|
|
161
|
+
let out = cmd;
|
|
162
|
+
let m;
|
|
163
|
+
while ((m = opener.exec(out)) !== null) {
|
|
164
|
+
const delim = m[1] ?? "";
|
|
165
|
+
const closer = new RegExp(`\\n[ \\t]*${delim}\\b`);
|
|
166
|
+
const rest = out.slice(m.index + m[0].length);
|
|
167
|
+
const hit = closer.exec(rest);
|
|
168
|
+
if (!hit || hit.index === void 0) break;
|
|
169
|
+
const end = m.index + m[0].length + hit.index + hit[0].length;
|
|
170
|
+
out = `${out.slice(0, m.index)} ${out.slice(end)}`;
|
|
171
|
+
opener.lastIndex = m.index;
|
|
172
|
+
}
|
|
173
|
+
return out;
|
|
145
174
|
}
|
|
146
175
|
/** Guards against dangerous Bash commands (critical → block, sensitive → ask). */
|
|
147
176
|
function securityGuard(ctx) {
|