← 返回 Skills 市场
ghostwritten

File Transfer

作者 Ghostwritten · GitHub ↗ · v0.2.0 · MIT-0
cross-platform ✓ 安全检测通过
136
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install file-transfer
功能描述
Transfers files intelligently based on chat context with MIME validation and progress tracking, supporting Telegram and extensible channels.
使用说明 (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 file
  • caption (string, optional): File description
  • context (object, optional): Conversation context with chatId

Returns:

  • success (boolean): Transfer success status
  • messageId (string): Message ID
  • context (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 records
  • stats (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.

安全使用建议
This package appears to implement what it claims: a local, simulated file-transfer library with Telegram adapter logic but no real network/bot integration and no credential requests. Before installing: 1) prefer obtaining the package from a trusted registry or the referenced GitHub repo to confirm provenance; 2) if you later enable a real Telegram adapter, be careful where you provide the bot token (only pass it to code you trust) and verify the adapter's implementation for secure storage/usage of tokens; 3) note the library will create temp files under /tmp by default—if that is a concern set a custom tempDir; 4) the package simulates chunk data in readFileInChunks rather than streaming actual file bytes — review and modify that behavior before using with real transfers. If you want further assurance, provide the exact npm package source (registry URL or tarball) or run a dependency audit/build in an isolated environment and I can re-evaluate.
功能分析
Type: OpenClaw Skill Name: file-transfer Version: 0.2.0 The 'file-transfer' skill bundle is a well-documented and professionally structured framework for managing file transfers within the OpenClaw ecosystem. It features a ContextEngine for intent analysis, a FileManager for size and MIME-type validation, and a TelegramAdapter that currently operates in a simulation mode. The code follows standard security practices for file handling, such as path validation and temporary file cleanup, and includes a comprehensive suite of unit and integration tests. No evidence of malicious intent, data exfiltration, or unauthorized execution was found across the source code (src/), documentation (docs/), or agent instructions (SKILL.md).
能力评估
Purpose & Capability
Name/description match the implementation: a FileTransferSkill with a ContextEngine, FileManager, and a TelegramAdapter (simulated). The code implements MIME checks, chunking, progress tracking and context analysis as advertised. Minor metadata mismatch: registry says 'instruction-only' but the package includes full source and package.json with a GitHub repo URL.
Instruction Scope
SKILL.md instructs using the library API (import and call sendFileWithContext or adapter methods). It does not instruct reading unrelated files, environment variables, or sending data to unexpected external endpoints. The README/SKILL.md and code consistently note that Telegram integration is simulated and no bot token or external network call is performed by the current code.
Install Mechanism
No install spec in the registry, but package.json is present and references normal npm installation. There are no downloads from arbitrary URLs or extract/install steps. Dependencies are minimal and from npm (mime-types).
Credentials
The skill requests no environment variables, no credentials, and no external config paths. Example/chat IDs are provided only as parameters. The code does not attempt to read other environment secrets.
Persistence & Privilege
The skill is not always-enabled and may be invoked by the model normally. It writes temporary files under /tmp (default tempDir '/tmp/file-transfer'); this is proportionate to file transfer functionality but you should be aware it will create and delete temp files on disk while in use.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install file-transfer
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /file-transfer 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v0.2.0
Rename from openclaw-file-transfer-skill: package is platform-agnostic, works with any AI agent (Claude, OpenAI, OpenClaw)
元数据
Slug file-transfer
版本 0.2.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

File Transfer 是什么?

Transfers files intelligently based on chat context with MIME validation and progress tracking, supporting Telegram and extensible channels. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 136 次。

如何安装 File Transfer?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install file-transfer」即可一键安装,无需额外配置。

File Transfer 是免费的吗?

是的,File Transfer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

File Transfer 支持哪些平台?

File Transfer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 File Transfer?

由 Ghostwritten(@ghostwritten)开发并维护,当前版本 v0.2.0。

💬 留言讨论