file-transfer
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-06-10
- Stars
- ★ 3
- Forks
- 0
03 SKILL.md 正文
File Transfer Skill
Overview
Context-aware file transfer skill for OpenClaw ecosystem. Intelligently transfers files based on conversation context with progress tracking.
Features
- Context-Aware: Automatically detects group/private chat and infers transfer intent
- File Validation: MIME type checking, size limits, chunked reading
- Telegram Support: Full adapter with progress tracking (simulated)
- Extensible: Adapter pattern for adding new channels
Installation
npm install file-transfer
Usage
Basic File Transfer
import { FileTransferSkill } from 'file-transfer';
const skill = new FileTransferSkill({
channels: { telegram: { enabled: true } }
});
const result = await skill.sendFileWithContext({
file: '/path/to/document.pdf',
caption: 'Team weekly report',
context: { chatId: '-1003655501651' }
});
Direct Adapter Usage
import { TelegramAdapter } from 'file-transfer/src/adapters/telegram-adapter.js';
const adapter = new TelegramAdapter();
const result = await adapter.sendFile({
filePath: '/path/to/file.pdf',
chatId: '-1003655501651',
caption: 'Document sharing'
});
Tool Definitions
sendFileWithContext
Transfers a file with intelligent context detection.
Parameters:
file(string, required): Path to the filecaption(string, optional): File descriptioncontext(object, optional): Conversation context withchatId
Returns:
success(boolean): Transfer success statusmessageId(string): Message IDcontext(object): Context analysis result (scenario, urgency, confidence)stats(object): Transfer statistics (size, duration, channel)
getTransferHistory
Retrieves file transfer history.
Parameters:
options(object, optional): Query options
Returns:
history(array): Transfer history recordsstats(object): Transfer statistics
Configuration
const skill = new FileTransferSkill({
contextEngine: {
enableAI: false,
maxHistoryLength: 10
},
file: {
maxFileSize: 100 * 1024 * 1024, // 100MB
allowedMimeTypes: ['application/pdf', 'image/jpeg', ...]
},
channels: {
telegram: {
enabled: true,
maxFileSize: 50 * 1024 * 1024 // 50MB
}
}
});
Context Analysis
The ContextEngine analyzes file transfers and returns:
| Field | Values | Description |
|---|---|---|
| scenario | share, backup, collaborate, archive |
Transfer intent |
| urgency | low, medium, high, critical |
Priority level |
| confidence | 0.0 - 1.0 | Analysis confidence |
| fileCategory | document, image, video, archive, code |
File classification |
Current Limitations
- Telegram adapter uses simulated transfer (no real API integration yet)
- WhatsApp and Discord adapters are planned but not implemented
- Transfer history is not persisted
Testing
npm test # All tests
npm run test:unit # Unit tests
npm run test:integration # Integration tests
License
MIT License - see LICENSE for details.
04 同仓库更多 Skills
youtube-content
YouTube transcripts to summaries, threads, blogs.
xurl
X/Twitter via xurl CLI: post, search, DM, media, v2 API.
touchdesigner-mcp
Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.
test-driven-development
TDD: enforce RED-GREEN-REFACTOR, tests before code.
teams-meeting-pipeline
Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.