(options: InitializeCliTelemetryOptions)
| 46 | } |
| 47 | |
| 48 | export function initializeCliTelemetry(options: InitializeCliTelemetryOptions): void { |
| 49 | initializeTelemetry({ |
| 50 | homeDir: options.harness.homeDir, |
| 51 | deviceId: options.bootstrap.deviceId, |
| 52 | enabled: options.config.telemetry !== false, |
| 53 | appName: CLI_USER_AGENT_PRODUCT, |
| 54 | version: options.version, |
| 55 | uiMode: options.uiMode, |
| 56 | model: options.model ?? options.config.defaultModel, |
| 57 | getAccessToken: async () => |
| 58 | (await options.harness.auth.getCachedAccessToken(KIMI_CODE_PROVIDER_NAME)) ?? null, |
| 59 | }); |
| 60 | if (options.bootstrap.firstLaunch) { |
| 61 | options.harness.track('first_launch'); |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | export interface InitializeServerTelemetryOptions { |
| 66 | readonly version: string; |
no test coverage detected