计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
feishu_file_fetch【效率与协作】Implements a Clawdbot extension tool that downloads Feishu files by message_id and file_key, streams to disk with sha256, size limits, and path traversal protection. Use when the user asks to build or update the feishu_file_fetch tool, Feishu file download workflow, or Clawdbot extension handling message_id/file_key inputs.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Create or update the reference implementation at scripts/feishu_file_fetch.py. It should:
{ message_id, file_key, type="file", outdir="/root/clawd/uploads", max_bytes=104857600 }{ ok, path, filename, bytes, sha256, error? }FEISHU_APP_ID / FEISHU_APP_SECRET to fetch and cache tenant_access_token (refresh 2 minutes before expiry).GET https://open.feishu.cn/open-apis/im/v1/messages/{message_id}/resources/{file_key}?type={type} with Authorization: Bearer <token>.outdir/yyyyMMdd/, parse filename from Content-Disposition, fallback to file_key.bin.max_bytes strictly (terminate and delete temp file if exceeded).outdir.Content-Length exceeds max_bytes, fail early.os.replace on success.echo '{"message_id":"om_xxx","file_key":"file_xxx"}' | python scripts/feishu_file_fetch.py