feat(telemetry): show first-run notice before command output

This commit is contained in:
Andrey Avtomonov 2026-05-22 16:52:01 +02:00
parent 1953466c78
commit 91772e5bce
3 changed files with 14 additions and 0 deletions

View file

@ -20,6 +20,14 @@ import { buildProjectStackSnapshotFields } from './project-snapshot.js';
export { beginCommandSpan, completeCommandSpan, shutdownTelemetryEmitter };
export type { CommandOutcome, CompletedCommandSpan };
export async function showTelemetryNoticeIfNeeded(io: KtxCliIo): Promise<void> {
await loadTelemetryIdentity({
stdoutIsTTY: io.stdout.isTTY === true,
stderr: io.stderr,
env: process.env,
});
}
type TelemetryEventFields<Name extends TelemetryEventName> = Omit<
TelemetryEventProperties<Name>,
keyof TelemetryCommonEnvelope