import { type DbClient } from './agentPresence.js'; export declare const TITLE_MAX = 200; export declare const DESCRIPTION_MAX = 1000; export declare const URL_MAX = 2048; /** * Mirrors decibel-hq src/lib/artifacts.ts extractArtifactLinks EXACTLY. If HQ * changes its regex, change this one — tests/unit/artifacts.test.ts pins both * to the same fixtures. */ export declare function extractArtifactLinks(text: string): string[]; export type RegisterResult = { ok: true; id: string; } | { ok: false; reason: 'unconfigured' | 'invalid' | 'unavailable' | 'failed'; message: string; }; export interface RegisterInput { url: string; title: string; source: 'agent' | 'chat'; description?: string | null; /** Local registry id or HQ project key; mapped to hq.projects.id, null on a miss. */ project?: string | null; /** A directory the caller is in; used for project + agent identity. */ cwd?: string | null; meta?: Record; } /** For tests. */ export declare function _resetArtifacts(): void; /** The registered project root that contains `dir`, deepest match wins. */ export declare function projectRootFor(dir: string | null | undefined): string | null; /** Validate before the round trip so the caller gets a message, not a SQLSTATE. */ export declare function validateUrl(url: unknown): string | null; export declare function registerArtifact(input: RegisterInput, deps?: { client?: DbClient | null; }): Promise; export interface HarvestableMessage { id: number; dir: 'in' | 'out'; peer_id?: string; project_id?: string; cwd?: string; text: string; } /** * A title from the text around the link. Chat text is untrusted data: it is * only ever used as a display string, stripped of control characters and * capped, and falls back to a fixed phrase when there is nothing usable. */ export declare function titleFromChat(text: string, project: string | null | undefined): string; /** Register every artifact link in one inbound chat message. Never throws. */ export declare function harvestChatMessage(m: HarvestableMessage, deps?: { client?: DbClient | null; }): Promise>; //# sourceMappingURL=artifacts.d.ts.map