maestro/docs/tools/downloadfile.md
2026-06-03 05:08:00 +00:00

51 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# DownloadFile
URL からファイルをダウンロードしてワークスペースに保存する。
## 基本
```js
DownloadFile({
url: "https://example.com/chart.png",
filename: "images/sales-chart.png",
section: "output"
})
```
## パラメータ
- `url`: ダウンロード元 URL
- `filename`: 保存先パスsection 配下からの相対パス)
- `section`: `"input"``"output"` (成果物に使う場合は `"output"`
## ファイル命名規約
### 画像(成果物に埋め込む場合)
- パス: `images/{わかりやすい名前}.png` (または .jpg / .webp / .gif
- section: `"output"`
- 命名は内容を表すスラッグkebab-case 推奨): `sales-q3-chart.png`, `product-screenshot-home.png`
### ダウンロード履歴
`logs/downloads.jsonl` に各ダウンロードのメタ情報URL, 保存先, サイズ)が記録される。
## 成果物への画像埋め込み
ダウンロードした画像は Markdown レポートから相対パスで埋め込める:
```markdown
![Q3 売上推移](./images/sales-q3-chart.png)
```
レポートoutput/report.mdと画像output/images/*.pngが同じ section 配下にあれば `./images/` で参照可能。
## SSRF 保護
WebFetch と同じく、ローカル/プライベート IP はデフォルトブロック。Settings UI の「SSRF Allowed Hosts」で例外設定可能。
## 注意
- 大きすぎるファイル数百MB以上はタイムアウトしやすい
- バイナリファイルPDF, 動画等)も保存可能だが、画像以外の用途では IngestDocument / TranscribeAudio 等の専用ツールも検討