feat: 市场转型为元数据注册表(pointer entry + 许可署名) (#33)

## 概述 / Summary

把 market 从「内容仓库」转型为「元数据注册表」的仓库侧改动,配合客户端 PR

[desirecore/desirecore#919](https://github.com/desirecore/desirecore/pull/919)
与

[ADR-038](https://github.com/desirecore/desirecore-docs/blob/main/技术/决策/ADR-038-市场元数据注册表与两层技能模型.md)。

原则:market 只放元数据、不放第三方内容;内置技能仍 bundled(有界例外)。每条第三方条目用
`entry.json`(元数据 + `source` 指针),正文放各自源仓库、安装时按需获取。

## 改动 / Changes

### S10 — minimax 迁出为官方独立仓库
- `minimax-image-gen` / `minimax-tts`(均 `author=desirecore`)迁至新建的官方开源仓库

**[desirecore/skills-minimax](https://github.com/desirecore/skills-minimax)**(MIT,monorepo,
  一仓多技能)。
- market 改用 `skills/<id>/entry.json` 的 pointer 引用(`source.path`
指入子目录,`ref` 锁定
  commit `6e39eee`),删除内联 `SKILL.md`。

### S11 — 许可署名合规
- 新增根 `LICENSE`(MIT)与 `THIRD_PARTY_NOTICES.md`。
- 标注 Anthropic **docx/pdf/pptx/xlsx 为 source-available(非开源、仅供演示参考)**、
frontend-design 等为 Apache-2.0;每条 entry 的 `license`/`redistribution`
为单条真相源。

### S12 — 外部技能改为纯 pointer(取代 #32 的 vendoring)
- 把 [#32](https://github.com/desirecore/market/pull/32) 的 10 个外部技能写成
`entry.json`
  pointer(**不再 vendor 上游源码**):
  - MIT/MIT-0 → `partner`/`community` + `allowed`
  - 无声明许可(meituan / netease)→ `pointer` + `source-pointer-only`
  - luckin 打包产物 → `pointer` + `verify-package-terms`(`source.kind=zip`)

## 说明 / Notes

- 外部条目的 `name`/`category` 为基于上游 URL 的合理初值,后续可随上游元数据完善。
- 客户端(#919)已支持 `entry.json` 读/装与体积守护栏;本 PR 合并后,主仓库需重新
  `npm run sync-market` 重打包 `defaults/market.zip`。

> 注:`follow-builders`(zarazhangrui/follow-builders, MIT)是 #32
`external-skills.json` 外部技能集合中的一员,属本次迁移范畴,非额外引入。

Co-authored-by: yi-ge <jackyoncode@gmail.com>
This commit is contained in:
2026-06-28 21:06:20 +08:00
committed by GitHub
parent 2bcbcbc9e2
commit 5b7708a612
18 changed files with 347 additions and 624 deletions

View File

@@ -1,148 +0,0 @@
---
name: minimax-image-gen
description: >-
Use this skill when the user wants to generate images using MiniMax's
image-01 model. Supports text-to-image and subject reference for character
consistency. Use when 用户提到 生成图片、画图、文生图、创建图片、
AI 绘画、生成插图、画一张、帮我画、设计图片、MiniMax 画图。
license: Complete terms in LICENSE.txt
version: 1.3.1
type: procedural
risk_level: low
status: enabled
disable-model-invocation: true
provider: minimax
tags:
- media
- image
- generation
- minimax
requires:
tools:
- Bash
metadata:
author: desirecore
updated_at: '2026-04-25'
i18n:
default_locale: en-US
source_locale: zh-CN
locales:
- zh-CN
- en-US
zh-CN:
name: MiniMax 文生图
short_desc: 基于 MiniMax image-01 的文本生成图片技能
description: >-
Use this skill when the user wants to generate images using MiniMax's image-01 model. Supports text-to-image and subject reference for character consistency. Use when 用户提到 生成图片、画图、文生图、创建图片、 AI 绘画、生成插图、画一张、帮我画、设计图片、MiniMax 画图。
body: ./SKILL.zh-CN.md
source_hash: sha256:4630268ef3bd4e23
translated_by: human
en-US:
name: MiniMax Image Generation
short_desc: Text-to-image generation skill powered by MiniMax image-01
description: >-
Use this skill when the user wants to generate images using MiniMax's image-01 model. Supports text-to-image and subject reference for character consistency. Use when the user mentions generate images, draw a picture, text-to-image, create an image, AI painting, generate illustration, draw one for me, help me draw, design an image, MiniMax drawing.
body: ./SKILL.md
source_hash: sha256:4630268ef3bd4e23
translated_by: human
translated_at: '2026-05-03'
market:
icon: >-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0
24 24" fill="none"><rect x="3" y="3" width="18" height="18" rx="3"
stroke="#34C759" stroke-width="1.5" fill="#34C759"
fill-opacity="0.1"/><circle cx="8.5" cy="8.5" r="2" stroke="#34C759"
stroke-width="1.2"/><path d="M3 16l5-5 4 4 3-3 6 6" stroke="#34C759"
stroke-width="1.5" stroke-linecap="round"
stroke-linejoin="round"/></svg>
category: media
maintainer:
name: DesireCore Official
verified: true
channel: latest
listed: false
---
# minimax-image-gen Skill
## Mandatory Rules (violations will cause feature failure)
1. **Must use `"response_format": "url"`**`"base64"` is forbidden, base64 will cause output truncation
2. **Must access agent-service over HTTPS**`https://127.0.0.1:${PORT}` with `-k` to skip certificate verification
3. **Must upload to media-store via `/api/media/upload`** — saving to local paths is forbidden
4. **Must use the `dc-media://` protocol to display images** — the only way the frontend can render correctly
5. **Use Bash curl throughout** — do not use the HttpRequest tool or Python
## Complete Execution Flow (strictly follow these three steps)
### Step 1: Call the API to generate the image
```bash
PORT=$(cat ${DESIRECORE_ROOT}/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": "/image_generation",
"body": {
"model": "image-01",
"prompt": "这里替换为英文图片描述",
"aspect_ratio": "1:1",
"response_format": "url",
"n": 1
},
"responseType": "json"
}'
```
Extract `data.data.image_urls[0]` from the JSON response to obtain the image URL.
### Step 2: Download and upload to media-store
```bash
PORT=$(cat ${DESIRECORE_ROOT}/agent-service.port)
IMAGE_URL="第一步拿到的图片URL"
curl -sL "$IMAGE_URL" -o /tmp/minimax-gen.png && \
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
-F "file=@/tmp/minimax-gen.png;type=image/png"
```
Extract the `mediaId` field from the JSON response (format like `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png`).
### Step 3: Display the image with the dc-media protocol
Write Markdown image syntax directly in your reply text:
```
![图片描述](dc-media://这里替换为mediaId)
```
For example: `![白色的猫坐在书桌上](dc-media://a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6.png)`
The frontend will automatically convert `dc-media://` into an accessible image URL and render it.
## Parameter Mapping
| User Intent | aspect_ratio |
|---------|-------------|
| Square / avatar | "1:1" |
| Landscape / scenery / wallpaper | "16:9" |
| Portrait / phone / poster | "9:16" |
| Standard photo | "4:3" |
| Portrait photo | "3:4" |
## Subject Reference (character consistency)
Add `subject_reference` in the body:
```json
"subject_reference": [
{ "type": "character", "image_file": { "url": "参考图片URL" } }
]
```
## Error Handling
- `"error": "未找到匹配的供应商"`: MiniMax Media Provider not configured
- `statusCode: 401`: Invalid API Key
- `statusCode: 429`: Rate limited, retry later

View File

@@ -1,85 +0,0 @@
<!-- locale: zh-CN -->
# minimax-image-gen 技能
## 强制规则(违反将导致功能失败)
1. **必须使用 `"response_format": "url"`** — 禁止 `"base64"`base64 会导致输出截断
2. **必须用 HTTPS 访问 agent-service**`https://127.0.0.1:${PORT}``-k` 跳过证书验证
3. **必须通过 `/api/media/upload` 上传到 media-store** — 禁止保存到本地路径
4. **必须使用 `dc-media://` 协议展示图片** — 唯一能让前端正确渲染的方式
5. **全程使用 Bash curl** — 不要使用 HttpRequest 工具或 Python
## 完整执行流程(严格按此三步执行)
### 第一步:调用 API 生成图片
```bash
PORT=$(cat ${DESIRECORE_ROOT}/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": "/image_generation",
"body": {
"model": "image-01",
"prompt": "这里替换为英文图片描述",
"aspect_ratio": "1:1",
"response_format": "url",
"n": 1
},
"responseType": "json"
}'
```
从 JSON 响应中提取 `data.data.image_urls[0]` 得到图片 URL。
### 第二步:下载并上传到 media-store
```bash
PORT=$(cat ${DESIRECORE_ROOT}/agent-service.port)
IMAGE_URL="第一步拿到的图片URL"
curl -sL "$IMAGE_URL" -o /tmp/minimax-gen.png && \
curl -sk -X POST "https://127.0.0.1:${PORT}/api/media/upload" \
-F "file=@/tmp/minimax-gen.png;type=image/png"
```
从 JSON 响应中提取 `mediaId` 字段(格式如 `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.png`)。
### 第三步:用 dc-media 协议展示图片
在你的回复文本中直接写 Markdown 图片语法:
```
![图片描述](dc-media://这里替换为mediaId)
```
例如:`![白色的猫坐在书桌上](dc-media://a1b2c3d4-e5f6-47a8-b9c0-d1e2f3a4b5c6.png)`
前端会自动将 `dc-media://` 转为可访问的图片 URL 并渲染出来。
## 参数映射
| 用户意图 | aspect_ratio |
|---------|-------------|
| 正方形/头像 | "1:1" |
| 横版/风景/壁纸 | "16:9" |
| 竖版/手机/海报 | "9:16" |
| 标准照片 | "4:3" |
| 竖版照片 | "3:4" |
## 主体参考(角色一致性)
在 body 中添加 `subject_reference`
```json
"subject_reference": [
{ "type": "character", "image_file": { "url": "参考图片URL" } }
]
```
## 错误处理
- `"error": "未找到匹配的供应商"`:未配置 MiniMax Media Provider
- `statusCode: 401`API Key 无效
- `statusCode: 429`:频率限制,稍后重试

View File

@@ -0,0 +1,36 @@
{
"id": "minimax-image-gen",
"name": "MiniMax 图像生成",
"category": "media",
"tags": [
"minimax",
"media"
],
"latestVersion": "1.3.1",
"i18n": {
"zh-CN": {
"name": "MiniMax 图像生成",
"shortDesc": "MiniMax 图像生成"
},
"en-US": {
"name": "MiniMax Image Generation",
"shortDesc": "MiniMax Image Generation"
}
},
"maintainer": {
"name": "DesireCore",
"verified": true,
"account": "desirecore",
"url": "https://github.com/desirecore"
},
"stewardship": "official",
"license": "MIT",
"redistribution": "allowed",
"source": {
"kind": "git",
"repoUrl": "https://github.com/desirecore/skills-minimax.git",
"repoBranch": "main",
"path": "minimax-image-gen",
"ref": "6e39eee2ad39632a21f43ed997983e70594b2b8a"
}
}