@fusengine/harness 0.1.48 → 0.1.50

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 (49) hide show
  1. package/dist/adapters/claude/index.d.mts +2 -2
  2. package/dist/adapters/claude/index.mjs +2 -2
  3. package/dist/adapters/cline/index.mjs +1 -1
  4. package/dist/adapters/codex/index.d.mts +1 -1
  5. package/dist/adapters/codex/index.mjs +1 -1
  6. package/dist/adapters/cursor/index.d.mts +10 -3
  7. package/dist/adapters/cursor/index.mjs +3 -3
  8. package/dist/adapters/gemini/index.mjs +1 -1
  9. package/dist/adapters/hermes/index.d.mts +54 -0
  10. package/dist/adapters/hermes/index.mjs +2 -0
  11. package/dist/apex-Wdi1nq_w.d.mts +73 -0
  12. package/dist/{claude-U1KTaRG4.mjs → claude-BxC9semG.mjs} +30 -9
  13. package/dist/cli/bin.mjs +5 -5
  14. package/dist/cli/index.mjs +1 -1
  15. package/dist/config/index.d.mts +1 -1
  16. package/dist/config/index.mjs +1 -1
  17. package/dist/detect/index.d.mts +1 -1
  18. package/dist/detect/index.mjs +1 -1
  19. package/dist/{doc-helpers-BNfYWvYv.d.mts → doc-helpers-CEKzGg2u.d.mts} +2 -0
  20. package/dist/{dotenv-B9nM4cuQ.mjs → dotenv-Jj8aL1FL.mjs} +2 -1
  21. package/dist/{evaluate-qYC5xClb.mjs → evaluate-CNAzgxnN.mjs} +3 -85
  22. package/dist/freshness/index.d.mts +1 -1
  23. package/dist/{handle-CCV0ycdr.mjs → handle-DzPjaPS-.mjs} +868 -71
  24. package/dist/{harness-C8Nxxyn_.mjs → harness-Cb9xR8dC.mjs} +6 -3
  25. package/dist/{harness-BPPu5CrN.d.mts → harness-s1Fce_dL.d.mts} +1 -1
  26. package/dist/hermes-DWXCRFZU.mjs +54 -0
  27. package/dist/home-state-D0RLWP8J.mjs +134 -0
  28. package/dist/{index-BqfOFKm7.d.mts → index-BfMsILmg.d.mts} +2 -63
  29. package/dist/{index-BxjzFraL.d.mts → index-DZCLmSoO.d.mts} +11 -9
  30. package/dist/{index-BXPySPxE.d.mts → index-jj_EzZRv.d.mts} +1 -1
  31. package/dist/index.d.mts +7 -6
  32. package/dist/index.mjs +6 -5
  33. package/dist/init/index.d.mts +1 -1
  34. package/dist/policy/index.d.mts +3 -2
  35. package/dist/policy/index.mjs +4 -3
  36. package/dist/prompt/index.d.mts +1 -1
  37. package/dist/{run-CaqeQFYp.mjs → run-DZvP_9xB.mjs} +1 -1
  38. package/dist/runtime/index.d.mts +39 -9
  39. package/dist/runtime/index.mjs +3 -3
  40. package/dist/{session-state-V8Jp-KE5.d.mts → session-state-DMpotbRz.d.mts} +26 -4
  41. package/dist/skill-path-DhItkBzk.mjs +95 -0
  42. package/dist/store-QSSTO3lY.mjs +349 -0
  43. package/dist/tracking/index.d.mts +2 -2
  44. package/dist/tracking/index.mjs +2 -2
  45. package/dist/{types-D56jSgD9.d.mts → types-DVbIl9md.d.mts} +6 -0
  46. package/dist/{validate-ebDjIyOa.mjs → validate-DCQ8dkdL.mjs} +16 -100
  47. package/package.json +7 -2
  48. package/dist/home-state-mKZxP4oZ.mjs +0 -52
  49. package/dist/store-ARx-GQSQ.mjs +0 -200
@@ -14,7 +14,8 @@ const ENV_SIGNALS = [
14
14
  ["AIDER", "aider"],
15
15
  ["KIRO", "kiro"],
16
16
  ["GOOSE", "goose"],
17
- ["AMP", "amp"]
17
+ ["AMP", "amp"],
18
+ ["HERMES_SESSION_ID", "hermes"]
18
19
  ];
19
20
  /** `AGENT=<name>` / `AI_AGENT=<name>` standard value -> harness id. */
20
21
  const STD_NAMES = {
@@ -29,7 +30,8 @@ const STD_NAMES = {
29
30
  opencode: "opencode",
30
31
  gemini: "gemini-cli",
31
32
  copilot: "copilot",
32
- kiro: "kiro"
33
+ kiro: "kiro",
34
+ hermes: "hermes"
33
35
  };
34
36
  /** Harnesses exposing a native hook system (vs CLI-only integration). */
35
37
  const HOOK_CAPABLE = /* @__PURE__ */ new Set([
@@ -38,7 +40,8 @@ const HOOK_CAPABLE = /* @__PURE__ */ new Set([
38
40
  "cursor",
39
41
  "cline",
40
42
  "gemini-cli",
41
- "opencode"
43
+ "opencode",
44
+ "hermes"
42
45
  ]);
43
46
  /** Integration mode for a harness id. */
44
47
  function modeFor(id) {
@@ -1,6 +1,6 @@
1
1
  //#region src/detect/interfaces/types.d.ts
2
2
  /** Known AI coding harnesses detectable at runtime. */
3
- type HarnessId = "claude-code" | "codex" | "cursor" | "cline" | "gemini-cli" | "opencode" | "windsurf" | "copilot" | "aider" | "kiro" | "goose" | "amp" | "unknown";
3
+ type HarnessId = "claude-code" | "codex" | "cursor" | "cline" | "gemini-cli" | "opencode" | "windsurf" | "copilot" | "aider" | "kiro" | "goose" | "amp" | "hermes" | "unknown";
4
4
  /** Integration mode: `hook` = native lifecycle hooks; `cli` = run as an external step. */
5
5
  type HarnessMode = "hook" | "cli";
6
6
  /** How the harness was identified. */
@@ -0,0 +1,54 @@
1
+ import { t as evaluate } from "./evaluate-CNAzgxnN.mjs";
2
+ import { t as formatPrompt } from "./types-ernB1Dy3.mjs";
3
+ import { c as readClaudeInput } from "./claude-BxC9semG.mjs";
4
+ //#region src/adapters/hermes/index.ts
5
+ /**
6
+ * Hermes Agent adapter (hook-mode). Nous Research's hermes-agent (2026) pipes a
7
+ * JSON payload to shell hooks on stdin and reads stdout back as JSON — config
8
+ * `~/.hermes/config.yaml` under `hooks:`, event `pre_tool_call`, scripts in
9
+ * `~/.hermes/agent-hooks/`. The INPUT shape matches Claude Code
10
+ * (`hook_event_name`/`tool_name`/`tool_input`/`cwd`), so the Claude reader is
11
+ * reused; the OUTPUT does not: a block is `{ decision: "block", reason }`
12
+ * (no `permissionDecision`, no interactive "ask"), `{}` allows, and
13
+ * `{ context }` injects LLM context. Tool fields verified: `terminal` takes
14
+ * `command`; `write_file` takes `path` + `content`.
15
+ */
16
+ /** Read & parse the Hermes hook stdin payload (same wire shape as Claude). */
17
+ async function readHermesInput() {
18
+ return await readClaudeInput();
19
+ }
20
+ /**
21
+ * Render a portable {@link Prompt} as a Hermes hook response string:
22
+ * `block` -> `{decision:"block",reason}`; `ask`/`inform` -> non-blocking
23
+ * `{context}` — Hermes has no interactive "ask" state, so both degrade to
24
+ * context injection, mirroring the gemini-cli/cline routing in `respond()`.
25
+ * @param prompt - The portable policy prompt.
26
+ * @returns The native Hermes JSON response string.
27
+ */
28
+ function toHermesResponse(prompt) {
29
+ const msg = formatPrompt(prompt);
30
+ const res = prompt.kind === "block" ? {
31
+ decision: "block",
32
+ reason: msg
33
+ } : { context: msg };
34
+ return JSON.stringify(res);
35
+ }
36
+ /**
37
+ * Run the bundled policy over a Hermes `pre_tool_call` payload and return the
38
+ * native response string, or null to allow (the hook then prints `{}`).
39
+ * @param input - Parsed `pre_tool_call` stdin payload.
40
+ * @returns Native response JSON, or null when the tool use is allowed.
41
+ */
42
+ function guard(input) {
43
+ const t = input.tool_input;
44
+ const r = evaluate({
45
+ tool: input.tool_name ?? "write_file",
46
+ filePath: t?.path ?? t?.file_path,
47
+ content: t?.content,
48
+ command: t?.command
49
+ });
50
+ if (r.decision === "allow" || !r.prompt) return null;
51
+ return toHermesResponse(r.prompt);
52
+ }
53
+ //#endregion
54
+ export { readHermesInput as n, toHermesResponse as r, guard as t };
@@ -0,0 +1,134 @@
1
+ import { i as splitTarget, r as resolveMaxLines } from "./limits-CHn8AIL1.mjs";
2
+ import { t as atomicWrite } from "./json-io-DisYd2fb.mjs";
3
+ import { basename, join } from "node:path";
4
+ import { existsSync, mkdirSync, readFileSync } from "node:fs";
5
+ import { homedir } from "node:os";
6
+ //#region src/policy/file-size.ts
7
+ /**
8
+ * Fixed marketplace plugins root — parity with Python `enforce-file-size.py`'s
9
+ * literal, unexpanded `~/...` string. Exported: reused by
10
+ * `policy/apex.ts::solidReadGate` for its "no reference matched" deny message.
11
+ */
12
+ const PLUGINS_DIR = "~/.claude/plugins/marketplaces/fusengine-plugins/plugins";
13
+ /**
14
+ * Skill-dir fragment per framework — parity with Python
15
+ * `enforce-file-size.py::get_solid_ref()` (falls back to `generic/`). Exported:
16
+ * reused by `policy/apex.ts::solidReadGate` (see {@link PLUGINS_DIR}).
17
+ */
18
+ const SOLID_REF = {
19
+ react: "react-expert/skills/solid-react/",
20
+ nextjs: "nextjs-expert/skills/solid-nextjs/",
21
+ laravel: "laravel-expert/skills/solid-php/",
22
+ swift: "swift-apple-expert/skills/solid-swift/"
23
+ };
24
+ /**
25
+ * Count physical lines — parity with the Python `enforce-file-size.py`
26
+ * (`sum(1 for _ in f)`): every line counts (blanks and comments included), and a
27
+ * single trailing newline does not add a phantom line. The SOLID ceiling is
28
+ * measured on raw file length, not substantive code, to match the upstream plugin.
29
+ */
30
+ function countLines(content) {
31
+ if (content === "") return 0;
32
+ return content.split("\n").length - (content.endsWith("\n") ? 1 : 0);
33
+ }
34
+ /**
35
+ * Count non-empty, non-comment lines — parity with the Python `count_code_lines`
36
+ * shared by the framework-specific SOLID validators: `_shared/scripts/validate_solid_common.py`
37
+ * (imported by `nextjs-expert/scripts/validate-nextjs-solid.py` and
38
+ * `swift-apple-expert/scripts/validate-swift-solid.py`), duplicated verbatim in
39
+ * `react-expert/scripts/validate-react-solid.py` / `laravel-expert/scripts/validate-laravel-solid.py`.
40
+ * Strips blank lines and lines starting with `//` or `*` — a SINGLE fixed rule
41
+ * for all 4 callers (the Python `comment` param defaults to, and every real
42
+ * call site leaves it at, `"//"` — never per-language despite covering
43
+ * ts/tsx/js/jsx, php and swift).
44
+ *
45
+ * Deliberately distinct from two other "code-only" counters already in this
46
+ * repo, neither of which is a faithful substitute here:
47
+ * - `countLoc` (`runtime/lifecycle/check-file-size.ts`): a genuinely
48
+ * per-language table (PHP additionally strips `#`, Python strips
49
+ * `#`/`"""`/`'''`) — ported from the unrelated `solid/scripts/check-file-size.py`.
50
+ * - `countCodeLines` (`runtime/lifecycle/aipilot/solid-compliance.ts`): also
51
+ * strips `#` — ported from `ai-pilot/scripts/check-solid-compliance.py`.
52
+ * Reusing either would silently strip PHP `#`/Python-style comments that the
53
+ * real react/nextjs/laravel/swift validators do NOT strip.
54
+ * @param content - The file content to measure.
55
+ */
56
+ function countFrameworkCodeLines(content) {
57
+ let count = 0;
58
+ for (const raw of content.split("\n")) {
59
+ const line = raw.trim();
60
+ if (!line || line.startsWith("//") || line.startsWith("*")) continue;
61
+ count++;
62
+ }
63
+ return count;
64
+ }
65
+ /**
66
+ * Evaluate a file's line count against the SOLID limit.
67
+ * @param lines - the file's line count
68
+ * @param max - the limit (defaults to `resolveMaxLines()`)
69
+ */
70
+ function evaluateFileSize(lines, max = resolveMaxLines(), filePath = "", framework = "generic", displayLines = lines) {
71
+ if (lines <= max) return {
72
+ ok: true,
73
+ lines,
74
+ max,
75
+ message: null
76
+ };
77
+ const split = splitTarget(max);
78
+ const fname = filePath ? basename(filePath) : "file";
79
+ return {
80
+ ok: false,
81
+ lines,
82
+ max,
83
+ message: `BLOCKED: '${fname}' has ${displayLines} lines (max: ${max}). TO SPLIT: 1) Read SOLID rules: ${PLUGINS_DIR}/${SOLID_REF[framework] ?? "generic/"} 2) Create new module files (<${split} lines each) 3) Use Write to replace '${fname}' with <${max} lines version.`
84
+ };
85
+ }
86
+ //#endregion
87
+ //#region src/runtime/home-state.ts
88
+ /** Home `~/.claude` dir — per-harness config (CLAUDE.md, logs, plugins). */
89
+ function claudeHome(home = homedir()) {
90
+ return join(home, ".claude");
91
+ }
92
+ /** Neutral, harness-agnostic home for fuse-harness's OWN cache/state: `~/.fuse-harness`. */
93
+ function fuseHarnessHome(home = homedir()) {
94
+ return join(home, ".fuse-harness");
95
+ }
96
+ /** `~/.fuse-harness/cache` base dir for session/cache state (shared across harnesses). */
97
+ function fusengineCache(home = homedir()) {
98
+ return join(fuseHarnessHome(home), "cache");
99
+ }
100
+ /** `~/.fuse-harness/cache/sessions` — per-session JSON state dir. */
101
+ function sessionsDir(home = homedir()) {
102
+ return join(fusengineCache(home), "sessions");
103
+ }
104
+ const SID_RE = /^[a-zA-Z0-9_-]{1,128}$/;
105
+ /** Validate a session id (1-128 url-safe chars); null when invalid. */
106
+ function sanitizeSessionId(sid) {
107
+ const s = String(sid ?? "").trim();
108
+ return SID_RE.test(s) ? s : null;
109
+ }
110
+ /** Unified per-session state file path: `sessions/session-<sid>.json`. */
111
+ function sessionStatePath(sid, home = homedir()) {
112
+ return join(sessionsDir(home), `session-${sid}.json`);
113
+ }
114
+ /** Load a session-state dict, or `{}` when missing/corrupt (mirrors Python). */
115
+ function loadSessionState(sid, home = homedir()) {
116
+ const path = sessionStatePath(sid, home);
117
+ try {
118
+ if (!existsSync(path)) return {};
119
+ const data = JSON.parse(readFileSync(path, "utf-8"));
120
+ return typeof data === "object" && data !== null && !Array.isArray(data) ? data : {};
121
+ } catch {
122
+ return {};
123
+ }
124
+ }
125
+ /** Atomically persist a session-state dict (0o600 via atomicWrite, indent 2). */
126
+ function saveSessionState(sid, state, home = homedir()) {
127
+ mkdirSync(sessionsDir(home), {
128
+ recursive: true,
129
+ mode: 448
130
+ });
131
+ atomicWrite(sessionStatePath(sid, home), JSON.stringify(state, null, 2));
132
+ }
133
+ //#endregion
134
+ export { sanitizeSessionId as a, sessionsDir as c, countFrameworkCodeLines as d, countLines as f, loadSessionState as i, PLUGINS_DIR as l, fuseHarnessHome as n, saveSessionState as o, evaluateFileSize as p, fusengineCache as r, sessionStatePath as s, claudeHome as t, SOLID_REF as u };
@@ -1,6 +1,4 @@
1
- import { t as Prompt } from "./types-D56jSgD9.mjs";
2
- import { t as AuthEntry } from "./doc-helpers-BNfYWvYv.mjs";
3
- import { t as RefMeta } from "./types-CY5qT2X1.mjs";
1
+ import { t as Prompt } from "./types-DVbIl9md.mjs";
4
2
 
5
3
  //#region src/policy/detect-project.d.ts
6
4
  /** Project types detected from filesystem indicators. */
@@ -155,65 +153,6 @@ interface PolicyResult {
155
153
  */
156
154
  declare function evaluate(ctx: PolicyContext): PolicyResult;
157
155
  //#endregion
158
- //#region src/policy/apex-gates.d.ts
159
- /** Gate: the routed SOLID references for this edit must have been read within the TTL. */
160
- declare const solidReadGate: ApexGate;
161
- /** Gate: the required prior agents (explore + research) must have run within the window. */
162
- declare const freshnessGate: ApexGate;
163
- //#endregion
164
- //#region src/policy/apex.d.ts
165
- /**
166
- * Session context for the stateful APEX gates. The harness adapter supplies this
167
- * (the package owns the gate LOGIC; recording the session activity is the
168
- * adapter's tracking layer).
169
- */
170
- interface ApexContext {
171
- sessionId: string;
172
- framework: string;
173
- filePath: string;
174
- content: string;
175
- /** Doc-consultation authorizations from session state (Context7/Exa). */
176
- authorizations?: Record<string, AuthEntry>;
177
- /** Available SOLID references for the framework's skill. */
178
- refs?: RefMeta[];
179
- /** Absolute paths of SOLID refs already read this session. */
180
- refsRead?: string[];
181
- /**
182
- * Epoch-ms read timestamp per `refsRead` path (parity track-solid-reads.py
183
- * `solid_reads[].timestamp`). PARITY: the TTL applies ONLY to solidReadGate —
184
- * Python TTL-izes SOLID reads exclusively (require-solid-read.py); the
185
- * skill-trigger/design/shadcn gates stay session-scoped (no TTL). A path in
186
- * `refsRead` with no stamp here (tracks recorded before this field existed)
187
- * counts as read — backward compat.
188
- */
189
- refsReadAt?: Record<string, number>;
190
- /** Current epoch ms for the SOLID-read TTL check; absent → reads never expire. */
191
- now?: number;
192
- /** Whether the required prior agents (explore + research) ran within the freshness window. */
193
- agentsFresh?: boolean;
194
- /** Names of REQUIRED_AGENTS that have NOT run fresh (subset), for a precise freshnessGate message. Absent → generic wording. */
195
- missingAgents?: string[];
196
- /** Freshness window in ms: labels the block messages' TTL (e.g. "2min") and bounds the SOLID-read TTL in solidReadGate. */
197
- windowMs?: number;
198
- /** Whether brainstorming is required for this edit (creation intent on a new file). */
199
- brainstormRequired?: boolean;
200
- /** Whether the brainstorming agent ran within the window. */
201
- brainstormFresh?: boolean;
202
- }
203
- /** A single APEX gate: returns a blocking {@link Prompt}, or null to pass. */
204
- type ApexGate = (ctx: ApexContext) => Prompt | null;
205
- /** Gate: BOTH Context7 AND Exa (or a web fallback alone) must have been consulted this session. */
206
- declare const docConsultedGate: ApexGate;
207
- /** Gate: brainstorming must precede creating new files when flagged. */
208
- declare const brainstormGate: ApexGate;
209
- /** Default APEX gate chain (brainstorm, freshness, docs, SOLID refs). */
210
- declare const APEX_GATES: ReadonlyArray<ApexGate>;
211
- /**
212
- * Run the APEX gates (chain-of-responsibility): the first failing gate's prompt
213
- * wins; null means every gate passed (allow).
214
- */
215
- declare function evaluateApex(ctx: ApexContext, gates?: ReadonlyArray<ApexGate>): Prompt | null;
216
- //#endregion
217
156
  //#region src/policy/guards/context.d.ts
218
157
  /** Context handed to every guard in the chain. */
219
158
  interface GuardContext {
@@ -602,4 +541,4 @@ declare function isHtmlLike(path: string): boolean;
602
541
  */
603
542
  declare function missingSeoElements(html: string): string[];
604
543
  //#endregion
605
- export { ASK_PATTERNS as $, FAIL_CLOSED as A, DEV_KEYWORDS as At, SWIFT_PROTO_RE as B, usesTailwindUtilities as C, FileSizeVerdict as Ct, MAX_TOKENS as D, countLines as Dt, MAX_EXA_RESULTS as E, countFrameworkCodeLines as Et, installGuard as F, isApexCommand as Ft, CODE_MUTATORS as G, interfaceSeparationGuard as H, GO_DECL_RE as I, requiredArchSkill as It, SAFE_PREFIXES as J, CODE_REDIRECT as K, JAVA_DECL_RE as L, clearUserGuards as M, ProjectType as Mt, registerGuard as N, detectModularArchitecture as Nt, capVerbosity as O, evaluateFileSize as Ot, runGuards as P, detectProjectType as Pt, protectedPathGuard as Q, PHP_DECL_RE as R, skillTriggerGate as S, matchPatterns as St, frameworkSolidGate as T, SOLID_REF as Tt, bashWriteGuard as U, TS_DECL_RE as V, ASK_WRITERS as W, PROTECTED_FRAGMENTS as X, SESSION_STATE_FRAGMENT as Y, PROTECTED_GIT_RE as Z, DEV_VERBS as _, GIT_BLOCKED as _t, firstHeading as a, APEX_GATES as at, detectClaudeMdProjectType as b, SYSTEM_INSTALL as bt, parseEntry as c, brainstormGate as ct, EXCLUDE_DIRS as d, freshnessGate as dt, CRITICAL_PATTERNS as et, PROJECT_INDICATORS as f, solidReadGate as ft, loadApexTaskState as g, GIT_ASK as gt, buildApexTaskInjection as h, PolicyResult as ht, firstComment as i, GuardContext as it, GUARDS as j, ModularArchitecture as jt, detectCreationIntent as k, detectFramework as kt, parseBodyDesc as l, docConsultedGate as lt, buildApexTaskContext as m, PolicyContext as mt, missingSeoElements as n, securityGuard as nt, TreeEntry as o, ApexContext as ot, ApexTaskState as p, evaluate as pt, FILE_REDIRECT as q, descFromText as r, Guard as rt, parseEnrichment as s, ApexGate as st, isHtmlLike as t, LabeledPattern as tt, parseField as u, evaluateApex as ut, buildApexInstruction as v, PROJECT_INSTALL as vt, SKILL_TRIGGERS as w, PLUGINS_DIR as wt, detectRequiredSkills as x, isRalphMode as xt, buildClaudeMdContext as y, RALPH_SAFE as yt, PY_MODEL_RE as z };
544
+ export { ASK_PATTERNS as $, FAIL_CLOSED as A, SWIFT_PROTO_RE as B, usesTailwindUtilities as C, ModularArchitecture as Ct, MAX_TOKENS as D, isApexCommand as Dt, MAX_EXA_RESULTS as E, detectProjectType as Et, installGuard as F, CODE_MUTATORS as G, interfaceSeparationGuard as H, GO_DECL_RE as I, SAFE_PREFIXES as J, CODE_REDIRECT as K, JAVA_DECL_RE as L, clearUserGuards as M, registerGuard as N, capVerbosity as O, requiredArchSkill as Ot, runGuards as P, protectedPathGuard as Q, PHP_DECL_RE as R, skillTriggerGate as S, DEV_KEYWORDS as St, frameworkSolidGate as T, detectModularArchitecture as Tt, bashWriteGuard as U, TS_DECL_RE as V, ASK_WRITERS as W, PROTECTED_FRAGMENTS as X, SESSION_STATE_FRAGMENT as Y, PROTECTED_GIT_RE as Z, DEV_VERBS as _, SOLID_REF as _t, firstHeading as a, evaluate as at, detectClaudeMdProjectType as b, evaluateFileSize as bt, parseEntry as c, GIT_ASK as ct, EXCLUDE_DIRS as d, RALPH_SAFE as dt, CRITICAL_PATTERNS as et, PROJECT_INDICATORS as f, SYSTEM_INSTALL as ft, loadApexTaskState as g, PLUGINS_DIR as gt, buildApexTaskInjection as h, FileSizeVerdict as ht, firstComment as i, GuardContext as it, GUARDS as j, detectCreationIntent as k, parseBodyDesc as l, GIT_BLOCKED as lt, buildApexTaskContext as m, matchPatterns as mt, missingSeoElements as n, securityGuard as nt, TreeEntry as o, PolicyContext as ot, ApexTaskState as p, isRalphMode as pt, FILE_REDIRECT as q, descFromText as r, Guard as rt, parseEnrichment as s, PolicyResult as st, isHtmlLike as t, LabeledPattern as tt, parseField as u, PROJECT_INSTALL as ut, buildApexInstruction as v, countFrameworkCodeLines as vt, SKILL_TRIGGERS as w, ProjectType as wt, detectRequiredSkills as x, detectFramework as xt, buildClaudeMdContext as y, countLines as yt, PY_MODEL_RE as z };
@@ -1,4 +1,4 @@
1
- import { t as Prompt } from "./types-D56jSgD9.mjs";
1
+ import { t as Prompt } from "./types-DVbIl9md.mjs";
2
2
 
3
3
  //#region src/adapters/claude/index.d.ts
4
4
  /** Subset of the Claude Code hook stdin payload we consume. */
@@ -18,22 +18,24 @@ declare function readClaudeInput(): Promise<ClaudeHookInput>;
18
18
  /** A `deny` hook response for a given event. PreToolUse-only field. */
19
19
  declare function denyResponse(event: string, reason: string): string;
20
20
  /**
21
- * A PostToolUse (and Stop/UserPromptSubmit) `block` response. These events
22
- * ignore `hookSpecificOutput.permissionDecision` (a PreToolUse-only field) and
23
- * only honor the top-level `decision`/`reason` keys, which feed the reason back
24
- * to Claude as automated feedback.
25
- * @param reason - The block feedback shown to Claude.
26
- * @returns The native `{decision:"block",reason}` response string.
21
+ * A PostToolUse (and Stop/UserPromptSubmit) `block` response: those events
22
+ * ignore `permissionDecision` (PreToolUse-only) and only honor the top-level
23
+ * `decision`/`reason` keys, which feed `reason` back to Claude.
27
24
  */
28
25
  declare function blockResponse(reason: string): string;
29
26
  /** An `additionalContext` injection response. */
30
27
  declare function contextResponse(event: string, text: string): string;
31
28
  /** A raw `systemMessage` notice — shown to the user without blocking the tool. Mirrors the shared Python `hook_output.allow_pass`/`post_pass` convention. */
32
29
  declare function systemMessage(text: string): string;
30
+ /** An `inform` response with a user-visible notice (Python `allow_pass`/`post_pass` parity): a pure pass reuses {@link systemMessage} alone; with agent-facing `context` both channels merge in one JSON. */
31
+ declare function informResponse(event: string, notice: string, context: string): string;
32
+ /** Attach a user-visible `systemMessage` onto an already-rendered hook stdout JSON ({@link systemMessage} alone when empty/unparseable). */
33
+ declare function attachSystemMessage(stdout: string, notice: string): string;
33
34
  /**
34
35
  * Render a portable {@link Prompt} as a Claude Code hook response:
35
36
  * `block` → `permissionDecision: deny`, `ask` → `permissionDecision: ask`
36
- * (interactive confirm), `inform` → `additionalContext`.
37
+ * (interactive confirm), `inform` → `additionalContext` — plus the user-visible
38
+ * `systemMessage` channel when the prompt carries a `userMessage`.
37
39
  */
38
40
  declare function toClaudeResponse(event: string, prompt: Prompt): string;
39
41
  /**
@@ -44,4 +46,4 @@ declare function guard(input: ClaudeHookInput): string | null;
44
46
  /** @deprecated use {@link guard}. Kept for back-compat. */
45
47
  declare const fileSizeGuard: typeof guard;
46
48
  //#endregion
47
- export { fileSizeGuard as a, systemMessage as c, denyResponse as i, toClaudeResponse as l, blockResponse as n, guard as o, contextResponse as r, readClaudeInput as s, ClaudeHookInput as t };
49
+ export { denyResponse as a, informResponse as c, toClaudeResponse as d, contextResponse as i, readClaudeInput as l, attachSystemMessage as n, fileSizeGuard as o, blockResponse as r, guard as s, ClaudeHookInput as t, systemMessage as u };
@@ -1,4 +1,4 @@
1
- import { i as HarnessId } from "./harness-BPPu5CrN.mjs";
1
+ import { i as HarnessId } from "./harness-s1Fce_dL.mjs";
2
2
 
3
3
  //#region src/config/env.d.ts
4
4
  /**
package/dist/index.d.mts CHANGED
@@ -1,13 +1,14 @@
1
- import { n as PromptKind, r as formatPrompt, t as Prompt } from "./types-D56jSgD9.mjs";
1
+ import { n as PromptKind, r as formatPrompt, t as Prompt } from "./types-DVbIl9md.mjs";
2
2
  import { _ as queryHash, a as cacheLookupSubstringMeta, c as mcpCacheKey, d as extractText, f as IndexSummary, g as jaccardSimilar, h as compactMarkdown, i as cacheLookupSubstring, l as mcpCacheWrite, m as summarizeIndex, n as cacheLookup, o as cachePath, p as loadIndex, r as cacheLookupMeta, s as cacheStore, t as CacheHit, u as webfetchCacheWrite } from "./index-BUwEmIK-.mjs";
3
- import { _ as parseEnvInt, a as ProjectLayout, c as projectLayout, d as resolveMaxLines, f as splitTarget, g as ttlLabel, h as resolveTtlSec, i as parseEnvFile, l as DEFAULT_MAX_LINES, m as TTL_ENV_KEY, n as envCandidates, o as STATE_GITIGNORE, p as DEFAULT_TTL_SEC, r as loadDotenv, s as STATE_ROOT, t as HOME_DIR, u as MAX_LINES_ENV_KEY } from "./index-BXPySPxE.mjs";
4
- import { a as HarnessInfo, i as HarnessId, n as detectMode, o as HarnessMode, r as modeFor, s as HarnessVia, t as detectHarness } from "./harness-BPPu5CrN.mjs";
5
- import { a as isDocConsulted, i as formatDocSatisfactionStatus, n as DocSatisfactionStatus, o as resolveSessions, r as formatDocDeny, t as AuthEntry } from "./doc-helpers-BNfYWvYv.mjs";
3
+ import { _ as parseEnvInt, a as ProjectLayout, c as projectLayout, d as resolveMaxLines, f as splitTarget, g as ttlLabel, h as resolveTtlSec, i as parseEnvFile, l as DEFAULT_MAX_LINES, m as TTL_ENV_KEY, n as envCandidates, o as STATE_GITIGNORE, p as DEFAULT_TTL_SEC, r as loadDotenv, s as STATE_ROOT, t as HOME_DIR, u as MAX_LINES_ENV_KEY } from "./index-jj_EzZRv.mjs";
4
+ import { a as HarnessInfo, i as HarnessId, n as detectMode, o as HarnessMode, r as modeFor, s as HarnessVia, t as detectHarness } from "./harness-s1Fce_dL.mjs";
5
+ import { a as isDocConsulted, i as formatDocSatisfactionStatus, n as DocSatisfactionStatus, o as resolveSessions, r as formatDocDeny, t as AuthEntry } from "./doc-helpers-CEKzGg2u.mjs";
6
6
  import { t as incrementTrivialEditCounter } from "./index-BOBXQ91y.mjs";
7
7
  import { a as compactJson, i as walkUpFor, n as projectRoot, r as projectRootOrNull, t as isCodeFile } from "./index-BEMumjOw.mjs";
8
- import { $ as ASK_PATTERNS, A as FAIL_CLOSED, At as DEV_KEYWORDS, B as SWIFT_PROTO_RE, C as usesTailwindUtilities, Ct as FileSizeVerdict, D as MAX_TOKENS, Dt as countLines, E as MAX_EXA_RESULTS, Et as countFrameworkCodeLines, F as installGuard, Ft as isApexCommand, G as CODE_MUTATORS, H as interfaceSeparationGuard, I as GO_DECL_RE, It as requiredArchSkill, J as SAFE_PREFIXES, K as CODE_REDIRECT, L as JAVA_DECL_RE, M as clearUserGuards, Mt as ProjectType, N as registerGuard, Nt as detectModularArchitecture, O as capVerbosity, Ot as evaluateFileSize, P as runGuards, Pt as detectProjectType, Q as protectedPathGuard, R as PHP_DECL_RE, S as skillTriggerGate, St as matchPatterns, T as frameworkSolidGate, Tt as SOLID_REF, U as bashWriteGuard, V as TS_DECL_RE, W as ASK_WRITERS, X as PROTECTED_FRAGMENTS, Y as SESSION_STATE_FRAGMENT, Z as PROTECTED_GIT_RE, _ as DEV_VERBS, _t as GIT_BLOCKED, a as firstHeading, at as APEX_GATES, b as detectClaudeMdProjectType, bt as SYSTEM_INSTALL, c as parseEntry, ct as brainstormGate, d as EXCLUDE_DIRS, dt as freshnessGate, et as CRITICAL_PATTERNS, f as PROJECT_INDICATORS, ft as solidReadGate, g as loadApexTaskState, gt as GIT_ASK, h as buildApexTaskInjection, ht as PolicyResult, i as firstComment, it as GuardContext, j as GUARDS, jt as ModularArchitecture, k as detectCreationIntent, kt as detectFramework, l as parseBodyDesc, lt as docConsultedGate, m as buildApexTaskContext, mt as PolicyContext, n as missingSeoElements, nt as securityGuard, o as TreeEntry, ot as ApexContext, p as ApexTaskState, pt as evaluate, q as FILE_REDIRECT, r as descFromText, rt as Guard, s as parseEnrichment, st as ApexGate, t as isHtmlLike, tt as LabeledPattern, u as parseField, ut as evaluateApex, v as buildApexInstruction, vt as PROJECT_INSTALL, w as SKILL_TRIGGERS, wt as PLUGINS_DIR, x as detectRequiredSkills, xt as isRalphMode, y as buildClaudeMdContext, yt as RALPH_SAFE, z as PY_MODEL_RE } from "./index-BqfOFKm7.mjs";
8
+ import { $ as ASK_PATTERNS, A as FAIL_CLOSED, B as SWIFT_PROTO_RE, C as usesTailwindUtilities, Ct as ModularArchitecture, D as MAX_TOKENS, Dt as isApexCommand, E as MAX_EXA_RESULTS, Et as detectProjectType, F as installGuard, G as CODE_MUTATORS, H as interfaceSeparationGuard, I as GO_DECL_RE, J as SAFE_PREFIXES, K as CODE_REDIRECT, L as JAVA_DECL_RE, M as clearUserGuards, N as registerGuard, O as capVerbosity, Ot as requiredArchSkill, P as runGuards, Q as protectedPathGuard, R as PHP_DECL_RE, S as skillTriggerGate, St as DEV_KEYWORDS, T as frameworkSolidGate, Tt as detectModularArchitecture, U as bashWriteGuard, V as TS_DECL_RE, W as ASK_WRITERS, X as PROTECTED_FRAGMENTS, Y as SESSION_STATE_FRAGMENT, Z as PROTECTED_GIT_RE, _ as DEV_VERBS, _t as SOLID_REF, a as firstHeading, at as evaluate, b as detectClaudeMdProjectType, bt as evaluateFileSize, c as parseEntry, ct as GIT_ASK, d as EXCLUDE_DIRS, dt as RALPH_SAFE, et as CRITICAL_PATTERNS, f as PROJECT_INDICATORS, ft as SYSTEM_INSTALL, g as loadApexTaskState, gt as PLUGINS_DIR, h as buildApexTaskInjection, ht as FileSizeVerdict, i as firstComment, it as GuardContext, j as GUARDS, k as detectCreationIntent, l as parseBodyDesc, lt as GIT_BLOCKED, m as buildApexTaskContext, mt as matchPatterns, n as missingSeoElements, nt as securityGuard, o as TreeEntry, ot as PolicyContext, p as ApexTaskState, pt as isRalphMode, q as FILE_REDIRECT, r as descFromText, rt as Guard, s as parseEnrichment, st as PolicyResult, t as isHtmlLike, tt as LabeledPattern, u as parseField, ut as PROJECT_INSTALL, v as buildApexInstruction, vt as countFrameworkCodeLines, w as SKILL_TRIGGERS, wt as ProjectType, x as detectRequiredSkills, xt as detectFramework, y as buildClaudeMdContext, yt as countLines, z as PY_MODEL_RE } from "./index-BfMsILmg.mjs";
9
9
  import { n as RouteResult, r as ScoredRef, t as RefMeta } from "./types-CY5qT2X1.mjs";
10
+ import { a as PRE_AUTH_GATES, c as evaluateApex, i as POST_AUTH_GATES, l as freshnessGate, n as ApexContext, o as brainstormGate, r as ApexGate, s as docConsultedGate, t as APEX_GATES, u as solidReadGate } from "./apex-Wdi1nq_w.mjs";
10
11
  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
12
  import { a as globToRe, i as scoreReferences, n as toRefMeta, o as parseFrontmatter, r as routeReferences, t as loadRefs } from "./index-mmRF3KNp.mjs";
12
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";
13
- export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, ApexTaskState, AuthEntry, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, CacheHit, ColorFn, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, DEV_VERBS, DocSatisfactionStatus, EXCLUDE_DIRS, FAIL_CLOSED, FILE_REDIRECT, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GRADIENT_BLOCKS, GUARDS, Guard, GuardContext, HOME_DIR, type HarnessId, type HarnessInfo, type HarnessMode, type HarnessVia, IndexSummary, JAVA_DECL_RE, LabeledPattern, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, MAX_TOKENS, ModularArchitecture, PHP_DECL_RE, PLUGINS_DIR, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, Palette, type PolicyContext, type PolicyResult, ProgressBarOptions, ProjectLayout, ProjectType, Prompt, PromptKind, RALPH_SAFE, RefMeta, ReminderState, RouteResult, SAFE_PREFIXES, SESSION_STATE_FRAGMENT, SKILL_TRIGGERS, SOLID_REF, STATE_GITIGNORE, STATE_ROOT, SWIFT_PROTO_RE, SYSTEM_INSTALL, ScoredRef, TIME_INTERVALS, TS_DECL_RE, TTL_ENV_KEY, TreeEntry, addRoot, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, cacheLookup, cacheLookupMeta, cacheLookupSubstring, cacheLookupSubstringMeta, cachePath, cacheStore, capVerbosity, clearUserGuards, colors, compactJson, compactMarkdown, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectHarness, detectMode, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, ensureMemoryGitignore, envCandidates, evaluate, evaluateApex, evaluateFileSize, extractText, firstComment, firstHeading, formatBasename, formatCost, formatDocDeny, formatDocSatisfactionStatus, formatPath, formatPrompt, formatTimeLeft, formatTokens, frameworkSolidGate, freshnessGate, generateGradientBar, generateProgressBar, globToRe, incrementTrivialEditCounter, installGuard, interfaceSeparationGuard, isApexCommand, isCodeFile, isDocConsulted, isHtmlLike, isRalphMode, jaccardSimilar, lessonsFileFor, loadApexTaskState, loadDotenv, loadIndex, loadRefs, matchPatterns, mcpCacheKey, mcpCacheWrite, missingSeoElements, modeFor, nowStamp, parseBodyDesc, parseEnrichment, parseEntry, parseEnvFile, parseEnvInt, parseField, parseFrontmatter, progressiveColor, projectLayout, projectRoot, projectRootOrNull, protectedPathGuard, queryHash, readRoots, readState, registerGuard, registryFile, requiredArchSkill, resolveMaxLines, resolveSessions, resolveTtlSec, routeReferences, runGuards, scoreReferences, securityGuard, setStateField, skillTriggerGate, solidReadGate, splitTarget, stateFileFor, summarizeIndex, throttleMs, toRefMeta, ttlLabel, usesTailwindUtilities, walkUpFor, webfetchCacheWrite };
14
+ export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, ApexTaskState, AuthEntry, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, CacheHit, ColorFn, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, DEV_VERBS, DocSatisfactionStatus, EXCLUDE_DIRS, FAIL_CLOSED, FILE_REDIRECT, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GRADIENT_BLOCKS, GUARDS, Guard, GuardContext, HOME_DIR, type HarnessId, type HarnessInfo, type HarnessMode, type HarnessVia, IndexSummary, JAVA_DECL_RE, LabeledPattern, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, MAX_TOKENS, ModularArchitecture, PHP_DECL_RE, PLUGINS_DIR, POST_AUTH_GATES, PRE_AUTH_GATES, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, Palette, type PolicyContext, type PolicyResult, ProgressBarOptions, ProjectLayout, ProjectType, Prompt, PromptKind, RALPH_SAFE, RefMeta, ReminderState, RouteResult, SAFE_PREFIXES, SESSION_STATE_FRAGMENT, SKILL_TRIGGERS, SOLID_REF, STATE_GITIGNORE, STATE_ROOT, SWIFT_PROTO_RE, SYSTEM_INSTALL, ScoredRef, TIME_INTERVALS, TS_DECL_RE, TTL_ENV_KEY, TreeEntry, addRoot, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, cacheLookup, cacheLookupMeta, cacheLookupSubstring, cacheLookupSubstringMeta, cachePath, cacheStore, capVerbosity, clearUserGuards, colors, compactJson, compactMarkdown, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectHarness, detectMode, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, ensureMemoryGitignore, envCandidates, evaluate, evaluateApex, evaluateFileSize, extractText, firstComment, firstHeading, formatBasename, formatCost, formatDocDeny, formatDocSatisfactionStatus, formatPath, formatPrompt, formatTimeLeft, formatTokens, frameworkSolidGate, freshnessGate, generateGradientBar, generateProgressBar, globToRe, incrementTrivialEditCounter, installGuard, interfaceSeparationGuard, isApexCommand, isCodeFile, isDocConsulted, isHtmlLike, isRalphMode, jaccardSimilar, lessonsFileFor, loadApexTaskState, loadDotenv, loadIndex, loadRefs, matchPatterns, mcpCacheKey, mcpCacheWrite, missingSeoElements, modeFor, nowStamp, parseBodyDesc, parseEnrichment, parseEntry, parseEnvFile, parseEnvInt, parseField, parseFrontmatter, progressiveColor, projectLayout, projectRoot, projectRootOrNull, protectedPathGuard, queryHash, readRoots, readState, registerGuard, registryFile, requiredArchSkill, resolveMaxLines, resolveSessions, resolveTtlSec, routeReferences, runGuards, scoreReferences, securityGuard, setStateField, skillTriggerGate, solidReadGate, splitTarget, stateFileFor, summarizeIndex, throttleMs, toRefMeta, ttlLabel, usesTailwindUtilities, walkUpFor, webfetchCacheWrite };
package/dist/index.mjs CHANGED
@@ -1,11 +1,12 @@
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 { a as DEFAULT_TTL_SEC, c as ttlLabel, i as parseEnvFile, n as envCandidates, o as TTL_ENV_KEY, r as loadDotenv, s as resolveTtlSec, t as HOME_DIR } from "./dotenv-B9nM4cuQ.mjs";
2
+ import { a as DEFAULT_TTL_SEC, c as ttlLabel, i as parseEnvFile, n as envCandidates, o as TTL_ENV_KEY, r as loadDotenv, s as resolveTtlSec, t as HOME_DIR } from "./dotenv-Jj8aL1FL.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 { i as walkUpFor, n as projectRoot, r as projectRootOrNull, t as isCodeFile } from "./project-root-3kk7gCOp.mjs";
6
- import { n as detectMode, r as modeFor, t as detectHarness } from "./harness-C8Nxxyn_.mjs";
7
- import { A as MAX_EXA_RESULTS, B as detectFramework, D as frameworkSolidGate, E as SKILL_TRIGGERS, F as brainstormGate, G as requiredArchSkill, H as detectModularArchitecture, I as docConsultedGate, L as evaluateApex, M as capVerbosity, N as detectCreationIntent, P as APEX_GATES, R as freshnessGate, S as usesTailwindUtilities, U as detectProjectType, V as DEV_KEYWORDS, W as isApexCommand, a as firstHeading, b as detectRequiredSkills, c as EXCLUDE_DIRS, d as buildApexTaskInjection, f as loadApexTaskState, g as detectClaudeMdProjectType, h as buildClaudeMdContext, i as firstComment, j as MAX_TOKENS, l as PROJECT_INDICATORS, m as buildApexInstruction, n as missingSeoElements, o as parseEnrichment, p as DEV_VERBS, r as descFromText, s as parseEntry, t as isHtmlLike, u as buildApexTaskContext, v as parseBodyDesc, x as skillTriggerGate, y as parseField, z as solidReadGate } from "./validate-ebDjIyOa.mjs";
8
- import { A as PROJECT_INSTALL, C as PROTECTED_GIT_RE, D as securityGuard, E as CRITICAL_PATTERNS, F as PLUGINS_DIR, I as SOLID_REF, L as countFrameworkCodeLines, M as SYSTEM_INSTALL, N as isRalphMode, O as GIT_ASK, P as matchPatterns, R as countLines, S as PROTECTED_FRAGMENTS, T as ASK_PATTERNS, _ as CODE_MUTATORS, a as registerGuard, b as SAFE_PREFIXES, c as GO_DECL_RE, d as PY_MODEL_RE, f as SWIFT_PROTO_RE, g as ASK_WRITERS, h as bashWriteGuard, i as clearUserGuards, j as RALPH_SAFE, k as GIT_BLOCKED, l as JAVA_DECL_RE, m as interfaceSeparationGuard, n as FAIL_CLOSED, o as runGuards, p as TS_DECL_RE, r as GUARDS, s as installGuard, t as evaluate, u as PHP_DECL_RE, v as CODE_REDIRECT, w as protectedPathGuard, x as SESSION_STATE_FRAGMENT, y as FILE_REDIRECT, z as evaluateFileSize } from "./evaluate-qYC5xClb.mjs";
6
+ import { n as detectMode, r as modeFor, t as detectHarness } from "./harness-Cb9xR8dC.mjs";
7
+ import { A as detectCreationIntent, B as DEV_KEYWORDS, C as SKILL_TRIGGERS, D as MAX_EXA_RESULTS, F as docConsultedGate, H as detectProjectType, I as evaluateApex, L as freshnessGate, M as POST_AUTH_GATES, N as PRE_AUTH_GATES, O as MAX_TOKENS, P as brainstormGate, R as solidReadGate, S as usesTailwindUtilities, U as isApexCommand, V as detectModularArchitecture, W as requiredArchSkill, a as firstHeading, b as detectRequiredSkills, c as EXCLUDE_DIRS, d as buildApexTaskInjection, f as loadApexTaskState, g as detectClaudeMdProjectType, h as buildClaudeMdContext, i as firstComment, j as APEX_GATES, k as capVerbosity, l as PROJECT_INDICATORS, m as buildApexInstruction, n as missingSeoElements, o as parseEnrichment, p as DEV_VERBS, r as descFromText, s as parseEntry, t as isHtmlLike, u as buildApexTaskContext, v as parseBodyDesc, w as frameworkSolidGate, x as skillTriggerGate, y as parseField, z as detectFramework } from "./validate-DCQ8dkdL.mjs";
8
+ import { d as countFrameworkCodeLines, f as countLines, l as PLUGINS_DIR, p as evaluateFileSize, u as SOLID_REF } from "./home-state-D0RLWP8J.mjs";
9
+ import { A as PROJECT_INSTALL, C as PROTECTED_GIT_RE, D as securityGuard, E as CRITICAL_PATTERNS, M as SYSTEM_INSTALL, N as isRalphMode, O as GIT_ASK, P as matchPatterns, S as PROTECTED_FRAGMENTS, T as ASK_PATTERNS, _ as CODE_MUTATORS, a as registerGuard, b as SAFE_PREFIXES, c as GO_DECL_RE, d as PY_MODEL_RE, f as SWIFT_PROTO_RE, g as ASK_WRITERS, h as bashWriteGuard, i as clearUserGuards, j as RALPH_SAFE, k as GIT_BLOCKED, l as JAVA_DECL_RE, m as interfaceSeparationGuard, n as FAIL_CLOSED, o as runGuards, p as TS_DECL_RE, r as GUARDS, s as installGuard, t as evaluate, u as PHP_DECL_RE, v as CODE_REDIRECT, w as protectedPathGuard, x as SESSION_STATE_FRAGMENT, y as FILE_REDIRECT } from "./evaluate-CNAzgxnN.mjs";
9
10
  import { i as resolveSessions, n as formatDocSatisfactionStatus, r as isDocConsulted, t as formatDocDeny } from "./doc-helpers-CWZegVdR.mjs";
10
11
  import { i as parseFrontmatter, n as scoreReferences, r as globToRe, t as routeReferences } from "./router-PKVNBHge.mjs";
11
12
  import { t as formatPrompt } from "./types-ernB1Dy3.mjs";
@@ -14,4 +15,4 @@ import { a as cacheLookupSubstring, c as cacheStore, d as loadIndex, f as summar
14
15
  import { t as incrementTrivialEditCounter } from "./freshness-BV3PQkDB.mjs";
15
16
  import { n as toRefMeta, t as loadRefs } from "./loader-AGz4nK7d.mjs";
16
17
  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";
17
- export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, DEV_VERBS, EXCLUDE_DIRS, FAIL_CLOSED, FILE_REDIRECT, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GRADIENT_BLOCKS, GUARDS, HOME_DIR, JAVA_DECL_RE, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, MAX_TOKENS, PHP_DECL_RE, PLUGINS_DIR, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, RALPH_SAFE, SAFE_PREFIXES, SESSION_STATE_FRAGMENT, SKILL_TRIGGERS, SOLID_REF, STATE_GITIGNORE, STATE_ROOT, SWIFT_PROTO_RE, SYSTEM_INSTALL, TIME_INTERVALS, TS_DECL_RE, TTL_ENV_KEY, addRoot, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, cacheLookup, cacheLookupMeta, cacheLookupSubstring, cacheLookupSubstringMeta, cachePath, cacheStore, capVerbosity, clearUserGuards, colors, compactJson, compactMarkdown, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectHarness, detectMode, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, ensureMemoryGitignore, envCandidates, evaluate, evaluateApex, evaluateFileSize, extractText, firstComment, firstHeading, formatBasename, formatCost, formatDocDeny, formatDocSatisfactionStatus, formatPath, formatPrompt, formatTimeLeft, formatTokens, frameworkSolidGate, freshnessGate, generateGradientBar, generateProgressBar, globToRe, incrementTrivialEditCounter, installGuard, interfaceSeparationGuard, isApexCommand, isCodeFile, isDocConsulted, isHtmlLike, isRalphMode, jaccardSimilar, lessonsFileFor, loadApexTaskState, loadDotenv, loadIndex, loadRefs, matchPatterns, mcpCacheKey, mcpCacheWrite, missingSeoElements, modeFor, nowStamp, parseBodyDesc, parseEnrichment, parseEntry, parseEnvFile, parseEnvInt, parseField, parseFrontmatter, progressiveColor, projectLayout, projectRoot, projectRootOrNull, protectedPathGuard, queryHash, readRoots, readState, registerGuard, registryFile, requiredArchSkill, resolveMaxLines, resolveSessions, resolveTtlSec, routeReferences, runGuards, scoreReferences, securityGuard, setStateField, skillTriggerGate, solidReadGate, splitTarget, stateFileFor, summarizeIndex, throttleMs, toRefMeta, ttlLabel, usesTailwindUtilities, walkUpFor, webfetchCacheWrite };
18
+ export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, DEFAULT_MAX_LINES, DEFAULT_TTL_SEC, DEV_KEYWORDS, DEV_VERBS, EXCLUDE_DIRS, FAIL_CLOSED, FILE_REDIRECT, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GRADIENT_BLOCKS, GUARDS, HOME_DIR, JAVA_DECL_RE, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, MAX_TOKENS, PHP_DECL_RE, PLUGINS_DIR, POST_AUTH_GATES, PRE_AUTH_GATES, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, RALPH_SAFE, SAFE_PREFIXES, SESSION_STATE_FRAGMENT, SKILL_TRIGGERS, SOLID_REF, STATE_GITIGNORE, STATE_ROOT, SWIFT_PROTO_RE, SYSTEM_INSTALL, TIME_INTERVALS, TS_DECL_RE, TTL_ENV_KEY, addRoot, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, cacheLookup, cacheLookupMeta, cacheLookupSubstring, cacheLookupSubstringMeta, cachePath, cacheStore, capVerbosity, clearUserGuards, colors, compactJson, compactMarkdown, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectHarness, detectMode, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, ensureMemoryGitignore, envCandidates, evaluate, evaluateApex, evaluateFileSize, extractText, firstComment, firstHeading, formatBasename, formatCost, formatDocDeny, formatDocSatisfactionStatus, formatPath, formatPrompt, formatTimeLeft, formatTokens, frameworkSolidGate, freshnessGate, generateGradientBar, generateProgressBar, globToRe, incrementTrivialEditCounter, installGuard, interfaceSeparationGuard, isApexCommand, isCodeFile, isDocConsulted, isHtmlLike, isRalphMode, jaccardSimilar, lessonsFileFor, loadApexTaskState, loadDotenv, loadIndex, loadRefs, matchPatterns, mcpCacheKey, mcpCacheWrite, missingSeoElements, modeFor, nowStamp, parseBodyDesc, parseEnrichment, parseEntry, parseEnvFile, parseEnvInt, parseField, parseFrontmatter, progressiveColor, projectLayout, projectRoot, projectRootOrNull, protectedPathGuard, queryHash, readRoots, readState, registerGuard, registryFile, requiredArchSkill, resolveMaxLines, resolveSessions, resolveTtlSec, routeReferences, runGuards, scoreReferences, securityGuard, setStateField, skillTriggerGate, solidReadGate, splitTarget, stateFileFor, summarizeIndex, throttleMs, toRefMeta, ttlLabel, usesTailwindUtilities, walkUpFor, webfetchCacheWrite };
@@ -1,4 +1,4 @@
1
- import { i as HarnessId } from "../harness-BPPu5CrN.mjs";
1
+ import { i as HarnessId } from "../harness-s1Fce_dL.mjs";
2
2
 
3
3
  //#region src/init/templates.d.ts
4
4
  /**
@@ -1,2 +1,3 @@
1
- import { $ as ASK_PATTERNS, A as FAIL_CLOSED, At as DEV_KEYWORDS, B as SWIFT_PROTO_RE, C as usesTailwindUtilities, Ct as FileSizeVerdict, D as MAX_TOKENS, Dt as countLines, E as MAX_EXA_RESULTS, Et as countFrameworkCodeLines, F as installGuard, Ft as isApexCommand, G as CODE_MUTATORS, H as interfaceSeparationGuard, I as GO_DECL_RE, It as requiredArchSkill, J as SAFE_PREFIXES, K as CODE_REDIRECT, L as JAVA_DECL_RE, M as clearUserGuards, Mt as ProjectType, N as registerGuard, Nt as detectModularArchitecture, O as capVerbosity, Ot as evaluateFileSize, P as runGuards, Pt as detectProjectType, Q as protectedPathGuard, R as PHP_DECL_RE, S as skillTriggerGate, St as matchPatterns, T as frameworkSolidGate, Tt as SOLID_REF, U as bashWriteGuard, V as TS_DECL_RE, W as ASK_WRITERS, X as PROTECTED_FRAGMENTS, Y as SESSION_STATE_FRAGMENT, Z as PROTECTED_GIT_RE, _ as DEV_VERBS, _t as GIT_BLOCKED, a as firstHeading, at as APEX_GATES, b as detectClaudeMdProjectType, bt as SYSTEM_INSTALL, c as parseEntry, ct as brainstormGate, d as EXCLUDE_DIRS, dt as freshnessGate, et as CRITICAL_PATTERNS, f as PROJECT_INDICATORS, ft as solidReadGate, g as loadApexTaskState, gt as GIT_ASK, h as buildApexTaskInjection, ht as PolicyResult, i as firstComment, it as GuardContext, j as GUARDS, jt as ModularArchitecture, k as detectCreationIntent, kt as detectFramework, l as parseBodyDesc, lt as docConsultedGate, m as buildApexTaskContext, mt as PolicyContext, n as missingSeoElements, nt as securityGuard, o as TreeEntry, ot as ApexContext, p as ApexTaskState, pt as evaluate, q as FILE_REDIRECT, r as descFromText, rt as Guard, s as parseEnrichment, st as ApexGate, t as isHtmlLike, tt as LabeledPattern, u as parseField, ut as evaluateApex, v as buildApexInstruction, vt as PROJECT_INSTALL, w as SKILL_TRIGGERS, wt as PLUGINS_DIR, x as detectRequiredSkills, xt as isRalphMode, y as buildClaudeMdContext, yt as RALPH_SAFE, z as PY_MODEL_RE } from "../index-BqfOFKm7.mjs";
2
- export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, ApexTaskState, CODE_MUTATORS, CODE_REDIRECT, CRITICAL_PATTERNS, DEV_KEYWORDS, DEV_VERBS, EXCLUDE_DIRS, FAIL_CLOSED, FILE_REDIRECT, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GUARDS, Guard, GuardContext, JAVA_DECL_RE, LabeledPattern, MAX_EXA_RESULTS, MAX_TOKENS, ModularArchitecture, PHP_DECL_RE, PLUGINS_DIR, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, type PolicyContext, type PolicyResult, ProjectType, RALPH_SAFE, SAFE_PREFIXES, SESSION_STATE_FRAGMENT, SKILL_TRIGGERS, SOLID_REF, SWIFT_PROTO_RE, SYSTEM_INSTALL, TS_DECL_RE, TreeEntry, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, capVerbosity, clearUserGuards, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, evaluate, evaluateApex, evaluateFileSize, firstComment, firstHeading, frameworkSolidGate, freshnessGate, installGuard, interfaceSeparationGuard, isApexCommand, isHtmlLike, isRalphMode, loadApexTaskState, matchPatterns, missingSeoElements, parseBodyDesc, parseEnrichment, parseEntry, parseField, protectedPathGuard, registerGuard, requiredArchSkill, runGuards, securityGuard, skillTriggerGate, solidReadGate, usesTailwindUtilities };
1
+ import { $ as ASK_PATTERNS, A as FAIL_CLOSED, B as SWIFT_PROTO_RE, C as usesTailwindUtilities, Ct as ModularArchitecture, D as MAX_TOKENS, Dt as isApexCommand, E as MAX_EXA_RESULTS, Et as detectProjectType, F as installGuard, G as CODE_MUTATORS, H as interfaceSeparationGuard, I as GO_DECL_RE, J as SAFE_PREFIXES, K as CODE_REDIRECT, L as JAVA_DECL_RE, M as clearUserGuards, N as registerGuard, O as capVerbosity, Ot as requiredArchSkill, P as runGuards, Q as protectedPathGuard, R as PHP_DECL_RE, S as skillTriggerGate, St as DEV_KEYWORDS, T as frameworkSolidGate, Tt as detectModularArchitecture, U as bashWriteGuard, V as TS_DECL_RE, W as ASK_WRITERS, X as PROTECTED_FRAGMENTS, Y as SESSION_STATE_FRAGMENT, Z as PROTECTED_GIT_RE, _ as DEV_VERBS, _t as SOLID_REF, a as firstHeading, at as evaluate, b as detectClaudeMdProjectType, bt as evaluateFileSize, c as parseEntry, ct as GIT_ASK, d as EXCLUDE_DIRS, dt as RALPH_SAFE, et as CRITICAL_PATTERNS, f as PROJECT_INDICATORS, ft as SYSTEM_INSTALL, g as loadApexTaskState, gt as PLUGINS_DIR, h as buildApexTaskInjection, ht as FileSizeVerdict, i as firstComment, it as GuardContext, j as GUARDS, k as detectCreationIntent, l as parseBodyDesc, lt as GIT_BLOCKED, m as buildApexTaskContext, mt as matchPatterns, n as missingSeoElements, nt as securityGuard, o as TreeEntry, ot as PolicyContext, p as ApexTaskState, pt as isRalphMode, q as FILE_REDIRECT, r as descFromText, rt as Guard, s as parseEnrichment, st as PolicyResult, t as isHtmlLike, tt as LabeledPattern, u as parseField, ut as PROJECT_INSTALL, v as buildApexInstruction, vt as countFrameworkCodeLines, w as SKILL_TRIGGERS, wt as ProjectType, x as detectRequiredSkills, xt as detectFramework, y as buildClaudeMdContext, yt as countLines, z as PY_MODEL_RE } from "../index-BfMsILmg.mjs";
2
+ import { a as PRE_AUTH_GATES, c as evaluateApex, i as POST_AUTH_GATES, l as freshnessGate, n as ApexContext, o as brainstormGate, r as ApexGate, s as docConsultedGate, t as APEX_GATES, u as solidReadGate } from "../apex-Wdi1nq_w.mjs";
3
+ export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, ApexTaskState, CODE_MUTATORS, CODE_REDIRECT, CRITICAL_PATTERNS, DEV_KEYWORDS, DEV_VERBS, EXCLUDE_DIRS, FAIL_CLOSED, FILE_REDIRECT, FileSizeVerdict, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GUARDS, Guard, GuardContext, JAVA_DECL_RE, LabeledPattern, MAX_EXA_RESULTS, MAX_TOKENS, ModularArchitecture, PHP_DECL_RE, PLUGINS_DIR, POST_AUTH_GATES, PRE_AUTH_GATES, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, type PolicyContext, type PolicyResult, ProjectType, RALPH_SAFE, SAFE_PREFIXES, SESSION_STATE_FRAGMENT, SKILL_TRIGGERS, SOLID_REF, SWIFT_PROTO_RE, SYSTEM_INSTALL, TS_DECL_RE, TreeEntry, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, capVerbosity, clearUserGuards, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, evaluate, evaluateApex, evaluateFileSize, firstComment, firstHeading, frameworkSolidGate, freshnessGate, installGuard, interfaceSeparationGuard, isApexCommand, isHtmlLike, isRalphMode, loadApexTaskState, matchPatterns, missingSeoElements, parseBodyDesc, parseEnrichment, parseEntry, parseField, protectedPathGuard, registerGuard, requiredArchSkill, runGuards, securityGuard, skillTriggerGate, solidReadGate, usesTailwindUtilities };
@@ -1,4 +1,5 @@
1
- import { A as MAX_EXA_RESULTS, B as detectFramework, D as frameworkSolidGate, E as SKILL_TRIGGERS, F as brainstormGate, G as requiredArchSkill, H as detectModularArchitecture, I as docConsultedGate, L as evaluateApex, M as capVerbosity, N as detectCreationIntent, P as APEX_GATES, R as freshnessGate, S as usesTailwindUtilities, U as detectProjectType, V as DEV_KEYWORDS, W as isApexCommand, a as firstHeading, b as detectRequiredSkills, c as EXCLUDE_DIRS, d as buildApexTaskInjection, f as loadApexTaskState, g as detectClaudeMdProjectType, h as buildClaudeMdContext, i as firstComment, j as MAX_TOKENS, l as PROJECT_INDICATORS, m as buildApexInstruction, n as missingSeoElements, o as parseEnrichment, p as DEV_VERBS, r as descFromText, s as parseEntry, t as isHtmlLike, u as buildApexTaskContext, v as parseBodyDesc, x as skillTriggerGate, y as parseField, z as solidReadGate } from "../validate-ebDjIyOa.mjs";
2
- import { A as PROJECT_INSTALL, C as PROTECTED_GIT_RE, D as securityGuard, E as CRITICAL_PATTERNS, F as PLUGINS_DIR, I as SOLID_REF, L as countFrameworkCodeLines, M as SYSTEM_INSTALL, N as isRalphMode, O as GIT_ASK, P as matchPatterns, R as countLines, S as PROTECTED_FRAGMENTS, T as ASK_PATTERNS, _ as CODE_MUTATORS, a as registerGuard, b as SAFE_PREFIXES, c as GO_DECL_RE, d as PY_MODEL_RE, f as SWIFT_PROTO_RE, g as ASK_WRITERS, h as bashWriteGuard, i as clearUserGuards, j as RALPH_SAFE, k as GIT_BLOCKED, l as JAVA_DECL_RE, m as interfaceSeparationGuard, n as FAIL_CLOSED, o as runGuards, p as TS_DECL_RE, r as GUARDS, s as installGuard, t as evaluate, u as PHP_DECL_RE, v as CODE_REDIRECT, w as protectedPathGuard, x as SESSION_STATE_FRAGMENT, y as FILE_REDIRECT, z as evaluateFileSize } from "../evaluate-qYC5xClb.mjs";
1
+ import { A as detectCreationIntent, B as DEV_KEYWORDS, C as SKILL_TRIGGERS, D as MAX_EXA_RESULTS, F as docConsultedGate, H as detectProjectType, I as evaluateApex, L as freshnessGate, M as POST_AUTH_GATES, N as PRE_AUTH_GATES, O as MAX_TOKENS, P as brainstormGate, R as solidReadGate, S as usesTailwindUtilities, U as isApexCommand, V as detectModularArchitecture, W as requiredArchSkill, a as firstHeading, b as detectRequiredSkills, c as EXCLUDE_DIRS, d as buildApexTaskInjection, f as loadApexTaskState, g as detectClaudeMdProjectType, h as buildClaudeMdContext, i as firstComment, j as APEX_GATES, k as capVerbosity, l as PROJECT_INDICATORS, m as buildApexInstruction, n as missingSeoElements, o as parseEnrichment, p as DEV_VERBS, r as descFromText, s as parseEntry, t as isHtmlLike, u as buildApexTaskContext, v as parseBodyDesc, w as frameworkSolidGate, x as skillTriggerGate, y as parseField, z as detectFramework } from "../validate-DCQ8dkdL.mjs";
2
+ import { d as countFrameworkCodeLines, f as countLines, l as PLUGINS_DIR, p as evaluateFileSize, u as SOLID_REF } from "../home-state-D0RLWP8J.mjs";
3
+ import { A as PROJECT_INSTALL, C as PROTECTED_GIT_RE, D as securityGuard, E as CRITICAL_PATTERNS, M as SYSTEM_INSTALL, N as isRalphMode, O as GIT_ASK, P as matchPatterns, S as PROTECTED_FRAGMENTS, T as ASK_PATTERNS, _ as CODE_MUTATORS, a as registerGuard, b as SAFE_PREFIXES, c as GO_DECL_RE, d as PY_MODEL_RE, f as SWIFT_PROTO_RE, g as ASK_WRITERS, h as bashWriteGuard, i as clearUserGuards, j as RALPH_SAFE, k as GIT_BLOCKED, l as JAVA_DECL_RE, m as interfaceSeparationGuard, n as FAIL_CLOSED, o as runGuards, p as TS_DECL_RE, r as GUARDS, s as installGuard, t as evaluate, u as PHP_DECL_RE, v as CODE_REDIRECT, w as protectedPathGuard, x as SESSION_STATE_FRAGMENT, y as FILE_REDIRECT } from "../evaluate-CNAzgxnN.mjs";
3
4
  import "../policy-la_KkjCS.mjs";
4
- export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, CRITICAL_PATTERNS, DEV_KEYWORDS, DEV_VERBS, EXCLUDE_DIRS, FAIL_CLOSED, FILE_REDIRECT, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GUARDS, JAVA_DECL_RE, MAX_EXA_RESULTS, MAX_TOKENS, PHP_DECL_RE, PLUGINS_DIR, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, RALPH_SAFE, SAFE_PREFIXES, SESSION_STATE_FRAGMENT, SKILL_TRIGGERS, SOLID_REF, SWIFT_PROTO_RE, SYSTEM_INSTALL, TS_DECL_RE, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, capVerbosity, clearUserGuards, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, evaluate, evaluateApex, evaluateFileSize, firstComment, firstHeading, frameworkSolidGate, freshnessGate, installGuard, interfaceSeparationGuard, isApexCommand, isHtmlLike, isRalphMode, loadApexTaskState, matchPatterns, missingSeoElements, parseBodyDesc, parseEnrichment, parseEntry, parseField, protectedPathGuard, registerGuard, requiredArchSkill, runGuards, securityGuard, skillTriggerGate, solidReadGate, usesTailwindUtilities };
5
+ export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, CODE_MUTATORS, CODE_REDIRECT, CRITICAL_PATTERNS, DEV_KEYWORDS, DEV_VERBS, EXCLUDE_DIRS, FAIL_CLOSED, FILE_REDIRECT, GIT_ASK, GIT_BLOCKED, GO_DECL_RE, GUARDS, JAVA_DECL_RE, MAX_EXA_RESULTS, MAX_TOKENS, PHP_DECL_RE, PLUGINS_DIR, POST_AUTH_GATES, PRE_AUTH_GATES, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, RALPH_SAFE, SAFE_PREFIXES, SESSION_STATE_FRAGMENT, SKILL_TRIGGERS, SOLID_REF, SWIFT_PROTO_RE, SYSTEM_INSTALL, TS_DECL_RE, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, capVerbosity, clearUserGuards, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, evaluate, evaluateApex, evaluateFileSize, firstComment, firstHeading, frameworkSolidGate, freshnessGate, installGuard, interfaceSeparationGuard, isApexCommand, isHtmlLike, isRalphMode, loadApexTaskState, matchPatterns, missingSeoElements, parseBodyDesc, parseEnrichment, parseEntry, parseField, protectedPathGuard, registerGuard, requiredArchSkill, runGuards, securityGuard, skillTriggerGate, solidReadGate, usesTailwindUtilities };
@@ -1,2 +1,2 @@
1
- import { n as PromptKind, r as formatPrompt, t as Prompt } from "../types-D56jSgD9.mjs";
1
+ import { n as PromptKind, r as formatPrompt, t as Prompt } from "../types-DVbIl9md.mjs";
2
2
  export { Prompt, PromptKind, formatPrompt };
@@ -1,5 +1,5 @@
1
1
  import { t as isCodeFile } from "./project-root-3kk7gCOp.mjs";
2
- import { t as evaluate } from "./evaluate-qYC5xClb.mjs";
2
+ import { t as evaluate } from "./evaluate-CNAzgxnN.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
@@ -1,6 +1,6 @@
1
- import { t as Prompt } from "../types-D56jSgD9.mjs";
1
+ import { t as Prompt } from "../types-DVbIl9md.mjs";
2
2
  import { t as RefMeta } from "../types-CY5qT2X1.mjs";
3
- import { t as AgentQuality } from "../session-state-V8Jp-KE5.mjs";
3
+ import { t as AgentQuality } from "../session-state-DMpotbRz.mjs";
4
4
 
5
5
  //#region src/runtime/paths.d.ts
6
6
  /**
@@ -50,6 +50,7 @@ type Activity = {
50
50
  framework: string;
51
51
  sessionId: string;
52
52
  source: string;
53
+ ts?: number;
53
54
  } | {
54
55
  kind: "ref";
55
56
  path: string;
@@ -174,17 +175,30 @@ declare function normalizeEvent(id: string, payload: Record<string, unknown>): N
174
175
  * Map a portable {@link Prompt} to a harness's native hook response, honoring
175
176
  * all 3 prompt kinds (`block`/`ask`/`inform`) instead of collapsing `ask` and
176
177
  * `inform` together. Reuses the Claude adapter's `denyResponse`/
177
- * `contextResponse` builders for claude-code/codex (same hook shape) to avoid
178
- * duplicating the JSON.
178
+ * `contextResponse`/`informResponse` builders for claude-code/codex (same hook
179
+ * shape) to avoid duplicating the JSON.
179
180
  * - claude-code/codex: `block` -> deny, `ask` -> interactive
180
181
  * `permissionDecision:"ask"`, `inform` -> non-blocking `additionalContext`.
181
182
  * - gemini-cli/cline: their real hook schemas have no interactive "ask"
182
183
  * state (deny is the only blocking outcome), so `ask` and `inform` already
183
184
  * both resolve to non-blocking context injection — unchanged.
184
- * - cursor: `ask` keeps its current best-effort `permission:"ask"` shape
185
- * (unverified against Cursor's exact hook docs); only `inform` is fixed to
186
- * a non-blocking `permission:"allow"` note, since it was wrongly conflated
187
- * with `ask` before.
185
+ * - cursor: `ask` keeps its current best-effort `permission:"ask"` shape;
186
+ * only `inform` is fixed to a non-blocking `permission:"allow"` note.
187
+ * - hermes: delegated to the adapter's `toHermesResponse` — `block` ->
188
+ * `{decision:"block",reason}`; `ask`/`inform` degrade to non-blocking
189
+ * `{context}` (Hermes has no interactive "ask" state).
190
+ *
191
+ * User-visible pass notices (`prompt.userMessage`, Python `hook_output.allow_pass`
192
+ * / `post_pass` parity), by harness:
193
+ * - claude-code/codex: top-level `systemMessage` ("warning message shown to the
194
+ * user"); a pure notice (empty `reason`) emits `{systemMessage}` alone. Codex
195
+ * consumes the Claude hook schema, so it rides the same field.
196
+ * - gemini-cli: common `systemMessage` output field ("displayed immediately to
197
+ * the user in the terminal") — the notice rides there.
198
+ * - cursor: `user_message` is its user-visible channel (see case comment).
199
+ * - cline: NO user-visible channel (`cancel`/`contextModification`/
200
+ * `errorMessage`-on-cancel only) — the notice is dropped silently (a pure
201
+ * notice returns "" = plain allow).
188
202
  */
189
203
  declare function respond(id: string, prompt: Prompt): string;
190
204
  //#endregion
@@ -226,8 +240,24 @@ declare function mcpPostStore(tool: string, input: Record<string, unknown>, resp
226
240
  //#endregion
227
241
  //#region src/runtime/inject-context.d.ts
228
242
  /**
243
+ * Build the {@link oncePerWindow} key for the CLAUDE.md preamble gate. The
244
+ * prompt hash keeps two distinct legitimate turns from colliding — even non-dev
245
+ * prompts, whose block is prompt-independent (just CLAUDE.md) and would
246
+ * otherwise hash-collide within the window — while the content hash still lets a
247
+ * same-turn double-fire of an identical block be suppressed. Single source of
248
+ * truth so the owner invariant test guards the real production key.
249
+ * @param prompt - The raw user prompt.
250
+ * @param ctx - The rendered CLAUDE.md (+ optional APEX) block.
251
+ * @returns The namespaced dedup key.
252
+ */
253
+ declare function claudeMdKey(prompt: string, ctx: string): string;
254
+ /**
229
255
  * UserPromptSubmit context injection: render the CLAUDE.md (+ optional APEX)
230
256
  * preamble as a Claude `additionalContext` response, or "" when nothing to emit.
257
+ * Guarded by {@link oncePerWindow} via {@link claudeMdKey}: only a
258
+ * near-simultaneous double-fire of the SAME turn (identical prompt AND identical
259
+ * block, within {@link DEDUP_WINDOW_MS}) is suppressed. The invariant "CLAUDE.md
260
+ * is emitted on EVERY message" is thus preserved.
231
261
  * @param prompt - The raw user prompt.
232
262
  * @param cwd - Project root (for project-type detection).
233
263
  * @returns The native hook stdout (possibly empty).
@@ -797,4 +827,4 @@ interface PreContext {
797
827
  */
798
828
  declare function handlePre(ctx: PreContext): Promise<HandleOutcome>;
799
829
  //#endregion
800
- export { Activity, DEFAULT_WINDOW_MS, DuplicationVerdict, type GateInput, HandleOptions, HandleOutcome, LifecycleInput, MCP_TTL_MS, McpIntercept, NormalizedEvent, PluginScope, PreContext, REQUIRED_AGENTS, SolidProfile, TRIVIAL_BUDGET, ToolEvent, WEBFETCH_TTL_MS, activityFor, aipilotPostToolUse, cacheQueryOf, cartoSessionStart, checkFileSize, claudeHome, cleanupSession, countFiles, countLoc, defaultStateDir, detectDuplication, detectSolidProfile, devContext, dispatchAipilot, dispatchLessons, dispatchLifecycle, dispatchMemory, dryGate, extractSymbols, fuseHarnessHome, fusengineCache, gate, generateEcosystemMap, generateProjectMap, getFileDesc, gitContext, handleHook, handlePre, harnessStateDir, injectRules, isMcpTool, isProject, isoUtc, lessonsFileFor, lessonsStateFileFor, lifecycleStdout, listChildren, loadEnriched, loadSecurityState, loadSessionState, logToolFailure, mcpPostStore, mcpPreIntercept, mergeLines, normalizeEvent, postEditContext, postEditTypescript, postTrackingSideEffects, preCommitGate, projectContext, projectHash, promptSubmitContext, pruneEmptyDirs, purgeTtlTree, queryOf, readRules, recordActivity, removeOldFiles, respond, runSessionStartCleanups, sanitizeSessionId, saveApexState, saveSecurityState, saveSessionState, securityAdvisory, securityStateDir, securityStatePath, seoPostToolUse, seoPostToolUseResponse, sessionStartCore, sessionStatePath, sessionsDir, solidDetectStart, subagentCacheContext, taskContext, todayUtc, trackAgentMemory, trackEnrichment, trackFile, trackMcpResearch, trackSessionChanges, trackSkillRead, trackWatchResearch, trimLogFile, validateRulesLoaded, validateSolidGate, validateTailwind, validateTeammateOutput, writePluginMap, writeTree };
830
+ export { Activity, DEFAULT_WINDOW_MS, DuplicationVerdict, type GateInput, HandleOptions, HandleOutcome, LifecycleInput, MCP_TTL_MS, McpIntercept, NormalizedEvent, PluginScope, PreContext, REQUIRED_AGENTS, SolidProfile, TRIVIAL_BUDGET, ToolEvent, WEBFETCH_TTL_MS, activityFor, aipilotPostToolUse, cacheQueryOf, cartoSessionStart, checkFileSize, claudeHome, claudeMdKey, cleanupSession, countFiles, countLoc, defaultStateDir, detectDuplication, detectSolidProfile, devContext, dispatchAipilot, dispatchLessons, dispatchLifecycle, dispatchMemory, dryGate, extractSymbols, fuseHarnessHome, fusengineCache, gate, generateEcosystemMap, generateProjectMap, getFileDesc, gitContext, handleHook, handlePre, harnessStateDir, injectRules, isMcpTool, isProject, isoUtc, lessonsFileFor, lessonsStateFileFor, lifecycleStdout, listChildren, loadEnriched, loadSecurityState, loadSessionState, logToolFailure, mcpPostStore, mcpPreIntercept, mergeLines, normalizeEvent, postEditContext, postEditTypescript, postTrackingSideEffects, preCommitGate, projectContext, projectHash, promptSubmitContext, pruneEmptyDirs, purgeTtlTree, queryOf, readRules, recordActivity, removeOldFiles, respond, runSessionStartCleanups, sanitizeSessionId, saveApexState, saveSecurityState, saveSessionState, securityAdvisory, securityStateDir, securityStatePath, seoPostToolUse, seoPostToolUseResponse, sessionStartCore, sessionStatePath, sessionsDir, solidDetectStart, subagentCacheContext, taskContext, todayUtc, trackAgentMemory, trackEnrichment, trackFile, trackMcpResearch, trackSessionChanges, trackSkillRead, trackWatchResearch, trimLogFile, validateRulesLoaded, validateSolidGate, validateTailwind, validateTeammateOutput, writePluginMap, writeTree };