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 摘要。