/** * 入站附件:可选落盘到当前 Agent workspace 下指定子目录(相对路径)。 * * 目录约定:{subdir}/{userId}/{YYYY-MM-DD}/{stem}_{HHmmssmmm}{ext} * 时间取写入时的本地时区。 */ import type { OpenClawConfig } from "openclaw/plugin-sdk"; import type { Log } from "./auth.js"; import type { MsgFileVO, XgImConfig } from "./types.js"; /** 校验:非空、相对路径、不含 `..` 段 */ export declare function normalizeInboundWorkspaceSubdir(subdir: string): string | null; export declare function resolveAgentWorkspaceDirFromRuntime(rt: unknown, cfg: OpenClawConfig): string | undefined; export declare function ensureAgentWorkspaceFromRuntime(rt: unknown, cfg: OpenClawConfig): Promise; export declare function formatDateFolderLocal(d: Date): string; /** `HHmmss` + 三位毫秒,如 `120459237` */ export declare function formatInboundTimeSuffix(d: Date): string; /** * 将落盘绝对路径转为 OpenClaw / 沙箱可用的 workspace 相对引用(POSIX 风格,带 `./` 前缀)。 * 若文件不在 workspaceRoot 之下则返回 null(调用方应回退 file:// 或报错)。 */ export declare function absPathToWorkspaceRelativeOpenClawRef(workspaceRoot: string, absPath: string): string | null; /** * 沙箱内常用挂载点(如 `/workspace`)+ 相对 workspace 的路径,供 read 等工具按「绝对路径」解析。 * 若未配置 sandboxRootPrefix,则仍用 `./xg_im_inbound/...`(相对当前 cwd,部分沙箱工具会误判为不可访问)。 */ export declare function sandboxWorkspaceMediaRef(workspaceRoot: string, absPath: string, sandboxRootPrefix: string): string | null; export declare function openClawMediaRefForSavedFile(args: { workspaceRoot: string; absPath: string; style: "workspaceRelative" | "absoluteFileUrl" | undefined; /** 非空且 style 为 workspaceRelative 时,用 `/workspace/...` 形式代替 `./...` */ sandboxRootPrefix?: string; log?: Log; }): string; /** `report_120459237.pdf` */ export declare function buildInboundStoredFilename(originalFilename: string, at: Date): string; /** * 将入站附件下载到 workspace 下子目录;失败项保留原 URL。 */ export declare function saveInboundFilesToWorkspace(args: { rt: unknown; cfg: OpenClawConfig; config: XgImConfig; workspaceSubdir: string; senderUserId: string | undefined; fileItems: MsgFileVO[]; log?: Log; }): Promise; //# sourceMappingURL=inbound-media-local.d.ts.map