fix: companion 改用 $.fs,修正 /companion 無法載入 #13

Merged
jiantw83 merged 1 commits from fix/companion-engine-fs into main 2026-10-12 06:07:25 +00:00
Contributor

問題

claude plugin validate 回報 hooks 模組 import 了 node:fs/promises(hooks/companion/node-fs.ts),沙箱不允許,整個模組被拒絕載入,所以 /companion 指令從未註冊。

變更

  • 移除 node-fs.ts,新增 engine-fs.ts,以引擎 $.fs 實作 Fs
  • register.tsx 在 session.start 內建立 adapter(驗證器不允許把 $.fs 當值傳遞,故用閉包)
  • Fs.rename 改為選用;$.fs 無 rename,因此改為直接覆寫(失去暫存檔原子寫入)
  • companion 版本號改為 0.0.1

驗證

  • claude plugin validate:通過
  • claude plugin test:14 過 / 11 失敗,與修改前相同(既有問題:測試使用 node:test,沙箱不允許)

🤖 Generated with Claude Code

## 問題 `claude plugin validate` 回報 hooks 模組 import 了 `node:fs/promises`(hooks/companion/node-fs.ts),沙箱不允許,整個模組被拒絕載入,所以 `/companion` 指令從未註冊。 ## 變更 - 移除 `node-fs.ts`,新增 `engine-fs.ts`,以引擎 `$.fs` 實作 `Fs` - `register.tsx` 在 `session.start` 內建立 adapter(驗證器不允許把 `$.fs` 當值傳遞,故用閉包) - `Fs.rename` 改為選用;`$.fs` 無 rename,因此改為直接覆寫(失去暫存檔原子寫入) - companion 版本號改為 0.0.1 ## 驗證 - `claude plugin validate`:通過 - `claude plugin test`:14 過 / 11 失敗,與修改前相同(既有問題:測試使用 `node:test`,沙箱不允許) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
admin added 1 commit 2026-10-12 06:06:58 +00:00
node-fs.ts 引用 node:fs/promises,hooks 沙箱不允許,導致 /companion 指令未註冊。
改為以引擎的 $.fs 包成 Fs adapter;rename 改為選用,無 rename 時直接覆寫。
版本號調整為 0.0.1。

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
jiantw83 merged commit 3d63d168ff into main 2026-10-12 06:07:25 +00:00
jiantw83 deleted branch fix/companion-engine-fs 2026-10-12 06:07:34 +00:00
Author
Contributor

@admin notify:fix: companion 改用 $.fs,修正 /companion 無法載入

@admin notify:fix: companion 改用 $.fs,修正 /companion 無法載入
Author
Contributor

@admin notify:fix: companion 改用 $.fs,修正 /companion 無法載入

@admin notify:fix: companion 改用 $.fs,修正 /companion 無法載入
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jiantw83/jsc-marketplace#13