@fusengine/harness 0.1.14 → 0.1.15
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-BoZuNxXl.mjs → claude-0DB5pb4d.mjs} +1 -1
- package/dist/cli/bin.mjs +5 -3
- package/dist/cli/index.mjs +1 -1
- package/dist/config/index.mjs +2 -1
- package/dist/config-la_KkjCS.mjs +1 -0
- package/dist/{evaluate-qGG2Ul0W.mjs → evaluate-urGmc24B.mjs} +16 -9
- package/dist/{handle-D-DClzB2.mjs → handle-D_cJGRjJ.mjs} +5 -4
- package/dist/{index-CQOPshSM.d.mts → index-BKSKTgnV.d.mts} +1 -5
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +3 -3
- package/dist/policy/index.d.mts +2 -2
- package/dist/policy/index.mjs +2 -2
- package/dist/{run-B-_9dPR6.mjs → run-CsWHdBJp.mjs} +1 -1
- package/dist/runtime/index.d.mts +4 -2
- package/dist/runtime/index.mjs +1 -1
- package/package.json +1 -1
- /package/dist/{config-BG55s6HZ.mjs → ttl-BG55s6HZ.mjs} +0 -0
|
@@ -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-0DB5pb4d.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-0DB5pb4d.mjs";
|
|
2
2
|
export { contextResponse, denyResponse, guard, readClaudeInput as readCodexInput };
|
package/dist/cli/bin.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { r as resolveTtlSec } from "../ttl-BG55s6HZ.mjs";
|
|
2
3
|
import { t as detectHarness } from "../harness-C8Nxxyn_.mjs";
|
|
3
|
-
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-CsWHdBJp.mjs";
|
|
4
5
|
import { n as writeInitFile, t as initFor } from "../run-D91N4ul1.mjs";
|
|
5
|
-
import { t as handleHook } from "../handle-
|
|
6
|
+
import { t as handleHook } from "../handle-D_cJGRjJ.mjs";
|
|
6
7
|
//#region src/cli/bin.ts
|
|
7
8
|
/**
|
|
8
9
|
* harness — CLI for @fusengine/harness.
|
|
@@ -27,7 +28,8 @@ if (cmd === "hook") {
|
|
|
27
28
|
const outcome = await handleHook(process.argv[3] ?? detectHarness().id, await readStdin(), {
|
|
28
29
|
now: Date.now(),
|
|
29
30
|
cwd: process.cwd(),
|
|
30
|
-
refsDir: process.env.FUSE_HARNESS_REFS
|
|
31
|
+
refsDir: process.env.FUSE_HARNESS_REFS,
|
|
32
|
+
windowMs: resolveTtlSec(process.env) * 1e3
|
|
31
33
|
});
|
|
32
34
|
if (outcome.stdout) process.stdout.write(outcome.stdout);
|
|
33
35
|
process.exit(outcome.exit);
|
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-CsWHdBJp.mjs";
|
|
2
2
|
export { checkStaged, stagedContent, stagedFiles };
|
package/dist/config/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { a as parseEnvInt, i as splitTarget, n as MAX_LINES_ENV_KEY, r as resolveMaxLines, t as DEFAULT_MAX_LINES } from "../limits-CHn8AIL1.mjs";
|
|
2
|
-
import { i as ttlLabel, n as TTL_ENV_KEY, r as resolveTtlSec, t as DEFAULT_TTL_SEC } from "../
|
|
2
|
+
import { i as ttlLabel, n as TTL_ENV_KEY, r as resolveTtlSec, t as DEFAULT_TTL_SEC } from "../ttl-BG55s6HZ.mjs";
|
|
3
3
|
import { n as STATE_ROOT, r as projectLayout, t as STATE_GITIGNORE } from "../layout-C0jaaCQC.mjs";
|
|
4
|
+
import "../config-la_KkjCS.mjs";
|
|
4
5
|
export { DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, MAX_LINES_ENV_KEY, STATE_GITIGNORE, STATE_ROOT, TTL_ENV_KEY, parseEnvInt, projectLayout, resolveMaxLines, resolveTtlSec, splitTarget, ttlLabel };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -82,7 +82,9 @@ const SYSTEM_INSTALL = [
|
|
|
82
82
|
/brew upgrade/,
|
|
83
83
|
/brew cask/,
|
|
84
84
|
/apt install/,
|
|
85
|
-
/apt-get install
|
|
85
|
+
/apt-get install/,
|
|
86
|
+
/dnf install/,
|
|
87
|
+
/pacman -S/
|
|
86
88
|
];
|
|
87
89
|
/** Project-level package installs. */
|
|
88
90
|
const PROJECT_INSTALL = [
|
|
@@ -228,18 +230,13 @@ function interfaceSeparationGuard(ctx) {
|
|
|
228
230
|
}
|
|
229
231
|
//#endregion
|
|
230
232
|
//#region src/policy/guards/install.ts
|
|
231
|
-
/** Project-level dependency installs (npm/yarn/pnpm/bun/pip/cargo/go/gem/composer). */
|
|
232
|
-
const PROJECT_INSTALL_RE = /\b(?:npm\s+(?:install|i)|(?:yarn|pnpm|bun)\s+add|pip3?\s+install|cargo\s+install|go\s+install|gem\s+install|composer\s+require)\b/;
|
|
233
|
-
/** System-level package installs (brew/apt/apt-get/dnf/pacman). */
|
|
234
|
-
const SYSTEM_INSTALL_RE = /\b(?:brew\s+install|apt(?:-get)?\s+install|dnf\s+install|pacman\s+-S)\b/;
|
|
235
233
|
/** Asks for confirmation before a dependency or system package install. */
|
|
236
234
|
function installGuard(ctx) {
|
|
237
235
|
if (ctx.tool !== "Bash" || !ctx.command) return null;
|
|
238
|
-
|
|
239
|
-
if (PROJECT_INSTALL_RE.test(cmd) || SYSTEM_INSTALL_RE.test(cmd)) return {
|
|
236
|
+
if (matchPatterns(ctx.command, PROJECT_INSTALL) || matchPatterns(ctx.command, SYSTEM_INSTALL)) return {
|
|
240
237
|
kind: "ask",
|
|
241
238
|
title: "Dependency install",
|
|
242
|
-
reason: `This command installs packages: ${
|
|
239
|
+
reason: `This command installs packages: ${ctx.command.trim()}`,
|
|
243
240
|
actions: ["Confirm this install is intended"]
|
|
244
241
|
};
|
|
245
242
|
return null;
|
|
@@ -289,6 +286,16 @@ function evaluate(ctx) {
|
|
|
289
286
|
}
|
|
290
287
|
};
|
|
291
288
|
}
|
|
289
|
+
if (ctx.command && matchPatterns(ctx.command, GIT_ASK)) return {
|
|
290
|
+
decision: "deny",
|
|
291
|
+
message: `Git operation requires confirmation: ${ctx.command}`,
|
|
292
|
+
prompt: {
|
|
293
|
+
kind: "ask",
|
|
294
|
+
title: "Confirm git operation",
|
|
295
|
+
reason: `Authorize: ${ctx.command.trim()}`,
|
|
296
|
+
actions: ["Approve if this git operation is intended"]
|
|
297
|
+
}
|
|
298
|
+
};
|
|
292
299
|
if (ctx.filePath && isCodeFile(ctx.filePath) && ctx.content !== void 0) {
|
|
293
300
|
const verdict = evaluateFileSize(countLines(ctx.content), ctx.maxLines);
|
|
294
301
|
if (!verdict.ok) return {
|
|
@@ -313,4 +320,4 @@ function evaluate(ctx) {
|
|
|
313
320
|
};
|
|
314
321
|
}
|
|
315
322
|
//#endregion
|
|
316
|
-
export {
|
|
323
|
+
export { matchPatterns as C, detectFramework as E, SYSTEM_INSTALL as S, evaluateFileSize as T, CRITICAL_PATTERNS as _, PHP_DECL_RE as a, GIT_BLOCKED as b, TS_DECL_RE as c, CODE_MUTATORS as d, CODE_REDIRECT as f, ASK_PATTERNS as g, protectedPathGuard as h, installGuard as i, interfaceSeparationGuard as l, PROTECTED_FRAGMENTS as m, GUARDS as n, PY_MODEL_RE as o, bashWriteGuard as p, runGuards as r, SWIFT_PROTO_RE as s, evaluate as t, ASK_WRITERS as u, securityGuard as v, countLines as w, PROJECT_INSTALL as x, GIT_ASK as y };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as projectLayout } from "./layout-C0jaaCQC.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { E as detectFramework, t as evaluate } from "./evaluate-urGmc24B.mjs";
|
|
3
3
|
import { n as capVerbosity, o as evaluateApex } from "./verbosity-ZYT7tLCw.mjs";
|
|
4
4
|
import { t as formatPrompt } from "./types-ernB1Dy3.mjs";
|
|
5
5
|
import { a as extractText, r as cacheStore, t as cacheLookup } from "./store-DeIsfMg5.mjs";
|
|
@@ -49,8 +49,8 @@ function activityFor(event) {
|
|
|
49
49
|
//#region src/runtime/gate.ts
|
|
50
50
|
/** Prior agents the freshness gate requires before a code edit. */
|
|
51
51
|
const REQUIRED_AGENTS = ["explore-codebase", "research-expert"];
|
|
52
|
-
/** Default freshness window for {@link REQUIRED_AGENTS} (
|
|
53
|
-
const DEFAULT_WINDOW_MS =
|
|
52
|
+
/** Default freshness window for {@link REQUIRED_AGENTS} (2 min — matches the plugin's `FUSE_ENFORCE_TTL_SEC` default). */
|
|
53
|
+
const DEFAULT_WINDOW_MS = 12e4;
|
|
54
54
|
/** Trivial edits allowed within the window before the full APEX gates apply. */
|
|
55
55
|
const TRIVIAL_BUDGET = 4;
|
|
56
56
|
/**
|
|
@@ -67,7 +67,7 @@ async function gate(input) {
|
|
|
67
67
|
});
|
|
68
68
|
if (quick.decision !== "allow" && quick.prompt) return quick.prompt;
|
|
69
69
|
if (!input.filePath) return null;
|
|
70
|
-
const window = input.windowMs ??
|
|
70
|
+
const window = input.windowMs ?? 12e4;
|
|
71
71
|
const track = await loadTrack(input.trackFile);
|
|
72
72
|
const lineCount = input.content === void 0 ? Number.POSITIVE_INFINITY : input.content.split("\n").length;
|
|
73
73
|
if (!input.isReplaceAll && lineCount < 5 && trivialCount(track, window, input.now) < 4) {
|
|
@@ -272,6 +272,7 @@ async function handleHook(id, payload, opts) {
|
|
|
272
272
|
command: event.command,
|
|
273
273
|
refs: opts.refsDir ? await loadRefs(opts.refsDir) : void 0,
|
|
274
274
|
isReplaceAll: event.input.replace_all === true,
|
|
275
|
+
windowMs: opts.windowMs,
|
|
275
276
|
now: opts.now,
|
|
276
277
|
trackFile: file
|
|
277
278
|
});
|
|
@@ -177,10 +177,6 @@ declare const SWIFT_PROTO_RE: RegExp;
|
|
|
177
177
|
declare function interfaceSeparationGuard(ctx: GuardContext): Prompt | null;
|
|
178
178
|
//#endregion
|
|
179
179
|
//#region src/policy/guards/install.d.ts
|
|
180
|
-
/** Project-level dependency installs (npm/yarn/pnpm/bun/pip/cargo/go/gem/composer). */
|
|
181
|
-
declare const PROJECT_INSTALL_RE: RegExp;
|
|
182
|
-
/** System-level package installs (brew/apt/apt-get/dnf/pacman). */
|
|
183
|
-
declare const SYSTEM_INSTALL_RE: RegExp;
|
|
184
180
|
/** Asks for confirmation before a dependency or system package install. */
|
|
185
181
|
declare function installGuard(ctx: GuardContext): Prompt | null;
|
|
186
182
|
//#endregion
|
|
@@ -207,4 +203,4 @@ declare const MAX_EXA_RESULTS = 3;
|
|
|
207
203
|
*/
|
|
208
204
|
declare function capVerbosity(tool: string, input: Record<string, unknown>): Record<string, unknown> | null;
|
|
209
205
|
//#endregion
|
|
210
|
-
export {
|
|
206
|
+
export { solidReadGate as A, countLines as B, APEX_GATES as C, docConsultedGate as D, brainstormGate as E, GIT_BLOCKED as F, detectProjectType as G, detectFramework as H, PROJECT_INSTALL as I, isApexCommand as K, SYSTEM_INSTALL as L, PolicyResult as M, evaluate as N, evaluateApex as O, GIT_ASK as P, matchPatterns as R, GuardContext as S, ApexGate as T, DEV_KEYWORDS as U, evaluateFileSize as V, ProjectType as W, protectedPathGuard as _, runGuards as a, securityGuard as b, PY_MODEL_RE as c, interfaceSeparationGuard as d, ASK_WRITERS as f, PROTECTED_FRAGMENTS as g, bashWriteGuard as h, GUARDS as i, PolicyContext as j, freshnessGate as k, SWIFT_PROTO_RE as l, CODE_REDIRECT as m, capVerbosity as n, installGuard as o, CODE_MUTATORS as p, detectCreationIntent as r, PHP_DECL_RE as s, MAX_EXA_RESULTS as t, TS_DECL_RE as u, ASK_PATTERNS as v, ApexContext as w, Guard as x, CRITICAL_PATTERNS as y, FileSizeVerdict as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -5,10 +5,10 @@ import { a as detectHarness, i as HarnessVia, n as HarnessInfo, o as detectMode,
|
|
|
5
5
|
import { a as isDocConsulted, i as formatDocSatisfactionStatus, n as DocSatisfactionStatus, o as resolveSessions, r as formatDocDeny, t as AuthEntry } from "./doc-helpers-CG1nuf-c.mjs";
|
|
6
6
|
import { t as incrementTrivialEditCounter } from "./index-BOBXQ91y.mjs";
|
|
7
7
|
import { i as compactJson, n as projectRoot, r as projectRootOrNull, t as isCodeFile } from "./index-C1vLIMwN.mjs";
|
|
8
|
-
import { A as
|
|
8
|
+
import { A as solidReadGate, B as countLines, C as APEX_GATES, D as docConsultedGate, E as brainstormGate, F as GIT_BLOCKED, G as detectProjectType, H as detectFramework, I as PROJECT_INSTALL, K as isApexCommand, L as SYSTEM_INSTALL, M as PolicyResult, N as evaluate, O as evaluateApex, P as GIT_ASK, R as matchPatterns, S as GuardContext, T as ApexGate, U as DEV_KEYWORDS, V as evaluateFileSize, W as ProjectType, _ as protectedPathGuard, a as runGuards, b as securityGuard, c as PY_MODEL_RE, d as interfaceSeparationGuard, f as ASK_WRITERS, g as PROTECTED_FRAGMENTS, h as bashWriteGuard, i as GUARDS, j as PolicyContext, k as freshnessGate, l as SWIFT_PROTO_RE, m as CODE_REDIRECT, n as capVerbosity, o as installGuard, p as CODE_MUTATORS, r as detectCreationIntent, s as PHP_DECL_RE, t as MAX_EXA_RESULTS, u as TS_DECL_RE, v as ASK_PATTERNS, w as ApexContext, x as Guard, y as CRITICAL_PATTERNS, z as FileSizeVerdict } from "./index-BKSKTgnV.mjs";
|
|
9
9
|
import { n as RouteResult, r as ScoredRef, t as RefMeta } from "./types-CY5qT2X1.mjs";
|
|
10
10
|
import { a as ReminderState, c as readState, d as throttleMs, i as registryFile, l as setStateField, n as addRoot, o as lessonsFileFor, r as readRoots, s as nowStamp, t as ensureMemoryGitignore, u as stateFileFor } from "./index-DLYhervv.mjs";
|
|
11
11
|
import { a as globToRe, i as scoreReferences, n as toRefMeta, o as parseFrontmatter, r as routeReferences, t as loadRefs } from "./index-hL_r6tlc.mjs";
|
|
12
12
|
import { a as taskStart, c as ensureStateDir, d as stateFilePath, f as acquireLock, i as taskCreate, l as loadState, n as ApexTaskFile, o as ApexState, r as taskComplete, s as apexStateDir, t as ApexTask, u as saveState } from "./index-CPoF_hLP.mjs";
|
|
13
13
|
import { _ as TIME_INTERVALS, a as formatCost, c as formatTokens, d as colors, f as progressiveColor, g as PROGRESS_CHARS, h as PROGRESS_BAR_DEFAULTS, i as formatBasename, l as ColorFn, m as GRADIENT_BLOCKS, n as generateGradientBar, o as formatPath, p as COLOR_THRESHOLDS, r as generateProgressBar, s as formatTimeLeft, t as ProgressBarOptions, u as Palette } from "./index-BWK8slRi.mjs";
|
|
14
|
-
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, ApexState, ApexTask, ApexTaskFile, AuthEntry, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, ColorFn, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, DocSatisfactionStatus, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GRADIENT_BLOCKS, GUARDS, Guard, GuardContext, HarnessId, HarnessInfo, HarnessMode, HarnessVia, IndexSummary, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, PHP_DECL_RE, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INSTALL,
|
|
14
|
+
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, ApexState, ApexTask, ApexTaskFile, AuthEntry, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, ColorFn, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, DocSatisfactionStatus, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GRADIENT_BLOCKS, GUARDS, Guard, GuardContext, HarnessId, HarnessInfo, HarnessMode, HarnessVia, IndexSummary, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, PHP_DECL_RE, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PY_MODEL_RE, Palette, PolicyContext, PolicyResult, ProgressBarOptions, ProjectLayout, ProjectType, Prompt, PromptKind, RefMeta, ReminderState, RouteResult, STATE_GITIGNORE, STATE_ROOT, SWIFT_PROTO_RE, SYSTEM_INSTALL, ScoredRef, TIME_INTERVALS, TS_DECL_RE, TTL_ENV_KEY, acquireLock, addRoot, apexStateDir, bashWriteGuard, brainstormGate, cacheLookup, cachePath, cacheStore, capVerbosity, colors, compactJson, compactMarkdown, countLines, detectCreationIntent, detectFramework, detectHarness, detectMode, detectProjectType, docConsultedGate, ensureMemoryGitignore, ensureStateDir, evaluate, evaluateApex, evaluateFileSize, extractText, formatBasename, formatCost, formatDocDeny, formatDocSatisfactionStatus, formatPath, formatPrompt, formatTimeLeft, formatTokens, freshnessGate, generateGradientBar, generateProgressBar, globToRe, incrementTrivialEditCounter, installGuard, interfaceSeparationGuard, isApexCommand, isCodeFile, isDocConsulted, jaccardSimilar, lessonsFileFor, loadIndex, loadRefs, loadState, matchPatterns, mcpCacheKey, modeFor, nowStamp, parseEnvInt, parseFrontmatter, progressiveColor, projectLayout, projectRoot, projectRootOrNull, protectedPathGuard, queryHash, readRoots, readState, registryFile, resolveMaxLines, resolveSessions, resolveTtlSec, routeReferences, runGuards, saveState, scoreReferences, securityGuard, setStateField, solidReadGate, splitTarget, stateFileFor, stateFilePath, summarizeIndex, taskComplete, taskCreate, taskStart, throttleMs, toRefMeta, ttlLabel };
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { a as parseEnvInt, i as splitTarget, n as MAX_LINES_ENV_KEY, r as resolveMaxLines, t as DEFAULT_MAX_LINES } from "./limits-CHn8AIL1.mjs";
|
|
2
|
-
import { i as ttlLabel, n as TTL_ENV_KEY, r as resolveTtlSec, t as DEFAULT_TTL_SEC } from "./
|
|
2
|
+
import { i as ttlLabel, n as TTL_ENV_KEY, r as resolveTtlSec, t as DEFAULT_TTL_SEC } from "./ttl-BG55s6HZ.mjs";
|
|
3
3
|
import { n as STATE_ROOT, r as projectLayout, t as STATE_GITIGNORE } from "./layout-C0jaaCQC.mjs";
|
|
4
4
|
import { t as compactJson } from "./compact-json-DK2nX-MK.mjs";
|
|
5
5
|
import { n as projectRoot, r as projectRootOrNull, t as isCodeFile } from "./project-root-ff0_poWU.mjs";
|
|
6
6
|
import { n as detectMode, r as modeFor, t as detectHarness } from "./harness-C8Nxxyn_.mjs";
|
|
7
7
|
import { i as isApexCommand, n as DEV_KEYWORDS, r as detectProjectType, t as detectCreationIntent } from "./policy-Cpa5aWek.mjs";
|
|
8
|
-
import { C as
|
|
8
|
+
import { C as matchPatterns, E as detectFramework, S as SYSTEM_INSTALL, T as evaluateFileSize, _ as CRITICAL_PATTERNS, a as PHP_DECL_RE, b as GIT_BLOCKED, c as TS_DECL_RE, d as CODE_MUTATORS, f as CODE_REDIRECT, g as ASK_PATTERNS, h as protectedPathGuard, i as installGuard, l as interfaceSeparationGuard, m as PROTECTED_FRAGMENTS, n as GUARDS, o as PY_MODEL_RE, p as bashWriteGuard, r as runGuards, s as SWIFT_PROTO_RE, t as evaluate, u as ASK_WRITERS, v as securityGuard, w as countLines, x as PROJECT_INSTALL, y as GIT_ASK } from "./evaluate-urGmc24B.mjs";
|
|
9
9
|
import { i as resolveSessions, n as formatDocSatisfactionStatus, r as isDocConsulted, t as formatDocDeny } from "./doc-helpers-Dd_x1-tZ.mjs";
|
|
10
10
|
import { i as parseFrontmatter, n as scoreReferences, r as globToRe, t as routeReferences } from "./router-Dj3AfgBE.mjs";
|
|
11
11
|
import { a as docConsultedGate, c as solidReadGate, i as brainstormGate, n as capVerbosity, o as evaluateApex, r as APEX_GATES, s as freshnessGate, t as MAX_EXA_RESULTS } from "./verbosity-ZYT7tLCw.mjs";
|
|
@@ -17,4 +17,4 @@ import { t as incrementTrivialEditCounter } from "./freshness-CezohJHo.mjs";
|
|
|
17
17
|
import { n as toRefMeta, t as loadRefs } from "./loader-BephwI8n.mjs";
|
|
18
18
|
import { a as ensureStateDir, c as stateFilePath, i as apexStateDir, l as acquireLock, n as taskCreate, o as loadState, r as taskStart, s as saveState, t as taskComplete } from "./state-Cs0Y0MG_.mjs";
|
|
19
19
|
import { a as formatPath, c as colors, d as GRADIENT_BLOCKS, f as PROGRESS_BAR_DEFAULTS, i as formatCost, l as progressiveColor, m as TIME_INTERVALS, n as generateProgressBar, o as formatTimeLeft, p as PROGRESS_CHARS, r as formatBasename, s as formatTokens, t as generateGradientBar, u as COLOR_THRESHOLDS } from "./statusline-D87eUNXl.mjs";
|
|
20
|
-
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, GIT_ASK, GIT_BLOCKED, GRADIENT_BLOCKS, GUARDS, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, PHP_DECL_RE, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INSTALL,
|
|
20
|
+
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, GIT_ASK, GIT_BLOCKED, GRADIENT_BLOCKS, GUARDS, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, PHP_DECL_RE, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PY_MODEL_RE, STATE_GITIGNORE, STATE_ROOT, SWIFT_PROTO_RE, SYSTEM_INSTALL, TIME_INTERVALS, TS_DECL_RE, TTL_ENV_KEY, acquireLock, addRoot, apexStateDir, bashWriteGuard, brainstormGate, cacheLookup, cachePath, cacheStore, capVerbosity, colors, compactJson, compactMarkdown, countLines, detectCreationIntent, detectFramework, detectHarness, detectMode, detectProjectType, docConsultedGate, ensureMemoryGitignore, ensureStateDir, evaluate, evaluateApex, evaluateFileSize, extractText, formatBasename, formatCost, formatDocDeny, formatDocSatisfactionStatus, formatPath, formatPrompt, formatTimeLeft, formatTokens, freshnessGate, generateGradientBar, generateProgressBar, globToRe, incrementTrivialEditCounter, installGuard, interfaceSeparationGuard, isApexCommand, isCodeFile, isDocConsulted, jaccardSimilar, lessonsFileFor, loadIndex, loadRefs, loadState, matchPatterns, mcpCacheKey, modeFor, nowStamp, parseEnvInt, parseFrontmatter, progressiveColor, projectLayout, projectRoot, projectRootOrNull, protectedPathGuard, queryHash, readRoots, readState, registryFile, resolveMaxLines, resolveSessions, resolveTtlSec, routeReferences, runGuards, saveState, scoreReferences, securityGuard, setStateField, solidReadGate, splitTarget, stateFileFor, stateFilePath, summarizeIndex, taskComplete, taskCreate, taskStart, throttleMs, toRefMeta, ttlLabel };
|
package/dist/policy/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, CODE_MUTATORS, CODE_REDIRECT, CRITICAL_PATTERNS, DEV_KEYWORDS, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GUARDS, Guard, GuardContext, MAX_EXA_RESULTS, PHP_DECL_RE, PROJECT_INSTALL,
|
|
1
|
+
import { A as solidReadGate, B as countLines, C as APEX_GATES, D as docConsultedGate, E as brainstormGate, F as GIT_BLOCKED, G as detectProjectType, H as detectFramework, I as PROJECT_INSTALL, K as isApexCommand, L as SYSTEM_INSTALL, M as PolicyResult, N as evaluate, O as evaluateApex, P as GIT_ASK, R as matchPatterns, S as GuardContext, T as ApexGate, U as DEV_KEYWORDS, V as evaluateFileSize, W as ProjectType, _ as protectedPathGuard, a as runGuards, b as securityGuard, c as PY_MODEL_RE, d as interfaceSeparationGuard, f as ASK_WRITERS, g as PROTECTED_FRAGMENTS, h as bashWriteGuard, i as GUARDS, j as PolicyContext, k as freshnessGate, l as SWIFT_PROTO_RE, m as CODE_REDIRECT, n as capVerbosity, o as installGuard, p as CODE_MUTATORS, r as detectCreationIntent, s as PHP_DECL_RE, t as MAX_EXA_RESULTS, u as TS_DECL_RE, v as ASK_PATTERNS, w as ApexContext, x as Guard, y as CRITICAL_PATTERNS, z as FileSizeVerdict } from "../index-BKSKTgnV.mjs";
|
|
2
|
+
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, CODE_MUTATORS, CODE_REDIRECT, CRITICAL_PATTERNS, DEV_KEYWORDS, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GUARDS, Guard, GuardContext, MAX_EXA_RESULTS, PHP_DECL_RE, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PY_MODEL_RE, PolicyContext, PolicyResult, ProjectType, SWIFT_PROTO_RE, SYSTEM_INSTALL, TS_DECL_RE, bashWriteGuard, brainstormGate, capVerbosity, countLines, detectCreationIntent, detectFramework, detectProjectType, docConsultedGate, evaluate, evaluateApex, evaluateFileSize, freshnessGate, installGuard, interfaceSeparationGuard, isApexCommand, matchPatterns, protectedPathGuard, runGuards, securityGuard, solidReadGate };
|
package/dist/policy/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { i as isApexCommand, n as DEV_KEYWORDS, r as detectProjectType, t as detectCreationIntent } from "../policy-Cpa5aWek.mjs";
|
|
2
|
-
import { C as
|
|
2
|
+
import { C as matchPatterns, E as detectFramework, S as SYSTEM_INSTALL, T as evaluateFileSize, _ as CRITICAL_PATTERNS, a as PHP_DECL_RE, b as GIT_BLOCKED, c as TS_DECL_RE, d as CODE_MUTATORS, f as CODE_REDIRECT, g as ASK_PATTERNS, h as protectedPathGuard, i as installGuard, l as interfaceSeparationGuard, m as PROTECTED_FRAGMENTS, n as GUARDS, o as PY_MODEL_RE, p as bashWriteGuard, r as runGuards, s as SWIFT_PROTO_RE, t as evaluate, u as ASK_WRITERS, v as securityGuard, w as countLines, x as PROJECT_INSTALL, y as GIT_ASK } from "../evaluate-urGmc24B.mjs";
|
|
3
3
|
import { a as docConsultedGate, c as solidReadGate, i as brainstormGate, n as capVerbosity, o as evaluateApex, r as APEX_GATES, s as freshnessGate, t as MAX_EXA_RESULTS } from "../verbosity-ZYT7tLCw.mjs";
|
|
4
|
-
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, CRITICAL_PATTERNS, DEV_KEYWORDS, GIT_ASK, GIT_BLOCKED, GUARDS, MAX_EXA_RESULTS, PHP_DECL_RE, PROJECT_INSTALL,
|
|
4
|
+
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, CRITICAL_PATTERNS, DEV_KEYWORDS, GIT_ASK, GIT_BLOCKED, GUARDS, MAX_EXA_RESULTS, PHP_DECL_RE, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PY_MODEL_RE, SWIFT_PROTO_RE, SYSTEM_INSTALL, TS_DECL_RE, bashWriteGuard, brainstormGate, capVerbosity, countLines, detectCreationIntent, detectFramework, detectProjectType, docConsultedGate, evaluate, evaluateApex, evaluateFileSize, freshnessGate, installGuard, interfaceSeparationGuard, isApexCommand, matchPatterns, protectedPathGuard, runGuards, securityGuard, solidReadGate };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as isCodeFile } from "./project-root-ff0_poWU.mjs";
|
|
2
|
-
import { t as evaluate } from "./evaluate-
|
|
2
|
+
import { t as evaluate } from "./evaluate-urGmc24B.mjs";
|
|
3
3
|
import { t as formatPrompt } from "./types-ernB1Dy3.mjs";
|
|
4
4
|
import { execSync } from "node:child_process";
|
|
5
5
|
//#region src/cli/run.ts
|
package/dist/runtime/index.d.mts
CHANGED
|
@@ -52,8 +52,8 @@ declare function activityFor(event: ToolEvent): Activity | null;
|
|
|
52
52
|
//#region src/runtime/gate.d.ts
|
|
53
53
|
/** Prior agents the freshness gate requires before a code edit. */
|
|
54
54
|
declare const REQUIRED_AGENTS: ReadonlyArray<string>;
|
|
55
|
-
/** Default freshness window for {@link REQUIRED_AGENTS} (
|
|
56
|
-
declare const DEFAULT_WINDOW_MS =
|
|
55
|
+
/** Default freshness window for {@link REQUIRED_AGENTS} (2 min — matches the plugin's `FUSE_ENFORCE_TTL_SEC` default). */
|
|
56
|
+
declare const DEFAULT_WINDOW_MS = 12e4;
|
|
57
57
|
/** Trivial edits allowed within the window before the full APEX gates apply. */
|
|
58
58
|
declare const TRIVIAL_BUDGET = 4;
|
|
59
59
|
/** A tool-use to gate, plus the session pointers needed for the stateful gates. */
|
|
@@ -126,6 +126,8 @@ interface HandleOptions {
|
|
|
126
126
|
cwd: string;
|
|
127
127
|
/** Directory of SOLID reference `.md` files for `solidReadGate` (else inert). */
|
|
128
128
|
refsDir?: string;
|
|
129
|
+
/** APEX freshness window in ms (from `FUSE_ENFORCE_TTL_SEC`). */
|
|
130
|
+
windowMs?: number;
|
|
129
131
|
}
|
|
130
132
|
/** What the hook bin should print + exit with. */
|
|
131
133
|
interface HandleOutcome {
|
package/dist/runtime/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as projectLayout } from "../layout-C0jaaCQC.mjs";
|
|
2
|
-
import { a as normalizeEvent, c as mcpPostStore, d as DEFAULT_WINDOW_MS, f as REQUIRED_AGENTS, h as activityFor, i as trackFile, l as mcpPreIntercept, m as gate, n as respond, o as MCP_TTL_MS, p as TRIVIAL_BUDGET, r as recordActivity, s as isMcpTool, t as handleHook, u as queryOf } from "../handle-
|
|
2
|
+
import { a as normalizeEvent, c as mcpPostStore, d as DEFAULT_WINDOW_MS, f as REQUIRED_AGENTS, h as activityFor, i as trackFile, l as mcpPreIntercept, m as gate, n as respond, o as MCP_TTL_MS, p as TRIVIAL_BUDGET, r as recordActivity, s as isMcpTool, t as handleHook, u as queryOf } from "../handle-D_cJGRjJ.mjs";
|
|
3
3
|
//#region src/runtime/storage.ts
|
|
4
4
|
/**
|
|
5
5
|
* The project's single state dir (`<root>/.harness`) — neutral + harness-agnostic,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fusengine/harness",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
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",
|
|
File without changes
|