looply-cli 0.5.50 → 0.5.52
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/account-connect.d.ts +2 -1
- package/dist/account-connect.d.ts.map +1 -1
- package/dist/account-connect.js.map +1 -1
- package/dist/adaptive-budget.d.ts +6 -0
- package/dist/adaptive-budget.d.ts.map +1 -1
- package/dist/adaptive-budget.js +9 -0
- package/dist/adaptive-budget.js.map +1 -1
- package/dist/base-check-turns.d.ts +38 -0
- package/dist/base-check-turns.d.ts.map +1 -0
- package/dist/base-check-turns.js +118 -0
- package/dist/base-check-turns.js.map +1 -0
- package/dist/bin.d.ts.map +1 -1
- package/dist/bin.js +32 -2
- package/dist/bin.js.map +1 -1
- package/dist/branch-delivery.d.ts +9 -0
- package/dist/branch-delivery.d.ts.map +1 -1
- package/dist/branch-delivery.js +85 -1
- package/dist/branch-delivery.js.map +1 -1
- package/dist/bug-repro.d.ts +13 -0
- package/dist/bug-repro.d.ts.map +1 -1
- package/dist/bug-repro.js +43 -1
- package/dist/bug-repro.js.map +1 -1
- package/dist/checkout-carry.d.ts +31 -0
- package/dist/checkout-carry.d.ts.map +1 -1
- package/dist/checkout-carry.js +98 -3
- package/dist/checkout-carry.js.map +1 -1
- package/dist/checkout-deps.d.ts +2 -0
- package/dist/checkout-deps.d.ts.map +1 -1
- package/dist/checkout-deps.js +2 -0
- package/dist/checkout-deps.js.map +1 -1
- package/dist/daemon-cmd.d.ts +1 -1
- package/dist/daemon-cmd.d.ts.map +1 -1
- package/dist/daemon-cmd.js +8 -1
- package/dist/daemon-cmd.js.map +1 -1
- package/dist/fresh-gates.d.ts.map +1 -1
- package/dist/fresh-gates.js +13 -0
- package/dist/fresh-gates.js.map +1 -1
- package/dist/gate-health.d.ts +2 -0
- package/dist/gate-health.d.ts.map +1 -1
- package/dist/gate-health.js +41 -4
- package/dist/gate-health.js.map +1 -1
- package/dist/goal-adaptive.d.ts +9 -0
- package/dist/goal-adaptive.d.ts.map +1 -1
- package/dist/goal-adaptive.js +32 -11
- package/dist/goal-adaptive.js.map +1 -1
- package/dist/goal-gap.d.ts.map +1 -1
- package/dist/goal-gap.js +13 -0
- package/dist/goal-gap.js.map +1 -1
- package/dist/integration-deps.d.ts.map +1 -1
- package/dist/integration-deps.js +18 -0
- package/dist/integration-deps.js.map +1 -1
- package/dist/machine-settings.d.ts +9 -0
- package/dist/machine-settings.d.ts.map +1 -1
- package/dist/machine-settings.js +35 -2
- package/dist/machine-settings.js.map +1 -1
- package/dist/output-gist.d.ts +40 -0
- package/dist/output-gist.d.ts.map +1 -0
- package/dist/output-gist.js +107 -0
- package/dist/output-gist.js.map +1 -0
- package/dist/plan-recovery.d.ts +14 -3
- package/dist/plan-recovery.d.ts.map +1 -1
- package/dist/plan-recovery.js +24 -6
- package/dist/plan-recovery.js.map +1 -1
- package/dist/provider-accounts.d.ts +0 -6
- package/dist/provider-accounts.d.ts.map +1 -1
- package/dist/provider-accounts.js +0 -6
- package/dist/provider-accounts.js.map +1 -1
- package/dist/quarantine-report.d.ts +32 -0
- package/dist/quarantine-report.d.ts.map +1 -0
- package/dist/quarantine-report.js +75 -0
- package/dist/quarantine-report.js.map +1 -0
- package/dist/round-runner.d.ts +13 -2
- package/dist/round-runner.d.ts.map +1 -1
- package/dist/round-runner.js +5 -1
- package/dist/round-runner.js.map +1 -1
- package/dist/run-base.d.ts.map +1 -1
- package/dist/run-base.js +19 -1
- package/dist/run-base.js.map +1 -1
- package/dist/run-cmd.d.ts.map +1 -1
- package/dist/run-cmd.js +44 -10
- package/dist/run-cmd.js.map +1 -1
- package/dist/self-update.d.ts +189 -11
- package/dist/self-update.d.ts.map +1 -1
- package/dist/self-update.js +477 -51
- package/dist/self-update.js.map +1 -1
- package/dist/serve-cmd.d.ts +15 -1
- package/dist/serve-cmd.d.ts.map +1 -1
- package/dist/serve-cmd.js +82 -1
- package/dist/serve-cmd.js.map +1 -1
- package/dist/serve-log.d.ts +52 -0
- package/dist/serve-log.d.ts.map +1 -0
- package/dist/serve-log.js +146 -0
- package/dist/serve-log.js.map +1 -0
- package/dist/serve.d.ts +7 -7
- package/dist/serve.d.ts.map +1 -1
- package/dist/serve.js +11 -15
- package/dist/serve.js.map +1 -1
- package/dist/server-client.d.ts +14 -2
- package/dist/server-client.d.ts.map +1 -1
- package/dist/server-client.js +12 -2
- package/dist/server-client.js.map +1 -1
- package/dist/setup-check-wiring.d.ts.map +1 -1
- package/dist/setup-check-wiring.js +17 -13
- package/dist/setup-check-wiring.js.map +1 -1
- package/dist/setup-check.d.ts.map +1 -1
- package/dist/setup-check.js +18 -1
- package/dist/setup-check.js.map +1 -1
- package/dist/steady-log.d.ts +48 -0
- package/dist/steady-log.d.ts.map +1 -0
- package/dist/steady-log.js +100 -0
- package/dist/steady-log.js.map +1 -0
- package/dist/ticket-words.d.ts.map +1 -1
- package/dist/ticket-words.js +6 -0
- package/dist/ticket-words.js.map +1 -1
- package/dist/verify-cmd.d.ts +0 -2
- package/dist/verify-cmd.d.ts.map +1 -1
- package/dist/verify-cmd.js +0 -5
- package/dist/verify-cmd.js.map +1 -1
- package/dist/workspace-builds.d.ts +153 -0
- package/dist/workspace-builds.d.ts.map +1 -0
- package/dist/workspace-builds.js +347 -0
- package/dist/workspace-builds.js.map +1 -0
- package/dist/workspace-provisioner.d.ts +12 -0
- package/dist/workspace-provisioner.d.ts.map +1 -1
- package/dist/workspace-provisioner.js +61 -3
- package/dist/workspace-provisioner.js.map +1 -1
- package/dist/workspace-quarantine.d.ts +36 -2
- package/dist/workspace-quarantine.d.ts.map +1 -1
- package/dist/workspace-quarantine.js +53 -0
- package/dist/workspace-quarantine.js.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +11 -3
- package/dist/workspace.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { type GateStepResult } from '@looply/core';
|
|
2
|
+
import type { CommandResult, CommandRunner, StepSpec } from './gate';
|
|
3
|
+
/**
|
|
4
|
+
* A CHECKOUT WHOSE WORKSPACE PACKAGES ARE NOT BUILT BUILDS THEM BEFORE ITS CHECKS.
|
|
5
|
+
*
|
|
6
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
7
|
+
* 🔴 LOOPLY'S OWN REPOSITORY (LOO-B-7…10, 2026-11). `@looply/core` declares its entry points in
|
|
8
|
+
* `dist/` (`main`, `types`, `exports`), `dist/` is git-ignored build output, and nothing built it in
|
|
9
|
+
* a machine-made checkout. So even with the workspace link in place (`checkout-carry.ts`), the
|
|
10
|
+
* typecheck gate of the package that imports it could not resolve one type from it, and the
|
|
11
|
+
* unchanged base was held as red. Every monorepo whose packages are consumed through their build
|
|
12
|
+
* output meets exactly this in a fresh checkout.
|
|
13
|
+
*
|
|
14
|
+
* THE RULE, and why it is this narrow — each part is a fact read from the checkout, none a guess:
|
|
15
|
+
*
|
|
16
|
+
* 1. THE WORKSPACE IS WHAT THE REPOSITORY DECLARES: the root `package.json` `workspaces` (a list,
|
|
17
|
+
* or `{ packages: [...] }`), or `pnpm-workspace.yaml` `packages:`. A pattern is a folder
|
|
18
|
+
* (`packages/core`) or one level of folders (`packages/*`); `!` excludes; anything wider
|
|
19
|
+
* (`**`, braces, `..`, absolute) is not expanded — a package this cannot name is not built.
|
|
20
|
+
* 2. ONLY A PACKAGE SOMETHING DEPENDS ON: another workspace package, or the root, names it in
|
|
21
|
+
* `dependencies`, `devDependencies`, `peerDependencies` or `optionalDependencies`. Nothing can
|
|
22
|
+
* import a package through `node_modules` that nobody depends on (an app, a site), so nothing
|
|
23
|
+
* a check runs can need it built.
|
|
24
|
+
* 3. ONLY WHEN WHAT IT DECLARES IS NOT THERE: one of `main`, `types`, `typings` or a file target
|
|
25
|
+
* of `exports` (no `*` patterns) does not exist in the checkout. A package that points at its
|
|
26
|
+
* sources, or that is already built (the carry copied it, a person built it), is left alone.
|
|
27
|
+
* 4. BUILT BY ITS OWN `build` SCRIPT, `cd <dir> && npm run build` — or, when it has none and the
|
|
28
|
+
* root has one, the root's, once. No `build` script anywhere: nothing is run; what to build is
|
|
29
|
+
* not this product's call. `npm run` because it runs any package.json script and is on every
|
|
30
|
+
* machine with Node; no install, no registry.
|
|
31
|
+
* 5. IN DEPENDENCY ORDER: a package after the workspace packages it depends on.
|
|
32
|
+
*
|
|
33
|
+
* - CONTAINED, like a gate: the build runs with the checkout's gate runner, in its sandbox and
|
|
34
|
+
* with NO network — it is the repository's own code, which its checks run anyway.
|
|
35
|
+
* - BEFORE THE CHECKS of a fresh checkout or a goal's first round (`checkout-deps.ts` installs
|
|
36
|
+
* first, then this), a failed build is said, with the gist of the build's own output
|
|
37
|
+
* (`output-gist.ts`), as a machine fault the goal waits on — "… — so the environment is
|
|
38
|
+
* unavailable, not the change", the clause `classifyEnvironment` reads — never as a red base:
|
|
39
|
+
* no change has been made yet.
|
|
40
|
+
*
|
|
41
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
42
|
+
* 🔴 AND AGAIN WHEN A ROUND CHANGES WHAT WAS BUILT (owner ruling 2026-11-16). Built once, a round
|
|
43
|
+
* that changed `packages/core/src` had the CLI's typecheck read the OLD `dist/` types: a new export
|
|
44
|
+
* the change added was "missing", and an export it removed was still there — the change judged on
|
|
45
|
+
* code it did not contain.
|
|
46
|
+
*
|
|
47
|
+
* 6. WHAT LOOPLY BUILT IS RECORDED, in the checkout itself (`BUILD_RECORD`, under the checkout's
|
|
48
|
+
* own git-ignored `node_modules`, deleted with it): each package's folder hashed by CONTENT
|
|
49
|
+
* (every file but `node_modules` and `.git`, path and bytes) right after its build, so the
|
|
50
|
+
* hash includes what the build wrote. A package Looply never built has no record and is never
|
|
51
|
+
* rebuilt by this — it was built by a person or carried, and what made it is not known here.
|
|
52
|
+
* 7. BEFORE EVERY ROUND'S CHECKS, and before the checks a goal runs again at its head, a recorded
|
|
53
|
+
* package whose folder no longer hashes the same is built again — the round changed its
|
|
54
|
+
* sources, or a discarded round's revert changed them back — and so is every recorded
|
|
55
|
+
* package that depends on one being built, after it (rule 5). Never from timestamps.
|
|
56
|
+
* 8. A PACKAGE NOBODY CHANGED COSTS NOTHING: the plan is read and hashed on the host; no step is
|
|
57
|
+
* added, no sandbox is started. One that changed costs one build per round.
|
|
58
|
+
* 9. THE REBUILD IS A STEP OF THE ROUND'S GATE, ahead of the configured ones (`rebuildSteps`), so
|
|
59
|
+
* the gate's own rule tells its two failures apart: a build that RAN and failed is the
|
|
60
|
+
* change's — the gate is red, with the build's output as the round's evidence — and a build
|
|
61
|
+
* that could not run at all (no contained toolchain, the sandbox refused it, a command that is
|
|
62
|
+
* not there) is `blocked`, the environment's, and spends no attempt. The integration lane and
|
|
63
|
+
* the fresh checks before delivery tell them apart the same way (`unavailable`).
|
|
64
|
+
* ─────────────────────────────────────────────────────────────────────────────
|
|
65
|
+
*/
|
|
66
|
+
export interface BuildFs {
|
|
67
|
+
/** A file's text, or null. Relative to the checkout. */
|
|
68
|
+
readFile(path: string): string | null;
|
|
69
|
+
/** The folders directly inside `dir` (relative to the checkout), or [] when it has none. */
|
|
70
|
+
listDirs?(dir: string): string[];
|
|
71
|
+
}
|
|
72
|
+
export interface WorkspacePackage {
|
|
73
|
+
/** Its folder, relative to the checkout, with `/`. */
|
|
74
|
+
readonly dir: string;
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly pkg: Record<string, unknown>;
|
|
77
|
+
}
|
|
78
|
+
export interface BuildStep {
|
|
79
|
+
/** The folder the build runs in ('' for the root). */
|
|
80
|
+
readonly dir: string;
|
|
81
|
+
/** The packages this build is for. */
|
|
82
|
+
readonly packages: readonly string[];
|
|
83
|
+
/** Their folders, which the build record hashes once it succeeds (rule 6). */
|
|
84
|
+
readonly dirs: readonly string[];
|
|
85
|
+
/** The declared entry points that are not there, `dir/path`. */
|
|
86
|
+
readonly missing: readonly string[];
|
|
87
|
+
/** Why it is built, in words for the log: what is not there, or what changed (rule 7). */
|
|
88
|
+
readonly why: string;
|
|
89
|
+
readonly cmd: string;
|
|
90
|
+
}
|
|
91
|
+
/** Where a checkout records what Looply built in it (rule 6): its own git-ignored node_modules. */
|
|
92
|
+
export declare const BUILD_RECORD = "node_modules/.cache/looply/workspace-builds.json";
|
|
93
|
+
/** A package folder's content, hashed: every file's path and bytes, but `node_modules` and `.git` (rule 6). */
|
|
94
|
+
export declare function packageHash(checkout: string, dir: string): string;
|
|
95
|
+
/** Record a successful build (rule 6). A record that cannot be written only costs a rebuild later. */
|
|
96
|
+
export declare function recordBuilt(checkout: string, step: Pick<BuildStep, 'packages' | 'dirs'>): void;
|
|
97
|
+
/** A cold `tsc -b` of a large package takes a minute or two; ten is room, not a target. */
|
|
98
|
+
export declare const BUILD_TIMEOUT_MS: number;
|
|
99
|
+
/** The workspace patterns the repository declares (rule 1). */
|
|
100
|
+
export declare function workspacePatterns(fs: BuildFs): string[];
|
|
101
|
+
/** The workspace's packages: each declared folder that has a `package.json` with a name. */
|
|
102
|
+
export declare function workspacePackages(fs: BuildFs): WorkspacePackage[];
|
|
103
|
+
/** The entry points a package declares that its folder does not have (rule 3). */
|
|
104
|
+
export declare function missingEntries(p: WorkspacePackage, fs: BuildFs): string[];
|
|
105
|
+
/**
|
|
106
|
+
* Every build the checks need, in dependency order (rules 2–5). With `checkout`, also every package
|
|
107
|
+
* Looply built there whose folder no longer hashes as recorded, and every recorded package that
|
|
108
|
+
* depends on one being built (rules 6–7).
|
|
109
|
+
*/
|
|
110
|
+
export declare function workspaceBuildPlan(fs: BuildFs, checkout?: string): BuildStep[];
|
|
111
|
+
/** A build as a step of a round's gate (rule 9). Not `required`: it is not one of the repository's checks. */
|
|
112
|
+
export declare const buildStepName: (step: Pick<BuildStep, "packages">) => string;
|
|
113
|
+
/**
|
|
114
|
+
* THE REBUILDS A ROUND'S GATE RUNS FIRST (rules 7–9). `before` is asked right before a gate runs and
|
|
115
|
+
* answers [] when nothing Looply built has changed — then nothing is run at all. `after` is given
|
|
116
|
+
* the gate's step results and records each build that passed, hashed as the build left it.
|
|
117
|
+
*/
|
|
118
|
+
export declare function workspaceRebuilds(checkout: string, fs: BuildFs, log?: (line: string) => void): {
|
|
119
|
+
before(): StepSpec[];
|
|
120
|
+
after(results: readonly Pick<GateStepResult, 'step' | 'ok' | 'skipped'>[] | readonly GateStepResult[]): void;
|
|
121
|
+
};
|
|
122
|
+
/** `BuildFs.listDirs` for a folder on disk (`checkoutDepsFs`, `projectFs`). Links are not followed into. */
|
|
123
|
+
export declare function listDirsIn(root: string): (dir: string) => string[];
|
|
124
|
+
export type BuildOutcome = {
|
|
125
|
+
kind: 'nothing';
|
|
126
|
+
} | {
|
|
127
|
+
kind: 'built';
|
|
128
|
+
packages: string[];
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* `unavailable`: the build could not run at all (no contained toolchain, the sandbox refused it, a
|
|
132
|
+
* command that is not there) — the machine's. Otherwise it ran and failed: the code's (rule 9).
|
|
133
|
+
*/
|
|
134
|
+
| {
|
|
135
|
+
kind: 'failed';
|
|
136
|
+
because: string;
|
|
137
|
+
unavailable: boolean;
|
|
138
|
+
failure: string;
|
|
139
|
+
};
|
|
140
|
+
/** Whether a failed build never ran: the gate's own rule for a step that could not run (`gate.ts`). */
|
|
141
|
+
export declare function buildCouldNotRun(r: Pick<CommandResult, 'ok' | 'unavailable' | 'timedOut' | 'output' | 'exitCode'>): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Build what the plan says, in order. `runner` is the checkout's contained gate runner (no network).
|
|
144
|
+
* The first build that fails ends it: what depends on it could not be checked anyway.
|
|
145
|
+
*/
|
|
146
|
+
export declare function buildWorkspacePackages(input: {
|
|
147
|
+
plan: readonly BuildStep[];
|
|
148
|
+
runner: CommandRunner;
|
|
149
|
+
log: (line: string) => void;
|
|
150
|
+
/** The checkout, when what is built there should be recorded for later rebuilds (rule 6). */
|
|
151
|
+
checkout?: string;
|
|
152
|
+
}): Promise<BuildOutcome>;
|
|
153
|
+
//# sourceMappingURL=workspace-builds.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EAAE,CAUlE;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAA;CAAE;AACvC;;;GAGG;GACD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAE/E,uGAAuG;AACvG,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,CAAC,GAAG,OAAO,CAI3H;AAKD;;;GAGG;AACH,wBAAsB,sBAAsB,CAAC,KAAK,EAAE;IAClD,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IAC3B,MAAM,EAAE,aAAa,CAAC;IACtB,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5B,6FAA6F;IAC7F,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,YAAY,CAAC,CAkBxB"}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildStepName = exports.BUILD_TIMEOUT_MS = exports.BUILD_RECORD = void 0;
|
|
4
|
+
exports.packageHash = packageHash;
|
|
5
|
+
exports.recordBuilt = recordBuilt;
|
|
6
|
+
exports.workspacePatterns = workspacePatterns;
|
|
7
|
+
exports.workspacePackages = workspacePackages;
|
|
8
|
+
exports.missingEntries = missingEntries;
|
|
9
|
+
exports.workspaceBuildPlan = workspaceBuildPlan;
|
|
10
|
+
exports.workspaceRebuilds = workspaceRebuilds;
|
|
11
|
+
exports.listDirsIn = listDirsIn;
|
|
12
|
+
exports.buildCouldNotRun = buildCouldNotRun;
|
|
13
|
+
exports.buildWorkspacePackages = buildWorkspacePackages;
|
|
14
|
+
const node_crypto_1 = require("node:crypto");
|
|
15
|
+
const node_fs_1 = require("node:fs");
|
|
16
|
+
const node_path_1 = require("node:path");
|
|
17
|
+
const core_1 = require("@looply/core");
|
|
18
|
+
const output_gist_1 = require("./output-gist");
|
|
19
|
+
/** Where a checkout records what Looply built in it (rule 6): its own git-ignored node_modules. */
|
|
20
|
+
exports.BUILD_RECORD = 'node_modules/.cache/looply/workspace-builds.json';
|
|
21
|
+
/** A package folder's content, hashed: every file's path and bytes, but `node_modules` and `.git` (rule 6). */
|
|
22
|
+
function packageHash(checkout, dir) {
|
|
23
|
+
const h = (0, node_crypto_1.createHash)('sha256');
|
|
24
|
+
const walk = (rel) => {
|
|
25
|
+
let entries;
|
|
26
|
+
try {
|
|
27
|
+
entries = (0, node_fs_1.readdirSync)((0, node_path_1.join)(checkout, rel), { withFileTypes: true });
|
|
28
|
+
}
|
|
29
|
+
catch {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
for (const e of entries.sort((a, b) => (a.name < b.name ? -1 : a.name > b.name ? 1 : 0))) {
|
|
33
|
+
const p = at(rel, e.name);
|
|
34
|
+
if (e.isDirectory()) {
|
|
35
|
+
if (e.name !== 'node_modules' && e.name !== '.git')
|
|
36
|
+
walk(p);
|
|
37
|
+
}
|
|
38
|
+
else if (e.isFile()) {
|
|
39
|
+
h.update(`${p}\0`);
|
|
40
|
+
try {
|
|
41
|
+
h.update((0, node_fs_1.readFileSync)((0, node_path_1.join)(checkout, p)));
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
h.update('\0unreadable');
|
|
45
|
+
}
|
|
46
|
+
h.update('\0');
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
walk(dir);
|
|
51
|
+
return h.digest('hex');
|
|
52
|
+
}
|
|
53
|
+
function readRecord(checkout) {
|
|
54
|
+
try {
|
|
55
|
+
const v = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(checkout, exports.BUILD_RECORD), 'utf8'));
|
|
56
|
+
return typeof v.packages === 'object' && v.packages !== null ? v.packages : {};
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return {};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
/** Record a successful build (rule 6). A record that cannot be written only costs a rebuild later. */
|
|
63
|
+
function recordBuilt(checkout, step) {
|
|
64
|
+
const record = readRecord(checkout);
|
|
65
|
+
step.packages.forEach((name, i) => {
|
|
66
|
+
const dir = step.dirs[i] ?? step.dirs[0] ?? '';
|
|
67
|
+
record[name] = { dir, hash: packageHash(checkout, dir) };
|
|
68
|
+
});
|
|
69
|
+
try {
|
|
70
|
+
const file = (0, node_path_1.join)(checkout, exports.BUILD_RECORD);
|
|
71
|
+
(0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(file), { recursive: true });
|
|
72
|
+
(0, node_fs_1.writeFileSync)(`${file}.tmp`, `${JSON.stringify({ version: 1, packages: record })}\n`, 'utf8');
|
|
73
|
+
(0, node_fs_1.renameSync)(`${file}.tmp`, file);
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
/* a rebuild next round is the cost */
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** A cold `tsc -b` of a large package takes a minute or two; ten is room, not a target. */
|
|
80
|
+
exports.BUILD_TIMEOUT_MS = 10 * 60 * 1000;
|
|
81
|
+
const at = (dir, file) => (dir ? `${dir}/${file}` : file);
|
|
82
|
+
const clean = (p) => p.replace(/\\/g, '/').replace(/^\.\/+/, '').replace(/\/+$/, '');
|
|
83
|
+
function json(text) {
|
|
84
|
+
if (text === null)
|
|
85
|
+
return null;
|
|
86
|
+
try {
|
|
87
|
+
const v = JSON.parse(text);
|
|
88
|
+
return typeof v === 'object' && v !== null && !Array.isArray(v) ? v : null;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** The patterns `pnpm-workspace.yaml` lists under `packages:` (its one documented shape). */
|
|
95
|
+
function pnpmPatterns(text) {
|
|
96
|
+
if (text === null)
|
|
97
|
+
return [];
|
|
98
|
+
const out = [];
|
|
99
|
+
let inPackages = false;
|
|
100
|
+
for (const raw of text.split(/\r?\n/)) {
|
|
101
|
+
const line = raw.replace(/#.*$/, '');
|
|
102
|
+
if (/^packages\s*:\s*$/.test(line)) {
|
|
103
|
+
inPackages = true;
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
if (!inPackages)
|
|
107
|
+
continue;
|
|
108
|
+
const item = /^\s+-\s*['"]?([^'"]+?)['"]?\s*$/.exec(line);
|
|
109
|
+
if (item)
|
|
110
|
+
out.push(item[1]);
|
|
111
|
+
else if (/^\S/.test(line))
|
|
112
|
+
inPackages = false;
|
|
113
|
+
}
|
|
114
|
+
return out;
|
|
115
|
+
}
|
|
116
|
+
/** The workspace patterns the repository declares (rule 1). */
|
|
117
|
+
function workspacePatterns(fs) {
|
|
118
|
+
const root = json(fs.readFile('package.json'));
|
|
119
|
+
const ws = root?.['workspaces'];
|
|
120
|
+
const list = Array.isArray(ws) ? ws : Array.isArray(ws?.packages) ? ws.packages : [];
|
|
121
|
+
const fromNpm = list.filter((p) => typeof p === 'string');
|
|
122
|
+
return fromNpm.length > 0 ? fromNpm : pnpmPatterns(fs.readFile('pnpm-workspace.yaml'));
|
|
123
|
+
}
|
|
124
|
+
/** A pattern's folders, or [] for a shape this does not expand (rule 1). */
|
|
125
|
+
function expand(pattern, fs) {
|
|
126
|
+
const p = clean(pattern);
|
|
127
|
+
if (p === '' || p.startsWith('/') || /^[A-Za-z]:/.test(p) || p.split('/').includes('..') || /[{}[\]?]|\*\*/.test(p))
|
|
128
|
+
return [];
|
|
129
|
+
if (!p.includes('*'))
|
|
130
|
+
return [p];
|
|
131
|
+
const m = /^((?:[^*/]+\/)*)\*$/.exec(p);
|
|
132
|
+
if (!m || fs.listDirs === undefined)
|
|
133
|
+
return [];
|
|
134
|
+
const parent = m[1].replace(/\/$/, '');
|
|
135
|
+
return fs
|
|
136
|
+
.listDirs(parent)
|
|
137
|
+
.filter((d) => !d.startsWith('.') && d !== 'node_modules')
|
|
138
|
+
.map((d) => at(parent, d));
|
|
139
|
+
}
|
|
140
|
+
/** The workspace's packages: each declared folder that has a `package.json` with a name. */
|
|
141
|
+
function workspacePackages(fs) {
|
|
142
|
+
const patterns = workspacePatterns(fs);
|
|
143
|
+
const excluded = new Set(patterns.filter((p) => p.startsWith('!')).flatMap((p) => expand(p.slice(1), fs)));
|
|
144
|
+
const seen = new Set();
|
|
145
|
+
const out = [];
|
|
146
|
+
for (const pattern of patterns.filter((p) => !p.startsWith('!'))) {
|
|
147
|
+
for (const dir of expand(pattern, fs)) {
|
|
148
|
+
if (seen.has(dir) || excluded.has(dir))
|
|
149
|
+
continue;
|
|
150
|
+
seen.add(dir);
|
|
151
|
+
const pkg = json(fs.readFile(at(dir, 'package.json')));
|
|
152
|
+
const name = pkg?.['name'];
|
|
153
|
+
if (pkg !== null && typeof name === 'string' && name !== '')
|
|
154
|
+
out.push({ dir, name, pkg });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
return out;
|
|
158
|
+
}
|
|
159
|
+
const DEP_FIELDS = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
|
|
160
|
+
function dependsOn(pkg) {
|
|
161
|
+
return DEP_FIELDS.flatMap((f) => {
|
|
162
|
+
const v = pkg[f];
|
|
163
|
+
return typeof v === 'object' && v !== null ? Object.keys(v) : [];
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/** Every file target `exports` names (rule 3): strings, through conditions and subpaths; no patterns. */
|
|
167
|
+
function exportTargets(v) {
|
|
168
|
+
if (typeof v === 'string')
|
|
169
|
+
return v.startsWith('./') && !v.includes('*') ? [v] : [];
|
|
170
|
+
if (Array.isArray(v))
|
|
171
|
+
return v.flatMap(exportTargets);
|
|
172
|
+
if (typeof v === 'object' && v !== null)
|
|
173
|
+
return Object.values(v).flatMap(exportTargets);
|
|
174
|
+
return [];
|
|
175
|
+
}
|
|
176
|
+
/** The entry points a package declares that its folder does not have (rule 3). */
|
|
177
|
+
function missingEntries(p, fs) {
|
|
178
|
+
const has = (f) => fs.readFile(at(p.dir, clean(f))) !== null;
|
|
179
|
+
const out = [];
|
|
180
|
+
for (const field of ['main', 'types', 'typings']) {
|
|
181
|
+
const v = p.pkg[field];
|
|
182
|
+
if (typeof v !== 'string' || v === '')
|
|
183
|
+
continue;
|
|
184
|
+
// `main` is resolved like a require: `dist/index` is `dist/index.js` or `dist/index/index.js`.
|
|
185
|
+
const found = field === 'main' ? has(v) || has(`${v}.js`) || has(`${clean(v)}/index.js`) : has(v);
|
|
186
|
+
if (!found)
|
|
187
|
+
out.push(at(p.dir, clean(v)));
|
|
188
|
+
}
|
|
189
|
+
for (const t of exportTargets(p.pkg['exports']))
|
|
190
|
+
if (!has(t) && !out.includes(at(p.dir, clean(t))))
|
|
191
|
+
out.push(at(p.dir, clean(t)));
|
|
192
|
+
return out;
|
|
193
|
+
}
|
|
194
|
+
const hasBuildScript = (pkg) => {
|
|
195
|
+
const s = pkg?.['scripts'];
|
|
196
|
+
return typeof s === 'object' && s !== null && typeof s['build'] === 'string';
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Every build the checks need, in dependency order (rules 2–5). With `checkout`, also every package
|
|
200
|
+
* Looply built there whose folder no longer hashes as recorded, and every recorded package that
|
|
201
|
+
* depends on one being built (rules 6–7).
|
|
202
|
+
*/
|
|
203
|
+
function workspaceBuildPlan(fs, checkout) {
|
|
204
|
+
const packages = workspacePackages(fs);
|
|
205
|
+
if (packages.length === 0)
|
|
206
|
+
return [];
|
|
207
|
+
const root = json(fs.readFile('package.json'));
|
|
208
|
+
const names = new Set(packages.map((p) => p.name));
|
|
209
|
+
const wanted = new Set([...(root ? dependsOn(root) : []), ...packages.flatMap((p) => dependsOn(p.pkg))].filter((n) => names.has(n)));
|
|
210
|
+
const record = checkout === undefined ? {} : readRecord(checkout);
|
|
211
|
+
const candidates = packages.filter((p) => wanted.has(p.name));
|
|
212
|
+
const why = new Map();
|
|
213
|
+
for (const p of candidates) {
|
|
214
|
+
const missing = missingEntries(p, fs);
|
|
215
|
+
if (missing.length > 0) {
|
|
216
|
+
why.set(p.name, { missing, why: `${missing.slice(0, 2).join(', ')}${missing.length > 2 ? ', …' : ''} is not there` });
|
|
217
|
+
}
|
|
218
|
+
else if (checkout !== undefined && record[p.name] !== undefined && packageHash(checkout, p.dir) !== record[p.name].hash) {
|
|
219
|
+
why.set(p.name, { missing: [], why: `its folder changed since it was built` });
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// Rule 7: a recorded package that depends on one being built is built after it.
|
|
223
|
+
for (let grew = true; grew;) {
|
|
224
|
+
grew = false;
|
|
225
|
+
for (const p of candidates) {
|
|
226
|
+
if (why.has(p.name) || record[p.name] === undefined)
|
|
227
|
+
continue;
|
|
228
|
+
const on = dependsOn(p.pkg).find((d) => why.has(d));
|
|
229
|
+
if (on !== undefined) {
|
|
230
|
+
why.set(p.name, { missing: [], why: `it depends on ${on}, which is built again` });
|
|
231
|
+
grew = true;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
const needing = candidates.filter((p) => why.has(p.name)).map((p) => ({ p, missing: why.get(p.name).missing, why: why.get(p.name).why }));
|
|
236
|
+
if (needing.length === 0)
|
|
237
|
+
return [];
|
|
238
|
+
// Rule 5: depth-first over the workspace dependencies, so a package follows what it needs.
|
|
239
|
+
const byName = new Map(needing.map((x) => [x.p.name, x]));
|
|
240
|
+
const ordered = [];
|
|
241
|
+
const state = new Map();
|
|
242
|
+
const visit = (name) => {
|
|
243
|
+
if (state.has(name))
|
|
244
|
+
return; // done, or a cycle: declaration order decides
|
|
245
|
+
state.set(name, 'visiting');
|
|
246
|
+
const x = byName.get(name);
|
|
247
|
+
for (const d of dependsOn(x.p.pkg))
|
|
248
|
+
if (byName.has(d))
|
|
249
|
+
visit(d);
|
|
250
|
+
state.set(name, 'done');
|
|
251
|
+
ordered.push(x);
|
|
252
|
+
};
|
|
253
|
+
for (const x of needing)
|
|
254
|
+
visit(x.p.name);
|
|
255
|
+
const steps = [];
|
|
256
|
+
const rootBuild = { packages: [], dirs: [], missing: [], why: [] };
|
|
257
|
+
for (const { p, missing, why: because } of ordered) {
|
|
258
|
+
if (hasBuildScript(p.pkg)) {
|
|
259
|
+
steps.push({ dir: p.dir, packages: [p.name], dirs: [p.dir], missing, why: because, cmd: `cd ${p.dir} && npm run build` });
|
|
260
|
+
}
|
|
261
|
+
else if (hasBuildScript(root)) {
|
|
262
|
+
rootBuild.packages.push(p.name);
|
|
263
|
+
rootBuild.dirs.push(p.dir);
|
|
264
|
+
rootBuild.missing.push(...missing);
|
|
265
|
+
rootBuild.why.push(`${p.name}: ${because}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
// The root's build is for packages that have none of their own: once, after theirs.
|
|
269
|
+
if (rootBuild.packages.length > 0)
|
|
270
|
+
steps.push({ dir: '', ...rootBuild, why: rootBuild.why.join('; '), cmd: 'npm run build' });
|
|
271
|
+
return steps;
|
|
272
|
+
}
|
|
273
|
+
/** A build as a step of a round's gate (rule 9). Not `required`: it is not one of the repository's checks. */
|
|
274
|
+
const buildStepName = (step) => `workspace build: ${step.packages.join(', ')}`;
|
|
275
|
+
exports.buildStepName = buildStepName;
|
|
276
|
+
/**
|
|
277
|
+
* THE REBUILDS A ROUND'S GATE RUNS FIRST (rules 7–9). `before` is asked right before a gate runs and
|
|
278
|
+
* answers [] when nothing Looply built has changed — then nothing is run at all. `after` is given
|
|
279
|
+
* the gate's step results and records each build that passed, hashed as the build left it.
|
|
280
|
+
*/
|
|
281
|
+
function workspaceRebuilds(checkout, fs, log = () => { }) {
|
|
282
|
+
let pending = [];
|
|
283
|
+
return {
|
|
284
|
+
before: () => {
|
|
285
|
+
pending = workspaceBuildPlan(fs, checkout);
|
|
286
|
+
for (const s of pending)
|
|
287
|
+
log(`build : building the workspace package ${s.packages.join(', ')} again before the checks — ${s.why}`);
|
|
288
|
+
return pending.map((s) => ({ name: (0, exports.buildStepName)(s), run: s.cmd, timeoutS: exports.BUILD_TIMEOUT_MS / 1000 }));
|
|
289
|
+
},
|
|
290
|
+
after: (results) => {
|
|
291
|
+
for (const s of pending) {
|
|
292
|
+
const r = results.find((x) => x.step === (0, exports.buildStepName)(s));
|
|
293
|
+
if (r !== undefined && r.ok && r.skipped !== true)
|
|
294
|
+
recordBuilt(checkout, s);
|
|
295
|
+
}
|
|
296
|
+
pending = [];
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
/** `BuildFs.listDirs` for a folder on disk (`checkoutDepsFs`, `projectFs`). Links are not followed into. */
|
|
301
|
+
function listDirsIn(root) {
|
|
302
|
+
return (dir) => {
|
|
303
|
+
try {
|
|
304
|
+
return (0, node_fs_1.readdirSync)((0, node_path_1.join)(root, dir), { withFileTypes: true })
|
|
305
|
+
.filter((e) => e.isDirectory())
|
|
306
|
+
.map((e) => e.name);
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
return [];
|
|
310
|
+
}
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/** Whether a failed build never ran: the gate's own rule for a step that could not run (`gate.ts`). */
|
|
314
|
+
function buildCouldNotRun(r) {
|
|
315
|
+
if (r.ok)
|
|
316
|
+
return false;
|
|
317
|
+
if (r.unavailable === true)
|
|
318
|
+
return true;
|
|
319
|
+
return r.timedOut !== true && (0, core_1.classifyGateCrash)(r.output, typeof r.exitCode === 'number' ? r.exitCode : null) !== null;
|
|
320
|
+
}
|
|
321
|
+
const gist = (r) => r.timedOut ? `it did not finish inside ${Math.round(exports.BUILD_TIMEOUT_MS / 60000)} minutes` : (0, output_gist_1.outputGist)(r.output, 200) || 'no output';
|
|
322
|
+
/**
|
|
323
|
+
* Build what the plan says, in order. `runner` is the checkout's contained gate runner (no network).
|
|
324
|
+
* The first build that fails ends it: what depends on it could not be checked anyway.
|
|
325
|
+
*/
|
|
326
|
+
async function buildWorkspacePackages(input) {
|
|
327
|
+
if (input.plan.length === 0)
|
|
328
|
+
return { kind: 'nothing' };
|
|
329
|
+
const built = [];
|
|
330
|
+
for (const step of input.plan) {
|
|
331
|
+
const what = step.packages.join(', ');
|
|
332
|
+
const where = step.dir || 'the checkout root';
|
|
333
|
+
input.log(`build : building the workspace package ${what} in ${where} (${step.cmd.replace(/^cd \S+ && /, '')}) — the checks need it and ${step.why}`);
|
|
334
|
+
const r = await input.runner(step.cmd, exports.BUILD_TIMEOUT_MS);
|
|
335
|
+
if (!r.ok) {
|
|
336
|
+
const failure = `the workspace package ${what}, which the checks need, could not be built in ${where} (${step.cmd.replace(/^cd \S+ && /, '')}): ${gist(r)}`;
|
|
337
|
+
// `because` for a build before any change (the base: always the environment's); `failure` for one after a change.
|
|
338
|
+
return { kind: 'failed', unavailable: buildCouldNotRun(r), failure, because: `${failure} — so the environment is unavailable, not the change` };
|
|
339
|
+
}
|
|
340
|
+
input.log(`build : built ${what}`);
|
|
341
|
+
if (input.checkout !== undefined)
|
|
342
|
+
recordBuilt(input.checkout, step);
|
|
343
|
+
built.push(...step.packages);
|
|
344
|
+
}
|
|
345
|
+
return { kind: 'built', packages: built };
|
|
346
|
+
}
|
|
347
|
+
//# sourceMappingURL=workspace-builds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-builds.js","sourceRoot":"","sources":["../src/workspace-builds.ts"],"names":[],"mappings":";;;AAyGA,kCA0BC;AAYD,kCAcC;AAsCD,8CAMC;AAiBD,8CAeC;AAoBD,wCAYC;AAYD,gDA6DC;AAUD,8CAoBC;AAGD,gCAUC;AAYD,4CAIC;AASD,wDAwBC;AA9aD,6CAAyC;AACzC,qCAAuG;AACvG,yCAA0C;AAC1C,uCAAsE;AAEtE,+CAA2C;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OAAO,EAAE,GAAG,OAAO,sDAAsD,EAAE,CAAC;QAClJ,CAAC;QACD,KAAK,CAAC,GAAG,CAAC,mBAAmB,IAAI,EAAE,CAAC,CAAC;QACrC,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;YAAE,WAAW,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACpE,KAAK,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC5C,CAAC"}
|
|
@@ -54,7 +54,19 @@ export interface ProvisionerDeps {
|
|
|
54
54
|
readonly carry?: () => readonly string[];
|
|
55
55
|
/** `run.base_branch`; read from the project's config when not given. Null: the repository default. */
|
|
56
56
|
readonly baseBranch?: () => string | null;
|
|
57
|
+
/**
|
|
58
|
+
* Bring origin's copy of a branch up to date before the cut (`git fetch origin <branch>`, bounded). Never throws.
|
|
59
|
+
* Production fetches; tests that give their own `git` and no `fetch` do not touch the network.
|
|
60
|
+
*/
|
|
61
|
+
readonly fetch?: (branch: string) => Promise<void>;
|
|
57
62
|
}
|
|
63
|
+
/** How long the pre-cut fetch may take: a slow or unreachable origin never holds a checkout back for long. */
|
|
64
|
+
export declare const BASE_FETCH_TIMEOUT_MS = 30000;
|
|
65
|
+
/** `git fetch origin refs/heads/<branch>:refs/remotes/origin/<branch>`, bounded and never prompting. Never throws. */
|
|
66
|
+
export declare function boundedOriginFetch(cwd: string, timeoutMs?: number, run?: (args: readonly string[]) => {
|
|
67
|
+
done: Promise<unknown>;
|
|
68
|
+
kill(): void;
|
|
69
|
+
}): (branch: string) => Promise<void>;
|
|
58
70
|
export declare function nodeWorkspaceProvisioner(cwd: string, deps?: ProvisionerDeps): WorkspaceProvisioner;
|
|
59
71
|
/**
|
|
60
72
|
* `run.carry_into_checkouts` from the project's config. No config file means
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace-provisioner.d.ts","sourceRoot":"","sources":["../src/workspace-provisioner.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"workspace-provisioner.d.ts","sourceRoot":"","sources":["../src/workspace-provisioner.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,SAAS,EAA0B,MAAM,cAAc,CAAC;AAMjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;AAEzD,MAAM,WAAW,gBAAgB;IAC/B,qFAAqF;IACrF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IAC5B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,MAAM,CAAC;IAChC,oFAAoF;IACpF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,SAAS,MAAM,EAAE,CAAC;IACzC,sGAAsG;IACtG,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC1C;;;OAGG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACpD;AAED,8GAA8G;AAC9G,eAAO,MAAM,qBAAqB,QAAS,CAAC;AAE5C,sHAAsH;AACtH,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,MAAM,EACX,SAAS,GAAE,MAA8B,EACzC,GAAG,GAAE,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,KAAK;IAAE,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;IAAC,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