@ottocode/web-sdk 0.1.302 → 0.1.304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (188) hide show
  1. package/dist/components/branch/BranchModal.d.ts +1 -1
  2. package/dist/components/branch/BranchModal.d.ts.map +1 -1
  3. package/dist/components/browser/BrowserViewerPanel.d.ts +1 -1
  4. package/dist/components/browser/BrowserViewerPanel.d.ts.map +1 -1
  5. package/dist/components/chat/CommandSuggestionsPopup.d.ts +1 -1
  6. package/dist/components/chat/CommandSuggestionsPopup.d.ts.map +1 -1
  7. package/dist/components/chat/ConfigModal.d.ts +1 -1
  8. package/dist/components/chat/ConfigModal.d.ts.map +1 -1
  9. package/dist/components/chat/ConfigSelector.d.ts +1 -1
  10. package/dist/components/chat/ConfigSelector.d.ts.map +1 -1
  11. package/dist/components/chat/FileMentionPopup.d.ts +1 -1
  12. package/dist/components/chat/FileMentionPopup.d.ts.map +1 -1
  13. package/dist/components/chat/LiveWaveform.d.ts +1 -1
  14. package/dist/components/chat/LiveWaveform.d.ts.map +1 -1
  15. package/dist/components/chat/ReasoningTabs.d.ts +1 -1
  16. package/dist/components/chat/ReasoningTabs.d.ts.map +1 -1
  17. package/dist/components/chat/ShortcutsModal.d.ts +1 -1
  18. package/dist/components/chat/ShortcutsModal.d.ts.map +1 -1
  19. package/dist/components/chat/SkillMentionPopup.d.ts +1 -1
  20. package/dist/components/chat/SkillMentionPopup.d.ts.map +1 -1
  21. package/dist/components/chat/StopButton.d.ts +1 -1
  22. package/dist/components/chat/StopButton.d.ts.map +1 -1
  23. package/dist/components/common/FileTypeIcon.d.ts +1 -1
  24. package/dist/components/common/FileTypeIcon.d.ts.map +1 -1
  25. package/dist/components/dashboard/UsageDashboard.d.ts +1 -1
  26. package/dist/components/dashboard/UsageDashboard.d.ts.map +1 -1
  27. package/dist/components/git/GitBranchSwitcher.d.ts +1 -1
  28. package/dist/components/git/GitBranchSwitcher.d.ts.map +1 -1
  29. package/dist/components/git/GitCommitModal.d.ts +1 -1
  30. package/dist/components/git/GitCommitModal.d.ts.map +1 -1
  31. package/dist/components/git/GitCreateBranchModal.d.ts +1 -1
  32. package/dist/components/git/GitCreateBranchModal.d.ts.map +1 -1
  33. package/dist/components/git/GitDiffViewer.d.ts +1 -1
  34. package/dist/components/git/GitDiffViewer.d.ts.map +1 -1
  35. package/dist/components/git/GitFileItem.d.ts +1 -1
  36. package/dist/components/git/GitFileItem.d.ts.map +1 -1
  37. package/dist/components/git/GitFileList.d.ts +1 -1
  38. package/dist/components/git/GitFileList.d.ts.map +1 -1
  39. package/dist/components/git/GitFileTree.d.ts +1 -1
  40. package/dist/components/git/GitFileTree.d.ts.map +1 -1
  41. package/dist/components/index.js +330 -282
  42. package/dist/components/index.js.map +11 -11
  43. package/dist/components/messages/ActionToolBox.d.ts +1 -1
  44. package/dist/components/messages/ActionToolBox.d.ts.map +1 -1
  45. package/dist/components/messages/CompactActivityGroup.d.ts +1 -1
  46. package/dist/components/messages/CompactActivityGroup.d.ts.map +1 -1
  47. package/dist/components/messages/CompactionSummaryBox.d.ts +1 -1
  48. package/dist/components/messages/CompactionSummaryBox.d.ts.map +1 -1
  49. package/dist/components/messages/MessagePartItem.d.ts.map +1 -1
  50. package/dist/components/messages/renderers/ApplyPatchRenderer.d.ts +1 -1
  51. package/dist/components/messages/renderers/ApplyPatchRenderer.d.ts.map +1 -1
  52. package/dist/components/messages/renderers/BashRenderer.d.ts +1 -1
  53. package/dist/components/messages/renderers/BashRenderer.d.ts.map +1 -1
  54. package/dist/components/messages/renderers/CopyAttachmentRenderer.d.ts +1 -1
  55. package/dist/components/messages/renderers/CopyAttachmentRenderer.d.ts.map +1 -1
  56. package/dist/components/messages/renderers/CopyIntoRenderer.d.ts +1 -1
  57. package/dist/components/messages/renderers/CopyIntoRenderer.d.ts.map +1 -1
  58. package/dist/components/messages/renderers/DatabaseToolRenderer.d.ts +1 -1
  59. package/dist/components/messages/renderers/DatabaseToolRenderer.d.ts.map +1 -1
  60. package/dist/components/messages/renderers/DebugRenderer.d.ts +1 -1
  61. package/dist/components/messages/renderers/DebugRenderer.d.ts.map +1 -1
  62. package/dist/components/messages/renderers/DiffView.d.ts +1 -1
  63. package/dist/components/messages/renderers/DiffView.d.ts.map +1 -1
  64. package/dist/components/messages/renderers/ErrorRenderer.d.ts +1 -2
  65. package/dist/components/messages/renderers/ErrorRenderer.d.ts.map +1 -1
  66. package/dist/components/messages/renderers/FinishRenderer.d.ts +1 -1
  67. package/dist/components/messages/renderers/FinishRenderer.d.ts.map +1 -1
  68. package/dist/components/messages/renderers/GenericRenderer.d.ts +1 -1
  69. package/dist/components/messages/renderers/GenericRenderer.d.ts.map +1 -1
  70. package/dist/components/messages/renderers/GitCommitRenderer.d.ts +1 -1
  71. package/dist/components/messages/renderers/GitCommitRenderer.d.ts.map +1 -1
  72. package/dist/components/messages/renderers/GitDiffRenderer.d.ts +1 -1
  73. package/dist/components/messages/renderers/GitDiffRenderer.d.ts.map +1 -1
  74. package/dist/components/messages/renderers/GitStatusRenderer.d.ts +1 -1
  75. package/dist/components/messages/renderers/GitStatusRenderer.d.ts.map +1 -1
  76. package/dist/components/messages/renderers/ListRenderer.d.ts +1 -1
  77. package/dist/components/messages/renderers/ListRenderer.d.ts.map +1 -1
  78. package/dist/components/messages/renderers/LoadMcpToolsRenderer.d.ts +1 -1
  79. package/dist/components/messages/renderers/LoadMcpToolsRenderer.d.ts.map +1 -1
  80. package/dist/components/messages/renderers/LoadToolsRenderer.d.ts +1 -1
  81. package/dist/components/messages/renderers/LoadToolsRenderer.d.ts.map +1 -1
  82. package/dist/components/messages/renderers/McpToolRenderer.d.ts +1 -1
  83. package/dist/components/messages/renderers/McpToolRenderer.d.ts.map +1 -1
  84. package/dist/components/messages/renderers/ProgressUpdateRenderer.d.ts +1 -1
  85. package/dist/components/messages/renderers/ProgressUpdateRenderer.d.ts.map +1 -1
  86. package/dist/components/messages/renderers/ReadImageRenderer.d.ts +1 -1
  87. package/dist/components/messages/renderers/ReadImageRenderer.d.ts.map +1 -1
  88. package/dist/components/messages/renderers/ReadRenderer.d.ts +1 -1
  89. package/dist/components/messages/renderers/ReadRenderer.d.ts.map +1 -1
  90. package/dist/components/messages/renderers/ReasoningRenderer.d.ts +1 -1
  91. package/dist/components/messages/renderers/ReasoningRenderer.d.ts.map +1 -1
  92. package/dist/components/messages/renderers/SearchRenderer.d.ts +1 -1
  93. package/dist/components/messages/renderers/SearchRenderer.d.ts.map +1 -1
  94. package/dist/components/messages/renderers/SimulatorRenderer.d.ts +1 -1
  95. package/dist/components/messages/renderers/SimulatorRenderer.d.ts.map +1 -1
  96. package/dist/components/messages/renderers/SkillRenderer.d.ts +1 -1
  97. package/dist/components/messages/renderers/SkillRenderer.d.ts.map +1 -1
  98. package/dist/components/messages/renderers/TerminalRenderer.d.ts +1 -1
  99. package/dist/components/messages/renderers/TerminalRenderer.d.ts.map +1 -1
  100. package/dist/components/messages/renderers/TodosRenderer.d.ts +1 -1
  101. package/dist/components/messages/renderers/TodosRenderer.d.ts.map +1 -1
  102. package/dist/components/messages/renderers/ToolErrorDisplay.d.ts +1 -1
  103. package/dist/components/messages/renderers/ToolErrorDisplay.d.ts.map +1 -1
  104. package/dist/components/messages/renderers/TreeRenderer.d.ts +1 -1
  105. package/dist/components/messages/renderers/TreeRenderer.d.ts.map +1 -1
  106. package/dist/components/messages/renderers/WebSearchRenderer.d.ts +1 -1
  107. package/dist/components/messages/renderers/WebSearchRenderer.d.ts.map +1 -1
  108. package/dist/components/messages/renderers/WriteRenderer.d.ts +1 -1
  109. package/dist/components/messages/renderers/WriteRenderer.d.ts.map +1 -1
  110. package/dist/components/messages/renderers/index.d.ts +1 -1
  111. package/dist/components/messages/renderers/index.d.ts.map +1 -1
  112. package/dist/components/messages/renderers/shared/CopyButton.d.ts +1 -1
  113. package/dist/components/messages/renderers/shared/CopyButton.d.ts.map +1 -1
  114. package/dist/components/messages/renderers/shared/ImagePreview.d.ts +1 -1
  115. package/dist/components/messages/renderers/shared/ImagePreview.d.ts.map +1 -1
  116. package/dist/components/messages/renderers/shared/ToolContentBox.d.ts +1 -1
  117. package/dist/components/messages/renderers/shared/ToolContentBox.d.ts.map +1 -1
  118. package/dist/components/messages/renderers/shared/ToolHeader.d.ts +6 -6
  119. package/dist/components/messages/renderers/shared/ToolHeader.d.ts.map +1 -1
  120. package/dist/components/messages/threadDensity.d.ts +1 -1
  121. package/dist/components/messages/threadDensity.d.ts.map +1 -1
  122. package/dist/components/sessions/EditableTitle.d.ts +1 -1
  123. package/dist/components/sessions/EditableTitle.d.ts.map +1 -1
  124. package/dist/components/sessions/LeanHeader.d.ts +1 -1
  125. package/dist/components/sessions/LeanHeader.d.ts.map +1 -1
  126. package/dist/components/sessions/SessionHeader.d.ts +1 -1
  127. package/dist/components/sessions/SessionHeader.d.ts.map +1 -1
  128. package/dist/components/tunnel/TunnelSidebar.d.ts.map +1 -1
  129. package/dist/components/ui/CodeMirrorViewer.d.ts +1 -1
  130. package/dist/components/ui/CodeMirrorViewer.d.ts.map +1 -1
  131. package/dist/components/ui/ConfirmationDialog.d.ts +1 -1
  132. package/dist/components/ui/ConfirmationDialog.d.ts.map +1 -1
  133. package/dist/components/ui/Modal.d.ts +1 -1
  134. package/dist/components/ui/Modal.d.ts.map +1 -1
  135. package/dist/components/ui/SidebarHeader.d.ts +1 -1
  136. package/dist/components/ui/SidebarHeader.d.ts.map +1 -1
  137. package/dist/components/ui/StableSpinner.d.ts +1 -1
  138. package/dist/components/ui/StableSpinner.d.ts.map +1 -1
  139. package/dist/components/ui/Toaster.d.ts +1 -1
  140. package/dist/components/ui/Toaster.d.ts.map +1 -1
  141. package/dist/components/ui/ToolApprovalDialog.d.ts +1 -1
  142. package/dist/components/ui/ToolApprovalDialog.d.ts.map +1 -1
  143. package/dist/components/workspace/ToolActivityToggle.d.ts +1 -1
  144. package/dist/components/workspace/ToolActivityToggle.d.ts.map +1 -1
  145. package/dist/components/workspace/ToolPreviewPanel.d.ts +1 -1
  146. package/dist/components/workspace/ToolPreviewPanel.d.ts.map +1 -1
  147. package/dist/components/workspace/ViewerStatusBar.d.ts +4 -4
  148. package/dist/components/workspace/ViewerStatusBar.d.ts.map +1 -1
  149. package/dist/hooks/index.js +62 -8
  150. package/dist/hooks/index.js.map +4 -4
  151. package/dist/hooks/useAgents.d.ts +6 -6
  152. package/dist/hooks/useAgents.d.ts.map +1 -1
  153. package/dist/hooks/useBranch.d.ts +2 -2
  154. package/dist/hooks/useBranch.d.ts.map +1 -1
  155. package/dist/hooks/useConfig.d.ts +5 -5
  156. package/dist/hooks/useConfig.d.ts.map +1 -1
  157. package/dist/hooks/useDictationModels.d.ts +1 -1
  158. package/dist/hooks/useFileBrowser.d.ts +5 -5
  159. package/dist/hooks/useFileBrowser.d.ts.map +1 -1
  160. package/dist/hooks/useFiles.d.ts +2 -2
  161. package/dist/hooks/useFiles.d.ts.map +1 -1
  162. package/dist/hooks/useGit.d.ts +5 -5
  163. package/dist/hooks/useGit.d.ts.map +1 -1
  164. package/dist/hooks/useMCP.d.ts +3 -3
  165. package/dist/hooks/useMCP.d.ts.map +1 -1
  166. package/dist/hooks/useMessages.d.ts +1 -1
  167. package/dist/hooks/useMessages.d.ts.map +1 -1
  168. package/dist/hooks/useResearch.d.ts +1 -1
  169. package/dist/hooks/useResearch.d.ts.map +1 -1
  170. package/dist/hooks/useSessionFiles.d.ts +1 -1
  171. package/dist/hooks/useSessionFiles.d.ts.map +1 -1
  172. package/dist/hooks/useSimulator.d.ts +1 -1
  173. package/dist/hooks/useSimulator.d.ts.map +1 -1
  174. package/dist/hooks/useSkills.d.ts +6 -6
  175. package/dist/hooks/useSkills.d.ts.map +1 -1
  176. package/dist/hooks/useTerminals.d.ts +2 -2
  177. package/dist/hooks/useTerminals.d.ts.map +1 -1
  178. package/dist/hooks/useTunnel.d.ts +2 -2
  179. package/dist/hooks/useTunnel.d.ts.map +1 -1
  180. package/dist/index.js +343 -295
  181. package/dist/index.js.map +11 -11
  182. package/dist/stores/gitStore.d.ts +4 -0
  183. package/dist/stores/gitStore.d.ts.map +1 -1
  184. package/dist/stores/index.js +43 -1
  185. package/dist/stores/index.js.map +3 -3
  186. package/dist/types/api.d.ts +3 -0
  187. package/dist/types/api.d.ts.map +1 -1
  188. package/package.json +39 -39
package/dist/index.js CHANGED
@@ -4413,6 +4413,8 @@ var useGitStore = create12((set) => ({
4413
4413
  isCommitModalOpen: false,
4414
4414
  commitSessionId: null,
4415
4415
  wasSessionListCollapsed: false,
4416
+ gitTreeKnownFolders: {},
4417
+ gitTreeExpandedFolders: {},
4416
4418
  gitTreeSections: {},
4417
4419
  gitTreeRows: [],
4418
4420
  toggleSidebar: () => {
@@ -4457,6 +4459,46 @@ var useGitStore = create12((set) => ({
4457
4459
  closeCommitModal: () => set({ isCommitModalOpen: false, commitSessionId: null }),
4458
4460
  setActiveSessionId: (sessionId) => set({ activeSessionId: sessionId }),
4459
4461
  setSessionListCollapsed: (collapsed) => set({ wasSessionListCollapsed: collapsed }),
4462
+ syncGitTreeFolders: (sectionId, paths) => set((state) => {
4463
+ const knownFolders = state.gitTreeKnownFolders[sectionId] ?? new Set;
4464
+ const expandedFolders = state.gitTreeExpandedFolders[sectionId] ?? new Set;
4465
+ let changed = false;
4466
+ const nextKnownFolders = new Set(knownFolders);
4467
+ const nextExpandedFolders = new Set(expandedFolders);
4468
+ for (const path of paths) {
4469
+ if (!nextKnownFolders.has(path)) {
4470
+ nextKnownFolders.add(path);
4471
+ nextExpandedFolders.add(path);
4472
+ changed = true;
4473
+ }
4474
+ }
4475
+ if (!changed)
4476
+ return state;
4477
+ return {
4478
+ gitTreeKnownFolders: {
4479
+ ...state.gitTreeKnownFolders,
4480
+ [sectionId]: nextKnownFolders
4481
+ },
4482
+ gitTreeExpandedFolders: {
4483
+ ...state.gitTreeExpandedFolders,
4484
+ [sectionId]: nextExpandedFolders
4485
+ }
4486
+ };
4487
+ }),
4488
+ toggleGitTreeFolder: (sectionId, path) => set((state) => {
4489
+ const expandedFolders = state.gitTreeExpandedFolders[sectionId] ?? new Set;
4490
+ const nextExpandedFolders = new Set(expandedFolders);
4491
+ if (nextExpandedFolders.has(path))
4492
+ nextExpandedFolders.delete(path);
4493
+ else
4494
+ nextExpandedFolders.add(path);
4495
+ return {
4496
+ gitTreeExpandedFolders: {
4497
+ ...state.gitTreeExpandedFolders,
4498
+ [sectionId]: nextExpandedFolders
4499
+ }
4500
+ };
4501
+ }),
4460
4502
  setGitTreeSectionRows: (sectionId, rows) => set((state) => {
4461
4503
  if (areGitTreeRowsEqual(state.gitTreeSections[sectionId], rows)) {
4462
4504
  return state;
@@ -12479,7 +12521,7 @@ function normalizeToolTarget(toolName, args) {
12479
12521
  apply_patch: ["path"],
12480
12522
  glob: ["pattern"],
12481
12523
  grep: ["query", "pattern"],
12482
- ripgrep: ["query", "pattern"],
12524
+ search: ["query", "pattern"],
12483
12525
  shell: ["cmd", "command"],
12484
12526
  bash: ["cmd", "command"],
12485
12527
  terminal: ["command"],
@@ -17590,7 +17632,8 @@ var TOOL_NAME_ALIASES = {
17590
17632
  Cd: "cd",
17591
17633
  Pwd: "pwd",
17592
17634
  Glob: "glob",
17593
- Grep: "ripgrep",
17635
+ Grep: "search",
17636
+ Search: "search",
17594
17637
  Shell: "shell",
17595
17638
  Bash: "shell",
17596
17639
  bash: "shell",
@@ -17709,7 +17752,7 @@ function ToolResultRenderer({
17709
17752
  return /* @__PURE__ */ jsx67(TreeRenderer, {
17710
17753
  ...props
17711
17754
  });
17712
- case "ripgrep":
17755
+ case "search":
17713
17756
  case "grep":
17714
17757
  case "glob":
17715
17758
  return /* @__PURE__ */ jsx67(SearchRenderer, {
@@ -18028,7 +18071,7 @@ var MessagePartItem = memo13(function MessagePartItem2({
18028
18071
  return /* @__PURE__ */ jsx69(Terminal5, {
18029
18072
  className: "h-4 w-4 text-muted-foreground"
18030
18073
  });
18031
- if (toolName === "ripgrep" || toolName === "grep" || toolName === "glob")
18074
+ if (toolName === "search" || toolName === "grep" || toolName === "glob")
18032
18075
  return /* @__PURE__ */ jsx69(Search5, {
18033
18076
  className: "h-4 w-4 text-amber-600 dark:text-amber-300"
18034
18077
  });
@@ -18340,7 +18383,7 @@ var EXPLORATION_TOOL_NAMES = new Set([
18340
18383
  "read",
18341
18384
  "ls",
18342
18385
  "tree",
18343
- "ripgrep",
18386
+ "search",
18344
18387
  "grep",
18345
18388
  "glob",
18346
18389
  "websearch",
@@ -18461,7 +18504,7 @@ function getCompactActivityEntry(part) {
18461
18504
  completedAt: part.completedAt
18462
18505
  };
18463
18506
  }
18464
- if (part.toolName === "ripgrep" || part.toolName === "grep" || part.toolName === "glob") {
18507
+ if (part.toolName === "search" || part.toolName === "grep" || part.toolName === "glob") {
18465
18508
  const query = getStringField(args, "query", "pattern", "filePattern") || getStringField(result, "query", "pattern");
18466
18509
  return {
18467
18510
  id: part.id,
@@ -18629,7 +18672,7 @@ function summarizeCompactActivities(entries) {
18629
18672
  case "tree":
18630
18673
  scans += 1;
18631
18674
  break;
18632
- case "ripgrep":
18675
+ case "search":
18633
18676
  case "grep":
18634
18677
  case "glob":
18635
18678
  searches += 1;
@@ -24938,12 +24981,7 @@ function GitDiffViewer({ diff: diff2 }) {
24938
24981
  import { GitCommit as GitCommit3, CheckSquare, AlertTriangle as AlertTriangle2 } from "lucide-react";
24939
24982
 
24940
24983
  // src/components/git/GitFileTree.tsx
24941
- import {
24942
- useCallback as useCallback29,
24943
- useEffect as useEffect41,
24944
- useMemo as useMemo25,
24945
- useState as useState42
24946
- } from "react";
24984
+ import { useCallback as useCallback29, useEffect as useEffect41, useMemo as useMemo25, useRef as useRef27 } from "react";
24947
24985
  import { ChevronDown as ChevronDown8, ChevronRight as ChevronRight12, Folder as Folder2 } from "lucide-react";
24948
24986
 
24949
24987
  // src/components/git/GitFileItem.tsx
@@ -25334,28 +25372,25 @@ function GitFileTree({
25334
25372
  showModifiedIndicator
25335
25373
  }) {
25336
25374
  const tree = useMemo25(() => buildTree(files), [files]);
25337
- const [expanded, setExpanded] = useState42(() => getInitialExpanded(tree));
25375
+ const folderPaths = useMemo25(() => getInitialExpanded(tree), [tree]);
25338
25376
  const currentFocus = useFocusStore((state) => state.currentFocus);
25339
25377
  const gitFileIndex = useFocusStore((state) => state.gitFileIndex);
25378
+ const expandedFolders = useGitStore((state) => state.gitTreeExpandedFolders[sectionId]);
25340
25379
  const gitTreeRows = useGitStore((state) => state.gitTreeRows);
25380
+ const syncGitTreeFolders = useGitStore((state) => state.syncGitTreeFolders);
25381
+ const toggleGitTreeFolder = useGitStore((state) => state.toggleGitTreeFolder);
25341
25382
  const setGitTreeSectionRows = useGitStore((state) => state.setGitTreeSectionRows);
25383
+ const expanded = expandedFolders ?? folderPaths;
25384
+ const lastScrolledFocusedRowIdRef = useRef27(null);
25342
25385
  useEffect41(() => {
25343
- const folderPaths = getInitialExpanded(tree);
25344
- setExpanded((prev) => {
25345
- const hasNewFolder = [...folderPaths].some((path) => !prev.has(path));
25346
- return hasNewFolder ? new Set([...folderPaths, ...prev]) : prev;
25347
- });
25348
- }, [tree]);
25349
- const toggleExpanded = useCallback29((path) => {
25350
- setExpanded((prev) => {
25351
- const next = new Set(prev);
25352
- if (next.has(path))
25353
- next.delete(path);
25354
- else
25355
- next.add(path);
25356
- return next;
25357
- });
25358
- }, []);
25386
+ syncGitTreeFolders(sectionId, [...folderPaths]);
25387
+ }, [sectionId, folderPaths, syncGitTreeFolders]);
25388
+ useEffect41(() => {
25389
+ if (currentFocus !== "git") {
25390
+ lastScrolledFocusedRowIdRef.current = null;
25391
+ }
25392
+ }, [currentFocus]);
25393
+ const toggleExpanded = useCallback29((path) => toggleGitTreeFolder(sectionId, path), [sectionId, toggleGitTreeFolder]);
25359
25394
  const visibleRows = useMemo25(() => collectVisibleRows(tree, sectionId, staged, expanded, toggleExpanded), [tree, sectionId, staged, expanded, toggleExpanded]);
25360
25395
  useEffect41(() => {
25361
25396
  setGitTreeSectionRows(sectionId, visibleRows);
@@ -25363,8 +25398,9 @@ function GitFileTree({
25363
25398
  }, [sectionId, visibleRows, setGitTreeSectionRows]);
25364
25399
  const focusedRow = currentFocus === "git" ? gitTreeRows[gitFileIndex] : undefined;
25365
25400
  const isRowFocused = (id) => focusedRow?.id === id;
25366
- const scrollFocusedRow = (element, focused) => {
25367
- if (element && focused) {
25401
+ const scrollFocusedRow = (element, focused, id) => {
25402
+ if (element && focused && lastScrolledFocusedRowIdRef.current !== id) {
25403
+ lastScrolledFocusedRowIdRef.current = id;
25368
25404
  element.scrollIntoView({ block: "nearest", behavior: "smooth" });
25369
25405
  }
25370
25406
  };
@@ -25373,7 +25409,7 @@ function GitFileTree({
25373
25409
  const focused = isRowFocused(rowId);
25374
25410
  if (node.type === "file") {
25375
25411
  return /* @__PURE__ */ jsx93("div", {
25376
- ref: (el) => scrollFocusedRow(el, focused),
25412
+ ref: (el) => scrollFocusedRow(el, focused, rowId),
25377
25413
  className: focused ? "ring-1 ring-inset ring-primary/40" : "",
25378
25414
  children: /* @__PURE__ */ jsx93(GitFileItem, {
25379
25415
  file: node.file,
@@ -25388,7 +25424,7 @@ function GitFileTree({
25388
25424
  return /* @__PURE__ */ jsxs80("div", {
25389
25425
  children: [
25390
25426
  /* @__PURE__ */ jsxs80("div", {
25391
- ref: (el) => scrollFocusedRow(el, focused),
25427
+ ref: (el) => scrollFocusedRow(el, focused, rowId),
25392
25428
  className: `flex items-center gap-2 px-3 py-1.5 h-8 text-left hover:bg-muted/50 transition-colors group ${focused ? "ring-1 ring-inset ring-primary/40 bg-muted/50" : ""}`,
25393
25429
  children: [
25394
25430
  depth > 0 && /* @__PURE__ */ jsx93("span", {
@@ -25596,7 +25632,7 @@ function GitFileList({ status }) {
25596
25632
  });
25597
25633
  }
25598
25634
  // src/components/git/GitSidebar.tsx
25599
- import { memo as memo26, useCallback as useCallback31, useEffect as useEffect44, useState as useState45 } from "react";
25635
+ import { memo as memo26, useCallback as useCallback31, useEffect as useEffect44, useState as useState44 } from "react";
25600
25636
  import {
25601
25637
  FolderGit2,
25602
25638
  ChevronRight as ChevronRight13,
@@ -25618,14 +25654,14 @@ import {
25618
25654
  useEffect as useEffect43,
25619
25655
  useId as useId3,
25620
25656
  useMemo as useMemo27,
25621
- useRef as useRef28,
25622
- useState as useState44
25657
+ useRef as useRef29,
25658
+ useState as useState43
25623
25659
  } from "react";
25624
25660
  import { AnimatePresence as AnimatePresence2, motion as motion3 } from "motion/react";
25625
25661
  import { Check as Check12, GitBranch as GitBranch9, Plus as Plus3, RefreshCw as RefreshCw6, Search as Search7 } from "lucide-react";
25626
25662
 
25627
25663
  // src/components/git/GitCreateBranchModal.tsx
25628
- import { useEffect as useEffect42, useId as useId2, useRef as useRef27, useState as useState43 } from "react";
25664
+ import { useEffect as useEffect42, useId as useId2, useRef as useRef28, useState as useState42 } from "react";
25629
25665
  import { GitBranch as GitBranch8 } from "lucide-react";
25630
25666
  import { jsx as jsx95, jsxs as jsxs82, Fragment as Fragment41 } from "react/jsx-runtime";
25631
25667
  var INVALID_BRANCH_PATTERN = /[\s~^:?*[\]\\]/;
@@ -25654,10 +25690,10 @@ function GitCreateBranchModal({
25654
25690
  }) {
25655
25691
  const inputId = useId2();
25656
25692
  const createBranch = useCreateGitBranch();
25657
- const [name, setName] = useState43(defaultName);
25658
- const [checkout, setCheckout] = useState43(true);
25659
- const [error, setError] = useState43(null);
25660
- const inputRef = useRef27(null);
25693
+ const [name, setName] = useState42(defaultName);
25694
+ const [checkout, setCheckout] = useState42(true);
25695
+ const [error, setError] = useState42(null);
25696
+ const inputRef = useRef28(null);
25661
25697
  useEffect42(() => {
25662
25698
  if (isOpen) {
25663
25699
  setName(defaultName);
@@ -25829,17 +25865,17 @@ function GitBranchSwitcher({
25829
25865
  isDetached,
25830
25866
  shortHeadSha
25831
25867
  }) {
25832
- const [isOpen, setIsOpen] = useState44(false);
25833
- const [showCreate, setShowCreate] = useState44(false);
25834
- const [query, setQuery] = useState44("");
25835
- const [activeIndex, setActiveIndex] = useState44(0);
25836
- const [actionError, setActionError] = useState44(null);
25868
+ const [isOpen, setIsOpen] = useState43(false);
25869
+ const [showCreate, setShowCreate] = useState43(false);
25870
+ const [query, setQuery] = useState43("");
25871
+ const [activeIndex, setActiveIndex] = useState43(0);
25872
+ const [actionError, setActionError] = useState43(null);
25837
25873
  const searchId = useId3();
25838
- const popoverRef = useRef28(null);
25839
- const triggerRef = useRef28(null);
25840
- const listRef = useRef28(null);
25841
- const itemRefs = useRef28(new Map);
25842
- const searchInputRef = useRef28(null);
25874
+ const popoverRef = useRef29(null);
25875
+ const triggerRef = useRef29(null);
25876
+ const listRef = useRef29(null);
25877
+ const itemRefs = useRef29(new Map);
25878
+ const searchInputRef = useRef29(null);
25843
25879
  const {
25844
25880
  data,
25845
25881
  isLoading: branchesLoading,
@@ -26105,12 +26141,12 @@ var GitSidebarContent = memo26(function GitSidebarContent2({
26105
26141
  const rebaseMutation = useGitRebaseAction();
26106
26142
  const addRemoteMutation = useAddRemote();
26107
26143
  const removeRemoteMutation = useRemoveRemote();
26108
- const [errors, setErrors] = useState45([]);
26109
- const [showRemotes, setShowRemotes] = useState45(false);
26110
- const [showAddRemote, setShowAddRemote] = useState45(false);
26111
- const [remoteName, setRemoteName] = useState45("origin");
26112
- const [remoteUrl, setRemoteUrl] = useState45("");
26113
- const [confirmRemoveRemote, setConfirmRemoveRemote] = useState45(null);
26144
+ const [errors, setErrors] = useState44([]);
26145
+ const [showRemotes, setShowRemotes] = useState44(false);
26146
+ const [showAddRemote, setShowAddRemote] = useState44(false);
26147
+ const [remoteName, setRemoteName] = useState44("origin");
26148
+ const [remoteUrl, setRemoteUrl] = useState44("");
26149
+ const [confirmRemoveRemote, setConfirmRemoveRemote] = useState44(null);
26114
26150
  useEffect44(() => {
26115
26151
  queryClient.invalidateQueries({ queryKey: ["git", "status"] });
26116
26152
  }, [queryClient]);
@@ -26629,10 +26665,10 @@ import { GitBranch as GitBranch11 } from "lucide-react";
26629
26665
  import { memo as memo27 } from "react";
26630
26666
 
26631
26667
  // src/hooks/useShortcutHintsVisible.ts
26632
- import { useEffect as useEffect45, useState as useState46 } from "react";
26668
+ import { useEffect as useEffect45, useState as useState45 } from "react";
26633
26669
  var SHORTCUT_HINT_MODIFIERS = new Set(["Control", "Meta"]);
26634
26670
  function useShortcutHintsVisible() {
26635
- const [isVisible, setIsVisible] = useState46(false);
26671
+ const [isVisible, setIsVisible] = useState45(false);
26636
26672
  useEffect45(() => {
26637
26673
  const handleKeyDown = (event) => {
26638
26674
  if (SHORTCUT_HINT_MODIFIERS.has(event.key) || event.ctrlKey || event.metaKey) {
@@ -26699,7 +26735,7 @@ var GitSidebarToggle = memo28(function GitSidebarToggle2() {
26699
26735
  });
26700
26736
  });
26701
26737
  // src/components/git/GitDiffPanel.tsx
26702
- import { useEffect as useEffect46, memo as memo29, useState as useState47 } from "react";
26738
+ import { useEffect as useEffect46, memo as memo29, useState as useState46 } from "react";
26703
26739
  import { X as X17, Maximize2, Minimize2 as Minimize22 } from "lucide-react";
26704
26740
 
26705
26741
  // src/hooks/useFileBrowser.ts
@@ -26750,7 +26786,7 @@ var GitDiffPanel = memo29(function GitDiffPanel2({
26750
26786
  const selectedFileStaged = staged ?? storeSelectedFileStaged;
26751
26787
  const closeDiff = onClose ?? storeCloseDiff;
26752
26788
  const { data: diff2, isLoading } = useGitDiff(selectedFile, selectedFileStaged);
26753
- const [showFullFile, setShowFullFile] = useState47(false);
26789
+ const [showFullFile, setShowFullFile] = useState46(false);
26754
26790
  const { data: fullFileDiff, isLoading: fullFileLoading } = useGitDiffFullFile(selectedFile, selectedFileStaged, showFullFile);
26755
26791
  const activeDiff = showFullFile && fullFileDiff ? fullFileDiff : diff2;
26756
26792
  const activeLoading = showFullFile ? fullFileLoading : isLoading;
@@ -26862,7 +26898,7 @@ ${activeDiff?.absPath || ""}`,
26862
26898
  });
26863
26899
  });
26864
26900
  // src/components/git/GitCommitModal.tsx
26865
- import { useState as useState48, useId as useId4, useEffect as useEffect47, useCallback as useCallback32 } from "react";
26901
+ import { useState as useState47, useId as useId4, useEffect as useEffect47, useCallback as useCallback32 } from "react";
26866
26902
  import { GitCommit as GitCommit4, Sparkles as Sparkles6 } from "lucide-react";
26867
26903
  import { jsx as jsx101, jsxs as jsxs87, Fragment as Fragment43 } from "react/jsx-runtime";
26868
26904
  function GitCommitModal() {
@@ -26874,7 +26910,7 @@ function GitCommitModalContent() {
26874
26910
  const commitSessionId = useGitStore((state) => state.commitSessionId);
26875
26911
  const commitChanges = useCommitChanges();
26876
26912
  const generateMessage = useGenerateCommitMessage(commitSessionId);
26877
- const [message, setMessage] = useState48("");
26913
+ const [message, setMessage] = useState47("");
26878
26914
  const messageId = useId4();
26879
26915
  const handleCommit = useCallback32(async () => {
26880
26916
  if (!message.trim())
@@ -27030,7 +27066,7 @@ function GitCommitModalContent() {
27030
27066
  });
27031
27067
  }
27032
27068
  // src/components/terminals/TerminalsPanel.tsx
27033
- import { memo as memo32, useCallback as useCallback35, useRef as useRef30, useEffect as useEffect49 } from "react";
27069
+ import { memo as memo32, useCallback as useCallback35, useRef as useRef31, useEffect as useEffect49 } from "react";
27034
27070
  import {
27035
27071
  Terminal as TerminalIcon,
27036
27072
  Maximize2 as Maximize22,
@@ -27213,7 +27249,7 @@ var TerminalTab = memo30(function TerminalTab2({
27213
27249
  });
27214
27250
 
27215
27251
  // src/components/terminals/TerminalViewer.tsx
27216
- import { memo as memo31, useEffect as useEffect48, useRef as useRef29, useState as useState49, useCallback as useCallback34 } from "react";
27252
+ import { memo as memo31, useEffect as useEffect48, useRef as useRef30, useState as useState48, useCallback as useCallback34 } from "react";
27217
27253
  import {
27218
27254
  init,
27219
27255
  Terminal as Terminal7,
@@ -27331,20 +27367,20 @@ var TerminalViewer = memo31(function TerminalViewer2({
27331
27367
  isActive,
27332
27368
  onExit
27333
27369
  }) {
27334
- const containerRef = useRef29(null);
27335
- const termRef = useRef29(null);
27336
- const fitAddonRef = useRef29(null);
27337
- const wsRef = useRef29(null);
27338
- const retryCountRef = useRef29(0);
27339
- const retryTimerRef = useRef29(null);
27340
- const [ready, setReady] = useState49(false);
27341
- const onExitRef = useRef29(onExit);
27370
+ const containerRef = useRef30(null);
27371
+ const termRef = useRef30(null);
27372
+ const fitAddonRef = useRef30(null);
27373
+ const wsRef = useRef30(null);
27374
+ const retryCountRef = useRef30(0);
27375
+ const retryTimerRef = useRef30(null);
27376
+ const [ready, setReady] = useState48(false);
27377
+ const onExitRef = useRef30(onExit);
27342
27378
  onExitRef.current = onExit;
27343
- const blinkTimerRef = useRef29(null);
27344
- const userScrolledRef = useRef29(false);
27345
- const bgColorRef = useRef29("#121216");
27346
- const disposedRef = useRef29(false);
27347
- const focusHandlersRef = useRef29(null);
27379
+ const blinkTimerRef = useRef30(null);
27380
+ const userScrolledRef = useRef30(false);
27381
+ const bgColorRef = useRef30("#121216");
27382
+ const disposedRef = useRef30(false);
27383
+ const focusHandlersRef = useRef30(null);
27348
27384
  const fitTerminal = useCallback34(() => {
27349
27385
  if (fitAddonRef.current) {
27350
27386
  try {
@@ -27677,10 +27713,10 @@ var TerminalsPanelContent = memo32(function TerminalsPanelContent2() {
27677
27713
  const { data: terminals } = useTerminals();
27678
27714
  const createTerminal = useCreateTerminal();
27679
27715
  const killTerminal = useKillTerminal();
27680
- const dragRef = useRef30(null);
27716
+ const dragRef = useRef31(null);
27681
27717
  const terminalsList = terminals?.terminals ?? [];
27682
- const autoCreatingRef = useRef30(false);
27683
- const terminalsListRef = useRef30(terminalsList);
27718
+ const autoCreatingRef = useRef31(false);
27719
+ const terminalsListRef = useRef31(terminalsList);
27684
27720
  terminalsListRef.current = terminalsList;
27685
27721
  useEffect49(() => {
27686
27722
  if (terminalsListRef.current.length > 0 && (!activeTabId || !terminalsListRef.current.find((t) => t.id === activeTabId))) {
@@ -28567,7 +28603,7 @@ ${contentLines.map((line) => `+${line}`).join(`
28567
28603
  });
28568
28604
  });
28569
28605
  // src/components/research/ResearchSidebar.tsx
28570
- import { memo as memo37, useState as useState50, useEffect as useEffect51, useCallback as useCallback37, useRef as useRef31, useMemo as useMemo30 } from "react";
28606
+ import { memo as memo37, useState as useState49, useEffect as useEffect51, useCallback as useCallback37, useRef as useRef32, useMemo as useMemo30 } from "react";
28571
28607
  import {
28572
28608
  FlaskConical as FlaskConical3,
28573
28609
  Plus as Plus6,
@@ -28722,12 +28758,12 @@ var ResearchSidebarContent = memo37(function ResearchSidebarContent2({
28722
28758
  const panelWidth = usePanelWidthStore((s) => s.widths[PANEL_KEY3] ?? DEFAULT_WIDTH3);
28723
28759
  const activeResearchSessionId = useResearchStore((state) => state.activeResearchSessionId);
28724
28760
  const selectResearchSession = useResearchStore((state) => state.selectResearchSession);
28725
- const [showHistory, setShowHistory] = useState50(false);
28726
- const [inputValue, setInputValue] = useState50("");
28727
- const [showModelSelector, setShowModelSelector] = useState50(false);
28728
- const [injectionStatus, setInjectionStatus] = useState50("idle");
28729
- const textareaRef = useRef31(null);
28730
- const messagesEndRef = useRef31(null);
28761
+ const [showHistory, setShowHistory] = useState49(false);
28762
+ const [inputValue, setInputValue] = useState49("");
28763
+ const [showModelSelector, setShowModelSelector] = useState49(false);
28764
+ const [injectionStatus, setInjectionStatus] = useState49("idle");
28765
+ const textareaRef = useRef32(null);
28766
+ const messagesEndRef = useRef32(null);
28731
28767
  const {
28732
28768
  data: researchData,
28733
28769
  isLoading,
@@ -29268,7 +29304,7 @@ var ResearchSidebarToggle = memo38(function ResearchSidebarToggle2({
29268
29304
  });
29269
29305
  });
29270
29306
  // src/components/settings/SettingsSidebar.tsx
29271
- import { memo as memo40, useState as useState52, useMemo as useMemo31, useCallback as useCallback39, useEffect as useEffect54, useRef as useRef34 } from "react";
29307
+ import { memo as memo40, useState as useState51, useMemo as useMemo31, useCallback as useCallback39, useEffect as useEffect54, useRef as useRef35 } from "react";
29272
29308
  import { createPortal as createPortal2 } from "react-dom";
29273
29309
  import { AnimatePresence as AnimatePresence3, motion as motion4 } from "motion/react";
29274
29310
  import {
@@ -29332,7 +29368,7 @@ var useOnboardingStore = create25((set, get) => ({
29332
29368
  }));
29333
29369
 
29334
29370
  // src/hooks/useAuthStatus.ts
29335
- import { useEffect as useEffect52, useCallback as useCallback38, useState as useState51, useRef as useRef32 } from "react";
29371
+ import { useEffect as useEffect52, useCallback as useCallback38, useState as useState50, useRef as useRef33 } from "react";
29336
29372
  import { useQueryClient as useQueryClient20 } from "@tanstack/react-query";
29337
29373
  var isInIframe = typeof window !== "undefined" && window.self !== window.top;
29338
29374
  function useAuthStatus() {
@@ -29343,10 +29379,10 @@ function useAuthStatus() {
29343
29379
  const authStatus = useOnboardingStore((s) => s.authStatus);
29344
29380
  const isOpen = useOnboardingStore((s) => s.isOpen);
29345
29381
  const queryClient = useQueryClient20();
29346
- const [initialized, setInitialized] = useState51(false);
29347
- const [oauthPolling, setOauthPolling] = useState51(false);
29348
- const oauthPollingRef = useRef32(null);
29349
- const preOauthProvidersRef = useRef32(new Set);
29382
+ const [initialized, setInitialized] = useState50(false);
29383
+ const [oauthPolling, setOauthPolling] = useState50(false);
29384
+ const oauthPollingRef = useRef33(null);
29385
+ const preOauthProvidersRef = useRef33(new Set);
29350
29386
  const fetchAuthStatus = useCallback38(async () => {
29351
29387
  setLoading(true);
29352
29388
  setError(null);
@@ -29871,11 +29907,11 @@ var DictationSettings = memo39(function DictationSettings2({
29871
29907
  });
29872
29908
 
29873
29909
  // src/hooks/useTopupCallback.ts
29874
- import { useEffect as useEffect53, useRef as useRef33 } from "react";
29910
+ import { useEffect as useEffect53, useRef as useRef34 } from "react";
29875
29911
  var STORAGE_KEY = "pendingPolarCheckout";
29876
29912
  function useTopupCallback() {
29877
- const hasHandled = useRef33(false);
29878
- const loadingToastId = useRef33(null);
29913
+ const hasHandled = useRef34(false);
29914
+ const loadingToastId = useRef34(null);
29879
29915
  const setBalance = useOttoRouterStore((s) => s.setBalance);
29880
29916
  const removeToast = useToastStore((s) => s.removeToast);
29881
29917
  useEffect53(() => {
@@ -30079,9 +30115,9 @@ var SelectRow = memo40(function SelectRow2({
30079
30115
  disabled,
30080
30116
  description
30081
30117
  }) {
30082
- const [isOpen, setIsOpen] = useState52(false);
30083
- const [menuStyle, setMenuStyle] = useState52(null);
30084
- const buttonRef = useRef34(null);
30118
+ const [isOpen, setIsOpen] = useState51(false);
30119
+ const [menuStyle, setMenuStyle] = useState51(null);
30120
+ const buttonRef = useRef35(null);
30085
30121
  const selectedOption = options.find((o) => o.id === value);
30086
30122
  useEffect54(() => {
30087
30123
  if (!isOpen || !buttonRef.current)
@@ -30175,11 +30211,11 @@ var FontPickerRow = memo40(function FontPickerRow2({
30175
30211
  value,
30176
30212
  onChange
30177
30213
  }) {
30178
- const [isOpen, setIsOpen] = useState52(false);
30179
- const [search, setSearch] = useState52("");
30180
- const [localFonts, setLocalFonts] = useState52([]);
30181
- const [isLoadingFonts, setIsLoadingFonts] = useState52(false);
30182
- const [fontError, setFontError] = useState52(null);
30214
+ const [isOpen, setIsOpen] = useState51(false);
30215
+ const [search, setSearch] = useState51("");
30216
+ const [localFonts, setLocalFonts] = useState51([]);
30217
+ const [isLoadingFonts, setIsLoadingFonts] = useState51(false);
30218
+ const [fontError, setFontError] = useState51(null);
30183
30219
  const canQueryLocalFonts = typeof window !== "undefined" && typeof window.queryLocalFonts === "function";
30184
30220
  const canRequestDesktopFonts = hasPlatformSystemFonts() || typeof window !== "undefined" && window.self !== window.top;
30185
30221
  const fontOptions = useMemo31(() => {
@@ -30308,7 +30344,7 @@ var NumberInputRow = memo40(function NumberInputRow2({
30308
30344
  hint,
30309
30345
  disabled
30310
30346
  }) {
30311
- const [draft, setDraft] = useState52(value !== null && value !== undefined ? String(value) : "");
30347
+ const [draft, setDraft] = useState51(value !== null && value !== undefined ? String(value) : "");
30312
30348
  useEffect54(() => {
30313
30349
  setDraft(value !== null && value !== undefined ? String(value) : "");
30314
30350
  }, [value]);
@@ -30416,7 +30452,7 @@ function PreferencesModal({ isOpen, onClose }) {
30416
30452
  const { preferences, updatePreferences } = usePreferences();
30417
30453
  const updateDefaults = useUpdateDefaults();
30418
30454
  const isDesktop = isPlatformDesktop();
30419
- const [activeTab, setActiveTab] = useState52("editor");
30455
+ const [activeTab, setActiveTab] = useState51("editor");
30420
30456
  const activeTabConfig = PREFERENCE_TABS.find((tab) => tab.id === activeTab);
30421
30457
  const renderActiveTab = () => {
30422
30458
  switch (activeTab) {
@@ -30646,7 +30682,7 @@ var SettingsSidebarContent = memo40(function SettingsSidebarContent2({
30646
30682
  onOpenDashboard
30647
30683
  } = {}) {
30648
30684
  const collapseSidebar = useSettingsStore((state) => state.collapseSidebar);
30649
- const [isPreferencesOpen, setIsPreferencesOpen] = useState52(false);
30685
+ const [isPreferencesOpen, setIsPreferencesOpen] = useState51(false);
30650
30686
  const panelWidth = usePanelWidthStore((s) => s.widths[SETTINGS_PANEL_KEY] ?? SETTINGS_DEFAULT_WIDTH);
30651
30687
  const { data: config2 } = useConfig();
30652
30688
  const { data: allModels } = useAllModels();
@@ -30907,12 +30943,12 @@ var OttoRouterWalletSection = memo40(function OttoRouterWalletSection2({
30907
30943
  onExportPrivateKey
30908
30944
  }) {
30909
30945
  const hasActiveSubscription = useOttoRouterStore((s) => !!s.subscription?.active);
30910
- const [copied, setCopied] = useState52(false);
30911
- const [isExportModalOpen, setIsExportModalOpen] = useState52(false);
30912
- const [exportPrivateKey, setExportPrivateKey] = useState52(null);
30913
- const [isExportingPrivateKey, setIsExportingPrivateKey] = useState52(false);
30914
- const [exportPrivateKeyError, setExportPrivateKeyError] = useState52(null);
30915
- const [privateKeyCopied, setPrivateKeyCopied] = useState52(false);
30946
+ const [copied, setCopied] = useState51(false);
30947
+ const [isExportModalOpen, setIsExportModalOpen] = useState51(false);
30948
+ const [exportPrivateKey, setExportPrivateKey] = useState51(null);
30949
+ const [isExportingPrivateKey, setIsExportingPrivateKey] = useState51(false);
30950
+ const [exportPrivateKeyError, setExportPrivateKeyError] = useState51(null);
30951
+ const [privateKeyCopied, setPrivateKeyCopied] = useState51(false);
30916
30952
  const handleCopy = useCallback39(async () => {
30917
30953
  if (!ottorouterWallet)
30918
30954
  return;
@@ -31209,7 +31245,7 @@ var SettingsSidebarToggle = memo41(function SettingsSidebarToggle2() {
31209
31245
  });
31210
31246
  });
31211
31247
  // src/components/tunnel/TunnelSidebar.tsx
31212
- import { memo as memo42, useState as useState53 } from "react";
31248
+ import { memo as memo42, useState as useState52 } from "react";
31213
31249
  import {
31214
31250
  Globe as Globe3,
31215
31251
  AlertCircle as AlertCircle12,
@@ -31222,7 +31258,7 @@ import { QRCodeSVG as QRCodeSVG2 } from "qrcode.react";
31222
31258
 
31223
31259
  // src/hooks/useTunnel.ts
31224
31260
  import { useQuery as useQuery14, useMutation as useMutation11, useQueryClient as useQueryClient21 } from "@tanstack/react-query";
31225
- import { useEffect as useEffect55, useCallback as useCallback40, useRef as useRef35 } from "react";
31261
+ import { useEffect as useEffect55, useCallback as useCallback40, useRef as useRef36 } from "react";
31226
31262
  import {
31227
31263
  client as client4,
31228
31264
  getTunnelQr,
@@ -31230,6 +31266,15 @@ import {
31230
31266
  startTunnel as apiStartTunnel,
31231
31267
  stopTunnel as apiStopTunnel
31232
31268
  } from "@ottocode/api";
31269
+ function normalizeTunnelStatus(data) {
31270
+ if (data.isRunning && data.url)
31271
+ return "connected";
31272
+ if (data.isRunning && data.status === "idle")
31273
+ return "starting";
31274
+ if (data.status === "connected" && !data.url)
31275
+ return "starting";
31276
+ return data.status;
31277
+ }
31233
31278
  async function fetchTunnelStatus() {
31234
31279
  const response = await getTunnelStatus();
31235
31280
  if (response.error)
@@ -31263,11 +31308,12 @@ function useTunnelStatus() {
31263
31308
  const query = useQuery14({
31264
31309
  queryKey: ["tunnel", "status"],
31265
31310
  queryFn: fetchTunnelStatus,
31266
- refetchInterval: 3000
31311
+ refetchInterval: 3000,
31312
+ refetchOnMount: "always"
31267
31313
  });
31268
31314
  useEffect55(() => {
31269
31315
  if (query.data) {
31270
- setStatus(query.data.status);
31316
+ setStatus(normalizeTunnelStatus(query.data));
31271
31317
  setUrl(query.data.url);
31272
31318
  setError(query.data.error);
31273
31319
  }
@@ -31288,11 +31334,13 @@ function useStartTunnel() {
31288
31334
  setError(null);
31289
31335
  },
31290
31336
  onSuccess: (data) => {
31291
- if (data.ok && data.url) {
31292
- setStatus("connected");
31293
- setUrl(data.url);
31337
+ if (data.ok) {
31338
+ if (data.url) {
31339
+ setStatus("connected");
31340
+ setUrl(data.url);
31341
+ }
31294
31342
  setProgress(null);
31295
- } else if (!data.ok) {
31343
+ } else {
31296
31344
  setStatus("error");
31297
31345
  setError(data.error || "Failed to start tunnel");
31298
31346
  setProgress(null);
@@ -31338,7 +31386,7 @@ function useTunnelStream() {
31338
31386
  const setError = useTunnelStore((s) => s.setError);
31339
31387
  const setProgress = useTunnelStore((s) => s.setProgress);
31340
31388
  const isExpanded = useTunnelStore((s) => s.isExpanded);
31341
- const eventSourceRef = useRef35(null);
31389
+ const eventSourceRef = useRef36(null);
31342
31390
  const connect = useCallback40(() => {
31343
31391
  if (eventSourceRef.current) {
31344
31392
  eventSourceRef.current.close();
@@ -31349,7 +31397,7 @@ function useTunnelStream() {
31349
31397
  try {
31350
31398
  const data = JSON.parse(event.data);
31351
31399
  if (data.type === "status") {
31352
- setStatus(data.status);
31400
+ setStatus(normalizeTunnelStatus(data));
31353
31401
  setUrl(data.url);
31354
31402
  setError(data.error);
31355
31403
  setProgress(data.progress);
@@ -31396,6 +31444,7 @@ function truncateUrl(url) {
31396
31444
  }
31397
31445
  var TunnelSidebar = memo42(function TunnelSidebar2() {
31398
31446
  const isExpanded = useTunnelStore((s) => s.isExpanded);
31447
+ useTunnelStatus();
31399
31448
  return isExpanded ? /* @__PURE__ */ jsx114(TunnelSidebarContent, {}) : null;
31400
31449
  });
31401
31450
  var TunnelSidebarContent = memo42(function TunnelSidebarContent2() {
@@ -31406,8 +31455,7 @@ var TunnelSidebarContent = memo42(function TunnelSidebarContent2() {
31406
31455
  const progress = useTunnelStore((s) => s.progress);
31407
31456
  const startTunnel2 = useStartTunnel();
31408
31457
  const stopTunnel2 = useStopTunnel();
31409
- const [copied, setCopied] = useState53(false);
31410
- useTunnelStatus();
31458
+ const [copied, setCopied] = useState52(false);
31411
31459
  useTunnelStream();
31412
31460
  const handleCopyUrl = async () => {
31413
31461
  if (url) {
@@ -31625,7 +31673,7 @@ var TunnelSidebarToggle = memo43(function TunnelSidebarToggle2() {
31625
31673
  });
31626
31674
  });
31627
31675
  // src/components/mcp/MCPSidebar.tsx
31628
- import { memo as memo46, useState as useState55, useCallback as useCallback43, useMemo as useMemo32, useEffect as useEffect58, useRef as useRef38 } from "react";
31676
+ import { memo as memo46, useState as useState54, useCallback as useCallback43, useMemo as useMemo32, useEffect as useEffect58, useRef as useRef39 } from "react";
31629
31677
  import {
31630
31678
  ChevronDown as ChevronDown13,
31631
31679
  ChevronRight as ChevronRight16,
@@ -31646,7 +31694,7 @@ import { useQueryClient as useQueryClient23 } from "@tanstack/react-query";
31646
31694
 
31647
31695
  // src/hooks/useMCP.ts
31648
31696
  import { useQuery as useQuery15, useMutation as useMutation12, useQueryClient as useQueryClient22 } from "@tanstack/react-query";
31649
- import { useEffect as useEffect56, useRef as useRef36, useCallback as useCallback41 } from "react";
31697
+ import { useEffect as useEffect56, useRef as useRef37, useCallback as useCallback41 } from "react";
31650
31698
  import {
31651
31699
  listMcpServers,
31652
31700
  startMcpServer,
@@ -31812,7 +31860,7 @@ function useCopilotDevicePoller() {
31812
31860
  const setCopilotDevice = useMCPStore((s) => s.setCopilotDevice);
31813
31861
  const setLoading = useMCPStore((s) => s.setLoading);
31814
31862
  const queryClient = useQueryClient22();
31815
- const timerRef = useRef36(null);
31863
+ const timerRef = useRef37(null);
31816
31864
  const stopPolling = useCallback41(() => {
31817
31865
  if (timerRef.current) {
31818
31866
  clearInterval(timerRef.current);
@@ -31855,7 +31903,7 @@ function useCopilotDevicePoller() {
31855
31903
  }
31856
31904
 
31857
31905
  // src/components/mcp/AddMCPServerModal.tsx
31858
- import { memo as memo44, useState as useState54, useCallback as useCallback42, useRef as useRef37, useEffect as useEffect57 } from "react";
31906
+ import { memo as memo44, useState as useState53, useCallback as useCallback42, useRef as useRef38, useEffect as useEffect57 } from "react";
31859
31907
  import { Globe as Globe5, Laptop, FolderDot, Terminal as Terminal9 } from "lucide-react";
31860
31908
  import { jsx as jsx116, jsxs as jsxs102, Fragment as Fragment49 } from "react/jsx-runtime";
31861
31909
  function parseCommandString(input) {
@@ -31894,15 +31942,15 @@ var AddMCPServerModal = memo44(function AddMCPServerModal2({
31894
31942
  isOpen,
31895
31943
  onClose
31896
31944
  }) {
31897
- const [serverMode, setServerMode] = useState54("local");
31898
- const [name, setName] = useState54("");
31899
- const [commandStr, setCommandStr] = useState54("");
31900
- const [url, setUrl] = useState54("");
31901
- const [transport, setTransport] = useState54("http");
31902
- const [headersStr, setHeadersStr] = useState54("");
31903
- const [envStr, setEnvStr] = useState54("");
31904
- const [scope, setScope] = useState54("global");
31905
- const [error, setError] = useState54(null);
31945
+ const [serverMode, setServerMode] = useState53("local");
31946
+ const [name, setName] = useState53("");
31947
+ const [commandStr, setCommandStr] = useState53("");
31948
+ const [url, setUrl] = useState53("");
31949
+ const [transport, setTransport] = useState53("http");
31950
+ const [headersStr, setHeadersStr] = useState53("");
31951
+ const [envStr, setEnvStr] = useState53("");
31952
+ const [scope, setScope] = useState53("global");
31953
+ const [error, setError] = useState53(null);
31906
31954
  const addServer = useAddMCPServer();
31907
31955
  const reset = useCallback42(() => {
31908
31956
  setName("");
@@ -31976,8 +32024,8 @@ var AddMCPServerModal = memo44(function AddMCPServerModal2({
31976
32024
  addServer,
31977
32025
  handleClose
31978
32026
  ]);
31979
- const contentRef = useRef37(null);
31980
- const [contentHeight, setContentHeight] = useState54(undefined);
32027
+ const contentRef = useRef38(null);
32028
+ const [contentHeight, setContentHeight] = useState53(undefined);
31981
32029
  useEffect57(() => {
31982
32030
  const el = contentRef.current;
31983
32031
  if (!el)
@@ -32295,7 +32343,7 @@ var CopilotDeviceAuth = memo46(function CopilotDeviceAuth2({
32295
32343
  userCode,
32296
32344
  verificationUri
32297
32345
  }) {
32298
- const [copied, setCopied] = useState55(false);
32346
+ const [copied, setCopied] = useState54(false);
32299
32347
  const handleCopy = useCallback43(() => {
32300
32348
  navigator.clipboard.writeText(userCode).then(() => {
32301
32349
  setCopied(true);
@@ -32373,7 +32421,7 @@ var MCPServerCard = memo46(function MCPServerCard2({
32373
32421
  onRemove,
32374
32422
  onAuth
32375
32423
  }) {
32376
- const [showTools, setShowTools] = useState55(false);
32424
+ const [showTools, setShowTools] = useState54(false);
32377
32425
  const hasTools = server.connected && server.tools.length > 0;
32378
32426
  const isRemote = server.transport === "http" || server.transport === "sse";
32379
32427
  const isAwaitingAuth = (!!authUrl || !!copilotDevice) && !server.connected;
@@ -32525,7 +32573,7 @@ var MCPServerCard = memo46(function MCPServerCard2({
32525
32573
  });
32526
32574
  function useAuthPoller(name, onAuthenticated) {
32527
32575
  const { data } = useMCPAuthStatus(name);
32528
- const prevAuth = useRef38(false);
32576
+ const prevAuth = useRef39(false);
32529
32577
  useEffect58(() => {
32530
32578
  if (data?.authenticated && !prevAuth.current) {
32531
32579
  onAuthenticated();
@@ -32551,10 +32599,10 @@ var MCPSidebarContent = memo46(function MCPSidebarContent2() {
32551
32599
  const removeServer = useRemoveMCPServer();
32552
32600
  const authServer = useAuthenticateMCPServer();
32553
32601
  const copilotDevice = useCopilotDevicePoller();
32554
- const [isAddModalOpen, setIsAddModalOpen] = useState55(false);
32555
- const [pollingServer, setPollingServer] = useState55(null);
32556
- const [deleteTarget, setDeleteTarget] = useState55(null);
32557
- const [searchQuery, setSearchQuery] = useState55("");
32602
+ const [isAddModalOpen, setIsAddModalOpen] = useState54(false);
32603
+ const [pollingServer, setPollingServer] = useState54(null);
32604
+ const [deleteTarget, setDeleteTarget] = useState54(null);
32605
+ const [searchQuery, setSearchQuery] = useState54("");
32558
32606
  const queryClient = useQueryClient23();
32559
32607
  const handleAuthCompleted = useCallback43(() => {
32560
32608
  if (pollingServer) {
@@ -32845,7 +32893,7 @@ var MCPSidebarToggle = memo47(function MCPSidebarToggle2() {
32845
32893
  });
32846
32894
  });
32847
32895
  // src/components/skills/SkillsSidebar.tsx
32848
- import { memo as memo48, useMemo as useMemo33, useState as useState56 } from "react";
32896
+ import { memo as memo48, useMemo as useMemo33, useState as useState55 } from "react";
32849
32897
  import {
32850
32898
  Sparkles as Sparkles7,
32851
32899
  FolderDot as FolderDot3,
@@ -32893,7 +32941,7 @@ var SkillsSidebarContent = memo48(function SkillsSidebarContent2() {
32893
32941
  const selectSkill = useSkillsStore((s) => s.selectSkill);
32894
32942
  const openViewer = useSkillsStore((s) => s.openViewer);
32895
32943
  const viewingFile = useSkillsStore((s) => s.viewingFile);
32896
- const [searchQuery, setSearchQuery] = useState56("");
32944
+ const [searchQuery, setSearchQuery] = useState55("");
32897
32945
  const { isLoading, isFetching, refetch } = useSkills();
32898
32946
  const updateSkillsConfig = useUpdateSkillsConfig();
32899
32947
  const { data: skillDetail } = useSkillDetail(selectedSkill);
@@ -33439,7 +33487,7 @@ var AgentsSidebarToggle = memo51(function AgentsSidebarToggle2() {
33439
33487
  });
33440
33488
  });
33441
33489
  // src/components/agents/AgentsManagerModal.tsx
33442
- import { memo as memo55, useCallback as useCallback44, useEffect as useEffect62, useMemo as useMemo36, useRef as useRef40, useState as useState59 } from "react";
33490
+ import { memo as memo55, useCallback as useCallback44, useEffect as useEffect62, useMemo as useMemo36, useRef as useRef41, useState as useState58 } from "react";
33443
33491
  import { AnimatePresence as AnimatePresence4, motion as motion5 } from "motion/react";
33444
33492
  import {
33445
33493
  ArrowLeft as ArrowLeft2,
@@ -33556,7 +33604,7 @@ function getAgentToolCount(agent) {
33556
33604
  }
33557
33605
 
33558
33606
  // src/components/agents/AgentToolList.tsx
33559
- import { memo as memo52, useEffect as useEffect61, useMemo as useMemo34, useRef as useRef39, useState as useState57 } from "react";
33607
+ import { memo as memo52, useEffect as useEffect61, useMemo as useMemo34, useRef as useRef40, useState as useState56 } from "react";
33560
33608
  import { GripVertical, Plus as Plus9, Search as Search10, X as X24, Zap as Zap2 } from "lucide-react";
33561
33609
 
33562
33610
  // src/components/agents/agentConstants.ts
@@ -33605,7 +33653,7 @@ function toolCategoryFromName(tool) {
33605
33653
  return "Filesystem";
33606
33654
  if (["edit", "multiedit", "write", "apply_patch"].includes(tool))
33607
33655
  return "Editing";
33608
- if (["ripgrep"].includes(tool))
33656
+ if (["search"].includes(tool))
33609
33657
  return "Search";
33610
33658
  if (["shell", "terminal"].includes(tool))
33611
33659
  return "Shell";
@@ -33696,7 +33744,7 @@ var TOOL_PRESETS = {
33696
33744
  "ls",
33697
33745
  "tree",
33698
33746
  "glob",
33699
- "ripgrep",
33747
+ "search",
33700
33748
  "websearch"
33701
33749
  ],
33702
33750
  loadable: ["read_image"]
@@ -33713,7 +33761,7 @@ var TOOL_PRESETS = {
33713
33761
  "ls",
33714
33762
  "tree",
33715
33763
  "glob",
33716
- "ripgrep",
33764
+ "search",
33717
33765
  "websearch"
33718
33766
  ],
33719
33767
  loadable: ["read_image"]
@@ -33729,7 +33777,7 @@ var TOOL_PRESETS = {
33729
33777
  "read",
33730
33778
  "ls",
33731
33779
  "tree",
33732
- "ripgrep",
33780
+ "search",
33733
33781
  "websearch",
33734
33782
  "query_sessions",
33735
33783
  "query_messages",
@@ -33867,8 +33915,8 @@ var ToolColumn = memo52(function ToolColumn2({
33867
33915
  onDropName
33868
33916
  }) {
33869
33917
  const meta = BUCKET_META[bucket];
33870
- const [isDragOver, setIsDragOver] = useState57(false);
33871
- const [picking, setPicking] = useState57(false);
33918
+ const [isDragOver, setIsDragOver] = useState56(false);
33919
+ const [picking, setPicking] = useState56(false);
33872
33920
  const selected = tools.filter((t) => t.enabled).sort((a, b) => Number(a.required ?? false) - Number(b.required ?? false));
33873
33921
  const available = tools.filter((t) => !t.enabled);
33874
33922
  const handleDrop = (e) => {
@@ -33955,8 +34003,8 @@ var ToolPicker = memo52(function ToolPicker2({
33955
34003
  onPick,
33956
34004
  onClose
33957
34005
  }) {
33958
- const [query, setQuery] = useState57("");
33959
- const inputRef = useRef39(null);
34006
+ const [query, setQuery] = useState56("");
34007
+ const inputRef = useRef40(null);
33960
34008
  useEffect61(() => {
33961
34009
  inputRef.current?.focus();
33962
34010
  }, []);
@@ -34148,7 +34196,7 @@ var AgentProviderModelFields = memo53(function AgentProviderModelFields2({
34148
34196
  });
34149
34197
 
34150
34198
  // src/components/agents/CreateAgentModal.tsx
34151
- import { memo as memo54, useId as useId5, useMemo as useMemo35, useState as useState58 } from "react";
34199
+ import { memo as memo54, useId as useId5, useMemo as useMemo35, useState as useState57 } from "react";
34152
34200
  import { ArrowLeft } from "lucide-react";
34153
34201
  import { jsx as jsx126, jsxs as jsxs110, Fragment as Fragment51 } from "react/jsx-runtime";
34154
34202
  var AGENT_NAME_RE = /^[a-zA-Z0-9_-]+$/;
@@ -34175,17 +34223,17 @@ var AgentCreatePane = memo54(function AgentCreatePane2({
34175
34223
  const nameId = useId5();
34176
34224
  const duplicateId = useId5();
34177
34225
  const promptId = useId5();
34178
- const [name, setName] = useState58("");
34179
- const [prompt, setPrompt] = useState58(BLANK_AGENT_PROMPT);
34180
- const [preset, setPreset] = useState58("planning");
34181
- const [duplicateFrom, setDuplicateFrom] = useState58("");
34182
- const [scope, setScope] = useState58("local");
34183
- const [provider, setProvider] = useState58("");
34184
- const [model, setModel] = useState58("");
34185
- const [copyPrompt, setCopyPrompt] = useState58(true);
34186
- const [copyTools, setCopyTools] = useState58(true);
34187
- const [copyModelSettings, setCopyModelSettings] = useState58(false);
34188
- const [error, setError] = useState58(null);
34226
+ const [name, setName] = useState57("");
34227
+ const [prompt, setPrompt] = useState57(BLANK_AGENT_PROMPT);
34228
+ const [preset, setPreset] = useState57("planning");
34229
+ const [duplicateFrom, setDuplicateFrom] = useState57("");
34230
+ const [scope, setScope] = useState57("local");
34231
+ const [provider, setProvider] = useState57("");
34232
+ const [model, setModel] = useState57("");
34233
+ const [copyPrompt, setCopyPrompt] = useState57(true);
34234
+ const [copyTools, setCopyTools] = useState57(true);
34235
+ const [copyModelSettings, setCopyModelSettings] = useState57(false);
34236
+ const [error, setError] = useState57(null);
34189
34237
  const duplicateSource = duplicateFrom ? agents.find((a) => a.name === duplicateFrom) : undefined;
34190
34238
  const selectedTools = useMemo35(() => {
34191
34239
  const base = new Set(toolNamesFromConfig(TOOL_PRESETS[preset].tools));
@@ -34541,7 +34589,7 @@ var AgentsManagerContent = memo55(function AgentsManagerContent2({
34541
34589
  const setManagerMode = useAgentsStore((s) => s.setManagerMode);
34542
34590
  const workspacePage = useAgentsStore((s) => s.editorPage);
34543
34591
  const setEditorPage = useAgentsStore((s) => s.setEditorPage);
34544
- const workspaceGuardRef = useRef40(null);
34592
+ const workspaceGuardRef = useRef41(null);
34545
34593
  const registerWorkspaceGuard = useCallback44((guard) => {
34546
34594
  workspaceGuardRef.current = guard;
34547
34595
  }, []);
@@ -34861,11 +34909,11 @@ var AgentWorkspaceMain = memo55(function AgentWorkspaceMain2({
34861
34909
  const deleteAgent = useDeleteAgent();
34862
34910
  const setDefaultAgent = useSetDefaultAgent();
34863
34911
  const savedToolNames = useMemo36(() => toolNamesFromConfig(agent.toolConfig), [agent.toolConfig]);
34864
- const [prompt, setPrompt] = useState59(agent.prompt);
34865
- const [provider, setProvider] = useState59(agent.provider ?? "");
34866
- const [model, setModel] = useState59(agent.model ?? "");
34867
- const [selectedToolNames, setSelectedToolNames] = useState59(() => new Set(savedToolNames));
34868
- const [toolBuckets, setToolBuckets] = useState59(() => toolBucketsFromConfig(agent.toolConfig));
34912
+ const [prompt, setPrompt] = useState58(agent.prompt);
34913
+ const [provider, setProvider] = useState58(agent.provider ?? "");
34914
+ const [model, setModel] = useState58(agent.model ?? "");
34915
+ const [selectedToolNames, setSelectedToolNames] = useState58(() => new Set(savedToolNames));
34916
+ const [toolBuckets, setToolBuckets] = useState58(() => toolBucketsFromConfig(agent.toolConfig));
34869
34917
  useEffect62(() => {
34870
34918
  setPrompt(agent.prompt);
34871
34919
  setProvider(agent.provider ?? "");
@@ -35167,7 +35215,7 @@ function MetaRow({ label, value }) {
35167
35215
  });
35168
35216
  }
35169
35217
  // src/components/file-browser/FileBrowserSidebar.tsx
35170
- import { memo as memo56, useCallback as useCallback45, useEffect as useEffect63, useRef as useRef41 } from "react";
35218
+ import { memo as memo56, useCallback as useCallback45, useEffect as useEffect63, useRef as useRef42 } from "react";
35171
35219
  import {
35172
35220
  ChevronRight as ChevronRight17,
35173
35221
  ChevronDown as ChevronDown14,
@@ -35436,7 +35484,7 @@ function TreeItem({
35436
35484
  const isExpanded = expandedDirs.has(path);
35437
35485
  const activeViewerTabPath = getViewerTabPath3(activeViewerTab);
35438
35486
  const isSelected = selectedFile === path || activeViewerTabPath === path;
35439
- const itemRef = useRef41(null);
35487
+ const itemRef = useRef42(null);
35440
35488
  useEffect63(() => {
35441
35489
  if (isSelected) {
35442
35490
  itemRef.current?.scrollIntoView({ block: "nearest" });
@@ -35612,8 +35660,8 @@ import {
35612
35660
  useCallback as useCallback46,
35613
35661
  useEffect as useEffect65,
35614
35662
  useMemo as useMemo38,
35615
- useRef as useRef43,
35616
- useState as useState60
35663
+ useRef as useRef44,
35664
+ useState as useState59
35617
35665
  } from "react";
35618
35666
  import { X as X25 } from "lucide-react";
35619
35667
  import ReactMarkdown3 from "react-markdown";
@@ -35621,7 +35669,7 @@ import remarkGfm3 from "remark-gfm";
35621
35669
 
35622
35670
  // src/components/workspace/ToolPreviewPanel.tsx
35623
35671
  import { CheckCircle2 as CheckCircle23, XCircle as XCircle4 } from "lucide-react";
35624
- import { useEffect as useEffect64, useMemo as useMemo37, useRef as useRef42 } from "react";
35672
+ import { useEffect as useEffect64, useMemo as useMemo37, useRef as useRef43 } from "react";
35625
35673
  import { jsx as jsx131, jsxs as jsxs114 } from "react/jsx-runtime";
35626
35674
  var LARGE_WRITE_PREVIEW_CHARS = 24000;
35627
35675
  var LARGE_WRITE_PREVIEW_LINES = 500;
@@ -36237,8 +36285,8 @@ function SourceViewer({
36237
36285
  });
36238
36286
  }
36239
36287
  function ToolPreviewPanel({ tab }) {
36240
- const scrollContainerRef = useRef42(null);
36241
- const lastPatchPreviewRef = useRef42(null);
36288
+ const scrollContainerRef = useRef43(null);
36289
+ const lastPatchPreviewRef = useRef43(null);
36242
36290
  const statusLabel = getStatusLabel(tab);
36243
36291
  const isPatchPreview = isPatchPreviewTool2(tab.toolName);
36244
36292
  const shouldLoadPatchFile = isPatchPreview;
@@ -36527,9 +36575,9 @@ var FileViewerPanel = memo58(function FileViewerPanel2({
36527
36575
  writePreview,
36528
36576
  onClose
36529
36577
  } = {}) {
36530
- const scrollContainerRef = useRef43(null);
36531
- const latestAnchorRectRef = useRef43(null);
36532
- const [selectionToolbar, setSelectionToolbar] = useState60(null);
36578
+ const scrollContainerRef = useRef44(null);
36579
+ const latestAnchorRectRef = useRef44(null);
36580
+ const [selectionToolbar, setSelectionToolbar] = useState59(null);
36533
36581
  const storeIsViewerOpen = useFileBrowserStore((s) => s.isViewerOpen);
36534
36582
  const storeSelectedFile = useFileBrowserStore((s) => s.selectedFile);
36535
36583
  const storeCloseViewer = useFileBrowserStore((s) => s.closeViewer);
@@ -36962,7 +37010,7 @@ var FileViewerPanel = memo58(function FileViewerPanel2({
36962
37010
  });
36963
37011
  });
36964
37012
  // src/components/file-browser/QuickFilePicker.tsx
36965
- import { memo as memo59, useState as useState61, useEffect as useEffect66, useRef as useRef44, useCallback as useCallback47, useMemo as useMemo39 } from "react";
37013
+ import { memo as memo59, useState as useState60, useEffect as useEffect66, useRef as useRef45, useCallback as useCallback47, useMemo as useMemo39 } from "react";
36966
37014
  import { FileCode as FileCode3, Search as Search11 } from "lucide-react";
36967
37015
 
36968
37016
  // src/stores/filePickerStore.ts
@@ -37006,10 +37054,10 @@ var QuickFilePicker = memo59(function QuickFilePicker2() {
37006
37054
  var QuickFilePickerContent = memo59(function QuickFilePickerContent2() {
37007
37055
  const close = useFilePickerStore((s) => s.close);
37008
37056
  const openFile = useFileBrowserStore((s) => s.openFile);
37009
- const [query, setQuery] = useState61("");
37010
- const [selectedIndex, setSelectedIndex] = useState61(0);
37011
- const inputRef = useRef44(null);
37012
- const listRef = useRef44(null);
37057
+ const [query, setQuery] = useState60("");
37058
+ const [selectedIndex, setSelectedIndex] = useState60(0);
37059
+ const inputRef = useRef45(null);
37060
+ const listRef = useRef45(null);
37013
37061
  const { data: filesData } = useFiles({ enabled: true, query });
37014
37062
  const ignoredSet = useMemo39(() => new Set(filesData?.ignoredFiles ?? []), [filesData?.ignoredFiles]);
37015
37063
  const filtered = useMemo39(() => {
@@ -37212,7 +37260,7 @@ var BrowserPanelToggle = memo60(function BrowserPanelToggle2() {
37212
37260
  });
37213
37261
  });
37214
37262
  // src/components/browser/BrowserViewerPanel.tsx
37215
- import { useCallback as useCallback48, useEffect as useEffect67, useRef as useRef45, useState as useState62 } from "react";
37263
+ import { useCallback as useCallback48, useEffect as useEffect67, useRef as useRef46, useState as useState61 } from "react";
37216
37264
  import {
37217
37265
  ChevronLeft as ChevronLeft2,
37218
37266
  ChevronRight as ChevronRight18,
@@ -37322,17 +37370,17 @@ function BrowserViewerPanel({ tab }) {
37322
37370
  const updateBrowserTabUrl = useViewerTabsStore((state) => state.updateBrowserTabUrl);
37323
37371
  const reloadBrowserTab = useViewerTabsStore((state) => state.reloadBrowserTab);
37324
37372
  const openBrowserTab = useViewerTabsStore((state) => state.openBrowserTab);
37325
- const contentRef = useRef45(null);
37326
- const iframeRef = useRef45(null);
37327
- const loadingDoneTimeoutRef = useRef45(null);
37328
- const iframeEmbedTimeoutRef = useRef45(null);
37329
- const isLoadingRef = useRef45(false);
37330
- const [draftUrl, setDraftUrl] = useState62(tab.url);
37331
- const [historyEntries, setHistoryEntries] = useState62(() => tab.url ? [normalizeBrowserUrl(tab.url)] : []);
37332
- const [historyIndex, setHistoryIndex] = useState62(tab.url ? 0 : -1);
37333
- const [isLoading, setIsLoading] = useState62(() => isEmbeddableUrl(normalizeBrowserUrl(tab.url)));
37334
- const [loadingProgress, setLoadingProgress] = useState62(() => isEmbeddableUrl(normalizeBrowserUrl(tab.url)) ? 12 : 0);
37335
- const [embedError, setEmbedError] = useState62(null);
37373
+ const contentRef = useRef46(null);
37374
+ const iframeRef = useRef46(null);
37375
+ const loadingDoneTimeoutRef = useRef46(null);
37376
+ const iframeEmbedTimeoutRef = useRef46(null);
37377
+ const isLoadingRef = useRef46(false);
37378
+ const [draftUrl, setDraftUrl] = useState61(tab.url);
37379
+ const [historyEntries, setHistoryEntries] = useState61(() => tab.url ? [normalizeBrowserUrl(tab.url)] : []);
37380
+ const [historyIndex, setHistoryIndex] = useState61(tab.url ? 0 : -1);
37381
+ const [isLoading, setIsLoading] = useState61(() => isEmbeddableUrl(normalizeBrowserUrl(tab.url)));
37382
+ const [loadingProgress, setLoadingProgress] = useState61(() => isEmbeddableUrl(normalizeBrowserUrl(tab.url)) ? 12 : 0);
37383
+ const [embedError, setEmbedError] = useState61(null);
37336
37384
  const simulatorStatus = useSimulatorStatus();
37337
37385
  const {
37338
37386
  mutate: startSimulatorPreview,
@@ -38172,7 +38220,7 @@ ${tabKindLabel(tab)}`,
38172
38220
  import { memo as memo64, useEffect as useEffect71 } from "react";
38173
38221
 
38174
38222
  // src/components/onboarding/steps/ProviderSetupStep.tsx
38175
- import { memo as memo62, useEffect as useEffect69, useState as useState63, useRef as useRef46 } from "react";
38223
+ import { memo as memo62, useEffect as useEffect69, useState as useState62, useRef as useRef47 } from "react";
38176
38224
  import {
38177
38225
  Copy as Copy5,
38178
38226
  Check as Check16,
@@ -38228,70 +38276,70 @@ var ProviderSetupStep = memo62(function ProviderSetupStep2({
38228
38276
  onImportCopilotTokenFromGh,
38229
38277
  onGetCopilotDiagnostics
38230
38278
  }) {
38231
- const [copied, setCopied] = useState63(false);
38232
- const [isSettingUp, setIsSettingUp] = useState63(false);
38233
- const [isImportModalOpen, setIsImportModalOpen] = useState63(false);
38234
- const [importPrivateKey, setImportPrivateKey] = useState63("");
38235
- const [isImportingWallet, setIsImportingWallet] = useState63(false);
38236
- const [importWalletError, setImportWalletError] = useState63(null);
38237
- const [addingProvider, setAddingProvider] = useState63(null);
38238
- const [apiKeyInput, setApiKeyInput] = useState63("");
38239
- const [isCustomProviderModalOpen, setIsCustomProviderModalOpen] = useState63(false);
38240
- const [customProviderId, setCustomProviderId] = useState63("");
38241
- const [customProviderLabel, setCustomProviderLabel] = useState63("");
38242
- const [customProviderBaseURL, setCustomProviderBaseURL] = useState63("");
38243
- const [customProviderApiKey, setCustomProviderApiKey] = useState63("");
38244
- const [customProviderModels, setCustomProviderModels] = useState63("");
38245
- const [customProviderCompatibility, setCustomProviderCompatibility] = useState63("openai-compatible");
38246
- const [customProviderAllowAnyModel, setCustomProviderAllowAnyModel] = useState63(true);
38247
- const [isAddingCustomProvider, setIsAddingCustomProvider] = useState63(false);
38248
- const [customProviderError, setCustomProviderError] = useState63(null);
38249
- const [isDiscoveringCustomModels, setIsDiscoveringCustomModels] = useState63(false);
38250
- const [discoveredCustomModels, setDiscoveredCustomModels] = useState63([]);
38251
- const [customProviderDiscoveryMessage, setCustomProviderDiscoveryMessage] = useState63(null);
38252
- const [removingProvider, setRemovingProvider] = useState63(null);
38253
- const [confirmingDelete, setConfirmingDelete] = useState63(null);
38254
- const [oauthSession, setOauthSession] = useState63(null);
38255
- const [oauthCodeInput, setOauthCodeInput] = useState63("");
38256
- const [isExchangingCode, setIsExchangingCode] = useState63(false);
38257
- const [isOpeningPopup, setIsOpeningPopup] = useState63(false);
38258
- const [openAIDevice, setOpenAIDevice] = useState63(null);
38259
- const [openAIPolling, setOpenAIPolling] = useState63(false);
38260
- const [openAIError, setOpenAIError] = useState63(null);
38261
- const [openAICodeCopied, setOpenAICodeCopied] = useState63(false);
38262
- const [openAIModalOpen, setOpenAIModalOpen] = useState63(false);
38263
- const [openAIAuthMode, setOpenAIAuthMode] = useState63("choice");
38264
- const [openAILoading, setOpenAILoading] = useState63(false);
38265
- const [copilotDevice, setCopilotDevice] = useState63(null);
38266
- const [copilotPolling, setCopilotPolling] = useState63(false);
38267
- const [copilotError, setCopilotError] = useState63(null);
38268
- const [copilotAuthMode, setCopilotAuthMode] = useState63("oauth");
38269
- const [copilotTokenInput, setCopilotTokenInput] = useState63("");
38270
- const [copilotTokenSaving, setCopilotTokenSaving] = useState63(false);
38271
- const [copilotGhImporting, setCopilotGhImporting] = useState63(false);
38272
- const [copilotAuthMethods, setCopilotAuthMethods] = useState63(null);
38273
- const [copilotDiagnostics, setCopilotDiagnostics] = useState63(null);
38274
- const [copilotCodeCopied, setCopilotCodeCopied] = useState63(false);
38275
- const [copilotModalOpen, setCopilotModalOpen] = useState63(false);
38276
- const [copilotLoading, setCopilotLoading] = useState63(false);
38277
- const copilotPollRef = useRef46(undefined);
38278
- const copilotCancelledRef = useRef46(false);
38279
- const copilotPollFnRef = useRef46(onPollCopilotDeviceFlow);
38279
+ const [copied, setCopied] = useState62(false);
38280
+ const [isSettingUp, setIsSettingUp] = useState62(false);
38281
+ const [isImportModalOpen, setIsImportModalOpen] = useState62(false);
38282
+ const [importPrivateKey, setImportPrivateKey] = useState62("");
38283
+ const [isImportingWallet, setIsImportingWallet] = useState62(false);
38284
+ const [importWalletError, setImportWalletError] = useState62(null);
38285
+ const [addingProvider, setAddingProvider] = useState62(null);
38286
+ const [apiKeyInput, setApiKeyInput] = useState62("");
38287
+ const [isCustomProviderModalOpen, setIsCustomProviderModalOpen] = useState62(false);
38288
+ const [customProviderId, setCustomProviderId] = useState62("");
38289
+ const [customProviderLabel, setCustomProviderLabel] = useState62("");
38290
+ const [customProviderBaseURL, setCustomProviderBaseURL] = useState62("");
38291
+ const [customProviderApiKey, setCustomProviderApiKey] = useState62("");
38292
+ const [customProviderModels, setCustomProviderModels] = useState62("");
38293
+ const [customProviderCompatibility, setCustomProviderCompatibility] = useState62("openai-compatible");
38294
+ const [customProviderAllowAnyModel, setCustomProviderAllowAnyModel] = useState62(true);
38295
+ const [isAddingCustomProvider, setIsAddingCustomProvider] = useState62(false);
38296
+ const [customProviderError, setCustomProviderError] = useState62(null);
38297
+ const [isDiscoveringCustomModels, setIsDiscoveringCustomModels] = useState62(false);
38298
+ const [discoveredCustomModels, setDiscoveredCustomModels] = useState62([]);
38299
+ const [customProviderDiscoveryMessage, setCustomProviderDiscoveryMessage] = useState62(null);
38300
+ const [removingProvider, setRemovingProvider] = useState62(null);
38301
+ const [confirmingDelete, setConfirmingDelete] = useState62(null);
38302
+ const [oauthSession, setOauthSession] = useState62(null);
38303
+ const [oauthCodeInput, setOauthCodeInput] = useState62("");
38304
+ const [isExchangingCode, setIsExchangingCode] = useState62(false);
38305
+ const [isOpeningPopup, setIsOpeningPopup] = useState62(false);
38306
+ const [openAIDevice, setOpenAIDevice] = useState62(null);
38307
+ const [openAIPolling, setOpenAIPolling] = useState62(false);
38308
+ const [openAIError, setOpenAIError] = useState62(null);
38309
+ const [openAICodeCopied, setOpenAICodeCopied] = useState62(false);
38310
+ const [openAIModalOpen, setOpenAIModalOpen] = useState62(false);
38311
+ const [openAIAuthMode, setOpenAIAuthMode] = useState62("choice");
38312
+ const [openAILoading, setOpenAILoading] = useState62(false);
38313
+ const [copilotDevice, setCopilotDevice] = useState62(null);
38314
+ const [copilotPolling, setCopilotPolling] = useState62(false);
38315
+ const [copilotError, setCopilotError] = useState62(null);
38316
+ const [copilotAuthMode, setCopilotAuthMode] = useState62("oauth");
38317
+ const [copilotTokenInput, setCopilotTokenInput] = useState62("");
38318
+ const [copilotTokenSaving, setCopilotTokenSaving] = useState62(false);
38319
+ const [copilotGhImporting, setCopilotGhImporting] = useState62(false);
38320
+ const [copilotAuthMethods, setCopilotAuthMethods] = useState62(null);
38321
+ const [copilotDiagnostics, setCopilotDiagnostics] = useState62(null);
38322
+ const [copilotCodeCopied, setCopilotCodeCopied] = useState62(false);
38323
+ const [copilotModalOpen, setCopilotModalOpen] = useState62(false);
38324
+ const [copilotLoading, setCopilotLoading] = useState62(false);
38325
+ const copilotPollRef = useRef47(undefined);
38326
+ const copilotCancelledRef = useRef47(false);
38327
+ const copilotPollFnRef = useRef47(onPollCopilotDeviceFlow);
38280
38328
  copilotPollFnRef.current = onPollCopilotDeviceFlow;
38281
- const openAIPollRef = useRef46(undefined);
38282
- const openAICancelledRef = useRef46(false);
38283
- const openAIPollFnRef = useRef46(onPollOpenAIDeviceFlow);
38329
+ const openAIPollRef = useRef47(undefined);
38330
+ const openAICancelledRef = useRef47(false);
38331
+ const openAIPollFnRef = useRef47(onPollOpenAIDeviceFlow);
38284
38332
  openAIPollFnRef.current = onPollOpenAIDeviceFlow;
38285
38333
  const balance = useOttoRouterStore((s) => s.balance);
38286
38334
  const usdcBalance = useOttoRouterStore((s) => s.usdcBalance);
38287
38335
  const payg = useOttoRouterStore((s) => s.payg);
38288
38336
  const subscription = useOttoRouterStore((s) => s.subscription);
38289
38337
  const isBalanceLoading = useOttoRouterStore((s) => s.isLoading);
38290
- const apiKeyInputRef = useRef46(null);
38291
- const oauthCodeInputRef = useRef46(null);
38292
- const importPrivateKeyRef = useRef46(null);
38338
+ const apiKeyInputRef = useRef47(null);
38339
+ const oauthCodeInputRef = useRef47(null);
38340
+ const importPrivateKeyRef = useRef47(null);
38293
38341
  const isTopupModalOpen = useOttoRouterStore((s) => s.isTopupModalOpen);
38294
- const prevTopupModalOpen = useRef46(false);
38342
+ const prevTopupModalOpen = useRef47(false);
38295
38343
  const { fetchBalance } = useOttoRouterBalance("ottorouter");
38296
38344
  const effectivePayg = payg?.effectiveSpendableUsd ?? balance ?? 0;
38297
38345
  const ottorouterStatusLabel = subscription?.active ? `GO ${(subscription.creditsRemaining ?? 0).toFixed(1)} credits` : `$${effectivePayg.toFixed(2)}`;
@@ -40075,7 +40123,7 @@ var ProviderSetupStep = memo62(function ProviderSetupStep2({
40075
40123
  });
40076
40124
 
40077
40125
  // src/components/onboarding/steps/DefaultsStep.tsx
40078
- import { memo as memo63, useState as useState64, useEffect as useEffect70, useId as useId6, useRef as useRef47 } from "react";
40126
+ import { memo as memo63, useState as useState63, useEffect as useEffect70, useId as useId6, useRef as useRef48 } from "react";
40079
40127
  import { ArrowLeft as ArrowLeft3, Sparkles as Sparkles9, ChevronDown as ChevronDown15 } from "lucide-react";
40080
40128
  import { jsx as jsx138, jsxs as jsxs120, Fragment as Fragment55 } from "react/jsx-runtime";
40081
40129
  var DefaultsStep = memo63(function DefaultsStep2({
@@ -40084,16 +40132,16 @@ var DefaultsStep = memo63(function DefaultsStep2({
40084
40132
  onBack,
40085
40133
  hideHeader = false
40086
40134
  }) {
40087
- const [config2, setConfig] = useState64(null);
40088
- const [allModels, setAllModels] = useState64(null);
40089
- const [isLoading, setIsLoading] = useState64(true);
40090
- const [isSaving, setIsSaving] = useState64(false);
40091
- const [selectedProvider, setSelectedProvider] = useState64("ottorouter");
40092
- const [selectedModel, setSelectedModel] = useState64("kimi-k2.5");
40093
- const [selectedAgent, setSelectedAgent] = useState64(authStatus.defaults.agent || "build");
40094
- const [selectedApproval, setSelectedApproval] = useState64(authStatus.defaults.toolApproval || "dangerous");
40095
- const [guidedMode, setGuidedMode] = useState64(false);
40096
- const hasUserChangedProvider = useRef47(false);
40135
+ const [config2, setConfig] = useState63(null);
40136
+ const [allModels, setAllModels] = useState63(null);
40137
+ const [isLoading, setIsLoading] = useState63(true);
40138
+ const [isSaving, setIsSaving] = useState63(false);
40139
+ const [selectedProvider, setSelectedProvider] = useState63("ottorouter");
40140
+ const [selectedModel, setSelectedModel] = useState63("kimi-k2.5");
40141
+ const [selectedAgent, setSelectedAgent] = useState63(authStatus.defaults.agent || "build");
40142
+ const [selectedApproval, setSelectedApproval] = useState63(authStatus.defaults.toolApproval || "dangerous");
40143
+ const [guidedMode, setGuidedMode] = useState63(false);
40144
+ const hasUserChangedProvider = useRef48(false);
40097
40145
  const providerId = useId6();
40098
40146
  const modelId = useId6();
40099
40147
  const agentId = useId6();
@@ -40556,7 +40604,7 @@ var OnboardingModal = memo64(function OnboardingModal2({
40556
40604
  });
40557
40605
  });
40558
40606
  // src/components/dashboard/UsageDashboard.tsx
40559
- import { useCallback as useCallback49, useEffect as useEffect72, useMemo as useMemo40, useState as useState65 } from "react";
40607
+ import { useCallback as useCallback49, useEffect as useEffect72, useMemo as useMemo40, useState as useState64 } from "react";
40560
40608
  import { AlertTriangle as AlertTriangle3, ArrowLeft as ArrowLeft4, Globe2 as Globe25, RefreshCw as RefreshCw16 } from "lucide-react";
40561
40609
  import { jsx as jsx140, jsxs as jsxs122, Fragment as Fragment56 } from "react/jsx-runtime";
40562
40610
  function formatNumber(n) {
@@ -40604,8 +40652,8 @@ function authColor(t) {
40604
40652
  return "text-muted-foreground";
40605
40653
  }
40606
40654
  function DailyChart({ data }) {
40607
- const [tab, setTab] = useState65("cost");
40608
- const [hover, setHover] = useState65(null);
40655
+ const [tab, setTab] = useState64("cost");
40656
+ const [hover, setHover] = useState64(null);
40609
40657
  const max = useMemo40(() => {
40610
40658
  if (tab === "tokens") {
40611
40659
  return data.reduce((m, d) => Math.max(m, d.inputTokens + d.outputTokens), 0);
@@ -41130,10 +41178,10 @@ function Section({
41130
41178
  });
41131
41179
  }
41132
41180
  function UsageDashboard({ onBack }) {
41133
- const [stats, setStats] = useState65(null);
41134
- const [loading, setLoading] = useState65(false);
41135
- const [error, setError] = useState65(null);
41136
- const [scope, setScope] = useState65("project");
41181
+ const [stats, setStats] = useState64(null);
41182
+ const [loading, setLoading] = useState64(false);
41183
+ const [error, setError] = useState64(null);
41184
+ const [scope, setScope] = useState64("project");
41137
41185
  const fetchStats = useCallback49(async () => {
41138
41186
  setLoading(true);
41139
41187
  setError(null);
@@ -41514,7 +41562,7 @@ function UsageDashboard({ onBack }) {
41514
41562
  });
41515
41563
  }
41516
41564
  // src/hooks/useClientEvents.ts
41517
- import { useEffect as useEffect73, useRef as useRef48 } from "react";
41565
+ import { useEffect as useEffect73, useRef as useRef49 } from "react";
41518
41566
  import { useQueryClient as useQueryClient26 } from "@tanstack/react-query";
41519
41567
  import {
41520
41568
  buildClientEventsStreamUrl,
@@ -41701,7 +41749,7 @@ async function maybeShowLocalAccessToast(baseUrl) {
41701
41749
  }
41702
41750
  function useClientEvents(activeSessionId) {
41703
41751
  const queryClient = useQueryClient26();
41704
- const activeSessionIdRef = useRef48(activeSessionId);
41752
+ const activeSessionIdRef = useRef49(activeSessionId);
41705
41753
  useEffect73(() => {
41706
41754
  activeSessionIdRef.current = activeSessionId;
41707
41755
  }, [activeSessionId]);
@@ -41784,7 +41832,7 @@ function useClientEvents(activeSessionId) {
41784
41832
  return buildClientEventsStreamUrl({ baseUrl: getBaseUrl() });
41785
41833
  }
41786
41834
  // src/hooks/useTheme.ts
41787
- import { useCallback as useCallback50, useEffect as useEffect74, useMemo as useMemo41, useState as useState66 } from "react";
41835
+ import { useCallback as useCallback50, useEffect as useEffect74, useMemo as useMemo41, useState as useState65 } from "react";
41788
41836
  function normalizeTheme(theme) {
41789
41837
  return theme === "light" ? "light" : "dark";
41790
41838
  }
@@ -41792,7 +41840,7 @@ function useTheme() {
41792
41840
  const { data: config2 } = useConfig();
41793
41841
  const updateDefaults = useUpdateDefaults();
41794
41842
  const configTheme = normalizeTheme(config2?.defaults?.theme);
41795
- const [optimisticTheme, setOptimisticTheme] = useState66(null);
41843
+ const [optimisticTheme, setOptimisticTheme] = useState65(null);
41796
41844
  const theme = optimisticTheme ?? configTheme;
41797
41845
  useEffect74(() => {
41798
41846
  if (optimisticTheme === configTheme) {
@@ -41826,10 +41874,10 @@ function useTheme() {
41826
41874
  return useMemo41(() => ({ theme, setTheme, toggleTheme }), [theme, setTheme, toggleTheme]);
41827
41875
  }
41828
41876
  // src/hooks/useWorkingDirectory.ts
41829
- import { useEffect as useEffect75, useState as useState67 } from "react";
41877
+ import { useEffect as useEffect75, useState as useState66 } from "react";
41830
41878
  import { getCwd } from "@ottocode/api";
41831
41879
  function useWorkingDirectory() {
41832
- const [dirName, setDirName] = useState67(null);
41880
+ const [dirName, setDirName] = useState66(null);
41833
41881
  useEffect75(() => {
41834
41882
  const fetchWorkingDirectory = async () => {
41835
41883
  try {
@@ -42175,7 +42223,7 @@ function useKeyboardShortcuts({
42175
42223
  }
42176
42224
  // src/hooks/useImageUpload.ts
42177
42225
  import {
42178
- useState as useState68,
42226
+ useState as useState67,
42179
42227
  useCallback as useCallback52,
42180
42228
  useEffect as useEffect77
42181
42229
  } from "react";
@@ -42205,9 +42253,9 @@ async function fileToPreview2(file) {
42205
42253
  }
42206
42254
  function useImageUpload(options = {}) {
42207
42255
  const { maxImages = 5, maxSizeMB = 5, pageWide = true } = options;
42208
- const [images, setImages] = useState68([]);
42209
- const [isDragging, setIsDragging] = useState68(false);
42210
- const [error, setError] = useState68(null);
42256
+ const [images, setImages] = useState67([]);
42257
+ const [isDragging, setIsDragging] = useState67(false);
42258
+ const [error, setError] = useState67(null);
42211
42259
  const maxSizeBytes = maxSizeMB * 1024 * 1024;
42212
42260
  const validateFile = useCallback52((file) => {
42213
42261
  if (!SUPPORTED_TYPES.includes(file.type)) {
@@ -42374,10 +42422,10 @@ function useImageUpload(options = {}) {
42374
42422
  };
42375
42423
  }
42376
42424
  // src/hooks/useOttoRouterPayments.ts
42377
- import { useEffect as useEffect78, useRef as useRef49 } from "react";
42425
+ import { useEffect as useEffect78, useRef as useRef50 } from "react";
42378
42426
  function useOttoRouterPayments(sessionId) {
42379
- const clientRef = useRef49(null);
42380
- const loadingToastIdRef = useRef49(null);
42427
+ const clientRef = useRef50(null);
42428
+ const loadingToastIdRef = useRef50(null);
42381
42429
  const setBalance = useOttoRouterStore((s) => s.setBalance);
42382
42430
  const setPaymentPending = useOttoRouterStore((s) => s.setPaymentPending);
42383
42431
  const removeToast = useToastStore((s) => s.removeToast);
@@ -42762,4 +42810,4 @@ export {
42762
42810
  API_BASE_URL
42763
42811
  };
42764
42812
 
42765
- //# debugId=04AD02E35B84EDEC64756E2164756E21
42813
+ //# debugId=13247ABCDC55D64D64756E2164756E21