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 / tests / fixtures / caught / replaying.ts
18 lines · 558 BRaw
1import type { TargetTier } from 'claude-code'
2
3/**
4 * A failure handler's `next` for a hook that had called it: the call
5 * replays what that last call settled to.
6 *
7 * Its `to` answers `to`, to tell the two apart.
8 *
9 * @param last what the failed hook's last call settled to
10 * @returns the stand-in
11 */
12export const replaying = (last: string) =>
13 Object.assign((_e: unknown) => Promise.resolve(last), {
14 to: (_e: unknown, _tier: TargetTier) => Promise.resolve('to'),
15 called: true,
16 error: { kind: 'throw' },
17 origin: { tier: 'user' },
18 })