Xpersona
F

File Transfer

CLAWHUB · Unverified

Transfers files intelligently based on chat context with MIME validation and progress tracking, supporting Telegram and extensible channels. Skill: File Transfer Owner: ghostwritten Summary: Transfers files intelligently based on chat context with MIME validation and progress tracking, supporting Telegram and extensible channels. Tags: ai-agent:0.2.0, context-aware:0.2.0, file-transfer:0.2.0, latest:0.2.0, telegram:0.2.0 Version history: v0.2.0 | 2026-04-08T02:03:35.533Z | user Rename from openclaw-file-transfer-skill: package is platform-agnostic, works

62
Rank
84
Safety
1.1k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1.1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s179kb8zt5gmn7mp4vz82ts7cs83gm2h:file-transfer
  1. Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
  2. Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-ghostwritten-file-transfer/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

27,109 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

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
```bash
npm install file-transfer
```

## Usage

### Basic File Transfer
```javascript
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
```javascript
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

```javascript
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

```bash
npm test                  # All tests
npm run test:u

README.md

# OpenClaw File Transfer Skill

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Node.js Version](https://img.shields.io/badge/node-%3E%3D18.0.0-brightgreen)](https://nodejs.org/)
[![OpenClaw Skill](https://img.shields.io/badge/OpenClaw-Skill-orange)](https://openclaw.ai)

A context-aware file transfer skill for the OpenClaw ecosystem. Intelligently transfers files based on conversation context (group chat vs private chat) with smart notifications and progress tracking.

## Features

- **Context-Aware Transfers**: Automatically detects group/private chat contexts and infers transfer intent
- **Smart File Validation**: MIME type checking, size limits, chunked reading for large files
- **Telegram Integration**: Full Telegram adapter with progress tracking and transfer status
- **Extensible Architecture**: Adapter pattern for adding new channels (WhatsApp, Discord planned)

## Installation

### From Source
```bash
git clone https://github.com/Ghostwritten/file-transfer.git
cd file-transfer
npm install
```

## Quick Start

### Using FileTransferSkill
```javascript
import { FileTransferSkill } from './src/index.js';

const skill = new FileTransferSkill({
  channels: {
    telegram: { enabled: true, maxFileSize: 50 * 1024 * 1024 }
  }
});

const result = await skill.sendFileWithContext({
  file: '/path/to/document.pdf',
  caption: 'Team weekly report',
  context: { chatId: '-1003655501651' }
});
```

### Using TelegramAdapter Directly
```javascript
import { TelegramAdapter } from './src/adapters/telegram-adapter.js';

const adapter = new TelegramAdapter({
  maxFileSize: 50 * 1024 * 1024,
  chunkSize: 10 * 1024 * 1024
});

const result = await adapter.sendFile({
  filePath: '/path/to/document.pdf',
  chatId: '-1003655501651',
  caption: 'Project document sharing'
});

console.log('Transfer ID:', result.transferId);
console.log('Context analysis:', result.analysis);
```

### Using Core Modules
```javascript
import { ContextEngine } from './src/core/context-engine.js';
import { FileManager } from './src/core/file-manager.js';

// Analyze context
const engine = new ContextEngine();
const analysis = await engine.analyzeContext({
  fileName: 'report.pdf',
  fileSize: 1024000,
  fileType: 'application/pdf',
  chatInfo: { isGroupChat: true, chatType: 'group' }
});

// Validate file
const manager = new FileManager();
const validation = await manager.validateFile('/path/to/file.pdf');
```

## Architecture

```
file-transfer/
├── src/
│   ├── index.js                   # Main entry - FileTransferSkill class
│   ├── core/
│   │   ├── context-engine.js      # Intelligent context analysis
│   │   └── file-manager.js        # File validation and management
│   ├── adapters/
│   │   └── telegram-adapter.js    # Telegram platform adapter
│   └── utils/
│       └── format.js              # Shared utilities (formatBytes)
├── tests/
│   ├── unit/                      # Unit tests
│   └── integration/             

_meta.json

{
  "ownerId": "kn779kw2dh5t8sj57v3at2msax82hpfn",
  "slug": "file-transfer",
  "version": "0.2.0",
  "publishedAt": 1775613815533
}

docs/API.md

# API Reference

## Table of Contents
- [FileTransferSkill](#filetransferskill)
- [ContextEngine](#contextengine)
- [FileManager](#filemanager)
- [TelegramAdapter](#telegramadapter)

## FileTransferSkill

Main orchestrator class for file transfer operations.

### Constructor
```javascript
import { FileTransferSkill } from './src/index.js';

const skill = new FileTransferSkill({
  contextEngine: { enableAI: false },
  file: { maxFileSize: 100 * 1024 * 1024 },
  channels: {
    telegram: { enabled: true }
  }
});
```

### `sendFileWithContext(options)` -> `Promise<Object>`

Send a file with context-aware intelligence.

**Parameters:**
```javascript
{
  file: string,           // Path to the file
  caption?: string,       // File description
  context?: {             // Conversation context
    chatId: string
  },
  metadata?: object       // Additional metadata
}
```

**Returns:**
```javascript
{
  success: boolean,
  messageId: string,
  context: ContextAnalysis,
  stats: {
    size: string,         // Human-readable size
    duration: number,     // Milliseconds
    channel: string       // Channel name
  }
}
```

### `getTransferHistory(options?)` -> `Promise<Object>`

Returns transfer history (currently returns empty result).

### `configure(newConfig)` -> `void`

Update skill configuration. Reinitializes channels if channel config changes.

### `getStatus()` -> `Object`

Returns `{ version, channels, uptime }`.

---

## ContextEngine

Intelligent context analysis engine for file transfers.

### Constructor
```javascript
import { ContextEngine } from './src/core/context-engine.js';

const engine = new ContextEngine({
  enableAI: false,              // AI analysis (not yet implemented)
  maxHistoryLength: 10,         // Max history messages to analyze
  scenarioWeights: {            // Custom scenario weights
    share: 1.0,
    backup: 0.8,
    collaborate: 1.2,
    archive: 0.6
  }
});
```

### `analyzeContext(context)` -> `Promise<ContextAnalysis>`

Main analysis method.

**Parameters:**
```javascript
{
  filePath?: string,
  fileName?: string,
  fileSize?: number,          // Bytes
  fileType?: string,          // MIME type
  caption?: string,
  chatInfo?: {
    isGroupChat: boolean,
    chatType: 'private' | 'group' | 'channel'
  },
  userInfo?: object,
  history?: string[]          // Message history
}
```

**Returns (ContextAnalysis):**
```javascript
{
  scenario: 'share' | 'backup' | 'collaborate' | 'archive',
  urgency: 'low' | 'medium' | 'high' | 'critical',
  recommendedTargets: string[],
  metadata: {
    fileType: string,
    fileSize: number,
    fileName: string,
    chatType: string,
    userIntent: string
  },
  isGroupChat: boolean,
  chatType: string,
  fileCategory: 'document' | 'image' | 'video' | 'archive' | 'code',
  timestamp: string,          // ISO 8601
  confidence: number          // 0.0 - 1.0
}
```

### `categorizeFile(mimeType)` -> `string`

Classifies a MIME type into a category: `document`, `image`, `video`, `arch

docs/CONTRIBUTING.md

# 贡献指南

感谢你对 OpenClaw File Transfer Skill 项目的兴趣!我们欢迎各种形式的贡献,包括bug报告、功能建议、文档改进和代码提交。

## 🎯 如何贡献

### 1. 报告问题

如果你发现bug或有功能建议,请先检查是否已有相关issue:

1. 访问 [GitHub Issues](https://github.com/Ghostwritten/openclaw-file-transfer-skill/issues)
2. 搜索相关问题
3. 如果没有找到,创建新issue

**创建issue时请提供**:
- 清晰的问题描述
- 复现步骤
- 期望行为 vs 实际行为
- 环境信息(Node版本、操作系统等)
- 相关日志或截图

### 2. 提交代码

#### 第一步:Fork仓库

1. 访问 https://github.com/Ghostwritten/openclaw-file-transfer-skill
2. 点击右上角的 "Fork" 按钮
3. 克隆你的fork到本地:
   ```bash
   git clone https://github.com/你的用户名/openclaw-file-transfer-skill.git
   cd openclaw-file-transfer-skill
   ```

#### 第二步:设置上游仓库

```bash
git remote add upstream https://github.com/Ghostwritten/openclaw-file-transfer-skill.git
git fetch upstream
```

#### 第三步:创建功能分支

```bash
# 从main分支创建新分支
git checkout -b feature/your-feature-name

# 或修复bug
git checkout -b fix/issue-123
```

**分支命名规范**:
- `feature/` - 新功能
- `fix/` - bug修复
- `docs/` - 文档更新
- `refactor/` - 代码重构
- `test/` - 测试相关
- `chore/` - 构建或工具更新

#### 第四步:开发代码

1. 编写代码,遵循[代码规范](#代码规范)
2. 添加或更新测试
3. 更新相关文档
4. 运行测试确保通过

```bash
# 运行测试
npm test

# 代码检查
npm run lint

# 代码格式化
npm run format
```

#### 第五步:提交更改

```bash
# 添加更改
git add .

# 提交(遵循约定式提交)
git commit -m "feat: add context analysis for image files"

# 或使用交互式提交
npm run commit
```

**提交信息格式**:
```
类型(范围): 描述

正文(可选)

脚注(可选)
```

**类型**:
- `feat`: 新功能
- `fix`: bug修复
- `docs`: 文档更新
- `style`: 代码格式(不影响功能)
- `refactor`: 代码重构
- `test`: 测试相关
- `chore`: 构建过程或辅助工具
- `perf`: 性能优化
- `ci`: CI配置

**示例**:
```
feat(core): add image file type detection

- Add support for JPEG, PNG, GIF formats
- Update file validation logic
- Add unit tests for new functionality

Closes #123
```

#### 第六步:同步上游更改

```bash
# 获取上游最新更改
git fetch upstream

# 合并到当前分支
git merge upstream/main

# 或使用rebase(保持历史整洁)
git rebase upstream/main
```

#### 第七步:推送分支

```bash
git push origin feature/your-feature-name
```

#### 第八步:创建Pull Request

1. 访问你的GitHub fork
2. 点击 "New Pull Request"
3. 选择你的分支
4. 填写PR模板
5. 等待代码审查

## 📋 Pull Request 模板

创建PR时,请使用以下模板:

```markdown
## 描述
<!-- 简要描述这个PR做了什么 -->

## 相关Issue
<!-- 关联的issue,例如:Closes #123 -->

## 类型
<!-- 选择一项 -->
- [ ] Bug修复
- [ ] 新功能
- [ ] 文档更新
- [ ] 代码重构
- [ ] 测试相关
- [ ] 其他

## 测试
<!-- 描述你如何测试这些更改 -->

- [ ] 单元测试已添加/更新
- [ ] 集成测试已添加/更新
- [ ] 所有测试通过

## 检查清单
- [ ] 代码遵循项目规范
- [ ] 已添加/更新相关文档
- [ ] 已添加/更新测试
- [ ] 提交信息遵循约定式提交
- [ ] 没有引入新的警告或错误
```

## 🧪 代码规范

### 通用规范

1. **使用ES6+语法**
2. **每个文件一个主要导出**
3. **使用JSDoc注释**
4. **遵循Airbnb JavaScript Style Guide**

### 文件结构

```javascript
// 1. 导入
import { something } from 'module';

// 2. 常量
const CONSTANT = 'value';

// 3. 类定义
export class MyClass {
  constructor(config) {
    this.config = config;
  }

  // 公共方法
  publicMethod() {
    // 实现
  }

  // 私有方法
  _privateMethod() {
    // 实现
  }
}

// 4. 辅助函数
function helper() {
  // 实现
}

// 5. 默认导出
export default MyClass;
```

### 测试规范

1. **每个测试文件对应一个源文件**
2. **使用描述性测试名称**
3. **遵循AAA模式** (Arrange, Act, Assert)
4. **覆盖率目标80%+**

```javascript
describe('ClassName', () => {
 

Sponsored

Ads related to File Transfer and adjacent AI workflows.