@cortexkit/aft-opencode 0.50.3 → 0.51.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.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +386 -154
- package/dist/shared/status.d.ts +15 -18
- package/dist/shared/status.d.ts.map +1 -1
- package/dist/tools/_shared.d.ts.map +1 -1
- package/dist/tools/bash.d.ts.map +1 -1
- package/dist/tools/inspect.d.ts +28 -0
- package/dist/tools/inspect.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/shared/status.ts +79 -50
- package/src/tui/index.tsx +55 -45
- package/src/tui/sidebar.tsx +79 -55
- package/src/tui-compiled/index.tsx +87 -69
- package/src/tui-compiled/sidebar.tsx +102 -84
- package/dist/status-bar-inject.d.ts +0 -11
- package/dist/status-bar-inject.d.ts.map +0 -1
|
@@ -17,7 +17,7 @@ import { createElement as _$createElement } from "opentui:runtime-module:%40open
|
|
|
17
17
|
import { canonicalizeProjectRoot } from "@cortexkit/aft-bridge";
|
|
18
18
|
import { createEffect, createMemo, createSignal, on, onCleanup } from "opentui:runtime-module:solid-js";
|
|
19
19
|
import { AftRpcClient } from "../shared/rpc-client";
|
|
20
|
-
import { coerceAftStatus, formatSemanticIndexStatus, formatSemanticRefreshing } from "../shared/status";
|
|
20
|
+
import { coerceAftStatus, formatSemanticIndexStatus, formatSemanticRefreshing, worktreeCacheRoleNote } from "../shared/status";
|
|
21
21
|
import { resolveCortexKitStorageRoot } from "../shared/storage-paths";
|
|
22
22
|
import { badgeTextColor } from "./badge-contrast";
|
|
23
23
|
import { createDebouncedStatusRefresh, refreshAftTuiSocketScope, subscribeStatusInvalidations } from "./notification-socket";
|
|
@@ -232,13 +232,14 @@ export function degradedReasonLabel(reason) {
|
|
|
232
232
|
}
|
|
233
233
|
return reason; // unknown reason — surface verbatim so users can grep logs
|
|
234
234
|
}
|
|
235
|
-
//
|
|
236
|
-
//
|
|
235
|
+
// Missing categories are intentionally muted: a green light requires an
|
|
236
|
+
// explicit zero for every category that feeds that light.
|
|
237
237
|
export function collapsedHealthLights(statusBar) {
|
|
238
238
|
if (!statusBar) return null;
|
|
239
|
-
const diagnostics = statusBar.errors > 0 ? "err" : statusBar.warnings > 0 ? "warn" : "ok";
|
|
240
|
-
const
|
|
241
|
-
const
|
|
239
|
+
const diagnostics = statusBar.errors !== undefined && statusBar.errors > 0 ? "err" : statusBar.warnings !== undefined && statusBar.warnings > 0 ? "warn" : statusBar.errors === 0 && statusBar.warnings === 0 ? "ok" : "muted";
|
|
240
|
+
const codeValues = [statusBar.dead_code, statusBar.unused_exports, statusBar.duplicates];
|
|
241
|
+
const code = codeValues.some(value => value !== undefined && value > 0) ? "warn" : codeValues.every(value => value === 0) ? "ok" : "muted";
|
|
242
|
+
const todos = statusBar.todos === undefined ? "muted" : statusBar.todos > 0 ? "warn" : "ok";
|
|
242
243
|
return {
|
|
243
244
|
diagnostics,
|
|
244
245
|
code,
|
|
@@ -510,6 +511,10 @@ const SidebarContent = props => {
|
|
|
510
511
|
if (reasons.length === 0) return null;
|
|
511
512
|
return reasons.map(degradedReasonLabel).join("; ");
|
|
512
513
|
};
|
|
514
|
+
|
|
515
|
+
// Worktree borrow is a shared-index arrangement, not a degraded_reasons
|
|
516
|
+
// entry. Keep this muted and separate from the DEGRADED badge above.
|
|
517
|
+
const worktreeNote = () => worktreeCacheRoleNote(s()?.cache_role);
|
|
513
518
|
return (() => {
|
|
514
519
|
var _el$0 = _$createElement("box"),
|
|
515
520
|
_el$1 = _$createElement("box"),
|
|
@@ -601,114 +606,127 @@ const SidebarContent = props => {
|
|
|
601
606
|
})();
|
|
602
607
|
})(), null);
|
|
603
608
|
_$insert(_el$0, (() => {
|
|
604
|
-
var _c$5 = _$memo(() => !!notInitialized());
|
|
609
|
+
var _c$5 = _$memo(() => !!(!notInitialized() && worktreeNote()));
|
|
605
610
|
return () => _c$5() && (() => {
|
|
606
611
|
var _el$23 = _$createElement("box"),
|
|
607
612
|
_el$24 = _$createElement("text");
|
|
608
613
|
_$insertNode(_el$23, _el$24);
|
|
609
614
|
_$setProp(_el$23, "marginTop", 1);
|
|
610
615
|
_$setProp(_el$23, "width", "100%");
|
|
611
|
-
_$insert(_el$24,
|
|
616
|
+
_$insert(_el$24, worktreeNote);
|
|
612
617
|
_$effect(_$p => _$setProp(_el$24, "fg", props.theme.textMuted, _$p));
|
|
613
618
|
return _el$23;
|
|
614
619
|
})();
|
|
615
620
|
})(), null);
|
|
616
621
|
_$insert(_el$0, (() => {
|
|
617
|
-
var _c$6 = _$memo(() => !!
|
|
622
|
+
var _c$6 = _$memo(() => !!notInitialized());
|
|
618
623
|
return () => _c$6() && (() => {
|
|
619
|
-
var _el$25 = _$createElement("box")
|
|
624
|
+
var _el$25 = _$createElement("box"),
|
|
625
|
+
_el$26 = _$createElement("text");
|
|
626
|
+
_$insertNode(_el$25, _el$26);
|
|
627
|
+
_$setProp(_el$25, "marginTop", 1);
|
|
620
628
|
_$setProp(_el$25, "width", "100%");
|
|
621
|
-
_$
|
|
622
|
-
_$
|
|
623
|
-
|
|
624
|
-
|
|
629
|
+
_$insert(_el$26, () => s().message || "AFT bridge is now spawned lazily, information here will be populated after first tool call.");
|
|
630
|
+
_$effect(_$p => _$setProp(_el$26, "fg", props.theme.textMuted, _$p));
|
|
631
|
+
return _el$25;
|
|
632
|
+
})();
|
|
633
|
+
})(), null);
|
|
634
|
+
_$insert(_el$0, (() => {
|
|
635
|
+
var _c$7 = _$memo(() => !!(!notInitialized() && collapsed()));
|
|
636
|
+
return () => _c$7() && (() => {
|
|
637
|
+
var _el$27 = _$createElement("box");
|
|
638
|
+
_$setProp(_el$27, "width", "100%");
|
|
639
|
+
_$setProp(_el$27, "flexDirection", "column");
|
|
640
|
+
_$insert(_el$27, (() => {
|
|
641
|
+
var _c$9 = _$memo(() => !!prefs().sections.searchIndex);
|
|
642
|
+
return () => _c$9() && _$createComponent(CollapsedRow, {
|
|
625
643
|
get theme() {
|
|
626
644
|
return props.theme;
|
|
627
645
|
},
|
|
628
646
|
label: "Search Index",
|
|
629
647
|
get children() {
|
|
630
|
-
var _el$
|
|
631
|
-
_$insertNode(_el$
|
|
632
|
-
_$effect(_$p => _$setProp(_el$
|
|
633
|
-
return _el$
|
|
648
|
+
var _el$28 = _$createElement("text");
|
|
649
|
+
_$insertNode(_el$28, _$createTextNode(`●`));
|
|
650
|
+
_$effect(_$p => _$setProp(_el$28, "fg", toneColor(props.theme, searchStatus().tone), _$p));
|
|
651
|
+
return _el$28;
|
|
634
652
|
}
|
|
635
653
|
});
|
|
636
654
|
})(), null);
|
|
637
|
-
_$insert(_el$
|
|
638
|
-
var _c$
|
|
639
|
-
return () => _c$
|
|
655
|
+
_$insert(_el$27, (() => {
|
|
656
|
+
var _c$0 = _$memo(() => !!prefs().sections.semanticIndex);
|
|
657
|
+
return () => _c$0() && _$createComponent(CollapsedRow, {
|
|
640
658
|
get theme() {
|
|
641
659
|
return props.theme;
|
|
642
660
|
},
|
|
643
661
|
label: "Semantic Index",
|
|
644
662
|
get children() {
|
|
645
|
-
var _el$
|
|
646
|
-
_$insertNode(_el$
|
|
647
|
-
_$effect(_$p => _$setProp(_el$
|
|
648
|
-
return _el$
|
|
663
|
+
var _el$30 = _$createElement("text");
|
|
664
|
+
_$insertNode(_el$30, _$createTextNode(`●`));
|
|
665
|
+
_$effect(_$p => _$setProp(_el$30, "fg", toneColor(props.theme, semanticStatus().tone), _$p));
|
|
666
|
+
return _el$30;
|
|
649
667
|
}
|
|
650
668
|
});
|
|
651
669
|
})(), null);
|
|
652
|
-
_$insert(_el$
|
|
653
|
-
var _c$
|
|
654
|
-
return () => _c$
|
|
670
|
+
_$insert(_el$27, (() => {
|
|
671
|
+
var _c$1 = _$memo(() => !!(prefs().sections.codeHealth && collapsedHealthLights(statusBar())));
|
|
672
|
+
return () => _c$1() && _$createComponent(CollapsedRow, {
|
|
655
673
|
get theme() {
|
|
656
674
|
return props.theme;
|
|
657
675
|
},
|
|
658
676
|
label: "Code Health",
|
|
659
677
|
get children() {
|
|
660
|
-
var _el$
|
|
661
|
-
_el$31 = _$createElement("text"),
|
|
678
|
+
var _el$32 = _$createElement("box"),
|
|
662
679
|
_el$33 = _$createElement("text"),
|
|
663
|
-
_el$35 = _$createElement("text")
|
|
664
|
-
|
|
665
|
-
_$insertNode(_el$
|
|
666
|
-
_$insertNode(_el$
|
|
667
|
-
_$
|
|
668
|
-
_$setProp(_el$
|
|
669
|
-
_$
|
|
680
|
+
_el$35 = _$createElement("text"),
|
|
681
|
+
_el$37 = _$createElement("text");
|
|
682
|
+
_$insertNode(_el$32, _el$33);
|
|
683
|
+
_$insertNode(_el$32, _el$35);
|
|
684
|
+
_$insertNode(_el$32, _el$37);
|
|
685
|
+
_$setProp(_el$32, "flexDirection", "row");
|
|
686
|
+
_$setProp(_el$32, "gap", 1);
|
|
670
687
|
_$insertNode(_el$33, _$createTextNode(`●`));
|
|
671
688
|
_$insertNode(_el$35, _$createTextNode(`●`));
|
|
689
|
+
_$insertNode(_el$37, _$createTextNode(`●`));
|
|
672
690
|
_$effect(_p$ => {
|
|
673
691
|
var _v$0 = toneColor(props.theme, collapsedHealthLights(statusBar()).diagnostics),
|
|
674
692
|
_v$1 = toneColor(props.theme, collapsedHealthLights(statusBar()).code),
|
|
675
693
|
_v$10 = toneColor(props.theme, collapsedHealthLights(statusBar()).todos);
|
|
676
|
-
_v$0 !== _p$.e && (_p$.e = _$setProp(_el$
|
|
677
|
-
_v$1 !== _p$.t && (_p$.t = _$setProp(_el$
|
|
678
|
-
_v$10 !== _p$.a && (_p$.a = _$setProp(_el$
|
|
694
|
+
_v$0 !== _p$.e && (_p$.e = _$setProp(_el$33, "fg", _v$0, _p$.e));
|
|
695
|
+
_v$1 !== _p$.t && (_p$.t = _$setProp(_el$35, "fg", _v$1, _p$.t));
|
|
696
|
+
_v$10 !== _p$.a && (_p$.a = _$setProp(_el$37, "fg", _v$10, _p$.a));
|
|
679
697
|
return _p$;
|
|
680
698
|
}, {
|
|
681
699
|
e: undefined,
|
|
682
700
|
t: undefined,
|
|
683
701
|
a: undefined
|
|
684
702
|
});
|
|
685
|
-
return _el$
|
|
703
|
+
return _el$32;
|
|
686
704
|
}
|
|
687
705
|
});
|
|
688
706
|
})(), null);
|
|
689
|
-
_$insert(_el$
|
|
690
|
-
var _c$
|
|
691
|
-
return () => _c$
|
|
707
|
+
_$insert(_el$27, (() => {
|
|
708
|
+
var _c$10 = _$memo(() => !!(prefs().sections.compression && collapsedCompressionValue(s()?.compression)));
|
|
709
|
+
return () => _c$10() && _$createComponent(CollapsedRow, {
|
|
692
710
|
get theme() {
|
|
693
711
|
return props.theme;
|
|
694
712
|
},
|
|
695
713
|
label: "Compression",
|
|
696
714
|
get children() {
|
|
697
|
-
var _el$
|
|
698
|
-
_el$
|
|
699
|
-
_$insertNode(_el$
|
|
700
|
-
_$insert(_el$
|
|
701
|
-
_$effect(_$p => _$setProp(_el$
|
|
702
|
-
return _el$
|
|
715
|
+
var _el$39 = _$createElement("text"),
|
|
716
|
+
_el$40 = _$createElement("b");
|
|
717
|
+
_$insertNode(_el$39, _el$40);
|
|
718
|
+
_$insert(_el$40, () => collapsedCompressionValue(s()?.compression));
|
|
719
|
+
_$effect(_$p => _$setProp(_el$39, "fg", props.theme.textMuted, _$p));
|
|
720
|
+
return _el$39;
|
|
703
721
|
}
|
|
704
722
|
});
|
|
705
723
|
})(), null);
|
|
706
|
-
return _el$
|
|
724
|
+
return _el$27;
|
|
707
725
|
})();
|
|
708
726
|
})(), null);
|
|
709
727
|
_$insert(_el$0, (() => {
|
|
710
|
-
var _c$
|
|
711
|
-
return () => _c$
|
|
728
|
+
var _c$8 = _$memo(() => !!(!notInitialized() && !collapsed()));
|
|
729
|
+
return () => _c$8() && [_$memo(() => _$memo(() => !!prefs().sections.searchIndex)() && [_$createComponent(SectionHeader, {
|
|
712
730
|
get theme() {
|
|
713
731
|
return props.theme;
|
|
714
732
|
},
|
|
@@ -759,13 +777,13 @@ const SidebarContent = props => {
|
|
|
759
777
|
return semanticStatus().tone;
|
|
760
778
|
}
|
|
761
779
|
}), _$memo(() => _$memo(() => !!semanticRefreshing())() && (() => {
|
|
762
|
-
var _el$
|
|
763
|
-
_el$
|
|
764
|
-
_$insertNode(_el$
|
|
765
|
-
_$setProp(_el$
|
|
766
|
-
_$insert(_el$
|
|
767
|
-
_$effect(_$p => _$setProp(_el$
|
|
768
|
-
return _el$
|
|
780
|
+
var _el$41 = _$createElement("box"),
|
|
781
|
+
_el$42 = _$createElement("text");
|
|
782
|
+
_$insertNode(_el$41, _el$42);
|
|
783
|
+
_$setProp(_el$41, "width", "100%");
|
|
784
|
+
_$insert(_el$42, semanticRefreshing);
|
|
785
|
+
_$effect(_$p => _$setProp(_el$42, "fg", props.theme.textMuted, _$p));
|
|
786
|
+
return _el$41;
|
|
769
787
|
})()), _$memo(() => _$memo(() => !!(s()?.semantic_index?.status === "loading" && s()?.semantic_index?.entries_total != null && s().semantic_index.entries_total > 0))() && _$createComponent(StatRow, {
|
|
770
788
|
get theme() {
|
|
771
789
|
return props.theme;
|
|
@@ -800,7 +818,7 @@ const SidebarContent = props => {
|
|
|
800
818
|
get title() {
|
|
801
819
|
return statusBar().tier2_stale ? "Code Health ~" : "Code Health";
|
|
802
820
|
}
|
|
803
|
-
}), _$createComponent(StatRow, {
|
|
821
|
+
}), _$memo(() => _$memo(() => statusBar().errors !== undefined)() && _$createComponent(StatRow, {
|
|
804
822
|
get theme() {
|
|
805
823
|
return props.theme;
|
|
806
824
|
},
|
|
@@ -811,7 +829,7 @@ const SidebarContent = props => {
|
|
|
811
829
|
get tone() {
|
|
812
830
|
return statusBar().errors > 0 ? "err" : "muted";
|
|
813
831
|
}
|
|
814
|
-
}), _$createComponent(StatRow, {
|
|
832
|
+
})), _$memo(() => _$memo(() => statusBar().warnings !== undefined)() && _$createComponent(StatRow, {
|
|
815
833
|
get theme() {
|
|
816
834
|
return props.theme;
|
|
817
835
|
},
|
|
@@ -822,7 +840,7 @@ const SidebarContent = props => {
|
|
|
822
840
|
get tone() {
|
|
823
841
|
return statusBar().warnings > 0 ? "warn" : "muted";
|
|
824
842
|
}
|
|
825
|
-
}), _$createComponent(StatRow, {
|
|
843
|
+
})), _$memo(() => _$memo(() => statusBar().dead_code !== undefined)() && _$createComponent(StatRow, {
|
|
826
844
|
get theme() {
|
|
827
845
|
return props.theme;
|
|
828
846
|
},
|
|
@@ -831,7 +849,7 @@ const SidebarContent = props => {
|
|
|
831
849
|
return formatCount(statusBar().dead_code);
|
|
832
850
|
},
|
|
833
851
|
tone: "muted"
|
|
834
|
-
}), _$createComponent(StatRow, {
|
|
852
|
+
})), _$memo(() => _$memo(() => statusBar().unused_exports !== undefined)() && _$createComponent(StatRow, {
|
|
835
853
|
get theme() {
|
|
836
854
|
return props.theme;
|
|
837
855
|
},
|
|
@@ -840,7 +858,7 @@ const SidebarContent = props => {
|
|
|
840
858
|
return formatCount(statusBar().unused_exports);
|
|
841
859
|
},
|
|
842
860
|
tone: "muted"
|
|
843
|
-
}), _$createComponent(StatRow, {
|
|
861
|
+
})), _$memo(() => _$memo(() => statusBar().duplicates !== undefined)() && _$createComponent(StatRow, {
|
|
844
862
|
get theme() {
|
|
845
863
|
return props.theme;
|
|
846
864
|
},
|
|
@@ -849,7 +867,7 @@ const SidebarContent = props => {
|
|
|
849
867
|
return formatCount(statusBar().duplicates);
|
|
850
868
|
},
|
|
851
869
|
tone: "muted"
|
|
852
|
-
}), _$createComponent(StatRow, {
|
|
870
|
+
})), _$memo(() => _$memo(() => statusBar().todos !== undefined)() && _$createComponent(StatRow, {
|
|
853
871
|
get theme() {
|
|
854
872
|
return props.theme;
|
|
855
873
|
},
|
|
@@ -858,19 +876,19 @@ const SidebarContent = props => {
|
|
|
858
876
|
return formatCount(statusBar().todos);
|
|
859
877
|
},
|
|
860
878
|
tone: "muted"
|
|
861
|
-
})]), _$memo(() => _$memo(() => !!(prefs().sections.compression && compressionRows().length > 0))() && [_$createComponent(SectionHeader, {
|
|
879
|
+
}))]), _$memo(() => _$memo(() => !!(prefs().sections.compression && compressionRows().length > 0))() && [_$createComponent(SectionHeader, {
|
|
862
880
|
get theme() {
|
|
863
881
|
return props.theme;
|
|
864
882
|
},
|
|
865
883
|
title: "Compression"
|
|
866
884
|
}), _$memo(() => compressionRows().map(row => row.kind === "scope" ? (() => {
|
|
867
|
-
var _el$
|
|
868
|
-
_el$
|
|
869
|
-
_$insertNode(_el$
|
|
870
|
-
_$setProp(_el$
|
|
871
|
-
_$insert(_el$
|
|
872
|
-
_$effect(_$p => _$setProp(_el$
|
|
873
|
-
return _el$
|
|
885
|
+
var _el$43 = _$createElement("box"),
|
|
886
|
+
_el$44 = _$createElement("text");
|
|
887
|
+
_$insertNode(_el$43, _el$44);
|
|
888
|
+
_$setProp(_el$43, "width", "100%");
|
|
889
|
+
_$insert(_el$44, () => row.label);
|
|
890
|
+
_$effect(_$p => _$setProp(_el$44, "fg", props.theme.text, _$p));
|
|
891
|
+
return _el$43;
|
|
874
892
|
})() : _$createComponent(StatRow, {
|
|
875
893
|
get theme() {
|
|
876
894
|
return props.theme;
|
|
@@ -883,16 +901,16 @@ const SidebarContent = props => {
|
|
|
883
901
|
},
|
|
884
902
|
tone: "muted"
|
|
885
903
|
})))]), _$memo(() => _$memo(() => !!(s()?.semantic_index?.status === "failed" && s()?.semantic_index?.error))() && (() => {
|
|
886
|
-
var _el$
|
|
887
|
-
_el$
|
|
888
|
-
_el$
|
|
889
|
-
_$insertNode(_el$
|
|
890
|
-
_$setProp(_el$
|
|
891
|
-
_$setProp(_el$
|
|
892
|
-
_$insertNode(_el$
|
|
893
|
-
_$insert(_el$
|
|
894
|
-
_$effect(_$p => _$setProp(_el$
|
|
895
|
-
return _el$
|
|
904
|
+
var _el$45 = _$createElement("box"),
|
|
905
|
+
_el$46 = _$createElement("text"),
|
|
906
|
+
_el$47 = _$createTextNode(`⚠ `);
|
|
907
|
+
_$insertNode(_el$45, _el$46);
|
|
908
|
+
_$setProp(_el$45, "marginTop", 1);
|
|
909
|
+
_$setProp(_el$45, "width", "100%");
|
|
910
|
+
_$insertNode(_el$46, _el$47);
|
|
911
|
+
_$insert(_el$46, () => s().semantic_index.error, null);
|
|
912
|
+
_$effect(_$p => _$setProp(_el$46, "fg", props.theme.error, _$p));
|
|
913
|
+
return _el$45;
|
|
896
914
|
})())];
|
|
897
915
|
})(), null);
|
|
898
916
|
_$effect(_p$ => {
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { type StatusBarCounts } from "@cortexkit/aft-bridge";
|
|
2
|
-
/**
|
|
3
|
-
* Decide whether to surface the bar for this session+counts and, if so, return
|
|
4
|
-
* the line to append to the tool output. Returns `""` when suppressed
|
|
5
|
-
* (unchanged since last emit and heartbeat not elapsed) or when counts are
|
|
6
|
-
* absent (no inspect scan has populated Tier-2 yet).
|
|
7
|
-
*/
|
|
8
|
-
export declare function statusBarSuffixForSession(sessionID: string, counts: StatusBarCounts | undefined, force?: boolean): string;
|
|
9
|
-
/** Drop a session's emit state (on session delete/shutdown). */
|
|
10
|
-
export declare function clearStatusBarSession(sessionID: string): void;
|
|
11
|
-
//# sourceMappingURL=status-bar-inject.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"status-bar-inject.d.ts","sourceRoot":"","sources":["../src/status-bar-inject.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,KAAK,eAAe,EAIrB,MAAM,uBAAuB,CAAC;AAI/B;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,eAAe,GAAG,SAAS,EACnC,KAAK,UAAQ,GACZ,MAAM,CAkBR;AAED,gEAAgE;AAChE,wBAAgB,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAE7D"}
|