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 / agents-md / hooks / telemetry / nested-row-of.ts
20 lines · 591 BRaw
1import type Modes from '../modes'
2import { modeChoiceOf } from './mode-choice-of.js'
3import { NESTED_EVENT } from './nested-event.js'
4import type { TelemetryRow } from './types'
5
6/**
7 * The row of a Read that attached nested AGENTS.md files: the mode and how
8 * many it attached.
9 *
10 * @param mode the configured mode
11 * @param fileCount the files attached to this Read's result
12 * @returns the row to send
13 */
14export const nestedRowOf = (
15 mode: Modes.Mode,
16 fileCount: number,
17): TelemetryRow => ({
18 event: NESTED_EVENT,
19 props: { mode: modeChoiceOf(mode), file_count: fileCount },
20})