@ottocode/web-sdk 0.1.251 → 0.1.253
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/components/chat/ConfigModal.d.ts.map +1 -1
- package/dist/components/chat/UnifiedModelSelector.d.ts +1 -0
- package/dist/components/chat/UnifiedModelSelector.d.ts.map +1 -1
- package/dist/components/index.js +427 -132
- package/dist/components/index.js.map +7 -7
- package/dist/components/settings/SettingsSidebar.d.ts.map +1 -1
- package/dist/hooks/index.js +30 -3
- package/dist/hooks/index.js.map +3 -3
- package/dist/hooks/usePreferences.d.ts +1 -0
- package/dist/hooks/usePreferences.d.ts.map +1 -1
- package/dist/index.js +430 -135
- package/dist/index.js.map +7 -7
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1787,10 +1787,29 @@ function useUpdateDefaults() {
|
|
|
1787
1787
|
// src/hooks/usePreferences.ts
|
|
1788
1788
|
import { useCallback as useCallback4, useMemo as useMemo2, useSyncExternalStore } from "react";
|
|
1789
1789
|
var STORAGE_KEY = "otto-preferences";
|
|
1790
|
+
var DEFAULT_FONT_FAMILY = "IBM Plex Mono";
|
|
1790
1791
|
var DEFAULT_STORED_PREFERENCES = {
|
|
1791
1792
|
vimMode: false,
|
|
1792
|
-
compactThread: true
|
|
1793
|
+
compactThread: true,
|
|
1794
|
+
fontFamily: DEFAULT_FONT_FAMILY
|
|
1793
1795
|
};
|
|
1796
|
+
function cssFontFamily(fontFamily) {
|
|
1797
|
+
const trimmed = fontFamily.trim();
|
|
1798
|
+
if (!trimmed || trimmed === DEFAULT_FONT_FAMILY) {
|
|
1799
|
+
return `"${DEFAULT_FONT_FAMILY}", monospace`;
|
|
1800
|
+
}
|
|
1801
|
+
return `"${trimmed.replaceAll('"', "\\\"")}", "${DEFAULT_FONT_FAMILY}", monospace`;
|
|
1802
|
+
}
|
|
1803
|
+
function applyFontFamily(fontFamily) {
|
|
1804
|
+
if (typeof document === "undefined") {
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
document.documentElement.style.setProperty("--otto-font-family", cssFontFamily(fontFamily));
|
|
1808
|
+
document.documentElement.dataset.ottoFontFamily = fontFamily;
|
|
1809
|
+
if (window.self !== window.top) {
|
|
1810
|
+
window.parent.postMessage({ type: "otto-font-family-changed", fontFamily }, "*");
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1794
1813
|
function resolveInitialPreferences() {
|
|
1795
1814
|
if (typeof window === "undefined") {
|
|
1796
1815
|
return DEFAULT_STORED_PREFERENCES;
|
|
@@ -1801,7 +1820,8 @@ function resolveInitialPreferences() {
|
|
|
1801
1820
|
const parsed = JSON.parse(stored);
|
|
1802
1821
|
return {
|
|
1803
1822
|
vimMode: typeof parsed.vimMode === "boolean" ? parsed.vimMode : DEFAULT_STORED_PREFERENCES.vimMode,
|
|
1804
|
-
compactThread: typeof parsed.compactThread === "boolean" ? parsed.compactThread : DEFAULT_STORED_PREFERENCES.compactThread
|
|
1823
|
+
compactThread: typeof parsed.compactThread === "boolean" ? parsed.compactThread : DEFAULT_STORED_PREFERENCES.compactThread,
|
|
1824
|
+
fontFamily: typeof parsed.fontFamily === "string" && parsed.fontFamily.trim() ? parsed.fontFamily.trim() : DEFAULT_STORED_PREFERENCES.fontFamily
|
|
1805
1825
|
};
|
|
1806
1826
|
}
|
|
1807
1827
|
} catch (error) {
|
|
@@ -1810,6 +1830,7 @@ function resolveInitialPreferences() {
|
|
|
1810
1830
|
return DEFAULT_STORED_PREFERENCES;
|
|
1811
1831
|
}
|
|
1812
1832
|
var preferences = resolveInitialPreferences();
|
|
1833
|
+
applyFontFamily(preferences.fontFamily);
|
|
1813
1834
|
var listeners = new Set;
|
|
1814
1835
|
function getSnapshot() {
|
|
1815
1836
|
return preferences;
|
|
@@ -1828,6 +1849,9 @@ function notifyListeners() {
|
|
|
1828
1849
|
}
|
|
1829
1850
|
function updateStore(updates) {
|
|
1830
1851
|
preferences = { ...preferences, ...updates };
|
|
1852
|
+
if (updates.fontFamily !== undefined) {
|
|
1853
|
+
applyFontFamily(preferences.fontFamily);
|
|
1854
|
+
}
|
|
1831
1855
|
if (typeof window !== "undefined") {
|
|
1832
1856
|
try {
|
|
1833
1857
|
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(preferences));
|
|
@@ -1849,6 +1873,9 @@ function usePreferences() {
|
|
|
1849
1873
|
if (updates.compactThread !== undefined) {
|
|
1850
1874
|
localUpdates.compactThread = updates.compactThread;
|
|
1851
1875
|
}
|
|
1876
|
+
if (updates.fontFamily !== undefined) {
|
|
1877
|
+
localUpdates.fontFamily = updates.fontFamily.trim() || DEFAULT_FONT_FAMILY;
|
|
1878
|
+
}
|
|
1852
1879
|
if (Object.keys(localUpdates).length > 0) {
|
|
1853
1880
|
updateStore(localUpdates);
|
|
1854
1881
|
}
|
|
@@ -2190,12 +2217,12 @@ function Modal({
|
|
|
2190
2217
|
}),
|
|
2191
2218
|
/* @__PURE__ */ jsx11("div", {
|
|
2192
2219
|
"data-native-overlay-root": "true",
|
|
2193
|
-
className: `${overlayPositionClass} top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[9999] w-full ${maxWidthClasses[maxWidth]} px-4`,
|
|
2220
|
+
className: `${overlayPositionClass} top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[9999] w-full ${maxWidthClasses[maxWidth]} max-h-[calc(100dvh-2rem)] px-4 flex`,
|
|
2194
2221
|
children: /* @__PURE__ */ jsxs6("div", {
|
|
2195
|
-
className: "bg-background border border-border rounded-lg shadow-lg",
|
|
2222
|
+
className: "bg-background border border-border rounded-lg shadow-lg max-h-full w-full flex flex-col overflow-hidden",
|
|
2196
2223
|
children: [
|
|
2197
2224
|
(title || showCloseButton) && /* @__PURE__ */ jsxs6("div", {
|
|
2198
|
-
className: "flex items-center justify-between p-4 border-b border-border",
|
|
2225
|
+
className: "flex flex-shrink-0 items-center justify-between p-4 border-b border-border",
|
|
2199
2226
|
children: [
|
|
2200
2227
|
title && /* @__PURE__ */ jsx11("div", {
|
|
2201
2228
|
className: "text-lg font-semibold text-foreground",
|
|
@@ -2213,7 +2240,7 @@ function Modal({
|
|
|
2213
2240
|
]
|
|
2214
2241
|
}),
|
|
2215
2242
|
/* @__PURE__ */ jsx11("div", {
|
|
2216
|
-
className: "p-6",
|
|
2243
|
+
className: "p-6 overflow-y-auto",
|
|
2217
2244
|
children
|
|
2218
2245
|
})
|
|
2219
2246
|
]
|
|
@@ -5172,7 +5199,7 @@ import {
|
|
|
5172
5199
|
import { ChevronDown, Search } from "lucide-react";
|
|
5173
5200
|
import Fuse2 from "fuse.js";
|
|
5174
5201
|
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5175
|
-
var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider, model, onChange, disabled = false }, ref) {
|
|
5202
|
+
var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider, model, onChange, disabled = false, dropdownMode = "absolute" }, ref) {
|
|
5176
5203
|
const { data: allModels } = useAllModels();
|
|
5177
5204
|
const { data: currentProviderModels, isLoading: isCurrentProviderLoading } = useModels(provider);
|
|
5178
5205
|
const [isOpen, setIsOpen] = useState10(false);
|
|
@@ -5425,6 +5452,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5425
5452
|
const currentProviderLabel = loadedModels[provider]?.label || currentProviderModels?.label || provider;
|
|
5426
5453
|
const currentModelLabel = loadedModels[provider]?.models.find((m) => m.id === model)?.label || currentProviderModels?.models.find((m) => m.id === model)?.label || model;
|
|
5427
5454
|
const displayedProviderKeys = searchQuery.trim() ? Object.keys(filteredModels) : configuredProviders;
|
|
5455
|
+
const dropdownPositionClass = dropdownMode === "inline" ? "relative" : "absolute z-50";
|
|
5428
5456
|
return /* @__PURE__ */ jsxs10("div", {
|
|
5429
5457
|
ref: dropdownRef,
|
|
5430
5458
|
className: "relative w-full",
|
|
@@ -5458,7 +5486,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5458
5486
|
]
|
|
5459
5487
|
}),
|
|
5460
5488
|
isOpen && /* @__PURE__ */ jsxs10("div", {
|
|
5461
|
-
className:
|
|
5489
|
+
className: `${dropdownPositionClass} mt-1 w-full bg-[hsl(var(--popover))] border border-[hsl(var(--border))] rounded-md shadow-lg max-h-80 overflow-hidden flex flex-col`,
|
|
5462
5490
|
children: [
|
|
5463
5491
|
/* @__PURE__ */ jsx16("div", {
|
|
5464
5492
|
className: "p-2 border-b border-[hsl(var(--border))]",
|
|
@@ -5892,7 +5920,8 @@ function ConfigModal({
|
|
|
5892
5920
|
ref: modelSelectorRef,
|
|
5893
5921
|
provider,
|
|
5894
5922
|
model,
|
|
5895
|
-
onChange: handleModelChange
|
|
5923
|
+
onChange: handleModelChange,
|
|
5924
|
+
dropdownMode: "inline"
|
|
5896
5925
|
})
|
|
5897
5926
|
]
|
|
5898
5927
|
})
|
|
@@ -21167,7 +21196,8 @@ var ResearchSidebarToggle = memo30(function ResearchSidebarToggle2({
|
|
|
21167
21196
|
});
|
|
21168
21197
|
});
|
|
21169
21198
|
// src/components/settings/SettingsSidebar.tsx
|
|
21170
|
-
import { memo as memo31, useState as useState39, useMemo as useMemo22, useCallback as useCallback27, useEffect as useEffect37 } from "react";
|
|
21199
|
+
import { memo as memo31, useState as useState39, useMemo as useMemo22, useCallback as useCallback27, useEffect as useEffect37, useRef as useRef26 } from "react";
|
|
21200
|
+
import { createPortal } from "react-dom";
|
|
21171
21201
|
import {
|
|
21172
21202
|
Settings as Settings2,
|
|
21173
21203
|
ChevronRight as ChevronRight13,
|
|
@@ -21182,7 +21212,9 @@ import {
|
|
|
21182
21212
|
Copy as Copy3,
|
|
21183
21213
|
Check as Check11,
|
|
21184
21214
|
Key,
|
|
21185
|
-
Loader2 as Loader210
|
|
21215
|
+
Loader2 as Loader210,
|
|
21216
|
+
Type,
|
|
21217
|
+
Sparkles as Sparkles6
|
|
21186
21218
|
} from "lucide-react";
|
|
21187
21219
|
import { QRCodeSVG } from "qrcode.react";
|
|
21188
21220
|
|
|
@@ -21589,6 +21621,52 @@ var SETTINGS_PANEL_KEY = "settings";
|
|
|
21589
21621
|
var SETTINGS_DEFAULT_WIDTH = 320;
|
|
21590
21622
|
var SETTINGS_MIN_WIDTH = 320;
|
|
21591
21623
|
var SETTINGS_MAX_WIDTH = 500;
|
|
21624
|
+
var DEFAULT_FONT_FAMILY2 = "IBM Plex Mono";
|
|
21625
|
+
var COMMON_SYSTEM_FONTS = [
|
|
21626
|
+
DEFAULT_FONT_FAMILY2,
|
|
21627
|
+
"System UI",
|
|
21628
|
+
"Arial",
|
|
21629
|
+
"Avenir",
|
|
21630
|
+
"BlinkMacSystemFont",
|
|
21631
|
+
"Courier New",
|
|
21632
|
+
"Fira Code",
|
|
21633
|
+
"Georgia",
|
|
21634
|
+
"Helvetica",
|
|
21635
|
+
"Inter",
|
|
21636
|
+
"Menlo",
|
|
21637
|
+
"Monaco",
|
|
21638
|
+
"SF Mono",
|
|
21639
|
+
"Segoe UI",
|
|
21640
|
+
"Times New Roman",
|
|
21641
|
+
"Ubuntu",
|
|
21642
|
+
"Verdana"
|
|
21643
|
+
];
|
|
21644
|
+
function requestDesktopSystemFonts() {
|
|
21645
|
+
if (typeof window === "undefined" || window.self === window.top) {
|
|
21646
|
+
return Promise.resolve(null);
|
|
21647
|
+
}
|
|
21648
|
+
return new Promise((resolve, reject) => {
|
|
21649
|
+
const requestId = crypto.randomUUID();
|
|
21650
|
+
const timeout = window.setTimeout(() => {
|
|
21651
|
+
window.removeEventListener("message", handleMessage);
|
|
21652
|
+
resolve(null);
|
|
21653
|
+
}, 3000);
|
|
21654
|
+
function handleMessage(event) {
|
|
21655
|
+
if (event.data?.type !== "otto-system-fonts-result" || event.data.requestId !== requestId) {
|
|
21656
|
+
return;
|
|
21657
|
+
}
|
|
21658
|
+
window.clearTimeout(timeout);
|
|
21659
|
+
window.removeEventListener("message", handleMessage);
|
|
21660
|
+
if (event.data.error) {
|
|
21661
|
+
reject(new Error(event.data.error));
|
|
21662
|
+
return;
|
|
21663
|
+
}
|
|
21664
|
+
resolve(event.data.fonts ?? null);
|
|
21665
|
+
}
|
|
21666
|
+
window.addEventListener("message", handleMessage);
|
|
21667
|
+
window.parent.postMessage({ type: "otto-list-system-fonts", requestId }, "*");
|
|
21668
|
+
});
|
|
21669
|
+
}
|
|
21592
21670
|
var SettingsSection = memo31(function SettingsSection2({
|
|
21593
21671
|
title,
|
|
21594
21672
|
icon,
|
|
@@ -21637,10 +21715,10 @@ var ToggleRow = memo31(function ToggleRow2({
|
|
|
21637
21715
|
onChange
|
|
21638
21716
|
}) {
|
|
21639
21717
|
return /* @__PURE__ */ jsxs80("div", {
|
|
21640
|
-
className: "flex items-center justify-between text-sm",
|
|
21718
|
+
className: "flex min-w-0 items-center justify-between gap-3 text-sm",
|
|
21641
21719
|
children: [
|
|
21642
21720
|
/* @__PURE__ */ jsx88("span", {
|
|
21643
|
-
className: "text-muted-foreground",
|
|
21721
|
+
className: "min-w-0 flex-1 truncate text-muted-foreground",
|
|
21644
21722
|
children: label
|
|
21645
21723
|
}),
|
|
21646
21724
|
/* @__PURE__ */ jsx88("button", {
|
|
@@ -21648,7 +21726,7 @@ var ToggleRow = memo31(function ToggleRow2({
|
|
|
21648
21726
|
role: "switch",
|
|
21649
21727
|
"aria-checked": checked,
|
|
21650
21728
|
onClick: () => onChange(!checked),
|
|
21651
|
-
className: `relative inline-flex h-6 w-11 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 ${checked ? "bg-primary" : "bg-muted"}`,
|
|
21729
|
+
className: `relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 ${checked ? "bg-primary" : "bg-muted"}`,
|
|
21652
21730
|
children: /* @__PURE__ */ jsx88("span", {
|
|
21653
21731
|
className: `inline-block h-4 w-4 transform rounded-full transition-transform ${checked ? "translate-x-6" : "translate-x-1"} ${checked ? "bg-primary-foreground" : "bg-foreground"}`
|
|
21654
21732
|
})
|
|
@@ -21664,7 +21742,31 @@ var SelectRow = memo31(function SelectRow2({
|
|
|
21664
21742
|
disabled
|
|
21665
21743
|
}) {
|
|
21666
21744
|
const [isOpen, setIsOpen] = useState39(false);
|
|
21745
|
+
const [menuStyle, setMenuStyle] = useState39(null);
|
|
21746
|
+
const buttonRef = useRef26(null);
|
|
21667
21747
|
const selectedOption = options.find((o) => o.id === value);
|
|
21748
|
+
useEffect37(() => {
|
|
21749
|
+
if (!isOpen || !buttonRef.current)
|
|
21750
|
+
return;
|
|
21751
|
+
const update = () => {
|
|
21752
|
+
const rect = buttonRef.current?.getBoundingClientRect();
|
|
21753
|
+
if (!rect)
|
|
21754
|
+
return;
|
|
21755
|
+
const width = Math.max(rect.width, 160);
|
|
21756
|
+
setMenuStyle({
|
|
21757
|
+
top: rect.bottom + 4,
|
|
21758
|
+
left: rect.right - width,
|
|
21759
|
+
width
|
|
21760
|
+
});
|
|
21761
|
+
};
|
|
21762
|
+
update();
|
|
21763
|
+
window.addEventListener("scroll", update, true);
|
|
21764
|
+
window.addEventListener("resize", update);
|
|
21765
|
+
return () => {
|
|
21766
|
+
window.removeEventListener("scroll", update, true);
|
|
21767
|
+
window.removeEventListener("resize", update);
|
|
21768
|
+
};
|
|
21769
|
+
}, [isOpen]);
|
|
21668
21770
|
return /* @__PURE__ */ jsxs80("div", {
|
|
21669
21771
|
className: "flex items-center justify-between text-sm",
|
|
21670
21772
|
children: [
|
|
@@ -21676,6 +21778,7 @@ var SelectRow = memo31(function SelectRow2({
|
|
|
21676
21778
|
className: "relative",
|
|
21677
21779
|
children: [
|
|
21678
21780
|
/* @__PURE__ */ jsxs80("button", {
|
|
21781
|
+
ref: buttonRef,
|
|
21679
21782
|
type: "button",
|
|
21680
21783
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
21681
21784
|
disabled,
|
|
@@ -21690,15 +21793,20 @@ var SelectRow = memo31(function SelectRow2({
|
|
|
21690
21793
|
})
|
|
21691
21794
|
]
|
|
21692
21795
|
}),
|
|
21693
|
-
isOpen && /* @__PURE__ */ jsxs80(Fragment35, {
|
|
21796
|
+
isOpen && menuStyle && typeof document !== "undefined" && createPortal(/* @__PURE__ */ jsxs80(Fragment35, {
|
|
21694
21797
|
children: [
|
|
21695
21798
|
/* @__PURE__ */ jsx88("div", {
|
|
21696
|
-
className: "fixed inset-0 z-
|
|
21799
|
+
className: "fixed inset-0 z-[10000]",
|
|
21697
21800
|
onClick: () => setIsOpen(false),
|
|
21698
21801
|
role: "presentation"
|
|
21699
21802
|
}),
|
|
21700
21803
|
/* @__PURE__ */ jsx88("div", {
|
|
21701
|
-
className: "
|
|
21804
|
+
className: "fixed z-[10001] max-h-[240px] overflow-y-auto bg-popover border border-border rounded-md shadow-lg",
|
|
21805
|
+
style: {
|
|
21806
|
+
top: menuStyle.top,
|
|
21807
|
+
left: menuStyle.left,
|
|
21808
|
+
minWidth: menuStyle.width
|
|
21809
|
+
},
|
|
21702
21810
|
children: options.map((option) => /* @__PURE__ */ jsx88("button", {
|
|
21703
21811
|
type: "button",
|
|
21704
21812
|
onClick: () => {
|
|
@@ -21710,12 +21818,141 @@ var SelectRow = memo31(function SelectRow2({
|
|
|
21710
21818
|
}, option.id))
|
|
21711
21819
|
})
|
|
21712
21820
|
]
|
|
21713
|
-
})
|
|
21821
|
+
}), document.body)
|
|
21714
21822
|
]
|
|
21715
21823
|
})
|
|
21716
21824
|
]
|
|
21717
21825
|
});
|
|
21718
21826
|
});
|
|
21827
|
+
var FontPickerRow = memo31(function FontPickerRow2({
|
|
21828
|
+
value,
|
|
21829
|
+
onChange
|
|
21830
|
+
}) {
|
|
21831
|
+
const [isOpen, setIsOpen] = useState39(false);
|
|
21832
|
+
const [search, setSearch] = useState39("");
|
|
21833
|
+
const [localFonts, setLocalFonts] = useState39([]);
|
|
21834
|
+
const [isLoadingFonts, setIsLoadingFonts] = useState39(false);
|
|
21835
|
+
const [fontError, setFontError] = useState39(null);
|
|
21836
|
+
const canQueryLocalFonts = typeof window !== "undefined" && typeof window.queryLocalFonts === "function";
|
|
21837
|
+
const canRequestDesktopFonts = typeof window !== "undefined" && window.self !== window.top;
|
|
21838
|
+
const fontOptions = useMemo22(() => {
|
|
21839
|
+
return Array.from(new Set([value, ...localFonts, ...COMMON_SYSTEM_FONTS].filter(Boolean))).sort((a, b) => a.localeCompare(b));
|
|
21840
|
+
}, [localFonts, value]);
|
|
21841
|
+
const filteredFonts = useMemo22(() => {
|
|
21842
|
+
const query = search.trim().toLowerCase();
|
|
21843
|
+
if (!query)
|
|
21844
|
+
return fontOptions;
|
|
21845
|
+
return fontOptions.filter((font) => font.toLowerCase().includes(query));
|
|
21846
|
+
}, [fontOptions, search]);
|
|
21847
|
+
const loadLocalFonts = useCallback27(async () => {
|
|
21848
|
+
if (isLoadingFonts || localFonts.length > 0)
|
|
21849
|
+
return;
|
|
21850
|
+
const queryLocalFonts = window.queryLocalFonts;
|
|
21851
|
+
setIsLoadingFonts(true);
|
|
21852
|
+
setFontError(null);
|
|
21853
|
+
try {
|
|
21854
|
+
if (queryLocalFonts) {
|
|
21855
|
+
const fonts = await queryLocalFonts();
|
|
21856
|
+
setLocalFonts(Array.from(new Set(fonts.map((font) => font.family).filter(Boolean))));
|
|
21857
|
+
return;
|
|
21858
|
+
}
|
|
21859
|
+
const desktopFonts = await requestDesktopSystemFonts();
|
|
21860
|
+
if (desktopFonts?.length) {
|
|
21861
|
+
setLocalFonts(desktopFonts);
|
|
21862
|
+
return;
|
|
21863
|
+
}
|
|
21864
|
+
setFontError("Local font access is not supported in this browser");
|
|
21865
|
+
} catch (error) {
|
|
21866
|
+
setFontError(error instanceof Error ? error.message : "Unable to load local fonts");
|
|
21867
|
+
} finally {
|
|
21868
|
+
setIsLoadingFonts(false);
|
|
21869
|
+
}
|
|
21870
|
+
}, [isLoadingFonts, localFonts.length]);
|
|
21871
|
+
const openPicker = () => {
|
|
21872
|
+
setIsOpen(true);
|
|
21873
|
+
loadLocalFonts();
|
|
21874
|
+
};
|
|
21875
|
+
return /* @__PURE__ */ jsx88("div", {
|
|
21876
|
+
className: "space-y-2 text-sm",
|
|
21877
|
+
children: /* @__PURE__ */ jsxs80("div", {
|
|
21878
|
+
className: "flex items-center justify-between gap-3",
|
|
21879
|
+
children: [
|
|
21880
|
+
/* @__PURE__ */ jsx88("span", {
|
|
21881
|
+
className: "text-muted-foreground",
|
|
21882
|
+
children: "UI Font"
|
|
21883
|
+
}),
|
|
21884
|
+
/* @__PURE__ */ jsxs80("div", {
|
|
21885
|
+
className: "relative min-w-0",
|
|
21886
|
+
children: [
|
|
21887
|
+
/* @__PURE__ */ jsxs80("button", {
|
|
21888
|
+
type: "button",
|
|
21889
|
+
onClick: () => isOpen ? setIsOpen(false) : openPicker(),
|
|
21890
|
+
className: "flex max-w-[170px] items-center gap-1 rounded border border-border bg-muted px-2 py-1 text-xs hover:bg-muted/80",
|
|
21891
|
+
children: [
|
|
21892
|
+
/* @__PURE__ */ jsx88("span", {
|
|
21893
|
+
className: "truncate",
|
|
21894
|
+
style: { fontFamily: value },
|
|
21895
|
+
children: value || DEFAULT_FONT_FAMILY2
|
|
21896
|
+
}),
|
|
21897
|
+
/* @__PURE__ */ jsx88(ChevronDown9, {
|
|
21898
|
+
className: "h-3 w-3 shrink-0"
|
|
21899
|
+
})
|
|
21900
|
+
]
|
|
21901
|
+
}),
|
|
21902
|
+
isOpen && /* @__PURE__ */ jsxs80(Fragment35, {
|
|
21903
|
+
children: [
|
|
21904
|
+
/* @__PURE__ */ jsx88("div", {
|
|
21905
|
+
className: "fixed inset-0 z-40",
|
|
21906
|
+
onClick: () => setIsOpen(false),
|
|
21907
|
+
role: "presentation"
|
|
21908
|
+
}),
|
|
21909
|
+
/* @__PURE__ */ jsxs80("div", {
|
|
21910
|
+
className: "absolute right-0 top-full z-50 mt-1 w-72 rounded-md border border-border bg-popover shadow-lg",
|
|
21911
|
+
children: [
|
|
21912
|
+
/* @__PURE__ */ jsx88("div", {
|
|
21913
|
+
className: "border-b border-border p-2",
|
|
21914
|
+
children: /* @__PURE__ */ jsx88("input", {
|
|
21915
|
+
type: "search",
|
|
21916
|
+
value: search,
|
|
21917
|
+
onChange: (event) => setSearch(event.target.value),
|
|
21918
|
+
placeholder: "Search system fonts...",
|
|
21919
|
+
className: "w-full rounded border border-border bg-background px-2 py-1.5 text-xs outline-none placeholder:text-muted-foreground/70 focus:border-primary"
|
|
21920
|
+
})
|
|
21921
|
+
}),
|
|
21922
|
+
/* @__PURE__ */ jsxs80("div", {
|
|
21923
|
+
className: "max-h-64 overflow-y-auto py-1",
|
|
21924
|
+
children: [
|
|
21925
|
+
filteredFonts.map((font) => /* @__PURE__ */ jsx88("button", {
|
|
21926
|
+
type: "button",
|
|
21927
|
+
onClick: () => {
|
|
21928
|
+
onChange(font);
|
|
21929
|
+
setIsOpen(false);
|
|
21930
|
+
setSearch("");
|
|
21931
|
+
},
|
|
21932
|
+
className: `w-full px-3 py-2 text-left text-xs hover:bg-muted ${font === value ? "bg-muted/50" : ""}`,
|
|
21933
|
+
style: { fontFamily: font },
|
|
21934
|
+
children: font
|
|
21935
|
+
}, font)),
|
|
21936
|
+
filteredFonts.length === 0 && /* @__PURE__ */ jsx88("div", {
|
|
21937
|
+
className: "px-3 py-2 text-xs text-muted-foreground",
|
|
21938
|
+
children: "No fonts found"
|
|
21939
|
+
})
|
|
21940
|
+
]
|
|
21941
|
+
}),
|
|
21942
|
+
/* @__PURE__ */ jsx88("div", {
|
|
21943
|
+
className: "border-t border-border px-3 py-2 text-xs text-muted-foreground",
|
|
21944
|
+
children: isLoadingFonts ? "Loading local fonts..." : fontError ? fontError : localFonts.length > 0 ? `${localFonts.length} local fonts found` : canQueryLocalFonts ? "Choose a font or allow local font access if prompted" : canRequestDesktopFonts ? "Loading desktop system fonts if available" : "Showing common system fonts"
|
|
21945
|
+
})
|
|
21946
|
+
]
|
|
21947
|
+
})
|
|
21948
|
+
]
|
|
21949
|
+
})
|
|
21950
|
+
]
|
|
21951
|
+
})
|
|
21952
|
+
]
|
|
21953
|
+
})
|
|
21954
|
+
});
|
|
21955
|
+
});
|
|
21719
21956
|
var NumberInputRow = memo31(function NumberInputRow2({
|
|
21720
21957
|
label,
|
|
21721
21958
|
value,
|
|
@@ -21793,13 +22030,130 @@ var NumberInputRow = memo31(function NumberInputRow2({
|
|
|
21793
22030
|
]
|
|
21794
22031
|
});
|
|
21795
22032
|
});
|
|
22033
|
+
function PreferencesModal({ isOpen, onClose }) {
|
|
22034
|
+
const { data: config2 } = useConfig();
|
|
22035
|
+
const { preferences: preferences2, updatePreferences } = usePreferences();
|
|
22036
|
+
const updateDefaults = useUpdateDefaults();
|
|
22037
|
+
return /* @__PURE__ */ jsx88(Modal, {
|
|
22038
|
+
isOpen,
|
|
22039
|
+
onClose,
|
|
22040
|
+
title: "Preferences",
|
|
22041
|
+
maxWidth: "lg",
|
|
22042
|
+
children: /* @__PURE__ */ jsxs80("div", {
|
|
22043
|
+
className: "-m-6",
|
|
22044
|
+
children: [
|
|
22045
|
+
/* @__PURE__ */ jsxs80(SettingsSection, {
|
|
22046
|
+
title: "Editor",
|
|
22047
|
+
icon: /* @__PURE__ */ jsx88(Type, {
|
|
22048
|
+
className: "w-4 h-4 text-muted-foreground"
|
|
22049
|
+
}),
|
|
22050
|
+
children: [
|
|
22051
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22052
|
+
label: "Vim Mode",
|
|
22053
|
+
checked: preferences2.vimMode,
|
|
22054
|
+
onChange: (checked) => updatePreferences({ vimMode: checked })
|
|
22055
|
+
}),
|
|
22056
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22057
|
+
label: "Compact Thread",
|
|
22058
|
+
checked: preferences2.compactThread,
|
|
22059
|
+
onChange: (checked) => updatePreferences({ compactThread: checked })
|
|
22060
|
+
}),
|
|
22061
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22062
|
+
label: "Full Width Content",
|
|
22063
|
+
checked: preferences2.fullWidthContent,
|
|
22064
|
+
onChange: (checked) => updatePreferences({ fullWidthContent: checked })
|
|
22065
|
+
}),
|
|
22066
|
+
/* @__PURE__ */ jsx88(FontPickerRow, {
|
|
22067
|
+
value: preferences2.fontFamily,
|
|
22068
|
+
onChange: (fontFamily) => updatePreferences({ fontFamily })
|
|
22069
|
+
})
|
|
22070
|
+
]
|
|
22071
|
+
}),
|
|
22072
|
+
/* @__PURE__ */ jsxs80(SettingsSection, {
|
|
22073
|
+
title: "Automation",
|
|
22074
|
+
icon: /* @__PURE__ */ jsx88(Zap, {
|
|
22075
|
+
className: "w-4 h-4 text-muted-foreground"
|
|
22076
|
+
}),
|
|
22077
|
+
children: [
|
|
22078
|
+
/* @__PURE__ */ jsx88(NumberInputRow, {
|
|
22079
|
+
label: "Auto Compact",
|
|
22080
|
+
value: config2?.defaults?.autoCompactThresholdTokens,
|
|
22081
|
+
onCommit: (value) => updateDefaults.mutate({
|
|
22082
|
+
autoCompactThresholdTokens: value,
|
|
22083
|
+
scope: "global"
|
|
22084
|
+
}),
|
|
22085
|
+
placeholder: "Tokens",
|
|
22086
|
+
disabled: updateDefaults.isPending
|
|
22087
|
+
}),
|
|
22088
|
+
/* @__PURE__ */ jsx88(SelectRow, {
|
|
22089
|
+
label: "Tool Approval",
|
|
22090
|
+
value: config2?.defaults?.toolApproval ?? "dangerous",
|
|
22091
|
+
options: [
|
|
22092
|
+
{ id: "auto", label: "Auto (no approval)" },
|
|
22093
|
+
{ id: "dangerous", label: "Dangerous only" },
|
|
22094
|
+
{ id: "yolo", label: "YOLO (hard blocks only)" },
|
|
22095
|
+
{ id: "all", label: "All tools" }
|
|
22096
|
+
],
|
|
22097
|
+
onChange: (value) => updateDefaults.mutate({
|
|
22098
|
+
toolApproval: value,
|
|
22099
|
+
scope: "global"
|
|
22100
|
+
}),
|
|
22101
|
+
disabled: updateDefaults.isPending
|
|
22102
|
+
}),
|
|
22103
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22104
|
+
label: "Guided Mode",
|
|
22105
|
+
checked: config2?.defaults?.guidedMode ?? false,
|
|
22106
|
+
onChange: (checked) => updateDefaults.mutate({
|
|
22107
|
+
guidedMode: checked,
|
|
22108
|
+
scope: "global"
|
|
22109
|
+
})
|
|
22110
|
+
})
|
|
22111
|
+
]
|
|
22112
|
+
}),
|
|
22113
|
+
/* @__PURE__ */ jsxs80(SettingsSection, {
|
|
22114
|
+
title: "Reasoning",
|
|
22115
|
+
icon: /* @__PURE__ */ jsx88(Sparkles6, {
|
|
22116
|
+
className: "w-4 h-4 text-muted-foreground"
|
|
22117
|
+
}),
|
|
22118
|
+
children: [
|
|
22119
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22120
|
+
label: "Show Reasoning",
|
|
22121
|
+
checked: config2?.defaults?.reasoningText ?? true,
|
|
22122
|
+
onChange: (checked) => updateDefaults.mutate({
|
|
22123
|
+
reasoningText: checked,
|
|
22124
|
+
scope: "global"
|
|
22125
|
+
})
|
|
22126
|
+
}),
|
|
22127
|
+
/* @__PURE__ */ jsx88(SelectRow, {
|
|
22128
|
+
label: "Reasoning Level",
|
|
22129
|
+
value: config2?.defaults?.reasoningLevel ?? "high",
|
|
22130
|
+
options: [
|
|
22131
|
+
{ id: "minimal", label: "Minimal" },
|
|
22132
|
+
{ id: "low", label: "Low" },
|
|
22133
|
+
{ id: "medium", label: "Medium" },
|
|
22134
|
+
{ id: "high", label: "High" },
|
|
22135
|
+
{ id: "max", label: "Max" },
|
|
22136
|
+
{ id: "xhigh", label: "Extra High" }
|
|
22137
|
+
],
|
|
22138
|
+
onChange: (value) => updateDefaults.mutate({
|
|
22139
|
+
reasoningLevel: value,
|
|
22140
|
+
scope: "global"
|
|
22141
|
+
}),
|
|
22142
|
+
disabled: updateDefaults.isPending
|
|
22143
|
+
})
|
|
22144
|
+
]
|
|
22145
|
+
})
|
|
22146
|
+
]
|
|
22147
|
+
})
|
|
22148
|
+
});
|
|
22149
|
+
}
|
|
21796
22150
|
var SettingsSidebar = memo31(function SettingsSidebar2() {
|
|
21797
22151
|
const isExpanded = useSettingsStore((state) => state.isExpanded);
|
|
21798
22152
|
const collapseSidebar = useSettingsStore((state) => state.collapseSidebar);
|
|
22153
|
+
const [isPreferencesOpen, setIsPreferencesOpen] = useState39(false);
|
|
21799
22154
|
const panelWidth = usePanelWidthStore((s) => s.widths[SETTINGS_PANEL_KEY] ?? SETTINGS_DEFAULT_WIDTH);
|
|
21800
22155
|
const { data: config2 } = useConfig();
|
|
21801
22156
|
const { data: allModels } = useAllModels();
|
|
21802
|
-
const { preferences: preferences2, updatePreferences } = usePreferences();
|
|
21803
22157
|
const updateDefaults = useUpdateDefaults();
|
|
21804
22158
|
const ottorouterBalance = useOttoRouterStore((s) => s.balance);
|
|
21805
22159
|
const ottorouterWallet = useOttoRouterStore((s) => s.walletAddress);
|
|
@@ -21925,87 +22279,6 @@ var SettingsSidebar = memo31(function SettingsSidebar2() {
|
|
|
21925
22279
|
})
|
|
21926
22280
|
]
|
|
21927
22281
|
}),
|
|
21928
|
-
/* @__PURE__ */ jsxs80(SettingsSection, {
|
|
21929
|
-
title: "Preferences",
|
|
21930
|
-
icon: /* @__PURE__ */ jsx88(User3, {
|
|
21931
|
-
className: "w-4 h-4 text-muted-foreground"
|
|
21932
|
-
}),
|
|
21933
|
-
children: [
|
|
21934
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
21935
|
-
label: "Vim Mode",
|
|
21936
|
-
checked: preferences2.vimMode,
|
|
21937
|
-
onChange: (checked) => updatePreferences({ vimMode: checked })
|
|
21938
|
-
}),
|
|
21939
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
21940
|
-
label: "Compact Thread",
|
|
21941
|
-
checked: preferences2.compactThread,
|
|
21942
|
-
onChange: (checked) => updatePreferences({ compactThread: checked })
|
|
21943
|
-
}),
|
|
21944
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
21945
|
-
label: "Full Width Content",
|
|
21946
|
-
checked: preferences2.fullWidthContent,
|
|
21947
|
-
onChange: (checked) => updatePreferences({ fullWidthContent: checked })
|
|
21948
|
-
}),
|
|
21949
|
-
/* @__PURE__ */ jsx88(NumberInputRow, {
|
|
21950
|
-
label: "Auto Compact",
|
|
21951
|
-
value: config2?.defaults?.autoCompactThresholdTokens,
|
|
21952
|
-
onCommit: (value) => updateDefaults.mutate({
|
|
21953
|
-
autoCompactThresholdTokens: value,
|
|
21954
|
-
scope: "global"
|
|
21955
|
-
}),
|
|
21956
|
-
placeholder: "Tokens",
|
|
21957
|
-
disabled: updateDefaults.isPending
|
|
21958
|
-
}),
|
|
21959
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
21960
|
-
label: "Show Reasoning",
|
|
21961
|
-
checked: config2?.defaults?.reasoningText ?? true,
|
|
21962
|
-
onChange: (checked) => updateDefaults.mutate({
|
|
21963
|
-
reasoningText: checked,
|
|
21964
|
-
scope: "global"
|
|
21965
|
-
})
|
|
21966
|
-
}),
|
|
21967
|
-
/* @__PURE__ */ jsx88(SelectRow, {
|
|
21968
|
-
label: "Reasoning Level",
|
|
21969
|
-
value: config2?.defaults?.reasoningLevel ?? "high",
|
|
21970
|
-
options: [
|
|
21971
|
-
{ id: "minimal", label: "Minimal" },
|
|
21972
|
-
{ id: "low", label: "Low" },
|
|
21973
|
-
{ id: "medium", label: "Medium" },
|
|
21974
|
-
{ id: "high", label: "High" },
|
|
21975
|
-
{ id: "max", label: "Max" },
|
|
21976
|
-
{ id: "xhigh", label: "Extra High" }
|
|
21977
|
-
],
|
|
21978
|
-
onChange: (value) => updateDefaults.mutate({
|
|
21979
|
-
reasoningLevel: value,
|
|
21980
|
-
scope: "global"
|
|
21981
|
-
}),
|
|
21982
|
-
disabled: updateDefaults.isPending
|
|
21983
|
-
}),
|
|
21984
|
-
/* @__PURE__ */ jsx88(SelectRow, {
|
|
21985
|
-
label: "Tool Approval",
|
|
21986
|
-
value: config2?.defaults?.toolApproval ?? "dangerous",
|
|
21987
|
-
options: [
|
|
21988
|
-
{ id: "auto", label: "Auto (no approval)" },
|
|
21989
|
-
{ id: "dangerous", label: "Dangerous only" },
|
|
21990
|
-
{ id: "yolo", label: "YOLO (hard blocks only)" },
|
|
21991
|
-
{ id: "all", label: "All tools" }
|
|
21992
|
-
],
|
|
21993
|
-
onChange: (value) => updateDefaults.mutate({
|
|
21994
|
-
toolApproval: value,
|
|
21995
|
-
scope: "global"
|
|
21996
|
-
}),
|
|
21997
|
-
disabled: updateDefaults.isPending
|
|
21998
|
-
}),
|
|
21999
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22000
|
-
label: "Guided Mode",
|
|
22001
|
-
checked: config2?.defaults?.guidedMode ?? false,
|
|
22002
|
-
onChange: (checked) => updateDefaults.mutate({
|
|
22003
|
-
guidedMode: checked,
|
|
22004
|
-
scope: "global"
|
|
22005
|
-
})
|
|
22006
|
-
})
|
|
22007
|
-
]
|
|
22008
|
-
}),
|
|
22009
22282
|
/* @__PURE__ */ jsx88(SettingsSection, {
|
|
22010
22283
|
title: "Providers",
|
|
22011
22284
|
icon: /* @__PURE__ */ jsx88(Zap, {
|
|
@@ -22048,6 +22321,28 @@ var SettingsSidebar = memo31(function SettingsSidebar2() {
|
|
|
22048
22321
|
}),
|
|
22049
22322
|
/* @__PURE__ */ jsx88(OttoRouterTopupModal, {})
|
|
22050
22323
|
]
|
|
22324
|
+
}),
|
|
22325
|
+
/* @__PURE__ */ jsxs80("button", {
|
|
22326
|
+
type: "button",
|
|
22327
|
+
onClick: () => setIsPreferencesOpen(true),
|
|
22328
|
+
title: "Open preferences",
|
|
22329
|
+
className: "group shrink-0 w-full h-12 px-4 flex items-center gap-2 bg-muted/20 hover:bg-muted/60 border-t border-border transition-colors text-left cursor-pointer",
|
|
22330
|
+
children: [
|
|
22331
|
+
/* @__PURE__ */ jsx88(User3, {
|
|
22332
|
+
className: "w-4 h-4 text-muted-foreground group-hover:text-foreground transition-colors"
|
|
22333
|
+
}),
|
|
22334
|
+
/* @__PURE__ */ jsx88("span", {
|
|
22335
|
+
className: "text-sm flex-1 text-muted-foreground group-hover:text-foreground transition-colors",
|
|
22336
|
+
children: "Preferences"
|
|
22337
|
+
}),
|
|
22338
|
+
/* @__PURE__ */ jsx88(ChevronRight13, {
|
|
22339
|
+
className: "w-4 h-4 text-muted-foreground group-hover:text-foreground group-hover:translate-x-0.5 transition-all"
|
|
22340
|
+
})
|
|
22341
|
+
]
|
|
22342
|
+
}),
|
|
22343
|
+
/* @__PURE__ */ jsx88(PreferencesModal, {
|
|
22344
|
+
isOpen: isPreferencesOpen,
|
|
22345
|
+
onClose: () => setIsPreferencesOpen(false)
|
|
22051
22346
|
})
|
|
22052
22347
|
]
|
|
22053
22348
|
})
|
|
@@ -22410,7 +22705,7 @@ import { QRCodeSVG as QRCodeSVG2 } from "qrcode.react";
|
|
|
22410
22705
|
|
|
22411
22706
|
// src/hooks/useTunnel.ts
|
|
22412
22707
|
import { useQuery as useQuery12, useMutation as useMutation9, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
22413
|
-
import { useEffect as useEffect38, useCallback as useCallback28, useRef as
|
|
22708
|
+
import { useEffect as useEffect38, useCallback as useCallback28, useRef as useRef27 } from "react";
|
|
22414
22709
|
async function fetchTunnelStatus() {
|
|
22415
22710
|
const response = await fetch(`${API_BASE_URL}/v1/tunnel/status`);
|
|
22416
22711
|
if (!response.ok) {
|
|
@@ -22518,7 +22813,7 @@ function useTunnelStream() {
|
|
|
22518
22813
|
const setError = useTunnelStore((s) => s.setError);
|
|
22519
22814
|
const setProgress = useTunnelStore((s) => s.setProgress);
|
|
22520
22815
|
const isExpanded = useTunnelStore((s) => s.isExpanded);
|
|
22521
|
-
const eventSourceRef =
|
|
22816
|
+
const eventSourceRef = useRef27(null);
|
|
22522
22817
|
const connect = useCallback28(() => {
|
|
22523
22818
|
if (eventSourceRef.current) {
|
|
22524
22819
|
eventSourceRef.current.close();
|
|
@@ -22818,7 +23113,7 @@ var TunnelSidebarToggle = memo34(function TunnelSidebarToggle2() {
|
|
|
22818
23113
|
});
|
|
22819
23114
|
});
|
|
22820
23115
|
// src/components/mcp/MCPSidebar.tsx
|
|
22821
|
-
import { memo as memo37, useState as useState42, useCallback as useCallback31, useMemo as useMemo23, useEffect as useEffect41, useRef as
|
|
23116
|
+
import { memo as memo37, useState as useState42, useCallback as useCallback31, useMemo as useMemo23, useEffect as useEffect41, useRef as useRef30 } from "react";
|
|
22822
23117
|
import {
|
|
22823
23118
|
ChevronDown as ChevronDown10,
|
|
22824
23119
|
ChevronRight as ChevronRight15,
|
|
@@ -22838,7 +23133,7 @@ import { useQueryClient as useQueryClient18 } from "@tanstack/react-query";
|
|
|
22838
23133
|
|
|
22839
23134
|
// src/hooks/useMCP.ts
|
|
22840
23135
|
import { useQuery as useQuery13, useMutation as useMutation10, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
|
|
22841
|
-
import { useEffect as useEffect39, useRef as
|
|
23136
|
+
import { useEffect as useEffect39, useRef as useRef28, useCallback as useCallback29 } from "react";
|
|
22842
23137
|
import {
|
|
22843
23138
|
listMcpServers,
|
|
22844
23139
|
startMcpServer,
|
|
@@ -23004,7 +23299,7 @@ function useCopilotDevicePoller() {
|
|
|
23004
23299
|
const setCopilotDevice = useMCPStore((s) => s.setCopilotDevice);
|
|
23005
23300
|
const setLoading = useMCPStore((s) => s.setLoading);
|
|
23006
23301
|
const queryClient = useQueryClient17();
|
|
23007
|
-
const timerRef =
|
|
23302
|
+
const timerRef = useRef28(null);
|
|
23008
23303
|
const stopPolling = useCallback29(() => {
|
|
23009
23304
|
if (timerRef.current) {
|
|
23010
23305
|
clearInterval(timerRef.current);
|
|
@@ -23047,7 +23342,7 @@ function useCopilotDevicePoller() {
|
|
|
23047
23342
|
}
|
|
23048
23343
|
|
|
23049
23344
|
// src/components/mcp/AddMCPServerModal.tsx
|
|
23050
|
-
import { memo as memo35, useState as useState41, useCallback as useCallback30, useRef as
|
|
23345
|
+
import { memo as memo35, useState as useState41, useCallback as useCallback30, useRef as useRef29, useEffect as useEffect40 } from "react";
|
|
23051
23346
|
import { Globe as Globe5, Laptop, Loader2 as Loader212, FolderDot, Terminal as Terminal9 } from "lucide-react";
|
|
23052
23347
|
import { jsx as jsx92, jsxs as jsxs83, Fragment as Fragment37 } from "react/jsx-runtime";
|
|
23053
23348
|
function parseCommandString(input) {
|
|
@@ -23168,7 +23463,7 @@ var AddMCPServerModal = memo35(function AddMCPServerModal2({
|
|
|
23168
23463
|
addServer,
|
|
23169
23464
|
handleClose
|
|
23170
23465
|
]);
|
|
23171
|
-
const contentRef =
|
|
23466
|
+
const contentRef = useRef29(null);
|
|
23172
23467
|
const [contentHeight, setContentHeight] = useState41(undefined);
|
|
23173
23468
|
useEffect40(() => {
|
|
23174
23469
|
const el = contentRef.current;
|
|
@@ -23706,7 +24001,7 @@ var MCPServerCard = memo37(function MCPServerCard2({
|
|
|
23706
24001
|
});
|
|
23707
24002
|
function useAuthPoller(name, onAuthenticated) {
|
|
23708
24003
|
const { data } = useMCPAuthStatus(name);
|
|
23709
|
-
const prevAuth =
|
|
24004
|
+
const prevAuth = useRef30(false);
|
|
23710
24005
|
useEffect41(() => {
|
|
23711
24006
|
if (data?.authenticated && !prevAuth.current) {
|
|
23712
24007
|
onAuthenticated();
|
|
@@ -24004,7 +24299,7 @@ var MCPSidebarToggle = memo38(function MCPSidebarToggle2() {
|
|
|
24004
24299
|
import { memo as memo39, useMemo as useMemo24 } from "react";
|
|
24005
24300
|
import {
|
|
24006
24301
|
ChevronRight as ChevronRight16,
|
|
24007
|
-
Sparkles as
|
|
24302
|
+
Sparkles as Sparkles7,
|
|
24008
24303
|
Loader2 as Loader215,
|
|
24009
24304
|
FolderDot as FolderDot3,
|
|
24010
24305
|
Laptop as Laptop3,
|
|
@@ -24147,7 +24442,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24147
24442
|
/* @__PURE__ */ jsxs86("div", {
|
|
24148
24443
|
className: "flex items-center gap-2",
|
|
24149
24444
|
children: [
|
|
24150
|
-
/* @__PURE__ */ jsx96(
|
|
24445
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24151
24446
|
className: "w-4 h-4 text-muted-foreground"
|
|
24152
24447
|
}),
|
|
24153
24448
|
/* @__PURE__ */ jsx96("span", {
|
|
@@ -24273,7 +24568,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24273
24568
|
}) : totalCount === 0 ? /* @__PURE__ */ jsxs86("div", {
|
|
24274
24569
|
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24275
24570
|
children: [
|
|
24276
|
-
/* @__PURE__ */ jsx96(
|
|
24571
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24277
24572
|
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24278
24573
|
}),
|
|
24279
24574
|
/* @__PURE__ */ jsx96("h3", {
|
|
@@ -24302,7 +24597,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24302
24597
|
}) : !globalEnabled ? /* @__PURE__ */ jsxs86("div", {
|
|
24303
24598
|
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24304
24599
|
children: [
|
|
24305
|
-
/* @__PURE__ */ jsx96(
|
|
24600
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24306
24601
|
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24307
24602
|
}),
|
|
24308
24603
|
/* @__PURE__ */ jsx96("h3", {
|
|
@@ -24317,7 +24612,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24317
24612
|
}) : skills.length === 0 ? /* @__PURE__ */ jsxs86("div", {
|
|
24318
24613
|
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24319
24614
|
children: [
|
|
24320
|
-
/* @__PURE__ */ jsx96(
|
|
24615
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24321
24616
|
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24322
24617
|
}),
|
|
24323
24618
|
/* @__PURE__ */ jsx96("h3", {
|
|
@@ -24395,7 +24690,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24395
24690
|
/* @__PURE__ */ jsxs86("div", {
|
|
24396
24691
|
className: "flex items-center gap-2 min-w-0 flex-1",
|
|
24397
24692
|
children: [
|
|
24398
|
-
/* @__PURE__ */ jsx96(
|
|
24693
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24399
24694
|
className: "w-3 h-3 flex-shrink-0"
|
|
24400
24695
|
}),
|
|
24401
24696
|
/* @__PURE__ */ jsxs86("span", {
|
|
@@ -24428,7 +24723,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24428
24723
|
});
|
|
24429
24724
|
// src/components/skills/SkillsSidebarToggle.tsx
|
|
24430
24725
|
import { memo as memo40 } from "react";
|
|
24431
|
-
import { Sparkles as
|
|
24726
|
+
import { Sparkles as Sparkles8 } from "lucide-react";
|
|
24432
24727
|
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
24433
24728
|
var SkillsSidebarToggle = memo40(function SkillsSidebarToggle2() {
|
|
24434
24729
|
const isExpanded = useSkillsStore((state) => state.isExpanded);
|
|
@@ -24438,7 +24733,7 @@ var SkillsSidebarToggle = memo40(function SkillsSidebarToggle2() {
|
|
|
24438
24733
|
onClick: toggleSidebar,
|
|
24439
24734
|
className: `relative h-14 w-full transition-colors touch-manipulation flex items-center justify-center border-r-2 ${isExpanded ? "bg-muted border-primary" : "border-transparent hover:bg-muted/50"}`,
|
|
24440
24735
|
title: "Skills",
|
|
24441
|
-
children: /* @__PURE__ */ jsx97(
|
|
24736
|
+
children: /* @__PURE__ */ jsx97(Sparkles8, {
|
|
24442
24737
|
className: "w-5 h-5 text-muted-foreground mx-auto"
|
|
24443
24738
|
})
|
|
24444
24739
|
});
|
|
@@ -24991,7 +25286,7 @@ var FileViewerPanel = memo44(function FileViewerPanel2() {
|
|
|
24991
25286
|
});
|
|
24992
25287
|
});
|
|
24993
25288
|
// src/components/file-browser/QuickFilePicker.tsx
|
|
24994
|
-
import { memo as memo45, useState as useState43, useEffect as useEffect45, useRef as
|
|
25289
|
+
import { memo as memo45, useState as useState43, useEffect as useEffect45, useRef as useRef31, useCallback as useCallback33, useMemo as useMemo25 } from "react";
|
|
24995
25290
|
import { FileCode as FileCode4, Search as Search7 } from "lucide-react";
|
|
24996
25291
|
|
|
24997
25292
|
// src/stores/filePickerStore.ts
|
|
@@ -25035,8 +25330,8 @@ var QuickFilePicker = memo45(function QuickFilePicker2() {
|
|
|
25035
25330
|
const expandSidebar = useFileBrowserStore((s) => s.expandSidebar);
|
|
25036
25331
|
const [query, setQuery] = useState43("");
|
|
25037
25332
|
const [selectedIndex, setSelectedIndex] = useState43(0);
|
|
25038
|
-
const inputRef =
|
|
25039
|
-
const listRef =
|
|
25333
|
+
const inputRef = useRef31(null);
|
|
25334
|
+
const listRef = useRef31(null);
|
|
25040
25335
|
const { data: filesData } = useFiles();
|
|
25041
25336
|
const ignoredSet = useMemo25(() => new Set(filesData?.ignoredFiles ?? []), [filesData?.ignoredFiles]);
|
|
25042
25337
|
const filtered = useMemo25(() => {
|
|
@@ -25216,7 +25511,7 @@ function HighlightedPath({ path, query }) {
|
|
|
25216
25511
|
import { memo as memo48 } from "react";
|
|
25217
25512
|
|
|
25218
25513
|
// src/components/onboarding/steps/ProviderSetupStep.tsx
|
|
25219
|
-
import { memo as memo46, useEffect as useEffect46, useState as useState44, useRef as
|
|
25514
|
+
import { memo as memo46, useEffect as useEffect46, useState as useState44, useRef as useRef32 } from "react";
|
|
25220
25515
|
import {
|
|
25221
25516
|
Copy as Copy5,
|
|
25222
25517
|
Check as Check13,
|
|
@@ -25307,20 +25602,20 @@ var ProviderSetupStep = memo46(function ProviderSetupStep2({
|
|
|
25307
25602
|
const [copilotCodeCopied, setCopilotCodeCopied] = useState44(false);
|
|
25308
25603
|
const [copilotModalOpen, setCopilotModalOpen] = useState44(false);
|
|
25309
25604
|
const [copilotLoading, setCopilotLoading] = useState44(false);
|
|
25310
|
-
const copilotPollRef =
|
|
25311
|
-
const copilotCancelledRef =
|
|
25312
|
-
const copilotPollFnRef =
|
|
25605
|
+
const copilotPollRef = useRef32(undefined);
|
|
25606
|
+
const copilotCancelledRef = useRef32(false);
|
|
25607
|
+
const copilotPollFnRef = useRef32(onPollCopilotDeviceFlow);
|
|
25313
25608
|
copilotPollFnRef.current = onPollCopilotDeviceFlow;
|
|
25314
25609
|
const balance = useOttoRouterStore((s) => s.balance);
|
|
25315
25610
|
const usdcBalance = useOttoRouterStore((s) => s.usdcBalance);
|
|
25316
25611
|
const payg = useOttoRouterStore((s) => s.payg);
|
|
25317
25612
|
const subscription = useOttoRouterStore((s) => s.subscription);
|
|
25318
25613
|
const isBalanceLoading = useOttoRouterStore((s) => s.isLoading);
|
|
25319
|
-
const apiKeyInputRef =
|
|
25320
|
-
const oauthCodeInputRef =
|
|
25321
|
-
const importPrivateKeyRef =
|
|
25614
|
+
const apiKeyInputRef = useRef32(null);
|
|
25615
|
+
const oauthCodeInputRef = useRef32(null);
|
|
25616
|
+
const importPrivateKeyRef = useRef32(null);
|
|
25322
25617
|
const isTopupModalOpen = useOttoRouterStore((s) => s.isTopupModalOpen);
|
|
25323
|
-
const prevTopupModalOpen =
|
|
25618
|
+
const prevTopupModalOpen = useRef32(false);
|
|
25324
25619
|
const { fetchBalance } = useOttoRouterBalance("ottorouter");
|
|
25325
25620
|
const effectivePayg = payg?.effectiveSpendableUsd ?? balance ?? 0;
|
|
25326
25621
|
const setuStatusLabel = subscription?.active ? `GO ${(subscription.creditsRemaining ?? 0).toFixed(1)} credits` : `$${effectivePayg.toFixed(2)}`;
|
|
@@ -26736,8 +27031,8 @@ var ProviderSetupStep = memo46(function ProviderSetupStep2({
|
|
|
26736
27031
|
});
|
|
26737
27032
|
|
|
26738
27033
|
// src/components/onboarding/steps/DefaultsStep.tsx
|
|
26739
|
-
import { memo as memo47, useState as useState45, useEffect as useEffect47, useId as useId3, useRef as
|
|
26740
|
-
import { Loader2 as Loader217, ArrowLeft, Sparkles as
|
|
27034
|
+
import { memo as memo47, useState as useState45, useEffect as useEffect47, useId as useId3, useRef as useRef33 } from "react";
|
|
27035
|
+
import { Loader2 as Loader217, ArrowLeft, Sparkles as Sparkles9, ChevronDown as ChevronDown12 } from "lucide-react";
|
|
26741
27036
|
import { jsx as jsx104, jsxs as jsxs92, Fragment as Fragment40 } from "react/jsx-runtime";
|
|
26742
27037
|
var DefaultsStep = memo47(function DefaultsStep2({
|
|
26743
27038
|
authStatus,
|
|
@@ -26754,7 +27049,7 @@ var DefaultsStep = memo47(function DefaultsStep2({
|
|
|
26754
27049
|
const [selectedAgent, setSelectedAgent] = useState45(authStatus.defaults.agent || "build");
|
|
26755
27050
|
const [selectedApproval, setSelectedApproval] = useState45(authStatus.defaults.toolApproval || "dangerous");
|
|
26756
27051
|
const [guidedMode, setGuidedMode] = useState45(false);
|
|
26757
|
-
const hasUserChangedProvider =
|
|
27052
|
+
const hasUserChangedProvider = useRef33(false);
|
|
26758
27053
|
const providerId = useId3();
|
|
26759
27054
|
const modelId = useId3();
|
|
26760
27055
|
const agentId = useId3();
|
|
@@ -27081,7 +27376,7 @@ var DefaultsStep = memo47(function DefaultsStep2({
|
|
|
27081
27376
|
}) : /* @__PURE__ */ jsxs92(Fragment40, {
|
|
27082
27377
|
children: [
|
|
27083
27378
|
"Start Using otto",
|
|
27084
|
-
/* @__PURE__ */ jsx104(
|
|
27379
|
+
/* @__PURE__ */ jsx104(Sparkles9, {
|
|
27085
27380
|
className: "w-4 h-4"
|
|
27086
27381
|
})
|
|
27087
27382
|
]
|
|
@@ -27688,10 +27983,10 @@ function useImageUpload(options = {}) {
|
|
|
27688
27983
|
};
|
|
27689
27984
|
}
|
|
27690
27985
|
// src/hooks/useSetuPayments.ts
|
|
27691
|
-
import { useEffect as useEffect52, useRef as
|
|
27986
|
+
import { useEffect as useEffect52, useRef as useRef34 } from "react";
|
|
27692
27987
|
function useSetuPayments(sessionId) {
|
|
27693
|
-
const clientRef =
|
|
27694
|
-
const loadingToastIdRef =
|
|
27988
|
+
const clientRef = useRef34(null);
|
|
27989
|
+
const loadingToastIdRef = useRef34(null);
|
|
27695
27990
|
const setBalance = useOttoRouterStore((s) => s.setBalance);
|
|
27696
27991
|
const setPaymentPending = useOttoRouterStore((s) => s.setPaymentPending);
|
|
27697
27992
|
const removeToast = useToastStore((s) => s.removeToast);
|
|
@@ -28002,4 +28297,4 @@ export {
|
|
|
28002
28297
|
API_BASE_URL
|
|
28003
28298
|
};
|
|
28004
28299
|
|
|
28005
|
-
//# debugId=
|
|
28300
|
+
//# debugId=E8C4AD91EB76EA8B64756E2164756E21
|