supcoflow 0.6.0 → 0.8.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/README.md +210 -162
- package/dist/alias.js +60 -0
- package/dist/api.js +121 -16
- package/dist/argumentos.js +92 -78
- package/dist/cli.js +42 -31
- 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/datos-y-politica.js +35 -23
- package/dist/comandos/describir.js +170 -138
- package/dist/comandos/guia.js +148 -61
- package/dist/comandos/instalacion.js +71 -40
- package/dist/comandos/login.js +25 -24
- package/dist/comandos/logout.js +17 -16
- package/dist/comandos/probar.js +359 -0
- package/dist/comandos/proyecto-del-repo.js +1 -1
- package/dist/comandos/proyecto.js +16 -16
- 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 +48 -0
- package/dist/entorno.js +32 -18
- package/dist/flags-por-comando.js +25 -19
- package/dist/guardado/archivo.js +2 -2
- package/dist/guardado/index.js +12 -8
- package/dist/guardado/llavero.js +5 -5
- package/dist/guia.js +3 -1
- package/dist/idempotencia.js +6 -6
- package/dist/instalacion.js +50 -11
- package/dist/lectura.js +10 -0
- package/dist/pruebas-guardadas.js +101 -0
- package/dist/repo-local.js +6 -6
- package/dist/secreto-a-archivo.js +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,200 +1,248 @@
|
|
|
1
1
|
# supcoflow
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
The [Supcoflow](https://app.supcoflow.dev) terminal: sign in and manage the support chat from the console,
|
|
4
|
+
or from a code assistant that runs the commands for you.
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
It signs you in and out, shows which account you are using, connects the repo with the GitHub App, creates
|
|
7
|
+
its project, configures the chat, puts it in the app, and checks that a problem reaches an issue.
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Install
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Node 24 or newer is required.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
14
|
npx supcoflow login
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## The commands
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
The command names are in English. The Spanish names of 0.7.0 (`quien-soy`, `guia publicar`,
|
|
20
|
+
`--autorizo-gasto`, `--modo relevar|guardar`…) still work as hidden aliases; `describe` and `--help` only show
|
|
21
|
+
the English ones.
|
|
22
|
+
|
|
23
|
+
| Command | What it does |
|
|
20
24
|
|---|---|
|
|
21
|
-
| `supcoflow login` |
|
|
22
|
-
| `supcoflow login --start` |
|
|
23
|
-
| `supcoflow login --wait` |
|
|
24
|
-
| `supcoflow logout` |
|
|
25
|
-
| `supcoflow
|
|
26
|
-
| `supcoflow repo
|
|
27
|
-
| `supcoflow
|
|
28
|
-
| `supcoflow
|
|
29
|
-
| `supcoflow
|
|
30
|
-
| `supcoflow
|
|
31
|
-
| `supcoflow
|
|
32
|
-
| `supcoflow
|
|
33
|
-
| `supcoflow
|
|
34
|
-
| `supcoflow
|
|
35
|
-
| `supcoflow
|
|
36
|
-
|
|
37
|
-
`supcoflow
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
25
|
+
| `supcoflow login` | Shows a link and a code; you approve it in the console and the terminal keeps its key. |
|
|
26
|
+
| `supcoflow login --start` | The first step alone: asks for the code and exits 5 with the link to approve it. |
|
|
27
|
+
| `supcoflow login --wait` | The second step: waits for the approval up to 90 s. If it hasn't arrived, exits 5: run it again. |
|
|
28
|
+
| `supcoflow logout` | Revokes the key in use and deletes it from this machine. |
|
|
29
|
+
| `supcoflow whoami` | Which key the terminal runs with, on whose behalf and in which team. |
|
|
30
|
+
| `supcoflow repo connect` | Connects this folder's repo with the GitHub App: it gives you a link and you confirm it in the console. Without a terminal, `--start` and then `--wait`, like `login`. |
|
|
31
|
+
| `supcoflow project create` | Creates (or reuses) the project of the connected repo and records it in `.supcoflow/proyecto.json`. If the engine can't work out the commands, `--install "…" --test "…"`. |
|
|
32
|
+
| `supcoflow project show` | The repo's project: branch, commands and the state of the GitHub App. |
|
|
33
|
+
| `supcoflow guide check` | Checks `.supcoflow/guide.md` against the engine without publishing anything. |
|
|
34
|
+
| `supcoflow guide publish` | Uploads `.supcoflow/guide.md` directly (with the commit and branch your clone declares, not verified in GitHub). `--from-github` verifies against the main branch instead of uploading the file. |
|
|
35
|
+
| `supcoflow guide show` | Shows the active guide, where it comes from, which file it was read from and whether the branch is still up to date. |
|
|
36
|
+
| `supcoflow guide use --source repo\|agent` | Chooses which guide is active. |
|
|
37
|
+
| `supcoflow guide versions` | The guide that governs now and the repo's publications, newest first; at most one says «live». |
|
|
38
|
+
| `supcoflow widget` | What to paste into the app to get the chat (see «Put the chat in the app»). |
|
|
39
|
+
| `supcoflow install record --skill 0.3.0 --file app/_supcoflow/support-chat.tsx` | Records in `.supcoflow/instalacion.json` which versions the chat was installed with and which file it lives in. |
|
|
40
|
+
| `supcoflow diagnose` | Free: how far the installation is (N of 6) and whether a test would go in. |
|
|
41
|
+
| `supcoflow test` | The end-to-end test (see «Test the installation»). |
|
|
42
|
+
| `supcoflow describe --json` | The whole contract (commands, flags, key capabilities, codes) in one line of JSON. |
|
|
43
|
+
|
|
44
|
+
`supcoflow --help` (or `supcoflow <command> --help`) shows the help with examples. The repo and project commands
|
|
45
|
+
take the repo from the folder's `origin`; `--repo owner/repo` picks it by hand.
|
|
46
|
+
|
|
47
|
+
### From zero to a project
|
|
48
|
+
|
|
49
|
+
1. `supcoflow login`: you approve the code in the console.
|
|
50
|
+
2. `supcoflow repo connect`: you install the App on GitHub if needed and tap Confirm.
|
|
51
|
+
3. `supcoflow project create`: the project is created and `.supcoflow/proyecto.json` is left to commit.
|
|
52
|
+
4. `supcoflow project show`: to check how it ended up.
|
|
53
|
+
|
|
54
|
+
### Examples
|
|
48
55
|
|
|
49
56
|
```bash
|
|
50
|
-
#
|
|
57
|
+
# A person at the terminal
|
|
51
58
|
supcoflow login
|
|
52
59
|
|
|
53
|
-
#
|
|
54
|
-
supcoflow login --start --json #
|
|
55
|
-
supcoflow login --wait --json #
|
|
60
|
+
# An assistant, without an interactive terminal: two steps
|
|
61
|
+
supcoflow login --start --json # exits 5 with verification_uri_complete and user_code
|
|
62
|
+
supcoflow login --wait --json # exits 5 until the person approves; 0 when they do
|
|
56
63
|
|
|
57
|
-
supcoflow repo
|
|
58
|
-
supcoflow repo
|
|
59
|
-
supcoflow
|
|
60
|
-
supcoflow
|
|
61
|
-
supcoflow
|
|
64
|
+
supcoflow repo connect --start --json # exits 5 with the URL to confirm
|
|
65
|
+
supcoflow repo connect --wait --json # exits 5 until someone confirms; 0 connected
|
|
66
|
+
supcoflow project create --json # 4 if there is a different .supcoflow/proyecto.json (it doesn't overwrite)
|
|
67
|
+
supcoflow project create --install "pnpm i" --test "pnpm test"
|
|
68
|
+
supcoflow project show --json
|
|
62
69
|
|
|
63
|
-
supcoflow
|
|
64
|
-
supcoflow logout --dry-run #
|
|
70
|
+
supcoflow whoami --json
|
|
71
|
+
supcoflow logout --dry-run # what it would revoke, without revoking anything
|
|
65
72
|
```
|
|
66
73
|
|
|
67
|
-
##
|
|
74
|
+
## Configure
|
|
68
75
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
76
|
+
With the repo connected and its project created, the chat is configured without entering the console (the key
|
|
77
|
+
has to be a session key, not a read-only one). All of them take the repo from the `origin`, or `--repo
|
|
78
|
+
owner/repo`, and the ones that write accept `--dry-run`.
|
|
72
79
|
|
|
73
|
-
|
|
|
80
|
+
| Command | What it does |
|
|
74
81
|
|---|---|
|
|
75
|
-
| `supcoflow
|
|
76
|
-
| `supcoflow
|
|
77
|
-
| `supcoflow chat
|
|
78
|
-
| `supcoflow chat
|
|
79
|
-
| `supcoflow chat logo --
|
|
80
|
-
| `supcoflow
|
|
81
|
-
| `supcoflow
|
|
82
|
-
| `supcoflow
|
|
83
|
-
| `supcoflow
|
|
84
|
-
| `supcoflow
|
|
85
|
-
|
|
86
|
-
##
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
`.supcoflow/
|
|
90
|
-
|
|
91
|
-
1. `supcoflow
|
|
92
|
-
2. `supcoflow
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
82
|
+
| `supcoflow catalog` | What can be configured and with which values. |
|
|
83
|
+
| `supcoflow config` | The project's chat, sites, brand and data agreement. |
|
|
84
|
+
| `supcoflow chat on` / `chat off` | Turns the chat on or off (a guide is needed: publish the repo's with `supcoflow guide publish`, or generate and approve our agent's in Brain). |
|
|
85
|
+
| `supcoflow chat brand --title "Help" --theme acento=#0a7` | Title, greeting and colors; whatever isn't named stays as it was. The `--theme` keys are the API's: `acento`, `fondo`, `texto`, `textoSuave`, `radio`, `fuente`. |
|
|
86
|
+
| `supcoflow chat logo --file logo.png` | Uploads the logo (.png, .jpg or .webp, up to 200 KB). |
|
|
87
|
+
| `supcoflow sites add\|remove --site https://app.example.com` | Sites the chat loads from. |
|
|
88
|
+
| `supcoflow data set --allow user_id,attribute:plan` | Data agreement: it limits what is saved and what the AI that investigates reads; it doesn't cover what the chat's AI sees while it talks. The values are `user_id`, `user_role`, `page_and_browser`, `screenshots`, `elements`, `email`, `attribute:<name>` or `nothing`. |
|
|
89
|
+
| `supcoflow policy set --mode save` | What the engine does with a problem that comes in through the chat: `investigate` (spends) or `save`. Saving only stops what the chat does automatically; a person can still ask for the investigation from the console, and it costs. |
|
|
90
|
+
| `supcoflow keys create --name ci --save-to ~/ci.key` | Read-only key for CI: the secret stays only in that file (0600, outside a repo), never in the output. |
|
|
91
|
+
| `supcoflow keys list` / `keys revoke --id cla_…` | List and revoke read-only keys. |
|
|
92
|
+
|
|
93
|
+
## The guide
|
|
94
|
+
|
|
95
|
+
The guide tells the chat what each screen of your product does. It lives in the repo, in
|
|
96
|
+
`.supcoflow/guide.md` (at the root). The flow, in this order:
|
|
97
|
+
|
|
98
|
+
1. `supcoflow guide check`: checks it against the engine without publishing anything (if it is badly formed it exits 3 with the line of each error).
|
|
99
|
+
2. `supcoflow guide publish`: uploads the file directly and it becomes the active guide. It also sends your clone's
|
|
100
|
+
commit and branch (`git rev-parse HEAD`, if there is git and commits; otherwise it goes without a commit): they are
|
|
101
|
+
declared by the terminal, not verified in GitHub, and are shown that way. It also sends the file it actually read.
|
|
102
|
+
Repeating with the same file doesn't duplicate it.
|
|
103
|
+
3. Optional, `supcoflow guide publish --from-github`: it doesn't upload the file; it sends its fingerprint and the
|
|
104
|
+
engine compares it with the main branch's on GitHub (verified commit). If it isn't pushed yet (or the branch has
|
|
105
|
+
another one), it exits 5: push the guide to the main branch and run again.
|
|
106
|
+
|
|
107
|
+
**The old file name.** Until 0.7.0 the file was `.supcoflow/guia.md`. If `guide.md` doesn't exist and `guia.md` does,
|
|
108
|
+
the terminal reads `guia.md` and says so («rename it to `guide.md`»); it never renames or deletes your files. If both
|
|
109
|
+
exist, `guide.md` wins and the terminal says `guia.md` is ignored. If `guide.md` exists but can't be read, or is
|
|
110
|
+
badly formed, that is an error: it never falls back to the old one.
|
|
111
|
+
|
|
112
|
+
`supcoflow guide show` shows the active guide, the file it was read from and whether the branch is still up to date
|
|
113
|
+
(`al_dia` in the JSON); `supcoflow guide versions` lists the guide that governs now and the repo's publications;
|
|
114
|
+
`supcoflow guide use --source repo|agent` chooses which one is active when there is one from the repo and one from
|
|
115
|
+
our agent. All of them take the repo from the `origin`, or `--repo owner/repo` (with `check` and `publish`, without a
|
|
116
|
+
local clone of that repo it exits 3 `falta_guia`: the guide is read from the file); `check`, `publish` and `use`
|
|
117
|
+
accept `--dry-run`; `--from-github` is only for `publish`.
|
|
118
|
+
|
|
119
|
+
The format of `.supcoflow/guide.md`:
|
|
104
120
|
|
|
105
121
|
```markdown
|
|
106
|
-
#
|
|
107
|
-
|
|
108
|
-
##
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
-
|
|
114
|
-
-
|
|
122
|
+
# My App guide ← optional; ignored
|
|
123
|
+
|
|
124
|
+
## Invoices ← one section per screen or function (1 to 60). Name: 1–120 characters
|
|
125
|
+
What it's for: See and pay the month's invoices. ← required, 1–600
|
|
126
|
+
What users can do: Download the PDF, pay by card and see the ← required, 1–600; it can continue
|
|
127
|
+
history. on the lines below
|
|
128
|
+
Common problems: ← optional; up to 10, each 1–300
|
|
129
|
+
- The Pay button does nothing with debit cards.
|
|
130
|
+
- The PDF comes out blank in Safari.
|
|
131
|
+
Where: /invoices ← optional; the page's path, starts with /
|
|
115
132
|
```
|
|
116
133
|
|
|
117
|
-
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
134
|
+
- Labels are recognized at the start of the line, ignoring case. The Spanish labels of 0.7.0 (`Para qué sirve:`,
|
|
135
|
+
`Qué puede hacer el usuario:`, `Problemas comunes:`) are still accepted. A line that isn't a label continues the
|
|
136
|
+
previous field (joined with a space).
|
|
137
|
+
- Text before the first `## ` that isn't the `# ` title → error. A repeated label in a section → error. A line with
|
|
138
|
+
`<` or `>` → error. More than 64 KB → `guia_muy_grande`.
|
|
139
|
+
|
|
140
|
+
## Put the chat in the app
|
|
141
|
+
|
|
142
|
+
`supcoflow widget` shows what to paste, built by the engine with your project's ids (don't copy them by hand: a
|
|
143
|
+
wrongly copied id leaves the chat invisible without any error). It writes no files of the app:
|
|
144
|
+
|
|
145
|
+
1. The package with its exact version (`npm i @supcoflow/chat@… --save-exact`, or the same with your package manager).
|
|
146
|
+
2. **Next.js (App Router):** a wrapper file at the path the engine suggests (`nextjs.archivo_sugerido`, today
|
|
147
|
+
`app/_supcoflow/support-chat.tsx`; if the app uses `src/app`, inside `src/app`), with the content as is. If the
|
|
148
|
+
chat is already installed under an earlier name (`nextjs.archivos_anteriores`, for example
|
|
149
|
+
`app/_supcoflow/chat-de-soporte.tsx`), update that file in place instead of creating a second one. The wrapper is
|
|
150
|
+
needed because the chat component uses React hooks and doesn't ship `"use client"`, and a `layout.tsx` is a server
|
|
151
|
+
component by default: importing it directly there doesn't work.
|
|
152
|
+
3. Use the wrapper in the layout that covers the screens where your users get stuck.
|
|
153
|
+
4. If the app has a Content Security Policy (CSP) with `connect-src`, add the chat's origin to it, keeping what it
|
|
154
|
+
already has (a second `connect-src` is ignored).
|
|
155
|
+
|
|
156
|
+
The `<script>` line it also shows is available but not tested in a real app, and is not for Next.js.
|
|
157
|
+
`supcoflow widget --json` returns the engine's object as is.
|
|
158
|
+
|
|
159
|
+
Then, `supcoflow install record --skill <version> [--app <folder>] [--file <path>]` leaves in
|
|
160
|
+
`.supcoflow/instalacion.json` (to commit) which versions it ended up with: the skill, the terminal, the chat declared
|
|
161
|
+
and installed, the project configuration and, with `--file`, the file the chat lives in (a path relative to the repo
|
|
162
|
+
root, with no `..`, and not a symlink). The file is version 2; a version 1 file (from 0.7.0) is read without error as
|
|
163
|
+
«no file recorded». Running it again without `--file` keeps the file already recorded. It never contains a secret or
|
|
164
|
+
a date; repeating it without changes doesn't touch it, and if the file has uncommitted changes it exits 4 and doesn't
|
|
165
|
+
overwrite it.
|
|
166
|
+
|
|
167
|
+
## Test the installation
|
|
168
|
+
|
|
169
|
+
With the chat in place, two commands say whether a problem that comes in through the chat reaches an issue. Both take
|
|
170
|
+
the repo from the `origin`, or `--repo owner/repo`.
|
|
171
|
+
|
|
172
|
+
| Command | What it does |
|
|
173
|
+
|---|---|
|
|
174
|
+
| `supcoflow diagnose` | Free and writes nothing. It prints «Checked sign-in, repo, GitHub App, allowed sites, chat and guide: N of 6, at no cost.» and, apart, «Ready for a test: yes / no, because …» with the policy, the month's balance and open tests. Exits 0 if everything is ready, 4 if something needs fixing (with each point). `--json` gives `instalacion: { ok, total: 6, puntos }` and `prueba: { listo, puntos }`. |
|
|
175
|
+
| `supcoflow test` | Without `--authorize-spend` it sends nothing: it exits 4 with the test's ceiling, the balance, the cap and what is committed this month, and the exact command to launch it. |
|
|
176
|
+
| `supcoflow test --authorize-spend --ceiling 2 --expect-policy investigate` | Requests the test: the problem comes in through the same door as the chat and runs an investigation that **spends** up to the ceiling you authorize (with the `save` policy it goes as far as the saved case and doesn't spend). Exits 5 with the id. `--message "…"` uses your own text. |
|
|
177
|
+
| `supcoflow test --wait` | Follows the last test up to 90 s: 5 while it runs (call it again), 0 with the issue, 4 if it needs a look in the console (it brings the link). The charge is shown as it is: `pendiente` right at the close, never 0. `--test-id prb_…` follows another one. |
|
|
178
|
+
| `supcoflow test --dry-run --authorize-spend --ceiling 2 --expect-policy investigate` | What it would do (project, ceiling, balance, policy), without requesting anything. |
|
|
179
|
+
|
|
180
|
+
`--ceiling` is the number you were shown and `--expect-policy` the policy you were offered: both travel in the request
|
|
181
|
+
and the terminal doesn't re-read anything to choose them. If the ceiling or the policy changed in the meantime, it
|
|
182
|
+
exits 4 `techo_distinto` / `politica_distinta` with the new values and doesn't retry: ask again. The old
|
|
183
|
+
`probar --autorizo-gasto` alias also needs `--ceiling` now (an alias can't widen what you authorized); if you need the
|
|
184
|
+
old behavior, use supcoflow 0.7.0.
|
|
185
|
+
|
|
186
|
+
If the engine's answer doesn't arrive, the request stays saved on this machine (outside the repo, next to the
|
|
187
|
+
credentials): repeating the same `supcoflow test --authorize-spend …` picks up **the same** test instead of
|
|
188
|
+
requesting another. While a request is unconfirmed, another `--message`, `--ceiling` or `--expect-policy` exits 4
|
|
189
|
+
`intento_pendiente`. The test goes with the personal key of `supcoflow login`; a read-only key can't request it. One
|
|
190
|
+
open test per project: another one exits 4 `prueba_en_curso` with the id of the open one. A test's issue stays open and
|
|
191
|
+
is marked as a test.
|
|
192
|
+
|
|
193
|
+
## With an assistant
|
|
194
|
+
|
|
195
|
+
If you use a code assistant such as Claude Code, the Supcoflow skill does the whole path for you: session, project,
|
|
196
|
+
configuration, guide, the chat in the app and the summary.
|
|
149
197
|
|
|
150
198
|
```bash
|
|
151
199
|
npx skills add supcoflow/skills
|
|
152
200
|
```
|
|
153
201
|
|
|
154
|
-
|
|
155
|
-
|
|
202
|
+
And in the assistant: `/supcoflow go`. It always asks you about your users' data and what happens with each problem;
|
|
203
|
+
it doesn't push anything to GitHub.
|
|
156
204
|
|
|
157
|
-
##
|
|
205
|
+
## The contract
|
|
158
206
|
|
|
159
|
-
|
|
207
|
+
Made to be read by a program, not only by a person:
|
|
160
208
|
|
|
161
|
-
- **`--json`**:
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
209
|
+
- **`--json`**: the result goes out on stdout as **one line** of JSON; warnings go to stderr. Errors too:
|
|
210
|
+
`{"ok":false,"error":"…","message":"…"}`, with their exit code. The `error` codes are stable identifiers (some are in
|
|
211
|
+
Spanish, like `falta_guia`); the `message` of the engine's answers is printed as it arrives.
|
|
212
|
+
- **No questions without an interactive terminal** (or with `--json`): if something is missing, it exits 3 saying which
|
|
213
|
+
flag to use. `supcoflow login` without a terminal exits 3 and points you to the two-step path.
|
|
214
|
+
- **`--dry-run`** wherever it can be simulated (`login`, `login --start`, `logout`, `repo connect --start`,
|
|
215
|
+
`project create`, `guide check`, `guide publish`, `guide use`, `install record`, `test`). `login --wait --dry-run`
|
|
216
|
+
exits 3: polling consumes the code and there is no way to simulate it.
|
|
168
217
|
|
|
169
|
-
|
|
|
218
|
+
| Code | It means |
|
|
170
219
|
|---|---|
|
|
171
220
|
| 0 | ok |
|
|
172
|
-
| 1 |
|
|
173
|
-
| 2 |
|
|
174
|
-
| 3 |
|
|
175
|
-
| 4 |
|
|
176
|
-
| 5 |
|
|
177
|
-
| 6 |
|
|
178
|
-
|
|
179
|
-
##
|
|
180
|
-
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
|
|
184
|
-
- **
|
|
185
|
-
|
|
186
|
-
- **`SUPCOFLOW_TOKEN`**
|
|
187
|
-
-
|
|
188
|
-
- `
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
##
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
viaja a producción.
|
|
221
|
+
| 1 | unexpected |
|
|
222
|
+
| 2 | login needed |
|
|
223
|
+
| 3 | invalid input |
|
|
224
|
+
| 4 | a person is needed |
|
|
225
|
+
| 5 | waiting for a person: call again |
|
|
226
|
+
| 6 | limit reached |
|
|
227
|
+
|
|
228
|
+
## Where the key is kept
|
|
229
|
+
|
|
230
|
+
- In the **system keychain** (Keychain on macOS, Secret Service with `secret-tool` on Linux).
|
|
231
|
+
- If there is no keychain, in `~/.config/supcoflow/credenciales.json` (or `$XDG_CONFIG_HOME/supcoflow/…`) with `0600`
|
|
232
|
+
permissions, and the terminal warns you.
|
|
233
|
+
- **Never inside a git repo**: if that file would land inside one (a `HOME` that is a dotfiles repo, for example), it
|
|
234
|
+
saves nothing and asks you to use the keychain or `SUPCOFLOW_TOKEN`.
|
|
235
|
+
- **`SUPCOFLOW_TOKEN`** takes priority over what is saved: it is for CI and the cloud.
|
|
236
|
+
- The key never appears in a log or in a `--json` output.
|
|
237
|
+
- `project create` keeps its idempotency key (it isn't a secret: it only avoids creating twice if the answer is lost)
|
|
238
|
+
in `idempotencia.json`, next to the credentials and with the same permissions.
|
|
239
|
+
|
|
240
|
+
When you sign in again, the previous key is revoked only after the new one is saved; if it couldn't be revoked, it is
|
|
241
|
+
noted down and retried on the next `login` or `logout`.
|
|
242
|
+
|
|
243
|
+
## The API is fixed
|
|
244
|
+
|
|
245
|
+
The terminal always talks to `https://app.supcoflow.dev`. No file in the repo can change that, so cloning someone
|
|
246
|
+
else's repo and running `supcoflow` doesn't send your key to another server. For development, only the
|
|
247
|
+
`SUPCOFLOW_API_URL` environment variable moves it (`https`, or `http` against `localhost`), and what is saved stays
|
|
248
|
+
tied to the API that issued it: a key from a local engine never travels to production.
|
package/dist/alias.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// Los nombres que la terminal tenía hasta la 0.7.0 (castellano). Siguen funcionando como alias, pero no salen en
|
|
2
|
+
// `describe` ni en la ayuda: el nombre canónico es el inglés. Todo el castellano de nombres vive acá, en un
|
|
3
|
+
// solo archivo, para que la alarma de textos (`test/textos-en-ingles.test.ts`) pueda dejarlo afuera.
|
|
4
|
+
// El comando viejo (completo, de una o dos palabras) → el canónico.
|
|
5
|
+
export const COMANDOS_VIEJOS = {
|
|
6
|
+
"quien-soy": "whoami",
|
|
7
|
+
describir: "describe",
|
|
8
|
+
"repo conectar": "repo connect",
|
|
9
|
+
"proyecto crear": "project create",
|
|
10
|
+
"proyecto ver": "project show",
|
|
11
|
+
catalogo: "catalog",
|
|
12
|
+
configuracion: "config",
|
|
13
|
+
"chat prender": "chat on",
|
|
14
|
+
"chat apagar": "chat off",
|
|
15
|
+
"chat marca": "chat brand",
|
|
16
|
+
"sitios agregar": "sites add",
|
|
17
|
+
"sitios quitar": "sites remove",
|
|
18
|
+
"datos fijar": "data set",
|
|
19
|
+
"politica fijar": "policy set",
|
|
20
|
+
"claves crear": "keys create",
|
|
21
|
+
"claves listar": "keys list",
|
|
22
|
+
"claves revocar": "keys revoke",
|
|
23
|
+
"guia revisar": "guide check",
|
|
24
|
+
"guia publicar": "guide publish",
|
|
25
|
+
"guia ver": "guide show",
|
|
26
|
+
"guia usar": "guide use",
|
|
27
|
+
"instalacion anotar": "install record",
|
|
28
|
+
diagnosticar: "diagnose",
|
|
29
|
+
probar: "test",
|
|
30
|
+
};
|
|
31
|
+
// El flag viejo (sin los guiones) → el canónico.
|
|
32
|
+
export const FLAGS_VIEJOS = {
|
|
33
|
+
"autorizo-gasto": "authorize-spend",
|
|
34
|
+
"desde-github": "from-github",
|
|
35
|
+
permitir: "allow",
|
|
36
|
+
modo: "mode",
|
|
37
|
+
mensaje: "message",
|
|
38
|
+
prueba: "test-id",
|
|
39
|
+
sitio: "site",
|
|
40
|
+
titulo: "title",
|
|
41
|
+
saludo: "greeting",
|
|
42
|
+
tema: "theme",
|
|
43
|
+
archivo: "file",
|
|
44
|
+
nombre: "name",
|
|
45
|
+
"guardar-en": "save-to",
|
|
46
|
+
origen: "source",
|
|
47
|
+
};
|
|
48
|
+
// Los valores viejos de los flags con valores fijos → el canónico. A la API siempre viaja el valor de la API
|
|
49
|
+
// (`relevar`, `guardar`, `agente`, `nada`…): cada comando traduce el que recibe.
|
|
50
|
+
export const POLITICA_VIEJA = { relevar: "investigate", guardar: "save" };
|
|
51
|
+
export const ORIGEN_VIEJO = { repo: "repo", agente: "agent" };
|
|
52
|
+
export const PERMITIDOS_VIEJOS = {
|
|
53
|
+
usuario_id: "user_id",
|
|
54
|
+
usuario_rol: "user_role",
|
|
55
|
+
pagina_y_navegador: "page_and_browser",
|
|
56
|
+
capturas: "screenshots",
|
|
57
|
+
elementos: "elements",
|
|
58
|
+
nada: "nothing",
|
|
59
|
+
};
|
|
60
|
+
export const PREFIJO_VIEJO_DE_ATRIBUTO = "atributo:";
|