"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ensureTCCApiKey = exports.TCC_API_KEY = exports.RIVET_VERSION = void 0;
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-require-imports
exports.RIVET_VERSION = require('../../package.json').version;
/**
 * The Context Company (TCC) observability configuration.
 *
 * TCC API keys are write-only telemetry keys (like PostHog project keys and Sentry DSNs),
 * safe to embed in client-distributed code. The env var takes precedence so local
 * .env.local overrides still work in development (dev_ prefixed keys route to
 * the TCC staging endpoint).
 *
 * NOTE: This key is also hardcoded in desktop/main/main.ts (for the Electron path).
 * If the key rotates, update both locations.
 */
exports.TCC_API_KEY = process.env.TCC_API_KEY ?? 'tcc_prod_CUPzjgH3bxZepZ9smXgmu4';
/**
 * Inject the TCC API key into process.env so the @contextcompany/claude library
 * can read it at telemetry send time via getTCCApiKey().
 * Safe to call multiple times — respects an existing env value.
 */
const ensureTCCApiKey = () => {
    if (!process.env.TCC_API_KEY) {
        process.env.TCC_API_KEY = exports.TCC_API_KEY;
    }
};
exports.ensureTCCApiKey = ensureTCCApiKey;
//# sourceMappingURL=telemetry.js.map