@nac3/forge-cli 1.8.5 → 1.9.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.
Files changed (76) hide show
  1. package/dist/chat/claude.d.ts +11 -0
  2. package/dist/chat/claude.d.ts.map +1 -1
  3. package/dist/chat/claude.js.map +1 -1
  4. package/dist/chat/claude_cli.d.ts.map +1 -1
  5. package/dist/chat/claude_cli.js +11 -2
  6. package/dist/chat/claude_cli.js.map +1 -1
  7. package/dist/chat/doctrine_digest.d.ts.map +1 -1
  8. package/dist/chat/doctrine_digest.js +11 -0
  9. package/dist/chat/doctrine_digest.js.map +1 -1
  10. package/dist/chat/panel.d.ts.map +1 -1
  11. package/dist/chat/panel.js +50 -24
  12. package/dist/chat/panel.js.map +1 -1
  13. package/dist/chat/server.d.ts.map +1 -1
  14. package/dist/chat/server.js +113 -16
  15. package/dist/chat/server.js.map +1 -1
  16. package/dist/chat/tools/config_write.d.ts +35 -0
  17. package/dist/chat/tools/config_write.d.ts.map +1 -0
  18. package/dist/chat/tools/config_write.js +381 -0
  19. package/dist/chat/tools/config_write.js.map +1 -0
  20. package/dist/chat/tools/db_query.d.ts +20 -0
  21. package/dist/chat/tools/db_query.d.ts.map +1 -1
  22. package/dist/chat/tools/db_query.js +3 -3
  23. package/dist/chat/tools/db_query.js.map +1 -1
  24. package/dist/chat/tools/nac3_invoke.d.ts.map +1 -1
  25. package/dist/chat/tools/nac3_invoke.js +19 -1
  26. package/dist/chat/tools/nac3_invoke.js.map +1 -1
  27. package/dist/chat/tools/orchestrator_write.d.ts +27 -0
  28. package/dist/chat/tools/orchestrator_write.d.ts.map +1 -0
  29. package/dist/chat/tools/orchestrator_write.js +481 -0
  30. package/dist/chat/tools/orchestrator_write.js.map +1 -0
  31. package/dist/chat/tools.d.ts.map +1 -1
  32. package/dist/chat/tools.js +28 -0
  33. package/dist/chat/tools.js.map +1 -1
  34. package/dist/commands/embed.d.ts +1 -0
  35. package/dist/commands/embed.d.ts.map +1 -1
  36. package/dist/commands/embed.js +5 -1
  37. package/dist/commands/embed.js.map +1 -1
  38. package/dist/core/config_formats.d.ts +45 -0
  39. package/dist/core/config_formats.d.ts.map +1 -0
  40. package/dist/core/config_formats.js +519 -0
  41. package/dist/core/config_formats.js.map +1 -0
  42. package/dist/core/db_write.d.ts +26 -0
  43. package/dist/core/db_write.d.ts.map +1 -0
  44. package/dist/core/db_write.js +262 -0
  45. package/dist/core/db_write.js.map +1 -0
  46. package/dist/core/forge_embed.d.ts +1 -0
  47. package/dist/core/forge_embed.d.ts.map +1 -1
  48. package/dist/core/forge_embed.js +132 -2
  49. package/dist/core/forge_embed.js.map +1 -1
  50. package/dist/core/forge_profile.d.ts +23 -0
  51. package/dist/core/forge_profile.d.ts.map +1 -1
  52. package/dist/core/forge_profile.js +56 -0
  53. package/dist/core/forge_profile.js.map +1 -1
  54. package/dist/core/operate_guard.d.ts +154 -0
  55. package/dist/core/operate_guard.d.ts.map +1 -0
  56. package/dist/core/operate_guard.js +542 -0
  57. package/dist/core/operate_guard.js.map +1 -0
  58. package/dist/core/projects.d.ts +10 -4
  59. package/dist/core/projects.d.ts.map +1 -1
  60. package/dist/core/projects.js +42 -2
  61. package/dist/core/projects.js.map +1 -1
  62. package/dist/docs/doctrine/operate-mode.md +118 -0
  63. package/dist/nac3/internal_manifest.d.ts.map +1 -1
  64. package/dist/nac3/internal_manifest.js +186 -0
  65. package/dist/nac3/internal_manifest.js.map +1 -1
  66. package/dist/nac3/manifest_lazy.d.ts +5 -0
  67. package/dist/nac3/manifest_lazy.d.ts.map +1 -1
  68. package/dist/nac3/manifest_lazy.js +3 -1
  69. package/dist/nac3/manifest_lazy.js.map +1 -1
  70. package/dist/pending/store.d.ts.map +1 -1
  71. package/dist/pending/store.js +9 -0
  72. package/dist/pending/store.js.map +1 -1
  73. package/dist/version.d.ts +1 -1
  74. package/dist/version.js +1 -1
  75. package/docs/doctrine/operate-mode.md +118 -0
  76. package/package.json +1 -1
@@ -15,9 +15,22 @@ import { promises as fs } from 'node:fs';
15
15
  import path from 'node:path';
16
16
  import os from 'node:os';
17
17
  const REGISTRY_FILE = 'projects.json';
18
- /** Resolve the path to the per-user registry directory. */
18
+ /** Resolve the path to the per-user registry directory.
19
+ *
20
+ * Honra YF_CONFIG_DIR igual que el resto de los stores (brain_config,
21
+ * cost_meter, vault). Antes usaba os.homedir() a secas, asi que este era el
22
+ * UNICO store imposible de aislar: cualquier test que disparara
23
+ * upsertProject/setActive escribia en el registro REAL del usuario por mas
24
+ * que se aislara YF_CONFIG_DIR. Encontrado el 2026-10-04 cuando un test de
25
+ * reanchor dejo dos proyectos de carpetas temporales en el registro de
26
+ * Pablo -- y el registro es lo que alimenta el selector de proyectos del
27
+ * celular, asi que la basura se ve en pantalla. */
19
28
  export function registryDir() {
20
- return path.join(os.homedir(), '.yujin-forge');
29
+ const env = process.env.YF_CONFIG_DIR;
30
+ if (env && env.trim() !== '')
31
+ return env;
32
+ const home = process.env.HOME || process.env.USERPROFILE || os.homedir();
33
+ return path.join(home, '.yujin-forge');
21
34
  }
22
35
  /** Read the local registry. Returns empty default when the
23
36
  * file does not exist. */
@@ -45,6 +58,14 @@ export async function writeRegistry(reg) {
45
58
  /** Add or update a project entry. Identified by slug; if the
46
59
  * slug exists, merges fields (last_active_at + cached fields
47
60
  * win on update; path stays unless explicitly replaced). */
61
+ /** Misma carpeta, escrita distinto. En Windows el case no importa y los
62
+ * separadores vienen mezclados segun quien resolvio el path. */
63
+ function samePath(a, b) {
64
+ if (!a || !b)
65
+ return false;
66
+ const norm = (s) => s.replace(/[\\/]+/g, '/').replace(/\/+$/, '').toLowerCase();
67
+ return norm(a) === norm(b);
68
+ }
48
69
  export async function upsertProject(entry) {
49
70
  const reg = await readRegistry();
50
71
  const idx = reg.projects.findIndex((p) => p.slug === entry.slug);
@@ -55,6 +76,25 @@ export async function upsertProject(entry) {
55
76
  else {
56
77
  reg.projects.push(stamped);
57
78
  }
79
+ /* Una carpeta = una entrada (Pablo 2026-10-04). Esto matcheaba SOLO por
80
+ * slug, asi que la misma carpeta entrando con otro slug agregaba una
81
+ * segunda entrada. Es justo lo que pasaba con `C:\adip\kikan`: el resolver
82
+ * sync devolvia el basename ('kikan') y el async el name del package.json
83
+ * ('yujin-kikan') -- ver el fix de 1.8.2 --, y el registro quedo con las
84
+ * dos. El selector de proyectos del celular lista estas entradas, y cada
85
+ * slug tiene su propio historial de chat, su grafo y su cerebro: elegir la
86
+ * entrada equivocada muestra un proyecto vacio que parece "otro". Al dar de
87
+ * alta, se descartan las demas entradas que apunten a la misma carpeta. */
88
+ const dupes = reg.projects.filter((p) => p.slug !== entry.slug && samePath(p.path, entry.path));
89
+ if (dupes.length > 0) {
90
+ reg.projects = reg.projects.filter((p) => p.slug === entry.slug || !samePath(p.path, entry.path));
91
+ /* Si el puntero activo apuntaba a un slug que acabamos de descartar, se
92
+ * mueve al que sobrevive -- no se deja colgado. */
93
+ if (reg.active_slug && dupes.some((d) => d.slug === reg.active_slug)) {
94
+ reg.active_slug = entry.slug;
95
+ reg.active_root = entry.path;
96
+ }
97
+ }
58
98
  await writeRegistry(reg);
59
99
  return reg;
60
100
  }
@@ -1 +1 @@
1
- {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/core/projects.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,QAAQ,IAAI,EAAE,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAwCzB,MAAM,aAAa,GAAG,eAAe,CAAC;AAEtC,2DAA2D;AAC3D,MAAM,UAAU,WAAW;IACzB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,cAAc,CAAC,CAAC;AACjD,CAAC;AAED;2BAC2B;AAC3B,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GAAG,IAAI,CAAC,IAA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AI,OAAO,CAAC;QACZ,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAC3D,CAAC;QAAC,MAAM,CAAC;YAAC,OAAO;QAAC,CAAC;QACnB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;YACxB,IAAI,CAAC,CAAC,IAAI,KAAK,cAAc,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM;mBACnE,CAAC,CAAC,IAAI,KAAK,cAAc,IAAI,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YAClE,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;gBAChD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAChB,CAAC;iBAAM,IAAI,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;gBAC3B,MAAM,IAAI,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,OAAO,CAAC,CAAS;IACxB,OAAO,CAAC,CAAC,WAAW,EAAE;SACnB,OAAO,CAAC,aAAa,EAAE,GAAG,CAAC;SAC3B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,SAAS,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,118 @@
1
+ # Operate-mode doctrine (Forge Embedded que CONFIGURA el sistema)
2
+
3
+ El asistente residente nacio DIAGNOSTICO (ver `diagnostic-mode`): leer,
4
+ consultar la base read-only, escribir reportes, y emitir la instruccion precisa
5
+ para el operador. El **operate mode** (Pablo, 2026-10-10) es la salida ACOTADA
6
+ de ese read-only: el asistente ademas CONFIGURA el sistema que atiende.
7
+
8
+ ## 1. El alcance, textual
9
+
10
+ Tres cosas, y nada mas:
11
+
12
+ 1. **Configurar por ARCHIVOS de datos de configuracion** -- json, xml, txt,
13
+ ini, env, properties, yaml, toml, vaults.
14
+ 2. **Configurar por TABLAS de configuracion** -- UPDATE/INSERT estructurado
15
+ sobre tablas declaradas como configuracion.
16
+ 3. **Crear procesos nuevos y cronearlos en el orquestador** del sistema.
17
+
18
+ Explicitamente AFUERA:
19
+
20
+ 4. **Las tablas de DATOS del sistema** no se tocan.
21
+ 5. **El software del sistema** no se modifica (codigo fuente, binarios, units,
22
+ definiciones de build o dependencias).
23
+
24
+ ## 2. Como se hace cumplir (no es prompt, es dispatcher)
25
+
26
+ La ley de esta casa: *las reglas son enforcement, no prompt* -- un cerebro
27
+ ignora un prompt. El alcance vive en `src/core/operate_guard.ts` y se aplica en
28
+ tres capas, donde una capa posterior NUNCA puede ensanchar a la anterior:
29
+
30
+ - **A. Invariantes compilados.** Toda extension que es software se rechaza
31
+ aunque el allowlist diga `**/*`; igual el arbol del SO (`/etc`, `/usr`,
32
+ `/boot`...), los esquemas de sistema de la base, y `.forge/` (el perfil que
33
+ otorga estos poderes: el asistente no puede ampliarse a si mismo).
34
+ - **B. Allowlist del operador.** `operate.config_files.allow` (globs) y
35
+ `operate.config_tables.allow` (tablas) en `.forge/profile.<env>.json`.
36
+ **Default deny**: sin allowlist no se escribe nada. Las tablas de datos
37
+ quedan afuera por omision -- no hay que enumerarlas.
38
+ - **C. Validacion por llamada.** Topes de tamano, columnas inmutables, WHERE
39
+ obligatorio, preflight de filas afectadas (0 filas -> no-op rechazado; mas
40
+ que `max_rows` -> cambio demasiado amplio rechazado), gramatica de cron,
41
+ saneado de nombres y argumentos que llegan a una linea de comando.
42
+
43
+ Y una decision de diseno que sostiene el punto 4: **no existe ningun verbo que
44
+ ejecute SQL mutante arbitrario**. El asistente pasa `{table, op, set, where}` y
45
+ el servidor compone la sentencia con identificadores validados y valores
46
+ literales. No hay superficie para "UPDATE pacientes SET ...".
47
+
48
+ ## 3. Los verbos
49
+
50
+ | Verbo | Para que |
51
+ | --- | --- |
52
+ | `yujin.config.file-set` | Cambiar UN valor en un archivo de configuracion. Preferido: deja el resto del archivo byte a byte, hace backup y VERIFICA releyendo (si no verifica, restaura el backup y falla). |
53
+ | `yujin.config.file-write` | Contenido completo, para lo que el editor puntual no puede expresar (XML complejo, blob de vault, archivo nuevo con `create:true`). Leer el archivo ANTES. |
54
+ | `yujin.config.file-revert` | Restaurar un backup por `backup_id`. El contenido actual tambien se respalda: el revert es reversible. |
55
+ | `yujin.config.table-set` | `{table, op: update\|insert\|delete, set, where}` sobre una tabla de configuracion allowlisteada. |
56
+ | `yujin.orchestrator.process-create` | Registrar un proceso nuevo en el orquestador (y opcionalmente cronearlo en la misma llamada). |
57
+ | `yujin.orchestrator.schedule-set` | Poner/cambiar el cron (5 campos Linux; `@daily` se rechaza) y el enabled de un proceso. |
58
+
59
+ Los verbos solo aparecen en el manifest cuando el perfil habilita operate mode,
60
+ y `nac3_invoke` los rechaza a nivel perfil cuando esta apagado. Un embed
61
+ diagnostico comun es identico al build anterior.
62
+
63
+ ## 4. El orquestador se declara, no se adivina
64
+
65
+ Cada sistema tiene su orquestador, asi que la FORMA la declara el operador una
66
+ vez en `operate.orchestrator` y el cerebro solo aporta la intencion
67
+ (`{name, command, cron}`). Tres adaptadores:
68
+
69
+ - `db_table`: filas en las tablas del orquestador (`process_table` +
70
+ `schedule_table`) con un mapa logico -> columna real. El orquestador RPA
71
+ clasico.
72
+ - `http`: POST a la API del propio orquestador (`base_url` + paths, key por env
73
+ var). **Preferido cuando el sistema valida y recarga sus agendas solo**: un
74
+ INSERT directo en un motor que hidrata su catalogo en memoria al arrancar no
75
+ tomaria efecto hasta un reinicio.
76
+ - `cron_file`: fragmento de crontab en un directorio declarado, armado desde un
77
+ `command_template`. Para sistemas cuyo "orquestador" es cron.
78
+
79
+ La URL / tabla / template siempre vienen del perfil: el asistente elige QUE
80
+ agendar, nunca ADONDE postear ni QUE binario correr.
81
+
82
+ ## 5. Como trabajar un pedido de configuracion (siendo el asistente)
83
+
84
+ 1. **Triage**: contra el system map, confirmar que el pedido se resuelve
85
+ OPERANDO el sistema. Si es bug o excepcion no contemplada -> ticket.
86
+ 2. **Leer el valor actual** (`yujin.fs.read-file` / `yujin.db.query`). Nunca
87
+ escribir a ciegas: un archivo de config reconstruido de memoria pierde
88
+ settings en silencio.
89
+ 3. **Decir en una linea** que se va a cambiar y donde, antes de hacerlo.
90
+ 4. **Aplicar** con el verbo puntual, de a un valor.
91
+ 5. **Verificar** releyendo, y reportar `antes -> despues`.
92
+ 6. **Decir que falta para que tome efecto** (reload / restart / proximo tick).
93
+ Reiniciar un servicio NO es del asistente: se le da al operador el comando
94
+ exacto.
95
+ 7. **Todo queda en el journal** (`.forge/changes/changes.jsonl`) con backup del
96
+ archivo o before-image de la fila + sentencia de rollback. Ante la duda:
97
+ revertir, o pasarle al operador el rollback.
98
+ 8. Fuera del alcance sigue siendo el asistente DIAGNOSTICO: instruccion
99
+ precisa, pending, o ticket.
100
+
101
+ `require_approval` (default true) muestra el cambio en el modal del panel antes
102
+ de aplicarlo -- el operador ve exactamente que se va a tocar. Ponerlo en false
103
+ es una decision deliberada del despliegue (queda igual en el journal).
104
+
105
+ ## 6. Como habilitarlo en un despliegue
106
+
107
+ `yf embed` genera `.forge/profile.ops.json` (read_only + operate con allowlists
108
+ VACIOS) y su unit `forge-<app>-ops.service` con `YF_ENV=ops`. Receta:
109
+
110
+ 1. Levantar el servicio ops con los allowlists vacios: el asistente ya
111
+ diagnostica y, como no hay nada declarado, no puede cambiar nada.
112
+ 2. Pedirle que construya/actualice su `system-map.md` y que **proponga** el
113
+ bloque `operate` -- que archivos de config y que tablas de configuracion
114
+ encontro, y como se registran y agendan los procesos.
115
+ 3. Revisar esa propuesta, recortarla (en la duda, afuera) y commitearla. El
116
+ asistente no puede ampliarse: `.forge/` esta fuera de su alcance.
117
+ 4. Reiniciar el servicio ops y probar UN cambio real de punta a punta
118
+ (antes -> despues -> journal -> revert).
@@ -1 +1 @@
1
- {"version":3,"file":"internal_manifest.d.ts","sourceRoot":"","sources":["../../src/nac3/internal_manifest.ts"],"names":[],"mappings":"AAiBA,MAAM,MAAM,UAAU,GAClB,cAAc,GACd,SAAS,GACT,mBAAmB,GACnB,aAAa,GACb,eAAe,GACf,oBAAoB,CAAC;AAEzB,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,KAAK,GACL,YAAY,GACZ,SAAS,GACT,SAAS,GACT,cAAc,GACd,KAAK,CAAC;AAEV,MAAM,MAAM,QAAQ,GAChB,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,YAAY,GACZ,SAAS,GACT,QAAQ,GACR,YAAY,CAAC;AAEjB,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;QACzB,IAAI,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;QAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;QACzB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;IACH,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;CAC7B;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,cAAc,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CACnB;AAykGD,wBAAgB,QAAQ,IAAI,YAAY,CAOvC;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAGzD;AAED;gEACgE;AAChE,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAO9D;AAED;;;uDAGuD;AACvD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,GAAG,IAAI,CAgCzF;AAED;;sEAEsE;AACtE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,SAAI,GAAG,MAAM,EAAE,CAO/D"}
@@ -1293,6 +1293,192 @@ const VERBS = [
1293
1293
  visible: false,
1294
1294
  handler_side: 'server',
1295
1295
  },
1296
+ /* ============================================================
1297
+ * OPERATE MODE VERBS (Pablo 2026-10-10) -- the Forge Embedded
1298
+ * assistant CONFIGURING the system it attends.
1299
+ *
1300
+ * Surfaced in the prompt stub ONLY when the deployment profile
1301
+ * enables operate mode (buildManifestStub({includeOperateVerbs})),
1302
+ * and nac3_invoke rejects them profile-wide when it is off, so a
1303
+ * plain diagnostic embed is identical to the pre-operate build.
1304
+ * Scope enforcement (which files, which tables, never software,
1305
+ * never data tables) lives in core/operate_guard.ts.
1306
+ * ============================================================ */
1307
+ {
1308
+ id: 'yujin.config.file-set',
1309
+ role: 'action',
1310
+ action: 'config_file_set',
1311
+ label: 'Cambiar un valor de configuracion en un archivo',
1312
+ description: 'Change ONE value inside a CONFIGURATION DATA FILE of the attended '
1313
+ + 'system (json / xml / ini / env / properties / yaml / txt / vault). '
1314
+ + 'PREFERRED over file-write: it keeps the rest of the file untouched '
1315
+ + '(comments, order, unrelated keys), backs it up, and VERIFIES the new '
1316
+ + 'value by reading it back (a write that does not verify is rolled '
1317
+ + 'back). key syntax by format: json "a.b.c" (or a.b[0].c), ini '
1318
+ + '"section.key", env/properties "KEY", yaml "a.b", xml "root/child" or '
1319
+ + '"root/child@attr". value must be a scalar. The file must be '
1320
+ + 'allowlisted in the deployment profile (operate.config_files.allow); '
1321
+ + 'SOFTWARE files are always refused. READ the current value first and '
1322
+ + 'report before -> after.',
1323
+ schema: {
1324
+ type: 'object',
1325
+ properties: {
1326
+ path: { type: 'string', description: 'Config file. Project-relative, or absolute when the allowlist declares it.', minLength: 1, maxLength: 1000 },
1327
+ key: { type: 'string', description: 'Setting path inside the file (format-dependent, see the description).', minLength: 1, maxLength: 500 },
1328
+ value: { type: 'string', description: 'New value, as text. Its TYPE is taken from the value already in the file (a JSON number stays a number) unless value_type says otherwise.', maxLength: 65535 },
1329
+ value_type: { type: 'string', description: 'Force the written type: auto (default: same as the current value) | string | number | boolean | null.', enum: ['auto', 'string', 'number', 'boolean', 'null'] },
1330
+ format: { type: 'string', description: 'Override the format detected from the extension: json|ini|env|properties|yaml|xml.' },
1331
+ create_missing: { type: 'boolean', description: 'Create the key when it does not exist (json/ini/env only). Default false.' },
1332
+ reason: { type: 'string', description: 'Why this change is being made -- it goes to the change journal.', maxLength: 500 },
1333
+ },
1334
+ required: ['path', 'key', 'value'],
1335
+ },
1336
+ policy: 'approval-required',
1337
+ side_effects: ['filesystem'],
1338
+ visible: false,
1339
+ handler_side: 'server',
1340
+ },
1341
+ {
1342
+ id: 'yujin.config.file-write',
1343
+ role: 'action',
1344
+ action: 'config_file_write',
1345
+ label: 'Reescribir un archivo de configuracion completo',
1346
+ description: 'Replace the FULL content of a configuration file of the attended '
1347
+ + 'system. Use it ONLY when the targeted editor (yujin.config.file-set) '
1348
+ + 'cannot express the change -- a complex XML block, a vault blob, a '
1349
+ + 'brand-new config file (create:true). ALWAYS read the file first and '
1350
+ + 'send it back complete: a config file reconstructed from memory '
1351
+ + 'silently loses settings. Keeps a backup + journal entry. Same '
1352
+ + 'allowlist as file-set; SOFTWARE files are always refused.',
1353
+ schema: {
1354
+ type: 'object',
1355
+ properties: {
1356
+ path: { type: 'string', description: 'Config file (allowlisted).', minLength: 1, maxLength: 1000 },
1357
+ content: { type: 'string', description: 'The COMPLETE new text of the file.', maxLength: 524288 },
1358
+ create: { type: 'boolean', description: 'Allow creating a file that does not exist yet. Default false.' },
1359
+ reason: { type: 'string', description: 'Why -- goes to the change journal.', maxLength: 500 },
1360
+ },
1361
+ required: ['path', 'content'],
1362
+ },
1363
+ policy: 'approval-required',
1364
+ side_effects: ['filesystem'],
1365
+ visible: false,
1366
+ handler_side: 'server',
1367
+ },
1368
+ {
1369
+ id: 'yujin.config.file-revert',
1370
+ role: 'action',
1371
+ action: 'config_file_revert',
1372
+ label: 'Revertir un cambio de configuracion',
1373
+ description: 'Restore a configuration file from a backup taken by this assistant. '
1374
+ + 'backup_id comes from the result of the change, or from the journal '
1375
+ + '(<journal_dir>/changes.jsonl). The current content is backed up too, '
1376
+ + 'so the revert is itself reversible.',
1377
+ schema: {
1378
+ type: 'object',
1379
+ properties: {
1380
+ backup_id: { type: 'string', description: 'Backup id from the change result or the journal.', minLength: 1, maxLength: 200 },
1381
+ reason: { type: 'string', description: 'Why -- goes to the change journal.', maxLength: 500 },
1382
+ },
1383
+ required: ['backup_id'],
1384
+ },
1385
+ policy: 'approval-required',
1386
+ side_effects: ['filesystem'],
1387
+ visible: false,
1388
+ handler_side: 'server',
1389
+ },
1390
+ {
1391
+ id: 'yujin.config.table-set',
1392
+ role: 'action',
1393
+ action: 'config_table_set',
1394
+ label: 'Cambiar un valor en una tabla de configuracion',
1395
+ description: 'STRUCTURED write on a CONFIGURATION TABLE of the attended system: '
1396
+ + '{table, op: update|insert|delete, set:{col:value}, where:{col:value}}. '
1397
+ + 'There is NO verb for arbitrary mutating SQL -- this composes the '
1398
+ + 'statement itself from validated identifiers and literal values. The '
1399
+ + 'table must be allowlisted in the deployment profile '
1400
+ + '(operate.config_tables.allow): the system DATA tables are off limits, '
1401
+ + 'and insert/delete may be disabled. UPDATE/DELETE need a where; the '
1402
+ + 'matched rows are preflighted (0 rows -> refused as a no-op, too many '
1403
+ + '-> refused as too broad) and the before-image plus a rollback '
1404
+ + 'statement go to the journal. FIND the row with yujin.db.query first, '
1405
+ + 'then report before -> after.',
1406
+ schema: {
1407
+ type: 'object',
1408
+ properties: {
1409
+ table: { type: 'string', description: 'Configuration table (optionally db-qualified).', minLength: 1, maxLength: 200 },
1410
+ op: { type: 'string', description: 'update (default) | insert | delete.' },
1411
+ set: { type: 'object', description: '{column: value} to write. Scalars only.' },
1412
+ where: { type: 'object', description: '{column: value} row selector, ANDed. Mandatory for update/delete.' },
1413
+ reason: { type: 'string', description: 'Why -- goes to the change journal.', maxLength: 500 },
1414
+ },
1415
+ required: ['table'],
1416
+ },
1417
+ policy: 'approval-required',
1418
+ side_effects: ['network'],
1419
+ visible: false,
1420
+ handler_side: 'server',
1421
+ },
1422
+ {
1423
+ id: 'yujin.orchestrator.process-create',
1424
+ role: 'action',
1425
+ action: 'orchestrator_process_create',
1426
+ label: 'Crear un proceso en el orquestador',
1427
+ description: 'Register a NEW process in the attended system orchestrator. The HOW '
1428
+ + '(tables / API / cron dir, and the command template) is declared by '
1429
+ + 'the operator in operate.orchestrator; you only say WHAT: name, what '
1430
+ + 'it runs (command, or target_kind + target_slug for a declarative '
1431
+ + 'catalog), optional params, and optionally cron to schedule it in the '
1432
+ + 'same call. This REGISTERS a process -- it never writes the program '
1433
+ + 'itself (that would be modifying the software). Verify it afterwards '
1434
+ + 'and say whether the orchestrator needs a reload.',
1435
+ schema: {
1436
+ type: 'object',
1437
+ properties: {
1438
+ name: { type: 'string', description: 'Process name (letters, digits, space, . _ -).', minLength: 1, maxLength: 80 },
1439
+ description: { type: 'string', description: 'What it does, for the operator.', maxLength: 500 },
1440
+ command: { type: 'string', description: 'Program/script the orchestrator already has (no shell metacharacters).', maxLength: 400 },
1441
+ target_kind: { type: 'string', description: 'Declarative orchestrators: the kind of catalog entry (e.g. kawa|sazanami).' },
1442
+ target_slug: { type: 'string', description: 'Declarative orchestrators: the catalog entry slug.' },
1443
+ params: { type: 'object', description: 'Extra parameters (serialised as JSON).' },
1444
+ enabled: { type: 'boolean', description: 'Create it enabled. Default true.' },
1445
+ cron: { type: 'string', description: 'Schedule it in the same call: 5 Linux cron fields, e.g. "0 3 * * *".' },
1446
+ reason: { type: 'string', description: 'Why -- goes to the change journal.', maxLength: 500 },
1447
+ },
1448
+ required: ['name'],
1449
+ },
1450
+ policy: 'approval-required',
1451
+ side_effects: ['network', 'filesystem'],
1452
+ visible: false,
1453
+ handler_side: 'server',
1454
+ },
1455
+ {
1456
+ id: 'yujin.orchestrator.schedule-set',
1457
+ role: 'action',
1458
+ action: 'orchestrator_schedule_set',
1459
+ label: 'Agendar (cronear) un proceso del orquestador',
1460
+ description: 'Set / change the SCHEDULE of a process in the attended system '
1461
+ + 'orchestrator: name + cron (5 Linux fields -- validated; macros like '
1462
+ + '@daily are refused) + enabled. With the db_table adapter it updates '
1463
+ + 'the schedule row, and creates it when the process has none yet. Say '
1464
+ + 'when the next run falls and whether the orchestrator re-reads its '
1465
+ + 'schedules live.',
1466
+ schema: {
1467
+ type: 'object',
1468
+ properties: {
1469
+ name: { type: 'string', description: 'The process whose schedule changes.', minLength: 1, maxLength: 80 },
1470
+ cron: { type: 'string', description: '5 Linux cron fields: minute hour day-of-month month day-of-week.', minLength: 1, maxLength: 120 },
1471
+ enabled: { type: 'boolean', description: 'Leave the schedule enabled. Default true.' },
1472
+ context: { type: 'object', description: 'Optional context/payload the orchestrator passes to the run.' },
1473
+ reason: { type: 'string', description: 'Why -- goes to the change journal.', maxLength: 500 },
1474
+ },
1475
+ required: ['name', 'cron'],
1476
+ },
1477
+ policy: 'approval-required',
1478
+ side_effects: ['network', 'filesystem'],
1479
+ visible: false,
1480
+ handler_side: 'server',
1481
+ },
1296
1482
  /* ============================================================
1297
1483
  * MCP BRIDGE VERBS (alpha.59z.26 F101 slice 2)
1298
1484
  *