Commit 2098ba35 by Hermes Desktop

feat(skills): update media-delivery

parent bc838215
......@@ -503,7 +503,7 @@ If MEDIA delivery fails, check in this order:
Helps if cache dirs were created mid-session
8. **Check workspace security policy**:
- Markdown links only work for files in `~/.hermes/workspace/`
- Markdown links only work for files in the **session's workspace** (not necessarily `~/.hermes/workspace/`)
- Files in `~/.hermes/cache/` will fail with "File is outside the session"
- See: `references/workspace-security-policy.md` for details
......
......@@ -16,7 +16,9 @@ When attempting to send files with long Chinese filenames from `~/.hermes/cache/
**This is a Hermes security policy restriction, NOT a platform-specific issue.**
Hermes enforces that files must be within the **session workspace** (`~/.hermes/workspace/`) for Markdown link delivery. Even though `~/.hermes/cache/` directories are listed as "safe roots" for MEDIA protocol, the **Markdown link delivery** path has stricter restrictions that only allow files within the active workspace.
Hermes enforces that files must be within the **session workspace** for Markdown link delivery. Even though `~/.hermes/cache/` directories are listed as "safe roots" for MEDIA protocol, the **Markdown link delivery** path has stricter restrictions that only allow files within the **active session's workspace**.
**Key point**: The workspace is the session-specific working directory (which may be `~/.hermes/workspace/` or another path configured for the session), NOT necessarily the default `~/.hermes/workspace/`.
**Applies to all deployment scenarios:**
- Hermes running locally on macOS/Linux/Windows
......@@ -44,15 +46,16 @@ cp "/Users/zhaoyuehui/.hermes/workspace/测试文件.md" "/Users/zhaoyuehui/.her
### Workaround A: Keep Files in Workspace (Recommended)
Always copy files to `~/.hermes/workspace/` before sending:
Always copy files to the session workspace before sending:
```bash
cp "/path/to/source/file.md" ~/.hermes/workspace/
# Or check your session's workspace path first
```
Then send:
```markdown
[文件名](</Users/zhaoyuehui/.hermes/workspace/文件名.md>)
[文件名](</path/to/session/workspace/文件名.md>)
```
### Workaround B: Base64 Encoding (Most Reliable)
......@@ -98,7 +101,9 @@ When encountering `File is outside the session and Hermes workspaces`:
2. **Verify if in workspace**:
```bash
[[ "/path/to/file" == ~/.hermes/workspace/* ]] && echo "In workspace" || echo "Not in workspace"
# Check if file is in the session's workspace
WORKSPACE=$(hermes config get workspace.path 2>/dev/null || echo "~/.hermes/workspace")
[[ "/path/to/file" == "$WORKSPACE"* ]] && echo "In workspace" || echo "Not in workspace"
```
3. **Try copying to workspace**:
......@@ -137,9 +142,13 @@ When encountering `File is outside the session and Hermes workspaces`:
## Key Takeaway
**Hermes security policy restricts Markdown file links to `~/.hermes/workspace/` only. Files in `~/.hermes/cache/` directories will fail with "File is outside the session and Hermes workspaces" error, regardless of deployment platform.**
**Hermes security policy restricts Markdown file links to the session's workspace directory only. Files in `~/.hermes/cache/` directories will fail with "File is outside the session and Hermes workspaces" error, regardless of deployment platform.**
The workspace is the **session-specific working directory**, which may be:
- Default: `~/.hermes/workspace/`
- Custom: Configured per session via `workdir` parameter
Use one of these alternatives:
1. Copy file to workspace (preferred for small/medium files)
1. Copy file to the session workspace (preferred for small/medium files)
2. Use base64 encoding (works for any file, any location)
3. Display content directly (for small files)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment