Commit 19d00cb2 by Hermes Desktop

feat(skills): update media-delivery

parent da3f0f2b
--- ---
name: media-delivery name: media-delivery
description: Send files through messaging platforms via Hermes MEDIA protocol — path rules, Windows quirks, allowed directories, and per-platform limitations. description: Send files through messaging platforms via Hermes MEDIA protocol — path rules, Windows quirks, allowed directories, and per-platform limitations.
version: 1.0.0 version: 1.1.0
author: Hermes Agent author: Hermes Agent
platforms: [windows, linux, macos] platforms: [windows, linux, macos]
metadata: metadata:
...@@ -118,20 +118,175 @@ The gateway auto-detects the content type from the file extension: ...@@ -118,20 +118,175 @@ The gateway auto-detects the content type from the file extension:
### Telegram ### Telegram
- MEDIA protocol fully supported - MEDIA protocol fully supported
- Images, video, audio, documents all work - Images, video, audio, documents all work
- Larger file size limit - Larger file size limit (~2GB)
### Discord / Slack ### Discord / Slack
- MEDIA protocol supported - MEDIA protocol supported
- File-type restrictions may apply per platform - File-type restrictions may apply per platform
- Discord: 25MB (free), 500MB (Nitro)
### WhatsApp / Other Platforms
- MEDIA protocol supported via gateway
- Platform-specific size and type limits apply
--- ---
## 5. Diagnostic Checklist ## 5. Client Chat File Delivery Workflow
When sending files to users during interactive chat sessions, follow this workflow:
### Step 1: Generate or Locate the File
Files can come from various sources:
- **Terminal output**: Logs, reports, data exports
- **Screenshots**: Browser captures, desktop screenshots
- **Code artifacts**: Generated code, config files, test results
- **Media**: Audio recordings, video clips, images
- **Documents**: PDFs, markdown files, spreadsheets
### Step 2: Move File to Cache Directory
**Always copy files to an appropriate cache directory before sending:**
```bash
# For documents (reports, logs, configs)
cp /path/to/file ~/.hermes/cache/documents/
# For images (screenshots, diagrams)
cp /path/to/image ~/.hermes/cache/images/
# For audio (recordings, synthesized speech)
cp /path/to/audio ~/.hermes/cache/audio/
# For videos (recordings, animations)
cp /path/to/video ~/.hermes/cache/videos/
```
**Quick one-liner pattern:**
```bash
# Copy and rename in one step
cp output.log ~/.hermes/cache/documents/chat-session-$(date +%Y%m%d-%H%M%S).log
```
### Step 3: Send with Correct Path Format
**Linux/macOS:**
```
MEDIA:~/.hermes/cache/documents/your-file.txt
```
**Windows (CRITICAL):**
```
MEDIA:C:/Users/YourUsername/.hermes/cache/documents/your-file.txt
```
**Never use:**
- `MEDIA:/c/Users/...` (git-bash format - fails on Windows)
- `MEDIA:~/...` (tilde expansion not reliable)
- `MEDIA:./...` (relative paths - always rejected)
### Common Chat Scenarios
#### Scenario 1: Sending Terminal Output
```bash
# Run command and capture output
your-command > /tmp/output.log
# Move to cache
cp /tmp/output.log ~/.hermes/cache/documents/
# Send to user
MEDIA:C:/Users/YourUsername/.hermes/cache/documents/output.log
```
#### Scenario 2: Sending a Screenshot
```bash
# Capture screenshot (macOS example)
screencapture -i ~/.hermes/cache/images/screenshot-$(date +%s).png
# Send to user
MEDIA:~/.hermes/cache/images/screenshot-1234567890.png
```
#### Scenario 3: Sending Generated Code
```bash
# Write code to file
cat > ~/.hermes/cache/documents/solution.py << 'EOF'
# Your generated code here
EOF
# Send to user
MEDIA:~/.hermes/cache/documents/solution.py
```
#### Scenario 4: Sending Data Export
```bash
# Export data to CSV
python export_data.py --output /tmp/data.csv
# Move to cache
cp /tmp/data.csv ~/.hermes/cache/documents/
# Send to user
MEDIA:C:/Users/YourUsername/.hermes/cache/documents/data.csv
```
### Best Practices
1. **Use descriptive filenames**: Include timestamp or context
-`error-log-2026-07-22-143052.txt`
-`temp.txt`
2. **Clean up old cache files**: Periodically remove files older than 24 hours
```bash
find ~/.hermes/cache -type f -mtime +1 -delete
```
3. **Verify file exists before sending**:
```python
python -c "from pathlib import Path; print('✅' if Path('path').exists() else '❌')"
```
4. **For large files**: Check platform limits
- WeChat: ~100MB
- Telegram: ~2GB
- Discord: ~25MB (free), ~500MB (Nitro)
5. **Don't send sensitive data**: Never place credentials, tokens, or private keys in cache directories
---
## 6. Diagnostic Checklist
If MEDIA delivery fails: If MEDIA delivery fails:
1. **Check gateway logs**: `grep "MEDIA\|media" ~/.hermes/logs/gateway.log` — look for "Skipping unsafe" or "media delivery failed"
2. **Verify file exists**: use Python (not bash) to check: `python -c "import pathlib; print(pathlib.Path('path').resolve(strict=True))"` 1. **Check gateway logs**:
```bash
grep "MEDIA\|media" ~/.hermes/logs/gateway.log
```
Look for "Skipping unsafe" or "media delivery failed"
2. **Verify file exists** (use Python, not bash):
```python
python -c "import pathlib; print(pathlib.Path('path').resolve(strict=True))"
```
3. **Check path format** (Windows): must be `C:/...` not `/c/...` 3. **Check path format** (Windows): must be `C:/...` not `/c/...`
4. **Verify location**: file must be under `~/.hermes/cache/<type>/` or another safe root 4. **Verify location**: file must be under `~/.hermes/cache/<type>/` or another safe root
5. **Check file permissions**: must be a regular file (not a symlink to a denied location) 5. **Check file permissions**: must be a regular file (not a symlink to a denied location)
6. **Try restarting gateway**: `hermes gateway restart` — helps if cache dirs were created mid-session
6. **Try restarting gateway**:
```bash
hermes gateway restart
```
Helps if cache dirs were created mid-session
---
## Related Skills
- [`hermes-agent`](hermes-agent): Configure Hermes itself
- [`markdown-viewer`](markdown-viewer): Create visual diagrams and charts
- [`computer-use`](computer-use): Take screenshots for delivery
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