@cortexkit/aft-opencode 0.58.2 → 0.60.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 (93) hide show
  1. package/dist/bash-wait-detach.d.ts.map +1 -1
  2. package/dist/bg-notifications.d.ts +13 -0
  3. package/dist/bg-notifications.d.ts.map +1 -1
  4. package/dist/bridge-bootstrap.d.ts +6 -6
  5. package/dist/bridge-bootstrap.d.ts.map +1 -1
  6. package/dist/config-live-reload.d.ts +36 -8
  7. package/dist/config-live-reload.d.ts.map +1 -1
  8. package/dist/config.d.ts +72 -17
  9. package/dist/config.d.ts.map +1 -1
  10. package/dist/configure-warnings.d.ts.map +1 -1
  11. package/dist/entry/server.js +5079 -2255
  12. package/dist/hooks/auto-update-checker/checker.d.ts.map +1 -1
  13. package/dist/hooks/auto-update-checker/index.d.ts.map +1 -1
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +4674 -1999
  16. package/dist/lsp-auto-install.d.ts.map +1 -1
  17. package/dist/lsp-github-install.d.ts +11 -2
  18. package/dist/lsp-github-install.d.ts.map +1 -1
  19. package/dist/notifications.d.ts +1 -1
  20. package/dist/notifications.d.ts.map +1 -1
  21. package/dist/rpc/contract.d.ts +1 -1
  22. package/dist/rpc/contract.d.ts.map +1 -1
  23. package/dist/rpc/register.d.ts +3 -1
  24. package/dist/rpc/register.d.ts.map +1 -1
  25. package/dist/shared/ignored-message.d.ts.map +1 -1
  26. package/dist/shared/read-vision.d.ts.map +1 -1
  27. package/dist/shared/rpc-client.d.ts +8 -0
  28. package/dist/shared/rpc-client.d.ts.map +1 -1
  29. package/dist/shared/rpc-server.d.ts.map +1 -1
  30. package/dist/shared/session-directory.d.ts +7 -5
  31. package/dist/shared/session-directory.d.ts.map +1 -1
  32. package/dist/shared/status.d.ts +10 -4
  33. package/dist/shared/status.d.ts.map +1 -1
  34. package/dist/shared/v2-context.d.ts +3 -0
  35. package/dist/shared/v2-context.d.ts.map +1 -0
  36. package/dist/subc-tool-schemas.d.ts +23 -1
  37. package/dist/subc-tool-schemas.d.ts.map +1 -1
  38. package/dist/tool-registration.d.ts +6 -3
  39. package/dist/tool-registration.d.ts.map +1 -1
  40. package/dist/tools/_shared.d.ts +2 -5
  41. package/dist/tools/_shared.d.ts.map +1 -1
  42. package/dist/tools/bash.d.ts +17 -0
  43. package/dist/tools/bash.d.ts.map +1 -1
  44. package/dist/tools/bash_watch.d.ts +11 -1
  45. package/dist/tools/bash_watch.d.ts.map +1 -1
  46. package/dist/tools/definitions/v2.d.ts +11 -1
  47. package/dist/tools/definitions/v2.d.ts.map +1 -1
  48. package/dist/tools/hoisted.d.ts +18 -0
  49. package/dist/tools/hoisted.d.ts.map +1 -1
  50. package/dist/tools/inspect.d.ts +10 -1
  51. package/dist/tools/inspect.d.ts.map +1 -1
  52. package/dist/tools/permissions.d.ts +2 -1
  53. package/dist/tools/permissions.d.ts.map +1 -1
  54. package/dist/tools/search.d.ts.map +1 -1
  55. package/dist/tools/semantic.d.ts.map +1 -1
  56. package/dist/tui/aft-rpc.d.ts +14 -0
  57. package/dist/tui/aft-rpc.d.ts.map +1 -1
  58. package/dist/tui/v2-status.d.ts.map +1 -1
  59. package/dist/types.d.ts +7 -1
  60. package/dist/types.d.ts.map +1 -1
  61. package/dist/v2-host-tool-names.d.ts +43 -0
  62. package/dist/v2-host-tool-names.d.ts.map +1 -0
  63. package/dist/v2-prompt-detach.d.ts +1 -0
  64. package/dist/v2-prompt-detach.d.ts.map +1 -1
  65. package/dist/v2-session-lifecycle.d.ts +22 -0
  66. package/dist/v2-session-lifecycle.d.ts.map +1 -0
  67. package/dist/v2-tool-hooks.d.ts +18 -0
  68. package/dist/v2-tool-hooks.d.ts.map +1 -0
  69. package/dist/v2-workflow-hints.d.ts +4 -0
  70. package/dist/v2-workflow-hints.d.ts.map +1 -0
  71. package/dist/wakes/runtime-consumer.d.ts +6 -1
  72. package/dist/wakes/runtime-consumer.d.ts.map +1 -1
  73. package/dist/wakes/session-delivery.d.ts +12 -7
  74. package/dist/wakes/session-delivery.d.ts.map +1 -1
  75. package/package.json +9 -9
  76. package/src/entry/server-runtime.mjs +36 -4
  77. package/src/shared/ignored-message.ts +18 -0
  78. package/src/shared/read-vision.ts +14 -4
  79. package/src/shared/rpc-client.ts +46 -5
  80. package/src/shared/rpc-server.ts +10 -0
  81. package/src/shared/session-directory.ts +67 -19
  82. package/src/shared/status.ts +40 -9
  83. package/src/shared/v2-context.ts +7 -0
  84. package/src/tui/aft-rpc.ts +11 -0
  85. package/src/tui/index.tsx +20 -16
  86. package/src/tui/sidebar-view.tsx +9 -1
  87. package/src/tui/v2-status.ts +8 -5
  88. package/src/tui/v2.tsx +50 -0
  89. package/src/tui-compiled/aft-rpc.ts +11 -0
  90. package/src/tui-compiled/index.tsx +27 -16
  91. package/src/tui-compiled/sidebar-view.tsx +11 -2
  92. package/src/tui-compiled/v2-status.ts +8 -5
  93. package/src/tui-compiled/v2.tsx +29 -0
@@ -197,6 +197,7 @@ const StatusDialog = props => {
197
197
  // The earlier `formatCompressionDialogRows` returned padded strings that
198
198
  // looked offset against neighboring sections.
199
199
  const compressionAggregateRows = () => formatCompressionSidebarRows(status()?.compression);
200
+ const statusBar = () => status()?.status_bar ?? status()?.status_bar_values;
200
201
  return (() => {
201
202
  var _el$4 = _$createElement("box"),
202
203
  _el$5 = _$createElement("box"),
@@ -698,7 +699,7 @@ const StatusDialog = props => {
698
699
  })() : null;
699
700
  })(), _el$9);
700
701
  _$insert(_el$4, (() => {
701
- var _c$9 = _$memo(() => !!status()?.status_bar);
702
+ var _c$9 = _$memo(() => !!statusBar());
702
703
  return () => _c$9() ? (() => {
703
704
  var _el$53 = _$createElement("box"),
704
705
  _el$54 = _$createElement("text"),
@@ -708,85 +709,95 @@ const StatusDialog = props => {
708
709
  _$setProp(_el$53, "width", "100%");
709
710
  _$setProp(_el$53, "marginTop", 1);
710
711
  _$insertNode(_el$54, _el$55);
711
- _$insert(_el$55, () => status().status_bar.tier2_stale ? "Code Health ~" : "Code Health");
712
+ _$insert(_el$55, () => statusBar().tier2_stale ? "Code Health ~" : "Code Health");
713
+ _$insert(_el$53, () => (statusBar().disabled_categories ?? []).map(key => _$createComponent(R, {
714
+ get theme() {
715
+ return t();
716
+ },
717
+ get label() {
718
+ return key.replaceAll("_", " ");
719
+ },
720
+ value: "\u25CB off",
721
+ tone: "muted"
722
+ })), null);
712
723
  _$insert(_el$53, (() => {
713
- var _c$14 = _$memo(() => status().status_bar.errors !== undefined);
724
+ var _c$14 = _$memo(() => statusBar().errors !== undefined);
714
725
  return () => _c$14() ? _$createComponent(R, {
715
726
  get theme() {
716
727
  return t();
717
728
  },
718
729
  label: "Errors",
719
730
  get value() {
720
- return formatCountShort(status().status_bar.errors);
731
+ return formatCountShort(statusBar().errors);
721
732
  },
722
733
  get tone() {
723
- return status().status_bar.errors > 0 ? "err" : "muted";
734
+ return statusBar().errors > 0 ? "err" : "muted";
724
735
  }
725
736
  }) : null;
726
737
  })(), null);
727
738
  _$insert(_el$53, (() => {
728
- var _c$15 = _$memo(() => status().status_bar.warnings !== undefined);
739
+ var _c$15 = _$memo(() => statusBar().warnings !== undefined);
729
740
  return () => _c$15() ? _$createComponent(R, {
730
741
  get theme() {
731
742
  return t();
732
743
  },
733
744
  label: "Warnings",
734
745
  get value() {
735
- return formatCountShort(status().status_bar.warnings);
746
+ return formatCountShort(statusBar().warnings);
736
747
  },
737
748
  get tone() {
738
- return status().status_bar.warnings > 0 ? "warn" : "muted";
749
+ return statusBar().warnings > 0 ? "warn" : "muted";
739
750
  }
740
751
  }) : null;
741
752
  })(), null);
742
753
  _$insert(_el$53, (() => {
743
- var _c$16 = _$memo(() => status().status_bar.dead_code !== undefined);
754
+ var _c$16 = _$memo(() => statusBar().dead_code !== undefined);
744
755
  return () => _c$16() ? _$createComponent(R, {
745
756
  get theme() {
746
757
  return t();
747
758
  },
748
759
  label: "Dead Code",
749
760
  get value() {
750
- return formatCountShort(status().status_bar.dead_code);
761
+ return formatCountShort(statusBar().dead_code);
751
762
  },
752
763
  tone: "muted"
753
764
  }) : null;
754
765
  })(), null);
755
766
  _$insert(_el$53, (() => {
756
- var _c$17 = _$memo(() => status().status_bar.unused_exports !== undefined);
767
+ var _c$17 = _$memo(() => statusBar().unused_exports !== undefined);
757
768
  return () => _c$17() ? _$createComponent(R, {
758
769
  get theme() {
759
770
  return t();
760
771
  },
761
772
  label: "Unused Exports",
762
773
  get value() {
763
- return formatCountShort(status().status_bar.unused_exports);
774
+ return formatCountShort(statusBar().unused_exports);
764
775
  },
765
776
  tone: "muted"
766
777
  }) : null;
767
778
  })(), null);
768
779
  _$insert(_el$53, (() => {
769
- var _c$18 = _$memo(() => status().status_bar.duplicates !== undefined);
780
+ var _c$18 = _$memo(() => statusBar().duplicates !== undefined);
770
781
  return () => _c$18() ? _$createComponent(R, {
771
782
  get theme() {
772
783
  return t();
773
784
  },
774
785
  label: "Duplicates",
775
786
  get value() {
776
- return formatCountShort(status().status_bar.duplicates);
787
+ return formatCountShort(statusBar().duplicates);
777
788
  },
778
789
  tone: "muted"
779
790
  }) : null;
780
791
  })(), null);
781
792
  _$insert(_el$53, (() => {
782
- var _c$19 = _$memo(() => status().status_bar.todos !== undefined);
793
+ var _c$19 = _$memo(() => statusBar().todos !== undefined);
783
794
  return () => _c$19() ? _$createComponent(R, {
784
795
  get theme() {
785
796
  return t();
786
797
  },
787
798
  label: "TODOs",
788
799
  get value() {
789
- return formatCountShort(status().status_bar.todos);
800
+ return formatCountShort(statusBar().todos);
790
801
  },
791
802
  tone: "muted"
792
803
  }) : null;
@@ -407,7 +407,7 @@ export const AftSidebarPanel = props => {
407
407
  const trigramBytes = () => s()?.disk?.trigram_disk_bytes ?? 0;
408
408
  const semanticBytes = () => s()?.disk?.semantic_disk_bytes ?? 0;
409
409
  const compressionRows = () => formatCompressionSidebarRows(s()?.compression);
410
- const statusBar = () => s()?.status_bar;
410
+ const statusBar = () => s()?.status_bar ?? s()?.status_bar_values;
411
411
  const degradedSummary = () => {
412
412
  const snap = s();
413
413
  if (!snap?.degraded) return null;
@@ -744,7 +744,16 @@ export const AftSidebarPanel = props => {
744
744
  get title() {
745
745
  return statusBar().tier2_stale ? "Code Health ~" : "Code Health";
746
746
  }
747
- }), _$memo(() => _$memo(() => statusBar().errors !== undefined)() && _$createComponent(StatRow, {
747
+ }), _$memo(() => (statusBar().disabled_categories ?? []).map(key => _$createComponent(StatRow, {
748
+ get palette() {
749
+ return props.palette;
750
+ },
751
+ get label() {
752
+ return key.replaceAll("_", " ");
753
+ },
754
+ value: "\u25CB off",
755
+ tone: "muted"
756
+ }))), _$memo(() => _$memo(() => statusBar().errors !== undefined)() && _$createComponent(StatRow, {
748
757
  get palette() {
749
758
  return props.palette;
750
759
  },
@@ -1,6 +1,7 @@
1
1
  import { type AftStatusSnapshot, degradedHeaderMarker, type StatusBar } from "../shared/status";
2
2
 
3
- function count(value: number | undefined): string {
3
+ function count(value: number | undefined, off = false): string {
4
+ if (off) return "○";
4
5
  return value === undefined ? "?" : String(value);
5
6
  }
6
7
 
@@ -10,6 +11,8 @@ function count(value: number | undefined): string {
10
11
  * indefinitely.
11
12
  */
12
13
  function diagnosticsPart(bar: StatusBar): string {
14
+ if (bar.disabled_categories?.includes("diagnostics")) return "E○ W○";
15
+ if (bar.diagnostics === "producer_missing") return "E? W?";
13
16
  if (
14
17
  bar.errors === undefined &&
15
18
  bar.warnings === undefined &&
@@ -36,8 +39,8 @@ export function formatAftStatusSegment(status: AftStatusSnapshot | null): string
36
39
  const stale = bar.tier2_stale ? "~" : "";
37
40
  return (
38
41
  `AFT ${diagnosticsPart(bar)} | ` +
39
- `${stale}D${count(bar.dead_code)} U${count(bar.unused_exports)} ` +
40
- `C${count(bar.duplicates)} | T${count(bar.todos)}`
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"))}`
41
44
  );
42
45
  }
43
46
 
@@ -53,8 +56,8 @@ function healthSummary(bar: StatusBar | undefined): string {
53
56
  const stale = bar.tier2_stale ? "~" : "";
54
57
  return (
55
58
  `${diagnosticsPart(bar)} ` +
56
- `${stale}D${count(bar.dead_code)} U${count(bar.unused_exports)} ` +
57
- `C${count(bar.duplicates)} T${count(bar.todos)}`
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"))}`
58
61
  );
59
62
  }
60
63
 
@@ -246,6 +246,31 @@ function AftStatusCommands(props) {
246
246
  }));
247
247
  return null;
248
248
  }
249
+
250
+ /** How long the built-in tool overlap toast stays up: long enough to read the command. */
251
+ const HOST_TOOL_OVERLAP_TOAST_MS = 15_000;
252
+
253
+ /**
254
+ * Show a server's one-off built-in tool overlap notice as a toast. A toast
255
+ * reaches the person at the terminal and nothing else. The current server no
256
+ * longer sends this notice: on OpenCode 2 AFT registers its command and patch
257
+ * tools as `shell` and `patch`, replacing the host's built-ins instead of
258
+ * sitting beside them. The subscription stays so a TUI still shows the notice
259
+ * from an older AFT server running in the same host during an upgrade. A host
260
+ * without a toast surface shows nothing.
261
+ */
262
+ export function subscribeV2HostToolOverlapToast(context, rpc, options) {
263
+ return rpc.events.on("hostToolOverlap", event => {
264
+ const toast = context.ui.toast;
265
+ if (typeof toast?.show !== "function") return;
266
+ toast.show({
267
+ title: "AFT",
268
+ message: event.data.message,
269
+ variant: "warning",
270
+ duration: HOST_TOOL_OVERLAP_TOAST_MS
271
+ });
272
+ }, options);
273
+ }
249
274
  export async function setupV2Tui(context) {
250
275
  const rpc = context.client.rpc(AftRpc);
251
276
  const controller = new AbortController();
@@ -282,9 +307,13 @@ export async function setupV2Tui(context) {
282
307
  const stopDialogEvents = rpc.events.on("showStatusDialog", event => showStatusDialog(context, rpc, event.data.sessionID ?? activeSessionID(context)), {
283
308
  signal: controller.signal
284
309
  });
310
+ const stopOverlapToasts = subscribeV2HostToolOverlapToast(context, rpc, {
311
+ signal: controller.signal
312
+ });
285
313
  return () => {
286
314
  controller.abort();
287
315
  stopDialogEvents();
316
+ stopOverlapToasts();
288
317
  for (const cleanup of slotCleanups) cleanup();
289
318
  };
290
319
  }