@fusengine/harness 0.1.43 → 0.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/claude/index.d.mts +2 -2
- package/dist/adapters/claude/index.mjs +2 -2
- package/dist/adapters/cline/index.mjs +1 -1
- package/dist/adapters/codex/index.d.mts +1 -1
- package/dist/adapters/codex/index.mjs +1 -1
- package/dist/adapters/cursor/index.mjs +1 -1
- package/dist/adapters/gemini/index.mjs +1 -1
- package/dist/{claude-CeRYMOaG.mjs → claude-DLh0fHWM.mjs} +6 -2
- package/dist/cli/bin.mjs +227 -7
- package/dist/cli/index.mjs +1 -1
- package/dist/config/index.d.mts +1 -1
- package/dist/config/index.mjs +1 -2
- package/dist/{doc-helpers-D14nkD5D.d.mts → doc-helpers-BNfYWvYv.d.mts} +9 -1
- package/dist/{doc-helpers-BhzDmJ18.mjs → doc-helpers-CWZegVdR.mjs} +14 -5
- package/dist/{dotenv-DGyLln7U.mjs → dotenv-B9nM4cuQ.mjs} +26 -1
- package/dist/evaluate-d7Pp8XJH.mjs +784 -0
- package/dist/freshness/index.d.mts +1 -1
- package/dist/freshness/index.mjs +1 -1
- package/dist/{handle-BTHcKWQ5.mjs → handle-CtMMVoxT.mjs} +789 -357
- package/dist/home-state-mKZxP4oZ.mjs +52 -0
- package/dist/{index-D7GpOmkl.d.mts → index-BA-SqNR7.d.mts} +1 -1
- package/dist/{index-DXQfL1u8.d.mts → index-BXPySPxE.d.mts} +7 -1
- package/dist/{index-CwOdFBOr.d.mts → index-BxjzFraL.d.mts} +3 -1
- package/dist/{index-DN4cZDbU.d.mts → index-CVhw7eA0.d.mts} +111 -23
- package/dist/index.d.mts +5 -5
- package/dist/index.mjs +7 -8
- package/dist/{loader-Bn-DbZmt.mjs → loader-AGz4nK7d.mjs} +1 -1
- package/dist/policy/index.d.mts +2 -2
- package/dist/policy/index.mjs +3 -3
- package/dist/refs/index.mjs +2 -2
- package/dist/{router-BfX0hJg8.mjs → router-PKVNBHge.mjs} +11 -1
- package/dist/{run-jgivVDv6.mjs → run-DLXtA5DH.mjs} +1 -1
- package/dist/runtime/index.d.mts +71 -14
- package/dist/runtime/index.mjs +3 -3
- package/dist/{session-state-Dzq6yrw7.d.mts → session-state-D4F_Dub6.d.mts} +1 -1
- package/dist/state/index.d.mts +1 -1
- package/dist/{store-CdWOQ9zD.mjs → store-CNjFenWe.mjs} +3 -50
- package/dist/tracking/index.d.mts +1 -1
- package/dist/tracking/index.mjs +1 -1
- package/dist/{validate-xi-zc-22.mjs → validate-Ca7NSp-r.mjs} +495 -83
- package/package.json +1 -1
- package/dist/evaluate-CeivW6G0.mjs +0 -477
- package/dist/ttl-BG55s6HZ.mjs +0 -20
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { t as atomicWrite } from "./json-io-DisYd2fb.mjs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
4
|
+
import { homedir } from "node:os";
|
|
5
|
+
//#region src/runtime/home-state.ts
|
|
6
|
+
/** Home `~/.claude` dir — per-harness config (CLAUDE.md, logs, plugins). */
|
|
7
|
+
function claudeHome(home = homedir()) {
|
|
8
|
+
return join(home, ".claude");
|
|
9
|
+
}
|
|
10
|
+
/** Neutral, harness-agnostic home for fuse-harness's OWN cache/state: `~/.fuse-harness`. */
|
|
11
|
+
function fuseHarnessHome(home = homedir()) {
|
|
12
|
+
return join(home, ".fuse-harness");
|
|
13
|
+
}
|
|
14
|
+
/** `~/.fuse-harness/cache` base dir for session/cache state (shared across harnesses). */
|
|
15
|
+
function fusengineCache(home = homedir()) {
|
|
16
|
+
return join(fuseHarnessHome(home), "cache");
|
|
17
|
+
}
|
|
18
|
+
/** `~/.fuse-harness/cache/sessions` — per-session JSON state dir. */
|
|
19
|
+
function sessionsDir(home = homedir()) {
|
|
20
|
+
return join(fusengineCache(home), "sessions");
|
|
21
|
+
}
|
|
22
|
+
const SID_RE = /^[a-zA-Z0-9_-]{1,128}$/;
|
|
23
|
+
/** Validate a session id (1-128 url-safe chars); null when invalid. */
|
|
24
|
+
function sanitizeSessionId(sid) {
|
|
25
|
+
const s = String(sid ?? "").trim();
|
|
26
|
+
return SID_RE.test(s) ? s : null;
|
|
27
|
+
}
|
|
28
|
+
/** Unified per-session state file path: `sessions/session-<sid>.json`. */
|
|
29
|
+
function sessionStatePath(sid, home = homedir()) {
|
|
30
|
+
return join(sessionsDir(home), `session-${sid}.json`);
|
|
31
|
+
}
|
|
32
|
+
/** Load a session-state dict, or `{}` when missing/corrupt (mirrors Python). */
|
|
33
|
+
function loadSessionState(sid, home = homedir()) {
|
|
34
|
+
const path = sessionStatePath(sid, home);
|
|
35
|
+
try {
|
|
36
|
+
if (!existsSync(path)) return {};
|
|
37
|
+
const data = JSON.parse(readFileSync(path, "utf-8"));
|
|
38
|
+
return typeof data === "object" && data !== null && !Array.isArray(data) ? data : {};
|
|
39
|
+
} catch {
|
|
40
|
+
return {};
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
/** Atomically persist a session-state dict (0o600 via atomicWrite, indent 2). */
|
|
44
|
+
function saveSessionState(sid, state, home = homedir()) {
|
|
45
|
+
mkdirSync(sessionsDir(home), {
|
|
46
|
+
recursive: true,
|
|
47
|
+
mode: 448
|
|
48
|
+
});
|
|
49
|
+
atomicWrite(sessionStatePath(sid, home), JSON.stringify(state, null, 2));
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
export { sanitizeSessionId as a, sessionsDir as c, loadSessionState as i, fuseHarnessHome as n, saveSessionState as o, fusengineCache as r, sessionStatePath as s, claudeHome as t };
|
|
@@ -9,7 +9,13 @@ import { i as HarnessId } from "./harness-BPPu5CrN.mjs";
|
|
|
9
9
|
declare function parseEnvInt(raw: string | undefined, fallback: number): number;
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/config/ttl.d.ts
|
|
12
|
-
/**
|
|
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
|
+
*/
|
|
13
19
|
declare const DEFAULT_TTL_SEC = 120;
|
|
14
20
|
/** Default env var name carrying the TTL override. */
|
|
15
21
|
declare const TTL_ENV_KEY = "FUSE_ENFORCE_TTL_SEC";
|
|
@@ -28,6 +28,8 @@ declare function denyResponse(event: string, reason: string): string;
|
|
|
28
28
|
declare function blockResponse(reason: string): string;
|
|
29
29
|
/** An `additionalContext` injection response. */
|
|
30
30
|
declare function contextResponse(event: string, text: string): string;
|
|
31
|
+
/** A raw `systemMessage` notice — shown to the user without blocking the tool. Mirrors the shared Python `hook_output.allow_pass`/`post_pass` convention. */
|
|
32
|
+
declare function systemMessage(text: string): string;
|
|
31
33
|
/**
|
|
32
34
|
* Render a portable {@link Prompt} as a Claude Code hook response:
|
|
33
35
|
* `block` → `permissionDecision: deny`, `ask` → `permissionDecision: ask`
|
|
@@ -42,4 +44,4 @@ declare function guard(input: ClaudeHookInput): string | null;
|
|
|
42
44
|
/** @deprecated use {@link guard}. Kept for back-compat. */
|
|
43
45
|
declare const fileSizeGuard: typeof guard;
|
|
44
46
|
//#endregion
|
|
45
|
-
export { fileSizeGuard as a,
|
|
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 };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as Prompt } from "./types-D56jSgD9.mjs";
|
|
2
|
-
import { t as AuthEntry } from "./doc-helpers-
|
|
2
|
+
import { t as AuthEntry } from "./doc-helpers-BNfYWvYv.mjs";
|
|
3
3
|
import { t as RefMeta } from "./types-CY5qT2X1.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/policy/detect-project.d.ts
|
|
@@ -41,6 +41,18 @@ declare function detectProjectType(dir: string): ProjectType;
|
|
|
41
41
|
declare function detectFramework(filePath: string, content: string): string;
|
|
42
42
|
//#endregion
|
|
43
43
|
//#region src/policy/file-size.d.ts
|
|
44
|
+
/**
|
|
45
|
+
* Fixed marketplace plugins root — parity with Python `enforce-file-size.py`'s
|
|
46
|
+
* literal, unexpanded `~/...` string. Exported: reused by
|
|
47
|
+
* `policy/apex.ts::solidReadGate` for its "no reference matched" deny message.
|
|
48
|
+
*/
|
|
49
|
+
declare const PLUGINS_DIR = "~/.claude/plugins/marketplaces/fusengine-plugins/plugins";
|
|
50
|
+
/**
|
|
51
|
+
* Skill-dir fragment per framework — parity with Python
|
|
52
|
+
* `enforce-file-size.py::get_solid_ref()` (falls back to `generic/`). Exported:
|
|
53
|
+
* reused by `policy/apex.ts::solidReadGate` (see {@link PLUGINS_DIR}).
|
|
54
|
+
*/
|
|
55
|
+
declare const SOLID_REF: Record<string, string>;
|
|
44
56
|
/** Verdict from {@link evaluateFileSize}. */
|
|
45
57
|
interface FileSizeVerdict {
|
|
46
58
|
ok: boolean;
|
|
@@ -56,11 +68,34 @@ interface FileSizeVerdict {
|
|
|
56
68
|
*/
|
|
57
69
|
declare function countLines(content: string): number;
|
|
58
70
|
/**
|
|
71
|
+
* Count non-empty, non-comment lines — parity with the Python `count_code_lines`
|
|
72
|
+
* shared by the framework-specific SOLID validators: `_shared/scripts/validate_solid_common.py`
|
|
73
|
+
* (imported by `nextjs-expert/scripts/validate-nextjs-solid.py` and
|
|
74
|
+
* `swift-apple-expert/scripts/validate-swift-solid.py`), duplicated verbatim in
|
|
75
|
+
* `react-expert/scripts/validate-react-solid.py` / `laravel-expert/scripts/validate-laravel-solid.py`.
|
|
76
|
+
* Strips blank lines and lines starting with `//` or `*` — a SINGLE fixed rule
|
|
77
|
+
* for all 4 callers (the Python `comment` param defaults to, and every real
|
|
78
|
+
* call site leaves it at, `"//"` — never per-language despite covering
|
|
79
|
+
* ts/tsx/js/jsx, php and swift).
|
|
80
|
+
*
|
|
81
|
+
* Deliberately distinct from two other "code-only" counters already in this
|
|
82
|
+
* repo, neither of which is a faithful substitute here:
|
|
83
|
+
* - `countLoc` (`runtime/lifecycle/check-file-size.ts`): a genuinely
|
|
84
|
+
* per-language table (PHP additionally strips `#`, Python strips
|
|
85
|
+
* `#`/`"""`/`'''`) — ported from the unrelated `solid/scripts/check-file-size.py`.
|
|
86
|
+
* - `countCodeLines` (`runtime/lifecycle/aipilot/solid-compliance.ts`): also
|
|
87
|
+
* strips `#` — ported from `ai-pilot/scripts/check-solid-compliance.py`.
|
|
88
|
+
* Reusing either would silently strip PHP `#`/Python-style comments that the
|
|
89
|
+
* real react/nextjs/laravel/swift validators do NOT strip.
|
|
90
|
+
* @param content - The file content to measure.
|
|
91
|
+
*/
|
|
92
|
+
declare function countFrameworkCodeLines(content: string): number;
|
|
93
|
+
/**
|
|
59
94
|
* Evaluate a file's line count against the SOLID limit.
|
|
60
95
|
* @param lines - the file's line count
|
|
61
96
|
* @param max - the limit (defaults to `resolveMaxLines()`)
|
|
62
97
|
*/
|
|
63
|
-
declare function evaluateFileSize(lines: number, max?: number): FileSizeVerdict;
|
|
98
|
+
declare function evaluateFileSize(lines: number, max?: number, filePath?: string, framework?: string, displayLines?: number): FileSizeVerdict;
|
|
64
99
|
//#endregion
|
|
65
100
|
//#region src/policy/patterns.d.ts
|
|
66
101
|
/**
|
|
@@ -110,6 +145,12 @@ interface PolicyResult {
|
|
|
110
145
|
*/
|
|
111
146
|
declare function evaluate(ctx: PolicyContext): PolicyResult;
|
|
112
147
|
//#endregion
|
|
148
|
+
//#region src/policy/apex-gates.d.ts
|
|
149
|
+
/** Gate: the routed SOLID references for this edit must have been read. */
|
|
150
|
+
declare const solidReadGate: ApexGate;
|
|
151
|
+
/** Gate: the required prior agents (explore + research) must have run within the window. */
|
|
152
|
+
declare const freshnessGate: ApexGate;
|
|
153
|
+
//#endregion
|
|
113
154
|
//#region src/policy/apex.d.ts
|
|
114
155
|
/**
|
|
115
156
|
* Session context for the stateful APEX gates. The harness adapter supplies this
|
|
@@ -129,6 +170,10 @@ interface ApexContext {
|
|
|
129
170
|
refsRead?: string[];
|
|
130
171
|
/** Whether the required prior agents (explore + research) ran within the freshness window. */
|
|
131
172
|
agentsFresh?: boolean;
|
|
173
|
+
/** Names of REQUIRED_AGENTS that have NOT run fresh (subset), for a precise freshnessGate message. Absent → generic wording. */
|
|
174
|
+
missingAgents?: string[];
|
|
175
|
+
/** Freshness window in ms, used only to label the block message with its TTL (e.g. "2min"). */
|
|
176
|
+
windowMs?: number;
|
|
132
177
|
/** Whether brainstorming is required for this edit (creation intent on a new file). */
|
|
133
178
|
brainstormRequired?: boolean;
|
|
134
179
|
/** Whether the brainstorming agent ran within the window. */
|
|
@@ -136,12 +181,8 @@ interface ApexContext {
|
|
|
136
181
|
}
|
|
137
182
|
/** A single APEX gate: returns a blocking {@link Prompt}, or null to pass. */
|
|
138
183
|
type ApexGate = (ctx: ApexContext) => Prompt | null;
|
|
139
|
-
/** Gate:
|
|
184
|
+
/** Gate: BOTH Context7 AND Exa (or a web fallback alone) must have been consulted this session. */
|
|
140
185
|
declare const docConsultedGate: ApexGate;
|
|
141
|
-
/** Gate: the routed SOLID references for this edit must have been read. */
|
|
142
|
-
declare const solidReadGate: ApexGate;
|
|
143
|
-
/** Gate: the required prior agents (explore + research) must have run within the window. */
|
|
144
|
-
declare const freshnessGate: ApexGate;
|
|
145
186
|
/** Gate: brainstorming must precede creating new files when flagged. */
|
|
146
187
|
declare const brainstormGate: ApexGate;
|
|
147
188
|
/** Default APEX gate chain (brainstorm, freshness, docs, SOLID refs). */
|
|
@@ -164,10 +205,15 @@ interface GuardContext {
|
|
|
164
205
|
type Guard = (ctx: GuardContext) => Prompt | null;
|
|
165
206
|
//#endregion
|
|
166
207
|
//#region src/policy/guards/security.d.ts
|
|
167
|
-
/**
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
208
|
+
/** A pattern paired with the violation label to name in the deny/ask reason. */
|
|
209
|
+
interface LabeledPattern {
|
|
210
|
+
re: RegExp;
|
|
211
|
+
label: string;
|
|
212
|
+
}
|
|
213
|
+
/** Critical patterns that must always be blocked — parity `security_rules.py`'s cumulated violation names. */
|
|
214
|
+
declare const CRITICAL_PATTERNS: LabeledPattern[];
|
|
215
|
+
/** Patterns that warrant explicit confirmation before running — parity `security_rules.py`'s ask-level violation names. */
|
|
216
|
+
declare const ASK_PATTERNS: LabeledPattern[];
|
|
171
217
|
/** Guards against dangerous Bash commands (critical → block, sensitive → ask). */
|
|
172
218
|
declare function securityGuard(ctx: GuardContext): Prompt | null;
|
|
173
219
|
//#endregion
|
|
@@ -199,21 +245,45 @@ declare const PROTECTED_GIT_RE: RegExp;
|
|
|
199
245
|
*/
|
|
200
246
|
declare function protectedPathGuard(ctx: GuardContext): Prompt | null;
|
|
201
247
|
//#endregion
|
|
202
|
-
//#region src/policy/guards/bash-write.d.ts
|
|
248
|
+
//#region src/policy/guards/bash-write-patterns.d.ts
|
|
203
249
|
/** Redirect (`>`/`>>`) targeting a code-file extension. */
|
|
204
250
|
declare const CODE_REDIRECT: RegExp;
|
|
205
|
-
/**
|
|
206
|
-
*
|
|
207
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Interpreters / tools that mutate source in place, plus heredoc-into-file —
|
|
253
|
+
* split into labeled sub-patterns (parity bash-write-guard.py `DENY_PATTERNS`,
|
|
254
|
+
* each with its own `desc`) so the deny reason names which motif matched
|
|
255
|
+
* instead of a single generic message for all six.
|
|
256
|
+
*/
|
|
257
|
+
declare const CODE_MUTATORS: readonly {
|
|
258
|
+
re: RegExp;
|
|
259
|
+
desc: string;
|
|
260
|
+
}[];
|
|
208
261
|
/** Redirect to a non-code file. Excludes `/dev/null`, `2>`/`N>` and `>&N` fd
|
|
209
262
|
* redirects via the `(?<![0-9&])` lookbehind + `(?!…|&)` (parity has_file_redirect). */
|
|
210
263
|
declare const FILE_REDIRECT: RegExp;
|
|
211
|
-
/** Other ambiguous file writers (ASK): `tee <file>` (not `tee -a`/path) and `dd … of
|
|
212
|
-
|
|
264
|
+
/** Other ambiguous file writers (ASK): `tee <file>` (not `tee -a`/path) and `dd … of=` —
|
|
265
|
+
* labeled sub-patterns (parity bash-write-guard.py `ASK_PATTERNS`). */
|
|
266
|
+
declare const ASK_WRITERS: readonly {
|
|
267
|
+
re: RegExp;
|
|
268
|
+
desc: string;
|
|
269
|
+
}[];
|
|
270
|
+
/** Commands whose first token never writes, skipped when a real redirect is
|
|
271
|
+
* present (parity bash-write-guard.py `SAFE_PREFIXES`). */
|
|
272
|
+
declare const SAFE_PREFIXES: readonly string[];
|
|
273
|
+
/**
|
|
274
|
+
* Session-state directory the freshness/APEX gates rely on. Any Bash command
|
|
275
|
+
* touching it is a hook-bypass vector, so it is blocked outright — a blunt
|
|
276
|
+
* substring match (read OR write), parity with bash-write-guard.py DENY_PATTERNS
|
|
277
|
+
* `fusengine-cache/sessions` (rebranded to the harness cache path).
|
|
278
|
+
*/
|
|
279
|
+
declare const SESSION_STATE_FRAGMENT = ".fuse-harness/cache/sessions";
|
|
280
|
+
//#endregion
|
|
281
|
+
//#region src/policy/guards/bash-write.d.ts
|
|
213
282
|
/**
|
|
214
283
|
* Blocks shell commands that mutate code files in place (and heredocs/redirects
|
|
215
|
-
* to source files); asks before other file-writing shell commands
|
|
216
|
-
* of the Write/Edit tool so
|
|
284
|
+
* to source files); asks before other file-writing shell commands unless the
|
|
285
|
+
* target is a harness-owned safe path. Forces use of the Write/Edit tool so
|
|
286
|
+
* APEX/SOLID checks are not bypassed.
|
|
217
287
|
*/
|
|
218
288
|
declare function bashWriteGuard(ctx: GuardContext): Prompt | null;
|
|
219
289
|
//#endregion
|
|
@@ -239,6 +309,12 @@ declare const JAVA_DECL_RE: RegExp;
|
|
|
239
309
|
* controller files (Interface Segregation). Fires only when BOTH the path
|
|
240
310
|
* category AND the content pattern match.
|
|
241
311
|
*
|
|
312
|
+
* Destination text for TS/JS/Vue/Svelte, PHP and Swift matches the user's own
|
|
313
|
+
* `claude-rules/rules/04-solid-dry-rules.md` ("SOLID Skill per Stack" table),
|
|
314
|
+
* the current authoritative convention — NOT the older `enforce-interfaces.py`
|
|
315
|
+
* text, which this guard originally ported. Go/Python/Java/Kotlin aren't
|
|
316
|
+
* covered by that table, so their destinations stay as a reasonable default.
|
|
317
|
+
*
|
|
242
318
|
* Parity note: enforce-interfaces.py only inspects `Write` (tool_input.content).
|
|
243
319
|
* We deliberately also fire on `Edit` — an in-place edit can introduce the same
|
|
244
320
|
* violation — and the path fragments accept singular *and* plural directory
|
|
@@ -317,6 +393,14 @@ declare const SKILL_TRIGGERS: Readonly<Record<string, Readonly<Record<string, Re
|
|
|
317
393
|
*/
|
|
318
394
|
declare function detectRequiredSkills(framework: string, content: string): string[];
|
|
319
395
|
/**
|
|
396
|
+
* True when `filePath`/`content` match the Python Tailwind gate's trigger
|
|
397
|
+
* condition. React/Next.js components embed Tailwind utility classes in
|
|
398
|
+
* `className` — this check fires IN ADDITION TO the primary framework gate,
|
|
399
|
+
* never instead of it: {@link detectFramework} keeps returning "react"/
|
|
400
|
+
* "nextjs" for these files (framework SOLID rules stay correct).
|
|
401
|
+
*/
|
|
402
|
+
declare function usesTailwindUtilities(filePath: string, content: string): boolean;
|
|
403
|
+
/**
|
|
320
404
|
* Block when a required sub-skill's `skills/<name>/` path is absent from
|
|
321
405
|
* `refsRead`. Mirrors `specific_skill_consulted`, which confirms a skill was
|
|
322
406
|
* read by checking the tracking file contains `skills/<name>/`.
|
|
@@ -326,9 +410,13 @@ declare function detectRequiredSkills(framework: string, content: string): strin
|
|
|
326
410
|
* @param forcedSkill - a skill the detected modular architecture forces (optional).
|
|
327
411
|
* @param cwd - project root; when set and not a shadcn project, `*-shadcn`
|
|
328
412
|
* requirements are skipped (ports the Python `is_shadcn_project` filter).
|
|
413
|
+
* @param filePath - the file being written; when it's a `.tsx`/`.jsx` file
|
|
414
|
+
* with Tailwind utility classes in `className`, the "tailwind" domain
|
|
415
|
+
* skills are merged in alongside `framework`'s own (ports the separate
|
|
416
|
+
* `check-tailwind-skill.py` gate, independent of react/nextjs).
|
|
329
417
|
* @returns a `block` Prompt naming the missing sub-skills, or `null` when satisfied.
|
|
330
418
|
*/
|
|
331
|
-
declare function skillTriggerGate(framework: string, content: string, refsRead: string[], forcedSkill?: string | null, cwd?: string): Prompt | null;
|
|
419
|
+
declare function skillTriggerGate(framework: string, content: string, refsRead: readonly string[], forcedSkill?: string | null, cwd?: string, filePath?: string): Prompt | null;
|
|
332
420
|
//#endregion
|
|
333
421
|
//#region src/policy/claude-md-context.d.ts
|
|
334
422
|
/** Dev-verb regex (FR/EN) that triggers the APEX preamble (case-insensitive). */
|
|
@@ -341,14 +429,14 @@ declare const DEV_VERBS: RegExp;
|
|
|
341
429
|
* @param cwd - Project root to scan.
|
|
342
430
|
* @returns The detected project type label.
|
|
343
431
|
*/
|
|
344
|
-
declare function detectClaudeMdProjectType(cwd: string):
|
|
432
|
+
declare function detectClaudeMdProjectType(cwd: string): ProjectType;
|
|
345
433
|
/**
|
|
346
434
|
* Build the APEX instruction preamble for a development task.
|
|
347
435
|
* @param projectType - Detected project type label.
|
|
348
436
|
* @param maxLines - SOLID per-file line ceiling.
|
|
349
437
|
* @returns The APEX instruction text.
|
|
350
438
|
*/
|
|
351
|
-
declare function buildApexInstruction(projectType:
|
|
439
|
+
declare function buildApexInstruction(projectType: ProjectType, maxLines: number): string;
|
|
352
440
|
/**
|
|
353
441
|
* Build the UserPromptSubmit injection text: read `~/.claude/CLAUDE.md` and,
|
|
354
442
|
* when the prompt matches a dev verb, prepend the APEX instruction. Returns
|
|
@@ -483,4 +571,4 @@ declare function isHtmlLike(path: string): boolean;
|
|
|
483
571
|
*/
|
|
484
572
|
declare function missingSeoElements(html: string): string[];
|
|
485
573
|
//#endregion
|
|
486
|
-
export {
|
|
574
|
+
export { ASK_PATTERNS as $, FAIL_CLOSED as A, ProjectType as At, SWIFT_PROTO_RE as B, usesTailwindUtilities as C, SOLID_REF as Ct, MAX_TOKENS as D, detectFramework as Dt, MAX_EXA_RESULTS as E, evaluateFileSize 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, detectProjectType as Mt, registerGuard as N, isApexCommand as Nt, capVerbosity as O, DEV_KEYWORDS as Ot, runGuards as P, requiredArchSkill as Pt, protectedPathGuard as Q, PHP_DECL_RE as R, skillTriggerGate as S, PLUGINS_DIR as St, frameworkSolidGate as T, countLines 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, matchPatterns 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, detectModularArchitecture as jt, detectCreationIntent as k, ModularArchitecture 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, countFrameworkCodeLines as wt, detectRequiredSkills as x, FileSizeVerdict as xt, buildClaudeMdContext as y, SYSTEM_INSTALL as yt, PY_MODEL_RE as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { n as PromptKind, r as formatPrompt, t as Prompt } from "./types-D56jSgD9.mjs";
|
|
2
2
|
import { a as mcpCacheKey, c as extractText, d as summarizeIndex, f as compactMarkdown, i as cacheStore, l as IndexSummary, m as queryHash, n as cacheLookupSubstring, o as mcpCacheWrite, p as jaccardSimilar, r as cachePath, s as webfetchCacheWrite, t as cacheLookup, u as loadIndex } from "./index-BX-xcvhY.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-
|
|
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
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-
|
|
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";
|
|
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
|
|
8
|
+
import { $ as ASK_PATTERNS, A as FAIL_CLOSED, At as ProjectType, B as SWIFT_PROTO_RE, C as usesTailwindUtilities, Ct as SOLID_REF, D as MAX_TOKENS, Dt as detectFramework, E as MAX_EXA_RESULTS, Et as evaluateFileSize, 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, Mt as detectProjectType, N as registerGuard, Nt as isApexCommand, O as capVerbosity, Ot as DEV_KEYWORDS, P as runGuards, Pt as requiredArchSkill, Q as protectedPathGuard, R as PHP_DECL_RE, S as skillTriggerGate, St as PLUGINS_DIR, T as frameworkSolidGate, Tt as countLines, 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 matchPatterns, 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 detectModularArchitecture, k as detectCreationIntent, kt as ModularArchitecture, 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 countFrameworkCodeLines, x as detectRequiredSkills, xt as FileSizeVerdict, y as buildClaudeMdContext, yt as SYSTEM_INSTALL, z as PY_MODEL_RE } from "./index-CVhw7eA0.mjs";
|
|
9
9
|
import { n as RouteResult, r as ScoredRef, t as RefMeta } from "./types-CY5qT2X1.mjs";
|
|
10
10
|
import { a as ReminderState, c as readState, d as throttleMs, i as registryFile, l as setStateField, n as addRoot, o as lessonsFileFor, r as readRoots, s as nowStamp, t as ensureMemoryGitignore, u as stateFileFor } from "./index-DLYhervv.mjs";
|
|
11
11
|
import { a as globToRe, i as scoreReferences, n as toRefMeta, o as parseFrontmatter, r as routeReferences, t as loadRefs } from "./index-mmRF3KNp.mjs";
|
|
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-
|
|
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-BA-SqNR7.mjs";
|
|
13
13
|
import { _ as TIME_INTERVALS, a as formatCost, c as formatTokens, d as colors, f as progressiveColor, g as PROGRESS_CHARS, h as PROGRESS_BAR_DEFAULTS, i as formatBasename, l as ColorFn, m as GRADIENT_BLOCKS, n as generateGradientBar, o as formatPath, p as COLOR_THRESHOLDS, r as generateProgressBar, s as formatTimeLeft, t as ProgressBarOptions, u as Palette } from "./index-BWK8slRi.mjs";
|
|
14
|
-
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, ApexState, ApexTask, ApexTaskFile, ApexTaskState, AuthEntry, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, 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, MAX_EXA_RESULTS, MAX_LINES_ENV_KEY, MAX_TOKENS, ModularArchitecture, PHP_DECL_RE, 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, RefMeta, ReminderState, RouteResult, SKILL_TRIGGERS, STATE_GITIGNORE, STATE_ROOT, SWIFT_PROTO_RE, SYSTEM_INSTALL, ScoredRef, TIME_INTERVALS, TS_DECL_RE, TTL_ENV_KEY, TreeEntry, acquireLock, addRoot, apexStateDir, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, cacheLookup, cacheLookupSubstring, cachePath, cacheStore, capVerbosity, clearUserGuards, colors, compactJson, compactMarkdown, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectHarness, detectMode, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, ensureMemoryGitignore, ensureStateDir, 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, jaccardSimilar, lessonsFileFor, loadApexTaskState, loadDotenv, loadIndex, loadRefs, loadState, 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, saveState, scoreReferences, securityGuard, setStateField, skillTriggerGate, solidReadGate, splitTarget, stateFileFor, stateFilePath, summarizeIndex, taskComplete, taskCreate, taskStart, throttleMs, toRefMeta, ttlLabel, walkUpFor, webfetchCacheWrite };
|
|
14
|
+
export { APEX_GATES, ASK_PATTERNS, ASK_WRITERS, ApexContext, ApexGate, ApexState, ApexTask, ApexTaskFile, ApexTaskState, AuthEntry, CODE_MUTATORS, CODE_REDIRECT, COLOR_THRESHOLDS, CRITICAL_PATTERNS, 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, 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, acquireLock, addRoot, apexStateDir, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, cacheLookup, cacheLookupSubstring, cachePath, cacheStore, capVerbosity, clearUserGuards, colors, compactJson, compactMarkdown, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectHarness, detectMode, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, ensureMemoryGitignore, ensureStateDir, 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, jaccardSimilar, lessonsFileFor, loadApexTaskState, loadDotenv, loadIndex, loadRefs, loadState, 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, saveState, scoreReferences, securityGuard, setStateField, skillTriggerGate, solidReadGate, splitTarget, stateFileFor, stateFilePath, summarizeIndex, taskComplete, taskCreate, taskStart, throttleMs, toRefMeta, ttlLabel, usesTailwindUtilities, walkUpFor, webfetchCacheWrite };
|
package/dist/index.mjs
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
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 {
|
|
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";
|
|
3
3
|
import { n as STATE_ROOT, r as projectLayout, t as STATE_GITIGNORE } from "./layout-C0jaaCQC.mjs";
|
|
4
|
-
import { i as parseEnvFile, n as envCandidates, r as loadDotenv, t as HOME_DIR } from "./dotenv-DGyLln7U.mjs";
|
|
5
4
|
import { t as compactJson } from "./compact-json-DK2nX-MK.mjs";
|
|
6
5
|
import { i as walkUpFor, n as projectRoot, r as projectRootOrNull, t as isCodeFile } from "./project-root-3kk7gCOp.mjs";
|
|
7
6
|
import { n as detectMode, r as modeFor, t as detectHarness } from "./harness-C8Nxxyn_.mjs";
|
|
8
|
-
import { A as
|
|
9
|
-
import { A as
|
|
10
|
-
import { i as resolveSessions, n as formatDocSatisfactionStatus, r as isDocConsulted, t as formatDocDeny } from "./doc-helpers-
|
|
11
|
-
import { i as parseFrontmatter, n as scoreReferences, r as globToRe, t as routeReferences } from "./router-
|
|
7
|
+
import { A as detectCreationIntent, B as detectProjectType, C as skillTriggerGate, D as MAX_EXA_RESULTS, E as frameworkSolidGate, F as freshnessGate, H as requiredArchSkill, I as solidReadGate, L as detectFramework, M as brainstormGate, N as docConsultedGate, O as MAX_TOKENS, P as evaluateApex, R as DEV_KEYWORDS, S as detectRequiredSkills, T as SKILL_TRIGGERS, V as isApexCommand, a as firstHeading, 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 usesTailwindUtilities, y as parseField, z as detectModularArchitecture } from "./validate-Ca7NSp-r.mjs";
|
|
8
|
+
import { A as PROJECT_INSTALL, C as PROTECTED_GIT_RE, D as securityGuard, E as CRITICAL_PATTERNS, F as countFrameworkCodeLines, I as countLines, L as evaluateFileSize, M as matchPatterns, N as PLUGINS_DIR, O as GIT_ASK, P as SOLID_REF, 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 SYSTEM_INSTALL, 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-d7Pp8XJH.mjs";
|
|
9
|
+
import { i as resolveSessions, n as formatDocSatisfactionStatus, r as isDocConsulted, t as formatDocDeny } from "./doc-helpers-CWZegVdR.mjs";
|
|
10
|
+
import { i as parseFrontmatter, n as scoreReferences, r as globToRe, t as routeReferences } from "./router-PKVNBHge.mjs";
|
|
12
11
|
import { t as formatPrompt } from "./types-ernB1Dy3.mjs";
|
|
13
12
|
import { a as nowStamp, c as stateFileFor, i as lessonsFileFor, l as throttleMs, n as readRoots, o as readState, r as registryFile, s as setStateField, t as addRoot, u as ensureMemoryGitignore } from "./registry-CymilZiZ.mjs";
|
|
14
13
|
import { a as cachePath, c as extractText, d as compactMarkdown, f as jaccardSimilar, i as cacheLookupSubstring, l as loadIndex, n as webfetchCacheWrite, o as cacheStore, p as queryHash, r as cacheLookup, s as mcpCacheKey, t as mcpCacheWrite, u as summarizeIndex } from "./mcp-store-CnsW9oFj.mjs";
|
|
15
14
|
import { t as incrementTrivialEditCounter } from "./freshness-BV3PQkDB.mjs";
|
|
16
|
-
import { n as toRefMeta, t as loadRefs } from "./loader-
|
|
15
|
+
import { n as toRefMeta, t as loadRefs } from "./loader-AGz4nK7d.mjs";
|
|
17
16
|
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-9lWvvWk8.mjs";
|
|
18
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";
|
|
19
|
-
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, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, SKILL_TRIGGERS, STATE_GITIGNORE, STATE_ROOT, SWIFT_PROTO_RE, SYSTEM_INSTALL, TIME_INTERVALS, TS_DECL_RE, TTL_ENV_KEY, acquireLock, addRoot, apexStateDir, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, cacheLookup, cacheLookupSubstring, cachePath, cacheStore, capVerbosity, clearUserGuards, colors, compactJson, compactMarkdown, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectHarness, detectMode, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, ensureMemoryGitignore, ensureStateDir, 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, jaccardSimilar, lessonsFileFor, loadApexTaskState, loadDotenv, loadIndex, loadRefs, loadState, 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, saveState, scoreReferences, securityGuard, setStateField, skillTriggerGate, solidReadGate, splitTarget, stateFileFor, stateFilePath, summarizeIndex, taskComplete, taskCreate, taskStart, throttleMs, toRefMeta, ttlLabel, 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, PROGRESS_BAR_DEFAULTS, PROGRESS_CHARS, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, 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, acquireLock, addRoot, apexStateDir, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, cacheLookup, cacheLookupSubstring, cachePath, cacheStore, capVerbosity, clearUserGuards, colors, compactJson, compactMarkdown, countFrameworkCodeLines, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectHarness, detectMode, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, ensureMemoryGitignore, ensureStateDir, 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, jaccardSimilar, lessonsFileFor, loadApexTaskState, loadDotenv, loadIndex, loadRefs, loadState, 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, saveState, scoreReferences, securityGuard, setStateField, skillTriggerGate, solidReadGate, splitTarget, stateFileFor, stateFilePath, summarizeIndex, taskComplete, taskCreate, taskStart, throttleMs, toRefMeta, ttlLabel, usesTailwindUtilities, walkUpFor, webfetchCacheWrite };
|
package/dist/policy/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
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, MAX_EXA_RESULTS, MAX_TOKENS, ModularArchitecture, PHP_DECL_RE, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, type PolicyContext, type PolicyResult, ProjectType, SKILL_TRIGGERS, SWIFT_PROTO_RE, SYSTEM_INSTALL, TS_DECL_RE, TreeEntry, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, capVerbosity, clearUserGuards, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, evaluate, evaluateApex, evaluateFileSize, firstComment, firstHeading, frameworkSolidGate, freshnessGate, installGuard, interfaceSeparationGuard, isApexCommand, isHtmlLike, loadApexTaskState, matchPatterns, missingSeoElements, parseBodyDesc, parseEnrichment, parseEntry, parseField, protectedPathGuard, registerGuard, requiredArchSkill, runGuards, securityGuard, skillTriggerGate, solidReadGate };
|
|
1
|
+
import { $ as ASK_PATTERNS, A as FAIL_CLOSED, At as ProjectType, B as SWIFT_PROTO_RE, C as usesTailwindUtilities, Ct as SOLID_REF, D as MAX_TOKENS, Dt as detectFramework, E as MAX_EXA_RESULTS, Et as evaluateFileSize, 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, Mt as detectProjectType, N as registerGuard, Nt as isApexCommand, O as capVerbosity, Ot as DEV_KEYWORDS, P as runGuards, Pt as requiredArchSkill, Q as protectedPathGuard, R as PHP_DECL_RE, S as skillTriggerGate, St as PLUGINS_DIR, T as frameworkSolidGate, Tt as countLines, 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 matchPatterns, 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 detectModularArchitecture, k as detectCreationIntent, kt as ModularArchitecture, 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 countFrameworkCodeLines, x as detectRequiredSkills, xt as FileSizeVerdict, y as buildClaudeMdContext, yt as SYSTEM_INSTALL, z as PY_MODEL_RE } from "../index-CVhw7eA0.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, 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, loadApexTaskState, matchPatterns, missingSeoElements, parseBodyDesc, parseEnrichment, parseEntry, parseField, protectedPathGuard, registerGuard, requiredArchSkill, runGuards, securityGuard, skillTriggerGate, solidReadGate, usesTailwindUtilities };
|
package/dist/policy/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
import { A as
|
|
1
|
+
import { A as detectCreationIntent, B as detectProjectType, C as skillTriggerGate, D as MAX_EXA_RESULTS, E as frameworkSolidGate, F as freshnessGate, H as requiredArchSkill, I as solidReadGate, L as detectFramework, M as brainstormGate, N as docConsultedGate, O as MAX_TOKENS, P as evaluateApex, R as DEV_KEYWORDS, S as detectRequiredSkills, T as SKILL_TRIGGERS, V as isApexCommand, a as firstHeading, 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 usesTailwindUtilities, y as parseField, z as detectModularArchitecture } from "../validate-Ca7NSp-r.mjs";
|
|
2
|
+
import { A as PROJECT_INSTALL, C as PROTECTED_GIT_RE, D as securityGuard, E as CRITICAL_PATTERNS, F as countFrameworkCodeLines, I as countLines, L as evaluateFileSize, M as matchPatterns, N as PLUGINS_DIR, O as GIT_ASK, P as SOLID_REF, 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 SYSTEM_INSTALL, 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-d7Pp8XJH.mjs";
|
|
3
3
|
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, PROJECT_INDICATORS, PROJECT_INSTALL, PROTECTED_FRAGMENTS, PROTECTED_GIT_RE, PY_MODEL_RE, SKILL_TRIGGERS, SWIFT_PROTO_RE, SYSTEM_INSTALL, TS_DECL_RE, bashWriteGuard, brainstormGate, buildApexInstruction, buildApexTaskContext, buildApexTaskInjection, buildClaudeMdContext, capVerbosity, clearUserGuards, countLines, descFromText, detectClaudeMdProjectType, detectCreationIntent, detectFramework, detectModularArchitecture, detectProjectType, detectRequiredSkills, docConsultedGate, evaluate, evaluateApex, evaluateFileSize, firstComment, firstHeading, frameworkSolidGate, freshnessGate, installGuard, interfaceSeparationGuard, isApexCommand, isHtmlLike, loadApexTaskState, matchPatterns, missingSeoElements, parseBodyDesc, parseEnrichment, parseEntry, parseField, protectedPathGuard, registerGuard, requiredArchSkill, runGuards, securityGuard, skillTriggerGate, solidReadGate };
|
|
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, 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, loadApexTaskState, matchPatterns, missingSeoElements, parseBodyDesc, parseEnrichment, parseEntry, parseField, protectedPathGuard, registerGuard, requiredArchSkill, runGuards, securityGuard, skillTriggerGate, solidReadGate, usesTailwindUtilities };
|
package/dist/refs/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as parseFrontmatter, n as scoreReferences, r as globToRe, t as routeReferences } from "../router-
|
|
2
|
-
import { n as toRefMeta, t as loadRefs } from "../loader-
|
|
1
|
+
import { i as parseFrontmatter, n as scoreReferences, r as globToRe, t as routeReferences } from "../router-PKVNBHge.mjs";
|
|
2
|
+
import { n as toRefMeta, t as loadRefs } from "../loader-AGz4nK7d.mjs";
|
|
3
3
|
import "../refs-la_KkjCS.mjs";
|
|
4
4
|
export { globToRe, loadRefs, parseFrontmatter, routeReferences, scoreReferences, toRefMeta };
|
|
@@ -65,8 +65,18 @@ function routeReferences(refs, filePath, content, skillPath = "") {
|
|
|
65
65
|
return {
|
|
66
66
|
required: scored.slice(0, 2),
|
|
67
67
|
optional: scored.slice(2, 4),
|
|
68
|
-
skillPath
|
|
68
|
+
skillPath: skillPath || skillPathFromRef(scored[0]?.meta.filePath ?? "")
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Derive a skill's `SKILL.md` path from one of its `references/` file paths
|
|
73
|
+
* (`<skill>/references/...` → `<skill>/SKILL.md`), matching the on-disk skill
|
|
74
|
+
* layout {@link discoverRefs} walks. Returns "" when the ref's path doesn't
|
|
75
|
+
* follow that layout (e.g. ad-hoc refs dirs used in tests).
|
|
76
|
+
*/
|
|
77
|
+
function skillPathFromRef(refFilePath) {
|
|
78
|
+
const i = refFilePath.indexOf("/references/");
|
|
79
|
+
return i === -1 ? "" : `${refFilePath.slice(0, i)}/SKILL.md`;
|
|
80
|
+
}
|
|
71
81
|
//#endregion
|
|
72
82
|
export { parseFrontmatter as i, scoreReferences as n, globToRe as r, routeReferences as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as isCodeFile } from "./project-root-3kk7gCOp.mjs";
|
|
2
|
-
import { t as evaluate } from "./evaluate-
|
|
2
|
+
import { t as evaluate } from "./evaluate-d7Pp8XJH.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
|