@ottocode/web-sdk 0.1.250 → 0.1.252
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 +400 -149
- package/dist/components/index.js.map +10 -10
- package/dist/components/messages/AssistantMessageGroup.d.ts.map +1 -1
- package/dist/components/messages/MessagePartItem.d.ts.map +1 -1
- package/dist/components/settings/SettingsSidebar.d.ts.map +1 -1
- package/dist/hooks/index.js +33 -18
- package/dist/hooks/index.js.map +4 -4
- package/dist/hooks/usePreferences.d.ts +1 -0
- package/dist/hooks/usePreferences.d.ts.map +1 -1
- package/dist/hooks/useSessionStream.d.ts.map +1 -1
- package/dist/index.js +403 -152
- package/dist/index.js.map +10 -10
- package/package.json +3 -3
package/dist/components/index.js
CHANGED
|
@@ -1787,10 +1787,26 @@ 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
|
+
}
|
|
1794
1810
|
function resolveInitialPreferences() {
|
|
1795
1811
|
if (typeof window === "undefined") {
|
|
1796
1812
|
return DEFAULT_STORED_PREFERENCES;
|
|
@@ -1801,7 +1817,8 @@ function resolveInitialPreferences() {
|
|
|
1801
1817
|
const parsed = JSON.parse(stored);
|
|
1802
1818
|
return {
|
|
1803
1819
|
vimMode: typeof parsed.vimMode === "boolean" ? parsed.vimMode : DEFAULT_STORED_PREFERENCES.vimMode,
|
|
1804
|
-
compactThread: typeof parsed.compactThread === "boolean" ? parsed.compactThread : DEFAULT_STORED_PREFERENCES.compactThread
|
|
1820
|
+
compactThread: typeof parsed.compactThread === "boolean" ? parsed.compactThread : DEFAULT_STORED_PREFERENCES.compactThread,
|
|
1821
|
+
fontFamily: typeof parsed.fontFamily === "string" && parsed.fontFamily.trim() ? parsed.fontFamily.trim() : DEFAULT_STORED_PREFERENCES.fontFamily
|
|
1805
1822
|
};
|
|
1806
1823
|
}
|
|
1807
1824
|
} catch (error) {
|
|
@@ -1810,6 +1827,7 @@ function resolveInitialPreferences() {
|
|
|
1810
1827
|
return DEFAULT_STORED_PREFERENCES;
|
|
1811
1828
|
}
|
|
1812
1829
|
var preferences = resolveInitialPreferences();
|
|
1830
|
+
applyFontFamily(preferences.fontFamily);
|
|
1813
1831
|
var listeners = new Set;
|
|
1814
1832
|
function getSnapshot() {
|
|
1815
1833
|
return preferences;
|
|
@@ -1828,6 +1846,9 @@ function notifyListeners() {
|
|
|
1828
1846
|
}
|
|
1829
1847
|
function updateStore(updates) {
|
|
1830
1848
|
preferences = { ...preferences, ...updates };
|
|
1849
|
+
if (updates.fontFamily !== undefined) {
|
|
1850
|
+
applyFontFamily(preferences.fontFamily);
|
|
1851
|
+
}
|
|
1831
1852
|
if (typeof window !== "undefined") {
|
|
1832
1853
|
try {
|
|
1833
1854
|
window.localStorage.setItem(STORAGE_KEY, JSON.stringify(preferences));
|
|
@@ -1849,6 +1870,9 @@ function usePreferences() {
|
|
|
1849
1870
|
if (updates.compactThread !== undefined) {
|
|
1850
1871
|
localUpdates.compactThread = updates.compactThread;
|
|
1851
1872
|
}
|
|
1873
|
+
if (updates.fontFamily !== undefined) {
|
|
1874
|
+
localUpdates.fontFamily = updates.fontFamily.trim() || DEFAULT_FONT_FAMILY;
|
|
1875
|
+
}
|
|
1852
1876
|
if (Object.keys(localUpdates).length > 0) {
|
|
1853
1877
|
updateStore(localUpdates);
|
|
1854
1878
|
}
|
|
@@ -2190,12 +2214,12 @@ function Modal({
|
|
|
2190
2214
|
}),
|
|
2191
2215
|
/* @__PURE__ */ jsx11("div", {
|
|
2192
2216
|
"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`,
|
|
2217
|
+
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
2218
|
children: /* @__PURE__ */ jsxs6("div", {
|
|
2195
|
-
className: "bg-background border border-border rounded-lg shadow-lg",
|
|
2219
|
+
className: "bg-background border border-border rounded-lg shadow-lg max-h-full w-full flex flex-col overflow-hidden",
|
|
2196
2220
|
children: [
|
|
2197
2221
|
(title || showCloseButton) && /* @__PURE__ */ jsxs6("div", {
|
|
2198
|
-
className: "flex items-center justify-between p-4 border-b border-border",
|
|
2222
|
+
className: "flex flex-shrink-0 items-center justify-between p-4 border-b border-border",
|
|
2199
2223
|
children: [
|
|
2200
2224
|
title && /* @__PURE__ */ jsx11("div", {
|
|
2201
2225
|
className: "text-lg font-semibold text-foreground",
|
|
@@ -2213,7 +2237,7 @@ function Modal({
|
|
|
2213
2237
|
]
|
|
2214
2238
|
}),
|
|
2215
2239
|
/* @__PURE__ */ jsx11("div", {
|
|
2216
|
-
className: "p-6",
|
|
2240
|
+
className: "p-6 overflow-y-auto",
|
|
2217
2241
|
children
|
|
2218
2242
|
})
|
|
2219
2243
|
]
|
|
@@ -5172,7 +5196,7 @@ import {
|
|
|
5172
5196
|
import { ChevronDown, Search } from "lucide-react";
|
|
5173
5197
|
import Fuse2 from "fuse.js";
|
|
5174
5198
|
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5175
|
-
var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider, model, onChange, disabled = false }, ref) {
|
|
5199
|
+
var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider, model, onChange, disabled = false, dropdownMode = "absolute" }, ref) {
|
|
5176
5200
|
const { data: allModels } = useAllModels();
|
|
5177
5201
|
const { data: currentProviderModels, isLoading: isCurrentProviderLoading } = useModels(provider);
|
|
5178
5202
|
const [isOpen, setIsOpen] = useState10(false);
|
|
@@ -5425,6 +5449,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5425
5449
|
const currentProviderLabel = loadedModels[provider]?.label || currentProviderModels?.label || provider;
|
|
5426
5450
|
const currentModelLabel = loadedModels[provider]?.models.find((m) => m.id === model)?.label || currentProviderModels?.models.find((m) => m.id === model)?.label || model;
|
|
5427
5451
|
const displayedProviderKeys = searchQuery.trim() ? Object.keys(filteredModels) : configuredProviders;
|
|
5452
|
+
const dropdownPositionClass = dropdownMode === "inline" ? "relative" : "absolute z-50";
|
|
5428
5453
|
return /* @__PURE__ */ jsxs10("div", {
|
|
5429
5454
|
ref: dropdownRef,
|
|
5430
5455
|
className: "relative w-full",
|
|
@@ -5458,7 +5483,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5458
5483
|
]
|
|
5459
5484
|
}),
|
|
5460
5485
|
isOpen && /* @__PURE__ */ jsxs10("div", {
|
|
5461
|
-
className:
|
|
5486
|
+
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
5487
|
children: [
|
|
5463
5488
|
/* @__PURE__ */ jsx16("div", {
|
|
5464
5489
|
className: "p-2 border-b border-[hsl(var(--border))]",
|
|
@@ -5892,7 +5917,8 @@ function ConfigModal({
|
|
|
5892
5917
|
ref: modelSelectorRef,
|
|
5893
5918
|
provider,
|
|
5894
5919
|
model,
|
|
5895
|
-
onChange: handleModelChange
|
|
5920
|
+
onChange: handleModelChange,
|
|
5921
|
+
dropdownMode: "inline"
|
|
5896
5922
|
})
|
|
5897
5923
|
]
|
|
5898
5924
|
})
|
|
@@ -11739,7 +11765,7 @@ var MessagePartItem = memo8(function MessagePartItem2({
|
|
|
11739
11765
|
]
|
|
11740
11766
|
});
|
|
11741
11767
|
}, (prevProps, nextProps) => {
|
|
11742
|
-
return prevProps.part.id === nextProps.part.id && prevProps.part.content === nextProps.part.content && prevProps.part.
|
|
11768
|
+
return prevProps.part.id === nextProps.part.id && prevProps.part.content === nextProps.part.content && prevProps.part.ephemeral === nextProps.part.ephemeral && prevProps.part.completedAt === nextProps.part.completedAt && prevProps.showLine === nextProps.showLine && prevProps.isLastToolCall === nextProps.isLastToolCall && prevProps.isLastProgressUpdate === nextProps.isLastProgressUpdate && prevProps.compact === nextProps.compact && prevProps.onNavigateToSession === nextProps.onNavigateToSession && prevProps.pendingApproval?.callId === nextProps.pendingApproval?.callId && prevProps.onApprove === nextProps.onApprove && prevProps.onReject === nextProps.onReject;
|
|
11743
11769
|
});
|
|
11744
11770
|
|
|
11745
11771
|
// src/components/messages/CompactActivityGroup.tsx
|
|
@@ -13389,7 +13415,7 @@ var AssistantMessageGroup = memo9(function AssistantMessageGroup2({
|
|
|
13389
13415
|
for (let i = 0;i < prevParts.length; i++) {
|
|
13390
13416
|
const prevPart = prevParts[i];
|
|
13391
13417
|
const nextPart = nextParts[i];
|
|
13392
|
-
if (prevPart.id !== nextPart.id || prevPart.index !== nextPart.index || prevPart.stepIndex !== nextPart.stepIndex || prevPart.type !== nextPart.type || prevPart.content !== nextPart.content || prevPart.
|
|
13418
|
+
if (prevPart.id !== nextPart.id || prevPart.index !== nextPart.index || prevPart.stepIndex !== nextPart.stepIndex || prevPart.type !== nextPart.type || prevPart.content !== nextPart.content || prevPart.toolName !== nextPart.toolName || prevPart.toolCallId !== nextPart.toolCallId || prevPart.ephemeral !== nextPart.ephemeral || prevPart.completedAt !== nextPart.completedAt || prevPart.startedAt !== nextPart.startedAt) {
|
|
13393
13419
|
return false;
|
|
13394
13420
|
}
|
|
13395
13421
|
}
|
|
@@ -15283,27 +15309,18 @@ function useSessionStream(sessionId, enabled = true) {
|
|
|
15283
15309
|
return typeof payload?.outputTextDelta === "string" ? payload.outputTextDelta : null;
|
|
15284
15310
|
};
|
|
15285
15311
|
const getOptimisticPartIndex = (parts, stepIndex) => {
|
|
15312
|
+
const appendIndex = (() => {
|
|
15313
|
+
const indexes = parts.map((part) => part.index).filter((index) => Number.isFinite(index));
|
|
15314
|
+
return indexes.length > 0 ? Math.max(...indexes) + 0.001 : 0;
|
|
15315
|
+
})();
|
|
15286
15316
|
if (typeof stepIndex !== "number") {
|
|
15287
|
-
return
|
|
15317
|
+
return appendIndex;
|
|
15288
15318
|
}
|
|
15289
15319
|
const sameStepIndexes = parts.filter((part) => part.stepIndex === stepIndex).map((part) => part.index).filter((index) => Number.isFinite(index));
|
|
15290
15320
|
if (sameStepIndexes.length > 0) {
|
|
15291
15321
|
return Math.max(...sameStepIndexes) + 0.001;
|
|
15292
15322
|
}
|
|
15293
|
-
|
|
15294
|
-
const nextStepIndexes = parts.filter((part) => typeof part.stepIndex === "number" && part.stepIndex > stepIndex).map((part) => part.index).filter((index) => Number.isFinite(index));
|
|
15295
|
-
const lowerBound = previousStepIndexes.length > 0 ? Math.max(...previousStepIndexes) : null;
|
|
15296
|
-
const upperBound = nextStepIndexes.length > 0 ? Math.min(...nextStepIndexes) : null;
|
|
15297
|
-
if (lowerBound !== null && upperBound !== null) {
|
|
15298
|
-
return (lowerBound + upperBound) / 2;
|
|
15299
|
-
}
|
|
15300
|
-
if (lowerBound !== null) {
|
|
15301
|
-
return lowerBound + 1;
|
|
15302
|
-
}
|
|
15303
|
-
if (upperBound !== null) {
|
|
15304
|
-
return upperBound - 1;
|
|
15305
|
-
}
|
|
15306
|
-
return parts.length;
|
|
15323
|
+
return appendIndex;
|
|
15307
15324
|
};
|
|
15308
15325
|
const applyReasoningDelta = (payload) => {
|
|
15309
15326
|
const messageId = typeof payload?.messageId === "string" ? payload.messageId : null;
|
|
@@ -21176,7 +21193,8 @@ var ResearchSidebarToggle = memo30(function ResearchSidebarToggle2({
|
|
|
21176
21193
|
});
|
|
21177
21194
|
});
|
|
21178
21195
|
// src/components/settings/SettingsSidebar.tsx
|
|
21179
|
-
import { memo as memo31, useState as useState39, useMemo as useMemo22, useCallback as useCallback27, useEffect as useEffect37 } from "react";
|
|
21196
|
+
import { memo as memo31, useState as useState39, useMemo as useMemo22, useCallback as useCallback27, useEffect as useEffect37, useRef as useRef26 } from "react";
|
|
21197
|
+
import { createPortal } from "react-dom";
|
|
21180
21198
|
import {
|
|
21181
21199
|
Settings as Settings2,
|
|
21182
21200
|
ChevronRight as ChevronRight13,
|
|
@@ -21191,7 +21209,9 @@ import {
|
|
|
21191
21209
|
Copy as Copy3,
|
|
21192
21210
|
Check as Check11,
|
|
21193
21211
|
Key,
|
|
21194
|
-
Loader2 as Loader210
|
|
21212
|
+
Loader2 as Loader210,
|
|
21213
|
+
Type,
|
|
21214
|
+
Sparkles as Sparkles6
|
|
21195
21215
|
} from "lucide-react";
|
|
21196
21216
|
import { QRCodeSVG } from "qrcode.react";
|
|
21197
21217
|
|
|
@@ -21598,6 +21618,26 @@ var SETTINGS_PANEL_KEY = "settings";
|
|
|
21598
21618
|
var SETTINGS_DEFAULT_WIDTH = 320;
|
|
21599
21619
|
var SETTINGS_MIN_WIDTH = 320;
|
|
21600
21620
|
var SETTINGS_MAX_WIDTH = 500;
|
|
21621
|
+
var DEFAULT_FONT_FAMILY2 = "IBM Plex Mono";
|
|
21622
|
+
var COMMON_SYSTEM_FONTS = [
|
|
21623
|
+
DEFAULT_FONT_FAMILY2,
|
|
21624
|
+
"System UI",
|
|
21625
|
+
"Arial",
|
|
21626
|
+
"Avenir",
|
|
21627
|
+
"BlinkMacSystemFont",
|
|
21628
|
+
"Courier New",
|
|
21629
|
+
"Fira Code",
|
|
21630
|
+
"Georgia",
|
|
21631
|
+
"Helvetica",
|
|
21632
|
+
"Inter",
|
|
21633
|
+
"Menlo",
|
|
21634
|
+
"Monaco",
|
|
21635
|
+
"SF Mono",
|
|
21636
|
+
"Segoe UI",
|
|
21637
|
+
"Times New Roman",
|
|
21638
|
+
"Ubuntu",
|
|
21639
|
+
"Verdana"
|
|
21640
|
+
];
|
|
21601
21641
|
var SettingsSection = memo31(function SettingsSection2({
|
|
21602
21642
|
title,
|
|
21603
21643
|
icon,
|
|
@@ -21646,10 +21686,10 @@ var ToggleRow = memo31(function ToggleRow2({
|
|
|
21646
21686
|
onChange
|
|
21647
21687
|
}) {
|
|
21648
21688
|
return /* @__PURE__ */ jsxs80("div", {
|
|
21649
|
-
className: "flex items-center justify-between text-sm",
|
|
21689
|
+
className: "flex min-w-0 items-center justify-between gap-3 text-sm",
|
|
21650
21690
|
children: [
|
|
21651
21691
|
/* @__PURE__ */ jsx88("span", {
|
|
21652
|
-
className: "text-muted-foreground",
|
|
21692
|
+
className: "min-w-0 flex-1 truncate text-muted-foreground",
|
|
21653
21693
|
children: label
|
|
21654
21694
|
}),
|
|
21655
21695
|
/* @__PURE__ */ jsx88("button", {
|
|
@@ -21657,7 +21697,7 @@ var ToggleRow = memo31(function ToggleRow2({
|
|
|
21657
21697
|
role: "switch",
|
|
21658
21698
|
"aria-checked": checked,
|
|
21659
21699
|
onClick: () => onChange(!checked),
|
|
21660
|
-
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"}`,
|
|
21700
|
+
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"}`,
|
|
21661
21701
|
children: /* @__PURE__ */ jsx88("span", {
|
|
21662
21702
|
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"}`
|
|
21663
21703
|
})
|
|
@@ -21673,7 +21713,31 @@ var SelectRow = memo31(function SelectRow2({
|
|
|
21673
21713
|
disabled
|
|
21674
21714
|
}) {
|
|
21675
21715
|
const [isOpen, setIsOpen] = useState39(false);
|
|
21716
|
+
const [menuStyle, setMenuStyle] = useState39(null);
|
|
21717
|
+
const buttonRef = useRef26(null);
|
|
21676
21718
|
const selectedOption = options.find((o) => o.id === value);
|
|
21719
|
+
useEffect37(() => {
|
|
21720
|
+
if (!isOpen || !buttonRef.current)
|
|
21721
|
+
return;
|
|
21722
|
+
const update = () => {
|
|
21723
|
+
const rect = buttonRef.current?.getBoundingClientRect();
|
|
21724
|
+
if (!rect)
|
|
21725
|
+
return;
|
|
21726
|
+
const width = Math.max(rect.width, 160);
|
|
21727
|
+
setMenuStyle({
|
|
21728
|
+
top: rect.bottom + 4,
|
|
21729
|
+
left: rect.right - width,
|
|
21730
|
+
width
|
|
21731
|
+
});
|
|
21732
|
+
};
|
|
21733
|
+
update();
|
|
21734
|
+
window.addEventListener("scroll", update, true);
|
|
21735
|
+
window.addEventListener("resize", update);
|
|
21736
|
+
return () => {
|
|
21737
|
+
window.removeEventListener("scroll", update, true);
|
|
21738
|
+
window.removeEventListener("resize", update);
|
|
21739
|
+
};
|
|
21740
|
+
}, [isOpen]);
|
|
21677
21741
|
return /* @__PURE__ */ jsxs80("div", {
|
|
21678
21742
|
className: "flex items-center justify-between text-sm",
|
|
21679
21743
|
children: [
|
|
@@ -21685,6 +21749,7 @@ var SelectRow = memo31(function SelectRow2({
|
|
|
21685
21749
|
className: "relative",
|
|
21686
21750
|
children: [
|
|
21687
21751
|
/* @__PURE__ */ jsxs80("button", {
|
|
21752
|
+
ref: buttonRef,
|
|
21688
21753
|
type: "button",
|
|
21689
21754
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
21690
21755
|
disabled,
|
|
@@ -21699,15 +21764,20 @@ var SelectRow = memo31(function SelectRow2({
|
|
|
21699
21764
|
})
|
|
21700
21765
|
]
|
|
21701
21766
|
}),
|
|
21702
|
-
isOpen && /* @__PURE__ */ jsxs80(Fragment35, {
|
|
21767
|
+
isOpen && menuStyle && typeof document !== "undefined" && createPortal(/* @__PURE__ */ jsxs80(Fragment35, {
|
|
21703
21768
|
children: [
|
|
21704
21769
|
/* @__PURE__ */ jsx88("div", {
|
|
21705
|
-
className: "fixed inset-0 z-
|
|
21770
|
+
className: "fixed inset-0 z-[10000]",
|
|
21706
21771
|
onClick: () => setIsOpen(false),
|
|
21707
21772
|
role: "presentation"
|
|
21708
21773
|
}),
|
|
21709
21774
|
/* @__PURE__ */ jsx88("div", {
|
|
21710
|
-
className: "
|
|
21775
|
+
className: "fixed z-[10001] max-h-[240px] overflow-y-auto bg-popover border border-border rounded-md shadow-lg",
|
|
21776
|
+
style: {
|
|
21777
|
+
top: menuStyle.top,
|
|
21778
|
+
left: menuStyle.left,
|
|
21779
|
+
minWidth: menuStyle.width
|
|
21780
|
+
},
|
|
21711
21781
|
children: options.map((option) => /* @__PURE__ */ jsx88("button", {
|
|
21712
21782
|
type: "button",
|
|
21713
21783
|
onClick: () => {
|
|
@@ -21719,12 +21789,135 @@ var SelectRow = memo31(function SelectRow2({
|
|
|
21719
21789
|
}, option.id))
|
|
21720
21790
|
})
|
|
21721
21791
|
]
|
|
21722
|
-
})
|
|
21792
|
+
}), document.body)
|
|
21723
21793
|
]
|
|
21724
21794
|
})
|
|
21725
21795
|
]
|
|
21726
21796
|
});
|
|
21727
21797
|
});
|
|
21798
|
+
var FontPickerRow = memo31(function FontPickerRow2({
|
|
21799
|
+
value,
|
|
21800
|
+
onChange
|
|
21801
|
+
}) {
|
|
21802
|
+
const [isOpen, setIsOpen] = useState39(false);
|
|
21803
|
+
const [search, setSearch] = useState39("");
|
|
21804
|
+
const [localFonts, setLocalFonts] = useState39([]);
|
|
21805
|
+
const [isLoadingFonts, setIsLoadingFonts] = useState39(false);
|
|
21806
|
+
const [fontError, setFontError] = useState39(null);
|
|
21807
|
+
const canQueryLocalFonts = typeof window !== "undefined" && typeof window.queryLocalFonts === "function";
|
|
21808
|
+
const fontOptions = useMemo22(() => {
|
|
21809
|
+
return Array.from(new Set([value, ...localFonts, ...COMMON_SYSTEM_FONTS].filter(Boolean))).sort((a, b) => a.localeCompare(b));
|
|
21810
|
+
}, [localFonts, value]);
|
|
21811
|
+
const filteredFonts = useMemo22(() => {
|
|
21812
|
+
const query = search.trim().toLowerCase();
|
|
21813
|
+
if (!query)
|
|
21814
|
+
return fontOptions;
|
|
21815
|
+
return fontOptions.filter((font) => font.toLowerCase().includes(query));
|
|
21816
|
+
}, [fontOptions, search]);
|
|
21817
|
+
const loadLocalFonts = useCallback27(async () => {
|
|
21818
|
+
if (isLoadingFonts || localFonts.length > 0)
|
|
21819
|
+
return;
|
|
21820
|
+
const queryLocalFonts = window.queryLocalFonts;
|
|
21821
|
+
if (!queryLocalFonts) {
|
|
21822
|
+
setFontError("Local font access is not supported in this browser");
|
|
21823
|
+
return;
|
|
21824
|
+
}
|
|
21825
|
+
setIsLoadingFonts(true);
|
|
21826
|
+
setFontError(null);
|
|
21827
|
+
try {
|
|
21828
|
+
const fonts = await queryLocalFonts();
|
|
21829
|
+
setLocalFonts(Array.from(new Set(fonts.map((font) => font.family).filter(Boolean))));
|
|
21830
|
+
} catch (error) {
|
|
21831
|
+
setFontError(error instanceof Error ? error.message : "Unable to load local fonts");
|
|
21832
|
+
} finally {
|
|
21833
|
+
setIsLoadingFonts(false);
|
|
21834
|
+
}
|
|
21835
|
+
}, [isLoadingFonts, localFonts.length]);
|
|
21836
|
+
const openPicker = () => {
|
|
21837
|
+
setIsOpen(true);
|
|
21838
|
+
loadLocalFonts();
|
|
21839
|
+
};
|
|
21840
|
+
return /* @__PURE__ */ jsx88("div", {
|
|
21841
|
+
className: "space-y-2 text-sm",
|
|
21842
|
+
children: /* @__PURE__ */ jsxs80("div", {
|
|
21843
|
+
className: "flex items-center justify-between gap-3",
|
|
21844
|
+
children: [
|
|
21845
|
+
/* @__PURE__ */ jsx88("span", {
|
|
21846
|
+
className: "text-muted-foreground",
|
|
21847
|
+
children: "UI Font"
|
|
21848
|
+
}),
|
|
21849
|
+
/* @__PURE__ */ jsxs80("div", {
|
|
21850
|
+
className: "relative min-w-0",
|
|
21851
|
+
children: [
|
|
21852
|
+
/* @__PURE__ */ jsxs80("button", {
|
|
21853
|
+
type: "button",
|
|
21854
|
+
onClick: () => isOpen ? setIsOpen(false) : openPicker(),
|
|
21855
|
+
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",
|
|
21856
|
+
children: [
|
|
21857
|
+
/* @__PURE__ */ jsx88("span", {
|
|
21858
|
+
className: "truncate",
|
|
21859
|
+
style: { fontFamily: value },
|
|
21860
|
+
children: value || DEFAULT_FONT_FAMILY2
|
|
21861
|
+
}),
|
|
21862
|
+
/* @__PURE__ */ jsx88(ChevronDown9, {
|
|
21863
|
+
className: "h-3 w-3 shrink-0"
|
|
21864
|
+
})
|
|
21865
|
+
]
|
|
21866
|
+
}),
|
|
21867
|
+
isOpen && /* @__PURE__ */ jsxs80(Fragment35, {
|
|
21868
|
+
children: [
|
|
21869
|
+
/* @__PURE__ */ jsx88("div", {
|
|
21870
|
+
className: "fixed inset-0 z-40",
|
|
21871
|
+
onClick: () => setIsOpen(false),
|
|
21872
|
+
role: "presentation"
|
|
21873
|
+
}),
|
|
21874
|
+
/* @__PURE__ */ jsxs80("div", {
|
|
21875
|
+
className: "absolute right-0 top-full z-50 mt-1 w-72 rounded-md border border-border bg-popover shadow-lg",
|
|
21876
|
+
children: [
|
|
21877
|
+
/* @__PURE__ */ jsx88("div", {
|
|
21878
|
+
className: "border-b border-border p-2",
|
|
21879
|
+
children: /* @__PURE__ */ jsx88("input", {
|
|
21880
|
+
type: "search",
|
|
21881
|
+
value: search,
|
|
21882
|
+
onChange: (event) => setSearch(event.target.value),
|
|
21883
|
+
placeholder: "Search system fonts...",
|
|
21884
|
+
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"
|
|
21885
|
+
})
|
|
21886
|
+
}),
|
|
21887
|
+
/* @__PURE__ */ jsxs80("div", {
|
|
21888
|
+
className: "max-h-64 overflow-y-auto py-1",
|
|
21889
|
+
children: [
|
|
21890
|
+
filteredFonts.map((font) => /* @__PURE__ */ jsx88("button", {
|
|
21891
|
+
type: "button",
|
|
21892
|
+
onClick: () => {
|
|
21893
|
+
onChange(font);
|
|
21894
|
+
setIsOpen(false);
|
|
21895
|
+
setSearch("");
|
|
21896
|
+
},
|
|
21897
|
+
className: `w-full px-3 py-2 text-left text-xs hover:bg-muted ${font === value ? "bg-muted/50" : ""}`,
|
|
21898
|
+
style: { fontFamily: font },
|
|
21899
|
+
children: font
|
|
21900
|
+
}, font)),
|
|
21901
|
+
filteredFonts.length === 0 && /* @__PURE__ */ jsx88("div", {
|
|
21902
|
+
className: "px-3 py-2 text-xs text-muted-foreground",
|
|
21903
|
+
children: "No fonts found"
|
|
21904
|
+
})
|
|
21905
|
+
]
|
|
21906
|
+
}),
|
|
21907
|
+
/* @__PURE__ */ jsx88("div", {
|
|
21908
|
+
className: "border-t border-border px-3 py-2 text-xs text-muted-foreground",
|
|
21909
|
+
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" : "Showing common system fonts"
|
|
21910
|
+
})
|
|
21911
|
+
]
|
|
21912
|
+
})
|
|
21913
|
+
]
|
|
21914
|
+
})
|
|
21915
|
+
]
|
|
21916
|
+
})
|
|
21917
|
+
]
|
|
21918
|
+
})
|
|
21919
|
+
});
|
|
21920
|
+
});
|
|
21728
21921
|
var NumberInputRow = memo31(function NumberInputRow2({
|
|
21729
21922
|
label,
|
|
21730
21923
|
value,
|
|
@@ -21802,13 +21995,130 @@ var NumberInputRow = memo31(function NumberInputRow2({
|
|
|
21802
21995
|
]
|
|
21803
21996
|
});
|
|
21804
21997
|
});
|
|
21998
|
+
function PreferencesModal({ isOpen, onClose }) {
|
|
21999
|
+
const { data: config2 } = useConfig();
|
|
22000
|
+
const { preferences: preferences2, updatePreferences } = usePreferences();
|
|
22001
|
+
const updateDefaults = useUpdateDefaults();
|
|
22002
|
+
return /* @__PURE__ */ jsx88(Modal, {
|
|
22003
|
+
isOpen,
|
|
22004
|
+
onClose,
|
|
22005
|
+
title: "Preferences",
|
|
22006
|
+
maxWidth: "lg",
|
|
22007
|
+
children: /* @__PURE__ */ jsxs80("div", {
|
|
22008
|
+
className: "-m-6",
|
|
22009
|
+
children: [
|
|
22010
|
+
/* @__PURE__ */ jsxs80(SettingsSection, {
|
|
22011
|
+
title: "Editor",
|
|
22012
|
+
icon: /* @__PURE__ */ jsx88(Type, {
|
|
22013
|
+
className: "w-4 h-4 text-muted-foreground"
|
|
22014
|
+
}),
|
|
22015
|
+
children: [
|
|
22016
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22017
|
+
label: "Vim Mode",
|
|
22018
|
+
checked: preferences2.vimMode,
|
|
22019
|
+
onChange: (checked) => updatePreferences({ vimMode: checked })
|
|
22020
|
+
}),
|
|
22021
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22022
|
+
label: "Compact Thread",
|
|
22023
|
+
checked: preferences2.compactThread,
|
|
22024
|
+
onChange: (checked) => updatePreferences({ compactThread: checked })
|
|
22025
|
+
}),
|
|
22026
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22027
|
+
label: "Full Width Content",
|
|
22028
|
+
checked: preferences2.fullWidthContent,
|
|
22029
|
+
onChange: (checked) => updatePreferences({ fullWidthContent: checked })
|
|
22030
|
+
}),
|
|
22031
|
+
/* @__PURE__ */ jsx88(FontPickerRow, {
|
|
22032
|
+
value: preferences2.fontFamily,
|
|
22033
|
+
onChange: (fontFamily) => updatePreferences({ fontFamily })
|
|
22034
|
+
})
|
|
22035
|
+
]
|
|
22036
|
+
}),
|
|
22037
|
+
/* @__PURE__ */ jsxs80(SettingsSection, {
|
|
22038
|
+
title: "Automation",
|
|
22039
|
+
icon: /* @__PURE__ */ jsx88(Zap, {
|
|
22040
|
+
className: "w-4 h-4 text-muted-foreground"
|
|
22041
|
+
}),
|
|
22042
|
+
children: [
|
|
22043
|
+
/* @__PURE__ */ jsx88(NumberInputRow, {
|
|
22044
|
+
label: "Auto Compact",
|
|
22045
|
+
value: config2?.defaults?.autoCompactThresholdTokens,
|
|
22046
|
+
onCommit: (value) => updateDefaults.mutate({
|
|
22047
|
+
autoCompactThresholdTokens: value,
|
|
22048
|
+
scope: "global"
|
|
22049
|
+
}),
|
|
22050
|
+
placeholder: "Tokens",
|
|
22051
|
+
disabled: updateDefaults.isPending
|
|
22052
|
+
}),
|
|
22053
|
+
/* @__PURE__ */ jsx88(SelectRow, {
|
|
22054
|
+
label: "Tool Approval",
|
|
22055
|
+
value: config2?.defaults?.toolApproval ?? "dangerous",
|
|
22056
|
+
options: [
|
|
22057
|
+
{ id: "auto", label: "Auto (no approval)" },
|
|
22058
|
+
{ id: "dangerous", label: "Dangerous only" },
|
|
22059
|
+
{ id: "yolo", label: "YOLO (hard blocks only)" },
|
|
22060
|
+
{ id: "all", label: "All tools" }
|
|
22061
|
+
],
|
|
22062
|
+
onChange: (value) => updateDefaults.mutate({
|
|
22063
|
+
toolApproval: value,
|
|
22064
|
+
scope: "global"
|
|
22065
|
+
}),
|
|
22066
|
+
disabled: updateDefaults.isPending
|
|
22067
|
+
}),
|
|
22068
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22069
|
+
label: "Guided Mode",
|
|
22070
|
+
checked: config2?.defaults?.guidedMode ?? false,
|
|
22071
|
+
onChange: (checked) => updateDefaults.mutate({
|
|
22072
|
+
guidedMode: checked,
|
|
22073
|
+
scope: "global"
|
|
22074
|
+
})
|
|
22075
|
+
})
|
|
22076
|
+
]
|
|
22077
|
+
}),
|
|
22078
|
+
/* @__PURE__ */ jsxs80(SettingsSection, {
|
|
22079
|
+
title: "Reasoning",
|
|
22080
|
+
icon: /* @__PURE__ */ jsx88(Sparkles6, {
|
|
22081
|
+
className: "w-4 h-4 text-muted-foreground"
|
|
22082
|
+
}),
|
|
22083
|
+
children: [
|
|
22084
|
+
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22085
|
+
label: "Show Reasoning",
|
|
22086
|
+
checked: config2?.defaults?.reasoningText ?? true,
|
|
22087
|
+
onChange: (checked) => updateDefaults.mutate({
|
|
22088
|
+
reasoningText: checked,
|
|
22089
|
+
scope: "global"
|
|
22090
|
+
})
|
|
22091
|
+
}),
|
|
22092
|
+
/* @__PURE__ */ jsx88(SelectRow, {
|
|
22093
|
+
label: "Reasoning Level",
|
|
22094
|
+
value: config2?.defaults?.reasoningLevel ?? "high",
|
|
22095
|
+
options: [
|
|
22096
|
+
{ id: "minimal", label: "Minimal" },
|
|
22097
|
+
{ id: "low", label: "Low" },
|
|
22098
|
+
{ id: "medium", label: "Medium" },
|
|
22099
|
+
{ id: "high", label: "High" },
|
|
22100
|
+
{ id: "max", label: "Max" },
|
|
22101
|
+
{ id: "xhigh", label: "Extra High" }
|
|
22102
|
+
],
|
|
22103
|
+
onChange: (value) => updateDefaults.mutate({
|
|
22104
|
+
reasoningLevel: value,
|
|
22105
|
+
scope: "global"
|
|
22106
|
+
}),
|
|
22107
|
+
disabled: updateDefaults.isPending
|
|
22108
|
+
})
|
|
22109
|
+
]
|
|
22110
|
+
})
|
|
22111
|
+
]
|
|
22112
|
+
})
|
|
22113
|
+
});
|
|
22114
|
+
}
|
|
21805
22115
|
var SettingsSidebar = memo31(function SettingsSidebar2() {
|
|
21806
22116
|
const isExpanded = useSettingsStore((state) => state.isExpanded);
|
|
21807
22117
|
const collapseSidebar = useSettingsStore((state) => state.collapseSidebar);
|
|
22118
|
+
const [isPreferencesOpen, setIsPreferencesOpen] = useState39(false);
|
|
21808
22119
|
const panelWidth = usePanelWidthStore((s) => s.widths[SETTINGS_PANEL_KEY] ?? SETTINGS_DEFAULT_WIDTH);
|
|
21809
22120
|
const { data: config2 } = useConfig();
|
|
21810
22121
|
const { data: allModels } = useAllModels();
|
|
21811
|
-
const { preferences: preferences2, updatePreferences } = usePreferences();
|
|
21812
22122
|
const updateDefaults = useUpdateDefaults();
|
|
21813
22123
|
const ottorouterBalance = useOttoRouterStore((s) => s.balance);
|
|
21814
22124
|
const ottorouterWallet = useOttoRouterStore((s) => s.walletAddress);
|
|
@@ -21934,87 +22244,6 @@ var SettingsSidebar = memo31(function SettingsSidebar2() {
|
|
|
21934
22244
|
})
|
|
21935
22245
|
]
|
|
21936
22246
|
}),
|
|
21937
|
-
/* @__PURE__ */ jsxs80(SettingsSection, {
|
|
21938
|
-
title: "Preferences",
|
|
21939
|
-
icon: /* @__PURE__ */ jsx88(User3, {
|
|
21940
|
-
className: "w-4 h-4 text-muted-foreground"
|
|
21941
|
-
}),
|
|
21942
|
-
children: [
|
|
21943
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
21944
|
-
label: "Vim Mode",
|
|
21945
|
-
checked: preferences2.vimMode,
|
|
21946
|
-
onChange: (checked) => updatePreferences({ vimMode: checked })
|
|
21947
|
-
}),
|
|
21948
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
21949
|
-
label: "Compact Thread",
|
|
21950
|
-
checked: preferences2.compactThread,
|
|
21951
|
-
onChange: (checked) => updatePreferences({ compactThread: checked })
|
|
21952
|
-
}),
|
|
21953
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
21954
|
-
label: "Full Width Content",
|
|
21955
|
-
checked: preferences2.fullWidthContent,
|
|
21956
|
-
onChange: (checked) => updatePreferences({ fullWidthContent: checked })
|
|
21957
|
-
}),
|
|
21958
|
-
/* @__PURE__ */ jsx88(NumberInputRow, {
|
|
21959
|
-
label: "Auto Compact",
|
|
21960
|
-
value: config2?.defaults?.autoCompactThresholdTokens,
|
|
21961
|
-
onCommit: (value) => updateDefaults.mutate({
|
|
21962
|
-
autoCompactThresholdTokens: value,
|
|
21963
|
-
scope: "global"
|
|
21964
|
-
}),
|
|
21965
|
-
placeholder: "Tokens",
|
|
21966
|
-
disabled: updateDefaults.isPending
|
|
21967
|
-
}),
|
|
21968
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
21969
|
-
label: "Show Reasoning",
|
|
21970
|
-
checked: config2?.defaults?.reasoningText ?? true,
|
|
21971
|
-
onChange: (checked) => updateDefaults.mutate({
|
|
21972
|
-
reasoningText: checked,
|
|
21973
|
-
scope: "global"
|
|
21974
|
-
})
|
|
21975
|
-
}),
|
|
21976
|
-
/* @__PURE__ */ jsx88(SelectRow, {
|
|
21977
|
-
label: "Reasoning Level",
|
|
21978
|
-
value: config2?.defaults?.reasoningLevel ?? "high",
|
|
21979
|
-
options: [
|
|
21980
|
-
{ id: "minimal", label: "Minimal" },
|
|
21981
|
-
{ id: "low", label: "Low" },
|
|
21982
|
-
{ id: "medium", label: "Medium" },
|
|
21983
|
-
{ id: "high", label: "High" },
|
|
21984
|
-
{ id: "max", label: "Max" },
|
|
21985
|
-
{ id: "xhigh", label: "Extra High" }
|
|
21986
|
-
],
|
|
21987
|
-
onChange: (value) => updateDefaults.mutate({
|
|
21988
|
-
reasoningLevel: value,
|
|
21989
|
-
scope: "global"
|
|
21990
|
-
}),
|
|
21991
|
-
disabled: updateDefaults.isPending
|
|
21992
|
-
}),
|
|
21993
|
-
/* @__PURE__ */ jsx88(SelectRow, {
|
|
21994
|
-
label: "Tool Approval",
|
|
21995
|
-
value: config2?.defaults?.toolApproval ?? "dangerous",
|
|
21996
|
-
options: [
|
|
21997
|
-
{ id: "auto", label: "Auto (no approval)" },
|
|
21998
|
-
{ id: "dangerous", label: "Dangerous only" },
|
|
21999
|
-
{ id: "yolo", label: "YOLO (hard blocks only)" },
|
|
22000
|
-
{ id: "all", label: "All tools" }
|
|
22001
|
-
],
|
|
22002
|
-
onChange: (value) => updateDefaults.mutate({
|
|
22003
|
-
toolApproval: value,
|
|
22004
|
-
scope: "global"
|
|
22005
|
-
}),
|
|
22006
|
-
disabled: updateDefaults.isPending
|
|
22007
|
-
}),
|
|
22008
|
-
/* @__PURE__ */ jsx88(ToggleRow, {
|
|
22009
|
-
label: "Guided Mode",
|
|
22010
|
-
checked: config2?.defaults?.guidedMode ?? false,
|
|
22011
|
-
onChange: (checked) => updateDefaults.mutate({
|
|
22012
|
-
guidedMode: checked,
|
|
22013
|
-
scope: "global"
|
|
22014
|
-
})
|
|
22015
|
-
})
|
|
22016
|
-
]
|
|
22017
|
-
}),
|
|
22018
22247
|
/* @__PURE__ */ jsx88(SettingsSection, {
|
|
22019
22248
|
title: "Providers",
|
|
22020
22249
|
icon: /* @__PURE__ */ jsx88(Zap, {
|
|
@@ -22057,6 +22286,28 @@ var SettingsSidebar = memo31(function SettingsSidebar2() {
|
|
|
22057
22286
|
}),
|
|
22058
22287
|
/* @__PURE__ */ jsx88(OttoRouterTopupModal, {})
|
|
22059
22288
|
]
|
|
22289
|
+
}),
|
|
22290
|
+
/* @__PURE__ */ jsxs80("button", {
|
|
22291
|
+
type: "button",
|
|
22292
|
+
onClick: () => setIsPreferencesOpen(true),
|
|
22293
|
+
title: "Open preferences",
|
|
22294
|
+
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",
|
|
22295
|
+
children: [
|
|
22296
|
+
/* @__PURE__ */ jsx88(User3, {
|
|
22297
|
+
className: "w-4 h-4 text-muted-foreground group-hover:text-foreground transition-colors"
|
|
22298
|
+
}),
|
|
22299
|
+
/* @__PURE__ */ jsx88("span", {
|
|
22300
|
+
className: "text-sm flex-1 text-muted-foreground group-hover:text-foreground transition-colors",
|
|
22301
|
+
children: "Preferences"
|
|
22302
|
+
}),
|
|
22303
|
+
/* @__PURE__ */ jsx88(ChevronRight13, {
|
|
22304
|
+
className: "w-4 h-4 text-muted-foreground group-hover:text-foreground group-hover:translate-x-0.5 transition-all"
|
|
22305
|
+
})
|
|
22306
|
+
]
|
|
22307
|
+
}),
|
|
22308
|
+
/* @__PURE__ */ jsx88(PreferencesModal, {
|
|
22309
|
+
isOpen: isPreferencesOpen,
|
|
22310
|
+
onClose: () => setIsPreferencesOpen(false)
|
|
22060
22311
|
})
|
|
22061
22312
|
]
|
|
22062
22313
|
})
|
|
@@ -22419,7 +22670,7 @@ import { QRCodeSVG as QRCodeSVG2 } from "qrcode.react";
|
|
|
22419
22670
|
|
|
22420
22671
|
// src/hooks/useTunnel.ts
|
|
22421
22672
|
import { useQuery as useQuery12, useMutation as useMutation9, useQueryClient as useQueryClient16 } from "@tanstack/react-query";
|
|
22422
|
-
import { useEffect as useEffect38, useCallback as useCallback28, useRef as
|
|
22673
|
+
import { useEffect as useEffect38, useCallback as useCallback28, useRef as useRef27 } from "react";
|
|
22423
22674
|
async function fetchTunnelStatus() {
|
|
22424
22675
|
const response = await fetch(`${API_BASE_URL}/v1/tunnel/status`);
|
|
22425
22676
|
if (!response.ok) {
|
|
@@ -22527,7 +22778,7 @@ function useTunnelStream() {
|
|
|
22527
22778
|
const setError = useTunnelStore((s) => s.setError);
|
|
22528
22779
|
const setProgress = useTunnelStore((s) => s.setProgress);
|
|
22529
22780
|
const isExpanded = useTunnelStore((s) => s.isExpanded);
|
|
22530
|
-
const eventSourceRef =
|
|
22781
|
+
const eventSourceRef = useRef27(null);
|
|
22531
22782
|
const connect = useCallback28(() => {
|
|
22532
22783
|
if (eventSourceRef.current) {
|
|
22533
22784
|
eventSourceRef.current.close();
|
|
@@ -22827,7 +23078,7 @@ var TunnelSidebarToggle = memo34(function TunnelSidebarToggle2() {
|
|
|
22827
23078
|
});
|
|
22828
23079
|
});
|
|
22829
23080
|
// src/components/mcp/MCPSidebar.tsx
|
|
22830
|
-
import { memo as memo37, useState as useState42, useCallback as useCallback31, useMemo as useMemo23, useEffect as useEffect41, useRef as
|
|
23081
|
+
import { memo as memo37, useState as useState42, useCallback as useCallback31, useMemo as useMemo23, useEffect as useEffect41, useRef as useRef30 } from "react";
|
|
22831
23082
|
import {
|
|
22832
23083
|
ChevronDown as ChevronDown10,
|
|
22833
23084
|
ChevronRight as ChevronRight15,
|
|
@@ -22847,7 +23098,7 @@ import { useQueryClient as useQueryClient18 } from "@tanstack/react-query";
|
|
|
22847
23098
|
|
|
22848
23099
|
// src/hooks/useMCP.ts
|
|
22849
23100
|
import { useQuery as useQuery13, useMutation as useMutation10, useQueryClient as useQueryClient17 } from "@tanstack/react-query";
|
|
22850
|
-
import { useEffect as useEffect39, useRef as
|
|
23101
|
+
import { useEffect as useEffect39, useRef as useRef28, useCallback as useCallback29 } from "react";
|
|
22851
23102
|
import {
|
|
22852
23103
|
listMcpServers,
|
|
22853
23104
|
startMcpServer,
|
|
@@ -23013,7 +23264,7 @@ function useCopilotDevicePoller() {
|
|
|
23013
23264
|
const setCopilotDevice = useMCPStore((s) => s.setCopilotDevice);
|
|
23014
23265
|
const setLoading = useMCPStore((s) => s.setLoading);
|
|
23015
23266
|
const queryClient = useQueryClient17();
|
|
23016
|
-
const timerRef =
|
|
23267
|
+
const timerRef = useRef28(null);
|
|
23017
23268
|
const stopPolling = useCallback29(() => {
|
|
23018
23269
|
if (timerRef.current) {
|
|
23019
23270
|
clearInterval(timerRef.current);
|
|
@@ -23056,7 +23307,7 @@ function useCopilotDevicePoller() {
|
|
|
23056
23307
|
}
|
|
23057
23308
|
|
|
23058
23309
|
// src/components/mcp/AddMCPServerModal.tsx
|
|
23059
|
-
import { memo as memo35, useState as useState41, useCallback as useCallback30, useRef as
|
|
23310
|
+
import { memo as memo35, useState as useState41, useCallback as useCallback30, useRef as useRef29, useEffect as useEffect40 } from "react";
|
|
23060
23311
|
import { Globe as Globe5, Laptop, Loader2 as Loader212, FolderDot, Terminal as Terminal9 } from "lucide-react";
|
|
23061
23312
|
import { jsx as jsx92, jsxs as jsxs83, Fragment as Fragment37 } from "react/jsx-runtime";
|
|
23062
23313
|
function parseCommandString(input) {
|
|
@@ -23177,7 +23428,7 @@ var AddMCPServerModal = memo35(function AddMCPServerModal2({
|
|
|
23177
23428
|
addServer,
|
|
23178
23429
|
handleClose
|
|
23179
23430
|
]);
|
|
23180
|
-
const contentRef =
|
|
23431
|
+
const contentRef = useRef29(null);
|
|
23181
23432
|
const [contentHeight, setContentHeight] = useState41(undefined);
|
|
23182
23433
|
useEffect40(() => {
|
|
23183
23434
|
const el = contentRef.current;
|
|
@@ -23715,7 +23966,7 @@ var MCPServerCard = memo37(function MCPServerCard2({
|
|
|
23715
23966
|
});
|
|
23716
23967
|
function useAuthPoller(name, onAuthenticated) {
|
|
23717
23968
|
const { data } = useMCPAuthStatus(name);
|
|
23718
|
-
const prevAuth =
|
|
23969
|
+
const prevAuth = useRef30(false);
|
|
23719
23970
|
useEffect41(() => {
|
|
23720
23971
|
if (data?.authenticated && !prevAuth.current) {
|
|
23721
23972
|
onAuthenticated();
|
|
@@ -24013,7 +24264,7 @@ var MCPSidebarToggle = memo38(function MCPSidebarToggle2() {
|
|
|
24013
24264
|
import { memo as memo39, useMemo as useMemo24 } from "react";
|
|
24014
24265
|
import {
|
|
24015
24266
|
ChevronRight as ChevronRight16,
|
|
24016
|
-
Sparkles as
|
|
24267
|
+
Sparkles as Sparkles7,
|
|
24017
24268
|
Loader2 as Loader215,
|
|
24018
24269
|
FolderDot as FolderDot3,
|
|
24019
24270
|
Laptop as Laptop3,
|
|
@@ -24156,7 +24407,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24156
24407
|
/* @__PURE__ */ jsxs86("div", {
|
|
24157
24408
|
className: "flex items-center gap-2",
|
|
24158
24409
|
children: [
|
|
24159
|
-
/* @__PURE__ */ jsx96(
|
|
24410
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24160
24411
|
className: "w-4 h-4 text-muted-foreground"
|
|
24161
24412
|
}),
|
|
24162
24413
|
/* @__PURE__ */ jsx96("span", {
|
|
@@ -24282,7 +24533,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24282
24533
|
}) : totalCount === 0 ? /* @__PURE__ */ jsxs86("div", {
|
|
24283
24534
|
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24284
24535
|
children: [
|
|
24285
|
-
/* @__PURE__ */ jsx96(
|
|
24536
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24286
24537
|
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24287
24538
|
}),
|
|
24288
24539
|
/* @__PURE__ */ jsx96("h3", {
|
|
@@ -24311,7 +24562,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24311
24562
|
}) : !globalEnabled ? /* @__PURE__ */ jsxs86("div", {
|
|
24312
24563
|
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24313
24564
|
children: [
|
|
24314
|
-
/* @__PURE__ */ jsx96(
|
|
24565
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24315
24566
|
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24316
24567
|
}),
|
|
24317
24568
|
/* @__PURE__ */ jsx96("h3", {
|
|
@@ -24326,7 +24577,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24326
24577
|
}) : skills.length === 0 ? /* @__PURE__ */ jsxs86("div", {
|
|
24327
24578
|
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24328
24579
|
children: [
|
|
24329
|
-
/* @__PURE__ */ jsx96(
|
|
24580
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24330
24581
|
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24331
24582
|
}),
|
|
24332
24583
|
/* @__PURE__ */ jsx96("h3", {
|
|
@@ -24404,7 +24655,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24404
24655
|
/* @__PURE__ */ jsxs86("div", {
|
|
24405
24656
|
className: "flex items-center gap-2 min-w-0 flex-1",
|
|
24406
24657
|
children: [
|
|
24407
|
-
/* @__PURE__ */ jsx96(
|
|
24658
|
+
/* @__PURE__ */ jsx96(Sparkles7, {
|
|
24408
24659
|
className: "w-3 h-3 flex-shrink-0"
|
|
24409
24660
|
}),
|
|
24410
24661
|
/* @__PURE__ */ jsxs86("span", {
|
|
@@ -24437,7 +24688,7 @@ var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
|
24437
24688
|
});
|
|
24438
24689
|
// src/components/skills/SkillsSidebarToggle.tsx
|
|
24439
24690
|
import { memo as memo40 } from "react";
|
|
24440
|
-
import { Sparkles as
|
|
24691
|
+
import { Sparkles as Sparkles8 } from "lucide-react";
|
|
24441
24692
|
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
24442
24693
|
var SkillsSidebarToggle = memo40(function SkillsSidebarToggle2() {
|
|
24443
24694
|
const isExpanded = useSkillsStore((state) => state.isExpanded);
|
|
@@ -24447,7 +24698,7 @@ var SkillsSidebarToggle = memo40(function SkillsSidebarToggle2() {
|
|
|
24447
24698
|
onClick: toggleSidebar,
|
|
24448
24699
|
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"}`,
|
|
24449
24700
|
title: "Skills",
|
|
24450
|
-
children: /* @__PURE__ */ jsx97(
|
|
24701
|
+
children: /* @__PURE__ */ jsx97(Sparkles8, {
|
|
24451
24702
|
className: "w-5 h-5 text-muted-foreground mx-auto"
|
|
24452
24703
|
})
|
|
24453
24704
|
});
|
|
@@ -25000,7 +25251,7 @@ var FileViewerPanel = memo44(function FileViewerPanel2() {
|
|
|
25000
25251
|
});
|
|
25001
25252
|
});
|
|
25002
25253
|
// src/components/file-browser/QuickFilePicker.tsx
|
|
25003
|
-
import { memo as memo45, useState as useState43, useEffect as useEffect45, useRef as
|
|
25254
|
+
import { memo as memo45, useState as useState43, useEffect as useEffect45, useRef as useRef31, useCallback as useCallback33, useMemo as useMemo25 } from "react";
|
|
25004
25255
|
import { FileCode as FileCode4, Search as Search7 } from "lucide-react";
|
|
25005
25256
|
|
|
25006
25257
|
// src/stores/filePickerStore.ts
|
|
@@ -25044,8 +25295,8 @@ var QuickFilePicker = memo45(function QuickFilePicker2() {
|
|
|
25044
25295
|
const expandSidebar = useFileBrowserStore((s) => s.expandSidebar);
|
|
25045
25296
|
const [query, setQuery] = useState43("");
|
|
25046
25297
|
const [selectedIndex, setSelectedIndex] = useState43(0);
|
|
25047
|
-
const inputRef =
|
|
25048
|
-
const listRef =
|
|
25298
|
+
const inputRef = useRef31(null);
|
|
25299
|
+
const listRef = useRef31(null);
|
|
25049
25300
|
const { data: filesData } = useFiles();
|
|
25050
25301
|
const ignoredSet = useMemo25(() => new Set(filesData?.ignoredFiles ?? []), [filesData?.ignoredFiles]);
|
|
25051
25302
|
const filtered = useMemo25(() => {
|
|
@@ -25225,7 +25476,7 @@ function HighlightedPath({ path, query }) {
|
|
|
25225
25476
|
import { memo as memo48 } from "react";
|
|
25226
25477
|
|
|
25227
25478
|
// src/components/onboarding/steps/ProviderSetupStep.tsx
|
|
25228
|
-
import { memo as memo46, useEffect as useEffect46, useState as useState44, useRef as
|
|
25479
|
+
import { memo as memo46, useEffect as useEffect46, useState as useState44, useRef as useRef32 } from "react";
|
|
25229
25480
|
import {
|
|
25230
25481
|
Copy as Copy5,
|
|
25231
25482
|
Check as Check13,
|
|
@@ -25316,20 +25567,20 @@ var ProviderSetupStep = memo46(function ProviderSetupStep2({
|
|
|
25316
25567
|
const [copilotCodeCopied, setCopilotCodeCopied] = useState44(false);
|
|
25317
25568
|
const [copilotModalOpen, setCopilotModalOpen] = useState44(false);
|
|
25318
25569
|
const [copilotLoading, setCopilotLoading] = useState44(false);
|
|
25319
|
-
const copilotPollRef =
|
|
25320
|
-
const copilotCancelledRef =
|
|
25321
|
-
const copilotPollFnRef =
|
|
25570
|
+
const copilotPollRef = useRef32(undefined);
|
|
25571
|
+
const copilotCancelledRef = useRef32(false);
|
|
25572
|
+
const copilotPollFnRef = useRef32(onPollCopilotDeviceFlow);
|
|
25322
25573
|
copilotPollFnRef.current = onPollCopilotDeviceFlow;
|
|
25323
25574
|
const balance = useOttoRouterStore((s) => s.balance);
|
|
25324
25575
|
const usdcBalance = useOttoRouterStore((s) => s.usdcBalance);
|
|
25325
25576
|
const payg = useOttoRouterStore((s) => s.payg);
|
|
25326
25577
|
const subscription = useOttoRouterStore((s) => s.subscription);
|
|
25327
25578
|
const isBalanceLoading = useOttoRouterStore((s) => s.isLoading);
|
|
25328
|
-
const apiKeyInputRef =
|
|
25329
|
-
const oauthCodeInputRef =
|
|
25330
|
-
const importPrivateKeyRef =
|
|
25579
|
+
const apiKeyInputRef = useRef32(null);
|
|
25580
|
+
const oauthCodeInputRef = useRef32(null);
|
|
25581
|
+
const importPrivateKeyRef = useRef32(null);
|
|
25331
25582
|
const isTopupModalOpen = useOttoRouterStore((s) => s.isTopupModalOpen);
|
|
25332
|
-
const prevTopupModalOpen =
|
|
25583
|
+
const prevTopupModalOpen = useRef32(false);
|
|
25333
25584
|
const { fetchBalance } = useOttoRouterBalance("ottorouter");
|
|
25334
25585
|
const effectivePayg = payg?.effectiveSpendableUsd ?? balance ?? 0;
|
|
25335
25586
|
const setuStatusLabel = subscription?.active ? `GO ${(subscription.creditsRemaining ?? 0).toFixed(1)} credits` : `$${effectivePayg.toFixed(2)}`;
|
|
@@ -26745,8 +26996,8 @@ var ProviderSetupStep = memo46(function ProviderSetupStep2({
|
|
|
26745
26996
|
});
|
|
26746
26997
|
|
|
26747
26998
|
// src/components/onboarding/steps/DefaultsStep.tsx
|
|
26748
|
-
import { memo as memo47, useState as useState45, useEffect as useEffect47, useId as useId3, useRef as
|
|
26749
|
-
import { Loader2 as Loader217, ArrowLeft, Sparkles as
|
|
26999
|
+
import { memo as memo47, useState as useState45, useEffect as useEffect47, useId as useId3, useRef as useRef33 } from "react";
|
|
27000
|
+
import { Loader2 as Loader217, ArrowLeft, Sparkles as Sparkles9, ChevronDown as ChevronDown12 } from "lucide-react";
|
|
26750
27001
|
import { jsx as jsx104, jsxs as jsxs92, Fragment as Fragment40 } from "react/jsx-runtime";
|
|
26751
27002
|
var DefaultsStep = memo47(function DefaultsStep2({
|
|
26752
27003
|
authStatus,
|
|
@@ -26763,7 +27014,7 @@ var DefaultsStep = memo47(function DefaultsStep2({
|
|
|
26763
27014
|
const [selectedAgent, setSelectedAgent] = useState45(authStatus.defaults.agent || "build");
|
|
26764
27015
|
const [selectedApproval, setSelectedApproval] = useState45(authStatus.defaults.toolApproval || "dangerous");
|
|
26765
27016
|
const [guidedMode, setGuidedMode] = useState45(false);
|
|
26766
|
-
const hasUserChangedProvider =
|
|
27017
|
+
const hasUserChangedProvider = useRef33(false);
|
|
26767
27018
|
const providerId = useId3();
|
|
26768
27019
|
const modelId = useId3();
|
|
26769
27020
|
const agentId = useId3();
|
|
@@ -27090,7 +27341,7 @@ var DefaultsStep = memo47(function DefaultsStep2({
|
|
|
27090
27341
|
}) : /* @__PURE__ */ jsxs92(Fragment40, {
|
|
27091
27342
|
children: [
|
|
27092
27343
|
"Start Using otto",
|
|
27093
|
-
/* @__PURE__ */ jsx104(
|
|
27344
|
+
/* @__PURE__ */ jsx104(Sparkles9, {
|
|
27094
27345
|
className: "w-4 h-4"
|
|
27095
27346
|
})
|
|
27096
27347
|
]
|
|
@@ -27240,4 +27491,4 @@ export {
|
|
|
27240
27491
|
AssistantMessageGroup
|
|
27241
27492
|
};
|
|
27242
27493
|
|
|
27243
|
-
//# debugId=
|
|
27494
|
+
//# debugId=B981D17F74D0602964756E2164756E21
|