import { type SessionMessagePayload } from './session-events.js'; import type { AttachmentMeta } from '../domain/ui-service/types.js'; export type { SessionMessagePayload }; /** Infer a MIME type from a filename's extension. */ export declare function extToMime(name: string): string; /** Classify a MIME type into the AttachmentMeta `type` bucket (mirrors the upload classifier). */ export declare function classifyAttachment(mimeType: string): 'image' | 'video' | 'file'; export interface CopiedFile { /** UI-relative path under `workspace/` (what the file card + download endpoint reference). */ relPath: string; name: string; size: number; } /** * Copy an agent-produced file into the session's `workspace/outputs//` area and return * its UI-relative path + final name + byte size. Copying (rather than referencing the source in * place) gives every agent-sent file a predictable location strictly under WORKSPACE_DIR, so the * download endpoint can serve it with a single-root traversal guard and never expose arbitrary * filesystem paths. Throws when the source is missing or not a regular file. */ export declare function copyFileIntoOutputs(a: { sessionId: string; filePath: string; fileName?: string; }): Promise; export interface SendAgentFileArgs { sessionId: string; filePath: string; fileName?: string; /** Optional caption shown alongside the file card. */ caption?: string; } export interface SendAgentFileDeps { copyIntoOutputs?: (a: { sessionId: string; filePath: string; fileName?: string; }) => Promise; appendAssistant?: (sessionId: string, opts: { text: string; ts?: string; attachments?: AttachmentMeta[]; }) => Promise; publish?: (p: SessionMessagePayload) => void; now?: () => string; } /** * Deliver a file into a web chat session as an agent-sent attachment (20a). Copies the file into the * session's outputs area, records an assistant message carrying the attachment (persisted, so it is * replayed by sessions.transcript on reload), and publishes a `session.message` event sharing the * SAME `ts` as the history entry so the web UI's content de-dup (transcript vs live-tail) keys them * identically. Returns the AttachmentMeta describing the delivered file. */ export declare function sendAgentFile(args: SendAgentFileArgs, deps?: SendAgentFileDeps): Promise;