import type { JsonCodec } from "../ports/codec.js"; import type { FileSystem } from "../ports/filesystem.js"; import type { MetricsSnapshot } from "./metrics.js"; import type { BurdenKind } from "./burden.js"; import type { GovernorDepth } from "../session/types.js"; export type RuntimeLogPolicy = "metadata_only"; export interface RuntimeObservabilityState { readonly enabled: boolean; readonly logPath: string; readonly maxBytes: number; readonly logPolicy: RuntimeLogPolicy; } export interface ResolveRuntimeObservabilityOptions { readonly graftDir: string; readonly env?: Readonly>; readonly overrides?: Partial; } export declare function resolveRuntimeObservabilityState(options: ResolveRuntimeObservabilityOptions): RuntimeObservabilityState; export interface RuntimeSessionStartedEvent { readonly event: "session_started"; readonly sessionId: string; readonly logPath: string; readonly logPolicy: RuntimeLogPolicy; } export interface RuntimeToolCallStartedEvent { readonly event: "tool_call_started"; readonly sessionId: string; readonly traceId: string; readonly tool: string; readonly argKeys: readonly string[]; readonly sessionDepth: GovernorDepth; } /** * Per-tool-call footprint capturing which files, symbols, and regions * were observed. Enables provenance tracing at sub-file granularity. */ export interface ToolCallFootprint { /** File paths read or scanned by this tool call. */ readonly paths: readonly string[]; /** Symbol names inspected (when available from outline/precision tools). */ readonly symbols: readonly string[]; /** Line regions accessed (when available from read_range). */ readonly regions: readonly ToolCallFootprintRegion[]; } /** A line region within a specific file. */ export interface ToolCallFootprintRegion { readonly path: string; readonly startLine: number; readonly endLine: number; } export interface RuntimeToolCallCompletedEvent { readonly event: "tool_call_completed"; readonly sessionId: string; readonly traceId: string; readonly seq: number; readonly tool: string; readonly latencyMs: number; readonly projection: string; readonly reason: string; readonly burdenKind: BurdenKind; readonly nonReadBurden: boolean; readonly returnedBytes: number; readonly fileBytes: number | null; readonly sessionDepth: GovernorDepth; readonly tripwireSignals: readonly string[]; readonly metrics: MetricsSnapshot; /** Optional sub-file footprint for provenance granularity. */ readonly footprint?: ToolCallFootprint; } export type RuntimeFailureKind = "validation_error" | "tool_error" | "unknown_error"; export interface RuntimeToolCallFailedEvent { readonly event: "tool_call_failed"; readonly sessionId: string; readonly traceId: string; readonly tool: string; readonly latencyMs: number; readonly sessionDepth: GovernorDepth; readonly argKeys: readonly string[]; readonly errorKind: RuntimeFailureKind; readonly errorName: string; } type RuntimeEvent = RuntimeSessionStartedEvent | RuntimeToolCallStartedEvent | RuntimeToolCallCompletedEvent | RuntimeToolCallFailedEvent; export interface RuntimeEventLoggerOptions { readonly fs: FileSystem; readonly codec: JsonCodec; readonly logPath: string; readonly maxBytes: number; } export declare function ensureGraftDirExcluded(projectRoot: string, graftDir: string, fs: FileSystem): Promise; export declare function classifyRuntimeFailure(error: unknown): { kind: RuntimeFailureKind; name: string; }; export { sanitizeArgValues } from "./secret-scrub.js"; export declare function sanitizeArgKeys(args: Record): string[]; export declare class RuntimeEventLogger { private readonly logWriter; private queue; constructor(options: RuntimeEventLoggerOptions); log(event: RuntimeEvent): Promise; } //# sourceMappingURL=runtime-observability.d.ts.map