import { type DbClient } from './agentPresence.js'; export declare const QUESTION_MAX = 4000; export declare const CHOICES_MAX = 10; export declare const CHOICE_MAX = 200; export declare const CONTEXT_REF_MAX = 500; export type AskShape = { kind: 'yes_no'; } | { kind: 'text'; } | { kind: 'options'; choices: string[]; }; export type AskStatus = 'draft' | 'open' | 'answered' | 'withdrawn' | 'expired'; export interface AskRecord { ask_id: string; project_id: string; project_key: string; asker: string; target: string; question: string; shape: AskShape; context_ref?: string; requires_approval: boolean; status: AskStatus; created_at: string; expires_at?: string; /** True once hq.asks holds this row. */ synced: boolean; sync_error?: string; answer?: boolean | string; answered_by?: string; on_behalf_of?: string; answered_via?: string; answered_at?: string; superseded_answers?: unknown[]; /** When a live session in the project was told the outcome. */ notified_at?: string; } export declare class AskError extends Error { } /** ASK- plus a ULID: 10 chars of time, 16 of randomness. Sorts by creation. */ export declare function mintAskId(now?: number): string; export declare function parseShape(raw: unknown): AskShape; /** A human who can answer: user:, human:, or guest:. */ export declare function parseTarget(raw: unknown): { target: string; guest: boolean; }; export declare function readAsks(projectId: string): AskRecord[]; export declare function readAsk(projectId: string, askId: string): AskRecord | null; /** The hq.asks row for a record. Never includes answer columns. */ export declare function hqRow(rec: AskRecord, orgId: string): Record; export interface CreateInput { project_id?: string; question: unknown; target: unknown; shape?: unknown; context_ref?: unknown; expires_at?: unknown; requires_approval?: unknown; /** Who is asking. Callers pass their agent name; defaults to the project's agent. */ asker?: string; } export interface CreateDeps { client?: DbClient | null; orgId?: () => string | null; now?: () => Date; } export declare function createAsk(input: CreateInput, deps?: CreateDeps): Promise; export interface PickupDeps { client?: DbClient | null; orgId?: () => string | null; /** project_ids to scan; defaults to every registered project. */ projects?: () => string[]; /** Tell a live session in the project; true when someone received it. */ notify?: (projectId: string, text: string) => Promise; now?: () => Date; } export declare function outcomeText(rec: AskRecord): string; export interface PickupResult { pushed: number; resolved: number; notified: number; errors: string[]; } export declare function pickupOnce(deps?: PickupDeps): Promise; /** Notify live claude-peers sessions whose repo is the project's. */ export declare function notifyProjectSessions(projectId: string, text: string): Promise; export declare const PICKUP_MS = 30000; /** The daemon's 30 s loop (the Friday fallback for realtime; ISS-0213). */ export declare function startAskPickup(intervalMs?: number): () => void; //# sourceMappingURL=asks.d.ts.map