/** * Daily Brief โ€” deviation ingestion SDK. * * Call when a skill fires locally (pre-PR, pre-commit, pre-chat) against * a file edit, commit, PR, chat turn, or task output. The server enforces * dedupe via UNIQUE (workspace_id, dedupe_key); plugin-side computation * here matches the server's expectation: * * dedupe_key = sha1(skill_id | evidence_kind | evidence_ref | floor(epoch/600)) * * 10-minute bucketing handles save-happy editors without losing legitimate * re-fires beyond that window. * * Endpoint contract: see orgx/docs/api-contracts/daily-brief-schema.md ยง04. */ export type EvidenceKind = "pr" | "commit" | "file_edit" | "chat_turn" | "task_output"; export type ApplicationSource = "agent_run" | "plugin_cursor" | "plugin_claude" | "plugin_codex" | "plugin_openclaw" | "manual"; export type DeviationOutcome = "pending" | "confirmed" | "rejected" | "ignored"; export interface PostDeviationInput { skillId: string; evidenceKind: EvidenceKind; /** e.g. "finance-dashboard#142" or "/path/to/file.py:42" */ evidenceRef: string; summary: string; applicationSource: ApplicationSource; /** 0..1 โ€” plugin-measured match confidence */ confidence: number; outcome?: DeviationOutcome; triggerContext?: Record; capturedAt?: Date; taskId?: string; runId?: string; } export interface PostDeviationOptions { apiBaseUrl: string; apiKey: string; fetchImpl?: typeof fetch; abortAfterMs?: number; } export interface PostDeviationResult { ok: boolean; id: string | null; deduplicated: boolean; status: number; error?: string; } export declare function computeDedupeKey(input: { skillId: string; evidenceKind: EvidenceKind; evidenceRef: string; capturedAt?: Date; }): string; /** * Post a deviation to OrgX. Returns the result shape from the server. * * On HTTP 409 / duplicate-key the server treats it as deduplicated โ€” callers * usually don't need to distinguish (the outcome is the same). */ export declare function postDeviation(input: PostDeviationInput, options: PostDeviationOptions): Promise; /** * Convenience: post multiple deviations in parallel with a shared auth. * Returns per-input results so callers can log which fired + which deduped. */ export declare function postDeviationBatch(inputs: PostDeviationInput[], options: PostDeviationOptions): Promise;