MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / buildContext

Function buildContext

packages/telemetry/src/sink.ts:99–117  ·  view source on GitHub ↗
(options: EventSinkContextOptions)

Source from the content-addressed store, hash-verified

97}
98
99function buildContext(options: EventSinkContextOptions): TelemetryContext {
100 const env = options.env ?? process.env;
101 const context: TelemetryContext = {
102 app_name: options.appName,
103 version: options.version,
104 runtime: 'node',
105 platform: platform(),
106 arch: arch(),
107 node_version: process.versions.node,
108 os_version: release(),
109 ci: env['CI'] !== undefined,
110 locale: options.locale ?? env['LANG'] ?? '',
111 terminal: options.terminal ?? env['TERM_PROGRAM'] ?? '',
112 ui_mode: options.uiMode ?? 'shell',
113 };
114 setPrimitive(context, 'model', options.model);
115 setPrimitive(context, 'build_sha', options.buildSha);
116 return context;
117}
118
119function setPrimitive(
120 target: TelemetryContext,

Callers 1

constructorMethod · 0.85

Calls 2

setPrimitiveFunction · 0.85
releaseFunction · 0.50

Tested by

no test coverage detected