@fusengine/harness 0.1.80 → 0.1.81

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 (73) hide show
  1. package/dist/adapters/claude/index.d.mts +1 -1
  2. package/dist/adapters/claude/index.mjs +1 -1
  3. package/dist/adapters/cline/index.mjs +1 -1
  4. package/dist/adapters/codex/index.d.mts +11 -12
  5. package/dist/adapters/codex/index.mjs +3 -3
  6. package/dist/adapters/cursor/index.d.mts +29 -29
  7. package/dist/adapters/cursor/index.mjs +1 -1
  8. package/dist/adapters/gemini/index.mjs +1 -1
  9. package/dist/adapters/hermes/index.d.mts +22 -23
  10. package/dist/adapters/hermes/index.mjs +1 -1
  11. package/dist/adapters/kimi/index.d.mts +54 -46
  12. package/dist/adapters/kimi/index.mjs +2 -2
  13. package/dist/cache/index.d.mts +1 -1
  14. package/dist/{claude-51RSspJ1.mjs → claude-D93HY8dq.mjs} +2 -2
  15. package/dist/cli/bin.d.mts +1 -1
  16. package/dist/cli/bin.mjs +129 -38
  17. package/dist/cli/index.d.mts +3 -3
  18. package/dist/cli/index.mjs +1 -1
  19. package/dist/config/index.d.mts +2 -2
  20. package/dist/config/index.mjs +4 -4
  21. package/dist/detect/index.d.mts +2 -1
  22. package/dist/{doc-helpers-CEKzGg2u.d.mts → doc-helpers-BGCzP9VF.d.mts} +12 -12
  23. package/dist/{dotenv-B26N_uGr.mjs → dotenv-DoqNlALG.mjs} +29 -2
  24. package/dist/{evaluate-ClfbCDiY.mjs → evaluate-B4-MhOy_.mjs} +322 -32
  25. package/dist/freshness/index.d.mts +2 -2
  26. package/dist/{handle-B7YufFz9.mjs → handle-J5r2f_O_.mjs} +637 -159
  27. package/dist/{hermes-rTmVdhUL.mjs → hermes-1PUEoY8q.mjs} +2 -2
  28. package/dist/{home-state-BXf38Zi1.mjs → home-state-oUGFB4ds.mjs} +4 -2
  29. package/dist/index-84heAAm_.d.mts +12 -0
  30. package/dist/index-CaxrMD1A.d.mts +1 -0
  31. package/dist/index-CigBu4K9.d.mts +14 -0
  32. package/dist/{index-DGxNjXW7.d.mts → index-D4C2-IIc.d.mts} +6 -8
  33. package/dist/index-DBgnIZn9.d.mts +756 -0
  34. package/dist/{index-mmRF3KNp.d.mts → index-DEfz82BP.d.mts} +12 -13
  35. package/dist/{index-BUwEmIK-.d.mts → index-DhmV2MPh.d.mts} +31 -31
  36. package/dist/index-oXXPs2xl.d.mts +119 -0
  37. package/dist/index-p9fLrSOD.d.mts +27 -0
  38. package/dist/index.d.mts +11 -11
  39. package/dist/index.mjs +8 -8
  40. package/dist/init/index.d.mts +8 -9
  41. package/dist/init/index.mjs +1 -1
  42. package/dist/{kimi-C7FGprQz.mjs → kimi-ChbcU2uI.mjs} +17 -3
  43. package/dist/{layout-C0jaaCQC.mjs → layout-KWoE_Mqn.mjs} +1 -0
  44. package/dist/limits-DG5pl-5s.mjs +59 -0
  45. package/dist/memory/index.mjs +1 -1
  46. package/dist/policy/index.d.mts +2 -3
  47. package/dist/policy/index.mjs +4 -4
  48. package/dist/prompt/index.d.mts +2 -1
  49. package/dist/refs/index.d.mts +1 -1
  50. package/dist/{registry-CymilZiZ.mjs → registry-IhHk2KlT.mjs} +1 -1
  51. package/dist/{run-3tyTW9Ud.mjs → run-D_WchZ3R.mjs} +1 -1
  52. package/dist/{run-Do2JltgU.mjs → run-TAXNRSpD.mjs} +1 -1
  53. package/dist/runtime/index.d.mts +453 -451
  54. package/dist/runtime/index.mjs +3 -3
  55. package/dist/{session-state-CY4iohn_.d.mts → session-state-D5gLr66m.d.mts} +29 -30
  56. package/dist/{skill-path-CDvR4bbF.mjs → skill-path-DhBGlQe3.mjs} +2 -2
  57. package/dist/{store-nDZ3eLBQ.mjs → store-yr_QFsZY.mjs} +101 -13
  58. package/dist/tracking/index.d.mts +22 -13
  59. package/dist/tracking/index.mjs +2 -2
  60. package/dist/{types-DVbIl9md.d.mts → types-C0-igRKr.d.mts} +8 -8
  61. package/dist/types-DvXTI71X.d.mts +15 -0
  62. package/dist/util/index.d.mts +1 -1
  63. package/dist/{validate-CkmquRDV.mjs → validate-Bf-EsbDh.mjs} +279 -20
  64. package/package.json +163 -163
  65. package/dist/apex-Wdi1nq_w.d.mts +0 -73
  66. package/dist/harness-BQ5_Wnva.d.mts +0 -27
  67. package/dist/index-BEMumjOw.d.mts +0 -27
  68. package/dist/index-BIGVNQB8.d.mts +0 -576
  69. package/dist/index-BKZ67WMa.d.mts +0 -1
  70. package/dist/index-BOBXQ91y.d.mts +0 -12
  71. package/dist/index-BVVgDSdq.d.mts +0 -1
  72. package/dist/index-B_VHbsaJ.d.mts +0 -96
  73. package/dist/limits-CHn8AIL1.mjs +0 -31
@@ -1,96 +0,0 @@
1
- import { i as HarnessId } from "./harness-BQ5_Wnva.mjs";
2
-
3
- //#region src/config/env.d.ts
4
- /**
5
- * Robust integer-from-env parser.
6
- * undefined / empty / whitespace / NaN / float / <= 0 all fall back to `fallback`.
7
- * `Number("")` is 0, so the empty guard is required before `Number()`.
8
- */
9
- declare function parseEnvInt(raw: string | undefined, fallback: number): number;
10
- //#endregion
11
- //#region src/config/ttl.d.ts
12
- /**
13
- * Default enforcement-freshness window, in seconds (2 minutes). Matches the
14
- * plugin's original `FUSE_ENFORCE_TTL_SEC` default. This is the constant that
15
- * actually reaches production (via `resolveTtlSec` -> `bin.ts`); `gate.ts`'s
16
- * `DEFAULT_WINDOW_MS` is only a fallback for direct programmatic callers that
17
- * omit `windowMs` (e.g. tests) and never applies on the real CLI path.
18
- */
19
- declare const DEFAULT_TTL_SEC = 120;
20
- /** Default env var name carrying the TTL override. */
21
- declare const TTL_ENV_KEY = "FUSE_ENFORCE_TTL_SEC";
22
- /**
23
- * Resolve the enforcement TTL (seconds) from an env map.
24
- * @param env - environment map (defaults to `process.env`)
25
- * @param key - env var name (defaults to `FUSE_ENFORCE_TTL_SEC`)
26
- */
27
- declare function resolveTtlSec(env?: Record<string, string | undefined>, key?: string): number;
28
- /** Human label for a TTL: 120 -> "2min", 240 -> "4min", 90 -> "90s". */
29
- declare function ttlLabel(sec: number): string;
30
- //#endregion
31
- //#region src/config/limits.d.ts
32
- /** Default SOLID max lines per file. */
33
- declare const DEFAULT_MAX_LINES = 100;
34
- /** Default env var name carrying the max-lines override. */
35
- declare const MAX_LINES_ENV_KEY = "FUSE_SOLID_MAX_LINES";
36
- /**
37
- * Resolve the SOLID max-lines limit from an env map.
38
- * @param env - environment map (defaults to `process.env`)
39
- * @param key - env var name (defaults to `FUSE_SOLID_MAX_LINES`)
40
- */
41
- declare function resolveMaxLines(env?: Record<string, string | undefined>, key?: string): number;
42
- /** Advisory module-split headroom = `maxLines - 10` (never below 1). */
43
- declare function splitTarget(maxLines: number): number;
44
- //#endregion
45
- //#region src/config/layout.d.ts
46
- /** Top-level project state dir — neutral + harness-agnostic (not `.claude/…`). */
47
- declare const STATE_ROOT = ".harness";
48
- /**
49
- * The selective `.gitignore` for `.harness/`: ignore the machine-local session
50
- * state (track, cache, throttle) but keep the curated `memory/LESSON.md`.
51
- */
52
- declare const STATE_GITIGNORE = "track/\ncache/\nmemory/state.json\n";
53
- /** Every project-state path the package uses, derived from one project root. */
54
- interface ProjectLayout {
55
- root: string;
56
- /** `<root>/.harness` — the single state dir. */
57
- stateDir: string;
58
- /** `<root>/.harness/track` — session track files. */
59
- trackDir: string;
60
- /** `<root>/.harness/cache` — MCP/WebFetch cache. */
61
- cacheDir: string;
62
- /** `<root>/.harness/memory` — lessons + throttle. */
63
- memoryDir: string;
64
- /** `<root>/.harness/memory/LESSON.md` — curated, committable. */
65
- lessonsFile: string;
66
- /** `<root>/.harness/memory/state.json` — machine-local throttle. */
67
- memoryStateFile: string;
68
- /** `<root>/.harness/.gitignore`. */
69
- gitignoreFile: string;
70
- }
71
- /**
72
- * The single source of truth for where every package file lives under a project
73
- * root. All modules (runtime storage, memory, init) derive their paths here —
74
- * nothing hardcodes a directory name elsewhere.
75
- */
76
- declare function projectLayout(root: string): ProjectLayout;
77
- //#endregion
78
- //#region src/config/dotenv.d.ts
79
- /** Home config dir holding the `.env` for each harness (defaults to `.claude`). */
80
- declare const HOME_DIR: Partial<Record<HarnessId, string>>;
81
- /** Parse a `.env` file into a key→value map (`export KEY="v"` or `KEY=v`). */
82
- declare function parseEnvFile(path: string): Record<string, string>;
83
- /** The `.env` paths probed for a harness: home `.env` then `<cwd>/.env`. */
84
- declare function envCandidates(id: HarnessId, home?: string, cwd?: string): string[];
85
- /**
86
- * Load `.env` files into `env` without overwriting existing keys. Reads the
87
- * harness home `.env` then `<cwd>/.env`. Best-effort (missing/unreadable files
88
- * are skipped) so a hook never fails on env loading.
89
- * @param id - Detected harness id (selects the home dir).
90
- * @param env - Target environment (defaults to `process.env`).
91
- * @param home - Home dir.
92
- * @param cwd - Project root.
93
- */
94
- declare function loadDotenv(id: HarnessId, env?: NodeJS.ProcessEnv, home?: string, cwd?: string): void;
95
- //#endregion
96
- export { parseEnvInt as _, ProjectLayout as a, projectLayout as c, resolveMaxLines as d, splitTarget as f, ttlLabel as g, resolveTtlSec as h, parseEnvFile as i, DEFAULT_MAX_LINES as l, TTL_ENV_KEY as m, envCandidates as n, STATE_GITIGNORE as o, DEFAULT_TTL_SEC as p, loadDotenv as r, STATE_ROOT as s, HOME_DIR as t, MAX_LINES_ENV_KEY as u };
@@ -1,31 +0,0 @@
1
- //#region src/config/env.ts
2
- /**
3
- * Robust integer-from-env parser.
4
- * undefined / empty / whitespace / NaN / float / <= 0 all fall back to `fallback`.
5
- * `Number("")` is 0, so the empty guard is required before `Number()`.
6
- */
7
- function parseEnvInt(raw, fallback) {
8
- if (!raw?.trim()) return fallback;
9
- const n = Number(raw.trim());
10
- return Number.isInteger(n) && n > 0 ? n : fallback;
11
- }
12
- //#endregion
13
- //#region src/config/limits.ts
14
- /** Default SOLID max lines per file. */
15
- const DEFAULT_MAX_LINES = 100;
16
- /** Default env var name carrying the max-lines override. */
17
- const MAX_LINES_ENV_KEY = "FUSE_SOLID_MAX_LINES";
18
- /**
19
- * Resolve the SOLID max-lines limit from an env map.
20
- * @param env - environment map (defaults to `process.env`)
21
- * @param key - env var name (defaults to `FUSE_SOLID_MAX_LINES`)
22
- */
23
- function resolveMaxLines(env = process.env, key = MAX_LINES_ENV_KEY) {
24
- return parseEnvInt(env[key], 100);
25
- }
26
- /** Advisory module-split headroom = `maxLines - 10` (never below 1). */
27
- function splitTarget(maxLines) {
28
- return Math.max(maxLines - 10, 1);
29
- }
30
- //#endregion
31
- export { parseEnvInt as a, splitTarget as i, MAX_LINES_ENV_KEY as n, resolveMaxLines as r, DEFAULT_MAX_LINES as t };