Files
claude-office/server
JianMiauandClaude Fable 5 a8cb82cd6f LIVE 模式可直接在辦公室對專案派發任務
摘要:
點選專案 agent 後可輸入任務派發,監看伺服器在該專案 cwd spawn
headless session(claude -p),執行過程即時演在辦公室,結束回報事件。

根本原因:
原本實況模式只能唯讀觀察 transcript,無法像 openclaw-office 的
chat.send 一樣從辦公室出手;缺一個能驅動真實 agent 的通道。

影響:
watcher 新增 POST /task(Origin 白名單 5173/5180、每專案排隊上限 3、
15 分鐘逾時);headless 以 acceptEdits 權限執行,等於允許 AI 改檔案,
僅限 localhost 使用。新產生的 session 檔改為從頭讀取,派發過程完整可視。

修法:
- server/watch.mjs:launchTask(prompt 走 stdin 防注入、--resume 支援、
  stderr 摘要回報)、handleTaskRequest(CORS/驗證/排隊)、born-now 檔案從頭 tail
- live.ts:dispatchTask() + task_accepted/task_done 事件對映
- SidePanel:LIVE 模式 TaskComposer(textarea + 續 session 勾選 + Ctrl+Enter)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-20 14:21:25 +08:00
..