@veilio-inc/cli 0.5.4 → 0.6.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 +62 -15
- package/dist/args.d.ts +20 -2
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +48 -3
- package/dist/args.js.map +1 -1
- package/dist/client/index.d.ts +9 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +13 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/keys.d.ts +22 -0
- package/dist/client/keys.d.ts.map +1 -0
- package/dist/client/keys.js +170 -0
- package/dist/client/keys.js.map +1 -0
- package/dist/client/maps.d.ts +115 -0
- package/dist/client/maps.d.ts.map +1 -0
- package/dist/client/maps.js +798 -0
- package/dist/client/maps.js.map +1 -0
- package/dist/client/personal-maps-key.d.ts +42 -0
- package/dist/client/personal-maps-key.d.ts.map +1 -0
- package/dist/client/personal-maps-key.js +168 -0
- package/dist/client/personal-maps-key.js.map +1 -0
- package/dist/client/project-scope.d.ts +87 -0
- package/dist/client/project-scope.d.ts.map +1 -0
- package/dist/client/project-scope.js +132 -0
- package/dist/client/project-scope.js.map +1 -0
- package/dist/client/projects.d.ts +53 -0
- package/dist/client/projects.d.ts.map +1 -0
- package/dist/client/projects.js +129 -0
- package/dist/client/projects.js.map +1 -0
- package/dist/client/status.d.ts +21 -0
- package/dist/client/status.d.ts.map +1 -0
- package/dist/client/status.js +71 -0
- package/dist/client/status.js.map +1 -0
- package/dist/client/team-key-bootstrap.d.ts +55 -0
- package/dist/client/team-key-bootstrap.d.ts.map +1 -0
- package/dist/client/team-key-bootstrap.js +127 -0
- package/dist/client/team-key-bootstrap.js.map +1 -0
- package/dist/client/vault-key.d.ts +5 -0
- package/dist/client/vault-key.d.ts.map +1 -0
- package/dist/client/vault-key.js +35 -0
- package/dist/client/vault-key.js.map +1 -0
- package/dist/client/wording.d.ts +62 -0
- package/dist/client/wording.d.ts.map +1 -0
- package/dist/client/wording.js +358 -0
- package/dist/client/wording.js.map +1 -0
- package/dist/cloud-commands.d.ts +34 -43
- package/dist/cloud-commands.d.ts.map +1 -1
- package/dist/cloud-commands.js +282 -466
- package/dist/cloud-commands.js.map +1 -1
- package/dist/cloud.d.ts +101 -2
- package/dist/cloud.d.ts.map +1 -1
- package/dist/cloud.js +91 -7
- package/dist/cloud.js.map +1 -1
- package/dist/commands.d.ts +14 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +24 -0
- package/dist/commands.js.map +1 -1
- package/dist/credential.d.ts +7 -0
- package/dist/credential.d.ts.map +1 -1
- package/dist/credential.js +10 -1
- package/dist/credential.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -5
- package/dist/index.js.map +1 -1
- package/dist/team-namespace.d.ts +74 -2
- package/dist/team-namespace.d.ts.map +1 -1
- package/dist/team-namespace.js +78 -18
- package/dist/team-namespace.js.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
// Every refusal the Cloud commands and the MCP map tools can give, in one table
|
|
2
|
+
// (spec 052 FR-019).
|
|
3
|
+
//
|
|
4
|
+
// WHY ONE TABLE
|
|
5
|
+
//
|
|
6
|
+
// The CLI and the MCP server do the same things to the same maps, and a person
|
|
7
|
+
// who meets a refusal in an agent's reply will often go and try the command
|
|
8
|
+
// themselves. If the two said different things for the same reason, the second
|
|
9
|
+
// reads as a second problem. So both renderers take their words from here, and
|
|
10
|
+
// a test checks the table as a table: one entry per code, each naming its
|
|
11
|
+
// reason AND what resolves it. "Not permitted" alone leaves somebody exactly
|
|
12
|
+
// where they were (Constitution V).
|
|
13
|
+
//
|
|
14
|
+
// The words never carry the `veilio:` prefix. That belongs to the renderer -
|
|
15
|
+
// the terminal prints `veilio: ...` and the MCP server `Veilio: ...` - so the
|
|
16
|
+
// sentence itself is the same everywhere.
|
|
17
|
+
//
|
|
18
|
+
// Real identifiers never go in `message` or `resolve`. A clash names the
|
|
19
|
+
// placeholders; the names behind them go in `details`, which only the terminal
|
|
20
|
+
// prints, because the MCP server's reader is the model whose context the names
|
|
21
|
+
// must stay out of (spec 052, founder decision 2026-10-25).
|
|
22
|
+
import { CloudError } from '../cloud.js';
|
|
23
|
+
export const REFUSAL_CODES = [
|
|
24
|
+
'not_signed_in',
|
|
25
|
+
'which_map',
|
|
26
|
+
'map_not_found',
|
|
27
|
+
'map_not_in_project',
|
|
28
|
+
'not_yours_remove',
|
|
29
|
+
'not_yours_update',
|
|
30
|
+
'no_local_map',
|
|
31
|
+
'no_vault',
|
|
32
|
+
'no_passphrase',
|
|
33
|
+
'wrong_passphrase',
|
|
34
|
+
'vault_locked',
|
|
35
|
+
'no_pmk_yet',
|
|
36
|
+
'pmk_unopenable',
|
|
37
|
+
'keys_not_set_up',
|
|
38
|
+
'team_key_waiting',
|
|
39
|
+
'own_public_key_mismatch',
|
|
40
|
+
'team_key_readback_mismatch',
|
|
41
|
+
'team_key_not_startable',
|
|
42
|
+
'team_key_solo_unavailable',
|
|
43
|
+
'personal_old_seal',
|
|
44
|
+
'personal_unopenable',
|
|
45
|
+
'not_envelope',
|
|
46
|
+
'team_locked',
|
|
47
|
+
'team_key_unreadable',
|
|
48
|
+
'team_key_mismatch',
|
|
49
|
+
'not_in_team',
|
|
50
|
+
'team_maps_unreadable',
|
|
51
|
+
'team_map_unopenable',
|
|
52
|
+
'clash',
|
|
53
|
+
'would_drop',
|
|
54
|
+
'pull_would_drop',
|
|
55
|
+
'diverged',
|
|
56
|
+
'stale',
|
|
57
|
+
'rotation_owed',
|
|
58
|
+
'too_large',
|
|
59
|
+
'abuse_limit',
|
|
60
|
+
'which_project',
|
|
61
|
+
'project_not_found',
|
|
62
|
+
'project_ambiguous',
|
|
63
|
+
'project_gone',
|
|
64
|
+
'project_env_not_found',
|
|
65
|
+
'project_env_ambiguous',
|
|
66
|
+
'no_projects',
|
|
67
|
+
'destructive_off',
|
|
68
|
+
'confirm_name',
|
|
69
|
+
'confirm_unknown',
|
|
70
|
+
'session_rejected',
|
|
71
|
+
'unentitled',
|
|
72
|
+
'suspended',
|
|
73
|
+
'forbidden',
|
|
74
|
+
'unreachable',
|
|
75
|
+
'server',
|
|
76
|
+
];
|
|
77
|
+
/** A trailing full stop, unless the text already ends a sentence. Server
|
|
78
|
+
* messages arrive both ways. */
|
|
79
|
+
function sentence(text) {
|
|
80
|
+
const t = (text ?? '').trim();
|
|
81
|
+
return /[.!?…]$/.test(t) ? t : `${t}.`;
|
|
82
|
+
}
|
|
83
|
+
function plural(n, one, many) {
|
|
84
|
+
return n === 1 ? one : many;
|
|
85
|
+
}
|
|
86
|
+
const label = (p) => (p.name ? `"${p.name}" (${p.id})` : `${p.id}`);
|
|
87
|
+
export const WORDING = {
|
|
88
|
+
not_signed_in: () => ({
|
|
89
|
+
message: 'not signed in.',
|
|
90
|
+
resolve: 'Run `veilio login` first.',
|
|
91
|
+
}),
|
|
92
|
+
which_map: () => ({
|
|
93
|
+
message: 'which map? No id was given, so nothing was done.',
|
|
94
|
+
resolve: 'Run `veilio maps list` for the ids.',
|
|
95
|
+
}),
|
|
96
|
+
map_not_found: (p) => ({
|
|
97
|
+
message: `there is no map ${p.id} on this account.`,
|
|
98
|
+
resolve: 'Run `veilio maps list` for the ids.',
|
|
99
|
+
}),
|
|
100
|
+
map_not_in_project: (p) => ({
|
|
101
|
+
message: `No map ${p.id} in project ${p.project} (${p.override ? 'set by VEILIO_PROJECT' : 'the project in use'}).`,
|
|
102
|
+
resolve: p.override
|
|
103
|
+
? 'Set VEILIO_PROJECT to another project, or unset it: `veilio projects` lists them.'
|
|
104
|
+
: '`veilio projects use <other>` to work in another one.',
|
|
105
|
+
}),
|
|
106
|
+
not_yours_remove: (p) => ({
|
|
107
|
+
message: `${label(p)} belongs to someone else on your team, so it is theirs to remove.`,
|
|
108
|
+
resolve: 'Ask whoever published it to remove it.',
|
|
109
|
+
}),
|
|
110
|
+
not_yours_update: (p) => ({
|
|
111
|
+
message: `${label(p)} belongs to someone else on your team, so only they can update it. Nothing was written.`,
|
|
112
|
+
resolve: 'Ask whoever published it to update it, or publish your own with `veilio maps push --team`.',
|
|
113
|
+
}),
|
|
114
|
+
no_local_map: (p) => ({
|
|
115
|
+
message: `there is no local map at ${p.path}, so there is nothing to send.`,
|
|
116
|
+
resolve: 'Run `veilio scrub` on the project first, or pass --map with the map to use.',
|
|
117
|
+
}),
|
|
118
|
+
no_vault: () => ({
|
|
119
|
+
message: 'this account has no vault, so there is no key to open or seal its personal maps.',
|
|
120
|
+
resolve: 'Create one in the web app first — it is the passphrase your maps are encrypted under.',
|
|
121
|
+
}),
|
|
122
|
+
no_passphrase: () => ({
|
|
123
|
+
message: 'no passphrase given, so nothing was changed.',
|
|
124
|
+
resolve: 'Run the command again and type the vault passphrase you use in the web app.',
|
|
125
|
+
}),
|
|
126
|
+
wrong_passphrase: () => ({
|
|
127
|
+
message: 'that vault passphrase is not right. Nothing was written or uploaded.',
|
|
128
|
+
resolve: 'Run the command again with the passphrase you use in the web app.',
|
|
129
|
+
}),
|
|
130
|
+
vault_locked: () => ({
|
|
131
|
+
message: 'the personal-maps key is not unlocked on this machine, so personal maps cannot be opened or sealed here. Nothing was changed.',
|
|
132
|
+
resolve: 'Run `veilio vault unlock` in a terminal first.',
|
|
133
|
+
}),
|
|
134
|
+
no_pmk_yet: () => ({
|
|
135
|
+
message: 'this account has no personal-maps key yet, so a personal map cannot be sealed for it.',
|
|
136
|
+
resolve: 'Run `veilio vault unlock`, which creates it.',
|
|
137
|
+
}),
|
|
138
|
+
pmk_unopenable: () => ({
|
|
139
|
+
message: "the account's personal-maps key could not be opened with this vault key, so it looks damaged. Nothing was changed.",
|
|
140
|
+
resolve: 'Contact Veilio support with the account email; do not create a new vault.',
|
|
141
|
+
}),
|
|
142
|
+
keys_not_set_up: () => ({
|
|
143
|
+
message: "this account's keys are not set up yet (it has no keypair), so nothing was changed.",
|
|
144
|
+
resolve: 'Open the web app and unlock your vault once to set up your keys, then run the command again.',
|
|
145
|
+
}),
|
|
146
|
+
own_public_key_mismatch: () => ({
|
|
147
|
+
message: 'the public key Cloud returned for this account does not belong to its private key, so no team key was made, wrapped or unlocked.',
|
|
148
|
+
resolve: 'Contact Veilio support, and do not grant or unlock team keys for this account until it is explained.',
|
|
149
|
+
}),
|
|
150
|
+
team_key_readback_mismatch: () => ({
|
|
151
|
+
message: 'the team key Cloud handed back (read back after it was set up) is not the one made here, so nothing was unlocked and nothing will be sealed under it.',
|
|
152
|
+
resolve: 'Contact Veilio support, and do not publish team maps until it is explained.',
|
|
153
|
+
}),
|
|
154
|
+
team_key_waiting: () => ({
|
|
155
|
+
message: 'no one in the team has granted this account the team key yet, so nothing was unlocked.',
|
|
156
|
+
resolve: 'Ask a team member who holds it to open the web app, which performs the grant, then run `veilio team unlock` again.',
|
|
157
|
+
}),
|
|
158
|
+
team_key_not_startable: (p) => ({
|
|
159
|
+
message: `the team has no key yet, and this account may not set one up: ${sentence(p.detail)}`,
|
|
160
|
+
resolve: 'Ask the team owner or an admin to open Veilio once, then run `veilio team unlock` again.',
|
|
161
|
+
}),
|
|
162
|
+
team_key_solo_unavailable: (p) => ({
|
|
163
|
+
message: `this account is the team's only member, and its key could not be set up from here (${p.detail}). Nothing was unlocked.`,
|
|
164
|
+
resolve: 'Open the team page in the web app, which sets the key up, then run `veilio team unlock` again.',
|
|
165
|
+
}),
|
|
166
|
+
personal_old_seal: (p) => ({
|
|
167
|
+
message: `${label(p)} is still sealed with the vault key, which this machine does not hold. Nothing was written.`,
|
|
168
|
+
resolve: 'Run `veilio vault unlock`, which re-seals it under the personal-maps key.',
|
|
169
|
+
}),
|
|
170
|
+
personal_unopenable: (p) => ({
|
|
171
|
+
message: `${label(p)} could not be opened — ${sentence(p.detail)} Nothing was written.`,
|
|
172
|
+
resolve: 'Check whether it opens in the web app; if it does not, it is damaged and `veilio maps rm` removes it.',
|
|
173
|
+
}),
|
|
174
|
+
not_envelope: () => ({
|
|
175
|
+
message: 'that map is not an encrypted envelope, so it was not written.',
|
|
176
|
+
resolve: 'Open it in the web app and save it again, which seals it.',
|
|
177
|
+
}),
|
|
178
|
+
team_locked: () => ({
|
|
179
|
+
message: 'no team key is unlocked on this machine, so team maps cannot be opened or sealed here. Nothing was written or uploaded.',
|
|
180
|
+
resolve: 'Run `veilio team unlock` first.',
|
|
181
|
+
}),
|
|
182
|
+
team_key_unreadable: (p) => ({
|
|
183
|
+
message: `the unlocked team key could not be read (${p.detail}). Nothing was written or uploaded.`,
|
|
184
|
+
resolve: 'Run `veilio team unlock` again.',
|
|
185
|
+
}),
|
|
186
|
+
team_key_mismatch: () => ({
|
|
187
|
+
message: 'the team key on this machine does not match this team. Nothing was written or uploaded.',
|
|
188
|
+
resolve: 'Run `veilio team unlock` again.',
|
|
189
|
+
}),
|
|
190
|
+
not_in_team: () => ({
|
|
191
|
+
message: 'this account is not in a team, so there is no shared map to publish to. Nothing was uploaded.',
|
|
192
|
+
resolve: "Open the team page in the web app, where the account's team is set up.",
|
|
193
|
+
}),
|
|
194
|
+
team_maps_unreadable: (p) => ({
|
|
195
|
+
message: `could not read the team's maps (${p.detail}), so whether this map conflicts with the team cannot be known. Nothing was uploaded.`,
|
|
196
|
+
resolve: 'Run `veilio team unlock` again; a named map that still does not open can be removed by its publisher with `veilio maps rm <id>`.',
|
|
197
|
+
}),
|
|
198
|
+
team_map_unopenable: (p) => ({
|
|
199
|
+
message: `that team map, ${label(p)}, could not be opened with the unlocked team keys — ${sentence(p.detail)} Nothing was written.`,
|
|
200
|
+
resolve: 'If the team key was rotated since, run `veilio team unlock` again.',
|
|
201
|
+
}),
|
|
202
|
+
clash: (p) => ({
|
|
203
|
+
message: `${p.count} ${plural(p.count, 'placeholder', 'placeholders')} in this map already ` +
|
|
204
|
+
`${plural(p.count, 'means', 'mean')} something else to the team (${p.list}). Publishing would leave ` +
|
|
205
|
+
`${plural(p.count, 'it', 'them')} unrestorable for every member, so nothing was uploaded.`,
|
|
206
|
+
resolve: 'Re-run `veilio scrub --team` to number this project out of the team’s own allocation, then push the result.',
|
|
207
|
+
}),
|
|
208
|
+
would_drop: (p) => ({
|
|
209
|
+
message: `updating ${label(p)} would drop ${p.count} ${plural(p.count, 'entry', 'entries')} the Cloud map holds and this project's map does not (${p.list}). Nothing was written.`,
|
|
210
|
+
resolve: 'Pass --allow-drop (for the MCP tool, allowDrop: true) to drop them deliberately, or pull the map first with `veilio maps pull <id>`.',
|
|
211
|
+
}),
|
|
212
|
+
pull_would_drop: (p) => ({
|
|
213
|
+
message: `pulling "${p.name}" would drop ${p.count} placeholder(s) this project's map has: ${p.list}. Nothing was written.`,
|
|
214
|
+
resolve: 'Push this map first (`veilio maps push`), pass --force to replace it, or export it with `veilio map --json`.',
|
|
215
|
+
}),
|
|
216
|
+
diverged: (p) => ({
|
|
217
|
+
message: `this map changed in Cloud (${p.from} → ${p.to}) and locally since it was pulled. Neither copy has been touched.`,
|
|
218
|
+
resolve: 'Pass --force to overwrite the local copy, or export it first with `veilio map --json`.',
|
|
219
|
+
}),
|
|
220
|
+
stale: (p) => ({
|
|
221
|
+
message: `${label(p)} changed in Cloud since it was read (now ${p.to}), so this update was not written over it.`,
|
|
222
|
+
resolve: 'Pull it (`veilio maps pull <id>`), check the change, then update again.',
|
|
223
|
+
}),
|
|
224
|
+
rotation_owed: () => ({
|
|
225
|
+
message: 'a teammate left while holding the team key, so no new team content may be written until the key is changed. Nothing was uploaded.',
|
|
226
|
+
resolve: 'A member who holds the current key has to change it in the web app — it cannot be done from here. Ask one of them.',
|
|
227
|
+
}),
|
|
228
|
+
too_large: () => ({
|
|
229
|
+
message: 'this map is too large for Cloud to accept, so nothing was stored.',
|
|
230
|
+
resolve: 'Split it, or remove entries you no longer need.',
|
|
231
|
+
}),
|
|
232
|
+
abuse_limit: (p) => ({
|
|
233
|
+
message: `${sentence(p.detail)} This ceiling is the same on every paid plan, so upgrading will not raise it. Nothing was uploaded.`,
|
|
234
|
+
resolve: 'Remove maps you no longer need with `veilio maps rm <id>`.',
|
|
235
|
+
}),
|
|
236
|
+
which_project: () => ({
|
|
237
|
+
message: 'which project? None was named, so nothing was changed.',
|
|
238
|
+
resolve: 'Run `veilio projects` for their names, then `veilio projects use <name>`.',
|
|
239
|
+
}),
|
|
240
|
+
project_not_found: (p) => ({
|
|
241
|
+
message: `"${p.project}" is not a project your team works in, so nothing was changed.`,
|
|
242
|
+
resolve: 'Run `veilio projects` to see the ones it does.',
|
|
243
|
+
}),
|
|
244
|
+
project_ambiguous: (p) => ({
|
|
245
|
+
message: `${p.count} projects are called "${p.project}", so nothing was changed.`,
|
|
246
|
+
resolve: 'Choose one by its id: `veilio projects` lists them.',
|
|
247
|
+
}),
|
|
248
|
+
project_gone: (p) => p.override
|
|
249
|
+
? {
|
|
250
|
+
message: `the project VEILIO_PROJECT names (${p.project}) is not one your team works in any more, so nothing was done. No other project was used instead.`,
|
|
251
|
+
resolve: 'Run `veilio projects`, then set VEILIO_PROJECT to one of them, or unset it.',
|
|
252
|
+
}
|
|
253
|
+
: {
|
|
254
|
+
message: `the project chosen for this sign-in (${p.project}) is not one your team works in any more, so nothing was done. No other project was used instead.`,
|
|
255
|
+
resolve: 'Run `veilio projects`, then `veilio projects use <name>`.',
|
|
256
|
+
},
|
|
257
|
+
// Somebody typed it, so it is never quietly replaced by the stored choice
|
|
258
|
+
// or the default (FR-012a): the value is named, and so is where it came from.
|
|
259
|
+
project_env_not_found: (p) => ({
|
|
260
|
+
message: `VEILIO_PROJECT is "${p.project}", which is not a project your team works in, so nothing was done. No other project was used instead.`,
|
|
261
|
+
resolve: 'Run `veilio projects` for the ones it does, then set VEILIO_PROJECT to one of them, or unset it.',
|
|
262
|
+
}),
|
|
263
|
+
project_env_ambiguous: (p) => ({
|
|
264
|
+
message: `VEILIO_PROJECT is "${p.project}", and ${p.count} projects are called that, so nothing was done. No other project was used instead.`,
|
|
265
|
+
resolve: "Set VEILIO_PROJECT to the project's id: `veilio projects` lists them.",
|
|
266
|
+
}),
|
|
267
|
+
no_projects: () => ({
|
|
268
|
+
message: "this account's team works in no project yet, so there is none to choose.",
|
|
269
|
+
resolve: 'Share a first team map with `veilio maps push --team`, which creates the default project, or make one in the web app.',
|
|
270
|
+
}),
|
|
271
|
+
destructive_off: () => ({
|
|
272
|
+
message: 'removing a map, or an update that drops entries, is turned off for this MCP server, so nothing was removed or dropped.',
|
|
273
|
+
resolve: 'The person running it can allow it by starting the server with VEILIO_MCP_DESTRUCTIVE=1, or do it in a terminal with `veilio maps rm` or `veilio maps update --allow-drop`.',
|
|
274
|
+
}),
|
|
275
|
+
confirm_name: (p) => ({
|
|
276
|
+
message: `confirmName must repeat the map's exact name ("${p.name}"), so nothing was removed.`,
|
|
277
|
+
resolve: 'Ask the person to confirm which map, then call again with its exact name.',
|
|
278
|
+
}),
|
|
279
|
+
confirm_unknown: (p) => ({
|
|
280
|
+
message: `the name of ${p.id} could not be read to check confirmName against, so nothing was removed.`,
|
|
281
|
+
resolve: 'Check the id with maps_list, then call again.',
|
|
282
|
+
}),
|
|
283
|
+
session_rejected: () => ({
|
|
284
|
+
message: 'not signed in, or the session was revoked or expired.',
|
|
285
|
+
resolve: 'Run `veilio login` again.',
|
|
286
|
+
}),
|
|
287
|
+
unentitled: (p) => ({
|
|
288
|
+
message: `this account’s plan does not include that — ${sentence(p.detail)}`,
|
|
289
|
+
resolve: 'Change the plan in the web app to use it from here.',
|
|
290
|
+
}),
|
|
291
|
+
suspended: (p) => ({
|
|
292
|
+
message: sentence(p.detail),
|
|
293
|
+
resolve: 'Export and deletion still work in the web app; nothing else will until the review ends. Contact Veilio support about the review.',
|
|
294
|
+
}),
|
|
295
|
+
forbidden: (p) => ({
|
|
296
|
+
message: sentence(p.detail),
|
|
297
|
+
resolve: 'Ask a team owner or admin for the access this needs.',
|
|
298
|
+
}),
|
|
299
|
+
unreachable: (p) => ({
|
|
300
|
+
message: sentence(p.detail),
|
|
301
|
+
resolve: 'Check the network and the instance address, then run the command again.',
|
|
302
|
+
}),
|
|
303
|
+
server: (p) => ({
|
|
304
|
+
message: `the instance reported an error — ${sentence(p.detail)}`,
|
|
305
|
+
resolve: 'Run the command again in a minute; if it keeps failing, contact the instance’s support.',
|
|
306
|
+
}),
|
|
307
|
+
};
|
|
308
|
+
/** A refusal outcome, worded from the table. */
|
|
309
|
+
export function refuse(code, params = {}, details) {
|
|
310
|
+
return { ok: false, refusal: refusal(code, params, details) };
|
|
311
|
+
}
|
|
312
|
+
export function refusal(code, params = {}, details) {
|
|
313
|
+
const words = WORDING[code](params);
|
|
314
|
+
return details && details.length > 0 ? { code, ...words, details } : { code, ...words };
|
|
315
|
+
}
|
|
316
|
+
/** How the terminal prints one. The MCP server has its own (no details). */
|
|
317
|
+
export function renderRefusal(r) {
|
|
318
|
+
const lines = (r.details ?? []).map((d) => ` ${d}\n`).join('');
|
|
319
|
+
return `veilio: ${r.message} ${r.resolve}\n${lines}`;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* A failed request, as a refusal with the remedy that fits it.
|
|
323
|
+
*
|
|
324
|
+
* `project` is the project the call carried. The server answers a project that
|
|
325
|
+
* is not the team's - or no longer is - with 404 "Project not found", and that
|
|
326
|
+
* must be said as such, never as "the instance reported an error", or nobody
|
|
327
|
+
* thinks to choose another (spec 052 edge case: the chosen project removed).
|
|
328
|
+
*/
|
|
329
|
+
export function refusalFromCloudError(err, ctx = {}) {
|
|
330
|
+
if (!(err instanceof CloudError)) {
|
|
331
|
+
return refusal('server', { detail: err instanceof Error ? err.message : String(err) });
|
|
332
|
+
}
|
|
333
|
+
if (err.status === 404 && /project not found/i.test(err.message)) {
|
|
334
|
+
return refusal('project_gone', {
|
|
335
|
+
project: ctx.project ?? 'the default',
|
|
336
|
+
...(ctx.override ? { override: true } : {}),
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
switch (err.kind) {
|
|
340
|
+
case 'unauthenticated':
|
|
341
|
+
return refusal('session_rejected');
|
|
342
|
+
case 'unentitled':
|
|
343
|
+
return refusal('unentitled', { detail: err.message });
|
|
344
|
+
case 'suspended':
|
|
345
|
+
return refusal('suspended', { detail: err.message });
|
|
346
|
+
case 'forbidden':
|
|
347
|
+
// The ceiling is an abuse limit, not a plan feature. Saying "upgrade"
|
|
348
|
+
// here would take money for a change that does nothing.
|
|
349
|
+
if (/limit/i.test(err.message))
|
|
350
|
+
return refusal('abuse_limit', { detail: err.message });
|
|
351
|
+
return refusal('forbidden', { detail: err.message });
|
|
352
|
+
case 'unreachable':
|
|
353
|
+
return refusal('unreachable', { detail: err.message });
|
|
354
|
+
case 'server':
|
|
355
|
+
return refusal('server', { detail: err.message });
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
//# sourceMappingURL=wording.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wording.js","sourceRoot":"","sources":["../../src/client/wording.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,qBAAqB;AACrB,EAAE;AACF,gBAAgB;AAChB,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,0EAA0E;AAC1E,6EAA6E;AAC7E,oCAAoC;AACpC,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,0CAA0C;AAC1C,EAAE;AACF,yEAAyE;AACzE,+EAA+E;AAC/E,+EAA+E;AAC/E,4DAA4D;AAE5D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,eAAe;IACf,WAAW;IACX,eAAe;IACf,oBAAoB;IACpB,kBAAkB;IAClB,kBAAkB;IAClB,cAAc;IACd,UAAU;IACV,eAAe;IACf,kBAAkB;IAClB,cAAc;IACd,YAAY;IACZ,gBAAgB;IAChB,iBAAiB;IACjB,kBAAkB;IAClB,yBAAyB;IACzB,4BAA4B;IAC5B,wBAAwB;IACxB,2BAA2B;IAC3B,mBAAmB;IACnB,qBAAqB;IACrB,cAAc;IACd,aAAa;IACb,qBAAqB;IACrB,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AM,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAA;IACrD,CAAC;AACH,CAAC"}
|
package/dist/cloud-commands.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type TeamLayer } from '@veilio-inc/engine';
|
|
2
2
|
import { type Io, type TeamNamespaceSource } from './commands.js';
|
|
3
|
+
import { type Env } from './client/project-scope.js';
|
|
3
4
|
/**
|
|
4
5
|
* Sign in, and store the credential only if the account can actually use it.
|
|
5
6
|
*
|
|
@@ -60,47 +61,30 @@ export declare function runWhoami(io: Io): number;
|
|
|
60
61
|
*
|
|
61
62
|
* Prints the id, because `pull` takes one. A name would be friendlier and is
|
|
62
63
|
* wrong: names are not unique, and picking "the first one that matches" is how
|
|
63
|
-
* somebody pulls a different map over the one they were using.
|
|
64
|
+
* somebody pulls a different map over the one they were using. A teammate's
|
|
65
|
+
* team map is marked, because it is theirs to update or remove.
|
|
64
66
|
*/
|
|
65
67
|
export declare function runMapsList(io: Io): Promise<number>;
|
|
66
68
|
/**
|
|
67
|
-
* Pull a map into the local store: decrypt FIRST, write second
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* a wrong passphrase leaves a half-built store behind — and the store is the one
|
|
71
|
-
* thing that can restore text already anonymized, so a partial write there is
|
|
72
|
-
* not an inconvenience, it is unrecoverable text.
|
|
73
|
-
*
|
|
74
|
-
* A personal map is opened HERE. The server holds the salt and a verifier and
|
|
75
|
-
* nothing else; the passphrase never leaves this machine, and there is no code
|
|
76
|
-
* path in this package that could send it.
|
|
69
|
+
* Pull a map into the local store: decrypt FIRST, write second (see
|
|
70
|
+
* `pullCloudMap`). A personal map is opened HERE - the passphrase never leaves
|
|
71
|
+
* this machine, and there is no code path in this package that could send it.
|
|
77
72
|
*/
|
|
78
73
|
export declare function runMapsPull(id: string | null, mapPath: string, io: Io, options?: {
|
|
79
74
|
force?: boolean;
|
|
80
75
|
}): Promise<number>;
|
|
76
|
+
/** Upload the local map, personal or the team's. Same endpoint, same quotas,
|
|
77
|
+
* same validation as the web app. */
|
|
78
|
+
export declare function runMapsPush(name: string | null, mapPath: string, io: Io, toTeam?: boolean): Promise<number>;
|
|
79
|
+
/** Replace a Cloud map's entries with the local map's, in place (spec 052). */
|
|
80
|
+
export declare function runMapsUpdate(id: string | null, mapPath: string, io: Io, options?: {
|
|
81
|
+
allowDrop?: boolean;
|
|
82
|
+
}): Promise<number>;
|
|
81
83
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
* Publishing one of these creates a DISPUTED placeholder, and
|
|
85
|
-
* `restoreLayers.disputedIn` then refuses to restore it for every member of
|
|
86
|
-
* the team until somebody deletes a map. One person's push, a cost paid by
|
|
87
|
-
* everyone, and nothing errors at the time - so it is checked before anything
|
|
88
|
-
* is sealed rather than reported afterwards.
|
|
89
|
-
*
|
|
90
|
-
* An identifier the team holds under a DIFFERENT placeholder is an alias, not
|
|
91
|
-
* a conflict: both still restore (spec 017), so those pass.
|
|
92
|
-
*
|
|
93
|
-
* A map anonymized with `reservedAnonymizeOverTeam` cannot reach this, because
|
|
94
|
-
* its numbers came out of the team's own allocation. This is for maps that
|
|
95
|
-
* predate it - numbered locally, possibly before this account joined a team.
|
|
84
|
+
* Remove a map from Cloud. Renaming and removing are allowed while a key
|
|
85
|
+
* rotation is owed, because neither stores anything under the key.
|
|
96
86
|
*/
|
|
97
|
-
export declare function
|
|
98
|
-
placeholder: string;
|
|
99
|
-
mine: string;
|
|
100
|
-
theirs: string;
|
|
101
|
-
}[];
|
|
102
|
-
/** Upload the local map. Same endpoint, same quotas, same validation. */
|
|
103
|
-
export declare function runMapsPush(name: string | null, mapPath: string, io: Io, toTeam?: boolean): Promise<number>;
|
|
87
|
+
export declare function runMapsRm(id: string | null, io: Io): Promise<number>;
|
|
104
88
|
/**
|
|
105
89
|
* Fetch the account's custom rules so `veilio scrub` can apply them offline.
|
|
106
90
|
*
|
|
@@ -121,25 +105,32 @@ export declare function runRulesPull(io: Io): Promise<number>;
|
|
|
121
105
|
export declare function runTeamUnlock(io: Io, days?: number): Promise<number>;
|
|
122
106
|
/** Remove the unlocked team keys. */
|
|
123
107
|
export declare function runTeamLock(io: Io): number;
|
|
108
|
+
/** The team's projects, the one in use marked with `*`. */
|
|
109
|
+
export declare function runProjectsList(io: Io): Promise<number>;
|
|
110
|
+
/** Choose the project this sign-in works in. */
|
|
111
|
+
export declare function runProjectsUse(ref: string | null, io: Io): Promise<number>;
|
|
112
|
+
/**
|
|
113
|
+
* Unlock the personal-maps key for processes that cannot ask for a passphrase
|
|
114
|
+
* (spec 052 FR-011). See `client/keys.ts` for what is kept: that key, and
|
|
115
|
+
* nothing else the vault protects.
|
|
116
|
+
*/
|
|
117
|
+
export declare function runVaultUnlock(io: Io, days?: number): Promise<number>;
|
|
118
|
+
/** Remove the personal-maps key from this machine. */
|
|
119
|
+
export declare function runVaultLock(io: Io): number;
|
|
124
120
|
/**
|
|
125
121
|
* The team's maps for `veilio restore` (spec 028), handed to the local command
|
|
126
122
|
* as a callback so that command stays unlinked from the network. Signed out:
|
|
127
123
|
* no request, no layer - a local restore, as before.
|
|
128
124
|
*/
|
|
129
|
-
export declare function teamLayerFor(home: string | undefined, missing: readonly string[]): Promise<{
|
|
125
|
+
export declare function teamLayerFor(home: string | undefined, missing: readonly string[], env?: Env): Promise<{
|
|
130
126
|
team: TeamLayer | null;
|
|
131
127
|
note: string | null;
|
|
128
|
+
refused?: string;
|
|
132
129
|
}>;
|
|
133
130
|
/** What `veilio scrub` numbers from (spec 030): the team's namespace, or this
|
|
134
131
|
* project's map with the reason. Signed out or in no team: no request, no note. */
|
|
135
|
-
export declare function teamNamespaceForScrub(home: string | undefined): Promise<Awaited<ReturnType<TeamNamespaceSource>>>;
|
|
136
|
-
/**
|
|
137
|
-
*
|
|
138
|
-
|
|
139
|
-
* Who may remove a team map is the server's decision and is not second-guessed
|
|
140
|
-
* here - this says what each refusal means and changes nothing locally either
|
|
141
|
-
* way. Renaming and removing are allowed while a key rotation is owed, because
|
|
142
|
-
* neither stores anything under the key.
|
|
143
|
-
*/
|
|
144
|
-
export declare function runMapsRm(id: string | null, io: Io): Promise<number>;
|
|
132
|
+
export declare function teamNamespaceForScrub(home: string | undefined, env?: Env): Promise<Awaited<ReturnType<TeamNamespaceSource>>>;
|
|
133
|
+
/** Kept importable from here: tests and callers written before spec 052 moved
|
|
134
|
+
* it into the shared client. */
|
|
135
|
+
export { conflictsWithTeam } from './client/maps.js';
|
|
145
136
|
//# sourceMappingURL=cloud-commands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-commands.d.ts","sourceRoot":"","sources":["../src/cloud-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cloud-commands.d.ts","sourceRoot":"","sources":["../src/cloud-commands.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAWjF,OAAO,EAAuB,KAAK,EAAE,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAoBtF,OAAO,EAIL,KAAK,GAAG,EACT,MAAM,2BAA2B,CAAA;AAelC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAoE1E;AA2CD,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,MAAM,GAAG,IAAI,EACvB,EAAE,EAAE,EAAE,EACN,IAAI,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9B,OAAO,CAAC,MAAM,CAAC,CA+FjB;AAED;;;;;;;;GAQG;AACH,wBAAsB,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA2FvD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,MA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