halfcycle 0.4.13 → 0.4.15

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 (79) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/bin/bin.bundle.mjs +6308 -588
  3. package/bin/pre-tool-use-filter.sh +134 -6
  4. package/commands/agent-teams-orchestration.md +1 -1
  5. package/commands/consistency-check.md +1 -1
  6. package/commands/context-update.md +1 -1
  7. package/commands/halfcycle-design.md +1 -1
  8. package/commands/halfcycle-setup.md +1 -1
  9. package/commands/stack-assembly-worker.md +1 -1
  10. package/commands/task-execution.md +1 -1
  11. package/commands/task-graph.md +1 -1
  12. package/commands/write-spec.md +1 -1
  13. package/dist/bin.d.ts +1 -0
  14. package/dist/bin.d.ts.map +1 -1
  15. package/dist/build-record/pair-io.d.ts +49 -0
  16. package/dist/build-record/pair-io.d.ts.map +1 -0
  17. package/dist/build-record/render-change.d.ts +25 -0
  18. package/dist/build-record/render-change.d.ts.map +1 -0
  19. package/dist/build-record/render-v2.d.ts +10 -5
  20. package/dist/build-record/render-v2.d.ts.map +1 -1
  21. package/dist/build-record/write-change.d.ts +63 -0
  22. package/dist/build-record/write-change.d.ts.map +1 -0
  23. package/dist/build-record/write.d.ts +5 -15
  24. package/dist/build-record/write.d.ts.map +1 -1
  25. package/dist/change.d.ts +136 -0
  26. package/dist/change.d.ts.map +1 -0
  27. package/dist/check-tasks.d.ts +71 -0
  28. package/dist/check-tasks.d.ts.map +1 -0
  29. package/dist/claude-plan.d.ts +133 -0
  30. package/dist/claude-plan.d.ts.map +1 -0
  31. package/dist/cli-contract.d.ts +12 -1
  32. package/dist/cli-contract.d.ts.map +1 -1
  33. package/dist/cli.js +9670 -4933
  34. package/dist/cli.js.map +3 -3
  35. package/dist/close-phase.d.ts +53 -1
  36. package/dist/close-phase.d.ts.map +1 -1
  37. package/dist/doctor.d.ts +34 -0
  38. package/dist/doctor.d.ts.map +1 -0
  39. package/dist/folder-refusals.d.ts +27 -0
  40. package/dist/folder-refusals.d.ts.map +1 -0
  41. package/dist/identity.d.ts +31 -1
  42. package/dist/identity.d.ts.map +1 -1
  43. package/dist/index.js +2832 -1324
  44. package/dist/index.js.map +3 -3
  45. package/dist/install-manifest.d.ts +11 -1
  46. package/dist/install-manifest.d.ts.map +1 -1
  47. package/dist/install-plan.d.ts +112 -0
  48. package/dist/install-plan.d.ts.map +1 -0
  49. package/dist/install.d.ts +593 -2
  50. package/dist/install.d.ts.map +1 -1
  51. package/dist/merge-settings.d.ts +21 -2
  52. package/dist/merge-settings.d.ts.map +1 -1
  53. package/dist/open-phase.d.ts +1 -1
  54. package/dist/open-phase.d.ts.map +1 -1
  55. package/dist/pace.d.ts +138 -0
  56. package/dist/pace.d.ts.map +1 -0
  57. package/dist/phase-work.d.ts +37 -0
  58. package/dist/phase-work.d.ts.map +1 -0
  59. package/dist/plan.d.ts +20 -4
  60. package/dist/plan.d.ts.map +1 -1
  61. package/dist/pre-create-checks.d.ts +28 -0
  62. package/dist/pre-create-checks.d.ts.map +1 -1
  63. package/dist/preview.d.ts +40 -0
  64. package/dist/preview.d.ts.map +1 -0
  65. package/dist/prove.d.ts +77 -0
  66. package/dist/prove.d.ts.map +1 -0
  67. package/dist/restore.d.ts +58 -0
  68. package/dist/restore.d.ts.map +1 -0
  69. package/dist/review.d.ts +19 -1
  70. package/dist/review.d.ts.map +1 -1
  71. package/dist/scan.d.ts +11 -0
  72. package/dist/scan.d.ts.map +1 -1
  73. package/dist/setup/discovery.d.ts.map +1 -1
  74. package/dist/setup/rows.d.ts +10 -6
  75. package/dist/setup/rows.d.ts.map +1 -1
  76. package/dist/system-report.d.ts +1 -1
  77. package/dist/system-report.d.ts.map +1 -1
  78. package/dist/uninstall.d.ts.map +1 -1
  79. package/package.json +2 -2
@@ -49,7 +49,7 @@
49
49
  * SHIPS TO CLIENT DISK inside the CLI: every string here is a sentence a person reads,
50
50
  * and no comment sits beside an object member.
51
51
  */
52
- import { unfinishedStepLine, type AcceptanceOutcome, type ObserveRunResult, type OpenReviewAnswer, type TimeRunResult, type TimeSummary } from '@halfcycle/events';
52
+ import { unfinishedStepLine, type AcceptanceOutcome, type OwnerWaitDeclaration, type ObserveRunResult, type OpenReviewAnswer, type TimeRunResult, type TimeSummary } from '@halfcycle/events';
53
53
  import type { RepoCredential } from './open-phase.js';
54
54
  /**
55
55
  * Whether the commit this phase closed at could be read, and if so the full hash
@@ -160,6 +160,15 @@ export declare function observeChildEnv(credential: RepoCredential): NodeJS.Proc
160
160
  * `unreachable` when stdout holds no such line.
161
161
  */
162
162
  export declare function readObserveLine(stdout: string): ObserveRunResult;
163
+ /**
164
+ * Run one verb of the runner binary this package ships, as a child process, in the
165
+ * named repository: `node <binary> <args…>`, with `observeChildEnv`. `change done`
166
+ * spawns `observe --change <id>` through it too. Never throws,
167
+ * never prints: a binary that cannot be found (`binary` is the error that said so), a
168
+ * child that cannot start, runs past `OBSERVE_CHILD_DEADLINE_MS` or prints no result
169
+ * line all read `fallback`.
170
+ */
171
+ export declare function runRunnerChild<T>(binary: string | Error, args: readonly string[], credential: RepoCredential, repoRoot: string, readLine: (stdout: string) => T, fallback: T): Promise<T>;
163
172
  /**
164
173
  * Send a fresh count through the runner's `observe` verb (`runRunnerChild`). Anything
165
174
  * but a result line reads `unreachable`, and the open goes ahead.
@@ -177,6 +186,21 @@ export declare function readTimeLine(stdout: string): TimeRunResult;
177
186
  * answers, the open goes ahead; nothing is printed about it.
178
187
  */
179
188
  export declare function runTimeChild(binary: string | Error, credential: RepoCredential, repoRoot: string): Promise<TimeRunResult>;
189
+ /**
190
+ * Send whatever this computer still has queued from earlier `prove` runs,
191
+ * through the runner's own `prove --send-queued` — spawned the way `observe`
192
+ * and `time` are, with the same credential. That sub-verb prints nothing and
193
+ * always exits 0, so there is no line to read here: this call is for its SIDE
194
+ * EFFECT alone, and its result is discarded on purpose.
195
+ *
196
+ * Run before the close's own count and open go out, so a check a worker proved
197
+ * just before closing the phase is not left stranded behind the close. Whatever
198
+ * happens — no vendored binary, the child killed at its own deadline, the
199
+ * service unreachable — the close goes ahead unchanged: a run still unsent
200
+ * stays queued for the next `prove` or close on this computer, exactly as
201
+ * `prove` itself leaves it.
202
+ */
203
+ export declare function runProveQueueChild(binary: string | Error, credential: RepoCredential, repoRoot: string): Promise<void>;
180
204
  /**
181
205
  * A close step refused on this machine, before anything was sent: the request failed
182
206
  * the shared request schema. The CLI prints the message and exits as a usage error.
@@ -320,4 +344,32 @@ export declare function readCloseTimeSummary(credential: RepoCredential, phase:
320
344
  * alone rather than a missing word.
321
345
  */
322
346
  export declare function timeTotalsLines(summary: TimeSummary | null): string[];
347
+ /**
348
+ * The address of a phase's declarations, this cycle only: `close-phase`'s own read
349
+ * (`fixed-list-and-one-sitting`, Component design, *Control*), the engagement
350
+ * credential's.
351
+ */
352
+ export declare function closeOwnerWaitDeclarationsUrl(credential: RepoCredential, phase: string): string;
353
+ /**
354
+ * Read the declarations made in this phase's current cycle. Never throws: anything
355
+ * that is not a 200 with a body `ownerWaitDeclarationsSchema` accepts — unreachable, a
356
+ * bad status, a body this CLI cannot read — is `null`, which `ownerWaitCloseLines`
357
+ * reads as a failed read (its own sentence), never as "none were made".
358
+ */
359
+ export declare function readCloseOwnerWaitDeclarations(credential: RepoCredential, phase: string): Promise<readonly OwnerWaitDeclaration[] | null>;
360
+ /**
361
+ * One line per declaration made in the phase, oldest first, after the time totals
362
+ * (`fixed-list-and-one-sitting` AC3's *At close*): `Waited for you: {item} — the agent
363
+ * asked: "{question}"`. A read that failed prints the one sentence that says so and
364
+ * stops there; with no declarations, and nothing failed, this prints nothing — a close
365
+ * with none of them carries on silently, exactly as the spec says.
366
+ */
367
+ export declare function ownerWaitCloseLines(declarations: readonly OwnerWaitDeclaration[] | null): string[];
368
+ /**
369
+ * C6, printed once the review has opened, only when it lists one or more calls — the
370
+ * phase's work read (`phase-work.ts`'s `readPhaseWork`) is the one count, never
371
+ * recomputed here. A failed read of it prints nothing: `bin.ts`'s caller never prints
372
+ * this line at all rather than guess at a count it could not read.
373
+ */
374
+ export declare function callsListedLine(n: number): string;
323
375
  //# sourceMappingURL=close-phase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"close-phase.d.ts","sourceRoot":"","sources":["../src/close-phase.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAGH,OAAO,EASL,kBAAkB,EAClB,KAAK,iBAAiB,EAEtB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAelB,KAAK,WAAW,EAIjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGtD;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAElG;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,gBAAkE,CAAC;AAE/F;;;;;;;;;;GAUG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG,WAAW,GAAG,YAAY,CAAC;AAE3E,qFAAqF;AACrF,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAC9B;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,eAAe,GAAG,WAAW,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,KAAK,E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AAM,GAAG,eAAe,CA2FhH;AASD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAKnF;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAoBjH;AAuBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,MAAM,EAAE,CAqBrE;AAID;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAK/F;AAED;;;;;GAKG;AACH,wBAAsB,8BAA8B,CAClD,UAAU,EAAE,cAAc,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,SAAS,oBAAoB,EAAE,GAAG,IAAI,CAAC,CAqBjD;AASD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,YAAY,EAAE,SAAS,oBAAoB,EAAE,GAAG,IAAI,GAAG,MAAM,EAAE,CAGlG;AAID;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEjD"}
@@ -0,0 +1,34 @@
1
+ /**
2
+ * `halfcycle doctor` — five checks, in order, one line each, and one closing line
3
+ * (`setup-preview-and-doctor` AC4, AC5, the words under *The diagnostic*).
4
+ *
5
+ * 1. Set up — the project's files are in place (read only).
6
+ * 2. Signed in — from the connection verb's answer (`check-connection`).
7
+ * 3. Connected — from the same answer.
8
+ * 4. Checks running — the project's own hook wrapper is started with the verb.
9
+ * 5. Up to date — the pinned version against the version running this.
10
+ *
11
+ * The check that starts the wrapper (4) runs BEFORE 2 and 3, because the verb it starts
12
+ * answers both; it is still printed fourth. A check that depends on one that failed is
13
+ * printed as "not checked, because …" (D7) instead of being run.
14
+ *
15
+ * `doctor` changes nothing in the folder. It reaches the runner only by running the
16
+ * project's wrapper, never by importing it (INV-001). The words for the sign-in and
17
+ * connection outcomes are the runner's own sentences, passed through unchanged.
18
+ *
19
+ * INV-001: Node builtins, `@halfcycle/core`, `@halfcycle/events` and this package's own
20
+ * modules only.
21
+ */
22
+ /** What `doctor` reads the run's surroundings from. A test names its own; the CLI passes the real ones. */
23
+ export interface DoctorOptions {
24
+ readonly env: NodeJS.ProcessEnv;
25
+ readonly platform: NodeJS.Platform;
26
+ }
27
+ /** The text to print, and the exit status: 0 only when every one of the five checks says yes. */
28
+ export interface DoctorReport {
29
+ readonly text: string;
30
+ readonly exitCode: 0 | 1;
31
+ }
32
+ /** Run `doctor` in `root`. Writes nothing. */
33
+ export declare function runDoctor(root: string, options: DoctorOptions): DoctorReport;
34
+ //# sourceMappingURL=doctor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../src/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAqBH,2GAA2G;AAC3G,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,CAAC;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;CACpC;AAED,iGAAiG;AACjG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,CAAC;CAC1B;AA4BD,8CAA8C;AAC9C,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,YAAY,CA4B5E"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The folder refusals the install arm and the preview share (`setup-preview-and-doctor`
3
+ * AC2). Each one is the sentence the install prints before it sends or writes anything,
4
+ * built here once so the preview refuses with the same words, never a copy of them.
5
+ *
6
+ * Every function returns the text WITHOUT the trailing newline; `bin.ts` writes it to
7
+ * standard error and exits 1, as it always has. INV-001: Node builtins and this package's
8
+ * own modules only.
9
+ */
10
+ /** The target does not exist. */
11
+ export declare function folderMissingRefusal(targetRepo: string): string;
12
+ /** The target exists and is a file, not a folder. */
13
+ export declare function folderIsFileRefusal(targetRepo: string): string;
14
+ /** The target is the product's own source tree, and the form given is not the one self-build form. */
15
+ export declare function monorepoRefusal(targetRepo: string): string;
16
+ /** The target is the user's home folder. */
17
+ export declare function homeFolderRefusal(targetRepo: string): string;
18
+ /**
19
+ * Is `dir` the user's home folder (windows-install-hygiene AC2)?
20
+ *
21
+ * `npx halfcycle` run in the home folder would put the project's `.halfcycle/`
22
+ * on top of the machine store, one folder serving both jobs. Compared by
23
+ * `realpathSync` so a symlinked home still matches, and lowercased on Windows, where the
24
+ * filesystem is case-insensitive. Absence (an unreadable home) is the safe default.
25
+ */
26
+ export declare function isHomeFolder(dir: string): boolean;
27
+ //# sourceMappingURL=folder-refusals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"folder-refusals.d.ts","sourceRoot":"","sources":["../src/folder-refusals.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAKH,iCAAiC;AACjC,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,qDAAqD;AACrD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,sGAAsG;AACtG,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAQ1D;AAED,4CAA4C;AAC5C,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAQjD"}
@@ -211,6 +211,33 @@ export declare function mintOrReadIdentity(targetRepoRoot: string): {
211
211
  * never sees a half-written file.
212
212
  */
213
213
  export declare function repairRemoteCredential(targetRepoRoot: string): void;
214
+ /**
215
+ * The read half of `repairRemoteCredential`: the bytes the G1 repair would write over
216
+ * an existing `project.json`, or `null` when it would leave the file alone (absent,
217
+ * unreadable, not an object, or a remote that is already clean). Reads only, so the
218
+ * installer's plan (`install-plan.ts`) can say `change` before anything is written.
219
+ */
220
+ export declare function plannedRemoteRepair(targetRepoRoot: string): string | null;
221
+ /**
222
+ * The write half of the G1 repair: `text` replaces the existing `project.json` through
223
+ * a temporary file and a rename, best-effort and silent (see `repairRemoteCredential`).
224
+ */
225
+ export declare function replaceProjectIdentityFile(targetRepoRoot: string, text: string): void;
226
+ /**
227
+ * What the installer will do to `.halfcycle/project.json`, decided by reading alone
228
+ * (`setup-preview-and-doctor` AC1): `add` when it is absent, with `after` a freshly
229
+ * minted identity (a new id plus the repository's fingerprint, read with git);
230
+ * `change` when the G1 repair would strip a credential from its remote, with `after`
231
+ * the repaired bytes; `leave` otherwise, with `after` the file as it is, or `null`
232
+ * when it cannot be read. `install()` and the create arm's `claimFolderId` both write
233
+ * from this, so neither decides on its own.
234
+ */
235
+ export interface PlannedProjectIdentity {
236
+ readonly action: 'add' | 'change' | 'leave';
237
+ readonly after: string | null;
238
+ }
239
+ /** Decide `PlannedProjectIdentity` for this folder. Reads files and read-only git; writes nothing. */
240
+ export declare function planProjectIdentity(targetRepoRoot: string): PlannedProjectIdentity;
214
241
  /**
215
242
  * The ONE serializer for `project.json`. `createProjectIdentityFile` below calls
216
243
  * it to produce the bytes for a freshly minted identity; `repairRemoteCredential`
@@ -240,9 +267,12 @@ export declare function serializeProjectIdentity(identity: ProjectIdentity): str
240
267
  * re-run in a folder that has since become read-only is refused before any request,
241
268
  * not after a project was created. The temporary file is always removed.
242
269
  *
270
+ * `text`, when given, is the identity the installer's plan already minted
271
+ * (`planProjectIdentity`), so the bytes that land are the bytes the plan listed.
272
+ *
243
273
  * Throws whatever the filesystem throws for a folder it cannot write to; the caller
244
274
  * (`pre-create-checks.ts`) turns that into a sentence. Reading and judging the file
245
275
  * that ends up in place is the caller's too — this module imports only builtins.
246
276
  */
247
- export declare function createProjectIdentityFile(targetRepoRoot: string): void;
277
+ export declare function createProjectIdentityFile(targetRepoRoot: string, text?: string): void;
248
278
  //# sourceMappingURL=identity.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAeH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,qBAAqB,QAGF,CAAC;AAEjC,uFAAuF;AACvF,eAAO,MAAM,oBAAoB,4BAA4B,CAAC;AAE9D,kFAAkF;AAClF,MAAM,WAAW,eAAe;IAC9B,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gEAAgE;IAChE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AA6BD,gFAAgF;AAChF,wBAAgB,kBAAkB,IAAI,MAAM,CAAC,UAAU,CAItD;AAqBD,sFAAsF;AACtF,wBAAgB,cAAc,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMpE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,IAAI,OAAO,CAOxC;AAED,oCAAoC;AACpC,wBAAgB,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEhE;AA0BD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAmB3E;AAED;;;;;;;;GAQG;AACH,wB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