@vikingmute: Cloudflare 除了一个刚出了 computer 的库理念非常有趣:https://github.com/cloudflare/computer… 一个在 Durable Object 里的虚拟文件系统,基于 SQLite 做持久化…
摘要
Cloudflare 发布了名为 computer 的预览库,在 Durable Object 中提供基于 SQLite 的虚拟文件系统,并支持多种运行时后端(容器、隔离 shell、隔离 JavaScript),为 Agent 提供持久化工作空间。
查看缓存全文
缓存时间: 2026/08/03 23:54
Cloudflare 除了一个刚出了 computer 的库理念非常有趣:https://github.com/cloudflare/computer…
一个在 Durable Object 里的虚拟文件系统,基于 SQLite 做持久化,通过 workspace.runtime 提供不同类型的 runtime: Container,把 SQLite 状态通过 FUSE 挂载到真实的 Linux 沙箱容器 Isolate Shell:模拟出来的、轻量级的假 Shell,在 Dynamic Worker 里跑 just-bash Isolate JavaScript:在隔离的 Dynamic Worker 里支持 JS runtime
让每个 Agent 都能拥有自己的持久化工作空间,并且能在不同 runtime 动态切换,不同的任务可以用不同的,可以兼顾性能和速度,非常有趣,很有想象力。
cloudflare/computer
Source: https://github.com/cloudflare/computer
Cloudflare Computer
Cloudflare Computer is a virtual filesystem that lives inside a
Durable Object. The Durable Object holds the authoritative state in
SQLite and exposes one pluggable execution surface through
workspace.runtime. Three backends ship today:
- Container projects the SQLite state into a sandbox container as
a real FUSE mount. A sandbox-side daemon (
computerd) mounts the state as a filesystem and syncs changes back over a capnweb RPC channel. Full Linux userland, real binaries, real network. - Isolate shell runs just-bash in a Dynamic Worker. It reaches the authoritative Workspace over Workers RPC, so there is no second store or sync round trip.
- Isolate JavaScript runs an ECMAScript module in a fresh Dynamic
Worker with structured input/results, durable relative imports,
configured libraries, Workspace-backed
node:fs/promises, and trustedws:gitandws:artifactsmodules.
A Workspace may register multiple backends under stable IDs.
workspace.runtime.exec(source, { backend }) is the single execution
entry point; the selected backend defines whether source is a shell
command or an ECMAScript module. Backends connect lazily on first use.
Workspace can also be constructed without a backend at all, giving callers the filesystem on its own.
PREVIEW ONLY This package is provided as a preview for feedback only. APIs are unstable and the design is subject to change.
Suitable for experiments, exploration and prototypes. It is NOT suitable for production use at this time.
The specification under
docs/is forward-looking — read it for intent, not as description of the code today.
Using it
If you want to build on Cloudflare Computer, install
@cloudflare/computer and follow that
package’s README — it has the installation steps, the entrypoint map,
and worked examples of the fs and runtime surfaces.
To work on this repository itself, see
CONTRIBUTING.md for setup, build, and test
instructions.
Examples
The examples/ directory holds runnable consumers of the
public surface. Each is a Worker workspace with its own README.
examples/container— runscomputerdinside a container, mounts a workspace, and talks to a Durable Object over capnweb. Awrite/read/execHTTP surface.examples/worker-shell— same HTTP surface as the container example, but the shell runs just-bash in a Dynamic Worker loaded throughenv.LOADER. No container.examples/worker-javascript— mirrorsworker-shell, butexecevaluates an ECMAScript module in a Dynamic Worker instead of running a shell command.examples/think— a@cloudflare/thinkchat agent that uses the workspace as its working directory, reachable from a terminal.examples/think-compare-runtimes— a web UI that runs the same agent task against the container and worker runtimes side by side.examples/tutorial— a step-by-step build: one endpoint, one agent that writes a markdown recipe card on the host and runspandocon it in the container to produce a PDF.examples/artifacts— generates a Worker project in a workspace and publishes it to Cloudflare Artifacts as a clone-ready repo.examples/assets— turns a prompt into an image with Workers AI, writes it to the workspace, and returns a shareable link through@cloudflare/computer/assets.
Repository layout
The repo is a small monorepo. Each package has its own README with package-specific status and usage notes.
packages/dofs(@cloudflare/dofs) — Durable Object SQLite-backed virtual filesystem, sync protocol building blocks, and a@platformatic/vfsprovider for Node.packages/rpc(@cloudflare/computer-rpc) — capnweb wire types and server/client helpers shared between the Durable Object andcomputerd.packages/computerd(@cloudflare/computerd) — thecomputerddaemon: a FUSE mount plus HTTP/WebSocket RPC server that runs inside the sandbox container.packages/computer(@cloudflare/computer) — the top-level Computer package consumed by Durable Objects. Work in progress.packages/computer-computerd-linux-x64(@cloudflare/computer-computerd-linux-x64) — the prebuiltcomputerdbinary for linux-x64, distributed for use in container images.
Performance
computerd’s FUSE mount beats real disk on metadata-heavy work and
trails it on large sequential I/O. See
docs/19_performance.md for the full fs-bench
numbers, a cloudflare/sandbox-sdk npm install comparison, and how
to reproduce them.
Documentation
docs/— design specification. Forward-looking; treat as intent.docs/19_performance.md— filesystem benchmarks.
Contributing
See CONTRIBUTING.md for setup, formatting,
testing, commit message, and pull request conventions.
If you’re working in this repo as an agent, start with
AGENTS.md and the skills under
.agents/skills/.
License
MIT. See LICENSE.
相似文章
@geekbb: Cloudflare 出品,给 AI agent 配了一台"电脑" 给 Agent 一个永不消失的工作区。SQLite 存文件,三种环境(完整容器 / shell / JS)随时开,换环境不换文件。
Cloudflare Computer is a virtual filesystem inside a Durable Object that gives AI agents a persistent workspace, using SQLite for storage and pluggable runtimes (container, shell, JavaScript). It's a preview-only open-source package.
cloudflare/computer
Cloudflare Computer 是一个构建在 Durable Objects 上的预览版虚拟文件系统,具有可插拔的运行时,支持容器、Shell 和 JavaScript,从而在 Cloudflare Workers 上实现有状态的无服务器计算。
@realchendahuang: 我感觉大家对 Cloudflare 的开发程度依然不足 1%。 它现在出了太多的功能。 对象存储用 R2。 后端 API 用 worker。 AI 网关用 AI Gateway。 重计算的,用 Container。 缓存用 KV。 数据库…
本推文介绍了Cloudflare提供的多种开发功能,包括对象存储R2、后端API Worker、AI网关AI Gateway、容器、缓存KV、数据库D1和PostgreSQL连接HyperDrive等,强调其价格便宜、功能丰富且免费额度充足。
celld — Durable Objects, self-hosted
celld is a self-hosted, distributed server that runs Cloudflare Workers and Durable Objects code unchanged, using your own S3 bucket for storage and coordination. It claims significantly lower costs and sub-millisecond warm latencies at scale, with data stored in SQLite/LTX format.
@geekbb: 这个好,一个开源内存层,让 Claude、ChatGPT、Cursor 和 Codex 共享一个大脑。 主要是它部署在 Cloudflare Workers 上,把记忆放在你自己 Cloudflare 账号里,对外走 MCP,数据落在用户…
Second Brain is an open-source memory layer that lets Claude, ChatGPT, Cursor, and Codex share persistent, semantic searchable memory, deployed on Cloudflare Workers for user-controlled storage.