@veilio-inc/cli 0.5.0 → 0.5.2
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 +51 -11
- package/dist/args.d.ts +19 -1
- package/dist/args.d.ts.map +1 -1
- package/dist/args.js +10 -2
- package/dist/args.js.map +1 -1
- package/dist/cloud-commands.d.ts +46 -10
- package/dist/cloud-commands.d.ts.map +1 -1
- package/dist/cloud-commands.js +330 -6
- package/dist/cloud-commands.js.map +1 -1
- package/dist/cloud.d.ts +69 -1
- package/dist/cloud.d.ts.map +1 -1
- package/dist/cloud.js +61 -0
- package/dist/cloud.js.map +1 -1
- package/dist/commands.d.ts +13 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +105 -17
- package/dist/commands.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -10
- package/dist/index.js.map +1 -1
- package/dist/team-anonymize.d.ts +59 -0
- package/dist/team-anonymize.d.ts.map +1 -1
- package/dist/team-anonymize.js +143 -2
- package/dist/team-anonymize.js.map +1 -1
- package/dist/team-namespace.d.ts +9 -0
- package/dist/team-namespace.d.ts.map +1 -1
- package/dist/team-namespace.js +7 -1
- package/dist/team-namespace.js.map +1 -1
- package/dist/third-party.d.ts +25 -0
- package/dist/third-party.d.ts.map +1 -0
- package/dist/third-party.js +113 -0
- package/dist/third-party.js.map +1 -0
- package/dist/version.d.ts +15 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +16 -0
- package/dist/version.js.map +1 -0
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -27,21 +27,24 @@ signed-in `scrub` offline, `veilio logout` first.
|
|
|
27
27
|
|
|
28
28
|
## Commands
|
|
29
29
|
|
|
30
|
-
| Command | Purpose
|
|
31
|
-
| -------------------- |
|
|
32
|
-
| `scrub [files...]` | Mask identifiers, redact credentials. Reads stdin when given no file.
|
|
30
|
+
| Command | Purpose |
|
|
31
|
+
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
32
|
+
| `scrub [files...]` | Mask identifiers, redact credentials. Reads stdin when given no file. |
|
|
33
33
|
| `restore [files...]` | Swap placeholders back, strip AI-generated noise. Signed in, also a teammate's placeholders — see below. Names anything it could not restore; `--strict` writes nothing if a placeholder would be left. |
|
|
34
|
-
| `scan [files...]` | Detect credentials only. Never rewrites. Exits 1 on findings.
|
|
35
|
-
| `map` | Show the symbol map (`--clear` to wipe it).
|
|
34
|
+
| `scan [files...]` | Detect credentials only. Never rewrites. Exits 1 on findings. |
|
|
35
|
+
| `map` | Show the symbol map (`--clear` to wipe it). |
|
|
36
36
|
|
|
37
37
|
## Cloud sync (Individual plan and above)
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
40
|
veilio login # email, password, and the authentication code if 2FA is on
|
|
41
|
+
veilio login --device # approve in a browser instead; no password typed here
|
|
41
42
|
veilio whoami # who you're signed in as, no request made
|
|
42
43
|
veilio maps list # ids, scope and symbol counts for everything in Cloud
|
|
43
44
|
veilio maps pull <id> # decrypt locally, write second — never a partial write
|
|
44
45
|
veilio maps push [name] # upload the local map under a new Cloud name
|
|
46
|
+
veilio maps push --team [name] # publish it as the team's shared map instead
|
|
47
|
+
veilio maps rm <id> # remove a map from Cloud
|
|
45
48
|
veilio team unlock # open the team key with your vault passphrase (kept 7 days)
|
|
46
49
|
veilio team lock # remove the unlocked team key from this machine
|
|
47
50
|
veilio rules pull # fetch your custom rules; scrub then applies them offline
|
|
@@ -58,6 +61,17 @@ derives the key here, on your machine — the passphrase and the key never
|
|
|
58
61
|
leave it. A team map is sealed under the team key, which the server cannot
|
|
59
62
|
read either; `veilio team unlock` opens it here with your vault passphrase.
|
|
60
63
|
|
|
64
|
+
**Creating and removing a shared map are here; replacing one is not.** There is
|
|
65
|
+
no `maps update --team`, and that is a decision rather than a gap. Replacing the
|
|
66
|
+
contents of a map teammates already rely on changes what their placeholders
|
|
67
|
+
mean after they have sent text using them — the old meaning is what their
|
|
68
|
+
`restore` still needs, and nothing in a shared map records which version a given
|
|
69
|
+
piece of text was masked under. Publish a new map and remove the old one when
|
|
70
|
+
you are sure nobody is still restoring against it. Cloud does have a route that
|
|
71
|
+
rewrites a team map's contents, used by key rotation to re-seal the same pairs
|
|
72
|
+
under a new key; it exists for that one purpose and does not change what any
|
|
73
|
+
placeholder means.
|
|
74
|
+
|
|
61
75
|
Custom rules (whitelist and replace, set in the web app) are applied by
|
|
62
76
|
`scrub` from a local copy that `veilio rules pull` writes to
|
|
63
77
|
`~/.veilio/rules.json` (`0600`). `scrub` never fetches them itself - it stays
|
|
@@ -90,7 +104,7 @@ against the team's maps, so a reply pasted from a teammate's agent comes back
|
|
|
90
104
|
with the real names:
|
|
91
105
|
|
|
92
106
|
- **A disputed placeholder is left, not guessed.** Where this project's store
|
|
93
|
-
and the team use the same placeholder for
|
|
107
|
+
and the team use the same placeholder for _different_ identifiers, neither
|
|
94
108
|
wins and the placeholder stays in the output with a line naming it. Same for
|
|
95
109
|
one this project numbered on its own while the team was out of reach — a
|
|
96
110
|
wrong name restored silently is worse than a placeholder left visibly.
|
|
@@ -120,6 +134,12 @@ a plan feature the web app couldn't.
|
|
|
120
134
|
nothing and exit 1 if a placeholder would be left
|
|
121
135
|
--keep-docs restore: keep JSDoc blocks the model wrote
|
|
122
136
|
-f, --force Allow a map write that would drop existing entries
|
|
137
|
+
--device login: sign in through a browser instead of typing a
|
|
138
|
+
password here. Required for an SSO-bound account, and
|
|
139
|
+
used automatically when the instance asks for a CAPTCHA
|
|
140
|
+
--team scrub: number new placeholders out of the team's
|
|
141
|
+
shared allocation, for a map you intend to publish.
|
|
142
|
+
maps push: publish as the team's shared map
|
|
123
143
|
-q, --quiet Suppress the all-clear summary (findings always show)
|
|
124
144
|
--instance <url> login: the Veilio instance to sign in to. Defaults to
|
|
125
145
|
the public Cloud; https required (localhost excepted)
|
|
@@ -135,7 +155,7 @@ text, placeholders and all, names each one on stderr and exits 0. A credential
|
|
|
135
155
|
redacted on purpose is not a placeholder and never fails it.
|
|
136
156
|
|
|
137
157
|
`--keep-docs` is worth knowing about: the default strip removes JSDoc along with
|
|
138
|
-
the narration and TODOs, which is wrong when the model was
|
|
158
|
+
the narration and TODOs, which is wrong when the model was _asked_ to document
|
|
139
159
|
its output. `--quiet` suppresses the all-clear only — a finding still prints,
|
|
140
160
|
because the text on stdout is what you are about to paste somewhere.
|
|
141
161
|
|
|
@@ -143,13 +163,33 @@ because the text on stdout is what you are about to paste somewhere.
|
|
|
143
163
|
|
|
144
164
|
Transformed code goes to **stdout**; summaries, warnings and errors go to **stderr**. That split is what makes the CLI composable — the summary stays visible without corrupting the pipe.
|
|
145
165
|
|
|
166
|
+
### On Windows
|
|
167
|
+
|
|
168
|
+
`pbcopy` and `pbpaste` are macOS. In PowerShell, first make pipes UTF-8 in both
|
|
169
|
+
directions for the session (or put the line in your `$PROFILE`):
|
|
170
|
+
|
|
171
|
+
```powershell
|
|
172
|
+
$OutputEncoding = [Console]::OutputEncoding = [Text.UTF8Encoding]::new()
|
|
173
|
+
veilio scrub src\billing.ts | Set-Clipboard
|
|
174
|
+
Get-Clipboard -Raw | veilio restore
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Without that line, how a pipe treats non-ASCII text depends on the PowerShell
|
|
178
|
+
version and the console's code page: Windows PowerShell 5.1 sends text piped
|
|
179
|
+
into Veilio as ASCII, so `Get-Content file | veilio scrub` turns every `ż` into
|
|
180
|
+
`?` before Veilio sees it, and restore cannot bring it back. Text piped out of
|
|
181
|
+
Veilio is read with the console's code page, which may not be UTF-8. Passing
|
|
182
|
+
files as arguments (`veilio scrub file`, `veilio restore answer.txt`) avoids
|
|
183
|
+
the first problem; the line above avoids both. In 5.1, `>` also writes UTF-16,
|
|
184
|
+
so write files from PowerShell 7 (`pwsh`).
|
|
185
|
+
|
|
146
186
|
## Exit codes
|
|
147
187
|
|
|
148
|
-
| Code | Meaning
|
|
149
|
-
| ---- |
|
|
150
|
-
| 0 | Clean
|
|
188
|
+
| Code | Meaning |
|
|
189
|
+
| ---- | ------------------------------------------------------------------------------------------------------------------ |
|
|
190
|
+
| 0 | Clean |
|
|
151
191
|
| 1 | Findings that should stop the pipeline: a credential (`scan`), or a placeholder `restore --strict` would have left |
|
|
152
|
-
| 2 | Usage or IO error
|
|
192
|
+
| 2 | Usage or IO error |
|
|
153
193
|
|
|
154
194
|
As a pre-commit hook:
|
|
155
195
|
|
package/dist/args.d.ts
CHANGED
|
@@ -23,6 +23,24 @@ 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
|
+
* `login --device`: sign in through a browser instead of typing a password.
|
|
28
|
+
*
|
|
29
|
+
* The right choice for an account bound by a team's SSO requirement: a
|
|
30
|
+
* password typed here is accepted by the login route and then refused by
|
|
31
|
+
* every later request, which reads as a broken tool rather than as the wrong
|
|
32
|
+
* way in. Automatic anyway when the instance requires a CAPTCHA.
|
|
33
|
+
*/
|
|
34
|
+
device: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* `maps push --team`: publish to the team instead of to this account.
|
|
37
|
+
*
|
|
38
|
+
* A flag rather than a separate verb because it is the same act with a
|
|
39
|
+
* different audience, and because `maps push` already means "upload the
|
|
40
|
+
* local map" — a `maps publish` beside it would read as a different
|
|
41
|
+
* operation on a different thing.
|
|
42
|
+
*/
|
|
43
|
+
team: boolean;
|
|
26
44
|
/**
|
|
27
45
|
* `maps` subcommand: list, pull or push. Null when `maps` was given alone.
|
|
28
46
|
*
|
|
@@ -31,7 +49,7 @@ export interface ParsedArgs {
|
|
|
31
49
|
* reads like they are the same thing. `maps <verb>` keeps the cloud surface
|
|
32
50
|
* visibly separate from the offline one.
|
|
33
51
|
*/
|
|
34
|
-
mapsAction: 'list' | 'pull' | 'push' | null;
|
|
52
|
+
mapsAction: 'list' | 'pull' | 'push' | 'rm' | null;
|
|
35
53
|
/**
|
|
36
54
|
* `team unlock` / `team lock`.
|
|
37
55
|
*
|
package/dist/args.d.ts.map
CHANGED
|
@@ -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,GACf,OAAO,GACP,SAAS,GACT,MAAM,GACN,KAAK,GACL,OAAO,GACP,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,SAAS,CAAA;AAEb,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,CAAA;IACtB,sCAAsC;IACtC,IAAI,EAAE,OAAO,CAAA;IACb,qDAAqD;IACrD,KAAK,EAAE,OAAO,CAAA;IACd,qCAAqC;IACrC,KAAK,EAAE,OAAO,CAAA;IACd,6DAA6D;IAC7D,MAAM,EAAE,OAAO,CAAA;IACf,wCAAwC;IACxC,QAAQ,EAAE,OAAO,CAAA;IACjB,iEAAiE;IACjE,KAAK,EAAE,OAAO,CAAA;IACd;;;;;;;OAOG;IACH,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAA;
|
|
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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C,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,CAkK7D"}
|
package/dist/args.js
CHANGED
|
@@ -54,6 +54,8 @@ export function parseArgs(argv) {
|
|
|
54
54
|
strict: false,
|
|
55
55
|
keepDocs: false,
|
|
56
56
|
force: false,
|
|
57
|
+
team: false,
|
|
58
|
+
device: false,
|
|
57
59
|
instance: null,
|
|
58
60
|
mapsAction: null,
|
|
59
61
|
teamAction: null,
|
|
@@ -74,8 +76,8 @@ export function parseArgs(argv) {
|
|
|
74
76
|
if (parsed.command === 'maps') {
|
|
75
77
|
const verb = argv[1];
|
|
76
78
|
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
|
|
79
|
+
if (verb !== 'list' && verb !== 'pull' && verb !== 'push' && verb !== 'rm') {
|
|
80
|
+
throw new UsageError(`unknown maps action "${verb}" — expected list, pull, push or rm`);
|
|
79
81
|
}
|
|
80
82
|
parsed.mapsAction = verb;
|
|
81
83
|
i = 2;
|
|
@@ -156,6 +158,12 @@ export function parseArgs(argv) {
|
|
|
156
158
|
parsed.keepDocs = true;
|
|
157
159
|
break;
|
|
158
160
|
case '-f':
|
|
161
|
+
case '--team':
|
|
162
|
+
parsed.team = true;
|
|
163
|
+
break;
|
|
164
|
+
case '--device':
|
|
165
|
+
parsed.device = true;
|
|
166
|
+
break;
|
|
159
167
|
case '--force':
|
|
160
168
|
parsed.force = true;
|
|
161
169
|
break;
|
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;
|
|
1
|
+
{"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],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AACf,CAAC"}
|
package/dist/cloud-commands.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TeamLayer } from '@veilio-inc/engine';
|
|
2
|
-
import { type Io } from './commands.js';
|
|
2
|
+
import { type Io, type TeamNamespaceSource } from './commands.js';
|
|
3
3
|
/**
|
|
4
4
|
* Sign in, and store the credential only if the account can actually use it.
|
|
5
5
|
*
|
|
@@ -24,7 +24,19 @@ import { type Io } from './commands.js';
|
|
|
24
24
|
* attempt that failed, and everything looks signed in until the first command
|
|
25
25
|
* that isn't.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Sign in by asking a browser to do it (spec 046).
|
|
29
|
+
*
|
|
30
|
+
* The terminal shows a short code; a person approves it in a browser session
|
|
31
|
+
* that has already satisfied whatever that account requires - a CAPTCHA, a
|
|
32
|
+
* second factor, an identity provider - and the terminal exchanges a long code
|
|
33
|
+
* for an ordinary session. Nothing about the account is typed here, so there is
|
|
34
|
+
* nothing here for a CAPTCHA to protect.
|
|
35
|
+
*/
|
|
36
|
+
export declare function runDeviceLogin(base: string, io: Io): Promise<number>;
|
|
37
|
+
export declare function runLogin(instance: string | null, io: Io, opts?: {
|
|
38
|
+
device?: boolean;
|
|
39
|
+
}): Promise<number>;
|
|
28
40
|
/**
|
|
29
41
|
* Sign out: revoke server-side, THEN remove the file.
|
|
30
42
|
*
|
|
@@ -66,8 +78,29 @@ export declare function runMapsList(io: Io): Promise<number>;
|
|
|
66
78
|
export declare function runMapsPull(id: string | null, mapPath: string, io: Io, options?: {
|
|
67
79
|
force?: boolean;
|
|
68
80
|
}): Promise<number>;
|
|
81
|
+
/**
|
|
82
|
+
* Placeholders the local map and the team's namespace use for DIFFERENT names.
|
|
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.
|
|
96
|
+
*/
|
|
97
|
+
export declare function conflictsWithTeam(local: Record<string, string>, teamNamespace: Record<string, string>): {
|
|
98
|
+
placeholder: string;
|
|
99
|
+
mine: string;
|
|
100
|
+
theirs: string;
|
|
101
|
+
}[];
|
|
69
102
|
/** Upload the local map. Same endpoint, same quotas, same validation. */
|
|
70
|
-
export declare function runMapsPush(name: string | null, mapPath: string, io: Io): Promise<number>;
|
|
103
|
+
export declare function runMapsPush(name: string | null, mapPath: string, io: Io, toTeam?: boolean): Promise<number>;
|
|
71
104
|
/**
|
|
72
105
|
* Fetch the account's custom rules so `veilio scrub` can apply them offline.
|
|
73
106
|
*
|
|
@@ -99,11 +132,14 @@ export declare function teamLayerFor(home: string | undefined, missing: readonly
|
|
|
99
132
|
}>;
|
|
100
133
|
/** What `veilio scrub` numbers from (spec 030): the team's namespace, or this
|
|
101
134
|
* project's map with the reason. Signed out or in no team: no request, no note. */
|
|
102
|
-
export declare function teamNamespaceForScrub(home: string | undefined): Promise<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
135
|
+
export declare function teamNamespaceForScrub(home: string | undefined): Promise<Awaited<ReturnType<TeamNamespaceSource>>>;
|
|
136
|
+
/**
|
|
137
|
+
* Remove a map from Cloud.
|
|
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>;
|
|
109
145
|
//# 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":"AA2BA,OAAO,EAgBL,KAAK,SAAS,EACf,MAAM,oBAAoB,CAAA;AAa3B,OAAO,EAAuB,KAAK,EAAE,EAAE,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAetF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;;;;;;;;GAQG;AACH,wBAAsB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAoE1E;AAsBD,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,CAgFvD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,MAAM,CAQxC;AAyDD;;;;;;GAMG;AACH,wBAAsB,WAAW,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAqBzD;AA+CD;;;;;;;;;;;GAWG;AACH,wBAAsB,WAAW,CAC/B,EAAE,EAAE,MAAM,GAAG,IAAI,EACjB,OAAO,EAAE,MAAM,EACf,EAAE,E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