@nac3/forge-cli 1.8.6 → 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.
- package/dist/chat/doctrine_digest.d.ts.map +1 -1
- package/dist/chat/doctrine_digest.js +11 -0
- package/dist/chat/doctrine_digest.js.map +1 -1
- package/dist/chat/server.d.ts.map +1 -1
- package/dist/chat/server.js +8 -2
- package/dist/chat/server.js.map +1 -1
- package/dist/chat/tools/config_write.d.ts +35 -0
- package/dist/chat/tools/config_write.d.ts.map +1 -0
- package/dist/chat/tools/config_write.js +381 -0
- package/dist/chat/tools/config_write.js.map +1 -0
- package/dist/chat/tools/db_query.d.ts +20 -0
- package/dist/chat/tools/db_query.d.ts.map +1 -1
- package/dist/chat/tools/db_query.js +3 -3
- package/dist/chat/tools/db_query.js.map +1 -1
- package/dist/chat/tools/nac3_invoke.d.ts.map +1 -1
- package/dist/chat/tools/nac3_invoke.js +19 -1
- package/dist/chat/tools/nac3_invoke.js.map +1 -1
- package/dist/chat/tools/orchestrator_write.d.ts +27 -0
- package/dist/chat/tools/orchestrator_write.d.ts.map +1 -0
- package/dist/chat/tools/orchestrator_write.js +481 -0
- package/dist/chat/tools/orchestrator_write.js.map +1 -0
- package/dist/chat/tools.d.ts.map +1 -1
- package/dist/chat/tools.js +28 -0
- package/dist/chat/tools.js.map +1 -1
- package/dist/commands/embed.d.ts +1 -0
- package/dist/commands/embed.d.ts.map +1 -1
- package/dist/commands/embed.js +5 -1
- package/dist/commands/embed.js.map +1 -1
- package/dist/core/config_formats.d.ts +45 -0
- package/dist/core/config_formats.d.ts.map +1 -0
- package/dist/core/config_formats.js +519 -0
- package/dist/core/config_formats.js.map +1 -0
- package/dist/core/db_write.d.ts +26 -0
- package/dist/core/db_write.d.ts.map +1 -0
- package/dist/core/db_write.js +262 -0
- package/dist/core/db_write.js.map +1 -0
- package/dist/core/forge_embed.d.ts +1 -0
- package/dist/core/forge_embed.d.ts.map +1 -1
- package/dist/core/forge_embed.js +132 -2
- package/dist/core/forge_embed.js.map +1 -1
- package/dist/core/forge_profile.d.ts +23 -0
- package/dist/core/forge_profile.d.ts.map +1 -1
- package/dist/core/forge_profile.js +56 -0
- package/dist/core/forge_profile.js.map +1 -1
- package/dist/core/operate_guard.d.ts +154 -0
- package/dist/core/operate_guard.d.ts.map +1 -0
- package/dist/core/operate_guard.js +542 -0
- package/dist/core/operate_guard.js.map +1 -0
- package/dist/docs/doctrine/operate-mode.md +118 -0
- package/dist/nac3/internal_manifest.d.ts.map +1 -1
- package/dist/nac3/internal_manifest.js +186 -0
- package/dist/nac3/internal_manifest.js.map +1 -1
- package/dist/nac3/manifest_lazy.d.ts +5 -0
- package/dist/nac3/manifest_lazy.d.ts.map +1 -1
- package/dist/nac3/manifest_lazy.js +3 -1
- package/dist/nac3/manifest_lazy.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/doctrine/operate-mode.md +118 -0
- package/package.json +1 -1
|
@@ -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;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AO,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
|
*
|