supcoflow 0.7.0 → 0.8.1

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.
@@ -1,19 +1,19 @@
1
- // `supcoflow describir --json`: el contrato entero en una línea (§13), para que un asistente sepa
1
+ // `supcoflow describe --json`: el contrato entero en una línea (§13), para que un asistente sepa
2
2
  // qué comandos hay, con qué flags, qué puede la clave y qué quiere decir cada código, sin leer la
3
3
  // ayuda pensada para personas. La ayuda se arma desde acá: una sola fuente, así no se desfasan.
4
4
  import { SALIDA } from "../contrato.js";
5
5
  // A mano a propósito, como en api.ts: tiene que coincidir con package.json (lo pinza un test).
6
- const VERSION = "0.7.0";
6
+ const VERSION = "0.8.1";
7
7
  export const DESCRIPCION = {
8
8
  version: VERSION,
9
9
  comandos: [
10
10
  {
11
11
  nombre: "login",
12
- resumen: "Inicia sesión aprobando un código desde la consola. Sin terminal interactiva, en dos pasos: --start y después --wait.",
12
+ resumen: "Signs in by approving a code from the console. Without an interactive terminal, in two steps: --start and then --wait.",
13
13
  flags: [
14
- "--start: pide el código y sale 5 con la URL para aprobarlo",
15
- "--wait: espera la aprobación hasta 90 s; sale 5 si todavía no llegó (volvé a llamarlo)",
16
- "--dry-run: dice qué haría sin pedir nada (no vale con --wait)",
14
+ "--start: asks for the code and exits 5 with the URL to approve it",
15
+ "--wait: waits for the approval up to 90 s; exits 5 if it hasn't arrived yet (call it again)",
16
+ "--dry-run: says what it would do without asking for anything (not valid with --wait)",
17
17
  "--json",
18
18
  ],
19
19
  ejemplos: ["supcoflow login", "supcoflow login --start --json", "supcoflow login --wait --json"],
@@ -21,270 +21,280 @@ export const DESCRIPCION = {
21
21
  },
22
22
  {
23
23
  nombre: "logout",
24
- resumen: "Revoca la clave en uso y la borra de esta máquina; reintenta las que quedaron por revocar.",
25
- flags: ["--dry-run: dice qué revocaría sin revocar nada", "--json"],
24
+ resumen: "Revokes the key in use and deletes it from this machine; retries the ones left to revoke.",
25
+ flags: ["--dry-run: says what it would revoke without revoking anything", "--json"],
26
26
  ejemplos: ["supcoflow logout", "supcoflow logout --json"],
27
27
  codigos: [0, 1, 3],
28
28
  },
29
29
  {
30
- nombre: "quien-soy",
31
- resumen: "Muestra con qué clave anda la terminal, a nombre de quién y en qué equipo.",
30
+ nombre: "whoami",
31
+ resumen: "Shows which key the terminal runs with, on whose behalf and in which team.",
32
32
  flags: ["--json"],
33
- ejemplos: ["supcoflow quien-soy", "supcoflow quien-soy --json"],
33
+ ejemplos: ["supcoflow whoami", "supcoflow whoami --json"],
34
34
  codigos: [0, 1, 2, 3],
35
35
  },
36
36
  {
37
- nombre: "describir",
38
- resumen: "Describe comandos, flags, facultades y códigos de salida, para un asistente.",
37
+ nombre: "describe",
38
+ resumen: "Describes commands, flags, capabilities and exit codes, for an assistant.",
39
39
  flags: ["--json"],
40
- ejemplos: ["supcoflow describir --json"],
40
+ ejemplos: ["supcoflow describe --json"],
41
41
  codigos: [0],
42
42
  },
43
43
  {
44
- nombre: "repo conectar",
45
- resumen: "Conecta el repo de esta carpeta (o el de --repo) con la App de GitHub: una persona lo confirma en la consola. Sin terminal interactiva, en dos pasos: --start y después --wait.",
44
+ nombre: "repo connect",
45
+ resumen: "Connects this folder's repo (or --repo's) with the GitHub App: a person confirms it in the console. Without an interactive terminal, in two steps: --start and then --wait.",
46
46
  flags: [
47
- "--start: pide la conexión y sale 5 con la URL para confirmarla",
48
- "--wait: espera la confirmación hasta 90 s; sale 5 si todavía no llegó (volvé a llamarlo)",
49
- "--repo owner/repo: el repo, si no es el «origin» de esta carpeta",
50
- "--dry-run: dice qué pediría sin pedir nada (--wait sólo lee)",
47
+ "--start: requests the connection and exits 5 with the URL to confirm it",
48
+ "--wait: waits for the confirmation up to 90 s; exits 5 if it hasn't arrived yet (call it again)",
49
+ "--repo owner/repo: the repo, if it isn't this folder's «origin»",
50
+ "--dry-run: says what it would request without requesting anything (--wait only reads)",
51
51
  "--json",
52
52
  ],
53
- ejemplos: ["supcoflow repo conectar", "supcoflow repo conectar --start --json", "supcoflow repo conectar --wait --json"],
53
+ ejemplos: ["supcoflow repo connect", "supcoflow repo connect --start --json", "supcoflow repo connect --wait --json"],
54
54
  codigos: [0, 1, 2, 3, 4, 5],
55
55
  },
56
56
  {
57
- nombre: "proyecto crear",
58
- resumen: "Crea (o reusa) el proyecto del repo ya conectado y lo anota en .supcoflow/proyecto.json; un archivo distinto nunca se pisa (sale 4).",
57
+ nombre: "project create",
58
+ resumen: "Creates (or reuses) the already connected repo's project and records it in .supcoflow/proyecto.json; a different existing file is never overwritten (exits 4). Before connecting or creating anything it checks what it can see and exits 4 contexto_incoherente (motivo proyecto_del_clon_distinto: the clone notes a project your account doesn't see for this repo; archivo_del_clon_ilegible: .supcoflow/proyecto.json can't be read; dueno_distinto_del_login: a possible mismatch, the repo's owner on GitHub isn't the GitHub login of your key; sin_github: the account isn't signed in with GitHub) without touching anything.",
59
59
  flags: [
60
- "--install \"…\": el comando de instalación, cuando el motor no lo puede deducir",
61
- "--test \"…\": el comando de pruebas, ídem",
62
- "--repo owner/repo: el repo, si no es el «origin» de esta carpeta (sin escribir el archivo)",
63
- "--dry-run: dice qué crearía sin crear nada",
60
+ "--install \"…\": the install command, when the engine can't work it out",
61
+ "--test \"…\": the test command, same",
62
+ "--repo owner/repo: the repo, if it isn't this folder's «origin» (without reading or writing this clone's file)",
63
+ "--dry-run: says what it would create without creating anything",
64
64
  "--json",
65
65
  ],
66
- ejemplos: ["supcoflow proyecto crear --json", "supcoflow proyecto crear --install \"pnpm i\" --test \"pnpm test\""],
66
+ ejemplos: ["supcoflow project create --json", "supcoflow project create --install \"pnpm i\" --test \"pnpm test\""],
67
67
  codigos: [0, 1, 2, 3, 4],
68
68
  },
69
69
  {
70
- nombre: "proyecto ver",
71
- resumen: "Muestra el proyecto del repo: rama, comandos y el estado de la App de GitHub; null si todavía no tiene.",
72
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--json"],
73
- ejemplos: ["supcoflow proyecto ver --json"],
74
- codigos: [0, 1, 2, 3],
70
+ nombre: "project show",
71
+ resumen: "Shows the repo's project: branch, commands and the GitHub App's state; null if it has none yet. It starts with who you are: `contexto` { equipo, identidad (the GitHub login, or «email», or «clave_de_consulta»), identidad_tipo, fuente, repo, proyecto (id or null), en_el_clon { estado: ausente|valido|ilegible, id } }, said as «You're @login in team T; repo O/R; project P (existing)». Exits 4 contexto_incoherente if this clone's .supcoflow/proyecto.json doesn't match what your key sees (proyecto_del_clon_distinto / archivo_del_clon_ilegible) or, when the repo has no project yet, if the account can't create one for it (dueno_distinto_del_login, a possible mismatch / sin_github): it stops BEFORE `repo connect`. The repo comes from the «origin» of this clone; if origin is an SSH alias or not GitHub, from a remote called `supcoflow` that points at https://github.com/owner/repo.git (the first time, `git remote add supcoflow https://github.com/owner/repo.git`: it is never fetched and ssh is never run).",
72
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--json"],
73
+ ejemplos: ["supcoflow project show --json"],
74
+ codigos: [0, 1, 2, 3, 4],
75
75
  },
76
76
  {
77
- nombre: "catalogo",
78
- resumen: "Lista lo que se puede configurar en el chat (claves y valores admitidos) y el estado del contrato de la App.",
77
+ nombre: "catalog",
78
+ resumen: "Lists what can be configured in the chat (keys and accepted values) and the state of the App's contract.",
79
79
  flags: ["--json"],
80
- ejemplos: ["supcoflow catalogo --json"],
80
+ ejemplos: ["supcoflow catalog --json"],
81
81
  codigos: [0, 1, 2, 3],
82
82
  },
83
83
  {
84
- nombre: "configuracion",
85
- resumen: "Muestra la configuración del proyecto del repo: chat, sitios, marca, política de problemas y acuerdo de datos. El acuerdo frena lo que se guarda y lo que lee la IA que releva; no cubre lo que ve la IA del chat mientras conversa.",
86
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--json"],
87
- ejemplos: ["supcoflow configuracion --json"],
84
+ nombre: "config",
85
+ resumen: "Shows the repo's project configuration: chat, sites, brand, problem policy and data agreement. The agreement limits what is saved and what the investigating AI reads; it doesn't cover what the chat's AI sees while it talks. Like every command that acts on the repo's project, it exits 4 contexto_incoherente without doing anything if this clone's .supcoflow/proyecto.json notes another project than the one your key sees (proyecto_del_clon_distinto) or can't be read (archivo_del_clon_ilegible).",
86
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--json"],
87
+ ejemplos: ["supcoflow config --json"],
88
88
  codigos: [0, 1, 2, 3, 4],
89
89
  },
90
90
  {
91
- nombre: "chat prender",
92
- resumen: "Prende el chat de soporte del proyecto. Hace falta una guía vigente (la publicada del repo o la aprobada de nuestro agente); si no, sale 4 (skill_no_aprobada).",
93
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--dry-run: dice qué haría sin hacerlo", "--json"],
94
- ejemplos: ["supcoflow chat prender --json"],
91
+ nombre: "chat on",
92
+ resumen: "Turns the project's support chat on. A current guide is needed (the repo's published one or our agent's approved one); otherwise it exits 4 (skill_no_aprobada).",
93
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--dry-run: says what it would do without doing it", "--json"],
94
+ ejemplos: ["supcoflow chat on --json"],
95
95
  codigos: [0, 1, 2, 3, 4],
96
96
  },
97
97
  {
98
- nombre: "chat apagar",
99
- resumen: "Apaga el chat de soporte del proyecto.",
100
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--dry-run: dice qué haría sin hacerlo", "--json"],
101
- ejemplos: ["supcoflow chat apagar --json"],
98
+ nombre: "chat off",
99
+ resumen: "Turns the project's support chat off.",
100
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--dry-run: says what it would do without doing it", "--json"],
101
+ ejemplos: ["supcoflow chat off --json"],
102
102
  codigos: [0, 1, 2, 3, 4],
103
103
  },
104
104
  {
105
- nombre: "chat marca",
106
- resumen: "Cambia título, saludo y colores del chat; lo que no nombrás queda como estaba.",
105
+ nombre: "chat brand",
106
+ resumen: "Changes the chat's title, greeting and colors; whatever you don't name stays as it was.",
107
107
  flags: [
108
- "--titulo \"…\": el título del chat",
109
- "--saludo \"…\": el saludo inicial",
110
- "--tema clave=valor: un color o ajuste del tema (se repite, uno por clave)",
111
- "--repo owner/repo: el repo, si no es el «origin» de esta carpeta",
112
- "--dry-run: dice qué haría sin hacerlo",
108
+ "--title \"…\": the chat's title",
109
+ "--greeting \"…\": the opening greeting",
110
+ "--theme key=value: a color or theme setting (repeatable, one per key); the keys are the API's: acento, fondo, texto, textoSuave, radio, fuente",
111
+ "--repo owner/repo: the repo, if it isn't this folder's «origin»",
112
+ "--dry-run: says what it would do without doing it",
113
113
  "--json",
114
114
  ],
115
- ejemplos: ["supcoflow chat marca --titulo \"Ayuda\" --tema acento=#0a7"],
115
+ ejemplos: ["supcoflow chat brand --title \"Help\" --theme acento=#0a7"],
116
116
  codigos: [0, 1, 2, 3, 4],
117
117
  },
118
118
  {
119
119
  nombre: "chat logo",
120
- resumen: "Sube el logo del chat (.png, .jpg o .webp, hasta 200 KB).",
121
- flags: ["--archivo ruta: la imagen", "--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--dry-run: dice qué haría sin hacerlo", "--json"],
122
- ejemplos: ["supcoflow chat logo --archivo logo.png --json"],
120
+ resumen: "Uploads the chat's logo (.png, .jpg or .webp, up to 200 KB).",
121
+ flags: ["--file path: the image", "--repo owner/repo: the repo, if it isn't this folder's «origin»", "--dry-run: says what it would do without doing it", "--json"],
122
+ ejemplos: ["supcoflow chat logo --file logo.png --json"],
123
123
  codigos: [0, 1, 2, 3, 4],
124
124
  },
125
125
  {
126
- nombre: "sitios agregar",
127
- resumen: "Agrega un sitio desde el que el chat puede cargarse.",
128
- flags: ["--sitio https://…: el sitio", "--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--dry-run: dice qué haría sin hacerlo", "--json"],
129
- ejemplos: ["supcoflow sitios agregar --sitio https://app.ejemplo.com"],
126
+ nombre: "sites add",
127
+ resumen: "Adds a site the chat can load from.",
128
+ flags: ["--site https://…: the site", "--repo owner/repo: the repo, if it isn't this folder's «origin»", "--dry-run: says what it would do without doing it", "--json"],
129
+ ejemplos: ["supcoflow sites add --site https://app.example.com"],
130
130
  codigos: [0, 1, 2, 3, 4],
131
131
  },
132
132
  {
133
- nombre: "sitios quitar",
134
- resumen: "Quita un sitio de los que pueden cargar el chat.",
135
- flags: ["--sitio https://…: el sitio", "--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--dry-run: dice qué haría sin hacerlo", "--json"],
136
- ejemplos: ["supcoflow sitios quitar --sitio https://app.ejemplo.com"],
133
+ nombre: "sites remove",
134
+ resumen: "Removes a site from the ones that can load the chat.",
135
+ flags: ["--site https://…: the site", "--repo owner/repo: the repo, if it isn't this folder's «origin»", "--dry-run: says what it would do without doing it", "--json"],
136
+ ejemplos: ["supcoflow sites remove --site https://app.example.com"],
137
137
  codigos: [0, 1, 2, 3, 4],
138
138
  },
139
139
  {
140
- nombre: "datos fijar",
141
- resumen: "Fija el acuerdo de datos: qué datos pasan. Frena lo que se guarda y lo que lee la IA que releva el repo; no cubre lo que ve la IA del chat mientras conversa.",
140
+ nombre: "data set",
141
+ resumen: "Sets the data agreement: which data gets through. It limits what is saved and what the AI that investigates the repo reads; it doesn't cover what the chat's AI sees while it talks.",
142
142
  flags: [
143
- "--permitir lista: datos que pasan, separados por coma (usuario_id, usuario_rol, pagina_y_navegador, capturas, elementos, email, atributo:nombre) o `nada`",
144
- "--repo owner/repo: el repo, si no es el «origin» de esta carpeta",
145
- "--dry-run: dice qué haría sin hacerlo",
143
+ "--allow list: data that gets through, comma-separated (user_id, user_role, page_and_browser, screenshots, elements, email, attribute:name) or `nothing`",
144
+ "--repo owner/repo: the repo, if it isn't this folder's «origin»",
145
+ "--dry-run: says what it would do without doing it",
146
146
  "--json",
147
147
  ],
148
- ejemplos: ["supcoflow datos fijar --permitir usuario_id,atributo:plan"],
148
+ ejemplos: ["supcoflow data set --allow user_id,attribute:plan"],
149
149
  codigos: [0, 1, 2, 3, 4],
150
150
  },
151
151
  {
152
- nombre: "politica fijar",
153
- resumen: "Fija qué hace el motor con un problema que llega por el chat: relevarlo en el acto (gasta) o guardarlo. Guardar frena sólo lo automático del chat: desde la consola una persona puede pedir el relevamiento, y cuesta.",
154
- flags: ["--modo relevar|guardar", "--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--dry-run: dice qué haría sin hacerlo", "--json"],
155
- ejemplos: ["supcoflow politica fijar --modo guardar"],
152
+ nombre: "policy set",
153
+ resumen: "Sets what the engine does with a problem that comes in through the chat: investigate it right away (spends) or save it. Saving only stops what the chat does automatically: from the console a person can still ask for the investigation, and it costs.",
154
+ flags: ["--mode investigate|save", "--repo owner/repo: the repo, if it isn't this folder's «origin»", "--dry-run: says what it would do without doing it", "--json"],
155
+ ejemplos: ["supcoflow policy set --mode save"],
156
156
  codigos: [0, 1, 2, 3, 4],
157
157
  },
158
158
  {
159
- nombre: "claves crear",
160
- resumen: "Crea una clave de consulta (sólo lee su proyecto) y la guarda en un archivo 0600 fuera de todo repo; el secreto nunca sale por la salida.",
159
+ nombre: "keys create",
160
+ resumen: "Creates a read-only key (it only reads its project) and saves it in a 0600 file outside any repo; the secret never goes out through the output.",
161
161
  flags: [
162
- "--nombre ci: para qué es la clave",
163
- "--guardar-en ruta: el archivo donde queda (fuera de un repo; si ya tiene otra cosa sale 4 y no lo toca)",
164
- "--repo owner/repo: el repo, si no es el «origin» de esta carpeta",
165
- "--dry-run: dice qué haría sin hacerlo",
162
+ "--name ci: what the key is for",
163
+ "--save-to path: the file where it ends up (outside a repo; if it already has something else it exits 4 and doesn't touch it)",
164
+ "--repo owner/repo: the repo, if it isn't this folder's «origin»",
165
+ "--dry-run: says what it would do without doing it",
166
166
  "--json",
167
167
  ],
168
- ejemplos: ["supcoflow claves crear --nombre ci --guardar-en ~/ci.key --json"],
168
+ ejemplos: ["supcoflow keys create --name ci --save-to ~/ci.key --json"],
169
169
  codigos: [0, 1, 2, 3, 4],
170
170
  },
171
171
  {
172
- nombre: "claves listar",
173
- resumen: "Lista las claves de consulta activas del proyecto (id, nombre, fecha; nunca el secreto).",
174
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--json"],
175
- ejemplos: ["supcoflow claves listar --json"],
172
+ nombre: "keys list",
173
+ resumen: "Lists the project's active read-only keys (id, name, date; never the secret).",
174
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--json"],
175
+ ejemplos: ["supcoflow keys list --json"],
176
176
  codigos: [0, 1, 2, 3, 4],
177
177
  },
178
178
  {
179
- nombre: "claves revocar",
180
- resumen: "Revoca una clave de consulta por su id; revocar dos veces deja lo mismo.",
181
- flags: ["--id cla_…: la clave (la da `claves listar`)", "--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--dry-run: dice qué haría sin hacerlo", "--json"],
182
- ejemplos: ["supcoflow claves revocar --id cla_0123456789abcdef --json"],
179
+ nombre: "keys revoke",
180
+ resumen: "Revokes a read-only key by its id; revoking twice leaves the same result.",
181
+ flags: ["--id cla_…: the key (`keys list` gives it)", "--repo owner/repo: the repo, if it isn't this folder's «origin»", "--dry-run: says what it would do without doing it", "--json"],
182
+ ejemplos: ["supcoflow keys revoke --id cla_0123456789abcdef --json"],
183
183
  codigos: [0, 1, 2, 3, 4],
184
184
  },
185
185
  {
186
- nombre: "guia revisar",
187
- resumen: "Revisa .supcoflow/guia.md (la raíz de este clon) contra el motor, sin publicar nada: dice si está bien armada y cuántas secciones tiene. Es el paso antes del commit.",
188
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta (sin clon local sale 3 falta_guia: la guía se lee del archivo)", "--dry-run: dice qué mandaría sin mandarlo", "--json"],
189
- ejemplos: ["supcoflow guia revisar --json"],
186
+ nombre: "guide check",
187
+ resumen: "Checks .supcoflow/guide.md (this clone's root) against the engine, without publishing anything: says whether it's well formed and how many sections it has. It's the step before the commit. If guide.md doesn't exist it reads the old name .supcoflow/guia.md and says so.",
188
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin» (the guide is read from this clone only if it is that repo: its origin, or a `supcoflow` remote at https://github.com/owner/repo.git; otherwise it exits 3 falta_guia saying what this clone is and the exact `git remote add supcoflow …`, without asking the engine)", "--dry-run: says what it would send without sending it", "--json"],
189
+ ejemplos: ["supcoflow guide check --json"],
190
190
  codigos: [0, 1, 2, 3, 4],
191
191
  },
192
192
  {
193
- nombre: "guia publicar",
194
- resumen: "Sube .supcoflow/guia.md directo: manda el contenido y el commit y la rama que declara este clon (si hay git y commits; si no, sin commit). El motor la revisa y la deja como guía activa; el commit queda como «declarado por la terminal, no verificado en GitHub». Con --desde-github conserva la vía anterior: manda la huella y el motor la compara con la de la rama principal; si todavía no está subida a esa rama (o es otra), sale 5.",
195
- flags: ["--desde-github: no sube el archivo; verifica contra la rama principal de GitHub (sale 5 guia_no_subida / guia_distinta si no coincide)", "--repo owner/repo: el repo, si no es el «origin» de esta carpeta (sin clon local sale 3 falta_guia: la guía se lee del archivo)", "--dry-run: dice qué mandaría (o la huella con --desde-github), sin pedir nada", "--json"],
196
- ejemplos: ["supcoflow guia publicar --json"],
193
+ nombre: "guide publish",
194
+ resumen: "Uploads .supcoflow/guide.md directly (or the old name guia.md, only if guide.md doesn't exist): sends the content, the file it read and the commit and branch this clone declares (if there's git and commits; otherwise, no commit). The engine checks it and makes it the active guide; the commit is kept as «declared by the terminal, not verified in GitHub». With --from-github it keeps the earlier route: it sends the fingerprint and the engine compares it with the main branch's; if it isn't pushed to that branch yet (or it's another one), it exits 5.",
195
+ flags: ["--from-github: doesn't upload the file; verifies against GitHub's main branch (exits 5 guia_no_subida / guia_distinta if it doesn't match)", "--repo owner/repo: the repo, if it isn't this folder's «origin» (the guide is read from this clone only if it is that repo: its origin, or a `supcoflow` remote at https://github.com/owner/repo.git; otherwise it exits 3 falta_guia saying what this clone is and the exact `git remote add supcoflow …`, without asking the engine)", "--dry-run: says what it would send (or the fingerprint with --from-github), without requesting anything", "--json"],
196
+ ejemplos: ["supcoflow guide publish --json"],
197
197
  codigos: [0, 1, 2, 3, 4, 5],
198
198
  },
199
199
  {
200
- nombre: "guia ver",
201
- resumen: "Muestra la guía activa del proyecto, de dónde viene y si la rama principal sigue teniendo esa versión (`al_dia` en el JSON).",
202
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--json"],
203
- ejemplos: ["supcoflow guia ver --json"],
200
+ nombre: "guide show",
201
+ resumen: "Shows the project's active guide, where it comes from, which file it was read from (and whether that name is declared) and whether the main branch still has that version (`al_dia` in the JSON).",
202
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--json"],
203
+ ejemplos: ["supcoflow guide show --json"],
204
+ codigos: [0, 1, 2, 3, 4],
205
+ },
206
+ {
207
+ nombre: "guide use",
208
+ resumen: "Chooses which guide is active when there are two: the repo's or our agent's.",
209
+ flags: ["--source repo|agent: which one becomes active (required)", "--repo owner/repo: the repo, if it isn't this folder's «origin»", "--dry-run: says what it would do without doing it", "--json"],
210
+ ejemplos: ["supcoflow guide use --source repo --json"],
204
211
  codigos: [0, 1, 2, 3, 4],
205
212
  },
206
213
  {
207
- nombre: "guia usar",
208
- resumen: "Elige cuál guía queda activa cuando hay dos: la del repo o la de nuestro agente.",
209
- flags: ["--origen repo|agente: cuál queda activa (obligatorio)", "--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--dry-run: dice qué haría sin hacerlo", "--json"],
210
- ejemplos: ["supcoflow guia usar --origen repo --json"],
214
+ nombre: "guide versions",
215
+ resumen: "Lists the guide that governs now (the one the chat reads: its origin and version) and the repo's publications, newest first, with where each one comes from (declared by the terminal or verified in GitHub), commit, file and who published it. At most one says «live»: the one that is the active guide. Read-only.",
216
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--json: { vigente, publicaciones }"],
217
+ ejemplos: ["supcoflow guide versions --json"],
211
218
  codigos: [0, 1, 2, 3, 4],
212
219
  },
213
220
  {
214
221
  nombre: "widget",
215
- resumen: "Muestra lo que hay que pegar en la app para tener el chat, armado por el motor con los ids del proyecto: el paquete y su versión exacta, el archivo envoltorio de Next.js (`nextjs.contenido`, tal cual, sin reescribir los ids), cómo usarlo, la línea de CSP y la de <script> (no para Next.js). No escribe archivos. Sale 4 sin_proyecto si el repo no tiene proyecto; 1 respuesta_inesperada si el motor manda algo a medias.",
216
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--json: el objeto del motor tal cual"],
222
+ resumen: "Shows what to paste into the app to get the chat, built by the engine with the project's ids: the package and its exact version, the Next.js wrapper file (`nextjs.contenido`, as is, without rewriting the ids), the file name to use (`nextjs.archivo_sugerido`) and the earlier names the chat may already be installed under (`nextjs.archivos_anteriores`), how to use it, the CSP line and the <script> one (not for Next.js). It writes no files. Exits 4 sin_proyecto if the repo has no project; 1 respuesta_inesperada if the engine sends something halfway.",
223
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--json: the engine's object as is"],
217
224
  ejemplos: ["supcoflow widget --json"],
218
225
  codigos: [0, 1, 2, 3, 4],
219
226
  },
220
227
  {
221
- nombre: "instalacion anotar",
222
- resumen: "Anota en .supcoflow/instalacion.json (la raíz de este clon) con qué versiones se instaló el chat: la skill, esta terminal, el paquete del chat (declarado en el package.json de la app e instalado en node_modules) y la configuración del proyecto; nunca un secreto ni una fecha. Repetir sin cambios no lo toca (sin_cambios: true). Lo reescribe sólo si git ya guarda el anterior: si tiene cambios sin commit (o está borrado sin commit) sale 4 cambios_sin_commit; si existe sin estar versionado (o ignorado), 4 archivo_no_versionado. Otros: 3 falta_skill / skill_invalida / app_fuera_del_repo / app_inexistente / sin_clon; 4 sin_proyecto / acuerdo_ilegible; 1 paquete_ilegible / configuracion_inesperada / archivo_no_escrito.",
228
+ nombre: "install record",
229
+ resumen: "Records in .supcoflow/instalacion.json (this clone's root, version 2) which versions the chat was installed with: the skill, this terminal, the chat package (declared in the app's package.json and installed in node_modules), the project configuration and, with --file, the file the chat lives in; never a secret or a date. Repeating without changes doesn't touch it (sin_cambios: true), and running again without --file keeps the file already recorded. It only rewrites it if git already keeps the previous one: with uncommitted changes (or deleted without a commit) it exits 4 cambios_sin_commit; if it exists without being tracked (or ignored), 4 archivo_no_versionado. Others: 3 falta_skill / skill_invalida / archivo_invalido / app_fuera_del_repo / app_inexistente / sin_clon; 4 sin_proyecto / acuerdo_ilegible; 1 paquete_ilegible / configuracion_inesperada / archivo_no_escrito.",
223
230
  flags: [
224
- "--skill versión: la metadata.version de la skill que instala (semver, obligatorio; sin él sale 3 falta_skill sin pedir nada)",
225
- "--app carpeta: la carpeta de la app, relativa a la raíz del repo (por defecto la raíz; fuera del repo sale 3 app_fuera_del_repo)",
226
- "--repo owner/repo: el repo, si no es el «origin» de esta carpeta (sin clon local sale 3 sin_clon: el archivo va en el clon)",
227
- "--dry-run: muestra el archivo y la diferencia sin escribir nada",
231
+ "--skill version: the metadata.version of the skill that installs it (semver, required; without it exits 3 falta_skill without requesting anything)",
232
+ "--file path: the chat file, relative to the repo root (no `..`, not absolute, not a symlink or through one; otherwise exits 3 archivo_invalido and writes nothing)",
233
+ "--app folder: the app's folder, relative to the repo root (the root by default; outside the repo it exits 3 app_fuera_del_repo)",
234
+ "--repo owner/repo: the repo, if it isn't this folder's «origin» (the file goes in this clone only if it is that repo: its origin, or a `supcoflow` remote at https://github.com/owner/repo.git; otherwise it exits 3 sin_clon saying what this clone is and the exact `git remote add supcoflow …`, without asking the engine)",
235
+ "--dry-run: shows the file and the difference without writing anything",
228
236
  "--json",
229
237
  ],
230
- ejemplos: ["supcoflow instalacion anotar --skill 0.1.0 --app web --json"],
238
+ ejemplos: ["supcoflow install record --skill 0.3.1 --app web --file web/app/_supcoflow/support-chat.tsx --json"],
231
239
  codigos: [0, 1, 2, 3, 4],
232
240
  },
233
241
  {
234
- nombre: "diagnosticar",
235
- resumen: "Dice, gratis y sin escribir nada, si una prueba del proyecto entraría y hasta dónde llegaría: instalación de GitHub, sitios, chat, guía, política, saldo del mes contra el techo de la prueba, pruebas abiertas y lo que el motor sume. Sale 0 si está todo listo y 4 si algo hay que arreglar (no_listo), con cada punto.",
236
- flags: ["--repo owner/repo: el repo, si no es el «origin» de esta carpeta", "--json"],
237
- ejemplos: ["supcoflow diagnosticar --json"],
242
+ nombre: "diagnose",
243
+ resumen: "Says, free of charge and writing nothing, how far the installation is (sign-in, repo, GitHub App, allowed sites, chat and guide: N of 6) and, apart, whether a test of the project would go in and how far it would get: policy, monthly balance against the test's ceiling, open tests, whether THIS machine can save the test request (the local point `maquina`, checked without writing anything) and whatever else the engine adds. Exits 0 if everything is ready and 4 if something needs fixing (no_listo), with each point; if `maquina` isn't ok, `listo` and `prueba.listo` are false and the N of 6 doesn't change.",
244
+ flags: ["--repo owner/repo: the repo, if it isn't this folder's «origin»", "--json: { instalacion: { ok, total: 6, puntos }, prueba: { listo, puntos }, maquina: { ok, impedimentos: [{ codigo, detalle }] }, intento_pendiente: { techo_usd, politica } | null, … }"],
245
+ ejemplos: ["supcoflow diagnose --json"],
238
246
  codigos: [0, 1, 2, 3, 4],
239
247
  },
240
248
  {
241
- nombre: "probar",
242
- resumen: "Prueba la instalación de punta a punta: un problema entra por la misma puerta que el chat y termina en un issue. Gasta un relevamiento (hasta el techo que dice el motor; con la política guardar llega hasta el caso guardado y no gasta). Sin --autorizo-gasto no manda nada: sale 4 falta_autorizacion con techo_usd, saldo_usd, tope_usd y comprometido_usd. Con --autorizo-gasto pide la prueba y sale 5 con prueba_id; después --wait la sigue. Otros: 4 prueba_en_curso (con su id), techo_distinto, chat_deshabilitado, requiere_api_key, intento_pendiente; 6 tope_mensual; 1 con intento_pendiente: true si la respuesta no llegó (repetir retoma la misma prueba).",
249
+ nombre: "test",
250
+ resumen: "Tests the installation end to end: a problem comes in through the same door as the chat and ends up as an issue. It spends one investigation (up to the ceiling you authorize; with the save policy it goes as far as the saved case and doesn't spend). Without --authorize-spend it sends nothing: it exits 4 falta_autorizacion with techo_usd, saldo_usd, tope_usd and comprometido_usd, and, checked before you say yes and without writing anything, `maquina` { ok, impedimentos: [{ codigo, detalle }] } (whether this machine can save the test request: if it isn't ok the message says why first) and `intento_pendiente` { techo_usd, politica } | null (a request waiting for confirmation: only its ceiling and policy, never its message or key). With --authorize-spend, --ceiling and --expect-policy it requests the test with exactly those values (it doesn't re-read anything to choose them) and exits 5 with prueba_id; then --wait follows it. If the ceiling or the policy changed in the meantime it exits 4 techo_distinto / politica_distinta with the new values and doesn't retry: ask again. Others: 4 prueba_en_curso (with its id), chat_deshabilitado, requiere_api_key, intento_pendiente; 6 tope_mensual; 1 with intento_pendiente: true if the answer didn't arrive (repeating resumes the same test).",
243
251
  flags: [
244
- "--autorizo-gasto: autoriza el gasto de UNA prueba, hasta el techo que mostró el motor; sin él no se manda nada que escriba",
245
- "--mensaje \"…\": el texto del problema de la prueba (por defecto, uno fijo del motor); con un pedido sin confirmar, otro --mensaje sale 4 intento_pendiente",
246
- "--wait: sigue la última prueba hasta 90 s; sale 5 mientras corre, 0 con el issue (o guardado), 4 si hace falta mirarla (con el enlace a la bandeja); el cobro sale como esté (pendiente nunca es 0)",
247
- "--prueba prb_…: con --wait, sigue esa prueba en vez de la última guardada",
248
- "--repo owner/repo: el repo, si no es el «origin» de esta carpeta",
249
- "--dry-run: dice qué haría (proyecto, techo, saldo, política) sin pedir nada que escriba",
252
+ "--authorize-spend: authorizes the spend of ONE test; without it nothing that writes is sent",
253
+ "--ceiling usd: the ceiling you authorize, the number you were shown (required with --authorize-spend)",
254
+ "--expect-policy investigate|save: the policy you were offered (required with --authorize-spend); if the project's is another one, nothing starts",
255
+ "--message \"…\": the problem text of the test (by default, a fixed one from the engine); with a request that was never confirmed, another --message exits 4 intento_pendiente",
256
+ "--wait: follows the last test up to 90 s; exits 5 while it runs, 0 with the issue (or saved), 4 if it needs a look (with the link to the inbox); the charge comes out as it is (pending is never 0)",
257
+ "--test-id prb_…: with --wait, follows that test instead of the last saved one",
258
+ "--repo owner/repo: the repo, if it isn't this folder's «origin»",
259
+ "--dry-run: says what it would do (project, ceiling, balance, policy) without requesting anything that writes",
250
260
  "--json",
251
261
  ],
252
- ejemplos: ["supcoflow probar --json", "supcoflow probar --autorizo-gasto --json", "supcoflow probar --wait --json", "supcoflow probar --dry-run --autorizo-gasto --json"],
262
+ ejemplos: ["supcoflow test --json", "supcoflow test --authorize-spend --ceiling 2 --expect-policy investigate --json", "supcoflow test --wait --json", "supcoflow test --dry-run --authorize-spend --ceiling 2 --expect-policy investigate --json"],
253
263
  codigos: [0, 1, 2, 3, 4, 5, 6],
254
264
  },
255
265
  ],
256
- flags_globales: ["--json: el resultado en una línea de JSON por stdout; los avisos van por stderr", "--help, -h: la ayuda con ejemplos"],
266
+ flags_globales: ["--json: the result as a line of JSON on stdout; warnings go to stderr", "--help, -h: the help with examples"],
257
267
  facultades: [
258
268
  {
259
- nombre: "consultar",
260
- incluye: "Identidad y equipo, proyectos, configuración, casos, issues, runs, costos, estado de la instalación, leer y revisar la guía (guia revisar, guia ver)",
269
+ nombre: "read",
270
+ incluye: "Identity and team, projects, configuration, cases, issues, runs, costs, installation state, reading and checking the guide (guide check, guide show, guide versions)",
261
271
  con_api_key: true,
262
272
  },
263
273
  {
264
- nombre: "configurar",
265
- incluye: "Crear/reusar proyecto, conectar o desconectar el repo, configurar y prender el chat, sitios permitidos, acuerdo de datos, política de problemas, publicar la guía, elegir la guía activa (guia usar), crear y revocar claves de consulta, perfiles de los agentes",
274
+ nombre: "configure",
275
+ incluye: "Create/reuse a project, connect or disconnect the repo, configure and turn on the chat, allowed sites, data agreement, problem policy, publish the guide, choose the active guide (guide use), create and revoke read-only keys, agent profiles",
266
276
  con_api_key: true,
267
277
  },
268
- { nombre: "probar", incluye: "La prueba hasta el issue (gasta, dentro de los topes)", con_api_key: true },
278
+ { nombre: "test", incluye: "The test up to the issue (spends, within the limits)", con_api_key: true },
269
279
  {
270
- nombre: "solo_consola",
271
- incluye: "Subir el tope de gasto, borrar el proyecto, encender la fábrica, dar o sacar acceso a personas: sólo con sesión en la consola",
280
+ nombre: "console_only",
281
+ incluye: "Raise the spend cap, delete the project, turn on the factory, give or remove people's access: only with a console session",
272
282
  con_api_key: false,
273
283
  },
274
284
  {
275
- nombre: "operador",
276
- incluye: "Solicitudes, /maquinaria, cerrar runs, la fábrica de operador: nunca por clave, aunque la persona sea operadora",
285
+ nombre: "operator",
286
+ incluye: "Requests, /maquinaria, closing runs, the operator factory: never by key, even if the person is an operator",
277
287
  con_api_key: false,
278
288
  },
279
289
  ],
280
290
  codigos: {
281
291
  [SALIDA.ok]: "ok",
282
- [SALIDA.inesperado]: "inesperado",
283
- [SALIDA.faltaLogin]: "falta login",
284
- [SALIDA.entradaInvalida]: "entrada inválida",
285
- [SALIDA.haceFaltaUnaPersona]: "hace falta una persona",
286
- [SALIDA.esperandoAUnaPersona]: "esperando a una persona (volvé a llamar)",
287
- [SALIDA.topeAlcanzado]: "tope alcanzado",
292
+ [SALIDA.inesperado]: "unexpected",
293
+ [SALIDA.faltaLogin]: "login needed",
294
+ [SALIDA.entradaInvalida]: "invalid input",
295
+ [SALIDA.haceFaltaUnaPersona]: "a person is needed",
296
+ [SALIDA.esperandoAUnaPersona]: "waiting for a person (call again)",
297
+ [SALIDA.topeAlcanzado]: "limit reached",
288
298
  },
289
299
  };
290
300
  export function comandoDescribir() {
@@ -298,21 +308,21 @@ function bloque(c) {
298
308
  }
299
309
  export function ayuda(comando) {
300
310
  const elegidos = comando === null ? DESCRIPCION.comandos : DESCRIPCION.comandos.filter((c) => c.nombre === comando);
301
- const uso = comando === null ? "supcoflow <comando> [flags]" : `supcoflow ${comando} [flags]`;
311
+ const uso = comando === null ? "supcoflow <command> [flags]" : `supcoflow ${comando} [flags]`;
302
312
  const codigos = Object.entries(DESCRIPCION.codigos).map(([n, t]) => ` ${n} ${t}`);
303
313
  return [
304
- `Uso: ${uso}`,
314
+ `Usage: ${uso}`,
305
315
  "",
306
- comando === null ? "Comandos:" : "Comando:",
316
+ comando === null ? "Commands:" : "Command:",
307
317
  ...elegidos.map(bloque),
308
318
  "",
309
- "Flags de todos los comandos:",
319
+ "Flags for every command:",
310
320
  ...DESCRIPCION.flags_globales.map((f) => ` ${f}`),
311
321
  "",
312
- "Ejemplos:",
322
+ "Examples:",
313
323
  ...elegidos.flatMap((c) => c.ejemplos.map((e) => ` ${e}`)),
314
324
  "",
315
- "Códigos de salida:",
325
+ "Exit codes:",
316
326
  ...codigos,
317
327
  ].join("\n");
318
328
  }