@agent-plan/core 0.2.18 → 0.2.19-next.1
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/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/naming.d.ts +22 -0
- package/dist/naming.d.ts.map +1 -1
- package/dist/naming.js +36 -1
- package/dist/plan-store.d.ts +70 -5
- package/dist/plan-store.d.ts.map +1 -1
- package/dist/plan-store.js +406 -107
- package/dist/recap.d.ts +32 -0
- package/dist/recap.d.ts.map +1 -0
- package/dist/recap.js +105 -0
- package/dist/refs.d.ts +24 -0
- package/dist/refs.d.ts.map +1 -0
- package/dist/refs.js +42 -0
- package/dist/schema.d.ts +117 -27
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +13 -2
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export * from "./naming.js";
|
|
2
|
+
export * from "./refs.js";
|
|
2
3
|
export * from "./schema.js";
|
|
3
|
-
export
|
|
4
|
+
export * from "./recap.js";
|
|
5
|
+
export { PlanStore, PlanStoreError, setWriteBusyHook, setWriteNotifyHook, migrateToUuids, withFeatureLock, type PhaseHandoffSummary } from "./plan-store.js";
|
|
4
6
|
export { PlanRenderer } from "./renderer.js";
|
|
5
7
|
export { ExportService } from "./export-service.js";
|
|
6
8
|
export type { CodebaseProfile, ResumeFocus, ActivityEntry, ActivityLog, AmbientFacts } from "./schema.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,cAAc,EAAE,eAAe,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC7J,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,YAAY,EAAE,eAAe,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export * from "./naming.js";
|
|
2
|
+
export * from "./refs.js";
|
|
2
3
|
export * from "./schema.js";
|
|
4
|
+
export * from "./recap.js";
|
|
3
5
|
export { PlanStore, PlanStoreError, setWriteBusyHook, setWriteNotifyHook, migrateToUuids, withFeatureLock } from "./plan-store.js";
|
|
4
6
|
export { PlanRenderer } from "./renderer.js";
|
|
5
7
|
export { ExportService } from "./export-service.js";
|
package/dist/naming.d.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
/** Crockford Base32 alphabet — excludes ambiguous characters 0/O/1/I/L
|
|
2
|
+
* to minimize human transcription errors. 32 symbols → 5 chars = 33M combos. */
|
|
3
|
+
export declare const CROCKFORD_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
4
|
+
export declare const SHORT_ID_LENGTH = 5;
|
|
5
|
+
export declare const SHORT_ID_PATTERN: RegExp;
|
|
6
|
+
/** Generate a globally-unique short id (5 chars, Crockford Base32, e.g. `UUXD1`-style
|
|
7
|
+
* but without 0/1/I/O). Retries until the id is not in `existing` (project-scoped
|
|
8
|
+
* collision guard). Throws only in the impossible saturation case (~50 retries). */
|
|
9
|
+
export declare function createShortId(existing?: Set<string>): string;
|
|
1
10
|
export declare function normalizeSlug(input: string): string;
|
|
2
11
|
/** Normalize, truncate to maxLen, and strip dangling dashes so the result
|
|
3
12
|
* always satisfies SlugSchema (/^[a-z0-9]+(?:-[a-z0-9]+)*$/). Returns fallback
|
|
@@ -7,6 +16,19 @@ export declare function normalizeSlug(input: string): string;
|
|
|
7
16
|
export declare function clampSlug(input: string, maxLen?: number, fallback?: string): string;
|
|
8
17
|
export declare function formatTwoDigitNumber(value: number): string;
|
|
9
18
|
export declare function formatThreeDigitNumber(value: number): string;
|
|
19
|
+
/** Human-readable phase composite ref: `P00x` or `P00x(F00x)` when the parent
|
|
20
|
+
* feature number is known. Harness-agnostic (used by core handoff listing +
|
|
21
|
+
* adapters). */
|
|
22
|
+
export declare function formatPhaseRef(phaseNumber: number, featureNumber?: number): string;
|
|
23
|
+
/** Human-readable feature ref: `F00x`. Harness-agnostic. */
|
|
24
|
+
export declare function formatFeatureRef(featureNumber: number): string;
|
|
25
|
+
/** Find the parent feature's number for a phase (for P00x(F00x) composite refs). */
|
|
26
|
+
export declare function featureNumberOfPhase(phase: {
|
|
27
|
+
featureId?: string | null | undefined;
|
|
28
|
+
}, features: {
|
|
29
|
+
id: string;
|
|
30
|
+
number: number;
|
|
31
|
+
}[]): number | undefined;
|
|
10
32
|
export declare function createPhaseId(): string;
|
|
11
33
|
/** True for legacy phase ids that are NOT feature-scoped (e.g. `phase-01-...`). */
|
|
12
34
|
export declare function isLegacyPhaseId(phaseId: string): boolean;
|
package/dist/naming.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming.d.ts","sourceRoot":"","sources":["../src/naming.ts"],"names":[],"mappings":"AAKA,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOnD;AAED;;;;8BAI8B;AAC9B,wBAAgB,SAAS,CAAC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KAAK,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE5D;AAED;;iBAEiB;AACjB,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAGlF;AAED,4DAA4D;AAC5D,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED,oFAAoF;AACpF,wBAAgB,oBAAoB,CAClC,KAAK,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;CAAE,EAChD,QAAQ,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EAAE,GACzC,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,aAAa,IAAI,MAAM,CAEtC;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAExD;AAED,0FAA0F;AAC1F,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGtF;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAE3F"}
|
package/dist/naming.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
1
|
+
import { randomInt, randomUUID } from "node:crypto";
|
|
2
2
|
const SLUG_PATTERN = /[^a-z0-9]+/g;
|
|
3
3
|
const MULTI_DASH_PATTERN = /-+/g;
|
|
4
|
+
/** Crockford Base32 alphabet — excludes ambiguous characters 0/O/1/I/L
|
|
5
|
+
* to minimize human transcription errors. 32 symbols → 5 chars = 33M combos. */
|
|
6
|
+
export const CROCKFORD_ALPHABET = "ABCDEFGHJKLMNPQRSTUVWXYZ23456789";
|
|
7
|
+
export const SHORT_ID_LENGTH = 5;
|
|
8
|
+
export const SHORT_ID_PATTERN = /^[A-Z2-9]{5}$/;
|
|
9
|
+
/** Generate a globally-unique short id (5 chars, Crockford Base32, e.g. `UUXD1`-style
|
|
10
|
+
* but without 0/1/I/O). Retries until the id is not in `existing` (project-scoped
|
|
11
|
+
* collision guard). Throws only in the impossible saturation case (~50 retries). */
|
|
12
|
+
export function createShortId(existing = new Set()) {
|
|
13
|
+
const max = CROCKFORD_ALPHABET.length;
|
|
14
|
+
for (let attempt = 0; attempt < 64; attempt += 1) {
|
|
15
|
+
let id = "";
|
|
16
|
+
for (let i = 0; i < SHORT_ID_LENGTH; i += 1) {
|
|
17
|
+
id += CROCKFORD_ALPHABET[randomInt(0, max)];
|
|
18
|
+
}
|
|
19
|
+
if (!existing.has(id))
|
|
20
|
+
return id;
|
|
21
|
+
}
|
|
22
|
+
throw new Error("createShortId: could not generate a unique id after 64 attempts");
|
|
23
|
+
}
|
|
4
24
|
export function normalizeSlug(input) {
|
|
5
25
|
return input
|
|
6
26
|
.trim()
|
|
@@ -24,6 +44,21 @@ export function formatTwoDigitNumber(value) {
|
|
|
24
44
|
export function formatThreeDigitNumber(value) {
|
|
25
45
|
return String(value).padStart(3, "0");
|
|
26
46
|
}
|
|
47
|
+
/** Human-readable phase composite ref: `P00x` or `P00x(F00x)` when the parent
|
|
48
|
+
* feature number is known. Harness-agnostic (used by core handoff listing +
|
|
49
|
+
* adapters). */
|
|
50
|
+
export function formatPhaseRef(phaseNumber, featureNumber) {
|
|
51
|
+
const p = `P${formatThreeDigitNumber(phaseNumber)}`;
|
|
52
|
+
return featureNumber != null ? `${p}(F${formatThreeDigitNumber(featureNumber)})` : p;
|
|
53
|
+
}
|
|
54
|
+
/** Human-readable feature ref: `F00x`. Harness-agnostic. */
|
|
55
|
+
export function formatFeatureRef(featureNumber) {
|
|
56
|
+
return `F${formatThreeDigitNumber(featureNumber)}`;
|
|
57
|
+
}
|
|
58
|
+
/** Find the parent feature's number for a phase (for P00x(F00x) composite refs). */
|
|
59
|
+
export function featureNumberOfPhase(phase, features) {
|
|
60
|
+
return phase.featureId ? features.find((f) => f.id === phase.featureId)?.number : undefined;
|
|
61
|
+
}
|
|
27
62
|
export function createPhaseId() {
|
|
28
63
|
return randomUUID();
|
|
29
64
|
}
|
package/dist/plan-store.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FeaturesDocument, type Manifest, type Phase, type PlanWorkspace, type Project, type RequirementsDocument, type ActivityEntry, type ActivityLog, type CodebaseProfile, type ResumeFocus } from "./schema.js";
|
|
1
|
+
import { type Feature, type FeaturesDocument, type Manifest, type Phase, type PlanWorkspace, type Project, type RequirementsDocument, type ActivityEntry, type ActivityLog, type CodebaseProfile, type ResumeFocus } from "./schema.js";
|
|
2
2
|
export declare class PlanStoreError extends Error {
|
|
3
3
|
readonly cause?: unknown | undefined;
|
|
4
4
|
constructor(message: string, cause?: unknown | undefined);
|
|
@@ -6,6 +6,16 @@ export declare class PlanStoreError extends Error {
|
|
|
6
6
|
export declare function setWriteBusyHook(hook: ((busy: boolean) => void) | undefined): void;
|
|
7
7
|
export declare function setWriteNotifyHook(hook: (() => void) | undefined): void;
|
|
8
8
|
export declare function withFeatureLock<T>(featureId: string, fn: () => Promise<T>): Promise<T>;
|
|
9
|
+
/** Summary of a phase that has a non-empty handoff, for the listHandoffs() API. */
|
|
10
|
+
export interface PhaseHandoffSummary {
|
|
11
|
+
phaseId: string;
|
|
12
|
+
/** Human-readable composite ref, e.g. `P003` or `P003(F002)`. */
|
|
13
|
+
compositeRef: string;
|
|
14
|
+
/** handoffUpdatedAt (falls back to phase.updatedAt if unset). */
|
|
15
|
+
updatedAt: string;
|
|
16
|
+
/** First non-empty line of the handoff, leading markdown headers stripped, ~80 chars. */
|
|
17
|
+
firstLine: string;
|
|
18
|
+
}
|
|
9
19
|
export declare function migrateToUuids(store: PlanStore): Promise<void>;
|
|
10
20
|
export declare class PlanStore {
|
|
11
21
|
readonly root: string;
|
|
@@ -24,6 +34,10 @@ export declare class PlanStore {
|
|
|
24
34
|
private runAsBatch;
|
|
25
35
|
/** Public batch wrapper used by the module-level migrateToUuids helper. */
|
|
26
36
|
runBatchForMigration<T>(fn: () => Promise<T>): Promise<T>;
|
|
37
|
+
/** Public batch wrapper: suspend autoSync (status rollup) for a sequence of
|
|
38
|
+
* writes. Use for priority-only reorders so they don't recompute phase/feature
|
|
39
|
+
* status (a reorder must not flip a partially-done feature to in-progress). */
|
|
40
|
+
runBatch<T>(fn: () => Promise<T>): Promise<T>;
|
|
27
41
|
private maybeAutoSync;
|
|
28
42
|
private normalizeTasks;
|
|
29
43
|
private normalizeFeaturesDocument;
|
|
@@ -36,6 +50,13 @@ export declare class PlanStore {
|
|
|
36
50
|
private projectPath;
|
|
37
51
|
private requirementsPath;
|
|
38
52
|
private featuresPath;
|
|
53
|
+
private featuresDir;
|
|
54
|
+
private featurePath;
|
|
55
|
+
private withFeaturesLock;
|
|
56
|
+
/** Idempotent one-time migration: if a legacy features.json exists, split it
|
|
57
|
+
* into features/<id>.json (one per feature) and remove the legacy file.
|
|
58
|
+
* Must be called under withFeaturesLock. Crash-safe: re-run overwrites. */
|
|
59
|
+
private migrateLegacy;
|
|
39
60
|
private phasesDir;
|
|
40
61
|
private phasePath;
|
|
41
62
|
private generatedDir;
|
|
@@ -48,6 +69,10 @@ export declare class PlanStore {
|
|
|
48
69
|
loadManifest(): Promise<Manifest>;
|
|
49
70
|
loadProject(): Promise<Project>;
|
|
50
71
|
loadPhase(phaseId: string): Promise<Phase>;
|
|
72
|
+
/** Read raw feature files WITHOUT the derived `status` field. Used
|
|
73
|
+
* internally so loadFeatures/loadAll can derive status from phases without
|
|
74
|
+
* double-loading. */
|
|
75
|
+
private loadRawFeatures;
|
|
51
76
|
loadFeatures(): Promise<FeaturesDocument>;
|
|
52
77
|
loadCodebaseProfile(): Promise<CodebaseProfile | null>;
|
|
53
78
|
saveCodebaseProfile(profile: CodebaseProfile): Promise<void>;
|
|
@@ -95,6 +120,22 @@ export declare class PlanStore {
|
|
|
95
120
|
cleanupOrphanBackups(): Promise<{
|
|
96
121
|
removed: number;
|
|
97
122
|
}>;
|
|
123
|
+
/** All non-empty shortIds currently assigned in the project (features + phases + tasks).
|
|
124
|
+
* Read-only; used by createShortId collision guard during entity creation. */
|
|
125
|
+
assignedShortIds(): Promise<Set<string>>;
|
|
126
|
+
/** Next priority (>=1) for a new entity within its scope.
|
|
127
|
+
* - feature: max priority among features + 1
|
|
128
|
+
* - phase: max priority among phases of parentId (featureId) + 1
|
|
129
|
+
* - task: max priority among tasks of parentId (phaseId) + 1 */
|
|
130
|
+
nextPriority(kind: "feature" | "phase" | "task", parentId?: string): Promise<number>;
|
|
131
|
+
/** Idempotent backfill of shortId (globally-unique 5-char Crockford) and priority
|
|
132
|
+
* (per-scope display order). Assigns missing shortIds and priorities; never overwrites
|
|
133
|
+
* existing non-empty shortIds or non-zero priorities. Safe to run at startup. */
|
|
134
|
+
ensureShortIdsAndPriority(): Promise<{
|
|
135
|
+
shortIdsAssigned: number;
|
|
136
|
+
prioritiesAssigned: number;
|
|
137
|
+
duplicateShortIds: string[];
|
|
138
|
+
}>;
|
|
98
139
|
/** Repair dangling references and report integrity. One-shot maintenance op. */
|
|
99
140
|
repair(): Promise<{
|
|
100
141
|
migrated: {
|
|
@@ -102,33 +143,57 @@ export declare class PlanStore {
|
|
|
102
143
|
repaired: number;
|
|
103
144
|
inferred: number;
|
|
104
145
|
};
|
|
146
|
+
backfill: {
|
|
147
|
+
shortIdsAssigned: number;
|
|
148
|
+
prioritiesAssigned: number;
|
|
149
|
+
duplicateShortIds: string[];
|
|
150
|
+
};
|
|
105
151
|
integrity: {
|
|
106
152
|
duplicatePhaseIds: string[];
|
|
107
153
|
danglingPhaseIds: string[];
|
|
154
|
+
duplicateShortIds: string[];
|
|
108
155
|
};
|
|
109
156
|
}>;
|
|
110
157
|
/** Validate plan integrity: globally unique phase ids and resolvable feature.phaseIds. */
|
|
111
158
|
validateIntegrity(): Promise<{
|
|
112
159
|
duplicatePhaseIds: string[];
|
|
113
160
|
danglingPhaseIds: string[];
|
|
161
|
+
duplicateShortIds: string[];
|
|
114
162
|
}>;
|
|
115
163
|
private derivePhaseStatus;
|
|
116
164
|
private deriveFeatureStatus;
|
|
117
|
-
syncStatuses(): Promise<
|
|
118
|
-
/**
|
|
119
|
-
*
|
|
120
|
-
|
|
165
|
+
syncStatuses(): Promise<string[]>;
|
|
166
|
+
/** Auto-clear a phase's handoff when its DERIVED status is done. Status itself
|
|
167
|
+
* is no longer persisted (derived on read), so the only remaining side effect
|
|
168
|
+
* of a task→done transition is clearing a stale handoff on a completed phase.
|
|
169
|
+
* Returns the composite ref of the phase if its handoff was cleared, else null. */
|
|
170
|
+
syncTaskStatusRollup(phaseId: string): Promise<string | null>;
|
|
121
171
|
updateProject(updater: (p: Project) => Project): Promise<Project>;
|
|
122
172
|
updateFeatures(updater: (f: FeaturesDocument) => FeaturesDocument): Promise<FeaturesDocument>;
|
|
123
173
|
updateRequirements(updater: (r: RequirementsDocument) => RequirementsDocument): Promise<RequirementsDocument>;
|
|
124
174
|
saveProject(project: Project): Promise<void>;
|
|
125
175
|
saveFeatures(features: FeaturesDocument): Promise<void>;
|
|
176
|
+
/** Per-file write of all features + orphan reconcile. No lock (caller holds withFeaturesLock). */
|
|
177
|
+
private saveFeaturesRaw;
|
|
178
|
+
/** Granular single-feature write (per-file lock; parallel-safe across features). */
|
|
179
|
+
saveFeature(feature: Feature): Promise<void>;
|
|
126
180
|
saveRequirements(reqs: RequirementsDocument): Promise<void>;
|
|
127
181
|
savePhase(phase: Phase): Promise<void>;
|
|
128
182
|
/** Atomic read-modify-write on a single phase file. Serializes concurrent
|
|
129
183
|
* task_create / phase_update calls on the SAME phaseId so batch operations
|
|
130
184
|
* don't lose tasks (last-write-wins race condition). */
|
|
131
185
|
updatePhase(phaseId: string, updater: (phase: Phase) => Phase): Promise<Phase>;
|
|
186
|
+
/** Get the handoff text for a phase ("" if none). Throws if phase missing. */
|
|
187
|
+
getPhaseHandoff(phaseId: string): Promise<string>;
|
|
188
|
+
/** Set the handoff text for a phase + stamp handoffUpdatedAt. Atomic per-file
|
|
189
|
+
* update via updatePhase (so the web UI refreshes via maybeAutoSync). */
|
|
190
|
+
setPhaseHandoff(phaseId: string, text: string): Promise<void>;
|
|
191
|
+
/** Clear the handoff text for a phase (handoff=""). handoffUpdatedAt is left
|
|
192
|
+
* unchanged as an audit trail (when a handoff last existed). */
|
|
193
|
+
clearPhaseHandoff(phaseId: string): Promise<void>;
|
|
194
|
+
/** List all phases that have a non-empty handoff, newest first, with a
|
|
195
|
+
* human-readable composite ref (P00x or P00x(F00x)) and a first-line excerpt. */
|
|
196
|
+
listHandoffs(): Promise<PhaseHandoffSummary[]>;
|
|
132
197
|
deletePhase(phaseId: string): Promise<void>;
|
|
133
198
|
/** Load the full workspace (manifest + phases + project + requirements + features) */
|
|
134
199
|
loadWorkspace(): Promise<PlanWorkspace>;
|
package/dist/plan-store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan-store.d.ts","sourceRoot":"","sources":["../src/plan-store.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"plan-store.d.ts","sourceRoot":"","sources":["../src/plan-store.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,OAAO,EACZ,KAAK,gBAAgB,EAGrB,KAAK,QAAQ,EAEb,KAAK,KAAK,EAEV,KAAK,aAAa,EAElB,KAAK,OAAO,EAEZ,KAAK,oBAAoB,EAIzB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB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