looply-cli 0.2.0 → 0.4.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/dist/.src-hash +1 -1
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +25 -11
- package/dist/bin.js.map +1 -1
- package/dist/connect-node.d.ts +8 -0
- package/dist/connect-node.d.ts.map +1 -0
- package/dist/connect-node.js +110 -0
- package/dist/connect-node.js.map +1 -0
- package/dist/connect.d.ts +135 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/connect.js +329 -0
- package/dist/connect.js.map +1 -0
- package/dist/daemon-cmd.d.ts +11 -2
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +20 -6
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/repo-init.d.ts +36 -0
- package/dist/repo-init.d.ts.map +1 -0
- package/dist/repo-init.js +61 -0
- package/dist/repo-init.js.map +1 -0
- package/dist/repo-origin.d.ts +15 -0
- package/dist/repo-origin.d.ts.map +1 -0
- package/dist/repo-origin.js +28 -0
- package/dist/repo-origin.js.map +1 -0
- package/dist/repo-requests.d.ts +79 -0
- package/dist/repo-requests.d.ts.map +1 -0
- package/dist/repo-requests.js +180 -0
- package/dist/repo-requests.js.map +1 -0
- package/dist/repo-scan.d.ts +47 -0
- package/dist/repo-scan.d.ts.map +1 -0
- package/dist/repo-scan.js +84 -0
- package/dist/repo-scan.js.map +1 -0
- package/dist/serve-cmd.d.ts +132 -0
- package/dist/serve-cmd.d.ts.map +1 -0
- package/dist/serve-cmd.js +532 -0
- package/dist/serve-cmd.js.map +1 -0
- package/dist/serve-tasks.d.ts +17 -0
- package/dist/serve-tasks.d.ts.map +1 -0
- package/dist/serve-tasks.js +124 -0
- package/dist/serve-tasks.js.map +1 -0
- package/dist/serve.d.ts +202 -0
- package/dist/serve.d.ts.map +1 -0
- package/dist/serve.js +413 -0
- package/dist/serve.js.map +1 -0
- package/dist/server-client.d.ts +37 -0
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +21 -0
- package/dist/server-client.js.map +1 -1
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +3 -1
- package/dist/sync.js.map +1 -1
- package/package.json +54 -54
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Find the git repositories under a folder a person said holds their code.
|
|
3
|
+
*
|
|
4
|
+
* ⚠️ BOUNDED THREE WAYS, because the folder is whatever they typed and that is
|
|
5
|
+
* sometimes their whole home directory:
|
|
6
|
+
*
|
|
7
|
+
* depth three levels below the root, no further — `~/code/client/app`
|
|
8
|
+
* is found, `~/code/a/b/c/d` is not;
|
|
9
|
+
* pruning `node_modules`, `dist`, `build`, `.next`, `vendor` and every
|
|
10
|
+
* hidden folder are never entered: they are where the walk would
|
|
11
|
+
* spend its time and they hold nobody's project;
|
|
12
|
+
* a cap two hundred repositories, and the caller says it stopped.
|
|
13
|
+
*
|
|
14
|
+
* 🔴 A REPOSITORY IS A LEAF. Once a folder has `.git` (a directory, or the
|
|
15
|
+
* file a linked worktree or submodule has) the walk does not go inside it: a
|
|
16
|
+
* vendored checkout or a submodule is part of the project around it, not a
|
|
17
|
+
* second project to serve.
|
|
18
|
+
*
|
|
19
|
+
* Symlinks are not followed — a link back up the tree is a walk that never ends.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SCAN_MAX_DEPTH = 3;
|
|
22
|
+
export declare const SCAN_MAX_REPOS = 200;
|
|
23
|
+
export declare const SCAN_SKIP: Set<string>;
|
|
24
|
+
export interface ScanEntry {
|
|
25
|
+
readonly name: string;
|
|
26
|
+
/** A real directory — not a symlink to one. */
|
|
27
|
+
readonly dir: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface ScanFs {
|
|
30
|
+
/** The entries of a folder, or `null` when it cannot be read. */
|
|
31
|
+
entries(dir: string): readonly ScanEntry[] | null;
|
|
32
|
+
}
|
|
33
|
+
export declare const nodeScanFs: ScanFs;
|
|
34
|
+
export interface ScanResult {
|
|
35
|
+
/** Repository roots, in walk order (sorted by name at each level). */
|
|
36
|
+
readonly repos: readonly string[];
|
|
37
|
+
/** True when the cap was reached and the walk stopped early. */
|
|
38
|
+
readonly capped: boolean;
|
|
39
|
+
/** Folders that could not be listed — said, not silently skipped. */
|
|
40
|
+
readonly unreadable: readonly string[];
|
|
41
|
+
}
|
|
42
|
+
export declare function scanForRepos(roots: readonly string[], fs: ScanFs, opts?: {
|
|
43
|
+
maxDepth?: number;
|
|
44
|
+
cap?: number;
|
|
45
|
+
join?: (a: string, b: string) => string;
|
|
46
|
+
}): ScanResult;
|
|
47
|
+
//# sourceMappingURL=repo-scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-scan.d.ts","sourceRoot":"","sources":["../src/repo-scan.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,eAAO,MAAM,cAAc,IAAI,CAAC;AAChC,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,SAAS,aAAgE,CAAC;AAEvF,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,MAAM;IACrB,iEAAiE;IACjE,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,SAAS,EAAE,GAAG,IAAI,CAAC;CACnD;AAED,eAAO,MAAM,UAAU,EAAE,MAQxB,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,gEAAgE;IAChE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,qEAAqE;IACrE,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC;AAED,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,EAAE,EAAE,MAAM,EACV,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM,CAAA;CAAO,GACtF,UAAU,CAwCZ"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nodeScanFs = exports.SCAN_SKIP = exports.SCAN_MAX_REPOS = exports.SCAN_MAX_DEPTH = void 0;
|
|
4
|
+
exports.scanForRepos = scanForRepos;
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
|
+
/**
|
|
8
|
+
* Find the git repositories under a folder a person said holds their code.
|
|
9
|
+
*
|
|
10
|
+
* ⚠️ BOUNDED THREE WAYS, because the folder is whatever they typed and that is
|
|
11
|
+
* sometimes their whole home directory:
|
|
12
|
+
*
|
|
13
|
+
* depth three levels below the root, no further — `~/code/client/app`
|
|
14
|
+
* is found, `~/code/a/b/c/d` is not;
|
|
15
|
+
* pruning `node_modules`, `dist`, `build`, `.next`, `vendor` and every
|
|
16
|
+
* hidden folder are never entered: they are where the walk would
|
|
17
|
+
* spend its time and they hold nobody's project;
|
|
18
|
+
* a cap two hundred repositories, and the caller says it stopped.
|
|
19
|
+
*
|
|
20
|
+
* 🔴 A REPOSITORY IS A LEAF. Once a folder has `.git` (a directory, or the
|
|
21
|
+
* file a linked worktree or submodule has) the walk does not go inside it: a
|
|
22
|
+
* vendored checkout or a submodule is part of the project around it, not a
|
|
23
|
+
* second project to serve.
|
|
24
|
+
*
|
|
25
|
+
* Symlinks are not followed — a link back up the tree is a walk that never ends.
|
|
26
|
+
*/
|
|
27
|
+
exports.SCAN_MAX_DEPTH = 3;
|
|
28
|
+
exports.SCAN_MAX_REPOS = 200;
|
|
29
|
+
exports.SCAN_SKIP = new Set(['node_modules', 'dist', 'build', '.next', 'vendor']);
|
|
30
|
+
exports.nodeScanFs = {
|
|
31
|
+
entries: (dir) => {
|
|
32
|
+
try {
|
|
33
|
+
return (0, node_fs_1.readdirSync)(dir, { withFileTypes: true }).map((d) => ({ name: d.name, dir: d.isDirectory() }));
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
function scanForRepos(roots, fs, opts = {}) {
|
|
41
|
+
const maxDepth = opts.maxDepth ?? exports.SCAN_MAX_DEPTH;
|
|
42
|
+
const cap = opts.cap ?? exports.SCAN_MAX_REPOS;
|
|
43
|
+
const joinPath = opts.join ?? node_path_1.join;
|
|
44
|
+
const repos = [];
|
|
45
|
+
const unreadable = [];
|
|
46
|
+
const seen = new Set();
|
|
47
|
+
let capped = false;
|
|
48
|
+
const walk = (dir, depth) => {
|
|
49
|
+
if (capped)
|
|
50
|
+
return;
|
|
51
|
+
const entries = fs.entries(dir);
|
|
52
|
+
if (entries === null) {
|
|
53
|
+
unreadable.push(dir);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
// `.git` as a folder OR a file: a linked worktree's is a file.
|
|
57
|
+
if (entries.some((e) => e.name === '.git')) {
|
|
58
|
+
if (seen.has(dir))
|
|
59
|
+
return;
|
|
60
|
+
if (repos.length >= cap) {
|
|
61
|
+
capped = true;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
seen.add(dir);
|
|
65
|
+
repos.push(dir);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
if (depth >= maxDepth)
|
|
69
|
+
return;
|
|
70
|
+
const children = entries
|
|
71
|
+
.filter((e) => e.dir && !e.name.startsWith('.') && !exports.SCAN_SKIP.has(e.name.toLowerCase()))
|
|
72
|
+
.map((e) => e.name)
|
|
73
|
+
.sort((a, b) => a.localeCompare(b));
|
|
74
|
+
for (const name of children) {
|
|
75
|
+
if (capped)
|
|
76
|
+
return;
|
|
77
|
+
walk(joinPath(dir, name), depth + 1);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
for (const root of roots)
|
|
81
|
+
walk(root, 0);
|
|
82
|
+
return { repos, capped, unreadable };
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=repo-scan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repo-scan.js","sourceRoot":"","sources":["../src/repo-scan.ts"],"names":[],"mappings":";;;AA0DA,oCA4CC;AAtGD,qCAAsC;AACtC,yCAAiC;AAEjC;;;;;;;;;;;;;;;;;;;GAmBG;AAEU,QAAA,cAAc,GAAG,CAAC,CAAC;AACnB,QAAA,cAAc,GAAG,GAAG,CAAC;AACrB,QAAA,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC;AAa1E,QAAA,UAAU,GAAW;IAChC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;QACf,IAAI,CAAC;YACH,OAAO,IAAA,qBAAW,EAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC;QACxG,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;CACF,CAAC;AAWF,SAAgB,YAAY,CAC1B,KAAwB,EACxB,EAAU,EACV,OAAqF,EAAE;IAEvF,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,IAAI,sBAAc,CAAC;IACjD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,sBAAc,C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EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;aAClB,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,KAAK,MAAM,IAAI,IAAI,QAAQ,EAAE,CAAC;YAC5B,IAAI,MAAM;gBAAE,OAAO;YACnB,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QACvC,CAAC;IACH,CAAC,CAAC;IAEF,KAAK,MAAM,IAAI,IAAI,KAAK;QAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACxC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { type ProbeFn } from './run-lease';
|
|
2
|
+
import { type Platform, type ServeFs, type ServedRepo } from './serve';
|
|
3
|
+
/**
|
|
4
|
+
* `looply serve` and its verbs — the composition around `serve.ts`.
|
|
5
|
+
*
|
|
6
|
+
* looply serve add [path] list a repository to be served (default: here)
|
|
7
|
+
* looply serve remove <path> stop serving one
|
|
8
|
+
* looply serve list what is listed, and whether each is still set up
|
|
9
|
+
* looply serve run the supervisor: one daemon per listed repository
|
|
10
|
+
* looply serve install start the supervisor at login (Windows); a template elsewhere
|
|
11
|
+
* looply serve uninstall undo `install`
|
|
12
|
+
*
|
|
13
|
+
* ⚠️ ADDING A REPOSITORY IS THE CONSENT. Each child runs `looply daemon --yes`,
|
|
14
|
+
* which registers the repository with the server without asking — there is no
|
|
15
|
+
* terminal to ask on. The question a person would have been asked at the
|
|
16
|
+
* daemon's prompt is the one they answered by typing `serve add`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const SERVE_USAGE: string;
|
|
19
|
+
export declare const EXIT_OK = 0;
|
|
20
|
+
export declare const EXIT_REFUSED = 1;
|
|
21
|
+
/** Somebody else is here — the same answer every other lock in this CLI gives. */
|
|
22
|
+
export declare const EXIT_HELD = 2;
|
|
23
|
+
export declare const EXIT_USAGE = 64;
|
|
24
|
+
/** How long children get to finish after being asked to stop, before they are killed outright. */
|
|
25
|
+
export declare const STOP_GRACE_MS = 10000;
|
|
26
|
+
export interface ChildEvents {
|
|
27
|
+
line(text: string): void;
|
|
28
|
+
/** Exactly once, whether the child ran and ended or never started. */
|
|
29
|
+
exit(code: number | null, signal: string | null, error?: Error): void;
|
|
30
|
+
}
|
|
31
|
+
export interface ChildHandle {
|
|
32
|
+
/** Ask it to stop; `force` is the second ask. */
|
|
33
|
+
kill(force: boolean): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Periodic work the supervisor does besides keeping children alive — the
|
|
37
|
+
* rescan of the code roots and the clone-request poll (`serve-tasks.ts`).
|
|
38
|
+
*
|
|
39
|
+
* ⚠️ A TASK NEVER OVERLAPS ITSELF: the next run is scheduled only when the
|
|
40
|
+
* last one has finished, however long it took. And a task that throws is
|
|
41
|
+
* logged and run again on schedule; it cannot take the supervisor down.
|
|
42
|
+
*/
|
|
43
|
+
export interface SupervisorTask {
|
|
44
|
+
readonly name: string;
|
|
45
|
+
readonly everyMs: number;
|
|
46
|
+
run(): unknown;
|
|
47
|
+
}
|
|
48
|
+
export interface SupervisorDeps {
|
|
49
|
+
readonly platform: Platform;
|
|
50
|
+
/** Run once at start, then every `everyMs` after each run finishes. */
|
|
51
|
+
readonly tasks?: readonly SupervisorTask[];
|
|
52
|
+
/** The listed repositories. Throws when the list cannot be read. */
|
|
53
|
+
repos(): readonly ServedRepo[];
|
|
54
|
+
configExists(repo: string): boolean;
|
|
55
|
+
spawnDaemon(repo: string, on: ChildEvents): ChildHandle;
|
|
56
|
+
now(): number;
|
|
57
|
+
setTimer(fn: () => void, ms: number): unknown;
|
|
58
|
+
clearTimer(handle: unknown): void;
|
|
59
|
+
log(line: string): void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The supervisor: keeps one child per listed repository alive.
|
|
63
|
+
*
|
|
64
|
+
* ⚠️ A CHILD THAT FAILS IS THE CHILD'S PROBLEM. A repository already served by
|
|
65
|
+
* a daemon a person started by hand makes its child exit on the per-repo lock;
|
|
66
|
+
* that line is logged, the child waits out its backoff and tries again, and
|
|
67
|
+
* every other repository carries on. Nothing a child does can stop the
|
|
68
|
+
* supervisor.
|
|
69
|
+
*/
|
|
70
|
+
export declare class Supervisor {
|
|
71
|
+
private readonly deps;
|
|
72
|
+
private readonly entries;
|
|
73
|
+
private readonly taskTimers;
|
|
74
|
+
private pollTimer;
|
|
75
|
+
private stopping;
|
|
76
|
+
private readError;
|
|
77
|
+
private drained;
|
|
78
|
+
/** One promise for every caller of `stop`, so the impatient second call resolves the first. */
|
|
79
|
+
private drain;
|
|
80
|
+
constructor(deps: SupervisorDeps);
|
|
81
|
+
/** The keys of the repositories that have an entry (running, waiting or skipped). */
|
|
82
|
+
keys(): string[];
|
|
83
|
+
running(): string[];
|
|
84
|
+
start(): void;
|
|
85
|
+
private runTask;
|
|
86
|
+
/** Re-read the list and make the running set match it. */
|
|
87
|
+
poll(): void;
|
|
88
|
+
/**
|
|
89
|
+
* Stop every child and resolve when all are gone. A second call is the
|
|
90
|
+
* impatient one: whatever is left is killed outright.
|
|
91
|
+
*/
|
|
92
|
+
stop(): Promise<void>;
|
|
93
|
+
private admit;
|
|
94
|
+
private retire;
|
|
95
|
+
private launch;
|
|
96
|
+
private exited;
|
|
97
|
+
private later;
|
|
98
|
+
private say;
|
|
99
|
+
}
|
|
100
|
+
export interface ServeDeps {
|
|
101
|
+
readonly home: string;
|
|
102
|
+
readonly cwd: string;
|
|
103
|
+
readonly platform: Platform;
|
|
104
|
+
readonly env: NodeJS.ProcessEnv;
|
|
105
|
+
readonly fs: ServeFs;
|
|
106
|
+
readonly pid: number;
|
|
107
|
+
readonly probe: ProbeFn;
|
|
108
|
+
/** Node and this CLI's own bin.js; `bin` is null when it cannot be found (an unbuilt checkout). */
|
|
109
|
+
readonly launch: {
|
|
110
|
+
node: string;
|
|
111
|
+
bin: string | null;
|
|
112
|
+
};
|
|
113
|
+
now(): Date;
|
|
114
|
+
out(line: string): void;
|
|
115
|
+
err(line: string): void;
|
|
116
|
+
/** The supervisor's world; only `looply serve` itself needs it. */
|
|
117
|
+
supervisor?(): Omit<SupervisorDeps, 'repos' | 'configExists' | 'platform' | 'log'>;
|
|
118
|
+
/** Calls back on every SIGINT/SIGTERM; returns the unsubscribe. */
|
|
119
|
+
onSignal?(cb: () => void): () => void;
|
|
120
|
+
}
|
|
121
|
+
export declare function serveCommand(argv: readonly string[], deps: ServeDeps): Promise<number>;
|
|
122
|
+
/**
|
|
123
|
+
* This CLI's own entry file, for spawning children and writing startup files.
|
|
124
|
+
*
|
|
125
|
+
* `serve-cmd.js` is built next to `bin.js`, so that is where it is looked for
|
|
126
|
+
* first — true both in this repository's dist and in an installed package,
|
|
127
|
+
* where npm's shim and `npx` both end at the same file. `require.main` is the
|
|
128
|
+
* fallback for a bundling that moved things.
|
|
129
|
+
*/
|
|
130
|
+
export declare function selfBin(fileExists: (p: string) => boolean): string | null;
|
|
131
|
+
export declare function nodeServeDeps(): ServeDeps;
|
|
132
|
+
//# sourceMappingURL=serve-cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serve-cmd.d.ts","sourceRoot":"","sources":["../src/serve-cmd.ts"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAuBL,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,UAAU,EAChB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,WAAW,QAMZ,CAAC;AAEb,eAAO,MAAM,OAAO,IAAI,CAAC;AACzB,eAAO,MAAM,YAAY,IAAI,CAAC;AAC9B,kFAAkF;AAClF,eAAO,MAAM,SAAS,I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