evework / agent /lib /agentfs-debug.ts
hunian
feat: 添加 CORS 支持和 session 文件系统,优化沙箱后端逻辑
67a584e
Raw
History Blame Contribute Delete
1.29 kB
/**
* AgentFS 调试与存档公开 API。
*
* 实现拆在 `lib/agentfs-debug/`:
* - browse:只读树 / 文件预览
* - checkpoint:存档创建 / 列表 / 回退 / 删除
* - sessions:磁盘 session 库列表
*
* 供 `channels/agentfs.ts` 与外部前端对接。写操作仅限 checkpoint API。
*/
export {
AGENTFS_DEBUG_MAX_FILE_BYTES,
CHECKPOINT_NAME_RE,
} from "./agentfs-debug/constants.js";
export {
AgentFsDebugError,
jsonError,
mapAgentFsOpenError,
mapFsError,
} from "./agentfs-debug/errors.js";
export {
AGENTFS_BACKEND_NAME,
assertSessionId,
normalizeVirtualPath,
resolveCheckpointDbPath,
resolveCheckpointsDir,
resolveDataDir,
resolveSessionDbPath,
resolveSessionsDir,
} from "./agentfs-debug/paths.js";
export {
assertSessionDbExists,
withAgentFs,
withAgentFsAtPath,
withSessionFileSystem,
} from "./agentfs-debug/open.js";
export { listSessionDbs } from "./agentfs-debug/sessions.js";
export { listTree, readFilePreview } from "./agentfs-debug/browse.js";
export {
createCheckpoint,
deleteCheckpoint,
listCheckpoints,
recursiveCopyFs,
restoreCheckpoint,
} from "./agentfs-debug/checkpoint.js";
export type {
CheckpointInfo,
FilePreview,
SessionDbInfo,
TreeEntry,
} from "./agentfs-debug/types.js";