/** * Shared agent-filter engine (ADR-0085). * * Pure transform over SignalEnvelope signals. Used by live runs (fit/graph/sim) * and session replay — one implementation, no drift. */ import { ConfigurationError } from '@opensip-cli/core'; import type { WarningDetail } from './command-outcome.js'; import type { SignalEnvelope } from './signal-envelope.js'; import type { OptionSpec, ToolCliContext } from '@opensip-cli/core'; /** * Thrown when an agent filter token or `--top` value is malformed. Extends * {@link ConfigurationError} so the host error boundary maps a bad live-run * filter to `CONFIGURATION_ERROR` (exit 2) — the same clean usage-error exit * `graph impact --top` already produces, rather than a generic system error. */ export declare class AgentFilterParseError extends ConfigurationError { constructor(message: string); } /** * The compact view emitted by a filtered live run (`--filter`/`--top`): the * filtered envelope plus the applied tokens and before/after signal counts. The * UNFILTERED envelope is still what persists and egresses (filtering is * presentation-only). */ export interface AgentFilteredResult { readonly type: 'agent-filtered'; readonly envelope: SignalEnvelope; readonly filtersApplied: readonly string[]; readonly originalSignalCount: number; readonly returnedSignalCount: number; } /** * Fold `--filter` tokens and optional `--top` into a normalized token list. * Appends `top:` when `--top` is present. */ export declare function normalizeAgentRunFilters(filter?: readonly string[], top?: string): readonly string[]; /** Apply agent filters to an envelope. Pure — no I/O. */ export declare function applyAgentFilters(envelope: SignalEnvelope, filters: readonly string[]): { readonly envelope: SignalEnvelope; readonly filtersApplied: readonly string[]; readonly originalSignalCount: number; readonly returnedSignalCount: number; }; /** Build an AgentFilteredResult wrapper for machine output. */ export declare function buildAgentFilteredResult(envelope: SignalEnvelope, filters: readonly string[]): AgentFilteredResult; /** Agent-run filter flags shared by fit/graph/sim/yagni JSON emission. */ export interface AgentRunFilterOpts { readonly filter?: readonly string[]; readonly top?: string; readonly raw?: boolean; } /** * Emit tool JSON — unfiltered envelope or agent-filtered result (ADR-0085). * Shared by fit/graph/sim/yagni so the filter/raw dispatch cannot drift. * * `warnings` (optional) are non-fatal run notices stamped onto the machine * outcome (`CommandOutcome.warnings`) on the unfiltered-envelope path — e.g. * graph's partial-coverage parse-failure notice. The agent-filtered compact * result deliberately omits them (its consumers opt into a minimal shape). */ export declare function emitAgentFilteredJsonOutput(cli: ToolCliContext, envelope: SignalEnvelope, opts: AgentRunFilterOpts, warnings?: readonly WarningDetail[]): void; /** Shared run-flag specs for fit/graph/sim agent ergonomics. */ export declare const agentRunFlagSpecs: readonly OptionSpec[]; //# sourceMappingURL=agent-filters.d.ts.map