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 / tool-check / link-of.ts
27 lines · 707 BRaw
1import type { EventResult, Tier, TraceEntry } from 'claude-code'
2
3import { CHECKED } from './checked.js'
4
5/**
6 * One settled link of a `tool.check` run as `next.trace` lists it: whose
7 * hook, in which tier, and what it settled on (nothing when it was skipped).
8 *
9 * @param plugin the hook's plugin
10 * @param tier the tier the engine pinned for it
11 * @param returned what the link settled on
12 * @returns the entry
13 */
14export const linkOf = (
15 plugin: string,
16 tier: Tier,
17 returned?: EventResult<'tool.check'>,
18): TraceEntry<'tool.check'> => ({
19 index: 0,
20 plugin,
21 tier,
22 event: 'tool.check',
23 outcome: returned === undefined ? 'skipped' : 'returned',
24 ms: 0,
25 received: CHECKED,
26 returned,
27})