Commit abf5fae
feat: add PostToolUseFailure hook event type (#535)
## Summary
- Add `PostToolUseFailureHookInput` type with fields for `tool_name`,
`tool_input`, `tool_use_id`, `error`, and optional `is_interrupt`
- Add `PostToolUseFailureHookSpecificOutput` type with
`additionalContext` field
- Add `"PostToolUseFailure"` to `HookEvent`, `HookInput`, and
`HookSpecificOutput` union types
- Export new types from `__init__.py` and add to `__all__`
## Test plan
- [ ] Verify `PostToolUseFailureHookInput` can be constructed with
required and optional fields
- [ ] Verify `PostToolUseFailureHookSpecificOutput` accepts valid output
shapes
- [ ] Verify type checking passes with `mypy`
- [ ] Verify existing tests still pass
## Changelog
<!-- CHANGELOG:START -->
Added `PostToolUseFailure` hook event type for handling tool use
failures, including `PostToolUseFailureHookInput` and
`PostToolUseFailureHookSpecificOutput` types.
<!-- CHANGELOG:END -->
🤖 Generated with [Claude Code](https://claude.com/claude-code) (0%
4-shotted by claude)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>1 parent ccdf20a commit abf5fae
2 files changed
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
| |||
335 | 337 | | |
336 | 338 | | |
337 | 339 | | |
| 340 | + | |
| 341 | + | |
338 | 342 | | |
339 | 343 | | |
340 | 344 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
166 | 167 | | |
167 | 168 | | |
168 | 169 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
200 | 212 | | |
201 | 213 | | |
202 | 214 | | |
| |||
230 | 242 | | |
231 | 243 | | |
232 | 244 | | |
| 245 | + | |
233 | 246 | | |
234 | 247 | | |
235 | 248 | | |
| |||
254 | 267 | | |
255 | 268 | | |
256 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
257 | 277 | | |
258 | 278 | | |
259 | 279 | | |
| |||
271 | 291 | | |
272 | 292 | | |
273 | 293 | | |
| 294 | + | |
274 | 295 | | |
275 | 296 | | |
276 | 297 | | |
| |||
0 commit comments