export type ScopeRule = 'credential_literal' | 'credential_header' | 'private_state' | 'mcp_config' | 'relay_probe' | 'platform_cli' | 'api_call' | 'process_inspect'; export interface ScopeViolation { rule: ScopeRule; /** `abort` ends the run; `warn` is recorded and the work continues. */ severity: 'abort' | 'warn'; /** One line a human can act on. Never contains a credential. */ reason: string; /** The offending fragment, already redacted and bounded. */ detail: string; } /** * Classify ONE tool input. Returns `null` when the input is ordinary work. * Order is deliberate: the first match is the most specific reason a human * will read in the run console. */ export declare function classifyScopeViolation(input: string, opts?: { homeDir?: string; }): ScopeViolation | null; /** * The tool INPUTS carried by one streamed harness line. * * Only JSON lines are read: every supported harness emits one JSON event per * line, and a non-JSON line is console text (assistant prose), which must never * be classified as an action. Returns `[]` for anything it cannot parse. */ export declare function scopeTextsFromLine(line: string): string[]; /** * The first ABORT violation across a line's tool inputs. Only a CREDENTIAL is * an abort (2026-10-25 revision); everything else is collected as a warning so * the run keeps working. */ export declare function inspectLineForScope(line: string, opts?: { homeDir?: string; }): { abort: ScopeViolation | null; warnings: ScopeViolation[]; }; /** What a `whoami` tool result told us about the session's identity. */ export interface WhoamiIdentity { userId?: string; /** 'agent' | 'human' - anything else is treated as unknown. */ kind?: string; /** The Agent row id (null for a person). */ agentId?: string | null; } /** * The identity a streamed harness line reports, when that line carries a * `whoami` result (2026-11-14). * * WHY A RESULT AND NOT A PROMPT: the bridge cannot trust the model to notice a * wrong identity, and the incident's failure was silent precisely because the * tools all "worked". Reading the tool's own answer makes verification * deterministic: the run is killed the moment its own whoami says it is a * person, before it writes anything as them. * * Returns null for every line that is not a whoami answer (assistant prose, any * other tool result), and for anything unparseable. */ export declare function whoamiIdentity(line: string): WhoamiIdentity | null;