@cortexkit/aft-opencode 0.26.0 → 0.26.2
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 +3 -0
- package/dist/bg-notifications.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +573 -260
- package/dist/lsp-github-install.d.ts +2 -2
- package/dist/lsp-github-install.d.ts.map +1 -1
- package/dist/shared/status.d.ts +11 -0
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/tui.js +66 -16
- package/package.json +7 -7
- package/src/shared/status.ts +15 -0
- package/src/tui/sidebar.tsx +50 -5
|
@@ -68,7 +68,7 @@ export declare function validateExtraction(stagingRoot: string): void;
|
|
|
68
68
|
* 4. Atomic rename: `staging → destDir`. Any prior `destDir` is removed first.
|
|
69
69
|
* 5. Always cleanup staging on any failure.
|
|
70
70
|
*/
|
|
71
|
-
declare function
|
|
71
|
+
export declare function precheckArchiveContents(archivePath: string, archiveType: string): void;
|
|
72
72
|
export interface GithubAutoInstallResult {
|
|
73
73
|
cachedBinDirs: string[];
|
|
74
74
|
installsStarted: number;
|
|
@@ -108,5 +108,5 @@ export declare function discoverRelevantGithubServers(projectRoot: string): Set<
|
|
|
108
108
|
* of `downloadFile`. We expose it here so the test suite can verify the
|
|
109
109
|
* allowlist independently of full network mocking.
|
|
110
110
|
*/
|
|
111
|
-
export { type Arch, assertAllowedDownloadUrl as _assertAllowedDownloadUrlForTesting, detectHostPlatform, downloadFile as _downloadFileForTesting, findGithubServerById, GITHUB_LSP_TABLE, type GithubServerSpec, type Platform,
|
|
111
|
+
export { type Arch, assertAllowedDownloadUrl as _assertAllowedDownloadUrlForTesting, detectHostPlatform, downloadFile as _downloadFileForTesting, findGithubServerById, GITHUB_LSP_TABLE, type GithubServerSpec, type Platform, precheckArchiveContents as _precheckArchiveSizeForTesting, };
|
|
112
112
|
//# sourceMappingURL=lsp-github-install.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lsp-github-install.d.ts","sourceRoot":"","sources":["../src/lsp-github-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAuCH,OAAO,EACL,KAAK,IAAI,EACT,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"lsp-github-install.d.ts","sourceRoot":"","sources":["../src/lsp-github-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAuCH,OAAO,EACL,KAAK,IAAI,EACT,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;AAiC/B,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAG/E;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CASrF;AAsDD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;AAoVD,iBAAS,wBAAwB,CAAC,MAAM,EAAE,MAAM,GAAG,GAAG,CAgBrD;AAED,iBAAe,YAAY,CACzB,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,OAAO,KAAK,EACvB,SAAS,CAAC,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CAuDf;AA6BD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CA0E5D;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CA4BtF;AA6WD,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,yEAAyE;IACzE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAC7B,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAsBD,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,GAAE,OAAO,KAAa,GAC9B,uBAAuB,CAwFzB;AAID;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAyC9E;AAID;;;;;;;GAOG;AACH,OAAO,EACL,KAAK,IAAI,EACT,wBAAwB,IAAI,mCAAmC,EAC/D,kBAAkB,EAClB,YAAY,IAAI,uBAAuB,EACvC,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACb,uBAAuB,IAAI,8BAA8B,GAC1D,CAAC"}
|
package/dist/shared/status.d.ts
CHANGED
|
@@ -3,6 +3,17 @@ export interface AftStatusSnapshot {
|
|
|
3
3
|
project_root: string | null;
|
|
4
4
|
canonical_root: string | null;
|
|
5
5
|
cache_role: string;
|
|
6
|
+
/**
|
|
7
|
+
* True when at least one heavy AFT subsystem has been auto-disabled for
|
|
8
|
+
* the current project root. `degraded_reasons` enumerates why (e.g.
|
|
9
|
+
* `["home_root"]`, `["search_too_many_files:20000"]`). The sidebar / TUI
|
|
10
|
+
* dialog surface this so users know `aft_search`, `aft_navigate` etc.
|
|
11
|
+
* won't return results from this session and can choose to open a
|
|
12
|
+
* project subdirectory instead.
|
|
13
|
+
*/
|
|
14
|
+
degraded: boolean;
|
|
15
|
+
/** Machine-readable degraded-mode reasons. Empty when `degraded === false`. */
|
|
16
|
+
degraded_reasons: string[];
|
|
6
17
|
features: {
|
|
7
18
|
format_on_edit: boolean;
|
|
8
19
|
validate_on_edit: string;
|
|
@@ -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,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,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,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AC1B,4DAA4D;IAC5D,OAAO,EAAE;QACP,EAAE,EAAE,MAAM,CAAC;QACX,aAAa,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;CACH;AAkCD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAajD;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,iBAAiB,CAiEpF;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAuE3E;AAED,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CA0EtE"}
|
package/dist/tui.js
CHANGED
|
@@ -4,7 +4,7 @@ import { createMemo as createMemo2, createSignal as createSignal2, onCleanup as
|
|
|
4
4
|
// package.json
|
|
5
5
|
var package_default = {
|
|
6
6
|
name: "@cortexkit/aft-opencode",
|
|
7
|
-
version: "0.26.
|
|
7
|
+
version: "0.26.2",
|
|
8
8
|
type: "module",
|
|
9
9
|
description: "OpenCode plugin for Agent File Tools (AFT) \u2014 tree-sitter and lsp powered code analysis",
|
|
10
10
|
main: "dist/index.js",
|
|
@@ -32,7 +32,7 @@ var package_default = {
|
|
|
32
32
|
},
|
|
33
33
|
dependencies: {
|
|
34
34
|
"@clack/prompts": "^1.2.0",
|
|
35
|
-
"@cortexkit/aft-bridge": "0.26.
|
|
35
|
+
"@cortexkit/aft-bridge": "0.26.2",
|
|
36
36
|
"@opencode-ai/plugin": "^1.14.39",
|
|
37
37
|
"@opencode-ai/sdk": "^1.14.39",
|
|
38
38
|
"comment-json": "^4.6.2",
|
|
@@ -40,11 +40,11 @@ var package_default = {
|
|
|
40
40
|
zod: "^4.1.8"
|
|
41
41
|
},
|
|
42
42
|
optionalDependencies: {
|
|
43
|
-
"@cortexkit/aft-darwin-arm64": "0.26.
|
|
44
|
-
"@cortexkit/aft-darwin-x64": "0.26.
|
|
45
|
-
"@cortexkit/aft-linux-arm64": "0.26.
|
|
46
|
-
"@cortexkit/aft-linux-x64": "0.26.
|
|
47
|
-
"@cortexkit/aft-win32-x64": "0.26.
|
|
43
|
+
"@cortexkit/aft-darwin-arm64": "0.26.2",
|
|
44
|
+
"@cortexkit/aft-darwin-x64": "0.26.2",
|
|
45
|
+
"@cortexkit/aft-linux-arm64": "0.26.2",
|
|
46
|
+
"@cortexkit/aft-linux-x64": "0.26.2",
|
|
47
|
+
"@cortexkit/aft-win32-x64": "0.26.2"
|
|
48
48
|
},
|
|
49
49
|
devDependencies: {
|
|
50
50
|
"@types/node": "^22.0.0",
|
|
@@ -334,6 +334,8 @@ function coerceAftStatus(response) {
|
|
|
334
334
|
project_root: readNullableString(response.project_root),
|
|
335
335
|
canonical_root: readNullableString(response.canonical_root),
|
|
336
336
|
cache_role: readString(response.cache_role, "not_initialized"),
|
|
337
|
+
degraded: readBoolean(response.degraded),
|
|
338
|
+
degraded_reasons: Array.isArray(response.degraded_reasons) ? response.degraded_reasons.filter((r) => typeof r === "string") : [],
|
|
337
339
|
features: {
|
|
338
340
|
format_on_edit: readBoolean(features.format_on_edit),
|
|
339
341
|
validate_on_edit: readString(features.validate_on_edit, "off"),
|
|
@@ -560,6 +562,25 @@ var SidebarContent = (props) => {
|
|
|
560
562
|
const semanticStatus = () => statusDisplay(s()?.semantic_index?.status ?? "disabled");
|
|
561
563
|
const trigramBytes = () => s()?.disk?.trigram_disk_bytes ?? 0;
|
|
562
564
|
const semanticBytes = () => s()?.disk?.semantic_disk_bytes ?? 0;
|
|
565
|
+
const degradedReasonLabel = (reason) => {
|
|
566
|
+
if (reason === "home_root") {
|
|
567
|
+
return "project root is your home directory";
|
|
568
|
+
}
|
|
569
|
+
if (reason.startsWith("search_too_many_files:")) {
|
|
570
|
+
const threshold = reason.split(":")[1] ?? "20000";
|
|
571
|
+
return `project exceeds ${threshold} files`;
|
|
572
|
+
}
|
|
573
|
+
return reason;
|
|
574
|
+
};
|
|
575
|
+
const degradedSummary = () => {
|
|
576
|
+
const snap = s();
|
|
577
|
+
if (!snap?.degraded)
|
|
578
|
+
return null;
|
|
579
|
+
const reasons = snap.degraded_reasons ?? [];
|
|
580
|
+
if (reasons.length === 0)
|
|
581
|
+
return null;
|
|
582
|
+
return reasons.map(degradedReasonLabel).join("; ");
|
|
583
|
+
};
|
|
563
584
|
return /* @__PURE__ */ jsxDEV("box", {
|
|
564
585
|
width: "100%",
|
|
565
586
|
flexDirection: "column",
|
|
@@ -576,16 +597,34 @@ var SidebarContent = (props) => {
|
|
|
576
597
|
alignItems: "center",
|
|
577
598
|
children: [
|
|
578
599
|
/* @__PURE__ */ jsxDEV("box", {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
600
|
+
flexDirection: "row",
|
|
601
|
+
alignItems: "center",
|
|
602
|
+
children: [
|
|
603
|
+
/* @__PURE__ */ jsxDEV("box", {
|
|
604
|
+
paddingLeft: 1,
|
|
605
|
+
paddingRight: 1,
|
|
606
|
+
backgroundColor: props.theme.accent,
|
|
607
|
+
children: /* @__PURE__ */ jsxDEV("text", {
|
|
608
|
+
fg: props.theme.background,
|
|
609
|
+
children: /* @__PURE__ */ jsxDEV("b", {
|
|
610
|
+
children: "AFT"
|
|
611
|
+
}, undefined, false, undefined, this)
|
|
612
|
+
}, undefined, false, undefined, this)
|
|
613
|
+
}, undefined, false, undefined, this),
|
|
614
|
+
s()?.degraded && /* @__PURE__ */ jsxDEV("box", {
|
|
615
|
+
paddingLeft: 1,
|
|
616
|
+
paddingRight: 1,
|
|
617
|
+
marginLeft: 1,
|
|
618
|
+
backgroundColor: props.theme.warning,
|
|
619
|
+
children: /* @__PURE__ */ jsxDEV("text", {
|
|
620
|
+
fg: props.theme.background,
|
|
621
|
+
children: /* @__PURE__ */ jsxDEV("b", {
|
|
622
|
+
children: "DEGRADED"
|
|
623
|
+
}, undefined, false, undefined, this)
|
|
624
|
+
}, undefined, false, undefined, this)
|
|
586
625
|
}, undefined, false, undefined, this)
|
|
587
|
-
|
|
588
|
-
}, undefined,
|
|
626
|
+
]
|
|
627
|
+
}, undefined, true, undefined, this),
|
|
589
628
|
/* @__PURE__ */ jsxDEV("text", {
|
|
590
629
|
fg: props.theme.textMuted,
|
|
591
630
|
children: [
|
|
@@ -595,6 +634,17 @@ var SidebarContent = (props) => {
|
|
|
595
634
|
}, undefined, true, undefined, this)
|
|
596
635
|
]
|
|
597
636
|
}, undefined, true, undefined, this),
|
|
637
|
+
s()?.degraded && degradedSummary() && /* @__PURE__ */ jsxDEV("box", {
|
|
638
|
+
marginTop: 1,
|
|
639
|
+
width: "100%",
|
|
640
|
+
children: /* @__PURE__ */ jsxDEV("text", {
|
|
641
|
+
fg: props.theme.warning,
|
|
642
|
+
children: [
|
|
643
|
+
"\u26A0 ",
|
|
644
|
+
degradedSummary()
|
|
645
|
+
]
|
|
646
|
+
}, undefined, true, undefined, this)
|
|
647
|
+
}, undefined, false, undefined, this),
|
|
598
648
|
/* @__PURE__ */ jsxDEV(SectionHeader, {
|
|
599
649
|
theme: props.theme,
|
|
600
650
|
title: "Search Index"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-opencode",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenCode plugin for Agent File Tools (AFT) — tree-sitter and lsp powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@clack/prompts": "^1.2.0",
|
|
31
|
-
"@cortexkit/aft-bridge": "0.26.
|
|
31
|
+
"@cortexkit/aft-bridge": "0.26.2",
|
|
32
32
|
"@opencode-ai/plugin": "^1.14.39",
|
|
33
33
|
"@opencode-ai/sdk": "^1.14.39",
|
|
34
34
|
"comment-json": "^4.6.2",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"zod": "^4.1.8"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@cortexkit/aft-darwin-arm64": "0.26.
|
|
40
|
-
"@cortexkit/aft-darwin-x64": "0.26.
|
|
41
|
-
"@cortexkit/aft-linux-arm64": "0.26.
|
|
42
|
-
"@cortexkit/aft-linux-x64": "0.26.
|
|
43
|
-
"@cortexkit/aft-win32-x64": "0.26.
|
|
39
|
+
"@cortexkit/aft-darwin-arm64": "0.26.2",
|
|
40
|
+
"@cortexkit/aft-darwin-x64": "0.26.2",
|
|
41
|
+
"@cortexkit/aft-linux-arm64": "0.26.2",
|
|
42
|
+
"@cortexkit/aft-linux-x64": "0.26.2",
|
|
43
|
+
"@cortexkit/aft-win32-x64": "0.26.2"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^22.0.0",
|
package/src/shared/status.ts
CHANGED
|
@@ -3,6 +3,17 @@ export interface AftStatusSnapshot {
|
|
|
3
3
|
project_root: string | null;
|
|
4
4
|
canonical_root: string | null;
|
|
5
5
|
cache_role: string;
|
|
6
|
+
/**
|
|
7
|
+
* True when at least one heavy AFT subsystem has been auto-disabled for
|
|
8
|
+
* the current project root. `degraded_reasons` enumerates why (e.g.
|
|
9
|
+
* `["home_root"]`, `["search_too_many_files:20000"]`). The sidebar / TUI
|
|
10
|
+
* dialog surface this so users know `aft_search`, `aft_navigate` etc.
|
|
11
|
+
* won't return results from this session and can choose to open a
|
|
12
|
+
* project subdirectory instead.
|
|
13
|
+
*/
|
|
14
|
+
degraded: boolean;
|
|
15
|
+
/** Machine-readable degraded-mode reasons. Empty when `degraded === false`. */
|
|
16
|
+
degraded_reasons: string[];
|
|
6
17
|
features: {
|
|
7
18
|
format_on_edit: boolean;
|
|
8
19
|
validate_on_edit: string;
|
|
@@ -112,6 +123,10 @@ export function coerceAftStatus(response: Record<string, unknown>): AftStatusSna
|
|
|
112
123
|
project_root: readNullableString(response.project_root),
|
|
113
124
|
canonical_root: readNullableString(response.canonical_root),
|
|
114
125
|
cache_role: readString(response.cache_role, "not_initialized"),
|
|
126
|
+
degraded: readBoolean(response.degraded),
|
|
127
|
+
degraded_reasons: Array.isArray(response.degraded_reasons)
|
|
128
|
+
? response.degraded_reasons.filter((r): r is string => typeof r === "string")
|
|
129
|
+
: [],
|
|
115
130
|
features: {
|
|
116
131
|
format_on_edit: readBoolean(features.format_on_edit),
|
|
117
132
|
validate_on_edit: readString(features.validate_on_edit, "off"),
|
package/src/tui/sidebar.tsx
CHANGED
|
@@ -226,6 +226,28 @@ const SidebarContent = (props: {
|
|
|
226
226
|
const trigramBytes = () => s()?.disk?.trigram_disk_bytes ?? 0;
|
|
227
227
|
const semanticBytes = () => s()?.disk?.semantic_disk_bytes ?? 0;
|
|
228
228
|
|
|
229
|
+
// Degraded-mode reason → human-readable hint. Distinct strings per reason
|
|
230
|
+
// because the UX direction is different: "home_root" tells the user to
|
|
231
|
+
// open a real project subdirectory, "search_too_many_files" tells them the
|
|
232
|
+
// tree is too big for full indexing.
|
|
233
|
+
const degradedReasonLabel = (reason: string): string => {
|
|
234
|
+
if (reason === "home_root") {
|
|
235
|
+
return "project root is your home directory";
|
|
236
|
+
}
|
|
237
|
+
if (reason.startsWith("search_too_many_files:")) {
|
|
238
|
+
const threshold = reason.split(":")[1] ?? "20000";
|
|
239
|
+
return `project exceeds ${threshold} files`;
|
|
240
|
+
}
|
|
241
|
+
return reason; // unknown reason — surface verbatim so users can grep logs
|
|
242
|
+
};
|
|
243
|
+
const degradedSummary = () => {
|
|
244
|
+
const snap = s();
|
|
245
|
+
if (!snap?.degraded) return null;
|
|
246
|
+
const reasons = snap.degraded_reasons ?? [];
|
|
247
|
+
if (reasons.length === 0) return null;
|
|
248
|
+
return reasons.map(degradedReasonLabel).join("; ");
|
|
249
|
+
};
|
|
250
|
+
|
|
229
251
|
return (
|
|
230
252
|
<box
|
|
231
253
|
width="100%"
|
|
@@ -237,16 +259,39 @@ const SidebarContent = (props: {
|
|
|
237
259
|
paddingLeft={1}
|
|
238
260
|
paddingRight={1}
|
|
239
261
|
>
|
|
240
|
-
{/* Header: AFT badge + binary version */}
|
|
262
|
+
{/* Header: AFT badge + binary version + degraded badge (when active) */}
|
|
241
263
|
<box flexDirection="row" justifyContent="space-between" alignItems="center">
|
|
242
|
-
<box
|
|
243
|
-
<
|
|
244
|
-
<
|
|
245
|
-
|
|
264
|
+
<box flexDirection="row" alignItems="center">
|
|
265
|
+
<box paddingLeft={1} paddingRight={1} backgroundColor={props.theme.accent}>
|
|
266
|
+
<text fg={props.theme.background}>
|
|
267
|
+
<b>AFT</b>
|
|
268
|
+
</text>
|
|
269
|
+
</box>
|
|
270
|
+
{s()?.degraded && (
|
|
271
|
+
<box
|
|
272
|
+
paddingLeft={1}
|
|
273
|
+
paddingRight={1}
|
|
274
|
+
marginLeft={1}
|
|
275
|
+
backgroundColor={props.theme.warning}
|
|
276
|
+
>
|
|
277
|
+
<text fg={props.theme.background}>
|
|
278
|
+
<b>DEGRADED</b>
|
|
279
|
+
</text>
|
|
280
|
+
</box>
|
|
281
|
+
)}
|
|
246
282
|
</box>
|
|
247
283
|
<text fg={props.theme.textMuted}>v{s()?.version ?? props.pluginVersion}</text>
|
|
248
284
|
</box>
|
|
249
285
|
|
|
286
|
+
{/* Degraded reason — explains why heavy tools (aft_search, aft_navigate)
|
|
287
|
+
are disabled. Surface this prominently so users know to open a real
|
|
288
|
+
project subdirectory if they want full features. */}
|
|
289
|
+
{s()?.degraded && degradedSummary() && (
|
|
290
|
+
<box marginTop={1} width="100%">
|
|
291
|
+
<text fg={props.theme.warning}>⚠ {degradedSummary()}</text>
|
|
292
|
+
</box>
|
|
293
|
+
)}
|
|
294
|
+
|
|
250
295
|
{/* Search index */}
|
|
251
296
|
<SectionHeader theme={props.theme} title="Search Index" />
|
|
252
297
|
<StatRow
|