@artblocks/abx-cli 0.1.0-alpha.40 → 0.1.0-alpha.41

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 (72) hide show
  1. package/CHANGELOG.md +145 -0
  2. package/assets/renderer-scaffold/README.md +12 -0
  3. package/assets/renderer-scaffold/foundry.toml +4 -0
  4. package/assets/renderer-scaffold/script/Preview.s.sol +99 -0
  5. package/dist/capabilities.d.ts +9 -4
  6. package/dist/capabilities.d.ts.map +1 -1
  7. package/dist/capabilities.js +13 -4
  8. package/dist/capabilities.js.map +1 -1
  9. package/dist/commands/deploy.d.ts.map +1 -1
  10. package/dist/commands/deploy.js +731 -65
  11. package/dist/commands/deploy.js.map +1 -1
  12. package/dist/commands/maintenance.d.ts +4 -0
  13. package/dist/commands/maintenance.d.ts.map +1 -0
  14. package/dist/commands/maintenance.js +114 -0
  15. package/dist/commands/maintenance.js.map +1 -0
  16. package/dist/commands/project.d.ts +175 -3
  17. package/dist/commands/project.d.ts.map +1 -1
  18. package/dist/commands/project.js +333 -27
  19. package/dist/commands/project.js.map +1 -1
  20. package/dist/commands/reads.d.ts +21 -0
  21. package/dist/commands/reads.d.ts.map +1 -1
  22. package/dist/commands/reads.js +171 -4
  23. package/dist/commands/reads.js.map +1 -1
  24. package/dist/commands/scaffold.d.ts.map +1 -1
  25. package/dist/commands/scaffold.js +5 -0
  26. package/dist/commands/scaffold.js.map +1 -1
  27. package/dist/commands/service.d.ts.map +1 -1
  28. package/dist/commands/service.js +7 -0
  29. package/dist/commands/service.js.map +1 -1
  30. package/dist/commands/storage.d.ts.map +1 -1
  31. package/dist/commands/storage.js +32 -3
  32. package/dist/commands/storage.js.map +1 -1
  33. package/dist/commands/submit-app.d.ts +43 -0
  34. package/dist/commands/submit-app.d.ts.map +1 -1
  35. package/dist/commands/submit-app.js +115 -6
  36. package/dist/commands/submit-app.js.map +1 -1
  37. package/dist/config.d.ts +16 -1
  38. package/dist/config.d.ts.map +1 -1
  39. package/dist/config.js +73 -7
  40. package/dist/config.js.map +1 -1
  41. package/dist/deploy-plan.d.ts +150 -0
  42. package/dist/deploy-plan.d.ts.map +1 -0
  43. package/dist/deploy-plan.js +31 -0
  44. package/dist/deploy-plan.js.map +1 -0
  45. package/dist/flag-allowlists.d.ts.map +1 -1
  46. package/dist/flag-allowlists.js +5 -1
  47. package/dist/flag-allowlists.js.map +1 -1
  48. package/dist/flags.d.ts +6 -0
  49. package/dist/flags.d.ts.map +1 -1
  50. package/dist/flags.js +14 -0
  51. package/dist/flags.js.map +1 -1
  52. package/dist/jsonout.d.ts.map +1 -1
  53. package/dist/jsonout.js +11 -0
  54. package/dist/jsonout.js.map +1 -1
  55. package/dist/main.js +46 -7
  56. package/dist/main.js.map +1 -1
  57. package/dist/ownerops.d.ts +69 -0
  58. package/dist/ownerops.d.ts.map +1 -1
  59. package/dist/ownerops.js +221 -17
  60. package/dist/ownerops.js.map +1 -1
  61. package/dist/script-chunks.d.ts +1 -1
  62. package/dist/script-chunks.d.ts.map +1 -1
  63. package/dist/script-chunks.js +2 -2
  64. package/dist/script-chunks.js.map +1 -1
  65. package/package.json +6 -6
  66. package/skill/SKILL.md +6 -4
  67. package/skill/reference/code.md +17 -8
  68. package/skill/reference/deploy.md +9 -2
  69. package/skill/reference/diagnose.md +15 -2
  70. package/skill/reference/hosting.md +26 -0
  71. package/skill/reference/operate.md +43 -4
  72. package/skill/reference/setup.md +14 -0
@@ -0,0 +1,4 @@
1
+ import { type Flags } from '../flags.js';
2
+ export declare function cmdVacuum(rest: string[], flags: Flags): Promise<void>;
3
+ export declare const VACUUM_HELP: string;
4
+ //# sourceMappingURL=maintenance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"maintenance.d.ts","sourceRoot":"","sources":["../../src/commands/maintenance.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAC,KAAK,KAAK,EAAC,MAAM,aAAa,CAAC;AAiBvC,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAc3E;AA8DD,eAAO,MAAM,WAAW,QAQ8D,CAAC"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * `abx vacuum` — SQLite maintenance for the local reference store (issue #113).
3
+ *
4
+ * Two halves, matching `SqliteStore`'s split in `packages/indexer/src/store.ts`:
5
+ * - `abx vacuum convert` the one-time, EXPLICIT full `VACUUM` for a store stuck at
6
+ * `auto_vacuum='none'` — every store created before this repo started
7
+ * setting the pragma ahead of schema creation (and, until the pragma
8
+ * ordering bug this issue also fixed, every store created since too —
9
+ * see the comment on `SCHEMA` in store.ts). A full VACUUM rewrites the
10
+ * ENTIRE database file and can briefly need up to ~2x its on-disk size,
11
+ * so it never runs on its own anywhere in this codebase — this command
12
+ * is the only place it happens, and only when an operator asks for it.
13
+ * - `abx vacuum incremental` a manual, bounded `PRAGMA incremental_vacuum` pass — the SAME bounded
14
+ * mechanism `abx serve` already runs automatically BETWEEN watch-loop
15
+ * ticks (`SelfHostIndexer.startVacuumMaintenance`), exposed here for an
16
+ * operator who wants one pass on demand (right after `convert`, or on a
17
+ * node that isn't running `abx serve`'s watcher at all).
18
+ *
19
+ * `abx vacuum` (or `abx vacuum status`) alone is read-only: it just reports where the store stands,
20
+ * so an operator can decide whether either half applies before running anything.
21
+ */
22
+ import { DEFAULT_INCREMENTAL_VACUUM_PAGES, SqliteStore } from '@artblocks/abx-indexer';
23
+ import { localIndexer } from '../config.js';
24
+ import { bold, dim, g, info, ok, warn } from '../output.js';
25
+ /** Vacuuming is SQLite-specific (see store.ts's docstring on why these methods aren't on the
26
+ * generic `Store` interface) — a platform-scale Postgres deploy has its own manual VACUUM story
27
+ * outside this codebase, so this command has nothing to do there and says so plainly. */
28
+ function requireSqliteStore() {
29
+ const store = localIndexer().store;
30
+ if (!(store instanceof SqliteStore)) {
31
+ throw new Error('abx vacuum applies to the local SQLite reference store only — this node is backed by something else, ' +
32
+ 'which owns its own maintenance story.');
33
+ }
34
+ return store;
35
+ }
36
+ export async function cmdVacuum(rest, flags) {
37
+ const sub = rest[0];
38
+ switch (sub) {
39
+ case undefined:
40
+ case 'status':
41
+ return cmdVacuumStatus();
42
+ case 'convert':
43
+ return cmdVacuumConvert();
44
+ case 'incremental':
45
+ return cmdVacuumIncremental(flags);
46
+ default:
47
+ console.error(VACUUM_USAGE);
48
+ process.exitCode = 1;
49
+ }
50
+ }
51
+ function cmdVacuumStatus() {
52
+ const store = requireSqliteStore();
53
+ const stats = store.vacuumStats();
54
+ console.log(`store ${store.path}`);
55
+ console.log(`auto_vacuum ${bold(stats.mode)}`);
56
+ console.log(`page_count ${stats.pageCount}`);
57
+ console.log(`freelist ${stats.freelistPages} page(s)`);
58
+ console.log('');
59
+ if (stats.mode === 'none') {
60
+ warn(`this store predates incremental auto-vacuum and needs a one-time conversion: ${g('abx vacuum convert')}`);
61
+ }
62
+ else if (stats.freelistPages > 0) {
63
+ info(`${stats.freelistPages} freed page(s) reclaimable — abx serve does this automatically between watch ticks; ` +
64
+ `run one pass now with ${g('abx vacuum incremental')}`);
65
+ }
66
+ else {
67
+ ok('nothing to reclaim');
68
+ }
69
+ }
70
+ function cmdVacuumConvert() {
71
+ const store = requireSqliteStore();
72
+ const before = store.vacuumStats();
73
+ if (before.mode !== 'none') {
74
+ ok(`already converted — auto_vacuum is '${before.mode}'; nothing to do.`);
75
+ return;
76
+ }
77
+ console.log(`${bold('abx vacuum convert')} runs a full SQLite ${bold('VACUUM')} on ${store.path} to enable incremental ` +
78
+ `auto-vacuum.\n` +
79
+ `${dim(`this REWRITES THE ENTIRE FILE (currently ${before.pageCount} page(s)) and can briefly need up to`)}\n` +
80
+ `${dim('~2x its on-disk size while it runs. This is a one-time operation — after it, freed pages reclaim')}\n` +
81
+ `${dim(`incrementally instead (${g('abx vacuum incremental')}, or automatically between abx serve's watch ticks).`)}\n`);
82
+ console.log(`converting… (auto_vacuum: none → incremental)`);
83
+ const mode = store.vacuumConvert();
84
+ const after = store.vacuumStats();
85
+ ok(`done — auto_vacuum is now '${mode}'; ${before.pageCount} → ${after.pageCount} page(s).`);
86
+ }
87
+ function cmdVacuumIncremental(flags) {
88
+ const store = requireSqliteStore();
89
+ const maxPages = flags.pages !== undefined ? Number(flags.pages) : DEFAULT_INCREMENTAL_VACUUM_PAGES;
90
+ if (!Number.isFinite(maxPages) || maxPages <= 0) {
91
+ throw new Error(`--pages must be a positive number (got ${JSON.stringify(flags.pages)})`);
92
+ }
93
+ const mode = store.autoVacuumMode();
94
+ if (mode !== 'incremental') {
95
+ warn(`auto_vacuum is '${mode}' — incremental_vacuum has nothing to do until this store is converted: ${g('abx vacuum convert')}`);
96
+ return;
97
+ }
98
+ const reclaimed = store.runIncrementalVacuum(maxPages);
99
+ if (reclaimed > 0)
100
+ ok(`reclaimed ${reclaimed} page(s) (bounded to ${maxPages} this pass)`);
101
+ else
102
+ info('nothing to reclaim');
103
+ }
104
+ const VACUUM_USAGE = `usage: abx vacuum [status|convert|incremental] [--pages <n>]`;
105
+ export const VACUUM_HELP = `
106
+ ${bold('abx vacuum')} [status|convert|incremental] ${dim('— SQLite maintenance for the local reference store; read-only unless a write happens below')}
107
+ ${g('abx vacuum')} ${dim('(default: status)')} report auto_vacuum mode + page/freelist counts
108
+ ${g('abx vacuum convert')} one-time, EXPLICIT full VACUUM for a store stuck at auto_vacuum='none' — rewrites
109
+ the whole file; can briefly need up to ~2x its on-disk size. Never runs automatically.
110
+ ${g('abx vacuum incremental')} [--pages <n>] one bounded PRAGMA incremental_vacuum pass (default ${DEFAULT_INCREMENTAL_VACUUM_PAGES}
111
+ pages) — the same bounded reclaim \`abx serve\` already runs automatically BETWEEN watch
112
+ ticks; use this on demand (after \`convert\`, or on a node not running \`abx serve\`).
113
+ ${dim('c.f. site/content/docs/using-abx/self-hosting.mdx → SQLite maintenance.')}`;
114
+ //# sourceMappingURL=maintenance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mainten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AW,GAAG;IACvB,IAAI,CAAC,YAAY,CAAC,iCAAiC,GAAG,CAAC,4FAA4F,CAAC;MAClJ,CAAC,CAAC,YAAY,CAAC,iBAAiB,GAAG,CAAC,mBAAmB,CAAC;MACxD,CAAC,CAAC,oBAAoB,CAAC;;MAEvB,CAAC,CAAC,wBAAwB,CAAC,uEAAuE,gCAAgC;;;MAGlI,GAAG,CAAC,yEAAyE,CAAC,EAAE,CAAC"}
@@ -1,12 +1,61 @@
1
- import { type Address } from '@artblocks/abx-sdk';
1
+ import { type Address, type PublicClient, type MetadataField } from '@artblocks/abx-sdk';
2
2
  import { type Flags } from '../flags.js';
3
3
  import { type RemoteTarget } from '../remote.js';
4
4
  export declare function cmdPredict(flags: Flags): Promise<void>;
5
5
  export declare function cmdAdd(address: Address | undefined, flags: Flags): Promise<void>;
6
6
  export declare function cmdIndex(address: Address | undefined, flags: Flags): Promise<void>;
7
7
  export declare function cmdVerify(address: Address | undefined, flags: Flags): Promise<void>;
8
+ export type AvailabilityStatus = 'available' | 'partial' | 'unavailable' | 'unknown';
9
+ export interface AvailabilityVerdict {
10
+ status: AvailabilityStatus;
11
+ note: string;
12
+ }
13
+ /**
14
+ * Pure by design — every caller (`cmdVerifyBody`'s local lane and `cmdVerifyRemote`'s hosted lane)
15
+ * feeds it facts it already gathered rather than each re-deriving its own verdict, so the two
16
+ * lanes' JSON payloads read the same word for the same situation.
17
+ *
18
+ * `isCode` selects which signal decides the verdict: a code project's render presence
19
+ * (`minted`/`present`), or — for everything else — whether a byte-check actually ran
20
+ * (`anyCheck`) versus a locator this run could not independently re-hash (`unrecomputablePointers`).
21
+ * The two signals are never combined into one number on purpose: "3 of 5 renders present" and "2
22
+ * locator commitments unconfirmed" are different facts about different projects, and mixing them
23
+ * would produce a verdict that answers neither question honestly.
24
+ */
25
+ export declare function computeAvailability(opts: {
26
+ isCode: boolean;
27
+ minted: number;
28
+ present: number;
29
+ anyCheck: boolean;
30
+ unrecomputablePointers: number;
31
+ }): AvailabilityVerdict;
32
+ /**
33
+ * Does this token's `image` field carry a locator commitment `verifyProject` never produced a
34
+ * check for? Exported and pure (a plain `fields` array in, a verdict out — no chain, no indexer)
35
+ * so #112's three-way distinction is unit-testable directly, rather than only reachable through a
36
+ * full `cmdVerifyBody` run against real chain state.
37
+ *
38
+ * Returns the representation name to report (`ipfs`/`arweave`/`url`/`url-template`) when the image
39
+ * field is a bare locator, else `null` — including when there's no `image` field at all, which is
40
+ * "no commitment", a different fact from "an unrecomputable one".
41
+ */
42
+ export declare function pointerOnlyImageCheck(fields: MetadataField[]): string | null;
8
43
  export declare function cmdVerifyBody(address: Address, flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
9
- export declare function cmdVerifyRemote(address: Address, remote: RemoteTarget): Promise<void>;
44
+ export declare function cmdVerifyRemote(address: Address, remote: RemoteTarget, emit: (p: Record<string, unknown>) => void): Promise<void>;
45
+ /** What {@link reportRemoteByteIntegrity} found, structured for the JSON payload as well as its own
46
+ * prose. `status` deliberately has a 4th value the local lane's `contentIntegrity` doesn't need:
47
+ * `'not-checked'` — no credential, a rejected token, an older node with no `/verify` route, or an
48
+ * unreachable endpoint. That is a DIFFERENT fact from `'no-commitments'` (the route answered and
49
+ * said there's nothing to check) and must never collapse into it — "we didn't ask" and "we asked
50
+ * and there was nothing" are different reasons for the same empty result. */
51
+ export interface RemoteByteIntegrity {
52
+ status: 'ok' | 'mismatch' | 'no-commitments' | 'not-checked';
53
+ checks: Array<{
54
+ tokenId: string;
55
+ kind: string;
56
+ verified: boolean;
57
+ }>;
58
+ }
10
59
  /**
11
60
  * The half `abx verify --remote` was missing: do the served BYTES still hash to the on-chain
12
61
  * commitment? Everything above it checks renders (is a thumbnail current, is it a placeholder) — a
@@ -18,7 +67,7 @@ export declare function cmdVerifyRemote(address: Address, remote: RemoteTarget):
18
67
  * outbound fetches). When we can't reach that — no credential, or an older node — say plainly that
19
68
  * byte integrity was NOT checked rather than leaving the ✓ above to imply it was.
20
69
  */
21
- export declare function reportRemoteByteIntegrity(address: Address, remote: RemoteTarget, base: string): Promise<void>;
70
+ export declare function reportRemoteByteIntegrity(address: Address, remote: RemoteTarget, base: string): Promise<RemoteByteIntegrity>;
22
71
  export declare const STATE_ABI: readonly [{
23
72
  readonly type: "function";
24
73
  readonly name: "owner";
@@ -123,6 +172,48 @@ export declare const STATE_ABI: readonly [{
123
172
  readonly outputs: readonly [{
124
173
  readonly type: "address";
125
174
  }];
175
+ }, {
176
+ readonly type: "function";
177
+ readonly name: "tokenURILocked";
178
+ readonly stateMutability: "view";
179
+ readonly inputs: readonly [];
180
+ readonly outputs: readonly [{
181
+ readonly type: "bool";
182
+ }];
183
+ }, {
184
+ readonly type: "function";
185
+ readonly name: "contractURILocked";
186
+ readonly stateMutability: "view";
187
+ readonly inputs: readonly [];
188
+ readonly outputs: readonly [{
189
+ readonly type: "bool";
190
+ }];
191
+ }, {
192
+ readonly type: "function";
193
+ readonly name: "scriptLocked";
194
+ readonly stateMutability: "view";
195
+ readonly inputs: readonly [];
196
+ readonly outputs: readonly [{
197
+ readonly type: "bool";
198
+ }];
199
+ }, {
200
+ readonly type: "function";
201
+ readonly name: "dependenciesLocked";
202
+ readonly stateMutability: "view";
203
+ readonly inputs: readonly [];
204
+ readonly outputs: readonly [{
205
+ readonly type: "bool";
206
+ }];
207
+ }, {
208
+ readonly type: "function";
209
+ readonly name: "contractFieldLocked";
210
+ readonly stateMutability: "view";
211
+ readonly inputs: readonly [{
212
+ readonly type: "bytes32";
213
+ }];
214
+ readonly outputs: readonly [{
215
+ readonly type: "bool";
216
+ }];
126
217
  }];
127
218
  /** The edition twin of {@link STATE_ABI} — `owner`/`maxInvocations`/`paused`/`minter`/
128
219
  * `primaryPayee`/`tokenURIRenderer`/`royaltyInfo` are shared, unchanged, function names (see
@@ -238,7 +329,87 @@ export declare const EDITION_STATE_ABI: readonly [{
238
329
  readonly outputs: readonly [{
239
330
  readonly type: "address";
240
331
  }];
332
+ }, {
333
+ readonly type: "function";
334
+ readonly name: "tokenURILocked";
335
+ readonly stateMutability: "view";
336
+ readonly inputs: readonly [];
337
+ readonly outputs: readonly [{
338
+ readonly type: "bool";
339
+ }];
340
+ }, {
341
+ readonly type: "function";
342
+ readonly name: "contractURILocked";
343
+ readonly stateMutability: "view";
344
+ readonly inputs: readonly [];
345
+ readonly outputs: readonly [{
346
+ readonly type: "bool";
347
+ }];
348
+ }, {
349
+ readonly type: "function";
350
+ readonly name: "scriptLocked";
351
+ readonly stateMutability: "view";
352
+ readonly inputs: readonly [];
353
+ readonly outputs: readonly [{
354
+ readonly type: "bool";
355
+ }];
356
+ }, {
357
+ readonly type: "function";
358
+ readonly name: "dependenciesLocked";
359
+ readonly stateMutability: "view";
360
+ readonly inputs: readonly [];
361
+ readonly outputs: readonly [{
362
+ readonly type: "bool";
363
+ }];
364
+ }, {
365
+ readonly type: "function";
366
+ readonly name: "contractFieldLocked";
367
+ readonly stateMutability: "view";
368
+ readonly inputs: readonly [{
369
+ readonly type: "bytes32";
370
+ }];
371
+ readonly outputs: readonly [{
372
+ readonly type: "bool";
373
+ }];
241
374
  }];
375
+ /** One boolean lock, tri-state: `true` (frozen forever) · `false` (open — the owner can still
376
+ * change it) · `null` (the read failed — an RPC refusal, or a wrong dialect). Never collapse
377
+ * `null` into `false`: an unread lock is not proof it's off, and `state`'s whole job here is to
378
+ * keep that distinction visible all the way to the JSON payload. */
379
+ type LockRead = boolean | null;
380
+ /** Every irreversible lock a collection can carry, as read straight from chain. */
381
+ export interface CollectionLocks {
382
+ tokenURI: LockRead;
383
+ contractURI: LockRead;
384
+ /** The bounded METADATA_FIELD scan — see {@link readFieldLocks}'s doc for the caveat this carries. */
385
+ fields: {
386
+ field: string;
387
+ locked: LockRead;
388
+ }[];
389
+ /** `null` (the OBJECT, not the inner `locked`) ⇒ not applicable: this contract has no on-chain
390
+ * script surface at all (not a code project), a different fact from "unknown" ({@link LockRead}'s
391
+ * `null`), which is reserved for "the surface exists but the read failed". */
392
+ script: {
393
+ locked: LockRead;
394
+ } | null;
395
+ dependencies: {
396
+ locked: LockRead;
397
+ } | null;
398
+ }
399
+ /**
400
+ * Read every applicable irreversible lock for one collection: token/contract URI config, the
401
+ * bounded standard field set, and — for a code project — the script and dependency freezes.
402
+ * `paramHooks.locked` is deliberately NOT read here: `cmdStateBody`/`cmdStateEditionBody` already
403
+ * read it (`readParamHooksLocked`) as part of the existing param-hooks readout, and re-reading it
404
+ * would cost a second `eth_call` for a fact already on hand — see the callers, which pass it into
405
+ * {@link printLocks} instead.
406
+ *
407
+ * `isCode` gates `scriptLocked`/`dependenciesLocked`: those getters exist ONLY on the two code
408
+ * twins (SeriesCode/EditionCode), so asking a plain image/Series contract for them isn't a failed
409
+ * read to report as "unknown" — it's a surface that was never there, reported as `null` (not
410
+ * applicable) via the OUTER object rather than the boolean inside it.
411
+ */
412
+ export declare function readCollectionLocks(publicClient: PublicClient, address: Address, abi: readonly unknown[], isCode: boolean): Promise<CollectionLocks>;
242
413
  export declare function cmdState(address: Address | undefined, flags: Flags): Promise<void>;
243
414
  export declare function cmdStateBody(address: Address, flags: Flags, emit: (p: Record<string, unknown>) => void): Promise<void>;
244
415
  /**
@@ -254,4 +425,5 @@ export declare function cmdStatus(address: Address | undefined, flags: Flags): P
254
425
  * can see. `--watch` tails until everything reaches a terminal state. */
255
426
  export declare function cmdStatusRemote(address: Address | undefined, remote: RemoteTarget, flags: Flags): Promise<void>;
256
427
  export declare function cmdForget(address: Address | undefined, flags: Flags): Promise<void>;
428
+ export {};
257
429
  //# sourceMappingURL=project.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../src/commands/project.ts"],"names":[],"mappings":"AAQA,OAAO,EAGL,KAAK,OAAO,EA+Bb,MAAM,oBAAoB,CAAC;AAgB5B,OAAO,EAAC,KAAK,KAAK,EAA0B,MAAM,aAAa,CAAC;AAOhE,OAAO,EACL,KAAK,YAAY,EAalB,MAAM,cAAc,CAAC;AAQtB,wBAAs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