paperclip-plugin-autopilot-ops 0.1.42 → 0.1.43
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/manifest.js +1 -1
- package/dist/ui/index.js +1 -1
- package/dist/worker.js +22 -2
- package/package.json +1 -1
package/dist/manifest.js
CHANGED
package/dist/ui/index.js
CHANGED
package/dist/worker.js
CHANGED
|
@@ -39932,7 +39932,7 @@ function startWorkerRpcHost(options) {
|
|
|
39932
39932
|
|
|
39933
39933
|
// src/manifest.ts
|
|
39934
39934
|
var PLUGIN_ID = "alephoo.autopilot-ops";
|
|
39935
|
-
var PLUGIN_VERSION = "0.1.
|
|
39935
|
+
var PLUGIN_VERSION = "0.1.43";
|
|
39936
39936
|
var DB_NAMESPACE_SLUG = "autopilot_ops";
|
|
39937
39937
|
var PAGE_ROUTE = "autopilot";
|
|
39938
39938
|
var TOOL_NAMES = {
|
|
@@ -46994,6 +46994,10 @@ function controlarTabla(ref, columnas, filas, problemas) {
|
|
|
46994
46994
|
}
|
|
46995
46995
|
}
|
|
46996
46996
|
}
|
|
46997
|
+
function jergaEn(texto10) {
|
|
46998
|
+
const m = /\b[A-Z]{2,5}-\d+\b|\b[a-z]+_[a-z0-9_]+\b|\bv\d+\.\d+(\.\d+)?\b/.exec(texto10) ?? /\bAlephoo\b|\bcapa sem[aá]ntica\b|\brecetas? sem[aá]nticas?\b/i.exec(texto10);
|
|
46999
|
+
return m ? m[0] : null;
|
|
47000
|
+
}
|
|
46997
47001
|
var MAX_BARRAS = 12;
|
|
46998
47002
|
function validarWidgets(entrada) {
|
|
46999
47003
|
const problemas = [];
|
|
@@ -47077,6 +47081,13 @@ function validarWidgets(entrada) {
|
|
|
47077
47081
|
}
|
|
47078
47082
|
}
|
|
47079
47083
|
});
|
|
47084
|
+
for (const [k, w] of salida.entries()) {
|
|
47085
|
+
const textos = [w.tipo === "texto" ? w.texto : null, w.tipo === "texto" ? w.titulo : null, "titulo" in w ? w.titulo : null, w.tipo === "indicador" ? w.contexto : null, w.tipo === "indicador" ? w.etiqueta : null].filter((x) => typeof x === "string");
|
|
47086
|
+
for (const x of textos) {
|
|
47087
|
+
const jerga = jergaEn(x);
|
|
47088
|
+
if (jerga) problemas.push(`widgets[${k}]: \xAB${jerga}\xBB es un t\xE9rmino interno; la direcci\xF3n no lo entiende (us\xE1 \xABel HIS\xBB y nombres de negocio; el detalle t\xE9cnico va en fuentes o en el comentario de la tarea)`);
|
|
47089
|
+
}
|
|
47090
|
+
}
|
|
47080
47091
|
const tonos = (t6) => salida.filter((w) => w.tipo === "indicador" && w.tono === t6).length;
|
|
47081
47092
|
if (tonos("ambar") > 1) problemas.push("como m\xE1ximo un indicador en \xE1mbar por tablero: el que pide una acci\xF3n de la direcci\xF3n (los dem\xE1s, neutro)");
|
|
47082
47093
|
if (tonos("corte") > 1) problemas.push("como m\xE1ximo un indicador en rojo (corte) por tablero: solo lo urgente");
|
|
@@ -47120,6 +47131,10 @@ async function publicarTablero(ctx, input2) {
|
|
|
47120
47131
|
if (!CLAVE_RE2.test(clave)) throw new OpsError("clave_invalida", "clave debe ser un identificador estable en min\xFAsculas (letras, n\xFAmeros y guiones, 2 a 61 caracteres), p. ej. turnos-ausentismo");
|
|
47121
47132
|
const titulo = typeof input2.titulo === "string" ? input2.titulo.trim().slice(0, 140) : "";
|
|
47122
47133
|
if (!titulo) throw new OpsError("titulo_requerido", "titulo es obligatorio");
|
|
47134
|
+
for (const [campo, v] of [["titulo", titulo], ["descripcion", input2.descripcion], ["periodo", input2.periodo]]) {
|
|
47135
|
+
const jerga = typeof v === "string" ? jergaEn(v) : null;
|
|
47136
|
+
if (jerga) throw new OpsError("tablero_invalido", `${campo}: \xAB${jerga}\xBB es un t\xE9rmino interno; la direcci\xF3n no lo entiende (us\xE1 \xABel HIS\xBB y nombres de negocio)`);
|
|
47137
|
+
}
|
|
47123
47138
|
const widgets = validarWidgets(input2.widgets);
|
|
47124
47139
|
const fuentes = arr(input2.fuentes).filter((f) => typeof f === "string" && f.trim()).map((f) => String(f).trim().slice(0, 120)).slice(0, 12);
|
|
47125
47140
|
const limpio = (v, max) => typeof v === "string" && v.trim() ? v.trim().slice(0, max) : null;
|
|
@@ -47193,7 +47208,12 @@ async function descartarRetiroTablero(ctx, input2) {
|
|
|
47193
47208
|
}
|
|
47194
47209
|
async function listarPublicaciones(ctx, companyId) {
|
|
47195
47210
|
const rows = await ctx.db.query(`SELECT clave, version, issue_id, publicado_at FROM ${t5(ctx, "tablero_publicacion")} WHERE company_id = $1 ORDER BY publicado_at DESC LIMIT 500`, [companyId]);
|
|
47196
|
-
|
|
47211
|
+
const lista3 = rows.map((r) => ({ clave: String(r.clave), version: Number(r.version), issueId: r.issue_id ?? null, en: iso4(r.publicado_at) }));
|
|
47212
|
+
const tableros = await ctx.db.query(`SELECT clave, versiones, issue_id, updated_at FROM ${t5(ctx, "tablero")} WHERE company_id = $1 AND issue_id IS NOT NULL`, [companyId]);
|
|
47213
|
+
for (const tb of tableros) {
|
|
47214
|
+
if (!lista3.some((x) => x.issueId === tb.issue_id)) lista3.push({ clave: String(tb.clave), version: Number(tb.versiones ?? 1), issueId: String(tb.issue_id), en: iso4(tb.updated_at) });
|
|
47215
|
+
}
|
|
47216
|
+
return lista3;
|
|
47197
47217
|
}
|
|
47198
47218
|
|
|
47199
47219
|
// src/worker.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "paperclip-plugin-autopilot-ops",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.43",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Autopilot Care · operación autónoma gobernada para instituciones de salud: workflows determinísticos, validaciones, registro de negocio, políticas (observa/propone/ejecuta/corte) y tablero del director, como plugin de Paperclip.",
|
|
6
6
|
"files": [
|