UNPKG

eve

Version:

Filesystem-first framework for durable backend AI agents that run anywhere.

30 lines (29 loc) 1.46 kB
/** * Shared instrumentation primitives used by both the channel projection * builder (`#channel/instrumentation.ts`) and the harness telemetry * builder (`#instrumentation/runtime-context.ts`). * * Both layers resolve a user-authored projector callback into a plain * record and reason about the same channel-kind vocabulary. Keeping that * vocabulary and the defensive resolution shell in one place stops the * two sites from drifting (e.g. the framework-kind set growing in one * file but not the other). */ import { type Logger } from "#internal/logging.js"; export { isInstrumentationChannelKind, normalizeInstrumentationChannelKind, } from "#shared/instrumentation-channel-kind.js"; /** * Invokes a user-authored instrumentation projector defensively. * * Returns the JSON object the projector produced. Returns `undefined` * without warning for a no-op `undefined`, or with a warning when it threw, * returned a `Promise`, returned an incorrect shape, or included values * outside eve's JSON contract. Every rejection path is warning-only so * instrumentation can never break the turn. Per-value shaping (for example * reserved-key filtering) is left to the caller, since the channel and * harness expose different value shapes. */ export declare function resolveInstrumentationProjection(input: { readonly invoke: () => unknown; readonly log: Logger; readonly source: string; }): Record<string, unknown> | undefined;