@smeltjs/core 0.2.0 → 0.4.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 (348) hide show
  1. package/README.md +3 -3
  2. package/dist/agents/guide.d.ts +68 -0
  3. package/dist/agents/guide.d.ts.map +1 -0
  4. package/dist/agents/guide.js +72 -0
  5. package/dist/agents/guide.js.map +1 -0
  6. package/dist/agents/instructions.d.ts +133 -0
  7. package/dist/agents/instructions.d.ts.map +1 -0
  8. package/dist/agents/instructions.js +212 -0
  9. package/dist/agents/instructions.js.map +1 -0
  10. package/dist/agents/lint.d.ts +154 -0
  11. package/dist/agents/lint.d.ts.map +1 -0
  12. package/dist/agents/lint.js +761 -0
  13. package/dist/agents/lint.js.map +1 -0
  14. package/dist/agents/split.d.ts +113 -0
  15. package/dist/agents/split.d.ts.map +1 -0
  16. package/dist/agents/split.js +234 -0
  17. package/dist/agents/split.js.map +1 -0
  18. package/dist/apply.d.ts.map +1 -1
  19. package/dist/apply.js.map +1 -1
  20. package/dist/cache/prefix.d.ts.map +1 -1
  21. package/dist/cache/prefix.js.map +1 -1
  22. package/dist/cli/agents.d.ts +39 -0
  23. package/dist/cli/agents.d.ts.map +1 -0
  24. package/dist/cli/agents.js +121 -0
  25. package/dist/cli/agents.js.map +1 -0
  26. package/dist/cli/args.d.ts +17 -70
  27. package/dist/cli/args.d.ts.map +1 -1
  28. package/dist/cli/args.js +18 -338
  29. package/dist/cli/args.js.map +1 -1
  30. package/dist/cli/bin.d.ts.map +1 -1
  31. package/dist/cli/bin.js.map +1 -1
  32. package/dist/cli/config.d.ts +60 -0
  33. package/dist/cli/config.d.ts.map +1 -1
  34. package/dist/cli/config.js +89 -2
  35. package/dist/cli/config.js.map +1 -1
  36. package/dist/cli/hooks.d.ts +55 -51
  37. package/dist/cli/hooks.d.ts.map +1 -1
  38. package/dist/cli/hooks.js +206 -658
  39. package/dist/cli/hooks.js.map +1 -1
  40. package/dist/cli/init.d.ts +30 -15
  41. package/dist/cli/init.d.ts.map +1 -1
  42. package/dist/cli/init.js +167 -38
  43. package/dist/cli/init.js.map +1 -1
  44. package/dist/cli/report.d.ts +23 -0
  45. package/dist/cli/report.d.ts.map +1 -1
  46. package/dist/cli/report.js +142 -4
  47. package/dist/cli/report.js.map +1 -1
  48. package/dist/cli/run.d.ts +29 -90
  49. package/dist/cli/run.d.ts.map +1 -1
  50. package/dist/cli/run.js +34 -342
  51. package/dist/cli/run.js.map +1 -1
  52. package/dist/cli/shell.d.ts +106 -0
  53. package/dist/cli/shell.d.ts.map +1 -0
  54. package/dist/cli/shell.js +100 -0
  55. package/dist/cli/shell.js.map +1 -0
  56. package/dist/cli/subcommands/agents.d.ts +72 -0
  57. package/dist/cli/subcommands/agents.d.ts.map +1 -0
  58. package/dist/cli/subcommands/agents.js +162 -0
  59. package/dist/cli/subcommands/agents.js.map +1 -0
  60. package/dist/cli/subcommands/flags.d.ts +144 -0
  61. package/dist/cli/subcommands/flags.d.ts.map +1 -0
  62. package/dist/cli/subcommands/flags.js +220 -0
  63. package/dist/cli/subcommands/flags.js.map +1 -0
  64. package/dist/cli/subcommands/hooks.d.ts +18 -0
  65. package/dist/cli/subcommands/hooks.d.ts.map +1 -0
  66. package/dist/cli/subcommands/hooks.js +80 -0
  67. package/dist/cli/subcommands/hooks.js.map +1 -0
  68. package/dist/cli/subcommands/init.d.ts +19 -0
  69. package/dist/cli/subcommands/init.d.ts.map +1 -0
  70. package/dist/cli/subcommands/init.js +44 -0
  71. package/dist/cli/subcommands/init.js.map +1 -0
  72. package/dist/cli/subcommands/map.d.ts +75 -0
  73. package/dist/cli/subcommands/map.d.ts.map +1 -0
  74. package/dist/cli/subcommands/map.js +132 -0
  75. package/dist/cli/subcommands/map.js.map +1 -0
  76. package/dist/cli/subcommands/registry.d.ts +81 -0
  77. package/dist/cli/subcommands/registry.d.ts.map +1 -0
  78. package/dist/cli/subcommands/registry.js +141 -0
  79. package/dist/cli/subcommands/registry.js.map +1 -0
  80. package/dist/cli/subcommands/retrieve.d.ts +74 -0
  81. package/dist/cli/subcommands/retrieve.d.ts.map +1 -0
  82. package/dist/cli/subcommands/retrieve.js +84 -0
  83. package/dist/cli/subcommands/retrieve.js.map +1 -0
  84. package/dist/cli/subcommands/smelt.d.ts +107 -0
  85. package/dist/cli/subcommands/smelt.d.ts.map +1 -0
  86. package/dist/cli/subcommands/smelt.js +304 -0
  87. package/dist/cli/subcommands/smelt.js.map +1 -0
  88. package/dist/cli/subcommands/stats.d.ts +43 -0
  89. package/dist/cli/subcommands/stats.d.ts.map +1 -0
  90. package/dist/cli/subcommands/stats.js +62 -0
  91. package/dist/cli/subcommands/stats.js.map +1 -0
  92. package/dist/cli/subcommands/subcommand.d.ts +113 -0
  93. package/dist/cli/subcommands/subcommand.d.ts.map +1 -0
  94. package/dist/cli/subcommands/subcommand.js +3 -0
  95. package/dist/cli/subcommands/subcommand.js.map +1 -0
  96. package/dist/cli/usage.d.ts +3 -0
  97. package/dist/cli/usage.d.ts.map +1 -0
  98. package/dist/cli/usage.js +95 -0
  99. package/dist/cli/usage.js.map +1 -0
  100. package/dist/detect.d.ts.map +1 -1
  101. package/dist/detect.js.map +1 -1
  102. package/dist/errors.d.ts +21 -1
  103. package/dist/errors.d.ts.map +1 -1
  104. package/dist/errors.js +33 -1
  105. package/dist/errors.js.map +1 -1
  106. package/dist/harness/aider.d.ts +10 -0
  107. package/dist/harness/aider.d.ts.map +1 -0
  108. package/dist/harness/aider.js +21 -0
  109. package/dist/harness/aider.js.map +1 -0
  110. package/dist/harness/claude-code.d.ts +3 -0
  111. package/dist/harness/claude-code.d.ts.map +1 -0
  112. package/dist/harness/claude-code.js +68 -0
  113. package/dist/harness/claude-code.js.map +1 -0
  114. package/dist/harness/cline.d.ts +3 -0
  115. package/dist/harness/cline.d.ts.map +1 -0
  116. package/dist/harness/cline.js +54 -0
  117. package/dist/harness/cline.js.map +1 -0
  118. package/dist/harness/codex.d.ts +3 -0
  119. package/dist/harness/codex.d.ts.map +1 -0
  120. package/dist/harness/codex.js +92 -0
  121. package/dist/harness/codex.js.map +1 -0
  122. package/dist/harness/cursor.d.ts +3 -0
  123. package/dist/harness/cursor.d.ts.map +1 -0
  124. package/dist/harness/cursor.js +54 -0
  125. package/dist/harness/cursor.js.map +1 -0
  126. package/dist/harness/gemini.d.ts +3 -0
  127. package/dist/harness/gemini.d.ts.map +1 -0
  128. package/dist/harness/gemini.js +60 -0
  129. package/dist/harness/gemini.js.map +1 -0
  130. package/dist/harness/grok.d.ts +3 -0
  131. package/dist/harness/grok.d.ts.map +1 -0
  132. package/dist/harness/grok.js +47 -0
  133. package/dist/harness/grok.js.map +1 -0
  134. package/dist/harness/hermes.d.ts +3 -0
  135. package/dist/harness/hermes.d.ts.map +1 -0
  136. package/dist/harness/hermes.js +72 -0
  137. package/dist/harness/hermes.js.map +1 -0
  138. package/dist/harness/kilocode.d.ts +3 -0
  139. package/dist/harness/kilocode.d.ts.map +1 -0
  140. package/dist/harness/kilocode.js +35 -0
  141. package/dist/harness/kilocode.js.map +1 -0
  142. package/dist/harness/opencode.d.ts +3 -0
  143. package/dist/harness/opencode.d.ts.map +1 -0
  144. package/dist/harness/opencode.js +97 -0
  145. package/dist/harness/opencode.js.map +1 -0
  146. package/dist/harness/paths.d.ts +17 -0
  147. package/dist/harness/paths.d.ts.map +1 -0
  148. package/dist/harness/paths.js +45 -0
  149. package/dist/harness/paths.js.map +1 -0
  150. package/dist/harness/profile.d.ts +209 -0
  151. package/dist/harness/profile.d.ts.map +1 -0
  152. package/dist/harness/profile.js +41 -0
  153. package/dist/harness/profile.js.map +1 -0
  154. package/dist/harness/registry.d.ts +100 -0
  155. package/dist/harness/registry.d.ts.map +1 -0
  156. package/dist/harness/registry.js +144 -0
  157. package/dist/harness/registry.js.map +1 -0
  158. package/dist/harness/snippet.d.ts +19 -0
  159. package/dist/harness/snippet.d.ts.map +1 -0
  160. package/dist/harness/snippet.js +41 -0
  161. package/dist/harness/snippet.js.map +1 -0
  162. package/dist/hash.d.ts.map +1 -1
  163. package/dist/hash.js.map +1 -1
  164. package/dist/hooks/guard-core.d.ts +14 -14
  165. package/dist/hooks/guard-core.d.ts.map +1 -1
  166. package/dist/hooks/guard-core.js +15 -37
  167. package/dist/hooks/guard-core.js.map +1 -1
  168. package/dist/hooks/shim.d.ts +95 -4
  169. package/dist/hooks/shim.d.ts.map +1 -1
  170. package/dist/hooks/shim.js +87 -2
  171. package/dist/hooks/shim.js.map +1 -1
  172. package/dist/hooks/shims/claude-code.d.ts +5 -18
  173. package/dist/hooks/shims/claude-code.d.ts.map +1 -1
  174. package/dist/hooks/shims/claude-code.js +9 -56
  175. package/dist/hooks/shims/claude-code.js.map +1 -1
  176. package/dist/hooks/shims/cline.d.ts +5 -12
  177. package/dist/hooks/shims/cline.d.ts.map +1 -1
  178. package/dist/hooks/shims/cline.js +9 -34
  179. package/dist/hooks/shims/cline.js.map +1 -1
  180. package/dist/hooks/shims/codex.d.ts +5 -18
  181. package/dist/hooks/shims/codex.d.ts.map +1 -1
  182. package/dist/hooks/shims/codex.js +9 -51
  183. package/dist/hooks/shims/codex.js.map +1 -1
  184. package/dist/hooks/shims/cursor.d.ts +5 -14
  185. package/dist/hooks/shims/cursor.d.ts.map +1 -1
  186. package/dist/hooks/shims/cursor.js +9 -42
  187. package/dist/hooks/shims/cursor.js.map +1 -1
  188. package/dist/hooks/shims/gemini.d.ts +5 -18
  189. package/dist/hooks/shims/gemini.d.ts.map +1 -1
  190. package/dist/hooks/shims/gemini.js +9 -48
  191. package/dist/hooks/shims/gemini.js.map +1 -1
  192. package/dist/hooks/shims/grok.d.ts +5 -13
  193. package/dist/hooks/shims/grok.d.ts.map +1 -1
  194. package/dist/hooks/shims/grok.js +9 -32
  195. package/dist/hooks/shims/grok.js.map +1 -1
  196. package/dist/hooks/shims/hermes.d.ts +5 -17
  197. package/dist/hooks/shims/hermes.d.ts.map +1 -1
  198. package/dist/hooks/shims/hermes.js +9 -45
  199. package/dist/hooks/shims/hermes.js.map +1 -1
  200. package/dist/index.d.ts +43 -76
  201. package/dist/index.d.ts.map +1 -1
  202. package/dist/index.js +21 -67
  203. package/dist/index.js.map +1 -1
  204. package/dist/lang/bash.d.ts.map +1 -1
  205. package/dist/lang/bash.js.map +1 -1
  206. package/dist/lang/c.d.ts.map +1 -1
  207. package/dist/lang/c.js.map +1 -1
  208. package/dist/lang/c_sharp.d.ts.map +1 -1
  209. package/dist/lang/c_sharp.js.map +1 -1
  210. package/dist/lang/cpp.d.ts.map +1 -1
  211. package/dist/lang/cpp.js.map +1 -1
  212. package/dist/lang/go.d.ts.map +1 -1
  213. package/dist/lang/go.js.map +1 -1
  214. package/dist/lang/java.d.ts.map +1 -1
  215. package/dist/lang/java.js.map +1 -1
  216. package/dist/lang/javascript.d.ts.map +1 -1
  217. package/dist/lang/javascript.js.map +1 -1
  218. package/dist/lang/kotlin.d.ts.map +1 -1
  219. package/dist/lang/kotlin.js.map +1 -1
  220. package/dist/lang/php.d.ts.map +1 -1
  221. package/dist/lang/php.js.map +1 -1
  222. package/dist/lang/profile.d.ts.map +1 -1
  223. package/dist/lang/profile.js.map +1 -1
  224. package/dist/lang/python.d.ts.map +1 -1
  225. package/dist/lang/python.js.map +1 -1
  226. package/dist/lang/registry.d.ts.map +1 -1
  227. package/dist/lang/registry.js.map +1 -1
  228. package/dist/lang/ruby.d.ts.map +1 -1
  229. package/dist/lang/ruby.js.map +1 -1
  230. package/dist/lang/rust.d.ts.map +1 -1
  231. package/dist/lang/rust.js.map +1 -1
  232. package/dist/lang/swift.d.ts.map +1 -1
  233. package/dist/lang/swift.js.map +1 -1
  234. package/dist/lang/tsx.d.ts.map +1 -1
  235. package/dist/lang/tsx.js.map +1 -1
  236. package/dist/lang/typescript.d.ts.map +1 -1
  237. package/dist/lang/typescript.js.map +1 -1
  238. package/dist/net/policy.d.ts +18 -1
  239. package/dist/net/policy.d.ts.map +1 -1
  240. package/dist/net/policy.js +6 -4
  241. package/dist/net/policy.js.map +1 -1
  242. package/dist/ops/index.d.ts +39 -0
  243. package/dist/ops/index.d.ts.map +1 -0
  244. package/dist/ops/index.js +37 -0
  245. package/dist/ops/index.js.map +1 -0
  246. package/dist/ops/inputs.d.ts +170 -0
  247. package/dist/ops/inputs.d.ts.map +1 -0
  248. package/dist/ops/inputs.js +142 -0
  249. package/dist/ops/inputs.js.map +1 -0
  250. package/dist/ops/verbs.d.ts +136 -0
  251. package/dist/ops/verbs.d.ts.map +1 -0
  252. package/dist/ops/verbs.js +76 -0
  253. package/dist/ops/verbs.js.map +1 -0
  254. package/dist/plan/auto.d.ts +69 -0
  255. package/dist/plan/auto.d.ts.map +1 -0
  256. package/dist/plan/auto.js +70 -0
  257. package/dist/plan/auto.js.map +1 -0
  258. package/dist/plan/budget.d.ts +21 -0
  259. package/dist/plan/budget.d.ts.map +1 -0
  260. package/dist/plan/budget.js +26 -0
  261. package/dist/plan/budget.js.map +1 -0
  262. package/dist/plan/grammar.d.ts +14 -0
  263. package/dist/plan/grammar.d.ts.map +1 -1
  264. package/dist/plan/grammar.js +47 -6
  265. package/dist/plan/grammar.js.map +1 -1
  266. package/dist/plan/lexical.d.ts.map +1 -1
  267. package/dist/plan/lexical.js +1 -7
  268. package/dist/plan/lexical.js.map +1 -1
  269. package/dist/plan/planners.d.ts +35 -2
  270. package/dist/plan/planners.d.ts.map +1 -1
  271. package/dist/plan/planners.js +35 -2
  272. package/dist/plan/planners.js.map +1 -1
  273. package/dist/plan/structural.d.ts +19 -5
  274. package/dist/plan/structural.d.ts.map +1 -1
  275. package/dist/plan/structural.js +180 -33
  276. package/dist/plan/structural.js.map +1 -1
  277. package/dist/repomap/cache.d.ts +48 -0
  278. package/dist/repomap/cache.d.ts.map +1 -1
  279. package/dist/repomap/cache.js +112 -13
  280. package/dist/repomap/cache.js.map +1 -1
  281. package/dist/repomap/io.d.ts +24 -0
  282. package/dist/repomap/io.d.ts.map +1 -0
  283. package/dist/repomap/io.js +34 -0
  284. package/dist/repomap/io.js.map +1 -0
  285. package/dist/repomap/map.d.ts +69 -6
  286. package/dist/repomap/map.d.ts.map +1 -1
  287. package/dist/repomap/map.js +104 -22
  288. package/dist/repomap/map.js.map +1 -1
  289. package/dist/repomap/rank.d.ts +26 -2
  290. package/dist/repomap/rank.d.ts.map +1 -1
  291. package/dist/repomap/rank.js +20 -0
  292. package/dist/repomap/rank.js.map +1 -1
  293. package/dist/repomap/reader.d.ts +73 -0
  294. package/dist/repomap/reader.d.ts.map +1 -0
  295. package/dist/repomap/reader.js +30 -0
  296. package/dist/repomap/reader.js.map +1 -0
  297. package/dist/repomap/tags.d.ts.map +1 -1
  298. package/dist/repomap/tags.js.map +1 -1
  299. package/dist/retrieve.d.ts +8 -0
  300. package/dist/retrieve.d.ts.map +1 -1
  301. package/dist/retrieve.js +12 -1
  302. package/dist/retrieve.js.map +1 -1
  303. package/dist/smelter.d.ts +79 -0
  304. package/dist/smelter.d.ts.map +1 -0
  305. package/dist/smelter.js +65 -0
  306. package/dist/smelter.js.map +1 -0
  307. package/dist/stages.d.ts.map +1 -1
  308. package/dist/stages.js +2 -2
  309. package/dist/stages.js.map +1 -1
  310. package/dist/stats.d.ts +2 -1
  311. package/dist/stats.d.ts.map +1 -1
  312. package/dist/stats.js +2 -1
  313. package/dist/stats.js.map +1 -1
  314. package/dist/store-dir.d.ts +43 -4
  315. package/dist/store-dir.d.ts.map +1 -1
  316. package/dist/store-dir.js +48 -5
  317. package/dist/store-dir.js.map +1 -1
  318. package/dist/store.d.ts +6 -0
  319. package/dist/store.d.ts.map +1 -1
  320. package/dist/store.js +6 -0
  321. package/dist/store.js.map +1 -1
  322. package/dist/text/json-edit.d.ts +71 -0
  323. package/dist/text/json-edit.d.ts.map +1 -0
  324. package/dist/text/json-edit.js +219 -0
  325. package/dist/text/json-edit.js.map +1 -0
  326. package/dist/types.d.ts +35 -14
  327. package/dist/types.d.ts.map +1 -1
  328. package/dist/types.js.map +1 -1
  329. package/grammars/tree-sitter-bash.wasm +0 -0
  330. package/grammars/tree-sitter-c.wasm +0 -0
  331. package/grammars/tree-sitter-c_sharp.wasm +0 -0
  332. package/grammars/tree-sitter-cpp.wasm +0 -0
  333. package/grammars/tree-sitter-go.wasm +0 -0
  334. package/grammars/tree-sitter-java.wasm +0 -0
  335. package/grammars/tree-sitter-javascript.wasm +0 -0
  336. package/grammars/tree-sitter-kotlin.wasm +0 -0
  337. package/grammars/tree-sitter-php.wasm +0 -0
  338. package/grammars/tree-sitter-python.wasm +0 -0
  339. package/grammars/tree-sitter-ruby.wasm +0 -0
  340. package/grammars/tree-sitter-rust.wasm +0 -0
  341. package/grammars/tree-sitter-swift.wasm +0 -0
  342. package/grammars/tree-sitter-tsx.wasm +0 -0
  343. package/grammars/tree-sitter-typescript.wasm +0 -0
  344. package/package.json +11 -11
  345. package/dist/cli/resolve.d.ts +0 -103
  346. package/dist/cli/resolve.d.ts.map +0 -1
  347. package/dist/cli/resolve.js +0 -106
  348. package/dist/cli/resolve.js.map +0 -1
@@ -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"]}
@@ -1,37 +1,14 @@
1
- import { asRecord, isMainModule, runShimMain, toolCallRequest } from '../shim.js';
1
+ import { grok } from '../../harness/grok.js';
2
+ import { shimAdapterOf } from '../../harness/profile.js';
3
+ import { isMainModule, runShimMain } from '../shim.js';
2
4
  /**
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.
5
+ * Grok 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/grok.ts`), and `shimFromSchema` turns that schema into the
8
+ * adapter below. The installer wires `node dist/hooks/shims/grok.js` as the
9
+ * harness's hook command; this file is what that runs.
16
10
  */
17
- export const adapter = {
18
- toRequest: (raw) => {
19
- const fields = asRecord(raw);
20
- return toolCallRequest(fields['tool_name'], fields['tool_input'], {
21
- read: ['Read', 'read_file', 'ReadFile'],
22
- bash: ['Bash', 'shell', 'run_shell_command'],
23
- });
24
- },
25
- pass: () => ({ stdout: '', exitCode: 0 }),
26
- deny: (_raw, _request, decision) => ({
27
- stdout: `${JSON.stringify({
28
- decision: 'deny',
29
- reason: decision.reason ?? 'denied by the smelt guard',
30
- })}\n`,
31
- exitCode: 0,
32
- }),
33
- // No `rewrite`: Grok's PreToolUse cannot modify tool input (deny-only harness).
34
- };
11
+ export const adapter = shimAdapterOf(grok);
35
12
  if (isMainModule(import.meta.url))
36
13
  runShimMain(adapter);
37
14
  //# sourceMappingURL=grok.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"grok.js","sourceRoot":"","sources":["../../../src/hooks/shims/grok.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlF;;;;;;;;;;;;;;GAcG;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,EAAE,WAAW,EAAE,UAAU,CAAC;YACvC,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,mBAAmB,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,gFAAgF;CACjF,CAAC;AAEF,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,CAAC"}
1
+ {"version":3,"file":"grok.js","sourceRoot":"","sources":["../../../src/hooks/shims/grok.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,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,IAAI,CAAC,CAAC;AAExD,IAAI,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC;IAAE,WAAW,CAAC,OAAO,CAAC,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"]}
@@ -1,22 +1,10 @@
1
1
  import type { ShimAdapter } from '../shim.ts';
2
2
  /**
3
- * Hermes Agent shim — EXPERIMENTAL tier: schema mapped from the capability matrix
4
- * (docs/research/2026-09-02-harness-capability-matrix.md, Hermes Agent row; primary
5
- * source <https://hermes-agent.nousresearch.com/docs/user-guide/features/hooks>),
6
- * not yet smoke-tested against the real binary.
7
- *
8
- * - event: `pre_tool_call`; stdin carries the tool name and its arguments
9
- * (`tool_name` + `args`, with `tool_input` accepted as a fallback spelling).
10
- * - deny: `{ "action": "block", "reason": … }`.
11
- * - rewrite: `{ "action": "modify", "args": { … } }` — a **shallow merge** into the
12
- * tool's arguments, so this shim sends only the `command` key and the harness
13
- * keeps the rest. The modify schema has **no reason field**, so the substitution
14
- * is announced on stderr — a rewrite must never be silent.
15
- *
16
- * Carried caveat from the matrix: Hermes has a known bypass where memory tools
17
- * ignore `disabled_toolsets` (<https://github.com/NousResearch/hermes-agent/issues/46171>) —
18
- * tool gating there is leaky at the edges, so treat this hook as best-effort
19
- * steering, not a boundary.
3
+ * Hermes Agent 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/hermes.ts`), and `shimFromSchema` turns that schema into the
6
+ * adapter below. The installer wires `node dist/hooks/shims/hermes.js` as the
7
+ * harness's hook command; this file is what that runs.
20
8
  */
21
9
  export declare const adapter: ShimAdapter;
22
10
  //# sourceMappingURL=hermes.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/hermes.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,OAAO,EAAE,WA2BrB,CAAC"}
1
+ {"version":3,"file":"hermes.d.ts","sourceRoot":"","sources":["../../../src/hooks/shims/hermes.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,EAAE,WAAmC,CAAC","sourcesContent":["import { hermes } from '../../harness/hermes.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Hermes Agent 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/hermes.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/hermes.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(hermes);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}
@@ -1,50 +1,14 @@
1
- import { asRecord, isMainModule, runShimMain, toolCallRequest } from '../shim.js';
1
+ import { hermes } from '../../harness/hermes.js';
2
+ import { shimAdapterOf } from '../../harness/profile.js';
3
+ import { isMainModule, runShimMain } from '../shim.js';
2
4
  /**
3
- * Hermes Agent shim — EXPERIMENTAL tier: schema mapped from the capability matrix
4
- * (docs/research/2026-09-02-harness-capability-matrix.md, Hermes Agent row; primary
5
- * source <https://hermes-agent.nousresearch.com/docs/user-guide/features/hooks>),
6
- * not yet smoke-tested against the real binary.
7
- *
8
- * - event: `pre_tool_call`; stdin carries the tool name and its arguments
9
- * (`tool_name` + `args`, with `tool_input` accepted as a fallback spelling).
10
- * - deny: `{ "action": "block", "reason": … }`.
11
- * - rewrite: `{ "action": "modify", "args": { … } }` — a **shallow merge** into the
12
- * tool's arguments, so this shim sends only the `command` key and the harness
13
- * keeps the rest. The modify schema has **no reason field**, so the substitution
14
- * is announced on stderr — a rewrite must never be silent.
15
- *
16
- * Carried caveat from the matrix: Hermes has a known bypass where memory tools
17
- * ignore `disabled_toolsets` (<https://github.com/NousResearch/hermes-agent/issues/46171>) —
18
- * tool gating there is leaky at the edges, so treat this hook as best-effort
19
- * steering, not a boundary.
5
+ * Hermes Agent 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/hermes.ts`), and `shimFromSchema` turns that schema into the
8
+ * adapter below. The installer wires `node dist/hooks/shims/hermes.js` as the
9
+ * harness's hook command; this file is what that runs.
20
10
  */
21
- export const adapter = {
22
- toRequest: (raw) => {
23
- const fields = asRecord(raw);
24
- return toolCallRequest(fields['tool_name'], fields['args'] ?? fields['tool_input'], {
25
- read: ['read_file', 'Read', 'ReadFile'],
26
- bash: ['execute_command', 'terminal', 'bash', 'Bash', 'shell'],
27
- });
28
- },
29
- pass: () => ({ stdout: '', exitCode: 0 }),
30
- deny: (_raw, _request, decision) => ({
31
- stdout: `${JSON.stringify({
32
- action: 'block',
33
- reason: decision.reason ?? 'denied by the smelt guard',
34
- })}\n`,
35
- exitCode: 0,
36
- }),
37
- rewrite: (_raw, _request, decision) => ({
38
- stdout: `${JSON.stringify({
39
- action: 'modify',
40
- args: { command: decision.suggestion },
41
- })}\n`,
42
- // Hermes's modify action carries no reason field — announce on stderr instead.
43
- stderr: `smelt guard (rewrite mode): substituted the command in-flight with ` +
44
- `\`${decision.suggestion ?? ''}\`. ${decision.reason ?? ''}\n`,
45
- exitCode: 0,
46
- }),
47
- };
11
+ export const adapter = shimAdapterOf(hermes);
48
12
  if (isMainModule(import.meta.url))
49
13
  runShimMain(adapter);
50
14
  //# sourceMappingURL=hermes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hermes.js","sourceRoot":"","sources":["../../../src/hooks/shims/hermes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAGlF;;;;;;;;;;;;;;;;;;GAkBG;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,MAAM,CAAC,IAAI,MAAM,CAAC,YAAY,CAAC,EAAE;YAClF,IAAI,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC;YACvC,IAAI,EAAE,CAAC,iBAAiB,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;SAC/D,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,OAAO;YACf,MAAM,EAAE,QAAQ,CAAC,MAAM,IAAI,2BAA2B;SACvD,CAAC,IAAI;QACN,QAAQ,EAAE,CAAC;KACZ,CAAC;IACF,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAC;QACtC,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC;YACxB,MAAM,EAAE,QAAQ;YAChB,IAAI,EAAE,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE;SACvC,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":"hermes.js","sourceRoot":"","sources":["../../../src/hooks/shims/hermes.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 { hermes } from '../../harness/hermes.ts';\nimport { shimAdapterOf } from '../../harness/profile.ts';\nimport { isMainModule, runShimMain } from '../shim.ts';\nimport type { ShimAdapter } from '../shim.ts';\n\n/**\n * Hermes Agent 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/hermes.ts`), and `shimFromSchema` turns that schema into the\n * adapter below. The installer wires `node dist/hooks/shims/hermes.js` as the\n * harness's hook command; this file is what that runs.\n */\nexport const adapter: ShimAdapter = shimAdapterOf(hermes);\n\nif (isMainModule(import.meta.url)) runShimMain(adapter);\n"]}