@proxysoul/soulforge 2.20.18 → 2.20.20

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.20",
72642
72642
  description: "Graph-powered code intelligence \u2014 multi-agent coding with codebase-aware AI",
72643
72643
  repository: {
72644
72644
  type: "git",
@@ -73163,6 +73163,11 @@ function getCompatReasoningBody(modelId, config2) {
73163
73163
  if (g)
73164
73164
  effort = g === "off" ? "off" : g;
73165
73165
  }
73166
+ if (provider === "llmgateway") {
73167
+ const l = config2.performance?.llmgatewayReasoningEffort;
73168
+ if (l && l !== "off")
73169
+ effort = l;
73170
+ }
73166
73171
  if (!effort || effort === "off") {
73167
73172
  const e = config2.performance?.effort;
73168
73173
  if (e && e !== "off") {
@@ -101580,6 +101585,269 @@ var init_lifecycle = __esm(() => {
101580
101585
  VERSION_CACHE_TTL = 10 * 60 * 1000;
101581
101586
  });
101582
101587
 
101588
+ // src/core/llm/providers/recover-leaked-tool-calls.ts
101589
+ function invokeRe() {
101590
+ return /<(?:antml:)?invoke\s+name="([^"]+)"\s*>([\s\S]*?)<\/(?:antml:)?invoke>/g;
101591
+ }
101592
+ function paramRe() {
101593
+ return /<(?:antml:)?parameter\s+name="([^"]+)"\s*>([\s\S]*?)<\/(?:antml:)?parameter>/g;
101594
+ }
101595
+ function coerce(raw) {
101596
+ const trimmed = raw.trim();
101597
+ if (trimmed === "")
101598
+ return "";
101599
+ try {
101600
+ return JSON.parse(trimmed);
101601
+ } catch {
101602
+ return raw;
101603
+ }
101604
+ }
101605
+ function buildArgs(body2) {
101606
+ const args2 = {};
101607
+ for (const m of body2.matchAll(paramRe())) {
101608
+ const name30 = m[1];
101609
+ const raw = m[2];
101610
+ if (name30 === undefined || raw === undefined)
101611
+ continue;
101612
+ args2[name30] = coerce(raw);
101613
+ }
101614
+ return JSON.stringify(args2);
101615
+ }
101616
+ function makeToolCall(name30, body2) {
101617
+ return {
101618
+ type: "tool-call",
101619
+ toolCallId: `leak_${crypto.randomUUID()}`,
101620
+ toolName: name30,
101621
+ input: buildArgs(body2)
101622
+ };
101623
+ }
101624
+ function parseInvokeBlock(block, valid) {
101625
+ const calls = [];
101626
+ for (const m of block.matchAll(invokeRe())) {
101627
+ const name30 = m[1];
101628
+ const body2 = m[2];
101629
+ if (name30 === undefined || body2 === undefined || !valid.has(name30))
101630
+ continue;
101631
+ calls.push(makeToolCall(name30, body2));
101632
+ }
101633
+ return calls;
101634
+ }
101635
+ function validToolNames(params) {
101636
+ const names = new Set;
101637
+ for (const tool4 of params.tools ?? []) {
101638
+ if (tool4.type === "function")
101639
+ names.add(tool4.name);
101640
+ }
101641
+ return names;
101642
+ }
101643
+ function buildLeakTransform(valid) {
101644
+ let mode = "pass";
101645
+ let tail = "";
101646
+ let capture = "";
101647
+ let textId;
101648
+ let textOpen = false;
101649
+ let sawRealToolCall = false;
101650
+ const recovered = [];
101651
+ const suppressed = [];
101652
+ const emitText = (controller, text2) => {
101653
+ if (!text2)
101654
+ return;
101655
+ if (textOpen && textId) {
101656
+ controller.enqueue({ type: "text-delta", id: textId, delta: text2 });
101657
+ } else {
101658
+ const id = `leak_${crypto.randomUUID()}`;
101659
+ controller.enqueue({ type: "text-start", id });
101660
+ controller.enqueue({ type: "text-delta", id, delta: text2 });
101661
+ controller.enqueue({ type: "text-end", id });
101662
+ }
101663
+ };
101664
+ const holdLen = (buf) => {
101665
+ const lt = buf.lastIndexOf("<");
101666
+ if (lt === -1)
101667
+ return 0;
101668
+ const suffix = buf.slice(lt);
101669
+ for (const lit of SENTINEL_LITERALS) {
101670
+ if (suffix.length < lit.length && lit.startsWith(suffix))
101671
+ return suffix.length;
101672
+ }
101673
+ return 0;
101674
+ };
101675
+ const tryClose = (controller) => {
101676
+ const isWrapper = /^<(?:antml:)?function_calls\b/.test(capture);
101677
+ const closer = isWrapper ? /<\/(?:antml:)?function_calls>/ : /<\/(?:antml:)?invoke>/;
101678
+ const m = closer.exec(capture);
101679
+ if (!m)
101680
+ return null;
101681
+ const end = m.index + m[0].length;
101682
+ const block = capture.slice(0, end);
101683
+ const rest = capture.slice(end);
101684
+ const calls = parseInvokeBlock(block, valid);
101685
+ if (calls.length > 0) {
101686
+ recovered.push(...calls);
101687
+ suppressed.push(block);
101688
+ } else {
101689
+ emitText(controller, block);
101690
+ }
101691
+ mode = "pass";
101692
+ capture = "";
101693
+ return rest;
101694
+ };
101695
+ const pass = (controller, text2) => {
101696
+ let buf = tail + text2;
101697
+ tail = "";
101698
+ while (true) {
101699
+ const m = SENTINEL.exec(buf);
101700
+ if (!m) {
101701
+ const hold = holdLen(buf);
101702
+ emitText(controller, buf.slice(0, buf.length - hold));
101703
+ tail = buf.slice(buf.length - hold);
101704
+ return;
101705
+ }
101706
+ emitText(controller, buf.slice(0, m.index));
101707
+ mode = "capture";
101708
+ capture = buf.slice(m.index);
101709
+ const rest = tryClose(controller);
101710
+ if (rest === null)
101711
+ return;
101712
+ buf = rest;
101713
+ }
101714
+ };
101715
+ const flushPending = (controller) => {
101716
+ if (mode === "capture") {
101717
+ emitText(controller, capture);
101718
+ capture = "";
101719
+ mode = "pass";
101720
+ }
101721
+ if (tail) {
101722
+ emitText(controller, tail);
101723
+ tail = "";
101724
+ }
101725
+ };
101726
+ return new TransformStream({
101727
+ transform(part, controller) {
101728
+ switch (part.type) {
101729
+ case "text-start":
101730
+ textId = part.id;
101731
+ textOpen = true;
101732
+ controller.enqueue(part);
101733
+ return;
101734
+ case "text-delta":
101735
+ if (mode === "capture") {
101736
+ capture += part.delta;
101737
+ const rest = tryClose(controller);
101738
+ if (rest !== null && rest)
101739
+ pass(controller, rest);
101740
+ } else {
101741
+ pass(controller, part.delta);
101742
+ }
101743
+ return;
101744
+ case "text-end":
101745
+ flushPending(controller);
101746
+ controller.enqueue(part);
101747
+ textOpen = false;
101748
+ return;
101749
+ case "tool-call":
101750
+ case "tool-input-start":
101751
+ sawRealToolCall = true;
101752
+ flushPending(controller);
101753
+ if (recovered.length > 0) {
101754
+ emitText(controller, suppressed.join(""));
101755
+ recovered.length = 0;
101756
+ suppressed.length = 0;
101757
+ }
101758
+ controller.enqueue(part);
101759
+ return;
101760
+ case "finish":
101761
+ flushPending(controller);
101762
+ if (recovered.length > 0 && !sawRealToolCall) {
101763
+ for (const call of recovered)
101764
+ controller.enqueue(call);
101765
+ controller.enqueue({
101766
+ ...part,
101767
+ finishReason: { ...part.finishReason, unified: "tool-calls" }
101768
+ });
101769
+ } else {
101770
+ controller.enqueue(part);
101771
+ }
101772
+ return;
101773
+ default:
101774
+ controller.enqueue(part);
101775
+ }
101776
+ }
101777
+ });
101778
+ }
101779
+ function recoverGenerate(content, valid) {
101780
+ if (content.some((c) => c.type === "tool-call"))
101781
+ return { content, recovered: false };
101782
+ const out2 = [];
101783
+ const calls = [];
101784
+ for (const part of content) {
101785
+ if (part.type !== "text") {
101786
+ out2.push(part);
101787
+ continue;
101788
+ }
101789
+ let cleaned = "";
101790
+ let last = 0;
101791
+ let found = false;
101792
+ for (const m of part.text.matchAll(invokeRe())) {
101793
+ const name30 = m[1];
101794
+ const body2 = m[2];
101795
+ const whole = m[0];
101796
+ const idx = m.index;
101797
+ if (name30 === undefined || body2 === undefined || idx === undefined || !valid.has(name30)) {
101798
+ continue;
101799
+ }
101800
+ found = true;
101801
+ calls.push(makeToolCall(name30, body2));
101802
+ cleaned += part.text.slice(last, idx);
101803
+ last = idx + whole.length;
101804
+ }
101805
+ if (!found) {
101806
+ out2.push(part);
101807
+ continue;
101808
+ }
101809
+ cleaned += part.text.slice(last);
101810
+ cleaned = cleaned.replace(/<\/?(?:antml:)?function_calls>/g, "").trim();
101811
+ if (cleaned.length > 0)
101812
+ out2.push({ ...part, text: cleaned });
101813
+ }
101814
+ if (calls.length === 0)
101815
+ return { content, recovered: false };
101816
+ out2.push(...calls);
101817
+ return { content: out2, recovered: true };
101818
+ }
101819
+ function recoverLeakedToolCallsMiddleware() {
101820
+ return {
101821
+ specificationVersion: "v3",
101822
+ async wrapStream({ doStream, params }) {
101823
+ const valid = validToolNames(params);
101824
+ const result = await doStream();
101825
+ if (valid.size === 0)
101826
+ return result;
101827
+ return { ...result, stream: result.stream.pipeThrough(buildLeakTransform(valid)) };
101828
+ },
101829
+ async wrapGenerate({ doGenerate, params }) {
101830
+ const valid = validToolNames(params);
101831
+ const result = await doGenerate();
101832
+ if (valid.size === 0)
101833
+ return result;
101834
+ const { content, recovered } = recoverGenerate(result.content, valid);
101835
+ if (!recovered)
101836
+ return result;
101837
+ return {
101838
+ ...result,
101839
+ content,
101840
+ finishReason: { ...result.finishReason, unified: "tool-calls" }
101841
+ };
101842
+ }
101843
+ };
101844
+ }
101845
+ var SENTINEL, SENTINEL_LITERALS;
101846
+ var init_recover_leaked_tool_calls = __esm(() => {
101847
+ SENTINEL = /<(?:antml:)?(?:invoke\b|function_calls\b)/;
101848
+ SENTINEL_LITERALS = ["<invoke", "<function_calls", "<invoke", "<function_calls"];
101849
+ });
101850
+
101583
101851
  // node_modules/@msgpack/msgpack/dist/utils/int.js
101584
101852
  var require_int = __commonJS((exports) => {
101585
101853
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -119682,6 +119950,7 @@ var init_types2 = __esm(() => {
119682
119950
  ".scala": "scala",
119683
119951
  ".sc": "scala",
119684
119952
  ".lua": "lua",
119953
+ ".luau": "lua",
119685
119954
  ".ex": "elixir",
119686
119955
  ".exs": "elixir",
119687
119956
  ".dart": "dart",
@@ -119959,7 +120228,10 @@ var init_server_registry = __esm(() => {
119959
120228
  ],
119960
120229
  go: [{ command: "gopls", args: ["serve"] }],
119961
120230
  rust: [{ command: "rust-analyzer", args: [] }],
119962
- lua: [{ command: "lua-language-server", args: [] }],
120231
+ lua: [
120232
+ { command: "lua-language-server", args: [] },
120233
+ { command: "luau-lsp", args: ["lsp"] }
120234
+ ],
119963
120235
  c: [{ command: "clangd", args: [] }],
119964
120236
  cpp: [{ command: "clangd", args: [] }],
119965
120237
  ruby: [{ command: "solargraph", args: ["stdio"] }],
@@ -409727,16 +409999,22 @@ var init_addons = __esm(() => {
409727
409999
  function isAnthropicModel(modelId) {
409728
410000
  return modelId.toLowerCase().startsWith("claude");
409729
410001
  }
410002
+ function leakRecoveryEnabled() {
410003
+ const v2 = process.env.SOULFORGE_PROXY_TOOL_RECOVERY;
410004
+ return v2 !== "0" && v2 !== "false";
410005
+ }
409730
410006
  var baseURL, GPT_55_INPUT_CONTEXT2 = 272000, proxy2;
409731
410007
  var init_proxy2 = __esm(() => {
409732
410008
  init_dist6();
409733
410009
  init_dist8();
410010
+ init_dist5();
409734
410011
  init_config2();
409735
410012
  init_key_resolver();
409736
410013
  init_lifecycle();
409737
410014
  init_compat_reasoning();
409738
410015
  init_context_windows();
409739
410016
  init_reasoning_fetch();
410017
+ init_recover_leaked_tool_calls();
409740
410018
  baseURL = process.env.PROXY_API_URL || "http://127.0.0.1:8317/v1";
409741
410019
  proxy2 = {
409742
410020
  id: "proxy",
@@ -409748,7 +410026,12 @@ var init_proxy2 = __esm(() => {
409748
410026
  createModel(modelId) {
409749
410027
  const apiKey = getActiveProxyApiKey();
409750
410028
  if (isAnthropicModel(modelId)) {
409751
- return createAnthropic({ baseURL, apiKey, fetch: withSessionHeaders() })(modelId);
410029
+ const model = createAnthropic({
410030
+ baseURL,
410031
+ apiKey,
410032
+ fetch: withSessionHeaders()
410033
+ })(modelId);
410034
+ return leakRecoveryEnabled() ? wrapLanguageModel({ model, middleware: recoverLeakedToolCallsMiddleware() }) : model;
409752
410035
  }
409753
410036
  const reasoningBody = getCompatReasoningBody(`proxy/${modelId}`, loadConfig());
409754
410037
  const reasoningFetch = createSessionFetchWrapper(reasoningBody);
@@ -489402,6 +489685,15 @@ function fuzzyMatch2(pattern, target) {
489402
489685
  }
489403
489686
  if (pi < p4.length)
489404
489687
  return null;
489688
+ const strip = (s2) => s2.startsWith("/") ? s2.slice(1) : s2;
489689
+ const sp = strip(p4);
489690
+ const st2 = strip(t2);
489691
+ if (sp.length > 0 && st2.startsWith(sp)) {
489692
+ score += 100;
489693
+ if (st2.length === sp.length)
489694
+ score += 50;
489695
+ score -= st2.length;
489696
+ }
489405
489697
  return { entry: target, score, indices };
489406
489698
  }
489407
489699
  function fuzzyFilter(pattern, entries2, limit = 50) {
@@ -496625,12 +496917,84 @@ var init_CommandPalette = __esm(async () => {
496625
496917
  };
496626
496918
  });
496627
496919
 
496920
+ // src/hooks/useMarqueeScroll.ts
496921
+ function tickMarquee(state, maxPos, pauseTicks) {
496922
+ if (state.endPause > 0) {
496923
+ const nextEndPause = state.endPause - 1;
496924
+ return {
496925
+ scrollPos: nextEndPause === 0 ? 0 : state.scrollPos,
496926
+ startPause: state.startPause,
496927
+ endPause: nextEndPause
496928
+ };
496929
+ }
496930
+ if (state.scrollPos === 0 && state.startPause > 0) {
496931
+ return {
496932
+ scrollPos: 0,
496933
+ startPause: state.startPause - 1,
496934
+ endPause: 0
496935
+ };
496936
+ }
496937
+ if (state.scrollPos >= maxPos) {
496938
+ return {
496939
+ scrollPos: state.scrollPos,
496940
+ startPause: pauseTicks,
496941
+ endPause: pauseTicks
496942
+ };
496943
+ }
496944
+ return {
496945
+ scrollPos: state.scrollPos + 1,
496946
+ startPause: state.startPause,
496947
+ endPause: state.endPause
496948
+ };
496949
+ }
496950
+ function getMarqueeDisplayText(text4, maxWidth, active, scrollPos) {
496951
+ if (maxWidth <= 0) {
496952
+ return "";
496953
+ }
496954
+ if (active && text4.length > maxWidth) {
496955
+ return text4.slice(scrollPos, scrollPos + maxWidth);
496956
+ }
496957
+ if (text4.length > maxWidth) {
496958
+ return `${text4.slice(0, maxWidth - 1)}\u2026`;
496959
+ }
496960
+ return text4;
496961
+ }
496962
+ function useMarqueeScroll(text4, maxWidth, active) {
496963
+ const [scrollPos, setScrollPos] = import_react103.useState(0);
496964
+ const stateRef = import_react103.useRef({ scrollPos: 0, startPause: PAUSE_TICKS, endPause: 0 });
496965
+ import_react103.useEffect(() => {
496966
+ if (maxWidth <= 0) {
496967
+ stateRef.current = { scrollPos: 0, startPause: PAUSE_TICKS, endPause: 0 };
496968
+ setScrollPos(0);
496969
+ return;
496970
+ }
496971
+ if (!active || text4.length <= maxWidth) {
496972
+ stateRef.current = { scrollPos: 0, startPause: PAUSE_TICKS, endPause: 0 };
496973
+ setScrollPos(0);
496974
+ return;
496975
+ }
496976
+ stateRef.current = { scrollPos: 0, startPause: PAUSE_TICKS, endPause: 0 };
496977
+ const maxPos = text4.length - maxWidth;
496978
+ const timer = setInterval(() => {
496979
+ const next = tickMarquee(stateRef.current, maxPos, PAUSE_TICKS);
496980
+ stateRef.current = next;
496981
+ setScrollPos(next.scrollPos);
496982
+ }, SCROLL_INTERVAL);
496983
+ return () => clearInterval(timer);
496984
+ }, [active, text4, maxWidth]);
496985
+ return getMarqueeDisplayText(text4, maxWidth, active, scrollPos);
496986
+ }
496987
+ var import_react103, SCROLL_INTERVAL = 100, PAUSE_TICKS = 10;
496988
+ var init_useMarqueeScroll = __esm(() => {
496989
+ import_react103 = __toESM(require_react(), 1);
496990
+ });
496991
+
496628
496992
  // src/components/modals/CommandPicker.tsx
496629
496993
  import { TextAttributes as TextAttributes21 } from "@opentui/core";
496630
496994
  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) => {
496995
+ const [cursor3, setCursor] = import_react105.useState(0);
496996
+ const [scrollOffset, setScrollOffset] = import_react105.useState(0);
496997
+ const adjustScroll = import_react105.useCallback((nextCursor) => {
496634
496998
  setScrollOffset((prev) => {
496635
496999
  let next = prev;
496636
497000
  if (nextCursor < prev)
@@ -496665,6 +497029,13 @@ function fuzzyScore3(query2, target) {
496665
497029
  score += 5;
496666
497030
  }
496667
497031
  score -= indices.length > 0 ? indices[0] : 0;
497032
+ const stripped = lower2.startsWith("/") ? lower2.slice(1) : lower2;
497033
+ if (stripped.startsWith(q3)) {
497034
+ score += 100;
497035
+ if (stripped.length === q3.length)
497036
+ score += 50;
497037
+ score -= stripped.length;
497038
+ }
496668
497039
  return { score, indices };
496669
497040
  }
496670
497041
  function OptionRow2({
@@ -496682,6 +497053,9 @@ function OptionRow2({
496682
497053
  textFaint,
496683
497054
  successColor
496684
497055
  }) {
497056
+ const descMaxWidth = innerW - 10;
497057
+ const descActive = isActive && option2.disabled !== true && option2.kind !== "separator";
497058
+ const descText = useMarqueeScroll(option2.description ?? "", descMaxWidth, descActive);
496685
497059
  if (option2.kind === "separator") {
496686
497060
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
496687
497061
  flexDirection: "row",
@@ -496744,7 +497118,7 @@ function OptionRow2({
496744
497118
  children: [
496745
497119
  " ",
496746
497120
  option2.icon ? " " : "",
496747
- option2.description.length > innerW - 10 ? `${option2.description.slice(0, innerW - 13)}\u2026` : option2.description
497121
+ descText
496748
497122
  ]
496749
497123
  }, undefined, true, undefined, this)
496750
497124
  }, undefined, false, undefined, this)
@@ -496762,12 +497136,12 @@ function CommandPicker({ visible, config: config2, onClose }) {
496762
497136
  const extraChrome = controlRows > 0 ? controlRows + 1 : 0;
496763
497137
  const maxVisible = Math.max(4, Math.floor(containerRows * 0.8) - CHROME_ROWS2 - extraChrome);
496764
497138
  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);
497139
+ const [scope, setScope] = import_react105.useState("project");
497140
+ const [search, setSearch] = import_react105.useState("");
497141
+ const [toggleState, setToggleState] = import_react105.useState({});
497142
+ const [toggleLabels, setToggleLabels] = import_react105.useState({});
497143
+ const [selectorState, setSelectorState] = import_react105.useState({});
497144
+ const [focusZone, setFocusZone] = import_react105.useState(ZONE_LIST);
496771
497145
  const controls = (() => {
496772
497146
  const list = [];
496773
497147
  if (config2?.toggles)
@@ -496791,9 +497165,9 @@ function CommandPicker({ visible, config: config2, onClose }) {
496791
497165
  scored.sort((a4, b6) => b6.score - a4.score);
496792
497166
  return scored.map((s2) => s2.option);
496793
497167
  })();
496794
- const prevVisibleRef = import_react104.useRef(false);
496795
- const prevOptionsRef = import_react104.useRef(null);
496796
- import_react104.useEffect(() => {
497168
+ const prevVisibleRef = import_react105.useRef(false);
497169
+ const prevOptionsRef = import_react105.useRef(null);
497170
+ import_react105.useEffect(() => {
496797
497171
  if (!visible || !config2) {
496798
497172
  prevVisibleRef.current = visible;
496799
497173
  prevOptionsRef.current = null;
@@ -496844,8 +497218,8 @@ function CommandPicker({ visible, config: config2, onClose }) {
496844
497218
  }
496845
497219
  prevOptionsRef.current = filteredOptions;
496846
497220
  }, [visible, config2, filteredOptions, setCursor, setScrollOffset, maxVisible]);
496847
- const prevSearch = import_react104.useRef("");
496848
- import_react104.useEffect(() => {
497221
+ const prevSearch = import_react105.useRef("");
497222
+ import_react105.useEffect(() => {
496849
497223
  if (!config2?.searchable)
496850
497224
  return;
496851
497225
  if (search !== prevSearch.current) {
@@ -496856,8 +497230,8 @@ function CommandPicker({ visible, config: config2, onClose }) {
496856
497230
  }
496857
497231
  }
496858
497232
  }, [search, config2?.searchable, setCursor, setScrollOffset]);
496859
- const prevCursorValue = import_react104.useRef(null);
496860
- import_react104.useEffect(() => {
497233
+ const prevCursorValue = import_react105.useRef(null);
497234
+ import_react105.useEffect(() => {
496861
497235
  if (!visible || !config2?.onCursorChange)
496862
497236
  return;
496863
497237
  const val = filteredOptions[cursor3]?.value;
@@ -497254,16 +497628,17 @@ function CommandPicker({ visible, config: config2, onClose }) {
497254
497628
  ]
497255
497629
  }, undefined, true, undefined, this);
497256
497630
  }
497257
- var import_react104, MAX_POPUP_WIDTH2 = 60, CHROME_ROWS2 = 7, ZONE_LIST = -1;
497631
+ var import_react105, MAX_POPUP_WIDTH2 = 60, CHROME_ROWS2 = 7, ZONE_LIST = -1;
497258
497632
  var init_CommandPicker = __esm(async () => {
497259
497633
  init_theme();
497634
+ init_useMarqueeScroll();
497260
497635
  init_jsx_dev_runtime();
497261
497636
  await __promiseAll([
497262
497637
  init_react2(),
497263
497638
  init_shared(),
497264
497639
  init_ui2()
497265
497640
  ]);
497266
- import_react104 = __toESM(require_react(), 1);
497641
+ import_react105 = __toESM(require_react(), 1);
497267
497642
  });
497268
497643
 
497269
497644
  // src/components/modals/DiagnosePopup.tsx
@@ -497328,19 +497703,19 @@ function buildLines(result, running, spinnerCh, t2) {
497328
497703
  function DiagnosePopup({ visible, onClose, runHealthCheck }) {
497329
497704
  const t2 = useTheme();
497330
497705
  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);
497706
+ const [result, setResult] = import_react107.useState(null);
497707
+ const [running, setRunning] = import_react107.useState(false);
497708
+ const [err2, setErr] = import_react107.useState(null);
497709
+ const [cursor3, setCursor] = import_react107.useState(0);
497710
+ const scrollRef = import_react107.useRef(null);
497336
497711
  const spinnerRef = useSpinnerFrameRef();
497337
497712
  const spinnerCh = SPINNER_FRAMES[spinnerRef.current % SPINNER_FRAMES.length] ?? "\u280B";
497338
497713
  const popupW = Math.min(80, Math.max(56, Math.floor(tw2 * 0.65)));
497339
497714
  const popupH = Math.min(30, Math.max(16, th - 4));
497340
497715
  const contentW = popupW - 4;
497341
497716
  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(() => {
497717
+ const lines = import_react107.useMemo(() => result ? buildLines(result, running, spinnerCh, t2) : [], [result, running, spinnerCh, t2]);
497718
+ const run3 = import_react107.useCallback(() => {
497344
497719
  setRunning(true);
497345
497720
  setErr(null);
497346
497721
  setResult(null);
@@ -497363,7 +497738,7 @@ function DiagnosePopup({ visible, onClose, runHealthCheck }) {
497363
497738
  setErr(ex instanceof Error ? ex.message : String(ex));
497364
497739
  });
497365
497740
  }, [runHealthCheck]);
497366
- import_react106.useEffect(() => {
497741
+ import_react107.useEffect(() => {
497367
497742
  if (visible)
497368
497743
  run3();
497369
497744
  }, [visible, run3]);
@@ -497450,7 +497825,7 @@ function DiagnosePopup({ visible, onClose, runHealthCheck }) {
497450
497825
  }, undefined, false, undefined, this)
497451
497826
  }, undefined, false, undefined, this);
497452
497827
  }
497453
- var import_react106;
497828
+ var import_react107;
497454
497829
  var init_DiagnosePopup = __esm(async () => {
497455
497830
  init_theme();
497456
497831
  init_scroll();
@@ -497460,7 +497835,7 @@ var init_DiagnosePopup = __esm(async () => {
497460
497835
  init_shared(),
497461
497836
  init_ui2()
497462
497837
  ]);
497463
- import_react106 = __toESM(require_react(), 1);
497838
+ import_react107 = __toESM(require_react(), 1);
497464
497839
  });
497465
497840
 
497466
497841
  // src/components/modals/wizard/data.ts
@@ -497941,14 +498316,14 @@ var init_primitives = __esm(async () => {
497941
498316
  });
497942
498317
 
497943
498318
  // src/components/modals/wizard/steps/AutomationStep.tsx
497944
- var import_react107, AutomationStep;
498319
+ var import_react108, AutomationStep;
497945
498320
  var init_AutomationStep = __esm(async () => {
497946
498321
  init_icons();
497947
498322
  init_data();
497948
498323
  init_jsx_dev_runtime();
497949
498324
  await init_primitives();
497950
- import_react107 = __toESM(require_react(), 1);
497951
- AutomationStep = import_react107.memo(function AutomationStep2() {
498325
+ import_react108 = __toESM(require_react(), 1);
498326
+ AutomationStep = import_react108.memo(function AutomationStep2() {
497952
498327
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
497953
498328
  heading: "Automation \u2014 scale without friction",
497954
498329
  headerIcon: icon("dispatch"),
@@ -497959,14 +498334,14 @@ var init_AutomationStep = __esm(async () => {
497959
498334
  });
497960
498335
 
497961
498336
  // src/components/modals/wizard/steps/EditingStep.tsx
497962
- var import_react108, EditingStep;
498337
+ var import_react109, EditingStep;
497963
498338
  var init_EditingStep = __esm(async () => {
497964
498339
  init_icons();
497965
498340
  init_data();
497966
498341
  init_jsx_dev_runtime();
497967
498342
  await init_primitives();
497968
- import_react108 = __toESM(require_react(), 1);
497969
- EditingStep = import_react108.memo(function EditingStep2() {
498343
+ import_react109 = __toESM(require_react(), 1);
498344
+ EditingStep = import_react109.memo(function EditingStep2() {
497970
498345
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
497971
498346
  heading: "Editing \u2014 by symbol, not by string",
497972
498347
  headerIcon: icon("morph"),
@@ -497977,14 +498352,14 @@ var init_EditingStep = __esm(async () => {
497977
498352
  });
497978
498353
 
497979
498354
  // src/components/modals/wizard/steps/IntelligenceStep.tsx
497980
- var import_react109, IntelligenceStep;
498355
+ var import_react110, IntelligenceStep;
497981
498356
  var init_IntelligenceStep = __esm(async () => {
497982
498357
  init_icons();
497983
498358
  init_data();
497984
498359
  init_jsx_dev_runtime();
497985
498360
  await init_primitives();
497986
- import_react109 = __toESM(require_react(), 1);
497987
- IntelligenceStep = import_react109.memo(function IntelligenceStep2() {
498361
+ import_react110 = __toESM(require_react(), 1);
498362
+ IntelligenceStep = import_react110.memo(function IntelligenceStep2() {
497988
498363
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
497989
498364
  heading: "Codebase Intelligence",
497990
498365
  headerIcon: icon("brain"),
@@ -497995,14 +498370,14 @@ var init_IntelligenceStep = __esm(async () => {
497995
498370
  });
497996
498371
 
497997
498372
  // src/components/modals/wizard/steps/ModesStep.tsx
497998
- var import_react110, ModesStep;
498373
+ var import_react111, ModesStep;
497999
498374
  var init_ModesStep = __esm(async () => {
498000
498375
  init_icons();
498001
498376
  init_data();
498002
498377
  init_jsx_dev_runtime();
498003
498378
  await init_primitives();
498004
- import_react110 = __toESM(require_react(), 1);
498005
- ModesStep = import_react110.memo(function ModesStep2() {
498379
+ import_react111 = __toESM(require_react(), 1);
498380
+ ModesStep = import_react111.memo(function ModesStep2() {
498006
498381
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
498007
498382
  heading: "Modes \u2014 how Forge approaches work",
498008
498383
  headerIcon: icon("plan"),
@@ -498013,7 +498388,7 @@ var init_ModesStep = __esm(async () => {
498013
498388
  });
498014
498389
 
498015
498390
  // src/components/modals/wizard/steps/ReadyStep.tsx
498016
- var import_react111, ReadyStep;
498391
+ var import_react112, ReadyStep;
498017
498392
  var init_ReadyStep = __esm(async () => {
498018
498393
  init_icons();
498019
498394
  init_theme();
@@ -498021,8 +498396,8 @@ var init_ReadyStep = __esm(async () => {
498021
498396
  init_theme2();
498022
498397
  init_jsx_dev_runtime();
498023
498398
  await init_ui2();
498024
- import_react111 = __toESM(require_react(), 1);
498025
- ReadyStep = import_react111.memo(function ReadyStep2() {
498399
+ import_react112 = __toESM(require_react(), 1);
498400
+ ReadyStep = import_react112.memo(function ReadyStep2() {
498026
498401
  const t2 = useTheme();
498027
498402
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
498028
498403
  flexDirection: "column",
@@ -498168,14 +498543,14 @@ var init_ReadyStep = __esm(async () => {
498168
498543
  });
498169
498544
 
498170
498545
  // src/components/modals/wizard/steps/RemoteStep.tsx
498171
- var import_react112, RemoteStep;
498546
+ var import_react113, RemoteStep;
498172
498547
  var init_RemoteStep = __esm(async () => {
498173
498548
  init_icons();
498174
498549
  init_data();
498175
498550
  init_jsx_dev_runtime();
498176
498551
  await init_primitives();
498177
- import_react112 = __toESM(require_react(), 1);
498178
- RemoteStep = import_react112.memo(function RemoteStep2() {
498552
+ import_react113 = __toESM(require_react(), 1);
498553
+ RemoteStep = import_react113.memo(function RemoteStep2() {
498179
498554
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
498180
498555
  heading: "MCP, Skills & Remote",
498181
498556
  headerIcon: icon("plug"),
@@ -498197,7 +498572,7 @@ function getStatusTag(id) {
498197
498572
  return s2.active;
498198
498573
  }
498199
498574
  function fuzzyMatch3(query2, target) {
498200
- const q3 = query2.toLowerCase();
498575
+ const q3 = query2.toLowerCase().replace(/\s+/g, "");
498201
498576
  const t2 = target.toLowerCase();
498202
498577
  let qi = 0;
498203
498578
  for (let ti = 0;ti < t2.length && qi < q3.length; ti++) {
@@ -498305,25 +498680,25 @@ function SetupStep({
498305
498680
  const t2 = useTheme();
498306
498681
  const renderer2 = useRenderer();
498307
498682
  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);
498683
+ const [phase, setPhase] = import_react115.useState("provider");
498684
+ const [cursor3, setCursor] = import_react115.useState(0);
498685
+ const [selectedProvider, setSelectedProvider] = import_react115.useState(null);
498686
+ const [keyInput, setKeyInput] = import_react115.useState("");
498687
+ const [allModels, setAllModels] = import_react115.useState([]);
498688
+ const [searchQuery, setSearchQuery] = import_react115.useState("");
498689
+ const [modelCursor, setModelCursor] = import_react115.useState(0);
498690
+ const [flash, setFlash] = import_react115.useState(null);
498691
+ const [errorMsg, setErrorMsg] = import_react115.useState("");
498692
+ const [spinnerFrame, setSpinnerFrame] = import_react115.useState(0);
498693
+ const [tick, setTick] = import_react115.useState(0);
498694
+ const [autoAvailMap, setAutoAvailMap] = import_react115.useState({});
498695
+ const spinnerRef = import_react115.useRef(null);
498321
498696
  const inputWidth = Math.min(Math.floor(iw * 0.8), 60);
498322
498697
  const maxH = Math.max(24, Math.floor(termRows * 0.7));
498323
498698
  const maxVisibleProviders = Math.max(4, maxH - PROVIDER_CHROME_ROWS);
498324
498699
  const refresh = () => setTick((n2) => n2 + 1);
498325
498700
  const anyKeySet = PROVIDERS.some((p4) => hasKey(p4.id)) || Object.values(autoAvailMap).some(Boolean);
498326
- import_react114.useEffect(() => {
498701
+ import_react115.useEffect(() => {
498327
498702
  for (const p4 of PROVIDERS) {
498328
498703
  if (!p4.autoDetect)
498329
498704
  continue;
@@ -498336,10 +498711,10 @@ function SetupStep({
498336
498711
  }
498337
498712
  }, []);
498338
498713
  const isInputPhase = phase !== "provider";
498339
- import_react114.useEffect(() => {
498714
+ import_react115.useEffect(() => {
498340
498715
  setActive(isInputPhase);
498341
498716
  }, [isInputPhase, setActive]);
498342
- import_react114.useEffect(() => {
498717
+ import_react115.useEffect(() => {
498343
498718
  if (phase !== "key")
498344
498719
  return;
498345
498720
  const handler4 = (event) => {
@@ -498352,7 +498727,7 @@ function SetupStep({
498352
498727
  renderer2.keyInput.off("paste", handler4);
498353
498728
  };
498354
498729
  }, [phase, renderer2]);
498355
- import_react114.useEffect(() => {
498730
+ import_react115.useEffect(() => {
498356
498731
  if (phase === "fetching") {
498357
498732
  spinnerRef.current = setInterval(() => setSpinnerFrame((f3) => (f3 + 1) % SPINNER_FRAMES2.length), 80);
498358
498733
  return () => {
@@ -498366,12 +498741,12 @@ function SetupStep({
498366
498741
  }
498367
498742
  return;
498368
498743
  }, [phase]);
498369
- import_react114.useEffect(() => {
498744
+ import_react115.useEffect(() => {
498370
498745
  setPhase("provider");
498371
498746
  setCursor(0);
498372
498747
  }, []);
498373
498748
  const filteredModels = searchQuery ? allModels.filter((m6) => fuzzyMatch3(searchQuery, m6.name) || fuzzyMatch3(searchQuery, m6.group ?? "")) : allModels;
498374
- import_react114.useEffect(() => {
498749
+ import_react115.useEffect(() => {
498375
498750
  if (modelCursor >= filteredModels.length) {
498376
498751
  setModelCursor(Math.max(0, filteredModels.length - 1));
498377
498752
  }
@@ -498817,7 +499192,7 @@ function SetupStep({
498817
499192
  }, undefined, true, undefined, this);
498818
499193
  }
498819
499194
  }
498820
- var import_react114, GATEWAY_REF = "https://llmgateway.io/dashboard?ref=6tjJR2H3X4E9RmVQiQwK", URL_OVERRIDES, PROVIDERS, SPINNER_FRAMES2, PROVIDER_CHROME_ROWS = 13;
499195
+ var import_react115, GATEWAY_REF = "https://llmgateway.io/dashboard?ref=6tjJR2H3X4E9RmVQiQwK", URL_OVERRIDES, PROVIDERS, SPINNER_FRAMES2, PROVIDER_CHROME_ROWS = 13;
498821
499196
  var init_SetupStep = __esm(async () => {
498822
499197
  init_models();
498823
499198
  init_providers();
@@ -498830,7 +499205,7 @@ var init_SetupStep = __esm(async () => {
498830
499205
  init_ui2(),
498831
499206
  init_primitives()
498832
499207
  ]);
498833
- import_react114 = __toESM(require_react(), 1);
499208
+ import_react115 = __toESM(require_react(), 1);
498834
499209
  URL_OVERRIDES = {
498835
499210
  llmgateway: GATEWAY_REF
498836
499211
  };
@@ -498847,7 +499222,7 @@ var init_SetupStep = __esm(async () => {
498847
499222
  });
498848
499223
 
498849
499224
  // src/components/modals/wizard/steps/ShortcutsStep.tsx
498850
- var import_react115, ShortcutsStep;
499225
+ var import_react116, ShortcutsStep;
498851
499226
  var init_ShortcutsStep = __esm(async () => {
498852
499227
  init_icons();
498853
499228
  init_theme();
@@ -498855,8 +499230,8 @@ var init_ShortcutsStep = __esm(async () => {
498855
499230
  init_theme2();
498856
499231
  init_jsx_dev_runtime();
498857
499232
  await init_ui2();
498858
- import_react115 = __toESM(require_react(), 1);
498859
- ShortcutsStep = import_react115.memo(function ShortcutsStep2() {
499233
+ import_react116 = __toESM(require_react(), 1);
499234
+ ShortcutsStep = import_react116.memo(function ShortcutsStep2() {
498860
499235
  const t2 = useTheme();
498861
499236
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
498862
499237
  flexDirection: "column",
@@ -498958,21 +499333,21 @@ function ThemeStep({ iw, setActive }) {
498958
499333
  const t2 = useTheme();
498959
499334
  const popupBg = t2.bgPopup;
498960
499335
  const popupHl = t2.bgPopupHighlight;
498961
- const themes = import_react117.useMemo(() => listThemes(), []);
499336
+ const themes = import_react118.useMemo(() => listThemes(), []);
498962
499337
  const currentName = useThemeStore((s2) => s2.name);
498963
499338
  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");
499339
+ const cfg = import_react118.useMemo(() => loadConfig(), []);
499340
+ const [msgOpacity, setMsgOpacity] = import_react118.useState(() => typeof cfg.theme?.userMessageOpacity === "number" ? cfg.theme.userMessageOpacity : 100);
499341
+ const [diffOpacity, setDiffOpacity] = import_react118.useState(() => typeof cfg.theme?.diffOpacity === "number" ? cfg.theme.diffOpacity : 100);
499342
+ const [borderStr, setBorderStr] = import_react118.useState(() => cfg.theme?.borderStrength ?? "default");
498968
499343
  const { height: termRows } = useTerminalDimensions();
498969
499344
  const maxH = Math.max(24, Math.floor(termRows * 0.7));
498970
499345
  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) => {
499346
+ const [cursor3, setCursor] = import_react118.useState(0);
499347
+ const applyAll = import_react118.useCallback((name30, tp, mOp, dOp, bdr) => {
498973
499348
  applyTheme(name30, tp, { userMessageOpacity: mOp, diffOpacity: dOp, borderStrength: bdr });
498974
499349
  }, []);
498975
- const saveAll = import_react117.useCallback((name30, tp, mOp, dOp, bdr) => {
499350
+ const saveAll = import_react118.useCallback((name30, tp, mOp, dOp, bdr) => {
498976
499351
  saveGlobalConfig({
498977
499352
  theme: {
498978
499353
  name: name30,
@@ -498983,12 +499358,12 @@ function ThemeStep({ iw, setActive }) {
498983
499358
  }
498984
499359
  });
498985
499360
  }, []);
498986
- import_react117.useEffect(() => {
499361
+ import_react118.useEffect(() => {
498987
499362
  const idx = themes.findIndex((th) => th.id === currentName);
498988
499363
  if (idx >= 0)
498989
499364
  setCursor(idx);
498990
499365
  }, [currentName, themes]);
498991
- import_react117.useEffect(() => {
499366
+ import_react118.useEffect(() => {
498992
499367
  setActive(false);
498993
499368
  }, [setActive]);
498994
499369
  useKeyboard((evt) => {
@@ -499222,7 +499597,7 @@ function OptionRow3({
499222
499597
  ]
499223
499598
  }, undefined, true, undefined, this);
499224
499599
  }
499225
- var import_react117, OPACITY_LEVELS2, OPACITY_LABELS, BORDER_OPTIONS, BORDER_LABELS, CHROME_ROWS3 = 16;
499600
+ var import_react118, OPACITY_LEVELS2, OPACITY_LABELS, BORDER_OPTIONS, BORDER_LABELS, CHROME_ROWS3 = 16;
499226
499601
  var init_ThemeStep = __esm(async () => {
499227
499602
  init_config2();
499228
499603
  init_theme();
@@ -499233,7 +499608,7 @@ var init_ThemeStep = __esm(async () => {
499233
499608
  init_ui2(),
499234
499609
  init_primitives()
499235
499610
  ]);
499236
- import_react117 = __toESM(require_react(), 1);
499611
+ import_react118 = __toESM(require_react(), 1);
499237
499612
  OPACITY_LEVELS2 = [0, 30, 70, 100];
499238
499613
  OPACITY_LABELS = ["Clear", "Dim", "Subtle", "Solid"];
499239
499614
  BORDER_OPTIONS = ["default", "strong", "op"];
@@ -499242,10 +499617,10 @@ var init_ThemeStep = __esm(async () => {
499242
499617
 
499243
499618
  // src/components/modals/wizard/steps/WelcomeStep.tsx
499244
499619
  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(() => {
499620
+ const [len, setLen] = import_react119.useState(0);
499621
+ const [cursorOn, setCursorOn] = import_react119.useState(true);
499622
+ const timer = import_react119.useRef(undefined);
499623
+ import_react119.useEffect(() => {
499249
499624
  let i5 = 0;
499250
499625
  const tick = () => {
499251
499626
  if (i5 < text4.length) {
@@ -499274,7 +499649,7 @@ function useTypewriter(text4, ms) {
499274
499649
  }, [text4, ms]);
499275
499650
  return { typed: text4.slice(0, len), cursorOn };
499276
499651
  }
499277
- var import_react118, WelcomeStep;
499652
+ var import_react119, WelcomeStep;
499278
499653
  var init_WelcomeStep = __esm(async () => {
499279
499654
  init_icons();
499280
499655
  init_theme();
@@ -499282,8 +499657,8 @@ var init_WelcomeStep = __esm(async () => {
499282
499657
  init_theme2();
499283
499658
  init_jsx_dev_runtime();
499284
499659
  await init_ui2();
499285
- import_react118 = __toESM(require_react(), 1);
499286
- WelcomeStep = import_react118.memo(function WelcomeStep2() {
499660
+ import_react119 = __toESM(require_react(), 1);
499661
+ WelcomeStep = import_react119.memo(function WelcomeStep2() {
499287
499662
  const t2 = useTheme();
499288
499663
  const { typed, cursorOn } = useTypewriter(WELCOME_TITLE, TYPEWRITER_MS);
499289
499664
  const smithy = icon("smithy");
@@ -499399,14 +499774,14 @@ var init_WelcomeStep = __esm(async () => {
499399
499774
  });
499400
499775
 
499401
499776
  // src/components/modals/wizard/steps/WorkflowStep.tsx
499402
- var import_react119, WorkflowStep;
499777
+ var import_react120, WorkflowStep;
499403
499778
  var init_WorkflowStep = __esm(async () => {
499404
499779
  init_icons();
499405
499780
  init_data();
499406
499781
  init_jsx_dev_runtime();
499407
499782
  await init_primitives();
499408
- import_react119 = __toESM(require_react(), 1);
499409
- WorkflowStep = import_react119.memo(function WorkflowStep2() {
499783
+ import_react120 = __toESM(require_react(), 1);
499784
+ WorkflowStep = import_react120.memo(function WorkflowStep2() {
499410
499785
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV(FeatureList, {
499411
499786
  heading: "Tabs, Sessions & Git",
499412
499787
  headerIcon: icon("tabs"),
@@ -499421,12 +499796,12 @@ function FirstRunWizard({ visible, hasModel, activeModel, onSelectModel, onClose
499421
499796
  const { width: termCols, height: termRows } = useTerminalDimensions();
499422
499797
  const pw = Math.min(MAX_W, Math.floor(termCols * 0.92));
499423
499798
  const contentW = pw - SIDEBAR_W - 3;
499424
- const [stepIdx, setStepIdx] = import_react121.useState(0);
499799
+ const [stepIdx, setStepIdx] = import_react122.useState(0);
499425
499800
  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(() => {
499801
+ const [inputLocked, setInputLocked] = import_react122.useState(false);
499802
+ const [visited, setVisited] = import_react122.useState(() => new Set([0]));
499803
+ const hasOpened = import_react122.useRef(false);
499804
+ import_react122.useEffect(() => {
499430
499805
  if (!visible)
499431
499806
  return;
499432
499807
  if (!hasOpened.current) {
@@ -499436,7 +499811,7 @@ function FirstRunWizard({ visible, hasModel, activeModel, onSelectModel, onClose
499436
499811
  }
499437
499812
  setInputLocked(false);
499438
499813
  }, [visible]);
499439
- import_react121.useEffect(() => {
499814
+ import_react122.useEffect(() => {
499440
499815
  setVisited((v3) => {
499441
499816
  if (v3.has(stepIdx))
499442
499817
  return v3;
@@ -499483,7 +499858,7 @@ function FirstRunWizard({ visible, hasModel, activeModel, onSelectModel, onClose
499483
499858
  evt.preventDefault();
499484
499859
  };
499485
499860
  useKeyboard(handleKeyboard);
499486
- const tabs = import_react121.useMemo(() => STEPS.map((s2, i5) => ({
499861
+ const tabs = import_react122.useMemo(() => STEPS.map((s2, i5) => ({
499487
499862
  id: s2,
499488
499863
  label: STEP_LABELS[s2],
499489
499864
  icon: STEP_ICONS[s2],
@@ -499542,7 +499917,7 @@ function FirstRunWizard({ visible, hasModel, activeModel, onSelectModel, onClose
499542
499917
  }, undefined, true, undefined, this)
499543
499918
  }, undefined, false, undefined, this);
499544
499919
  }
499545
- var import_react121;
499920
+ var import_react122;
499546
499921
  var init_wizard2 = __esm(async () => {
499547
499922
  init_data();
499548
499923
  init_jsx_dev_runtime();
@@ -499561,7 +499936,7 @@ var init_wizard2 = __esm(async () => {
499561
499936
  init_WelcomeStep(),
499562
499937
  init_WorkflowStep()
499563
499938
  ]);
499564
- import_react121 = __toESM(require_react(), 1);
499939
+ import_react122 = __toESM(require_react(), 1);
499565
499940
  });
499566
499941
 
499567
499942
  // src/components/modals/FirstRunWizard.tsx
@@ -499574,14 +499949,14 @@ function GitCommitModal({ visible, cwd: cwd2, coAuthor, onClose, onCommitted, on
499574
499949
  const t2 = useTheme();
499575
499950
  const { width: tw2 } = useTerminalDimensions();
499576
499951
  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(() => {
499952
+ const [message, setMessage] = import_react124.useState("");
499953
+ const [staged, setStaged] = import_react124.useState([]);
499954
+ const [modified, setModified] = import_react124.useState([]);
499955
+ const [untracked, setUntracked] = import_react124.useState([]);
499956
+ const [diffSummary, setDiffSummary] = import_react124.useState("");
499957
+ const [error51, setError] = import_react124.useState(null);
499958
+ const [stageAll, setStageAll] = import_react124.useState(false);
499959
+ import_react124.useEffect(() => {
499585
499960
  if (!visible)
499586
499961
  return;
499587
499962
  setMessage("");
@@ -499596,7 +499971,7 @@ function GitCommitModal({ visible, cwd: cwd2, coAuthor, onClose, onCommitted, on
499596
499971
  setDiffSummary(lines > 1 ? `${lines} lines changed` : "no staged changes");
499597
499972
  }).catch(() => {});
499598
499973
  }, [visible, cwd2]);
499599
- const handleCommit2 = import_react123.useCallback(async () => {
499974
+ const handleCommit2 = import_react124.useCallback(async () => {
499600
499975
  if (!message.trim()) {
499601
499976
  setError("Commit message cannot be empty");
499602
499977
  return;
@@ -499748,7 +500123,7 @@ Co-Authored-By: SoulForge <noreply@soulforge.com>` : message.trim();
499748
500123
  }, undefined, true, undefined, this)
499749
500124
  }, undefined, false, undefined, this);
499750
500125
  }
499751
- var import_react123;
500126
+ var import_react124;
499752
500127
  var init_GitCommitModal = __esm(async () => {
499753
500128
  init_status();
499754
500129
  init_theme();
@@ -499757,7 +500132,7 @@ var init_GitCommitModal = __esm(async () => {
499757
500132
  init_react2(),
499758
500133
  init_ui2()
499759
500134
  ]);
499760
- import_react123 = __toESM(require_react(), 1);
500135
+ import_react124 = __toESM(require_react(), 1);
499761
500136
  });
499762
500137
 
499763
500138
  // src/components/modals/GitMenu.tsx
@@ -499771,13 +500146,13 @@ function GitMenu({
499771
500146
  onRefresh
499772
500147
  }) {
499773
500148
  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);
500149
+ const [cursor3, setCursor] = import_react126.useState(0);
500150
+ const [busy, setBusy] = import_react126.useState(false);
500151
+ const cursorRef = import_react126.useRef(0);
499777
500152
  cursorRef.current = cursor3;
499778
- const busyRef = import_react125.useRef(false);
500153
+ const busyRef = import_react126.useRef(false);
499779
500154
  busyRef.current = busy;
499780
- import_react125.useEffect(() => {
500155
+ import_react126.useEffect(() => {
499781
500156
  if (visible)
499782
500157
  setCursor(0);
499783
500158
  }, [visible]);
@@ -499938,7 +500313,7 @@ function GitMenu({
499938
500313
  }, undefined, false, undefined, this)
499939
500314
  }, undefined, false, undefined, this);
499940
500315
  }
499941
- var import_react125, MENU_ITEMS, GROUPS;
500316
+ var import_react126, MENU_ITEMS, GROUPS;
499942
500317
  var init_GitMenu = __esm(async () => {
499943
500318
  init_status();
499944
500319
  init_dialog();
@@ -499948,7 +500323,7 @@ var init_GitMenu = __esm(async () => {
499948
500323
  init_dialogs(),
499949
500324
  init_ui2()
499950
500325
  ]);
499951
- import_react125 = __toESM(require_react(), 1);
500326
+ import_react126 = __toESM(require_react(), 1);
499952
500327
  MENU_ITEMS = [
499953
500328
  { id: "commit", keyHint: "c", label: "Commit", meta: "open commit form", action: "commit" },
499954
500329
  { id: "push", keyHint: "p", label: "Push", meta: "git push", action: "push" },
@@ -499993,9 +500368,9 @@ var init_GitMenu = __esm(async () => {
499993
500368
  function InfoPopup({ visible, config: config2, onClose }) {
499994
500369
  const t2 = useTheme();
499995
500370
  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(() => {
500371
+ const [cursor3, setCursor] = import_react128.useState(0);
500372
+ const scrollRef = import_react128.useRef(null);
500373
+ import_react128.useEffect(() => {
499999
500374
  if (visible) {
500000
500375
  setCursor(0);
500001
500376
  scrollRef.current?.scrollTo(0);
@@ -500091,7 +500466,7 @@ function InfoPopup({ visible, config: config2, onClose }) {
500091
500466
  }, undefined, true, undefined, this)
500092
500467
  }, undefined, false, undefined, this);
500093
500468
  }
500094
- var import_react127;
500469
+ var import_react128;
500095
500470
  var init_InfoPopup = __esm(async () => {
500096
500471
  init_theme();
500097
500472
  init_scroll();
@@ -500100,7 +500475,7 @@ var init_InfoPopup = __esm(async () => {
500100
500475
  init_react2(),
500101
500476
  init_ui2()
500102
500477
  ]);
500103
- import_react127 = __toESM(require_react(), 1);
500478
+ import_react128 = __toESM(require_react(), 1);
500104
500479
  });
500105
500480
 
500106
500481
  // src/hooks/useAllProviderModels.ts
@@ -500112,7 +500487,7 @@ function flattenGrouped(r5) {
500112
500487
  return out2;
500113
500488
  }
500114
500489
  function useAllProviderModels(active) {
500115
- const [providerData, setProviderData] = import_react128.useState(() => {
500490
+ const [providerData, setProviderData] = import_react129.useState(() => {
500116
500491
  const init2 = {};
500117
500492
  for (const cfg of PROVIDER_CONFIGS) {
500118
500493
  if (cfg.grouped) {
@@ -500125,7 +500500,7 @@ function useAllProviderModels(active) {
500125
500500
  }
500126
500501
  return init2;
500127
500502
  });
500128
- const [availability, setAvailability] = import_react128.useState(() => {
500503
+ const [availability, setAvailability] = import_react129.useState(() => {
500129
500504
  const cached3 = getCachedProviderStatuses();
500130
500505
  const map2 = new Map;
500131
500506
  if (cached3) {
@@ -500139,7 +500514,7 @@ function useAllProviderModels(active) {
500139
500514
  }
500140
500515
  return map2;
500141
500516
  });
500142
- import_react128.useEffect(() => {
500517
+ import_react129.useEffect(() => {
500143
500518
  if (!active)
500144
500519
  return;
500145
500520
  const init2 = {};
@@ -500243,15 +500618,15 @@ function useAllProviderModels(active) {
500243
500618
  clearTimeout(fetchTimer);
500244
500619
  };
500245
500620
  }, [active]);
500246
- const anyLoading = import_react128.useMemo(() => Object.values(providerData).some((p4) => p4.loading), [providerData]);
500621
+ const anyLoading = import_react129.useMemo(() => Object.values(providerData).some((p4) => p4.loading), [providerData]);
500247
500622
  return { providerData, availability, anyLoading };
500248
500623
  }
500249
- var import_react128, BG_REFRESH_COOLDOWN = 1e4, lastBgRefresh = 0, ENV_SK;
500624
+ var import_react129, BG_REFRESH_COOLDOWN = 1e4, lastBgRefresh = 0, ENV_SK;
500250
500625
  var init_useAllProviderModels = __esm(() => {
500251
500626
  init_models();
500252
500627
  init_provider();
500253
500628
  init_secrets();
500254
- import_react128 = __toESM(require_react(), 1);
500629
+ import_react129 = __toESM(require_react(), 1);
500255
500630
  ENV_SK = {
500256
500631
  ANTHROPIC_API_KEY: "anthropic-api-key",
500257
500632
  OPENAI_API_KEY: "openai-api-key",
@@ -500285,13 +500660,13 @@ function buildMeta(m6, free) {
500285
500660
  function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500286
500661
  const { width: tw2, height: th } = useTerminalDimensions();
500287
500662
  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);
500663
+ const [query2, setQuery] = import_react131.useState("");
500664
+ const [searchMode, setSearchMode] = import_react131.useState(false);
500665
+ const [cursor3, setCursor] = import_react131.useState(0);
500666
+ const [expanded, setExpanded] = import_react131.useState(new Set);
500667
+ const cursorRef = import_react131.useRef(0);
500293
500668
  cursorRef.current = cursor3;
500294
- import_react130.useEffect(() => {
500669
+ import_react131.useEffect(() => {
500295
500670
  if (!visible)
500296
500671
  return;
500297
500672
  setQuery("");
@@ -500303,7 +500678,7 @@ function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500303
500678
  const popupW = Math.min(92, Math.max(82, Math.floor(tw2 * 0.75)));
500304
500679
  const popupH = Math.min(32, Math.max(18, th - 4));
500305
500680
  const contentW = popupW - 4;
500306
- const frecencyByModel = import_react130.useMemo(() => {
500681
+ const frecencyByModel = import_react131.useMemo(() => {
500307
500682
  if (!visible)
500308
500683
  return new Map;
500309
500684
  const allIds = [];
@@ -500322,7 +500697,7 @@ function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500322
500697
  }
500323
500698
  return out2;
500324
500699
  }, [visible, providerData]);
500325
- const groups = import_react130.useMemo(() => {
500700
+ const groups = import_react131.useMemo(() => {
500326
500701
  const visibleConfigs = PROVIDER_CONFIGS.filter((cfg) => {
500327
500702
  if (cfg.envVar !== "")
500328
500703
  return true;
@@ -500364,10 +500739,10 @@ function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500364
500739
  };
500365
500740
  });
500366
500741
  }, [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(() => {
500742
+ const filteredGroups = import_react131.useMemo(() => fuzzyFilterGroups(groups, query2), [groups, query2]);
500743
+ const effectiveExpanded = import_react131.useMemo(() => query2.trim().length > 0 ? new Set(filteredGroups.map((g4) => g4.id)) : expanded, [query2, filteredGroups, expanded]);
500744
+ const rows = import_react131.useMemo(() => buildGroupedRows(filteredGroups, effectiveExpanded), [filteredGroups, effectiveExpanded]);
500745
+ import_react131.useEffect(() => {
500371
500746
  if (cursor3 >= rows.length && rows.length > 0)
500372
500747
  setCursor(rows.length - 1);
500373
500748
  }, [rows.length, cursor3]);
@@ -500532,7 +500907,7 @@ function LlmSelector({ visible, activeModel, onSelect, onClose }) {
500532
500907
  }, undefined, true, undefined, this)
500533
500908
  }, undefined, false, undefined, this);
500534
500909
  }
500535
- var import_react130;
500910
+ var import_react131;
500536
500911
  var init_LlmSelector = __esm(async () => {
500537
500912
  init_history();
500538
500913
  init_icons();
@@ -500546,7 +500921,7 @@ var init_LlmSelector = __esm(async () => {
500546
500921
  init_react2(),
500547
500922
  init_ui2()
500548
500923
  ]);
500549
- import_react130 = __toESM(require_react(), 1);
500924
+ import_react131 = __toESM(require_react(), 1);
500550
500925
  });
500551
500926
 
500552
500927
  // src/components/modals/SessionPicker.tsx
@@ -500577,23 +500952,23 @@ function SessionPicker({ visible, cwd: cwd2, onClose, onRestore, onSystemMessage
500577
500952
  const popupW = Math.min(110, Math.max(80, Math.floor(tw2 * 0.8)));
500578
500953
  const popupH = Math.min(34, Math.max(18, th - 4));
500579
500954
  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);
500955
+ const [sessions, setSessions] = import_react133.useState([]);
500956
+ const [loading, setLoading] = import_react133.useState(false);
500957
+ const [query2, setQuery] = import_react133.useState("");
500958
+ const [cursor3, setCursor] = import_react133.useState(0);
500959
+ const [confirmClear, setConfirmClear] = import_react133.useState(false);
500960
+ const [renameId, setRenameId] = import_react133.useState(null);
500961
+ const [renameValue, setRenameValue] = import_react133.useState("");
500962
+ const [flash, setFlash] = import_react133.useState(null);
500963
+ const cursorRef = import_react133.useRef(0);
500589
500964
  cursorRef.current = cursor3;
500590
- const manager = import_react132.useMemo(() => new SessionManager(cwd2), [cwd2]);
500591
- const refresh = import_react132.useCallback(() => {
500965
+ const manager = import_react133.useMemo(() => new SessionManager(cwd2), [cwd2]);
500966
+ const refresh = import_react133.useCallback(() => {
500592
500967
  const mgr = new SessionManager(cwd2);
500593
500968
  setLoading(true);
500594
500969
  mgr.listSessionsAsync().then(setSessions).catch(() => setSessions(mgr.listSessions())).finally(() => setLoading(false));
500595
500970
  }, [cwd2]);
500596
- import_react132.useEffect(() => {
500971
+ import_react133.useEffect(() => {
500597
500972
  if (!visible)
500598
500973
  return;
500599
500974
  setQuery("");
@@ -500603,12 +500978,12 @@ function SessionPicker({ visible, cwd: cwd2, onClose, onRestore, onSystemMessage
500603
500978
  setFlash(null);
500604
500979
  refresh();
500605
500980
  }, [visible, refresh]);
500606
- const filtered = import_react132.useMemo(() => {
500981
+ const filtered = import_react133.useMemo(() => {
500607
500982
  const fq = query2.toLowerCase().trim();
500608
500983
  const rows = sessions.map(toRow);
500609
500984
  return fq ? rows.filter((r5) => r5.title.toLowerCase().includes(fq)) : rows;
500610
500985
  }, [sessions, query2]);
500611
- import_react132.useEffect(() => {
500986
+ import_react133.useEffect(() => {
500612
500987
  if (cursor3 >= filtered.length && filtered.length > 0)
500613
500988
  setCursor(filtered.length - 1);
500614
500989
  }, [filtered.length, cursor3]);
@@ -500868,7 +501243,7 @@ function SessionPicker({ visible, cwd: cwd2, onClose, onRestore, onSystemMessage
500868
501243
  }, undefined, true, undefined, this)
500869
501244
  }, undefined, false, undefined, this);
500870
501245
  }
500871
- var import_react132, COLUMNS;
501246
+ var import_react133, COLUMNS;
500872
501247
  var init_SessionPicker = __esm(async () => {
500873
501248
  init_manager();
500874
501249
  init_theme();
@@ -500880,7 +501255,7 @@ var init_SessionPicker = __esm(async () => {
500880
501255
  init_dialogs(),
500881
501256
  init_ui2()
500882
501257
  ]);
500883
- import_react132 = __toESM(require_react(), 1);
501258
+ import_react133 = __toESM(require_react(), 1);
500884
501259
  COLUMNS = [
500885
501260
  { key: "title" },
500886
501261
  { key: "msgs", width: 6, align: "right" },
@@ -500938,21 +501313,21 @@ function StatusDashboard({
500938
501313
  const popupH = Math.min(Math.max(22, Math.floor(termRows * 0.88)), termRows - 2);
500939
501314
  const contentW = popupWidth - SIDEBAR_W2 - 3;
500940
501315
  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);
501316
+ const [tab, setTab] = import_react135.useState(() => resolveInitial(initialTab));
501317
+ const [scrollOffset, setScrollOffset] = import_react135.useState(0);
501318
+ const [scopeTabId, setScopeTabId] = import_react135.useState(tabMgr.activeTabId);
500944
501319
  const sb = useStatusBarStore();
500945
501320
  const rm3 = useRepoMapStore();
500946
501321
  const wk = useWorkerStore();
500947
- const [hearth, setHearth] = import_react134.useState(null);
500948
- import_react134.useEffect(() => {
501322
+ const [hearth, setHearth] = import_react135.useState(null);
501323
+ import_react135.useEffect(() => {
500949
501324
  if (visible) {
500950
501325
  setTab(resolveInitial(initialTab));
500951
501326
  setScrollOffset(0);
500952
501327
  setScopeTabId(tabMgr.activeTabId);
500953
501328
  }
500954
501329
  }, [visible, initialTab, tabMgr.activeTabId]);
500955
- import_react134.useEffect(() => {
501330
+ import_react135.useEffect(() => {
500956
501331
  if (!visible)
500957
501332
  return;
500958
501333
  let stopped = false;
@@ -501044,7 +501419,7 @@ function StatusDashboard({
501044
501419
  clearInterval(iv);
501045
501420
  };
501046
501421
  }, [visible]);
501047
- const pollWorkerMemory = import_react134.useCallback(async () => {
501422
+ const pollWorkerMemory = import_react135.useCallback(async () => {
501048
501423
  const store = useWorkerStore.getState();
501049
501424
  try {
501050
501425
  const intel = contextManager.getRepoMap();
@@ -501057,8 +501432,8 @@ function StatusDashboard({
501057
501432
  store.setWorkerMemory("io", Math.round(res.heapUsed / 1024 / 1024), Math.round(res.rss / 1024 / 1024));
501058
501433
  } catch {}
501059
501434
  }, [contextManager]);
501060
- const pollRef = import_react134.useRef(null);
501061
- import_react134.useEffect(() => {
501435
+ const pollRef = import_react135.useRef(null);
501436
+ import_react135.useEffect(() => {
501062
501437
  if (visible && tab === "System") {
501063
501438
  pollWorkerMemory();
501064
501439
  pollRef.current = setInterval(pollWorkerMemory, 5000);
@@ -501075,12 +501450,12 @@ function StatusDashboard({
501075
501450
  const allTabs = tabMgr.tabs;
501076
501451
  const isMultiTab = allTabs.length > 1;
501077
501452
  const isAllScope = scopeTabId === "all";
501078
- const getTabUsage = import_react134.useCallback((tabId) => {
501453
+ const getTabUsage = import_react135.useCallback((tabId) => {
501079
501454
  if (tabId === tabMgr.activeTabId)
501080
501455
  return tu;
501081
501456
  return tabMgr.getChat(tabId)?.tokenUsage ?? ZERO_USAGE;
501082
501457
  }, [tu, tabMgr]);
501083
- const scopedUsage = import_react134.useMemo(() => {
501458
+ const scopedUsage = import_react135.useMemo(() => {
501084
501459
  if (!isAllScope)
501085
501460
  return getTabUsage(scopeTabId);
501086
501461
  const agg = { ...ZERO_USAGE, modelBreakdown: {} };
@@ -501110,8 +501485,8 @@ function StatusDashboard({
501110
501485
  }
501111
501486
  return agg;
501112
501487
  }, [isAllScope, scopeTabId, getTabUsage, allTabs]);
501113
- const [lspCount, setLspCount] = import_react134.useState(0);
501114
- import_react134.useEffect(() => {
501488
+ const [lspCount, setLspCount] = import_react135.useState(0);
501489
+ import_react135.useEffect(() => {
501115
501490
  getIntelligenceStatus().then((s2) => setLspCount(s2?.lspServers.length ?? 0));
501116
501491
  }, []);
501117
501492
  const scopeRelevant = tab === "Usage" || tab === "Prompt" || tab === "Cost" || tab === "Tabs";
@@ -501292,8 +501667,8 @@ function UsagePane({
501292
501667
  const clearTrigger = Math.max(80000, Math.floor(ctxWindow * (clearPct / 100)));
501293
501668
  const serverPct = 80;
501294
501669
  const serverTrigger = Math.max(160000, Math.floor(ctxWindow * (serverPct / 100)));
501295
- const ref = import_react134.useRef(null);
501296
- import_react134.useEffect(() => {
501670
+ const ref = import_react135.useRef(null);
501671
+ import_react135.useEffect(() => {
501297
501672
  ref.current?.scrollTo(scrollOffset);
501298
501673
  }, [scrollOffset]);
501299
501674
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
@@ -501469,8 +501844,8 @@ function PromptPane({
501469
501844
  const breakdown = contextManager.getContextBreakdown();
501470
501845
  const activeSections = breakdown.filter((s2) => s2.active && s2.chars > 0);
501471
501846
  const totalSysChars = activeSections.reduce((sum, s2) => sum + s2.chars, 0);
501472
- const ref = import_react134.useRef(null);
501473
- import_react134.useEffect(() => {
501847
+ const ref = import_react135.useRef(null);
501848
+ import_react135.useEffect(() => {
501474
501849
  ref.current?.scrollTo(scrollOffset);
501475
501850
  }, [scrollOffset]);
501476
501851
  if (activeSections.length === 0) {
@@ -501537,8 +501912,8 @@ function CostPane({
501537
501912
  pct: c3 > 0 && totalCost > 0 ? `${String(pct)}%` : "\u2014"
501538
501913
  };
501539
501914
  });
501540
- const ref = import_react134.useRef(null);
501541
- import_react134.useEffect(() => {
501915
+ const ref = import_react135.useRef(null);
501916
+ import_react135.useEffect(() => {
501542
501917
  ref.current?.scrollTo(scrollOffset);
501543
501918
  }, [scrollOffset]);
501544
501919
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
@@ -501646,8 +502021,8 @@ function DispatchPane({
501646
502021
  }) {
501647
502022
  const t2 = useTheme();
501648
502023
  const dispatch2 = sb.lastDispatch;
501649
- const ref = import_react134.useRef(null);
501650
- import_react134.useEffect(() => {
502024
+ const ref = import_react135.useRef(null);
502025
+ import_react135.useEffect(() => {
501651
502026
  ref.current?.scrollTo(scrollOffset);
501652
502027
  }, [scrollOffset]);
501653
502028
  if (!dispatch2) {
@@ -501813,8 +502188,8 @@ function SystemPane({
501813
502188
  const wkColor = (s2) => s2 === "ready" || s2 === "busy" ? t2.success : s2 === "starting" || s2 === "restarting" ? t2.amber : s2 === "crashed" ? t2.error : t2.textMuted;
501814
502189
  const wkIcon = (s2) => s2 === "busy" ? icon("worker_busy") : s2 === "crashed" ? icon("worker_crash") : s2 === "restarting" ? icon("worker_restart") : icon("worker");
501815
502190
  const termStats = getTerminalStats();
501816
- const ref = import_react134.useRef(null);
501817
- import_react134.useEffect(() => {
502191
+ const ref = import_react135.useRef(null);
502192
+ import_react135.useEffect(() => {
501818
502193
  ref.current?.scrollTo(scrollOffset);
501819
502194
  }, [scrollOffset]);
501820
502195
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("scrollbox", {
@@ -502078,7 +502453,7 @@ function SystemPane({
502078
502453
  ]
502079
502454
  }, undefined, true, undefined, this);
502080
502455
  }
502081
- var import_react134, BOLD16, SIDEBAR_W2 = 22, TABS;
502456
+ var import_react135, BOLD16, SIDEBAR_W2 = 22, TABS;
502082
502457
  var init_StatusDashboard = __esm(async () => {
502083
502458
  init_instance();
502084
502459
  init_icons();
@@ -502097,7 +502472,7 @@ var init_StatusDashboard = __esm(async () => {
502097
502472
  init_react2(),
502098
502473
  init_ui2()
502099
502474
  ]);
502100
- import_react134 = __toESM(require_react(), 1);
502475
+ import_react135 = __toESM(require_react(), 1);
502101
502476
  BOLD16 = TextAttributes25.BOLD;
502102
502477
  TABS = ["Usage", "Prompt", "Cost", "Tabs", "Dispatch", "System"];
502103
502478
  });
@@ -502105,8 +502480,8 @@ var init_StatusDashboard = __esm(async () => {
502105
502480
  // src/components/modals/TabNamePopup.tsx
502106
502481
  function TabNamePopup({ visible, placeholder, onSubmit, onClose }) {
502107
502482
  const { width: tw2 } = useTerminalDimensions();
502108
- const [value, setValue2] = import_react136.useState("");
502109
- import_react136.useEffect(() => {
502483
+ const [value, setValue2] = import_react137.useState("");
502484
+ import_react137.useEffect(() => {
502110
502485
  if (visible)
502111
502486
  setValue2("");
502112
502487
  }, [visible]);
@@ -502161,14 +502536,14 @@ function TabNamePopup({ visible, placeholder, onSubmit, onClose }) {
502161
502536
  }, undefined, true, undefined, this)
502162
502537
  }, undefined, false, undefined, this);
502163
502538
  }
502164
- var import_react136, NAME_MAX = 30;
502539
+ var import_react137, NAME_MAX = 30;
502165
502540
  var init_TabNamePopup = __esm(async () => {
502166
502541
  init_jsx_dev_runtime();
502167
502542
  await __promiseAll([
502168
502543
  init_react2(),
502169
502544
  init_ui2()
502170
502545
  ]);
502171
- import_react136 = __toESM(require_react(), 1);
502546
+ import_react137 = __toESM(require_react(), 1);
502172
502547
  });
502173
502548
 
502174
502549
  // src/components/modals/UiDemo.tsx
@@ -502211,37 +502586,37 @@ function fuzzyFilterProviders(providers, query2) {
502211
502586
  }
502212
502587
  function UiDemo({ visible, onClose }) {
502213
502588
  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);
502589
+ const [tab, setTab] = import_react139.useState("controls");
502590
+ const [row, setRow] = import_react139.useState(0);
502591
+ const [btnCol, setBtnCol] = import_react139.useState(0);
502592
+ const [toggles, setToggles] = import_react139.useState({ a: true, b: false });
502593
+ const [checks4, setChecks] = import_react139.useState({ x: true, y: false, z: false });
502594
+ const [radio, setRadio] = import_react139.useState("y");
502595
+ const [flash, setFlash] = import_react139.useState(null);
502596
+ const [query2, setQuery] = import_react139.useState("");
502597
+ const [searchMode, setSearchMode] = import_react139.useState(false);
502598
+ const [expanded, setExpanded] = import_react139.useState(new Set(["anthropic"]));
502599
+ const [pickerIdx, setPickerIdx] = import_react139.useState(0);
502600
+ const [pickerQuery, setPickerQuery] = import_react139.useState("");
502601
+ const [pickerSearchMode, setPickerSearchMode] = import_react139.useState(false);
502227
502602
  const width = Math.min(120, Math.max(90, Math.floor(tw2 * 0.85)));
502228
502603
  const height = Math.min(30, Math.max(22, Math.floor(th * 0.82)));
502229
- const filteredUsers = import_react138.useMemo(() => {
502604
+ const filteredUsers = import_react139.useMemo(() => {
502230
502605
  const q3 = query2.trim().toLowerCase();
502231
502606
  if (!q3)
502232
502607
  return USERS;
502233
502608
  return USERS.filter((u5) => [u5.first, u5.last, u5.email, u5.role].some((v3) => v3.toLowerCase().includes(q3)));
502234
502609
  }, [query2]);
502235
- const filteredProviders = import_react138.useMemo(() => {
502610
+ const filteredProviders = import_react139.useMemo(() => {
502236
502611
  return fuzzyFilterProviders(PROVIDERS2, pickerQuery);
502237
502612
  }, [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(() => {
502613
+ const effectiveExpanded = import_react139.useMemo(() => pickerQuery.trim().length > 0 ? new Set(filteredProviders.map((g4) => g4.id)) : expanded, [pickerQuery, filteredProviders, expanded]);
502614
+ const pickerRows = import_react139.useMemo(() => buildGroupedRows(filteredProviders, effectiveExpanded), [filteredProviders, effectiveExpanded]);
502615
+ import_react139.useEffect(() => {
502241
502616
  if (pickerIdx >= pickerRows.length)
502242
502617
  setPickerIdx(Math.max(0, pickerRows.length - 1));
502243
502618
  }, [pickerRows.length, pickerIdx]);
502244
- const rowCount = import_react138.useMemo(() => {
502619
+ const rowCount = import_react139.useMemo(() => {
502245
502620
  if (tab === "controls")
502246
502621
  return 5;
502247
502622
  if (tab === "fields")
@@ -502803,14 +503178,14 @@ function renderBody(tab, row, btnCol, toggles, checks4, radio, contentW, query2,
502803
503178
  ]
502804
503179
  }, undefined, true, undefined, this);
502805
503180
  }
502806
- var import_react138, PROVIDERS2, USERS, USER_COLUMNS, TABS2;
503181
+ var import_react139, PROVIDERS2, USERS, USER_COLUMNS, TABS2;
502807
503182
  var init_UiDemo = __esm(async () => {
502808
503183
  init_jsx_dev_runtime();
502809
503184
  await __promiseAll([
502810
503185
  init_react2(),
502811
503186
  init_ui2()
502812
503187
  ]);
502813
- import_react138 = __toESM(require_react(), 1);
503188
+ import_react139 = __toESM(require_react(), 1);
502814
503189
  PROVIDERS2 = [
502815
503190
  {
502816
503191
  id: "anthropic",
@@ -503063,14 +503438,14 @@ function UpdateModal({ visible, onClose }) {
503063
503438
  installMethod,
503064
503439
  updateAvailable
503065
503440
  } = 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(() => {
503441
+ const [copied, setCopied] = import_react141.useState(false);
503442
+ const [phase, setPhase] = import_react141.useState("info");
503443
+ const [quipIdx, setQuipIdx] = import_react141.useState(0);
503444
+ const [spinIdx, setSpinIdx] = import_react141.useState(0);
503445
+ const [logLines, setLogLines] = import_react141.useState([]);
503446
+ const [errorMsg, setErrorMsg] = import_react141.useState("");
503447
+ const upgrading = import_react141.useRef(false);
503448
+ import_react141.useEffect(() => {
503074
503449
  if (visible)
503075
503450
  setPhase("info");
503076
503451
  }, [visible]);
@@ -503080,7 +503455,7 @@ function UpdateModal({ visible, onClose }) {
503080
503455
  const maxChangelog = Math.max(6, popupH - 14);
503081
503456
  const logH = Math.max(3, Math.min(6, popupH - 12));
503082
503457
  const bg = t2.bgPopup;
503083
- import_react140.useEffect(() => {
503458
+ import_react141.useEffect(() => {
503084
503459
  if (phase !== "upgrading")
503085
503460
  return;
503086
503461
  const s2 = setInterval(() => setSpinIdx((i5) => i5 + 1), 80);
@@ -503090,7 +503465,7 @@ function UpdateModal({ visible, onClose }) {
503090
503465
  clearInterval(q3);
503091
503466
  };
503092
503467
  }, [phase]);
503093
- const doUpgrade = import_react140.useCallback(async () => {
503468
+ const doUpgrade = import_react141.useCallback(async () => {
503094
503469
  if (upgrading.current)
503095
503470
  return;
503096
503471
  upgrading.current = true;
@@ -503702,7 +504077,7 @@ function UpdateModal({ visible, onClose }) {
503702
504077
  }, undefined, true, undefined, this)
503703
504078
  }, undefined, false, undefined, this);
503704
504079
  }
503705
- var import_react140, UPGRADE_QUIPS, LATEST_QUIPS, CHANGELOG_ERROR_QUIPS, MAX_LOG = 50, BOLD17, ITALIC6, DIM6, TYPE_BADGE;
504080
+ var import_react141, UPGRADE_QUIPS, LATEST_QUIPS, CHANGELOG_ERROR_QUIPS, MAX_LOG = 50, BOLD17, ITALIC6, DIM6, TYPE_BADGE;
503706
504081
  var init_UpdateModal = __esm(async () => {
503707
504082
  init_icons();
503708
504083
  init_theme();
@@ -503715,7 +504090,7 @@ var init_UpdateModal = __esm(async () => {
503715
504090
  init_shared(),
503716
504091
  init_ui2()
503717
504092
  ]);
503718
- import_react140 = __toESM(require_react(), 1);
504093
+ import_react141 = __toESM(require_react(), 1);
503719
504094
  UPGRADE_QUIPS = [
503720
504095
  "Heating the forge\u2026",
503721
504096
  "Melting down the old version\u2026",
@@ -503768,10 +504143,10 @@ var init_UpdateModal = __esm(async () => {
503768
504143
  // src/components/settings/EditorSettings.tsx
503769
504144
  function EditorSettings({ visible, settings: settings2, initialScope, onUpdate, onClose }) {
503770
504145
  const { width: tw2, height: th } = useTerminalDimensions();
503771
- const [cursor3, setCursor] = import_react142.useState(0);
503772
- const [scope, setScope] = import_react142.useState(initialScope ?? "project");
504146
+ const [cursor3, setCursor] = import_react143.useState(0);
504147
+ const [scope, setScope] = import_react143.useState(initialScope ?? "project");
503773
504148
  const current = settings2 ?? ALL_ON;
503774
- import_react142.useEffect(() => {
504149
+ import_react143.useEffect(() => {
503775
504150
  if (visible) {
503776
504151
  setScope(initialScope ?? "project");
503777
504152
  setCursor(0);
@@ -503780,7 +504155,7 @@ function EditorSettings({ visible, settings: settings2, initialScope, onUpdate,
503780
504155
  const popupW = Math.min(80, Math.max(64, Math.floor(tw2 * 0.7)));
503781
504156
  const popupH = Math.min(32, Math.max(20, th - 4));
503782
504157
  const contentW = popupW - 4;
503783
- const groups = import_react142.useMemo(() => [
504158
+ const groups = import_react143.useMemo(() => [
503784
504159
  {
503785
504160
  id: "features",
503786
504161
  label: "Features",
@@ -503795,7 +504170,7 @@ function EditorSettings({ visible, settings: settings2, initialScope, onUpdate,
503795
504170
  }))
503796
504171
  }
503797
504172
  ], [current]);
503798
- const rows = import_react142.useMemo(() => buildGroupedRows(groups, new Set(["features"])), [groups]);
504173
+ const rows = import_react143.useMemo(() => buildGroupedRows(groups, new Set(["features"])), [groups]);
503799
504174
  useKeyboard((evt) => {
503800
504175
  if (!visible)
503801
504176
  return;
@@ -503895,7 +504270,7 @@ function EditorSettings({ visible, settings: settings2, initialScope, onUpdate,
503895
504270
  }, undefined, true, undefined, this)
503896
504271
  }, undefined, false, undefined, this);
503897
504272
  }
503898
- var import_react142, AGENT_ACCESS_MODES, AGENT_ACCESS_LABELS, FEATURES, ALL_ON, ALL_OFF;
504273
+ var import_react143, AGENT_ACCESS_MODES, AGENT_ACCESS_LABELS, FEATURES, ALL_ON, ALL_OFF;
503899
504274
  var init_EditorSettings = __esm(async () => {
503900
504275
  init_jsx_dev_runtime();
503901
504276
  await __promiseAll([
@@ -503903,7 +504278,7 @@ var init_EditorSettings = __esm(async () => {
503903
504278
  init_shared(),
503904
504279
  init_ui2()
503905
504280
  ]);
503906
- import_react142 = __toESM(require_react(), 1);
504281
+ import_react143 = __toESM(require_react(), 1);
503907
504282
  AGENT_ACCESS_MODES = ["on", "off", "when-open"];
503908
504283
  AGENT_ACCESS_LABELS = {
503909
504284
  on: "Always",
@@ -504266,35 +504641,35 @@ function HearthSettings({ visible, onClose }) {
504266
504641
  const contentW = innerW - SIDEBAR_W3 - 1;
504267
504642
  const popupHeight = Math.max(MIN_BODY_ROWS + 8, Math.min(termRows - 2, Math.floor(termRows * MAX_HEIGHT_RATIO)));
504268
504643
  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) => {
504644
+ const [tab, setTab] = import_react145.useState("surfaces");
504645
+ const [config2, setConfig] = import_react145.useState(() => loadHearthConfig());
504646
+ const [status, setStatus] = import_react145.useState({ running: false });
504647
+ const [flash, setFlash] = import_react145.useState(null);
504648
+ const flashTimer = import_react145.useRef(null);
504649
+ const [cursor3, setCursor] = import_react145.useState(0);
504650
+ const [mode, setMode] = import_react145.useState({ k: "list" });
504651
+ const [logLines, setLogLines] = import_react145.useState([]);
504652
+ const [logScroll, setLogScroll] = import_react145.useState(0);
504653
+ const [logAutoscroll, setLogAutoscroll] = import_react145.useState(true);
504654
+ const [logFilter, setLogFilter] = import_react145.useState("");
504655
+ const [logFilterFocused, setLogFilterFocused] = import_react145.useState(false);
504656
+ const logWatcherRef = import_react145.useRef(null);
504657
+ const daemonProcRef = import_react145.useRef(null);
504658
+ const mountedRef = import_react145.useRef(false);
504659
+ const bootLogRef = import_react145.useRef(null);
504660
+ const statusRef = import_react145.useRef({ running: false });
504661
+ const [startupError, setStartupError] = import_react145.useState(null);
504662
+ const [service, setService] = import_react145.useState(null);
504663
+ const flashMsg = import_react145.useCallback((kind, msg) => {
504289
504664
  if (flashTimer.current)
504290
504665
  clearTimeout(flashTimer.current);
504291
504666
  setFlash({ kind, msg });
504292
504667
  flashTimer.current = setTimeout(() => setFlash(null), 3000);
504293
504668
  }, []);
504294
- const refreshConfig = import_react144.useCallback(() => {
504669
+ const refreshConfig = import_react145.useCallback(() => {
504295
504670
  setConfig(loadHearthConfig());
504296
504671
  }, []);
504297
- const refreshStatus = import_react144.useCallback(async () => {
504672
+ const refreshStatus = import_react145.useCallback(async () => {
504298
504673
  const cfg = loadHearthConfig();
504299
504674
  const st2 = await probeDaemon(cfg.daemon.socketPath);
504300
504675
  try {
@@ -504324,7 +504699,7 @@ function HearthSettings({ visible, onClose }) {
504324
504699
  if (st2.running)
504325
504700
  setStartupError(null);
504326
504701
  }, []);
504327
- import_react144.useEffect(() => {
504702
+ import_react145.useEffect(() => {
504328
504703
  if (!visible)
504329
504704
  return;
504330
504705
  mountedRef.current = true;
@@ -504338,13 +504713,13 @@ function HearthSettings({ visible, onClose }) {
504338
504713
  clearInterval(poll);
504339
504714
  };
504340
504715
  }, [visible, refreshConfig, refreshStatus]);
504341
- const filteredLogs = import_react144.useMemo(() => {
504716
+ const filteredLogs = import_react145.useMemo(() => {
504342
504717
  if (!logFilter.trim())
504343
504718
  return logLines;
504344
504719
  const q3 = logFilter.trim().toLowerCase();
504345
504720
  return logLines.filter((l6) => l6.toLowerCase().includes(q3));
504346
504721
  }, [logLines, logFilter]);
504347
- import_react144.useEffect(() => {
504722
+ import_react145.useEffect(() => {
504348
504723
  if (!visible || tab !== "logs") {
504349
504724
  if (logWatcherRef.current) {
504350
504725
  logWatcherRef.current.close();
@@ -504379,12 +504754,12 @@ function HearthSettings({ visible, onClose }) {
504379
504754
  logWatcherRef.current = null;
504380
504755
  };
504381
504756
  }, [visible, tab, config2.daemon.logFile]);
504382
- import_react144.useEffect(() => {
504757
+ import_react145.useEffect(() => {
504383
504758
  if (tab !== "logs" || !logAutoscroll)
504384
504759
  return;
504385
504760
  setLogScroll(Math.max(0, filteredLogs.length - bodyRows));
504386
504761
  }, [filteredLogs.length, tab, logAutoscroll, bodyRows]);
504387
- import_react144.useEffect(() => {
504762
+ import_react145.useEffect(() => {
504388
504763
  if (!visible)
504389
504764
  return;
504390
504765
  const handler4 = (event) => {
@@ -504402,7 +504777,7 @@ function HearthSettings({ visible, onClose }) {
504402
504777
  renderer2.keyInput.off("paste", handler4);
504403
504778
  };
504404
504779
  }, [visible, renderer2, tab, mode.k, logFilterFocused]);
504405
- const startDaemon = import_react144.useCallback(async () => {
504780
+ const startDaemon = import_react145.useCallback(async () => {
504406
504781
  try {
504407
504782
  const launcher = resolveLauncher();
504408
504783
  if (!launcher) {
@@ -504450,7 +504825,7 @@ function HearthSettings({ visible, onClose }) {
504450
504825
  flashMsg("err", err2 instanceof Error ? err2.message : String(err2));
504451
504826
  }
504452
504827
  }, [flashMsg, refreshStatus]);
504453
- const stopDaemon = import_react144.useCallback(async () => {
504828
+ const stopDaemon = import_react145.useCallback(async () => {
504454
504829
  try {
504455
504830
  if (statusRef.current.surfaceOwner === "tui") {
504456
504831
  const { getTuiHost: getTuiHost2 } = await Promise.resolve().then(() => (init_tui_host(), exports_tui_host));
@@ -504491,7 +504866,7 @@ function HearthSettings({ visible, onClose }) {
504491
504866
  flashMsg("err", err2 instanceof Error ? err2.message : String(err2));
504492
504867
  }
504493
504868
  }, [flashMsg, refreshStatus]);
504494
- const persist = import_react144.useCallback((next) => {
504869
+ const persist = import_react145.useCallback((next) => {
504495
504870
  try {
504496
504871
  writeGlobalHearthConfig(next);
504497
504872
  setConfig(next);
@@ -504518,18 +504893,18 @@ function HearthSettings({ visible, onClose }) {
504518
504893
  flashMsg("err", `reload failed: ${err2 instanceof Error ? err2.message : String(err2)}`);
504519
504894
  });
504520
504895
  }, [flashMsg, refreshStatus]);
504521
- const refreshService = import_react144.useCallback(async () => {
504896
+ const refreshService = import_react145.useCallback(async () => {
504522
504897
  try {
504523
504898
  const s2 = await getServiceStatus();
504524
504899
  setService(s2);
504525
504900
  } catch {}
504526
504901
  }, []);
504527
- import_react144.useEffect(() => {
504902
+ import_react145.useEffect(() => {
504528
504903
  if (!visible)
504529
504904
  return;
504530
504905
  refreshService();
504531
504906
  }, [visible, refreshService]);
504532
- const installPersistent = import_react144.useCallback(async () => {
504907
+ const installPersistent = import_react145.useCallback(async () => {
504533
504908
  try {
504534
504909
  const launcher = resolveLauncher();
504535
504910
  if (!launcher) {
@@ -504553,7 +504928,7 @@ function HearthSettings({ visible, onClose }) {
504553
504928
  flashMsg("err", err2 instanceof Error ? err2.message : String(err2));
504554
504929
  }
504555
504930
  }, [flashMsg, refreshStatus]);
504556
- const uninstallPersistent = import_react144.useCallback(async () => {
504931
+ const uninstallPersistent = import_react145.useCallback(async () => {
504557
504932
  try {
504558
504933
  const s2 = await uninstallService();
504559
504934
  if (s2.error) {
@@ -504566,8 +504941,8 @@ function HearthSettings({ visible, onClose }) {
504566
504941
  flashMsg("err", err2 instanceof Error ? err2.message : String(err2));
504567
504942
  }
504568
504943
  }, [flashMsg]);
504569
- const surfaceEntries = import_react144.useMemo(() => Object.entries(config2.surfaces), [config2.surfaces]);
504570
- const toggleSurface = import_react144.useCallback((surfaceId) => {
504944
+ const surfaceEntries = import_react145.useMemo(() => Object.entries(config2.surfaces), [config2.surfaces]);
504945
+ const toggleSurface = import_react145.useCallback((surfaceId) => {
504571
504946
  const current = config2.surfaces[surfaceId];
504572
504947
  if (!current)
504573
504948
  return;
@@ -504579,12 +504954,12 @@ function HearthSettings({ visible, onClose }) {
504579
504954
  }
504580
504955
  });
504581
504956
  }, [config2, persist]);
504582
- const removeSurface = import_react144.useCallback((surfaceId) => {
504957
+ const removeSurface = import_react145.useCallback((surfaceId) => {
504583
504958
  const next = { ...config2, surfaces: { ...config2.surfaces } };
504584
504959
  delete next.surfaces[surfaceId];
504585
504960
  persist(next);
504586
504961
  }, [config2, persist]);
504587
- const removeChat = import_react144.useCallback((surfaceId, chatId) => {
504962
+ const removeChat = import_react145.useCallback((surfaceId, chatId) => {
504588
504963
  const surface = config2.surfaces[surfaceId];
504589
504964
  if (!surface)
504590
504965
  return;
@@ -504598,7 +504973,7 @@ function HearthSettings({ visible, onClose }) {
504598
504973
  }
504599
504974
  });
504600
504975
  }, [config2, persist]);
504601
- const addSurface = import_react144.useCallback((kind, id) => {
504976
+ const addSurface = import_react145.useCallback((kind, id) => {
504602
504977
  const trimmedKind = kind.trim().toLowerCase();
504603
504978
  const trimmedId = id.trim();
504604
504979
  if (!trimmedKind || !trimmedId) {
@@ -504614,7 +504989,7 @@ function HearthSettings({ visible, onClose }) {
504614
504989
  }
504615
504990
  });
504616
504991
  }, [config2, flashMsg, persist]);
504617
- const addChat = import_react144.useCallback((surfaceId, chatId, cwd2) => {
504992
+ const addChat = import_react145.useCallback((surfaceId, chatId, cwd2) => {
504618
504993
  const trimmedChat = chatId.trim();
504619
504994
  const trimmedCwd = cwd2.trim();
504620
504995
  if (!trimmedChat || !trimmedCwd) {
@@ -504644,7 +505019,7 @@ function HearthSettings({ visible, onClose }) {
504644
505019
  }
504645
505020
  });
504646
505021
  }, [config2, flashMsg, persist]);
504647
- const setToken = import_react144.useCallback((surfaceId, value) => {
505022
+ const setToken = import_react145.useCallback((surfaceId, value) => {
504648
505023
  const key3 = tokenSecretKey(surfaceId);
504649
505024
  const trimmed = value.trim();
504650
505025
  if (!key3 || !trimmed) {
@@ -504654,7 +505029,7 @@ function HearthSettings({ visible, onClose }) {
504654
505029
  const res = setSecret(key3, trimmed);
504655
505030
  flashMsg(res.success ? "ok" : "err", res.success ? `stored ${key3} (${res.storage})` : "failed to store token");
504656
505031
  }, [flashMsg]);
504657
- const addAllowedUser = import_react144.useCallback((surfaceId, chatId, userId) => {
505032
+ const addAllowedUser = import_react145.useCallback((surfaceId, chatId, userId) => {
504658
505033
  const trimmedChat = chatId.trim();
504659
505034
  const trimmedUser = userId.trim();
504660
505035
  if (!trimmedChat || !trimmedUser) {
@@ -504683,7 +505058,7 @@ function HearthSettings({ visible, onClose }) {
504683
505058
  }
504684
505059
  });
504685
505060
  }, [config2, flashMsg, persist]);
504686
- const saveQuickstart = import_react144.useCallback((args2) => {
505061
+ const saveQuickstart = import_react145.useCallback((args2) => {
504687
505062
  const cwd2 = args2.cwd.trim();
504688
505063
  if (!cwd2) {
504689
505064
  flashMsg("err", "cwd required");
@@ -504782,7 +505157,7 @@ function HearthSettings({ visible, onClose }) {
504782
505157
  }, [config2, flashMsg, persist]);
504783
505158
  const surfacesList = surfaceEntries;
504784
505159
  const selectedSurface = tab === "surfaces" && surfacesList.length > 0 ? surfacesList[Math.min(cursor3, surfacesList.length - 1)] : null;
504785
- const pairingsList = import_react144.useMemo(() => {
505160
+ const pairingsList = import_react145.useMemo(() => {
504786
505161
  const out2 = [];
504787
505162
  for (const [sid, cfg] of surfaceEntries) {
504788
505163
  for (const [chatId, chat] of Object.entries(cfg.chats ?? {})) {
@@ -507159,7 +507534,7 @@ function VSep({ t: t2 }) {
507159
507534
  alignSelf: "stretch"
507160
507535
  }, undefined, false, undefined, this);
507161
507536
  }
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;
507537
+ 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
507538
  var init_HearthSettings = __esm(async () => {
507164
507539
  init_icons();
507165
507540
  init_platform();
@@ -507174,7 +507549,7 @@ var init_HearthSettings = __esm(async () => {
507174
507549
  init_react2(),
507175
507550
  init_shared()
507176
507551
  ]);
507177
- import_react144 = __toESM(require_react(), 1);
507552
+ import_react145 = __toESM(require_react(), 1);
507178
507553
  TABS3 = ["surfaces", "daemon", "pairings", "logs"];
507179
507554
  TAB_LABEL = {
507180
507555
  surfaces: "Surfaces",
@@ -507797,7 +508172,7 @@ var init_installer = __esm(() => {
507797
508172
  Python: ["pyproject.toml", "setup.py", "requirements.txt", "*.py"],
507798
508173
  Go: ["go.mod", "*.go"],
507799
508174
  Rust: ["Cargo.toml", "*.rs"],
507800
- Lua: ["*.lua", ".luacheckrc"],
508175
+ Lua: ["*.lua", "*.luau", ".luacheckrc"],
507801
508176
  C: ["*.c", "*.h", "CMakeLists.txt", "Makefile"],
507802
508177
  "C++": ["*.cpp", "*.hpp", "*.cc", "CMakeLists.txt"],
507803
508178
  Ruby: ["Gemfile", "*.rb"],
@@ -507954,18 +508329,18 @@ function LspInstallSearch({
507954
508329
  }) {
507955
508330
  const t2 = useTheme();
507956
508331
  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);
508332
+ const [tab, setTab] = import_react147.useState(initialTab);
508333
+ const [query2, setQuery] = import_react147.useState("");
508334
+ const [categoryFilter, setCategoryFilter] = import_react147.useState("All");
508335
+ const [allStatus, setAllStatus] = import_react147.useState([]);
508336
+ const [recommended, setRecommended] = import_react147.useState([]);
508337
+ const [installing, setInstalling] = import_react147.useState(false);
508338
+ const [registryLoaded, setRegistryLoaded] = import_react147.useState(false);
508339
+ const [registryLoading, setRegistryLoading] = import_react147.useState(false);
508340
+ const [pendingToggle, setPendingToggle] = import_react147.useState(null);
507966
508341
  const defaultScopeCursor = detectScope("disabledLspServers") === "project" ? 0 : 1;
507967
- const [scopeCursor, setScopeCursor] = import_react146.useState(defaultScopeCursor);
507968
- const downloadAttemptedRef = import_react146.useRef(false);
508342
+ const [scopeCursor, setScopeCursor] = import_react147.useState(defaultScopeCursor);
508343
+ const downloadAttemptedRef = import_react147.useRef(false);
507969
508344
  const isInProject = existsSync62(join67(cwd2, ".git"));
507970
508345
  const { width: termCols, height: termRows } = useTerminalDimensions();
507971
508346
  const containerRows = termRows - 2;
@@ -507973,9 +508348,9 @@ function LspInstallSearch({
507973
508348
  const maxVisible = Math.max(4, Math.floor(containerRows * 0.85) - CHROME_ROWS4);
507974
508349
  const contentW = popupWidth - 22 - 3;
507975
508350
  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 () => {
508351
+ const [cursor3, setCursor] = import_react147.useState(0);
508352
+ const resetScroll = import_react147.useCallback(() => setCursor(0), []);
508353
+ const refreshAll = import_react147.useCallback(async () => {
507979
508354
  setRegistryLoading(true);
507980
508355
  await new Promise((r5) => setTimeout(r5, 16));
507981
508356
  const statuses = getAllPackageStatus();
@@ -507984,7 +508359,7 @@ function LspInstallSearch({
507984
508359
  setRecommended(getRecommendedPackages(cwd2));
507985
508360
  setRegistryLoading(false);
507986
508361
  }, [cwd2]);
507987
- import_react146.useEffect(() => {
508362
+ import_react147.useEffect(() => {
507988
508363
  if (!visible)
507989
508364
  return;
507990
508365
  setTab(initialTab);
@@ -508405,7 +508780,7 @@ function LspInstallSearch({
508405
508780
  ]
508406
508781
  }, undefined, true, undefined, this);
508407
508782
  }
508408
- var import_react146, MAX_POPUP_WIDTH3 = 130, CHROME_ROWS4 = 10, TABS4, CATEGORY_FILTERS;
508783
+ var import_react147, MAX_POPUP_WIDTH3 = 130, CHROME_ROWS4 = 10, TABS4, CATEGORY_FILTERS;
508409
508784
  var init_LspInstallSearch = __esm(async () => {
508410
508785
  init_installer();
508411
508786
  init_server_registry();
@@ -508415,7 +508790,7 @@ var init_LspInstallSearch = __esm(async () => {
508415
508790
  init_react2(),
508416
508791
  init_ui2()
508417
508792
  ]);
508418
- import_react146 = __toESM(require_react(), 1);
508793
+ import_react147 = __toESM(require_react(), 1);
508419
508794
  TABS4 = ["search", "installed", "updates", "disabled", "recommended"];
508420
508795
  CATEGORY_FILTERS = ["All", "LSP", "Formatter", "Linter", "DAP"];
508421
508796
  });
@@ -508423,9 +508798,9 @@ var init_LspInstallSearch = __esm(async () => {
508423
508798
  // src/components/settings/MCPSettings.tsx
508424
508799
  import { TextAttributes as TextAttributes29 } from "@opentui/core";
508425
508800
  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) => {
508801
+ const [cursor3, setCursor] = import_react149.useState(0);
508802
+ const [scrollOffset, setScrollOffset] = import_react149.useState(0);
508803
+ const adjustScroll = import_react149.useCallback((nextCursor) => {
508429
508804
  setScrollOffset((prev) => {
508430
508805
  let next = prev;
508431
508806
  if (nextCursor < prev)
@@ -508438,7 +508813,7 @@ function useListScroll2(maxVisible, totalItems) {
508438
508813
  return Math.max(0, next);
508439
508814
  });
508440
508815
  }, [maxVisible, totalItems]);
508441
- const resetScroll = import_react148.useCallback(() => {
508816
+ const resetScroll = import_react149.useCallback(() => {
508442
508817
  setCursor(0);
508443
508818
  setScrollOffset(0);
508444
508819
  }, []);
@@ -508574,29 +508949,29 @@ function MCPSettings({
508574
508949
  const maxVisibleRows = Math.max(6, containerRows - CHROME_ROWS5);
508575
508950
  const serverPageSize = Math.max(2, Math.floor(maxVisibleRows / 3));
508576
508951
  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]);
508952
+ const projectSet = import_react149.useMemo(() => new Set(projectServers.map((s2) => s2.name)), [projectServers]);
508953
+ const scopeOf = import_react149.useCallback((n2) => projectSet.has(n2) ? "project" : "global", [projectSet]);
508579
508954
  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]);
508955
+ const serverList = import_react149.useMemo(() => Object.values(runtimeServers), [runtimeServers]);
508956
+ const allTools = import_react149.useMemo(() => serverList.flatMap((s2) => s2.tools.map((ti) => ({ ...ti, serverStatus: s2.status }))), [serverList]);
508582
508957
  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(() => {
508958
+ const [view, setView] = import_react149.useState("list");
508959
+ const [toolFilter, setToolFilter] = import_react149.useState("");
508960
+ const [serverFilter, setServerFilter] = import_react149.useState("");
508961
+ const [draft, setDraft] = import_react149.useState({ ...EMPTY });
508962
+ const [activeField, setActiveField] = import_react149.useState("name");
508963
+ const [editingName, setEditingName] = import_react149.useState(null);
508964
+ const [detailName, setDetailName] = import_react149.useState(null);
508965
+ const [errorExpanded, setErrorExpanded] = import_react149.useState(false);
508966
+ const [pendingDelete, setPendingDelete] = import_react149.useState(null);
508967
+ const [deleteChoice, setDeleteChoice] = import_react149.useState("no");
508968
+ const filteredTools = import_react149.useMemo(() => {
508594
508969
  if (!toolFilter)
508595
508970
  return allTools;
508596
508971
  const q3 = toolFilter.toLowerCase();
508597
508972
  return allTools.filter((ti) => ti.name.toLowerCase().includes(q3) || ti.description.toLowerCase().includes(q3) || ti.serverName.toLowerCase().includes(q3));
508598
508973
  }, [allTools, toolFilter]);
508599
- const filteredServers = import_react148.useMemo(() => {
508974
+ const filteredServers = import_react149.useMemo(() => {
508600
508975
  if (!serverFilter)
508601
508976
  return serverList;
508602
508977
  const q3 = serverFilter.toLowerCase();
@@ -508605,13 +508980,13 @@ function MCPSettings({
508605
508980
  const pageSize = view === "list" ? serverPageSize : toolPageSize;
508606
508981
  const listCount = view === "list" ? filteredServers.length : view === "tools" ? filteredTools.length : 0;
508607
508982
  const { cursor: cursor3, setCursor, scrollOffset, adjustScroll, resetScroll } = useListScroll2(pageSize, listCount);
508608
- import_react148.useEffect(() => {
508983
+ import_react149.useEffect(() => {
508609
508984
  resetScroll();
508610
508985
  }, [resetScroll]);
508611
- import_react148.useEffect(() => {
508986
+ import_react149.useEffect(() => {
508612
508987
  resetScroll();
508613
508988
  }, [serverFilter, toolFilter, resetScroll]);
508614
- import_react148.useEffect(() => {
508989
+ import_react149.useEffect(() => {
508615
508990
  if (visible) {
508616
508991
  setView("list");
508617
508992
  setToolFilter("");
@@ -508626,13 +509001,13 @@ function MCPSettings({
508626
509001
  resetScroll();
508627
509002
  }
508628
509003
  }, [visible, resetScroll]);
508629
- const openAdd = import_react148.useCallback(() => {
509004
+ const openAdd = import_react149.useCallback(() => {
508630
509005
  setDraft({ ...EMPTY });
508631
509006
  setActiveField("name");
508632
509007
  setEditingName(null);
508633
509008
  setView("form");
508634
509009
  }, []);
508635
- const openEdit = import_react148.useCallback((name30) => {
509010
+ const openEdit = import_react149.useCallback((name30) => {
508636
509011
  const scope = scopeOf(name30);
508637
509012
  const list = scope === "project" ? projectServers : globalServers;
508638
509013
  const cfg = list.find((s2) => s2.name === name30);
@@ -508643,7 +509018,7 @@ function MCPSettings({
508643
509018
  setEditingName(name30);
508644
509019
  setView("form");
508645
509020
  }, [scopeOf, projectServers, globalServers]);
508646
- const commitForm = import_react148.useCallback(() => {
509021
+ const commitForm = import_react149.useCallback(() => {
508647
509022
  if (!draft.name.trim())
508648
509023
  return;
508649
509024
  const cfg = draftToConfig(draft);
@@ -508653,13 +509028,13 @@ function MCPSettings({
508653
509028
  onSave(updated, scope);
508654
509029
  setView("list");
508655
509030
  }, [draft, editingName, projectServers, globalServers, onSave]);
508656
- const deleteServer = import_react148.useCallback((name30) => {
509031
+ const deleteServer = import_react149.useCallback((name30) => {
508657
509032
  const scope = scopeOf(name30);
508658
509033
  const list = scope === "project" ? projectServers : globalServers;
508659
509034
  onSave(list.filter((s2) => s2.name !== name30), scope);
508660
509035
  setCursor((c3) => Math.max(0, Math.min(c3, filteredServers.length - 2)));
508661
509036
  }, [scopeOf, projectServers, globalServers, onSave, setCursor, filteredServers.length]);
508662
- const toggleDisabled = import_react148.useCallback((name30) => {
509037
+ const toggleDisabled = import_react149.useCallback((name30) => {
508663
509038
  const scope = scopeOf(name30);
508664
509039
  const list = scope === "project" ? projectServers : globalServers;
508665
509040
  const srv = list.find((s2) => s2.name === name30);
@@ -509242,7 +509617,7 @@ function FormBody({
509242
509617
  const t2 = useTheme();
509243
509618
  const fields = fieldsFor(draft.transport);
509244
509619
  const inputW = Math.max(30, innerW - 8);
509245
- const advanceField = import_react148.useCallback(() => {
509620
+ const advanceField = import_react149.useCallback(() => {
509246
509621
  const idx = fields.indexOf(activeField);
509247
509622
  const next = fields[idx + 1];
509248
509623
  if (next)
@@ -509366,7 +509741,7 @@ function FormBody({
509366
509741
  ]
509367
509742
  }, undefined, true, undefined, this);
509368
509743
  }
509369
- var import_react148, STATUS_LABEL, TRANSPORTS, TRANSPORT_LABEL, EMPTY, LABEL, HINT, MAX_WIDTH2 = 96, CHROME_ROWS5 = 8, MCP_TABS, TabRow, EmptyState, ServerCard, ToolBrowser;
509744
+ var import_react149, STATUS_LABEL, TRANSPORTS, TRANSPORT_LABEL, EMPTY, LABEL, HINT, MAX_WIDTH2 = 96, CHROME_ROWS5 = 8, MCP_TABS, TabRow, EmptyState, ServerCard, ToolBrowser;
509370
509745
  var init_MCPSettings = __esm(async () => {
509371
509746
  init_icons();
509372
509747
  init_theme();
@@ -509377,7 +509752,7 @@ var init_MCPSettings = __esm(async () => {
509377
509752
  init_shared(),
509378
509753
  init_ui2()
509379
509754
  ]);
509380
- import_react148 = __toESM(require_react(), 1);
509755
+ import_react149 = __toESM(require_react(), 1);
509381
509756
  STATUS_LABEL = {
509382
509757
  disconnected: "offline",
509383
509758
  connecting: "connecting\u2026",
@@ -509421,7 +509796,7 @@ var init_MCPSettings = __esm(async () => {
509421
509796
  { id: "list", label: "Servers", ic: "server" },
509422
509797
  { id: "tools", label: "Tools", ic: "mcp_tool" }
509423
509798
  ];
509424
- TabRow = import_react148.memo(function TabRow2({ view, innerW }) {
509799
+ TabRow = import_react149.memo(function TabRow2({ view, innerW }) {
509425
509800
  const t2 = useTheme();
509426
509801
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
509427
509802
  flexDirection: "row",
@@ -509441,7 +509816,7 @@ var init_MCPSettings = __esm(async () => {
509441
509816
  }, undefined, false, undefined, this)
509442
509817
  }, undefined, false, undefined, this);
509443
509818
  });
509444
- EmptyState = import_react148.memo(function EmptyState2({ innerW: _innerW }) {
509819
+ EmptyState = import_react149.memo(function EmptyState2({ innerW: _innerW }) {
509445
509820
  const t2 = useTheme();
509446
509821
  return /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("box", {
509447
509822
  flexDirection: "column",
@@ -509480,7 +509855,7 @@ var init_MCPSettings = __esm(async () => {
509480
509855
  ]
509481
509856
  }, undefined, true, undefined, this);
509482
509857
  });
509483
- ServerCard = import_react148.memo(function ServerCard2({
509858
+ ServerCard = import_react149.memo(function ServerCard2({
509484
509859
  server: server2,
509485
509860
  scope,
509486
509861
  isSelected,
@@ -509657,7 +510032,7 @@ var init_MCPSettings = __esm(async () => {
509657
510032
  ]
509658
510033
  }, undefined, true, undefined, this);
509659
510034
  });
509660
- ToolBrowser = import_react148.memo(function ToolBrowser2({
510035
+ ToolBrowser = import_react149.memo(function ToolBrowser2({
509661
510036
  tools,
509662
510037
  filter: filter7,
509663
510038
  cursor: cursor3,
@@ -509800,9 +510175,9 @@ function ModelEventsPopup({ visible, onClose }) {
509800
510175
  const events = useModelEventsStore((s2) => s2.events);
509801
510176
  const setEnabled = useModelEventsStore((s2) => s2.setEnabled);
509802
510177
  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(() => {
510178
+ const [tab, setTab] = import_react151.useState("Models");
510179
+ const [now2, setNow] = import_react151.useState(Date.now());
510180
+ import_react151.useEffect(() => {
509806
510181
  if (!visible)
509807
510182
  return;
509808
510183
  const i5 = setInterval(() => setNow(Date.now()), 1000);
@@ -509838,9 +510213,9 @@ function ModelEventsPopup({ visible, onClose }) {
509838
510213
  }
509839
510214
  evt.preventDefault();
509840
510215
  });
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]);
510216
+ const aggregates = import_react151.useMemo(() => aggregateModelEvents(events), [events]);
510217
+ const errors4 = import_react151.useMemo(() => modelErrorEvents(events), [events]);
510218
+ const recent = import_react151.useMemo(() => [...events].reverse().slice(0, 200), [events]);
509844
510219
  if (!visible)
509845
510220
  return null;
509846
510221
  const sidebarTabs = TABS5.map((id) => ({
@@ -509999,7 +510374,7 @@ function ModelEventsPopup({ visible, onClose }) {
509999
510374
  ]
510000
510375
  }, undefined, true, undefined, this);
510001
510376
  }
510002
- var import_react150, BOLD18 = 1, TABS5;
510377
+ var import_react151, BOLD18 = 1, TABS5;
510003
510378
  var init_ModelEventsPopup = __esm(async () => {
510004
510379
  init_icons();
510005
510380
  init_theme();
@@ -510009,7 +510384,7 @@ var init_ModelEventsPopup = __esm(async () => {
510009
510384
  init_react2(),
510010
510385
  init_ui2()
510011
510386
  ]);
510012
- import_react150 = __toESM(require_react(), 1);
510387
+ import_react151 = __toESM(require_react(), 1);
510013
510388
  TABS5 = ["Models", "Recent", "Errors"];
510014
510389
  });
510015
510390
 
@@ -510056,6 +510431,8 @@ function readValuesFromLayer(layer) {
510056
510431
  v3.openrouterExcludeReasoning = layer.performance.openrouterExcludeReasoning;
510057
510432
  if (layer.performance?.compatReasoningEffort !== undefined)
510058
510433
  v3.compatReasoningEffort = layer.performance.compatReasoningEffort;
510434
+ if (layer.performance?.llmgatewayReasoningEffort !== undefined)
510435
+ v3.llmgatewayReasoningEffort = layer.performance.llmgatewayReasoningEffort;
510059
510436
  if (layer.performance?.groqReasoningEffort !== undefined)
510060
510437
  v3.groqReasoningEffort = layer.performance.groqReasoningEffort;
510061
510438
  if (layer.performance?.openaiReasoningSummary !== undefined)
@@ -510135,6 +510512,10 @@ function buildPatch(key3, value) {
510135
510512
  return { performance: { openrouterExcludeReasoning: value } };
510136
510513
  case "compatReasoningEffort":
510137
510514
  return { performance: { compatReasoningEffort: value } };
510515
+ case "llmgatewayReasoningEffort":
510516
+ return {
510517
+ performance: { llmgatewayReasoningEffort: value }
510518
+ };
510138
510519
  case "groqReasoningEffort":
510139
510520
  return { performance: { groqReasoningEffort: value } };
510140
510521
  case "openaiReasoningSummary":
@@ -510202,19 +510583,19 @@ function ProviderSettings({
510202
510583
  const popupWidth = Math.min(MAX_POPUP_WIDTH4, Math.floor(termCols * 0.85));
510203
510584
  const maxVisible = Math.max(6, Math.floor(containerRows * 0.85) - CHROME_ROWS6);
510204
510585
  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));
510586
+ const [tab, setTab] = import_react153.useState("llmgateway");
510587
+ const [cursor3, setCursor] = import_react153.useState(0);
510588
+ const [scope, setScope] = import_react153.useState(() => detectInitialScope(projectConfig));
510208
510589
  const vals = effectiveValues(globalConfig2, projectConfig);
510209
510590
  const activeModel = projectConfig?.defaultModel ?? globalConfig2.defaultModel ?? "";
510210
510591
  const items = TAB_ITEMS[tab];
510211
510592
  const tabIdx = TABS6.indexOf(tab);
510212
510593
  const firstRowIdx = items.findIndex((i5) => i5.type !== "section" && i5.type !== "info");
510213
- import_react152.useEffect(() => {
510594
+ import_react153.useEffect(() => {
510214
510595
  if (visible)
510215
510596
  setScope(detectInitialScope(projectConfig));
510216
510597
  }, [visible, projectConfig]);
510217
- import_react152.useEffect(() => {
510598
+ import_react153.useEffect(() => {
510218
510599
  setCursor(Math.max(0, firstRowIdx));
510219
510600
  }, [tab]);
510220
510601
  const isBudgetDisabled = vals.thinkingMode !== "enabled";
@@ -510333,6 +510714,12 @@ function ProviderSettings({
510333
510714
  title: "Provider Options",
510334
510715
  titleIcon: "system",
510335
510716
  tabs: [
510717
+ {
510718
+ id: "llmgateway",
510719
+ label: "LLM Gateway",
510720
+ icon: "cloud",
510721
+ blurb: "unified gateway \xB7 effort \xB7 cache \xB7 web search"
510722
+ },
510336
510723
  { id: "claude", label: "Claude", icon: "ai", blurb: "thinking \xB7 reasoning \xB7 beta" },
510337
510724
  { id: "openai", label: "OpenAI", icon: "ai", blurb: "reasoning \xB7 service tier" },
510338
510725
  { id: "google", label: "Gemini", icon: "ai", blurb: "thinking level \xB7 budget" },
@@ -510379,6 +510766,7 @@ function ProviderSettings({
510379
510766
  flexDirection: "row",
510380
510767
  backgroundColor: t2.bgPopup,
510381
510768
  paddingX: 1,
510769
+ height: 1,
510382
510770
  children: [
510383
510771
  /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
510384
510772
  bg: t2.bgPopup,
@@ -510402,9 +510790,11 @@ function ProviderSettings({
510402
510790
  flexDirection: "row",
510403
510791
  backgroundColor: t2.bgPopup,
510404
510792
  paddingX: 1,
510793
+ height: 1,
510405
510794
  children: /* @__PURE__ */ import_jsx_dev_runtime2.jsxDEV("text", {
510406
510795
  bg: t2.bgPopup,
510407
510796
  fg: t2.textFaint,
510797
+ truncate: true,
510408
510798
  children: [
510409
510799
  "\u2139 ",
510410
510800
  item.text
@@ -510552,7 +510942,7 @@ function ProviderSettings({
510552
510942
  ]
510553
510943
  }, undefined, true, undefined, this);
510554
510944
  }
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;
510945
+ 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, LLMGATEWAY_ITEMS, COMPAT_ITEMS, TAB_ITEMS, DEFAULTS, EFFORT_KEY_MODELS;
510556
510946
  var init_ProviderSettings = __esm(async () => {
510557
510947
  init_provider_options();
510558
510948
  init_theme();
@@ -510562,8 +510952,9 @@ var init_ProviderSettings = __esm(async () => {
510562
510952
  init_shared(),
510563
510953
  init_ui2()
510564
510954
  ]);
510565
- import_react152 = __toESM(require_react(), 1);
510955
+ import_react153 = __toESM(require_react(), 1);
510566
510956
  TABS6 = [
510957
+ "llmgateway",
510567
510958
  "claude",
510568
510959
  "openai",
510569
510960
  "google",
@@ -510810,10 +511201,43 @@ var init_ProviderSettings = __esm(async () => {
510810
511201
  type: "toggle"
510811
511202
  }
510812
511203
  ];
511204
+ LLMGATEWAY_ITEMS = [
511205
+ {
511206
+ type: "info",
511207
+ text: "api.llmgateway.io unified gateway \u2014 one key, every model. Effort emits reasoning_effort for non-Claude SKUs (DeepSeek \xB7 Qwen \xB7 GLM). Claude routes native Anthropic thinking via the Claude tab."
511208
+ },
511209
+ { type: "section", label: "Reasoning" },
511210
+ {
511211
+ key: "llmgatewayReasoningEffort",
511212
+ label: "Effort",
511213
+ desc: "Sent as reasoning_effort in the request body. Overrides the shared Other-tab compat effort when set.",
511214
+ type: "cycle",
511215
+ options: ["off", "low", "medium", "high", "xhigh"]
511216
+ },
511217
+ { type: "section", label: "Prompt caching" },
511218
+ {
511219
+ type: "info",
511220
+ text: "Ephemeral cache TTL for cacheable prefixes (system + tools). Gateway bills cache writes/reads separately."
511221
+ },
511222
+ {
511223
+ key: "cacheTtl",
511224
+ label: "Cache TTL",
511225
+ desc: "5m or 1h ephemeral cache window. Longer TTL costs more to write, cheaper on repeated reads.",
511226
+ type: "cycle",
511227
+ options: ["5m", "1h"]
511228
+ },
511229
+ { type: "section", label: "Tools" },
511230
+ {
511231
+ key: "webSearch",
511232
+ label: "Web search",
511233
+ desc: "Allow models to call the gateway's web_search tool. Billed as web_search_cost per request.",
511234
+ type: "toggle"
511235
+ }
511236
+ ];
510813
511237
  COMPAT_ITEMS = [
510814
511238
  {
510815
511239
  type: "info",
510816
- text: "Catch-all for providers without their own tab: Groq \xB7 Fireworks \xB7 OpenCode Zen \xB7 OpenCode Go \xB7 LM Studio \xB7 Ollama \xB7 Copilot \xB7 GitHub Models \xB7 MiniMax \xB7 Proxy \xB7 LLM Gateway (non-Claude lane). DeepSeek has its own tab."
511240
+ text: "Catch-all for providers without their own tab: Groq \xB7 Fireworks \xB7 OpenCode Zen \xB7 OpenCode Go \xB7 LM Studio \xB7 Ollama \xB7 Copilot \xB7 GitHub Models \xB7 MiniMax \xB7 Proxy. DeepSeek and LLM Gateway have their own tabs."
510817
511241
  },
510818
511242
  { type: "section", label: "Shared effort" },
510819
511243
  {
@@ -510844,6 +511268,7 @@ var init_ProviderSettings = __esm(async () => {
510844
511268
  }
510845
511269
  ];
510846
511270
  TAB_ITEMS = {
511271
+ llmgateway: LLMGATEWAY_ITEMS,
510847
511272
  claude: CLAUDE_ITEMS,
510848
511273
  openai: OPENAI_ITEMS,
510849
511274
  google: GOOGLE_ITEMS,
@@ -510881,6 +511306,7 @@ var init_ProviderSettings = __esm(async () => {
510881
511306
  openrouterReasoningMaxTokens: "off",
510882
511307
  openrouterExcludeReasoning: false,
510883
511308
  compatReasoningEffort: "off",
511309
+ llmgatewayReasoningEffort: "off",
510884
511310
  groqReasoningEffort: "off",
510885
511311
  openaiReasoningSummary: "off",
510886
511312
  openaiVerbosity: "off",
@@ -510892,7 +511318,8 @@ var init_ProviderSettings = __esm(async () => {
510892
511318
  deepseekReasoningEffort: () => "deepseek/deepseek-v4-pro",
510893
511319
  openaiReasoningEffort: () => "openai/gpt-5",
510894
511320
  xaiReasoningEffort: () => "xai/grok-4",
510895
- googleThinkingLevel: () => "google/gemini-3-pro"
511321
+ googleThinkingLevel: () => "google/gemini-3-pro",
511322
+ llmgatewayReasoningEffort: (m6) => `llmgateway/${m6.split("/").pop() ?? m6}`
510896
511323
  };
510897
511324
  });
510898
511325
 
@@ -510944,20 +511371,20 @@ function RepoMapStatusPopup({
510944
511371
  const { width: termCols, height: termRows } = useTerminalDimensions();
510945
511372
  const popupWidth = Math.min(POPUP_W, Math.floor(termCols * 0.8));
510946
511373
  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);
511374
+ const stateRef = import_react155.useRef(useRepoMapStore.getState());
511375
+ const [, setRenderTick] = import_react155.useState(0);
511376
+ const spinnerRef = import_react155.useRef(0);
511377
+ const bodyScrollRef = import_react155.useRef(null);
510951
511378
  const initialMode = currentMode ?? "off";
510952
511379
  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(() => {
511380
+ const [selectedMode, setSelectedMode] = import_react155.useState(initialMode);
511381
+ const [selectedLimit, setSelectedLimit] = import_react155.useState(initialLimit);
511382
+ const [selectedAutoRegen, setSelectedAutoRegen] = import_react155.useState(currentAutoRegen ?? false);
511383
+ const [selectedTokenBudget, setSelectedTokenBudget] = import_react155.useState(currentTokenBudget);
511384
+ const [selectedScope, setSelectedScope] = import_react155.useState(currentScope ?? "project");
511385
+ const [focusRow, setFocusRow] = import_react155.useState(0 /* Mode */);
511386
+ const [confirmClear, setConfirmClear] = import_react155.useState(false);
511387
+ import_react155.useEffect(() => {
510961
511388
  if (!visible)
510962
511389
  return;
510963
511390
  setSelectedMode(currentMode ?? "off");
@@ -510968,7 +511395,7 @@ function RepoMapStatusPopup({
510968
511395
  setFocusRow(0 /* Mode */);
510969
511396
  setConfirmClear(false);
510970
511397
  }, [visible, currentMode, currentLimit, currentAutoRegen, currentTokenBudget, currentScope]);
510971
- import_react154.useEffect(() => {
511398
+ import_react155.useEffect(() => {
510972
511399
  if (!visible)
510973
511400
  return;
510974
511401
  stateRef.current = useRepoMapStore.getState();
@@ -510978,7 +511405,7 @@ function RepoMapStatusPopup({
510978
511405
  setRenderTick((n2) => n2 + 1);
510979
511406
  });
510980
511407
  }, [visible]);
510981
- import_react154.useEffect(() => {
511408
+ import_react155.useEffect(() => {
510982
511409
  if (!visible)
510983
511410
  return;
510984
511411
  const timer = setInterval(() => {
@@ -510990,7 +511417,7 @@ function RepoMapStatusPopup({
510990
511417
  }, 150);
510991
511418
  return () => clearInterval(timer);
510992
511419
  }, [visible]);
510993
- import_react154.useEffect(() => {
511420
+ import_react155.useEffect(() => {
510994
511421
  if (!visible)
510995
511422
  return;
510996
511423
  const sb = bodyScrollRef.current;
@@ -511379,7 +511806,7 @@ function RepoMapStatusPopup({
511379
511806
  }, undefined, true, undefined, this)
511380
511807
  }, undefined, false, undefined, this);
511381
511808
  }
511382
- var import_react154, LABEL_W = 18, POPUP_W = 72, SEMANTIC_MODES, MODE_DESCRIPTIONS, MODE_LABELS2, LLM_LIMIT_PRESETS, TOKEN_BUDGET_PRESETS;
511809
+ var import_react155, LABEL_W = 18, POPUP_W = 72, SEMANTIC_MODES, MODE_DESCRIPTIONS, MODE_LABELS2, LLM_LIMIT_PRESETS, TOKEN_BUDGET_PRESETS;
511383
511810
  var init_RepoMapStatusPopup = __esm(async () => {
511384
511811
  init_theme();
511385
511812
  init_repomap();
@@ -511390,7 +511817,7 @@ var init_RepoMapStatusPopup = __esm(async () => {
511390
511817
  init_shared(),
511391
511818
  init_ui2()
511392
511819
  ]);
511393
- import_react154 = __toESM(require_react(), 1);
511820
+ import_react155 = __toESM(require_react(), 1);
511394
511821
  SEMANTIC_MODES = ["off", "ast", "synthetic", "llm", "full"];
511395
511822
  MODE_DESCRIPTIONS = {
511396
511823
  off: "disabled",
@@ -511435,11 +511862,11 @@ function RouterSettings({
511435
511862
  }) {
511436
511863
  const t2 = useTheme();
511437
511864
  const { width: tw2, height: th } = useTerminalDimensions();
511438
- const [cursor3, setCursor] = import_react156.useState(0);
511865
+ const [cursor3, setCursor] = import_react157.useState(0);
511439
511866
  const popupW = Math.min(100, Math.max(72, Math.floor(tw2 * 0.78)));
511440
511867
  const popupH = Math.min(40, Math.max(26, th - 4));
511441
511868
  const contentW = popupW - 4;
511442
- const modelsInUse = import_react156.useMemo(() => {
511869
+ const modelsInUse = import_react157.useMemo(() => {
511443
511870
  const set3 = new Set;
511444
511871
  if (defaultModel)
511445
511872
  set3.add(defaultModel);
@@ -511462,7 +511889,7 @@ function RouterSettings({
511462
511889
  }
511463
511890
  return Array.from(set3);
511464
511891
  }, [router2, defaultModel]);
511465
- const rows = import_react156.useMemo(() => {
511892
+ const rows = import_react157.useMemo(() => {
511466
511893
  const out2 = [];
511467
511894
  for (const s2 of SECTIONS) {
511468
511895
  out2.push({ kind: "header", section: s2 });
@@ -511481,7 +511908,7 @@ function RouterSettings({
511481
511908
  }
511482
511909
  return out2;
511483
511910
  }, [modelsInUse]);
511484
- const selectableIndices = import_react156.useMemo(() => rows.map((r5, i5) => r5.kind === "header" ? -1 : i5).filter((i5) => i5 >= 0), [rows]);
511911
+ const selectableIndices = import_react157.useMemo(() => rows.map((r5, i5) => r5.kind === "header" ? -1 : i5).filter((i5) => i5 >= 0), [rows]);
511485
511912
  const moveItem = (dir) => {
511486
511913
  if (selectableIndices.length === 0)
511487
511914
  return;
@@ -511490,7 +511917,7 @@ function RouterSettings({
511490
511917
  const nextPos = (base + dir + selectableIndices.length) % selectableIndices.length;
511491
511918
  setCursor(selectableIndices[nextPos] ?? selectableIndices[0] ?? 0);
511492
511919
  };
511493
- import_react156.useMemo(() => {
511920
+ import_react157.useMemo(() => {
511494
511921
  if (cursor3 === 0 && selectableIndices.length > 0 && selectableIndices[0] !== 0) {
511495
511922
  setCursor(selectableIndices[0] ?? 0);
511496
511923
  }
@@ -511716,7 +512143,7 @@ function RouterSettings({
511716
512143
  }, undefined, true, undefined, this)
511717
512144
  }, undefined, false, undefined, this);
511718
512145
  }
511719
- var import_react156, BOLD19 = 1, SECTIONS, ALL_DEFS;
512146
+ var import_react157, BOLD19 = 1, SECTIONS, ALL_DEFS;
511720
512147
  var init_RouterSettings = __esm(async () => {
511721
512148
  init_theme();
511722
512149
  init_jsx_dev_runtime();
@@ -511725,7 +512152,7 @@ var init_RouterSettings = __esm(async () => {
511725
512152
  init_shared(),
511726
512153
  init_ui2()
511727
512154
  ]);
511728
- import_react156 = __toESM(require_react(), 1);
512155
+ import_react157 = __toESM(require_react(), 1);
511729
512156
  SECTIONS = [
511730
512157
  {
511731
512158
  id: "main",
@@ -511951,25 +512378,25 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
511951
512378
  const t2 = useTheme();
511952
512379
  const popupBg = t2.bgPopup;
511953
512380
  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);
512381
+ const [tab, setTab] = import_react159.useState("search");
512382
+ const [query2, setQuery] = import_react159.useState("");
512383
+ const [popular, setPopular] = import_react159.useState([]);
512384
+ const [results, setResults] = import_react159.useState([]);
512385
+ const [installed2, setInstalled] = import_react159.useState([]);
512386
+ const [activeSkills, setActiveSkills] = import_react159.useState([]);
512387
+ const [searching, setSearching] = import_react159.useState(false);
512388
+ const [installing, setInstalling] = import_react159.useState(false);
512389
+ const [pendingInstall, setPendingInstall] = import_react159.useState(null);
512390
+ const [scopeCursor, setScopeCursor] = import_react159.useState(0);
512391
+ const debounceRef = import_react159.useRef(null);
511965
512392
  const isInProject = existsSync63(join68(getCwd(), ".git"));
511966
512393
  const { width: termCols, height: termRows } = useTerminalDimensions();
511967
512394
  const containerRows = termRows - 2;
511968
512395
  const popupWidth = Math.min(MAX_POPUP_WIDTH5, Math.floor(termCols * 0.88));
511969
512396
  const maxVisible = Math.max(4, Math.floor(containerRows * 0.85) - CHROME_ROWS7);
511970
512397
  const contentW = popupWidth - 22 - 3;
511971
- const [cursor3, setCursor] = import_react158.useState(0);
511972
- const resetScroll = import_react158.useCallback(() => setCursor(0), []);
512398
+ const [cursor3, setCursor] = import_react159.useState(0);
512399
+ const resetScroll = import_react159.useCallback(() => setCursor(0), []);
511973
512400
  const filterQuery = query2.toLowerCase().trim();
511974
512401
  const installedNames = new Set(installed2.map((s2) => s2.name));
511975
512402
  const filteredInstalled = filterQuery ? installed2.filter((s2) => s2.name.toLowerCase().includes(filterQuery)) : installed2;
@@ -511982,13 +512409,13 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
511982
512409
  return filteredInstalled.length;
511983
512410
  return filteredActive.length;
511984
512411
  })();
511985
- const refreshInstalled = import_react158.useCallback(() => {
512412
+ const refreshInstalled = import_react159.useCallback(() => {
511986
512413
  setInstalled(listInstalledSkills());
511987
512414
  }, []);
511988
- const refreshActive = import_react158.useCallback(() => {
512415
+ const refreshActive = import_react159.useCallback(() => {
511989
512416
  setActiveSkills(contextManager.getActiveSkills());
511990
512417
  }, [contextManager]);
511991
- import_react158.useEffect(() => {
512418
+ import_react159.useEffect(() => {
511992
512419
  if (visible) {
511993
512420
  setTab("search");
511994
512421
  setQuery("");
@@ -511999,7 +512426,7 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
511999
512426
  listPopularSkills().then((r5) => setPopular(r5)).catch(() => {});
512000
512427
  }
512001
512428
  }, [visible, refreshActive, refreshInstalled]);
512002
- import_react158.useEffect(() => {
512429
+ import_react159.useEffect(() => {
512003
512430
  if (!visible || tab !== "search")
512004
512431
  return;
512005
512432
  if (debounceRef.current)
@@ -512025,7 +512452,7 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
512025
512452
  clearTimeout(debounceRef.current);
512026
512453
  };
512027
512454
  }, [query2, visible, tab, popular.length]);
512028
- import_react158.useEffect(() => {
512455
+ import_react159.useEffect(() => {
512029
512456
  setQuery("");
512030
512457
  setResults([]);
512031
512458
  resetScroll();
@@ -512340,7 +512767,7 @@ function SkillSearch({ visible, contextManager, onClose, onSystemMessage }) {
512340
512767
  ]
512341
512768
  }, undefined, true, undefined, this);
512342
512769
  }
512343
- var import_react158, MAX_POPUP_WIDTH5 = 120, CHROME_ROWS7 = 9, TABS7;
512770
+ var import_react159, MAX_POPUP_WIDTH5 = 120, CHROME_ROWS7 = 9, TABS7;
512344
512771
  var init_SkillSearch = __esm(async () => {
512345
512772
  init_cwd();
512346
512773
  init_manager5();
@@ -512350,23 +512777,23 @@ var init_SkillSearch = __esm(async () => {
512350
512777
  init_react2(),
512351
512778
  init_ui2()
512352
512779
  ]);
512353
- import_react158 = __toESM(require_react(), 1);
512780
+ import_react159 = __toESM(require_react(), 1);
512354
512781
  TABS7 = ["search", "installed", "active"];
512355
512782
  });
512356
512783
 
512357
512784
  // src/components/settings/ToolsPopup.tsx
512358
512785
  function ToolsPopup({ visible, disabledTools, onToggleTool, onClose }) {
512359
512786
  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(() => {
512787
+ const [cursor3, setCursor] = import_react161.useState(0);
512788
+ const catalog = import_react161.useMemo(() => getToolCatalog(), []);
512789
+ import_react161.useEffect(() => {
512363
512790
  if (visible)
512364
512791
  setCursor(0);
512365
512792
  }, [visible]);
512366
512793
  const popupW = Math.min(110, Math.max(72, tw2 - 4));
512367
512794
  const popupH = Math.min(32, Math.max(16, th - 4));
512368
512795
  const contentW = popupW - 4;
512369
- const groups = import_react160.useMemo(() => {
512796
+ const groups = import_react161.useMemo(() => {
512370
512797
  return [
512371
512798
  {
512372
512799
  id: "tools",
@@ -512382,7 +512809,7 @@ function ToolsPopup({ visible, disabledTools, onToggleTool, onClose }) {
512382
512809
  }
512383
512810
  ];
512384
512811
  }, [disabledTools, catalog]);
512385
- const rows = import_react160.useMemo(() => buildGroupedRows(groups, new Set(["tools"])), [groups]);
512812
+ const rows = import_react161.useMemo(() => buildGroupedRows(groups, new Set(["tools"])), [groups]);
512386
512813
  useKeyboard((evt) => {
512387
512814
  if (!visible)
512388
512815
  return;
@@ -512429,7 +512856,7 @@ function ToolsPopup({ visible, disabledTools, onToggleTool, onClose }) {
512429
512856
  }, undefined, false, undefined, this)
512430
512857
  }, undefined, false, undefined, this);
512431
512858
  }
512432
- var import_react160;
512859
+ var import_react161;
512433
512860
  var init_ToolsPopup = __esm(async () => {
512434
512861
  init_constants();
512435
512862
  init_jsx_dev_runtime();
@@ -512437,7 +512864,7 @@ var init_ToolsPopup = __esm(async () => {
512437
512864
  init_react2(),
512438
512865
  init_ui2()
512439
512866
  ]);
512440
- import_react160 = __toESM(require_react(), 1);
512867
+ import_react161 = __toESM(require_react(), 1);
512441
512868
  });
512442
512869
 
512443
512870
  // src/components/modals/MemoryBrowser.tsx
@@ -512484,29 +512911,29 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512484
512911
  const popupH = Math.min(36, Math.max(20, th - 4));
512485
512912
  const SIDEBAR_W4 = 22;
512486
512913
  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);
512914
+ const [tab, setTab] = import_react163.useState("All");
512915
+ const [query2, setQuery] = import_react163.useState("");
512916
+ const [cursor3, setCursor] = import_react163.useState(0);
512917
+ const [generation, setGeneration] = import_react163.useState(0);
512918
+ const [flash, setFlash] = import_react163.useState(null);
512919
+ const [confirmPurge, setConfirmPurge] = import_react163.useState(false);
512920
+ const [cleanupRows, setCleanupRows] = import_react163.useState([]);
512921
+ const [cleanupSelected, setCleanupSelected] = import_react163.useState(new Map);
512922
+ const [settingsModal, setSettingsModal] = import_react163.useState(null);
512923
+ const cursorRef = import_react163.useRef(0);
512497
512924
  cursorRef.current = cursor3;
512498
- const popFlash = import_react162.useCallback((kind, message) => {
512925
+ const popFlash = import_react163.useCallback((kind, message) => {
512499
512926
  setFlash({ kind, message });
512500
512927
  setTimeout(() => setFlash(null), 1800);
512501
512928
  }, []);
512502
- const fileExists = import_react162.useCallback((p4) => {
512929
+ const fileExists = import_react163.useCallback((p4) => {
512503
512930
  try {
512504
512931
  return existsSync64(join69(cwd2, p4));
512505
512932
  } catch {
512506
512933
  return false;
512507
512934
  }
512508
512935
  }, [cwd2]);
512509
- const refreshCleanup = import_react162.useCallback(() => {
512936
+ const refreshCleanup = import_react163.useCallback(() => {
512510
512937
  const dupes = memMgr.findDuplicates("all");
512511
512938
  const dead = memMgr.findDeadFileRefs("all", fileExists);
512512
512939
  const stale = memMgr.staleCandidates("all", 25);
@@ -512580,7 +513007,7 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512580
513007
  setCleanupRows(rows);
512581
513008
  setCleanupSelected(new Map);
512582
513009
  }, [memMgr, fileExists]);
512583
- import_react162.useEffect(() => {
513010
+ import_react163.useEffect(() => {
512584
513011
  if (!visible)
512585
513012
  return;
512586
513013
  setQuery("");
@@ -512591,13 +513018,13 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512591
513018
  if (tab === "Cleanup")
512592
513019
  refreshCleanup();
512593
513020
  }, [visible, tab, refreshCleanup]);
512594
- const allRows = import_react162.useMemo(() => {
513021
+ const allRows = import_react163.useMemo(() => {
512595
513022
  return memMgr.list("all", { includeHidden: false }).map(toRow2);
512596
513023
  }, [memMgr, generation]);
512597
- const hiddenRows = import_react162.useMemo(() => {
513024
+ const hiddenRows = import_react163.useMemo(() => {
512598
513025
  return memMgr.list("all", { includeHidden: true }).filter((m6) => m6.hidden).map(toRow2);
512599
513026
  }, [memMgr, generation]);
512600
- const filteredRows = import_react162.useMemo(() => {
513027
+ const filteredRows = import_react163.useMemo(() => {
512601
513028
  const source = tab === "Hidden" ? hiddenRows : allRows;
512602
513029
  const fq = query2.toLowerCase().trim();
512603
513030
  if (!fq)
@@ -512607,7 +513034,7 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512607
513034
  return hay.toLowerCase().includes(fq);
512608
513035
  });
512609
513036
  }, [allRows, hiddenRows, tab, query2]);
512610
- const settingsGroups = import_react162.useMemo(() => {
513037
+ const settingsGroups = import_react163.useMemo(() => {
512611
513038
  const scopeCfg = memMgr.scopeConfig;
512612
513039
  const resolution = contextManager.getEmbedderResolution();
512613
513040
  const embedderMeta = resolution?.modelId ? `${resolution.modelId} (${resolution.source})` : "offline (hashbag-v2)";
@@ -512646,8 +513073,8 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
512646
513073
  }
512647
513074
  ];
512648
513075
  }, [memMgr, contextManager]);
512649
- const settingsRows = import_react162.useMemo(() => buildGroupedRows(settingsGroups, new Set(["scopes"])), [settingsGroups]);
512650
- import_react162.useEffect(() => {
513076
+ const settingsRows = import_react163.useMemo(() => buildGroupedRows(settingsGroups, new Set(["scopes"])), [settingsGroups]);
513077
+ import_react163.useEffect(() => {
512651
513078
  let len;
512652
513079
  if (tab === "Cleanup")
512653
513080
  len = cleanupRows.length + 1;
@@ -513124,7 +513551,7 @@ function MemoryBrowser({ visible, contextManager, cwd: cwd2, onClose, onSystemMe
513124
513551
  }, undefined, true, undefined, this)
513125
513552
  }, undefined, false, undefined, this);
513126
513553
  }
513127
- var import_react162, SETTINGS_MODAL_TITLE, SETTINGS_MODAL_OPTIONS, TABS8, COLUMNS2, CLEANUP_COLUMNS;
513554
+ var import_react163, SETTINGS_MODAL_TITLE, SETTINGS_MODAL_OPTIONS, TABS8, COLUMNS2, CLEANUP_COLUMNS;
513128
513555
  var init_MemoryBrowser = __esm(async () => {
513129
513556
  init_theme();
513130
513557
  init_jsx_dev_runtime();
@@ -513132,7 +513559,7 @@ var init_MemoryBrowser = __esm(async () => {
513132
513559
  init_react2(),
513133
513560
  init_ui2()
513134
513561
  ]);
513135
- import_react162 = __toESM(require_react(), 1);
513562
+ import_react163 = __toESM(require_react(), 1);
513136
513563
  SETTINGS_MODAL_TITLE = {
513137
513564
  write: "Write Scope",
513138
513565
  read: "Read Scope",
@@ -513185,7 +513612,7 @@ function DialogHost() {
513185
513612
  pop();
513186
513613
  }
513187
513614
  });
513188
- import_react164.useEffect(() => {
513615
+ import_react165.useEffect(() => {
513189
513616
  if (!top)
513190
513617
  return;
513191
513618
  return () => {};
@@ -513237,7 +513664,7 @@ function DialogBody({ width }) {
513237
513664
  }
513238
513665
  }
513239
513666
  }
513240
- var import_react164;
513667
+ var import_react165;
513241
513668
  var init_DialogHost = __esm(async () => {
513242
513669
  init_shallow2();
513243
513670
  init_theme();
@@ -513249,7 +513676,7 @@ var init_DialogHost = __esm(async () => {
513249
513676
  init_AlertDialog(),
513250
513677
  init_ConfirmDialog()
513251
513678
  ]);
513252
- import_react164 = __toESM(require_react(), 1);
513679
+ import_react165 = __toESM(require_react(), 1);
513253
513680
  });
513254
513681
 
513255
513682
  // src/hearth/claim.ts
@@ -513354,9 +513781,9 @@ function ShutdownSplash({
513354
513781
  height
513355
513782
  }) {
513356
513783
  const shortId = sessionId?.slice(0, 8);
513357
- const [tick, setTick] = import_react166.useState(0);
513784
+ const [tick, setTick] = import_react167.useState(0);
513358
513785
  const { width: termWidth } = useTerminalDimensions();
513359
- import_react166.useEffect(() => {
513786
+ import_react167.useEffect(() => {
513360
513787
  const timer = setInterval(() => setTick((t3) => t3 + 1), 80);
513361
513788
  return () => clearInterval(timer);
513362
513789
  }, []);
@@ -513558,12 +513985,12 @@ function App({
513558
513985
  const renderer2 = useRenderer();
513559
513986
  const { height: termHeight, width: termWidth } = useTerminalDimensions();
513560
513987
  const t2 = useTheme();
513561
- const [providerStatuses, setProviderStatuses] = import_react166.useState(() => {
513988
+ const [providerStatuses, setProviderStatuses] = import_react167.useState(() => {
513562
513989
  return getCachedProviderStatuses() ?? bootProviders;
513563
513990
  });
513564
- const [shutdownPhase, setShutdownPhase] = import_react166.useState(-1);
513565
- const savedSessionIdRef = import_react166.useRef(null);
513566
- import_react166.useEffect(() => {
513991
+ const [shutdownPhase, setShutdownPhase] = import_react167.useState(-1);
513992
+ const savedSessionIdRef = import_react167.useRef(null);
513993
+ import_react167.useEffect(() => {
513567
513994
  const stdin2 = process.stdin;
513568
513995
  const originalRead = stdin2.read.bind(stdin2);
513569
513996
  const patchedRead = (size) => {
@@ -513586,16 +514013,16 @@ function App({
513586
514013
  stdin2.read = originalRead;
513587
514014
  };
513588
514015
  }, []);
513589
- const copyToClipboard3 = import_react166.useCallback((text4) => {
514016
+ const copyToClipboard3 = import_react167.useCallback((text4) => {
513590
514017
  if (!renderer2.copyToClipboardOSC52(text4))
513591
514018
  copyOsc52(text4);
513592
514019
  copyToClipboard2(text4);
513593
514020
  }, [renderer2]);
513594
- import_react166.useEffect(() => {
514021
+ import_react167.useEffect(() => {
513595
514022
  setProviderStatuses(getCachedProviderStatuses() ?? bootProviders);
513596
514023
  }, [bootProviders]);
513597
- import_react166.useEffect(() => subscribeProviderStatuses(setProviderStatuses), []);
513598
- import_react166.useEffect(() => {
514024
+ import_react167.useEffect(() => subscribeProviderStatuses(setProviderStatuses), []);
514025
+ import_react167.useEffect(() => {
513599
514026
  if (IS_WIN)
513600
514027
  return;
513601
514028
  const onSelection = (sel) => {
@@ -513613,28 +514040,28 @@ function App({
513613
514040
  onMouseDown: onRootMouseDown,
513614
514041
  onMouseUp: onRootMouseUp
513615
514042
  } = useCopySelection();
513616
- import_react166.useEffect(() => {
514043
+ import_react167.useEffect(() => {
513617
514044
  fetchOpenRouterMetadata();
513618
514045
  }, []);
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]);
514046
+ const [globalConfig2, setGlobalConfig] = import_react167.useState(config2);
514047
+ const [projConfig, setProjConfig] = import_react167.useState(projectConfig ?? null);
514048
+ const [routerScope, setRouterScope] = import_react167.useState(() => projectConfig && ("taskRouter" in projectConfig) ? "project" : "global");
514049
+ const modelScope = import_react167.useMemo(() => projConfig && ("defaultModel" in projConfig) ? "project" : "global", [projConfig]);
514050
+ const effectiveConfig = import_react167.useMemo(() => mergeConfigs(globalConfig2, projConfig), [globalConfig2, projConfig]);
513624
514051
  const { focusMode, editorOpen, toggleEditor, openEditor, closeEditor, focusChat, focusEditor } = useEditorFocus();
513625
- const [editorVisible, setEditorVisible] = import_react166.useState(false);
514052
+ const [editorVisible, setEditorVisible] = import_react167.useState(false);
513626
514053
  const tabMgr = useTabs((survivingIds) => {
513627
514054
  const sm = sessionManagerRef.current;
513628
514055
  const sid = getAppSessionId();
513629
514056
  if (sm && sid)
513630
514057
  sm.pruneTabsNotIn(sid, survivingIds).catch(() => {});
513631
514058
  });
513632
- const tabMgrRef = import_react166.useRef(tabMgr);
514059
+ const tabMgrRef = import_react167.useRef(tabMgr);
513633
514060
  tabMgrRef.current = tabMgr;
513634
- const sessionManagerRef = import_react166.useRef(null);
513635
- const hasTabBarRef = import_react166.useRef(false);
514061
+ const sessionManagerRef = import_react167.useRef(null);
514062
+ const hasTabBarRef = import_react167.useRef(false);
513636
514063
  hasTabBarRef.current = tabMgr.tabCount > 1;
513637
- const editorSplitRef = import_react166.useRef(60);
514064
+ const editorSplitRef = import_react167.useRef(60);
513638
514065
  const {
513639
514066
  ready: nvimReady,
513640
514067
  ptyWrite,
@@ -513650,8 +514077,8 @@ function App({
513650
514077
  openFile: nvimOpen,
513651
514078
  error: nvimError
513652
514079
  } = useNeovim(true, effectiveConfig.nvimPath, effectiveConfig.nvimConfig, closeEditor, hasTabBarRef.current, editorSplitRef.current);
513653
- const pendingEditorFileRef = import_react166.useRef(null);
513654
- import_react166.useEffect(() => {
514080
+ const pendingEditorFileRef = import_react167.useRef(null);
514081
+ import_react167.useEffect(() => {
513655
514082
  if (nvimReady && pendingEditorFileRef.current) {
513656
514083
  const file2 = pendingEditorFileRef.current;
513657
514084
  pendingEditorFileRef.current = null;
@@ -513660,7 +514087,7 @@ function App({
513660
514087
  });
513661
514088
  }
513662
514089
  }, [nvimReady, nvimOpen]);
513663
- const openEditorWithFile = import_react166.useCallback((file2) => {
514090
+ const openEditorWithFile = import_react167.useCallback((file2) => {
513664
514091
  if (editorOpen && nvimReady) {
513665
514092
  nvimOpen(file2).catch((err2) => {
513666
514093
  logBackgroundError("editor", `failed to open ${file2}: ${err2 instanceof Error ? err2.message : String(err2)}`);
@@ -513670,18 +514097,18 @@ function App({
513670
514097
  openEditor();
513671
514098
  }
513672
514099
  }, [editorOpen, nvimReady, nvimOpen, openEditor]);
513673
- import_react166.useEffect(() => {
514100
+ import_react167.useEffect(() => {
513674
514101
  setEditorRequestCallback((file2) => {
513675
514102
  if (file2)
513676
514103
  openEditorWithFile(file2);
513677
514104
  });
513678
514105
  return () => setEditorRequestCallback(null);
513679
514106
  }, [openEditorWithFile]);
513680
- import_react166.useEffect(() => {
514107
+ import_react167.useEffect(() => {
513681
514108
  if (editorOpen)
513682
514109
  setEditorVisible(true);
513683
514110
  }, [editorOpen]);
513684
- import_react166.useEffect(() => {
514111
+ import_react167.useEffect(() => {
513685
514112
  const activity = tabMgr.getTabActivity(tabMgr.activeTabId);
513686
514113
  const label = tabMgr.activeTab.label;
513687
514114
  const truncated = label.length > 40 ? `${label.slice(0, 37)}\u2026` : label;
@@ -513693,10 +514120,10 @@ function App({
513693
514120
  const reasoningExpanded = useUIStore((s2) => s2.reasoningExpanded);
513694
514121
  const codeExpanded = useUIStore((s2) => s2.codeExpanded);
513695
514122
  const hasTabBar = tabMgr.tabCount > 1;
513696
- import_react166.useEffect(() => {
514123
+ import_react167.useEffect(() => {
513697
514124
  renderer2.requestRender();
513698
514125
  }, [editorOpen, editorVisible, focusMode, reasoningExpanded, codeExpanded, hasTabBar, renderer2]);
513699
- const handleEditorClosed = import_react166.useCallback(() => {
514126
+ const handleEditorClosed = import_react167.useCallback(() => {
513700
514127
  setEditorVisible(false);
513701
514128
  }, []);
513702
514129
  useEditorInput({
@@ -513739,24 +514166,24 @@ function App({
513739
514166
  const modalMemoryBrowser = useUIStore((s2) => s2.modals.memoryBrowser);
513740
514167
  const modalUiDemo = useUIStore((s2) => s2.modals.uiDemo);
513741
514168
  const toolsState = useToolsStore();
513742
- import_react166.useEffect(() => {
514169
+ import_react167.useEffect(() => {
513743
514170
  toolsState.initFromConfig(effectiveConfig.disabledTools);
513744
514171
  }, [effectiveConfig.disabledTools, toolsState.initFromConfig]);
513745
- import_react166.useEffect(() => {
514172
+ import_react167.useEffect(() => {
513746
514173
  saveGlobalConfig({ disabledTools: [...toolsState.disabledTools] });
513747
514174
  }, [toolsState.disabledTools]);
513748
514175
  const statusDashboardTab = useUIStore((s2) => s2.statusDashboardTab);
513749
514176
  const modalRepoMapStatus = useUIStore((s2) => s2.modals.repoMapStatus);
513750
514177
  const isModalOpen = useUIStore(selectIsAnyModalOpen);
513751
- const wizardOpenedLlm = import_react166.useRef(false);
513752
- const closerCache2 = import_react166.useRef({});
514178
+ const wizardOpenedLlm = import_react167.useRef(false);
514179
+ const closerCache2 = import_react167.useRef({});
513753
514180
  const getCloser2 = (name30) => closerCache2.current[name30] ??= () => useUIStore.getState().closeModal(name30);
513754
514181
  useVersionCheck();
513755
514182
  const versionCurrent = useVersionStore((s2) => s2.current);
513756
514183
  const versionLatest = useVersionStore((s2) => s2.latest);
513757
514184
  const versionUpdateAvailable = useVersionStore((s2) => s2.updateAvailable);
513758
- const updateModalShown = import_react166.useRef(false);
513759
- import_react166.useEffect(() => {
514185
+ const updateModalShown = import_react167.useRef(false);
514186
+ import_react167.useEffect(() => {
513760
514187
  if (!versionUpdateAvailable || !versionLatest || updateModalShown.current)
513761
514188
  return;
513762
514189
  if (isDismissed(versionLatest))
@@ -513770,7 +514197,7 @@ function App({
513770
514197
  }, 500);
513771
514198
  return () => clearTimeout(timer);
513772
514199
  }, [versionUpdateAvailable, versionLatest]);
513773
- import_react166.useEffect(() => {
514200
+ import_react167.useEffect(() => {
513774
514201
  if (getMissingRequired().length > 0) {
513775
514202
  useUIStore.getState().openModal("setup");
513776
514203
  } else if (forceWizard || !config2.onboardingComplete && !resumeSessionId) {
@@ -513778,7 +514205,7 @@ function App({
513778
514205
  }
513779
514206
  }, [config2.onboardingComplete, forceWizard, resumeSessionId]);
513780
514207
  const cwd2 = getCwd();
513781
- const saveToScope = import_react166.useCallback((patch, toScope, fromScope) => {
514208
+ const saveToScope = import_react167.useCallback((patch, toScope, fromScope) => {
513782
514209
  if (toScope === "global") {
513783
514210
  saveGlobalConfig(patch);
513784
514211
  setGlobalConfig((prev) => applyConfigPatch(prev, patch));
@@ -513798,12 +514225,12 @@ function App({
513798
514225
  }
513799
514226
  }
513800
514227
  }, [cwd2]);
513801
- const detectScope = import_react166.useCallback((key3) => {
514228
+ const detectScope = import_react167.useCallback((key3) => {
513802
514229
  if (projConfig && key3 in projConfig)
513803
514230
  return "project";
513804
514231
  return "global";
513805
514232
  }, [projConfig]);
513806
- import_react166.useEffect(() => {
514233
+ import_react167.useEffect(() => {
513807
514234
  initForbidden(cwd2);
513808
514235
  for (const cfg of PROVIDER_CONFIGS) {
513809
514236
  if (cfg.grouped)
@@ -513812,20 +514239,20 @@ function App({
513812
514239
  fetchProviderModels(cfg.id).catch(() => {});
513813
514240
  }
513814
514241
  }, []);
513815
- const contextManager = import_react166.useMemo(() => preloadedContextManager ?? new ContextManager(cwd2), [cwd2, preloadedContextManager]);
513816
- const sessionManager = import_react166.useMemo(() => new SessionManager(cwd2), [cwd2]);
514242
+ const contextManager = import_react167.useMemo(() => preloadedContextManager ?? new ContextManager(cwd2), [cwd2, preloadedContextManager]);
514243
+ const sessionManager = import_react167.useMemo(() => new SessionManager(cwd2), [cwd2]);
513817
514244
  sessionManagerRef.current = sessionManager;
513818
- const mcpManager = import_react166.useMemo(() => getMCPManager(), []);
513819
- import_react166.useEffect(() => {
514245
+ const mcpManager = import_react167.useMemo(() => getMCPManager(), []);
514246
+ import_react167.useEffect(() => {
513820
514247
  mcpManager.connectAll(effectiveConfig.mcpServers ?? []);
513821
514248
  }, [mcpManager, effectiveConfig.mcpServers]);
513822
- import_react166.useEffect(() => {
514249
+ import_react167.useEffect(() => {
513823
514250
  return () => {
513824
514251
  disposeMCPManager();
513825
514252
  };
513826
514253
  }, []);
513827
514254
  const git = useGitStatus(cwd2);
513828
- const [forgeMode, setForgeModeHeader] = import_react166.useState("default");
514255
+ const [forgeMode, setForgeModeHeader] = import_react167.useState("default");
513829
514256
  const modeLabel = getModeLabel(forgeMode);
513830
514257
  const modeColor = getModeColor(forgeMode);
513831
514258
  useConfigSync({
@@ -513839,7 +514266,7 @@ function App({
513839
514266
  cursorCol,
513840
514267
  visualSelection
513841
514268
  });
513842
- const handleSuspend = import_react166.useCallback(async (opts) => {
514269
+ const handleSuspend = import_react167.useCallback(async (opts) => {
513843
514270
  useUIStore.getState().setSuspended(true);
513844
514271
  await new Promise((r5) => setTimeout(r5, 50));
513845
514272
  const result = await suspendAndRun({ ...opts, cwd: cwd2 });
@@ -513859,29 +514286,29 @@ function App({
513859
514286
  git.refresh();
513860
514287
  }, [cwd2, git]);
513861
514288
  editorSplitRef.current = editorSplit;
513862
- const sharedResources = import_react166.useMemo(() => ({
514289
+ const sharedResources = import_react167.useMemo(() => ({
513863
514290
  ...contextManager.getSharedResources(),
513864
514291
  workspaceCoordinator: getWorkspaceCoordinator()
513865
514292
  }), [contextManager]);
513866
- const workspaceSnapshotRef = import_react166.useRef(null);
514293
+ const workspaceSnapshotRef = import_react167.useRef(null);
513867
514294
  workspaceSnapshotRef.current = () => ({
513868
514295
  tabStates: tabMgr.getAllTabStates(),
513869
514296
  activeTabId: tabMgr.activeTabId
513870
514297
  });
513871
- const addSystemMessage = import_react166.useCallback((msg) => {
514298
+ const addSystemMessage = import_react167.useCallback((msg) => {
513872
514299
  const activeChat = tabMgrRef.current?.getActiveChat();
513873
514300
  activeChat?.setMessages((prev) => [
513874
514301
  ...prev,
513875
514302
  { id: crypto.randomUUID(), role: "system", content: msg, timestamp: Date.now() }
513876
514303
  ]);
513877
514304
  }, []);
513878
- const refreshGit = import_react166.useCallback(() => {
514305
+ const refreshGit = import_react167.useCallback(() => {
513879
514306
  git.refresh();
513880
514307
  }, [git]);
513881
- const shutdownPhaseRef = import_react166.useRef(shutdownPhase);
514308
+ const shutdownPhaseRef = import_react167.useRef(shutdownPhase);
513882
514309
  shutdownPhaseRef.current = shutdownPhase;
513883
- const exitTimersRef = import_react166.useRef([]);
513884
- const handleCycleTab = import_react166.useCallback((direction) => {
514310
+ const exitTimersRef = import_react167.useRef([]);
514311
+ const handleCycleTab = import_react167.useCallback((direction) => {
513885
514312
  if (tabMgr.tabCount <= 1)
513886
514313
  return;
513887
514314
  if (direction === 1)
@@ -513889,7 +514316,7 @@ function App({
513889
514316
  else
513890
514317
  tabMgr.prevTab();
513891
514318
  }, [tabMgr.tabCount, tabMgr.nextTab, tabMgr.prevTab]);
513892
- const handleExit = import_react166.useCallback(() => {
514319
+ const handleExit = import_react167.useCallback(() => {
513893
514320
  if (shutdownPhaseRef.current >= 0)
513894
514321
  return;
513895
514322
  setShutdownPhase(0);
@@ -513968,8 +514395,8 @@ function App({
513968
514395
  }, 300);
513969
514396
  }, 250);
513970
514397
  }, [cwd2, sessionManager, contextManager, renderer2]);
513971
- const hasRestoredRef = import_react166.useRef(false);
513972
- import_react166.useEffect(() => {
514398
+ const hasRestoredRef = import_react167.useRef(false);
514399
+ import_react167.useEffect(() => {
513973
514400
  if (hasRestoredRef.current || !resumeSessionId)
513974
514401
  return;
513975
514402
  hasRestoredRef.current = true;
@@ -514004,8 +514431,8 @@ function App({
514004
514431
  }, 100);
514005
514432
  }
514006
514433
  }, []);
514007
- const hasBootedHearthRef = import_react166.useRef(false);
514008
- import_react166.useEffect(() => {
514434
+ const hasBootedHearthRef = import_react167.useRef(false);
514435
+ import_react167.useEffect(() => {
514009
514436
  if (hasBootedHearthRef.current)
514010
514437
  return;
514011
514438
  hasBootedHearthRef.current = true;
@@ -514220,9 +514647,9 @@ function App({
514220
514647
  } catch {}
514221
514648
  })();
514222
514649
  }, []);
514223
- const [activeModelForHeader, setActiveModelForHeader] = import_react166.useState(effectiveConfig.defaultModel);
514224
- const activeChatRef = import_react166.useRef(null);
514225
- import_react166.useEffect(() => {
514650
+ const [activeModelForHeader, setActiveModelForHeader] = import_react167.useState(effectiveConfig.defaultModel);
514651
+ const activeChatRef = import_react167.useRef(null);
514652
+ import_react167.useEffect(() => {
514226
514653
  const chat = tabMgr.getActiveChat();
514227
514654
  activeChatRef.current = chat;
514228
514655
  if (chat) {
@@ -514232,7 +514659,7 @@ function App({
514232
514659
  setExitSessionId(hasContent ? getAppSessionId() : null);
514233
514660
  }
514234
514661
  }, [tabMgr.activeTabId]);
514235
- import_react166.useEffect(() => {
514662
+ import_react167.useEffect(() => {
514236
514663
  if (tabMgr.tabCount <= 1)
514237
514664
  return;
514238
514665
  (async () => {
@@ -514250,7 +514677,7 @@ function App({
514250
514677
  } catch {}
514251
514678
  })();
514252
514679
  }, [tabMgr.tabCount, tabMgr.activeTabId]);
514253
- const { displayProvider, displayModel, isGateway, isProxy } = import_react166.useMemo(() => {
514680
+ const { displayProvider, displayModel, isGateway, isProxy } = import_react167.useMemo(() => {
514254
514681
  const model = activeModelForHeader;
514255
514682
  if (model === "none") {
514256
514683
  return {
@@ -514281,12 +514708,12 @@ function App({
514281
514708
  isProxy: false
514282
514709
  };
514283
514710
  }, [activeModelForHeader]);
514284
- import_react166.useEffect(() => {
514711
+ import_react167.useEffect(() => {
514285
514712
  if (nvimError && nvimError !== "neovim-not-found") {
514286
514713
  addSystemMessage(`Neovim error: ${nvimError}`);
514287
514714
  }
514288
514715
  }, [nvimError]);
514289
- import_react166.useEffect(() => {
514716
+ import_react167.useEffect(() => {
514290
514717
  const memMgr = contextManager.getMemoryManager();
514291
514718
  const { project: project2, global: global2 } = memMgr.getLegacyBackupPaths();
514292
514719
  const parts2 = [];
@@ -514298,7 +514725,7 @@ function App({
514298
514725
  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
514726
  }
514300
514727
  }, []);
514301
- const handleNewSession = import_react166.useCallback(async () => {
514728
+ const handleNewSession = import_react167.useCallback(async () => {
514302
514729
  const activeChat = tabMgrRef.current?.getActiveChat();
514303
514730
  const hasContent = activeChat?.messages.some((m6) => m6.role === "user" || m6.role === "assistant");
514304
514731
  if (hasContent && activeChat) {
@@ -514347,7 +514774,7 @@ function App({
514347
514774
  cpStore.skipCleanup(tab.id);
514348
514775
  restart();
514349
514776
  }, [cwd2, sessionManager]);
514350
- const handleTabCommand = import_react166.useCallback((input, chat) => {
514777
+ const handleTabCommand = import_react167.useCallback((input, chat) => {
514351
514778
  const cmd = input.trim().toLowerCase().split(/\s+/)[0] ?? "";
514352
514779
  const twoWord = input.trim().toLowerCase().split(/\s+/).slice(0, 2).join(" ");
514353
514780
  if (chat.isLoading && (ABORT_ON_LOADING.has(cmd) || ABORT_ON_LOADING.has(twoWord))) {
@@ -514484,7 +514911,7 @@ function App({
514484
514911
  handleNewSession,
514485
514912
  effectiveConfig.watchdog
514486
514913
  ]);
514487
- const closeLlmSelector = import_react166.useCallback(() => {
514914
+ const closeLlmSelector = import_react167.useCallback(() => {
514488
514915
  const wasPickingSlot = useUIStore.getState().routerSlotPicking != null;
514489
514916
  const wasFallbackForModel = useUIStore.getState().fallbackForModel != null;
514490
514917
  const wasFromWizard = wizardOpenedLlm.current;
@@ -514498,12 +514925,12 @@ function App({
514498
514925
  useUIStore.getState().openModal("firstRunWizard");
514499
514926
  }
514500
514927
  }, []);
514501
- const closeInfoPopup = import_react166.useCallback(() => {
514928
+ const closeInfoPopup = import_react167.useCallback(() => {
514502
514929
  const cfg = useUIStore.getState().infoPopupConfig;
514503
514930
  useUIStore.getState().closeInfoPopup();
514504
514931
  cfg?.onClose?.();
514505
514932
  }, []);
514506
- const onGitMenuCommit = import_react166.useCallback(() => {
514933
+ const onGitMenuCommit = import_react167.useCallback(() => {
514507
514934
  useUIStore.getState().closeModal("gitMenu");
514508
514935
  useUIStore.getState().openModal("gitCommit");
514509
514936
  }, []);
@@ -514516,7 +514943,7 @@ function App({
514516
514943
  renderer: renderer2,
514517
514944
  copySelection,
514518
514945
  activeChatRef,
514519
- cycleMode: import_react166.useCallback(() => {
514946
+ cycleMode: import_react167.useCallback(() => {
514520
514947
  const chat = tabMgrRef.current?.getActiveChat();
514521
514948
  if (chat) {
514522
514949
  const next = chat.cycleMode();
@@ -515149,7 +515576,7 @@ function App({
515149
515576
  ]
515150
515577
  }, undefined, true, undefined, this);
515151
515578
  }
515152
- var import_react166, ABORT_ON_LOADING, DEFAULT_TASK_ROUTER, SHUTDOWN_STEPS, KITTY_PROTOCOL_RESPONSE_RE;
515579
+ var import_react167, ABORT_ON_LOADING, DEFAULT_TASK_ROUTER, SHUTDOWN_STEPS, KITTY_PROTOCOL_RESPONSE_RE;
515153
515580
  var init_App = __esm(async () => {
515154
515581
  init_shallow2();
515155
515582
  init_config2();
@@ -515233,7 +515660,7 @@ var init_App = __esm(async () => {
515233
515660
  init_MemoryBrowser(),
515234
515661
  init_DialogHost()
515235
515662
  ]);
515236
- import_react166 = __toESM(require_react(), 1);
515663
+ import_react167 = __toESM(require_react(), 1);
515237
515664
  startMemoryPoll();
515238
515665
  ABORT_ON_LOADING = new Set([
515239
515666
  "/clear",