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 / telemetry / hooks / context / session-fields-of / session-fields-of.ts
21 lines · 839 BRaw
1import type { Facts } from '../../facts'
2import { clientTypeOf } from '../client-type-of'
3import { entrypointOf } from '../entrypoint-of'
4import type { SessionFields } from '../session-fields'
5import { versionOf } from '../version-of'
6
7/**
8 * The session's constant row fields from the variables as read: the client,
9 * the entrypoint, the SDK's version and a benchmark run's ids.
10 *
11 * @param facts the variables as read once for the session
12 * @returns the fields
13 */
14export const sessionFieldsOf = (facts: Facts): SessionFields => ({
15 clientType: clientTypeOf(facts),
16 entrypoint: entrypointOf(facts.entrypoint),
17 agentSdkVersion: versionOf(facts.agentSdkVersion),
18 sweBenchRunId: facts.sweBenchRunId || undefined,
19 sweBenchInstanceId: facts.sweBenchInstanceId || undefined,
20 sweBenchTaskId: facts.sweBenchTaskId || undefined,
21})