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.
- package/README.md +253 -176
- package/dist/alias.js +60 -0
- package/dist/api.js +41 -19
- package/dist/argumentos.js +92 -85
- package/dist/cli.js +40 -35
- package/dist/comandos/clave-vigente.js +2 -2
- package/dist/comandos/claves.js +25 -25
- package/dist/comandos/configurar.js +40 -40
- package/dist/comandos/contexto.js +102 -0
- package/dist/comandos/datos-y-politica.js +35 -23
- package/dist/comandos/describir.js +162 -152
- package/dist/comandos/guia.js +150 -62
- package/dist/comandos/instalacion.js +73 -41
- package/dist/comandos/login.js +25 -24
- package/dist/comandos/logout.js +17 -16
- package/dist/comandos/probar.js +177 -64
- package/dist/comandos/proyecto-del-repo.js +12 -2
- package/dist/comandos/proyecto.js +48 -34
- package/dist/comandos/quien-soy.js +8 -7
- package/dist/comandos/repo-conectar.js +9 -9
- package/dist/comandos/widget.js +9 -5
- package/dist/diagnostico.js +51 -0
- package/dist/entorno.js +57 -26
- package/dist/flags-por-comando.js +25 -21
- package/dist/guardado/archivo.js +2 -2
- package/dist/guardado/index.js +12 -8
- package/dist/guardado/llavero.js +5 -5
- package/dist/guardado/lugar.js +63 -0
- package/dist/guardado/protegido.js +38 -0
- package/dist/guardado/repo.js +98 -0
- package/dist/guia.js +3 -1
- package/dist/idempotencia.js +16 -28
- package/dist/instalacion.js +50 -11
- package/dist/lectura.js +10 -0
- package/dist/pruebas-guardadas.js +40 -22
- package/dist/repo-local.js +95 -13
- package/dist/secreto-a-archivo.js +6 -6
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
// `supcoflow
|
|
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.
|
|
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: "
|
|
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:
|
|
15
|
-
"--wait:
|
|
16
|
-
"--dry-run:
|
|
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: "
|
|
25
|
-
flags: ["--dry-run:
|
|
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: "
|
|
31
|
-
resumen: "
|
|
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
|
|
33
|
+
ejemplos: ["supcoflow whoami", "supcoflow whoami --json"],
|
|
34
34
|
codigos: [0, 1, 2, 3],
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
nombre: "
|
|
38
|
-
resumen: "
|
|
37
|
+
nombre: "describe",
|
|
38
|
+
resumen: "Describes commands, flags, capabilities and exit codes, for an assistant.",
|
|
39
39
|
flags: ["--json"],
|
|
40
|
-
ejemplos: ["supcoflow
|
|
40
|
+
ejemplos: ["supcoflow describe --json"],
|
|
41
41
|
codigos: [0],
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
-
nombre: "repo
|
|
45
|
-
resumen: "
|
|
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:
|
|
48
|
-
"--wait:
|
|
49
|
-
"--repo owner/repo:
|
|
50
|
-
"--dry-run:
|
|
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
|
|
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: "
|
|
58
|
-
resumen: "
|
|
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 \"…\":
|
|
61
|
-
"--test \"…\":
|
|
62
|
-
"--repo owner/repo:
|
|
63
|
-
"--dry-run:
|
|
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
|
|
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: "
|
|
71
|
-
resumen: "
|
|
72
|
-
flags: ["--repo owner/repo:
|
|
73
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
78
|
-
resumen: "
|
|
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
|
|
80
|
+
ejemplos: ["supcoflow catalog --json"],
|
|
81
81
|
codigos: [0, 1, 2, 3],
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
|
-
nombre: "
|
|
85
|
-
resumen: "
|
|
86
|
-
flags: ["--repo owner/repo:
|
|
87
|
-
ejemplos: ["supcoflow
|
|
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
|
|
92
|
-
resumen: "
|
|
93
|
-
flags: ["--repo owner/repo:
|
|
94
|
-
ejemplos: ["supcoflow chat
|
|
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
|
|
99
|
-
resumen: "
|
|
100
|
-
flags: ["--repo owner/repo:
|
|
101
|
-
ejemplos: ["supcoflow chat
|
|
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
|
|
106
|
-
resumen: "
|
|
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
|
-
"--
|
|
109
|
-
"--
|
|
110
|
-
"--
|
|
111
|
-
"--repo owner/repo:
|
|
112
|
-
"--dry-run:
|
|
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
|
|
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: "
|
|
121
|
-
flags: ["--
|
|
122
|
-
ejemplos: ["supcoflow chat logo --
|
|
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: "
|
|
127
|
-
resumen: "
|
|
128
|
-
flags: ["--
|
|
129
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
134
|
-
resumen: "
|
|
135
|
-
flags: ["--
|
|
136
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
141
|
-
resumen: "
|
|
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
|
-
"--
|
|
144
|
-
"--repo owner/repo:
|
|
145
|
-
"--dry-run:
|
|
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
|
|
148
|
+
ejemplos: ["supcoflow data set --allow user_id,attribute:plan"],
|
|
149
149
|
codigos: [0, 1, 2, 3, 4],
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
|
-
nombre: "
|
|
153
|
-
resumen: "
|
|
154
|
-
flags: ["--
|
|
155
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
160
|
-
resumen: "
|
|
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
|
-
"--
|
|
163
|
-
"--
|
|
164
|
-
"--repo owner/repo:
|
|
165
|
-
"--dry-run:
|
|
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
|
|
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: "
|
|
173
|
-
resumen: "
|
|
174
|
-
flags: ["--repo owner/repo:
|
|
175
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
180
|
-
resumen: "
|
|
181
|
-
flags: ["--id cla_…:
|
|
182
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
187
|
-
resumen: "
|
|
188
|
-
flags: ["--repo owner/repo:
|
|
189
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
194
|
-
resumen: "
|
|
195
|
-
flags: ["--
|
|
196
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
201
|
-
resumen: "
|
|
202
|
-
flags: ["--repo owner/repo:
|
|
203
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
208
|
-
resumen: "
|
|
209
|
-
flags: ["--
|
|
210
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
216
|
-
flags: ["--repo owner/repo:
|
|
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: "
|
|
222
|
-
resumen: "
|
|
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
|
|
225
|
-
"--
|
|
226
|
-
"--
|
|
227
|
-
"--
|
|
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
|
|
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: "
|
|
235
|
-
resumen: "
|
|
236
|
-
flags: ["--repo owner/repo:
|
|
237
|
-
ejemplos: ["supcoflow
|
|
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: "
|
|
242
|
-
resumen: "
|
|
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
|
-
"--
|
|
245
|
-
"--
|
|
246
|
-
"--
|
|
247
|
-
"--
|
|
248
|
-
"--
|
|
249
|
-
"--
|
|
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
|
|
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:
|
|
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: "
|
|
260
|
-
incluye: "
|
|
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: "
|
|
265
|
-
incluye: "
|
|
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: "
|
|
278
|
+
{ nombre: "test", incluye: "The test up to the issue (spends, within the limits)", con_api_key: true },
|
|
269
279
|
{
|
|
270
|
-
nombre: "
|
|
271
|
-
incluye: "
|
|
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: "
|
|
276
|
-
incluye: "
|
|
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]: "
|
|
283
|
-
[SALIDA.faltaLogin]: "
|
|
284
|
-
[SALIDA.entradaInvalida]: "
|
|
285
|
-
[SALIDA.haceFaltaUnaPersona]: "
|
|
286
|
-
[SALIDA.esperandoAUnaPersona]: "
|
|
287
|
-
[SALIDA.topeAlcanzado]: "
|
|
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 <
|
|
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
|
-
`
|
|
314
|
+
`Usage: ${uso}`,
|
|
305
315
|
"",
|
|
306
|
-
comando === null ? "
|
|
316
|
+
comando === null ? "Commands:" : "Command:",
|
|
307
317
|
...elegidos.map(bloque),
|
|
308
318
|
"",
|
|
309
|
-
"Flags
|
|
319
|
+
"Flags for every command:",
|
|
310
320
|
...DESCRIPCION.flags_globales.map((f) => ` ${f}`),
|
|
311
321
|
"",
|
|
312
|
-
"
|
|
322
|
+
"Examples:",
|
|
313
323
|
...elegidos.flatMap((c) => c.ejemplos.map((e) => ` ${e}`)),
|
|
314
324
|
"",
|
|
315
|
-
"
|
|
325
|
+
"Exit codes:",
|
|
316
326
|
...codigos,
|
|
317
327
|
].join("\n");
|
|
318
328
|
}
|