@ironbee-ai/cli 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (100) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +159 -0
  4. package/dist/assets/banner.txt +6 -0
  5. package/dist/assets/icon.svg +59 -0
  6. package/dist/clients/base.d.ts +20 -0
  7. package/dist/clients/base.d.ts.map +1 -0
  8. package/dist/clients/base.js +3 -0
  9. package/dist/clients/base.js.map +1 -0
  10. package/dist/clients/claude/hooks/clear-verdict.d.ts +11 -0
  11. package/dist/clients/claude/hooks/clear-verdict.d.ts.map +1 -0
  12. package/dist/clients/claude/hooks/clear-verdict.js +58 -0
  13. package/dist/clients/claude/hooks/clear-verdict.js.map +1 -0
  14. package/dist/clients/claude/hooks/session-start.d.ts +9 -0
  15. package/dist/clients/claude/hooks/session-start.d.ts.map +1 -0
  16. package/dist/clients/claude/hooks/session-start.js +72 -0
  17. package/dist/clients/claude/hooks/session-start.js.map +1 -0
  18. package/dist/clients/claude/hooks/track-action.d.ts +11 -0
  19. package/dist/clients/claude/hooks/track-action.d.ts.map +1 -0
  20. package/dist/clients/claude/hooks/track-action.js +73 -0
  21. package/dist/clients/claude/hooks/track-action.js.map +1 -0
  22. package/dist/clients/claude/hooks/verify-gate.d.ts +11 -0
  23. package/dist/clients/claude/hooks/verify-gate.d.ts.map +1 -0
  24. package/dist/clients/claude/hooks/verify-gate.js +48 -0
  25. package/dist/clients/claude/hooks/verify-gate.js.map +1 -0
  26. package/dist/clients/claude/index.d.ts +22 -0
  27. package/dist/clients/claude/index.d.ts.map +1 -0
  28. package/dist/clients/claude/index.js +270 -0
  29. package/dist/clients/claude/index.js.map +1 -0
  30. package/dist/clients/claude/rule.md +35 -0
  31. package/dist/clients/claude/skill.md +63 -0
  32. package/dist/clients/registry.d.ts +6 -0
  33. package/dist/clients/registry.d.ts.map +1 -0
  34. package/dist/clients/registry.js +20 -0
  35. package/dist/clients/registry.js.map +1 -0
  36. package/dist/commands/hook.d.ts +3 -0
  37. package/dist/commands/hook.d.ts.map +1 -0
  38. package/dist/commands/hook.js +57 -0
  39. package/dist/commands/hook.js.map +1 -0
  40. package/dist/commands/install.d.ts +3 -0
  41. package/dist/commands/install.d.ts.map +1 -0
  42. package/dist/commands/install.js +69 -0
  43. package/dist/commands/install.js.map +1 -0
  44. package/dist/commands/status.d.ts +3 -0
  45. package/dist/commands/status.d.ts.map +1 -0
  46. package/dist/commands/status.js +71 -0
  47. package/dist/commands/status.js.map +1 -0
  48. package/dist/commands/uninstall.d.ts +3 -0
  49. package/dist/commands/uninstall.d.ts.map +1 -0
  50. package/dist/commands/uninstall.js +54 -0
  51. package/dist/commands/uninstall.js.map +1 -0
  52. package/dist/commands/update.d.ts +3 -0
  53. package/dist/commands/update.d.ts.map +1 -0
  54. package/dist/commands/update.js +38 -0
  55. package/dist/commands/update.js.map +1 -0
  56. package/dist/commands/verify.d.ts +3 -0
  57. package/dist/commands/verify.d.ts.map +1 -0
  58. package/dist/commands/verify.js +150 -0
  59. package/dist/commands/verify.js.map +1 -0
  60. package/dist/hooks/core/actions.d.ts +35 -0
  61. package/dist/hooks/core/actions.d.ts.map +1 -0
  62. package/dist/hooks/core/actions.js +61 -0
  63. package/dist/hooks/core/actions.js.map +1 -0
  64. package/dist/hooks/core/clear-verdict.d.ts +12 -0
  65. package/dist/hooks/core/clear-verdict.d.ts.map +1 -0
  66. package/dist/hooks/core/clear-verdict.js +25 -0
  67. package/dist/hooks/core/clear-verdict.js.map +1 -0
  68. package/dist/hooks/core/verify-gate.d.ts +20 -0
  69. package/dist/hooks/core/verify-gate.d.ts.map +1 -0
  70. package/dist/hooks/core/verify-gate.js +222 -0
  71. package/dist/hooks/core/verify-gate.js.map +1 -0
  72. package/dist/index.d.ts +3 -0
  73. package/dist/index.d.ts.map +1 -0
  74. package/dist/index.js +56 -0
  75. package/dist/index.js.map +1 -0
  76. package/dist/lib/config.d.ts +44 -0
  77. package/dist/lib/config.d.ts.map +1 -0
  78. package/dist/lib/config.js +135 -0
  79. package/dist/lib/config.js.map +1 -0
  80. package/dist/lib/icon.d.ts +2 -0
  81. package/dist/lib/icon.d.ts.map +1 -0
  82. package/dist/lib/icon.js +14 -0
  83. package/dist/lib/icon.js.map +1 -0
  84. package/dist/lib/logger.d.ts +7 -0
  85. package/dist/lib/logger.d.ts.map +1 -0
  86. package/dist/lib/logger.js +70 -0
  87. package/dist/lib/logger.js.map +1 -0
  88. package/dist/lib/output.d.ts +21 -0
  89. package/dist/lib/output.d.ts.map +1 -0
  90. package/dist/lib/output.js +45 -0
  91. package/dist/lib/output.js.map +1 -0
  92. package/dist/lib/stdin.d.ts +6 -0
  93. package/dist/lib/stdin.d.ts.map +1 -0
  94. package/dist/lib/stdin.js +18 -0
  95. package/dist/lib/stdin.js.map +1 -0
  96. package/dist/lib/version.d.ts +10 -0
  97. package/dist/lib/version.d.ts.map +1 -0
  98. package/dist/lib/version.js +81 -0
  99. package/dist/lib/version.js.map +1 -0
  100. package/package.json +72 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 (2026-03-14)
4
+
5
+ All notable changes to this project will be documented in this file.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 IronBee
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,159 @@
1
+ <h1 align="center">
2
+ <img src="assets/icon.svg" alt="IronBee" width="128" /><br />
3
+ IronBee CLI
4
+ </h1>
5
+
6
+ <p align="center">
7
+ <strong>The CLI for <a href="https://ironbee.ai">IronBee</a> — The Verification Layer for Agentic Development</strong>
8
+ </p>
9
+
10
+ <p align="center">
11
+ <a href="https://www.npmjs.com/package/@ironbee-ai/cli"><img src="https://img.shields.io/npm/v/@ironbee-ai/cli.svg" alt="npm version" /></a>
12
+ <a href="https://www.npmjs.com/package/@ironbee-ai/cli"><img src="https://img.shields.io/npm/dm/@ironbee-ai/cli.svg" alt="npm downloads" /></a>
13
+ <a href="https://github.com/ironbee-ai/ironbee-cli/blob/main/LICENSE"><img src="https://img.shields.io/npm/l/@ironbee-ai/cli.svg" alt="license" /></a>
14
+ <a href="https://github.com/ironbee-ai/ironbee-cli/actions"><img src="https://img.shields.io/github/actions/workflow/status/ironbee-ai/@ironbee-ai/cli/build.yml?branch=main" alt="CI" /></a>
15
+ </p>
16
+
17
+ ---
18
+
19
+ [IronBee](https://ironbee.ai) ensures that AI agents verify their code changes before completing a task. When an agent edits code, it cannot finish until it navigates to the affected pages, functionally tests the changes, and writes a passing verdict.
20
+
21
+ No more "it should work" — every change is tested.
22
+
23
+ Powered by [browser-devtools-mcp](https://browser-devtools.com) — the agent navigates pages, clicks buttons, fills forms, takes screenshots, checks console errors, and writes a structured verdict.
24
+
25
+ ## Supported Clients
26
+
27
+ | Client | Status |
28
+ |--------|--------|
29
+ | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | Supported |
30
+ | Cursor | Planned |
31
+ | Codex | Planned |
32
+ | OpenCode | Planned |
33
+
34
+ ## Quick Start
35
+
36
+ ### Install IronBee globally
37
+
38
+ ```bash
39
+ npm install -g @ironbee-ai/cli
40
+ ```
41
+
42
+ ### Set up a project
43
+
44
+ ```bash
45
+ cd your-project
46
+ ironbee install
47
+ ```
48
+
49
+ This auto-detects your AI client and writes:
50
+ - Hook configuration (so the client calls IronBee automatically)
51
+ - Verification skill/rules (so the agent knows the workflow)
52
+ - MCP server config (so the agent has browser access)
53
+ - Browser-devtools permissions
54
+
55
+ ### That's it
56
+
57
+ The next time your AI agent edits code, IronBee will require browser verification before the task can complete.
58
+
59
+ ## Commands
60
+
61
+ ```
62
+ ironbee install [project-dir] [--client <name>] Set up hooks and config
63
+ ironbee uninstall [project-dir] [--client <name>] Remove hooks and config
64
+ ironbee status [project-dir] Show verdict status for active sessions
65
+ ironbee verify [session-id] Dry-run verdict validation
66
+ ```
67
+
68
+ ## Configuration
69
+
70
+ IronBee loads config from two locations (project overrides global):
71
+
72
+ - **Global:** `~/.ironbee/config.json`
73
+ - **Project:** `<project>/.ironbee/config.json`
74
+
75
+ ```json
76
+ {
77
+ "verifyPatterns": ["*.ts", "*.tsx", "*.css"],
78
+ "additionalVerifyPatterns": ["*.mdx"],
79
+ "ignoredVerifyPatterns": ["*.test.ts", "*.spec.ts"],
80
+ "maxRetries": 5
81
+ }
82
+ ```
83
+
84
+ | Key | Description | Default |
85
+ |-----|-------------|---------|
86
+ | `verifyPatterns` | Glob patterns for files that require verification (replaces defaults) | 40+ code extensions |
87
+ | `additionalVerifyPatterns` | Extra patterns added on top of defaults | `[]` |
88
+ | `ignoredVerifyPatterns` | Patterns to exclude from verification (checked first) | `[]` |
89
+ | `maxRetries` | Max retry attempts before allowing completion | `3` |
90
+
91
+ ### Default verify patterns
92
+
93
+ By default, IronBee requires verification for common code file extensions: `.ts`, `.tsx`, `.js`, `.jsx`, `.css`, `.scss`, `.html`, `.py`, `.go`, `.rs`, `.java`, `.vue`, `.svelte`, and [many more](src/lib/config.ts).
94
+
95
+ Non-code files like `README.md`, `package.json`, or `.gitignore` do not trigger verification.
96
+
97
+ ## Verification Flow
98
+
99
+ When the agent tries to complete a task, IronBee runs these checks:
100
+
101
+ 1. **Were code files edited?** — If no matching files were changed, the agent completes normally.
102
+ 2. **Were browser tools used?** — The agent must have called: navigate, screenshot, accessibility snapshot, and console check.
103
+ 3. **Does a verdict file exist?** — The agent must write a JSON verdict after testing.
104
+ 4. **Is the verdict valid?** — Must include `status`, `pages_tested`, `checks`, `console_errors`, and `network_failures`.
105
+ 5. **Pass or fail?** — Pass allows completion. Fail blocks the agent and asks it to fix the issues and re-verify.
106
+ 6. **Retry limit** — After `maxRetries` failed attempts (default 3), the agent is allowed to complete but must report unresolved issues.
107
+
108
+ ### Verdict format
109
+
110
+ ```json
111
+ {
112
+ "status": "pass",
113
+ "pages_tested": ["http://localhost:3000/dashboard"],
114
+ "checks": ["form submits successfully", "new item appears in list"],
115
+ "console_errors": 0,
116
+ "network_failures": 0
117
+ }
118
+ ```
119
+
120
+ On failure, include an `errors` array describing what went wrong:
121
+
122
+ ```json
123
+ {
124
+ "status": "fail",
125
+ "pages_tested": ["http://localhost:3000/dashboard"],
126
+ "checks": ["form renders", "submit button unresponsive"],
127
+ "console_errors": 2,
128
+ "network_failures": 0,
129
+ "errors": ["button click handler not firing", "TypeError in console"]
130
+ }
131
+ ```
132
+
133
+ ## Session Isolation
134
+
135
+ Each AI session gets its own directory under `.ironbee/sessions/<session-id>/`:
136
+
137
+ ```
138
+ .ironbee/sessions/<session-id>/
139
+ actions.jsonl # Event log (file edits, tool calls, verification markers)
140
+ verdict.json # Written by agent after verification
141
+ retries # Retry counter
142
+ session.log # Debug log
143
+ ```
144
+
145
+ This means parallel sessions (e.g., multiple Claude Code instances) don't interfere with each other.
146
+
147
+ ## Development
148
+
149
+ ```bash
150
+ npm install
151
+ npm run build # Compile TypeScript
152
+ npm run lint # ESLint
153
+ npm run test # Jest (unit + integration + client tests)
154
+ npm run dev # Run via ts-node
155
+ ```
156
+
157
+ ## License
158
+
159
+ MIT
@@ -0,0 +1,6 @@
1
+  ██╗ ██████╗   ██████╗  ███╗   ██╗ ██████╗  ███████╗ ███████╗
2
+  ██║ ██╔══██╗ ██╔═══██╗ ████╗  ██║ ██╔══██╗ ██╔════╝ ██╔════╝
3
+  ██║ ██████╔╝ ██║   ██║ ██╔██╗ ██║ ██████╔╝ █████╗   █████╗  
4
+  ██║ ██╔══██╗ ██║   ██║ ██║╚██╗██║ ██╔══██╗ ██╔══╝   ██╔══╝  
5
+  ██║ ██║  ██║ ╚██████╔╝ ██║ ╚████║ ██████╔╝ ███████╗ ███████╗
6
+  ╚═╝ ╚═╝  ╚═╝  ╚═════╝  ╚═╝  ╚═══╝ ╚═════╝  ╚══════╝ ╚══════╝
@@ -0,0 +1,59 @@
1
+ <svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path d="M217.557 138.711C211.185 166.725 218.839 188.038 224.039 201.771L249.307 154.531L275.674 201.771C285.561 179.579 286.328 161.013 281.167 135.964C277.431 117.837 259.744 95.3889 249.307 84C241.91 92.6058 222.355 117.618 217.557 138.711Z" fill="url(#paint0_linear_103_132)"/>
3
+ <path d="M249.527 416C223.951 394.731 206.425 358.067 202.396 343.052L249.527 381.394L272.378 362.937L295.559 343.052C290.988 371.089 262.417 403.805 249.527 416Z" fill="url(#paint1_linear_103_132)"/>
4
+ <path d="M220.854 231.434L250.077 171.12L279.629 231.434L250.077 256.153L220.854 231.434Z" fill="url(#paint2_linear_103_132)"/>
5
+ <path d="M298.525 286.804C302.568 301.218 299.258 322.399 297.097 331.188L273.587 350.303L249.857 369.749L225.907 349.754L202.397 331.188C197.387 320.465 200.31 297.131 202.397 286.804L249.857 324.486L298.525 286.804Z" fill="url(#paint3_linear_103_132)"/>
6
+ <path d="M249.856 313.609L203.495 275.268C203.495 263.315 211.552 247.29 215.58 240.771L249.856 267.028L284.573 240.771C291.955 248.066 296.071 266.809 297.207 275.268L249.856 313.609Z" fill="url(#paint4_linear_103_132)"/>
7
+ <path d="M215.909 165.298C215.36 179.579 220.853 193.752 224.039 201.771L236.563 178.481L249.307 154.531L275.674 201.881C280.947 190.785 284.902 174.526 284.133 167.275C281.277 147.061 274.136 138.052 264.138 125.638C255.679 132.01 244.847 132.141 235.355 125.638C223.38 137.613 216.568 156.289 215.909 165.298Z" fill="url(#paint5_linear_103_132)" fill-opacity="0.7"/>
8
+ <path d="M249.856 347.996L202.396 286.804L249.856 324.486L298.525 286.804L249.856 347.996Z" fill="#333941" fill-opacity="0.64"/>
9
+ <path d="M249.527 292.296L215.58 240.771L249.857 267.028L284.573 240.771L249.527 292.296Z" fill="#333941" fill-opacity="0.35"/>
10
+ <path d="M249.419 404.685L202.396 343.053L249.419 381.614L295.559 343.053L249.419 404.685Z" fill="#0F0F0F" fill-opacity="0.1"/>
11
+ <path d="M285.482 209.139C297.06 183.136 300.205 166.929 294.24 132.4L346.304 224.989L319.38 218.541L350.314 284.253C319.826 267.918 305.852 251.479 285.482 209.139Z" fill="url(#paint6_linear_103_132)"/>
12
+ <path d="M214.785 209.139C203.206 183.136 200.062 166.929 206.027 132.4L153.963 224.989L180.887 218.541L149.953 284.253C180.44 267.918 194.414 251.479 214.785 209.139Z" fill="url(#paint7_linear_103_132)"/>
13
+ <path d="M458.055 281.287L306.25 134.086L375.851 242.958L344.516 235.599L359.745 289.281C390.46 298.849 431.254 294.285 458.055 281.287Z" fill="url(#paint8_linear_103_132)"/>
14
+ <path d="M42.2112 281.287L194.017 134.086L124.415 242.958L155.75 235.599L140.521 289.281C109.807 298.849 69.0124 294.285 42.2112 281.287Z" fill="url(#paint9_linear_103_132)"/>
15
+ <path d="M155.707 235.608C120.279 262.873 94.8569 272.188 42.5488 281.311C69.9036 294.823 110.553 298.339 140.546 289.221L155.707 235.608Z" fill="black" fill-opacity="0.16"/>
16
+ <path d="M344.558 235.608C380.054 262.765 405.526 272.042 457.935 281.129C430.527 294.588 389.799 298.089 359.748 289.007L344.558 235.608Z" fill="black" fill-opacity="0.16"/>
17
+ <defs>
18
+ <linearGradient id="paint0_linear_103_132" x1="248.978" y1="84" x2="248.978" y2="416" gradientUnits="userSpaceOnUse">
19
+ <stop stop-color="#E5E5E5"/>
20
+ <stop offset="1" stop-color="#272F39"/>
21
+ </linearGradient>
22
+ <linearGradient id="paint1_linear_103_132" x1="248.978" y1="84" x2="248.978" y2="416" gradientUnits="userSpaceOnUse">
23
+ <stop stop-color="#E5E5E5"/>
24
+ <stop offset="1" stop-color="#272F39"/>
25
+ </linearGradient>
26
+ <linearGradient id="paint2_linear_103_132" x1="250.032" y1="171.12" x2="250.032" y2="369.749" gradientUnits="userSpaceOnUse">
27
+ <stop stop-color="#D9D9D9"/>
28
+ <stop offset="1" stop-color="#272F39"/>
29
+ </linearGradient>
30
+ <linearGradient id="paint3_linear_103_132" x1="250.032" y1="171.12" x2="250.032" y2="369.749" gradientUnits="userSpaceOnUse">
31
+ <stop stop-color="#D9D9D9"/>
32
+ <stop offset="1" stop-color="#272F39"/>
33
+ </linearGradient>
34
+ <linearGradient id="paint4_linear_103_132" x1="250.351" y1="240.771" x2="250.351" y2="313.609" gradientUnits="userSpaceOnUse">
35
+ <stop stop-color="#D9D9D9"/>
36
+ <stop offset="1" stop-color="#272F39"/>
37
+ </linearGradient>
38
+ <linearGradient id="paint5_linear_103_132" x1="250.05" y1="125.638" x2="250.05" y2="201.881" gradientUnits="userSpaceOnUse">
39
+ <stop stop-color="#B1B1B2"/>
40
+ <stop offset="1" stop-color="#343B43"/>
41
+ </linearGradient>
42
+ <linearGradient id="paint6_linear_103_132" x1="315.879" y1="132.019" x2="318.569" y2="284.812" gradientUnits="userSpaceOnUse">
43
+ <stop stop-color="#D9D9D9"/>
44
+ <stop offset="1" stop-color="#454B54"/>
45
+ </linearGradient>
46
+ <linearGradient id="paint7_linear_103_132" x1="184.387" y1="132.019" x2="181.698" y2="284.812" gradientUnits="userSpaceOnUse">
47
+ <stop stop-color="#D9D9D9"/>
48
+ <stop offset="1" stop-color="#454B54"/>
49
+ </linearGradient>
50
+ <linearGradient id="paint8_linear_103_132" x1="380.834" y1="132.773" x2="383.683" y2="294.632" gradientUnits="userSpaceOnUse">
51
+ <stop stop-color="#D9D9D9"/>
52
+ <stop offset="1" stop-color="#4A5159"/>
53
+ </linearGradient>
54
+ <linearGradient id="paint9_linear_103_132" x1="119.433" y1="132.773" x2="116.583" y2="294.632" gradientUnits="userSpaceOnUse">
55
+ <stop stop-color="#D9D9D9"/>
56
+ <stop offset="1" stop-color="#4A5159"/>
57
+ </linearGradient>
58
+ </defs>
59
+ </svg>
@@ -0,0 +1,20 @@
1
+ export interface IClient {
2
+ readonly name: string;
3
+ /** Returns true if this client is detected in the project directory. */
4
+ detect(projectDir: string): boolean;
5
+ /** Installs hooks and guidance files into the project directory. */
6
+ install(projectDir: string, ironbeePath: string): void;
7
+ /** Removes IronBee hooks and guidance files from the project directory. */
8
+ uninstall(projectDir: string): void;
9
+ /** Resolves the project directory from client-specific env vars, falling back to cwd. */
10
+ resolveProjectDir(): string;
11
+ /** Runs the verify-gate Stop hook for this client. */
12
+ runVerifyGate(projectDir: string): void;
13
+ /** Runs the clear-verdict PostToolUse hook for this client. */
14
+ runClearVerdict(projectDir: string): void;
15
+ /** Runs the track-action PostToolUse hook for this client. */
16
+ runTrackAction(projectDir: string): void;
17
+ /** Runs the session-start hook for this client. */
18
+ runSessionStart(projectDir: string): void;
19
+ }
20
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/clients/base.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,wEAAwE;IACxE,MAAM,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IAEpC,oEAAoE;IACpE,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvD,2EAA2E;IAC3E,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAEpC,yFAAyF;IACzF,iBAAiB,IAAI,MAAM,CAAC;IAE5B,sDAAsD;IACtD,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAExC,+DAA+D;IAC/D,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAE1C,8DAA8D;IAC9D,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC,mDAAmD;IACnD,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/clients/base.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Claude Code — clear-verdict hook adapter
3
+ *
4
+ * Reads Claude Code's stdin format, extracts session_id,
5
+ * then delegates to the shared core logic.
6
+ *
7
+ * Only records file_edit and clears verdict for files with
8
+ * extensions in the verifyExtensions whitelist.
9
+ */
10
+ export declare function run(projectDir: string): void;
11
+ //# sourceMappingURL=clear-verdict.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clear-verdict.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/clear-verdict.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAgBH,wBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CA2C5C"}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ /**
3
+ * Claude Code — clear-verdict hook adapter
4
+ *
5
+ * Reads Claude Code's stdin format, extracts session_id,
6
+ * then delegates to the shared core logic.
7
+ *
8
+ * Only records file_edit and clears verdict for files with
9
+ * extensions in the verifyExtensions whitelist.
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.run = run;
13
+ const clear_verdict_1 = require("../../../hooks/core/clear-verdict");
14
+ const actions_1 = require("../../../hooks/core/actions");
15
+ const config_1 = require("../../../lib/config");
16
+ const logger_1 = require("../../../lib/logger");
17
+ const stdin_1 = require("../../../lib/stdin");
18
+ function run(projectDir) {
19
+ let sessionId = "default";
20
+ let input;
21
+ try {
22
+ input = JSON.parse((0, stdin_1.readStdin)());
23
+ sessionId = input.session_id ?? "default";
24
+ (0, logger_1.setLogFile)(`${projectDir}/.ironbee/sessions/${sessionId}/session.log`);
25
+ }
26
+ catch (e) {
27
+ logger_1.logger.debug(`failed to parse stdin: ${e}`);
28
+ process.exit(0);
29
+ }
30
+ // skip clear if the write target is the verdict file itself
31
+ const writtenFile = input.tool_input?.file_path;
32
+ if (writtenFile && writtenFile.includes(".ironbee/sessions/") && writtenFile.endsWith("verdict.json")) {
33
+ logger_1.logger.debug(`skipping clear-verdict: write target is verdict file ${writtenFile}`);
34
+ process.exit(0);
35
+ }
36
+ // skip if file does not require verification
37
+ if (writtenFile) {
38
+ const config = (0, config_1.loadConfig)(projectDir);
39
+ if (!(0, config_1.requiresVerification)(writtenFile, config)) {
40
+ logger_1.logger.debug(`skipping clear-verdict: file does not require verification (${writtenFile})`);
41
+ process.exit(0);
42
+ }
43
+ }
44
+ // record file edit in actions.jsonl
45
+ const fileEditEntry = {
46
+ type: "file_edit",
47
+ timestamp: new Date().toISOString(),
48
+ tool_name: input.tool_name ?? "unknown",
49
+ file_path: writtenFile,
50
+ };
51
+ (0, actions_1.appendAction)(`${projectDir}/.ironbee/sessions/${sessionId}/actions.jsonl`, fileEditEntry);
52
+ (0, clear_verdict_1.runClearVerdict)({
53
+ verdictFile: `${projectDir}/.ironbee/sessions/${sessionId}/verdict.json`,
54
+ retryFile: `${projectDir}/.ironbee/sessions/${sessionId}/retries`,
55
+ });
56
+ process.exit(0);
57
+ }
58
+ //# sourceMappingURL=clear-verdict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clear-verdict.js","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/clear-verdict.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAgBH,kBA2CC;AAzDD,qEAAoE;AACpE,yDAA2E;AAC3E,gDAAsF;AACtF,gDAAyD;AACzD,8CAA+C;AAU/C,SAAgB,GAAG,CAAC,UAAkB;IAClC,IAAI,SAAS,GAAW,SAAS,CAAC;IAClC,IAAI,KAA6B,CAAC;IAClC,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAS,GAAE,CAA2B,CAAC;QAC1D,SAAS,GAAG,KAAK,CAAC,UAAU,IAAI,SAAS,CAAC;QAC1C,IAAA,mBAAU,EAAC,GAAG,UAAU,sBAAsB,SAAS,cAAc,CAAC,CAAC;IAC3E,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QAClB,eAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,4DAA4D;IAC5D,MAAM,WAAW,GAAuB,KAAK,CAAC,UAAU,EAAE,SAAS,CAAC;IACpE,IAAI,WAAW,IAAI,WAAW,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,WAAW,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;QACpG,eAAM,CAAC,KAAK,CAAC,wDAAwD,WAAW,EAAE,CAAC,CAAC;QACpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,6CAA6C;IAC7C,IAAI,WAAW,EAAE,CAAC;QACd,MAAM,MAAM,GAAkB,IAAA,mBAAU,EAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,IAAA,6BAAoB,EAAC,WAAW,EAAE,MAAM,CAAC,EAAE,CAAC;YAC7C,eAAM,CAAC,KAAK,CAAC,+DAA+D,WAAW,GAAG,CAAC,CAAC;YAC5F,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACpB,CAAC;IACL,CAAC;IAED,oCAAoC;IACpC,MAAM,aAAa,GAAmB;QAClC,IAAI,EAAE,WAAW;QACjB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,SAAS,EAAE,KAAK,CAAC,SAAS,IAAI,SAAS;QACvC,SAAS,EAAE,WAAW;KACzB,CAAC;IACF,IAAA,sBAAY,EAAC,GAAG,UAAU,sBAAsB,SAAS,gBAAgB,EAAE,aAAa,CAAC,CAAC;IAE1F,IAAA,+BAAe,EAAC;QACZ,WAAW,EAAE,GAAG,UAAU,sBAAsB,SAAS,eAAe;QACxE,SAAS,EAAE,GAAG,UAAU,sBAAsB,SAAS,UAAU;KACpE,CAAC,CAAC;IAEH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Claude Code — session-start hook adapter
3
+ *
4
+ * SessionStart hook — appends a session_start entry to actions.jsonl
5
+ * and outputs the session verdict path to stdout so Claude knows
6
+ * where to write the verdict without waiting for the Stop hook.
7
+ */
8
+ export declare function run(projectDir: string): void;
9
+ //# sourceMappingURL=session-start.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-start.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/session-start.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,wBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CA8D5C"}
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ /**
3
+ * Claude Code — session-start hook adapter
4
+ *
5
+ * SessionStart hook — appends a session_start entry to actions.jsonl
6
+ * and outputs the session verdict path to stdout so Claude knows
7
+ * where to write the verdict without waiting for the Stop hook.
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.run = run;
11
+ const actions_1 = require("../../../hooks/core/actions");
12
+ const logger_1 = require("../../../lib/logger");
13
+ const stdin_1 = require("../../../lib/stdin");
14
+ function run(projectDir) {
15
+ let input;
16
+ try {
17
+ input = JSON.parse((0, stdin_1.readStdin)());
18
+ }
19
+ catch (e) {
20
+ logger_1.logger.debug(`failed to parse stdin: ${e}`);
21
+ process.exit(0);
22
+ }
23
+ const sessionId = input.session_id ?? "default";
24
+ const actionsFile = `${projectDir}/.ironbee/sessions/${sessionId}/actions.jsonl`;
25
+ (0, logger_1.setLogFile)(`${projectDir}/.ironbee/sessions/${sessionId}/session.log`);
26
+ const entry = {
27
+ type: "session_start",
28
+ timestamp: new Date().toISOString(),
29
+ session_id: sessionId,
30
+ source: input.source,
31
+ };
32
+ (0, actions_1.appendAction)(actionsFile, entry);
33
+ logger_1.logger.debug(`session-start: ${sessionId} (${input.source ?? "unknown"})`);
34
+ // output verdict path + format to stdout — Claude receives this as context
35
+ const verdictPath = `.ironbee/sessions/${sessionId}/verdict.json`;
36
+ const verdictFormatPass = JSON.stringify({
37
+ status: "pass",
38
+ pages_tested: ["http://localhost:3000/affected-page"],
39
+ checks: ["form submits successfully", "new item appears in list", "no console errors"],
40
+ console_errors: 0,
41
+ network_failures: 0,
42
+ });
43
+ const verdictFormatFail = JSON.stringify({
44
+ status: "fail",
45
+ pages_tested: ["http://localhost:3000/affected-page"],
46
+ checks: ["form renders", "submit button unresponsive"],
47
+ console_errors: 2,
48
+ network_failures: 0,
49
+ errors: ["button click handler not firing", "TypeError in console"],
50
+ });
51
+ process.stdout.write(`
52
+ =====================================
53
+ IRONBEE VERIFICATION — SESSION ACTIVE
54
+ =====================================
55
+ Verdict file path: ${verdictPath}
56
+
57
+ After browser verification, use the Write tool to write your verdict JSON to exactly this path:
58
+ ${verdictPath}
59
+
60
+ Verdict format:
61
+ On pass: ${verdictFormatPass}
62
+ On fail: ${verdictFormatFail}
63
+
64
+ Required fields: status, pages_tested, checks, console_errors, network_failures
65
+ On fail, include: errors (array of issue descriptions)
66
+
67
+ Do NOT guess or change this path. This is your session-specific verdict file.
68
+ =====================================
69
+ `);
70
+ process.exit(0);
71
+ }
72
+ //# sourceMappingURL=session-start.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-start.js","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/session-start.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAWH,kBA8DC;AAvED,yDAA+E;AAC/E,gDAAyD;AACzD,8CAA+C;AAO/C,SAAgB,GAAG,CAAC,UAAkB;IAClC,IAAI,KAA8B,CAAC;IACnC,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAS,GAAE,CAA4B,CAAC;IAC/D,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QAClB,eAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,MAAM,SAAS,GAAW,KAAK,CAAC,UAAU,IAAI,SAAS,CAAC;IACxD,MAAM,WAAW,GAAW,GAAG,UAAU,sBAAsB,SAAS,gBAAgB,CAAC;IACzF,IAAA,mBAAU,EAAC,GAAG,UAAU,sBAAsB,SAAS,cAAc,CAAC,CAAC;IAEvE,MAAM,KAAK,GAAuB;QAC9B,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACnC,UAAU,EAAE,SAAS;QACrB,MAAM,EAAE,KAAK,CAAC,MAAM;KACvB,CAAC;IAEF,IAAA,sBAAY,EAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACjC,eAAM,CAAC,KAAK,CAAC,kBAAkB,SAAS,KAAK,KAAK,CAAC,MAAM,IAAI,SAAS,GAAG,CAAC,CAAC;IAE3E,2EAA2E;IAC3E,MAAM,WAAW,GAAW,qBAAqB,SAAS,eAAe,CAAC;IAC1E,MAAM,iBAAiB,GAAW,IAAI,CAAC,SAAS,CAAC;QAC7C,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,CAAC,qCAAqC,CAAC;QACrD,MAAM,EAAE,CAAC,2BAA2B,EAAE,0BAA0B,EAAE,mBAAmB,CAAC;QACtF,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,CAAC;KACtB,CAAC,CAAC;IACH,MAAM,iBAAiB,GAAW,IAAI,CAAC,SAAS,CAAC;QAC7C,MAAM,EAAE,MAAM;QACd,YAAY,EAAE,CAAC,qCAAqC,CAAC;QACrD,MAAM,EAAE,CAAC,cAAc,EAAE,4BAA4B,CAAC;QACtD,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,CAAC;QACnB,MAAM,EAAE,CAAC,iCAAiC,EAAE,sBAAsB,CAAC;KACtE,CAAC,CAAC;IAEH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;;;;qBAIJ,WAAW;;;IAG5B,WAAW;;;aAGF,iBAAiB;aACjB,iBAAiB;;;;;;;CAO7B,CAAC,CAAC;IAEC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Claude Code — track-action hook adapter
3
+ *
4
+ * PostToolUse hook for mcp__browser-devtools__ tool calls.
5
+ * Appends tool_call entries to actions.jsonl for the session.
6
+ *
7
+ * Handles both direct tool calls and nested callTool() invocations
8
+ * inside the execute tool (mcp__browser-devtools__execute).
9
+ */
10
+ export declare function run(projectDir: string): void;
11
+ //# sourceMappingURL=track-action.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"track-action.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/track-action.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmCH,wBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CA0C5C"}
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /**
3
+ * Claude Code — track-action hook adapter
4
+ *
5
+ * PostToolUse hook for mcp__browser-devtools__ tool calls.
6
+ * Appends tool_call entries to actions.jsonl for the session.
7
+ *
8
+ * Handles both direct tool calls and nested callTool() invocations
9
+ * inside the execute tool (mcp__browser-devtools__execute).
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.run = run;
13
+ const actions_1 = require("../../../hooks/core/actions");
14
+ const logger_1 = require("../../../lib/logger");
15
+ const stdin_1 = require("../../../lib/stdin");
16
+ const CALL_TOOL_PATTERN = /callTool\(\s*['"]([^'"]+)['"]/g;
17
+ const MCP_PREFIX = "mcp__browser-devtools__";
18
+ const EXECUTE_TOOL = `${MCP_PREFIX}execute`;
19
+ function toFullName(shortName) {
20
+ return shortName.startsWith(MCP_PREFIX) ? shortName : `${MCP_PREFIX}${shortName}`;
21
+ }
22
+ function extractNestedToolNames(toolInput) {
23
+ const inputStr = typeof toolInput === "string"
24
+ ? toolInput
25
+ : JSON.stringify(toolInput ?? "");
26
+ const names = new Set();
27
+ let match = CALL_TOOL_PATTERN.exec(inputStr);
28
+ while (match !== null) {
29
+ names.add(toFullName(match[1]));
30
+ match = CALL_TOOL_PATTERN.exec(inputStr);
31
+ }
32
+ return [...names];
33
+ }
34
+ function run(projectDir) {
35
+ let input;
36
+ try {
37
+ input = JSON.parse((0, stdin_1.readStdin)());
38
+ }
39
+ catch (e) {
40
+ logger_1.logger.debug(`failed to parse stdin: ${e}`);
41
+ process.exit(0);
42
+ }
43
+ const sessionId = input.session_id ?? "default";
44
+ const actionsFile = `${projectDir}/.ironbee/sessions/${sessionId}/actions.jsonl`;
45
+ (0, logger_1.setLogFile)(`${projectDir}/.ironbee/sessions/${sessionId}/session.log`);
46
+ const toolName = input.tool_name ?? "unknown";
47
+ const timestamp = new Date().toISOString();
48
+ // record the direct tool call
49
+ const entry = {
50
+ type: "tool_call",
51
+ timestamp,
52
+ tool_name: toolName,
53
+ tool_input: input.tool_input,
54
+ tool_response: input.tool_response,
55
+ };
56
+ (0, actions_1.appendAction)(actionsFile, entry);
57
+ logger_1.logger.debug(`track-action: ${toolName}`);
58
+ // for execute tool, extract and record nested callTool() invocations
59
+ if (toolName === EXECUTE_TOOL) {
60
+ const nested = extractNestedToolNames(input.tool_input);
61
+ for (const name of nested) {
62
+ const nestedEntry = {
63
+ type: "tool_call",
64
+ timestamp,
65
+ tool_name: name,
66
+ };
67
+ (0, actions_1.appendAction)(actionsFile, nestedEntry);
68
+ logger_1.logger.debug(`track-action (nested): ${name}`);
69
+ }
70
+ }
71
+ process.exit(0);
72
+ }
73
+ //# sourceMappingURL=track-action.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"track-action.js","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/track-action.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAmCH,kBA0CC;AA3ED,yDAA2E;AAC3E,gDAAyD;AACzD,8CAA+C;AAE/C,MAAM,iBAAiB,GAAW,gCAAgC,CAAC;AACnE,MAAM,UAAU,GAAW,yBAAyB,CAAC;AACrD,MAAM,YAAY,GAAW,GAAG,UAAU,SAAS,CAAC;AASpD,SAAS,UAAU,CAAC,SAAiB;IACjC,OAAO,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,UAAU,GAAG,SAAS,EAAE,CAAC;AACtF,CAAC;AAED,SAAS,sBAAsB,CAAC,SAAkB;IAC9C,MAAM,QAAQ,GAAW,OAAO,SAAS,KAAK,QAAQ;QAClD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC;IAEtC,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAU,CAAC;IAC7C,IAAI,KAAK,GAA2B,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrE,OAAO,KAAK,KAAK,IAAI,EAAE,CAAC;QACpB,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAChC,KAAK,GAAG,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC;AACtB,CAAC;AAED,SAAgB,GAAG,CAAC,UAAkB;IAClC,IAAI,KAA6B,CAAC;IAClC,IAAI,CAAC;QACD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAS,GAAE,CAA2B,CAAC;IAC9D,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QAClB,eAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,EAAE,CAAC,CAAC;QAC5C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IAED,MAAM,SAAS,GAAW,KAAK,CAAC,UAAU,IAAI,SAAS,CAAC;IACxD,MAAM,WAAW,GAAW,GAAG,UAAU,sBAAsB,SAAS,gBAAgB,CAAC;IACzF,IAAA,mBAAU,EAAC,GAAG,UAAU,sBAAsB,SAAS,cAAc,CAAC,CAAC;IAEvE,MAAM,QAAQ,GAAW,KAAK,CAAC,SAAS,IAAI,SAAS,CAAC;IACtD,MAAM,SAAS,GAAW,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAEnD,8BAA8B;IAC9B,MAAM,KAAK,GAAmB;QAC1B,IAAI,EAAE,WAAW;QACjB,SAAS;QACT,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,KAAK,CAAC,UAAU;QAC5B,aAAa,EAAE,KAAK,CAAC,aAAa;KACrC,CAAC;IACF,IAAA,sBAAY,EAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACjC,eAAM,CAAC,KAAK,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC;IAE1C,qEAAqE;IACrE,IAAI,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC5B,MAAM,MAAM,GAAa,sBAAsB,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QAClE,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;YACxB,MAAM,WAAW,GAAmB;gBAChC,IAAI,EAAE,WAAW;gBACjB,SAAS;gBACT,SAAS,EAAE,IAAI;aAClB,CAAC;YACF,IAAA,sBAAY,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YACvC,eAAM,CAAC,KAAK,CAAC,0BAA0B,IAAI,EAAE,CAAC,CAAC;QACnD,CAAC;IACL,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Claude Code — verify-gate hook adapter
3
+ *
4
+ * Reads Claude Code's stdin format, extracts session_id,
5
+ * then delegates to the shared core logic and translates
6
+ * the result into Claude Code exit codes:
7
+ * 0 = allow completion
8
+ * 2 = block completion (stderr fed back to Claude)
9
+ */
10
+ export declare function run(projectDir: string): void;
11
+ //# sourceMappingURL=verify-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"verify-gate.d.ts","sourceRoot":"","sources":["../../../../src/clients/claude/hooks/verify-gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAWH,wBAAgB,GAAG,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAkC5C"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ /**
3
+ * Claude Code — verify-gate hook adapter
4
+ *
5
+ * Reads Claude Code's stdin format, extracts session_id,
6
+ * then delegates to the shared core logic and translates
7
+ * the result into Claude Code exit codes:
8
+ * 0 = allow completion
9
+ * 2 = block completion (stderr fed back to Claude)
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.run = run;
13
+ const verify_gate_1 = require("../../../hooks/core/verify-gate");
14
+ const config_1 = require("../../../lib/config");
15
+ const logger_1 = require("../../../lib/logger");
16
+ const stdin_1 = require("../../../lib/stdin");
17
+ function run(projectDir) {
18
+ let input;
19
+ try {
20
+ input = JSON.parse((0, stdin_1.readStdin)());
21
+ }
22
+ catch (e) {
23
+ logger_1.logger.debug(`failed to parse stdin: ${e}`);
24
+ process.exit(0);
25
+ }
26
+ const sessionId = input.session_id ?? "default";
27
+ (0, logger_1.setLogFile)(`${projectDir}/.ironbee/sessions/${sessionId}/session.log`);
28
+ const config = (0, config_1.loadConfig)(projectDir);
29
+ const result = (0, verify_gate_1.runVerifyGate)({
30
+ sessionId,
31
+ actionsFile: `${projectDir}/.ironbee/sessions/${sessionId}/actions.jsonl`,
32
+ verdictFile: `${projectDir}/.ironbee/sessions/${sessionId}/verdict.json`,
33
+ retryFile: `${projectDir}/.ironbee/sessions/${sessionId}/retries`,
34
+ maxRetries: (0, config_1.getMaxRetries)(config),
35
+ });
36
+ if (result.action === "allow") {
37
+ if (result.message) {
38
+ process.stderr.write(result.message + "\n");
39
+ }
40
+ process.exit(0);
41
+ }
42
+ // block: exit 2 with stderr feedback to Claude
43
+ if (result.message) {
44
+ process.stderr.write(result.message + "\n");
45
+ }
46
+ process.exit(2);
47
+ }
48
+ //# sourceMappingURL=verify-gate.js.map