beplus-mcp 0.17.2 → 0.18.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/index.js +36 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -428,10 +428,21 @@ function compact(obj) {
|
|
|
428
428
|
}
|
|
429
429
|
return out;
|
|
430
430
|
}
|
|
431
|
+
var CHARGED_FROM_LABEL = {
|
|
432
|
+
budget: "do budget do projeto",
|
|
433
|
+
weekly_allowance: "do cr\xE9dito semanal da equipe",
|
|
434
|
+
unlimited: "sem consumo (limite livre)",
|
|
435
|
+
free: "sem custo (modo relaxed)"
|
|
436
|
+
};
|
|
431
437
|
function costFooter(start, cfg) {
|
|
432
438
|
const parts = [];
|
|
433
|
-
|
|
434
|
-
if (typeof start.
|
|
439
|
+
const paidElsewhere = CHARGED_FROM_LABEL[start.charged_from ?? ""];
|
|
440
|
+
if (typeof start.diamond_cost === "number") {
|
|
441
|
+
parts.push(`Custo: ${start.diamond_cost} \u{1F48E}${paidElsewhere ? ` (${paidElsewhere})` : ""}`);
|
|
442
|
+
}
|
|
443
|
+
if (!paidElsewhere && typeof start.new_balance === "number") {
|
|
444
|
+
parts.push(`Saldo: ${start.new_balance} \u{1F48E}`);
|
|
445
|
+
}
|
|
435
446
|
let footer = parts.join(" \xB7 ");
|
|
436
447
|
if (cfg.costWarnThreshold && typeof start.diamond_cost === "number" && start.diamond_cost > cfg.costWarnThreshold) {
|
|
437
448
|
footer = `\u26A0 Custo alto (${start.diamond_cost} \u{1F48E})
|
|
@@ -546,6 +557,7 @@ var VOICES = [
|
|
|
546
557
|
"Sulafat"
|
|
547
558
|
];
|
|
548
559
|
var ASPECT_RATIOS = ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3", "4:5", "5:4", "21:9"];
|
|
560
|
+
var VIDEO_ASPECT_RATIOS = [...ASPECT_RATIOS, "adaptive"];
|
|
549
561
|
var IMAGE_RESOLUTIONS = ["1K", "2K", "4K"];
|
|
550
562
|
var VIDEO_RESOLUTIONS = ["480p", "720p", "1080p", "4K"];
|
|
551
563
|
var DEFAULTS = {
|
|
@@ -825,7 +837,7 @@ ${BUDGET_BLOCKED_GUIDANCE}`);
|
|
|
825
837
|
model: z.enum(VIDEO_MODELS).default(DEFAULTS.videoModel).describe(
|
|
826
838
|
"seedance-2.0-fast = barato/r\xE1pido; seedance-2.5 = at\xE9 30s num take e 50 refs (m\xE1x 720p); seedance-2.0 = \xFAnico com 1080p/4K; kling-v3-video = alternativa."
|
|
827
839
|
),
|
|
828
|
-
aspect_ratio: z.enum(
|
|
840
|
+
aspect_ratio: z.enum(VIDEO_ASPECT_RATIOS).optional().describe("Propor\xE7\xE3o. Padr\xE3o 16:9. `adaptive` (herda dos inputs) s\xF3 no seedance-2.5."),
|
|
829
841
|
resolution: z.enum(VIDEO_RESOLUTIONS).optional().describe("480p/720p/1080p/4K (1080p/4K S\xD3 no seedance-2.0 standard; 2.5, fast e mini aceitam apenas 480p/720p). Padr\xE3o 720p."),
|
|
830
842
|
duration: z.number().int().min(3).max(60).optional().describe(
|
|
831
843
|
"Dura\xE7\xE3o em segundos. Seedance 2.5: 4\u201330 (granular). Seedance 2.0/2.0-fast: 4\u201315. Kling: 5 ou 10. O backend valida por modelo \u2014 consulte list_models p/ os valores aceitos. Padr\xE3o 5."
|
|
@@ -853,6 +865,19 @@ ${BUDGET_BLOCKED_GUIDANCE}`);
|
|
|
853
865
|
`${args.model} s\xF3 suporta 480p ou 720p (voc\xEA pediu ${args.resolution}). Use seedance-2.0 (standard) para 1080p/4K.`
|
|
854
866
|
);
|
|
855
867
|
}
|
|
868
|
+
if (args.model === "bytedance/seedance-2.5" && args.aspect_ratio) {
|
|
869
|
+
const SEEDANCE_25_RATIOS = ["1:1", "16:9", "9:16", "4:3", "3:4", "21:9", "adaptive"];
|
|
870
|
+
if (!SEEDANCE_25_RATIOS.includes(args.aspect_ratio)) {
|
|
871
|
+
return errorResult(
|
|
872
|
+
`bytedance/seedance-2.5 n\xE3o aceita a propor\xE7\xE3o ${args.aspect_ratio}. Use uma destas: ${SEEDANCE_25_RATIOS.join(", ")}.`
|
|
873
|
+
);
|
|
874
|
+
}
|
|
875
|
+
}
|
|
876
|
+
if (args.last_frame_image && !(args.first_frame_image ?? args.reference_image)) {
|
|
877
|
+
return errorResult(
|
|
878
|
+
"O \xFAltimo frame (`last_frame_image`) s\xF3 funciona junto com o primeiro (`first_frame_image`)."
|
|
879
|
+
);
|
|
880
|
+
}
|
|
856
881
|
if (args.duration != null && args.duration !== -1) {
|
|
857
882
|
const maxDuration = args.model === "bytedance/seedance-2.5" ? 30 : 15;
|
|
858
883
|
if (args.model.startsWith("bytedance/") && (args.duration < 4 || args.duration > maxDuration)) {
|
|
@@ -1347,7 +1372,10 @@ function registerAnalyzeTools(server, client, cfg) {
|
|
|
1347
1372
|
media_urls: z5.array(z5.string().min(1)).max(50).optional().describe(
|
|
1348
1373
|
"M\xEDdia (imagem/v\xEDdeo/\xE1udio/PDF): URLs p\xFAblicas OU caminhos de arquivo local (o MCP sobe pro R2 automaticamente). Pode misturar tipos. Opcional (prompt s\xF3-texto tamb\xE9m funciona)."
|
|
1349
1374
|
),
|
|
1350
|
-
model: z5.enum(["gemini-flash", "gemini-pro"]).default("gemini-flash").optional().describe("gemini-flash = r\xE1pido/barato (Gemini 3.5 Flash); gemini-pro = mais capaz (Gemini 3.1 Pro).")
|
|
1375
|
+
model: z5.enum(["gemini-flash", "gemini-pro"]).default("gemini-flash").optional().describe("gemini-flash = r\xE1pido/barato (Gemini 3.5 Flash); gemini-pro = mais capaz (Gemini 3.1 Pro)."),
|
|
1376
|
+
project: z5.string().optional().describe(
|
|
1377
|
+
'Projeto (uuid ou code curto, ex.: "ICONS") de cujo budget cobrar. Omitido \u2192 usa o projeto ativo da conta.'
|
|
1378
|
+
)
|
|
1351
1379
|
}
|
|
1352
1380
|
},
|
|
1353
1381
|
async (args) => {
|
|
@@ -1357,12 +1385,14 @@ function registerAnalyzeTools(server, client, cfg) {
|
|
|
1357
1385
|
compact({
|
|
1358
1386
|
prompt: args.prompt,
|
|
1359
1387
|
media_urls,
|
|
1360
|
-
model: args.model
|
|
1388
|
+
model: args.model,
|
|
1389
|
+
project: args.project
|
|
1361
1390
|
})
|
|
1362
1391
|
);
|
|
1392
|
+
const origem = res.chargedFrom === "budget" ? "restam no budget do projeto" : res.chargedFrom === "weekly_allowance" ? "restam no cr\xE9dito semanal" : res.chargedFrom === "unlimited" ? "limite livre" : "saldo pessoal";
|
|
1363
1393
|
const footer = `
|
|
1364
1394
|
|
|
1365
|
-
\u2014 ${res.diamondsUsed} \u{1F48E} (
|
|
1395
|
+
\u2014 ${res.diamondsUsed} \u{1F48E} (${res.newBalance} ${origem}) \xB7 ${res.model} \xB7 ${res.inputTokens}\u2192${res.outputTokens} tok`;
|
|
1366
1396
|
return textResult(`${res.text}${footer}`);
|
|
1367
1397
|
} catch (e) {
|
|
1368
1398
|
return errorResult(apiErrorToUserMessage(e));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "beplus-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"description": "Conector MCP da equipe BePlus — gere imagens/vídeos/áudio e consulte calls, projetos e clientes pela sua conta BePlus (diamantes, limites e histórico aplicados pela plataforma).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|