@prism-d1/cli 1.10.1 → 1.11.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.
Files changed (73) hide show
  1. package/dist/assets/kirocrew-app/skills/prism-fix-findings/SKILL.md +19 -12
  2. package/dist/src/codewatch/config.d.ts +33 -0
  3. package/dist/src/codewatch/config.d.ts.map +1 -1
  4. package/dist/src/codewatch/config.js +83 -0
  5. package/dist/src/codewatch/config.js.map +1 -1
  6. package/dist/src/codewatch/gitleaks.d.ts +67 -0
  7. package/dist/src/codewatch/gitleaks.d.ts.map +1 -1
  8. package/dist/src/codewatch/gitleaks.js +158 -2
  9. package/dist/src/codewatch/gitleaks.js.map +1 -1
  10. package/dist/src/codewatch/harness/claude.d.ts +83 -0
  11. package/dist/src/codewatch/harness/claude.d.ts.map +1 -0
  12. package/dist/src/codewatch/harness/claude.js +429 -0
  13. package/dist/src/codewatch/harness/claude.js.map +1 -0
  14. package/dist/src/codewatch/harness/diff.d.ts +51 -0
  15. package/dist/src/codewatch/harness/diff.d.ts.map +1 -0
  16. package/dist/src/codewatch/harness/diff.js +227 -0
  17. package/dist/src/codewatch/harness/diff.js.map +1 -0
  18. package/dist/src/codewatch/harness/engine.d.ts +127 -0
  19. package/dist/src/codewatch/harness/engine.d.ts.map +1 -0
  20. package/dist/src/codewatch/harness/engine.js +683 -0
  21. package/dist/src/codewatch/harness/engine.js.map +1 -0
  22. package/dist/src/codewatch/harness/state.d.ts +48 -0
  23. package/dist/src/codewatch/harness/state.d.ts.map +1 -0
  24. package/dist/src/codewatch/harness/state.js +168 -0
  25. package/dist/src/codewatch/harness/state.js.map +1 -0
  26. package/dist/src/codewatch/prepush.d.ts +4 -1
  27. package/dist/src/codewatch/prepush.d.ts.map +1 -1
  28. package/dist/src/codewatch/prepush.js +19 -23
  29. package/dist/src/codewatch/prepush.js.map +1 -1
  30. package/dist/src/codewatch/pushbase.d.ts +19 -0
  31. package/dist/src/codewatch/pushbase.d.ts.map +1 -0
  32. package/dist/src/codewatch/pushbase.js +82 -0
  33. package/dist/src/codewatch/pushbase.js.map +1 -0
  34. package/dist/src/codewatch/results.d.ts +32 -3
  35. package/dist/src/codewatch/results.d.ts.map +1 -1
  36. package/dist/src/codewatch/results.js +6 -2
  37. package/dist/src/codewatch/results.js.map +1 -1
  38. package/dist/src/codewatch/reviewers/claude.d.ts.map +1 -1
  39. package/dist/src/codewatch/reviewers/claude.js +4 -2
  40. package/dist/src/codewatch/reviewers/claude.js.map +1 -1
  41. package/dist/src/codewatch/reviewers/index.d.ts +3 -1
  42. package/dist/src/codewatch/reviewers/index.d.ts.map +1 -1
  43. package/dist/src/codewatch/reviewers/index.js +4 -2
  44. package/dist/src/codewatch/reviewers/index.js.map +1 -1
  45. package/dist/src/codewatch/reviewers/kiro.d.ts.map +1 -1
  46. package/dist/src/codewatch/reviewers/kiro.js +2 -1
  47. package/dist/src/codewatch/reviewers/kiro.js.map +1 -1
  48. package/dist/src/codewatch/reviewers/types.d.ts +4 -0
  49. package/dist/src/codewatch/reviewers/types.d.ts.map +1 -1
  50. package/dist/src/codewatch/reviewers/types.js.map +1 -1
  51. package/dist/src/codewatch/rules.d.ts +13 -0
  52. package/dist/src/codewatch/rules.d.ts.map +1 -1
  53. package/dist/src/codewatch/rules.js +20 -1
  54. package/dist/src/codewatch/rules.js.map +1 -1
  55. package/dist/src/commands/_top/mcp.js +1 -1
  56. package/dist/src/commands/_top/mcp.js.map +1 -1
  57. package/dist/src/commands/codewatch/hook.d.ts +17 -0
  58. package/dist/src/commands/codewatch/hook.d.ts.map +1 -0
  59. package/dist/src/commands/codewatch/hook.js +46 -0
  60. package/dist/src/commands/codewatch/hook.js.map +1 -0
  61. package/dist/src/commands/codewatch/review.d.ts +25 -0
  62. package/dist/src/commands/codewatch/review.d.ts.map +1 -0
  63. package/dist/src/commands/codewatch/review.js +80 -0
  64. package/dist/src/commands/codewatch/review.js.map +1 -0
  65. package/dist/src/index.js +1 -1
  66. package/dist/src/index.js.map +1 -1
  67. package/dist/src/mcp/server.js +2 -2
  68. package/dist/src/mcp/server.js.map +1 -1
  69. package/dist/src/mcp/tools.d.ts +9 -1
  70. package/dist/src/mcp/tools.d.ts.map +1 -1
  71. package/dist/src/mcp/tools.js +48 -0
  72. package/dist/src/mcp/tools.js.map +1 -1
  73. package/package.json +1 -1
@@ -0,0 +1,227 @@
1
+ /**
2
+ * Git plumbing for the harness loop: working-tree snapshots, tree-to-tree
3
+ * diffs, and a small unified-diff parser.
4
+ *
5
+ * A snapshot is `git add -A` into a COPY of the index followed by
6
+ * `git write-tree`, so the user's index, stash and working tree are never
7
+ * touched (docs/DESIGN-harness-loop.md section 4.1). It writes blob and tree
8
+ * objects only; nothing references them, so `git gc` prunes them later.
9
+ */
10
+ import { spawnSync } from 'node:child_process';
11
+ import { copyFileSync, existsSync, mkdtempSync, rmSync } from 'node:fs';
12
+ import { tmpdir } from 'node:os';
13
+ import { join } from 'node:path';
14
+ import { DIFF_EXCLUDES } from '../prepush.js';
15
+ import { RESULTS_DIR } from '../results.js';
16
+ export const HARNESS_DIR = '.prism/harness';
17
+ /** PRISM's own local output never counts as a change. */
18
+ const OWN_OUTPUT = [`:(exclude,glob)${RESULTS_DIR}/**`, `:(exclude,glob)${HARNESS_DIR}/**`];
19
+ const GIT_HOOK_ENV = ['GIT_DIR', 'GIT_INDEX_FILE', 'GIT_WORK_TREE', 'GIT_PREFIX', 'GIT_OBJECT_DIRECTORY', 'GIT_ALTERNATE_OBJECT_DIRECTORIES'];
20
+ const MAX_BUFFER = 256 * 1024 * 1024;
21
+ export function gitIn(repoRoot, args, extraEnv = {}, input) {
22
+ const env = { ...process.env };
23
+ for (const k of GIT_HOOK_ENV)
24
+ delete env[k];
25
+ Object.assign(env, extraEnv);
26
+ const r = spawnSync('git', ['-C', repoRoot, ...args], { encoding: 'utf8', env, input, maxBuffer: MAX_BUFFER, stdio: ['pipe', 'pipe', 'pipe'] });
27
+ return { ok: r.status === 0 && !r.error, stdout: (r.stdout || '').replace(/\n$/, ''), stderr: r.stderr || '' };
28
+ }
29
+ /**
30
+ * Tree object of the whole working tree (tracked plus untracked, honoring
31
+ * .gitignore), or null. A partial snapshot (a file git could not read) still
32
+ * returns a tree and says what was left out in `warnings`.
33
+ */
34
+ export function snapshotTree(repoRoot, warnings = []) {
35
+ const idx = gitIn(repoRoot, ['rev-parse', '--path-format=absolute', '--git-path', 'index']);
36
+ const dir = mkdtempSync(join(tmpdir(), 'prism-harness-idx-'));
37
+ const firstLine = (s) => s.trim().split('\n')[0].slice(0, 200);
38
+ try {
39
+ const tmpIndex = join(dir, 'index');
40
+ if (idx.ok && idx.stdout && existsSync(idx.stdout))
41
+ copyFileSync(idx.stdout, tmpIndex);
42
+ const env = { GIT_INDEX_FILE: tmpIndex };
43
+ // --ignore-errors: an unreadable file is left out rather than failing the snapshot.
44
+ const add = gitIn(repoRoot, ['add', '-A', '--ignore-errors', '--', '.'], env);
45
+ if (!add.ok)
46
+ warnings.push(`the working-tree snapshot left out files git could not add (${firstLine(add.stderr)}); changes in them are not reviewed`);
47
+ // PRISM's own output never counts, even where git does not ignore it. (An exclude
48
+ // pathspec on `git add` errors when the path is also ignored, so remove it after.)
49
+ // The diff excludes these paths too, so a failure here only costs a warning.
50
+ const rm = gitIn(repoRoot, ['rm', '-r', '-q', '--cached', '--ignore-unmatch', '--', RESULTS_DIR, HARNESS_DIR], env);
51
+ if (!rm.ok)
52
+ warnings.push(`could not drop PRISM's own output from the snapshot (${firstLine(rm.stderr)})`);
53
+ const t = gitIn(repoRoot, ['write-tree'], env);
54
+ return t.ok && /^[0-9a-f]{40,64}$/.test(t.stdout) ? t.stdout : null;
55
+ }
56
+ finally {
57
+ rmSync(dir, { recursive: true, force: true });
58
+ }
59
+ }
60
+ export function objectExists(repoRoot, rev) {
61
+ return gitIn(repoRoot, ['cat-file', '-e', rev]).ok;
62
+ }
63
+ export function revParse(repoRoot, rev) {
64
+ const r = gitIn(repoRoot, ['rev-parse', '--verify', '--quiet', rev]);
65
+ return r.ok && r.stdout ? r.stdout : null;
66
+ }
67
+ /** Unified diff between two trees (or commits), lock files and PRISM's own output excluded. */
68
+ export function diffTrees(repoRoot, from, to) {
69
+ const r = gitIn(repoRoot, ['-c', 'core.quotePath=false', 'diff', '--no-color', '--no-ext-diff', '--unified=3', '-M',
70
+ '--src-prefix=a/', '--dst-prefix=b/', from, to, '--', '.', ...DIFF_EXCLUDES, ...OWN_OUTPUT]);
71
+ return r.ok ? r.stdout : null;
72
+ }
73
+ function unquote(p) {
74
+ if (!p.startsWith('"'))
75
+ return p;
76
+ try {
77
+ return JSON.parse(p);
78
+ }
79
+ catch {
80
+ return p.slice(1, -1);
81
+ }
82
+ }
83
+ const stripPrefix = (p, pre) => (p.startsWith(pre) ? p.slice(pre.length) : p);
84
+ /** Parses `git diff` output (a/ b/ prefixes). Tolerant: unknown lines are skipped. */
85
+ export function parseDiff(text) {
86
+ const files = [];
87
+ const allowMarkers = [];
88
+ let cur = null;
89
+ let inHunk = false;
90
+ let newLine = 0;
91
+ let addedLines = 0;
92
+ for (const line of text.split('\n')) {
93
+ if (line.startsWith('diff --git ')) {
94
+ const m = /^diff --git (.+?) (b\/.+|"b\/.+")$/.exec(line);
95
+ const b = m ? stripPrefix(unquote(m[2]), 'b/') : '';
96
+ const a = m ? stripPrefix(unquote(m[1]), 'a/') : '';
97
+ cur = { path: b, oldPath: a && a !== b ? a : null, deleted: false, added: new Set() };
98
+ files.push(cur);
99
+ inHunk = false;
100
+ continue;
101
+ }
102
+ if (!cur)
103
+ continue;
104
+ if (!inHunk) {
105
+ if (line.startsWith('+++ ')) {
106
+ const p = line.slice(4);
107
+ if (p === '/dev/null') {
108
+ cur.deleted = true;
109
+ cur.oldPath = cur.oldPath ?? cur.path;
110
+ }
111
+ else
112
+ cur.path = stripPrefix(unquote(p), 'b/');
113
+ }
114
+ else if (line.startsWith('--- ')) {
115
+ const p = line.slice(4);
116
+ if (p !== '/dev/null') {
117
+ const old = stripPrefix(unquote(p), 'a/');
118
+ if (old !== cur.path)
119
+ cur.oldPath = old;
120
+ }
121
+ }
122
+ else if (line.startsWith('rename from '))
123
+ cur.oldPath = unquote(line.slice(12));
124
+ else if (line.startsWith('rename to '))
125
+ cur.path = unquote(line.slice(10));
126
+ else if (line.startsWith('deleted file mode'))
127
+ cur.deleted = true;
128
+ }
129
+ const h = /^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/.exec(line);
130
+ if (h) {
131
+ inHunk = true;
132
+ newLine = Number(h[1]);
133
+ continue;
134
+ }
135
+ if (!inHunk)
136
+ continue;
137
+ if (line.startsWith('+')) {
138
+ cur.added.add(newLine);
139
+ addedLines++;
140
+ if (line.includes('gitleaks:allow'))
141
+ allowMarkers.push({ file: cur.path, line: newLine });
142
+ newLine++;
143
+ }
144
+ else if (line.startsWith(' '))
145
+ newLine++;
146
+ }
147
+ return { files, addedLines, allowMarkers };
148
+ }
149
+ /** Every path a diff touches, old and new. */
150
+ export function touchedPaths(d) {
151
+ const out = new Set();
152
+ for (const f of d.files) {
153
+ out.add(f.path);
154
+ if (f.oldPath)
155
+ out.add(f.oldPath);
156
+ }
157
+ return [...out].filter(Boolean);
158
+ }
159
+ /**
160
+ * Contents of `<rev>:<path>` for each path, through one `git cat-file --batch`.
161
+ * Missing paths are absent from the map. A path holding a newline cannot be
162
+ * sent on the batch protocol's one-line-per-object input (it would desync
163
+ * every object after it; `-z` needs git 2.43), so it is left out and pushed
164
+ * onto `unreadable` for the caller to report.
165
+ */
166
+ export function readBlobs(repoRoot, rev, paths, unreadable = []) {
167
+ const out = new Map();
168
+ const ok = paths.filter((p) => !/[\n\r]/.test(p));
169
+ unreadable.push(...paths.filter((p) => /[\n\r]/.test(p)));
170
+ paths = ok;
171
+ if (!paths.length)
172
+ return out;
173
+ const env = { ...process.env };
174
+ for (const k of GIT_HOOK_ENV)
175
+ delete env[k];
176
+ const r = spawnSync('git', ['-C', repoRoot, 'cat-file', '--batch'], {
177
+ input: paths.map((p) => `${rev}:${p}`).join('\n') + '\n', env, maxBuffer: MAX_BUFFER, stdio: ['pipe', 'pipe', 'pipe'],
178
+ });
179
+ if (r.status !== 0 || !r.stdout)
180
+ return out;
181
+ const buf = r.stdout;
182
+ let pos = 0;
183
+ for (const p of paths) {
184
+ const nl = buf.indexOf(0x0a, pos);
185
+ if (nl < 0)
186
+ break;
187
+ const header = buf.subarray(pos, nl).toString('utf8');
188
+ pos = nl + 1;
189
+ const m = /^[0-9a-f]+ (\w+) (\d+)$/.exec(header);
190
+ if (!m)
191
+ continue; // "<obj> missing"
192
+ const size = Number(m[2]);
193
+ if (m[1] === 'blob')
194
+ out.set(p, buf.subarray(pos, pos + size));
195
+ pos += size + 1;
196
+ }
197
+ return out;
198
+ }
199
+ /** Converts a glob (`*`, `**`, `?`) to a regex. A pattern without `/` matches the base name. */
200
+ export function globToRegExp(glob) {
201
+ let re = '';
202
+ for (let i = 0; i < glob.length; i++) {
203
+ const c = glob[i];
204
+ if (c === '*') {
205
+ if (glob[i + 1] === '*') {
206
+ i++;
207
+ if (glob[i + 1] === '/') {
208
+ re += '(.*/)?';
209
+ i++;
210
+ }
211
+ else
212
+ re += '.*';
213
+ }
214
+ else
215
+ re += '[^/]*';
216
+ }
217
+ else if (c === '?')
218
+ re += '[^/]';
219
+ else
220
+ re += c.replace(/[.+^${}()|[\]\\]/g, '\\$&');
221
+ }
222
+ return new RegExp(glob.includes('/') ? `^${re}$` : `(^|/)${re}$`);
223
+ }
224
+ export function matchesAny(path, globs) {
225
+ return globs.some((g) => globToRegExp(g).test(path));
226
+ }
227
+ //# sourceMappingURL=diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diff.js","sourceRoot":"","sources":["../../../../src/codewatch/harness/diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,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AAC,EAAE,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;AACvD,CAAC"}
@@ -0,0 +1,127 @@
1
+ import { type BlockOn } from '../config.js';
2
+ import { type CommitSecret } from '../gitleaks.js';
3
+ import { type Finding } from '../results.js';
4
+ import { type Verdict } from './state.js';
5
+ export declare const VERDICT_SCHEMA = "prism.harness.verdict";
6
+ export declare const VERDICT_VERSION = 1;
7
+ /** The harness reviews a smaller diff than the pre-push gate (200,000), because a person waits on it. */
8
+ export declare const MAX_HARNESS_DIFF_CHARS = 60000;
9
+ /** Set in the reviewer's environment, so a reviewer that loads the same plugin does not re-enter the hook. */
10
+ export declare const HARNESS_CHILD_ENV = "PRISM_HARNESS_CHILD";
11
+ export declare const RETRY_NOTE = "Your previous reply was not valid JSON. Return exactly one JSON object matching that schema and nothing else: no prose, no code fences.";
12
+ export type Scope = 'new-lines' | 'files' | 'branch';
13
+ export declare const SCOPES: Scope[];
14
+ export type HumanWhy = 'secret-committed' | 'tamper' | 'max-rounds' | 'reviewer-failed' | 'no-progress' | 'secrets-scan-failed' | 'push-unknown';
15
+ export type HarnessEvent = 'stop' | 'pre-push' | 'manual' | 'mcp';
16
+ /** One `git push` as the adapter read it from the command line. */
17
+ export interface PushTarget {
18
+ /** The remote named on the command line, or null for the default. */
19
+ remote: string | null;
20
+ /** The source of the refspec (`HEAD`, a branch, a sha), or null for the current branch. */
21
+ src: string | null;
22
+ /** The branch it writes to on the remote, or null when not given. */
23
+ dst: string | null;
24
+ /** Set when the command's push target cannot be determined (`--all`, several refspecs, a glob): the push is held. */
25
+ unknown: string | null;
26
+ }
27
+ /** Paths whose change during a session ends the loop (section 6.2). `.prism/results/**` and
28
+ * `.prism/harness/**` are on the design's list but never appear here: every diff and snapshot
29
+ * excludes PRISM's own output, so an edit to them is never seen (the section 6.2 non-goal). */
30
+ export declare const TAMPER_GLOBS: string[];
31
+ export declare const isTamperPath: (p: string) => boolean;
32
+ export interface VerdictSecret {
33
+ file: string;
34
+ line: number | null;
35
+ rule: string;
36
+ committed: boolean;
37
+ }
38
+ export interface VerdictFinding extends Finding {
39
+ introduced_in_session: boolean;
40
+ blocking: boolean;
41
+ }
42
+ export interface HarnessVerdict {
43
+ schema: typeof VERDICT_SCHEMA;
44
+ version: typeof VERDICT_VERSION;
45
+ verdict: Verdict;
46
+ round: number;
47
+ max_rounds: number;
48
+ session: string | null;
49
+ scope: Scope;
50
+ diff: {
51
+ files: number;
52
+ added_lines: number;
53
+ hash: string | null;
54
+ cached: boolean;
55
+ };
56
+ secrets_scanned: boolean;
57
+ secrets: VerdictSecret[];
58
+ /**
59
+ * Branch scope: secrets gitleaks found in a commit of the reviewed range,
60
+ * even if a later commit removed them. Any entry makes the verdict `stop`
61
+ * (`secret-committed`): the commit itself would leave with the push.
62
+ */
63
+ commit_secrets: CommitSecret[];
64
+ block_on: BlockOn[];
65
+ findings: VerdictFinding[];
66
+ dropped: {
67
+ out_of_scope: number;
68
+ unknown_file: number;
69
+ };
70
+ reasons: string[];
71
+ next_action: string;
72
+ human_needed: boolean;
73
+ human_why: HumanWhy | null;
74
+ warnings: string[];
75
+ reviewer: {
76
+ tool: string;
77
+ model: string | null;
78
+ attempts: number;
79
+ wall_s: number;
80
+ cost_usd: number | null;
81
+ } | null;
82
+ result_path: string | null;
83
+ fail_open: boolean;
84
+ }
85
+ export interface HarnessOptions {
86
+ repoRoot: string;
87
+ /** working (default) | staged (index vs HEAD) | since (<ref>...HEAD plus uncommitted). */
88
+ mode?: 'working' | 'staged' | 'since';
89
+ since?: string;
90
+ session?: string | null;
91
+ client?: string | null;
92
+ scope?: Scope;
93
+ maxRounds?: number;
94
+ timeoutSeconds?: number;
95
+ /** --no-review: gitleaks and the tamper check only. */
96
+ noReview?: boolean;
97
+ /** false when the push gate is off: the AI review is skipped, gitleaks still runs. */
98
+ aiReview?: boolean;
99
+ event?: HarnessEvent;
100
+ /**
101
+ * Absolute time (epoch ms) the whole run must finish by: every gitleaks scan
102
+ * and reviewer attempt gets only what is left, minus a reserve for writing
103
+ * the result. Hooks set it below the client's kill time. Unset: no deadline.
104
+ */
105
+ deadlineMs?: number;
106
+ /**
107
+ * Returns true the first time a notice with this key may be shown in the
108
+ * current session, false after. Unset: every notice shows.
109
+ */
110
+ noticeOnce?: (key: string) => boolean;
111
+ /** pre-push: what the agent's `git push` command writes (parsed by the adapter). */
112
+ push?: PushTarget;
113
+ /** PATH for reviewer detection (tests). */
114
+ pathEnv?: string;
115
+ gitleaksBin?: string;
116
+ now?: () => Date;
117
+ }
118
+ /** Time kept back from the deadline for writing the state and the result and printing the answer. */
119
+ export declare const DEADLINE_RESERVE_MS = 5000;
120
+ /**
121
+ * Runs one review. Throws only on an internal error (the CLI turns that into
122
+ * exit 1, adapters into "no decision").
123
+ */
124
+ export declare function runHarnessReview(opts: HarnessOptions): HarnessVerdict;
125
+ /** CLI exit code for a verdict: 0 pass, 3 fix, 4 stop (exit 2 is avoided on purpose, section 3). */
126
+ export declare function exitCodeFor(v: HarnessVerdict): number;
127
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../../../src/codewatch/harness/engine.ts"],"names":[],"mappings":"AAsBA,OAAO,EAA6I,KAAK,OAAO,EAAsB,MAAM,cAAc,CAAC;AAC3M,OAAO,EAAqG,KAAK,YAAY,EAA6C,MAAM,gBAAgB,CAAC;AACjM,OAAO,EAAqC,KAAK,OAAO,EAAiB,MAAM,eAAe,CAAC;AAK/F,OAAO,EAAiH,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAEzJ,eAAO,MAAM,cAAc,0BAA0B,CAAC;AACtD,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,yGAAyG;AACzG,eAAO,MAAM,sBAAsB,QAAS,CAAC;AAC7C,8GAA8G;AAC9G,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AACvD,eAAO,MAAM,UAAU,4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