/**
 * Global state for Telemetry (survives hot reloads / module re-evaluation).
 */
const telemetryInstanceKey = Symbol.for('@agentuity/telemetry:instance');
const originalConsoleKey = Symbol.for('@agentuity/telemetry:originalConsole');
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const g = globalThis;
export const telemetry = {
    get: () => g[telemetryInstanceKey],
    set: (v) => {
        g[telemetryInstanceKey] = v;
    },
    clear: () => {
        g[telemetryInstanceKey] = undefined;
    },
};
/**
 * Capture the native console once. Bun --hot re-evaluates this module while
 * `globalThis.console` may already be our patch; without a process-global
 * snapshot, `__originalConsole = Object.create(console)` chains patches and
 * stacks `[INFO]` prefixes on every reload.
 */
export function getOriginalConsole() {
    const existing = g[originalConsoleKey];
    if (existing) {
        return existing;
    }
    const native = globalThis.console;
    g[originalConsoleKey] = native;
    return native;
}
//# sourceMappingURL=globals.js.map