@jmanuelcorral/openteam 0.2.0 → 0.2.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.
@@ -24,7 +24,7 @@ import type { WorkspaceLease } from "../storage/graph/workspaceLease";
24
24
  import type { GraphEffectExecutor } from "./graphEffects";
25
25
  import type { RevisionPlan } from "./graphReview";
26
26
  import { type RuntimeStepOutcome } from "./graphRuntime";
27
- import type { SddTask } from "./sdd";
27
+ import { type SddTask } from "./sddCompiler";
28
28
  /** Marca privada del módulo: nada fuera de aquí puede fabricarla. */
29
29
  declare const ACTIVE_INGRESS_BRAND: unique symbol;
30
30
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"graphIngress.d.ts","sourceRoot":"","sources":["../../src/orchestrator/graphIngress.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAAsB,KAAK,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAGrC,qEAAqE;AACrE,QAAA,MAAM,oBAAoB,EAAE,OAAO,MAAyC,CAAC;AAE7E;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,CAAC,CAAC,oBAAoB,CAAC,EAAE,IAAI,CAAC;IACtC,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAw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AU,EAAE,SAAS,MAAM,EAAE,CAAC;CACxC,CAAC;AAEF,uEAAuE;AACvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,cAAc,CAAC;IAC/B,QAAQ,CAAC,OAAO,EAAE,mBAAmB,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC9C,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/C,MAAM,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC/D,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACnE,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAChD;AAkBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,gBAAgB,GAAG,YAAY,CAyIvE"}
@@ -1,23 +1,18 @@
1
- import type { StorageProvider } from "../storage/provider";
2
1
  /**
3
- * Ledger de progreso durable del orquestador.
2
+ * Tipos y reducción del ledger de progreso legacy.
4
3
  *
5
- * Registra, una línea por tarea, el estado de las tareas ya procesadas para que
6
- * un flujo largo (loop SDD, `openteam loop`) pueda **reanudarse** tras una
7
- * compactación de contexto o un reinicio sin repetir trabajo hecho. Vive detrás
8
- * del `StorageProvider` (misma fuente de verdad que roster/decisions/telemetría)
9
- * y es **privacy-safe**: solo `taskID`, estado y un `detail` ya redactado; nunca
10
- * prompts ni datos sensibles.
11
- *
12
- * Formato de línea (Markdown, inspirado en obra/superpowers):
13
- * `- <taskID>: complete (<detail>)`
14
- * `- <taskID>: failed (<detail>)`
4
+ * El ledger legacy (`progress.md`) registra, una línea por tarea, el desenlace
5
+ * terminal de las tareas ya procesadas. Su **autoridad** fue retirada (R7): ya
6
+ * no se lee ni se escribe como fuente de verdad. Lo que sobrevive es el modelo
7
+ * de datos (`LedgerEntry` / `LedgerStatus`) y la reducción pura `latestStatuses`,
8
+ * que la **importación terminal** a la autoridad de Graph
9
+ * (`storage/graph/importLegacy.ts`) usa para colapsar entradas repetidas al
10
+ * último estado por `taskID`. El parseo del texto legacy vive ahora inline en el
11
+ * importador/migración, no aquí.
15
12
  *
16
- * Las funciones de parse/format son puras; el I/O se hace vía un
17
- * `StorageProvider` inyectado.
13
+ * Es **privacy-safe**: solo `taskID`, estado y un `detail` ya redactado; nunca
14
+ * prompts ni datos sensibles.
18
15
  */
19
- /** Ruta por defecto del ledger (estado derivado del equipo). */
20
- export declare const DEFAULT_LEDGER_PATH = ".opencode/openteam/progress.md";
21
16
  export type LedgerStatus = "complete" | "failed";
22
17
  export type LedgerEntry = {
23
18
  taskID: string;
@@ -25,35 +20,9 @@ export type LedgerEntry = {
25
20
  /** Metadatos redactados (modelo, tier, resultado de review). Nunca prompts. */
26
21
  detail?: string;
27
22
  };
28
- /** Serializa una entrada a su línea Markdown canónica. Puro. */
29
- export declare function formatLedgerEntry(entry: LedgerEntry): string;
30
- /** Parsea una línea; `undefined` si no es una entrada de ledger válida. Puro. */
31
- export declare function parseLedgerLine(line: string): LedgerEntry | undefined;
32
- /** Parsea todo el ledger, saltando cabeceras/blancos/líneas inválidas. Puro. */
33
- export declare function parseLedger(text: string): LedgerEntry[];
34
23
  /**
35
24
  * Estado más reciente por `taskID` (las líneas posteriores sobrescriben a las
36
25
  * anteriores: un `failed` seguido de `complete` cuenta como `complete`). Puro.
37
26
  */
38
27
  export declare function latestStatuses(entries: readonly LedgerEntry[]): Map<string, LedgerStatus>;
39
- /** `true` si el último estado registrado para la tarea es `complete`. Puro. */
40
- export declare function isTaskComplete(entries: readonly LedgerEntry[], taskID: string): boolean;
41
- /** Conjunto de `taskID` cuyo estado más reciente es `complete`. Puro. */
42
- export declare function completedTaskIDs(entries: readonly LedgerEntry[]): Set<string>;
43
- /**
44
- * Lee y parsea el ledger; `[]` si el fichero no existe.
45
- *
46
- * @deprecated As authority source — legacy SDD authority (progress.md as the
47
- * task-completion ledger) will be removed in v1.0.0. The pure parsing
48
- * functions (`parseLedger`, `parseLedgerLine`, etc.) remain available for
49
- * terminal import into graph authority. See docs/guide/graph-migration.md.
50
- */
51
- export declare function readLedger(storage: StorageProvider, path?: string): Promise<LedgerEntry[]>;
52
- /**
53
- * Añade una entrada al ledger (crea el fichero si no existe).
54
- *
55
- * @deprecated Legacy SDD authority (progress.md as the task-completion ledger)
56
- * will be removed in v1.0.0. See docs/guide/graph-migration.md.
57
- */
58
- export declare function appendLedgerEntry(storage: StorageProvider, entry: LedgerEntry, path?: string): Promise<void>;
59
28
  //# sourceMappingURL=ledger.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ledger.d.ts","sourceRoot":"","sources":["../../src/orchestrator/ledger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAE3D;;;;;;;;;;;;;;;;GAgBG;AAEH,gEAAgE;AAChE,eAAO,MAAM,mBAAmB,mCAAmC,CAAC;AAEpE,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEjD,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,YAAY,CAAC;IACrB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAIF,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAM5D;AAED,iFAAiF;AACjF,wBAAgB,e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import { type GraphSpecV1 } from "../graph/schema";
2
- import { type SddTask } from "./sdd";
2
+ import type { TaskSignals } from "../router/types";
3
+ /** Rol reviewer por defecto de la compilación SDD → grafo. */
4
+ export declare const DEFAULT_REVIEWER_ROLE_ID = "reviewer";
5
+ /**
6
+ * Descriptor de entrada del compilador SDD → grafo.
7
+ *
8
+ * Es el contrato que `compileSddTask` y el ingress activo (`graphIngress.ts`)
9
+ * consumen: identifica la tarea, sus roles y su brief accionable, más las
10
+ * señales de routing. El brief nunca se persiste en crudo; el compilador lo
11
+ * ancla por digest (`assertReferenceOnly` rechaza cualquier campo crudo).
12
+ */
13
+ export type SddTask = {
14
+ /** Id estable y sin `:` (kebab-case) usado para anclas y nodos. */
15
+ id: string;
16
+ /** Rol que implementa (y arregla) la tarea. */
17
+ implementerRoleID: string;
18
+ /** Título humano corto. */
19
+ title: string;
20
+ /** Brief accionable de la tarea (cuerpo del prompt del implementer). */
21
+ brief: string;
22
+ /** Señales de routing para la tarea. */
23
+ task: TaskSignals;
24
+ /** Rol reviewer específico (sobreescribe el reviewer por defecto). */
25
+ reviewerRoleID?: string;
26
+ };
3
27
  /**
4
28
  * Compilador **puro** de una tarea SDD legacy a un `GraphSpecV1` estático
5
29
  * (GE-041).
@@ -1 +1 @@
1
- {"version":3,"file":"sddCompiler.d.ts","sourceRoot":"","sources":["../../src/orchestrator/sddCompiler.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,WAAW,EAEjB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAA4B,KAAK,OAAO,EAAE,MAAM,OAAO,CAAC;AAE/D;;;;;;;;;;;;;;;;;GAiBG;AAEH,0EAA0E;AAC1E,MAAM,MAAM,mBAAmB,GAC3B,cAAc,GACd,oBAAoB,GACpB,cAAc,CAAC;AAEnB,iDAAiD;AACjD,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MA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,CAAC,MAAM,EAAE,MAAM,CAAC;IAExB,YAAY,IAAI,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAKpD;CACF;AAED,+BAA+B;AAC/B,MAAM,MAAM,iBAAiB,GAAG;IAC9B,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAwBF;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,OAAO,EACb,OAAO,GAAE,iBAAsB,GAC9B,WAAW,CA0Db"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jmanuelcorral/openteam",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "packageManager": "bun@1.3.14",
5
5
  "description": "Cost-aware, local-first routing plugin for opencode with cheapest-capable frontier fallback and multi-agent orchestration.",
6
6
  "license": "MIT",
@@ -1,180 +0,0 @@
1
- import type { OpenTeamConfig } from "../config/schema";
2
- import { type ArtifactManifest, type ContextRef, type PrivacyClass } from "../context/schema";
3
- import type { TaskSignals } from "../router/types";
4
- import type { StorageProvider } from "../storage/provider";
5
- import { type CoordinatorDeps, type RoleTaskResult } from "./coordinator";
6
- /**
7
- * Operator-facing deprecation notice for legacy SDD authority.
8
- *
9
- * Legacy authority means using `progress.md` as the authoritative ledger for
10
- * task completion in the SDD loop (`runSddTask` / `runSddPlan`). The ability
11
- * to **import** an existing `progress.md` into graph authority is NOT
12
- * deprecated and will remain available after v1.0.0.
13
- *
14
- * **Reachability note (2026-08-23):** As of this date, neither `runSddTask`
15
- * nor `runSddPlan` has a production caller — the two entry points
16
- * (`src/index.ts`, `src/cli.ts`) do not import them. No operator will see
17
- * this warning today. The warning exists as defence-in-depth: if a future
18
- * change wires the SDD loop back into a production path, reachability and
19
- * operator notification arrive together. An invariant test in
20
- * `tests/orchestrator/sdd-unreachability.test.ts` enforces this.
21
- */
22
- export declare const LEGACY_AUTHORITY_DEPRECATION_WARNING: string;
23
- /**
24
- * Emits the deprecation warning once per process when legacy SDD authority is
25
- * exercised. The `warn` callback defaults to `console.warn`; tests inject a
26
- * spy to verify the seam reaches the operator channel.
27
- *
28
- * Currently no production code path calls this function — it is defence-in-
29
- * depth so that if `runSddTask` / `runSddPlan` are wired back into a
30
- * production caller, the operator is immediately notified of the deprecation.
31
- *
32
- * @returns `true` if the warning was emitted on this call, `false` if it was
33
- * already emitted in a prior call (once-only guard).
34
- */
35
- export declare function emitLegacyAuthorityWarning(warn?: (message: string) => void): boolean;
36
- /**
37
- * Resets the once-only deprecation state. **Test-only** — production code must
38
- * never call this; the flag is per-process by design.
39
- */
40
- export declare function _resetLegacyAuthorityWarning(): void;
41
- /**
42
- * Loop de **subagent-driven-development** (SDD), adaptado de obra/superpowers al
43
- * boundary de openteam. Por cada tarea:
44
- *
45
- * 1. Reanuda desde el ledger: si la tarea ya está `complete`, la salta.
46
- * 2. Persiste un **manifiesto redactado** de inputs del brief (referencia +
47
- * digest, nunca el brief crudo) y entrega el brief íntegro al implementer
48
- * **en memoria** vía el prompt (higiene de contexto: el implementer recibe
49
- * solo su tarea, no el historial acumulado).
50
- * 3. Despacha el **implementer** con el brief.
51
- * 4. Despacha el **reviewer** (rol con alto code-quality) para revisar el
52
- * cambio; la generación del diff vive en el propio agente reviewer.
53
- * 5. Si el veredicto pide arreglos, despacha **UN** fix subagent con TODOS los
54
- * findings (no uno por finding), con un número de rondas acotado.
55
- * 6. Escribe el resultado en el ledger durable.
56
- *
57
- * Es una capa de orquestación **inyectable y determinista**: cliente opencode,
58
- * storage, reloj, generadores de id y el intérprete de review se inyectan, así
59
- * que se prueba con fakes/memory provider. No hace I/O de git ni shell: los
60
- * artefactos persistidos son metadatos **redactados** (nunca prompts ni la
61
- * respuesta cruda del modelo).
62
- */
63
- /** Directorio de artefactos del loop SDD (estado derivado). */
64
- export declare const DEFAULT_SDD_WORKSPACE_DIR = ".opencode/openteam/sdd";
65
- /** Rol reviewer por defecto. */
66
- export declare const DEFAULT_REVIEWER_ROLE_ID = "reviewer";
67
- export type SddTask = {
68
- /** Id estable y sin `:` (kebab-case) usado para ledger y artefactos. */
69
- id: string;
70
- /** Rol que implementa (y arregla) la tarea. */
71
- implementerRoleID: string;
72
- /** Título humano corto. */
73
- title: string;
74
- /** Brief accionable de la tarea (cuerpo del prompt del implementer). */
75
- brief: string;
76
- /** Señales de routing para la tarea. */
77
- task: TaskSignals;
78
- /** Rol reviewer específico (sobreescribe `deps.reviewerRoleID`). */
79
- reviewerRoleID?: string;
80
- };
81
- export type ReviewVerdict = {
82
- needsFix: boolean;
83
- /** Resumen redactado de findings para el fix dispatch. */
84
- findings?: string;
85
- };
86
- export type SddDeps = CoordinatorDeps & {
87
- storage: StorageProvider;
88
- config: OpenTeamConfig;
89
- workspaceDir?: string;
90
- ledgerPath?: string;
91
- reviewerRoleID?: string;
92
- interpretReview?: (review: RoleTaskResult) => ReviewVerdict;
93
- /** Máximo de rondas de fix+re-review (def: 1). */
94
- maxFixRounds?: number;
95
- parentSessionID?: string;
96
- directory?: string;
97
- /**
98
- * Callback for operator-facing warnings (defaults to `console.warn`).
99
- * Used by the legacy authority deprecation to reach the operator channel.
100
- */
101
- onWarning?: (message: string) => void;
102
- };
103
- export type SddTaskStatus = "complete" | "failed" | "skipped";
104
- export type SddTaskOutcome = {
105
- taskID: string;
106
- status: SddTaskStatus;
107
- implement?: RoleTaskResult;
108
- review?: RoleTaskResult;
109
- fixes: RoleTaskResult[];
110
- };
111
- export type SddPlanResult = {
112
- outcomes: SddTaskOutcome[];
113
- completed: string[];
114
- failed: string[];
115
- skipped: string[];
116
- };
117
- /**
118
- * Texto **completo** del brief en memoria para el prompt del implementer.
119
- *
120
- * GE-007 congela que el brief íntegro es un input de dispatch **en memoria**
121
- * (byte a byte), nunca solo una ruta a fichero; un prompt path-only es una
122
- * regresión funcional. GE-038 lo cablea al text part de `session.prompt`. Puro:
123
- * no persiste nada.
124
- */
125
- export declare function implementerBriefInput(task: SddTask): string;
126
- /** Opciones del manifiesto redactado de inputs del brief. */
127
- export type BriefManifestOptions = {
128
- /** Clase de privacidad del manifiesto (def: `internal`). */
129
- privacyClass?: PrivacyClass;
130
- /** Referencia estable del brief cuando persiste como artefacto revalidable. */
131
- briefRef?: ContextRef;
132
- };
133
- /** Manifiesto redactado del brief más su elegibilidad para shadow. */
134
- export type BriefManifestResult = {
135
- manifest: ArtifactManifest;
136
- /** Solo elegible si **cada** input seleccionado tiene referencia estable. */
137
- shadowEligible: boolean;
138
- };
139
- /**
140
- * Construye el manifiesto **redactado** de inputs del brief (GE-007).
141
- *
142
- * Sustituye el fichero de brief crudo por una referencia/digest ordenada:
143
- * versión, taskID, clase de privacidad y una entrada por input con digest
144
- * SHA-256 y tamaño en bytes; nunca título, extracto, prompt ni salida del
145
- * modelo. Un brief sin referencia estable produce una entrada solo-digest y
146
- * queda **inelegible** para shadow (no se fabrica una referencia). Puro y
147
- * determinista: solo cómputo de digest, sin I/O.
148
- */
149
- export declare function briefInputManifest(task: SddTask, options?: BriefManifestOptions): BriefManifestResult;
150
- /** Extrae texto de una respuesta opaca del modelo (best-effort). Puro. */
151
- export declare function extractResponseText(response: unknown): string;
152
- /**
153
- * Veredicto por defecto: escanea el texto de la review en busca de marcadores de
154
- * severidad. Conservador y determinista; los llamadores pueden inyectar su
155
- * propio intérprete vía `deps.interpretReview`.
156
- */
157
- export declare function defaultReviewVerdict(review: RoleTaskResult): ReviewVerdict;
158
- /**
159
- * Ejecuta una única tarea del loop SDD (con reanudación desde el ledger).
160
- *
161
- * @deprecated Legacy SDD authority (progress.md as task-completion ledger)
162
- * will be removed in v1.0.0. Use graph authority instead.
163
- * See docs/guide/graph-migration.md.
164
- * **Note:** This function currently has no production caller — it is only
165
- * invoked by tests. The deprecation warning is defence-in-depth.
166
- */
167
- export declare function runSddTask(task: SddTask, deps: SddDeps): Promise<SddTaskOutcome>;
168
- /**
169
- * Ejecuta un plan SDD **en orden** (las tareas son secuenciales por diseño; la
170
- * paralelización de tareas independientes es otra capa). Reanuda saltando las ya
171
- * completas y resume el resultado por estado.
172
- *
173
- * @deprecated Legacy SDD authority (progress.md as task-completion ledger)
174
- * will be removed in v1.0.0. Use graph authority instead.
175
- * See docs/guide/graph-migration.md.
176
- * **Note:** This function currently has no production caller — it is only
177
- * invoked by tests. The deprecation warning is defence-in-depth.
178
- */
179
- export declare function runSddPlan(tasks: readonly SddTask[], deps: SddDeps): Promise<SddPlanResult>;
180
- //# sourceMappingURL=sdd.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sdd.d.ts","sourceRoot":"","sources":["../../src/orchestrator/sdd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EACL,KAAK,gBAAgB,EAErB,KAAK,UAAU,EACf,KAAK,YAAY,EAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,KAAK,eAAe,EAEpB,KAAK,cAAc,EAEpB,MAAM,eAAe,CAAC;AAqBvB;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oCAAoC,QAI8B,CAAC;AAEhF;;;;;;;;;;;GAWG;AACH,wBAAgB,0BAA0B,CACxC,IAAI,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAmB,GAC7C,OAAO,CAOT;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,2BAA2B,CAAC;AAElE,gCAAgC;AAChC,eAAO,MAAM,wBAAwB,aAAa,CAAC;AAEnD,M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