@aaac/runtime 0.1.55 → 0.2.1

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 (71) hide show
  1. package/README.md +6 -11
  2. package/dist/adapters/adk-sdk.d.ts +3 -3
  3. package/dist/adapters/adk-sdk.js +6 -8
  4. package/dist/adapters/adk-sdk.js.map +1 -1
  5. package/dist/adapters/claude-agent-sdk.d.ts +3 -3
  6. package/dist/adapters/claude-agent-sdk.js +22 -23
  7. package/dist/adapters/claude-agent-sdk.js.map +1 -1
  8. package/dist/adapters/mock.d.ts +2 -3
  9. package/dist/adapters/openai-agents-sdk.d.ts +3 -3
  10. package/dist/adapters/openai-agents-sdk.js +6 -5
  11. package/dist/adapters/openai-agents-sdk.js.map +1 -1
  12. package/dist/chunk-2INQL5TG.js +298 -0
  13. package/dist/chunk-2INQL5TG.js.map +1 -0
  14. package/dist/chunk-3CLWG72V.js +47 -0
  15. package/dist/chunk-3CLWG72V.js.map +1 -0
  16. package/dist/chunk-3DDB34BU.js +237 -0
  17. package/dist/chunk-3DDB34BU.js.map +1 -0
  18. package/dist/chunk-ABXDSTUV.js +685 -0
  19. package/dist/chunk-ABXDSTUV.js.map +1 -0
  20. package/dist/{chunk-3H3PVPPF.js → chunk-F5R46S7I.js} +151 -204
  21. package/dist/chunk-F5R46S7I.js.map +1 -0
  22. package/dist/chunk-FKAI54OM.js +234 -0
  23. package/dist/chunk-FKAI54OM.js.map +1 -0
  24. package/dist/chunk-KTVMMG33.js +1111 -0
  25. package/dist/chunk-KTVMMG33.js.map +1 -0
  26. package/dist/chunk-MSVIEEGR.js +269 -0
  27. package/dist/chunk-MSVIEEGR.js.map +1 -0
  28. package/dist/chunk-VJXGCWSZ.js +36 -0
  29. package/dist/chunk-VJXGCWSZ.js.map +1 -0
  30. package/dist/claude-bundles/full.js +311 -309
  31. package/dist/claude-bundles/lean.js +6 -6
  32. package/dist/claude-bundles/prompt.js +17 -0
  33. package/dist/generator/index.d.ts +2 -2
  34. package/dist/generator/index.js +8 -7
  35. package/dist/guardrail-hooks-CB23nhZV.d.ts +202 -0
  36. package/dist/hook-protocol-CFnNudiV.d.ts +96 -0
  37. package/dist/hooks-lite-CoWWnCRH.d.ts +428 -0
  38. package/dist/index-BlSepCSZ.d.ts +296 -0
  39. package/dist/index.d.ts +785 -105
  40. package/dist/index.js +2189 -634
  41. package/dist/index.js.map +1 -1
  42. package/dist/lib/claude-native/hooks-lite.d.ts +3 -26
  43. package/dist/lib/claude-native/hooks-lite.js +18 -36
  44. package/dist/lib/claude-native/hooks-prompt.d.ts +5 -0
  45. package/dist/lib/claude-native/hooks-prompt.js +33 -0
  46. package/dist/lib/claude-native/hooks-prompt.js.map +1 -0
  47. package/dist/lib/claude-native/index.d.ts +56 -214
  48. package/dist/lib/claude-native/index.js +79 -280
  49. package/dist/lib/claude-native/index.js.map +1 -1
  50. package/dist/{navigation-context-D_E1NIUf.d.ts → navigation-context-B-RpUg3_.d.ts} +1 -1
  51. package/dist/navigation-index-prompt-CbrS5laO.d.ts +43 -0
  52. package/dist/{task-runner-DfIEorkU.d.ts → task-runner-GWoI7_71.d.ts} +100 -493
  53. package/dist/workspace-user-prompt-submit-D11Iu0zO.d.ts +269 -0
  54. package/package.json +15 -6
  55. package/dist/chunk-3H3PVPPF.js.map +0 -1
  56. package/dist/chunk-DBM5XN67.js +0 -354
  57. package/dist/chunk-DBM5XN67.js.map +0 -1
  58. package/dist/chunk-KXGUWBGK.js +0 -370
  59. package/dist/chunk-KXGUWBGK.js.map +0 -1
  60. package/dist/chunk-LDCQZPDG.js +0 -11
  61. package/dist/chunk-LDCQZPDG.js.map +0 -1
  62. package/dist/chunk-N4KNGDYY.js +0 -1963
  63. package/dist/chunk-N4KNGDYY.js.map +0 -1
  64. package/dist/chunk-NMX4C6LC.js +0 -332
  65. package/dist/chunk-NMX4C6LC.js.map +0 -1
  66. package/dist/chunk-QVH5KKBR.js +0 -374
  67. package/dist/chunk-QVH5KKBR.js.map +0 -1
  68. package/dist/context-DKkamYX_.d.ts +0 -31
  69. package/dist/guardrail-hooks-slK-z0Dz.d.ts +0 -83
  70. package/dist/index-LqEvaRk-.d.ts +0 -299
  71. package/dist/workspace-pre-tool-use-C6nidc0q.d.ts +0 -333
@@ -0,0 +1,237 @@
1
+ import {
2
+ isGuardrailRuleData,
3
+ matchGlob
4
+ } from "./chunk-MSVIEEGR.js";
5
+
6
+ // src/lib/claude-native/hook-protocol.ts
7
+ var MODELLED_EVENTS = ["SessionStart", "UserPromptSubmit", "PreToolUse"];
8
+ var notAHookPayload = (raw) => new Error(`Not a hook payload: ${raw.slice(0, 100)}`);
9
+ var optionalString = (value) => value === void 0 || typeof value === "string";
10
+ function isToolInput(value) {
11
+ if (value === void 0) return true;
12
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
13
+ const input = value;
14
+ return optionalString(input.file_path) && optionalString(input.path) && optionalString(input.command) && optionalString(input.content);
15
+ }
16
+ function isHookInput(value) {
17
+ if (!optionalString(value.session_id)) return false;
18
+ switch (value.hookEventName) {
19
+ case "SessionStart":
20
+ return value.type === void 0 || typeof value.type === "string" && ["new", "resume", "clear", "compact"].includes(value.type);
21
+ case "UserPromptSubmit":
22
+ return optionalString(value.prompt);
23
+ case "PreToolUse":
24
+ return optionalString(value.tool_name) && isToolInput(value.tool_input);
25
+ default:
26
+ return false;
27
+ }
28
+ }
29
+ function parseHookInput(raw) {
30
+ const parsed = JSON.parse(raw);
31
+ if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) {
32
+ throw notAHookPayload(raw);
33
+ }
34
+ const record = parsed;
35
+ if (typeof record.hook_event_name === "string" && record.hookEventName === void 0) {
36
+ record.hookEventName = record.hook_event_name;
37
+ }
38
+ if (!MODELLED_EVENTS.includes(record.hookEventName)) {
39
+ if (typeof record.hookEventName === "string") return void 0;
40
+ throw notAHookPayload(raw);
41
+ }
42
+ if (!isHookInput(record)) throw notAHookPayload(raw);
43
+ return record;
44
+ }
45
+ async function readHookInput() {
46
+ const chunks = [];
47
+ for await (const chunk of process.stdin) {
48
+ chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
49
+ }
50
+ const raw = Buffer.concat(chunks).toString("utf-8").trim();
51
+ if (!raw) {
52
+ throw new Error("Empty stdin \u2014 no hook input received");
53
+ }
54
+ return parseHookInput(raw);
55
+ }
56
+ function emitHookOutput(output) {
57
+ process.stdout.write(JSON.stringify(output) + "\n");
58
+ }
59
+ function buildContextResponse(eventName, additionalContext) {
60
+ return {
61
+ hookSpecificOutput: {
62
+ hookEventName: eventName,
63
+ additionalContext
64
+ }
65
+ };
66
+ }
67
+ function buildDenyResponse(reason) {
68
+ return {
69
+ hookSpecificOutput: {
70
+ hookEventName: "PreToolUse",
71
+ permissionDecision: "deny",
72
+ permissionDecisionReason: reason
73
+ }
74
+ };
75
+ }
76
+ function buildAllowResponse() {
77
+ return {};
78
+ }
79
+
80
+ // src/lib/claude-native/cache-store.ts
81
+ import { readFile, writeFile, rename, stat, mkdir } from "fs/promises";
82
+ import { join } from "path";
83
+ import { randomBytes } from "crypto";
84
+ var isCachedRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
85
+ function isCacheEntry(value, isData) {
86
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
87
+ const entry = value;
88
+ return typeof entry.writtenAt === "string" && typeof entry.sourceHash === "string" && (entry.sourceFiles === void 0 || Array.isArray(entry.sourceFiles) && entry.sourceFiles.every((f) => typeof f === "string")) && isData(entry.data);
89
+ }
90
+ function createCacheStore(options) {
91
+ const { cacheDir } = options;
92
+ function cacheFilePath(key) {
93
+ return join(cacheDir, `${key}.json`);
94
+ }
95
+ async function ensureDir() {
96
+ await mkdir(cacheDir, { recursive: true });
97
+ }
98
+ const store = {
99
+ async read(key, isData) {
100
+ let parsed;
101
+ try {
102
+ parsed = JSON.parse(await readFile(cacheFilePath(key), "utf-8"));
103
+ } catch {
104
+ return null;
105
+ }
106
+ return isCacheEntry(parsed, isData) ? parsed : null;
107
+ },
108
+ async write(key, data, sourceHash, sourceFiles) {
109
+ await ensureDir();
110
+ const entry = {
111
+ data,
112
+ writtenAt: (/* @__PURE__ */ new Date()).toISOString(),
113
+ sourceHash,
114
+ ...sourceFiles ? { sourceFiles } : {}
115
+ };
116
+ const content = JSON.stringify(entry, null, 2);
117
+ const target = cacheFilePath(key);
118
+ const tmpPath = `${target}.${randomBytes(4).toString("hex")}.tmp`;
119
+ await writeFile(tmpPath, content, "utf-8");
120
+ try {
121
+ await rename(tmpPath, target);
122
+ } catch {
123
+ await writeFile(target, content, "utf-8");
124
+ }
125
+ },
126
+ async getFileMtime(filePath) {
127
+ try {
128
+ const s = await stat(filePath);
129
+ return s.mtimeMs;
130
+ } catch {
131
+ return null;
132
+ }
133
+ }
134
+ };
135
+ return store;
136
+ }
137
+ function computeSourceHash(inputs) {
138
+ return inputs.map(String).join(":");
139
+ }
140
+
141
+ // src/lib/claude-native/navigation-freshness.ts
142
+ import { stat as stat2 } from "fs/promises";
143
+
144
+ // src/lib/claude-native/ensure-navigation-index-keys.ts
145
+ var GUARDRAIL_CACHE_SUFFIX = ".guardrails";
146
+ function guardrailCacheKey(navigationCacheKey) {
147
+ return `${navigationCacheKey}${GUARDRAIL_CACHE_SUFFIX}`;
148
+ }
149
+
150
+ // src/lib/claude-native/navigation-freshness.ts
151
+ var DEFAULT_CACHE_KEY = "navigation-index";
152
+ async function computeCurrentHash(sourceFiles) {
153
+ const mtimes = [];
154
+ for (const file of sourceFiles) {
155
+ try {
156
+ const s = await stat2(file);
157
+ mtimes.push(s.mtimeMs);
158
+ } catch {
159
+ mtimes.push(`missing:${file}`);
160
+ }
161
+ }
162
+ return computeSourceHash(mtimes);
163
+ }
164
+ async function readFreshNavigationBuild(options) {
165
+ const cacheKey = options.cacheKey ?? DEFAULT_CACHE_KEY;
166
+ const store = createCacheStore({ cacheDir: options.cacheDir });
167
+ const entry = await store.read(cacheKey, isCachedRecord);
168
+ if (!entry?.sourceFiles) return void 0;
169
+ const current = await computeCurrentHash(entry.sourceFiles);
170
+ if (current !== entry.sourceHash) return void 0;
171
+ const companion = await store.read(guardrailCacheKey(cacheKey), isGuardrailRuleData);
172
+ if (companion?.sourceHash !== entry.sourceHash) return void 0;
173
+ return { navigationIndex: entry.data, guardrailRules: companion.data };
174
+ }
175
+
176
+ // src/lib/claude-native/artifact-resolver.ts
177
+ function resolvePathToArtifacts(filePath, navigationIndex) {
178
+ const artifacts = navigationIndex.artifacts ?? {};
179
+ const matches = [];
180
+ for (const [id, artifact] of Object.entries(artifacts)) {
181
+ const patterns = artifact?.files?.path_patterns;
182
+ if (!Array.isArray(patterns)) continue;
183
+ for (const pattern of patterns) {
184
+ if (typeof pattern !== "string") continue;
185
+ if (matchGlob(pattern, filePath)) {
186
+ matches.push({ artifactId: id, artifact, matchedPattern: pattern });
187
+ break;
188
+ }
189
+ }
190
+ }
191
+ return matches;
192
+ }
193
+ function isProtectedArtifact(match) {
194
+ const props = match.artifact.properties ?? {};
195
+ if (props.authority === "generated") {
196
+ const regen = match.artifact.routes?.regenerate;
197
+ const hint = regen ? ` Run '${regen}' to regenerate.` : " Edit the source artifact and regenerate instead.";
198
+ return {
199
+ protected: true,
200
+ reason: `File belongs to generated artifact '${match.artifactId}'. Direct editing is not allowed.${hint}`
201
+ };
202
+ }
203
+ if (props.manual_edit === "forbidden") {
204
+ return {
205
+ protected: true,
206
+ reason: `File belongs to artifact '${match.artifactId}' which has manual_edit: forbidden. This artifact must not be edited directly.`
207
+ };
208
+ }
209
+ return { protected: false, reason: "" };
210
+ }
211
+ function listArtifacts(navigationIndex) {
212
+ const artifacts = navigationIndex.artifacts ?? {};
213
+ return Object.entries(artifacts).map(([id, artifact]) => ({
214
+ id,
215
+ artifact
216
+ }));
217
+ }
218
+
219
+ export {
220
+ parseHookInput,
221
+ readHookInput,
222
+ emitHookOutput,
223
+ buildContextResponse,
224
+ buildDenyResponse,
225
+ buildAllowResponse,
226
+ isCachedRecord,
227
+ createCacheStore,
228
+ computeSourceHash,
229
+ guardrailCacheKey,
230
+ DEFAULT_CACHE_KEY,
231
+ computeCurrentHash,
232
+ readFreshNavigationBuild,
233
+ resolvePathToArtifacts,
234
+ isProtectedArtifact,
235
+ listArtifacts
236
+ };
237
+ //# sourceMappingURL=chunk-3DDB34BU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/lib/claude-native/hook-protocol.ts","../src/lib/claude-native/cache-store.ts","../src/lib/claude-native/navigation-freshness.ts","../src/lib/claude-native/ensure-navigation-index-keys.ts","../src/lib/claude-native/artifact-resolver.ts"],"sourcesContent":["/**\n * Claude Code Hook Protocol — parse stdin JSON input and emit hook response JSON.\n *\n * Implements the protocol defined at https://code.claude.com/docs/en/hooks\n * for SessionStart, UserPromptSubmit, and PreToolUse hook events.\n */\n\n// ---------------------------------------------------------------------------\n// Hook Event Types\n// ---------------------------------------------------------------------------\n\n/**\n * One declaration for the events this harness models, so the type and the check\n * `parseHookInput` performs cannot name different sets.\n */\nconst MODELLED_EVENTS = [\"SessionStart\", \"UserPromptSubmit\", \"PreToolUse\"] as const;\n\nexport type HookEventName = (typeof MODELLED_EVENTS)[number];\n\nexport interface SessionStartInput {\n hookEventName: \"SessionStart\";\n session_id?: string;\n type?: \"new\" | \"resume\" | \"clear\" | \"compact\";\n}\n\nexport interface UserPromptSubmitInput {\n hookEventName: \"UserPromptSubmit\";\n session_id?: string;\n prompt?: string;\n}\n\nexport interface PreToolUseInput {\n hookEventName: \"PreToolUse\";\n session_id?: string;\n tool_name?: string;\n tool_input?: {\n file_path?: string;\n path?: string;\n command?: string;\n content?: string;\n [key: string]: unknown;\n };\n}\n\nexport type HookInput = SessionStartInput | UserPromptSubmitInput | PreToolUseInput;\n\n// ---------------------------------------------------------------------------\n// Hook Response Types\n// ---------------------------------------------------------------------------\n\nexport type PermissionDecision = \"allow\" | \"deny\" | \"ask\";\n\nexport interface HookOutput {\n /** Hook-specific output envelope. */\n hookSpecificOutput?: {\n hookEventName: HookEventName;\n /** Additional context injected into the session. */\n additionalContext?: string;\n /** Permission decision for PreToolUse hooks. */\n permissionDecision?: PermissionDecision;\n /** Reason for the permission decision. */\n permissionDecisionReason?: string;\n };\n}\n\n// ---------------------------------------------------------------------------\n// Parse / Emit\n// ---------------------------------------------------------------------------\n\n/** One wording for \"these bytes are not a hook payload\"; `raw` is the diagnosis. */\nconst notAHookPayload = (raw: string): Error =>\n new Error(`Not a hook payload: ${raw.slice(0, 100)}`);\n\nconst optionalString = (value: unknown): boolean =>\n value === undefined || typeof value === \"string\";\n\n/** The `tool_input` bag: four named strings, everything else `unknown`. */\nfunction isToolInput(value: unknown): boolean {\n if (value === undefined) return true;\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n const input = value as Record<string, unknown>;\n return (\n optionalString(input.file_path) &&\n optionalString(input.path) &&\n optionalString(input.command) &&\n optionalString(input.content)\n );\n}\n\n/**\n * The single gate between stdin and {@link HookInput}.\n *\n * Every field of the member the discriminant names is checked. `prompt` is one\n * of them and reads like a field nothing would get wrong, which is the reason to\n * check it: `renderCandidateArtifacts` calls `prompt.trim()`, so a non-string\n * there is a `TypeError` two frames from the parse that let it through.\n */\nfunction isHookInput(value: Record<string, unknown>): value is HookInput & Record<string, unknown> {\n if (!optionalString(value.session_id)) return false;\n switch (value.hookEventName) {\n case \"SessionStart\":\n return (\n value.type === undefined ||\n (typeof value.type === \"string\" &&\n [\"new\", \"resume\", \"clear\", \"compact\"].includes(value.type))\n );\n case \"UserPromptSubmit\":\n return optionalString(value.prompt);\n case \"PreToolUse\":\n return optionalString(value.tool_name) && isToolInput(value.tool_input);\n default:\n return false;\n }\n}\n\n/**\n * Parse hook input from a raw JSON string (typically from stdin).\n *\n * Three answers, and the difference between the last two is load-bearing:\n *\n * • a {@link HookInput} — the payload names an event this harness models and\n * carries the fields that member declares;\n * • THROWS — the bytes are not a hook payload at all (not a JSON object, no\n * event name, or a modelled event whose fields are not what it declares).\n * `null` stdin used to reach `parsed.hook_event_name` and answer\n * `TypeError: … reading 'hook_event_name'`;\n * • `undefined` — a well-formed payload for an event this harness does not\n * model. NOT a throw, and that is not a nicety. `pre-tool-use.sh` turns any\n * non-zero bin exit into `exit 2`, which is the one code that BLOCKS a tool\n * call — deliberately, because a guard that could not run must refuse rather\n * than allow (#304). Refusing input we simply do not handle would spend that\n * on every tool call after a version skew, or on a user who registered the\n * launcher under another event, which `settings-merge.ts` explicitly\n * contemplates. Measured end to end: `pre-tool-use.sh` exits 2 on a bin\n * throw, `session-start.sh` and `user-prompt-submit.sh` exit 1 (non-blocking\n * per the protocol — only exit 2 blocks).\n *\n * Routing between the three modelled events stays with each bin's own guard,\n * which spends exit 0 on \"not mine\".\n */\nexport function parseHookInput(raw: string): HookInput | undefined {\n const parsed: unknown = JSON.parse(raw);\n if (typeof parsed !== \"object\" || parsed === null || Array.isArray(parsed)) {\n throw notAHookPayload(raw);\n }\n const record = parsed as Record<string, unknown>;\n // Claude Code's hook INPUT wire protocol sends the event name as snake_case\n // `hook_event_name` (sibling fields session_id / tool_name / tool_input are\n // likewise snake_case). The internal HookInput union — and every hook bin's\n // event guard — reads `hookEventName`. Normalize once here, at the single\n // stdin parse boundary, so the guards match real payloads (#252). Output\n // stays camelCase `hookSpecificOutput.hookEventName`, which the wire expects.\n if (typeof record.hook_event_name === \"string\" && record.hookEventName === undefined) {\n record.hookEventName = record.hook_event_name;\n }\n if (!MODELLED_EVENTS.includes(record.hookEventName as HookEventName)) {\n // A name we do not model is `undefined`; no name at all is not a payload.\n if (typeof record.hookEventName === \"string\") return undefined;\n throw notAHookPayload(raw);\n }\n if (!isHookInput(record)) throw notAHookPayload(raw);\n return record;\n}\n\n/**\n * Read all of stdin and parse as hook input JSON.\n */\nexport async function readHookInput(): Promise<HookInput | undefined> {\n const chunks: Buffer[] = [];\n for await (const chunk of process.stdin) {\n chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk as string));\n }\n const raw = Buffer.concat(chunks).toString(\"utf-8\").trim();\n if (!raw) {\n throw new Error(\"Empty stdin — no hook input received\");\n }\n return parseHookInput(raw);\n}\n\n/**\n * Emit a hook response as JSON to stdout.\n */\nexport function emitHookOutput(output: HookOutput): void {\n process.stdout.write(JSON.stringify(output) + \"\\n\");\n}\n\n// ---------------------------------------------------------------------------\n// Response Builders\n// ---------------------------------------------------------------------------\n\n/**\n * Build a response that injects additional context into the session.\n */\nexport function buildContextResponse(\n eventName: HookEventName,\n additionalContext: string,\n): HookOutput {\n return {\n hookSpecificOutput: {\n hookEventName: eventName,\n additionalContext,\n },\n };\n}\n\n/**\n * Build a deny response for PreToolUse hooks.\n */\nexport function buildDenyResponse(reason: string): HookOutput {\n return {\n hookSpecificOutput: {\n hookEventName: \"PreToolUse\",\n permissionDecision: \"deny\",\n permissionDecisionReason: reason,\n },\n };\n}\n\n/**\n * Build an allow response (empty output = allow by default).\n */\nexport function buildAllowResponse(): HookOutput {\n return {};\n}\n","/**\n * Cache Store — read/write `.claude/cache/` directory.\n *\n * Stores navigation-index.json and metadata for graph cache invalidation.\n * Uses atomic write (write-to-temp + rename) for concurrent-access safety.\n */\n\nimport { readFile, writeFile, rename, stat, mkdir } from \"node:fs/promises\";\nimport { join, dirname } from \"node:path\";\nimport { randomBytes } from \"node:crypto\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/**\n * Deciding whether an entry is fresh is deliberately NOT a method here.\n * `navigation-cache.ts` owns that question, and owning it in one place is what\n * keeps the hook that READS the index and the builder that WRITES it from\n * disagreeing about the same file.\n */\nexport interface CacheEntry<T = unknown> {\n data: T;\n /** ISO timestamp of when the cache was written. */\n writtenAt: string;\n /** Hash of source inputs used for invalidation. */\n sourceHash: string;\n /**\n * The files `sourceHash` was computed over.\n *\n * Recorded with the hash, in the same record and the same atomic write, so a\n * reader can re-check freshness without being able to resolve that list\n * itself. Resolving it means parsing the project manifest, which is what the\n * interactive hooks must not pay for; the builder already knows the answer, so\n * it writes it down (#278).\n */\n sourceFiles?: string[];\n}\n\nexport interface CacheStoreOptions {\n /** Absolute path to the `.claude/cache/` directory. */\n cacheDir: string;\n}\n\n// ---------------------------------------------------------------------------\n// Cache Store\n// ---------------------------------------------------------------------------\n\n/**\n * What a caller knows about `data` and this module does not.\n *\n * `read` is generic over `T`, so the only thing here that could establish `T` is\n * the caller's own predicate — `as CacheEntry<T>` promised whatever the call\n * site asked for and delivered whatever was on disk, which is how a cache file\n * written by another process (or an older build) reached `computeCurrentHash`\n * as `sourceFiles: 5` and threw `TypeError: sourceFiles is not iterable`.\n */\nexport type DataPredicate<T> = (value: unknown) => value is T;\n\n/**\n * The shape of an entry whose `data` is declared no more precisely than \"an\n * object\" — what both navigation-index readers ask for. It checks exactly that\n * and no more: a predicate that demanded the index's own keys would promise more\n * than {@link FreshNavigationBuild} declares, and reject builds the type admits.\n */\nexport const isCachedRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === \"object\" && value !== null && !Array.isArray(value);\n\nexport interface CacheStore {\n /**\n * The entry under `key` if the file holds one whose `data` satisfies `isData`,\n * else `null` — the same answer an absent or unparseable file gets, because a\n * record this reader cannot use is not one, however it came to be that way.\n */\n read<T>(key: string, isData: DataPredicate<T>): Promise<CacheEntry<T> | null>;\n write<T = unknown>(\n key: string,\n data: T,\n sourceHash: string,\n sourceFiles?: string[],\n ): Promise<void>;\n /** Get the mtime of a file (for invalidation checks). */\n getFileMtime(filePath: string): Promise<number | null>;\n}\n\n/**\n * The single gate between a cache file's bytes and {@link CacheEntry}.\n *\n * Every declared field is checked, `sourceFiles` included — that one is what\n * `readFreshNavigationBuild` iterates, and it is optional in the type, so\n * \"absent\" and \"present but not a list of strings\" are different answers and\n * only the first is an entry.\n */\nfunction isCacheEntry<T>(value: unknown, isData: DataPredicate<T>): value is CacheEntry<T> {\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) return false;\n const entry = value as Record<string, unknown>;\n return (\n typeof entry.writtenAt === \"string\" &&\n typeof entry.sourceHash === \"string\" &&\n (entry.sourceFiles === undefined ||\n (Array.isArray(entry.sourceFiles) &&\n entry.sourceFiles.every((f) => typeof f === \"string\"))) &&\n isData(entry.data)\n );\n}\n\nexport function createCacheStore(options: CacheStoreOptions): CacheStore {\n const { cacheDir } = options;\n\n function cacheFilePath(key: string): string {\n return join(cacheDir, `${key}.json`);\n }\n\n async function ensureDir(): Promise<void> {\n await mkdir(cacheDir, { recursive: true });\n }\n\n const store: CacheStore = {\n async read<T>(key: string, isData: DataPredicate<T>): Promise<CacheEntry<T> | null> {\n let parsed: unknown;\n try {\n parsed = JSON.parse(await readFile(cacheFilePath(key), \"utf-8\"));\n } catch {\n return null;\n }\n return isCacheEntry(parsed, isData) ? parsed : null;\n },\n\n async write<T = unknown>(\n key: string,\n data: T,\n sourceHash: string,\n sourceFiles?: string[],\n ): Promise<void> {\n await ensureDir();\n const entry: CacheEntry<T> = {\n data,\n writtenAt: new Date().toISOString(),\n sourceHash,\n ...(sourceFiles ? { sourceFiles } : {}),\n };\n const content = JSON.stringify(entry, null, 2);\n const target = cacheFilePath(key);\n const tmpPath = `${target}.${randomBytes(4).toString(\"hex\")}.tmp`;\n\n // Atomic write: write to temp file then rename\n await writeFile(tmpPath, content, \"utf-8\");\n try {\n await rename(tmpPath, target);\n } catch {\n // Fallback: direct write if rename fails (cross-device)\n await writeFile(target, content, \"utf-8\");\n }\n },\n\n async getFileMtime(filePath: string): Promise<number | null> {\n try {\n const s = await stat(filePath);\n return s.mtimeMs;\n } catch {\n return null;\n }\n },\n };\n\n return store;\n}\n\n/**\n * Compute a simple hash string from an array of file mtimes and content strings.\n * Not cryptographic — used only for cache invalidation.\n */\nexport function computeSourceHash(inputs: Array<string | number>): string {\n return inputs.map(String).join(\":\");\n}\n","/**\n * Is the cached navigation build still the one this project's sources describe?\n *\n * THE freshness predicate — there is deliberately no other. `cache-store` offers\n * no freshness method, and `ensureNavigationIndex` decides whether to rebuild by\n * asking this, so the hooks that READ a build and the builder that WRITES it\n * cannot answer differently about the same files.\n *\n * ITS OWN MODULE, and that is load-bearing rather than tidiness. The bundler\n * layers chunks by MODULE (`layerOnto` in scripts/build-claude-bundles.mjs), so\n * everything in one file lands on one side of the #278 split. Freshness is\n * needed on BOTH sides — by `build-contextpack`, which escalates a stale cache\n * to a rebuild, and by `check-artifact-edit`, which must not judge from one —\n * while the escalation itself (`runEnsureNavigationIndexBin`, a `spawn`) must\n * never be reachable from the PreToolUse guard: that hook fires on every tool\n * call and has no business starting the DSL loader. Splitting the file is what\n * makes \"the guard can ask, and cannot rebuild\" a fact about the chunk graph\n * instead of a convention.\n */\n\nimport { stat } from \"node:fs/promises\";\nimport { createCacheStore, computeSourceHash, isCachedRecord } from \"./cache-store.js\";\nimport { guardrailCacheKey } from \"./ensure-navigation-index-keys.js\";\nimport { isGuardrailRuleData, type GuardrailRuleData } from \"../guardrail-hooks.js\";\n\nexport const DEFAULT_CACHE_KEY = \"navigation-index\";\n\n/**\n * Cache hash for a set of source files: their mtimes, in order.\n *\n * There is no TTL — the index is stale exactly when one of the files it was\n * built from has been touched. Callers must pass the same `sourceFiles` the\n * build used, or the hash will never match.\n */\nexport async function computeCurrentHash(sourceFiles: string[]): Promise<string> {\n const mtimes: Array<string | number> = [];\n for (const file of sourceFiles) {\n try {\n const s = await stat(file);\n mtimes.push(s.mtimeMs);\n } catch {\n // File not found — include a sentinel so hash changes if file appears\n mtimes.push(`missing:${file}`);\n }\n }\n return computeSourceHash(mtimes);\n}\n\n/**\n * What one `ensureNavigationIndex` run produced: the navigation index and the\n * DSL guardrail rules resolved alongside it.\n *\n * Returned together because they were WRITTEN together, under one hash. A\n * caller that could take one without the other would be free to pair a current\n * artifact registry with a superseded rule set.\n */\nexport interface FreshNavigationBuild {\n navigationIndex: Record<string, unknown>;\n guardrailRules: GuardrailRuleData;\n}\n\n/**\n * The cached build if it is still fresh, else undefined. Never builds.\n *\n * The file list the hash is checked against comes from the CACHE ENTRY, not from\n * re-resolving the project manifest. That is what keeps this readable from the\n * lean graph: resolving the list means loading the manifest parser (zod + yaml),\n * which every per-interaction hook would then carry. The builder resolved it\n * already and wrote it down, so the reader just re-stats it.\n *\n * An entry with no recorded list is treated as stale. It was written by an older\n * build, and rebuilding is exactly what upgrades it — the alternative, assuming\n * it is fresh, would pin a stale index forever.\n *\n * FRESH MEANS THE WHOLE BUILD, not just the index. One run writes both entries,\n * so an index sitting next to no companion is the same \"written by an older\n * build\" case and has to be answered the same way. Asking only about the index\n * is not merely incomplete: `ensureNavigationIndex` returns early on this\n * predicate, so it would keep returning the untouched index and the companion\n * the PreToolUse guard reads could never come back (#304).\n */\nexport async function readFreshNavigationBuild(options: {\n cacheDir: string;\n cacheKey?: string;\n}): Promise<FreshNavigationBuild | undefined> {\n const cacheKey = options.cacheKey ?? DEFAULT_CACHE_KEY;\n const store = createCacheStore({ cacheDir: options.cacheDir });\n const entry = await store.read(cacheKey, isCachedRecord);\n if (!entry?.sourceFiles) return undefined;\n const current = await computeCurrentHash(entry.sourceFiles);\n if (current !== entry.sourceHash) return undefined;\n // Written in the same run, from the same hash — no second stat pass needed.\n const companion = await store.read(guardrailCacheKey(cacheKey), isGuardrailRuleData);\n if (companion?.sourceHash !== entry.sourceHash) return undefined;\n return { navigationIndex: entry.data, guardrailRules: companion.data };\n}\n","/**\n * Cache-key helpers shared between the heavy navigation-index warm path\n * (`ensure-navigation-index.ts`) and the lean PreToolUse hot path\n * (`workspace-pre-tool-use.ts`).\n *\n * This module is intentionally dependency-free (no `navigation-context` /\n * `agent-contracts` imports) so it is safe to include in the lean\n * `hooks-lite` entry point without pulling the heavy DSL loader.\n */\n\n/**\n * Cache-key suffix under which a member's DSL guardrail rules are persisted\n * alongside its navigation-index (#238 / C5).\n *\n * The navigation-index cache stays byte-identical to previous versions; the\n * guardrail rules live in a companion entry (e.g.\n * `navigation-index.aaac.guardrails.json`) so the lean PreToolUse hook can\n * read them without importing the heavy `agent-contracts` DSL loader.\n */\nexport const GUARDRAIL_CACHE_SUFFIX = \".guardrails\";\n\n/** Companion cache key for a navigation-index cache key's guardrail rules. */\nexport function guardrailCacheKey(navigationCacheKey: string): string {\n return `${navigationCacheKey}${GUARDRAIL_CACHE_SUFFIX}`;\n}\n","/**\n * Artifact Resolver — reverse-lookup path to artifact_id using navigation-index.\n *\n * Uses glob matching from guardrail-hooks.ts to match file paths against\n * artifact path_patterns defined in the navigation index.\n */\n\nimport { matchGlob } from \"../guardrail-hooks.js\";\n\n// ---------------------------------------------------------------------------\n// Types\n// ---------------------------------------------------------------------------\n\n/** Minimal shape of a navigation-index artifact node. */\nexport interface NavigationArtifact {\n properties?: {\n type?: string;\n authority?: string;\n manual_edit?: string;\n [key: string]: unknown;\n };\n files?: {\n path_patterns?: string[];\n [key: string]: unknown;\n };\n agents?: {\n owners?: string[];\n editors?: string[];\n [key: string]: unknown;\n };\n routes?: {\n regenerate?: string;\n [key: string]: unknown;\n };\n relations?: {\n derived_artifacts?: string[];\n [key: string]: unknown;\n };\n}\n\nexport interface ArtifactMatch {\n artifactId: string;\n artifact: NavigationArtifact;\n /** The glob pattern that matched. */\n matchedPattern: string;\n}\n\n// ---------------------------------------------------------------------------\n// Resolver\n// ---------------------------------------------------------------------------\n\n/**\n * Resolve a file path to its artifact(s) in the navigation index.\n * Returns all matching artifacts (a file may belong to multiple artifacts).\n */\nexport function resolvePathToArtifacts(\n filePath: string,\n navigationIndex: Record<string, unknown>,\n): ArtifactMatch[] {\n const artifacts =\n (navigationIndex.artifacts as Record<string, NavigationArtifact>) ?? {};\n const matches: ArtifactMatch[] = [];\n\n for (const [id, artifact] of Object.entries(artifacts)) {\n const patterns = artifact?.files?.path_patterns;\n if (!Array.isArray(patterns)) continue;\n\n for (const pattern of patterns) {\n if (typeof pattern !== \"string\") continue;\n if (matchGlob(pattern, filePath)) {\n matches.push({ artifactId: id, artifact, matchedPattern: pattern });\n break; // One match per artifact is sufficient\n }\n }\n }\n\n return matches;\n}\n\n/**\n * Check if a file path targets a protected artifact (generated or manual_edit: forbidden).\n */\nexport function isProtectedArtifact(match: ArtifactMatch): {\n protected: boolean;\n reason: string;\n} {\n const props = match.artifact.properties ?? {};\n\n if (props.authority === \"generated\") {\n const regen = match.artifact.routes?.regenerate;\n const hint = regen\n ? ` Run '${regen}' to regenerate.`\n : \" Edit the source artifact and regenerate instead.\";\n return {\n protected: true,\n reason:\n `File belongs to generated artifact '${match.artifactId}'.` +\n ` Direct editing is not allowed.${hint}`,\n };\n }\n\n if (props.manual_edit === \"forbidden\") {\n return {\n protected: true,\n reason:\n `File belongs to artifact '${match.artifactId}' which has manual_edit: forbidden.` +\n ` This artifact must not be edited directly.`,\n };\n }\n\n return { protected: false, reason: \"\" };\n}\n\n/**\n * Get all artifact entries from a navigation index as a flat list.\n */\nexport function listArtifacts(\n navigationIndex: Record<string, unknown>,\n): Array<{ id: string; artifact: NavigationArtifact }> {\n const artifacts =\n (navigationIndex.artifacts as Record<string, NavigationArtifact>) ?? {};\n return Object.entries(artifacts).map(([id, artifact]) => ({\n id,\n artifact,\n }));\n}\n"],"mappings":";;;;;;AAeA,IAAM,kBAAkB,CAAC,gBAAgB,oBAAoB,YAAY;AAuDzE,IAAM,kBAAkB,CAAC,QACvB,IAAI,MAAM,uBAAuB,IAAI,MAAM,GAAG,GAAG,CAAC,EAAE;AAEtD,IAAM,iBAAiB,CAAC,UACtB,UAAU,UAAa,OAAO,UAAU;AAG1C,SAAS,YAAY,OAAyB;AAC5C,MAAI,UAAU,OAAW,QAAO;AAChC,MAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,EAAG,QAAO;AAChF,QAAM,QAAQ;AACd,SACE,eAAe,MAAM,SAAS,KAC9B,eAAe,MAAM,IAAI,KACzB,eAAe,MAAM,OAAO,KAC5B,eAAe,MAAM,OAAO;AAEhC;AAUA,SAAS,YAAY,OAA8E;AACjG,MAAI,CAAC,eAAe,MAAM,UAAU,EAAG,QAAO;AAC9C,UAAQ,MAAM,eAAe;AAAA,IAC3B,KAAK;AACH,aACE,MAAM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