@fusengine/harness 0.1.25 → 0.1.26

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 { r as resolveTtlSec } from "../ttl-BG55s6HZ.mjs";
3
3
  import { t as detectHarness } from "../harness-C8Nxxyn_.mjs";
4
4
  import { n as stagedContent, r as stagedFiles, t as checkStaged } from "../run-0LTLAbmo.mjs";
5
5
  import { n as writeInitFile, t as initFor } from "../run-D91N4ul1.mjs";
6
- import { t as handleHook } from "../handle-lX8yNCj3.mjs";
6
+ import { t as handleHook } from "../handle-CqI_i3Re.mjs";
7
7
  //#region src/cli/bin.ts
8
8
  /**
9
9
  * harness — CLI for @fusengine/harness.
@@ -3,7 +3,7 @@ import { j as detectFramework, n as FAIL_CLOSED, t as evaluate } from "./evaluat
3
3
  import { c as evaluateApex, i as detectCreationIntent, r as capVerbosity } from "./verbosity-BnGJPq6y.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";
6
- import { t as loadRefs } from "./loader-CR3MT6Sn.mjs";
6
+ import { t as loadRefs } from "./loader-6TxEFTND.mjs";
7
7
  import { a as recordAgent, c as recordRefRead, l as recordTrivialEdit, n as saveTrack, o as recordBrainstormRequired, r as agentsFresh, s as recordDoc, t as loadTrack, u as trivialCount } from "./store-BnHpq2ZB.mjs";
8
8
  import { join } from "node:path";
9
9
  import { existsSync, readFileSync } from "node:fs";
@@ -28,6 +28,6 @@ declare function toRefMeta(fm: Record<string, string>, filePath: string): RefMet
28
28
  * {@link RefMeta}. The content is entirely the consumer's — point this at any
29
29
  * refs dir (`FUSE_HARNESS_REFS`). Returns an empty list when the dir is absent.
30
30
  */
31
- declare function loadRefs(dir: string): Promise<RefMeta[]>;
31
+ declare function loadRefs(dirs: string): Promise<RefMeta[]>;
32
32
  //#endregion
33
33
  export { globToRe as a, scoreReferences as i, toRefMeta as n, parseFrontmatter as o, routeReferences as r, loadRefs as t };
package/dist/index.d.mts CHANGED
@@ -8,7 +8,7 @@ import { i as compactJson, n as projectRoot, r as projectRootOrNull, t as isCode
8
8
  import { A as ApexContext, B as GIT_ASK, C as protectedPathGuard, D as Guard, E as securityGuard, F as freshnessGate, G as FileSizeVerdict, H as PROJECT_INSTALL, I as solidReadGate, J as detectFramework, K as countLines, L as PolicyContext, M as brainstormGate, N as docConsultedGate, O as GuardContext, P as evaluateApex, Q as isApexCommand, R as PolicyResult, S as PROTECTED_FRAGMENTS, T as CRITICAL_PATTERNS, U as SYSTEM_INSTALL, V as GIT_BLOCKED, W as matchPatterns, X as ProjectType, Y as DEV_KEYWORDS, Z as detectProjectType, _ as interfaceSeparationGuard, a as FAIL_CLOSED, b as CODE_REDIRECT, c as registerGuard, d as GO_DECL_RE, f as JAVA_DECL_RE, g as TS_DECL_RE, h as SWIFT_PROTO_RE, i as detectCreationIntent, j as ApexGate, k as APEX_GATES, l as runGuards, m as PY_MODEL_RE, n as MAX_TOKENS, o as GUARDS, p as PHP_DECL_RE, q as evaluateFileSize, r as capVerbosity, s as clearUserGuards, t as MAX_EXA_RESULTS, u as installGuard, v as ASK_WRITERS, w as ASK_PATTERNS, x as bashWriteGuard, y as CODE_MUTATORS, z as evaluate } from "./index-DNAzITvw.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
- import { a as globToRe, i as scoreReferences, n as toRefMeta, o as parseFrontmatter, r as routeReferences, t as loadRefs } from "./index-BD1ZRv-H.mjs";
11
+ import { a as globToRe, i as scoreReferences, n as toRefMeta, o as parseFrontmatter, r as routeReferences, t as loadRefs } from "./index-DL8MxjuP.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
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, FAIL_CLOSED, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GRADIENT_BLOCKS, GUARDS, Guard, GuardContext, HarnessId, HarnessInfo, HarnessMode, HarnessVia, IndexSummary, JAVA_DECL_RE, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, MAX_TOKENS, 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, clearUserGuards, 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, registerGuard, 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
@@ -14,7 +14,7 @@ import { a as nowStamp, c as stateFileFor, i as lessonsFileFor, l as throttleMs,
14
14
  import { a as queryHash, i as jaccardSimilar, n as summarizeIndex, r as compactMarkdown, t as loadIndex } from "./cache-BzbX-ztL.mjs";
15
15
  import { a as extractText, i as mcpCacheKey, n as cachePath, r as cacheStore, t as cacheLookup } from "./store-DeIsfMg5.mjs";
16
16
  import { t as incrementTrivialEditCounter } from "./freshness-CezohJHo.mjs";
17
- import { n as toRefMeta, t as loadRefs } from "./loader-CR3MT6Sn.mjs";
17
+ import { n as toRefMeta, t as loadRefs } from "./loader-6TxEFTND.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
20
  export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, FAIL_CLOSED, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GRADIENT_BLOCKS, GUARDS, JAVA_DECL_RE, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, MAX_TOKENS, 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, clearUserGuards, 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, registerGuard, registryFile, resolveMaxLines, resolveSessions, resolveTtlSec, routeReferences, runGuards, saveState, scoreReferences, securityGuard, setStateField, solidReadGate, splitTarget, stateFileFor, stateFilePath, summarizeIndex, taskComplete, taskCreate, taskStart, throttleMs, toRefMeta, ttlLabel };
@@ -1,5 +1,5 @@
1
1
  import { i as parseFrontmatter } from "./router-BxA7TgnX.mjs";
2
- import { join } from "node:path";
2
+ import { delimiter, join } from "node:path";
3
3
  import { readFile, readdir } from "node:fs/promises";
4
4
  //#region src/refs/loader.ts
5
5
  function pick(fm, ...keys) {
@@ -28,18 +28,20 @@ function toRefMeta(fm, filePath) {
28
28
  * {@link RefMeta}. The content is entirely the consumer's — point this at any
29
29
  * refs dir (`FUSE_HARNESS_REFS`). Returns an empty list when the dir is absent.
30
30
  */
31
- async function loadRefs(dir) {
32
- let entries;
33
- try {
34
- entries = await readdir(dir, { recursive: true });
35
- } catch {
36
- return [];
37
- }
31
+ async function loadRefs(dirs) {
38
32
  const refs = [];
39
- for (const rel of entries) {
40
- if (!rel.endsWith(".md")) continue;
41
- const filePath = join(dir, rel);
42
- refs.push(toRefMeta(parseFrontmatter(await readFile(filePath, "utf8")), filePath));
33
+ for (const dir of dirs.split(delimiter).filter(Boolean)) {
34
+ let entries;
35
+ try {
36
+ entries = await readdir(dir, { recursive: true });
37
+ } catch {
38
+ continue;
39
+ }
40
+ for (const rel of entries) {
41
+ if (!rel.endsWith(".md")) continue;
42
+ const filePath = join(dir, rel);
43
+ refs.push(toRefMeta(parseFrontmatter(await readFile(filePath, "utf8")), filePath));
44
+ }
43
45
  }
44
46
  return refs;
45
47
  }
@@ -1,3 +1,3 @@
1
1
  import { n as RouteResult, r as ScoredRef, t as RefMeta } from "../types-CY5qT2X1.mjs";
2
- import { a as globToRe, i as scoreReferences, n as toRefMeta, o as parseFrontmatter, r as routeReferences, t as loadRefs } from "../index-BD1ZRv-H.mjs";
2
+ import { a as globToRe, i as scoreReferences, n as toRefMeta, o as parseFrontmatter, r as routeReferences, t as loadRefs } from "../index-DL8MxjuP.mjs";
3
3
  export { RefMeta, RouteResult, ScoredRef, globToRe, loadRefs, parseFrontmatter, routeReferences, scoreReferences, toRefMeta };
@@ -1,4 +1,4 @@
1
1
  import { i as parseFrontmatter, n as scoreReferences, r as globToRe, t as routeReferences } from "../router-BxA7TgnX.mjs";
2
- import { n as toRefMeta, t as loadRefs } from "../loader-CR3MT6Sn.mjs";
2
+ import { n as toRefMeta, t as loadRefs } from "../loader-6TxEFTND.mjs";
3
3
  import "../refs-la_KkjCS.mjs";
4
4
  export { globToRe, loadRefs, parseFrontmatter, routeReferences, scoreReferences, toRefMeta };
@@ -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-lX8yNCj3.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-CqI_i3Re.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.25",
3
+ "version": "0.1.26",
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",