events-ui-protocols 0.5.5

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 jaminsmoke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ # events-ui-protocols
2
+
3
+ Las puertas del flujo de [Events UI](https://github.com/jaminsmoke/events-ui):
4
+ el esquema de `.EUI/protocolos.json`, la política de partida y un `eui-guard`
5
+ que delega en el CLI.
6
+
7
+ ## Qué trae
8
+
9
+ - `protocolos.json`: las puertas de la v1, todas puestas. Se copia a
10
+ `.EUI/protocolos.json` del repo.
11
+ - `schema.json`: el JSON Schema del archivo, para validarlo o autocompletarlo.
12
+ - `eui-guard`: ejecuta `eui guard` y devuelve su código de salida.
13
+
14
+ ## Cómo se adopta
15
+
16
+ ```sh
17
+ npm install --save-dev events-ui-protocols
18
+ mkdir -p .EUI
19
+ cp node_modules/events-ui-protocols/protocolos.json .EUI/protocolos.json
20
+ ```
21
+
22
+ En `.gitignore`, para versionar solo la política:
23
+
24
+ ```gitignore
25
+ .EUI/*
26
+ !.EUI/protocolos.json
27
+ ```
28
+
29
+ Y en el pre-commit, o en el pre-herramienta del agente:
30
+
31
+ ```sh
32
+ npx eui-guard --repo .
33
+ ```
34
+
35
+ `eui-guard` necesita el CLI `eui` en el PATH (`@events-ui/webapp`).
36
+
37
+ ## Qué no hace
38
+
39
+ El paquete no puede impedir que alguien escriba con su editor: la guarda
40
+ detecta y el hook del host decide. Lo que sí cierra son las herramientas del
41
+ MCP, y eso lo aplica el core.
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env node
2
+ // `eui-guard` no aplica reglas: llama a `eui guard` y devuelve su veredicto.
3
+ // Las reglas viven en el core, que es el único que sabe evaluar el mapa.
4
+
5
+ import { spawnSync } from "node:child_process";
6
+
7
+ const resultado = spawnSync("eui", ["guard", ...process.argv.slice(2)], {
8
+ stdio: "inherit",
9
+ });
10
+
11
+ if (resultado.error) {
12
+ console.error(
13
+ "eui-guard necesita el CLI `eui` en el PATH (paquete @events-ui/webapp).",
14
+ );
15
+ process.exit(2);
16
+ }
17
+
18
+ process.exit(resultado.status ?? 2);
package/index.d.ts ADDED
@@ -0,0 +1,15 @@
1
+ export interface Puerta {
2
+ id: string;
3
+ activa?: boolean;
4
+ motivo?: string;
5
+ }
6
+
7
+ export interface Protocolos {
8
+ version: 1;
9
+ puertas: Puerta[];
10
+ }
11
+
12
+ export declare const protocolos: Protocolos;
13
+ export declare const esquema: Record<string, unknown>;
14
+ export declare const PUERTAS: string[];
15
+ export declare const ARCHIVO: string;
package/index.js ADDED
@@ -0,0 +1,20 @@
1
+ // Lo que el paquete sabe de la política, sin lógica propia: el esquema y los
2
+ // presets son datos, y quien aplica las reglas es el core (`eui guard`). Si el
3
+ // paquete reimplementara las guardas habría dos verdades y una se quedaría atrás.
4
+
5
+ import { readFileSync } from "node:fs";
6
+
7
+ const leer = (nombre) =>
8
+ JSON.parse(readFileSync(new URL(nombre, import.meta.url), "utf8"));
9
+
10
+ /** La política de partida: las puertas de la v1, todas puestas. */
11
+ export const protocolos = leer("./protocolos.json");
12
+
13
+ /** El JSON Schema de `.EUI/protocolos.json`. */
14
+ export const esquema = leer("./schema.json");
15
+
16
+ /** Los identificadores de las puertas que este paquete conoce. */
17
+ export const PUERTAS = protocolos.puertas.map((puerta) => puerta.id);
18
+
19
+ /** Dónde se copia la política dentro del repo. */
20
+ export const ARCHIVO = ".EUI/protocolos.json";
package/package.json ADDED
@@ -0,0 +1,37 @@
1
+ {
2
+ "name": "events-ui-protocols",
3
+ "version": "0.5.5",
4
+ "description": "Las puertas del flujo de Events UI: esquema, política de partida y la guarda para el repo.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "engines": {
8
+ "node": ">=18"
9
+ },
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/jaminsmoke/events-ui.git",
16
+ "directory": "packages/protocols"
17
+ },
18
+ "exports": {
19
+ ".": {
20
+ "types": "./index.d.ts",
21
+ "default": "./index.js"
22
+ },
23
+ "./schema.json": "./schema.json",
24
+ "./protocolos.json": "./protocolos.json"
25
+ },
26
+ "bin": {
27
+ "eui-guard": "bin/eui-guard.mjs"
28
+ },
29
+ "files": [
30
+ "index.js",
31
+ "index.d.ts",
32
+ "schema.json",
33
+ "protocolos.json",
34
+ "bin/",
35
+ "README.md"
36
+ ]
37
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "version": 1,
3
+ "puertas": [
4
+ { "id": "sin-ficha-activa" },
5
+ { "id": "ficha-sin-fases" },
6
+ { "id": "verificando-no-se-toca" },
7
+ { "id": "documentos-fuera-del-flujo" },
8
+ { "id": "una-ficha-a-la-vez" }
9
+ ]
10
+ }
package/schema.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "$defs": {
3
+ "PuertaArchivo": {
4
+ "additionalProperties": false,
5
+ "description": "Una puerta en `.EUI/protocolos.json`: se apaga o se le cambia el motivo.\n\n`motivo` ausente o vacío deja el del preset: el archivo no tiene que repetir\nel texto del core para decir que la puerta está puesta.",
6
+ "properties": {
7
+ "id": {
8
+ "minLength": 1,
9
+ "title": "Id",
10
+ "type": "string"
11
+ },
12
+ "activa": {
13
+ "default": true,
14
+ "title": "Activa",
15
+ "type": "boolean"
16
+ },
17
+ "motivo": {
18
+ "anyOf": [
19
+ {
20
+ "type": "string"
21
+ },
22
+ {
23
+ "type": "null"
24
+ }
25
+ ],
26
+ "default": null,
27
+ "title": "Motivo"
28
+ }
29
+ },
30
+ "required": [
31
+ "id"
32
+ ],
33
+ "title": "PuertaArchivo",
34
+ "type": "object"
35
+ }
36
+ },
37
+ "additionalProperties": false,
38
+ "description": "El archivo entero. La versión 1 es la única que este core entiende.",
39
+ "properties": {
40
+ "version": {
41
+ "const": 1,
42
+ "title": "Version",
43
+ "type": "integer"
44
+ },
45
+ "puertas": {
46
+ "items": {
47
+ "$ref": "#/$defs/PuertaArchivo"
48
+ },
49
+ "title": "Puertas",
50
+ "type": "array"
51
+ }
52
+ },
53
+ "required": [
54
+ "version"
55
+ ],
56
+ "title": "ProtocolosArchivo",
57
+ "type": "object"
58
+ }