@cortexkit/aft-opencode 0.63.4 → 0.64.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/config-live-reload.d.ts +4 -16
- package/dist/config-live-reload.d.ts.map +1 -1
- package/dist/config.d.ts +11 -28
- package/dist/config.d.ts.map +1 -1
- package/dist/entry/server.js +774 -410
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +774 -410
- package/dist/lsp-auto-install.d.ts.map +1 -1
- package/dist/shared/session-directory.d.ts +4 -2
- package/dist/shared/session-directory.d.ts.map +1 -1
- package/dist/shared/status.d.ts +0 -4
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/subc-tool-schemas.d.ts +4 -3
- package/dist/subc-tool-schemas.d.ts.map +1 -1
- package/dist/tools/_shared.d.ts +11 -17
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/bash_watch.d.ts +6 -3
- package/dist/tools/bash_watch.d.ts.map +1 -1
- package/dist/tools/definitions/v2.d.ts +25 -0
- package/dist/tools/definitions/v2.d.ts.map +1 -1
- package/dist/tools/inspect.d.ts +0 -15
- package/dist/tools/inspect.d.ts.map +1 -1
- package/dist/tui/preferences.d.ts +1 -1
- package/dist/tui/v2-status.d.ts +3 -2
- package/dist/tui/v2-status.d.ts.map +1 -1
- package/dist/v2-session-lifecycle.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/shared/session-directory.ts +10 -5
- package/src/shared/status.ts +2 -22
- package/src/tui/index.tsx +1 -25
- package/src/tui/preferences.ts +1 -1
- package/src/tui/sidebar-view.tsx +2 -39
- package/src/tui/v2-status.ts +5 -14
- package/src/tui-compiled/index.tsx +2 -41
- package/src/tui-compiled/preferences.ts +1 -1
- package/src/tui-compiled/sidebar-view.tsx +34 -72
- package/src/tui-compiled/v2-status.ts +5 -14
package/src/tui/v2-status.ts
CHANGED
|
@@ -27,8 +27,9 @@ function diagnosticsPart(bar: StatusBar): string {
|
|
|
27
27
|
* The V2 footer segment. "AFT starting…" is only true before the bridge has
|
|
28
28
|
* delivered a real snapshot. After that the footer shows every health category
|
|
29
29
|
* that has a value and `?` for any that does not, because a producer that is
|
|
30
|
-
* unavailable (for example
|
|
31
|
-
*
|
|
30
|
+
* unavailable (for example no language server) can leave the complete
|
|
31
|
+
* `status_bar` missing for the whole session. Dead code, unused exports and
|
|
32
|
+
* duplicates are not shown: they are computed only by aft_inspect.
|
|
32
33
|
*/
|
|
33
34
|
export function formatAftStatusSegment(status: AftStatusSnapshot | null): string {
|
|
34
35
|
// The config error state never produces a real snapshot; say so instead of
|
|
@@ -36,12 +37,7 @@ export function formatAftStatusSegment(status: AftStatusSnapshot | null): string
|
|
|
36
37
|
if (status?.config_error) return "AFT config error";
|
|
37
38
|
if (!status || status.cache_role === "not_initialized") return "AFT starting…";
|
|
38
39
|
const bar: StatusBar = status.status_bar ?? status.status_bar_values ?? {};
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
`AFT ${diagnosticsPart(bar)} | ` +
|
|
42
|
-
`${stale}D${count(bar.dead_code, bar.disabled_categories?.includes("dead_code"))} U${count(bar.unused_exports, bar.disabled_categories?.includes("unused_exports"))} ` +
|
|
43
|
-
`C${count(bar.duplicates, bar.disabled_categories?.includes("duplicates"))} | T${count(bar.todos, bar.disabled_categories?.includes("todos"))}`
|
|
44
|
-
);
|
|
40
|
+
return `AFT ${diagnosticsPart(bar)} | T${count(bar.todos, bar.disabled_categories?.includes("todos"))}`;
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
export type AftSidebarSummary = {
|
|
@@ -53,12 +49,7 @@ export type AftSidebarSummary = {
|
|
|
53
49
|
};
|
|
54
50
|
function healthSummary(bar: StatusBar | undefined): string {
|
|
55
51
|
if (!bar) return "health pending";
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
`${diagnosticsPart(bar)} ` +
|
|
59
|
-
`${stale}D${count(bar.dead_code, bar.disabled_categories?.includes("dead_code"))} U${count(bar.unused_exports, bar.disabled_categories?.includes("unused_exports"))} ` +
|
|
60
|
-
`C${count(bar.duplicates, bar.disabled_categories?.includes("duplicates"))} T${count(bar.todos, bar.disabled_categories?.includes("todos"))}`
|
|
61
|
-
);
|
|
52
|
+
return `${diagnosticsPart(bar)} T${count(bar.todos, bar.disabled_categories?.includes("todos"))}`;
|
|
62
53
|
}
|
|
63
54
|
|
|
64
55
|
/**
|
|
@@ -709,7 +709,7 @@ const StatusDialog = props => {
|
|
|
709
709
|
_$setProp(_el$53, "width", "100%");
|
|
710
710
|
_$setProp(_el$53, "marginTop", 1);
|
|
711
711
|
_$insertNode(_el$54, _el$55);
|
|
712
|
-
_$
|
|
712
|
+
_$insertNode(_el$55, _$createTextNode(`Code Health`));
|
|
713
713
|
_$insert(_el$53, () => (statusBar().disabled_categories ?? []).map(key => _$createComponent(R, {
|
|
714
714
|
get theme() {
|
|
715
715
|
return t();
|
|
@@ -751,47 +751,8 @@ const StatusDialog = props => {
|
|
|
751
751
|
}) : null;
|
|
752
752
|
})(), null);
|
|
753
753
|
_$insert(_el$53, (() => {
|
|
754
|
-
var _c$16 = _$memo(() => statusBar().
|
|
754
|
+
var _c$16 = _$memo(() => statusBar().todos !== undefined);
|
|
755
755
|
return () => _c$16() ? _$createComponent(R, {
|
|
756
|
-
get theme() {
|
|
757
|
-
return t();
|
|
758
|
-
},
|
|
759
|
-
label: "Dead Code",
|
|
760
|
-
get value() {
|
|
761
|
-
return formatCountShort(statusBar().dead_code);
|
|
762
|
-
},
|
|
763
|
-
tone: "muted"
|
|
764
|
-
}) : null;
|
|
765
|
-
})(), null);
|
|
766
|
-
_$insert(_el$53, (() => {
|
|
767
|
-
var _c$17 = _$memo(() => statusBar().unused_exports !== undefined);
|
|
768
|
-
return () => _c$17() ? _$createComponent(R, {
|
|
769
|
-
get theme() {
|
|
770
|
-
return t();
|
|
771
|
-
},
|
|
772
|
-
label: "Unused Exports",
|
|
773
|
-
get value() {
|
|
774
|
-
return formatCountShort(statusBar().unused_exports);
|
|
775
|
-
},
|
|
776
|
-
tone: "muted"
|
|
777
|
-
}) : null;
|
|
778
|
-
})(), null);
|
|
779
|
-
_$insert(_el$53, (() => {
|
|
780
|
-
var _c$18 = _$memo(() => statusBar().duplicates !== undefined);
|
|
781
|
-
return () => _c$18() ? _$createComponent(R, {
|
|
782
|
-
get theme() {
|
|
783
|
-
return t();
|
|
784
|
-
},
|
|
785
|
-
label: "Duplicates",
|
|
786
|
-
get value() {
|
|
787
|
-
return formatCountShort(statusBar().duplicates);
|
|
788
|
-
},
|
|
789
|
-
tone: "muted"
|
|
790
|
-
}) : null;
|
|
791
|
-
})(), null);
|
|
792
|
-
_$insert(_el$53, (() => {
|
|
793
|
-
var _c$19 = _$memo(() => statusBar().todos !== undefined);
|
|
794
|
-
return () => _c$19() ? _$createComponent(R, {
|
|
795
756
|
get theme() {
|
|
796
757
|
return t();
|
|
797
758
|
},
|
|
@@ -40,7 +40,7 @@ export interface AftTuiPrefs {
|
|
|
40
40
|
rememberCollapsed: boolean;
|
|
41
41
|
collapsed: boolean | null;
|
|
42
42
|
/**
|
|
43
|
-
* Whether OpenCode 2 shows AFT's health line (`AFT E0 W0 |
|
|
43
|
+
* Whether OpenCode 2 shows AFT's health line (`AFT E0 W0 | T0`)
|
|
44
44
|
* in the prompt footer. Off hides it entirely; the sidebar and the status
|
|
45
45
|
* dialog are unaffected.
|
|
46
46
|
*/
|
|
@@ -319,12 +319,9 @@ export function degradedReasonLabel(reason) {
|
|
|
319
319
|
export function collapsedHealthLights(statusBar) {
|
|
320
320
|
if (!statusBar) return null;
|
|
321
321
|
const diagnostics = statusBar.errors !== undefined && statusBar.errors > 0 ? "err" : statusBar.warnings !== undefined && statusBar.warnings > 0 ? "warn" : statusBar.errors === 0 && statusBar.warnings === 0 ? "ok" : "muted";
|
|
322
|
-
const codeValues = [statusBar.dead_code, statusBar.unused_exports, statusBar.duplicates];
|
|
323
|
-
const code = codeValues.some(value => value !== undefined && value > 0) ? "warn" : codeValues.every(value => value === 0) ? "ok" : "muted";
|
|
324
322
|
const todos = statusBar.todos === undefined ? "muted" : statusBar.todos > 0 ? "warn" : "ok";
|
|
325
323
|
return {
|
|
326
324
|
diagnostics,
|
|
327
|
-
code,
|
|
328
325
|
todos
|
|
329
326
|
};
|
|
330
327
|
}
|
|
@@ -604,28 +601,22 @@ export const AftSidebarPanel = props => {
|
|
|
604
601
|
get children() {
|
|
605
602
|
var _el$35 = _$createElement("box"),
|
|
606
603
|
_el$36 = _$createElement("text"),
|
|
607
|
-
_el$38 = _$createElement("text")
|
|
608
|
-
_el$40 = _$createElement("text");
|
|
604
|
+
_el$38 = _$createElement("text");
|
|
609
605
|
_$insertNode(_el$35, _el$36);
|
|
610
606
|
_$insertNode(_el$35, _el$38);
|
|
611
|
-
_$insertNode(_el$35, _el$40);
|
|
612
607
|
_$setProp(_el$35, "flexDirection", "row");
|
|
613
608
|
_$setProp(_el$35, "gap", 1);
|
|
614
609
|
_$insertNode(_el$36, _$createTextNode(`●`));
|
|
615
610
|
_$insertNode(_el$38, _$createTextNode(`●`));
|
|
616
|
-
_$insertNode(_el$40, _$createTextNode(`●`));
|
|
617
611
|
_$effect(_p$ => {
|
|
618
612
|
var _v$0 = toneColor(props.palette, collapsedHealthLights(statusBar()).diagnostics),
|
|
619
|
-
_v$1 = toneColor(props.palette, collapsedHealthLights(statusBar()).
|
|
620
|
-
_v$10 = toneColor(props.palette, collapsedHealthLights(statusBar()).todos);
|
|
613
|
+
_v$1 = toneColor(props.palette, collapsedHealthLights(statusBar()).todos);
|
|
621
614
|
_v$0 !== _p$.e && (_p$.e = _$setProp(_el$36, "fg", _v$0, _p$.e));
|
|
622
615
|
_v$1 !== _p$.t && (_p$.t = _$setProp(_el$38, "fg", _v$1, _p$.t));
|
|
623
|
-
_v$10 !== _p$.a && (_p$.a = _$setProp(_el$40, "fg", _v$10, _p$.a));
|
|
624
616
|
return _p$;
|
|
625
617
|
}, {
|
|
626
618
|
e: undefined,
|
|
627
|
-
t: undefined
|
|
628
|
-
a: undefined
|
|
619
|
+
t: undefined
|
|
629
620
|
});
|
|
630
621
|
return _el$35;
|
|
631
622
|
}
|
|
@@ -639,12 +630,12 @@ export const AftSidebarPanel = props => {
|
|
|
639
630
|
},
|
|
640
631
|
label: "Compression",
|
|
641
632
|
get children() {
|
|
642
|
-
var _el$
|
|
643
|
-
_el$
|
|
644
|
-
_$insertNode(_el$
|
|
645
|
-
_$insert(_el$
|
|
646
|
-
_$effect(_$p => _$setProp(_el$
|
|
647
|
-
return _el$
|
|
633
|
+
var _el$40 = _$createElement("text"),
|
|
634
|
+
_el$41 = _$createElement("b");
|
|
635
|
+
_$insertNode(_el$40, _el$41);
|
|
636
|
+
_$insert(_el$41, () => collapsedCompressionValue(s()?.compression));
|
|
637
|
+
_$effect(_$p => _$setProp(_el$40, "fg", props.palette.textMuted, _$p));
|
|
638
|
+
return _el$40;
|
|
648
639
|
}
|
|
649
640
|
});
|
|
650
641
|
})(), null);
|
|
@@ -704,13 +695,13 @@ export const AftSidebarPanel = props => {
|
|
|
704
695
|
return semanticStatus().tone;
|
|
705
696
|
}
|
|
706
697
|
}), _$memo(() => _$memo(() => !!semanticRefreshing())() && (() => {
|
|
707
|
-
var _el$
|
|
708
|
-
_el$
|
|
709
|
-
_$insertNode(_el$
|
|
710
|
-
_$setProp(_el$
|
|
711
|
-
_$insert(_el$
|
|
712
|
-
_$effect(_$p => _$setProp(_el$
|
|
713
|
-
return _el$
|
|
698
|
+
var _el$42 = _$createElement("box"),
|
|
699
|
+
_el$43 = _$createElement("text");
|
|
700
|
+
_$insertNode(_el$42, _el$43);
|
|
701
|
+
_$setProp(_el$42, "width", "100%");
|
|
702
|
+
_$insert(_el$43, semanticRefreshing);
|
|
703
|
+
_$effect(_$p => _$setProp(_el$43, "fg", props.palette.textMuted, _$p));
|
|
704
|
+
return _el$42;
|
|
714
705
|
})()), _$memo(() => _$memo(() => !!(s()?.semantic_index?.status === "loading" && s()?.semantic_index?.entries_total != null && s().semantic_index.entries_total > 0))() && _$createComponent(StatRow, {
|
|
715
706
|
get palette() {
|
|
716
707
|
return props.palette;
|
|
@@ -742,9 +733,7 @@ export const AftSidebarPanel = props => {
|
|
|
742
733
|
get palette() {
|
|
743
734
|
return props.palette;
|
|
744
735
|
},
|
|
745
|
-
|
|
746
|
-
return statusBar().tier2_stale ? "Code Health ~" : "Code Health";
|
|
747
|
-
}
|
|
736
|
+
title: "Code Health"
|
|
748
737
|
}), _$memo(() => (statusBar().disabled_categories ?? []).map(key => _$createComponent(StatRow, {
|
|
749
738
|
get palette() {
|
|
750
739
|
return props.palette;
|
|
@@ -776,33 +765,6 @@ export const AftSidebarPanel = props => {
|
|
|
776
765
|
get tone() {
|
|
777
766
|
return statusBar().warnings > 0 ? "warn" : "muted";
|
|
778
767
|
}
|
|
779
|
-
})), _$memo(() => _$memo(() => statusBar().dead_code !== undefined)() && _$createComponent(StatRow, {
|
|
780
|
-
get palette() {
|
|
781
|
-
return props.palette;
|
|
782
|
-
},
|
|
783
|
-
label: "Dead Code",
|
|
784
|
-
get value() {
|
|
785
|
-
return formatCount(statusBar().dead_code);
|
|
786
|
-
},
|
|
787
|
-
tone: "muted"
|
|
788
|
-
})), _$memo(() => _$memo(() => statusBar().unused_exports !== undefined)() && _$createComponent(StatRow, {
|
|
789
|
-
get palette() {
|
|
790
|
-
return props.palette;
|
|
791
|
-
},
|
|
792
|
-
label: "Unused Exports",
|
|
793
|
-
get value() {
|
|
794
|
-
return formatCount(statusBar().unused_exports);
|
|
795
|
-
},
|
|
796
|
-
tone: "muted"
|
|
797
|
-
})), _$memo(() => _$memo(() => statusBar().duplicates !== undefined)() && _$createComponent(StatRow, {
|
|
798
|
-
get palette() {
|
|
799
|
-
return props.palette;
|
|
800
|
-
},
|
|
801
|
-
label: "Duplicates",
|
|
802
|
-
get value() {
|
|
803
|
-
return formatCount(statusBar().duplicates);
|
|
804
|
-
},
|
|
805
|
-
tone: "muted"
|
|
806
768
|
})), _$memo(() => _$memo(() => statusBar().todos !== undefined)() && _$createComponent(StatRow, {
|
|
807
769
|
get palette() {
|
|
808
770
|
return props.palette;
|
|
@@ -818,13 +780,13 @@ export const AftSidebarPanel = props => {
|
|
|
818
780
|
},
|
|
819
781
|
title: "Compression"
|
|
820
782
|
}), _$memo(() => compressionRows().map(row => row.kind === "scope" ? (() => {
|
|
821
|
-
var _el$
|
|
822
|
-
_el$
|
|
823
|
-
_$insertNode(_el$
|
|
824
|
-
_$setProp(_el$
|
|
825
|
-
_$insert(_el$
|
|
826
|
-
_$effect(_$p => _$setProp(_el$
|
|
827
|
-
return _el$
|
|
783
|
+
var _el$44 = _$createElement("box"),
|
|
784
|
+
_el$45 = _$createElement("text");
|
|
785
|
+
_$insertNode(_el$44, _el$45);
|
|
786
|
+
_$setProp(_el$44, "width", "100%");
|
|
787
|
+
_$insert(_el$45, () => row.label);
|
|
788
|
+
_$effect(_$p => _$setProp(_el$45, "fg", props.palette.text, _$p));
|
|
789
|
+
return _el$44;
|
|
828
790
|
})() : _$createComponent(StatRow, {
|
|
829
791
|
get palette() {
|
|
830
792
|
return props.palette;
|
|
@@ -837,16 +799,16 @@ export const AftSidebarPanel = props => {
|
|
|
837
799
|
},
|
|
838
800
|
tone: "muted"
|
|
839
801
|
})))]), _$memo(() => _$memo(() => !!(s()?.semantic_index?.status === "failed" && s()?.semantic_index?.error))() && (() => {
|
|
840
|
-
var _el$
|
|
841
|
-
_el$
|
|
842
|
-
_el$
|
|
843
|
-
_$insertNode(_el$
|
|
844
|
-
_$setProp(_el$
|
|
845
|
-
_$setProp(_el$
|
|
846
|
-
_$insertNode(_el$
|
|
847
|
-
_$insert(_el$
|
|
848
|
-
_$effect(_$p => _$setProp(_el$
|
|
849
|
-
return _el$
|
|
802
|
+
var _el$46 = _$createElement("box"),
|
|
803
|
+
_el$47 = _$createElement("text"),
|
|
804
|
+
_el$48 = _$createTextNode(`⚠ `);
|
|
805
|
+
_$insertNode(_el$46, _el$47);
|
|
806
|
+
_$setProp(_el$46, "marginTop", 1);
|
|
807
|
+
_$setProp(_el$46, "width", "100%");
|
|
808
|
+
_$insertNode(_el$47, _el$48);
|
|
809
|
+
_$insert(_el$47, () => s().semantic_index.error, null);
|
|
810
|
+
_$effect(_$p => _$setProp(_el$47, "fg", props.palette.error, _$p));
|
|
811
|
+
return _el$46;
|
|
850
812
|
})())];
|
|
851
813
|
})(), null);
|
|
852
814
|
_$effect(_p$ => {
|
|
@@ -27,8 +27,9 @@ function diagnosticsPart(bar: StatusBar): string {
|
|
|
27
27
|
* The V2 footer segment. "AFT starting…" is only true before the bridge has
|
|
28
28
|
* delivered a real snapshot. After that the footer shows every health category
|
|
29
29
|
* that has a value and `?` for any that does not, because a producer that is
|
|
30
|
-
* unavailable (for example
|
|
31
|
-
*
|
|
30
|
+
* unavailable (for example no language server) can leave the complete
|
|
31
|
+
* `status_bar` missing for the whole session. Dead code, unused exports and
|
|
32
|
+
* duplicates are not shown: they are computed only by aft_inspect.
|
|
32
33
|
*/
|
|
33
34
|
export function formatAftStatusSegment(status: AftStatusSnapshot | null): string {
|
|
34
35
|
// The config error state never produces a real snapshot; say so instead of
|
|
@@ -36,12 +37,7 @@ export function formatAftStatusSegment(status: AftStatusSnapshot | null): string
|
|
|
36
37
|
if (status?.config_error) return "AFT config error";
|
|
37
38
|
if (!status || status.cache_role === "not_initialized") return "AFT starting…";
|
|
38
39
|
const bar: StatusBar = status.status_bar ?? status.status_bar_values ?? {};
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
`AFT ${diagnosticsPart(bar)} | ` +
|
|
42
|
-
`${stale}D${count(bar.dead_code, bar.disabled_categories?.includes("dead_code"))} U${count(bar.unused_exports, bar.disabled_categories?.includes("unused_exports"))} ` +
|
|
43
|
-
`C${count(bar.duplicates, bar.disabled_categories?.includes("duplicates"))} | T${count(bar.todos, bar.disabled_categories?.includes("todos"))}`
|
|
44
|
-
);
|
|
40
|
+
return `AFT ${diagnosticsPart(bar)} | T${count(bar.todos, bar.disabled_categories?.includes("todos"))}`;
|
|
45
41
|
}
|
|
46
42
|
|
|
47
43
|
export type AftSidebarSummary = {
|
|
@@ -53,12 +49,7 @@ export type AftSidebarSummary = {
|
|
|
53
49
|
};
|
|
54
50
|
function healthSummary(bar: StatusBar | undefined): string {
|
|
55
51
|
if (!bar) return "health pending";
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
`${diagnosticsPart(bar)} ` +
|
|
59
|
-
`${stale}D${count(bar.dead_code, bar.disabled_categories?.includes("dead_code"))} U${count(bar.unused_exports, bar.disabled_categories?.includes("unused_exports"))} ` +
|
|
60
|
-
`C${count(bar.duplicates, bar.disabled_categories?.includes("duplicates"))} T${count(bar.todos, bar.disabled_categories?.includes("todos"))}`
|
|
61
|
-
);
|
|
52
|
+
return `${diagnosticsPart(bar)} T${count(bar.todos, bar.disabled_categories?.includes("todos"))}`;
|
|
62
53
|
}
|
|
63
54
|
|
|
64
55
|
/**
|