cynarAI 6c7eed7580 Initial clean evOo-local from f00577b
Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline
(Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/*
packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
2026-09-20 17:15:16 +02:00

19 lines
556 B
TypeScript

import { AsyncLocalStorage } from "node:async_hooks";
import type { LogBindings } from "./types.js";
const storage = new AsyncLocalStorage<LogBindings>();
export function getLogContext(): LogBindings {
return { ...(storage.getStore() ?? {}) };
}
export function runWithLogContext<T>(bindings: LogBindings, fn: () => T): T {
return storage.run({ ...storage.getStore(), ...bindings }, fn);
}
export function enrichLogContext(bindings: LogBindings): void {
const store = storage.getStore();
if (!store) return;
Object.assign(store, bindings);
}