/** * 会话级 NAS 目录声明:路径规范化、安全校验、幂等指纹与 OpenClaw sandbox bind 注入。 */ import type { OpenClawConfig } from "openclaw/plugin-sdk"; import type { NasVolume } from "./agent-context-types.js"; import type { XgImConfig } from "./types.js"; export interface NormalizedNasVolume { /** 已解析软链接后的宿主机真实目录。 */ realDir: string; /** 相对 Agent workspace 的 POSIX 路径。 */ dockerDir: string; /** 容器内绝对路径。 */ sandboxDir: string; mode: "ro" | "rw"; } /** 将 IM 的 dockerDir 规范为不带 /workspace 前缀的 workspace 相对路径。 */ export declare function normalizeNasDockerDir(raw: string): string; export declare function nasVolumeSandboxDir(dockerDir: string): string; /** Prompt 使用的轻量规范化;真实路径与白名单在 dispatch 前再次校验。 */ export declare function normalizeNasVolumesForPrompt(volumes: NasVolume[] | undefined): Array<{ dockerDir: string; sandboxDir: string; mode: "ro" | "rw"; }>; export declare function validateAndNormalizeNasVolumes(volumes: NasVolume[], config: XgImConfig): NormalizedNasVolume[]; export declare function nasVolumeSpecHash(volumes: NormalizedNasVolume[]): string; /** * 将本会话期望的 NAS mounts 注入本轮 cfg。重复传入相同声明是幂等的;同一 session 改绑则拒绝。 */ export declare function resolveNasVolumeDispatchConfig(args: { cfg: OpenClawConfig; config: XgImConfig; agentId: string; sessionKey: string; volumes?: NasVolume[]; }): { cfg: OpenClawConfig; specHash?: string; reused: boolean; }; /** 测试与 Gateway 停止时使用。 */ export declare function clearSessionNasVolumeStates(): void; //# sourceMappingURL=nas-volumes.d.ts.map