beplus-mcp 0.42.0 → 0.44.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/README.md +3 -3
- package/dist/index.js +78 -33
- package/dist/index.js.map +1 -1
- package/dist/remote-server.js +78 -33
- package/dist/remote-server.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -235,10 +235,10 @@ BEPLUS_API_TOKEN=pat_… npx @modelcontextprotocol/inspector node dist/index.js
|
|
|
235
235
|
|
|
236
236
|
### SeedAudio 1.0
|
|
237
237
|
|
|
238
|
-
Use `generate_audio` com `model: "seed-audio-1.0"`, `text` e direção opcional em `style_instruction`. Omita `voice` ou use `seed-auto`. Texto e direção somados: até 2700 caracteres.
|
|
238
|
+
Use `generate_audio` com `model: "seed-audio-1.0"`, `text` e direção opcional em `style_instruction`. Omita `voice` ou use `seed-auto`. Texto e direção somados: até 2700 caracteres. Diálogo com referências usa marcadores `@Audio1: fala` e `@Audio2: fala`, não `multi_speaker` nem vozes Gemini.
|
|
239
239
|
|
|
240
|
-
Para referência, passe `seed_reference` como arquivo local no stdio ou URL pública no conector remoto.
|
|
240
|
+
Para referência, passe `seed_reference` como arquivo local no stdio ou URL pública no conector remoto. Ou passe até 3 fontes em `seed_references`, na ordem dos marcadores `@Audio1`, `@Audio2` e `@Audio3`. Cada áudio deve ter de 1 a 30 segundos, e a soma deve ter até 3 MiB, com `seed_consent: true` após autorização explícita da pessoa. O MCP envia os bytes diretamente ao backend, sem publicar um novo arquivo de referência. O modo remoto mantém a proteção de caminhos locais e rede privada.
|
|
241
241
|
|
|
242
|
-
A resposta inclui o ID da geração. Para repetir
|
|
242
|
+
A resposta inclui o ID da geração. O volume nativo usa `seed_loudness_rate`: inteiro de -50 (50%) a 100 (200%), com 0 (100%) como padrão. Para repetir todas as vozes, use esse ID em `seed_reference_generation_id` e confirme novamente `seed_consent`. Só referências de gerações da própria conta são aceitas. Essa referência por pedido é separada das vozes próprias do Gemini.
|
|
243
243
|
|
|
244
244
|
O conector remoto também precisa da nova versão do pacote no backend. Ordem de entrega: configurar `SEEDAUDIO_API_KEY` e disponibilizar o backend TTS, atualizar o pacote MCP no backend, depois disponibilizar IA Lab e Canvas.
|
package/dist/index.js
CHANGED
|
@@ -23619,8 +23619,8 @@ function probeBuffer(b, mime) {
|
|
|
23619
23619
|
return meta;
|
|
23620
23620
|
}
|
|
23621
23621
|
if (mime.startsWith("audio/")) {
|
|
23622
|
-
const
|
|
23623
|
-
return
|
|
23622
|
+
const seconds2 = probeWav(b) ?? probeFlac(b) ?? (mime === "audio/mpeg" ? probeMp3(b) : null);
|
|
23623
|
+
return seconds2 ? { duration: round(seconds2) } : null;
|
|
23624
23624
|
}
|
|
23625
23625
|
return null;
|
|
23626
23626
|
}
|
|
@@ -23876,12 +23876,14 @@ function registerAudioTools(server, client, cfg) {
|
|
|
23876
23876
|
"generate_audio",
|
|
23877
23877
|
{
|
|
23878
23878
|
title: "Gerar \xE1udio (TTS)",
|
|
23879
|
-
description: 'Sintetiza fala a partir de texto e retorna a URL usando o IA Lab da BePlus. SeedAudio 1.0 (seed-audio-1.0) aceita dire\xE7\xE3o e
|
|
23879
|
+
description: 'Sintetiza fala a partir de texto e retorna a URL usando o IA Lab da BePlus. SeedAudio 1.0 (seed-audio-1.0) aceita dire\xE7\xE3o, volume e at\xE9 3 refer\xEAncias de voz em seed_references (ou seed_reference legado), com seed_consent. Para v\xE1rias vozes, marque todas no texto: @Audio1: Ol\xE1. @Audio2: Oi. Um ID pr\xF3prio em seed_reference_generation_id reutiliza todas as refer\xEAncias. Texto e dire\xE7\xE3o somados at\xE9 2700 caracteres. N\xE3o aceita multi_speaker nem vozes Gemini. Modelos Gemini 3.8 (`gemini-3.8-flash-lite-tts`, padr\xE3o, r\xE1pido e barato; `gemini-3.8-flash-tts`, qualidade de est\xFAdio, melhor para di\xE1logo e narra\xE7\xE3o longa) aceitam: vozes da biblioteca (milhares, por idioma; liste com `list_tts_voices` e passe o id em `voice`), tags vocais no texto como <laugh> <chuckle> <sigh> <breath> <gasp> <cough> <sneeze> <throat-clearing> <yawn> <groan> <scream> <whimper> <argh> <short pause> <long pause> (viram som de verdade), e estilo por locutor (`style` em cada speaker). No 3.8, `style_instruction` \xE9 dire\xE7\xE3o e N\xC3O \xE9 lida em voz alta. Os modelos legados (`gemini-3.1-flash-tts-preview`, `gemini-2.5-pro-preview-tts`) s\xF3 aceitam as 30 vozes cl\xE1ssicas (Kore, Puck, Charon...) e n\xE3o t\xEAm voz da biblioteca. Vozes pr\xF3prias (voice_xxx; liste com `list_custom_voices`, crie com `design_voice`) s\xF3 no 3.8 e sem `multi_speaker`. No 3.8, dire\xE7\xE3o por linha: `(sussurrando) texto` no in\xEDcio da linha vale at\xE9 a pr\xF3xima dire\xE7\xE3o; no di\xE1logo, `Ana (rindo): fala`; rea\xE7\xF5es `|hmm|` `|aham|` no meio da fala (s\xF3 di\xE1logo). Opcional `style_instruction` (ex.: "fale animado e pausado") e di\xE1logo com 2 locutores via `multi_speaker`. Consome diamantes por segundo de \xE1udio.' + TEAM_GATING_NOTE,
|
|
23880
23880
|
inputSchema: {
|
|
23881
23881
|
text: external_exports.string().min(1).max(1e4).describe("Texto a ser falado."),
|
|
23882
23882
|
voice: topVoiceSchema.optional().describe(VOICE_HELP_TOP + " No SeedAudio, omita ou use seed-auto."),
|
|
23883
23883
|
seed_reference: external_exports.string().min(1).optional().describe("SeedAudio: arquivo local (stdio) ou URL p\xFAblica de uma voz autorizada, de 1 a 30 s e at\xE9 3 MiB. N\xE3o \xE9 publicado pelo MCP."),
|
|
23884
|
-
|
|
23884
|
+
seed_references: external_exports.array(external_exports.string().min(1)).min(1).max(3).optional().describe("SeedAudio: at\xE9 3 arquivos locais (stdio) ou URLs p\xFAblicas, na ordem @Audio1, @Audio2, @Audio3. Cada \xE1udio de 1 a 30 s; soma de at\xE9 3 MiB. Use todos os marcadores no texto quando houver v\xE1rias vozes."),
|
|
23885
|
+
seed_loudness_rate: external_exports.number().int().min(-50).max(100).optional().describe("SeedAudio: volume nativo. -50 = 50%, 0 = 100% (normal), 100 = 200%."),
|
|
23886
|
+
seed_reference_generation_id: external_exports.string().uuid().optional().describe("Reutiliza a refer\xEAncia de uma gera\xE7\xE3o SeedAudio sua. Alternativa a seed_reference e seed_references; reutiliza todas as vozes da gera\xE7\xE3o."),
|
|
23885
23887
|
seed_consent: external_exports.literal(true).optional().describe("Confirme apenas ap\xF3s autoriza\xE7\xE3o expl\xEDcita da pessoa para usar sua voz. Obrigat\xF3rio com refer\xEAncia."),
|
|
23886
23888
|
model: external_exports.enum(TTS_MODELS).default(DEFAULTS.ttsModel).describe("Modelo TTS."),
|
|
23887
23889
|
style_instruction: external_exports.string().max(2e3).optional().describe("Instru\xE7\xE3o de estilo/tom aplicada \xE0 fala."),
|
|
@@ -23896,12 +23898,19 @@ function registerAudioTools(server, client, cfg) {
|
|
|
23896
23898
|
try {
|
|
23897
23899
|
const seed = args.model === "seed-audio-1.0";
|
|
23898
23900
|
const voice = args.voice ?? (seed ? "seed-auto" : DEFAULTS.voice);
|
|
23899
|
-
const hasReference = !!(args.seed_reference || args.seed_reference_generation_id);
|
|
23900
|
-
if (!seed && (hasReference || args.seed_consent || voice === "seed-auto")) return errorResult("Os controles SeedAudio exigem seed-audio-1.0.");
|
|
23901
|
-
if (seed && (voice !== "seed-auto" || args.multi_speaker)) return errorResult("SeedAudio usa seed-auto
|
|
23902
|
-
if (args.seed_reference
|
|
23901
|
+
const hasReference = !!(args.seed_reference || args.seed_references || args.seed_reference_generation_id);
|
|
23902
|
+
if (!seed && (hasReference || args.seed_consent !== void 0 || args.seed_loudness_rate !== void 0 || voice === "seed-auto")) return errorResult("Os controles SeedAudio exigem seed-audio-1.0.");
|
|
23903
|
+
if (seed && (voice !== "seed-auto" || args.multi_speaker)) return errorResult("SeedAudio usa seed-auto. Para v\xE1rias vozes, use seed_references e marcadores @Audio, sem multi_speaker.");
|
|
23904
|
+
if ([args.seed_reference, args.seed_references, args.seed_reference_generation_id].filter(Boolean).length > 1) return errorResult("Use apenas uma origem de refer\xEAncia.");
|
|
23903
23905
|
if (hasReference && !args.seed_consent) return errorResult("Confirme a autoriza\xE7\xE3o da voz em seed_consent.");
|
|
23904
23906
|
if (seed && args.text.trim().length + (args.style_instruction?.trim().length ?? 0) > 2700) return errorResult("SeedAudio: texto e dire\xE7\xE3o devem somar at\xE9 2700 caracteres.");
|
|
23907
|
+
const referenceSources = args.seed_references ?? (args.seed_reference ? [args.seed_reference] : []);
|
|
23908
|
+
if (seed && !args.seed_reference_generation_id) {
|
|
23909
|
+
const markersIn = (value) => (value.match(/@Audio[^\s:,.!?;"'()\[\]{}]*/gi) ?? []).map((token) => /^@Audio[1-3]$/.test(token) ? Number(token.slice(6)) : 0);
|
|
23910
|
+
const markers = markersIn(args.text);
|
|
23911
|
+
const allMarkers = [...markers, ...markersIn(args.style_instruction ?? "")];
|
|
23912
|
+
if (allMarkers.some((index) => index < 1 || index > referenceSources.length) || referenceSources.length > 1 && referenceSources.some((_, index) => !markers.includes(index + 1))) return errorResult("Use os marcadores @Audio1, @Audio2 e @Audio3 correspondentes a todas as refer\xEAncias enviadas.");
|
|
23913
|
+
}
|
|
23905
23914
|
const ms = args.multi_speaker;
|
|
23906
23915
|
const voices = [voice, ms?.speaker1.voice, ms?.speaker2.voice].filter((v) => !!v);
|
|
23907
23916
|
if (isCustomVoice(voice)) {
|
|
@@ -23922,14 +23931,18 @@ function registerAudioTools(server, client, cfg) {
|
|
|
23922
23931
|
return errorResult("O estilo por locutor (`style`) s\xF3 funciona nos modelos Gemini 3.8.");
|
|
23923
23932
|
}
|
|
23924
23933
|
}
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
23929
|
-
|
|
23934
|
+
const seedReferences = [];
|
|
23935
|
+
let remainingBytes = 3 * 1024 * 1024;
|
|
23936
|
+
for (const source of referenceSources) {
|
|
23937
|
+
const file = await (isRemoteRef(source) ? loadRemote(source, remainingBytes) : loadLocal(source, remainingBytes));
|
|
23938
|
+
if (!file.buf.length || file.buf.length > remainingBytes) return errorResult("As refer\xEAncias devem somar at\xE9 3 MiB.");
|
|
23939
|
+
remainingBytes -= file.buf.length;
|
|
23940
|
+
seedReferences.push({ audio: file.buf.toString("base64"), mime: file.mime });
|
|
23930
23941
|
}
|
|
23931
23942
|
const body2 = compact({
|
|
23932
|
-
seedReference,
|
|
23943
|
+
seedReference: args.seed_reference ? seedReferences[0] : void 0,
|
|
23944
|
+
seedReferences: args.seed_references ? seedReferences : void 0,
|
|
23945
|
+
seedLoudnessRate: args.seed_loudness_rate,
|
|
23933
23946
|
seedReferenceGenerationId: args.seed_reference_generation_id,
|
|
23934
23947
|
seedConsent: args.seed_consent,
|
|
23935
23948
|
text: args.text,
|
|
@@ -24795,7 +24808,7 @@ var KINDS = {
|
|
|
24795
24808
|
data: { model: "gemini-3.8-flash-lite-tts", voice: "Algieba", speed: "normal" },
|
|
24796
24809
|
inputs: ["text"],
|
|
24797
24810
|
outputs: ["audio", "approved"],
|
|
24798
|
-
dynamic: "style conforme o modelo; SeedAudio 1.0 tem reference (audio), usa voice: seed-auto e seedConsent: true com refer\xEAncia; alternativa seedReferenceGenerationId de gera\xE7\xE3o pr\xF3pria"
|
|
24811
|
+
dynamic: "style conforme o modelo; SeedAudio 1.0 tem reference (audio, at\xE9 3 vozes na ordem @Audio1..3), volume seedLoudnessRate (-50..100), usa voice: seed-auto e seedConsent: true com refer\xEAncia; alternativa seedReferenceGenerationId de gera\xE7\xE3o pr\xF3pria"
|
|
24799
24812
|
},
|
|
24800
24813
|
music: {
|
|
24801
24814
|
title: "Trilha",
|
|
@@ -26500,6 +26513,17 @@ ${payload(u)}`
|
|
|
26500
26513
|
// src/tools/canvas-run.ts
|
|
26501
26514
|
import { randomUUID as randomUUID3 } from "crypto";
|
|
26502
26515
|
var MAX_REMEMBERED = 50;
|
|
26516
|
+
var acceptedPacing = { repeats: 9, pauseMs: 1e3 };
|
|
26517
|
+
var sleep3 = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
26518
|
+
var seconds = (ms) => `${new Intl.NumberFormat("pt-BR", { maximumFractionDigits: 1 }).format(ms / 1e3)} s`;
|
|
26519
|
+
function timingsLine(t) {
|
|
26520
|
+
if (!t || t.estimateMs === null && t.startMs === null) return "";
|
|
26521
|
+
const parts = [];
|
|
26522
|
+
if (t.estimateMs !== null) parts.push(`estimar ${seconds(t.estimateMs)}`);
|
|
26523
|
+
if (t.startMs !== null) parts.push(`come\xE7ar ${seconds(t.startMs)}`);
|
|
26524
|
+
return `Tempo na aba: ${parts.join(", ")}.`;
|
|
26525
|
+
}
|
|
26526
|
+
var lacksTitles = (nodes) => (nodes ?? []).some((n) => !n.title);
|
|
26503
26527
|
var boardId2 = external_exports.string().uuid().describe("Id (uuid) do board.");
|
|
26504
26528
|
var nodeId = external_exports.string().min(1).max(128);
|
|
26505
26529
|
var fmt2 = (n) => new Intl.NumberFormat("pt-BR").format(n);
|
|
@@ -26592,15 +26616,21 @@ function registerCanvasRunTools(server, api, run) {
|
|
|
26592
26616
|
const total = a.estimate ? `${dia(a.estimate.total)} (teto ${fmt2(max)})` : "";
|
|
26593
26617
|
const again = a.repeated ? " (a aba j\xE1 tinha recebido este request_id; esta \xE9 a mesma resposta)" : "";
|
|
26594
26618
|
if (a.status === "estimate") {
|
|
26595
|
-
return [
|
|
26619
|
+
return [
|
|
26620
|
+
`Estimativa, nada rodou${again}. Modo ${modeText(a.mode)}. Total agora: ${total}.`,
|
|
26621
|
+
...est,
|
|
26622
|
+
cabeLine(a, max),
|
|
26623
|
+
timingsLine(a.timings)
|
|
26624
|
+
].filter(Boolean).join("\n");
|
|
26596
26625
|
}
|
|
26597
26626
|
if (a.status === "nothing") return `Nada para rodar${again}: ${a.message ?? "o board j\xE1 est\xE1 em dia."}`;
|
|
26598
26627
|
const willRun = (a.estimate?.nodes ?? []).filter((n) => n.willRun).map((n) => n.nodeId);
|
|
26599
26628
|
return [
|
|
26600
26629
|
`Rodando pela sua aba do Canvas${again}. Modo ${modeText(a.mode)}. Estimativa: ${total}.`,
|
|
26601
26630
|
...est,
|
|
26602
|
-
`request_id: ${requestId}. Andamento: canvas_run_status (board_id, request_id). Resultado: canvas_read_board com node_ids [${willRun.slice(0, 20).join(", ")}] quando terminar
|
|
26603
|
-
|
|
26631
|
+
`request_id: ${requestId}. Andamento: canvas_run_status (board_id, request_id). Resultado: canvas_read_board com node_ids [${willRun.slice(0, 20).join(", ")}] quando terminar.`,
|
|
26632
|
+
timingsLine(a.timings)
|
|
26633
|
+
].filter(Boolean).join("\n");
|
|
26604
26634
|
}
|
|
26605
26635
|
function cabeLine(a, max) {
|
|
26606
26636
|
if (!a.estimate) return "";
|
|
@@ -26628,20 +26658,32 @@ function registerCanvasRunTools(server, api, run) {
|
|
|
26628
26658
|
const target = targetOf(args);
|
|
26629
26659
|
const requestId = (args.request_id ?? randomUUID3()).toLowerCase();
|
|
26630
26660
|
const label = args.label ?? prettyClient(server.server.getClientVersion()?.name);
|
|
26631
|
-
|
|
26632
|
-
|
|
26633
|
-
|
|
26634
|
-
|
|
26635
|
-
|
|
26636
|
-
|
|
26637
|
-
|
|
26638
|
-
|
|
26639
|
-
|
|
26640
|
-
|
|
26641
|
-
|
|
26642
|
-
|
|
26661
|
+
const ask = async () => {
|
|
26662
|
+
try {
|
|
26663
|
+
return await api.runRequest(args.board_id, {
|
|
26664
|
+
requestId,
|
|
26665
|
+
target,
|
|
26666
|
+
maxDiamonds: args.max_diamonds,
|
|
26667
|
+
dryRun: args.dry_run === true,
|
|
26668
|
+
simulated: args.simulated === true,
|
|
26669
|
+
label,
|
|
26670
|
+
earlyAck: true
|
|
26671
|
+
});
|
|
26672
|
+
} catch (e) {
|
|
26673
|
+
explain2(e, requestId);
|
|
26674
|
+
}
|
|
26675
|
+
};
|
|
26676
|
+
let answer = await ask();
|
|
26677
|
+
const wasAccepted = answer.ok === true && answer.status === "accepted";
|
|
26678
|
+
for (let i = 0; answer.ok === true && answer.status === "accepted" && i < acceptedPacing.repeats; i++) {
|
|
26679
|
+
await sleep3(acceptedPacing.pauseMs);
|
|
26680
|
+
answer = await ask();
|
|
26681
|
+
}
|
|
26682
|
+
if (wasAccepted) answer = { ...answer, repeated: false };
|
|
26683
|
+
if (answer.ok === true && answer.status === "accepted") {
|
|
26684
|
+
return `A aba recebeu o pedido e ainda est\xE1 estimando e conferindo (board grande). request_id: ${requestId}. Acompanhe com canvas_run_status; para a resposta completa, chame canvas_run de novo com o MESMO request_id (\xE9 seguro: a aba n\xE3o roda duas vezes). N\xC3O pe\xE7a com outro id.`;
|
|
26643
26685
|
}
|
|
26644
|
-
const titleOf = await titles(args.board_id);
|
|
26686
|
+
const titleOf = lacksTitles(answer.estimate?.nodes) ? await titles(args.board_id) : (id) => id;
|
|
26645
26687
|
if (answer.ok !== true) {
|
|
26646
26688
|
const est = estimateLines(answer.estimate, titleOf);
|
|
26647
26689
|
throw new CanvasToolError(
|
|
@@ -26675,7 +26717,8 @@ function registerCanvasRunTools(server, api, run) {
|
|
|
26675
26717
|
const requestId = request_id.toLowerCase();
|
|
26676
26718
|
let why = "";
|
|
26677
26719
|
try {
|
|
26678
|
-
|
|
26720
|
+
const status = await api.runStatus(board_id, requestId);
|
|
26721
|
+
return statusText(status, lacksTitles(status.nodes) ? await titles(board_id) : (id) => id);
|
|
26679
26722
|
} catch (e) {
|
|
26680
26723
|
const reason = errorRaw(e)?.reason;
|
|
26681
26724
|
if (!(e instanceof ApiError) || reason !== "unknown-request" && reason !== "no-tab") explain2(e);
|
|
@@ -26729,6 +26772,8 @@ function statusText(a, titleOf) {
|
|
|
26729
26772
|
}
|
|
26730
26773
|
if (a.omitted) lines.push(`\u2026 e mais ${a.omitted} n\xF3(s) fora da lista (a resposta da aba foi cortada pelo tamanho).`);
|
|
26731
26774
|
if (a.state === "done" || a.state === "failed") lines.push("Leia o resultado com canvas_read_board (node_ids).");
|
|
26775
|
+
const timing = timingsLine(a.timings);
|
|
26776
|
+
if (timing) lines.push(timing);
|
|
26732
26777
|
return lines.join("\n");
|
|
26733
26778
|
}
|
|
26734
26779
|
function fromRuns(snap, ids) {
|
|
@@ -27845,7 +27890,7 @@ N\xF3s: ${Object.entries(ids).map(([k, v]) => `${k}=${v}`).join(" \xB7 ")}` : ""
|
|
|
27845
27890
|
import { createRequire } from "module";
|
|
27846
27891
|
var require2 = createRequire(import.meta.url);
|
|
27847
27892
|
function readVersion() {
|
|
27848
|
-
if ("0.
|
|
27893
|
+
if ("0.44.0") return "0.44.0";
|
|
27849
27894
|
try {
|
|
27850
27895
|
const pkg = require2("../package.json");
|
|
27851
27896
|
return pkg.version ?? "0.0.0-unknown";
|