Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Export one file helper over workspace.fs

未关闭
#261 1 条评论 1 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@aron-cf 已经在做这个了。

开始于 2026年10月20日。

评估

这个 Issue 还没有评估数据。

描述

enhancement

Three packages carry their own copy of the same small helper over workspace.fs:

  • WorkspaceFileStore in packages/computer/src/tools/common/fs/store.ts (internal to the tools)
  • WorkspaceFiles in @cloudflare/think (packages/think/src/workspace-files.ts in cloudflare/agents)
  • createSkillWorkspaceFiles / createSkillWorkspaceAccess in agents/skills (packages/agents/src/skills/workspace.ts in cloudflare/agents)

Each one does the same things:

  • reads a file into bytes or text, returning null instead of throwing ENOENT
  • writes a file, creating its parent directories first
  • drains a readFile stream into one Uint8Array
  • lists a directory as plain entries

Think and the skills package also both define WORKSPACE_ROOT = "/workspace" and a helper that resolves relative paths against it. That root is Computer's convention, not theirs.

Proposal: export one helper from @cloudflare/computer, for example WorkspaceFileStore or a workspaceFiles(workspace) function, plus the workspace root constant. It should work on a Workspace, a loaded getWorkspace client and a lazy one, since it only uses fs methods that return promises. Then Think and agents/skills import it and delete their copies.

Follow-up in cloudflare/agents once this ships: replace WorkspaceFiles in Think and the skills helpers with the Computer export.

主要语言
TypeScript
星标
9.7k
派生
577
平均合并
1 天 15 小时
30 天内合并 PR
79

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cloudflare/computer 的其他 Issue

查看 cloudflare/computer 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。