← 返回 Skills 市场
kolemaravilla

TokenFlow 词元流

作者 马酷 Maku · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
99
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install tokenflow
功能描述
Convert files and URLs to structured text using the TokenFlow API with customizable per-filetype conversion and fallback options.
使用说明 (SKILL.md)

TokenFlow

Name: tokenflow
Version: 2.0.0
Description: Convert files and URLs to structured text using the TokenFlow API
Author: Iron Lion International
License: MIT


Overview

This skill enables agents to automatically convert supported file types and URLs to structured text using the TokenFlow API. Configuration happens agent-side — edit config.json to set per-filetype behavior.

Supported Platforms: OpenClaw, Hermes


Requirements

  • TOKENFLOW_API_KEY — Your TokenFlow API key (required)
  • Internet access to reach https://tokenflow.fly.dev

Installation

OpenClaw

openclaw skills install tokenflow

Or manually copy this skill directory to ~/.openclaw/skills/.

Hermes

Copy the tokenflow/ skill directory to ~/.hermes/skills/.


Configuration

Edit config.json in the skill directory:

{
  "apiKey": "your-api-key-here",
  "apiUrl": "https://tokenflow.fly.dev",
  "filetypeBehavior": {
    "docx":   { "action": "convert", "askEachTime": false },
    "xlsx":   { "action": "convert", "askEachTime": true },
    "pdf":    { "action": "convert", "askEachTime": false },
    "audio":  { "action": "convert", "askEachTime": false }
  },
  "outputFormat": "markdown",
  "maxRetries": 1,
  "fallbackBehavior": "use_file"
}

Filetype Behavior

Filetype Extensions action askEachTime
docx .docx, .pptx "convert" or "skip" true = prompt user each time
xlsx .xlsx, .xls, .csv "convert" or "skip" true = prompt user each time
pdf .pdf "convert" or "skip" true = prompt user each time

| audio | .wav, .mp3, .ogg, .flac, .m4a | "convert" or "skip" | true = prompt user each time |

Options

  • outputFormat: "markdown" (default) or "html". Agents should use "markdown".
  • maxRetries: 03. Retry count on failure.
  • fallbackBehavior: "use_file" (use original file on failure) or "fail" (report error)

Supported File Types

  • Documents: .pdf, .docx, .pptx, .html, .htm
  • Spreadsheets: .xlsx, .xls, .csv
  • Data: .json, .xml, .txt, .md
  • Audio: .wav, .mp3, .ogg, .flac, .m4a → transcription
  • Archives: .zip

Agent Behavior

On File Attachment

1. Check if extension is supported
   └─ No → Skip, use file as-is

2. Look up filetypeBehavior in config
   ├─ action = "skip" → Skip
   ├─ askEachTime = true and not explicit → Return shouldAsk signal
   └─ action = "convert" → Proceed

3. For XLSX: call /convert/preview to get sheet names
   └─ If multiple sheets, pass sheets="all"

4. Call TokenFlow API: POST /convert
   Headers: Authorization: Bearer {apiKey}
   Body: multipart/form-data with file + output_format=markdown

5. If success (200):
   └─ Return structured text to agent

6. If failure or empty result:
   ├─ Retries \x3C maxRetries → Retry (step 4)
   ├─ Fallback = use_file → Use original file, log warning
   └─ Fallback = fail → Report error to user

On URL Paste

  1. Detect URL in user message
  2. Call POST /convert/url with {url: "..."}
  3. Return structured text from the webpage

API Integration

POST /convert

curl -X POST "https://tokenflow.fly.dev/convert" \
  -H "Authorization: Bearer ${TOKENFLOW_API_KEY}" \
  -F "[email protected]" \
  -F "output_format=markdown"

Response: JSON with markdown or html field.

POST /convert/preview (XLSX only)

curl -X POST "https://tokenflow.fly.dev/convert/preview" \
  -H "Authorization: Bearer ${TOKENFLOW_API_KEY}" \
  -F "[email protected]"

Response: {"sheets": ["Sheet1", "Sheet2"]}

GET /health

curl "https://tokenflow.fly.dev/health"

GET /usage

curl -H "Authorization: Bearer ${TOKENFLOW_API_KEY}" \
  "https://tokenflow.fly.dev/usage"

POST /convert/url

curl -X POST "https://tokenflow.fly.dev/convert/url" \
  -H "Authorization: Bearer ${TOKENFLOW_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Error Handling

Scenario Behavior
API key invalid Log error, use original file (if fallback=use_file)
Quota exceeded (429) Report to user: "TokenFlow quota exceeded"
Rate limited (429) Wait 1s, retry once if retries > 0
File too large (413) Skip conversion, use original file
Unsupported format (400) Skip conversion, use original file
API timeout (5s) Fail fast, use original file
Empty result Treat as failure, apply fallback

Changelog

v2.0.0 (2026-05-13)

  • Agent-agnostic: supports OpenClaw and Hermes
  • Configuration moved agent-side (config.json)
  • Per-filetype behavior with askEachTime option
  • PDFs return markdown with base64-embedded images when outputFormat=markdown
  • Standalone image conversion removed (base64 always inflates tokens)

v1.2.0 (2026-05-05)

  • Added persistent config file
  • Added automatic first-run onboarding
  • Added AGENTS.md sync protocol

v1.0.0 (2026-04-27)

  • Initial release

Support

安全使用建议
This result is low confidence because the artifact files could not be inspected. Re-run the review when metadata.json and the artifact directory are readable so any concrete risks can be evaluated from evidence.
能力标签
requires-sensitive-credentials
能力评估
Purpose & Capability
Unable to assess from artifact content because metadata.json and artifact files could not be read in this run.
Instruction Scope
Unable to assess runtime instructions or scoping because artifact files could not be read.
Install Mechanism
Unable to assess install behavior because install specs and file contents could not be read.
Credentials
Unable to assess requested environment access because artifact contents were unavailable.
Persistence & Privilege
Unable to assess persistence or privilege behavior because artifact contents were unavailable.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install tokenflow
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /tokenflow 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
TokenFlow v1.0.0 — 2026-04-27 What: File/URL → structured text. Agent-agnostic. Converts: PDF, DOCX, PPTX, XLSX, CSV, audio (transcription), ZIP, URLs. Config: Agent-side config.json — per-filetype rules (convert / skip / ask). API: POST /convert, /convert/url, /convert/preview (XLSX sheets), /health, /usage. Error handling: Quota → tell user. Too large / unsupported → skip. 5xx → retry once, fallback. Install: openclaw skills install tokenflow or drop in ~/.hermes/skills/. Needs: TOKENFLOW_API_KEY + network to tokenflow.fly.dev. Live: tokenflow.ironlion.cc
元数据
Slug tokenflow
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

TokenFlow 词元流 是什么?

Convert files and URLs to structured text using the TokenFlow API with customizable per-filetype conversion and fallback options. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 99 次。

如何安装 TokenFlow 词元流?

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

TokenFlow 词元流 是免费的吗?

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

TokenFlow 词元流 支持哪些平台?

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

谁开发了 TokenFlow 词元流?

由 马酷 Maku(@kolemaravilla)开发并维护,当前版本 v1.0.0。

💬 留言讨论