@smeltjs/core 0.2.0 → 0.3.0

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 (319) hide show
  1. package/README.md +3 -3
  2. package/dist/apply.d.ts.map +1 -1
  3. package/dist/apply.js.map +1 -1
  4. package/dist/cache/prefix.d.ts.map +1 -1
  5. package/dist/cache/prefix.js.map +1 -1
  6. package/dist/cli/args.d.ts +16 -70
  7. package/dist/cli/args.d.ts.map +1 -1
  8. package/dist/cli/args.js +18 -338
  9. package/dist/cli/args.js.map +1 -1
  10. package/dist/cli/bin.d.ts.map +1 -1
  11. package/dist/cli/bin.js.map +1 -1
  12. package/dist/cli/config.d.ts +40 -0
  13. package/dist/cli/config.d.ts.map +1 -1
  14. package/dist/cli/config.js +55 -1
  15. package/dist/cli/config.js.map +1 -1
  16. package/dist/cli/hooks.d.ts +33 -38
  17. package/dist/cli/hooks.d.ts.map +1 -1
  18. package/dist/cli/hooks.js +140 -485
  19. package/dist/cli/hooks.js.map +1 -1
  20. package/dist/cli/init.d.ts +30 -15
  21. package/dist/cli/init.d.ts.map +1 -1
  22. package/dist/cli/init.js +167 -38
  23. package/dist/cli/init.js.map +1 -1
  24. package/dist/cli/report.d.ts.map +1 -1
  25. package/dist/cli/report.js +2 -2
  26. package/dist/cli/report.js.map +1 -1
  27. package/dist/cli/run.d.ts +25 -88
  28. package/dist/cli/run.d.ts.map +1 -1
  29. package/dist/cli/run.js +32 -341
  30. package/dist/cli/run.js.map +1 -1
  31. package/dist/cli/shell.d.ts +106 -0
  32. package/dist/cli/shell.d.ts.map +1 -0
  33. package/dist/cli/shell.js +100 -0
  34. package/dist/cli/shell.js.map +1 -0
  35. package/dist/cli/subcommands/flags.d.ts +141 -0
  36. package/dist/cli/subcommands/flags.d.ts.map +1 -0
  37. package/dist/cli/subcommands/flags.js +208 -0
  38. package/dist/cli/subcommands/flags.js.map +1 -0
  39. package/dist/cli/subcommands/hooks.d.ts +18 -0
  40. package/dist/cli/subcommands/hooks.d.ts.map +1 -0
  41. package/dist/cli/subcommands/hooks.js +64 -0
  42. package/dist/cli/subcommands/hooks.js.map +1 -0
  43. package/dist/cli/subcommands/init.d.ts +19 -0
  44. package/dist/cli/subcommands/init.d.ts.map +1 -0
  45. package/dist/cli/subcommands/init.js +44 -0
  46. package/dist/cli/subcommands/init.js.map +1 -0
  47. package/dist/cli/subcommands/map.d.ts +75 -0
  48. package/dist/cli/subcommands/map.d.ts.map +1 -0
  49. package/dist/cli/subcommands/map.js +132 -0
  50. package/dist/cli/subcommands/map.js.map +1 -0
  51. package/dist/cli/subcommands/registry.d.ts +80 -0
  52. package/dist/cli/subcommands/registry.d.ts.map +1 -0
  53. package/dist/cli/subcommands/registry.js +138 -0
  54. package/dist/cli/subcommands/registry.js.map +1 -0
  55. package/dist/cli/subcommands/retrieve.d.ts +74 -0
  56. package/dist/cli/subcommands/retrieve.d.ts.map +1 -0
  57. package/dist/cli/subcommands/retrieve.js +84 -0
  58. package/dist/cli/subcommands/retrieve.js.map +1 -0
  59. package/dist/cli/subcommands/smelt.d.ts +107 -0
  60. package/dist/cli/subcommands/smelt.d.ts.map +1 -0
  61. package/dist/cli/subcommands/smelt.js +304 -0
  62. package/dist/cli/subcommands/smelt.js.map +1 -0
  63. package/dist/cli/subcommands/stats.d.ts +43 -0
  64. package/dist/cli/subcommands/stats.d.ts.map +1 -0
  65. package/dist/cli/subcommands/stats.js +62 -0
  66. package/dist/cli/subcommands/stats.js.map +1 -0
  67. package/dist/cli/subcommands/subcommand.d.ts +113 -0
  68. package/dist/cli/subcommands/subcommand.d.ts.map +1 -0
  69. package/dist/cli/subcommands/subcommand.js +3 -0
  70. package/dist/cli/subcommands/subcommand.js.map +1 -0
  71. package/dist/cli/usage.d.ts +3 -0
  72. package/dist/cli/usage.d.ts.map +1 -0
  73. package/dist/cli/usage.js +95 -0
  74. package/dist/cli/usage.js.map +1 -0
  75. package/dist/detect.d.ts.map +1 -1
  76. package/dist/detect.js.map +1 -1
  77. package/dist/errors.d.ts +21 -1
  78. package/dist/errors.d.ts.map +1 -1
  79. package/dist/errors.js +33 -1
  80. package/dist/errors.js.map +1 -1
  81. package/dist/harness/aider.d.ts +10 -0
  82. package/dist/harness/aider.d.ts.map +1 -0
  83. package/dist/harness/aider.js +21 -0
  84. package/dist/harness/aider.js.map +1 -0
  85. package/dist/harness/claude-code.d.ts +3 -0
  86. package/dist/harness/claude-code.d.ts.map +1 -0
  87. package/dist/harness/claude-code.js +68 -0
  88. package/dist/harness/claude-code.js.map +1 -0
  89. package/dist/harness/cline.d.ts +3 -0
  90. package/dist/harness/cline.d.ts.map +1 -0
  91. package/dist/harness/cline.js +54 -0
  92. package/dist/harness/cline.js.map +1 -0
  93. package/dist/harness/codex.d.ts +3 -0
  94. package/dist/harness/codex.d.ts.map +1 -0
  95. package/dist/harness/codex.js +91 -0
  96. package/dist/harness/codex.js.map +1 -0
  97. package/dist/harness/cursor.d.ts +3 -0
  98. package/dist/harness/cursor.d.ts.map +1 -0
  99. package/dist/harness/cursor.js +54 -0
  100. package/dist/harness/cursor.js.map +1 -0
  101. package/dist/harness/gemini.d.ts +3 -0
  102. package/dist/harness/gemini.d.ts.map +1 -0
  103. package/dist/harness/gemini.js +59 -0
  104. package/dist/harness/gemini.js.map +1 -0
  105. package/dist/harness/grok.d.ts +3 -0
  106. package/dist/harness/grok.d.ts.map +1 -0
  107. package/dist/harness/grok.js +46 -0
  108. package/dist/harness/grok.js.map +1 -0
  109. package/dist/harness/hermes.d.ts +3 -0
  110. package/dist/harness/hermes.d.ts.map +1 -0
  111. package/dist/harness/hermes.js +71 -0
  112. package/dist/harness/hermes.js.map +1 -0
  113. package/dist/harness/kilocode.d.ts +3 -0
  114. package/dist/harness/kilocode.d.ts.map +1 -0
  115. package/dist/harness/kilocode.js +35 -0
  116. package/dist/harness/kilocode.js.map +1 -0
  117. package/dist/harness/opencode.d.ts +3 -0
  118. package/dist/harness/opencode.d.ts.map +1 -0
  119. package/dist/harness/opencode.js +97 -0
  120. package/dist/harness/opencode.js.map +1 -0
  121. package/dist/harness/paths.d.ts +17 -0
  122. package/dist/harness/paths.d.ts.map +1 -0
  123. package/dist/harness/paths.js +45 -0
  124. package/dist/harness/paths.js.map +1 -0
  125. package/dist/harness/profile.d.ts +184 -0
  126. package/dist/harness/profile.d.ts.map +1 -0
  127. package/dist/harness/profile.js +26 -0
  128. package/dist/harness/profile.js.map +1 -0
  129. package/dist/harness/registry.d.ts +51 -0
  130. package/dist/harness/registry.d.ts.map +1 -0
  131. package/dist/harness/registry.js +87 -0
  132. package/dist/harness/registry.js.map +1 -0
  133. package/dist/harness/snippet.d.ts +19 -0
  134. package/dist/harness/snippet.d.ts.map +1 -0
  135. package/dist/harness/snippet.js +41 -0
  136. package/dist/harness/snippet.js.map +1 -0
  137. package/dist/hash.d.ts.map +1 -1
  138. package/dist/hash.js.map +1 -1
  139. package/dist/hooks/guard-core.d.ts +14 -14
  140. package/dist/hooks/guard-core.d.ts.map +1 -1
  141. package/dist/hooks/guard-core.js +15 -37
  142. package/dist/hooks/guard-core.js.map +1 -1
  143. package/dist/hooks/shim.d.ts +95 -4
  144. package/dist/hooks/shim.d.ts.map +1 -1
  145. package/dist/hooks/shim.js +87 -2
  146. package/dist/hooks/shim.js.map +1 -1
  147. package/dist/hooks/shims/claude-code.d.ts +5 -18
  148. package/dist/hooks/shims/claude-code.d.ts.map +1 -1
  149. package/dist/hooks/shims/claude-code.js +9 -56
  150. package/dist/hooks/shims/claude-code.js.map +1 -1
  151. package/dist/hooks/shims/cline.d.ts +5 -12
  152. package/dist/hooks/shims/cline.d.ts.map +1 -1
  153. package/dist/hooks/shims/cline.js +9 -34
  154. package/dist/hooks/shims/cline.js.map +1 -1
  155. package/dist/hooks/shims/codex.d.ts +5 -18
  156. package/dist/hooks/shims/codex.d.ts.map +1 -1
  157. package/dist/hooks/shims/codex.js +9 -51
  158. package/dist/hooks/shims/codex.js.map +1 -1
  159. package/dist/hooks/shims/cursor.d.ts +5 -14
  160. package/dist/hooks/shims/cursor.d.ts.map +1 -1
  161. package/dist/hooks/shims/cursor.js +9 -42
  162. package/dist/hooks/shims/cursor.js.map +1 -1
  163. package/dist/hooks/shims/gemini.d.ts +5 -18
  164. package/dist/hooks/shims/gemini.d.ts.map +1 -1
  165. package/dist/hooks/shims/gemini.js +9 -48
  166. package/dist/hooks/shims/gemini.js.map +1 -1
  167. package/dist/hooks/shims/grok.d.ts +5 -13
  168. package/dist/hooks/shims/grok.d.ts.map +1 -1
  169. package/dist/hooks/shims/grok.js +9 -32
  170. package/dist/hooks/shims/grok.js.map +1 -1
  171. package/dist/hooks/shims/hermes.d.ts +5 -17
  172. package/dist/hooks/shims/hermes.d.ts.map +1 -1
  173. package/dist/hooks/shims/hermes.js +9 -45
  174. package/dist/hooks/shims/hermes.js.map +1 -1
  175. package/dist/index.d.ts +33 -76
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +13 -67
  178. package/dist/index.js.map +1 -1
  179. package/dist/lang/bash.d.ts.map +1 -1
  180. package/dist/lang/bash.js.map +1 -1
  181. package/dist/lang/c.d.ts.map +1 -1
  182. package/dist/lang/c.js.map +1 -1
  183. package/dist/lang/c_sharp.d.ts.map +1 -1
  184. package/dist/lang/c_sharp.js.map +1 -1
  185. package/dist/lang/cpp.d.ts.map +1 -1
  186. package/dist/lang/cpp.js.map +1 -1
  187. package/dist/lang/go.d.ts.map +1 -1
  188. package/dist/lang/go.js.map +1 -1
  189. package/dist/lang/java.d.ts.map +1 -1
  190. package/dist/lang/java.js.map +1 -1
  191. package/dist/lang/javascript.d.ts.map +1 -1
  192. package/dist/lang/javascript.js.map +1 -1
  193. package/dist/lang/kotlin.d.ts.map +1 -1
  194. package/dist/lang/kotlin.js.map +1 -1
  195. package/dist/lang/php.d.ts.map +1 -1
  196. package/dist/lang/php.js.map +1 -1
  197. package/dist/lang/profile.d.ts.map +1 -1
  198. package/dist/lang/profile.js.map +1 -1
  199. package/dist/lang/python.d.ts.map +1 -1
  200. package/dist/lang/python.js.map +1 -1
  201. package/dist/lang/registry.d.ts.map +1 -1
  202. package/dist/lang/registry.js.map +1 -1
  203. package/dist/lang/ruby.d.ts.map +1 -1
  204. package/dist/lang/ruby.js.map +1 -1
  205. package/dist/lang/rust.d.ts.map +1 -1
  206. package/dist/lang/rust.js.map +1 -1
  207. package/dist/lang/swift.d.ts.map +1 -1
  208. package/dist/lang/swift.js.map +1 -1
  209. package/dist/lang/tsx.d.ts.map +1 -1
  210. package/dist/lang/tsx.js.map +1 -1
  211. package/dist/lang/typescript.d.ts.map +1 -1
  212. package/dist/lang/typescript.js.map +1 -1
  213. package/dist/net/policy.d.ts +18 -1
  214. package/dist/net/policy.d.ts.map +1 -1
  215. package/dist/net/policy.js +6 -4
  216. package/dist/net/policy.js.map +1 -1
  217. package/dist/ops/index.d.ts +39 -0
  218. package/dist/ops/index.d.ts.map +1 -0
  219. package/dist/ops/index.js +37 -0
  220. package/dist/ops/index.js.map +1 -0
  221. package/dist/ops/inputs.d.ts +170 -0
  222. package/dist/ops/inputs.d.ts.map +1 -0
  223. package/dist/ops/inputs.js +142 -0
  224. package/dist/ops/inputs.js.map +1 -0
  225. package/dist/ops/verbs.d.ts +136 -0
  226. package/dist/ops/verbs.d.ts.map +1 -0
  227. package/dist/ops/verbs.js +76 -0
  228. package/dist/ops/verbs.js.map +1 -0
  229. package/dist/plan/auto.d.ts +69 -0
  230. package/dist/plan/auto.d.ts.map +1 -0
  231. package/dist/plan/auto.js +70 -0
  232. package/dist/plan/auto.js.map +1 -0
  233. package/dist/plan/budget.d.ts +21 -0
  234. package/dist/plan/budget.d.ts.map +1 -0
  235. package/dist/plan/budget.js +26 -0
  236. package/dist/plan/budget.js.map +1 -0
  237. package/dist/plan/grammar.d.ts +14 -0
  238. package/dist/plan/grammar.d.ts.map +1 -1
  239. package/dist/plan/grammar.js +47 -6
  240. package/dist/plan/grammar.js.map +1 -1
  241. package/dist/plan/lexical.d.ts.map +1 -1
  242. package/dist/plan/lexical.js +1 -7
  243. package/dist/plan/lexical.js.map +1 -1
  244. package/dist/plan/planners.d.ts +35 -2
  245. package/dist/plan/planners.d.ts.map +1 -1
  246. package/dist/plan/planners.js +35 -2
  247. package/dist/plan/planners.js.map +1 -1
  248. package/dist/plan/structural.d.ts +19 -5
  249. package/dist/plan/structural.d.ts.map +1 -1
  250. package/dist/plan/structural.js +180 -33
  251. package/dist/plan/structural.js.map +1 -1
  252. package/dist/repomap/cache.d.ts +48 -0
  253. package/dist/repomap/cache.d.ts.map +1 -1
  254. package/dist/repomap/cache.js +112 -13
  255. package/dist/repomap/cache.js.map +1 -1
  256. package/dist/repomap/io.d.ts +24 -0
  257. package/dist/repomap/io.d.ts.map +1 -0
  258. package/dist/repomap/io.js +34 -0
  259. package/dist/repomap/io.js.map +1 -0
  260. package/dist/repomap/map.d.ts +69 -6
  261. package/dist/repomap/map.d.ts.map +1 -1
  262. package/dist/repomap/map.js +104 -22
  263. package/dist/repomap/map.js.map +1 -1
  264. package/dist/repomap/rank.d.ts +26 -2
  265. package/dist/repomap/rank.d.ts.map +1 -1
  266. package/dist/repomap/rank.js +20 -0
  267. package/dist/repomap/rank.js.map +1 -1
  268. package/dist/repomap/reader.d.ts +73 -0
  269. package/dist/repomap/reader.d.ts.map +1 -0
  270. package/dist/repomap/reader.js +30 -0
  271. package/dist/repomap/reader.js.map +1 -0
  272. package/dist/repomap/tags.d.ts.map +1 -1
  273. package/dist/repomap/tags.js.map +1 -1
  274. package/dist/retrieve.d.ts +8 -0
  275. package/dist/retrieve.d.ts.map +1 -1
  276. package/dist/retrieve.js +12 -1
  277. package/dist/retrieve.js.map +1 -1
  278. package/dist/smelter.d.ts +79 -0
  279. package/dist/smelter.d.ts.map +1 -0
  280. package/dist/smelter.js +65 -0
  281. package/dist/smelter.js.map +1 -0
  282. package/dist/stages.d.ts.map +1 -1
  283. package/dist/stages.js +2 -2
  284. package/dist/stages.js.map +1 -1
  285. package/dist/stats.d.ts +2 -1
  286. package/dist/stats.d.ts.map +1 -1
  287. package/dist/stats.js +2 -1
  288. package/dist/stats.js.map +1 -1
  289. package/dist/store-dir.d.ts +43 -4
  290. package/dist/store-dir.d.ts.map +1 -1
  291. package/dist/store-dir.js +48 -5
  292. package/dist/store-dir.js.map +1 -1
  293. package/dist/store.d.ts +6 -0
  294. package/dist/store.d.ts.map +1 -1
  295. package/dist/store.js +6 -0
  296. package/dist/store.js.map +1 -1
  297. package/dist/types.d.ts +35 -3
  298. package/dist/types.d.ts.map +1 -1
  299. package/dist/types.js.map +1 -1
  300. package/grammars/tree-sitter-bash.wasm +0 -0
  301. package/grammars/tree-sitter-c.wasm +0 -0
  302. package/grammars/tree-sitter-c_sharp.wasm +0 -0
  303. package/grammars/tree-sitter-cpp.wasm +0 -0
  304. package/grammars/tree-sitter-go.wasm +0 -0
  305. package/grammars/tree-sitter-java.wasm +0 -0
  306. package/grammars/tree-sitter-javascript.wasm +0 -0
  307. package/grammars/tree-sitter-kotlin.wasm +0 -0
  308. package/grammars/tree-sitter-php.wasm +0 -0
  309. package/grammars/tree-sitter-python.wasm +0 -0
  310. package/grammars/tree-sitter-ruby.wasm +0 -0
  311. package/grammars/tree-sitter-rust.wasm +0 -0
  312. package/grammars/tree-sitter-swift.wasm +0 -0
  313. package/grammars/tree-sitter-tsx.wasm +0 -0
  314. package/grammars/tree-sitter-typescript.wasm +0 -0
  315. package/package.json +11 -11
  316. package/dist/cli/resolve.d.ts +0 -103
  317. package/dist/cli/resolve.d.ts.map +0 -1
  318. package/dist/cli/resolve.js +0 -106
  319. package/dist/cli/resolve.js.map +0 -1
@@ -1,23 +1,10 @@
1
1
  import type { ShimAdapter } from '../shim.ts';
2
2
  /**
3
- * Claude Code shim — VERIFIED tier.
4
- *
5
- * Schema per <https://code.claude.com/docs/en/hooks> (verified 2026-09-02; the deep
6
- * dive is docs/research/2026-09-02-agent-enforcement.md § 1):
7
- *
8
- * - stdin: `{ hook_event_name: "PreToolUse", tool_name, tool_input, cwd }`. For
9
- * `Read`, `tool_input.file_path` is already absolute and `offset`/`limit` mark a
10
- * windowed read; for `Bash`, `tool_input.command` is the full command string, and
11
- * a relative path in it resolves against the payload's `cwd` — the *session's*
12
- * working directory, which after the model `cd`s differs from this hook
13
- * process's own cwd.
14
- * - deny: `hookSpecificOutput.permissionDecision: "deny"` with
15
- * `permissionDecisionReason` — which is **shown to the model**, so the guard's
16
- * reason (the exact replacement command, the `smelt retrieve` contract) lands in
17
- * the transcript as steering.
18
- * - rewrite (opt-in, `hooks.enforcement: "rewrite"`): `updatedInput` replaces the
19
- * entire input object of the *same* tool (v2.0.10+), so a Bash command can be
20
- * substituted but a Read can never become a Bash call — Reads deny in every mode.
3
+ * Claude Code shim — VERIFIED tier. The runnable front door only: every fact about this
4
+ * harness, its hook schema included, lives in its profile
5
+ * (`src/harness/claude-code.ts`), and `shimFromSchema` turns that schema into the
6
+ * adapter below. The installer wires `node dist/hooks/shims/claude-code.js` as the
7
+ * harness's hook command; this file is what that runs.
21
8
  */
22
9
  export declare const adapter: ShimAdapter;
23
10
  //# sourceMappingURL=claude-code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/claude-code.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,EAAE,WAqCrB,CAAC"}
1
+ {"version":3,"file":"claude-code.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/claude-code.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,WAAuC,CAAC","sourcesContent":["import { claudeCode } from '../../harness/claude-code.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Claude Code shim — VERIFIED tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/claude-code.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/claude-code.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(claudeCode);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,61 +1,14 @@
1
- import { asRecord, isMainModule, runShimMain, toolCallRequest } from '../shim.js';
1
+ import { claudeCode } from '../../harness/claude-code.js';
2
+ import { shimAdapterOf } from '../../harness/profile.js';
3
+ import { isMainModule, runShimMain } from '../shim.js';
2
4
  /**
3
- * Claude Code shim — VERIFIED tier.
4
- *
5
- * Schema per <https://code.claude.com/docs/en/hooks> (verified 2026-09-02; the deep
6
- * dive is docs/research/2026-09-02-agent-enforcement.md § 1):
7
- *
8
- * - stdin: `{ hook_event_name: "PreToolUse", tool_name, tool_input, cwd }`. For
9
- * `Read`, `tool_input.file_path` is already absolute and `offset`/`limit` mark a
10
- * windowed read; for `Bash`, `tool_input.command` is the full command string, and
11
- * a relative path in it resolves against the payload's `cwd` — the *session's*
12
- * working directory, which after the model `cd`s differs from this hook
13
- * process's own cwd.
14
- * - deny: `hookSpecificOutput.permissionDecision: "deny"` with
15
- * `permissionDecisionReason` — which is **shown to the model**, so the guard's
16
- * reason (the exact replacement command, the `smelt retrieve` contract) lands in
17
- * the transcript as steering.
18
- * - rewrite (opt-in, `hooks.enforcement: "rewrite"`): `updatedInput` replaces the
19
- * entire input object of the *same* tool (v2.0.10+), so a Bash command can be
20
- * substituted but a Read can never become a Bash call — Reads deny in every mode.
5
+ * Claude Code shim — VERIFIED tier. The runnable front door only: every fact about this
6
+ * harness, its hook schema included, lives in its profile
7
+ * (`src/harness/claude-code.ts`), and `shimFromSchema` turns that schema into the
8
+ * adapter below. The installer wires `node dist/hooks/shims/claude-code.js` as the
9
+ * harness's hook command; this file is what that runs.
21
10
  */
22
- export const adapter = {
23
- toRequest: (raw) => {
24
- const fields = asRecord(raw);
25
- return toolCallRequest(fields['tool_name'], fields['tool_input'], {
26
- read: ['Read'],
27
- bash: ['Bash'],
28
- });
29
- },
30
- cwd: (raw) => {
31
- const cwd = asRecord(raw)['cwd'];
32
- return typeof cwd === 'string' && cwd !== '' ? cwd : undefined;
33
- },
34
- pass: () => ({ stdout: '', exitCode: 0 }),
35
- deny: (_raw, _request, decision) => ({
36
- stdout: `${JSON.stringify({
37
- hookSpecificOutput: {
38
- hookEventName: 'PreToolUse',
39
- permissionDecision: 'deny',
40
- permissionDecisionReason: decision.reason ?? 'denied by the smelt guard',
41
- },
42
- })}\n`,
43
- exitCode: 0,
44
- }),
45
- rewrite: (raw, _request, decision) => ({
46
- stdout: `${JSON.stringify({
47
- hookSpecificOutput: {
48
- hookEventName: 'PreToolUse',
49
- permissionDecision: 'allow',
50
- permissionDecisionReason: `smelt rewrote this command (hooks.enforcement: "rewrite"): ` +
51
- `${decision.suggestion ?? ''}`,
52
- // updatedInput replaces the whole input object — unchanged fields ride along.
53
- updatedInput: { ...asRecord(asRecord(raw)['tool_input']), command: decision.suggestion },
54
- },
55
- })}\n`,
56
- exitCode: 0,
57
- }),
58
- };
11
+ export const adapter = shimAdapterOf(claudeCode);
59
12
  if (isMainModule(import.meta.url))
60
13
  runShimMain(adapter);
61
14
  //# sourceMappingURL=claude-code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/hooks/shims/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7B,OAAO,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE;YAChE,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,IAAI,EAAE,CAAC,MAAM,CAAC;SACf,CAAC,CAAC;IACL,CAAC;IACD,GAAG,EAAE,CAAC,GAAG,EAAE,EAAE;QACX,MAAM,GAAG,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;QACjC,OAAO,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;IACjE,CAAC;IACD,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACzC,IAAI,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,kBAAkB,EAAE;gBAClB,aAAa,EAAE,YAAY;gBAC3B,kBAAkB,EAAE,MAAM;gBAC1B,wBAAwB,EAAE,QAAQ,CAAC,MAAM,IAAI,2BAA2B;aACzE;SACF,CAAC,IAAI;QACN,QAAQ,EAAE,CAAC;KACZ,CAAC;IACF,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,kBAAkB,EAAE;gBAClB,aAAa,EAAE,YAAY;gBAC3B,kBAAkB,EAAE,OAAO;gBAC3B,wBAAwB,EACtB,6DAA6D;oBAC7D,GAAG,QAAQ,CAAC,UAAU,IAAI,EAAE,EAAE;gBAChC,8EAA8E;gBAC9E,YAAY,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE;aACzF;SACF,CAAC,IAAI;QACN,QAAQ,EAAE,CAAC;KACZ,CAAC;CACH,CAAC;AAEF,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"claude-code.js","sourceRoot":"","sources":["../../../src/hooks/shims/claude-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB,aAAa,CAAC,UAAU,CAAC,CAAC;AAE9D,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import { claudeCode } from '../../harness/claude-code.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Claude Code shim — VERIFIED tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/claude-code.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/claude-code.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(claudeCode);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,17 +1,10 @@
1
1
  import type { ShimAdapter } from '../shim.ts';
2
2
  /**
3
- * Cline shim — EXPERIMENTAL tier: schema mapped from the capability matrix
4
- * (docs/research/2026-09-02-harness-capability-matrix.md, Cline row; primary source
5
- * <https://docs.cline.bot/features/hooks>), not yet smoke-tested against the real
6
- * binary.
7
- *
8
- * - event: `PreToolUse`, delivered to an executable under `.clinerules/hooks/`;
9
- * stdin carries the tool call (accepted spellings: `tool_name`/`tool_input`,
10
- * `toolName`/`toolInput`, or nested under `preToolUse`).
11
- * - deny: `{ "cancel": true, "errorMessage": … }`. **Deny-only**: the response
12
- * schema has no input-modification field, so under
13
- * `hooks.enforcement: "rewrite"` this harness falls back to the deny, whose
14
- * reason still carries the exact replacement pipeline.
3
+ * Cline shim — EXPERIMENTAL tier. The runnable front door only: every fact about this
4
+ * harness, its hook schema included, lives in its profile
5
+ * (`src/harness/cline.ts`), and `shimFromSchema` turns that schema into the
6
+ * adapter below. The installer wires `node dist/hooks/shims/cline.js` as the
7
+ * harness's hook command; this file is what that runs.
15
8
  */
16
9
  export declare const adapter: ShimAdapter;
17
10
  //# sourceMappingURL=cline.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cline.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/cline.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,OAAO,EAAE,WAqBrB,CAAC"}
1
+ {"version":3,"file":"cline.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/cline.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,WAAkC,CAAC","sourcesContent":["import { cline } from '../../harness/cline.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Cline shim — EXPERIMENTAL tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/cline.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/cline.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(cline);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,39 +1,14 @@
1
- import { asRecord, isMainModule, runShimMain, toolCallRequest } from '../shim.js';
1
+ import { cline } from '../../harness/cline.js';
2
+ import { shimAdapterOf } from '../../harness/profile.js';
3
+ import { isMainModule, runShimMain } from '../shim.js';
2
4
  /**
3
- * Cline shim — EXPERIMENTAL tier: schema mapped from the capability matrix
4
- * (docs/research/2026-09-02-harness-capability-matrix.md, Cline row; primary source
5
- * <https://docs.cline.bot/features/hooks>), not yet smoke-tested against the real
6
- * binary.
7
- *
8
- * - event: `PreToolUse`, delivered to an executable under `.clinerules/hooks/`;
9
- * stdin carries the tool call (accepted spellings: `tool_name`/`tool_input`,
10
- * `toolName`/`toolInput`, or nested under `preToolUse`).
11
- * - deny: `{ "cancel": true, "errorMessage": … }`. **Deny-only**: the response
12
- * schema has no input-modification field, so under
13
- * `hooks.enforcement: "rewrite"` this harness falls back to the deny, whose
14
- * reason still carries the exact replacement pipeline.
5
+ * Cline shim — EXPERIMENTAL tier. The runnable front door only: every fact about this
6
+ * harness, its hook schema included, lives in its profile
7
+ * (`src/harness/cline.ts`), and `shimFromSchema` turns that schema into the
8
+ * adapter below. The installer wires `node dist/hooks/shims/cline.js` as the
9
+ * harness's hook command; this file is what that runs.
15
10
  */
16
- export const adapter = {
17
- toRequest: (raw) => {
18
- const fields = asRecord(raw);
19
- const nested = asRecord(fields['preToolUse']);
20
- const name = fields['tool_name'] ?? fields['toolName'] ?? nested['toolName'] ?? nested['tool'];
21
- const input = fields['tool_input'] ?? fields['toolInput'] ?? nested['toolInput'] ?? nested['input'];
22
- return toolCallRequest(name, input, {
23
- read: ['Read', 'read_file', 'readFile'],
24
- bash: ['Bash', 'execute_command', 'executeCommand', 'shell'],
25
- });
26
- },
27
- pass: () => ({ stdout: '', exitCode: 0 }),
28
- deny: (_raw, _request, decision) => ({
29
- stdout: `${JSON.stringify({
30
- cancel: true,
31
- errorMessage: decision.reason ?? 'denied by the smelt guard',
32
- })}\n`,
33
- exitCode: 0,
34
- }),
35
- // No `rewrite`: Cline's PreToolUse response cannot modify tool input (deny-only).
36
- };
11
+ export const adapter = shimAdapterOf(cline);
37
12
  if (isMainModule(import.meta.url))
38
13
  runShimMain(adapter);
39
14
  //# sourceMappingURL=cline.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cline.js","sourceRoot":"","sources":["../../../src/hooks/shims/cline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlF;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7B,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC;QAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC;QAC/F,MAAM,KAAK,GACT,MAAM,CAAC,YAAY,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC;QACxF,OAAO,eAAe,CAAC,IAAI,EAAE,KAAK,EAAE;YAClC,IAAI,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,CAAC;YACvC,IAAI,EAAE,CAAC,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,OAAO,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IACD,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACzC,IAAI,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,MAAM,EAAE,IAAI;YACZ,YAAY,EAAE,QAAQ,CAAC,MAAM,IAAI,2BAA2B;SAC7D,CAAC,IAAI;QACN,QAAQ,EAAE,CAAC;KACZ,CAAC;IACF,kFAAkF;CACnF,CAAC;AAEF,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"cline.js","sourceRoot":"","sources":["../../../src/hooks/shims/cline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB,aAAa,CAAC,KAAK,CAAC,CAAC;AAEzD,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import { cline } from '../../harness/cline.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Cline shim — EXPERIMENTAL tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/cline.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/cline.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(cline);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,23 +1,10 @@
1
1
  import type { ShimAdapter } from '../shim.ts';
2
2
  /**
3
- * Codex CLI shim — VERIFIED tier.
4
- *
5
- * Codex's experimental hooks (`features.hooks`, rust-v0.114.0+, on by default from
6
- * 0.150.1) deliberately mirror Claude Code's schema the survey is
7
- * docs/research/2026-09-02-agent-enforcement.md § 3, primary source
8
- * <https://developers.openai.com/codex/hooks>:
9
- *
10
- * - stdin: `{ tool_name, tool_input }`; shell input arrives as `tool_name: "Bash"`,
11
- * `tool_input.command`.
12
- * - deny: `hookSpecificOutput.permissionDecision: "deny"` + reason (or exit 2).
13
- * - rewrite: `permissionDecision: "allow"` with `updatedInput` — for Bash,
14
- * `updatedInput` **must include a string `command` field**, which this shim's
15
- * rewrite always does.
16
- *
17
- * Two documented differences from Claude Code, both honoured here:
18
- * `permissionDecision: "ask"` is NOT supported (a parse error — the tool proceeds),
19
- * and this shim never emits it; project-layer hooks only run once the project is
20
- * trusted, which the installer's output says out loud.
3
+ * Codex CLI shim — VERIFIED tier. The runnable front door only: every fact about this
4
+ * harness, its hook schema included, lives in its profile
5
+ * (`src/harness/codex.ts`), and `shimFromSchema` turns that schema into the
6
+ * adapter below. The installer wires `node dist/hooks/shims/codex.js` as the
7
+ * harness's hook command; this file is what that runs.
21
8
  */
22
9
  export declare const adapter: ShimAdapter;
23
10
  //# sourceMappingURL=codex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/codex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,EAAE,WAgCrB,CAAC"}
1
+ {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/codex.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,WAAkC,CAAC","sourcesContent":["import { codex } from '../../harness/codex.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Codex CLI shim — VERIFIED tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/codex.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/codex.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(codex);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,56 +1,14 @@
1
- import { asRecord, isMainModule, runShimMain, toolCallRequest } from '../shim.js';
1
+ import { codex } from '../../harness/codex.js';
2
+ import { shimAdapterOf } from '../../harness/profile.js';
3
+ import { isMainModule, runShimMain } from '../shim.js';
2
4
  /**
3
- * Codex CLI shim — VERIFIED tier.
4
- *
5
- * Codex's experimental hooks (`features.hooks`, rust-v0.114.0+, on by default from
6
- * 0.150.1) deliberately mirror Claude Code's schema the survey is
7
- * docs/research/2026-09-02-agent-enforcement.md § 3, primary source
8
- * <https://developers.openai.com/codex/hooks>:
9
- *
10
- * - stdin: `{ tool_name, tool_input }`; shell input arrives as `tool_name: "Bash"`,
11
- * `tool_input.command`.
12
- * - deny: `hookSpecificOutput.permissionDecision: "deny"` + reason (or exit 2).
13
- * - rewrite: `permissionDecision: "allow"` with `updatedInput` — for Bash,
14
- * `updatedInput` **must include a string `command` field**, which this shim's
15
- * rewrite always does.
16
- *
17
- * Two documented differences from Claude Code, both honoured here:
18
- * `permissionDecision: "ask"` is NOT supported (a parse error — the tool proceeds),
19
- * and this shim never emits it; project-layer hooks only run once the project is
20
- * trusted, which the installer's output says out loud.
5
+ * Codex CLI shim — VERIFIED tier. The runnable front door only: every fact about this
6
+ * harness, its hook schema included, lives in its profile
7
+ * (`src/harness/codex.ts`), and `shimFromSchema` turns that schema into the
8
+ * adapter below. The installer wires `node dist/hooks/shims/codex.js` as the
9
+ * harness's hook command; this file is what that runs.
21
10
  */
22
- export const adapter = {
23
- toRequest: (raw) => {
24
- const fields = asRecord(raw);
25
- return toolCallRequest(fields['tool_name'], fields['tool_input'], {
26
- read: ['Read'],
27
- bash: ['Bash', 'shell'],
28
- });
29
- },
30
- pass: () => ({ stdout: '', exitCode: 0 }),
31
- deny: (_raw, _request, decision) => ({
32
- stdout: `${JSON.stringify({
33
- hookSpecificOutput: {
34
- hookEventName: 'PreToolUse',
35
- permissionDecision: 'deny',
36
- permissionDecisionReason: decision.reason ?? 'denied by the smelt guard',
37
- },
38
- })}\n`,
39
- exitCode: 0,
40
- }),
41
- rewrite: (raw, _request, decision) => ({
42
- stdout: `${JSON.stringify({
43
- hookSpecificOutput: {
44
- hookEventName: 'PreToolUse',
45
- permissionDecision: 'allow',
46
- permissionDecisionReason: `smelt rewrote this command (hooks.enforcement: "rewrite"): ` +
47
- `${decision.suggestion ?? ''}`,
48
- updatedInput: { ...asRecord(asRecord(raw)['tool_input']), command: decision.suggestion },
49
- },
50
- })}\n`,
51
- exitCode: 0,
52
- }),
53
- };
11
+ export const adapter = shimAdapterOf(codex);
54
12
  if (isMainModule(import.meta.url))
55
13
  runShimMain(adapter);
56
14
  //# sourceMappingURL=codex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../src/hooks/shims/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7B,OAAO,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE;YAChE,IAAI,EAAE,CAAC,MAAM,CAAC;YACd,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC;SACxB,CAAC,CAAC;IACL,CAAC;IACD,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACzC,IAAI,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,kBAAkB,EAAE;gBAClB,aAAa,EAAE,YAAY;gBAC3B,kBAAkB,EAAE,MAAM;gBAC1B,wBAAwB,EAAE,QAAQ,CAAC,MAAM,IAAI,2BAA2B;aACzE;SACF,CAAC,IAAI;QACN,QAAQ,EAAE,CAAC;KACZ,CAAC;IACF,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,kBAAkB,EAAE;gBAClB,aAAa,EAAE,YAAY;gBAC3B,kBAAkB,EAAE,OAAO;gBAC3B,wBAAwB,EACtB,6DAA6D;oBAC7D,GAAG,QAAQ,CAAC,UAAU,IAAI,EAAE,EAAE;gBAChC,YAAY,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE;aACzF;SACF,CAAC,IAAI;QACN,QAAQ,EAAE,CAAC;KACZ,CAAC;CACH,CAAC;AAEF,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../src/hooks/shims/codex.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB,aAAa,CAAC,KAAK,CAAC,CAAC;AAEzD,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import { codex } from '../../harness/codex.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Codex CLI shim — VERIFIED tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/codex.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/codex.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(codex);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,19 +1,10 @@
1
1
  import type { ShimAdapter } from '../shim.ts';
2
2
  /**
3
- * Cursor CLI/agent shim — EXPERIMENTAL tier: schema mapped from the capability
4
- * matrix (docs/research/2026-09-02-harness-capability-matrix.md, Cursor row; primary
5
- * source <https://cursor.com/docs/agent/hooks>), not yet smoke-tested against the
6
- * real binary.
7
- *
8
- * - event: `preToolUse` (the broad hook — unlike `beforeShellExecution`, it
9
- * supports input rewrite); stdin `{ tool_name, tool_input }`.
10
- * - deny: `{ "permission": "deny", "agentMessage": … }` — `agentMessage` reaches
11
- * the model, `userMessage` the human; the guard's steering text goes to the model.
12
- * - rewrite: `{ "permission": "allow", "updated_input": { … } }` (snake_case, the
13
- * whole input object).
14
- *
15
- * Cursor has no static permission-config file — gating is entirely hook code — so
16
- * this shim plus the instruction file is the whole enforcement story there.
3
+ * Cursor shim — EXPERIMENTAL tier. The runnable front door only: every fact about this
4
+ * harness, its hook schema included, lives in its profile
5
+ * (`src/harness/cursor.ts`), and `shimFromSchema` turns that schema into the
6
+ * adapter below. The installer wires `node dist/hooks/shims/cursor.js` as the
7
+ * harness's hook command; this file is what that runs.
17
8
  */
18
9
  export declare const adapter: ShimAdapter;
19
10
  //# sourceMappingURL=cursor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/cursor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,OAAO,EAAE,WA2BrB,CAAC"}
1
+ {"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/cursor.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,WAAmC,CAAC","sourcesContent":["import { cursor } from '../../harness/cursor.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Cursor shim — EXPERIMENTAL tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/cursor.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/cursor.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(cursor);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,47 +1,14 @@
1
- import { asRecord, isMainModule, runShimMain, toolCallRequest } from '../shim.js';
1
+ import { cursor } from '../../harness/cursor.js';
2
+ import { shimAdapterOf } from '../../harness/profile.js';
3
+ import { isMainModule, runShimMain } from '../shim.js';
2
4
  /**
3
- * Cursor CLI/agent shim — EXPERIMENTAL tier: schema mapped from the capability
4
- * matrix (docs/research/2026-09-02-harness-capability-matrix.md, Cursor row; primary
5
- * source <https://cursor.com/docs/agent/hooks>), not yet smoke-tested against the
6
- * real binary.
7
- *
8
- * - event: `preToolUse` (the broad hook — unlike `beforeShellExecution`, it
9
- * supports input rewrite); stdin `{ tool_name, tool_input }`.
10
- * - deny: `{ "permission": "deny", "agentMessage": … }` — `agentMessage` reaches
11
- * the model, `userMessage` the human; the guard's steering text goes to the model.
12
- * - rewrite: `{ "permission": "allow", "updated_input": { … } }` (snake_case, the
13
- * whole input object).
14
- *
15
- * Cursor has no static permission-config file — gating is entirely hook code — so
16
- * this shim plus the instruction file is the whole enforcement story there.
5
+ * Cursor shim — EXPERIMENTAL tier. The runnable front door only: every fact about this
6
+ * harness, its hook schema included, lives in its profile
7
+ * (`src/harness/cursor.ts`), and `shimFromSchema` turns that schema into the
8
+ * adapter below. The installer wires `node dist/hooks/shims/cursor.js` as the
9
+ * harness's hook command; this file is what that runs.
17
10
  */
18
- export const adapter = {
19
- toRequest: (raw) => {
20
- const fields = asRecord(raw);
21
- return toolCallRequest(fields['tool_name'], fields['tool_input'], {
22
- read: ['read_file', 'Read', 'ReadFile'],
23
- bash: ['run_terminal_cmd', 'Shell', 'Bash', 'shell'],
24
- });
25
- },
26
- pass: () => ({ stdout: '', exitCode: 0 }),
27
- deny: (_raw, _request, decision) => ({
28
- stdout: `${JSON.stringify({
29
- permission: 'deny',
30
- agentMessage: decision.reason ?? 'denied by the smelt guard',
31
- })}\n`,
32
- exitCode: 0,
33
- }),
34
- rewrite: (raw, _request, decision) => ({
35
- stdout: `${JSON.stringify({
36
- permission: 'allow',
37
- updated_input: { ...asRecord(asRecord(raw)['tool_input']), command: decision.suggestion },
38
- })}\n`,
39
- // The allow/updated_input shape carries no message field — announce on stderr.
40
- stderr: `smelt guard (rewrite mode): substituted the command in-flight with ` +
41
- `\`${decision.suggestion ?? ''}\`. ${decision.reason ?? ''}\n`,
42
- exitCode: 0,
43
- }),
44
- };
11
+ export const adapter = shimAdapterOf(cursor);
45
12
  if (isMainModule(import.meta.url))
46
13
  runShimMain(adapter);
47
14
  //# sourceMappingURL=cursor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/hooks/shims/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7B,OAAO,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE;YAChE,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC;YACvC,IAAI,EAAE,CAAC,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;SACrD,CAAC,CAAC;IACL,CAAC;IACD,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACzC,IAAI,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,UAAU,EAAE,MAAM;YAClB,YAAY,EAAE,QAAQ,CAAC,MAAM,IAAI,2BAA2B;SAC7D,CAAC,IAAI;QACN,QAAQ,EAAE,CAAC;KACZ,CAAC;IACF,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,UAAU,EAAE,OAAO;YACnB,aAAa,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE;SAC1F,CAAC,IAAI;QACN,+EAA+E;QAC/E,MAAM,EACJ,qEAAqE;YACrE,KAAK,QAAQ,CAAC,UAAU,IAAI,EAAE,OAAO,QAAQ,CAAC,MAAM,IAAI,EAAE,IAAI;QAChE,QAAQ,EAAE,CAAC;KACZ,CAAC;CACH,CAAC;AAEF,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/hooks/shims/cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB,aAAa,CAAC,MAAM,CAAC,CAAC;AAE1D,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import { cursor } from '../../harness/cursor.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Cursor shim — EXPERIMENTAL tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/cursor.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/cursor.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(cursor);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,23 +1,10 @@
1
1
  import type { ShimAdapter } from '../shim.ts';
2
2
  /**
3
- * Gemini CLI shim — EXPERIMENTAL tier: the schema below is mapped from the
4
- * capability matrix (docs/research/2026-09-02-harness-capability-matrix.md, Gemini
5
- * CLI row; primary source <https://geminicli.com/docs/hooks/reference/>), and the
6
- * field names were additionally checked 2026-09-02 against the shipped
7
- * `@google/gemini-cli` 0.58.0 bundle (installed headlessly for KOT-212's
8
- * verification pass): the BeforeTool stdin payload is `{ tool_name, tool_input }`,
9
- * `read_file` takes `file_path` with `start_line`/`end_line` windows, the shell
10
- * tool is `run_shell_command` with `command`, denial is `{ "decision": "deny",
11
- * "reason": … }`, and `hookSpecificOutput.tool_input` substitutes the input. What
12
- * has NOT run is a live end-to-end session (needs credentials this environment does
13
- * not have), so the tier stays experimental — treat surprises as shim bugs and
14
- * please report them.
15
- *
16
- * Carried caveat from the matrix: Gemini's policy engine has an open bug where an
17
- * `allow` policy is ignored in non-interactive runs
18
- * (<https://github.com/google-gemini/gemini-cli/issues/20469>) — this preset uses
19
- * hooks, not the policy engine, but non-interactive behaviour is the least-tested
20
- * corner; verify before relying on it in CI.
3
+ * Gemini CLI shim — EXPERIMENTAL tier. The runnable front door only: every fact about this
4
+ * harness, its hook schema included, lives in its profile
5
+ * (`src/harness/gemini.ts`), and `shimFromSchema` turns that schema into the
6
+ * adapter below. The installer wires `node dist/hooks/shims/gemini.js` as the
7
+ * harness's hook command; this file is what that runs.
21
8
  */
22
9
  export declare const adapter: ShimAdapter;
23
10
  //# sourceMappingURL=gemini.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/gemini.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,OAAO,EAAE,WA6BrB,CAAC"}
1
+ {"version":3,"file":"gemini.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/gemini.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,WAAmC,CAAC","sourcesContent":["import { gemini } from '../../harness/gemini.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Gemini CLI shim — EXPERIMENTAL tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/gemini.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/gemini.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(gemini);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,53 +1,14 @@
1
- import { asRecord, isMainModule, runShimMain, toolCallRequest } from '../shim.js';
1
+ import { gemini } from '../../harness/gemini.js';
2
+ import { shimAdapterOf } from '../../harness/profile.js';
3
+ import { isMainModule, runShimMain } from '../shim.js';
2
4
  /**
3
- * Gemini CLI shim — EXPERIMENTAL tier: the schema below is mapped from the
4
- * capability matrix (docs/research/2026-09-02-harness-capability-matrix.md, Gemini
5
- * CLI row; primary source <https://geminicli.com/docs/hooks/reference/>), and the
6
- * field names were additionally checked 2026-09-02 against the shipped
7
- * `@google/gemini-cli` 0.58.0 bundle (installed headlessly for KOT-212's
8
- * verification pass): the BeforeTool stdin payload is `{ tool_name, tool_input }`,
9
- * `read_file` takes `file_path` with `start_line`/`end_line` windows, the shell
10
- * tool is `run_shell_command` with `command`, denial is `{ "decision": "deny",
11
- * "reason": … }`, and `hookSpecificOutput.tool_input` substitutes the input. What
12
- * has NOT run is a live end-to-end session (needs credentials this environment does
13
- * not have), so the tier stays experimental — treat surprises as shim bugs and
14
- * please report them.
15
- *
16
- * Carried caveat from the matrix: Gemini's policy engine has an open bug where an
17
- * `allow` policy is ignored in non-interactive runs
18
- * (<https://github.com/google-gemini/gemini-cli/issues/20469>) — this preset uses
19
- * hooks, not the policy engine, but non-interactive behaviour is the least-tested
20
- * corner; verify before relying on it in CI.
5
+ * Gemini CLI shim — EXPERIMENTAL tier. The runnable front door only: every fact about this
6
+ * harness, its hook schema included, lives in its profile
7
+ * (`src/harness/gemini.ts`), and `shimFromSchema` turns that schema into the
8
+ * adapter below. The installer wires `node dist/hooks/shims/gemini.js` as the
9
+ * harness's hook command; this file is what that runs.
21
10
  */
22
- export const adapter = {
23
- toRequest: (raw) => {
24
- const fields = asRecord(raw);
25
- return toolCallRequest(fields['tool_name'], fields['tool_input'], {
26
- read: ['read_file', 'ReadFile', 'Read'],
27
- bash: ['run_shell_command', 'Shell', 'Bash'],
28
- });
29
- },
30
- pass: () => ({ stdout: '', exitCode: 0 }),
31
- deny: (_raw, _request, decision) => ({
32
- stdout: `${JSON.stringify({
33
- decision: 'deny',
34
- reason: decision.reason ?? 'denied by the smelt guard',
35
- })}\n`,
36
- exitCode: 0,
37
- }),
38
- rewrite: (raw, _request, decision) => ({
39
- stdout: `${JSON.stringify({
40
- hookSpecificOutput: {
41
- hookEventName: 'BeforeTool',
42
- tool_input: { ...asRecord(asRecord(raw)['tool_input']), command: decision.suggestion },
43
- },
44
- })}\n`,
45
- // The BeforeTool rewrite shape carries no reason field — announce on stderr.
46
- stderr: `smelt guard (rewrite mode): substituted the command in-flight with ` +
47
- `\`${decision.suggestion ?? ''}\`. ${decision.reason ?? ''}\n`,
48
- exitCode: 0,
49
- }),
50
- };
11
+ export const adapter = shimAdapterOf(gemini);
51
12
  if (isMainModule(import.meta.url))
52
13
  runShimMain(adapter);
53
14
  //# sourceMappingURL=gemini.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../../src/hooks/shims/gemini.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB;IAClC,SAAS,EAAE,CAAC,GAAG,EAAE,EAAE;QACjB,MAAM,MAAM,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC7B,OAAO,eAAe,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE;YAChE,IAAI,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,MAAM,CAAC;YACvC,IAAI,EAAE,CAAC,mBAAmB,EAAE,OAAO,EAAE,MAAM,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;IACD,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACzC,IAAI,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACnC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,2BAA2B;SACvD,CAAC,IAAI;QACN,QAAQ,EAAE,CAAC;KACZ,CAAC;IACF,OAAO,EAAE,CAAC,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACrC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,kBAAkB,EAAE;gBAClB,aAAa,EAAE,YAAY;gBAC3B,UAAU,EAAE,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE;aACvF;SACF,CAAC,IAAI;QACN,6EAA6E;QAC7E,MAAM,EACJ,qEAAqE;YACrE,KAAK,QAAQ,CAAC,UAAU,IAAI,EAAE,OAAO,QAAQ,CAAC,MAAM,IAAI,EAAE,IAAI;QAChE,QAAQ,EAAE,CAAC;KACZ,CAAC;CACH,CAAC;AAEF,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"gemini.js","sourceRoot":"","sources":["../../../src/hooks/shims/gemini.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGvD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,OAAO,GAAgB,aAAa,CAAC,MAAM,CAAC,CAAC;AAE1D,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC","sourcesContent":["import { gemini } from '../../harness/gemini.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Gemini CLI shim — EXPERIMENTAL tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/gemini.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/gemini.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(gemini);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,18 +1,10 @@
1
1
  import type { ShimAdapter } from '../shim.ts';
2
2
  /**
3
- * Grok CLI shim — EXPERIMENTAL tier: schema mapped from the capability matrix
4
- * (docs/research/2026-09-02-harness-capability-matrix.md, Grok CLI row; primary
5
- * source <https://docs.x.ai/build/features/hooks>), not yet smoke-tested against
6
- * the real binary. Note the matrix's provenance warning: the official CLI is
7
- * `xai-org/grok-build` (binary `grok`) `superagent-ai/grok-cli` is a third-party
8
- * clone with a different hook surface.
9
- *
10
- * - event: `PreToolUse`; stdin `{ tool_name, tool_input }` (Claude-Code-like tool
11
- * names).
12
- * - deny: `{ "decision": "deny", "reason": … }` or exit 2. **Deny-only**: the input
13
- * is read-only to hooks, so there is no rewrite here — under
14
- * `hooks.enforcement: "rewrite"` this harness falls back to the deny, whose
15
- * reason still carries the exact replacement pipeline.
3
+ * Grok CLI shim — EXPERIMENTAL tier. The runnable front door only: every fact about this
4
+ * harness, its hook schema included, lives in its profile
5
+ * (`src/harness/grok.ts`), and `shimFromSchema` turns that schema into the
6
+ * adapter below. The installer wires `node dist/hooks/shims/grok.js` as the
7
+ * harness's hook command; this file is what that runs.
16
8
  */
17
9
  export declare const adapter: ShimAdapter;
18
10
  //# sourceMappingURL=grok.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grok.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/grok.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,OAAO,EAAE,WAiBrB,CAAC"}
1
+ {"version":3,"file":"grok.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/grok.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,WAAiC,CAAC","sourcesContent":["import { grok } from '../../harness/grok.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Grok CLI shim — EXPERIMENTAL tier. The runnable front door only: every fact about this\n * harness, its hook schema included, lives in its profile\n * (`src/harness/grok.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/grok.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(grok);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}