@veilio-inc/cli 0.1.0 → 0.3.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/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  # Veilio Community License
2
2
 
3
- _Version 1.0 · Effective 2026-08-08_
3
+ _Version 1.1 · Effective 2026-09-25_
4
4
 
5
5
  **Copyright © 2026 Veilio**
6
6
 
@@ -10,7 +10,8 @@ _Version 1.0 · Effective 2026-08-08_
10
10
  > The one thing you may not do without written permission is sell Veilio itself:
11
11
  > reselling it, white-labeling it, or running it as a hosted service for other
12
12
  > people. Contributions are welcome. For a commercial or redistribution license,
13
- > email `hello@veilio.dev`.
13
+ > email `hello@veilio.dev`. Veilio is not licensed for use in or from Russia or
14
+ > Belarus, or by sanctioned persons (Section 5A).
14
15
 
15
16
  ---
16
17
 
@@ -48,11 +49,17 @@ For the purposes of this License:
48
49
 
49
50
  **"Competing Product"** means a commercially offered product or service whose primary purpose and core functionality substantially overlap with the Software or Cloud Edition.
50
51
 
52
+ **"Applicable Sanctions"** means any economic, financial, trade or other restrictive measures applicable to Veilio or the relevant transaction under the laws of the European Union or the Republic of Poland, including applicable asset-freezing and prohibition-on-making-available measures, and any other sanctions or trade restrictions that are legally binding on Veilio.
53
+
54
+ **"Restricted Person"** means any natural or legal person, entity or body that: (a) is designated or otherwise subject to restrictive measures under Applicable Sanctions, (b) is directly or indirectly owned or controlled by such a person, entity or body, (c) acts on behalf of or at the direction of such a person, entity or body; or (d) is otherwise a person to whom Veilio is prohibited under Applicable Sanctions from providing the Software, funds or economic resources.
55
+
56
+ **"Restricted Territory"** means the Russian Federation and the Republic of Belarus.
57
+
51
58
  ---
52
59
 
53
60
  ## 3. Permissions
54
61
 
55
- Subject to the restrictions in this License, you are granted a worldwide, royalty-free, non-exclusive license to:
62
+ Subject to the restrictions in this License, including Section 5A, you are granted a worldwide, royalty-free, non-exclusive license to:
56
63
 
57
64
  * use the Software for personal purposes;
58
65
  * use the Software for internal commercial purposes;
@@ -114,6 +121,24 @@ Requests for written permission may be sent to `hello@veilio.dev`.
114
121
 
115
122
  ---
116
123
 
124
+ ## 5A. Restricted Territories and Sanctions
125
+
126
+ **5A.1.** No license or other right to the Software is granted to:
127
+
128
+ * persons or entities incorporated, registered, established or headquartered in a Restricted Territory;
129
+ * natural persons whose principal place of business or ordinary residence is in a Restricted Territory; or
130
+ * Restricted Persons.
131
+
132
+ **5A.2.** You must not access or use the Software from a Restricted Territory, make the Software available to any person located in a Restricted Territory, or use the Software directly or indirectly for the benefit of a Restricted Person or a person or entity incorporated, registered, established or headquartered in a Restricted Territory.
133
+
134
+ **5A.3.** By using the Software, you represent and warrant, both when you first use it and throughout your use of it, that you are not a Restricted Person and do not fall within any of the territorial restrictions set out in this Section.
135
+
136
+ **5A.4.** You must not use an intermediary, affiliate, nominee, proxy, VPN or other arrangement for the purpose of circumventing the restrictions set out in this Section or Applicable Sanctions.
137
+
138
+ **5A.5.** Any breach of this Section is a material violation of this License and terminates your rights under it (Section 14). Veilio does not grant written permission for exceptions to this Section.
139
+
140
+ ---
141
+
117
142
  ## 6. Cloud Edition
118
143
 
119
144
  The Cloud Edition is the official commercial hosted offering of the project.
@@ -218,7 +243,7 @@ TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL THE AUTHORS
218
243
 
219
244
  ## 14. Termination
220
245
 
221
- Your rights under this License terminate automatically if you materially violate its terms.
246
+ Your rights under this License terminate automatically if you materially violate its terms. Any breach of Section 5A is a material violation.
222
247
 
223
248
  Upon termination, you must cease the activities that are prohibited by this License.
224
249
 
@@ -244,5 +269,5 @@ Each version will be identified by a version number. Unless explicitly stated ot
244
269
 
245
270
  **Project:** Veilio
246
271
  **Copyright:** © 2026 Veilio
247
- **License:** Veilio Community License, Version 1.0
272
+ **License:** Veilio Community License, Version 1.1
248
273
  **Contact:** `hello@veilio.dev`
package/README.md CHANGED
@@ -8,6 +8,8 @@ pbpaste | veilio restore # bring the answer back
8
8
  git diff --cached | veilio scan # refuse to commit a live key
9
9
  ```
10
10
 
11
+ Full guide - terminal, Cloud sign-in, and connecting AI assistants (Claude Code, Claude Desktop, Xcode, Cursor, VS Code): [docs/USING-THE-CLI-AND-MCP.md](../../docs/USING-THE-CLI-AND-MCP.md).
12
+
11
13
  ## Install
12
14
 
13
15
  ```bash
@@ -15,9 +17,11 @@ npm install -g @veilio-inc/cli # or run it without installing:
15
17
  npx @veilio-inc/cli scrub src/billing.ts
16
18
  ```
17
19
 
18
- Requires Node 24 or newer. No account, no API key, and no network call on any of
19
- the commands below — `packages/cli/tests/purity.test.ts` traps the network
20
- globals and fails if one is ever introduced.
20
+ Requires Node 24 or newer. No account, no API key, and no network call on
21
+ `scrub`, `restore`, `scan` or `map` — `packages/cli/tests/purity.test.ts` and
22
+ `offline.test.ts` walk the import graph and trap the network globals to keep it
23
+ that way. Signing in is entirely optional and adds nothing to those commands'
24
+ behavior; it only unlocks the four commands below that name Cloud explicitly.
21
25
 
22
26
  ## Commands
23
27
 
@@ -28,6 +32,41 @@ globals and fails if one is ever introduced.
28
32
  | `scan [files...]` | Detect credentials only. Never rewrites. Exits 1 on findings. |
29
33
  | `map` | Show the symbol map (`--clear` to wipe it). |
30
34
 
35
+ ## Cloud sync (Individual plan and above)
36
+
37
+ ```bash
38
+ veilio login # email, password, and the authentication code if 2FA is on
39
+ veilio whoami # who you're signed in as, no request made
40
+ veilio maps list # ids, scope and symbol counts for everything in Cloud
41
+ veilio maps pull <id> # decrypt locally, write second — never a partial write
42
+ veilio maps push <name> # upload the local map under a new Cloud name
43
+ veilio team unlock # open the team key with your vault passphrase (kept 7 days)
44
+ veilio team lock # remove the unlocked team key from this machine
45
+ veilio rules pull # fetch your custom rules; scrub then applies them offline
46
+ veilio logout # revokes server-side, then removes the local credential
47
+ ```
48
+
49
+ The session token lives in a single file under your home directory
50
+ (`~/.veilio/credential.json` on Linux/macOS, `%USERPROFILE%\.veilio\credential.json`
51
+ on Windows), created at mode `0600` and never written until the server has
52
+ accepted the sign-in. `0600` is the floor, not the final answer — the OS
53
+ keychain is a stronger option and a planned follow-up. A personal map is
54
+ zero-knowledge: pulling or pushing one prompts for the vault passphrase and
55
+ derives the key here, on your machine — the passphrase and the key never
56
+ leave it. A team map is sealed under the team key, which the server cannot
57
+ read either; `veilio team unlock` opens it here with your vault passphrase.
58
+
59
+ Custom rules (whitelist and replace, set in the web app) are applied by
60
+ `scrub` from a local copy that `veilio rules pull` writes to
61
+ `~/.veilio/rules.json` (`0600`). `scrub` never fetches them itself - it stays
62
+ offline - and says on every run how many rules it applied and how old the copy
63
+ is. Pull again after the rules change; `logout` removes the copy.
64
+
65
+ The map commands are clients of `GET /api/maps`, `GET /api/maps/:id` and
66
+ `POST /api/maps` — the exact same routes the browser uses, behind the exact
67
+ same entitlement check. There is no CLI-shaped API and nothing here can reach
68
+ a plan feature the web app couldn't.
69
+
31
70
  ## Options
32
71
 
33
72
  ```
package/dist/args.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type LanguageOption } from '@veilio-inc/engine';
2
2
  import type { SecretPolicy } from '@veilio-inc/engine';
3
- export type Command = 'scrub' | 'restore' | 'scan' | 'map' | 'help' | 'version';
3
+ export type Command = 'scrub' | 'restore' | 'scan' | 'map' | 'login' | 'logout' | 'whoami' | 'maps' | 'team' | 'rules' | 'help' | 'version';
4
4
  export interface ParsedArgs {
5
5
  command: Command;
6
6
  /** Positional file paths. Empty means read stdin (or, for `scan`, error). */
@@ -23,8 +23,42 @@ export interface ParsedArgs {
23
23
  keepDocs: boolean;
24
24
  /** Allow a map write that would drop entries already on disk. */
25
25
  force: boolean;
26
+ /**
27
+ * `maps` subcommand: list, pull or push. Null when `maps` was given alone.
28
+ *
29
+ * A subcommand rather than three top-level commands, because `map` (singular,
30
+ * the local store) already exists and `veilio push` next to `veilio map`
31
+ * reads like they are the same thing. `maps <verb>` keeps the cloud surface
32
+ * visibly separate from the offline one.
33
+ */
34
+ mapsAction: 'list' | 'pull' | 'push' | null;
35
+ /**
36
+ * `team unlock` / `team lock`.
37
+ *
38
+ * A subcommand for the same reason `maps` is one: `veilio unlock` alone would
39
+ * not say what it unlocks, and what it unlocks is specifically the team's
40
+ * keys rather than the account or the local store.
41
+ */
42
+ teamAction: 'unlock' | 'lock' | null;
43
+ /** `rules pull`. */
44
+ rulesAction: 'pull' | null;
45
+ /**
46
+ * Base URL of the Veilio instance to sign in to. Null means the public Cloud.
47
+ *
48
+ * Only meaningful to `login`: once signed in, the instance is read back from
49
+ * the stored credential, so a later command cannot be pointed at a different
50
+ * host while still holding the first one's token.
51
+ */
52
+ instance: string | null;
26
53
  }
27
54
  export declare class UsageError extends Error {
28
55
  }
56
+ /**
57
+ * The commands that reach the network. Named here so the split is one list
58
+ * rather than a condition repeated at each call site — and so that adding a
59
+ * command without deciding which side of the line it falls on is a compile
60
+ * error rather than an accident.
61
+ */
62
+ export declare const CLOUD_COMMANDS: Set<Command>;
29
63
  export declare function parseArgs(argv: readonly string[]): ParsedArgs;
30
64
  //# sourceMappingURL=args.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEtD,MAAM,MAAM,OAAO,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAAA;AAE/E,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,6EAA6E;IAC7E,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,cAAc,CAAA;IACxB,OAAO,EAAE,YAAY,CAAA;IACrB,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAA;IACjB,uCAAuC;IACvC,OAAO,EAAE,MAAM,GAAG,IAAI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iEAAiE;IACjE,KAAK,EAAE,OAAO,CAAA;IACd;;;;;;;OAOG;IACH,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;IAE3C;;;;;;OAMG;IACH,UAAU,EAAE,QAAQ,GAAG,MAAM,GAAG,IAAI,CAAA;IACpC,oBAAoB;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAE1B;;;;;;OAMG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB;AAED,qBAAa,UAAW,SAAQ,KAAK;CAAG;AAiBxC;;;;;GAKG;AACH,eAAO,MAAM,cAAc,cAOzB,CAAA;AAWF,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CA0J7D"}
package/dist/args.js CHANGED
@@ -4,7 +4,34 @@
4
4
  import { LANGUAGES } from '@veilio-inc/engine';
5
5
  export class UsageError extends Error {
6
6
  }
7
- const COMMANDS = new Set(['scrub', 'restore', 'scan', 'map', 'help', 'version']);
7
+ const COMMANDS = new Set([
8
+ 'scrub',
9
+ 'restore',
10
+ 'scan',
11
+ 'map',
12
+ 'login',
13
+ 'logout',
14
+ 'whoami',
15
+ 'maps',
16
+ 'team',
17
+ 'rules',
18
+ 'help',
19
+ 'version',
20
+ ]);
21
+ /**
22
+ * The commands that reach the network. Named here so the split is one list
23
+ * rather than a condition repeated at each call site — and so that adding a
24
+ * command without deciding which side of the line it falls on is a compile
25
+ * error rather than an accident.
26
+ */
27
+ export const CLOUD_COMMANDS = new Set([
28
+ 'login',
29
+ 'logout',
30
+ 'whoami',
31
+ 'maps',
32
+ 'team',
33
+ 'rules',
34
+ ]);
8
35
  const SECRET_POLICIES = new Set(['redact', 'warn', 'off']);
9
36
  const LANGUAGE_VALUES = new Set([...LANGUAGES, 'auto']);
10
37
  function requireValue(flag, value) {
@@ -27,6 +54,10 @@ export function parseArgs(argv) {
27
54
  strict: false,
28
55
  keepDocs: false,
29
56
  force: false,
57
+ instance: null,
58
+ mapsAction: null,
59
+ teamAction: null,
60
+ rulesAction: null,
30
61
  };
31
62
  if (argv.length === 0)
32
63
  return parsed;
@@ -38,6 +69,38 @@ export function parseArgs(argv) {
38
69
  }
39
70
  parsed.command = first;
40
71
  i = 1;
72
+ // `maps` takes a verb. Read here rather than as a positional later, so that
73
+ // `veilio maps pull abc` does not treat `pull` as a file to anonymize.
74
+ if (parsed.command === 'maps') {
75
+ const verb = argv[1];
76
+ if (verb !== undefined && !verb.startsWith('-')) {
77
+ if (verb !== 'list' && verb !== 'pull' && verb !== 'push') {
78
+ throw new UsageError(`unknown maps action "${verb}" — expected list, pull or push`);
79
+ }
80
+ parsed.mapsAction = verb;
81
+ i = 2;
82
+ }
83
+ }
84
+ if (parsed.command === 'team') {
85
+ const verb = argv[1];
86
+ if (verb !== undefined && !verb.startsWith('-')) {
87
+ if (verb !== 'unlock' && verb !== 'lock') {
88
+ throw new UsageError(`unknown team action "${verb}" — expected unlock or lock`);
89
+ }
90
+ parsed.teamAction = verb;
91
+ i = 2;
92
+ }
93
+ }
94
+ if (parsed.command === 'rules') {
95
+ const verb = argv[1];
96
+ if (verb !== undefined && !verb.startsWith('-')) {
97
+ if (verb !== 'pull') {
98
+ throw new UsageError(`unknown rules action "${verb}" — expected pull`);
99
+ }
100
+ parsed.rulesAction = verb;
101
+ i = 2;
102
+ }
103
+ }
41
104
  }
42
105
  for (; i < argv.length; i++) {
43
106
  const arg = argv[i];
@@ -96,6 +159,24 @@ export function parseArgs(argv) {
96
159
  case '--force':
97
160
  parsed.force = true;
98
161
  break;
162
+ case '--instance': {
163
+ const value = requireValue(arg, argv[++i]);
164
+ // Parsed here rather than at use, so a typo is a usage error before any
165
+ // password is typed rather than a confusing failure after.
166
+ let url;
167
+ try {
168
+ url = new URL(value);
169
+ }
170
+ catch {
171
+ throw new UsageError(`--instance must be a URL (got "${value}")`);
172
+ }
173
+ if (url.protocol !== 'https:' && url.hostname !== 'localhost') {
174
+ throw new UsageError(`--instance must be https (got "${value}") — a password and a session token over ` +
175
+ 'plain http are readable by anything on the path. localhost is allowed for development.');
176
+ }
177
+ parsed.instance = value;
178
+ break;
179
+ }
99
180
  default:
100
181
  if (arg.startsWith('-') && arg !== '-') {
101
182
  throw new UsageError(`unknown flag "${arg}"`);
package/dist/args.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,2EAA2E;AAC3E,8DAA8D;AAE9D,OAAO,EAAE,SAAS,EAAsC,MAAM,oBAAoB,CAAA;AA6BlF,MAAM,OAAO,UAAW,SAAQ,KAAK;CAAG;AAExC,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAU,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC,CAAA;AACzF,MAAM,eAAe,GAAG,IAAI,GAAG,CAAe,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;AACxE,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS,CAAC,GAAG,SAAS,EAAE,MAAM,CAAC,CAAC,CAAA;AAE/D,SAAS,YAAY,CAAC,IAAY,EAAE,KAAyB;IAC3D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACjD,MAAM,IAAI,UAAU,CAAC,GAAG,IAAI,mBAAmB,CAAC,CAAA;IAClD,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC/C,MAAM,MAAM,GAAe;QACzB,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,MAAM;QAChB,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,KA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AC,GAAG,CAAC,CAAA;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { type Io } from './commands.js';
2
+ /**
3
+ * Sign in, and store the credential only if the account can actually use it.
4
+ *
5
+ * Two requests, and the second one is the interesting one.
6
+ *
7
+ * `POST /api/auth/login` answers "is this the right password". It does NOT
8
+ * answer "does this plan include the terminal" — a free account signs in
9
+ * perfectly well, because signing in is how you reach the billing page. So a
10
+ * CLI that stopped after the first request would store a credential for an
11
+ * account that gets refused by every command that follows, and would report
12
+ * that refusal as though the sign-in had worked.
13
+ *
14
+ * The obvious shortcut is to read `user.plan` out of the login response and
15
+ * decide locally. That is exactly what FR-009 forbids: entitlement is the
16
+ * server's answer on each request, never the client's reading of a plan name.
17
+ * A copy of the rule shipped to other people's laptops is a second definition of
18
+ * it, and the one that goes stale first.
19
+ *
20
+ * So the second request asks the server a real question and lets it refuse. Only
21
+ * then is anything written — validate, then persist (Constitution IV). A
22
+ * credential written first and validated after leaves a file behind for an
23
+ * attempt that failed, and everything looks signed in until the first command
24
+ * that isn't.
25
+ */
26
+ export declare function runLogin(instance: string | null, io: Io): Promise<number>;
27
+ /**
28
+ * Sign out: revoke server-side, THEN remove the file.
29
+ *
30
+ * The order is the control. Removing the file first makes `logout` always look
31
+ * like it worked, while leaving a live session on the server that the user has
32
+ * been told is gone — and nothing anywhere reports that. So a failed revocation
33
+ * keeps the credential and says so, which is the loud failure rather than the
34
+ * quiet one (Constitution V).
35
+ */
36
+ export declare function runLogout(io: Io): Promise<number>;
37
+ /**
38
+ * Who is signed in, answered from disk.
39
+ *
40
+ * Makes no request, on purpose. Its job is "am I signed in", not "is Cloud up" —
41
+ * an answer that needs the network is useless at exactly the moment somebody is
42
+ * trying to work out why the network isn't working.
43
+ */
44
+ export declare function runWhoami(io: Io): number;
45
+ /**
46
+ * List what the account holds.
47
+ *
48
+ * Prints the id, because `pull` takes one. A name would be friendlier and is
49
+ * wrong: names are not unique, and picking "the first one that matches" is how
50
+ * somebody pulls a different map over the one they were using.
51
+ */
52
+ export declare function runMapsList(io: Io): Promise<number>;
53
+ /**
54
+ * Pull a map into the local store: decrypt FIRST, write second.
55
+ *
56
+ * The ordering is the control (Constitution IV). Writing before decrypting means
57
+ * a wrong passphrase leaves a half-built store behind — and the store is the one
58
+ * thing that can restore text already anonymized, so a partial write there is
59
+ * not an inconvenience, it is unrecoverable text.
60
+ *
61
+ * A personal map is opened HERE. The server holds the salt and a verifier and
62
+ * nothing else; the passphrase never leaves this machine, and there is no code
63
+ * path in this package that could send it.
64
+ */
65
+ export declare function runMapsPull(id: string | null, mapPath: string, io: Io, options?: {
66
+ force?: boolean;
67
+ }): Promise<number>;
68
+ /** Upload the local map. Same endpoint, same quotas, same validation. */
69
+ export declare function runMapsPush(name: string | null, mapPath: string, io: Io): Promise<number>;
70
+ /**
71
+ * Fetch the account's custom rules so `veilio scrub` can apply them offline.
72
+ *
73
+ * Merged here, in the web app's order, so every later scrub applies exactly
74
+ * what the browser would. A plan without custom rules REMOVES any cache left
75
+ * from before: rules the account can no longer use must not go on shaping
76
+ * its output. Any other failure keeps the cache and says so.
77
+ */
78
+ export declare function runRulesPull(io: Io): Promise<number>;
79
+ /**
80
+ * Unlock this team's keys for processes that cannot ask for a passphrase.
81
+ *
82
+ * The MCP server starts inside a coding agent with no terminal attached, so the
83
+ * keys it needs have to be put on disk by a run like this one, where a person
84
+ * is present to type the passphrase. See `team-unlock.ts` for what is stored
85
+ * and why it is the team key rather than the vault key.
86
+ */
87
+ export declare function runTeamUnlock(io: Io, days?: number): Promise<number>;
88
+ /** Remove the unlocked team keys. */
89
+ export declare function runTeamLock(io: Io): number;
90
+ //# sourceMappingURL=cloud-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-commands.d.ts","sourceRoot":"","sources":["../src/cloud-commands.ts"],"names":[],"mappings":"AAkDA,OAAO,EAAuB,KAAK,EAAE,EAAE,MAAM,eA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