/** * SessionAttachmentMapper:把 `` 附件描述映射为模型可消费的 file parts。 * * 关键点(中文) * - 兼容 Telegram / Feishu / TUI 等统一的 `` 协议入口。 * - Data URL 附件先由 Session Attachment Store 落盘,Message 只保存文件路径。 * - 模型执行阶段再读取本地文件,并转换为模型可消费的数据格式。 * - 历史中的相对路径与旧版 `file://` 会在喂给模型前临时 hydrate。 * * 输入到输出(中文): * `file.url = data:;base64,...` * → Session Attachment Store 解码并写入附件文件 * → `file.url = .downcity/.../attachments/att_.` * → Message 持久化路径引用 * → 模型执行前读取文件并恢复为 Data URL * → `convertToModelMessages()` 生成最终 ModelMessage。 */ import type { SessionUserMessagePart } from "../../types/sdk/AgentSessionPrompt.js"; import type { SessionAttachmentStore } from "../../types/store/SessionAttachmentStore.js"; import type { SessionMessageRecordV1 } from "../../executor/types/SessionRecords.js"; /** * 在用户 prompt 入库前,将 Data URL file part 保存为 Session 附件路径。 * * 关键点(中文) * - 只有 Data URL 会在此处落盘;远程 URL 和本地路径保持引用不变。 * - 附件成功落盘后才把 URL 替换为相对 Workspace 根目录的路径。 * - canonical filename 保留调用侧传入的用户可见文件名;真实落盘路径只写入 url。 */ export declare function persist_user_prompt_file_parts(parts: SessionUserMessagePart[], attachment_store: SessionAttachmentStore): Promise; /** * 将历史中的本地 file part 临时转换为模型可消费的 data URL。 * * 关键点(中文) * - 该函数只修改本轮内存消息,不回写历史。 * - 新历史保留 Agent 根目录相对路径,旧历史的 `file://` 仍继续兼容。 */ export declare function hydrate_file_url_parts_for_model(messages: SessionMessageRecordV1[], project_root?: string): Promise; /** * 在 user 消息上注入 FileUIPart,以便多模态模型直接消费本地附件。 */ export declare function inject_file_parts_from_attachments(messages: SessionMessageRecordV1[], project_root?: string): Promise; //# sourceMappingURL=SessionAttachmentMapper.d.ts.map