mandioca-tabs-mcp 0.2.15 → 0.2.16
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/index.mjs +118 -7
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -20704,8 +20704,19 @@ var init_piano = __esm({
|
|
|
20704
20704
|
});
|
|
20705
20705
|
|
|
20706
20706
|
// packages/editor/src/loudness.ts
|
|
20707
|
+
var MUESTRAS_POR_TRAMO, MUESTRAS_POR_TRAMO_DEL_PICO, FASES_BS1770, COEFICIENTES, GANANCIA_MAXIMA;
|
|
20707
20708
|
var init_loudness = __esm({
|
|
20708
20709
|
"packages/editor/src/loudness.ts"() {
|
|
20710
|
+
MUESTRAS_POR_TRAMO = 1 << 18;
|
|
20711
|
+
MUESTRAS_POR_TRAMO_DEL_PICO = 1 << 14;
|
|
20712
|
+
FASES_BS1770 = [
|
|
20713
|
+
[0.001708984375, 0.010986328125, -0.0196533203125, 0.033203125, -0.0594482421875, 0.1373291015625, 0.97216796875, -0.102294921875, 0.047607421875, -0.026611328125, 0.014892578125, -0.00830078125],
|
|
20714
|
+
[-0.0291748046875, 0.029296875, -0.0517578125, 0.089111328125, -0.16650390625, 0.465087890625, 0.77978515625, -0.2003173828125, 0.1015625, -0.0582275390625, 0.0330810546875, -0.0189208984375],
|
|
20715
|
+
[-0.0189208984375, 0.0330810546875, -0.0582275390625, 0.1015625, -0.2003173828125, 0.77978515625, 0.465087890625, -0.16650390625, 0.089111328125, -0.0517578125, 0.029296875, -0.0291748046875],
|
|
20716
|
+
[-0.00830078125, 0.014892578125, -0.026611328125, 0.047607421875, -0.102294921875, 0.97216796875, 0.1373291015625, -0.0594482421875, 0.033203125, -0.0196533203125, 0.010986328125, 0.001708984375]
|
|
20717
|
+
];
|
|
20718
|
+
COEFICIENTES = Float64Array.from({ length: 48 }, (_, i2) => FASES_BS1770[i2 % 4][Math.floor(i2 / 4)]);
|
|
20719
|
+
GANANCIA_MAXIMA = Math.max(...FASES_BS1770.map((fase) => fase.reduce((s, c) => s + Math.abs(c), 0)));
|
|
20709
20720
|
}
|
|
20710
20721
|
});
|
|
20711
20722
|
|
|
@@ -90339,6 +90350,9 @@ function abrirEnBlanco(opciones = {}) {
|
|
|
90339
90350
|
};
|
|
90340
90351
|
return alAbrirLaObra(abierta);
|
|
90341
90352
|
}
|
|
90353
|
+
function salaDeLaObraAdoptada() {
|
|
90354
|
+
return abierta && abierta.origen.clase === "pesta\xF1a" ? abierta.origen.sala : null;
|
|
90355
|
+
}
|
|
90342
90356
|
function idDeLaObraActiva() {
|
|
90343
90357
|
if (!abierta || abierta.origen.clase !== "pesta\xF1a") return null;
|
|
90344
90358
|
if (!laPesta\u00F1aSigueViva()) return null;
|
|
@@ -90469,7 +90483,7 @@ var VERSION_DEL_CONECTOR;
|
|
|
90469
90483
|
var init_version = __esm({
|
|
90470
90484
|
"apps/mcp/src/version.ts"() {
|
|
90471
90485
|
"use strict";
|
|
90472
|
-
VERSION_DEL_CONECTOR = true ? "0.2.
|
|
90486
|
+
VERSION_DEL_CONECTOR = true ? "0.2.16" : null;
|
|
90473
90487
|
}
|
|
90474
90488
|
});
|
|
90475
90489
|
|
|
@@ -90483,6 +90497,7 @@ __export(puente_exports, {
|
|
|
90483
90497
|
PUERTO_POR_OMISION: () => PUERTO_POR_OMISION,
|
|
90484
90498
|
SALA_DE_LA_OBRA: () => SALA_DE_LA_OBRA,
|
|
90485
90499
|
SALA_DE_PEDIDOS: () => SALA_DE_PEDIDOS,
|
|
90500
|
+
SALA_OCIOSA_MS: () => SALA_OCIOSA_MS,
|
|
90486
90501
|
abrirPuente: () => abrirPuente,
|
|
90487
90502
|
buscarLaPesta\u00F1a: () => buscarLaPesta\u00F1a,
|
|
90488
90503
|
cerrarPuente: () => cerrarPuente,
|
|
@@ -90511,12 +90526,14 @@ function envoltorioDe(doc) {
|
|
|
90511
90526
|
envoltoriosPorDoc.set(doc, nuevo);
|
|
90512
90527
|
return nuevo;
|
|
90513
90528
|
}
|
|
90514
|
-
function origenPermitido(origen) {
|
|
90529
|
+
function origenPermitido(origen, puertoDelPuente = PUERTO_POR_OMISION) {
|
|
90515
90530
|
if (origen === void 0) return true;
|
|
90516
90531
|
if (ORIGENES_DE_TABS.includes(origen)) return true;
|
|
90517
90532
|
try {
|
|
90518
90533
|
const u = new URL(origen);
|
|
90519
|
-
|
|
90534
|
+
const local = (u.protocol === "http:" || u.protocol === "https:") && ["localhost", "127.0.0.1", "[::1]"].includes(u.hostname);
|
|
90535
|
+
if (!local) return false;
|
|
90536
|
+
return puertoDelPuente !== PUERTO_DEL_CONECTOR || PUERTOS_LOCALES_DE_TABS.includes(u.port);
|
|
90520
90537
|
} catch {
|
|
90521
90538
|
return false;
|
|
90522
90539
|
}
|
|
@@ -90789,8 +90806,28 @@ function abrirDeVerdad(puerto) {
|
|
|
90789
90806
|
const apuntarLaEtiqueta = (sala) => apuntarLaEtiquetaDe(idDeLaSala(sala));
|
|
90790
90807
|
const sincronizadas = /* @__PURE__ */ new Set();
|
|
90791
90808
|
const deLaSala = (sala) => [...conexiones].filter(([, s]) => s === sala).map(([c]) => c);
|
|
90809
|
+
const relojesDeSalas = /* @__PURE__ */ new Map();
|
|
90810
|
+
const noSoltarla = (sala) => {
|
|
90811
|
+
const reloj = relojesDeSalas.get(sala);
|
|
90812
|
+
if (reloj) clearTimeout(reloj);
|
|
90813
|
+
relojesDeSalas.delete(sala);
|
|
90814
|
+
};
|
|
90815
|
+
const soltarSiSigueVacia = (sala) => {
|
|
90816
|
+
relojesDeSalas.delete(sala);
|
|
90817
|
+
if (sala === SALA_DE_LA_OBRA || sala === SALA_DE_PEDIDOS) return;
|
|
90818
|
+
if (deLaSala(sala).length > 0 || salaDeLaObraAdoptada() === sala) return;
|
|
90819
|
+
const doc = docs.get(sala);
|
|
90820
|
+
docs.delete(sala);
|
|
90821
|
+
sincronizadas.delete(sala);
|
|
90822
|
+
doc?.destroy();
|
|
90823
|
+
};
|
|
90792
90824
|
const olvidarSiQuedoVacia = (sala) => {
|
|
90793
|
-
if (deLaSala(sala).length
|
|
90825
|
+
if (deLaSala(sala).length > 0) return;
|
|
90826
|
+
sincronizadas.delete(sala);
|
|
90827
|
+
noSoltarla(sala);
|
|
90828
|
+
const reloj = setTimeout(() => soltarSiSigueVacia(sala), SALA_OCIOSA_MS);
|
|
90829
|
+
reloj.unref?.();
|
|
90830
|
+
relojesDeSalas.set(sala, reloj);
|
|
90794
90831
|
};
|
|
90795
90832
|
const escuchar = (sala, doc) => {
|
|
90796
90833
|
doc.on("update", (cambio, origen) => {
|
|
@@ -90809,7 +90846,7 @@ function abrirDeVerdad(puerto) {
|
|
|
90809
90846
|
const servidor2 = new import_websocket_server.default({
|
|
90810
90847
|
server: http,
|
|
90811
90848
|
// Ver `origenPermitido`: una página de otro sitio recibe un 401 y no llega a la obra.
|
|
90812
|
-
verifyClient: ({ origin }) => origenPermitido(origin || void 0)
|
|
90849
|
+
verifyClient: ({ origin }) => origenPermitido(origin || void 0, puerto)
|
|
90813
90850
|
});
|
|
90814
90851
|
servidor2.on("error", () => {
|
|
90815
90852
|
});
|
|
@@ -90829,6 +90866,7 @@ function abrirDeVerdad(puerto) {
|
|
|
90829
90866
|
return;
|
|
90830
90867
|
}
|
|
90831
90868
|
const sala = salaValida(pedida) ? pedida : SALA_DE_LA_OBRA;
|
|
90869
|
+
noSoltarla(sala);
|
|
90832
90870
|
const doc = docDeLaSala(sala);
|
|
90833
90871
|
if (esDeObra(sala) && deLaSala(sala).length > 0) {
|
|
90834
90872
|
conexion.close(4001, "Ya hay otra pesta\xF1a conectada a la IA. Descon\xE9ctala antes de conectar \xE9sta.");
|
|
@@ -90922,8 +90960,14 @@ function abrirDeVerdad(puerto) {
|
|
|
90922
90960
|
// separa la vida del buzón de la del documento. Ver el bloque del índice.
|
|
90923
90961
|
pedidosDe: (id2) => docs.get(salaDelBuzonDe(id2)),
|
|
90924
90962
|
escuchanPedidosDe: (id2) => deLaSala(salaDelBuzonDe(id2)).length,
|
|
90963
|
+
oyentesDe: (canal) => {
|
|
90964
|
+
for (const [sala, doc] of docs) if (doc === canal) return deLaSala(sala).length;
|
|
90965
|
+
return 0;
|
|
90966
|
+
},
|
|
90925
90967
|
cerrar: () => new Promise((listo) => {
|
|
90926
90968
|
clearInterval(latidoDelPuente);
|
|
90969
|
+
for (const reloj of relojesDeSalas.values()) clearTimeout(reloj);
|
|
90970
|
+
relojesDeSalas.clear();
|
|
90927
90971
|
for (const c of conexiones.keys()) c.close();
|
|
90928
90972
|
conexiones.clear();
|
|
90929
90973
|
mostrador.clear();
|
|
@@ -90992,7 +91036,7 @@ async function pedirALaPesta\u00F1a(herramienta, argumentos = {}, msDelAcuse = E
|
|
|
90992
91036
|
}, msDelAcuse);
|
|
90993
91037
|
let desdeCuandoNoHayNadie = null;
|
|
90994
91038
|
const latido = setInterval(() => {
|
|
90995
|
-
if (p.
|
|
91039
|
+
if (p.oyentesDe(canal) > 0) {
|
|
90996
91040
|
desdeCuandoNoHayNadie = null;
|
|
90997
91041
|
return;
|
|
90998
91042
|
}
|
|
@@ -91035,7 +91079,7 @@ async function pedirALaPesta\u00F1a(herramienta, argumentos = {}, msDelAcuse = E
|
|
|
91035
91079
|
canal.transact(() => mapa.delete(id2));
|
|
91036
91080
|
}
|
|
91037
91081
|
}
|
|
91038
|
-
var envoltoriosPorDoc, SINCRONIZAR, PRESENCIA, SALA_DE_LA_OBRA, SALA_DE_PEDIDOS, PUERTO_POR_OMISION, ORIGENES_DE_TABS, puente, reclamado, ESPERA_POR_LA_PESTA\u00D1A, mostrador, casillero, TIPOS, abriendo, siguienteId, INSTANCIA, ESPERA_DEL_ACUSE_MS, LATIDO_MS, LATIDO_DEL_PUENTE_MS, AUSENCIA_PARA_DARLA_POR_IDA_MS, MARGEN_PARA_QUE_ENTRE_MS;
|
|
91082
|
+
var envoltoriosPorDoc, SINCRONIZAR, PRESENCIA, SALA_DE_LA_OBRA, SALA_DE_PEDIDOS, PUERTO_POR_OMISION, ORIGENES_DE_TABS, PUERTOS_LOCALES_DE_TABS, PUERTO_DEL_CONECTOR, puente, reclamado, ESPERA_POR_LA_PESTA\u00D1A, mostrador, casillero, TIPOS, abriendo, siguienteId, INSTANCIA, ESPERA_DEL_ACUSE_MS, LATIDO_MS, LATIDO_DEL_PUENTE_MS, AUSENCIA_PARA_DARLA_POR_IDA_MS, SALA_OCIOSA_MS, MARGEN_PARA_QUE_ENTRE_MS;
|
|
91039
91083
|
var init_puente = __esm({
|
|
91040
91084
|
"apps/mcp/src/puente.ts"() {
|
|
91041
91085
|
"use strict";
|
|
@@ -91059,6 +91103,8 @@ var init_puente = __esm({
|
|
|
91059
91103
|
"https://mandioca-tabs.entelequia.workers.dev",
|
|
91060
91104
|
...(process.env["MANDIOCA_TABS_ORIGENES"] ?? "").split(",").map((o) => o.trim().replace(/\/+$/, "")).filter(Boolean)
|
|
91061
91105
|
];
|
|
91106
|
+
PUERTOS_LOCALES_DE_TABS = ["5173", "4173"];
|
|
91107
|
+
PUERTO_DEL_CONECTOR = 5183;
|
|
91062
91108
|
puente = null;
|
|
91063
91109
|
reclamado = false;
|
|
91064
91110
|
ESPERA_POR_LA_PESTA\u00D1A = 3500;
|
|
@@ -91074,6 +91120,7 @@ var init_puente = __esm({
|
|
|
91074
91120
|
LATIDO_MS = 250;
|
|
91075
91121
|
LATIDO_DEL_PUENTE_MS = 1e4;
|
|
91076
91122
|
AUSENCIA_PARA_DARLA_POR_IDA_MS = 2e3;
|
|
91123
|
+
SALA_OCIOSA_MS = Number(process.env["MANDIOCA_TABS_SALA_OCIOSA_MS"] ?? 10 * 6e4);
|
|
91077
91124
|
MARGEN_PARA_QUE_ENTRE_MS = 750;
|
|
91078
91125
|
}
|
|
91079
91126
|
});
|
|
@@ -122984,6 +123031,68 @@ var EMPTY_COMPLETION_RESULT = {
|
|
|
122984
123031
|
}
|
|
122985
123032
|
};
|
|
122986
123033
|
|
|
123034
|
+
// apps/mcp/src/anotaciones.ts
|
|
123035
|
+
var LEEN = /* @__PURE__ */ new Set([
|
|
123036
|
+
"acorde_en_el_cursor",
|
|
123037
|
+
"acordes_de_la_obra",
|
|
123038
|
+
"afinaciones_disponibles",
|
|
123039
|
+
"ajustes_de_video",
|
|
123040
|
+
"atajos_del_programa",
|
|
123041
|
+
"audios_rechazados_por_largos",
|
|
123042
|
+
"captura",
|
|
123043
|
+
"direcciones_disponibles",
|
|
123044
|
+
"efectos_disponibles",
|
|
123045
|
+
"estado_de_la_conexion",
|
|
123046
|
+
"estado_de_la_obra",
|
|
123047
|
+
"estilo_de_la_obra",
|
|
123048
|
+
"estructura_de_la_obra",
|
|
123049
|
+
"formas_de_bend",
|
|
123050
|
+
"formatos_de_exportacion",
|
|
123051
|
+
"instrumentos_disponibles",
|
|
123052
|
+
"leer_compases",
|
|
123053
|
+
"leer_curva_de_bend",
|
|
123054
|
+
"leer_letra",
|
|
123055
|
+
"letra_estacionada",
|
|
123056
|
+
"letra_sincronizada",
|
|
123057
|
+
"matices_disponibles",
|
|
123058
|
+
"obras_conectadas",
|
|
123059
|
+
"obras_recientes",
|
|
123060
|
+
"piezas_de_bateria",
|
|
123061
|
+
"precision_del_alineador",
|
|
123062
|
+
"que_hace_un_control",
|
|
123063
|
+
"secciones_de_la_obra",
|
|
123064
|
+
"signos_de_una_nota",
|
|
123065
|
+
"signos_disponibles",
|
|
123066
|
+
"variantes_disponibles"
|
|
123067
|
+
]);
|
|
123068
|
+
var BORRAN = /* @__PURE__ */ new Set([
|
|
123069
|
+
"borrar_compas",
|
|
123070
|
+
"borrar_compases_desde",
|
|
123071
|
+
"borrar_compases_hasta",
|
|
123072
|
+
"borrar_figura",
|
|
123073
|
+
"borrar_grabacion",
|
|
123074
|
+
"borrar_notas",
|
|
123075
|
+
"borrar_pista",
|
|
123076
|
+
"cortar_pasaje",
|
|
123077
|
+
"desanclar_todo",
|
|
123078
|
+
"olvidar_reciente",
|
|
123079
|
+
"quitar_cuerda",
|
|
123080
|
+
"quitar_grabacion",
|
|
123081
|
+
"quitar_silaba",
|
|
123082
|
+
// Pisan un archivo del disco si se les pide (`pisar`), y eso no tiene «deshacer».
|
|
123083
|
+
"guardar_obra",
|
|
123084
|
+
"guardar_grabacion",
|
|
123085
|
+
"guardar_letra",
|
|
123086
|
+
"exportar",
|
|
123087
|
+
"exportar_audio",
|
|
123088
|
+
"exportar_pdf",
|
|
123089
|
+
"exportar_video"
|
|
123090
|
+
]);
|
|
123091
|
+
function anotacionesDe(nombre) {
|
|
123092
|
+
if (LEEN.has(nombre)) return { readOnlyHint: true, openWorldHint: false };
|
|
123093
|
+
return { readOnlyHint: false, destructiveHint: BORRAN.has(nombre), openWorldHint: false };
|
|
123094
|
+
}
|
|
123095
|
+
|
|
122987
123096
|
// apps/mcp/src/herramientas/documento.ts
|
|
122988
123097
|
init_src2();
|
|
122989
123098
|
init_src3();
|
|
@@ -126761,6 +126870,8 @@ function crearServidor() {
|
|
|
126761
126870
|
{ name: NOMBRE, version: VERSION },
|
|
126762
126871
|
{ instructions: INSTRUCCIONES }
|
|
126763
126872
|
);
|
|
126873
|
+
const registrar = servidor2.registerTool.bind(servidor2);
|
|
126874
|
+
servidor2.registerTool = ((nombre, config2, cb) => registrar(nombre, { ...config2, annotations: { ...anotacionesDe(nombre), ...config2.annotations } }, cb));
|
|
126764
126875
|
registrarHerramientasDelDocumento(servidor2);
|
|
126765
126876
|
registrarHerramientasDelPuente(servidor2);
|
|
126766
126877
|
registrarHerramientasDeSignos(servidor2);
|
package/package.json
CHANGED