spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / hooks / held-verdict / held-kind.ts
11 lines · 387 BRaw
1import type { EventResult } from 'claude-code'
2
3/**
4 * What kind of thing held over a person's plugin, as the notice calls it:
5 * `deny rule`, `ask rule`, or `refusal`, a deny that names no rule.
6 *
7 * @param held the verdict that holds
8 * @returns the kind
9 */
10export const heldKind = (held: EventResult<'tool.check'>) =>
11 held.rule === undefined ? 'refusal' : `${held.decision} rule`