mirror of
https://git.openapi.site/https://github.com/desirecore/market.git
synced 2026-06-06 04:30:42 +08:00
* feat: skills i18n 改造 — schemaVersion 1.1,零向后兼容
把 21 个 skills + 1 个 agent + manifest/categories 全量迁移到 schemaVersion 1.1
的 i18n 结构,配套 CI AI 翻译流水线(GitHub Models)与本地工具链。
## 关键变更
### 数据结构(破坏性,schemaVersion 1.0 → 1.1)
- SKILL.md: 顶层 name 改为 ASCII slug(== 目录名,符合 agentskills.io 规范);
中文显示名/short_desc/description 全部迁入 metadata.i18n.<locale>
- agents/<id>/agent.json: shortDesc/fullDesc/tags/persona.{role,traits} 迁入
i18n.<locale>;changelog[].changes 改为 { <locale>: string[] } 对象
- categories.json: 每个分类的 label/description 迁入 i18n.<locale>,顶层只剩
color/icon
- manifest.json: 加 supportedLocales / defaultLocale;顶层 description 迁入
i18n.<locale>
### Body 文件结构
- 根 SKILL.md = frontmatter + default_locale (en-US) body
- SKILL.<locale>.md = 各 locale 的 markdown body(首行 <!-- locale: xx --> 自校验)
### 工具链(scripts/i18n/)
- glossary.json: zh→en 术语表 + do_not_translate 白名单
- schema/skill-frontmatter.schema.json: i18n frontmatter JSON Schema
- validate-i18n.py: 8 条校验规则(name 合规 / locale 完整性 / hash 一致性等)
- translate.py: GitHub Models / Anthropic 双 backend,sha256 增量翻译
- migrate.py: 一次性迁移脚本(旧格式 → i18n 结构)
### CI(.github/workflows/)
- i18n-validate.yml: PR 触发跑 validate + translate --check
- i18n-translate.yml: PR 触发用 GitHub Models(默认 openai/gpt-5-mini)翻译缺失
locale,自动追加 commit;可切到 ANTHROPIC_API_KEY 走 Claude
### 文档
- docs/I18N.md: 作者贡献指南(schema 说明 / 提交流程 / 常见问题)
- README.md: 加多语言段落
## 验证
- uv run scripts/i18n/validate-i18n.py: OK,49 文件 0 错误
- uv run scripts/i18n/translate.py --check: 0 stale locale
- 21 skills 标题数 zh-CN == en-US 严格对齐(最大 66=66)
- skills-ref 规范校验:全部通过(顶层 name ASCII slug + description 单字段)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(i18n): 修复 PR #1 review 反馈的 6 项问题
- schema: translated_by 正则放宽为 ^(human|ai:[A-Za-z0-9._:/-]+)$,接受
'ai:github:openai/gpt-5-mini' 这类 backend:model 形式(CI 翻译输出格式)
- README + docs/I18N.md: 修正"CI 用 Claude API"误导描述,正确说明默认是
GitHub Models(openai/gpt-5-mini)+ GITHUB_TOKEN,可选切到 Anthropic
- skills/minimax-tts/SKILL.md & SKILL.zh-CN.md: 删除多余的 ``` 闭合,避免
Markdown 后续渲染错乱
- skills/docx/SKILL.md: 翻译时丢失的 • Unicode escape 示例已恢复,
与 zh-CN 版本对齐
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7.0 KiB
7.0 KiB
name, description, license, version, type, risk_level, status, disable-model-invocation, provider, tags, requires, metadata, market
| name | description | license | version | type | risk_level | status | disable-model-invocation | provider | tags | requires | metadata | market | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| minimax-tts | Use this skill when the user wants to convert text to speech using MiniMax's T2A (Text-to-Audio) API. Supports multiple voice styles, emotional control, and voice cloning. Use when 用户提到 语音合成、文字转语音、TTS、朗读、 读出来、生成语音、生成音频、文本转音频、配音、念出来、MiniMax 语音。 | Complete terms in LICENSE.txt | 1.2.1 | procedural | low | enabled | true | minimax |
|
|
|
|
minimax-tts Skill
Mandatory Rules (violations will cause feature failure)
- Must access agent-service over HTTPS —
https://127.0.0.1:${PORT}with-kto skip certificate verification - Use Bash curl throughout — do not use the HttpRequest tool or Python
Complete Execution Flow
Prerequisites
- The user has configured a MiniMax Media Provider with an API Key under Resources → Compute
- agent-service is running
Voice Selection Guide
| voice_id | Characteristics | Use Cases |
|---|---|---|
| male-qn-qingse | Young male voice | Narration, podcasts |
| female-shaonv | Young female voice | Audiobooks, dialogue |
| female-yujie | Mature female voice | Professional broadcasting |
| presenter_male | Male anchor voice | News, formal occasions |
| presenter_female | Female anchor voice | News, formal occasions |
Generate Speech
MiniMax TTS returns JSON (containing an audio URL or hex data); use "json" for responseType.
PORT=$(cat ~/.desirecore/agent-service.port)
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media-proxy" \
-H "Content-Type: application/json" \
-d '{
"providerId": "provider-minimax-media-001",
"endpoint": "/t2a_v2",
"body": {
"model": "speech-02-hd",
"text": "要转换为语音的文本内容",
"voice_setting": {
"voice_id": "male-qn-qingse",
"speed": 1.0,
"vol": 1.0,
"pitch": 0
},
"audio_setting": {
"format": "mp3",
"sample_rate": 32000
}
},
"responseType": "json"
}'
Response Handling
MiniMax TTS returns JSON which, depending on the request parameters, may contain a URL or hex format:
URL format response (recommended, requires "format": "url" in audio_setting):
{
"success": true,
"data": {
"data": {
"audio": {
"audio_url": "https://...",
"status": 1
}
},
"base_resp": { "status_code": 0, "status_msg": "success" }
},
"statusCode": 200
}
Hex format response (default):
{
"success": true,
"data": {
"data": {
"audio": {
"data": "hex编码的音频数据...",
"status": 1
}
},
"extra_info": {
"audio_length": 12345,
"audio_sample_rate": 32000,
"audio_size": 67890
}
},
"statusCode": 200
}
Download and Upload to media-store
Audio URLs have a time limit, so they must be downloaded immediately and saved to the local media-store.
URL format:
PORT=$(cat ~/.desirecore/agent-service.port)
AUDIO_URL="响应中的audio_url"
curl -sL "$AUDIO_URL" -o /tmp/minimax-tts.mp3 && \
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
-F "file=@/tmp/minimax-tts.mp3;type=audio/mpeg"
Hex format:
PORT=$(cat ~/.desirecore/agent-service.port)
HEX_DATA="响应中的hex数据"
echo -n "$HEX_DATA" | xxd -r -p > /tmp/minimax-tts.mp3 && \
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
-F "file=@/tmp/minimax-tts.mp3;type=audio/mpeg"
Extract the mediaId field from the JSON response.
Display the Result
Reference it in your reply using the dc-media protocol (the frontend will automatically detect the audio extension and render a player):

Parameter Reference
| Parameter | Description | Default |
|---|---|---|
| model | Model | "speech-02-hd" (HD) or "speech-02-turbo" (fast) |
| text | Text to convert | Max 10000 characters |
| voice_setting.voice_id | Voice persona | "male-qn-qingse" |
| voice_setting.speed | Speaking speed | 1.0 |
| voice_setting.vol | Volume | 1.0 |
| voice_setting.pitch | Pitch | 0 |
| audio_setting.format | Audio format | "mp3" |
| audio_setting.sample_rate | Sample rate | 32000 |
Special Syntax
MiniMax TTS supports inserting pause markers in the text:
<#0.5#>— pause for 0.5 seconds<#2#>— pause for 2 seconds- Valid range: 0.01 ~ 99.99 seconds
Example: "你好<#1#>欢迎来到 DesireCore"
Error Handling
success: false+statusCode: 400: empty text or malformed parameterssuccess: false+statusCode: 401: invalid API Keysuccess: false+statusCode: 429: rate limitedsuccess: false+error: "未找到匹配的供应商": MiniMax Media Provider not configured
Notes
- For text exceeding 3000 characters, streaming output is recommended (proxy mode does not yet support streaming)
- Returned audio_url is valid for 24 hours
- Unless the user specifies otherwise, default to
speech-02-hd+male-qn-qingse+ 1.0x speed - For long text, split it into segments of no more than 3000 characters each