@cortexkit/aft-opencode 0.22.1 → 0.24.0
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/bg-notifications.d.ts +0 -1
- package/dist/bg-notifications.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +85 -21
- package/dist/shared/status.d.ts +9 -0
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/tui.js +385 -119
- package/dist/workflow-hints.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/shared/status.ts +15 -1
- package/src/tui/index.tsx +349 -68
|
@@ -39,7 +39,6 @@ interface DrainContext {
|
|
|
39
39
|
ctx: PluginContext;
|
|
40
40
|
directory: string;
|
|
41
41
|
sessionID: string;
|
|
42
|
-
isActive?: () => boolean;
|
|
43
42
|
}
|
|
44
43
|
export declare function trackBgTask(sessionID: string | undefined, taskId: string): void;
|
|
45
44
|
export declare function ingestBgCompletions(sessionID: string | undefined, completions: unknown): BgCompletion[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bg-notifications.d.ts","sourceRoot":"","sources":["../src/bg-notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEhD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,UA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AoBhB;AAED,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,YAAY,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EAChD,UAAU,EAAE,OAAO,GAClB,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,YAAY,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,EAChD,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC,IAAI,CAAC,CAGf;AAED,wBAAsB,yBAAyB,CAC7C,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GACtC,OAAO,CAAC,IAAI,CAAC,CAgCf;AAED,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,YAAY,GAAG;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,GAC/C,OAAO,CAAC,IAAI,CAAC,CAEf;AAiED,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,SAAS,YAAY,EAAE,GAAG,MAAM,CASjF;AAED,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,SAAS,qBAAqB,EAAE,GAAG,MAAM,CAQ7F;AAWD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAcnE;AAED,wBAAgB,kCAAkC,IAAI,IAAI,CAKzD"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA8JlD;;;;;;;;;;;;;;;;;;GAkBG;AAQH,QAAA,MAAM,MAAM,EAAE,MAA6D,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AA8JlD;;;;;;;;;;;;;;;;;;GAkBG;AAQH,QAAA,MAAM,MAAM,EAAE,MAA6D,CAAC;AAovB5E,eAAe,MAAM,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7953,6 +7953,8 @@ class BinaryBridge {
|
|
|
7953
7953
|
onConfigureWarnings;
|
|
7954
7954
|
onBashCompletion;
|
|
7955
7955
|
onBashLongRunning;
|
|
7956
|
+
cachedStatus = null;
|
|
7957
|
+
statusListeners = new Set;
|
|
7956
7958
|
configureWarningClients = new Map;
|
|
7957
7959
|
restartResetTimer = null;
|
|
7958
7960
|
errorPrefix;
|
|
@@ -8001,6 +8003,21 @@ class BinaryBridge {
|
|
|
8001
8003
|
hasPendingRequests() {
|
|
8002
8004
|
return this.pending.size > 0;
|
|
8003
8005
|
}
|
|
8006
|
+
getCachedStatus() {
|
|
8007
|
+
return this.cachedStatus;
|
|
8008
|
+
}
|
|
8009
|
+
subscribeStatus(listener) {
|
|
8010
|
+
this.statusListeners.add(listener);
|
|
8011
|
+
if (this.cachedStatus !== null) {
|
|
8012
|
+
this.deliverStatusSnapshot(listener, this.cachedStatus);
|
|
8013
|
+
}
|
|
8014
|
+
return () => {
|
|
8015
|
+
this.statusListeners.delete(listener);
|
|
8016
|
+
};
|
|
8017
|
+
}
|
|
8018
|
+
cacheStatusSnapshot(snapshot) {
|
|
8019
|
+
this.cachedStatus = snapshot;
|
|
8020
|
+
}
|
|
8004
8021
|
async send(command, params = {}, options) {
|
|
8005
8022
|
if (this._shuttingDown) {
|
|
8006
8023
|
throw new Error(`${this.errorPrefix} Bridge is shutting down, cannot send "${command}"`);
|
|
@@ -8137,6 +8154,23 @@ class BinaryBridge {
|
|
|
8137
8154
|
}
|
|
8138
8155
|
}
|
|
8139
8156
|
}
|
|
8157
|
+
handleStatusChangedFrame(frame) {
|
|
8158
|
+
const snapshot = frame.snapshot;
|
|
8159
|
+
if (!snapshot || typeof snapshot !== "object" || Array.isArray(snapshot))
|
|
8160
|
+
return;
|
|
8161
|
+
this.cachedStatus = snapshot;
|
|
8162
|
+
log("Received status_changed push frame; cached AFT status snapshot");
|
|
8163
|
+
for (const listener of this.statusListeners) {
|
|
8164
|
+
this.deliverStatusSnapshot(listener, this.cachedStatus);
|
|
8165
|
+
}
|
|
8166
|
+
}
|
|
8167
|
+
deliverStatusSnapshot(listener, snapshot) {
|
|
8168
|
+
try {
|
|
8169
|
+
listener(snapshot);
|
|
8170
|
+
} catch (err) {
|
|
8171
|
+
warn(`status listener threw: ${err instanceof Error ? err.message : String(err)}`);
|
|
8172
|
+
}
|
|
8173
|
+
}
|
|
8140
8174
|
async shutdown() {
|
|
8141
8175
|
this._shuttingDown = true;
|
|
8142
8176
|
this.clearRestartResetTimer();
|
|
@@ -8341,6 +8375,10 @@ class BinaryBridge {
|
|
|
8341
8375
|
});
|
|
8342
8376
|
continue;
|
|
8343
8377
|
}
|
|
8378
|
+
if (response.type === "status_changed") {
|
|
8379
|
+
this.handleStatusChangedFrame(response);
|
|
8380
|
+
continue;
|
|
8381
|
+
}
|
|
8344
8382
|
const id = response.id;
|
|
8345
8383
|
if (id && this.pending.has(id)) {
|
|
8346
8384
|
const entry = this.pending.get(id);
|
|
@@ -9305,9 +9343,9 @@ import { chmodSync as chmodSync3, copyFileSync as copyFileSync2, existsSync as e
|
|
|
9305
9343
|
import { createRequire } from "module";
|
|
9306
9344
|
import { homedir as homedir4 } from "os";
|
|
9307
9345
|
import { join as join4 } from "path";
|
|
9308
|
-
function
|
|
9346
|
+
function readBinaryVersion(binaryPath) {
|
|
9309
9347
|
try {
|
|
9310
|
-
const result = spawnSync(
|
|
9348
|
+
const result = spawnSync(binaryPath, ["--version"], {
|
|
9311
9349
|
encoding: "utf-8",
|
|
9312
9350
|
stdio: ["pipe", "pipe", "pipe"],
|
|
9313
9351
|
timeout: 5000
|
|
@@ -9315,7 +9353,16 @@ function copyToVersionedCache(npmBinaryPath) {
|
|
|
9315
9353
|
const rawVersion = result.stdout?.trim();
|
|
9316
9354
|
if (!rawVersion)
|
|
9317
9355
|
return null;
|
|
9318
|
-
|
|
9356
|
+
return rawVersion.replace(/^aft\s+/, "");
|
|
9357
|
+
} catch {
|
|
9358
|
+
return null;
|
|
9359
|
+
}
|
|
9360
|
+
}
|
|
9361
|
+
function copyToVersionedCache(npmBinaryPath, knownVersion) {
|
|
9362
|
+
try {
|
|
9363
|
+
const version = knownVersion ?? readBinaryVersion(npmBinaryPath);
|
|
9364
|
+
if (!version)
|
|
9365
|
+
return null;
|
|
9319
9366
|
const tag = version.startsWith("v") ? version : `v${version}`;
|
|
9320
9367
|
const cacheDir = getCacheDir();
|
|
9321
9368
|
const versionedDir = join4(cacheDir, tag);
|
|
@@ -9370,8 +9417,13 @@ function findBinarySync(expectedVersion) {
|
|
|
9370
9417
|
const req = createRequire(import.meta.url);
|
|
9371
9418
|
const resolved = req.resolve(packageBin);
|
|
9372
9419
|
if (existsSync3(resolved)) {
|
|
9373
|
-
const
|
|
9374
|
-
|
|
9420
|
+
const npmVersion = readBinaryVersion(resolved);
|
|
9421
|
+
if (pluginVersion && npmVersion && npmVersion !== pluginVersion) {
|
|
9422
|
+
warn(`npm platform package binary v${npmVersion} does not match plugin v${pluginVersion}; skipping (continuing to PATH lookup)`);
|
|
9423
|
+
} else {
|
|
9424
|
+
const copied = copyToVersionedCache(resolved, npmVersion ?? undefined);
|
|
9425
|
+
return copied ?? resolved;
|
|
9426
|
+
}
|
|
9375
9427
|
}
|
|
9376
9428
|
} catch {}
|
|
9377
9429
|
try {
|
|
@@ -10041,8 +10093,6 @@ async function handleIdleBgCompletions(drainContext) {
|
|
|
10041
10093
|
}
|
|
10042
10094
|
async function triggerWakeIfPending(drainContext, skipDrain) {
|
|
10043
10095
|
const state = stateFor(drainContext.sessionID);
|
|
10044
|
-
if (drainContext.isActive?.())
|
|
10045
|
-
return;
|
|
10046
10096
|
if (!skipDrain && state.outstandingTaskIds.size > 0) {
|
|
10047
10097
|
await drainCompletions(drainContext);
|
|
10048
10098
|
}
|
|
@@ -27082,6 +27132,8 @@ function coerceAftStatus(response) {
|
|
|
27082
27132
|
return {
|
|
27083
27133
|
version: readString(response.version, "unknown"),
|
|
27084
27134
|
project_root: readNullableString(response.project_root),
|
|
27135
|
+
canonical_root: readNullableString(response.canonical_root),
|
|
27136
|
+
cache_role: readString(response.cache_role, "not_initialized"),
|
|
27085
27137
|
features: {
|
|
27086
27138
|
format_on_edit: readBoolean(features.format_on_edit),
|
|
27087
27139
|
validate_on_edit: readString(features.validate_on_edit, "off"),
|
|
@@ -27131,6 +27183,8 @@ function formatStatusMarkdown(status) {
|
|
|
27131
27183
|
"",
|
|
27132
27184
|
`- **Version:** \`${status.version}\``,
|
|
27133
27185
|
`- **Project root:** \`${status.project_root ?? "(not configured)"}\``,
|
|
27186
|
+
`- **Canonical root:** \`${status.canonical_root ?? "(not configured)"}\``,
|
|
27187
|
+
`- **Cache role:** \`${status.cache_role}\``,
|
|
27134
27188
|
"",
|
|
27135
27189
|
"### Enabled features",
|
|
27136
27190
|
`- \`format_on_edit\`: ${formatFlag(status.features.format_on_edit)}`,
|
|
@@ -30357,21 +30411,21 @@ function arg2(schema) {
|
|
|
30357
30411
|
function semanticTools(ctx) {
|
|
30358
30412
|
const searchTool = {
|
|
30359
30413
|
description: [
|
|
30360
|
-
"Find symbols by concept
|
|
30414
|
+
"Find symbols by concept using hybrid semantic + lexical search. Returns ranked code matches with similarity scores and provenance tags.",
|
|
30361
30415
|
"",
|
|
30362
30416
|
"When to reach for it:",
|
|
30363
30417
|
"- Exploring an unfamiliar area: 'where is rate limiting handled', 'how does auth flow work'",
|
|
30364
30418
|
"- Concept doesn't appear as a literal string: 'retry logic', 'cache invalidation', 'graceful shutdown'",
|
|
30419
|
+
"- Filename-shaped concepts: 'the bridge spawn helper', 'the session detection module'",
|
|
30365
30420
|
"- After 2+ grep attempts that came back empty or noisy",
|
|
30366
30421
|
"- You know roughly what the function does but not what it's named",
|
|
30367
30422
|
"",
|
|
30368
30423
|
"When NOT to use:",
|
|
30369
|
-
"- You have a specific symbol name \u2192 use grep",
|
|
30370
30424
|
"- You have an error message or stack trace \u2192 use grep",
|
|
30371
30425
|
"- You want the file/module structure \u2192 use aft_outline",
|
|
30372
30426
|
"- You're following a call chain \u2192 use aft_navigate",
|
|
30373
30427
|
"",
|
|
30374
|
-
"
|
|
30428
|
+
"Each result tags `source` as one of: 'semantic' (embedding match only), 'lexical' (trigram exact-token match the embedding lane missed), or 'hybrid' (both lanes agreed \u2014 strongest signal)."
|
|
30375
30429
|
].join(`
|
|
30376
30430
|
`),
|
|
30377
30431
|
args: {
|
|
@@ -30535,8 +30589,8 @@ function buildWorkflowHints(opts) {
|
|
|
30535
30589
|
sections.push(`**Web/URL access**: \`aft_outline({ url })\` first for structure, then \`aft_zoom({ url, symbol: "<heading>" })\` for the specific section.`);
|
|
30536
30590
|
}
|
|
30537
30591
|
if (hasOutline && hasZoom && (hasGrep || hasSearch)) {
|
|
30538
|
-
const locator = hasGrep
|
|
30539
|
-
sections.push(`**Code exploration**: ${locator} to locate \u2192 \`aft_outline\` for structure \u2192 \`aft_zoom\` for symbol(s).`);
|
|
30592
|
+
const locator = hasGrep ? `\`${grepName}\`` : "`aft_search`";
|
|
30593
|
+
sections.push(hasGrep && hasSearch ? `**Code exploration**: For exact identifiers (\`useState\`, function names, env vars), error messages, or path-shaped queries \u2192 \`${grepName}\` first. For broad concepts ('where is X handled', 'how does Y work') \u2192 \`aft_search\`. Then use \`aft_outline\` for structure \u2192 \`aft_zoom\` for symbol(s).` : `**Code exploration**: ${locator} to locate \u2192 \`aft_outline\` for structure \u2192 \`aft_zoom\` for symbol(s).`);
|
|
30540
30594
|
}
|
|
30541
30595
|
if (hasNavigate) {
|
|
30542
30596
|
sections.push([
|
|
@@ -30657,7 +30711,7 @@ var ANNOUNCEMENT_FEATURES = [
|
|
|
30657
30711
|
];
|
|
30658
30712
|
var plugin = async (input) => initializePluginForDirectory(input);
|
|
30659
30713
|
async function initializePluginForDirectory(input) {
|
|
30660
|
-
const binaryPath = await findBinary();
|
|
30714
|
+
const binaryPath = await findBinary(PLUGIN_VERSION);
|
|
30661
30715
|
const aftConfig = loadAftConfig(input.directory);
|
|
30662
30716
|
const autoUpdateAbort = new AbortController;
|
|
30663
30717
|
const configOverrides = {};
|
|
@@ -30796,24 +30850,22 @@ ${lines}
|
|
|
30796
30850
|
pluginVersion: PLUGIN_VERSION
|
|
30797
30851
|
});
|
|
30798
30852
|
},
|
|
30799
|
-
onBashCompletion: (completion
|
|
30853
|
+
onBashCompletion: (completion) => {
|
|
30800
30854
|
const sessionDir = getSessionDirectoryCached(completion.session_id) ?? input.directory;
|
|
30801
30855
|
handlePushedBgCompletion({
|
|
30802
30856
|
ctx,
|
|
30803
30857
|
directory: sessionDir,
|
|
30804
30858
|
sessionID: completion.session_id,
|
|
30805
|
-
client: input.client
|
|
30806
|
-
isActive: () => bridge.hasPendingRequests()
|
|
30859
|
+
client: input.client
|
|
30807
30860
|
}, completion);
|
|
30808
30861
|
},
|
|
30809
|
-
onBashLongRunning: (reminder
|
|
30862
|
+
onBashLongRunning: (reminder) => {
|
|
30810
30863
|
const sessionDir = getSessionDirectoryCached(reminder.session_id) ?? input.directory;
|
|
30811
30864
|
handlePushedBgLongRunning({
|
|
30812
30865
|
ctx,
|
|
30813
30866
|
directory: sessionDir,
|
|
30814
30867
|
sessionID: reminder.session_id,
|
|
30815
|
-
client: input.client
|
|
30816
|
-
isActive: () => bridge.hasPendingRequests()
|
|
30868
|
+
client: input.client
|
|
30817
30869
|
}, reminder);
|
|
30818
30870
|
}
|
|
30819
30871
|
};
|
|
@@ -30884,7 +30936,15 @@ ${lines}
|
|
|
30884
30936
|
message: "AFT bridge has not been initialized for this project yet. Status will populate after the first tool call."
|
|
30885
30937
|
};
|
|
30886
30938
|
}
|
|
30887
|
-
|
|
30939
|
+
const cached2 = bridge.getCachedStatus();
|
|
30940
|
+
if (cached2 !== null) {
|
|
30941
|
+
return { success: true, ...cached2 };
|
|
30942
|
+
}
|
|
30943
|
+
const response = await bridge.send("status", { session_id: sessionID });
|
|
30944
|
+
if (response.success !== false) {
|
|
30945
|
+
bridge.cacheStatusSnapshot(response);
|
|
30946
|
+
}
|
|
30947
|
+
return response;
|
|
30888
30948
|
});
|
|
30889
30949
|
const storageDir = configOverrides.storage_dir;
|
|
30890
30950
|
rpcServer.handle("get-announcement", async () => {
|
|
@@ -31047,7 +31107,11 @@ Install: ${getManualInstallHint()}`).catch(() => {});
|
|
|
31047
31107
|
}
|
|
31048
31108
|
const sessionDir = await getSessionDirectory(input.client, commandInput.sessionID, input.directory) ?? input.directory;
|
|
31049
31109
|
const bridge = ctx.pool.getActiveBridgeForRoot(sessionDir) ?? ctx.pool.getBridge(sessionDir);
|
|
31050
|
-
const
|
|
31110
|
+
const cached2 = bridge.getCachedStatus();
|
|
31111
|
+
const response = cached2 ? { success: true, ...cached2 } : await bridge.send("status", { session_id: commandInput.sessionID });
|
|
31112
|
+
if (!cached2 && response.success !== false) {
|
|
31113
|
+
bridge.cacheStatusSnapshot(response);
|
|
31114
|
+
}
|
|
31051
31115
|
if (response.success === false) {
|
|
31052
31116
|
throw new Error(response.message || "status failed");
|
|
31053
31117
|
}
|
package/dist/shared/status.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export interface AftStatusSnapshot {
|
|
2
2
|
version: string;
|
|
3
3
|
project_root: string | null;
|
|
4
|
+
canonical_root: string | null;
|
|
5
|
+
cache_role: string;
|
|
4
6
|
features: {
|
|
5
7
|
format_on_edit: boolean;
|
|
6
8
|
validate_on_edit: string;
|
|
@@ -47,6 +49,13 @@ export interface AftStatusSnapshot {
|
|
|
47
49
|
}
|
|
48
50
|
export declare function formatBytes(bytes: number): string;
|
|
49
51
|
export declare function coerceAftStatus(response: Record<string, unknown>): AftStatusSnapshot;
|
|
52
|
+
/**
|
|
53
|
+
* Plain-text status renderer used by the Desktop `sendIgnoredMessage` path,
|
|
54
|
+
* which can only show a plain string. The TUI dialog uses a custom JSX
|
|
55
|
+
* component in `tui/index.tsx` (see `StatusDialog`) so it can render with
|
|
56
|
+
* themed colors, proper flex columns, and right-aligned values instead of
|
|
57
|
+
* monospace padding.
|
|
58
|
+
*/
|
|
50
59
|
export declare function formatStatusDialogMessage(status: AftStatusSnapshot): string;
|
|
51
60
|
export declare function formatStatusMarkdown(status: AftStatusSnapshot): string;
|
|
52
61
|
//# sourceMappingURL=status.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/shared/status.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,QAAQ,EAAE;QACR,cAAc,EAAE,OAAO,CAAC;QACxB,gBAAgB,EAAE,MAAM,CAAC;QACzB,wBAAwB,EAAE,OAAO,CAAC;QAClC,YAAY,EAAE,OAAO,CAAC;QACtB,eAAe,EAAE,OAAO,CAAC;KAC1B,CAAC;IACF,YAAY,EAAE;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;KACzB,CAAC;IACF,cAAc,EAAE;QACd,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;QACvB,SAAS,EAAE,MAAM,GAAG,IAAI,C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