@modelbay/mcp 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/derive.mjs +17 -8
- package/dist/generate.mjs +1 -1
- package/package.json +2 -2
package/dist/derive.mjs
CHANGED
|
@@ -61,9 +61,18 @@ function collectModelIds(model) {
|
|
|
61
61
|
for (const alias of model.aliases.short ?? []) push(alias);
|
|
62
62
|
return ids;
|
|
63
63
|
}
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
/**
|
|
65
|
+
* 声明里参与这项能力的模型(按声明顺序)。
|
|
66
|
+
*
|
|
67
|
+
* native 工具(重排序、文件转写、音频生成……):有声明了该操作的专用模型时只列这些;
|
|
68
|
+
* 没有时排除标了其他 native 操作的模型(如 speech_to_text 不列文件转写模型)。
|
|
69
|
+
* 通用能力工具不筛:有的模型既能按能力调用,又带一个附加的 native 操作(如 MiniMax-H3-Image)。
|
|
70
|
+
*/
|
|
71
|
+
function modelsForCapability(models, capability, nativeOp) {
|
|
72
|
+
const scoped = models.filter((model) => model.capabilities.includes(capability));
|
|
73
|
+
if (!nativeOp) return scoped;
|
|
74
|
+
const dedicated = scoped.filter((model) => model.native?.includes(nativeOp));
|
|
75
|
+
return dedicated.length ? dedicated : scoped.filter((model) => !model.native?.length);
|
|
67
76
|
}
|
|
68
77
|
/**
|
|
69
78
|
* 用 core 的 schema 函数从声明派生模型参数部分:
|
|
@@ -79,7 +88,7 @@ function deriveModelParameterPart(models, capability, channel, nativeOp) {
|
|
|
79
88
|
const notices = [];
|
|
80
89
|
const details = [];
|
|
81
90
|
const optionProperties = {};
|
|
82
|
-
const scoped = modelsForCapability(models, capability);
|
|
91
|
+
const scoped = modelsForCapability(models, capability, nativeOp);
|
|
83
92
|
for (const model of scoped) {
|
|
84
93
|
for (const id of collectModelIds(model)) if (!ids.includes(id)) ids.push(id);
|
|
85
94
|
const notice = lifecycleNotice(model);
|
|
@@ -140,8 +149,8 @@ function deriveParamProperties(models, capability, modelParams, channel) {
|
|
|
140
149
|
* 生成工具说明里的模型清单:每个模型一行,写它的上限和生命周期提示。
|
|
141
150
|
* 内容全部来自声明,改声明这段文字就跟着变。
|
|
142
151
|
*/
|
|
143
|
-
function deriveModelDetails(models, capability) {
|
|
144
|
-
const scoped = modelsForCapability(models, capability);
|
|
152
|
+
function deriveModelDetails(models, capability, nativeOp) {
|
|
153
|
+
const scoped = modelsForCapability(models, capability, nativeOp);
|
|
145
154
|
if (!scoped.length) return "";
|
|
146
155
|
return scoped.map((model) => {
|
|
147
156
|
const limits = modelLimitsText(model);
|
|
@@ -172,8 +181,8 @@ function deriveDefaultNote(entry, models, capability, channel, nativeOp) {
|
|
|
172
181
|
* 工具的完整说明 = 目录里手写的平台说明 + 运行时派生的模型清单。
|
|
173
182
|
* 模型清单里每个模型一行,带它的上限与生命周期提示。
|
|
174
183
|
*/
|
|
175
|
-
function deriveToolDescription(base, models, capability) {
|
|
176
|
-
const details = deriveModelDetails(models, capability);
|
|
184
|
+
function deriveToolDescription(base, models, capability, nativeOp) {
|
|
185
|
+
const details = deriveModelDetails(models, capability, nativeOp);
|
|
177
186
|
if (!details) return base;
|
|
178
187
|
return `${base}\n可用模型(由声明派生):\n${details}\n`;
|
|
179
188
|
}
|
package/dist/generate.mjs
CHANGED
|
@@ -67,7 +67,7 @@ function buildTool(entry, channel, models, defaultCapability, nodeOnly) {
|
|
|
67
67
|
const inputSchema = deriveInputSchema(entry, models, capability, channel, nativeOp);
|
|
68
68
|
const annotations = deriveAnnotations(meta.nature);
|
|
69
69
|
const note = deriveDefaultNote(entry, models, capability, channel, nativeOp);
|
|
70
|
-
const description = `${deriveToolDescription(entry.description, models, capability)}${note ? `\n${note}\n` : ""}`;
|
|
70
|
+
const description = `${deriveToolDescription(entry.description, models, capability, nativeOp)}${note ? `\n${note}\n` : ""}`;
|
|
71
71
|
return {
|
|
72
72
|
name: entry.name,
|
|
73
73
|
description,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@modelbay/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "MCP server for Volcengine Ark, Alibaba Bailian, MiniMax, Doubao Speech and OpenAI: image, video, speech, music and chat tools for Claude Code, Codex, Cursor and Claude Desktop",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"zod": "^4.6"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"modelbay": "0.
|
|
58
|
+
"modelbay": "0.5.0"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
61
|
"@modelbay/ark": "0.1.0",
|