description:Send files to users via MEDIA protocol (native attachments) or Markdown links (workspace files) — path rules, Windows quirks, Chinese filename handling, and per-platform limitations.
version:1.3.0
version:1.4.0
author:Hermes Agent
platforms:[windows,linux,macos]
metadata:
...
...
@@ -21,358 +21,163 @@ Hermes detects the `MEDIA:` prefix, validates the path against security rules, a
---
## Quick Reference (常见问题速查)
## ⛔ 核心规则(必须遵守)
| 问题现象 | 可能原因 | 解决方案 |
|---------|---------|---------|
| `Skipping unsafe MEDIA directive path` | Windows 路径格式错误 | 使用 `C:/...` 而非 `/c/...` |
The MEDIA validation runs through Python's `Path.resolve(strict=True)`, which on Windows interprets `/c/Users/...` as a **relative** path (`\c\Users\...` off the current C: drive), not an absolute one. This causes the file to be reported as nonexistent and the path to be skipped as "unsafe".
| Correct ✅ | Wrong ❌ |
|-----------|---------|
| 正确 ✅ | 错误 ❌ |
|---------|---------|
| `MEDIA:C:/Users/...` | `MEDIA:/c/Users/...` |
| `MEDIA:C:\Users\...` | `MEDIA:/C:/Users/...` |
Forward slashes (`C:/Users/...`) work fine — both `Path.resolve()` and Windows APIs accept them.
#### Quick fix when coming from terminal
When you create or find a file in terminal (where `/c/Users/...` paths work), copy it to a cache dir and reference it with the Windows-form path: