capsule-fs README

The project's README from github.com/unicity-aos/capsule-fs. As one markdown file: README.md.

astrid-capsule-fs

License: MIT OR Apache-2.0 MSRV: 1.94

Filesystem tools for Astrid OS agents.

In the OS model, this capsule is the coreutils package. It gives agents the ability to read, write, search, and navigate the workspace filesystem through the kernel's VFS airlock.

Tools

Tool Description
read_file Read file contents with optional line range (start_line, end_line)
write_file Write content to a file
replace_in_file Replace an exact string match in a file (rejects 0 or >1 occurrences)
list_directory List entries in a directory
grep_search Recursive content search with depth, file count, and match count caps
create_directory Create a directory
delete_file Delete a file (session-created files only, no whiteout support yet)
move_file Move a file with 10MB size limit, existence checks, and rollback on failure

All operations go through the VFS airlock. The kernel enforces path boundaries, copy-on-write isolation, and capability checks before any host filesystem access occurs.

Development

cargo build --target wasm32-unknown-unknown --release

License

Dual-licensed under MIT and Apache 2.0.

Copyright (c) 2025-2026 Joshua J. Bouw and Unicity Labs.

capsule-fs (unicity-aos/capsule-fs)

Searching Database…

这是什么?capsule-fs 是 Unicity AOS(也称 Astrid OS)内 AI 智能体使用的文件系统工具包:它为智能体提供 readfile、writefile、replaceinfile、listdirectory、grepsearch、createdirectory、deletefile 和 movefile 等工具,所有操作都经由操作系统内核的 VFS 气闸(airlock)调度。
这是独立的应用,还是要接入更大的系统?它是一个“capsule”(模块),接入 Unicity AOS 内核,相当于该智能体操作系统的 coreutils 软件包,而不是独立运行的程序。
这些工具没有 Unicity AOS 的其他部分也能用吗?不能。每项操作都要经过内核的 VFS 气闸,它会在触碰真实文件系统之前,检查路径边界、写时复制隔离和权限能力。
删除或移动文件有限制吗?有限制:deletefile 只能删除当前会话中创建的文件(目前还不支持 whiteout 标记);movefile 有 10MB 的大小上限,并会检查文件是否存在,失败时回滚。
如果匹配到不止一处,replaceinfile 会怎么做?它会直接拒绝这次修改。replaceinfile 只在字符串完全匹配且在文件中恰好出现一次时才会执行,以避免意外改写多处内容。
grepsearch 能做什么?它是递归的内容搜索工具,对搜索深度、扫描文件数量和返回的匹配条数都设有上限,因此智能体无法触发失控的搜索。
VFS airlock 具体能防范什么?它是内核的文件系统访问守门人:在任何工具接触宿主文件系统之前,它会检查路径边界、通过写时复制隔离写入操作,并验证权限能力。
What are similar projects?SPACE, just-bash, mirage, agentbox, composio, coop, arc-code, computer
Size
0.2 MB
Stars
8.4K
Age
7mo
Commits · 90 Days