import type { HarnessEvent } from "@claudexor/schema"; /** * D-16c: claude 2.1.165 typed context / rate-limit signal mapping, extracted * from the main stream parser so each concern stays a small, testable owner. * These map FIXTURE-PROVEN vendor frames onto typed HarnessEvents — no prose * matching. Context signals are a sibling of the transient-retry taxonomy and * NEVER enter the transient_retry loop. */ type Json = any; /** * `system/compact_boundary` → a typed compaction context event. The boundary is * the COMPLETION of a compaction; `trigger` (auto|manual) and `pre_tokens` ride * through as evidence. The frame states no cause, so cause stays `unknown`. */ export declare function claudeCompactBoundaryEvents(obj: Json, sessionId: string, ts: string): HarnessEvent[]; /** * QA-015: the top-level typed `rate_limit_event` heartbeat. Always RECOGNIZED * (never a dropped event). The routine `allowed` and advisory * `allowed_warning` heartbeats surface NOTHING (arming a rate_limit signal on * either would falsely cool the account after a successful run); only a * rejecting status arms the TYPED `rate_limit` signal the budget layer reads. * Returns `[]` for a benign/advisory heartbeat. */ export declare function claudeRateLimitEvents(obj: Json, sessionId: string, ts: string): HarnessEvent[]; /** * Map the FIXTURE-PROVEN result `terminal_reason` values onto a typed * context-exhaustion event (or null for `completed`/unrecognized). No prose * matching — only the typed vendor enum. `prompt_too_long` is an irreducible- * packet exhaustion (NOT continuation-eligible); `rapid_refill_breaker` is the * SDK's repeated-refill breaker (the continuation-eligible cause). */ export declare function claudeTerminalContextEvent(terminalReason: unknown, sessionId: string, ts: string): HarnessEvent | null; /** * D-16c side_tool: a `{work_report}`-ONLY structured_output (no `output` key) is * the claude StructuredOutput-tool WorkReport envelope — the report rides the * tool while the markdown final message stays the deliverable. Returns the raw * work_report value, or undefined when the structured_output is a full * `{work_report, output}` envelope / a plain caller-schema answer (both of * which surface AS the final message). */ /** * The final-message events a `result` frame emits (D-16c). Precedence: * - a full `{work_report, output}` envelope / plain structured answer surfaces * AS the final message (`structured_output` finality); * - otherwise the markdown `result` is the final message (side_tool rides its * WorkReport on the message payload); * - a side_tool report with no deliverable text still surfaces (rare). * Finality is stamped only for a success result. A NON-SUCCESS result's text * is failure evidence, not answer material (A3 deliverable hygiene): it rides * a `status` event — visible in the timeline, typed by the entitlement/error * signals alongside — and never a `message` the answer assembly could adopt. */ export declare function claudeResultMessageEvents(obj: Json, successResult: boolean, sessionId: string, ts: string): HarnessEvent[]; export declare function claudeSideToolReport(structuredOutput: unknown): unknown; export {}; //# sourceMappingURL=context-signals.d.ts.map