@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.
Files changed (37) hide show
  1. package/dist/config-live-reload.d.ts +4 -16
  2. package/dist/config-live-reload.d.ts.map +1 -1
  3. package/dist/config.d.ts +11 -28
  4. package/dist/config.d.ts.map +1 -1
  5. package/dist/entry/server.js +774 -410
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +774 -410
  8. package/dist/lsp-auto-install.d.ts.map +1 -1
  9. package/dist/shared/session-directory.d.ts +4 -2
  10. package/dist/shared/session-directory.d.ts.map +1 -1
  11. package/dist/shared/status.d.ts +0 -4
  12. package/dist/shared/status.d.ts.map +1 -1
  13. package/dist/subc-tool-schemas.d.ts +4 -3
  14. package/dist/subc-tool-schemas.d.ts.map +1 -1
  15. package/dist/tools/_shared.d.ts +11 -17
  16. package/dist/tools/_shared.d.ts.map +1 -1
  17. package/dist/tools/bash_watch.d.ts +6 -3
  18. package/dist/tools/bash_watch.d.ts.map +1 -1
  19. package/dist/tools/definitions/v2.d.ts +25 -0
  20. package/dist/tools/definitions/v2.d.ts.map +1 -1
  21. package/dist/tools/inspect.d.ts +0 -15
  22. package/dist/tools/inspect.d.ts.map +1 -1
  23. package/dist/tui/preferences.d.ts +1 -1
  24. package/dist/tui/v2-status.d.ts +3 -2
  25. package/dist/tui/v2-status.d.ts.map +1 -1
  26. package/dist/v2-session-lifecycle.d.ts.map +1 -1
  27. package/package.json +8 -8
  28. package/src/shared/session-directory.ts +10 -5
  29. package/src/shared/status.ts +2 -22
  30. package/src/tui/index.tsx +1 -25
  31. package/src/tui/preferences.ts +1 -1
  32. package/src/tui/sidebar-view.tsx +2 -39
  33. package/src/tui/v2-status.ts +5 -14
  34. package/src/tui-compiled/index.tsx +2 -41
  35. package/src/tui-compiled/preferences.ts +1 -1
  36. package/src/tui-compiled/sidebar-view.tsx +34 -72
  37. package/src/tui-compiled/v2-status.ts +5 -14
@@ -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 dead-code when the callgraph store cannot be used)
31
- * can leave the complete `status_bar` missing for the whole session.
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
- const stale = bar.tier2_stale ? "~" : "";
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
- const stale = bar.tier2_stale ? "~" : "";
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
- _$insert(_el$55, () => statusBar().tier2_stale ? "Code Health ~" : "Code Health");
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().dead_code !== undefined);
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 | D0 U0 C0 | T0`)
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()).code),
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$42 = _$createElement("text"),
643
- _el$43 = _$createElement("b");
644
- _$insertNode(_el$42, _el$43);
645
- _$insert(_el$43, () => collapsedCompressionValue(s()?.compression));
646
- _$effect(_$p => _$setProp(_el$42, "fg", props.palette.textMuted, _$p));
647
- return _el$42;
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$44 = _$createElement("box"),
708
- _el$45 = _$createElement("text");
709
- _$insertNode(_el$44, _el$45);
710
- _$setProp(_el$44, "width", "100%");
711
- _$insert(_el$45, semanticRefreshing);
712
- _$effect(_$p => _$setProp(_el$45, "fg", props.palette.textMuted, _$p));
713
- return _el$44;
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
- get title() {
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$46 = _$createElement("box"),
822
- _el$47 = _$createElement("text");
823
- _$insertNode(_el$46, _el$47);
824
- _$setProp(_el$46, "width", "100%");
825
- _$insert(_el$47, () => row.label);
826
- _$effect(_$p => _$setProp(_el$47, "fg", props.palette.text, _$p));
827
- return _el$46;
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$48 = _$createElement("box"),
841
- _el$49 = _$createElement("text"),
842
- _el$50 = _$createTextNode(`⚠ `);
843
- _$insertNode(_el$48, _el$49);
844
- _$setProp(_el$48, "marginTop", 1);
845
- _$setProp(_el$48, "width", "100%");
846
- _$insertNode(_el$49, _el$50);
847
- _$insert(_el$49, () => s().semantic_index.error, null);
848
- _$effect(_$p => _$setProp(_el$49, "fg", props.palette.error, _$p));
849
- return _el$48;
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 dead-code when the callgraph store cannot be used)
31
- * can leave the complete `status_bar` missing for the whole session.
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
- const stale = bar.tier2_stale ? "~" : "";
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
- const stale = bar.tier2_stale ? "~" : "";
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
  /**