import { z } from 'zod'; import { type Complete } from './providers.js'; export * from './providers.js'; /** * The one decision triage makes about a message: a question is answered from the docs (RAG); a report is anything else * (a bug, feedback, a request, a complaint) and goes to the AI pipeline. */ export declare const TYPES: readonly ["question", "report"]; export type MessageType = (typeof TYPES)[number]; /** Finer detail about a report, used by the pipeline. A question is always `how_to`, and a report never is. */ export declare const KINDS: readonly ["bug", "outage", "feature_request", "how_to", "account_billing", "abuse", "other"]; export type Kind = (typeof KINDS)[number]; export type Severity = 'low' | 'medium' | 'high' | 'critical'; export declare const LIMITS: { message: number; pageUrl: number; appVersion: number; userId: number; email: number; consoleError: number; consoleErrors: number; }; export declare const ReportSchema: z.ZodObject<{ message: z.ZodPipeline, z.ZodString>; pageUrl: z.ZodEffects; appVersion: z.ZodEffects; userId: z.ZodEffects; /** Where to tell the customer their bug is fixed. An address that isn't valid is dropped, not the report. */ email: z.ZodEffects; /** The most recent errors are kept when there are more than fit. */ consoleErrors: z.ZodEffects; }, "strip", z.ZodTypeAny, { message: string; pageUrl?: string | undefined; appVersion?: string | undefined; userId?: string | undefined; email?: string | undefined; consoleErrors?: string[] | undefined; }, { message: string; pageUrl?: unknown; appVersion?: unknown; userId?: unknown; email?: unknown; consoleErrors?: unknown; }>; export type Report = z.output; export interface Triage { type: MessageType; kind: Kind; severity: Severity; summary: string; steps: string[]; expected?: string; actual?: string; feature?: string; /** Path of the page the report was sent from. Reports are grouped by it, since it is stable where `feature` isn't. */ page?: string; /** Only real bug candidates enter the fix loop. Injection attempts never do. */ enterFixLoop: boolean; source: 'llm' | 'rules'; injection: boolean; } type Verdict = Omit; /** * The model's verdict, normalized; undefined when the reply names neither a type nor a kind. A missing type is read off * the kind, and a kind that contradicts the type gives way to it: a question is always `how_to`, and a report that the * model called `how_to` (or gave no kind) gets its kind from the rules. */ export declare function readVerdict(raw: unknown, report: Report): Verdict | undefined; /** * A question for the docs. It must read as one; any sign of a problem or a wanted change makes it a report. Vaguer words * ("issue", "wrong", "problem") make it a report too, unless it is plainly a how-to ("how do I report a problem?"). */ export declare function isQuestion(text: string): boolean; /** What kind of report a message is, for the pipeline. Never `how_to`. */ export declare function reportKind(text: string): Exclude; export declare function triageByRules(report: Report): Verdict; /** * Classifies one report. Attempts to instruct the AI are checked first and short-circuit to `abuse` without calling * a model. Any model failure (no key, timeout, a reply with no usable verdict) falls back to the rules, so triage * never blocks intake. `complete` defaults to whichever AI provider has a key configured (see providers.ts). */ export declare function triage(report: Report, complete?: Complete | undefined): Promise; //# sourceMappingURL=index.d.ts.map