@proxysoul/soulforge 2.20.18 → 2.20.19

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/index.js CHANGED
@@ -72638,7 +72638,7 @@ var package_default;
72638
72638
  var init_package = __esm(() => {
72639
72639
  package_default = {
72640
72640
  name: "@proxysoul/soulforge",
72641
- version: "2.20.18",
72641
+ version: "2.20.19",
72642
72642
  description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
72643
72643
  repository: {
72644
72644
  type: "git",
@@ -119682,6 +119682,7 @@ var init_types2 = __esm(() => {
119682
119682
  ".scala": "scala",
119683
119683
  ".sc": "scala",
119684
119684
  ".lua": "lua",
119685
+ ".luau": "lua",
119685
119686
  ".ex": "elixir",
119686
119687
  ".exs": "elixir",
119687
119688
  ".dart": "dart",
@@ -119959,7 +119960,10 @@ var init_server_registry = __esm(() => {
119959
119960
  ],
119960
119961
  go: [{ command: "gopls", args: ["serve"] }],
119961
119962
  rust: [{ command: "rust-analyzer", args: [] }],
119962
- lua: [{ command: "lua-language-server", args: [] }],
119963
+ lua: [
119964
+ { command: "lua-language-server", args: [] },
119965
+ { command: "luau-lsp", args: ["lsp"] }
119966
+ ],
119963
119967
  c: [{ command: "clangd", args: [] }],
119964
119968
  cpp: [{ command: "clangd", args: [] }],
119965
119969
  ruby: [{ command: "solargraph", args: ["stdio"] }],
@@ -496625,12 +496629,84 @@ var init_CommandPalette = __esm(async () => {
496625
496629
  };
496626
496630
  });
496627
496631
 
496632
+ // src/hooks/useMarqueeScroll.ts
496633
+ function tickMarquee(state, maxPos, pauseTicks) {
496634
+ if (state.endPause > 0) {
496635
+ const nextEndPause = state.endPause - 1;
496636
+ return {
496637
+ scrollPos: nextEndPause === 0 ? 0 : state.scrollPos,
496638
+ startPause: state.startPause,
496639
+ endPause: nextEndPause
496640
+ };
496641
+ }
496642
+ if (state.scrollPos === 0 && state.startPause > 0) {
496643
+ return {
496644
+ scrollPos: 0,
496645
+ startPause: state.startPause - 1,
496646
+ endPause: 0
496647
+ };
496648
+ }
496649
+ if (state.scrollPos >= maxPos) {
496650
+ return {
496651
+ scrollPos: state.scrollPos,
496652
+ startPause: pauseTicks,
496653
+ endPause: pauseTicks
496654
+ };
496655
+ }
496656
+ return {
496657
+ scrollPos: state.scrollPos + 1,
496658
+ startPause: state.startPause,
496659
+ endPause: state.endPause
496660
+ };
496661
+ }
496662
+ function getMarqueeDisplayText(text4, maxWidth, active, scrollPos) {
496663
+ if (maxWidth <= 0) {
496664
+ return "";
496665
+ }
496666
+ if (active && text4.length > maxWidth) {
496667
+ return text4.slice(scrollPos, scrollPos + maxWidth);
496668
+ }
496669
+ if (text4.length > maxWidth) {
496670
+ return `${text4.slice(0, maxWidth - 1)}\u2026`;
496671
+ }
496672
+ return text4;
496673
+ }
496674
+ function useMarqueeScroll(text4, maxWidth, active) {
496675
+ const [scrollPos, setScrollPos] = import_react103.useState(0);
496676
+ const stateRef = import_react103.useRef({ scrollPos: 0, startPause: PAUSE_TICKS, endPause: 0 });
496677
+ import_react103.useEffect(() => {
496678
+ if (maxWidth <= 0) {
496679
+ stateRef.current = { scrollPos: 0, startPause: PAUSE_TICKS, endPause: 0 };
496680
+ setScrollPos(0);
496681
+ return;
496682
+ }
496683
+ if (!active || text4.length <= maxWidth) {
496684
+ stateRef.current = { scrollPos: 0, startPause: PAUSE_TICKS, endPause: 0 };
496685
+ setScrollPos(0);
496686
+ return;
496687
+ }
496688
+ stateRef.current = { scrollPos: 0, startPause: PAUSE_TICKS, endPause: 0 };
496689
+ const maxPos = text4.length - maxWidth;
496690
+ const timer = setInterval(() => {
496691
+ const next = tickMarquee(stateRef.current, maxPos, PAUSE_TICKS);
496692
+ stateRef.current = next;
496693
+ setScrollPos(next.scrollPos);
496694
+ }, SCROLL_INTERVAL);
496695
+ return () => clearInterval(timer);
496696
+ }, [active, text4, maxWidth]);
496697
+ return getMarqueeDisplayText(text4, maxWidth, active, scrollPos);
496698
+ }
496699
+ var import_react103, SCROLL_INTERVAL = 100, PAUSE_TICKS = 10;
496700
+ var init_useMarqueeScroll = __esm(() => {
496701
+ import_react103 = __toESM(require_react(), 1);
496702
+ });
496703
+
496628
496704
  // src/components/modals/CommandPicker.tsx
496629
496705
  import { TextAttributes as TextAttributes21 } from "@opentui/core";
496630
496706
  function useListScroll(maxVisible) {
496631
- const [cursor3, setCursor] = import_react104.useState(0);
496632
- const [scrollOffset, setScrollOffset] = import_react104.useState(0);
496633
- const adjustScroll = import_react104.useCallback((nextCursor) => {
496707
+ const [cursor3, setCursor] = import_react105.useState(0);
496708
+ const [scrollOffset, setScrollOffset] = import_react105.useState(0);
496709
+ const adjustScroll = import_react105.useCallback((nextCursor) => {
496634
496710
  setScrollOffset((prev) => {
496635
496711
  let next = prev;
496636
496712
  if (nextCursor < prev)
@@ -496682,6 +496758,9 @@ function OptionRow2({
496682
496758
  textFaint,
496683
496759
  successColor
496684
496760
  }) {
496761
+ const descMaxWidth = innerW - 10;
496762
+ const descActive = isActive && option2.disabled !== true && option2.kind !== "separator";
496763
+ const descText = useMarqueeScroll(option2.description ?? "", descMaxWidth, descActive);
496685
496764
  if (option2.kind === "separator") {
496686
496765
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
496687
496766
  flexDirection: "row",
@@ -496744,7 +496823,7 @@ function OptionRow2({
496744
496823
  children: [
496745
496824
  " ",
496746
496825
  option2.icon ? " " : "",
496747
- option2.description.length > innerW - 10 ? `${option2.description.slice(0, innerW - 13)}\u2026` : option2.description
496826
+ descText
496748
496827
  ]
496749
496828
  }, undefined, true, undefined, this)
496750
496829
  }, undefined, false, undefined, this)
@@ -496762,12 +496841,12 @@ function CommandPicker({ visible, config: config2, onClose }) {
496762
496841
  const extraChrome = controlRows > 0 ? controlRows + 1 : 0;
496763
496842
  const maxVisible = Math.max(4, Math.floor(containerRows * 0.8) - CHROME_ROWS2 - extraChrome);
496764
496843
  const { cursor: cursor3, setCursor, scrollOffset, setScrollOffset, adjustScroll } = useListScroll(maxVisible);
496765
- const [scope, setScope] = import_react104.useState("project");
496766
- const [search, setSearch] = import_react104.useState("");
496767
- const [toggleState, setToggleState] = import_react104.useState({});
496768
- const [toggleLabels, setToggleLabels] = import_react104.useState({});
496769
- const [selectorState, setSelectorState] = import_react104.useState({});
496770
- const [focusZone, setFocusZone] = import_react104.useState(ZONE_LIST);
496844
+ const [scope, setScope] = import_react105.useState("project");
496845
+ const [search, setSearch] = import_react105.useState("");
496846
+ const [toggleState, setToggleState] = import_react105.useState({});
496847
+ const [toggleLabels, setToggleLabels] = import_react105.useState({});
496848
+ const [selectorState, setSelectorState] = import_react105.useState({});
496849
+ const [focusZone, setFocusZone] = import_react105.useState(ZONE_LIST);
496771
496850
  const controls = (() => {
496772
496851
  const list = [];
496773
496852
  if (config2?.toggles)
@@ -496791,9 +496870,9 @@ function CommandPicker({ visible, config: config2, onClose }) {
496791
496870
  scored.sort((a4, b6) => b6.score - a4.score);
496792
496871
  return scored.map((s2) => s2.option);
496793
496872
  })();
496794
- const prevVisibleRef = import_react104.useRef(false);
496795
- const prevOptionsRef = import_react104.useRef(null);
496796
- import_react104.useEffect(() => {
496873
+ const prevVisibleRef = import_react105.useRef(false);
496874
+ const prevOptionsRef = import_react105.useRef(null);
496875
+ import_react105.useEffect(() => {
496797
496876
  if (!visible || !config2) {
496798
496877
  prevVisibleRef.current = visible;
496799
496878
  prevOptionsRef.current = null;
@@ -496844,8 +496923,8 @@ function CommandPicker({ visible, config: config2, onClose }) {
496844
496923
  }
496845
496924
  prevOptionsRef.current = filteredOptions;
496846
496925
  }, [visible, config2, filteredOptions, setCursor, setScrollOffset, maxVisible]);
496847
- const prevSearch = import_react104.useRef("");
496848
- import_react104.useEffect(() => {
496926
+ const prevSearch = import_react105.useRef("");
496927
+ import_react105.useEffect(() => {
496849
496928
  if (!config2?.searchable)
496850
496929
  return;
496851
496930
  if (search !== prevSearch.current) {
@@ -496856,8 +496935,8 @@ function CommandPicker({ visible, config: config2, onClose }) {
496856
496935
  }
496857
496936
  }
496858
496937
  }, [search, config2?.searchable, setCursor, setScrollOffset]);
496859
- const prevCursorValue = import_react104.useRef(null);
496860
- import_react104.useEffect(() => {
496938
+ const prevCursorValue = import_react105.useRef(null);
496939
+ import_react105.useEffect(() => {
496861
496940
  if (!visible || !config2?.onCursorChange)
496862
496941
  return;
496863
496942
  const val = filteredOptions[cursor3]?.value;
@@ -497254,16 +497333,17 @@ function CommandPicker({ visible, config: config2, onClose }) {
497254
497333
  ]
497255
497334
  }, undefined, true, undefined, this);
497256
497335
  }
497257
- var import_react104, MAX_POPUP_WIDTH2 = 60, CHROME_ROWS2 = 7, ZONE_LIST = -1;
497336
+ var import_react105, MAX_POPUP_WIDTH2 = 60, CHROME_ROWS2 = 7, ZONE_LIST = -1;
497258
497337
  var init_CommandPicker = __esm(async () => {
497259
497338
  init_theme();
497339
+ init_useMarqueeScroll();
497260
497340
  init_jsx_dev_runtime();
497261
497341
  await __promiseAll([
497262
497342
  init_react2(),
497263
497343
  init_shared(),
497264
497344
  init_ui2()
497265
497345
  ]);
497266
- import_react104 = __toESM(require_react(), 1);
497346
+ import_react105 = __toESM(require_react(), 1);
497267
497347
  });
497268
497348
 
497269
497349
  // src/components/modals/DiagnosePopup.tsx
@@ -497328,19 +497408,19 @@ function buildLines(result, running, spinnerCh, t2) {
497328
497408
  function DiagnosePopup({ visible, onClose, runHealthCheck }) {
497329
497409
  const t2 = useTheme();
497330
497410
  const { width: tw2, height: th } = useTerminalDimensions();
497331
- const [result, setResult] = import_react106.useState(null);
497332
- const [running, setRunning] = import_react106.useState(false);
497333
- const [err2, setErr] = import_react106.useState(null);
497334
- const [cursor3, setCursor] = import_react106.useState(0);
497335
- const scrollRef = import_react106.useRef(null);
497411
+ const [result, setResult] = import_react107.useState(null);
497412
+ const [running, setRunning] = import_react107.useState(false);
497413
+ const [err2, setErr] = import_react107.useState(null);
497414
+ const [cursor3, setCursor] = import_react107.useState(0);
497415
+ const scrollRef = import_react107.useRef(null);
497336
497416
  const spinnerRef = useSpinnerFrameRef();
497337
497417
  const spinnerCh = SPINNER_FRAMES[spinnerRef.current % SPINNER_FRAMES.length] ?? "\u280B";
497338
497418
  const popupW = Math.min(80, Math.max(56, Math.floor(tw2 * 0.65)));
497339
497419
  const popupH = Math.min(30, Math.max(16, th - 4));
497340
497420
  const contentW = popupW - 4;
497341
497421
  const viewportRows = Math.max(6, popupH - 9);
497342
- const lines = import_react106.useMemo(() => result ? buildLines(result, running, spinnerCh, t2) : [], [result, running, spinnerCh, t2]);
497343
- const run3 = import_react106.useCallback(() => {
497422
+ const lines = import_react107.useMemo(() => result ? buildLines(result, running, spinnerCh, t2) : [], [result, running, spinnerCh, t2]);
497423
+ const run3 = import_react107.useCallback(() => {
497344
497424
  setRunning(true);
497345
497425
  setErr(null);
497346
497426
  setResult(null);
@@ -497363,7 +497443,7 @@ function DiagnosePopup({ visible, onClose, runHealthCheck }) {
497363
497443
  setErr(ex instanceof Error ? ex.message : String(ex));
497364
497444
  });
497365
497445
  }, [runHealthCheck]);
497366
- import_react106.useEffect(() => {
497446
+ import_react107.useEffect(() => {
497367
497447
  if (visible)
497368
497448
  run3();
497369
497449
  }, [visible, run3]);
@@ -497450,7 +497530,7 @@ function DiagnosePopup({ visible, onClose, runHealthCheck }) {
497450
497530
  }, undefined, false, undefined, this)
497451
497531
  }, undefined, false, undefined, this);
497452
497532
  }
497453
- var import_react106;
497533
+ var import_react107;
497454
497534
  var init_DiagnosePopup = __esm(async () => {
497455
497535
  init_theme();
497456
497536
  init_scroll();
@@ -497460,7 +497540,7 @@ var init_DiagnosePopup = __esm(async () => {
497460
497540
  init_shared(),
497461
497541
  init_ui2()
497462
497542
  ]);
497463
- import_react106 = __toESM(require_react(), 1);
497543
+ import_react107 = __toESM(require_react(), 1);
497464
497544
  });
497465
497545
 
497466
497546
  // src/components/modals/wizard/data.ts
@@ -497941,14 +498021,14 @@ var init_primitives = __esm(async () => {
497941
498021
  });
497942
498022
 
497943
498023
  // src/components/modals/wizard/steps/AutomationStep.tsx
497944
- var import_react107, AutomationStep;
498024
+ var import_react108, AutomationStep;
497945
498025
  var init_AutomationStep = __esm(async () => {
497946
498026
  init_icons();
497947
498027
  init_data();
497948
498028
  init_jsx_dev_runtime();
497949
498029
  await init_primitives();
497950
- import_react107 = __toESM(require_react(), 1);
497951
- AutomationStep = import_react107.memo(function AutomationStep2() {
498030
+ import_react108 = __toESM(require_react(), 1);
498031
+ AutomationStep = import_react108.memo(function AutomationStep2() {
497952
498032
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
497953
498033
  heading: "Automation \u2014 scale without friction",
497954
498034
  headerIcon: icon("dispatch"),
@@ -497959,14 +498039,14 @@ var init_AutomationStep = __esm(async () => {
497959
498039
  });
497960
498040
 
497961
498041
  // src/components/modals/wizard/steps/EditingStep.tsx
497962
- var import_react108, EditingStep;
498042
+ var import_react109, EditingStep;
497963
498043
  var init_EditingStep = __esm(async () => {
497964
498044
  init_icons();
497965
498045
  init_data();
497966
498046
  init_jsx_dev_runtime();
497967
498047
  await init_primitives();
497968
- import_react108 = __toESM(require_react(), 1);
497969
- EditingStep = import_react108.memo(function EditingStep2() {
498048
+ import_react109 = __toESM(require_react(), 1);
498049
+ EditingStep = import_react109.memo(function EditingStep2() {
497970
498050
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
497971
498051
  heading: "Editing \u2014 by symbol, not by string",
497972
498052
  headerIcon: icon("morph"),
@@ -497977,14 +498057,14 @@ var init_EditingStep = __esm(async () => {
497977
498057
  });
497978
498058
 
497979
498059
  // src/components/modals/wizard/steps/IntelligenceStep.tsx
497980
- var import_react109, IntelligenceStep;
498060
+ var import_react110, IntelligenceStep;
497981
498061
  var init_IntelligenceStep = __esm(async () => {
497982
498062
  init_icons();
497983
498063
  init_data();
497984
498064
  init_jsx_dev_runtime();
497985
498065
  await init_primitives();
497986
- import_react109 = __toESM(require_react(), 1);
497987
- IntelligenceStep = import_react109.memo(function IntelligenceStep2() {
498066
+ import_react110 = __toESM(require_react(), 1);
498067
+ IntelligenceStep = import_react110.memo(function IntelligenceStep2() {
497988
498068
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
497989
498069
  heading: "Codebase Intelligence",
497990
498070
  headerIcon: icon("brain"),
@@ -497995,14 +498075,14 @@ var init_IntelligenceStep = __esm(async () => {
497995
498075
  });
497996
498076
 
497997
498077
  // src/components/modals/wizard/steps/ModesStep.tsx
497998
- var import_react110, ModesStep;
498078
+ var import_react111, ModesStep;
497999
498079
  var init_ModesStep = __esm(async () => {
498000
498080
  init_icons();
498001
498081
  init_data();
498002
498082
  init_jsx_dev_runtime();
498003
498083
  await init_primitives();
498004
- import_react110 = __toESM(require_react(), 1);
498005
- ModesStep = import_react110.memo(function ModesStep2() {
498084
+ import_react111 = __toESM(require_react(), 1);
498085
+ ModesStep = import_react111.memo(function ModesStep2() {
498006
498086
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
498007
498087
  heading: "Modes \u2014 how Forge approaches work",
498008
498088
  headerIcon: icon("plan"),
@@ -498013,7 +498093,7 @@ var init_ModesStep = __esm(async () => {
498013
498093
  });
498014
498094
 
498015
498095
  // src/components/modals/wizard/steps/ReadyStep.tsx
498016
- var import_react111, ReadyStep;
498096
+ var import_react112, ReadyStep;
498017
498097
  var init_ReadyStep = __esm(async () => {
498018
498098
  init_icons();
498019
498099
  init_theme();
@@ -498021,8 +498101,8 @@ var init_ReadyStep = __esm(async () => {
498021
498101
  init_theme2();
498022
498102
  init_jsx_dev_runtime();
498023
498103
  await init_ui2();
498024
- import_react111 = __toESM(require_react(), 1);
498025
- ReadyStep = import_react111.memo(function ReadyStep2() {
498104
+ import_react112 = __toESM(require_react(), 1);
498105
+ ReadyStep = import_react112.memo(function ReadyStep2() {
498026
498106
  const t2 = useTheme();
498027
498107
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
498028
498108
  flexDirection: "column",
@@ -498168,14 +498248,14 @@ var init_ReadyStep = __esm(async () => {
498168
498248
  });
498169
498249
 
498170
498250
  // src/components/modals/wizard/steps/RemoteStep.tsx
498171
- var import_react112, RemoteStep;
498251
+ var import_react113, RemoteStep;
498172
498252
  var init_RemoteStep = __esm(async () => {
498173
498253
  init_icons();
498174
498254
  init_data();
498175
498255
  init_jsx_dev_runtime();
498176
498256
  await init_primitives();
498177
- import_react112 = __toESM(require_react(), 1);
498178
- RemoteStep = import_react112.memo(function RemoteStep2() {
498257
+ import_react113 = __toESM(require_react(), 1);
498258
+ RemoteStep = import_react113.memo(function RemoteStep2() {
498179
498259
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
498180
498260
  heading: "MCP, Skills & Remote",
498181
498261
  headerIcon: icon("plug"),
@@ -498305,25 +498385,25 @@ function SetupStep({
498305
498385
  const t2 = useTheme();
498306
498386
  const renderer2 = useRenderer();
498307
498387
  const { height: termRows } = useTerminalDimensions();
498308
- const [phase, setPhase] = import_react114.useState("provider");
498309
- const [cursor3, setCursor] = import_react114.useState(0);
498310
- const [selectedProvider, setSelectedProvider] = import_react114.useState(null);
498311
- const [keyInput, setKeyInput] = import_react114.useState("");
498312
- const [allModels, setAllModels] = import_react114.useState([]);
498313
- const [searchQuery, setSearchQuery] = import_react114.useState("");
498314
- const [modelCursor, setModelCursor] = import_react114.useState(0);
498315
- const [flash, setFlash] = import_react114.useState(null);
498316
- const [errorMsg, setErrorMsg] = import_react114.useState("");
498317
- const [spinnerFrame, setSpinnerFrame] = import_react114.useState(0);
498318
- const [tick, setTick] = import_react114.useState(0);
498319
- const [autoAvailMap, setAutoAvailMap] = import_react114.useState({});
498320
- const spinnerRef = import_react114.useRef(null);
498388
+ const [phase, setPhase] = import_react115.useState("provider");
498389
+ const [cursor3, setCursor] = import_react115.useState(0);
498390
+ const [selectedProvider, setSelectedProvider] = import_react115.useState(null);
498391
+ const [keyInput, setKeyInput] = import_react115.useState("");
498392
+ const [allModels, setAllModels] = import_react115.useState([]);
498393
+ const [searchQuery, setSearchQuery] = import_react115.useState("");
498394
+ const [modelCursor, setModelCursor] = import_react115.useState(0);
498395
+ const [flash, setFlash] = import_react115.useState(null);
498396
+ const [errorMsg, setErrorMsg] = import_react115.useState("");
498397
+ const [spinnerFrame, setSpinnerFrame] = import_react115.useState(0);
498398
+ const [tick, setTick] = import_react115.useState(0);
498399
+ const [autoAvailMap, setAutoAvailMap] = import_react115.useState({});
498400
+ const spinnerRef = import_react115.useRef(null);
498321
498401
  const inputWidth = Math.min(Math.floor(iw * 0.8), 60);
498322
498402
  const maxH = Math.max(24, Math.floor(termRows * 0.7));
498323
498403
  const maxVisibleProviders = Math.max(4, maxH - PROVIDER_CHROME_ROWS);
498324
498404
  const refresh = () => setTick((n2) => n2 + 1);
498325
498405
  const anyKeySet = PROVIDERS.some((p4) => hasKey(p4.id)) || Object.values(autoAvailMap).some(Boolean);
498326
- import_react114.useEffect(() => {
498406
+ import_react115.useEffect(() => {
498327
498407
  for (const p4 of PROVIDERS) {
498328
498408
  if (!p4.autoDetect)
498329
498409
  continue;
@@ -498336,10 +498416,10 @@ function SetupStep({
498336
498416
  }
498337
498417
  }, []);
498338
498418
  const isInputPhase = phase !== "provider";
498339
- import_react114.useEffect(() => {
498419
+ import_react115.useEffect(() => {
498340
498420
  setActive(isInputPhase);
498341
498421
  }, [isInputPhase, setActive]);
498342
- import_react114.useEffect(() => {
498422
+ import_react115.useEffect(() => {
498343
498423
  if (phase !== "key")
498344
498424
  return;
498345
498425
  const handler4 = (event) => {
@@ -498352,7 +498432,7 @@ function SetupStep({
498352
498432
  renderer2.keyInput.off("paste", handler4);
498353
498433
  };
498354
498434
  }, [phase, renderer2]);
498355
- import_react114.useEffect(() => {
498435
+ import_react115.useEffect(() => {
498356
498436
  if (phase === "fetching") {
498357
498437
  spinnerRef.current = setInterval(() => setSpinnerFrame((f3) => (f3 + 1) % SPINNER_FRAMES2.length), 80);
498358
498438
  return () => {
@@ -498366,12 +498446,12 @@ function SetupStep({
498366
498446
  }
498367
498447
  return;
498368
498448
  }, [phase]);
498369
- import_react114.useEffect(() => {
498449
+ import_react115.useEffect(() => {
498370
498450
  setPhase("provider");
498371
498451
  setCursor(0);
498372
498452
  }, []);
498373
498453
  const filteredModels = searchQuery ? allModels.filter((m6) => fuzzyMatch3(searchQuery, m6.name) || fuzzyMatch3(searchQuery, m6.group ?? "")) : allModels;
498374
- import_react114.useEffect(() => {
498454
+ import_react115.useEffect(() => {
498375
498455
  if (modelCursor >= filteredModels.length) {
498376
498456
  setModelCursor(Math.max(0, filteredModels.length - 1));
498377
498457
  }
@@ -498817,7 +498897,7 @@ function SetupStep({
498817
498897
  }, undefined, true, undefined, this);
498818
498898
  }
498819
498899
  }
498820
- var import_react114, GATEWAY_REF = "https://llmgateway.io/dashboard?ref=6tjJR2H3X4E9RmVQiQwK", URL_OVERRIDES, PROVIDERS, SPINNER_FRAMES2, PROVIDER_CHROME_ROWS = 13;
498900
+ var import_react115, GATEWAY_REF = "https://llmgateway.io/dashboard?ref=6tjJR2H3X4E9RmVQiQwK", URL_OVERRIDES, PROVIDERS, SPINNER_FRAMES2, PROVIDER_CHROME_ROWS = 13;
498821
498901
  var init_SetupStep = __esm(async () => {
498822
498902
  init_models();
498823
498903
  init_providers();
@@ -498830,7 +498910,7 @@ var init_SetupStep = __esm(async () => {
498830
498910
  init_ui2(),
498831
498911
  init_primitives()
498832
498912
  ]);
498833
- import_react114 = __toESM(require_react(), 1);
498913
+ import_react115 = __toESM(require_react(), 1);
498834
498914
  URL_OVERRIDES = {
498835
498915
  llmgateway: GATEWAY_REF
498836
498916
  };
@@ -498847,7 +498927,7 @@ var init_SetupStep = __esm(async () => {
498847
498927
  });
498848
498928
 
498849
498929
  // src/components/modals/wizard/steps/ShortcutsStep.tsx
498850
- var import_react115, ShortcutsStep;
498930
+ var import_react116, ShortcutsStep;
498851
498931
  var init_ShortcutsStep = __esm(async () => {
498852
498932
  init_icons();
498853
498933
  init_theme();
@@ -498855,8 +498935,8 @@ var init_ShortcutsStep = __esm(async () => {
498855
498935
  init_theme2();
498856
498936
  init_jsx_dev_runtime();
498857
498937
  await init_ui2();
498858
- import_react115 = __toESM(require_react(), 1);
498859
- ShortcutsStep = import_react115.memo(function ShortcutsStep2() {
498938
+ import_react116 = __toESM(require_react(), 1);
498939
+ ShortcutsStep = import_react116.memo(function ShortcutsStep2() {
498860
498940
  const t2 = useTheme();
498861
498941
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
498862
498942
  flexDirection: "column",
@@ -498958,21 +499038,21 @@ function ThemeStep({ iw, setActive }) {
498958
499038
  const t2 = useTheme();
498959
499039
  const popupBg = t2.bgPopup;
498960
499040
  const popupHl = t2.bgPopupHighlight;
498961
- const themes = import_react117.useMemo(() => listThemes(), []);
499041
+ const themes = import_react118.useMemo(() => listThemes(), []);
498962
499042
  const currentName = useThemeStore((s2) => s2.name);
498963
499043
  const isTransparent = useThemeStore((s2) => s2.tokens.bgApp === "transparent");
498964
- const cfg = import_react117.useMemo(() => loadConfig(), []);
498965
- const [msgOpacity, setMsgOpacity] = import_react117.useState(() => typeof cfg.theme?.userMessageOpacity === "number" ? cfg.theme.userMessageOpacity : 100);
498966
- const [diffOpacity, setDiffOpacity] = import_react117.useState(() => typeof cfg.theme?.diffOpacity === "number" ? cfg.theme.diffOpacity : 100);
498967
- const [borderStr, setBorderStr] = import_react117.useState(() => cfg.theme?.borderStrength ?? "default");
499044
+ const cfg = import_react118.useMemo(() => loadConfig(), []);
499045
+ const [msgOpacity, setMsgOpacity] = import_react118.useState(() => typeof cfg.theme?.userMessageOpacity === "number" ? cfg.theme.userMessageOpacity : 100);
499046
+ const [diffOpacity, setDiffOpacity] = import_react118.useState(() => typeof cfg.theme?.diffOpacity === "number" ? cfg.theme.diffOpacity : 100);
499047
+ const [borderStr, setBorderStr] = import_react118.useState(() => cfg.theme?.borderStrength ?? "default");
498968
499048
  const { height: termRows } = useTerminalDimensions();
498969
499049
  const maxH = Math.max(24, Math.floor(termRows * 0.7));
498970
499050
  const maxVisible = Math.max(4, maxH - CHROME_ROWS3);
498971
- const [cursor3, setCursor] = import_react117.useState(0);
498972
- const applyAll = import_react117.useCallback((name30, tp, mOp, dOp, bdr) => {
499051
+ const [cursor3, setCursor] = import_react118.useState(0);
499052
+ const applyAll = import_react118.useCallback((name30, tp, mOp, dOp, bdr) => {
498973
499053
  applyTheme(name30, tp, { userMessageOpacity: mOp, diffOpacity: dOp, borderStrength: bdr });
498974
499054
  }, []);
498975
- const saveAll = import_react117.useCallback((name30, tp, mOp, dOp, bdr) => {
499055
+ const saveAll = import_react118.useCallback((name30, tp, mOp, dOp, bdr) => {
498976
499056
  saveGlobalConfig({
498977
499057
  theme: {
498978
499058
  name: name30,
@@ -498983,12 +499063,12 @@ function ThemeStep({ iw, setActive }) {
498983
499063
  }
498984
499064
  });
498985
499065
  }, []);
498986
- import_react117.useEffect(() => {
499066
+ import_react118.useEffect(() => {
498987
499067
  const idx = themes.findIndex((th) => th.id === currentName);
498988
499068
  if (idx >= 0)
498989
499069
  setCursor(idx);
498990
499070
  }, [currentName, themes]);
498991
- import_react117.useEffect(() => {
499071
+ import_react118.useEffect(() => {
498992
499072
  setActive(false);
498993
499073
  }, [setActive]);
498994
499074
  useKeyboard((evt) => {
@@ -499222,7 +499302,7 @@ function OptionRow3({
499222
499302
  ]
499223
499303
  }, undefined, true, undefined, this);
499224
499304
  }
499225
- var import_react117, OPACITY_LEVELS2, OPACITY_LABELS, BORDER_OPTIONS, BORDER_LABELS, CHROME_ROWS3 = 16;
499305
+ var import_react118, OPACITY_LEVELS2, OPACITY_LABELS, BORDER_OPTIONS, BORDER_LABELS, CHROME_ROWS3 = 16;
499226
499306
  var init_ThemeStep = __esm(async () => {
499227
499307
  init_config2();
499228
499308
  init_theme();
@@ -499233,7 +499313,7 @@ var init_ThemeStep = __esm(async () => {
499233
499313
  init_ui2(),
499234
499314
  init_primitives()
499235
499315
  ]);
499236
- import_react117 = __toESM(require_react(), 1);
499316
+ import_react118 = __toESM(require_react(), 1);
499237
499317
  OPACITY_LEVELS2 = [0, 30, 70, 100];
499238
499318
  OPACITY_LABELS = ["Clear", "Dim", "Subtle", "Solid"];
499239
499319
  BORDER_OPTIONS = ["default", "strong", "op"];
@@ -499242,10 +499322,10 @@ var init_ThemeStep = __esm(async () => {
499242
499322
 
499243
499323
  // src/components/modals/wizard/steps/WelcomeStep.tsx
499244
499324
  function useTypewriter(text4, ms) {
499245
- const [len, setLen] = import_react118.useState(0);
499246
- const [cursorOn, setCursorOn] = import_react118.useState(true);
499247
- const timer = import_react118.useRef(undefined);
499248
- import_react118.useEffect(() => {
499325
+ const [len, setLen] = import_react119.useState(0);
499326
+ const [cursorOn, setCursorOn] = import_react119.useState(true);
499327
+ const timer = import_react119.useRef(undefined);
499328
+ import_react119.useEffect(() => {
499249
499329
  let i5 = 0;
499250
499330
  const tick = () => {
499251
499331
  if (i5 < text4.length) {
@@ -499274,7 +499354,7 @@ function useTypewriter(text4, ms) {
499274
499354
  }, [text4, ms]);
499275
499355
  return { typed: text4.slice(0, len), cursorOn };
499276
499356
  }
499277
- var import_react118, WelcomeStep;
499357
+ var import_react119, WelcomeStep;
499278
499358
  var init_WelcomeStep = __esm(async () => {
499279
499359
  init_icons();
499280
499360
  init_theme();
@@ -499282,8 +499362,8 @@ var init_WelcomeStep = __esm(async () => {
499282
499362
  init_theme2();
499283
499363
  init_jsx_dev_runtime();
499284
499364
  await init_ui2();
499285
- import_react118 = __toESM(require_react(), 1);
499286
- WelcomeStep = import_react118.memo(function WelcomeStep2() {
499365
+ import_react119 = __toESM(require_react(), 1);
499366
+ WelcomeStep = import_react119.memo(function WelcomeStep2() {
499287
499367
  const t2 = useTheme();
499288
499368
  const { typed, cursorOn } = useTypewriter(WELCOME_TITLE, TYPEWRITER_MS);
499289
499369
  const smithy = icon("smithy");
@@ -499399,14 +499479,14 @@ var init_WelcomeStep = __esm(async () => {
499399
499479
  });
499400
499480
 
499401
499481
  // src/components/modals/wizard/steps/WorkflowStep.tsx
499402
- var import_react119, WorkflowStep;
499482
+ var import_react120, WorkflowStep;
499403
499483
  var init_WorkflowStep = __esm(async () => {
499404
499484
  init_icons();
499405
499485
  init_data();
499406
499486
  init_jsx_dev_runtime();
499407
499487
  await init_primitives();
499408
- import_react119 = __toESM(require_react(), 1);
499409
- WorkflowStep = import_react119.memo(function WorkflowStep2() {
499488
+ import_react120 = __toESM(require_react(), 1);
499489
+ WorkflowStep = import_react120.memo(function WorkflowStep2() {
499410
499490
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
499411
499491
  heading: "Tabs, Sessions & Git",
499412
499492
  headerIcon: icon("tabs"),
@@ -499421,12 +499501,12 @@ function FirstRunWizard({ visible, hasModel, activeModel, onSelectModel, onClose
499421
499501
  const { width: termCols, height: termRows } = useTerminalDimensions();
499422
499502
  const pw = Math.min(MAX_W, Math.floor(termCols * 0.92));
499423
499503
  const contentW = pw - SIDEBAR_W - 3;
499424
- const [stepIdx, setStepIdx] = import_react121.useState(0);
499504
+ const [stepIdx, setStepIdx] = import_react122.useState(0);
499425
499505
  const step = STEPS[stepIdx] ?? "welcome";
499426
- const [inputLocked, setInputLocked] = import_react121.useState(false);
499427
- const [visited, setVisited] = import_react121.useState(() => new Set([0]));
499428
- const hasOpened = import_react121.useRef(false);
499429
- import_react121.useEffect(() => {
499506
+ const [inputLocked, setInputLocked] = import_react122.useState(false);
499507
+ const [visited, setVisited] = import_react122.useState(() => new Set([0]));
499508
+ const hasOpened = import_react122.useRef(false);
499509
+ import_react122.useEffect(() => {
499430
499510
  if (!visible)
499431
499511
  return;
499432
499512
  if (!hasOpened.current) {
@@ -499436,7 +499516,7 @@ function FirstRunWizard({ visible, hasModel, activeModel, onSelectModel, onClose
499436
499516
  }
499437
499517
  setInputLocked(false);
499438
499518
  }, [visible]);
499439
- import_react121.useEffect(() => {
499519
+ import_react122.useEffect(() => {
499440
499520
  setVisited((v3) => {
499441
499521
  if (v3.has(stepIdx))
499442
499522
  return v3;
@@ -499483,7 +499563,7 @@ function FirstRunWizard({ visible, hasModel, activeModel, onSelectModel, onClose
499483
499563
  evt.preventDefault();
499484
499564
  };
499485
499565
  useKeyboard(handleKeyboard);
499486
- const tabs = import_react121.useMemo(() => STEPS.map((s2, i5) => ({
499566
+ const tabs = import_react122.useMemo(() => STEPS.map((s2, i5) => ({
499487
499567
  id: s2,
499488
499568
  label: STEP_LABELS[s2],
499489
499569
  icon: STEP_ICONS[s2],
@@ -499542,7 +499622,7 @@ function FirstRunWizard({ visible, hasModel, activeModel, onSelectModel, onClose
499542
499622
  }, undefined, true, undefined, this)
499543
499623
  }, undefined, false, undefined, this);
499544
499624
  }
499545
- var import_react121;
499625
+ var import_react122;
499546
499626
  var init_wizard2 = __esm(async () => {
499547
499627
  init_data();
499548
499628
  init_jsx_dev_runtime();
@@ -499561,7 +499641,7 @@ var init_wizard2 = __esm(async () => {
499561
499641
  init_WelcomeStep(),
499562
499642
  init_WorkflowStep()
499563
499643
  ]);
499564
- import_react121 = __toESM(require_react(), 1);
499644
+ import_react122 = __toESM(require_react(), 1);
499565
499645
  });
499566
499646
 
499567
499647
  // src/components/modals/FirstRunWizard.tsx
@@ -499574,14 +499654,14 @@ function GitCommitModal({ visible, cwd: cwd2, coAuthor, onClose, onCommitted, on
499574
499654
  const t2 = useTheme();
499575
499655
  const { width: tw2 } = useTerminalDimensions();
499576
499656
  const popupW = Math.min(72, Math.max(56, Math.floor(tw2 * 0.6)));
499577
- const [message, setMessage] = import_react123.useState("");
499578
- const [staged, setStaged] = import_react123.useState([]);
499579
- const [modified, setModified] = import_react123.useState([]);
499580
- const [untracked, setUntracked] = import_react123.useState([]);
499581
- const [diffSummary, setDiffSummary] = import_react123.useState("");
499582
- const [error51, setError] = import_react123.useState(null);
499583
- const [stageAll, setStageAll] = import_react123.useState(false);
499584
- import_react123.useEffect(() => {
499657
+ const [message, setMessage] = import_react124.useState("");
499658
+ const [staged, setStaged] = import_react124.useState([]);
499659
+ const [modified, setModified] = import_react124.useState([]);
499660
+ const [untracked, setUntracked] = import_react124.useState([]);
499661
+ const [diffSummary, setDiffSummary] = import_react124.useState("");
499662
+ const [error51, setError] = import_react124.useState(null);
499663
+ const [stageAll, setStageAll] = import_react124.useState(false);
499664
+ import_react124.useEffect(() => {
499585
499665
  if (!visible)
499586
499666
  return;
499587
499667
  setMessage("");
@@ -499596,7 +499676,7 @@ function GitCommitModal({ visible, cwd: cwd2, coAuthor, onClose, onCommitted, on
499596
499676
  setDiffSummary(lines > 1 ? `${lines} lines changed` : "no staged changes");
499597
499677
  }).catch(() => {});
499598
499678
  }, [visible, cwd2]);
499599
- const handleCommit2 = import_react123.useCallback(async () => {
499679
+ const handleCommit2 = import_react124.useCallback(async () => {
499600
499680
  if (!message.trim()) {
499601
499681
  setError("Commit message cannot be empty");
499602
499682
  return;
@@ -499748,7 +499828,7 @@ Co-Authored-By: SoulForge <noreply@soulforge.com>` : message.trim();
499748
499828
  }, undefined, true, undefined, this)
499749
499829
  }, undefined, false, undefined, this);
499750
499830
  }
499751
- var import_react123;
499831
+ var import_react124;
499752
499832
  var init_GitCommitModal = __esm(async () => {
499753
499833
  init_status();
499754
499834
  init_theme();
@@ -499757,7 +499837,7 @@ var init_GitCommitModal = __esm(async () => {
499757
499837
  init_react2(),
499758
499838
  init_ui2()
499759
499839
  ]);
499760
- import_react123 = __toESM(require_react(), 1);
499840
+ import_react124 = __toESM(require_react(), 1);
499761
499841
  });
499762
499842
 
499763
499843
  // src/components/modals/GitMenu.tsx
@@ -499771,13 +499851,13 @@ function GitMenu({
499771
499851
  onRefresh
499772
499852
  }) {
499773
499853
  const { width: tw2 } = useTerminalDimensions();
499774
- const [cursor3, setCursor] = import_react125.useState(0);
499775
- const [busy, setBusy] = import_react125.useState(false);
499776
- const cursorRef = import_react125.useRef(0);
499854
+ const [cursor3, setCursor] = import_react126.useState(0);
499855
+ const [busy, setBusy] = import_react126.useState(false);
499856
+ const cursorRef = import_react126.useRef(0);
499777
499857
  cursorRef.current = cursor3;
499778
- const busyRef = import_react125.useRef(false);
499858
+ const busyRef = import_react126.useRef(false);
499779
499859
  busyRef.current = busy;
499780
- import_react125.useEffect(() => {
499860
+ import_react126.useEffect(() => {
499781
499861
  if (visible)
499782
499862
  setCursor(0);
499783
499863
  }, [visible]);
@@ -499938,7 +500018,7 @@ function GitMenu({
499938
500018
  }, undefined, false, undefined, this)
499939
500019
  }, undefined, false, undefined, this);
499940
500020
  }
499941
- var import_react125, MENU_ITEMS, GROUPS;
500021
+ var import_react126, MENU_ITEMS, GROUPS;
499942
500022
  var init_GitMenu = __esm(async () => {
499943
500023
  init_status();
499944
500024
  init_dialog();
@@ -499948,7 +500028,7 @@ var init_GitMenu = __esm(async () => {
499948
500028
  init_dialogs(),
499949
500029
  init_ui2()
499950
500030
  ]);
499951
- import_react125 = __toESM(require_react(), 1);
500031
+ import_react126 = __toESM(require_react(), 1);
499952
500032
  MENU_ITEMS = [
499953
500033
  { id: "commit", keyHint: "c", label: "Commit", meta: "open commit form", action: "commit" },
499954
500034
  { id: "push", keyHint: "p", label: "Push", meta: "git push", action: "push" },
@@ -499993,9 +500073,9 @@ var init_GitMenu = __esm(async () => {
499993
500073
  function InfoPopup({ visible, config: config2, onClose }) {
499994
500074
  const t2 = useTheme();
499995
500075
  const { width: tw2, height: th } = useTerminalDimensions();
499996
- const [cursor3, setCursor] = import_react127.useState(0);
499997
- const scrollRef = import_react127.useRef(null);
499998
- import_react127.useEffect(() => {
500076
+ const [cursor3, setCursor] = import_react128.useState(0);
500077
+ const scrollRef = import_react128.useRef(null);
500078
+ import_react128.useEffect(() => {
499999
500079
  if (visible) {
500000
500080
  setCursor(0);
500001
500081
  scrollRef.current?.scrollTo(0);
@@ -500091,7 +500171,7 @@ function InfoPopup({ visible, config: config2, onClose }) {
500091
500171
  }, undefined, true, undefined, this)
500092
500172
  }, undefined, false, undefined, this);
500093
500173
  }
500094
- var import_react127;
500174
+ var import_react128;
500095
500175
  var init_InfoPopup = __esm(async () => {
500096
500176
  init_theme();
500097
500177
  init_scroll();
@@ -500100,7 +500180,7 @@ var init_InfoPopup = __esm(async () => {
500100
500180
  init_react2(),
500101
500181
  init_ui2()
500102
500182
  ]);
500103
- import_react127 = __toESM(require_react(), 1);
500183
+ import_react128 = __toESM(require_react(), 1);
500104
500184
  });
500105
500185
 
500106
500186
  // src/hooks/useAllProviderModels.ts
@@ -500112,7 +500192,7 @@ function flattenGrouped(r5) {
500112
500192
  return out2;
500113
500193
  }
500114
500194
  function useAllProviderModels(active) {
500115
- const [providerData, setProviderData] = import_react128.useState(() => {
500195
+ const [providerData, setProviderData] = import_react129.useState(() => {
500116
500196
  const init2 = {};
500117
500197
  for (const cfg of PROVIDER_CONFIGS) {
500118
500198
  if (cfg.grouped) {
@@ -500125,7 +500205,7 @@ function useAllProviderModels(active) {
500125
500205
  }
500126
500206
  return init2;
500127
500207
  });
500128
- const [availability, setAvailability] = import_react128.useState(() => {
500208
+ const [availability, setAvailability] = import_react129.useState(() => {
500129
500209
  const cached3 = getCachedProviderStatuses();
500130
500210
  const map2 = new Map;
500131
500211
  if (cached3) {
@@ -500139,7 +500219,7 @@ function useAllProviderModels(active) {
500139
500219
  }
500140
500220
  return map2;
500141
500221
  });
500142
- import_react128.useEffect(() => {
500222
+ import_react129.useEffect(() => {
500143
500223
  if (!active)
500144
500224
  return;
500145
500225
  const init2 = {};
@@ -500243,15 +500323,15 @@ function useAllProviderModels(active) {
500243
500323
  clearTimeout(fetchTimer);
500244
500324
  };
500245
500325
  }, [active]);
500246
- const anyLoading = import_react128.useMemo(() => Object.values(providerData).some((p4) => p4.loading), [providerData]);
500326
+ const anyLoading = import_react129.useMemo(() => Object.values(providerData).some((p4) => p4.loading), [providerData]);
500247
500327
  return { providerData, availability, anyLoading };
500248
500328
  }
500249
- var import_react128, BG_REFRESH_COOLDOWN = 1e4, lastBgRefresh = 0, ENV_SK;
500329
+ var import_react129, BG_REFRESH_COOLDOWN = 1e4, lastBgRefresh = 0, ENV_SK;
500250
500330
  var init_useAllProviderModels = __esm(() => {
500251
500331
  init_models();
500252
500332
  init_provider();
500253
500333
  init_secrets();
500254
- import_react128 = __toESM(require_react(), 1);
500334
+ import_react129 = __toESM(require_react(), 1);
500255
500335
  ENV_SK = {
500256
500336
  ANTHROPIC_API_KEY: "anthropic-api-key",
500257
500337
  OPENAI_API_KEY: "openai-api-key",
@@ -500285,13 +500365,13 @@ function buildMeta(m6, free) {
500285
500365
  function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500286
500366
  const { width: tw2, height: th } = useTerminalDimensions();
500287
500367
  const { providerData, availability } = useAllProviderModels(visible);
500288
- const [query2, setQuery] = import_react130.useState("");
500289
- const [searchMode, setSearchMode] = import_react130.useState(false);
500290
- const [cursor3, setCursor] = import_react130.useState(0);
500291
- const [expanded, setExpanded] = import_react130.useState(new Set);
500292
- const cursorRef = import_react130.useRef(0);
500368
+ const [query2, setQuery] = import_react131.useState("");
500369
+ const [searchMode, setSearchMode] = import_react131.useState(false);
500370
+ const [cursor3, setCursor] = import_react131.useState(0);
500371
+ const [expanded, setExpanded] = import_react131.useState(new Set);
500372
+ const cursorRef = import_react131.useRef(0);
500293
500373
  cursorRef.current = cursor3;
500294
- import_react130.useEffect(() => {
500374
+ import_react131.useEffect(() => {
500295
500375
  if (!visible)
500296
500376
  return;
500297
500377
  setQuery("");
@@ -500303,7 +500383,7 @@ function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500303
500383
  const popupW = Math.min(92, Math.max(82, Math.floor(tw2 * 0.75)));
500304
500384
  const popupH = Math.min(32, Math.max(18, th - 4));
500305
500385
  const contentW = popupW - 4;
500306
- const frecencyByModel = import_react130.useMemo(() => {
500386
+ const frecencyByModel = import_react131.useMemo(() => {
500307
500387
  if (!visible)
500308
500388
  return new Map;
500309
500389
  const allIds = [];
@@ -500322,7 +500402,7 @@ function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500322
500402
  }
500323
500403
  return out2;
500324
500404
  }, [visible, providerData]);
500325
- const groups = import_react130.useMemo(() => {
500405
+ const groups = import_react131.useMemo(() => {
500326
500406
  const visibleConfigs = PROVIDER_CONFIGS.filter((cfg) => {
500327
500407
  if (cfg.envVar !== "")
500328
500408
  return true;
@@ -500364,10 +500444,10 @@ function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500364
500444
  };
500365
500445
  });
500366
500446
  }, [providerData, availability, activeModel, frecencyByModel.get]);
500367
- const filteredGroups = import_react130.useMemo(() => fuzzyFilterGroups(groups, query2), [groups, query2]);
500368
- const effectiveExpanded = import_react130.useMemo(() => query2.trim().length > 0 ? new Set(filteredGroups.map((g4) => g4.id)) : expanded, [query2, filteredGroups, expanded]);
500369
- const rows = import_react130.useMemo(() => buildGroupedRows(filteredGroups, effectiveExpanded), [filteredGroups, effectiveExpanded]);
500370
- import_react130.useEffect(() => {
500447
+ const filteredGroups = import_react131.useMemo(() => fuzzyFilterGroups(groups, query2), [groups, query2]);
500448
+ const effectiveExpanded = import_react131.useMemo(() => query2.trim().length > 0 ? new Set(filteredGroups.map((g4) => g4.id)) : expanded, [query2, filteredGroups, expanded]);
500449
+ const rows = import_react131.useMemo(() => buildGroupedRows(filteredGroups, effectiveExpanded), [filteredGroups, effectiveExpanded]);
500450
+ import_react131.useEffect(() => {
500371
500451
  if (cursor3 >= rows.length && rows.length > 0)
500372
500452
  setCursor(rows.length - 1);
500373
500453
  }, [rows.length, cursor3]);
@@ -500532,7 +500612,7 @@ function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500532
500612
  }, undefined, true, undefined, this)
500533
500613
  }, undefined, false, undefined, this);
500534
500614
  }
500535
- var import_react130;
500615
+ var import_react131;
500536
500616
  var init_LlmSelector = __esm(async () => {
500537
500617
  init_history();
500538
500618
  init_icons();
@@ -500546,7 +500626,7 @@ var init_LlmSelector = __esm(async () => {
500546
500626
  init_react2(),
500547
500627
  init_ui2()
500548
500628
  ]);
500549
- import_react130 = __toESM(require_react(), 1);
500629
+ import_react131 = __toESM(require_react(), 1);
500550
500630
  });
500551
500631
 
500552
500632
  // src/components/modals/SessionPicker.tsx
@@ -500577,23 +500657,23 @@ function SessionPicker({ visible, cwd: cwd2, onClose, onRestore, onSystemMessage
500577
500657
  const popupW = Math.min(110, Math.max(80, Math.floor(tw2 * 0.8)));
500578
500658
  const popupH = Math.min(34, Math.max(18, th - 4));
500579
500659
  const contentW = popupW - 4;
500580
- const [sessions, setSessions] = import_react132.useState([]);
500581
- const [loading, setLoading] = import_react132.useState(false);
500582
- const [query2, setQuery] = import_react132.useState("");
500583
- const [cursor3, setCursor] = import_react132.useState(0);
500584
- const [confirmClear, setConfirmClear] = import_react132.useState(false);
500585
- const [renameId, setRenameId] = import_react132.useState(null);
500586
- const [renameValue, setRenameValue] = import_react132.useState("");
500587
- const [flash, setFlash] = import_react132.useState(null);
500588
- const cursorRef = import_react132.useRef(0);
500660
+ const [sessions, setSessions] = import_react133.useState([]);
500661
+ const [loading, setLoading] = import_react133.useState(false);
500662
+ const [query2, setQuery] = import_react133.useState("");
500663
+ const [cursor3, setCursor] = import_react133.useState(0);
500664
+ const [confirmClear, setConfirmClear] = import_react133.useState(false);
500665
+ const [renameId, setRenameId] = import_react133.useState(null);
500666
+ const [renameValue, setRenameValue] = import_react133.useState("");
500667
+ const [flash, setFlash] = import_react133.useState(null);
500668
+ const cursorRef = import_react133.useRef(0);
500589
500669
  cursorRef.current = cursor3;
500590
- const manager = import_react132.useMemo(() => new SessionManager(cwd2), [cwd2]);
500591
- const refresh = import_react132.useCallback(() => {
500670
+ const manager = import_react133.useMemo(() => new SessionManager(cwd2), [cwd2]);
500671
+ const refresh = import_react133.useCallback(() => {
500592
500672
  const mgr = new SessionManager(cwd2);
500593
500673
  setLoading(true);
500594
500674
  mgr.listSessionsAsync().then(setSessions).catch(() => setSessions(mgr.listSessions())).finally(() => setLoading(false));
500595
500675
  }, [cwd2]);
500596
- import_react132.useEffect(() => {
500676
+ import_react133.useEffect(() => {
500597
500677
  if (!visible)
500598
500678
  return;
500599
500679
  setQuery("");
@@ -500603,12 +500683,12 @@ function SessionPicker({ visible, cwd: cwd2, onClose, onRestore, onSystemMessage
500603
500683
  setFlash(null);
500604
500684
  refresh();
500605
500685
  }, [visible, refresh]);
500606
- const filtered = import_react132.useMemo(() => {
500686
+ const filtered = import_react133.useMemo(() => {
500607
500687
  const fq = query2.toLowerCase().trim();
500608
500688
  const rows = sessions.map(toRow);
500609
500689
  return fq ? rows.filter((r5) => r5.title.toLowerCase().includes(fq)) : rows;
500610
500690
  }, [sessions, query2]);
500611
- import_react132.useEffect(() => {
500691
+ import_react133.useEffect(() => {
500612
500692
  if (cursor3 >= filtered.length && filtered.length > 0)
500613
500693
  setCursor(filtered.length - 1);
500614
500694
  }, [filtered.length, cursor3]);
@@ -500868,7 +500948,7 @@ function SessionPicker({ visible, cwd: cwd2, onClose, onRestore, onSystemMessage
500868
500948
  }, undefined, true, undefined, this)
500869
500949
  }, undefined, false, undefined, this);
500870
500950
  }
500871
- var import_react132, COLUMNS;
500951
+ var import_react133, COLUMNS;
500872
500952
  var init_SessionPicker = __esm(async () => {
500873
500953
  init_manager();
500874
500954
  init_theme();
@@ -500880,7 +500960,7 @@ var init_SessionPicker = __esm(async () => {
500880
500960
  init_dialogs(),
500881
500961
  init_ui2()
500882
500962
  ]);
500883
- import_react132 = __toESM(require_react(), 1);
500963
+ import_react133 = __toESM(require_react(), 1);
500884
500964
  COLUMNS = [
500885
500965
  { key: "title" },
500886
500966
  { key: "msgs", width: 6, align: "right" },
@@ -500938,21 +501018,21 @@ function StatusDashboard({
500938
501018
  const popupH = Math.min(Math.max(22, Math.floor(termRows * 0.88)), termRows - 2);
500939
501019
  const contentW = popupWidth - SIDEBAR_W2 - 3;
500940
501020
  const scrollH = Math.max(8, popupH - 6);
500941
- const [tab, setTab] = import_react134.useState(() => resolveInitial(initialTab));
500942
- const [scrollOffset, setScrollOffset] = import_react134.useState(0);
500943
- const [scopeTabId, setScopeTabId] = import_react134.useState(tabMgr.activeTabId);
501021
+ const [tab, setTab] = import_react135.useState(() => resolveInitial(initialTab));
501022
+ const [scrollOffset, setScrollOffset] = import_react135.useState(0);
501023
+ const [scopeTabId, setScopeTabId] = import_react135.useState(tabMgr.activeTabId);
500944
501024
  const sb = useStatusBarStore();
500945
501025
  const rm3 = useRepoMapStore();
500946
501026
  const wk = useWorkerStore();
500947
- const [hearth, setHearth] = import_react134.useState(null);
500948
- import_react134.useEffect(() => {
501027
+ const [hearth, setHearth] = import_react135.useState(null);
501028
+ import_react135.useEffect(() => {
500949
501029
  if (visible) {
500950
501030
  setTab(resolveInitial(initialTab));
500951
501031
  setScrollOffset(0);
500952
501032
  setScopeTabId(tabMgr.activeTabId);
500953
501033
  }
500954
501034
  }, [visible, initialTab, tabMgr.activeTabId]);
500955
- import_react134.useEffect(() => {
501035
+ import_react135.useEffect(() => {
500956
501036
  if (!visible)
500957
501037
  return;
500958
501038
  let stopped = false;
@@ -501044,7 +501124,7 @@ function StatusDashboard({
501044
501124
  clearInterval(iv);
501045
501125
  };
501046
501126
  }, [visible]);
501047
- const pollWorkerMemory = import_react134.useCallback(async () => {
501127
+ const pollWorkerMemory = import_react135.useCallback(async () => {
501048
501128
  const store = useWorkerStore.getState();
501049
501129
  try {
501050
501130
  const intel = contextManager.getRepoMap();
@@ -501057,8 +501137,8 @@ function StatusDashboard({
501057
501137
  store.setWorkerMemory("io", Math.round(res.heapUsed / 1024 / 1024), Math.round(res.rss / 1024 / 1024));
501058
501138
  } catch {}
501059
501139
  }, [contextManager]);
501060
- const pollRef = import_react134.useRef(null);
501061
- import_react134.useEffect(() => {
501140
+ const pollRef = import_react135.useRef(null);
501141
+ import_react135.useEffect(() => {
501062
501142
  if (visible && tab === "System") {
501063
501143
  pollWorkerMemory();
501064
501144
  pollRef.current = setInterval(pollWorkerMemory, 5000);
@@ -501075,12 +501155,12 @@ function StatusDashboard({
501075
501155
  const allTabs = tabMgr.tabs;
501076
501156
  const isMultiTab = allTabs.length > 1;
501077
501157
  const isAllScope = scopeTabId === "all";
501078
- const getTabUsage = import_react134.useCallback((tabId) => {
501158
+ const getTabUsage = import_react135.useCallback((tabId) => {
501079
501159
  if (tabId === tabMgr.activeTabId)
501080
501160
  return tu;
501081
501161
  return tabMgr.getChat(tabId)?.tokenUsage ?? ZERO_USAGE;
501082
501162
  }, [tu, tabMgr]);
501083
- const scopedUsage = import_react134.useMemo(() => {
501163
+ const scopedUsage = import_react135.useMemo(() => {
501084
501164
  if (!isAllScope)
501085
501165
  return getTabUsage(scopeTabId);
501086
501166
  const agg = { ...ZERO_USAGE, modelBreakdown: {} };
@@ -501110,8 +501190,8 @@ function StatusDashboard({
501110
501190
  }
501111
501191
  return agg;
501112
501192
  }, [isAllScope, scopeTabId, getTabUsage, allTabs]);
501113
- const [lspCount, setLspCount] = import_react134.useState(0);
501114
- import_react134.useEffect(() => {
501193
+ const [lspCount, setLspCount] = import_react135.useState(0);
501194
+ import_react135.useEffect(() => {
501115
501195
  getIntelligenceStatus().then((s2) => setLspCount(s2?.lspServers.length ?? 0));
501116
501196
  }, []);
501117
501197
  const scopeRelevant = tab === "Usage" || tab === "Prompt" || tab === "Cost" || tab === "Tabs";
@@ -501292,8 +501372,8 @@ function UsagePane({
501292
501372
  const clearTrigger = Math.max(80000, Math.floor(ctxWindow * (clearPct / 100)));
501293
501373
  const serverPct = 80;
501294
501374
  const serverTrigger = Math.max(160000, Math.floor(ctxWindow * (serverPct / 100)));
501295
- const ref = import_react134.useRef(null);
501296
- import_react134.useEffect(() => {
501375
+ const ref = import_react135.useRef(null);
501376
+ import_react135.useEffect(() => {
501297
501377
  ref.current?.scrollTo(scrollOffset);
501298
501378
  }, [scrollOffset]);
501299
501379
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
@@ -501469,8 +501549,8 @@ function PromptPane({
501469
501549
  const breakdown = contextManager.getContextBreakdown();
501470
501550
  const activeSections = breakdown.filter((s2) => s2.active && s2.chars > 0);
501471
501551
  const totalSysChars = activeSections.reduce((sum, s2) => sum + s2.chars, 0);
501472
- const ref = import_react134.useRef(null);
501473
- import_react134.useEffect(() => {
501552
+ const ref = import_react135.useRef(null);
501553
+ import_react135.useEffect(() => {
501474
501554
  ref.current?.scrollTo(scrollOffset);
501475
501555
  }, [scrollOffset]);
501476
501556
  if (activeSections.length === 0) {
@@ -501537,8 +501617,8 @@ function CostPane({
501537
501617
  pct: c3 > 0 && totalCost > 0 ? `${String(pct)}%` : "\u2014"
501538
501618
  };
501539
501619
  });
501540
- const ref = import_react134.useRef(null);
501541
- import_react134.useEffect(() => {
501620
+ const ref = import_react135.useRef(null);
501621
+ import_react135.useEffect(() => {
501542
501622
  ref.current?.scrollTo(scrollOffset);
501543
501623
  }, [scrollOffset]);
501544
501624
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
@@ -501646,8 +501726,8 @@ function DispatchPane({
501646
501726
  }) {
501647
501727
  const t2 = useTheme();
501648
501728
  const dispatch2 = sb.lastDispatch;
501649
- const ref = import_react134.useRef(null);
501650
- import_react134.useEffect(() => {
501729
+ const ref = import_react135.useRef(null);
501730
+ import_react135.useEffect(() => {
501651
501731
  ref.current?.scrollTo(scrollOffset);
501652
501732
  }, [scrollOffset]);
501653
501733
  if (!dispatch2) {
@@ -501813,8 +501893,8 @@ function SystemPane({
501813
501893
  const wkColor = (s2) => s2 === "ready" || s2 === "busy" ? t2.success : s2 === "starting" || s2 === "restarting" ? t2.amber : s2 === "crashed" ? t2.error : t2.textMuted;
501814
501894
  const wkIcon = (s2) => s2 === "busy" ? icon("worker_busy") : s2 === "crashed" ? icon("worker_crash") : s2 === "restarting" ? icon("worker_restart") : icon("worker");
501815
501895
  const termStats = getTerminalStats();
501816
- const ref = import_react134.useRef(null);
501817
- import_react134.useEffect(() => {
501896
+ const ref = import_react135.useRef(null);
501897
+ import_react135.useEffect(() => {
501818
501898
  ref.current?.scrollTo(scrollOffset);
501819
501899
  }, [scrollOffset]);
501820
501900
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("scrollbox", {
@@ -502078,7 +502158,7 @@ function SystemPane({
502078
502158
  ]
502079
502159
  }, undefined, true, undefined, this);
502080
502160
  }
502081
- var import_react134, BOLD16, SIDEBAR_W2 = 22, TABS;
502161
+ var import_react135, BOLD16, SIDEBAR_W2 = 22, TABS;
502082
502162
  var init_StatusDashboard = __esm(async () => {
502083
502163
  init_instance();
502084
502164
  init_icons();
@@ -502097,7 +502177,7 @@ var init_StatusDashboard = __esm(async () => {
502097
502177
  init_react2(),
502098
502178
  init_ui2()
502099
502179
  ]);
502100
- import_react134 = __toESM(require_react(), 1);
502180
+ import_react135 = __toESM(require_react(), 1);
502101
502181
  BOLD16 = TextAttributes25.BOLD;
502102
502182
  TABS = ["Usage", "Prompt", "Cost", "Tabs", "Dispatch", "System"];
502103
502183
  });
@@ -502105,8 +502185,8 @@ var init_StatusDashboard = __esm(async () => {
502105
502185
  // src/components/modals/TabNamePopup.tsx
502106
502186
  function TabNamePopup({ visible, placeholder, onSubmit, onClose }) {
502107
502187
  const { width: tw2 } = useTerminalDimensions();
502108
- const [value, setValue2] = import_react136.useState("");
502109
- import_react136.useEffect(() => {
502188
+ const [value, setValue2] = import_react137.useState("");
502189
+ import_react137.useEffect(() => {
502110
502190
  if (visible)
502111
502191
  setValue2("");
502112
502192
  }, [visible]);
@@ -502161,14 +502241,14 @@ function TabNamePopup({ visible, placeholder, onSubmit, onClose }) {
502161
502241
  }, undefined, true, undefined, this)
502162
502242
  }, undefined, false, undefined, this);
502163
502243
  }
502164
- var import_react136, NAME_MAX = 30;
502244
+ var import_react137, NAME_MAX = 30;
502165
502245
  var init_TabNamePopup = __esm(async () => {
502166
502246
  init_jsx_dev_runtime();
502167
502247
  await __promiseAll([
502168
502248
  init_react2(),
502169
502249
  init_ui2()
502170
502250
  ]);
502171
- import_react136 = __toESM(require_react(), 1);
502251
+ import_react137 = __toESM(require_react(), 1);
502172
502252
  });
502173
502253
 
502174
502254
  // src/components/modals/UiDemo.tsx
@@ -502211,37 +502291,37 @@ function fuzzyFilterProviders(providers, query2) {
502211
502291
  }
502212
502292
  function UiDemo({ visible, onClose }) {
502213
502293
  const { width: tw2, height: th } = useTerminalDimensions();
502214
- const [tab, setTab] = import_react138.useState("controls");
502215
- const [row, setRow] = import_react138.useState(0);
502216
- const [btnCol, setBtnCol] = import_react138.useState(0);
502217
- const [toggles, setToggles] = import_react138.useState({ a: true, b: false });
502218
- const [checks4, setChecks] = import_react138.useState({ x: true, y: false, z: false });
502219
- const [radio, setRadio] = import_react138.useState("y");
502220
- const [flash, setFlash] = import_react138.useState(null);
502221
- const [query2, setQuery] = import_react138.useState("");
502222
- const [searchMode, setSearchMode] = import_react138.useState(false);
502223
- const [expanded, setExpanded] = import_react138.useState(new Set(["anthropic"]));
502224
- const [pickerIdx, setPickerIdx] = import_react138.useState(0);
502225
- const [pickerQuery, setPickerQuery] = import_react138.useState("");
502226
- const [pickerSearchMode, setPickerSearchMode] = import_react138.useState(false);
502294
+ const [tab, setTab] = import_react139.useState("controls");
502295
+ const [row, setRow] = import_react139.useState(0);
502296
+ const [btnCol, setBtnCol] = import_react139.useState(0);
502297
+ const [toggles, setToggles] = import_react139.useState({ a: true, b: false });
502298
+ const [checks4, setChecks] = import_react139.useState({ x: true, y: false, z: false });
502299
+ const [radio, setRadio] = import_react139.useState("y");
502300
+ const [flash, setFlash] = import_react139.useState(null);
502301
+ const [query2, setQuery] = import_react139.useState("");
502302
+ const [searchMode, setSearchMode] = import_react139.useState(false);
502303
+ const [expanded, setExpanded] = import_react139.useState(new Set(["anthropic"]));
502304
+ const [pickerIdx, setPickerIdx] = import_react139.useState(0);
502305
+ const [pickerQuery, setPickerQuery] = import_react139.useState("");
502306
+ const [pickerSearchMode, setPickerSearchMode] = import_react139.useState(false);
502227
502307
  const width = Math.min(120, Math.max(90, Math.floor(tw2 * 0.85)));
502228
502308
  const height = Math.min(30, Math.max(22, Math.floor(th * 0.82)));
502229
- const filteredUsers = import_react138.useMemo(() => {
502309
+ const filteredUsers = import_react139.useMemo(() => {
502230
502310
  const q3 = query2.trim().toLowerCase();
502231
502311
  if (!q3)
502232
502312
  return USERS;
502233
502313
  return USERS.filter((u5) => [u5.first, u5.last, u5.email, u5.role].some((v3) => v3.toLowerCase().includes(q3)));
502234
502314
  }, [query2]);
502235
- const filteredProviders = import_react138.useMemo(() => {
502315
+ const filteredProviders = import_react139.useMemo(() => {
502236
502316
  return fuzzyFilterProviders(PROVIDERS2, pickerQuery);
502237
502317
  }, [pickerQuery]);
502238
- const effectiveExpanded = import_react138.useMemo(() => pickerQuery.trim().length > 0 ? new Set(filteredProviders.map((g4) => g4.id)) : expanded, [pickerQuery, filteredProviders, expanded]);
502239
- const pickerRows = import_react138.useMemo(() => buildGroupedRows(filteredProviders, effectiveExpanded), [filteredProviders, effectiveExpanded]);
502240
- import_react138.useEffect(() => {
502318
+ const effectiveExpanded = import_react139.useMemo(() => pickerQuery.trim().length > 0 ? new Set(filteredProviders.map((g4) => g4.id)) : expanded, [pickerQuery, filteredProviders, expanded]);
502319
+ const pickerRows = import_react139.useMemo(() => buildGroupedRows(filteredProviders, effectiveExpanded), [filteredProviders, effectiveExpanded]);
502320
+ import_react139.useEffect(() => {
502241
502321
  if (pickerIdx >= pickerRows.length)
502242
502322
  setPickerIdx(Math.max(0, pickerRows.length - 1));
502243
502323
  }, [pickerRows.length, pickerIdx]);
502244
- const rowCount = import_react138.useMemo(() => {
502324
+ const rowCount = import_react139.useMemo(() => {
502245
502325
  if (tab === "controls")
502246
502326
  return 5;
502247
502327
  if (tab === "fields")
@@ -502803,14 +502883,14 @@ function renderBody(tab, row, btnCol, toggles, checks4, radio, contentW, query2,
502803
502883
  ]
502804
502884
  }, undefined, true, undefined, this);
502805
502885
  }
502806
- var import_react138, PROVIDERS2, USERS, USER_COLUMNS, TABS2;
502886
+ var import_react139, PROVIDERS2, USERS, USER_COLUMNS, TABS2;
502807
502887
  var init_UiDemo = __esm(async () => {
502808
502888
  init_jsx_dev_runtime();
502809
502889
  await __promiseAll([
502810
502890
  init_react2(),
502811
502891
  init_ui2()
502812
502892
  ]);
502813
- import_react138 = __toESM(require_react(), 1);
502893
+ import_react139 = __toESM(require_react(), 1);
502814
502894
  PROVIDERS2 = [
502815
502895
  {
502816
502896
  id: "anthropic",
@@ -503063,14 +503143,14 @@ function UpdateModal({ visible, onClose }) {
503063
503143
  installMethod,
503064
503144
  updateAvailable
503065
503145
  } = useVersionStore();
503066
- const [copied, setCopied] = import_react140.useState(false);
503067
- const [phase, setPhase] = import_react140.useState("info");
503068
- const [quipIdx, setQuipIdx] = import_react140.useState(0);
503069
- const [spinIdx, setSpinIdx] = import_react140.useState(0);
503070
- const [logLines, setLogLines] = import_react140.useState([]);
503071
- const [errorMsg, setErrorMsg] = import_react140.useState("");
503072
- const upgrading = import_react140.useRef(false);
503073
- import_react140.useEffect(() => {
503146
+ const [copied, setCopied] = import_react141.useState(false);
503147
+ const [phase, setPhase] = import_react141.useState("info");
503148
+ const [quipIdx, setQuipIdx] = import_react141.useState(0);
503149
+ const [spinIdx, setSpinIdx] = import_react141.useState(0);
503150
+ const [logLines, setLogLines] = import_react141.useState([]);
503151
+ const [errorMsg, setErrorMsg] = import_react141.useState("");
503152
+ const upgrading = import_react141.useRef(false);
503153
+ import_react141.useEffect(() => {
503074
503154
  if (visible)
503075
503155
  setPhase("info");
503076
503156
  }, [visible]);
@@ -503080,7 +503160,7 @@ function UpdateModal({ visible, onClose }) {
503080
503160
  const maxChangelog = Math.max(6, popupH - 14);
503081
503161
  const logH = Math.max(3, Math.min(6, popupH - 12));
503082
503162
  const bg = t2.bgPopup;
503083
- import_react140.useEffect(() => {
503163
+ import_react141.useEffect(() => {
503084
503164
  if (phase !== "upgrading")
503085
503165
  return;
503086
503166
  const s2 = setInterval(() => setSpinIdx((i5) => i5 + 1), 80);
@@ -503090,7 +503170,7 @@ function UpdateModal({ visible, onClose }) {
503090
503170
  clearInterval(q3);
503091
503171
  };
503092
503172
  }, [phase]);
503093
- const doUpgrade = import_react140.useCallback(async () => {
503173
+ const doUpgrade = import_react141.useCallback(async () => {
503094
503174
  if (upgrading.current)
503095
503175
  return;
503096
503176
  upgrading.current = true;
@@ -503702,7 +503782,7 @@ function UpdateModal({ visible, onClose }) {
503702
503782
  }, undefined, true, undefined, this)
503703
503783
  }, undefined, false, undefined, this);
503704
503784
  }
503705
- var import_react140, UPGRADE_QUIPS, LATEST_QUIPS, CHANGELOG_ERROR_QUIPS, MAX_LOG = 50, BOLD17, ITALIC6, DIM6, TYPE_BADGE;
503785
+ var import_react141, UPGRADE_QUIPS, LATEST_QUIPS, CHANGELOG_ERROR_QUIPS, MAX_LOG = 50, BOLD17, ITALIC6, DIM6, TYPE_BADGE;
503706
503786
  var init_UpdateModal = __esm(async () => {
503707
503787
  init_icons();
503708
503788
  init_theme();
@@ -503715,7 +503795,7 @@ var init_UpdateModal = __esm(async () => {
503715
503795
  init_shared(),
503716
503796
  init_ui2()
503717
503797
  ]);
503718
- import_react140 = __toESM(require_react(), 1);
503798
+ import_react141 = __toESM(require_react(), 1);
503719
503799
  UPGRADE_QUIPS = [
503720
503800
  "Heating the forge\u2026",
503721
503801
  "Melting down the old version\u2026",
@@ -503768,10 +503848,10 @@ var init_UpdateModal = __esm(async () => {
503768
503848
  // src/components/settings/EditorSettings.tsx
503769
503849
  function EditorSettings({ visible, settings: settings2, initialScope, onUpdate, onClose }) {
503770
503850
  const { width: tw2, height: th } = useTerminalDimensions();
503771
- const [cursor3, setCursor] = import_react142.useState(0);
503772
- const [scope, setScope] = import_react142.useState(initialScope ?? "project");
503851
+ const [cursor3, setCursor] = import_react143.useState(0);
503852
+ const [scope, setScope] = import_react143.useState(initialScope ?? "project");
503773
503853
  const current = settings2 ?? ALL_ON;
503774
- import_react142.useEffect(() => {
503854
+ import_react143.useEffect(() => {
503775
503855
  if (visible) {
503776
503856
  setScope(initialScope ?? "project");
503777
503857
  setCursor(0);
@@ -503780,7 +503860,7 @@ function EditorSettings({ visible, settings: settings2, initialScope, onUpdate,
503780
503860
  const popupW = Math.min(80, Math.max(64, Math.floor(tw2 * 0.7)));
503781
503861
  const popupH = Math.min(32, Math.max(20, th - 4));
503782
503862
  const contentW = popupW - 4;
503783
- const groups = import_react142.useMemo(() => [
503863
+ const groups = import_react143.useMemo(() => [
503784
503864
  {
503785
503865
  id: "features",
503786
503866
  label: "Features",
@@ -503795,7 +503875,7 @@ function EditorSettings({ visible, settings: settings2, initialScope, onUpdate,
503795
503875
  }))
503796
503876
  }
503797
503877
  ], [current]);
503798
- const rows = import_react142.useMemo(() => buildGroupedRows(groups, new Set(["features"])), [groups]);
503878
+ const rows = import_react143.useMemo(() => buildGroupedRows(groups, new Set(["features"])), [groups]);
503799
503879
  useKeyboard((evt) => {
503800
503880
  if (!visible)
503801
503881
  return;
@@ -503895,7 +503975,7 @@ function EditorSettings({ visible, settings: settings2, initialScope, onUpdate,
503895
503975
  }, undefined, true, undefined, this)
503896
503976
  }, undefined, false, undefined, this);
503897
503977
  }
503898
- var import_react142, AGENT_ACCESS_MODES, AGENT_ACCESS_LABELS, FEATURES, ALL_ON, ALL_OFF;
503978
+ var import_react143, AGENT_ACCESS_MODES, AGENT_ACCESS_LABELS, FEATURES, ALL_ON, ALL_OFF;
503899
503979
  var init_EditorSettings = __esm(async () => {
503900
503980
  init_jsx_dev_runtime();
503901
503981
  await __promiseAll([
@@ -503903,7 +503983,7 @@ var init_EditorSettings = __esm(async () => {
503903
503983
  init_shared(),
503904
503984
  init_ui2()
503905
503985
  ]);
503906
- import_react142 = __toESM(require_react(), 1);
503986
+ import_react143 = __toESM(require_react(), 1);
503907
503987
  AGENT_ACCESS_MODES = ["on", "off", "when-open"];
503908
503988
  AGENT_ACCESS_LABELS = {
503909
503989
  on: "Always",
@@ -504266,35 +504346,35 @@ function HearthSettings({ visible, onClose }) {
504266
504346
  const contentW = innerW - SIDEBAR_W3 - 1;
504267
504347
  const popupHeight = Math.max(MIN_BODY_ROWS + 8, Math.min(termRows - 2, Math.floor(termRows * MAX_HEIGHT_RATIO)));
504268
504348
  const bodyRows = Math.max(MIN_BODY_ROWS, popupHeight - 8);
504269
- const [tab, setTab] = import_react144.useState("surfaces");
504270
- const [config2, setConfig] = import_react144.useState(() => loadHearthConfig());
504271
- const [status, setStatus] = import_react144.useState({ running: false });
504272
- const [flash, setFlash] = import_react144.useState(null);
504273
- const flashTimer = import_react144.useRef(null);
504274
- const [cursor3, setCursor] = import_react144.useState(0);
504275
- const [mode, setMode] = import_react144.useState({ k: "list" });
504276
- const [logLines, setLogLines] = import_react144.useState([]);
504277
- const [logScroll, setLogScroll] = import_react144.useState(0);
504278
- const [logAutoscroll, setLogAutoscroll] = import_react144.useState(true);
504279
- const [logFilter, setLogFilter] = import_react144.useState("");
504280
- const [logFilterFocused, setLogFilterFocused] = import_react144.useState(false);
504281
- const logWatcherRef = import_react144.useRef(null);
504282
- const daemonProcRef = import_react144.useRef(null);
504283
- const mountedRef = import_react144.useRef(false);
504284
- const bootLogRef = import_react144.useRef(null);
504285
- const statusRef = import_react144.useRef({ running: false });
504286
- const [startupError, setStartupError] = import_react144.useState(null);
504287
- const [service, setService] = import_react144.useState(null);
504288
- const flashMsg = import_react144.useCallback((kind, msg) => {
504349
+ const [tab, setTab] = import_react145.useState("surfaces");
504350
+ const [config2, setConfig] = import_react145.useState(() => loadHearthConfig());
504351
+ const [status, setStatus] = import_react145.useState({ running: false });
504352
+ const [flash, setFlash] = import_react145.useState(null);
504353
+ const flashTimer = import_react145.useRef(null);
504354
+ const [cursor3, setCursor] = import_react145.useState(0);
504355
+ const [mode, setMode] = import_react145.useState({ k: "list" });
504356
+ const [logLines, setLogLines] = import_react145.useState([]);
504357
+ const [logScroll, setLogScroll] = import_react145.useState(0);
504358
+ const [logAutoscroll, setLogAutoscroll] = import_react145.useState(true);
504359
+ const [logFilter, setLogFilter] = import_react145.useState("");
504360
+ const [logFilterFocused, setLogFilterFocused] = import_react145.useState(false);
504361
+ const logWatcherRef = import_react145.useRef(null);
504362
+ const daemonProcRef = import_react145.useRef(null);
504363
+ const mountedRef = import_react145.useRef(false);
504364
+ const bootLogRef = import_react145.useRef(null);
504365
+ const statusRef = import_react145.useRef({ running: false });
504366
+ const [startupError, setStartupError] = import_react145.useState(null);
504367
+ const [service, setService] = import_react145.useState(null);
504368
+ const flashMsg = import_react145.useCallback((kind, msg) => {
504289
504369
  if (flashTimer.current)
504290
504370
  clearTimeout(flashTimer.current);
504291
504371
  setFlash({ kind, msg });
504292
504372
  flashTimer.current = setTimeout(() => setFlash(null), 3000);
504293
504373
  }, []);
504294
- const refreshConfig = import_react144.useCallback(() => {
504374
+ const refreshConfig = import_react145.useCallback(() => {
504295
504375
  setConfig(loadHearthConfig());
504296
504376
  }, []);
504297
- const refreshStatus = import_react144.useCallback(async () => {
504377
+ const refreshStatus = import_react145.useCallback(async () => {
504298
504378
  const cfg = loadHearthConfig();
504299
504379
  const st2 = await probeDaemon(cfg.daemon.socketPath);
504300
504380
  try {
@@ -504324,7 +504404,7 @@ function HearthSettings({ visible, onClose }) {
504324
504404
  if (st2.running)
504325
504405
  setStartupError(null);
504326
504406
  }, []);
504327
- import_react144.useEffect(() => {
504407
+ import_react145.useEffect(() => {
504328
504408
  if (!visible)
504329
504409
  return;
504330
504410
  mountedRef.current = true;
@@ -504338,13 +504418,13 @@ function HearthSettings({ visible, onClose }) {
504338
504418
  clearInterval(poll);
504339
504419
  };
504340
504420
  }, [visible, refreshConfig, refreshStatus]);
504341
- const filteredLogs = import_react144.useMemo(() => {
504421
+ const filteredLogs = import_react145.useMemo(() => {
504342
504422
  if (!logFilter.trim())
504343
504423
  return logLines;
504344
504424
  const q3 = logFilter.trim().toLowerCase();
504345
504425
  return logLines.filter((l6) => l6.toLowerCase().includes(q3));
504346
504426
  }, [logLines, logFilter]);
504347
- import_react144.useEffect(() => {
504427
+ import_react145.useEffect(() => {
504348
504428
  if (!visible || tab !== "logs") {
504349
504429
  if (logWatcherRef.current) {
504350
504430
  logWatcherRef.current.close();
@@ -504379,12 +504459,12 @@ function HearthSettings({ visible, onClose }) {
504379
504459
  logWatcherRef.current = null;
504380
504460
  };
504381
504461
  }, [visible, tab, config2.daemon.logFile]);
504382
- import_react144.useEffect(() => {
504462
+ import_react145.useEffect(() => {
504383
504463
  if (tab !== "logs" || !logAutoscroll)
504384
504464
  return;
504385
504465
  setLogScroll(Math.max(0, filteredLogs.length - bodyRows));
504386
504466
  }, [filteredLogs.length, tab, logAutoscroll, bodyRows]);
504387
- import_react144.useEffect(() => {
504467
+ import_react145.useEffect(() => {
504388
504468
  if (!visible)
504389
504469
  return;
504390
504470
  const handler4 = (event) => {
@@ -504402,7 +504482,7 @@ function HearthSettings({ visible, onClose }) {
504402
504482
  renderer2.keyInput.off("paste", handler4);
504403
504483
  };
504404
504484
  }, [visible, renderer2, tab, mode.k, logFilterFocused]);
504405
- const startDaemon = import_react144.useCallback(async () => {
504485
+ const startDaemon = import_react145.useCallback(async () => {
504406
504486
  try {
504407
504487
  const launcher = resolveLauncher();
504408
504488
  if (!launcher) {
@@ -504450,7 +504530,7 @@ function HearthSettings({ visible, onClose }) {
504450
504530
  flashMsg("err", err2 instanceof Error ? err2.message : String(err2));
504451
504531
  }
504452
504532
  }, [flashMsg, refreshStatus]);
504453
- const stopDaemon = import_react144.useCallback(async () => {
504533
+ const stopDaemon = import_react145.useCallback(async () => {
504454
504534
  try {
504455
504535
  if (statusRef.current.surfaceOwner === "tui") {
504456
504536
  const { getTuiHost: getTuiHost2 } = await Promise.resolve().then(() => (init_tui_host(), exports_tui_host));
@@ -504491,7 +504571,7 @@ function HearthSettings({ visible, onClose }) {
504491
504571
  flashMsg("err", err2 instanceof Error ? err2.message : String(err2));
504492
504572
  }
504493
504573
  }, [flashMsg, refreshStatus]);
504494
- const persist = import_react144.useCallback((next) => {
504574
+ const persist = import_react145.useCallback((next) => {
504495
504575
  try {
504496
504576
  writeGlobalHearthConfig(next);
504497
504577
  setConfig(next);
@@ -504518,18 +504598,18 @@ function HearthSettings({ visible, onClose }) {
504518
504598
  flashMsg("err", `reload failed: ${err2 instanceof Error ? err2.message : String(err2)}`);
504519
504599
  });
504520
504600
  }, [flashMsg, refreshStatus]);
504521
- const refreshService = import_react144.useCallback(async () => {
504601
+ const refreshService = import_react145.useCallback(async () => {
504522
504602
  try {
504523
504603
  const s2 = await getServiceStatus();
504524
504604
  setService(s2);
504525
504605
  } catch {}
504526
504606
  }, []);
504527
- import_react144.useEffect(() => {
504607
+ import_react145.useEffect(() => {
504528
504608
  if (!visible)
504529
504609
  return;
504530
504610
  refreshService();
504531
504611
  }, [visible, refreshService]);
504532
- const installPersistent = import_react144.useCallback(async () => {
504612
+ const installPersistent = import_react145.useCallback(async () => {
504533
504613
  try {
504534
504614
  const launcher = resolveLauncher();
504535
504615
  if (!launcher) {
@@ -504553,7 +504633,7 @@ function HearthSettings({ visible, onClose }) {
504553
504633
  flashMsg("err", err2 instanceof Error ? err2.message : String(err2));
504554
504634
  }
504555
504635
  }, [flashMsg, refreshStatus]);
504556
- const uninstallPersistent = import_react144.useCallback(async () => {
504636
+ const uninstallPersistent = import_react145.useCallback(async () => {
504557
504637
  try {
504558
504638
  const s2 = await uninstallService();
504559
504639
  if (s2.error) {
@@ -504566,8 +504646,8 @@ function HearthSettings({ visible, onClose }) {
504566
504646
  flashMsg("err", err2 instanceof Error ? err2.message : String(err2));
504567
504647
  }
504568
504648
  }, [flashMsg]);
504569
- const surfaceEntries = import_react144.useMemo(() => Object.entries(config2.surfaces), [config2.surfaces]);
504570
- const toggleSurface = import_react144.useCallback((surfaceId) => {
504649
+ const surfaceEntries = import_react145.useMemo(() => Object.entries(config2.surfaces), [config2.surfaces]);
504650
+ const toggleSurface = import_react145.useCallback((surfaceId) => {
504571
504651
  const current = config2.surfaces[surfaceId];
504572
504652
  if (!current)
504573
504653
  return;
@@ -504579,12 +504659,12 @@ function HearthSettings({ visible, onClose }) {
504579
504659
  }
504580
504660
  });
504581
504661
  }, [config2, persist]);
504582
- const removeSurface = import_react144.useCallback((surfaceId) => {
504662
+ const removeSurface = import_react145.useCallback((surfaceId) => {
504583
504663
  const next = { ...config2, surfaces: { ...config2.surfaces } };
504584
504664
  delete next.surfaces[surfaceId];
504585
504665
  persist(next);
504586
504666
  }, [config2, persist]);
504587
- const removeChat = import_react144.useCallback((surfaceId, chatId) => {
504667
+ const removeChat = import_react145.useCallback((surfaceId, chatId) => {
504588
504668
  const surface = config2.surfaces[surfaceId];
504589
504669
  if (!surface)
504590
504670
  return;
@@ -504598,7 +504678,7 @@ function HearthSettings({ visible, onClose }) {
504598
504678
  }
504599
504679
  });
504600
504680
  }, [config2, persist]);
504601
- const addSurface = import_react144.useCallback((kind, id) => {
504681
+ const addSurface = import_react145.useCallback((kind, id) => {
504602
504682
  const trimmedKind = kind.trim().toLowerCase();
504603
504683
  const trimmedId = id.trim();
504604
504684
  if (!trimmedKind || !trimmedId) {
@@ -504614,7 +504694,7 @@ function HearthSettings({ visible, onClose }) {
504614
504694
  }
504615
504695
  });
504616
504696
  }, [config2, flashMsg, persist]);
504617
- const addChat = import_react144.useCallback((surfaceId, chatId, cwd2) => {
504697
+ const addChat = import_react145.useCallback((surfaceId, chatId, cwd2) => {
504618
504698
  const trimmedChat = chatId.trim();
504619
504699
  const trimmedCwd = cwd2.trim();
504620
504700
  if (!trimmedChat || !trimmedCwd) {
@@ -504644,7 +504724,7 @@ function HearthSettings({ visible, onClose }) {
504644
504724
  }
504645
504725
  });
504646
504726
  }, [config2, flashMsg, persist]);
504647
- const setToken = import_react144.useCallback((surfaceId, value) => {
504727
+ const setToken = import_react145.useCallback((surfaceId, value) => {
504648
504728
  const key3 = tokenSecretKey(surfaceId);
504649
504729
  const trimmed = value.trim();
504650
504730
  if (!key3 || !trimmed) {
@@ -504654,7 +504734,7 @@ function HearthSettings({ visible, onClose }) {
504654
504734
  const res = setSecret(key3, trimmed);
504655
504735
  flashMsg(res.success ? "ok" : "err", res.success ? `stored ${key3} (${res.storage})` : "failed to store token");
504656
504736
  }, [flashMsg]);
504657
- const addAllowedUser = import_react144.useCallback((surfaceId, chatId, userId) => {
504737
+ const addAllowedUser = import_react145.useCallback((surfaceId, chatId, userId) => {
504658
504738
  const trimmedChat = chatId.trim();
504659
504739
  const trimmedUser = userId.trim();
504660
504740
  if (!trimmedChat || !trimmedUser) {
@@ -504683,7 +504763,7 @@ function HearthSettings({ visible, onClose }) {
504683
504763
  }
504684
504764
  });
504685
504765
  }, [config2, flashMsg, persist]);
504686
- const saveQuickstart = import_react144.useCallback((args2) => {
504766
+ const saveQuickstart = import_react145.useCallback((args2) => {
504687
504767
  const cwd2 = args2.cwd.trim();
504688
504768
  if (!cwd2) {
504689
504769
  flashMsg("err", "cwd required");
@@ -504782,7 +504862,7 @@ function HearthSettings({ visible, onClose }) {
504782
504862
  }, [config2, flashMsg, persist]);
504783
504863
  const surfacesList = surfaceEntries;
504784
504864
  const selectedSurface = tab === "surfaces" && surfacesList.length > 0 ? surfacesList[Math.min(cursor3, surfacesList.length - 1)] : null;
504785
- const pairingsList = import_react144.useMemo(() => {
504865
+ const pairingsList = import_react145.useMemo(() => {
504786
504866
  const out2 = [];
504787
504867
  for (const [sid, cfg] of surfaceEntries) {
504788
504868
  for (const [chatId, chat] of Object.entries(cfg.chats ?? {})) {
@@ -507159,7 +507239,7 @@ function VSep({ t: t2 }) {
507159
507239
  alignSelf: "stretch"
507160
507240
  }, undefined, false, undefined, this);
507161
507241
  }
507162
- var import_react144, MIN_WIDTH = 100, MAX_WIDTH = 150, WIDTH_RATIO = 0.92, SIDEBAR_W3 = 22, MAX_HEIGHT_RATIO = 0.9, MIN_BODY_ROWS = 18, CARD_PAD = 2, TABS3, TAB_LABEL, TAB_ICON, TAB_BLURB, PROVIDERS3, TG_FIELD_ORDER, DISCORD_FIELD_ORDER;
507242
+ var import_react145, MIN_WIDTH = 100, MAX_WIDTH = 150, WIDTH_RATIO = 0.92, SIDEBAR_W3 = 22, MAX_HEIGHT_RATIO = 0.9, MIN_BODY_ROWS = 18, CARD_PAD = 2, TABS3, TAB_LABEL, TAB_ICON, TAB_BLURB, PROVIDERS3, TG_FIELD_ORDER, DISCORD_FIELD_ORDER;
507163
507243
  var init_HearthSettings = __esm(async () => {
507164
507244
  init_icons();
507165
507245
  init_platform();
@@ -507174,7 +507254,7 @@ var init_HearthSettings = __esm(async () => {
507174
507254
  init_react2(),
507175
507255
  init_shared()
507176
507256
  ]);
507177
- import_react144 = __toESM(require_react(), 1);
507257
+ import_react145 = __toESM(require_react(), 1);
507178
507258
  TABS3 = ["surfaces", "daemon", "pairings", "logs"];
507179
507259
  TAB_LABEL = {
507180
507260
  surfaces: "Surfaces",
@@ -507797,7 +507877,7 @@ var init_installer = __esm(() => {
507797
507877
  Python: ["pyproject.toml", "setup.py", "requirements.txt", "*.py"],
507798
507878
  Go: ["go.mod", "*.go"],
507799
507879
  Rust: ["Cargo.toml", "*.rs"],
507800
- Lua: ["*.lua", ".luacheckrc"],
507880
+ Lua: ["*.lua", "*.luau", ".luacheckrc"],
507801
507881
  C: ["*.c", "*.h", "CMakeLists.txt", "Makefile"],
507802
507882
  "C++": ["*.cpp", "*.hpp", "*.cc", "CMakeLists.txt"],
507803
507883
  Ruby: ["Gemfile", "*.rb"],
@@ -507954,18 +508034,18 @@ function LspInstallSearch({
507954
508034
  }) {
507955
508035
  const t2 = useTheme();
507956
508036
  const pc = { bg: t2.bgPopup, hl: t2.bgPopupHighlight };
507957
- const [tab, setTab] = import_react146.useState(initialTab);
507958
- const [query2, setQuery] = import_react146.useState("");
507959
- const [categoryFilter, setCategoryFilter] = import_react146.useState("All");
507960
- const [allStatus, setAllStatus] = import_react146.useState([]);
507961
- const [recommended, setRecommended] = import_react146.useState([]);
507962
- const [installing, setInstalling] = import_react146.useState(false);
507963
- const [registryLoaded, setRegistryLoaded] = import_react146.useState(false);
507964
- const [registryLoading, setRegistryLoading] = import_react146.useState(false);
507965
- const [pendingToggle, setPendingToggle] = import_react146.useState(null);
508037
+ const [tab, setTab] = import_react147.useState(initialTab);
508038
+ const [query2, setQuery] = import_react147.useState("");
508039
+ const [categoryFilter, setCategoryFilter] = import_react147.useState("All");
508040
+ const [allStatus, setAllStatus] = import_react147.useState([]);
508041
+ const [recommended, setRecommended] = import_react147.useState([]);
508042
+ const [installing, setInstalling] = import_react147.useState(false);
508043
+ const [registryLoaded, setRegistryLoaded] = import_react147.useState(false);
508044
+ const [registryLoading, setRegistryLoading] = import_react147.useState(false);
508045
+ const [pendingToggle, setPendingToggle] = import_react147.useState(null);
507966
508046
  const defaultScopeCursor = detectScope("disabledLspServers") === "project" ? 0 : 1;
507967
- const [scopeCursor, setScopeCursor] = import_react146.useState(defaultScopeCursor);
507968
- const downloadAttemptedRef = import_react146.useRef(false);
508047
+ const [scopeCursor, setScopeCursor] = import_react147.useState(defaultScopeCursor);
508048
+ const downloadAttemptedRef = import_react147.useRef(false);
507969
508049
  const isInProject = existsSync62(join67(cwd2, ".git"));
507970
508050
  const { width: termCols, height: termRows } = useTerminalDimensions();
507971
508051
  const containerRows = termRows - 2;
@@ -507973,9 +508053,9 @@ function LspInstallSearch({
507973
508053
  const maxVisible = Math.max(4, Math.floor(containerRows * 0.85) - CHROME_ROWS4);
507974
508054
  const contentW = popupWidth - 22 - 3;
507975
508055
  const innerW = contentW;
507976
- const [cursor3, setCursor] = import_react146.useState(0);
507977
- const resetScroll = import_react146.useCallback(() => setCursor(0), []);
507978
- const refreshAll = import_react146.useCallback(async () => {
508056
+ const [cursor3, setCursor] = import_react147.useState(0);
508057
+ const resetScroll = import_react147.useCallback(() => setCursor(0), []);
508058
+ const refreshAll = import_react147.useCallback(async () => {
507979
508059
  setRegistryLoading(true);
507980
508060
  await new Promise((r5) => setTimeout(r5, 16));
507981
508061
  const statuses = getAllPackageStatus();
@@ -507984,7 +508064,7 @@ function LspInstallSearch({
507984
508064
  setRecommended(getRecommendedPackages(cwd2));
507985
508065
  setRegistryLoading(false);
507986
508066
  }, [cwd2]);
507987
- import_react146.useEffect(() => {
508067
+ import_react147.useEffect(() => {
507988
508068
  if (!visible)
507989
508069
  return;
507990
508070
  setTab(initialTab);
@@ -508405,7 +508485,7 @@ function LspInstallSearch({
508405
508485
  ]
508406
508486
  }, undefined, true, undefined, this);
508407
508487
  }
508408
- var import_react146, MAX_POPUP_WIDTH3 = 130, CHROME_ROWS4 = 10, TABS4, CATEGORY_FILTERS;
508488
+ var import_react147, MAX_POPUP_WIDTH3 = 130, CHROME_ROWS4 = 10, TABS4, CATEGORY_FILTERS;
508409
508489
  var init_LspInstallSearch = __esm(async () => {
508410
508490
  init_installer();
508411
508491
  init_server_registry();
@@ -508415,7 +508495,7 @@ var init_LspInstallSearch = __esm(async () => {
508415
508495
  init_react2(),
508416
508496
  init_ui2()
508417
508497
  ]);
508418
- import_react146 = __toESM(require_react(), 1);
508498
+ import_react147 = __toESM(require_react(), 1);
508419
508499
  TABS4 = ["search", "installed", "updates", "disabled", "recommended"];
508420
508500
  CATEGORY_FILTERS = ["All", "LSP", "Formatter", "Linter", "DAP"];
508421
508501
  });
@@ -508423,9 +508503,9 @@ var init_LspInstallSearch = __esm(async () => {
508423
508503
  // src/components/settings/MCPSettings.tsx
508424
508504
  import { TextAttributes as TextAttributes29 } from "@opentui/core";
508425
508505
  function useListScroll2(maxVisible, totalItems) {
508426
- const [cursor3, setCursor] = import_react148.useState(0);
508427
- const [scrollOffset, setScrollOffset] = import_react148.useState(0);
508428
- const adjustScroll = import_react148.useCallback((nextCursor) => {
508506
+ const [cursor3, setCursor] = import_react149.useState(0);
508507
+ const [scrollOffset, setScrollOffset] = import_react149.useState(0);
508508
+ const adjustScroll = import_react149.useCallback((nextCursor) => {
508429
508509
  setScrollOffset((prev) => {
508430
508510
  let next = prev;
508431
508511
  if (nextCursor < prev)
@@ -508438,7 +508518,7 @@ function useListScroll2(maxVisible, totalItems) {
508438
508518
  return Math.max(0, next);
508439
508519
  });
508440
508520
  }, [maxVisible, totalItems]);
508441
- const resetScroll = import_react148.useCallback(() => {
508521
+ const resetScroll = import_react149.useCallback(() => {
508442
508522
  setCursor(0);
508443
508523
  setScrollOffset(0);
508444
508524
  }, []);
@@ -508574,29 +508654,29 @@ function MCPSettings({
508574
508654
  const maxVisibleRows = Math.max(6, containerRows - CHROME_ROWS5);
508575
508655
  const serverPageSize = Math.max(2, Math.floor(maxVisibleRows / 3));
508576
508656
  const toolPageSize = Math.max(3, Math.floor(maxVisibleRows / 2));
508577
- const projectSet = import_react148.useMemo(() => new Set(projectServers.map((s2) => s2.name)), [projectServers]);
508578
- const scopeOf = import_react148.useCallback((n2) => projectSet.has(n2) ? "project" : "global", [projectSet]);
508657
+ const projectSet = import_react149.useMemo(() => new Set(projectServers.map((s2) => s2.name)), [projectServers]);
508658
+ const scopeOf = import_react149.useCallback((n2) => projectSet.has(n2) ? "project" : "global", [projectSet]);
508579
508659
  const runtimeServers = useMCPStore((s2) => s2.servers);
508580
- const serverList = import_react148.useMemo(() => Object.values(runtimeServers), [runtimeServers]);
508581
- const allTools = import_react148.useMemo(() => serverList.flatMap((s2) => s2.tools.map((ti) => ({ ...ti, serverStatus: s2.status }))), [serverList]);
508660
+ const serverList = import_react149.useMemo(() => Object.values(runtimeServers), [runtimeServers]);
508661
+ const allTools = import_react149.useMemo(() => serverList.flatMap((s2) => s2.tools.map((ti) => ({ ...ti, serverStatus: s2.status }))), [serverList]);
508582
508662
  const readyCount = serverList.filter((s2) => s2.status === "ready").length;
508583
- const [view, setView] = import_react148.useState("list");
508584
- const [toolFilter, setToolFilter] = import_react148.useState("");
508585
- const [serverFilter, setServerFilter] = import_react148.useState("");
508586
- const [draft, setDraft] = import_react148.useState({ ...EMPTY });
508587
- const [activeField, setActiveField] = import_react148.useState("name");
508588
- const [editingName, setEditingName] = import_react148.useState(null);
508589
- const [detailName, setDetailName] = import_react148.useState(null);
508590
- const [errorExpanded, setErrorExpanded] = import_react148.useState(false);
508591
- const [pendingDelete, setPendingDelete] = import_react148.useState(null);
508592
- const [deleteChoice, setDeleteChoice] = import_react148.useState("no");
508593
- const filteredTools = import_react148.useMemo(() => {
508663
+ const [view, setView] = import_react149.useState("list");
508664
+ const [toolFilter, setToolFilter] = import_react149.useState("");
508665
+ const [serverFilter, setServerFilter] = import_react149.useState("");
508666
+ const [draft, setDraft] = import_react149.useState({ ...EMPTY });
508667
+ const [activeField, setActiveField] = import_react149.useState("name");
508668
+ const [editingName, setEditingName] = import_react149.useState(null);
508669
+ const [detailName, setDetailName] = import_react149.useState(null);
508670
+ const [errorExpanded, setErrorExpanded] = import_react149.useState(false);
508671
+ const [pendingDelete, setPendingDelete] = import_react149.useState(null);
508672
+ const [deleteChoice, setDeleteChoice] = import_react149.useState("no");
508673
+ const filteredTools = import_react149.useMemo(() => {
508594
508674
  if (!toolFilter)
508595
508675
  return allTools;
508596
508676
  const q3 = toolFilter.toLowerCase();
508597
508677
  return allTools.filter((ti) => ti.name.toLowerCase().includes(q3) || ti.description.toLowerCase().includes(q3) || ti.serverName.toLowerCase().includes(q3));
508598
508678
  }, [allTools, toolFilter]);
508599
- const filteredServers = import_react148.useMemo(() => {
508679
+ const filteredServers = import_react149.useMemo(() => {
508600
508680
  if (!serverFilter)
508601
508681
  return serverList;
508602
508682
  const q3 = serverFilter.toLowerCase();
@@ -508605,13 +508685,13 @@ function MCPSettings({
508605
508685
  const pageSize = view === "list" ? serverPageSize : toolPageSize;
508606
508686
  const listCount = view === "list" ? filteredServers.length : view === "tools" ? filteredTools.length : 0;
508607
508687
  const { cursor: cursor3, setCursor, scrollOffset, adjustScroll, resetScroll } = useListScroll2(pageSize, listCount);
508608
- import_react148.useEffect(() => {
508688
+ import_react149.useEffect(() => {
508609
508689
  resetScroll();
508610
508690
  }, [resetScroll]);
508611
- import_react148.useEffect(() => {
508691
+ import_react149.useEffect(() => {
508612
508692
  resetScroll();
508613
508693
  }, [serverFilter, toolFilter, resetScroll]);
508614
- import_react148.useEffect(() => {
508694
+ import_react149.useEffect(() => {
508615
508695
  if (visible) {
508616
508696
  setView("list");
508617
508697
  setToolFilter("");
@@ -508626,13 +508706,13 @@ function MCPSettings({
508626
508706
  resetScroll();
508627
508707
  }
508628
508708
  }, [visible, resetScroll]);
508629
- const openAdd = import_react148.useCallback(() => {
508709
+ const openAdd = import_react149.useCallback(() => {
508630
508710
  setDraft({ ...EMPTY });
508631
508711
  setActiveField("name");
508632
508712
  setEditingName(null);
508633
508713
  setView("form");
508634
508714
  }, []);
508635
- const openEdit = import_react148.useCallback((name30) => {
508715
+ const openEdit = import_react149.useCallback((name30) => {
508636
508716
  const scope = scopeOf(name30);
508637
508717
  const list = scope === "project" ? projectServers : globalServers;
508638
508718
  const cfg = list.find((s2) => s2.name === name30);
@@ -508643,7 +508723,7 @@ function MCPSettings({
508643
508723
  setEditingName(name30);
508644
508724
  setView("form");
508645
508725
  }, [scopeOf, projectServers, globalServers]);
508646
- const commitForm = import_react148.useCallback(() => {
508726
+ const commitForm = import_react149.useCallback(() => {
508647
508727
  if (!draft.name.trim())
508648
508728
  return;
508649
508729
  const cfg = draftToConfig(draft);
@@ -508653,13 +508733,13 @@ function MCPSettings({
508653
508733
  onSave(updated, scope);
508654
508734
  setView("list");
508655
508735
  }, [draft, editingName, projectServers, globalServers, onSave]);
508656
- const deleteServer = import_react148.useCallback((name30) => {
508736
+ const deleteServer = import_react149.useCallback((name30) => {
508657
508737
  const scope = scopeOf(name30);
508658
508738
  const list = scope === "project" ? projectServers : globalServers;
508659
508739
  onSave(list.filter((s2) => s2.name !== name30), scope);
508660
508740
  setCursor((c3) => Math.max(0, Math.min(c3, filteredServers.length - 2)));
508661
508741
  }, [scopeOf, projectServers, globalServers, onSave, setCursor, filteredServers.length]);
508662
- const toggleDisabled = import_react148.useCallback((name30) => {
508742
+ const toggleDisabled = import_react149.useCallback((name30) => {
508663
508743
  const scope = scopeOf(name30);
508664
508744
  const list = scope === "project" ? projectServers : globalServers;
508665
508745
  const srv = list.find((s2) => s2.name === name30);
@@ -509242,7 +509322,7 @@ function FormBody({
509242
509322
  const t2 = useTheme();
509243
509323
  const fields = fieldsFor(draft.transport);
509244
509324
  const inputW = Math.max(30, innerW - 8);
509245
- const advanceField = import_react148.useCallback(() => {
509325
+ const advanceField = import_react149.useCallback(() => {
509246
509326
  const idx = fields.indexOf(activeField);
509247
509327
  const next = fields[idx + 1];
509248
509328
  if (next)
@@ -509366,7 +509446,7 @@ function FormBody({
509366
509446
  ]
509367
509447
  }, undefined, true, undefined, this);
509368
509448
  }
509369
- var import_react148, STATUS_LABEL, TRANSPORTS, TRANSPORT_LABEL, EMPTY, LABEL, HINT, MAX_WIDTH2 = 96, CHROME_ROWS5 = 8, MCP_TABS, TabRow, EmptyState, ServerCard, ToolBrowser;
509449
+ var import_react149, STATUS_LABEL, TRANSPORTS, TRANSPORT_LABEL, EMPTY, LABEL, HINT, MAX_WIDTH2 = 96, CHROME_ROWS5 = 8, MCP_TABS, TabRow, EmptyState, ServerCard, ToolBrowser;
509370
509450
  var init_MCPSettings = __esm(async () => {
509371
509451
  init_icons();
509372
509452
  init_theme();
@@ -509377,7 +509457,7 @@ var init_MCPSettings = __esm(async () => {
509377
509457
  init_shared(),
509378
509458
  init_ui2()
509379
509459
  ]);
509380
- import_react148 = __toESM(require_react(), 1);
509460
+ import_react149 = __toESM(require_react(), 1);
509381
509461
  STATUS_LABEL = {
509382
509462
  disconnected: "offline",
509383
509463
  connecting: "connecting\u2026",
@@ -509421,7 +509501,7 @@ var init_MCPSettings = __esm(async () => {
509421
509501
  { id: "list", label: "Servers", ic: "server" },
509422
509502
  { id: "tools", label: "Tools", ic: "mcp_tool" }
509423
509503
  ];
509424
- TabRow = import_react148.memo(function TabRow2({ view, innerW }) {
509504
+ TabRow = import_react149.memo(function TabRow2({ view, innerW }) {
509425
509505
  const t2 = useTheme();
509426
509506
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
509427
509507
  flexDirection: "row",
@@ -509441,7 +509521,7 @@ var init_MCPSettings = __esm(async () => {
509441
509521
  }, undefined, false, undefined, this)
509442
509522
  }, undefined, false, undefined, this);
509443
509523
  });
509444
- EmptyState = import_react148.memo(function EmptyState2({ innerW: _innerW }) {
509524
+ EmptyState = import_react149.memo(function EmptyState2({ innerW: _innerW }) {
509445
509525
  const t2 = useTheme();
509446
509526
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
509447
509527
  flexDirection: "column",
@@ -509480,7 +509560,7 @@ var init_MCPSettings = __esm(async () => {
509480
509560
  ]
509481
509561
  }, undefined, true, undefined, this);
509482
509562
  });
509483
- ServerCard = import_react148.memo(function ServerCard2({
509563
+ ServerCard = import_react149.memo(function ServerCard2({
509484
509564
  server: server2,
509485
509565
  scope,
509486
509566
  isSelected,
@@ -509657,7 +509737,7 @@ var init_MCPSettings = __esm(async () => {
509657
509737
  ]
509658
509738
  }, undefined, true, undefined, this);
509659
509739
  });
509660
- ToolBrowser = import_react148.memo(function ToolBrowser2({
509740
+ ToolBrowser = import_react149.memo(function ToolBrowser2({
509661
509741
  tools,
509662
509742
  filter: filter7,
509663
509743
  cursor: cursor3,
@@ -509800,9 +509880,9 @@ function ModelEventsPopup({ visible, onClose }) {
509800
509880
  const events = useModelEventsStore((s2) => s2.events);
509801
509881
  const setEnabled = useModelEventsStore((s2) => s2.setEnabled);
509802
509882
  const clear = useModelEventsStore((s2) => s2.clear);
509803
- const [tab, setTab] = import_react150.useState("Models");
509804
- const [now2, setNow] = import_react150.useState(Date.now());
509805
- import_react150.useEffect(() => {
509883
+ const [tab, setTab] = import_react151.useState("Models");
509884
+ const [now2, setNow] = import_react151.useState(Date.now());
509885
+ import_react151.useEffect(() => {
509806
509886
  if (!visible)
509807
509887
  return;
509808
509888
  const i5 = setInterval(() => setNow(Date.now()), 1000);
@@ -509838,9 +509918,9 @@ function ModelEventsPopup({ visible, onClose }) {
509838
509918
  }
509839
509919
  evt.preventDefault();
509840
509920
  });
509841
- const aggregates = import_react150.useMemo(() => aggregateModelEvents(events), [events]);
509842
- const errors4 = import_react150.useMemo(() => modelErrorEvents(events), [events]);
509843
- const recent = import_react150.useMemo(() => [...events].reverse().slice(0, 200), [events]);
509921
+ const aggregates = import_react151.useMemo(() => aggregateModelEvents(events), [events]);
509922
+ const errors4 = import_react151.useMemo(() => modelErrorEvents(events), [events]);
509923
+ const recent = import_react151.useMemo(() => [...events].reverse().slice(0, 200), [events]);
509844
509924
  if (!visible)
509845
509925
  return null;
509846
509926
  const sidebarTabs = TABS5.map((id) => ({
@@ -509999,7 +510079,7 @@ function ModelEventsPopup({ visible, onClose }) {
509999
510079
  ]
510000
510080
  }, undefined, true, undefined, this);
510001
510081
  }
510002
- var import_react150, BOLD18 = 1, TABS5;
510082
+ var import_react151, BOLD18 = 1, TABS5;
510003
510083
  var init_ModelEventsPopup = __esm(async () => {
510004
510084
  init_icons();
510005
510085
  init_theme();
@@ -510009,7 +510089,7 @@ var init_ModelEventsPopup = __esm(async () => {
510009
510089
  init_react2(),
510010
510090
  init_ui2()
510011
510091
  ]);
510012
- import_react150 = __toESM(require_react(), 1);
510092
+ import_react151 = __toESM(require_react(), 1);
510013
510093
  TABS5 = ["Models", "Recent", "Errors"];
510014
510094
  });
510015
510095
 
@@ -510202,19 +510282,19 @@ function ProviderSettings({
510202
510282
  const popupWidth = Math.min(MAX_POPUP_WIDTH4, Math.floor(termCols * 0.85));
510203
510283
  const maxVisible = Math.max(6, Math.floor(containerRows * 0.85) - CHROME_ROWS6);
510204
510284
  const t2 = useTheme();
510205
- const [tab, setTab] = import_react152.useState("claude");
510206
- const [cursor3, setCursor] = import_react152.useState(0);
510207
- const [scope, setScope] = import_react152.useState(() => detectInitialScope(projectConfig));
510285
+ const [tab, setTab] = import_react153.useState("claude");
510286
+ const [cursor3, setCursor] = import_react153.useState(0);
510287
+ const [scope, setScope] = import_react153.useState(() => detectInitialScope(projectConfig));
510208
510288
  const vals = effectiveValues(globalConfig2, projectConfig);
510209
510289
  const activeModel = projectConfig?.defaultModel ?? globalConfig2.defaultModel ?? "";
510210
510290
  const items = TAB_ITEMS[tab];
510211
510291
  const tabIdx = TABS6.indexOf(tab);
510212
510292
  const firstRowIdx = items.findIndex((i5) => i5.type !== "section" && i5.type !== "info");
510213
- import_react152.useEffect(() => {
510293
+ import_react153.useEffect(() => {
510214
510294
  if (visible)
510215
510295
  setScope(detectInitialScope(projectConfig));
510216
510296
  }, [visible, projectConfig]);
510217
- import_react152.useEffect(() => {
510297
+ import_react153.useEffect(() => {
510218
510298
  setCursor(Math.max(0, firstRowIdx));
510219
510299
  }, [tab]);
510220
510300
  const isBudgetDisabled = vals.thinkingMode !== "enabled";
@@ -510552,7 +510632,7 @@ function ProviderSettings({
510552
510632
  ]
510553
510633
  }, undefined, true, undefined, this);
510554
510634
  }
510555
- var import_react152, MAX_POPUP_WIDTH4 = 110, CHROME_ROWS6 = 10, TABS6, CLAUDE_ITEMS, OPENAI_ITEMS, GENERAL_ITEMS, GOOGLE_ITEMS, XAI_ITEMS, DEEPSEEK_ITEMS, OPENROUTER_ITEMS, COMPAT_ITEMS, TAB_ITEMS, DEFAULTS, EFFORT_KEY_MODELS;
510635
+ var import_react153, MAX_POPUP_WIDTH4 = 110, CHROME_ROWS6 = 10, TABS6, CLAUDE_ITEMS, OPENAI_ITEMS, GENERAL_ITEMS, GOOGLE_ITEMS, XAI_ITEMS, DEEPSEEK_ITEMS, OPENROUTER_ITEMS, COMPAT_ITEMS, TAB_ITEMS, DEFAULTS, EFFORT_KEY_MODELS;
510556
510636
  var init_ProviderSettings = __esm(async () => {
510557
510637
  init_provider_options();
510558
510638
  init_theme();
@@ -510562,7 +510642,7 @@ var init_ProviderSettings = __esm(async () => {
510562
510642
  init_shared(),
510563
510643
  init_ui2()
510564
510644
  ]);
510565
- import_react152 = __toESM(require_react(), 1);
510645
+ import_react153 = __toESM(require_react(), 1);
510566
510646
  TABS6 = [
510567
510647
  "claude",
510568
510648
  "openai",
@@ -510944,20 +511024,20 @@ function RepoMapStatusPopup({
510944
511024
  const { width: termCols, height: termRows } = useTerminalDimensions();
510945
511025
  const popupWidth = Math.min(POPUP_W, Math.floor(termCols * 0.8));
510946
511026
  const innerW = popupWidth - 2;
510947
- const stateRef = import_react154.useRef(useRepoMapStore.getState());
510948
- const [, setRenderTick] = import_react154.useState(0);
510949
- const spinnerRef = import_react154.useRef(0);
510950
- const bodyScrollRef = import_react154.useRef(null);
511027
+ const stateRef = import_react155.useRef(useRepoMapStore.getState());
511028
+ const [, setRenderTick] = import_react155.useState(0);
511029
+ const spinnerRef = import_react155.useRef(0);
511030
+ const bodyScrollRef = import_react155.useRef(null);
510951
511031
  const initialMode = currentMode ?? "off";
510952
511032
  const initialLimit = currentLimit ?? 300;
510953
- const [selectedMode, setSelectedMode] = import_react154.useState(initialMode);
510954
- const [selectedLimit, setSelectedLimit] = import_react154.useState(initialLimit);
510955
- const [selectedAutoRegen, setSelectedAutoRegen] = import_react154.useState(currentAutoRegen ?? false);
510956
- const [selectedTokenBudget, setSelectedTokenBudget] = import_react154.useState(currentTokenBudget);
510957
- const [selectedScope, setSelectedScope] = import_react154.useState(currentScope ?? "project");
510958
- const [focusRow, setFocusRow] = import_react154.useState(0 /* Mode */);
510959
- const [confirmClear, setConfirmClear] = import_react154.useState(false);
510960
- import_react154.useEffect(() => {
511033
+ const [selectedMode, setSelectedMode] = import_react155.useState(initialMode);
511034
+ const [selectedLimit, setSelectedLimit] = import_react155.useState(initialLimit);
511035
+ const [selectedAutoRegen, setSelectedAutoRegen] = import_react155.useState(currentAutoRegen ?? false);
511036
+ const [selectedTokenBudget, setSelectedTokenBudget] = import_react155.useState(currentTokenBudget);
511037
+ const [selectedScope, setSelectedScope] = import_react155.useState(currentScope ?? "project");
511038
+ const [focusRow, setFocusRow] = import_react155.useState(0 /* Mode */);
511039
+ const [confirmClear, setConfirmClear] = import_react155.useState(false);
511040
+ import_react155.useEffect(() => {
510961
511041
  if (!visible)
510962
511042
  return;
510963
511043
  setSelectedMode(currentMode ?? "off");
@@ -510968,7 +511048,7 @@ function RepoMapStatusPopup({
510968
511048
  setFocusRow(0 /* Mode */);
510969
511049
  setConfirmClear(false);
510970
511050
  }, [visible, currentMode, currentLimit, currentAutoRegen, currentTokenBudget, currentScope]);
510971
- import_react154.useEffect(() => {
511051
+ import_react155.useEffect(() => {
510972
511052
  if (!visible)
510973
511053
  return;
510974
511054
  stateRef.current = useRepoMapStore.getState();
@@ -510978,7 +511058,7 @@ function RepoMapStatusPopup({
510978
511058
  setRenderTick((n2) => n2 + 1);
510979
511059
  });
510980
511060
  }, [visible]);
510981
- import_react154.useEffect(() => {
511061
+ import_react155.useEffect(() => {
510982
511062
  if (!visible)
510983
511063
  return;
510984
511064
  const timer = setInterval(() => {
@@ -510990,7 +511070,7 @@ function RepoMapStatusPopup({
510990
511070
  }, 150);
510991
511071
  return () => clearInterval(timer);
510992
511072
  }, [visible]);
510993
- import_react154.useEffect(() => {
511073
+ import_react155.useEffect(() => {
510994
511074
  if (!visible)
510995
511075
  return;
510996
511076
  const sb = bodyScrollRef.current;
@@ -511379,7 +511459,7 @@ function RepoMapStatusPopup({
511379
511459
  }, undefined, true, undefined, this)
511380
511460
  }, undefined, false, undefined, this);
511381
511461
  }
511382
- var import_react154, LABEL_W = 18, POPUP_W = 72, SEMANTIC_MODES, MODE_DESCRIPTIONS, MODE_LABELS2, LLM_LIMIT_PRESETS, TOKEN_BUDGET_PRESETS;
511462
+ var import_react155, LABEL_W = 18, POPUP_W = 72, SEMANTIC_MODES, MODE_DESCRIPTIONS, MODE_LABELS2, LLM_LIMIT_PRESETS, TOKEN_BUDGET_PRESETS;
511383
511463
  var init_RepoMapStatusPopup = __esm(async () => {
511384
511464
  init_theme();
511385
511465
  init_repomap();
@@ -511390,7 +511470,7 @@ var init_RepoMapStatusPopup = __esm(async () => {
511390
511470
  init_shared(),
511391
511471
  init_ui2()
511392
511472
  ]);
511393
- import_react154 = __toESM(require_react(), 1);
511473
+ import_react155 = __toESM(require_react(), 1);
511394
511474
  SEMANTIC_MODES = ["off", "ast", "synthetic", "llm", "full"];
511395
511475
  MODE_DESCRIPTIONS = {
511396
511476
  off: "disabled",
@@ -511435,11 +511515,11 @@ function RouterSettings({
511435
511515
  }) {
511436
511516
  const t2 = useTheme();
511437
511517
  const { width: tw2, height: th } = useTerminalDimensions();
511438
- const [cursor3, setCursor] = import_react156.useState(0);
511518
+ const [cursor3, setCursor] = import_react157.useState(0);
511439
511519
  const popupW = Math.min(100, Math.max(72, Math.floor(tw2 * 0.78)));
511440
511520
  const popupH = Math.min(40, Math.max(26, th - 4));
511441
511521
  const contentW = popupW - 4;
511442
- const modelsInUse = import_react156.useMemo(() => {
511522
+ const modelsInUse = import_react157.useMemo(() => {
511443
511523
  const set3 = new Set;
511444
511524
  if (defaultModel)
511445
511525
  set3.add(defaultModel);
@@ -511462,7 +511542,7 @@ function RouterSettings({
511462
511542
  }
511463
511543
  return Array.from(set3);
511464
511544
  }, [router2, defaultModel]);
511465
- const rows = import_react156.useMemo(() => {
511545
+ const rows = import_react157.useMemo(() => {
511466
511546
  const out2 = [];
511467
511547
  for (const s2 of SECTIONS) {
511468
511548
  out2.push({ kind: "header", section: s2 });
@@ -511481,7 +511561,7 @@ function RouterSettings({
511481
511561
  }
511482
511562
  return out2;
511483
511563
  }, [modelsInUse]);
511484
- const selectableIndices = import_react156.useMemo(() => rows.map((r5, i5) => r5.kind === "header" ? -1 : i5).filter((i5) => i5 >= 0), [rows]);
511564
+ const selectableIndices = import_react157.useMemo(() => rows.map((r5, i5) => r5.kind === "header" ? -1 : i5).filter((i5) => i5 >= 0), [rows]);
511485
511565
  const moveItem = (dir) => {
511486
511566
  if (selectableIndices.length === 0)
511487
511567
  return;
@@ -511490,7 +511570,7 @@ function RouterSettings({
511490
511570
  const nextPos = (base + dir + selectableIndices.length) % selectableIndices.length;
511491
511571
  setCursor(selectableIndices[nextPos] ?? selectableIndices[0] ?? 0);
511492
511572
  };
511493
- import_react156.useMemo(() => {
511573
+ import_react157.useMemo(() => {
511494
511574
  if (cursor3 === 0 && selectableIndices.length > 0 && selectableIndices[0] !== 0) {
511495
511575
  setCursor(selectableIndices[0] ?? 0);
511496
511576
  }
@@ -511716,7 +511796,7 @@ function RouterSettings({
511716
511796
  }, undefined, true, undefined, this)
511717
511797
  }, undefined, false, undefined, this);
511718
511798
  }
511719
- var import_react156, BOLD19 = 1, SECTIONS, ALL_DEFS;
511799
+ var import_react157, BOLD19 = 1, SECTIONS, ALL_DEFS;
511720
511800
  var init_RouterSettings = __esm(async () => {
511721
511801
  init_theme();
511722
511802
  init_jsx_dev_runtime();
@@ -511725,7 +511805,7 @@ var init_RouterSettings = __esm(async () => {
511725
511805
  init_shared(),
511726
511806
  init_ui2()
511727
511807
  ]);
511728
- import_react156 = __toESM(require_react(), 1);
511808
+ import_react157 = __toESM(require_react(), 1);
511729
511809
  SECTIONS = [
511730
511810
  {
511731
511811
  id: "main",
@@ -511951,25 +512031,25 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
511951
512031
  const t2 = useTheme();
511952
512032
  const popupBg = t2.bgPopup;
511953
512033
  const popupHl = t2.bgPopupHighlight;
511954
- const [tab, setTab] = import_react158.useState("search");
511955
- const [query2, setQuery] = import_react158.useState("");
511956
- const [popular, setPopular] = import_react158.useState([]);
511957
- const [results, setResults] = import_react158.useState([]);
511958
- const [installed2, setInstalled] = import_react158.useState([]);
511959
- const [activeSkills, setActiveSkills] = import_react158.useState([]);
511960
- const [searching, setSearching] = import_react158.useState(false);
511961
- const [installing, setInstalling] = import_react158.useState(false);
511962
- const [pendingInstall, setPendingInstall] = import_react158.useState(null);
511963
- const [scopeCursor, setScopeCursor] = import_react158.useState(0);
511964
- const debounceRef = import_react158.useRef(null);
512034
+ const [tab, setTab] = import_react159.useState("search");
512035
+ const [query2, setQuery] = import_react159.useState("");
512036
+ const [popular, setPopular] = import_react159.useState([]);
512037
+ const [results, setResults] = import_react159.useState([]);
512038
+ const [installed2, setInstalled] = import_react159.useState([]);
512039
+ const [activeSkills, setActiveSkills] = import_react159.useState([]);
512040
+ const [searching, setSearching] = import_react159.useState(false);
512041
+ const [installing, setInstalling] = import_react159.useState(false);
512042
+ const [pendingInstall, setPendingInstall] = import_react159.useState(null);
512043
+ const [scopeCursor, setScopeCursor] = import_react159.useState(0);
512044
+ const debounceRef = import_react159.useRef(null);
511965
512045
  const isInProject = existsSync63(join68(getCwd(), ".git"));
511966
512046
  const { width: termCols, height: termRows } = useTerminalDimensions();
511967
512047
  const containerRows = termRows - 2;
511968
512048
  const popupWidth = Math.min(MAX_POPUP_WIDTH5, Math.floor(termCols * 0.88));
511969
512049
  const maxVisible = Math.max(4, Math.floor(containerRows * 0.85) - CHROME_ROWS7);
511970
512050
  const contentW = popupWidth - 22 - 3;
511971
- const [cursor3, setCursor] = import_react158.useState(0);
511972
- const resetScroll = import_react158.useCallback(() => setCursor(0), []);
512051
+ const [cursor3, setCursor] = import_react159.useState(0);
512052
+ const resetScroll = import_react159.useCallback(() => setCursor(0), []);
511973
512053
  const filterQuery = query2.toLowerCase().trim();
511974
512054
  const installedNames = new Set(installed2.map((s2) => s2.name));
511975
512055
  const filteredInstalled = filterQuery ? installed2.filter((s2) => s2.name.toLowerCase().includes(filterQuery)) : installed2;
@@ -511982,13 +512062,13 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
511982
512062
  return filteredInstalled.length;
511983
512063
  return filteredActive.length;
511984
512064
  })();
511985
- const refreshInstalled = import_react158.useCallback(() => {
512065
+ const refreshInstalled = import_react159.useCallback(() => {
511986
512066
  setInstalled(listInstalledSkills());
511987
512067
  }, []);
511988
- const refreshActive = import_react158.useCallback(() => {
512068
+ const refreshActive = import_react159.useCallback(() => {
511989
512069
  setActiveSkills(contextManager.getActiveSkills());
511990
512070
  }, [contextManager]);
511991
- import_react158.useEffect(() => {
512071
+ import_react159.useEffect(() => {
511992
512072
  if (visible) {
511993
512073
  setTab("search");
511994
512074
  setQuery("");
@@ -511999,7 +512079,7 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
511999
512079
  listPopularSkills().then((r5) => setPopular(r5)).catch(() => {});
512000
512080
  }
512001
512081
  }, [visible, refreshActive, refreshInstalled]);
512002
- import_react158.useEffect(() => {
512082
+ import_react159.useEffect(() => {
512003
512083
  if (!visible || tab !== "search")
512004
512084
  return;
512005
512085
  if (debounceRef.current)
@@ -512025,7 +512105,7 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
512025
512105
  clearTimeout(debounceRef.current);
512026
512106
  };
512027
512107
  }, [query2, visible, tab, popular.length]);
512028
- import_react158.useEffect(() => {
512108
+ import_react159.useEffect(() => {
512029
512109
  setQuery("");
512030
512110
  setResults([]);
512031
512111
  resetScroll();
@@ -512340,7 +512420,7 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
512340
512420
  ]
512341
512421
  }, undefined, true, undefined, this);
512342
512422
  }
512343
- var import_react158, MAX_POPUP_WIDTH5 = 120, CHROME_ROWS7 = 9, TABS7;
512423
+ var import_react159, MAX_POPUP_WIDTH5 = 120, CHROME_ROWS7 = 9, TABS7;
512344
512424
  var init_SkillSearch = __esm(async () => {
512345
512425
  init_cwd();
512346
512426
  init_manager5();
@@ -512350,23 +512430,23 @@ var init_SkillSearch = __esm(async () => {
512350
512430
  init_react2(),
512351
512431
  init_ui2()
512352
512432
  ]);
512353
- import_react158 = __toESM(require_react(), 1);
512433
+ import_react159 = __toESM(require_react(), 1);
512354
512434
  TABS7 = ["search", "installed", "active"];
512355
512435
  });
512356
512436
 
512357
512437
  // src/components/settings/ToolsPopup.tsx
512358
512438
  function ToolsPopup({ visible, disabledTools, onToggleTool, onClose }) {
512359
512439
  const { width: tw2, height: th } = useTerminalDimensions();
512360
- const [cursor3, setCursor] = import_react160.useState(0);
512361
- const catalog = import_react160.useMemo(() => getToolCatalog(), []);
512362
- import_react160.useEffect(() => {
512440
+ const [cursor3, setCursor] = import_react161.useState(0);
512441
+ const catalog = import_react161.useMemo(() => getToolCatalog(), []);
512442
+ import_react161.useEffect(() => {
512363
512443
  if (visible)
512364
512444
  setCursor(0);
512365
512445
  }, [visible]);
512366
512446
  const popupW = Math.min(110, Math.max(72, tw2 - 4));
512367
512447
  const popupH = Math.min(32, Math.max(16, th - 4));
512368
512448
  const contentW = popupW - 4;
512369
- const groups = import_react160.useMemo(() => {
512449
+ const groups = import_react161.useMemo(() => {
512370
512450
  return [
512371
512451
  {
512372
512452
  id: "tools",
@@ -512382,7 +512462,7 @@ function ToolsPopup({ visible, disabledTools, onToggleTool, onClose }) {
512382
512462
  }
512383
512463
  ];
512384
512464
  }, [disabledTools, catalog]);
512385
- const rows = import_react160.useMemo(() => buildGroupedRows(groups, new Set(["tools"])), [groups]);
512465
+ const rows = import_react161.useMemo(() => buildGroupedRows(groups, new Set(["tools"])), [groups]);
512386
512466
  useKeyboard((evt) => {
512387
512467
  if (!visible)
512388
512468
  return;
@@ -512429,7 +512509,7 @@ function ToolsPopup({ visible, disabledTools, onToggleTool, onClose }) {
512429
512509
  }, undefined, false, undefined, this)
512430
512510
  }, undefined, false, undefined, this);
512431
512511
  }
512432
- var import_react160;
512512
+ var import_react161;
512433
512513
  var init_ToolsPopup = __esm(async () => {
512434
512514
  init_constants();
512435
512515
  init_jsx_dev_runtime();
@@ -512437,7 +512517,7 @@ var init_ToolsPopup = __esm(async () => {
512437
512517
  init_react2(),
512438
512518
  init_ui2()
512439
512519
  ]);
512440
- import_react160 = __toESM(require_react(), 1);
512520
+ import_react161 = __toESM(require_react(), 1);
512441
512521
  });
512442
512522
 
512443
512523
  // src/components/modals/MemoryBrowser.tsx
@@ -512484,29 +512564,29 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512484
512564
  const popupH = Math.min(36, Math.max(20, th - 4));
512485
512565
  const SIDEBAR_W4 = 22;
512486
512566
  const contentW = popupW - SIDEBAR_W4 - 9;
512487
- const [tab, setTab] = import_react162.useState("All");
512488
- const [query2, setQuery] = import_react162.useState("");
512489
- const [cursor3, setCursor] = import_react162.useState(0);
512490
- const [generation, setGeneration] = import_react162.useState(0);
512491
- const [flash, setFlash] = import_react162.useState(null);
512492
- const [confirmPurge, setConfirmPurge] = import_react162.useState(false);
512493
- const [cleanupRows, setCleanupRows] = import_react162.useState([]);
512494
- const [cleanupSelected, setCleanupSelected] = import_react162.useState(new Map);
512495
- const [settingsModal, setSettingsModal] = import_react162.useState(null);
512496
- const cursorRef = import_react162.useRef(0);
512567
+ const [tab, setTab] = import_react163.useState("All");
512568
+ const [query2, setQuery] = import_react163.useState("");
512569
+ const [cursor3, setCursor] = import_react163.useState(0);
512570
+ const [generation, setGeneration] = import_react163.useState(0);
512571
+ const [flash, setFlash] = import_react163.useState(null);
512572
+ const [confirmPurge, setConfirmPurge] = import_react163.useState(false);
512573
+ const [cleanupRows, setCleanupRows] = import_react163.useState([]);
512574
+ const [cleanupSelected, setCleanupSelected] = import_react163.useState(new Map);
512575
+ const [settingsModal, setSettingsModal] = import_react163.useState(null);
512576
+ const cursorRef = import_react163.useRef(0);
512497
512577
  cursorRef.current = cursor3;
512498
- const popFlash = import_react162.useCallback((kind, message) => {
512578
+ const popFlash = import_react163.useCallback((kind, message) => {
512499
512579
  setFlash({ kind, message });
512500
512580
  setTimeout(() => setFlash(null), 1800);
512501
512581
  }, []);
512502
- const fileExists = import_react162.useCallback((p4) => {
512582
+ const fileExists = import_react163.useCallback((p4) => {
512503
512583
  try {
512504
512584
  return existsSync64(join69(cwd2, p4));
512505
512585
  } catch {
512506
512586
  return false;
512507
512587
  }
512508
512588
  }, [cwd2]);
512509
- const refreshCleanup = import_react162.useCallback(() => {
512589
+ const refreshCleanup = import_react163.useCallback(() => {
512510
512590
  const dupes = memMgr.findDuplicates("all");
512511
512591
  const dead = memMgr.findDeadFileRefs("all", fileExists);
512512
512592
  const stale = memMgr.staleCandidates("all", 25);
@@ -512580,7 +512660,7 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512580
512660
  setCleanupRows(rows);
512581
512661
  setCleanupSelected(new Map);
512582
512662
  }, [memMgr, fileExists]);
512583
- import_react162.useEffect(() => {
512663
+ import_react163.useEffect(() => {
512584
512664
  if (!visible)
512585
512665
  return;
512586
512666
  setQuery("");
@@ -512591,13 +512671,13 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512591
512671
  if (tab === "Cleanup")
512592
512672
  refreshCleanup();
512593
512673
  }, [visible, tab, refreshCleanup]);
512594
- const allRows = import_react162.useMemo(() => {
512674
+ const allRows = import_react163.useMemo(() => {
512595
512675
  return memMgr.list("all", { includeHidden: false }).map(toRow2);
512596
512676
  }, [memMgr, generation]);
512597
- const hiddenRows = import_react162.useMemo(() => {
512677
+ const hiddenRows = import_react163.useMemo(() => {
512598
512678
  return memMgr.list("all", { includeHidden: true }).filter((m6) => m6.hidden).map(toRow2);
512599
512679
  }, [memMgr, generation]);
512600
- const filteredRows = import_react162.useMemo(() => {
512680
+ const filteredRows = import_react163.useMemo(() => {
512601
512681
  const source = tab === "Hidden" ? hiddenRows : allRows;
512602
512682
  const fq = query2.toLowerCase().trim();
512603
512683
  if (!fq)
@@ -512607,7 +512687,7 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512607
512687
  return hay.toLowerCase().includes(fq);
512608
512688
  });
512609
512689
  }, [allRows, hiddenRows, tab, query2]);
512610
- const settingsGroups = import_react162.useMemo(() => {
512690
+ const settingsGroups = import_react163.useMemo(() => {
512611
512691
  const scopeCfg = memMgr.scopeConfig;
512612
512692
  const resolution = contextManager.getEmbedderResolution();
512613
512693
  const embedderMeta = resolution?.modelId ? `${resolution.modelId} (${resolution.source})` : "offline (hashbag-v2)";
@@ -512646,8 +512726,8 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512646
512726
  }
512647
512727
  ];
512648
512728
  }, [memMgr, contextManager]);
512649
- const settingsRows = import_react162.useMemo(() => buildGroupedRows(settingsGroups, new Set(["scopes"])), [settingsGroups]);
512650
- import_react162.useEffect(() => {
512729
+ const settingsRows = import_react163.useMemo(() => buildGroupedRows(settingsGroups, new Set(["scopes"])), [settingsGroups]);
512730
+ import_react163.useEffect(() => {
512651
512731
  let len;
512652
512732
  if (tab === "Cleanup")
512653
512733
  len = cleanupRows.length + 1;
@@ -513124,7 +513204,7 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
513124
513204
  }, undefined, true, undefined, this)
513125
513205
  }, undefined, false, undefined, this);
513126
513206
  }
513127
- var import_react162, SETTINGS_MODAL_TITLE, SETTINGS_MODAL_OPTIONS, TABS8, COLUMNS2, CLEANUP_COLUMNS;
513207
+ var import_react163, SETTINGS_MODAL_TITLE, SETTINGS_MODAL_OPTIONS, TABS8, COLUMNS2, CLEANUP_COLUMNS;
513128
513208
  var init_MemoryBrowser = __esm(async () => {
513129
513209
  init_theme();
513130
513210
  init_jsx_dev_runtime();
@@ -513132,7 +513212,7 @@ var init_MemoryBrowser = __esm(async () => {
513132
513212
  init_react2(),
513133
513213
  init_ui2()
513134
513214
  ]);
513135
- import_react162 = __toESM(require_react(), 1);
513215
+ import_react163 = __toESM(require_react(), 1);
513136
513216
  SETTINGS_MODAL_TITLE = {
513137
513217
  write: "Write Scope",
513138
513218
  read: "Read Scope",
@@ -513185,7 +513265,7 @@ function DialogHost() {
513185
513265
  pop();
513186
513266
  }
513187
513267
  });
513188
- import_react164.useEffect(() => {
513268
+ import_react165.useEffect(() => {
513189
513269
  if (!top)
513190
513270
  return;
513191
513271
  return () => {};
@@ -513237,7 +513317,7 @@ function DialogBody({ width }) {
513237
513317
  }
513238
513318
  }
513239
513319
  }
513240
- var import_react164;
513320
+ var import_react165;
513241
513321
  var init_DialogHost = __esm(async () => {
513242
513322
  init_shallow2();
513243
513323
  init_theme();
@@ -513249,7 +513329,7 @@ var init_DialogHost = __esm(async () => {
513249
513329
  init_AlertDialog(),
513250
513330
  init_ConfirmDialog()
513251
513331
  ]);
513252
- import_react164 = __toESM(require_react(), 1);
513332
+ import_react165 = __toESM(require_react(), 1);
513253
513333
  });
513254
513334
 
513255
513335
  // src/hearth/claim.ts
@@ -513354,9 +513434,9 @@ function ShutdownSplash({
513354
513434
  height
513355
513435
  }) {
513356
513436
  const shortId = sessionId?.slice(0, 8);
513357
- const [tick, setTick] = import_react166.useState(0);
513437
+ const [tick, setTick] = import_react167.useState(0);
513358
513438
  const { width: termWidth } = useTerminalDimensions();
513359
- import_react166.useEffect(() => {
513439
+ import_react167.useEffect(() => {
513360
513440
  const timer = setInterval(() => setTick((t3) => t3 + 1), 80);
513361
513441
  return () => clearInterval(timer);
513362
513442
  }, []);
@@ -513558,12 +513638,12 @@ function App({
513558
513638
  const renderer2 = useRenderer();
513559
513639
  const { height: termHeight, width: termWidth } = useTerminalDimensions();
513560
513640
  const t2 = useTheme();
513561
- const [providerStatuses, setProviderStatuses] = import_react166.useState(() => {
513641
+ const [providerStatuses, setProviderStatuses] = import_react167.useState(() => {
513562
513642
  return getCachedProviderStatuses() ?? bootProviders;
513563
513643
  });
513564
- const [shutdownPhase, setShutdownPhase] = import_react166.useState(-1);
513565
- const savedSessionIdRef = import_react166.useRef(null);
513566
- import_react166.useEffect(() => {
513644
+ const [shutdownPhase, setShutdownPhase] = import_react167.useState(-1);
513645
+ const savedSessionIdRef = import_react167.useRef(null);
513646
+ import_react167.useEffect(() => {
513567
513647
  const stdin2 = process.stdin;
513568
513648
  const originalRead = stdin2.read.bind(stdin2);
513569
513649
  const patchedRead = (size) => {
@@ -513586,16 +513666,16 @@ function App({
513586
513666
  stdin2.read = originalRead;
513587
513667
  };
513588
513668
  }, []);
513589
- const copyToClipboard3 = import_react166.useCallback((text4) => {
513669
+ const copyToClipboard3 = import_react167.useCallback((text4) => {
513590
513670
  if (!renderer2.copyToClipboardOSC52(text4))
513591
513671
  copyOsc52(text4);
513592
513672
  copyToClipboard2(text4);
513593
513673
  }, [renderer2]);
513594
- import_react166.useEffect(() => {
513674
+ import_react167.useEffect(() => {
513595
513675
  setProviderStatuses(getCachedProviderStatuses() ?? bootProviders);
513596
513676
  }, [bootProviders]);
513597
- import_react166.useEffect(() => subscribeProviderStatuses(setProviderStatuses), []);
513598
- import_react166.useEffect(() => {
513677
+ import_react167.useEffect(() => subscribeProviderStatuses(setProviderStatuses), []);
513678
+ import_react167.useEffect(() => {
513599
513679
  if (IS_WIN)
513600
513680
  return;
513601
513681
  const onSelection = (sel) => {
@@ -513613,28 +513693,28 @@ function App({
513613
513693
  onMouseDown: onRootMouseDown,
513614
513694
  onMouseUp: onRootMouseUp
513615
513695
  } = useCopySelection();
513616
- import_react166.useEffect(() => {
513696
+ import_react167.useEffect(() => {
513617
513697
  fetchOpenRouterMetadata();
513618
513698
  }, []);
513619
- const [globalConfig2, setGlobalConfig] = import_react166.useState(config2);
513620
- const [projConfig, setProjConfig] = import_react166.useState(projectConfig ?? null);
513621
- const [routerScope, setRouterScope] = import_react166.useState(() => projectConfig && ("taskRouter" in projectConfig) ? "project" : "global");
513622
- const modelScope = import_react166.useMemo(() => projConfig && ("defaultModel" in projConfig) ? "project" : "global", [projConfig]);
513623
- const effectiveConfig = import_react166.useMemo(() => mergeConfigs(globalConfig2, projConfig), [globalConfig2, projConfig]);
513699
+ const [globalConfig2, setGlobalConfig] = import_react167.useState(config2);
513700
+ const [projConfig, setProjConfig] = import_react167.useState(projectConfig ?? null);
513701
+ const [routerScope, setRouterScope] = import_react167.useState(() => projectConfig && ("taskRouter" in projectConfig) ? "project" : "global");
513702
+ const modelScope = import_react167.useMemo(() => projConfig && ("defaultModel" in projConfig) ? "project" : "global", [projConfig]);
513703
+ const effectiveConfig = import_react167.useMemo(() => mergeConfigs(globalConfig2, projConfig), [globalConfig2, projConfig]);
513624
513704
  const { focusMode, editorOpen, toggleEditor, openEditor, closeEditor, focusChat, focusEditor } = useEditorFocus();
513625
- const [editorVisible, setEditorVisible] = import_react166.useState(false);
513705
+ const [editorVisible, setEditorVisible] = import_react167.useState(false);
513626
513706
  const tabMgr = useTabs((survivingIds) => {
513627
513707
  const sm = sessionManagerRef.current;
513628
513708
  const sid = getAppSessionId();
513629
513709
  if (sm && sid)
513630
513710
  sm.pruneTabsNotIn(sid, survivingIds).catch(() => {});
513631
513711
  });
513632
- const tabMgrRef = import_react166.useRef(tabMgr);
513712
+ const tabMgrRef = import_react167.useRef(tabMgr);
513633
513713
  tabMgrRef.current = tabMgr;
513634
- const sessionManagerRef = import_react166.useRef(null);
513635
- const hasTabBarRef = import_react166.useRef(false);
513714
+ const sessionManagerRef = import_react167.useRef(null);
513715
+ const hasTabBarRef = import_react167.useRef(false);
513636
513716
  hasTabBarRef.current = tabMgr.tabCount > 1;
513637
- const editorSplitRef = import_react166.useRef(60);
513717
+ const editorSplitRef = import_react167.useRef(60);
513638
513718
  const {
513639
513719
  ready: nvimReady,
513640
513720
  ptyWrite,
@@ -513650,8 +513730,8 @@ function App({
513650
513730
  openFile: nvimOpen,
513651
513731
  error: nvimError
513652
513732
  } = useNeovim(true, effectiveConfig.nvimPath, effectiveConfig.nvimConfig, closeEditor, hasTabBarRef.current, editorSplitRef.current);
513653
- const pendingEditorFileRef = import_react166.useRef(null);
513654
- import_react166.useEffect(() => {
513733
+ const pendingEditorFileRef = import_react167.useRef(null);
513734
+ import_react167.useEffect(() => {
513655
513735
  if (nvimReady && pendingEditorFileRef.current) {
513656
513736
  const file2 = pendingEditorFileRef.current;
513657
513737
  pendingEditorFileRef.current = null;
@@ -513660,7 +513740,7 @@ function App({
513660
513740
  });
513661
513741
  }
513662
513742
  }, [nvimReady, nvimOpen]);
513663
- const openEditorWithFile = import_react166.useCallback((file2) => {
513743
+ const openEditorWithFile = import_react167.useCallback((file2) => {
513664
513744
  if (editorOpen && nvimReady) {
513665
513745
  nvimOpen(file2).catch((err2) => {
513666
513746
  logBackgroundError("editor", `failed to open ${file2}: ${err2 instanceof Error ? err2.message : String(err2)}`);
@@ -513670,18 +513750,18 @@ function App({
513670
513750
  openEditor();
513671
513751
  }
513672
513752
  }, [editorOpen, nvimReady, nvimOpen, openEditor]);
513673
- import_react166.useEffect(() => {
513753
+ import_react167.useEffect(() => {
513674
513754
  setEditorRequestCallback((file2) => {
513675
513755
  if (file2)
513676
513756
  openEditorWithFile(file2);
513677
513757
  });
513678
513758
  return () => setEditorRequestCallback(null);
513679
513759
  }, [openEditorWithFile]);
513680
- import_react166.useEffect(() => {
513760
+ import_react167.useEffect(() => {
513681
513761
  if (editorOpen)
513682
513762
  setEditorVisible(true);
513683
513763
  }, [editorOpen]);
513684
- import_react166.useEffect(() => {
513764
+ import_react167.useEffect(() => {
513685
513765
  const activity = tabMgr.getTabActivity(tabMgr.activeTabId);
513686
513766
  const label = tabMgr.activeTab.label;
513687
513767
  const truncated = label.length > 40 ? `${label.slice(0, 37)}\u2026` : label;
@@ -513693,10 +513773,10 @@ function App({
513693
513773
  const reasoningExpanded = useUIStore((s2) => s2.reasoningExpanded);
513694
513774
  const codeExpanded = useUIStore((s2) => s2.codeExpanded);
513695
513775
  const hasTabBar = tabMgr.tabCount > 1;
513696
- import_react166.useEffect(() => {
513776
+ import_react167.useEffect(() => {
513697
513777
  renderer2.requestRender();
513698
513778
  }, [editorOpen, editorVisible, focusMode, reasoningExpanded, codeExpanded, hasTabBar, renderer2]);
513699
- const handleEditorClosed = import_react166.useCallback(() => {
513779
+ const handleEditorClosed = import_react167.useCallback(() => {
513700
513780
  setEditorVisible(false);
513701
513781
  }, []);
513702
513782
  useEditorInput({
@@ -513739,24 +513819,24 @@ function App({
513739
513819
  const modalMemoryBrowser = useUIStore((s2) => s2.modals.memoryBrowser);
513740
513820
  const modalUiDemo = useUIStore((s2) => s2.modals.uiDemo);
513741
513821
  const toolsState = useToolsStore();
513742
- import_react166.useEffect(() => {
513822
+ import_react167.useEffect(() => {
513743
513823
  toolsState.initFromConfig(effectiveConfig.disabledTools);
513744
513824
  }, [effectiveConfig.disabledTools, toolsState.initFromConfig]);
513745
- import_react166.useEffect(() => {
513825
+ import_react167.useEffect(() => {
513746
513826
  saveGlobalConfig({ disabledTools: [...toolsState.disabledTools] });
513747
513827
  }, [toolsState.disabledTools]);
513748
513828
  const statusDashboardTab = useUIStore((s2) => s2.statusDashboardTab);
513749
513829
  const modalRepoMapStatus = useUIStore((s2) => s2.modals.repoMapStatus);
513750
513830
  const isModalOpen = useUIStore(selectIsAnyModalOpen);
513751
- const wizardOpenedLlm = import_react166.useRef(false);
513752
- const closerCache2 = import_react166.useRef({});
513831
+ const wizardOpenedLlm = import_react167.useRef(false);
513832
+ const closerCache2 = import_react167.useRef({});
513753
513833
  const getCloser2 = (name30) => closerCache2.current[name30] ??= () => useUIStore.getState().closeModal(name30);
513754
513834
  useVersionCheck();
513755
513835
  const versionCurrent = useVersionStore((s2) => s2.current);
513756
513836
  const versionLatest = useVersionStore((s2) => s2.latest);
513757
513837
  const versionUpdateAvailable = useVersionStore((s2) => s2.updateAvailable);
513758
- const updateModalShown = import_react166.useRef(false);
513759
- import_react166.useEffect(() => {
513838
+ const updateModalShown = import_react167.useRef(false);
513839
+ import_react167.useEffect(() => {
513760
513840
  if (!versionUpdateAvailable || !versionLatest || updateModalShown.current)
513761
513841
  return;
513762
513842
  if (isDismissed(versionLatest))
@@ -513770,7 +513850,7 @@ function App({
513770
513850
  }, 500);
513771
513851
  return () => clearTimeout(timer);
513772
513852
  }, [versionUpdateAvailable, versionLatest]);
513773
- import_react166.useEffect(() => {
513853
+ import_react167.useEffect(() => {
513774
513854
  if (getMissingRequired().length > 0) {
513775
513855
  useUIStore.getState().openModal("setup");
513776
513856
  } else if (forceWizard || !config2.onboardingComplete && !resumeSessionId) {
@@ -513778,7 +513858,7 @@ function App({
513778
513858
  }
513779
513859
  }, [config2.onboardingComplete, forceWizard, resumeSessionId]);
513780
513860
  const cwd2 = getCwd();
513781
- const saveToScope = import_react166.useCallback((patch, toScope, fromScope) => {
513861
+ const saveToScope = import_react167.useCallback((patch, toScope, fromScope) => {
513782
513862
  if (toScope === "global") {
513783
513863
  saveGlobalConfig(patch);
513784
513864
  setGlobalConfig((prev) => applyConfigPatch(prev, patch));
@@ -513798,12 +513878,12 @@ function App({
513798
513878
  }
513799
513879
  }
513800
513880
  }, [cwd2]);
513801
- const detectScope = import_react166.useCallback((key3) => {
513881
+ const detectScope = import_react167.useCallback((key3) => {
513802
513882
  if (projConfig && key3 in projConfig)
513803
513883
  return "project";
513804
513884
  return "global";
513805
513885
  }, [projConfig]);
513806
- import_react166.useEffect(() => {
513886
+ import_react167.useEffect(() => {
513807
513887
  initForbidden(cwd2);
513808
513888
  for (const cfg of PROVIDER_CONFIGS) {
513809
513889
  if (cfg.grouped)
@@ -513812,20 +513892,20 @@ function App({
513812
513892
  fetchProviderModels(cfg.id).catch(() => {});
513813
513893
  }
513814
513894
  }, []);
513815
- const contextManager = import_react166.useMemo(() => preloadedContextManager ?? new ContextManager(cwd2), [cwd2, preloadedContextManager]);
513816
- const sessionManager = import_react166.useMemo(() => new SessionManager(cwd2), [cwd2]);
513895
+ const contextManager = import_react167.useMemo(() => preloadedContextManager ?? new ContextManager(cwd2), [cwd2, preloadedContextManager]);
513896
+ const sessionManager = import_react167.useMemo(() => new SessionManager(cwd2), [cwd2]);
513817
513897
  sessionManagerRef.current = sessionManager;
513818
- const mcpManager = import_react166.useMemo(() => getMCPManager(), []);
513819
- import_react166.useEffect(() => {
513898
+ const mcpManager = import_react167.useMemo(() => getMCPManager(), []);
513899
+ import_react167.useEffect(() => {
513820
513900
  mcpManager.connectAll(effectiveConfig.mcpServers ?? []);
513821
513901
  }, [mcpManager, effectiveConfig.mcpServers]);
513822
- import_react166.useEffect(() => {
513902
+ import_react167.useEffect(() => {
513823
513903
  return () => {
513824
513904
  disposeMCPManager();
513825
513905
  };
513826
513906
  }, []);
513827
513907
  const git = useGitStatus(cwd2);
513828
- const [forgeMode, setForgeModeHeader] = import_react166.useState("default");
513908
+ const [forgeMode, setForgeModeHeader] = import_react167.useState("default");
513829
513909
  const modeLabel = getModeLabel(forgeMode);
513830
513910
  const modeColor = getModeColor(forgeMode);
513831
513911
  useConfigSync({
@@ -513839,7 +513919,7 @@ function App({
513839
513919
  cursorCol,
513840
513920
  visualSelection
513841
513921
  });
513842
- const handleSuspend = import_react166.useCallback(async (opts) => {
513922
+ const handleSuspend = import_react167.useCallback(async (opts) => {
513843
513923
  useUIStore.getState().setSuspended(true);
513844
513924
  await new Promise((r5) => setTimeout(r5, 50));
513845
513925
  const result = await suspendAndRun({ ...opts, cwd: cwd2 });
@@ -513859,29 +513939,29 @@ function App({
513859
513939
  git.refresh();
513860
513940
  }, [cwd2, git]);
513861
513941
  editorSplitRef.current = editorSplit;
513862
- const sharedResources = import_react166.useMemo(() => ({
513942
+ const sharedResources = import_react167.useMemo(() => ({
513863
513943
  ...contextManager.getSharedResources(),
513864
513944
  workspaceCoordinator: getWorkspaceCoordinator()
513865
513945
  }), [contextManager]);
513866
- const workspaceSnapshotRef = import_react166.useRef(null);
513946
+ const workspaceSnapshotRef = import_react167.useRef(null);
513867
513947
  workspaceSnapshotRef.current = () => ({
513868
513948
  tabStates: tabMgr.getAllTabStates(),
513869
513949
  activeTabId: tabMgr.activeTabId
513870
513950
  });
513871
- const addSystemMessage = import_react166.useCallback((msg) => {
513951
+ const addSystemMessage = import_react167.useCallback((msg) => {
513872
513952
  const activeChat = tabMgrRef.current?.getActiveChat();
513873
513953
  activeChat?.setMessages((prev) => [
513874
513954
  ...prev,
513875
513955
  { id: crypto.randomUUID(), role: "system", content: msg, timestamp: Date.now() }
513876
513956
  ]);
513877
513957
  }, []);
513878
- const refreshGit = import_react166.useCallback(() => {
513958
+ const refreshGit = import_react167.useCallback(() => {
513879
513959
  git.refresh();
513880
513960
  }, [git]);
513881
- const shutdownPhaseRef = import_react166.useRef(shutdownPhase);
513961
+ const shutdownPhaseRef = import_react167.useRef(shutdownPhase);
513882
513962
  shutdownPhaseRef.current = shutdownPhase;
513883
- const exitTimersRef = import_react166.useRef([]);
513884
- const handleCycleTab = import_react166.useCallback((direction) => {
513963
+ const exitTimersRef = import_react167.useRef([]);
513964
+ const handleCycleTab = import_react167.useCallback((direction) => {
513885
513965
  if (tabMgr.tabCount <= 1)
513886
513966
  return;
513887
513967
  if (direction === 1)
@@ -513889,7 +513969,7 @@ function App({
513889
513969
  else
513890
513970
  tabMgr.prevTab();
513891
513971
  }, [tabMgr.tabCount, tabMgr.nextTab, tabMgr.prevTab]);
513892
- const handleExit = import_react166.useCallback(() => {
513972
+ const handleExit = import_react167.useCallback(() => {
513893
513973
  if (shutdownPhaseRef.current >= 0)
513894
513974
  return;
513895
513975
  setShutdownPhase(0);
@@ -513968,8 +514048,8 @@ function App({
513968
514048
  }, 300);
513969
514049
  }, 250);
513970
514050
  }, [cwd2, sessionManager, contextManager, renderer2]);
513971
- const hasRestoredRef = import_react166.useRef(false);
513972
- import_react166.useEffect(() => {
514051
+ const hasRestoredRef = import_react167.useRef(false);
514052
+ import_react167.useEffect(() => {
513973
514053
  if (hasRestoredRef.current || !resumeSessionId)
513974
514054
  return;
513975
514055
  hasRestoredRef.current = true;
@@ -514004,8 +514084,8 @@ function App({
514004
514084
  }, 100);
514005
514085
  }
514006
514086
  }, []);
514007
- const hasBootedHearthRef = import_react166.useRef(false);
514008
- import_react166.useEffect(() => {
514087
+ const hasBootedHearthRef = import_react167.useRef(false);
514088
+ import_react167.useEffect(() => {
514009
514089
  if (hasBootedHearthRef.current)
514010
514090
  return;
514011
514091
  hasBootedHearthRef.current = true;
@@ -514220,9 +514300,9 @@ function App({
514220
514300
  } catch {}
514221
514301
  })();
514222
514302
  }, []);
514223
- const [activeModelForHeader, setActiveModelForHeader] = import_react166.useState(effectiveConfig.defaultModel);
514224
- const activeChatRef = import_react166.useRef(null);
514225
- import_react166.useEffect(() => {
514303
+ const [activeModelForHeader, setActiveModelForHeader] = import_react167.useState(effectiveConfig.defaultModel);
514304
+ const activeChatRef = import_react167.useRef(null);
514305
+ import_react167.useEffect(() => {
514226
514306
  const chat = tabMgr.getActiveChat();
514227
514307
  activeChatRef.current = chat;
514228
514308
  if (chat) {
@@ -514232,7 +514312,7 @@ function App({
514232
514312
  setExitSessionId(hasContent ? getAppSessionId() : null);
514233
514313
  }
514234
514314
  }, [tabMgr.activeTabId]);
514235
- import_react166.useEffect(() => {
514315
+ import_react167.useEffect(() => {
514236
514316
  if (tabMgr.tabCount <= 1)
514237
514317
  return;
514238
514318
  (async () => {
@@ -514250,7 +514330,7 @@ function App({
514250
514330
  } catch {}
514251
514331
  })();
514252
514332
  }, [tabMgr.tabCount, tabMgr.activeTabId]);
514253
- const { displayProvider, displayModel, isGateway, isProxy } = import_react166.useMemo(() => {
514333
+ const { displayProvider, displayModel, isGateway, isProxy } = import_react167.useMemo(() => {
514254
514334
  const model = activeModelForHeader;
514255
514335
  if (model === "none") {
514256
514336
  return {
@@ -514281,12 +514361,12 @@ function App({
514281
514361
  isProxy: false
514282
514362
  };
514283
514363
  }, [activeModelForHeader]);
514284
- import_react166.useEffect(() => {
514364
+ import_react167.useEffect(() => {
514285
514365
  if (nvimError && nvimError !== "neovim-not-found") {
514286
514366
  addSystemMessage(`Neovim error: ${nvimError}`);
514287
514367
  }
514288
514368
  }, [nvimError]);
514289
- import_react166.useEffect(() => {
514369
+ import_react167.useEffect(() => {
514290
514370
  const memMgr = contextManager.getMemoryManager();
514291
514371
  const { project: project2, global: global2 } = memMgr.getLegacyBackupPaths();
514292
514372
  const parts2 = [];
@@ -514298,7 +514378,7 @@ function App({
514298
514378
  addSystemMessage(`Legacy memory schema detected \u2014 your old DB was preserved at ${parts2.join(", ")}. Phase 1 schema is now active in .soulforge/memory.db.`);
514299
514379
  }
514300
514380
  }, []);
514301
- const handleNewSession = import_react166.useCallback(async () => {
514381
+ const handleNewSession = import_react167.useCallback(async () => {
514302
514382
  const activeChat = tabMgrRef.current?.getActiveChat();
514303
514383
  const hasContent = activeChat?.messages.some((m6) => m6.role === "user" || m6.role === "assistant");
514304
514384
  if (hasContent && activeChat) {
@@ -514347,7 +514427,7 @@ function App({
514347
514427
  cpStore.skipCleanup(tab.id);
514348
514428
  restart();
514349
514429
  }, [cwd2, sessionManager]);
514350
- const handleTabCommand = import_react166.useCallback((input, chat) => {
514430
+ const handleTabCommand = import_react167.useCallback((input, chat) => {
514351
514431
  const cmd = input.trim().toLowerCase().split(/\s+/)[0] ?? "";
514352
514432
  const twoWord = input.trim().toLowerCase().split(/\s+/).slice(0, 2).join(" ");
514353
514433
  if (chat.isLoading && (ABORT_ON_LOADING.has(cmd) || ABORT_ON_LOADING.has(twoWord))) {
@@ -514484,7 +514564,7 @@ function App({
514484
514564
  handleNewSession,
514485
514565
  effectiveConfig.watchdog
514486
514566
  ]);
514487
- const closeLlmSelector = import_react166.useCallback(() => {
514567
+ const closeLlmSelector = import_react167.useCallback(() => {
514488
514568
  const wasPickingSlot = useUIStore.getState().routerSlotPicking != null;
514489
514569
  const wasFallbackForModel = useUIStore.getState().fallbackForModel != null;
514490
514570
  const wasFromWizard = wizardOpenedLlm.current;
@@ -514498,12 +514578,12 @@ function App({
514498
514578
  useUIStore.getState().openModal("firstRunWizard");
514499
514579
  }
514500
514580
  }, []);
514501
- const closeInfoPopup = import_react166.useCallback(() => {
514581
+ const closeInfoPopup = import_react167.useCallback(() => {
514502
514582
  const cfg = useUIStore.getState().infoPopupConfig;
514503
514583
  useUIStore.getState().closeInfoPopup();
514504
514584
  cfg?.onClose?.();
514505
514585
  }, []);
514506
- const onGitMenuCommit = import_react166.useCallback(() => {
514586
+ const onGitMenuCommit = import_react167.useCallback(() => {
514507
514587
  useUIStore.getState().closeModal("gitMenu");
514508
514588
  useUIStore.getState().openModal("gitCommit");
514509
514589
  }, []);
@@ -514516,7 +514596,7 @@ function App({
514516
514596
  renderer: renderer2,
514517
514597
  copySelection,
514518
514598
  activeChatRef,
514519
- cycleMode: import_react166.useCallback(() => {
514599
+ cycleMode: import_react167.useCallback(() => {
514520
514600
  const chat = tabMgrRef.current?.getActiveChat();
514521
514601
  if (chat) {
514522
514602
  const next = chat.cycleMode();
@@ -515149,7 +515229,7 @@ function App({
515149
515229
  ]
515150
515230
  }, undefined, true, undefined, this);
515151
515231
  }
515152
- var import_react166, ABORT_ON_LOADING, DEFAULT_TASK_ROUTER, SHUTDOWN_STEPS, KITTY_PROTOCOL_RESPONSE_RE;
515232
+ var import_react167, ABORT_ON_LOADING, DEFAULT_TASK_ROUTER, SHUTDOWN_STEPS, KITTY_PROTOCOL_RESPONSE_RE;
515153
515233
  var init_App = __esm(async () => {
515154
515234
  init_shallow2();
515155
515235
  init_config2();
@@ -515233,7 +515313,7 @@ var init_App = __esm(async () => {
515233
515313
  init_MemoryBrowser(),
515234
515314
  init_DialogHost()
515235
515315
  ]);
515236
- import_react166 = __toESM(require_react(), 1);
515316
+ import_react167 = __toESM(require_react(), 1);
515237
515317
  startMemoryPoll();
515238
515318
  ABORT_ON_LOADING = new Set([
515239
515319
  "/clear",