@ottocode/web-sdk 0.1.245 → 0.1.247
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/assets/provider-logos.d.ts +1 -0
- package/dist/assets/provider-logos.d.ts.map +1 -1
- package/dist/components/chat/UnifiedModelSelector.d.ts.map +1 -1
- package/dist/components/common/ProviderLogo.d.ts.map +1 -1
- package/dist/components/file-browser/FileViewerPanel.d.ts.map +1 -1
- package/dist/components/index.js +720 -446
- package/dist/components/index.js.map +24 -23
- package/dist/components/mcp/MCPSidebar.d.ts.map +1 -1
- package/dist/components/messages/ActionToolBox.d.ts.map +1 -1
- package/dist/components/messages/AssistantMessageGroup.d.ts.map +1 -1
- package/dist/components/messages/MessagePartItem.d.ts.map +1 -1
- package/dist/components/messages/ToolApprovalCard.d.ts.map +1 -1
- package/dist/components/messages/renderers/index.d.ts.map +1 -1
- package/dist/components/skills/SkillsSidebar.d.ts.map +1 -1
- package/dist/components/ui/ToggleSwitch.d.ts +7 -0
- package/dist/components/ui/ToggleSwitch.d.ts.map +1 -0
- package/dist/components/ui/ToolApprovalDialog.d.ts.map +1 -1
- package/dist/hooks/index.js +50 -8
- package/dist/hooks/index.js.map +8 -8
- package/dist/hooks/useConfig.d.ts +7 -0
- package/dist/hooks/useConfig.d.ts.map +1 -1
- package/dist/hooks/useSkills.d.ts +8 -3
- package/dist/hooks/useSkills.d.ts.map +1 -1
- package/dist/index.js +721 -446
- package/dist/index.js.map +24 -23
- package/dist/lib/api-client/config.d.ts +7 -0
- package/dist/lib/api-client/config.d.ts.map +1 -1
- package/dist/lib/api-client/index.d.ts +15 -0
- package/dist/lib/api-client/index.d.ts.map +1 -1
- package/dist/lib/api-client/skills.d.ts +15 -0
- package/dist/lib/api-client/skills.d.ts.map +1 -1
- package/dist/lib/index.js +17 -1
- package/dist/lib/index.js.map +5 -5
- package/dist/stores/index.js +5 -1
- package/dist/stores/index.js.map +3 -3
- package/dist/stores/skillsStore.d.ts +10 -0
- package/dist/stores/skillsStore.d.ts.map +1 -1
- package/dist/types/api.d.ts +2 -0
- package/dist/types/api.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/components/index.js
CHANGED
|
@@ -383,6 +383,7 @@ var useToolApprovalStore = create3((set) => ({
|
|
|
383
383
|
import { Shield, Check, X as X2, Terminal, FileEdit, GitCommit } from "lucide-react";
|
|
384
384
|
import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
385
385
|
var TOOL_ICONS = {
|
|
386
|
+
shell: Terminal,
|
|
386
387
|
bash: Terminal,
|
|
387
388
|
edit: FileEdit,
|
|
388
389
|
multiedit: FileEdit,
|
|
@@ -1565,6 +1566,8 @@ var authMixin = {
|
|
|
1565
1566
|
|
|
1566
1567
|
// src/lib/api-client/skills.ts
|
|
1567
1568
|
import {
|
|
1569
|
+
getSkillsConfig as apiGetSkillsConfig,
|
|
1570
|
+
updateSkillsConfig as apiUpdateSkillsConfig,
|
|
1568
1571
|
listSkills as apiListSkills,
|
|
1569
1572
|
getSkill as apiGetSkill,
|
|
1570
1573
|
listSkillFiles as apiListSkillFiles,
|
|
@@ -1596,6 +1599,18 @@ var skillsMixin = {
|
|
|
1596
1599
|
if (response.error)
|
|
1597
1600
|
throw new Error(extractErrorMessage(response.error));
|
|
1598
1601
|
return response.data;
|
|
1602
|
+
},
|
|
1603
|
+
async getSkillsConfig() {
|
|
1604
|
+
const response = await apiGetSkillsConfig();
|
|
1605
|
+
if (response.error)
|
|
1606
|
+
throw new Error(extractErrorMessage(response.error));
|
|
1607
|
+
return response.data;
|
|
1608
|
+
},
|
|
1609
|
+
async updateSkillsConfig(input) {
|
|
1610
|
+
const response = await apiUpdateSkillsConfig({ body: input });
|
|
1611
|
+
if (response.error)
|
|
1612
|
+
throw new Error(extractErrorMessage(response.error));
|
|
1613
|
+
return response.data;
|
|
1599
1614
|
}
|
|
1600
1615
|
};
|
|
1601
1616
|
|
|
@@ -1679,6 +1694,8 @@ class ApiClient {
|
|
|
1679
1694
|
getSkill = skillsMixin.getSkill;
|
|
1680
1695
|
getSkillFiles = skillsMixin.getSkillFiles;
|
|
1681
1696
|
getSkillFileContent = skillsMixin.getSkillFileContent;
|
|
1697
|
+
getSkillsConfig = skillsMixin.getSkillsConfig;
|
|
1698
|
+
updateSkillsConfig = skillsMixin.updateSkillsConfig;
|
|
1682
1699
|
}
|
|
1683
1700
|
var apiClient = new ApiClient;
|
|
1684
1701
|
|
|
@@ -2567,6 +2584,13 @@ var openaiLogo = `<svg width="24" height="24" viewBox="0 0 40 40" xmlns="http://
|
|
|
2567
2584
|
var googleLogo = `<svg width="24" height="24" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
|
|
2568
2585
|
<path d="M37 20.034C27.8809 20.5837 20.5808 27.8809 20.0326 37H19.966C19.4163 27.8809 12.1177 20.5837 3 20.034V19.9674C12.1191 19.4163 19.4163 12.1191 19.966 3H20.0326C20.5822 12.1191 27.8809 19.4163 37 19.9674V20.034Z" fill="currentColor"/>
|
|
2569
2586
|
</svg>`;
|
|
2587
|
+
var ollamaCloudLogo = `<svg width="24" height="24" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
|
|
2588
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M12.1766 4.57738C12.7424 4.45248 13.3253 4.4821 13.8719 4.64802C14.3313 4.78771 14.7467 5.0176 15.1232 5.32158C15.7506 5.82452 16.2805 6.54484 16.6847 7.39778C17.0911 8.25589 17.3555 9.20672 17.4555 10.1602C18.7946 9.57485 20.2806 9.21797 21.8134 9.11449L21.9219 9.10819C23.7727 8.99312 25.6026 9.25154 27.1981 9.88772C27.4129 9.97483 27.6238 10.0679 27.8301 10.1665C27.9364 9.23136 28.196 8.30283 28.5958 7.46464C28.9999 6.60982 29.5307 5.89059 30.1561 5.38591C30.5055 5.09396 30.9329 4.86411 31.4086 4.71235C31.9551 4.54805 32.5357 4.5182 33.1014 4.64297C33.9545 4.83037 34.6868 5.24855 35.2633 5.85515C35.3459 5.94188 35.4243 6.03325 35.5005 6.12759V15.9511C35.3966 15.8807 35.2901 15.8126 35.18 15.748C33.9142 15.0017 32.2379 14.6416 30.117 14.7452C29.8396 14.7591 29.5632 14.7076 29.3236 14.5989C29.084 14.4902 28.8918 14.3286 28.7724 14.1347C28.1043 13.0417 27.1301 12.2596 25.9154 11.7747C24.7492 11.325 23.443 11.1355 22.1451 11.2285C19.4969 11.3914 17.161 12.5451 16.4653 13.9998C16.3668 14.2045 16.1901 14.3819 15.9582 14.5068C15.7263 14.6316 15.4499 14.6982 15.1673 14.6986C12.8978 14.7019 11.1405 15.1127 9.85572 15.854C8.74521 16.4951 7.98775 17.3916 7.58779 18.4649C7.22593 19.4754 7.17595 20.5375 7.44274 21.5654C7.68101 22.4825 8.14742 23.2424 8.68139 23.6517L8.69905 23.6631C9.14965 24.0034 9.24462 24.5344 8.92988 24.9534C8.16414 25.9759 7.59183 27.5 7.49823 28.9645C7.39192 30.6379 7.89443 32.0911 9.02827 33.1334L9.06232 33.1649C9.23327 33.3188 9.34304 33.5076 9.37893 33.7085C9.41476 33.9096 9.37497 34.1146 9.26414 34.2988C9.01373 34.7141 8.79967 35.1146 8.61959 35.4996H5.70206C5.88367 35.0312 6.10757 34.5494 6.37562 34.0555L6.40463 33.9973L6.38824 33.9785C5.81212 33.3209 5.38162 32.5935 5.11552 31.8266L5.10543 31.7951C4.78254 30.8384 4.65491 29.8484 4.72828 28.8612C4.82189 27.3653 5.31963 25.8324 6.05146 24.6028L6.07795 24.5599L6.0729 24.5573C5.4496 23.8702 4.98861 22.99 4.73333 22.0169L4.72198 21.9779C4.37027 20.6205 4.43825 19.2181 4.92001 17.8847C5.47739 16.3806 6.5735 15.0886 8.18819 14.1549C8.31563 14.0811 8.44921 14.0069 8.58301 13.9379C8.24476 11.4838 8.33005 9.45005 8.82141 7.90485C9.09153 7.05352 9.48977 6.34345 10.0172 5.78955C10.5916 5.18463 11.3236 4.76644 12.1766 4.57738ZM12.8767 6.64096C12.6303 6.7238 12.4193 6.8594 12.27 7.03199L12.2599 7.04208C11.9664 7.35278 11.7109 7.80949 11.5195 8.4094C11.1578 9.54695 11.0601 11.091 11.2558 12.9831C12.1706 12.7727 13.1684 12.641 14.2427 12.5933L14.2642 12.5908L14.3045 12.5353C14.4022 12.4008 14.5061 12.271 14.6186 12.143C14.8802 10.8758 14.6661 9.36166 14.0813 8.12559C13.7963 7.52741 13.4494 7.05655 13.1176 6.78855C13.0491 6.73286 12.972 6.68361 12.8893 6.64096L12.883 6.63719L12.8767 6.64096ZM32.3963 6.70403C32.3135 6.74667 32.2365 6.79719 32.1679 6.85288C31.8361 7.12084 31.4873 7.5929 31.2043 8.19118C30.5875 9.49635 30.3808 11.1109 30.7149 12.4193L30.8385 12.5782L30.8549 12.6009H30.9192C31.975 12.6011 33.0258 12.7194 34.0385 12.9503C34.2214 11.1026 34.1192 9.59119 33.7661 8.47499C33.5745 7.87507 33.3189 7.41836 33.0231 7.10767L33.0143 7.09758C32.8652 6.92452 32.6555 6.78729 32.4088 6.70403L32.4 6.70278L32.3963 6.70403Z" fill="currentColor"/>
|
|
2589
|
+
<path d="M21.5208 22.8469C21.7175 22.8312 21.9155 22.876 22.0695 22.9718L22.5262 23.2555L22.9941 22.9692C23.1476 22.8755 23.343 22.8314 23.5378 22.8469C23.7324 22.8626 23.912 22.9364 24.0373 23.0525L24.046 23.0601C24.3009 23.3081 24.2473 23.6677 23.9262 23.8648L23.3057 24.2432V24.9761C23.3045 25.1391 23.2194 25.295 23.0698 25.41C22.92 25.5248 22.717 25.5894 22.5059 25.5891C22.2946 25.5895 22.0908 25.5249 21.9408 25.41C21.7912 25.295 21.706 25.1391 21.705 24.9761V24.2205L21.1285 23.8623C21.0527 23.8153 20.9899 23.7567 20.9432 23.6907C20.8964 23.6247 20.8663 23.5512 20.8561 23.4763C20.8459 23.4017 20.8551 23.3262 20.8826 23.2542C20.9103 23.182 20.9572 23.1146 21.0188 23.0562C21.1443 22.9384 21.3244 22.8627 21.5208 22.8469Z" fill="currentColor"/>
|
|
2590
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M22.6284 19.5913C24.6195 19.5913 26.4584 20.1055 27.8327 20.9965C29.1727 21.8626 29.9705 23.0264 29.9707 24.1853C29.9707 25.6448 29.1066 26.7822 27.5602 27.5089C26.2412 28.1253 24.4732 28.4247 22.4479 28.4247C20.3014 28.4247 18.4671 27.9996 17.1439 27.2188C15.8314 26.4461 15.0955 25.3604 15.0955 24.1853C15.0957 23.0232 15.9423 21.8558 17.3419 20.9864C18.763 20.1036 20.6394 19.5914 22.6284 19.5913ZM22.6284 21.0634C21.1527 21.0534 19.716 21.4302 18.5529 22.1317C17.5721 22.7399 17.0165 23.5056 17.0165 24.1877C17.0168 24.8911 17.4639 25.5495 18.3144 26.0508C19.2825 26.6211 20.7055 26.9526 22.4479 26.9526C24.1473 26.9526 25.581 26.7109 26.5575 26.2525C27.5425 25.7922 28.0472 25.1239 28.0472 24.1853C28.0469 23.4898 27.5235 22.7218 26.5941 22.1203C25.5644 21.4547 24.1684 21.0634 22.6284 21.0634Z" fill="currentColor"/>
|
|
2591
|
+
<path d="M13.3142 19.8978C14.331 19.8978 15.1595 20.54 15.1595 21.3308C15.1599 21.7093 14.9655 22.0727 14.6197 22.3411C14.2735 22.6095 13.8033 22.7614 13.3129 22.7624C12.8231 22.7611 12.3531 22.6091 12.0074 22.3411C11.6621 22.0731 11.4676 21.7101 11.4675 21.332C11.4664 20.9532 11.6605 20.5891 12.0061 20.3204C12.3519 20.0516 12.8239 19.8994 13.3142 19.8978Z" fill="currentColor"/>
|
|
2592
|
+
<path d="M31.8364 19.8978C32.8574 19.8978 33.683 20.54 33.683 21.3308C33.6834 21.7095 33.4892 22.0727 33.1431 22.3411C32.7968 22.6095 32.3267 22.7615 31.8364 22.7624C31.3466 22.7611 30.8779 22.6091 30.5321 22.3411C30.1866 22.0731 29.9923 21.7104 29.9922 21.332C29.991 20.9532 30.184 20.5891 30.5295 20.3204C30.8753 20.0516 31.3458 19.8992 31.8364 19.8978Z" fill="currentColor"/>
|
|
2593
|
+
</svg>`;
|
|
2570
2594
|
var openrouterLogo = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2571
2595
|
<path d="M3.10913 12.07C3.65512 12.07 5.76627 11.5988 6.85825 10.98C7.95023 10.3612 7.95023 10.3612 10.207 8.75965C13.0642 6.73196 15.0845 7.41088 18.3968 7.41088" fill="currentColor"/>
|
|
2572
2596
|
<path d="M3.10913 12.07C3.65512 12.07 5.76627 11.5988 6.85825 10.98C7.95023 10.3612 7.95023 10.3612 10.207 8.75965C13.0642 6.73196 15.0845 7.41088 18.3968 7.41088" stroke="currentColor" stroke-width="3.27593"/>
|
|
@@ -2607,6 +2631,8 @@ var providerLogos = {
|
|
|
2607
2631
|
anthropic: anthropicLogo,
|
|
2608
2632
|
openai: openaiLogo,
|
|
2609
2633
|
google: googleLogo,
|
|
2634
|
+
ollama: ollamaCloudLogo,
|
|
2635
|
+
"ollama-cloud": ollamaCloudLogo,
|
|
2610
2636
|
openrouter: openrouterLogo,
|
|
2611
2637
|
groq: groqLogo,
|
|
2612
2638
|
deepseek: deepseekLogo,
|
|
@@ -2623,7 +2649,8 @@ var ProviderLogo = memo2(function ProviderLogo2({
|
|
|
2623
2649
|
className = "",
|
|
2624
2650
|
size = 16
|
|
2625
2651
|
}) {
|
|
2626
|
-
const
|
|
2652
|
+
const normalizedProvider = provider.toLowerCase();
|
|
2653
|
+
const logoSvg = providerLogos[normalizedProvider] ?? (normalizedProvider.includes("ollama") ? ollamaCloudLogo : undefined);
|
|
2627
2654
|
if (!logoSvg) {
|
|
2628
2655
|
return /* @__PURE__ */ jsx13("span", {
|
|
2629
2656
|
className: `inline-flex items-center justify-center text-[10px] font-medium text-muted-foreground uppercase ${className}`,
|
|
@@ -4170,6 +4197,9 @@ import { create as create6 } from "zustand";
|
|
|
4170
4197
|
var useSkillsStore = create6((set) => ({
|
|
4171
4198
|
isExpanded: false,
|
|
4172
4199
|
skills: [],
|
|
4200
|
+
globalEnabled: true,
|
|
4201
|
+
totalCount: 0,
|
|
4202
|
+
enabledCount: 0,
|
|
4173
4203
|
selectedSkill: null,
|
|
4174
4204
|
isViewerOpen: false,
|
|
4175
4205
|
viewingFile: null,
|
|
@@ -4200,6 +4230,7 @@ var useSkillsStore = create6((set) => ({
|
|
|
4200
4230
|
},
|
|
4201
4231
|
collapseSidebar: () => set({ isExpanded: false }),
|
|
4202
4232
|
setSkills: (skills) => set({ skills }),
|
|
4233
|
+
setSkillsConfig: ({ skills, globalEnabled, totalCount, enabledCount }) => set({ skills, globalEnabled, totalCount, enabledCount }),
|
|
4203
4234
|
selectSkill: (name) => set({ selectedSkill: name, isViewerOpen: false, viewingFile: null }),
|
|
4204
4235
|
openViewer: (file) => set({ isViewerOpen: true, viewingFile: file }),
|
|
4205
4236
|
closeViewer: () => set({ isViewerOpen: false, viewingFile: null })
|
|
@@ -5103,23 +5134,97 @@ import { ChevronDown, Search } from "lucide-react";
|
|
|
5103
5134
|
import Fuse2 from "fuse.js";
|
|
5104
5135
|
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5105
5136
|
var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider, model, onChange, disabled = false }, ref) {
|
|
5106
|
-
const { data: allModels
|
|
5137
|
+
const { data: allModels } = useAllModels();
|
|
5138
|
+
const { data: currentProviderModels, isLoading: isCurrentProviderLoading } = useModels(provider);
|
|
5107
5139
|
const [isOpen, setIsOpen] = useState10(false);
|
|
5108
5140
|
const [searchQuery, setSearchQuery] = useState10("");
|
|
5109
5141
|
const [highlightedIndex, setHighlightedIndex] = useState10(0);
|
|
5142
|
+
const [loadedModels, setLoadedModels] = useState10({});
|
|
5143
|
+
const [loadingProviders, setLoadingProviders] = useState10({});
|
|
5144
|
+
const [hydratedProviders, setHydratedProviders] = useState10({});
|
|
5110
5145
|
const dropdownRef = useRef4(null);
|
|
5111
5146
|
const searchInputRef = useRef4(null);
|
|
5112
5147
|
const itemRefs = useRef4([]);
|
|
5148
|
+
useEffect9(() => {
|
|
5149
|
+
if (!allModels)
|
|
5150
|
+
return;
|
|
5151
|
+
setLoadedModels((prev) => {
|
|
5152
|
+
const next = { ...prev };
|
|
5153
|
+
for (const [providerId, providerData] of Object.entries(allModels)) {
|
|
5154
|
+
next[providerId] = {
|
|
5155
|
+
...providerData,
|
|
5156
|
+
models: hydratedProviders[providerId] ? prev[providerId]?.models ?? providerData.models : providerData.models
|
|
5157
|
+
};
|
|
5158
|
+
}
|
|
5159
|
+
return next;
|
|
5160
|
+
});
|
|
5161
|
+
}, [allModels, hydratedProviders]);
|
|
5162
|
+
const configuredProviders = useMemo6(() => {
|
|
5163
|
+
const providers = Object.keys(allModels ?? {});
|
|
5164
|
+
if (!provider || providers.includes(provider)) {
|
|
5165
|
+
return providers;
|
|
5166
|
+
}
|
|
5167
|
+
return [provider, ...providers];
|
|
5168
|
+
}, [allModels, provider]);
|
|
5169
|
+
useEffect9(() => {
|
|
5170
|
+
if (!provider || !currentProviderModels)
|
|
5171
|
+
return;
|
|
5172
|
+
setLoadedModels((prev) => ({
|
|
5173
|
+
...prev,
|
|
5174
|
+
[provider]: {
|
|
5175
|
+
...prev[provider] ?? {},
|
|
5176
|
+
label: currentProviderModels.label || provider,
|
|
5177
|
+
models: currentProviderModels.models
|
|
5178
|
+
}
|
|
5179
|
+
}));
|
|
5180
|
+
setHydratedProviders((prev) => ({ ...prev, [provider]: true }));
|
|
5181
|
+
}, [currentProviderModels, provider]);
|
|
5182
|
+
useEffect9(() => {
|
|
5183
|
+
if (!isOpen || !configuredProviders.length)
|
|
5184
|
+
return;
|
|
5185
|
+
for (const providerId of configuredProviders) {
|
|
5186
|
+
const providerData = loadedModels[providerId] ?? allModels?.[providerId];
|
|
5187
|
+
if (!providerData?.dynamicModels || hydratedProviders[providerId] || loadingProviders[providerId]) {
|
|
5188
|
+
continue;
|
|
5189
|
+
}
|
|
5190
|
+
setLoadingProviders((prev) => ({ ...prev, [providerId]: true }));
|
|
5191
|
+
apiClient.getModels(providerId).then((data) => {
|
|
5192
|
+
setLoadedModels((prev) => ({
|
|
5193
|
+
...prev,
|
|
5194
|
+
[providerId]: {
|
|
5195
|
+
...prev[providerId] ?? allModels?.[providerId] ?? {},
|
|
5196
|
+
label: data.label || providerId,
|
|
5197
|
+
models: data.models,
|
|
5198
|
+
allowAnyModel: data.allowAnyModel,
|
|
5199
|
+
dynamicModels: true
|
|
5200
|
+
}
|
|
5201
|
+
}));
|
|
5202
|
+
setHydratedProviders((prev) => ({ ...prev, [providerId]: true }));
|
|
5203
|
+
}).catch(() => {
|
|
5204
|
+
setHydratedProviders((prev) => ({ ...prev, [providerId]: true }));
|
|
5205
|
+
}).finally(() => {
|
|
5206
|
+
setLoadingProviders((prev) => ({
|
|
5207
|
+
...prev,
|
|
5208
|
+
[providerId]: false
|
|
5209
|
+
}));
|
|
5210
|
+
});
|
|
5211
|
+
}
|
|
5212
|
+
}, [
|
|
5213
|
+
allModels,
|
|
5214
|
+
configuredProviders,
|
|
5215
|
+
hydratedProviders,
|
|
5216
|
+
isOpen,
|
|
5217
|
+
loadedModels,
|
|
5218
|
+
loadingProviders
|
|
5219
|
+
]);
|
|
5113
5220
|
useImperativeHandle2(ref, () => ({
|
|
5114
5221
|
openAndFocus: () => {
|
|
5115
5222
|
setIsOpen(true);
|
|
5116
5223
|
}
|
|
5117
5224
|
}));
|
|
5118
5225
|
const flattenedModels = useMemo6(() => {
|
|
5119
|
-
if (!allModels)
|
|
5120
|
-
return [];
|
|
5121
5226
|
const flattened = [];
|
|
5122
|
-
for (const [providerKey, providerData] of Object.entries(
|
|
5227
|
+
for (const [providerKey, providerData] of Object.entries(loadedModels)) {
|
|
5123
5228
|
for (const modelItem of providerData.models) {
|
|
5124
5229
|
flattened.push({
|
|
5125
5230
|
providerKey,
|
|
@@ -5134,7 +5239,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5134
5239
|
}
|
|
5135
5240
|
}
|
|
5136
5241
|
return flattened;
|
|
5137
|
-
}, [
|
|
5242
|
+
}, [loadedModels]);
|
|
5138
5243
|
const fuse = useMemo6(() => {
|
|
5139
5244
|
return new Fuse2(flattenedModels, {
|
|
5140
5245
|
keys: [
|
|
@@ -5150,10 +5255,8 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5150
5255
|
});
|
|
5151
5256
|
}, [flattenedModels]);
|
|
5152
5257
|
const filteredModels = useMemo6(() => {
|
|
5153
|
-
if (!allModels)
|
|
5154
|
-
return {};
|
|
5155
5258
|
if (!searchQuery.trim())
|
|
5156
|
-
return
|
|
5259
|
+
return loadedModels;
|
|
5157
5260
|
const results = fuse.search(searchQuery);
|
|
5158
5261
|
const sortedResults = results.sort((a, b) => {
|
|
5159
5262
|
const scoreA = a.score ?? 1;
|
|
@@ -5195,7 +5298,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5195
5298
|
}
|
|
5196
5299
|
}
|
|
5197
5300
|
return filtered;
|
|
5198
|
-
}, [
|
|
5301
|
+
}, [loadedModels, searchQuery, fuse]);
|
|
5199
5302
|
const filteredFlatList = useMemo6(() => {
|
|
5200
5303
|
const list = [];
|
|
5201
5304
|
for (const [providerKey, providerData] of Object.entries(filteredModels)) {
|
|
@@ -5274,8 +5377,9 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5274
5377
|
}
|
|
5275
5378
|
}
|
|
5276
5379
|
};
|
|
5277
|
-
const currentProviderLabel =
|
|
5278
|
-
const currentModelLabel =
|
|
5380
|
+
const currentProviderLabel = loadedModels[provider]?.label || currentProviderModels?.label || provider;
|
|
5381
|
+
const currentModelLabel = loadedModels[provider]?.models.find((m) => m.id === model)?.label || currentProviderModels?.models.find((m) => m.id === model)?.label || model;
|
|
5382
|
+
const displayedProviderKeys = searchQuery.trim() ? Object.keys(filteredModels) : configuredProviders;
|
|
5279
5383
|
return /* @__PURE__ */ jsxs10("div", {
|
|
5280
5384
|
ref: dropdownRef,
|
|
5281
5385
|
className: "relative w-full",
|
|
@@ -5283,7 +5387,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5283
5387
|
/* @__PURE__ */ jsxs10("button", {
|
|
5284
5388
|
type: "button",
|
|
5285
5389
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
5286
|
-
disabled
|
|
5390
|
+
disabled,
|
|
5287
5391
|
className: "w-full flex items-center justify-between px-3 py-2 bg-[hsl(var(--secondary))] border border-[hsl(var(--border))] rounded-md hover:bg-[hsl(var(--accent))] focus:outline-none focus:ring-2 focus:ring-[hsl(var(--ring))] disabled:opacity-50 disabled:cursor-not-allowed transition-colors",
|
|
5288
5392
|
children: [
|
|
5289
5393
|
/* @__PURE__ */ jsxs10("span", {
|
|
@@ -5308,7 +5412,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5308
5412
|
})
|
|
5309
5413
|
]
|
|
5310
5414
|
}),
|
|
5311
|
-
isOpen &&
|
|
5415
|
+
isOpen && /* @__PURE__ */ jsxs10("div", {
|
|
5312
5416
|
className: "absolute z-50 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",
|
|
5313
5417
|
children: [
|
|
5314
5418
|
/* @__PURE__ */ jsx16("div", {
|
|
@@ -5333,62 +5437,72 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5333
5437
|
}),
|
|
5334
5438
|
/* @__PURE__ */ jsx16("div", {
|
|
5335
5439
|
className: "overflow-y-auto",
|
|
5336
|
-
children:
|
|
5440
|
+
children: displayedProviderKeys.length === 0 ? /* @__PURE__ */ jsx16("div", {
|
|
5337
5441
|
className: "p-4 text-center text-[hsl(var(--muted-foreground))] text-sm",
|
|
5338
|
-
children: "No models found"
|
|
5339
|
-
}) :
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5367
|
-
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5383
|
-
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5442
|
+
children: isCurrentProviderLoading ? "Loading models..." : "No models found"
|
|
5443
|
+
}) : displayedProviderKeys.map((providerKey) => {
|
|
5444
|
+
const providerData = filteredModels[providerKey];
|
|
5445
|
+
const isProviderLoading = loadingProviders[providerKey] || providerKey === provider && isCurrentProviderLoading && !providerData;
|
|
5446
|
+
return /* @__PURE__ */ jsxs10("div", {
|
|
5447
|
+
className: "border-b border-[hsl(var(--border))] last:border-0",
|
|
5448
|
+
children: [
|
|
5449
|
+
/* @__PURE__ */ jsx16("div", {
|
|
5450
|
+
className: "sticky top-0 px-3 py-2 text-xs font-semibold text-[hsl(var(--muted-foreground))] uppercase tracking-wider bg-[hsl(var(--muted))] z-10",
|
|
5451
|
+
children: providerData?.label || providerKey
|
|
5452
|
+
}),
|
|
5453
|
+
/* @__PURE__ */ jsx16("div", {
|
|
5454
|
+
children: isProviderLoading ? /* @__PURE__ */ jsx16("div", {
|
|
5455
|
+
className: "px-4 py-2 text-sm text-[hsl(var(--muted-foreground))]",
|
|
5456
|
+
children: "Loading models..."
|
|
5457
|
+
}) : providerData?.models.length ? providerData.models.map((modelItem) => {
|
|
5458
|
+
const isSelected = providerKey === provider && modelItem.id === model;
|
|
5459
|
+
const flatIndex = filteredFlatList.findIndex((item) => item.providerKey === providerKey && item.modelId === modelItem.id);
|
|
5460
|
+
const isHighlighted = flatIndex === highlightedIndex;
|
|
5461
|
+
const isAvailable = modelItem.available !== false;
|
|
5462
|
+
return /* @__PURE__ */ jsxs10("button", {
|
|
5463
|
+
ref: (el) => {
|
|
5464
|
+
if (flatIndex >= 0) {
|
|
5465
|
+
itemRefs.current[flatIndex] = el;
|
|
5466
|
+
}
|
|
5467
|
+
},
|
|
5468
|
+
type: "button",
|
|
5469
|
+
disabled: !isAvailable,
|
|
5470
|
+
title: modelItem.unavailableReason,
|
|
5471
|
+
onClick: () => handleSelect(providerKey, modelItem.id, modelItem.available),
|
|
5472
|
+
onMouseEnter: () => setHighlightedIndex(flatIndex),
|
|
5473
|
+
className: `w-full text-left px-4 py-2 text-sm flex items-center justify-between transition-colors ${isHighlighted ? "bg-[hsl(var(--accent))]" : "hover:bg-[hsl(var(--accent))]"} ${isSelected ? "text-[hsl(var(--accent-foreground))] font-medium" : "text-[hsl(var(--foreground))]"} ${!isAvailable ? "opacity-60 cursor-not-allowed" : ""}`,
|
|
5474
|
+
children: [
|
|
5475
|
+
/* @__PURE__ */ jsx16("span", {
|
|
5476
|
+
className: "truncate",
|
|
5477
|
+
children: modelItem.label
|
|
5478
|
+
}),
|
|
5479
|
+
(!isAvailable || modelItem.toolCall || modelItem.reasoningText) && /* @__PURE__ */ jsxs10("div", {
|
|
5480
|
+
className: "flex gap-1 ml-2 flex-shrink-0",
|
|
5481
|
+
children: [
|
|
5482
|
+
!isAvailable && /* @__PURE__ */ jsx16("span", {
|
|
5483
|
+
className: "text-[10px] px-1.5 py-0.5 bg-red-600/20 text-red-400 rounded",
|
|
5484
|
+
children: "Unavailable"
|
|
5485
|
+
}),
|
|
5486
|
+
modelItem.toolCall && /* @__PURE__ */ jsx16("span", {
|
|
5487
|
+
className: "text-[10px] px-1.5 py-0.5 bg-green-600/20 text-green-400 rounded",
|
|
5488
|
+
children: "Tools"
|
|
5489
|
+
}),
|
|
5490
|
+
modelItem.reasoningText && /* @__PURE__ */ jsx16("span", {
|
|
5491
|
+
className: "text-[10px] px-1.5 py-0.5 bg-purple-600/20 text-purple-400 rounded",
|
|
5492
|
+
children: "Reasoning"
|
|
5493
|
+
})
|
|
5494
|
+
]
|
|
5495
|
+
})
|
|
5496
|
+
]
|
|
5497
|
+
}, modelItem.id);
|
|
5498
|
+
}) : /* @__PURE__ */ jsx16("div", {
|
|
5499
|
+
className: "px-4 py-2 text-sm text-[hsl(var(--muted-foreground))]",
|
|
5500
|
+
children: "No models available"
|
|
5501
|
+
})
|
|
5388
5502
|
})
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
}
|
|
5503
|
+
]
|
|
5504
|
+
}, providerKey);
|
|
5505
|
+
})
|
|
5392
5506
|
})
|
|
5393
5507
|
]
|
|
5394
5508
|
})
|
|
@@ -6747,6 +6861,12 @@ function getLanguageFromPath2(path) {
|
|
|
6747
6861
|
};
|
|
6748
6862
|
return langMap[ext || ""] || "javascript";
|
|
6749
6863
|
}
|
|
6864
|
+
function normalizeToolName(toolName) {
|
|
6865
|
+
return toolName === "bash" ? "shell" : toolName;
|
|
6866
|
+
}
|
|
6867
|
+
function isShellTool(toolName) {
|
|
6868
|
+
return normalizeToolName(toolName) === "shell";
|
|
6869
|
+
}
|
|
6750
6870
|
function normalizeToolTarget(toolName, args) {
|
|
6751
6871
|
if (!args)
|
|
6752
6872
|
return null;
|
|
@@ -6759,6 +6879,7 @@ function normalizeToolTarget(toolName, args) {
|
|
|
6759
6879
|
glob: ["pattern"],
|
|
6760
6880
|
grep: ["query", "pattern"],
|
|
6761
6881
|
ripgrep: ["query", "pattern"],
|
|
6882
|
+
shell: ["cmd", "command"],
|
|
6762
6883
|
bash: ["cmd", "command"],
|
|
6763
6884
|
terminal: ["command"],
|
|
6764
6885
|
git_commit: ["message"],
|
|
@@ -6802,9 +6923,10 @@ var ToolApprovalCard = memo7(function ToolApprovalCard2({
|
|
|
6802
6923
|
onReject
|
|
6803
6924
|
}) {
|
|
6804
6925
|
const [isProcessing, setIsProcessing] = useState16(false);
|
|
6805
|
-
const
|
|
6806
|
-
const
|
|
6807
|
-
const
|
|
6926
|
+
const normalizedToolName = normalizeToolName(toolName);
|
|
6927
|
+
const toolLabel = normalizedToolName.replace(/_/g, " ");
|
|
6928
|
+
const primary = normalizeToolTarget(normalizedToolName, args);
|
|
6929
|
+
const command = isShellTool(normalizedToolName) ? getPrimaryCommand(args) : null;
|
|
6808
6930
|
const approvalTarget = command || primary?.value;
|
|
6809
6931
|
const filePath = typeof args?.path === "string" ? args.path : "";
|
|
6810
6932
|
const language = getLanguageFromPath2(filePath);
|
|
@@ -6867,7 +6989,7 @@ var ToolApprovalCard = memo7(function ToolApprovalCard2({
|
|
|
6867
6989
|
children: toolName === "multiedit" ? "Multiple exact replacements will be applied atomically." : "An exact text replacement will be applied to this file."
|
|
6868
6990
|
});
|
|
6869
6991
|
}
|
|
6870
|
-
if (
|
|
6992
|
+
if (isShellTool(normalizedToolName) && args?.cmd) {
|
|
6871
6993
|
const cmd = String(args.cmd);
|
|
6872
6994
|
return /* @__PURE__ */ jsx24("div", {
|
|
6873
6995
|
className: "ml-6 max-w-full overflow-hidden",
|
|
@@ -6905,7 +7027,7 @@ var ToolApprovalCard = memo7(function ToolApprovalCard2({
|
|
|
6905
7027
|
className: "font-medium text-foreground text-sm",
|
|
6906
7028
|
children: toolLabel
|
|
6907
7029
|
}),
|
|
6908
|
-
approvalTarget &&
|
|
7030
|
+
approvalTarget && !isShellTool(normalizedToolName) && /* @__PURE__ */ jsx24("code", {
|
|
6909
7031
|
className: "text-xs font-mono text-foreground/80 bg-muted/50 px-1.5 py-0.5 rounded truncate max-w-xs",
|
|
6910
7032
|
children: approvalTarget
|
|
6911
7033
|
}),
|
|
@@ -7597,7 +7719,7 @@ function BashRenderer({
|
|
|
7597
7719
|
className: "text-xs",
|
|
7598
7720
|
children: [
|
|
7599
7721
|
/* @__PURE__ */ jsxs25(ToolHeader, {
|
|
7600
|
-
toolName: "
|
|
7722
|
+
toolName: "shell",
|
|
7601
7723
|
isExpanded,
|
|
7602
7724
|
onToggle,
|
|
7603
7725
|
isError,
|
|
@@ -10878,7 +11000,9 @@ var TOOL_NAME_ALIASES = {
|
|
|
10878
11000
|
Pwd: "pwd",
|
|
10879
11001
|
Glob: "glob",
|
|
10880
11002
|
Grep: "ripgrep",
|
|
10881
|
-
|
|
11003
|
+
Shell: "shell",
|
|
11004
|
+
Bash: "shell",
|
|
11005
|
+
bash: "shell",
|
|
10882
11006
|
Terminal: "terminal",
|
|
10883
11007
|
GitStatus: "git_status",
|
|
10884
11008
|
GitDiff: "git_diff",
|
|
@@ -10892,11 +11016,11 @@ var TOOL_NAME_ALIASES = {
|
|
|
10892
11016
|
LoadMcpTools: "load_mcp_tools",
|
|
10893
11017
|
Skill: "skill"
|
|
10894
11018
|
};
|
|
10895
|
-
function
|
|
11019
|
+
function normalizeToolName2(name) {
|
|
10896
11020
|
return TOOL_NAME_ALIASES[name] ?? name;
|
|
10897
11021
|
}
|
|
10898
11022
|
var COMPACT_DETAIL_TOOL_NAMES = new Set([
|
|
10899
|
-
"
|
|
11023
|
+
"shell",
|
|
10900
11024
|
"edit",
|
|
10901
11025
|
"multiedit",
|
|
10902
11026
|
"write",
|
|
@@ -10915,7 +11039,7 @@ function ToolResultRenderer({
|
|
|
10915
11039
|
onCompact
|
|
10916
11040
|
}) {
|
|
10917
11041
|
const [isExpanded, setIsExpanded] = useState22(false);
|
|
10918
|
-
const normalizedName =
|
|
11042
|
+
const normalizedName = normalizeToolName2(toolName);
|
|
10919
11043
|
const rendererCompact = compact && !COMPACT_DETAIL_TOOL_NAMES.has(normalizedName);
|
|
10920
11044
|
const handleToggle = () => setIsExpanded(!isExpanded);
|
|
10921
11045
|
const props = {
|
|
@@ -10946,7 +11070,7 @@ function ToolResultRenderer({
|
|
|
10946
11070
|
return /* @__PURE__ */ jsx53(WriteRenderer, {
|
|
10947
11071
|
...props
|
|
10948
11072
|
});
|
|
10949
|
-
case "
|
|
11073
|
+
case "shell":
|
|
10950
11074
|
return /* @__PURE__ */ jsx53(BashRenderer, {
|
|
10951
11075
|
...props
|
|
10952
11076
|
});
|
|
@@ -11085,6 +11209,12 @@ function getPatchedFileFromPatch(patch) {
|
|
|
11085
11209
|
const match = patch.match(/^\*\*\*\s+(?:Update|Add|Delete|Replace in):\s+(.+)$/m);
|
|
11086
11210
|
return match?.[1]?.trim() || null;
|
|
11087
11211
|
}
|
|
11212
|
+
function normalizeToolName3(toolName) {
|
|
11213
|
+
return toolName === "bash" ? "shell" : toolName;
|
|
11214
|
+
}
|
|
11215
|
+
function isShellTool2(toolName) {
|
|
11216
|
+
return normalizeToolName3(toolName) === "shell";
|
|
11217
|
+
}
|
|
11088
11218
|
function normalizeToolTarget2(toolName, args) {
|
|
11089
11219
|
if (!args)
|
|
11090
11220
|
return null;
|
|
@@ -11104,7 +11234,7 @@ function normalizeToolTarget2(toolName, args) {
|
|
|
11104
11234
|
return { key, value: value.trim() };
|
|
11105
11235
|
}
|
|
11106
11236
|
}
|
|
11107
|
-
if (toolName
|
|
11237
|
+
if (isShellTool2(toolName)) {
|
|
11108
11238
|
const command = args.command;
|
|
11109
11239
|
if (typeof command === "string" && command.trim().length > 0) {
|
|
11110
11240
|
return { key: "command", value: command.trim() };
|
|
@@ -11239,7 +11369,7 @@ var MessagePartItem = memo8(function MessagePartItem2({
|
|
|
11239
11369
|
return /* @__PURE__ */ jsx54(FolderTree2, {
|
|
11240
11370
|
className: "h-4 w-4 text-cyan-600 dark:text-cyan-300"
|
|
11241
11371
|
});
|
|
11242
|
-
if (toolName
|
|
11372
|
+
if (isShellTool2(toolName))
|
|
11243
11373
|
return /* @__PURE__ */ jsx54(Terminal5, {
|
|
11244
11374
|
className: "h-4 w-4 text-muted-foreground"
|
|
11245
11375
|
});
|
|
@@ -11455,13 +11585,14 @@ var MessagePartItem = memo8(function MessagePartItem2({
|
|
|
11455
11585
|
if (part.type === "tool_call") {
|
|
11456
11586
|
const payload = getToolCallPayload(part);
|
|
11457
11587
|
const rawToolName = part.toolName || (typeof payload?.name === "string" ? payload.name : "tool");
|
|
11458
|
-
const
|
|
11588
|
+
const normalizedToolName = normalizeToolName3(rawToolName);
|
|
11589
|
+
const toolLabel = normalizedToolName.includes("__") ? normalizedToolName.replace("__", " › ") : normalizedToolName.replace(/_/g, " ");
|
|
11459
11590
|
const partArgs = getToolCallArgs(part);
|
|
11460
11591
|
const approvalArgs = pendingApproval?.args;
|
|
11461
11592
|
const args = partArgs || approvalArgs;
|
|
11462
|
-
const primary = normalizeToolTarget2(
|
|
11593
|
+
const primary = normalizeToolTarget2(normalizedToolName, args);
|
|
11463
11594
|
const argsPreview = formatArgsPreview(args, primary?.key);
|
|
11464
|
-
const command =
|
|
11595
|
+
const command = isShellTool2(normalizedToolName) ? getPrimaryCommand2(args) : null;
|
|
11465
11596
|
const segments = [];
|
|
11466
11597
|
if (command) {
|
|
11467
11598
|
segments.push({
|
|
@@ -12125,6 +12256,7 @@ function getPatchTarget(patch) {
|
|
|
12125
12256
|
return match?.[1]?.trim() || null;
|
|
12126
12257
|
}
|
|
12127
12258
|
var TOOL_CONFIG = {
|
|
12259
|
+
shell: { Icon: Terminal6, color: "text-muted-foreground", label: "Running" },
|
|
12128
12260
|
bash: { Icon: Terminal6, color: "text-muted-foreground", label: "Running" },
|
|
12129
12261
|
write: {
|
|
12130
12262
|
Icon: FileEdit3,
|
|
@@ -12152,10 +12284,16 @@ var TOOL_CONFIG = {
|
|
|
12152
12284
|
label: "Terminal"
|
|
12153
12285
|
}
|
|
12154
12286
|
};
|
|
12287
|
+
function normalizeToolName4(toolName) {
|
|
12288
|
+
return toolName === "bash" ? "shell" : toolName;
|
|
12289
|
+
}
|
|
12290
|
+
function isShellTool3(toolName) {
|
|
12291
|
+
return normalizeToolName4(toolName) === "shell";
|
|
12292
|
+
}
|
|
12155
12293
|
function getTargetFromArgs(toolName, args) {
|
|
12156
12294
|
if (!args)
|
|
12157
12295
|
return "";
|
|
12158
|
-
if (toolName
|
|
12296
|
+
if (isShellTool3(toolName)) {
|
|
12159
12297
|
const cmd = String(args.cmd || "");
|
|
12160
12298
|
return cmd.length > 80 ? `${cmd.slice(0, 77)}…` : cmd;
|
|
12161
12299
|
}
|
|
@@ -12170,7 +12308,7 @@ function getTargetFromArgs(toolName, args) {
|
|
|
12170
12308
|
return "";
|
|
12171
12309
|
}
|
|
12172
12310
|
function getTargetFromStream(toolName, raw) {
|
|
12173
|
-
if (toolName
|
|
12311
|
+
if (isShellTool3(toolName)) {
|
|
12174
12312
|
const cmd = extractJsonStringField(raw, "cmd");
|
|
12175
12313
|
if (cmd) {
|
|
12176
12314
|
return cmd.length > 80 ? `${cmd.slice(0, 77)}…` : cmd;
|
|
@@ -12206,7 +12344,7 @@ function ActionToolBox({ part, showLine }) {
|
|
|
12206
12344
|
const hoveredRef = useRef11(false);
|
|
12207
12345
|
const previousContentLengthRef = useRef11(0);
|
|
12208
12346
|
const [contentHeight, setContentHeight] = useState24(0);
|
|
12209
|
-
const toolName = part.toolName || "";
|
|
12347
|
+
const toolName = normalizeToolName4(part.toolName || "");
|
|
12210
12348
|
const isComplete = part.type === "tool_result";
|
|
12211
12349
|
const config2 = TOOL_CONFIG[toolName] || {
|
|
12212
12350
|
Icon: Terminal6,
|
|
@@ -12220,7 +12358,7 @@ function ActionToolBox({ part, showLine }) {
|
|
|
12220
12358
|
const streamedOutput = getStreamedOutput(part);
|
|
12221
12359
|
const target = getTargetFromArgs(toolName, args) || getTargetFromStream(toolName, streamedInput);
|
|
12222
12360
|
const streamedContent = getContentFromStream(toolName, streamedInput);
|
|
12223
|
-
const displayContent = toolName
|
|
12361
|
+
const displayContent = isShellTool3(toolName) ? streamedOutput || streamedContent || (args ? getContentFromArgs(toolName, args) : "") : args ? getContentFromArgs(toolName, args) : streamedContent;
|
|
12224
12362
|
const hasDisplayContent = displayContent.trim().length > 0;
|
|
12225
12363
|
useEffect18(() => {
|
|
12226
12364
|
if (!isComplete && !latched) {
|
|
@@ -12243,7 +12381,7 @@ function ActionToolBox({ part, showLine }) {
|
|
|
12243
12381
|
return;
|
|
12244
12382
|
}
|
|
12245
12383
|
const el = contentMeasureRef.current;
|
|
12246
|
-
if (!el)
|
|
12384
|
+
if (!el || el.textContent !== displayContent)
|
|
12247
12385
|
return;
|
|
12248
12386
|
const nextHeight = Math.min(el.scrollHeight, MAX_SCROLL_H2 - 12);
|
|
12249
12387
|
setContentHeight((prev) => prev === nextHeight ? prev : nextHeight);
|
|
@@ -12375,9 +12513,10 @@ function ActionToolBox({ part, showLine }) {
|
|
|
12375
12513
|
},
|
|
12376
12514
|
children: displayContent && /* @__PURE__ */ jsx56("div", {
|
|
12377
12515
|
className: "pt-1.5",
|
|
12378
|
-
children: /* @__PURE__ */ jsx56("
|
|
12516
|
+
children: /* @__PURE__ */ jsx56("section", {
|
|
12379
12517
|
ref: scrollRef,
|
|
12380
12518
|
className: "overflow-y-auto",
|
|
12519
|
+
"aria-label": `${config2.label} content`,
|
|
12381
12520
|
style: {
|
|
12382
12521
|
height: `${contentHeight}px`,
|
|
12383
12522
|
maskImage: "linear-gradient(to bottom, transparent 0px, black 20px)",
|
|
@@ -12432,7 +12571,7 @@ function ActionToolBox({ part, showLine }) {
|
|
|
12432
12571
|
});
|
|
12433
12572
|
}
|
|
12434
12573
|
function getContentFromArgs(toolName, args) {
|
|
12435
|
-
if (toolName
|
|
12574
|
+
if (isShellTool3(toolName))
|
|
12436
12575
|
return String(args.cmd || "");
|
|
12437
12576
|
if (toolName === "write")
|
|
12438
12577
|
return String(args.content || "");
|
|
@@ -12479,7 +12618,7 @@ function extractJsonStringField(raw, field) {
|
|
|
12479
12618
|
function getContentFromStream(toolName, raw) {
|
|
12480
12619
|
if (!raw)
|
|
12481
12620
|
return "";
|
|
12482
|
-
if (toolName
|
|
12621
|
+
if (isShellTool3(toolName))
|
|
12483
12622
|
return extractJsonStringField(raw, "cmd");
|
|
12484
12623
|
if (toolName === "write")
|
|
12485
12624
|
return extractJsonStringField(raw, "content");
|
|
@@ -12842,6 +12981,7 @@ var AssistantMessageGroup = memo9(function AssistantMessageGroup2({
|
|
|
12842
12981
|
const latestProgressUpdateIndex = parts.reduce((lastIndex, part, index) => part.type === "tool_result" && part.toolName === "progress_update" ? index : lastIndex, -1);
|
|
12843
12982
|
const latestProgressUpdatePart = latestProgressUpdateIndex >= 0 ? parts[latestProgressUpdateIndex] : null;
|
|
12844
12983
|
const liveActionToolCallIds = new Set(parts.filter((part) => part.ephemeral && [
|
|
12984
|
+
"shell",
|
|
12845
12985
|
"bash",
|
|
12846
12986
|
"edit",
|
|
12847
12987
|
"multiedit",
|
|
@@ -13042,6 +13182,7 @@ var AssistantMessageGroup = memo9(function AssistantMessageGroup2({
|
|
|
13042
13182
|
const { part, index } = item;
|
|
13043
13183
|
const isLastPart = index === parts.length - 1;
|
|
13044
13184
|
const isActionTool = part.ephemeral && (part.type === "tool_call" || part.type === "tool_result") && [
|
|
13185
|
+
"shell",
|
|
13045
13186
|
"bash",
|
|
13046
13187
|
"edit",
|
|
13047
13188
|
"multiedit",
|
|
@@ -14132,7 +14273,7 @@ function useProviderUsage(provider, authType) {
|
|
|
14132
14273
|
const fetchRef = useRef13(fetchUsage);
|
|
14133
14274
|
fetchRef.current = fetchUsage;
|
|
14134
14275
|
useEffect20(() => {
|
|
14135
|
-
if (!isOAuthProvider)
|
|
14276
|
+
if (!provider || !isOAuthProvider)
|
|
14136
14277
|
return;
|
|
14137
14278
|
fetchRef.current();
|
|
14138
14279
|
const interval = setInterval(() => fetchRef.current(), POLL_INTERVAL);
|
|
@@ -18432,7 +18573,7 @@ var GitDiffPanel = memo22(function GitDiffPanel2() {
|
|
|
18432
18573
|
};
|
|
18433
18574
|
document.addEventListener("keydown", handleEscape);
|
|
18434
18575
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
18435
|
-
}, [isDiffOpen, closeDiff
|
|
18576
|
+
}, [isDiffOpen, closeDiff]);
|
|
18436
18577
|
if (!isDiffOpen || !selectedFile)
|
|
18437
18578
|
return null;
|
|
18438
18579
|
return /* @__PURE__ */ jsxs69("div", {
|
|
@@ -22610,7 +22751,7 @@ var TunnelSidebarToggle = memo34(function TunnelSidebarToggle2() {
|
|
|
22610
22751
|
});
|
|
22611
22752
|
});
|
|
22612
22753
|
// src/components/mcp/MCPSidebar.tsx
|
|
22613
|
-
import { memo as
|
|
22754
|
+
import { memo as memo37, useState as useState42, useCallback as useCallback31, useMemo as useMemo23, useEffect as useEffect41, useRef as useRef29 } from "react";
|
|
22614
22755
|
import {
|
|
22615
22756
|
ChevronDown as ChevronDown10,
|
|
22616
22757
|
ChevronRight as ChevronRight15,
|
|
@@ -22619,7 +22760,7 @@ import {
|
|
|
22619
22760
|
FolderDot as FolderDot2,
|
|
22620
22761
|
Globe as Globe6,
|
|
22621
22762
|
Laptop as Laptop2,
|
|
22622
|
-
Loader2 as
|
|
22763
|
+
Loader2 as Loader214,
|
|
22623
22764
|
Lock,
|
|
22624
22765
|
Plug as Plug4,
|
|
22625
22766
|
Plus as Plus7,
|
|
@@ -23237,8 +23378,10 @@ API_KEY=sk-xxx`,
|
|
|
23237
23378
|
});
|
|
23238
23379
|
});
|
|
23239
23380
|
|
|
23240
|
-
// src/components/
|
|
23241
|
-
import {
|
|
23381
|
+
// src/components/ui/ToggleSwitch.tsx
|
|
23382
|
+
import { memo as memo36 } from "react";
|
|
23383
|
+
import { Loader2 as Loader213 } from "lucide-react";
|
|
23384
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
23242
23385
|
var ToggleSwitch = memo36(function ToggleSwitch2({
|
|
23243
23386
|
checked,
|
|
23244
23387
|
loading,
|
|
@@ -23250,20 +23393,23 @@ var ToggleSwitch = memo36(function ToggleSwitch2({
|
|
|
23250
23393
|
role: "switch",
|
|
23251
23394
|
"aria-checked": checked,
|
|
23252
23395
|
disabled: disabled || loading,
|
|
23253
|
-
onClick: (
|
|
23254
|
-
|
|
23396
|
+
onClick: (event) => {
|
|
23397
|
+
event.stopPropagation();
|
|
23255
23398
|
onChange();
|
|
23256
23399
|
},
|
|
23257
23400
|
className: `relative inline-flex h-5 w-9 flex-shrink-0 items-center rounded-full transition-colors duration-200 focus-visible:outline-none disabled:opacity-50 disabled:cursor-not-allowed ${checked ? "bg-green-500" : "bg-muted-foreground/30"}`,
|
|
23258
23401
|
children: /* @__PURE__ */ jsx93("span", {
|
|
23259
23402
|
className: `inline-block h-3.5 w-3.5 rounded-full transition-transform duration-200 ${checked ? "translate-x-[18px]" : "translate-x-[3px]"} ${loading ? "bg-transparent" : "bg-white"}`,
|
|
23260
|
-
children: loading
|
|
23403
|
+
children: loading ? /* @__PURE__ */ jsx93(Loader213, {
|
|
23261
23404
|
className: "w-3.5 h-3.5 animate-spin text-white"
|
|
23262
|
-
})
|
|
23405
|
+
}) : null
|
|
23263
23406
|
})
|
|
23264
23407
|
});
|
|
23265
23408
|
});
|
|
23266
|
-
|
|
23409
|
+
|
|
23410
|
+
// src/components/mcp/MCPSidebar.tsx
|
|
23411
|
+
import { jsx as jsx94, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
23412
|
+
var CopilotDeviceAuth = memo37(function CopilotDeviceAuth2({
|
|
23267
23413
|
userCode,
|
|
23268
23414
|
verificationUri
|
|
23269
23415
|
}) {
|
|
@@ -23274,7 +23420,7 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23274
23420
|
setTimeout(() => setCopied(false), 2000);
|
|
23275
23421
|
});
|
|
23276
23422
|
}, [userCode]);
|
|
23277
|
-
return /* @__PURE__ */
|
|
23423
|
+
return /* @__PURE__ */ jsx94("div", {
|
|
23278
23424
|
className: "px-3 pb-2.5 pt-0",
|
|
23279
23425
|
children: /* @__PURE__ */ jsxs84("div", {
|
|
23280
23426
|
className: "rounded-md bg-yellow-500/10 border border-yellow-500/20 p-2 space-y-1.5",
|
|
@@ -23282,10 +23428,10 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23282
23428
|
/* @__PURE__ */ jsxs84("div", {
|
|
23283
23429
|
className: "flex items-center gap-1.5 text-xs",
|
|
23284
23430
|
children: [
|
|
23285
|
-
/* @__PURE__ */
|
|
23431
|
+
/* @__PURE__ */ jsx94(Loader214, {
|
|
23286
23432
|
className: "w-3 h-3 animate-spin text-yellow-500 flex-shrink-0"
|
|
23287
23433
|
}),
|
|
23288
|
-
/* @__PURE__ */
|
|
23434
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23289
23435
|
className: "text-yellow-500/80",
|
|
23290
23436
|
children: "Enter code at GitHub:"
|
|
23291
23437
|
})
|
|
@@ -23294,20 +23440,20 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23294
23440
|
/* @__PURE__ */ jsxs84("div", {
|
|
23295
23441
|
className: "flex items-center gap-2",
|
|
23296
23442
|
children: [
|
|
23297
|
-
/* @__PURE__ */
|
|
23443
|
+
/* @__PURE__ */ jsx94("code", {
|
|
23298
23444
|
className: "text-sm font-mono font-bold text-yellow-400 tracking-wider",
|
|
23299
23445
|
children: userCode
|
|
23300
23446
|
}),
|
|
23301
|
-
/* @__PURE__ */
|
|
23447
|
+
/* @__PURE__ */ jsx94("button", {
|
|
23302
23448
|
type: "button",
|
|
23303
23449
|
onClick: handleCopy,
|
|
23304
23450
|
className: "text-yellow-500/60 hover:text-yellow-400 transition-colors",
|
|
23305
23451
|
title: "Copy code",
|
|
23306
|
-
children: /* @__PURE__ */
|
|
23452
|
+
children: /* @__PURE__ */ jsx94(ClipboardCopy, {
|
|
23307
23453
|
className: "w-3.5 h-3.5"
|
|
23308
23454
|
})
|
|
23309
23455
|
}),
|
|
23310
|
-
copied && /* @__PURE__ */
|
|
23456
|
+
copied && /* @__PURE__ */ jsx94("span", {
|
|
23311
23457
|
className: "text-xs text-green-400",
|
|
23312
23458
|
children: "Copied!"
|
|
23313
23459
|
})
|
|
@@ -23324,7 +23470,7 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23324
23470
|
className: "inline-flex items-center gap-1 text-xs text-yellow-400 hover:text-yellow-300 underline underline-offset-2",
|
|
23325
23471
|
children: [
|
|
23326
23472
|
"Open GitHub login",
|
|
23327
|
-
/* @__PURE__ */
|
|
23473
|
+
/* @__PURE__ */ jsx94(ExternalLink9, {
|
|
23328
23474
|
className: "w-3 h-3"
|
|
23329
23475
|
})
|
|
23330
23476
|
]
|
|
@@ -23333,7 +23479,7 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23333
23479
|
})
|
|
23334
23480
|
});
|
|
23335
23481
|
});
|
|
23336
|
-
var MCPServerCard =
|
|
23482
|
+
var MCPServerCard = memo37(function MCPServerCard2({
|
|
23337
23483
|
server,
|
|
23338
23484
|
isLoading,
|
|
23339
23485
|
authUrl,
|
|
@@ -23366,7 +23512,7 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23366
23512
|
/* @__PURE__ */ jsxs84("div", {
|
|
23367
23513
|
className: "flex items-center gap-3 px-3 py-2.5",
|
|
23368
23514
|
children: [
|
|
23369
|
-
/* @__PURE__ */
|
|
23515
|
+
/* @__PURE__ */ jsx94(ToggleSwitch, {
|
|
23370
23516
|
checked: server.connected,
|
|
23371
23517
|
loading: isLoading || isAwaitingAuth,
|
|
23372
23518
|
onChange: handleToggle
|
|
@@ -23377,14 +23523,14 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23377
23523
|
/* @__PURE__ */ jsxs84("div", {
|
|
23378
23524
|
className: "flex items-center gap-1.5",
|
|
23379
23525
|
children: [
|
|
23380
|
-
/* @__PURE__ */
|
|
23526
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23381
23527
|
className: "text-sm font-medium truncate",
|
|
23382
23528
|
children: server.name
|
|
23383
23529
|
}),
|
|
23384
|
-
isRemote && /* @__PURE__ */
|
|
23530
|
+
isRemote && /* @__PURE__ */ jsx94(Globe6, {
|
|
23385
23531
|
className: "w-3 h-3 text-muted-foreground flex-shrink-0"
|
|
23386
23532
|
}),
|
|
23387
|
-
server.authRequired && !server.connected && /* @__PURE__ */
|
|
23533
|
+
server.authRequired && !server.connected && /* @__PURE__ */ jsx94(Lock, {
|
|
23388
23534
|
className: "w-3 h-3 text-yellow-500 flex-shrink-0"
|
|
23389
23535
|
})
|
|
23390
23536
|
]
|
|
@@ -23392,16 +23538,16 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23392
23538
|
/* @__PURE__ */ jsxs84("div", {
|
|
23393
23539
|
className: "flex items-center gap-1.5 mt-0.5",
|
|
23394
23540
|
children: [
|
|
23395
|
-
/* @__PURE__ */
|
|
23541
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23396
23542
|
className: "text-xs text-muted-foreground truncate",
|
|
23397
23543
|
children: isRemote ? server.url : `${server.command ?? ""} ${server.args.join(" ")}`
|
|
23398
23544
|
}),
|
|
23399
|
-
/* @__PURE__ */
|
|
23545
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23400
23546
|
className: "flex items-center flex-shrink-0 opacity-50",
|
|
23401
23547
|
title: server.scope === "project" ? "Project-local" : "Global",
|
|
23402
|
-
children: server.scope === "project" ? /* @__PURE__ */
|
|
23548
|
+
children: server.scope === "project" ? /* @__PURE__ */ jsx94(FolderDot2, {
|
|
23403
23549
|
className: "w-3 h-3"
|
|
23404
|
-
}) : /* @__PURE__ */
|
|
23550
|
+
}) : /* @__PURE__ */ jsx94(Laptop2, {
|
|
23405
23551
|
className: "w-3 h-3"
|
|
23406
23552
|
})
|
|
23407
23553
|
})
|
|
@@ -23417,24 +23563,24 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23417
23563
|
onClick: toggleTools,
|
|
23418
23564
|
className: "flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground px-1.5 py-1 rounded transition-colors",
|
|
23419
23565
|
children: [
|
|
23420
|
-
/* @__PURE__ */
|
|
23566
|
+
/* @__PURE__ */ jsx94(Wrench, {
|
|
23421
23567
|
className: "w-3 h-3"
|
|
23422
23568
|
}),
|
|
23423
23569
|
server.tools.length,
|
|
23424
|
-
showTools ? /* @__PURE__ */
|
|
23570
|
+
showTools ? /* @__PURE__ */ jsx94(ChevronDown10, {
|
|
23425
23571
|
className: "w-3 h-3"
|
|
23426
|
-
}) : /* @__PURE__ */
|
|
23572
|
+
}) : /* @__PURE__ */ jsx94(ChevronRight15, {
|
|
23427
23573
|
className: "w-3 h-3"
|
|
23428
23574
|
})
|
|
23429
23575
|
]
|
|
23430
23576
|
}),
|
|
23431
|
-
/* @__PURE__ */
|
|
23577
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23432
23578
|
variant: "ghost",
|
|
23433
23579
|
size: "icon",
|
|
23434
23580
|
onClick: onRemove,
|
|
23435
23581
|
title: "Remove server",
|
|
23436
23582
|
className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
23437
|
-
children: /* @__PURE__ */
|
|
23583
|
+
children: /* @__PURE__ */ jsx94(Trash25, {
|
|
23438
23584
|
className: "w-3 h-3 text-muted-foreground hover:text-red-400"
|
|
23439
23585
|
})
|
|
23440
23586
|
})
|
|
@@ -23442,19 +23588,19 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23442
23588
|
})
|
|
23443
23589
|
]
|
|
23444
23590
|
}),
|
|
23445
|
-
copilotDevice && !server.connected && /* @__PURE__ */
|
|
23591
|
+
copilotDevice && !server.connected && /* @__PURE__ */ jsx94(CopilotDeviceAuth, {
|
|
23446
23592
|
userCode: copilotDevice.userCode,
|
|
23447
23593
|
verificationUri: copilotDevice.verificationUri
|
|
23448
23594
|
}),
|
|
23449
|
-
!copilotDevice && isAwaitingAuth && authUrl && /* @__PURE__ */
|
|
23595
|
+
!copilotDevice && isAwaitingAuth && authUrl && /* @__PURE__ */ jsx94("div", {
|
|
23450
23596
|
className: "px-3 pb-2.5 pt-0",
|
|
23451
23597
|
children: /* @__PURE__ */ jsxs84("div", {
|
|
23452
23598
|
className: "flex items-center gap-1.5 text-xs",
|
|
23453
23599
|
children: [
|
|
23454
|
-
/* @__PURE__ */
|
|
23600
|
+
/* @__PURE__ */ jsx94(Loader214, {
|
|
23455
23601
|
className: "w-3 h-3 animate-spin text-yellow-500 flex-shrink-0"
|
|
23456
23602
|
}),
|
|
23457
|
-
/* @__PURE__ */
|
|
23603
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23458
23604
|
className: "text-yellow-500/80",
|
|
23459
23605
|
children: "Waiting for auth..."
|
|
23460
23606
|
}),
|
|
@@ -23469,7 +23615,7 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23469
23615
|
className: "inline-flex items-center gap-0.5 text-yellow-400 hover:text-yellow-300 underline underline-offset-2",
|
|
23470
23616
|
children: [
|
|
23471
23617
|
"Open login",
|
|
23472
|
-
/* @__PURE__ */
|
|
23618
|
+
/* @__PURE__ */ jsx94(ExternalLink9, {
|
|
23473
23619
|
className: "w-3 h-3"
|
|
23474
23620
|
})
|
|
23475
23621
|
]
|
|
@@ -23477,11 +23623,11 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23477
23623
|
]
|
|
23478
23624
|
})
|
|
23479
23625
|
}),
|
|
23480
|
-
hasTools && showTools && /* @__PURE__ */
|
|
23626
|
+
hasTools && showTools && /* @__PURE__ */ jsx94("div", {
|
|
23481
23627
|
className: "px-3 pb-2.5 pt-0",
|
|
23482
|
-
children: /* @__PURE__ */
|
|
23628
|
+
children: /* @__PURE__ */ jsx94("div", {
|
|
23483
23629
|
className: "flex flex-wrap gap-1",
|
|
23484
|
-
children: server.tools.map((tool) => /* @__PURE__ */
|
|
23630
|
+
children: server.tools.map((tool) => /* @__PURE__ */ jsx94("span", {
|
|
23485
23631
|
className: "text-xs bg-muted px-1.5 py-0.5 rounded",
|
|
23486
23632
|
title: tool,
|
|
23487
23633
|
children: tool.split("__").pop()
|
|
@@ -23501,7 +23647,7 @@ function useAuthPoller(name, onAuthenticated) {
|
|
|
23501
23647
|
prevAuth.current = data?.authenticated ?? false;
|
|
23502
23648
|
}, [data?.authenticated, onAuthenticated]);
|
|
23503
23649
|
}
|
|
23504
|
-
var MCPSidebar =
|
|
23650
|
+
var MCPSidebar = memo37(function MCPSidebar2() {
|
|
23505
23651
|
const isExpanded = useMCPStore((s) => s.isExpanded);
|
|
23506
23652
|
const collapseSidebar = useMCPStore((s) => s.collapseSidebar);
|
|
23507
23653
|
const servers = useMCPStore((s) => s.servers);
|
|
@@ -23616,10 +23762,10 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23616
23762
|
/* @__PURE__ */ jsxs84("div", {
|
|
23617
23763
|
className: "flex items-center gap-2",
|
|
23618
23764
|
children: [
|
|
23619
|
-
/* @__PURE__ */
|
|
23765
|
+
/* @__PURE__ */ jsx94(Plug4, {
|
|
23620
23766
|
className: "w-4 h-4 text-muted-foreground"
|
|
23621
23767
|
}),
|
|
23622
|
-
/* @__PURE__ */
|
|
23768
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23623
23769
|
className: "font-medium text-sm",
|
|
23624
23770
|
children: "MCP Servers"
|
|
23625
23771
|
}),
|
|
@@ -23635,22 +23781,22 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23635
23781
|
/* @__PURE__ */ jsxs84("div", {
|
|
23636
23782
|
className: "flex items-center gap-1",
|
|
23637
23783
|
children: [
|
|
23638
|
-
/* @__PURE__ */
|
|
23784
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23639
23785
|
variant: "ghost",
|
|
23640
23786
|
size: "icon",
|
|
23641
23787
|
onClick: () => setIsAddModalOpen(true),
|
|
23642
23788
|
title: "Add MCP server",
|
|
23643
23789
|
className: "h-7 w-7",
|
|
23644
|
-
children: /* @__PURE__ */
|
|
23790
|
+
children: /* @__PURE__ */ jsx94(Plus7, {
|
|
23645
23791
|
className: "w-4 h-4"
|
|
23646
23792
|
})
|
|
23647
23793
|
}),
|
|
23648
|
-
/* @__PURE__ */
|
|
23794
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23649
23795
|
variant: "ghost",
|
|
23650
23796
|
size: "icon",
|
|
23651
23797
|
onClick: collapseSidebar,
|
|
23652
23798
|
title: "Close sidebar",
|
|
23653
|
-
children: /* @__PURE__ */
|
|
23799
|
+
children: /* @__PURE__ */ jsx94(ChevronRight15, {
|
|
23654
23800
|
className: "w-4 h-4"
|
|
23655
23801
|
})
|
|
23656
23802
|
})
|
|
@@ -23658,12 +23804,12 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23658
23804
|
})
|
|
23659
23805
|
]
|
|
23660
23806
|
}),
|
|
23661
|
-
/* @__PURE__ */
|
|
23807
|
+
/* @__PURE__ */ jsx94("div", {
|
|
23662
23808
|
className: "flex-1 overflow-y-auto",
|
|
23663
23809
|
children: isFetching && servers.length === 0 ? /* @__PURE__ */ jsxs84("div", {
|
|
23664
23810
|
className: "flex items-center justify-center h-32 text-muted-foreground",
|
|
23665
23811
|
children: [
|
|
23666
|
-
/* @__PURE__ */
|
|
23812
|
+
/* @__PURE__ */ jsx94(Loader214, {
|
|
23667
23813
|
className: "w-4 h-4 animate-spin mr-2"
|
|
23668
23814
|
}),
|
|
23669
23815
|
"Loading..."
|
|
@@ -23671,7 +23817,7 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23671
23817
|
}) : servers.length === 0 ? /* @__PURE__ */ jsxs84("div", {
|
|
23672
23818
|
className: "p-4 text-sm text-muted-foreground space-y-3",
|
|
23673
23819
|
children: [
|
|
23674
|
-
/* @__PURE__ */
|
|
23820
|
+
/* @__PURE__ */ jsx94("p", {
|
|
23675
23821
|
children: "No MCP servers configured."
|
|
23676
23822
|
}),
|
|
23677
23823
|
/* @__PURE__ */ jsxs84(Button, {
|
|
@@ -23680,7 +23826,7 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23680
23826
|
onClick: () => setIsAddModalOpen(true),
|
|
23681
23827
|
className: "w-full",
|
|
23682
23828
|
children: [
|
|
23683
|
-
/* @__PURE__ */
|
|
23829
|
+
/* @__PURE__ */ jsx94(Plus7, {
|
|
23684
23830
|
className: "w-3 h-3 mr-1"
|
|
23685
23831
|
}),
|
|
23686
23832
|
"Add MCP Server"
|
|
@@ -23691,16 +23837,16 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23691
23837
|
children: [
|
|
23692
23838
|
"Or add servers to",
|
|
23693
23839
|
" ",
|
|
23694
|
-
/* @__PURE__ */
|
|
23840
|
+
/* @__PURE__ */ jsx94("code", {
|
|
23695
23841
|
className: "bg-muted px-1 py-0.5 rounded text-xs",
|
|
23696
23842
|
children: ".otto/config.json"
|
|
23697
23843
|
})
|
|
23698
23844
|
]
|
|
23699
23845
|
})
|
|
23700
23846
|
]
|
|
23701
|
-
}) : /* @__PURE__ */
|
|
23847
|
+
}) : /* @__PURE__ */ jsx94("div", {
|
|
23702
23848
|
className: "p-2 space-y-1.5",
|
|
23703
|
-
children: sortedServers.map((server) => /* @__PURE__ */
|
|
23849
|
+
children: sortedServers.map((server) => /* @__PURE__ */ jsx94(MCPServerCard, {
|
|
23704
23850
|
server,
|
|
23705
23851
|
isLoading: loading.has(server.name),
|
|
23706
23852
|
authUrl: authUrls.get(server.name),
|
|
@@ -23712,7 +23858,7 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23712
23858
|
}, server.name))
|
|
23713
23859
|
})
|
|
23714
23860
|
}),
|
|
23715
|
-
/* @__PURE__ */
|
|
23861
|
+
/* @__PURE__ */ jsx94(AddMCPServerModal, {
|
|
23716
23862
|
isOpen: isAddModalOpen,
|
|
23717
23863
|
onClose: () => setIsAddModalOpen(false)
|
|
23718
23864
|
}),
|
|
@@ -23728,7 +23874,7 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23728
23874
|
children: [
|
|
23729
23875
|
"Are you sure you want to remove",
|
|
23730
23876
|
" ",
|
|
23731
|
-
/* @__PURE__ */
|
|
23877
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23732
23878
|
className: "font-medium text-foreground",
|
|
23733
23879
|
children: deleteTarget
|
|
23734
23880
|
}),
|
|
@@ -23738,13 +23884,13 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23738
23884
|
/* @__PURE__ */ jsxs84("div", {
|
|
23739
23885
|
className: "flex justify-end gap-2",
|
|
23740
23886
|
children: [
|
|
23741
|
-
/* @__PURE__ */
|
|
23887
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23742
23888
|
variant: "secondary",
|
|
23743
23889
|
size: "sm",
|
|
23744
23890
|
onClick: () => setDeleteTarget(null),
|
|
23745
23891
|
children: "Cancel"
|
|
23746
23892
|
}),
|
|
23747
|
-
/* @__PURE__ */
|
|
23893
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23748
23894
|
variant: "primary",
|
|
23749
23895
|
size: "sm",
|
|
23750
23896
|
className: "bg-red-500 hover:bg-red-600 text-white",
|
|
@@ -23764,10 +23910,10 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23764
23910
|
});
|
|
23765
23911
|
});
|
|
23766
23912
|
// src/components/mcp/MCPSidebarToggle.tsx
|
|
23767
|
-
import { memo as
|
|
23913
|
+
import { memo as memo38 } from "react";
|
|
23768
23914
|
import { Plug as Plug5 } from "lucide-react";
|
|
23769
|
-
import { jsx as
|
|
23770
|
-
var MCPSidebarToggle =
|
|
23915
|
+
import { jsx as jsx95, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
23916
|
+
var MCPSidebarToggle = memo38(function MCPSidebarToggle2() {
|
|
23771
23917
|
const isExpanded = useMCPStore((state) => state.isExpanded);
|
|
23772
23918
|
const toggleSidebar = useMCPStore((state) => state.toggleSidebar);
|
|
23773
23919
|
const servers = useMCPStore((state) => state.servers);
|
|
@@ -23778,21 +23924,21 @@ var MCPSidebarToggle = memo37(function MCPSidebarToggle2() {
|
|
|
23778
23924
|
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"}`,
|
|
23779
23925
|
title: "MCP Servers",
|
|
23780
23926
|
children: [
|
|
23781
|
-
/* @__PURE__ */
|
|
23927
|
+
/* @__PURE__ */ jsx95(Plug5, {
|
|
23782
23928
|
className: "w-5 h-5 text-muted-foreground mx-auto"
|
|
23783
23929
|
}),
|
|
23784
|
-
connectedCount > 0 && /* @__PURE__ */
|
|
23930
|
+
connectedCount > 0 && /* @__PURE__ */ jsx95("span", {
|
|
23785
23931
|
className: "absolute top-2 right-2 w-2 h-2 bg-green-500 rounded-full"
|
|
23786
23932
|
})
|
|
23787
23933
|
]
|
|
23788
23934
|
});
|
|
23789
23935
|
});
|
|
23790
23936
|
// src/components/skills/SkillsSidebar.tsx
|
|
23791
|
-
import { memo as
|
|
23937
|
+
import { memo as memo39, useMemo as useMemo24 } from "react";
|
|
23792
23938
|
import {
|
|
23793
23939
|
ChevronRight as ChevronRight16,
|
|
23794
23940
|
Sparkles as Sparkles6,
|
|
23795
|
-
Loader2 as
|
|
23941
|
+
Loader2 as Loader215,
|
|
23796
23942
|
FolderDot as FolderDot3,
|
|
23797
23943
|
Laptop as Laptop3,
|
|
23798
23944
|
Globe as Globe7,
|
|
@@ -23802,24 +23948,45 @@ import {
|
|
|
23802
23948
|
} from "lucide-react";
|
|
23803
23949
|
|
|
23804
23950
|
// src/hooks/useSkills.ts
|
|
23805
|
-
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
23951
|
+
import { useMutation as useMutation11, useQuery as useQuery14, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
|
|
23806
23952
|
import { useEffect as useEffect42 } from "react";
|
|
23807
23953
|
function useSkills() {
|
|
23808
|
-
const
|
|
23954
|
+
const setSkillsConfig = useSkillsStore((s) => s.setSkillsConfig);
|
|
23809
23955
|
const query = useQuery14({
|
|
23810
23956
|
queryKey: ["skills"],
|
|
23811
23957
|
queryFn: async () => {
|
|
23812
|
-
return apiClient.
|
|
23958
|
+
return apiClient.getSkillsConfig();
|
|
23813
23959
|
},
|
|
23814
23960
|
refetchInterval: 30000
|
|
23815
23961
|
});
|
|
23816
23962
|
useEffect42(() => {
|
|
23817
|
-
if (query.data?.
|
|
23818
|
-
|
|
23963
|
+
if (query.data?.items) {
|
|
23964
|
+
setSkillsConfig({
|
|
23965
|
+
skills: query.data.items,
|
|
23966
|
+
globalEnabled: query.data.enabled,
|
|
23967
|
+
totalCount: query.data.totalCount,
|
|
23968
|
+
enabledCount: query.data.enabledCount
|
|
23969
|
+
});
|
|
23819
23970
|
}
|
|
23820
|
-
}, [query.data,
|
|
23971
|
+
}, [query.data, setSkillsConfig]);
|
|
23821
23972
|
return query;
|
|
23822
23973
|
}
|
|
23974
|
+
function useUpdateSkillsConfig() {
|
|
23975
|
+
const queryClient = useQueryClient19();
|
|
23976
|
+
const setSkillsConfig = useSkillsStore((s) => s.setSkillsConfig);
|
|
23977
|
+
return useMutation11({
|
|
23978
|
+
mutationFn: (input) => apiClient.updateSkillsConfig(input),
|
|
23979
|
+
onSuccess: (data) => {
|
|
23980
|
+
setSkillsConfig({
|
|
23981
|
+
skills: data.items,
|
|
23982
|
+
globalEnabled: data.enabled,
|
|
23983
|
+
totalCount: data.totalCount,
|
|
23984
|
+
enabledCount: data.enabledCount
|
|
23985
|
+
});
|
|
23986
|
+
queryClient.setQueryData(["skills"], data);
|
|
23987
|
+
}
|
|
23988
|
+
});
|
|
23989
|
+
}
|
|
23823
23990
|
function useSkillDetail(name) {
|
|
23824
23991
|
return useQuery14({
|
|
23825
23992
|
queryKey: ["skills", name],
|
|
@@ -23855,7 +24022,7 @@ function useSkillFileContent(name, filePath) {
|
|
|
23855
24022
|
}
|
|
23856
24023
|
|
|
23857
24024
|
// src/components/skills/SkillsSidebar.tsx
|
|
23858
|
-
import { jsx as
|
|
24025
|
+
import { jsx as jsx96, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
23859
24026
|
var SCOPE_ICONS = {
|
|
23860
24027
|
cwd: FolderDot3,
|
|
23861
24028
|
parent: FolderDot3,
|
|
@@ -23877,15 +24044,19 @@ function formatSize(bytes) {
|
|
|
23877
24044
|
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
23878
24045
|
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
23879
24046
|
}
|
|
23880
|
-
var SkillsSidebar =
|
|
24047
|
+
var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
23881
24048
|
const isExpanded = useSkillsStore((s) => s.isExpanded);
|
|
23882
24049
|
const collapseSidebar = useSkillsStore((s) => s.collapseSidebar);
|
|
23883
24050
|
const skills = useSkillsStore((s) => s.skills);
|
|
24051
|
+
const globalEnabled = useSkillsStore((s) => s.globalEnabled);
|
|
24052
|
+
const totalCount = useSkillsStore((s) => s.totalCount);
|
|
24053
|
+
const enabledCount = useSkillsStore((s) => s.enabledCount);
|
|
23884
24054
|
const selectedSkill = useSkillsStore((s) => s.selectedSkill);
|
|
23885
24055
|
const selectSkill = useSkillsStore((s) => s.selectSkill);
|
|
23886
24056
|
const openViewer = useSkillsStore((s) => s.openViewer);
|
|
23887
24057
|
const viewingFile = useSkillsStore((s) => s.viewingFile);
|
|
23888
24058
|
const { isLoading, isFetching, refetch } = useSkills();
|
|
24059
|
+
const updateSkillsConfig = useUpdateSkillsConfig();
|
|
23889
24060
|
const { data: skillDetail } = useSkillDetail(selectedSkill);
|
|
23890
24061
|
const { data: skillFilesData } = useSkillFiles(selectedSkill);
|
|
23891
24062
|
const skillFiles = skillFilesData?.files ?? [];
|
|
@@ -23909,32 +24080,42 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
23909
24080
|
/* @__PURE__ */ jsxs86("div", {
|
|
23910
24081
|
className: "flex items-center gap-2",
|
|
23911
24082
|
children: [
|
|
23912
|
-
/* @__PURE__ */
|
|
24083
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
23913
24084
|
className: "w-4 h-4 text-muted-foreground"
|
|
23914
24085
|
}),
|
|
23915
|
-
/* @__PURE__ */
|
|
24086
|
+
/* @__PURE__ */ jsx96("span", {
|
|
23916
24087
|
className: "font-medium text-sm",
|
|
23917
24088
|
children: "Skills"
|
|
23918
24089
|
})
|
|
23919
24090
|
]
|
|
23920
24091
|
}),
|
|
23921
|
-
/* @__PURE__ */
|
|
23922
|
-
|
|
23923
|
-
|
|
23924
|
-
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
24092
|
+
/* @__PURE__ */ jsxs86("div", {
|
|
24093
|
+
className: "flex items-center gap-1",
|
|
24094
|
+
children: [
|
|
24095
|
+
/* @__PURE__ */ jsx96(ToggleSwitch, {
|
|
24096
|
+
checked: globalEnabled,
|
|
24097
|
+
loading: updateSkillsConfig.isPending,
|
|
24098
|
+
onChange: () => updateSkillsConfig.mutate({ enabled: !globalEnabled })
|
|
24099
|
+
}),
|
|
24100
|
+
/* @__PURE__ */ jsx96(Button, {
|
|
24101
|
+
variant: "ghost",
|
|
24102
|
+
size: "icon",
|
|
24103
|
+
onClick: collapseSidebar,
|
|
24104
|
+
title: "Close sidebar",
|
|
24105
|
+
children: /* @__PURE__ */ jsx96(ChevronRight16, {
|
|
24106
|
+
className: "w-4 h-4"
|
|
24107
|
+
})
|
|
24108
|
+
})
|
|
24109
|
+
]
|
|
23929
24110
|
})
|
|
23930
24111
|
]
|
|
23931
24112
|
}),
|
|
23932
24113
|
selectedSkill && skillDetail ? /* @__PURE__ */ jsxs86("div", {
|
|
23933
24114
|
className: "flex-1 overflow-y-auto",
|
|
23934
24115
|
children: [
|
|
23935
|
-
/* @__PURE__ */
|
|
24116
|
+
/* @__PURE__ */ jsx96("div", {
|
|
23936
24117
|
className: "p-3 border-b border-border",
|
|
23937
|
-
children: /* @__PURE__ */
|
|
24118
|
+
children: /* @__PURE__ */ jsx96("button", {
|
|
23938
24119
|
type: "button",
|
|
23939
24120
|
onClick: () => selectSkill(null),
|
|
23940
24121
|
className: "text-xs text-muted-foreground hover:text-foreground transition-colors",
|
|
@@ -23944,22 +24125,22 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
23944
24125
|
/* @__PURE__ */ jsxs86("div", {
|
|
23945
24126
|
className: "px-3 py-3 border-b border-border",
|
|
23946
24127
|
children: [
|
|
23947
|
-
/* @__PURE__ */
|
|
24128
|
+
/* @__PURE__ */ jsx96("h3", {
|
|
23948
24129
|
className: "font-medium text-sm mb-1",
|
|
23949
24130
|
children: skillDetail.name
|
|
23950
24131
|
}),
|
|
23951
|
-
/* @__PURE__ */
|
|
24132
|
+
/* @__PURE__ */ jsx96("p", {
|
|
23952
24133
|
className: "text-xs text-muted-foreground mb-2",
|
|
23953
24134
|
children: skillDetail.description
|
|
23954
24135
|
}),
|
|
23955
24136
|
/* @__PURE__ */ jsxs86("div", {
|
|
23956
24137
|
className: "flex items-center gap-2",
|
|
23957
24138
|
children: [
|
|
23958
|
-
/* @__PURE__ */
|
|
24139
|
+
/* @__PURE__ */ jsx96("span", {
|
|
23959
24140
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground",
|
|
23960
24141
|
children: SCOPE_LABELS[skillDetail.scope] ?? skillDetail.scope
|
|
23961
24142
|
}),
|
|
23962
|
-
skillDetail.license && /* @__PURE__ */
|
|
24143
|
+
skillDetail.license && /* @__PURE__ */ jsx96("span", {
|
|
23963
24144
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground",
|
|
23964
24145
|
children: skillDetail.license
|
|
23965
24146
|
})
|
|
@@ -23970,42 +24151,42 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
23970
24151
|
/* @__PURE__ */ jsxs86("div", {
|
|
23971
24152
|
className: "py-1",
|
|
23972
24153
|
children: [
|
|
23973
|
-
/* @__PURE__ */
|
|
24154
|
+
/* @__PURE__ */ jsx96("div", {
|
|
23974
24155
|
className: "flex items-center gap-1.5 px-3 py-2 text-[10px] uppercase tracking-wider text-muted-foreground font-medium",
|
|
23975
24156
|
children: "Files"
|
|
23976
24157
|
}),
|
|
23977
|
-
/* @__PURE__ */
|
|
24158
|
+
/* @__PURE__ */ jsx96("button", {
|
|
23978
24159
|
type: "button",
|
|
23979
24160
|
onClick: () => openViewer(null),
|
|
23980
24161
|
className: `w-full text-left px-3 py-2 hover:bg-accent transition-colors ${viewingFile === null ? "bg-accent" : ""}`,
|
|
23981
24162
|
children: /* @__PURE__ */ jsxs86("div", {
|
|
23982
24163
|
className: "flex items-center gap-2",
|
|
23983
24164
|
children: [
|
|
23984
|
-
/* @__PURE__ */
|
|
24165
|
+
/* @__PURE__ */ jsx96(FileText7, {
|
|
23985
24166
|
className: "w-3.5 h-3.5 flex-shrink-0 text-muted-foreground"
|
|
23986
24167
|
}),
|
|
23987
|
-
/* @__PURE__ */
|
|
24168
|
+
/* @__PURE__ */ jsx96("span", {
|
|
23988
24169
|
className: "text-sm font-mono truncate flex-1",
|
|
23989
24170
|
children: "SKILL.md"
|
|
23990
24171
|
})
|
|
23991
24172
|
]
|
|
23992
24173
|
})
|
|
23993
24174
|
}),
|
|
23994
|
-
skillFiles.map((file) => /* @__PURE__ */
|
|
24175
|
+
skillFiles.map((file) => /* @__PURE__ */ jsx96("button", {
|
|
23995
24176
|
type: "button",
|
|
23996
24177
|
onClick: () => openViewer(file.relativePath),
|
|
23997
24178
|
className: `w-full text-left px-3 py-2 hover:bg-accent transition-colors ${viewingFile === file.relativePath ? "bg-accent" : ""}`,
|
|
23998
24179
|
children: /* @__PURE__ */ jsxs86("div", {
|
|
23999
24180
|
className: "flex items-center gap-2",
|
|
24000
24181
|
children: [
|
|
24001
|
-
/* @__PURE__ */
|
|
24182
|
+
/* @__PURE__ */ jsx96(FileCode2, {
|
|
24002
24183
|
className: "w-3.5 h-3.5 flex-shrink-0 text-muted-foreground"
|
|
24003
24184
|
}),
|
|
24004
|
-
/* @__PURE__ */
|
|
24185
|
+
/* @__PURE__ */ jsx96("span", {
|
|
24005
24186
|
className: "text-sm font-mono truncate flex-1",
|
|
24006
24187
|
children: file.relativePath
|
|
24007
24188
|
}),
|
|
24008
|
-
/* @__PURE__ */
|
|
24189
|
+
/* @__PURE__ */ jsx96("span", {
|
|
24009
24190
|
className: "text-[10px] text-muted-foreground flex-shrink-0",
|
|
24010
24191
|
children: formatSize(file.size)
|
|
24011
24192
|
})
|
|
@@ -24015,20 +24196,20 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24015
24196
|
]
|
|
24016
24197
|
})
|
|
24017
24198
|
]
|
|
24018
|
-
}) : /* @__PURE__ */
|
|
24199
|
+
}) : /* @__PURE__ */ jsx96("div", {
|
|
24019
24200
|
className: "flex-1 overflow-y-auto",
|
|
24020
|
-
children: isLoading ? /* @__PURE__ */
|
|
24201
|
+
children: isLoading ? /* @__PURE__ */ jsx96("div", {
|
|
24021
24202
|
className: "flex items-center justify-center py-8",
|
|
24022
|
-
children: /* @__PURE__ */
|
|
24203
|
+
children: /* @__PURE__ */ jsx96(Loader215, {
|
|
24023
24204
|
className: "w-4 h-4 animate-spin text-muted-foreground"
|
|
24024
24205
|
})
|
|
24025
|
-
}) :
|
|
24206
|
+
}) : totalCount === 0 ? /* @__PURE__ */ jsxs86("div", {
|
|
24026
24207
|
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24027
24208
|
children: [
|
|
24028
|
-
/* @__PURE__ */
|
|
24209
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
24029
24210
|
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24030
24211
|
}),
|
|
24031
|
-
/* @__PURE__ */
|
|
24212
|
+
/* @__PURE__ */ jsx96("h3", {
|
|
24032
24213
|
className: "text-sm font-medium mb-2",
|
|
24033
24214
|
children: "No skills found"
|
|
24034
24215
|
}),
|
|
@@ -24037,21 +24218,51 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24037
24218
|
children: [
|
|
24038
24219
|
"Create skills in",
|
|
24039
24220
|
" ",
|
|
24040
|
-
/* @__PURE__ */
|
|
24221
|
+
/* @__PURE__ */ jsx96("code", {
|
|
24041
24222
|
className: "text-[10px] bg-muted px-1 rounded",
|
|
24042
24223
|
children: ".otto/skills/ or .agents/skills/"
|
|
24043
24224
|
}),
|
|
24044
24225
|
" ",
|
|
24045
24226
|
"or",
|
|
24046
24227
|
" ",
|
|
24047
|
-
/* @__PURE__ */
|
|
24228
|
+
/* @__PURE__ */ jsx96("code", {
|
|
24048
24229
|
className: "text-[10px] bg-muted px-1 rounded",
|
|
24049
24230
|
children: "~/.config/otto/skills/ or ~/.agents/skills/"
|
|
24050
24231
|
})
|
|
24051
24232
|
]
|
|
24052
24233
|
})
|
|
24053
24234
|
]
|
|
24054
|
-
}) : /* @__PURE__ */
|
|
24235
|
+
}) : !globalEnabled ? /* @__PURE__ */ jsxs86("div", {
|
|
24236
|
+
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24237
|
+
children: [
|
|
24238
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
24239
|
+
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24240
|
+
}),
|
|
24241
|
+
/* @__PURE__ */ jsx96("h3", {
|
|
24242
|
+
className: "text-sm font-medium mb-2",
|
|
24243
|
+
children: "Skills are disabled"
|
|
24244
|
+
}),
|
|
24245
|
+
/* @__PURE__ */ jsx96("p", {
|
|
24246
|
+
className: "text-xs text-muted-foreground max-w-[220px]",
|
|
24247
|
+
children: "Turn the skills toggle on to make discovered skills available."
|
|
24248
|
+
})
|
|
24249
|
+
]
|
|
24250
|
+
}) : skills.length === 0 ? /* @__PURE__ */ jsxs86("div", {
|
|
24251
|
+
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24252
|
+
children: [
|
|
24253
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
24254
|
+
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24255
|
+
}),
|
|
24256
|
+
/* @__PURE__ */ jsx96("h3", {
|
|
24257
|
+
className: "text-sm font-medium mb-2",
|
|
24258
|
+
children: "All skills are disabled"
|
|
24259
|
+
}),
|
|
24260
|
+
/* @__PURE__ */ jsx96("p", {
|
|
24261
|
+
className: "text-xs text-muted-foreground max-w-[220px]",
|
|
24262
|
+
children: "Enable individual skills or turn all skills back on."
|
|
24263
|
+
})
|
|
24264
|
+
]
|
|
24265
|
+
}) : /* @__PURE__ */ jsx96("div", {
|
|
24055
24266
|
className: "py-1",
|
|
24056
24267
|
children: ["cwd", "parent", "repo", "user", "system"].map((scope) => {
|
|
24057
24268
|
const scopeSkills = groupedSkills.get(scope);
|
|
@@ -24063,34 +24274,45 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24063
24274
|
/* @__PURE__ */ jsxs86("div", {
|
|
24064
24275
|
className: "flex items-center gap-1.5 px-3 py-2 text-[10px] uppercase tracking-wider text-muted-foreground font-medium",
|
|
24065
24276
|
children: [
|
|
24066
|
-
/* @__PURE__ */
|
|
24277
|
+
/* @__PURE__ */ jsx96(ScopeIcon, {
|
|
24067
24278
|
className: "w-3 h-3"
|
|
24068
24279
|
}),
|
|
24069
24280
|
SCOPE_LABELS[scope] ?? scope
|
|
24070
24281
|
]
|
|
24071
24282
|
}),
|
|
24072
|
-
scopeSkills.map((skill) => /* @__PURE__ */
|
|
24283
|
+
scopeSkills.map((skill) => /* @__PURE__ */ jsx96("button", {
|
|
24073
24284
|
type: "button",
|
|
24074
24285
|
onClick: () => selectSkill(skill.name),
|
|
24075
24286
|
className: `w-full text-left px-3 py-2 hover:bg-accent transition-colors ${selectedSkill === skill.name ? "bg-accent" : ""}`,
|
|
24076
24287
|
children: /* @__PURE__ */ jsxs86("div", {
|
|
24077
|
-
className: "flex items-
|
|
24288
|
+
className: "flex items-start gap-2",
|
|
24078
24289
|
children: [
|
|
24079
|
-
/* @__PURE__ */
|
|
24290
|
+
/* @__PURE__ */ jsx96(FileText7, {
|
|
24080
24291
|
className: "w-3.5 h-3.5 flex-shrink-0 text-muted-foreground"
|
|
24081
24292
|
}),
|
|
24082
24293
|
/* @__PURE__ */ jsxs86("div", {
|
|
24083
24294
|
className: "min-w-0 flex-1",
|
|
24084
24295
|
children: [
|
|
24085
|
-
/* @__PURE__ */
|
|
24296
|
+
/* @__PURE__ */ jsx96("div", {
|
|
24086
24297
|
className: "text-sm font-medium truncate",
|
|
24087
24298
|
children: skill.name
|
|
24088
24299
|
}),
|
|
24089
|
-
/* @__PURE__ */
|
|
24300
|
+
/* @__PURE__ */ jsx96("div", {
|
|
24090
24301
|
className: "text-xs text-muted-foreground truncate",
|
|
24091
24302
|
children: skill.description
|
|
24092
24303
|
})
|
|
24093
24304
|
]
|
|
24305
|
+
}),
|
|
24306
|
+
/* @__PURE__ */ jsx96(ToggleSwitch, {
|
|
24307
|
+
checked: skill.enabled !== false,
|
|
24308
|
+
loading: updateSkillsConfig.isPending,
|
|
24309
|
+
onChange: () => updateSkillsConfig.mutate({
|
|
24310
|
+
items: {
|
|
24311
|
+
[skill.name]: {
|
|
24312
|
+
enabled: skill.enabled === false
|
|
24313
|
+
}
|
|
24314
|
+
}
|
|
24315
|
+
})
|
|
24094
24316
|
})
|
|
24095
24317
|
]
|
|
24096
24318
|
})
|
|
@@ -24106,27 +24328,29 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24106
24328
|
/* @__PURE__ */ jsxs86("div", {
|
|
24107
24329
|
className: "flex items-center gap-2 min-w-0 flex-1",
|
|
24108
24330
|
children: [
|
|
24109
|
-
/* @__PURE__ */
|
|
24331
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
24110
24332
|
className: "w-3 h-3 flex-shrink-0"
|
|
24111
24333
|
}),
|
|
24112
24334
|
/* @__PURE__ */ jsxs86("span", {
|
|
24113
24335
|
className: "truncate",
|
|
24114
24336
|
children: [
|
|
24115
|
-
|
|
24337
|
+
enabledCount,
|
|
24338
|
+
"/",
|
|
24339
|
+
totalCount,
|
|
24116
24340
|
" ",
|
|
24117
|
-
|
|
24341
|
+
totalCount === 1 ? "skill" : "skills"
|
|
24118
24342
|
]
|
|
24119
24343
|
})
|
|
24120
24344
|
]
|
|
24121
24345
|
}),
|
|
24122
|
-
/* @__PURE__ */
|
|
24346
|
+
/* @__PURE__ */ jsx96(Button, {
|
|
24123
24347
|
variant: "ghost",
|
|
24124
24348
|
size: "icon",
|
|
24125
24349
|
onClick: () => refetch(),
|
|
24126
24350
|
title: "Refresh skills",
|
|
24127
24351
|
className: "h-6 w-6 flex-shrink-0",
|
|
24128
24352
|
disabled: isFetching,
|
|
24129
|
-
children: /* @__PURE__ */
|
|
24353
|
+
children: /* @__PURE__ */ jsx96(RefreshCw9, {
|
|
24130
24354
|
className: `w-3 h-3 ${isFetching ? "animate-spin" : ""}`
|
|
24131
24355
|
})
|
|
24132
24356
|
})
|
|
@@ -24136,31 +24360,31 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24136
24360
|
});
|
|
24137
24361
|
});
|
|
24138
24362
|
// src/components/skills/SkillsSidebarToggle.tsx
|
|
24139
|
-
import { memo as
|
|
24363
|
+
import { memo as memo40 } from "react";
|
|
24140
24364
|
import { Sparkles as Sparkles7 } from "lucide-react";
|
|
24141
|
-
import { jsx as
|
|
24142
|
-
var SkillsSidebarToggle =
|
|
24365
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
24366
|
+
var SkillsSidebarToggle = memo40(function SkillsSidebarToggle2() {
|
|
24143
24367
|
const isExpanded = useSkillsStore((state) => state.isExpanded);
|
|
24144
24368
|
const toggleSidebar = useSkillsStore((state) => state.toggleSidebar);
|
|
24145
|
-
return /* @__PURE__ */
|
|
24369
|
+
return /* @__PURE__ */ jsx97("button", {
|
|
24146
24370
|
type: "button",
|
|
24147
24371
|
onClick: toggleSidebar,
|
|
24148
24372
|
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"}`,
|
|
24149
24373
|
title: "Skills",
|
|
24150
|
-
children: /* @__PURE__ */
|
|
24374
|
+
children: /* @__PURE__ */ jsx97(Sparkles7, {
|
|
24151
24375
|
className: "w-5 h-5 text-muted-foreground mx-auto"
|
|
24152
24376
|
})
|
|
24153
24377
|
});
|
|
24154
24378
|
});
|
|
24155
24379
|
// src/components/skills/SkillViewerPanel.tsx
|
|
24156
|
-
import { memo as
|
|
24380
|
+
import { memo as memo41, useEffect as useEffect43 } from "react";
|
|
24157
24381
|
import { X as X16 } from "lucide-react";
|
|
24158
24382
|
import { Prism as SyntaxHighlighter11 } from "react-syntax-highlighter";
|
|
24159
24383
|
import {
|
|
24160
24384
|
prism as prism11,
|
|
24161
24385
|
vscDarkPlus as vscDarkPlus11
|
|
24162
24386
|
} from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
24163
|
-
import { jsx as
|
|
24387
|
+
import { jsx as jsx98, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
24164
24388
|
var LANGUAGE_MAP2 = {
|
|
24165
24389
|
js: "javascript",
|
|
24166
24390
|
jsx: "jsx",
|
|
@@ -24196,7 +24420,7 @@ function inferLanguage(path) {
|
|
|
24196
24420
|
const ext = path.split(".").pop()?.toLowerCase() ?? "";
|
|
24197
24421
|
return LANGUAGE_MAP2[ext] ?? "plaintext";
|
|
24198
24422
|
}
|
|
24199
|
-
var SkillViewerPanel =
|
|
24423
|
+
var SkillViewerPanel = memo41(function SkillViewerPanel2() {
|
|
24200
24424
|
const isViewerOpen = useSkillsStore((s) => s.isViewerOpen);
|
|
24201
24425
|
const viewingFile = useSkillsStore((s) => s.viewingFile);
|
|
24202
24426
|
const selectedSkill = useSkillsStore((s) => s.selectedSkill);
|
|
@@ -24228,47 +24452,47 @@ var SkillViewerPanel = memo40(function SkillViewerPanel2() {
|
|
|
24228
24452
|
/* @__PURE__ */ jsxs87("div", {
|
|
24229
24453
|
className: "h-14 border-b border-border px-4 flex items-center gap-3",
|
|
24230
24454
|
children: [
|
|
24231
|
-
/* @__PURE__ */
|
|
24455
|
+
/* @__PURE__ */ jsx98(Button, {
|
|
24232
24456
|
variant: "ghost",
|
|
24233
24457
|
size: "icon",
|
|
24234
24458
|
onClick: closeViewer,
|
|
24235
24459
|
title: "Close viewer (ESC)",
|
|
24236
|
-
children: /* @__PURE__ */
|
|
24460
|
+
children: /* @__PURE__ */ jsx98(X16, {
|
|
24237
24461
|
className: "w-4 h-4"
|
|
24238
24462
|
})
|
|
24239
24463
|
}),
|
|
24240
24464
|
/* @__PURE__ */ jsxs87("div", {
|
|
24241
24465
|
className: "flex-1 flex items-center gap-2 min-w-0",
|
|
24242
24466
|
children: [
|
|
24243
|
-
/* @__PURE__ */
|
|
24467
|
+
/* @__PURE__ */ jsx98("span", {
|
|
24244
24468
|
className: "text-xs text-muted-foreground flex-shrink-0",
|
|
24245
24469
|
children: selectedSkill
|
|
24246
24470
|
}),
|
|
24247
|
-
/* @__PURE__ */
|
|
24471
|
+
/* @__PURE__ */ jsx98("span", {
|
|
24248
24472
|
className: "text-xs text-muted-foreground",
|
|
24249
24473
|
children: "/"
|
|
24250
24474
|
}),
|
|
24251
|
-
/* @__PURE__ */
|
|
24475
|
+
/* @__PURE__ */ jsx98("span", {
|
|
24252
24476
|
className: "text-sm font-medium text-foreground font-mono truncate",
|
|
24253
24477
|
title: displayPath,
|
|
24254
24478
|
children: displayPath
|
|
24255
24479
|
})
|
|
24256
24480
|
]
|
|
24257
24481
|
}),
|
|
24258
|
-
/* @__PURE__ */
|
|
24482
|
+
/* @__PURE__ */ jsx98("span", {
|
|
24259
24483
|
className: "text-xs text-muted-foreground",
|
|
24260
24484
|
children: language
|
|
24261
24485
|
})
|
|
24262
24486
|
]
|
|
24263
24487
|
}),
|
|
24264
|
-
/* @__PURE__ */
|
|
24488
|
+
/* @__PURE__ */ jsx98("div", {
|
|
24265
24489
|
className: "flex-1 overflow-auto",
|
|
24266
|
-
children: isLoading ? /* @__PURE__ */
|
|
24490
|
+
children: isLoading ? /* @__PURE__ */ jsx98("div", {
|
|
24267
24491
|
className: "h-full flex items-center justify-center text-muted-foreground",
|
|
24268
24492
|
children: "Loading..."
|
|
24269
|
-
}) : content ? /* @__PURE__ */
|
|
24493
|
+
}) : content ? /* @__PURE__ */ jsx98("div", {
|
|
24270
24494
|
className: "code-with-line-numbers",
|
|
24271
|
-
children: /* @__PURE__ */
|
|
24495
|
+
children: /* @__PURE__ */ jsx98(SyntaxHighlighter11, {
|
|
24272
24496
|
language,
|
|
24273
24497
|
style: syntaxTheme,
|
|
24274
24498
|
wrapLines: true,
|
|
@@ -24290,7 +24514,7 @@ var SkillViewerPanel = memo40(function SkillViewerPanel2() {
|
|
|
24290
24514
|
},
|
|
24291
24515
|
children: content
|
|
24292
24516
|
})
|
|
24293
|
-
}) : /* @__PURE__ */
|
|
24517
|
+
}) : /* @__PURE__ */ jsx98("div", {
|
|
24294
24518
|
className: "h-full flex items-center justify-center text-muted-foreground",
|
|
24295
24519
|
children: "Unable to load file"
|
|
24296
24520
|
})
|
|
@@ -24299,7 +24523,7 @@ var SkillViewerPanel = memo40(function SkillViewerPanel2() {
|
|
|
24299
24523
|
});
|
|
24300
24524
|
});
|
|
24301
24525
|
// src/components/file-browser/FileBrowserSidebar.tsx
|
|
24302
|
-
import { memo as
|
|
24526
|
+
import { memo as memo42, useCallback as useCallback32 } from "react";
|
|
24303
24527
|
import {
|
|
24304
24528
|
ChevronRight as ChevronRight17,
|
|
24305
24529
|
ChevronDown as ChevronDown11,
|
|
@@ -24309,7 +24533,7 @@ import {
|
|
|
24309
24533
|
FolderTree as FolderTree3,
|
|
24310
24534
|
RefreshCw as RefreshCw10
|
|
24311
24535
|
} from "lucide-react";
|
|
24312
|
-
import { jsx as
|
|
24536
|
+
import { jsx as jsx99, jsxs as jsxs88, Fragment as Fragment38 } from "react/jsx-runtime";
|
|
24313
24537
|
var PANEL_KEY4 = "file-browser";
|
|
24314
24538
|
var DEFAULT_WIDTH4 = 320;
|
|
24315
24539
|
var MIN_WIDTH4 = 280;
|
|
@@ -24321,14 +24545,14 @@ function TreeDirectory({ dirPath }) {
|
|
|
24321
24545
|
if (!isExpanded)
|
|
24322
24546
|
return null;
|
|
24323
24547
|
if (isLoading) {
|
|
24324
|
-
return /* @__PURE__ */
|
|
24548
|
+
return /* @__PURE__ */ jsx99("div", {
|
|
24325
24549
|
className: "pl-4 py-1 text-xs text-muted-foreground",
|
|
24326
24550
|
children: "Loading..."
|
|
24327
24551
|
});
|
|
24328
24552
|
}
|
|
24329
|
-
return /* @__PURE__ */
|
|
24553
|
+
return /* @__PURE__ */ jsx99("div", {
|
|
24330
24554
|
className: "pl-3",
|
|
24331
|
-
children: data?.items.map((item) => /* @__PURE__ */
|
|
24555
|
+
children: data?.items.map((item) => /* @__PURE__ */ jsx99(TreeItem, {
|
|
24332
24556
|
name: item.name,
|
|
24333
24557
|
path: item.path,
|
|
24334
24558
|
type: item.type,
|
|
@@ -24364,40 +24588,40 @@ function TreeItem({
|
|
|
24364
24588
|
children: [
|
|
24365
24589
|
type === "directory" ? /* @__PURE__ */ jsxs88(Fragment38, {
|
|
24366
24590
|
children: [
|
|
24367
|
-
isExpanded ? /* @__PURE__ */
|
|
24591
|
+
isExpanded ? /* @__PURE__ */ jsx99(ChevronDown11, {
|
|
24368
24592
|
className: "w-3 h-3 text-muted-foreground flex-shrink-0"
|
|
24369
|
-
}) : /* @__PURE__ */
|
|
24593
|
+
}) : /* @__PURE__ */ jsx99(ChevronRight17, {
|
|
24370
24594
|
className: "w-3 h-3 text-muted-foreground flex-shrink-0"
|
|
24371
24595
|
}),
|
|
24372
|
-
isExpanded ? /* @__PURE__ */
|
|
24596
|
+
isExpanded ? /* @__PURE__ */ jsx99(FolderOpen2, {
|
|
24373
24597
|
className: "w-3.5 h-3.5 text-blue-500 flex-shrink-0"
|
|
24374
|
-
}) : /* @__PURE__ */
|
|
24598
|
+
}) : /* @__PURE__ */ jsx99(Folder2, {
|
|
24375
24599
|
className: "w-3.5 h-3.5 text-blue-500 flex-shrink-0"
|
|
24376
24600
|
})
|
|
24377
24601
|
]
|
|
24378
24602
|
}) : /* @__PURE__ */ jsxs88(Fragment38, {
|
|
24379
24603
|
children: [
|
|
24380
|
-
/* @__PURE__ */
|
|
24604
|
+
/* @__PURE__ */ jsx99("span", {
|
|
24381
24605
|
className: "w-3 flex-shrink-0"
|
|
24382
24606
|
}),
|
|
24383
|
-
/* @__PURE__ */
|
|
24607
|
+
/* @__PURE__ */ jsx99(FileCode3, {
|
|
24384
24608
|
className: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0"
|
|
24385
24609
|
})
|
|
24386
24610
|
]
|
|
24387
24611
|
}),
|
|
24388
|
-
/* @__PURE__ */
|
|
24612
|
+
/* @__PURE__ */ jsx99("span", {
|
|
24389
24613
|
className: "truncate",
|
|
24390
24614
|
children: name
|
|
24391
24615
|
})
|
|
24392
24616
|
]
|
|
24393
24617
|
}),
|
|
24394
|
-
type === "directory" && /* @__PURE__ */
|
|
24618
|
+
type === "directory" && /* @__PURE__ */ jsx99(TreeDirectory, {
|
|
24395
24619
|
dirPath: path
|
|
24396
24620
|
})
|
|
24397
24621
|
]
|
|
24398
24622
|
});
|
|
24399
24623
|
}
|
|
24400
|
-
var FileBrowserSidebar =
|
|
24624
|
+
var FileBrowserSidebar = memo42(function FileBrowserSidebar2() {
|
|
24401
24625
|
const isExpanded = useFileBrowserStore((s) => s.isExpanded);
|
|
24402
24626
|
const collapseSidebar = useFileBrowserStore((s) => s.collapseSidebar);
|
|
24403
24627
|
const panelWidth = usePanelWidthStore((s) => s.widths[PANEL_KEY4] ?? DEFAULT_WIDTH4);
|
|
@@ -24408,7 +24632,7 @@ var FileBrowserSidebar = memo41(function FileBrowserSidebar2() {
|
|
|
24408
24632
|
className: "border-l border-sidebar-border sidebar-fade-in flex h-full relative",
|
|
24409
24633
|
style: { width: panelWidth },
|
|
24410
24634
|
children: [
|
|
24411
|
-
/* @__PURE__ */
|
|
24635
|
+
/* @__PURE__ */ jsx99(ResizeHandle, {
|
|
24412
24636
|
panelKey: PANEL_KEY4,
|
|
24413
24637
|
side: "right",
|
|
24414
24638
|
minWidth: MIN_WIDTH4,
|
|
@@ -24424,34 +24648,34 @@ var FileBrowserSidebar = memo41(function FileBrowserSidebar2() {
|
|
|
24424
24648
|
/* @__PURE__ */ jsxs88("div", {
|
|
24425
24649
|
className: "flex items-center gap-2",
|
|
24426
24650
|
children: [
|
|
24427
|
-
/* @__PURE__ */
|
|
24651
|
+
/* @__PURE__ */ jsx99(FolderTree3, {
|
|
24428
24652
|
className: "w-4 h-4 text-muted-foreground"
|
|
24429
24653
|
}),
|
|
24430
|
-
/* @__PURE__ */
|
|
24654
|
+
/* @__PURE__ */ jsx99("span", {
|
|
24431
24655
|
className: "font-medium",
|
|
24432
24656
|
children: "Files"
|
|
24433
24657
|
})
|
|
24434
24658
|
]
|
|
24435
24659
|
}),
|
|
24436
|
-
/* @__PURE__ */
|
|
24660
|
+
/* @__PURE__ */ jsx99(Button, {
|
|
24437
24661
|
variant: "ghost",
|
|
24438
24662
|
size: "icon",
|
|
24439
24663
|
onClick: collapseSidebar,
|
|
24440
|
-
children: /* @__PURE__ */
|
|
24664
|
+
children: /* @__PURE__ */ jsx99(ChevronRight17, {
|
|
24441
24665
|
className: "w-4 h-4"
|
|
24442
24666
|
})
|
|
24443
24667
|
})
|
|
24444
24668
|
]
|
|
24445
24669
|
}),
|
|
24446
|
-
/* @__PURE__ */
|
|
24670
|
+
/* @__PURE__ */ jsx99("div", {
|
|
24447
24671
|
className: "flex-1 overflow-y-auto p-1",
|
|
24448
|
-
children: isLoading ? /* @__PURE__ */
|
|
24672
|
+
children: isLoading ? /* @__PURE__ */ jsx99("div", {
|
|
24449
24673
|
className: "p-4 text-sm text-muted-foreground",
|
|
24450
24674
|
children: "Loading file tree..."
|
|
24451
|
-
}) : !rootData || rootData.items.length === 0 ? /* @__PURE__ */
|
|
24675
|
+
}) : !rootData || rootData.items.length === 0 ? /* @__PURE__ */ jsx99("div", {
|
|
24452
24676
|
className: "p-4 text-sm text-muted-foreground",
|
|
24453
24677
|
children: "No files found"
|
|
24454
|
-
}) : rootData.items.map((item) => /* @__PURE__ */
|
|
24678
|
+
}) : rootData.items.map((item) => /* @__PURE__ */ jsx99(TreeItem, {
|
|
24455
24679
|
name: item.name,
|
|
24456
24680
|
path: item.path,
|
|
24457
24681
|
type: item.type,
|
|
@@ -24464,23 +24688,23 @@ var FileBrowserSidebar = memo41(function FileBrowserSidebar2() {
|
|
|
24464
24688
|
/* @__PURE__ */ jsxs88("div", {
|
|
24465
24689
|
className: "flex items-center gap-2 min-w-0 flex-1",
|
|
24466
24690
|
children: [
|
|
24467
|
-
/* @__PURE__ */
|
|
24691
|
+
/* @__PURE__ */ jsx99(FolderTree3, {
|
|
24468
24692
|
className: "w-3 h-3 flex-shrink-0"
|
|
24469
24693
|
}),
|
|
24470
|
-
/* @__PURE__ */
|
|
24694
|
+
/* @__PURE__ */ jsx99("span", {
|
|
24471
24695
|
className: "truncate",
|
|
24472
24696
|
children: "Project Files"
|
|
24473
24697
|
})
|
|
24474
24698
|
]
|
|
24475
24699
|
}),
|
|
24476
|
-
/* @__PURE__ */
|
|
24700
|
+
/* @__PURE__ */ jsx99(Button, {
|
|
24477
24701
|
variant: "ghost",
|
|
24478
24702
|
size: "icon",
|
|
24479
24703
|
onClick: () => refetch(),
|
|
24480
24704
|
title: "Refresh file tree",
|
|
24481
24705
|
className: "h-6 w-6 flex-shrink-0",
|
|
24482
24706
|
disabled: isLoading,
|
|
24483
|
-
children: /* @__PURE__ */
|
|
24707
|
+
children: /* @__PURE__ */ jsx99(RefreshCw10, {
|
|
24484
24708
|
className: `w-3 h-3 ${isLoading ? "animate-spin" : ""}`
|
|
24485
24709
|
})
|
|
24486
24710
|
})
|
|
@@ -24492,31 +24716,33 @@ var FileBrowserSidebar = memo41(function FileBrowserSidebar2() {
|
|
|
24492
24716
|
});
|
|
24493
24717
|
});
|
|
24494
24718
|
// src/components/file-browser/FileBrowserSidebarToggle.tsx
|
|
24495
|
-
import { memo as
|
|
24719
|
+
import { memo as memo43 } from "react";
|
|
24496
24720
|
import { FolderTree as FolderTree4 } from "lucide-react";
|
|
24497
|
-
import { jsx as
|
|
24498
|
-
var FileBrowserSidebarToggle =
|
|
24721
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
24722
|
+
var FileBrowserSidebarToggle = memo43(function FileBrowserSidebarToggle2() {
|
|
24499
24723
|
const isExpanded = useFileBrowserStore((s) => s.isExpanded);
|
|
24500
24724
|
const toggleSidebar = useFileBrowserStore((s) => s.toggleSidebar);
|
|
24501
|
-
return /* @__PURE__ */
|
|
24725
|
+
return /* @__PURE__ */ jsx100("button", {
|
|
24502
24726
|
type: "button",
|
|
24503
24727
|
onClick: toggleSidebar,
|
|
24504
24728
|
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"}`,
|
|
24505
24729
|
title: "Files",
|
|
24506
|
-
children: /* @__PURE__ */
|
|
24730
|
+
children: /* @__PURE__ */ jsx100(FolderTree4, {
|
|
24507
24731
|
className: "w-5 h-5 text-muted-foreground mx-auto"
|
|
24508
24732
|
})
|
|
24509
24733
|
});
|
|
24510
24734
|
});
|
|
24511
24735
|
// src/components/file-browser/FileViewerPanel.tsx
|
|
24512
|
-
import { memo as
|
|
24736
|
+
import { memo as memo44, useEffect as useEffect44 } from "react";
|
|
24513
24737
|
import { X as X17 } from "lucide-react";
|
|
24738
|
+
import ReactMarkdown3 from "react-markdown";
|
|
24514
24739
|
import { Prism as SyntaxHighlighter12 } from "react-syntax-highlighter";
|
|
24515
24740
|
import {
|
|
24516
24741
|
prism as prism12,
|
|
24517
24742
|
vscDarkPlus as vscDarkPlus12
|
|
24518
24743
|
} from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
24519
|
-
import
|
|
24744
|
+
import remarkGfm3 from "remark-gfm";
|
|
24745
|
+
import { jsx as jsx101, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
24520
24746
|
var LANGUAGE_MAP3 = {
|
|
24521
24747
|
js: "javascript",
|
|
24522
24748
|
jsx: "jsx",
|
|
@@ -24545,16 +24771,25 @@ var LANGUAGE_MAP3 = {
|
|
|
24545
24771
|
css: "css",
|
|
24546
24772
|
scss: "scss",
|
|
24547
24773
|
md: "markdown",
|
|
24774
|
+
markdown: "markdown",
|
|
24775
|
+
mdx: "markdown",
|
|
24548
24776
|
txt: "plaintext",
|
|
24549
24777
|
svelte: "svelte",
|
|
24550
24778
|
toml: "toml",
|
|
24551
24779
|
lock: "plaintext"
|
|
24552
24780
|
};
|
|
24781
|
+
function getFileExtension(path) {
|
|
24782
|
+
return path.split(".").pop()?.toLowerCase() ?? "";
|
|
24783
|
+
}
|
|
24553
24784
|
function inferLanguage2(path) {
|
|
24554
|
-
const ext = path
|
|
24785
|
+
const ext = getFileExtension(path);
|
|
24555
24786
|
return LANGUAGE_MAP3[ext] ?? "plaintext";
|
|
24556
24787
|
}
|
|
24557
|
-
|
|
24788
|
+
function isMarkdownFile(path) {
|
|
24789
|
+
const ext = getFileExtension(path);
|
|
24790
|
+
return ext === "md" || ext === "markdown" || ext === "mdx";
|
|
24791
|
+
}
|
|
24792
|
+
var FileViewerPanel = memo44(function FileViewerPanel2() {
|
|
24558
24793
|
const isViewerOpen = useFileBrowserStore((s) => s.isViewerOpen);
|
|
24559
24794
|
const selectedFile = useFileBrowserStore((s) => s.selectedFile);
|
|
24560
24795
|
const closeViewer = useFileBrowserStore((s) => s.closeViewer);
|
|
@@ -24574,25 +24809,26 @@ var FileViewerPanel = memo43(function FileViewerPanel2() {
|
|
|
24574
24809
|
return null;
|
|
24575
24810
|
const syntaxTheme = document?.documentElement.classList.contains("dark") ? vscDarkPlus12 : prism12;
|
|
24576
24811
|
const language = inferLanguage2(selectedFile);
|
|
24812
|
+
const renderMarkdown = isMarkdownFile(selectedFile);
|
|
24577
24813
|
return /* @__PURE__ */ jsxs89("div", {
|
|
24578
24814
|
className: "absolute inset-0 bg-background z-50 flex flex-col animate-in slide-in-from-left duration-300",
|
|
24579
24815
|
children: [
|
|
24580
24816
|
/* @__PURE__ */ jsxs89("div", {
|
|
24581
24817
|
className: "h-14 border-b border-border px-4 flex items-center gap-3",
|
|
24582
24818
|
children: [
|
|
24583
|
-
/* @__PURE__ */
|
|
24819
|
+
/* @__PURE__ */ jsx101(Button, {
|
|
24584
24820
|
variant: "ghost",
|
|
24585
24821
|
size: "icon",
|
|
24586
24822
|
onClick: closeViewer,
|
|
24587
24823
|
title: "Close file viewer (ESC)",
|
|
24588
|
-
children: /* @__PURE__ */
|
|
24824
|
+
children: /* @__PURE__ */ jsx101(X17, {
|
|
24589
24825
|
className: "w-4 h-4"
|
|
24590
24826
|
})
|
|
24591
24827
|
}),
|
|
24592
24828
|
/* @__PURE__ */ jsxs89("div", {
|
|
24593
24829
|
className: "flex-1 flex items-center gap-2 min-w-0",
|
|
24594
24830
|
children: [
|
|
24595
|
-
/* @__PURE__ */
|
|
24831
|
+
/* @__PURE__ */ jsx101("span", {
|
|
24596
24832
|
className: "text-sm font-medium text-foreground font-mono truncate",
|
|
24597
24833
|
title: selectedFile,
|
|
24598
24834
|
children: selectedFile
|
|
@@ -24606,20 +24842,58 @@ var FileViewerPanel = memo43(function FileViewerPanel2() {
|
|
|
24606
24842
|
})
|
|
24607
24843
|
]
|
|
24608
24844
|
}),
|
|
24609
|
-
/* @__PURE__ */
|
|
24845
|
+
/* @__PURE__ */ jsx101("span", {
|
|
24610
24846
|
className: "text-xs text-muted-foreground",
|
|
24611
24847
|
children: language
|
|
24612
24848
|
})
|
|
24613
24849
|
]
|
|
24614
24850
|
}),
|
|
24615
|
-
/* @__PURE__ */
|
|
24851
|
+
/* @__PURE__ */ jsx101("div", {
|
|
24616
24852
|
className: "flex-1 overflow-auto",
|
|
24617
|
-
children: isLoading ? /* @__PURE__ */
|
|
24853
|
+
children: isLoading ? /* @__PURE__ */ jsx101("div", {
|
|
24618
24854
|
className: "h-full flex items-center justify-center text-muted-foreground",
|
|
24619
24855
|
children: "Loading file..."
|
|
24620
|
-
}) : data ? /* @__PURE__ */
|
|
24856
|
+
}) : data ? renderMarkdown ? /* @__PURE__ */ jsx101("div", {
|
|
24857
|
+
className: "p-4 text-sm text-foreground leading-6 markdown-content max-w-full overflow-x-auto",
|
|
24858
|
+
children: /* @__PURE__ */ jsx101(ReactMarkdown3, {
|
|
24859
|
+
remarkPlugins: [remarkGfm3],
|
|
24860
|
+
components: {
|
|
24861
|
+
a: ({
|
|
24862
|
+
href,
|
|
24863
|
+
children,
|
|
24864
|
+
...props
|
|
24865
|
+
}) => /* @__PURE__ */ jsx101("a", {
|
|
24866
|
+
href,
|
|
24867
|
+
target: "_blank",
|
|
24868
|
+
rel: "noopener noreferrer",
|
|
24869
|
+
onClick: (e) => {
|
|
24870
|
+
if (window.self !== window.top && href) {
|
|
24871
|
+
e.preventDefault();
|
|
24872
|
+
window.parent.postMessage({
|
|
24873
|
+
type: "otto-open-url",
|
|
24874
|
+
url: href
|
|
24875
|
+
}, "*");
|
|
24876
|
+
}
|
|
24877
|
+
},
|
|
24878
|
+
...props,
|
|
24879
|
+
children
|
|
24880
|
+
}),
|
|
24881
|
+
table: ({
|
|
24882
|
+
children,
|
|
24883
|
+
...props
|
|
24884
|
+
}) => /* @__PURE__ */ jsx101("div", {
|
|
24885
|
+
className: "overflow-x-auto max-w-full min-w-0 my-3",
|
|
24886
|
+
children: /* @__PURE__ */ jsx101("table", {
|
|
24887
|
+
...props,
|
|
24888
|
+
children
|
|
24889
|
+
})
|
|
24890
|
+
})
|
|
24891
|
+
},
|
|
24892
|
+
children: data.content
|
|
24893
|
+
})
|
|
24894
|
+
}) : /* @__PURE__ */ jsx101("div", {
|
|
24621
24895
|
className: "code-with-line-numbers",
|
|
24622
|
-
children: /* @__PURE__ */
|
|
24896
|
+
children: /* @__PURE__ */ jsx101(SyntaxHighlighter12, {
|
|
24623
24897
|
language,
|
|
24624
24898
|
style: syntaxTheme,
|
|
24625
24899
|
wrapLines: true,
|
|
@@ -24641,7 +24915,7 @@ var FileViewerPanel = memo43(function FileViewerPanel2() {
|
|
|
24641
24915
|
},
|
|
24642
24916
|
children: data.content
|
|
24643
24917
|
})
|
|
24644
|
-
}) : /* @__PURE__ */
|
|
24918
|
+
}) : /* @__PURE__ */ jsx101("div", {
|
|
24645
24919
|
className: "h-full flex items-center justify-center text-muted-foreground",
|
|
24646
24920
|
children: "Unable to load file"
|
|
24647
24921
|
})
|
|
@@ -24650,7 +24924,7 @@ var FileViewerPanel = memo43(function FileViewerPanel2() {
|
|
|
24650
24924
|
});
|
|
24651
24925
|
});
|
|
24652
24926
|
// src/components/file-browser/QuickFilePicker.tsx
|
|
24653
|
-
import { memo as
|
|
24927
|
+
import { memo as memo45, useState as useState43, useEffect as useEffect45, useRef as useRef30, useCallback as useCallback33, useMemo as useMemo25 } from "react";
|
|
24654
24928
|
import { FileCode as FileCode4, Search as Search7 } from "lucide-react";
|
|
24655
24929
|
|
|
24656
24930
|
// src/stores/filePickerStore.ts
|
|
@@ -24663,7 +24937,7 @@ var useFilePickerStore = create22((set) => ({
|
|
|
24663
24937
|
}));
|
|
24664
24938
|
|
|
24665
24939
|
// src/components/file-browser/QuickFilePicker.tsx
|
|
24666
|
-
import { jsx as
|
|
24940
|
+
import { jsx as jsx102, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
24667
24941
|
function fuzzyMatch(query, target) {
|
|
24668
24942
|
const q = query.toLowerCase();
|
|
24669
24943
|
const t = target.toLowerCase();
|
|
@@ -24687,7 +24961,7 @@ function fuzzyMatch(query, target) {
|
|
|
24687
24961
|
}
|
|
24688
24962
|
return { match: qi === q.length, score };
|
|
24689
24963
|
}
|
|
24690
|
-
var QuickFilePicker =
|
|
24964
|
+
var QuickFilePicker = memo45(function QuickFilePicker2() {
|
|
24691
24965
|
const isOpen = useFilePickerStore((s) => s.isOpen);
|
|
24692
24966
|
const close = useFilePickerStore((s) => s.close);
|
|
24693
24967
|
const openFile = useFileBrowserStore((s) => s.openFile);
|
|
@@ -24743,7 +25017,7 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24743
25017
|
}, [close]);
|
|
24744
25018
|
if (!isOpen)
|
|
24745
25019
|
return null;
|
|
24746
|
-
return /* @__PURE__ */
|
|
25020
|
+
return /* @__PURE__ */ jsx102("div", {
|
|
24747
25021
|
role: "dialog",
|
|
24748
25022
|
"aria-modal": "true",
|
|
24749
25023
|
className: "fixed inset-0 bg-black/50 flex items-start justify-center z-[60] pt-[15vh]",
|
|
@@ -24758,10 +25032,10 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24758
25032
|
/* @__PURE__ */ jsxs90("div", {
|
|
24759
25033
|
className: "flex items-center gap-2 px-3 border-b border-border",
|
|
24760
25034
|
children: [
|
|
24761
|
-
/* @__PURE__ */
|
|
25035
|
+
/* @__PURE__ */ jsx102(Search7, {
|
|
24762
25036
|
className: "w-4 h-4 text-muted-foreground flex-shrink-0"
|
|
24763
25037
|
}),
|
|
24764
|
-
/* @__PURE__ */
|
|
25038
|
+
/* @__PURE__ */ jsx102("input", {
|
|
24765
25039
|
ref: inputRef,
|
|
24766
25040
|
type: "text",
|
|
24767
25041
|
value: query,
|
|
@@ -24773,16 +25047,16 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24773
25047
|
placeholder: "Search files by name...",
|
|
24774
25048
|
className: "flex-1 bg-transparent py-3 text-sm text-foreground placeholder-muted-foreground outline-none"
|
|
24775
25049
|
}),
|
|
24776
|
-
/* @__PURE__ */
|
|
25050
|
+
/* @__PURE__ */ jsx102("kbd", {
|
|
24777
25051
|
className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border font-mono",
|
|
24778
25052
|
children: "ESC"
|
|
24779
25053
|
})
|
|
24780
25054
|
]
|
|
24781
25055
|
}),
|
|
24782
|
-
/* @__PURE__ */
|
|
25056
|
+
/* @__PURE__ */ jsx102("div", {
|
|
24783
25057
|
ref: listRef,
|
|
24784
25058
|
className: "max-h-[40vh] overflow-y-auto",
|
|
24785
|
-
children: filtered.length === 0 ? /* @__PURE__ */
|
|
25059
|
+
children: filtered.length === 0 ? /* @__PURE__ */ jsx102("div", {
|
|
24786
25060
|
className: "px-4 py-8 text-center text-sm text-muted-foreground",
|
|
24787
25061
|
children: query ? "No matching files" : "No files found"
|
|
24788
25062
|
}) : filtered.map((file, idx) => {
|
|
@@ -24792,14 +25066,14 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24792
25066
|
onClick: () => handleSelect(file),
|
|
24793
25067
|
className: `w-full text-left flex items-center gap-2 px-3 py-2 text-sm transition-colors ${idx === selectedIndex ? "bg-accent text-accent-foreground" : "text-foreground/80 hover:bg-muted/50"} ${isIgnored ? "opacity-40" : ""}`,
|
|
24794
25068
|
children: [
|
|
24795
|
-
/* @__PURE__ */
|
|
25069
|
+
/* @__PURE__ */ jsx102(FileCode4, {
|
|
24796
25070
|
className: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0"
|
|
24797
25071
|
}),
|
|
24798
|
-
/* @__PURE__ */
|
|
25072
|
+
/* @__PURE__ */ jsx102(HighlightedPath, {
|
|
24799
25073
|
path: file,
|
|
24800
25074
|
query
|
|
24801
25075
|
}),
|
|
24802
|
-
isIgnored && /* @__PURE__ */
|
|
25076
|
+
isIgnored && /* @__PURE__ */ jsx102("span", {
|
|
24803
25077
|
className: "ml-auto text-[10px] text-muted-foreground italic",
|
|
24804
25078
|
children: "ignored"
|
|
24805
25079
|
})
|
|
@@ -24812,7 +25086,7 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24812
25086
|
children: [
|
|
24813
25087
|
/* @__PURE__ */ jsxs90("span", {
|
|
24814
25088
|
children: [
|
|
24815
|
-
/* @__PURE__ */
|
|
25089
|
+
/* @__PURE__ */ jsx102("kbd", {
|
|
24816
25090
|
className: "bg-muted px-1 py-0.5 rounded border border-border font-mono",
|
|
24817
25091
|
children: "↑↓"
|
|
24818
25092
|
}),
|
|
@@ -24822,7 +25096,7 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24822
25096
|
}),
|
|
24823
25097
|
/* @__PURE__ */ jsxs90("span", {
|
|
24824
25098
|
children: [
|
|
24825
|
-
/* @__PURE__ */
|
|
25099
|
+
/* @__PURE__ */ jsx102("kbd", {
|
|
24826
25100
|
className: "bg-muted px-1 py-0.5 rounded border border-border font-mono",
|
|
24827
25101
|
children: "↵"
|
|
24828
25102
|
}),
|
|
@@ -24845,7 +25119,7 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24845
25119
|
});
|
|
24846
25120
|
function HighlightedPath({ path, query }) {
|
|
24847
25121
|
if (!query) {
|
|
24848
|
-
return /* @__PURE__ */
|
|
25122
|
+
return /* @__PURE__ */ jsx102("span", {
|
|
24849
25123
|
className: "truncate font-mono text-xs",
|
|
24850
25124
|
children: path
|
|
24851
25125
|
});
|
|
@@ -24858,7 +25132,7 @@ function HighlightedPath({ path, query }) {
|
|
|
24858
25132
|
className: "truncate font-mono text-xs",
|
|
24859
25133
|
children: [
|
|
24860
25134
|
path.slice(0, idx),
|
|
24861
|
-
/* @__PURE__ */
|
|
25135
|
+
/* @__PURE__ */ jsx102("span", {
|
|
24862
25136
|
className: "text-primary font-semibold",
|
|
24863
25137
|
children: path.slice(idx, idx + query.length)
|
|
24864
25138
|
}),
|
|
@@ -24866,21 +25140,21 @@ function HighlightedPath({ path, query }) {
|
|
|
24866
25140
|
]
|
|
24867
25141
|
});
|
|
24868
25142
|
}
|
|
24869
|
-
return /* @__PURE__ */
|
|
25143
|
+
return /* @__PURE__ */ jsx102("span", {
|
|
24870
25144
|
className: "truncate font-mono text-xs",
|
|
24871
25145
|
children: path
|
|
24872
25146
|
});
|
|
24873
25147
|
}
|
|
24874
25148
|
// src/components/onboarding/OnboardingModal.tsx
|
|
24875
|
-
import { memo as
|
|
25149
|
+
import { memo as memo48 } from "react";
|
|
24876
25150
|
|
|
24877
25151
|
// src/components/onboarding/steps/ProviderSetupStep.tsx
|
|
24878
|
-
import { memo as
|
|
25152
|
+
import { memo as memo46, useEffect as useEffect46, useState as useState44, useRef as useRef31 } from "react";
|
|
24879
25153
|
import {
|
|
24880
25154
|
Copy as Copy5,
|
|
24881
25155
|
Check as Check13,
|
|
24882
25156
|
CreditCard as CreditCard5,
|
|
24883
|
-
Loader2 as
|
|
25157
|
+
Loader2 as Loader216,
|
|
24884
25158
|
X as X18,
|
|
24885
25159
|
Key as Key2,
|
|
24886
25160
|
ExternalLink as ExternalLink10,
|
|
@@ -24888,8 +25162,8 @@ import {
|
|
|
24888
25162
|
RefreshCw as RefreshCw11
|
|
24889
25163
|
} from "lucide-react";
|
|
24890
25164
|
import { QRCodeSVG as QRCodeSVG3 } from "qrcode.react";
|
|
24891
|
-
import { jsx as
|
|
24892
|
-
var ProviderSetupStep =
|
|
25165
|
+
import { jsx as jsx103, jsxs as jsxs91, Fragment as Fragment39 } from "react/jsx-runtime";
|
|
25166
|
+
var ProviderSetupStep = memo46(function ProviderSetupStep2({
|
|
24893
25167
|
authStatus,
|
|
24894
25168
|
onSetupWallet,
|
|
24895
25169
|
onImportWallet,
|
|
@@ -25228,11 +25502,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25228
25502
|
/* @__PURE__ */ jsxs91("div", {
|
|
25229
25503
|
className: "flex items-center gap-3",
|
|
25230
25504
|
children: [
|
|
25231
|
-
/* @__PURE__ */
|
|
25505
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25232
25506
|
provider: "ottorouter",
|
|
25233
25507
|
size: 24
|
|
25234
25508
|
}),
|
|
25235
|
-
/* @__PURE__ */
|
|
25509
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25236
25510
|
className: "font-semibold text-foreground",
|
|
25237
25511
|
children: "otto"
|
|
25238
25512
|
})
|
|
@@ -25241,7 +25515,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25241
25515
|
!manageMode && /* @__PURE__ */ jsxs91("div", {
|
|
25242
25516
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
25243
25517
|
children: [
|
|
25244
|
-
/* @__PURE__ */
|
|
25518
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25245
25519
|
className: "w-2 h-2 rounded-full bg-green-500"
|
|
25246
25520
|
}),
|
|
25247
25521
|
"Step 1 of 2"
|
|
@@ -25249,7 +25523,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25249
25523
|
})
|
|
25250
25524
|
]
|
|
25251
25525
|
}),
|
|
25252
|
-
/* @__PURE__ */
|
|
25526
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25253
25527
|
className: `flex-1 px-4 sm:px-6 lg:px-12 pb-32 ${hideHeader ? "pt-8 sm:pt-10 lg:pt-14" : "pt-6 sm:pt-8 lg:pt-12"}`,
|
|
25254
25528
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25255
25529
|
className: "max-w-7xl mx-auto",
|
|
@@ -25257,11 +25531,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25257
25531
|
/* @__PURE__ */ jsxs91("div", {
|
|
25258
25532
|
className: "mb-10",
|
|
25259
25533
|
children: [
|
|
25260
|
-
/* @__PURE__ */
|
|
25534
|
+
/* @__PURE__ */ jsx103("h1", {
|
|
25261
25535
|
className: "text-2xl sm:text-3xl lg:text-4xl font-semibold text-foreground mb-3",
|
|
25262
25536
|
children: manageMode ? "Manage Providers" : "Welcome to otto"
|
|
25263
25537
|
}),
|
|
25264
|
-
/* @__PURE__ */
|
|
25538
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25265
25539
|
className: "text-lg text-muted-foreground max-w-2xl",
|
|
25266
25540
|
children: manageMode ? "Add or remove AI providers. Your changes are saved automatically." : "Setu is your default AI provider. GO plan credits are applied automatically."
|
|
25267
25541
|
})
|
|
@@ -25270,8 +25544,8 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25270
25544
|
/* @__PURE__ */ jsxs91("div", {
|
|
25271
25545
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-6 sm:gap-8",
|
|
25272
25546
|
children: [
|
|
25273
|
-
/* @__PURE__ */
|
|
25274
|
-
children: /* @__PURE__ */
|
|
25547
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25548
|
+
children: /* @__PURE__ */ jsx103("div", {
|
|
25275
25549
|
className: "bg-card rounded-2xl border border-border p-5",
|
|
25276
25550
|
children: authStatus.ottorouter.configured && authStatus.ottorouter.publicKey ? /* @__PURE__ */ jsxs91("div", {
|
|
25277
25551
|
className: "flex flex-col h-full",
|
|
@@ -25279,25 +25553,25 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25279
25553
|
/* @__PURE__ */ jsxs91("div", {
|
|
25280
25554
|
className: "flex items-center gap-2 px-3 py-2 bg-green-500/10 border border-green-500/20 rounded-lg",
|
|
25281
25555
|
children: [
|
|
25282
|
-
/* @__PURE__ */
|
|
25556
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25283
25557
|
provider: "ottorouter",
|
|
25284
25558
|
size: 16
|
|
25285
25559
|
}),
|
|
25286
|
-
/* @__PURE__ */
|
|
25560
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25287
25561
|
className: "text-sm font-medium text-green-600 dark:text-green-400",
|
|
25288
25562
|
children: "Setu"
|
|
25289
25563
|
}),
|
|
25290
|
-
/* @__PURE__ */
|
|
25564
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25291
25565
|
className: "text-xs text-green-600/60 dark:text-green-500/60 ml-auto",
|
|
25292
25566
|
children: "Default Provider"
|
|
25293
25567
|
})
|
|
25294
25568
|
]
|
|
25295
25569
|
}),
|
|
25296
|
-
/* @__PURE__ */
|
|
25570
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25297
25571
|
className: "flex justify-center py-4 mt-4",
|
|
25298
|
-
children: /* @__PURE__ */
|
|
25572
|
+
children: /* @__PURE__ */ jsx103("div", {
|
|
25299
25573
|
className: "bg-white p-2 rounded-lg",
|
|
25300
|
-
children: /* @__PURE__ */
|
|
25574
|
+
children: /* @__PURE__ */ jsx103(QRCodeSVG3, {
|
|
25301
25575
|
value: authStatus.ottorouter.publicKey,
|
|
25302
25576
|
size: 140,
|
|
25303
25577
|
level: "M"
|
|
@@ -25313,9 +25587,9 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25313
25587
|
className: "w-full flex items-center justify-center gap-2 px-3 py-2 bg-muted hover:bg-muted/80 rounded-lg text-xs font-mono text-muted-foreground transition-colors",
|
|
25314
25588
|
children: [
|
|
25315
25589
|
truncateAddress(authStatus.ottorouter.publicKey),
|
|
25316
|
-
copied ? /* @__PURE__ */
|
|
25590
|
+
copied ? /* @__PURE__ */ jsx103(Check13, {
|
|
25317
25591
|
className: "w-3.5 h-3.5 text-green-500"
|
|
25318
|
-
}) : /* @__PURE__ */
|
|
25592
|
+
}) : /* @__PURE__ */ jsx103(Copy5, {
|
|
25319
25593
|
className: "w-3.5 h-3.5 text-muted-foreground"
|
|
25320
25594
|
})
|
|
25321
25595
|
]
|
|
@@ -25326,19 +25600,19 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25326
25600
|
/* @__PURE__ */ jsxs91("div", {
|
|
25327
25601
|
className: "flex items-center justify-between gap-2",
|
|
25328
25602
|
children: [
|
|
25329
|
-
/* @__PURE__ */
|
|
25603
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25330
25604
|
className: "flex items-center gap-1.5 min-w-0",
|
|
25331
|
-
children: /* @__PURE__ */
|
|
25605
|
+
children: /* @__PURE__ */ jsx103("span", {
|
|
25332
25606
|
className: "font-mono text-xs sm:text-sm text-foreground truncate",
|
|
25333
25607
|
children: setuStatusLabel
|
|
25334
25608
|
})
|
|
25335
25609
|
}),
|
|
25336
|
-
/* @__PURE__ */
|
|
25610
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25337
25611
|
type: "button",
|
|
25338
25612
|
onClick: fetchBalance,
|
|
25339
25613
|
disabled: isBalanceLoading,
|
|
25340
25614
|
className: "p-0.5 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",
|
|
25341
|
-
children: /* @__PURE__ */
|
|
25615
|
+
children: /* @__PURE__ */ jsx103(RefreshCw11, {
|
|
25342
25616
|
className: `w-3 h-3 ${isBalanceLoading ? "animate-spin" : ""}`
|
|
25343
25617
|
})
|
|
25344
25618
|
})
|
|
@@ -25362,14 +25636,14 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25362
25636
|
/* @__PURE__ */ jsxs91("div", {
|
|
25363
25637
|
className: "flex items-center gap-4 py-4",
|
|
25364
25638
|
children: [
|
|
25365
|
-
/* @__PURE__ */
|
|
25639
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25366
25640
|
className: "flex-1 h-px bg-border"
|
|
25367
25641
|
}),
|
|
25368
|
-
/* @__PURE__ */
|
|
25642
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25369
25643
|
className: "text-xs text-muted-foreground font-medium",
|
|
25370
25644
|
children: "OR"
|
|
25371
25645
|
}),
|
|
25372
|
-
/* @__PURE__ */
|
|
25646
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25373
25647
|
className: "flex-1 h-px bg-border"
|
|
25374
25648
|
})
|
|
25375
25649
|
]
|
|
@@ -25379,7 +25653,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25379
25653
|
onClick: onOpenTopup,
|
|
25380
25654
|
className: "w-full flex items-center justify-center gap-2 px-4 py-2.5 bg-primary text-primary-foreground rounded-lg text-sm font-medium hover:bg-primary/90 transition-colors",
|
|
25381
25655
|
children: [
|
|
25382
|
-
/* @__PURE__ */
|
|
25656
|
+
/* @__PURE__ */ jsx103(CreditCard5, {
|
|
25383
25657
|
className: "w-4 h-4"
|
|
25384
25658
|
}),
|
|
25385
25659
|
"Top Up with Card"
|
|
@@ -25390,16 +25664,16 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25390
25664
|
onClick: handleOpenImportWallet,
|
|
25391
25665
|
className: "w-full mt-2 flex items-center justify-center gap-2 px-4 py-2.5 border border-border text-foreground rounded-lg text-sm font-medium hover:bg-muted/50 transition-colors",
|
|
25392
25666
|
children: [
|
|
25393
|
-
/* @__PURE__ */
|
|
25667
|
+
/* @__PURE__ */ jsx103(Key2, {
|
|
25394
25668
|
className: "w-4 h-4"
|
|
25395
25669
|
}),
|
|
25396
25670
|
"Import Wallet"
|
|
25397
25671
|
]
|
|
25398
25672
|
})
|
|
25399
25673
|
]
|
|
25400
|
-
}) : /* @__PURE__ */
|
|
25674
|
+
}) : /* @__PURE__ */ jsx103("div", {
|
|
25401
25675
|
className: "flex items-center justify-center py-16",
|
|
25402
|
-
children: /* @__PURE__ */
|
|
25676
|
+
children: /* @__PURE__ */ jsx103(Loader216, {
|
|
25403
25677
|
className: "w-8 h-8 animate-spin text-muted-foreground"
|
|
25404
25678
|
})
|
|
25405
25679
|
})
|
|
@@ -25413,7 +25687,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25413
25687
|
/* @__PURE__ */ jsxs91("div", {
|
|
25414
25688
|
className: "flex items-center justify-between mb-4",
|
|
25415
25689
|
children: [
|
|
25416
|
-
/* @__PURE__ */
|
|
25690
|
+
/* @__PURE__ */ jsx103("h2", {
|
|
25417
25691
|
className: "font-semibold text-foreground",
|
|
25418
25692
|
children: "Connected Providers"
|
|
25419
25693
|
}),
|
|
@@ -25426,54 +25700,54 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25426
25700
|
})
|
|
25427
25701
|
]
|
|
25428
25702
|
}),
|
|
25429
|
-
configuredProviders.length === 0 ? /* @__PURE__ */
|
|
25703
|
+
configuredProviders.length === 0 ? /* @__PURE__ */ jsx103("div", {
|
|
25430
25704
|
className: "text-sm text-muted-foreground py-4",
|
|
25431
25705
|
children: "No providers connected yet. Add one below."
|
|
25432
|
-
}) : /* @__PURE__ */
|
|
25706
|
+
}) : /* @__PURE__ */ jsx103("div", {
|
|
25433
25707
|
className: "flex flex-wrap gap-2",
|
|
25434
25708
|
children: configuredProviders.map(([id, info]) => /* @__PURE__ */ jsxs91("div", {
|
|
25435
25709
|
className: `flex items-center gap-2 pl-3 pr-2 py-2 rounded-full transition-all duration-200 ${confirmingDelete === id ? "bg-destructive/10 border border-destructive/30" : "group bg-green-500/10 border border-green-500/20"}`,
|
|
25436
25710
|
children: [
|
|
25437
|
-
/* @__PURE__ */
|
|
25711
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25438
25712
|
provider: id,
|
|
25439
25713
|
size: 16
|
|
25440
25714
|
}),
|
|
25441
|
-
/* @__PURE__ */
|
|
25715
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25442
25716
|
className: `text-sm font-medium transition-colors ${confirmingDelete === id ? "text-destructive" : "text-green-600 dark:text-green-400"}`,
|
|
25443
25717
|
children: info.label
|
|
25444
25718
|
}),
|
|
25445
|
-
confirmingDelete !== id && /* @__PURE__ */
|
|
25719
|
+
confirmingDelete !== id && /* @__PURE__ */ jsx103("span", {
|
|
25446
25720
|
className: "text-xs text-green-600/60 dark:text-green-500/60",
|
|
25447
25721
|
children: info.type === "oauth" ? "OAuth" : "API"
|
|
25448
25722
|
}),
|
|
25449
25723
|
confirmingDelete === id ? /* @__PURE__ */ jsxs91("div", {
|
|
25450
25724
|
className: "flex items-center gap-1 ml-1",
|
|
25451
25725
|
children: [
|
|
25452
|
-
/* @__PURE__ */
|
|
25726
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25453
25727
|
className: "text-xs text-destructive/80 mr-1",
|
|
25454
25728
|
children: "Remove?"
|
|
25455
25729
|
}),
|
|
25456
|
-
/* @__PURE__ */
|
|
25730
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25457
25731
|
type: "button",
|
|
25458
25732
|
onClick: () => handleRemoveProvider(id),
|
|
25459
25733
|
disabled: removingProvider === id,
|
|
25460
25734
|
className: "px-2 py-0.5 text-xs bg-destructive text-destructive-foreground rounded hover:bg-destructive/90 transition-colors disabled:opacity-50",
|
|
25461
|
-
children: removingProvider === id ? /* @__PURE__ */
|
|
25735
|
+
children: removingProvider === id ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25462
25736
|
className: "w-3 h-3 animate-spin"
|
|
25463
25737
|
}) : "Yes"
|
|
25464
25738
|
}),
|
|
25465
|
-
/* @__PURE__ */
|
|
25739
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25466
25740
|
type: "button",
|
|
25467
25741
|
onClick: handleCancelDelete,
|
|
25468
25742
|
className: "px-2 py-0.5 text-xs bg-muted text-muted-foreground rounded hover:bg-muted/80 transition-colors",
|
|
25469
25743
|
children: "No"
|
|
25470
25744
|
})
|
|
25471
25745
|
]
|
|
25472
|
-
}) : id !== "ottorouter" && /* @__PURE__ */
|
|
25746
|
+
}) : id !== "ottorouter" && /* @__PURE__ */ jsx103("button", {
|
|
25473
25747
|
type: "button",
|
|
25474
25748
|
onClick: () => handleRemoveProvider(id),
|
|
25475
25749
|
className: "ml-1 p-1 text-green-600/40 dark:text-green-500/40 hover:text-green-600/80 dark:hover:text-green-500/80 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
25476
|
-
children: /* @__PURE__ */
|
|
25750
|
+
children: /* @__PURE__ */ jsx103(X18, {
|
|
25477
25751
|
className: "w-3 h-3"
|
|
25478
25752
|
})
|
|
25479
25753
|
})
|
|
@@ -25484,24 +25758,24 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25484
25758
|
}),
|
|
25485
25759
|
/* @__PURE__ */ jsxs91("div", {
|
|
25486
25760
|
children: [
|
|
25487
|
-
/* @__PURE__ */
|
|
25761
|
+
/* @__PURE__ */ jsx103("h2", {
|
|
25488
25762
|
className: "font-semibold text-foreground mb-4",
|
|
25489
25763
|
children: "Add Providers"
|
|
25490
25764
|
}),
|
|
25491
|
-
/* @__PURE__ */
|
|
25765
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25492
25766
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-3 items-start",
|
|
25493
|
-
children: unconfiguredProviders.map(([id, info]) => /* @__PURE__ */
|
|
25767
|
+
children: unconfiguredProviders.map(([id, info]) => /* @__PURE__ */ jsx103("div", {
|
|
25494
25768
|
children: addingProvider === id ? /* @__PURE__ */ jsxs91("div", {
|
|
25495
25769
|
className: "flex items-center gap-2 p-3 bg-card border border-ring rounded-xl overflow-hidden",
|
|
25496
25770
|
children: [
|
|
25497
|
-
/* @__PURE__ */
|
|
25771
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25498
25772
|
className: "shrink-0",
|
|
25499
|
-
children: /* @__PURE__ */
|
|
25773
|
+
children: /* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25500
25774
|
provider: id,
|
|
25501
25775
|
size: 18
|
|
25502
25776
|
})
|
|
25503
25777
|
}),
|
|
25504
|
-
/* @__PURE__ */
|
|
25778
|
+
/* @__PURE__ */ jsx103("input", {
|
|
25505
25779
|
ref: apiKeyInputRef,
|
|
25506
25780
|
type: "password",
|
|
25507
25781
|
value: apiKeyInput,
|
|
@@ -25517,21 +25791,21 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25517
25791
|
}
|
|
25518
25792
|
}
|
|
25519
25793
|
}),
|
|
25520
|
-
/* @__PURE__ */
|
|
25794
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25521
25795
|
type: "button",
|
|
25522
25796
|
onClick: () => handleAddProvider(id),
|
|
25523
25797
|
disabled: !apiKeyInput.trim(),
|
|
25524
25798
|
className: "shrink-0 px-3 py-1.5 bg-primary text-primary-foreground text-sm font-medium rounded-lg disabled:opacity-50",
|
|
25525
25799
|
children: "Add"
|
|
25526
25800
|
}),
|
|
25527
|
-
/* @__PURE__ */
|
|
25801
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25528
25802
|
type: "button",
|
|
25529
25803
|
onClick: () => {
|
|
25530
25804
|
setAddingProvider(null);
|
|
25531
25805
|
setApiKeyInput("");
|
|
25532
25806
|
},
|
|
25533
25807
|
className: "shrink-0 p-1.5 text-muted-foreground hover:text-foreground",
|
|
25534
|
-
children: /* @__PURE__ */
|
|
25808
|
+
children: /* @__PURE__ */ jsx103(X18, {
|
|
25535
25809
|
className: "w-4 h-4"
|
|
25536
25810
|
})
|
|
25537
25811
|
})
|
|
@@ -25542,14 +25816,14 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25542
25816
|
/* @__PURE__ */ jsxs91("div", {
|
|
25543
25817
|
className: "flex items-center gap-3 min-w-0",
|
|
25544
25818
|
children: [
|
|
25545
|
-
/* @__PURE__ */
|
|
25819
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25546
25820
|
provider: id,
|
|
25547
25821
|
size: 20
|
|
25548
25822
|
}),
|
|
25549
25823
|
/* @__PURE__ */ jsxs91("div", {
|
|
25550
25824
|
className: "min-w-0",
|
|
25551
25825
|
children: [
|
|
25552
|
-
/* @__PURE__ */
|
|
25826
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25553
25827
|
className: "font-medium text-foreground truncate",
|
|
25554
25828
|
children: info.label
|
|
25555
25829
|
}),
|
|
@@ -25572,7 +25846,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25572
25846
|
onClick: () => setAddingProvider(id),
|
|
25573
25847
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-sm text-muted-foreground hover:text-foreground hover:bg-muted rounded-lg transition-colors",
|
|
25574
25848
|
children: [
|
|
25575
|
-
/* @__PURE__ */
|
|
25849
|
+
/* @__PURE__ */ jsx103(Key2, {
|
|
25576
25850
|
className: "w-3.5 h-3.5"
|
|
25577
25851
|
}),
|
|
25578
25852
|
"API"
|
|
@@ -25583,7 +25857,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25583
25857
|
onClick: () => handleStartOAuth(id, id === "anthropic" ? "max" : undefined),
|
|
25584
25858
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-sm text-muted-foreground hover:text-foreground hover:bg-muted rounded-lg transition-colors",
|
|
25585
25859
|
children: [
|
|
25586
|
-
/* @__PURE__ */
|
|
25860
|
+
/* @__PURE__ */ jsx103(ExternalLink10, {
|
|
25587
25861
|
className: "w-3.5 h-3.5"
|
|
25588
25862
|
}),
|
|
25589
25863
|
id === "anthropic" ? "Pro" : id === "copilot" ? "Login" : "OAuth"
|
|
@@ -25604,16 +25878,16 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25604
25878
|
]
|
|
25605
25879
|
})
|
|
25606
25880
|
}),
|
|
25607
|
-
/* @__PURE__ */
|
|
25881
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25608
25882
|
className: "fixed bottom-0 left-0 right-0 px-4 sm:px-6 py-4 border-t border-border bg-background",
|
|
25609
25883
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25610
25884
|
className: "max-w-7xl mx-auto flex items-center justify-between",
|
|
25611
25885
|
children: [
|
|
25612
|
-
!manageMode && /* @__PURE__ */
|
|
25886
|
+
!manageMode && /* @__PURE__ */ jsx103("div", {
|
|
25613
25887
|
className: "text-xs sm:text-sm text-muted-foreground hidden sm:block",
|
|
25614
25888
|
children: "You can add more providers later in settings"
|
|
25615
25889
|
}),
|
|
25616
|
-
manageMode ? /* @__PURE__ */
|
|
25890
|
+
manageMode ? /* @__PURE__ */ jsx103("button", {
|
|
25617
25891
|
type: "button",
|
|
25618
25892
|
onClick: onClose,
|
|
25619
25893
|
className: "flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg font-medium hover:bg-primary/90 transition-colors ml-auto",
|
|
@@ -25624,7 +25898,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25624
25898
|
className: "flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg font-medium hover:bg-primary/90 transition-colors",
|
|
25625
25899
|
children: [
|
|
25626
25900
|
"Continue",
|
|
25627
|
-
/* @__PURE__ */
|
|
25901
|
+
/* @__PURE__ */ jsx103(ArrowRight2, {
|
|
25628
25902
|
className: "w-4 h-4"
|
|
25629
25903
|
})
|
|
25630
25904
|
]
|
|
@@ -25632,7 +25906,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25632
25906
|
]
|
|
25633
25907
|
})
|
|
25634
25908
|
}),
|
|
25635
|
-
isImportModalOpen && /* @__PURE__ */
|
|
25909
|
+
isImportModalOpen && /* @__PURE__ */ jsx103("div", {
|
|
25636
25910
|
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
25637
25911
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25638
25912
|
className: "bg-background border border-border rounded-xl w-full max-w-lg mx-6 shadow-2xl",
|
|
@@ -25640,11 +25914,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25640
25914
|
/* @__PURE__ */ jsxs91("div", {
|
|
25641
25915
|
className: "flex items-center gap-3 p-6 border-b border-border",
|
|
25642
25916
|
children: [
|
|
25643
|
-
/* @__PURE__ */
|
|
25917
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25644
25918
|
provider: "ottorouter",
|
|
25645
25919
|
size: 24
|
|
25646
25920
|
}),
|
|
25647
|
-
/* @__PURE__ */
|
|
25921
|
+
/* @__PURE__ */ jsx103("h3", {
|
|
25648
25922
|
className: "text-lg font-semibold",
|
|
25649
25923
|
children: "Import Setu Wallet"
|
|
25650
25924
|
})
|
|
@@ -25653,11 +25927,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25653
25927
|
/* @__PURE__ */ jsxs91("div", {
|
|
25654
25928
|
className: "p-6",
|
|
25655
25929
|
children: [
|
|
25656
|
-
/* @__PURE__ */
|
|
25930
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25657
25931
|
className: "text-sm text-muted-foreground mb-4",
|
|
25658
25932
|
children: "Paste your base58 private key to replace the current wallet used for Setu."
|
|
25659
25933
|
}),
|
|
25660
|
-
/* @__PURE__ */
|
|
25934
|
+
/* @__PURE__ */ jsx103("textarea", {
|
|
25661
25935
|
ref: importPrivateKeyRef,
|
|
25662
25936
|
value: importPrivateKey,
|
|
25663
25937
|
onChange: (e) => setImportPrivateKey(e.target.value),
|
|
@@ -25672,26 +25946,26 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25672
25946
|
handleCloseImportWallet();
|
|
25673
25947
|
}
|
|
25674
25948
|
}),
|
|
25675
|
-
importWalletError && /* @__PURE__ */
|
|
25949
|
+
importWalletError && /* @__PURE__ */ jsx103("p", {
|
|
25676
25950
|
className: "text-sm text-red-500 mt-3",
|
|
25677
25951
|
children: importWalletError
|
|
25678
25952
|
}),
|
|
25679
25953
|
/* @__PURE__ */ jsxs91("div", {
|
|
25680
25954
|
className: "flex gap-3 mt-5",
|
|
25681
25955
|
children: [
|
|
25682
|
-
/* @__PURE__ */
|
|
25956
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25683
25957
|
type: "button",
|
|
25684
25958
|
onClick: handleCloseImportWallet,
|
|
25685
25959
|
disabled: isImportingWallet,
|
|
25686
25960
|
className: "flex-1 h-11 px-4 bg-transparent border border-border text-foreground rounded-lg font-medium hover:bg-muted/50 transition-colors disabled:opacity-50",
|
|
25687
25961
|
children: "Cancel"
|
|
25688
25962
|
}),
|
|
25689
|
-
/* @__PURE__ */
|
|
25963
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25690
25964
|
type: "button",
|
|
25691
25965
|
onClick: handleImportWallet,
|
|
25692
25966
|
disabled: !importPrivateKey.trim() || isImportingWallet,
|
|
25693
25967
|
className: "flex-1 h-11 px-4 bg-foreground text-background rounded-lg font-medium hover:bg-foreground/90 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",
|
|
25694
|
-
children: isImportingWallet ? /* @__PURE__ */
|
|
25968
|
+
children: isImportingWallet ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25695
25969
|
className: "w-4 h-4 animate-spin"
|
|
25696
25970
|
}) : "Import Wallet"
|
|
25697
25971
|
})
|
|
@@ -25702,7 +25976,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25702
25976
|
]
|
|
25703
25977
|
})
|
|
25704
25978
|
}),
|
|
25705
|
-
oauthSession && /* @__PURE__ */
|
|
25979
|
+
oauthSession && /* @__PURE__ */ jsx103("div", {
|
|
25706
25980
|
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
25707
25981
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25708
25982
|
className: "bg-background border border-border rounded-xl w-full max-w-lg mx-6 shadow-2xl",
|
|
@@ -25710,7 +25984,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25710
25984
|
/* @__PURE__ */ jsxs91("div", {
|
|
25711
25985
|
className: "flex items-center gap-3 p-6 border-b border-border",
|
|
25712
25986
|
children: [
|
|
25713
|
-
/* @__PURE__ */
|
|
25987
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25714
25988
|
provider: oauthSession.provider,
|
|
25715
25989
|
size: 24
|
|
25716
25990
|
}),
|
|
@@ -25740,23 +26014,23 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25740
26014
|
/* @__PURE__ */ jsxs91("div", {
|
|
25741
26015
|
className: "flex gap-3",
|
|
25742
26016
|
children: [
|
|
25743
|
-
/* @__PURE__ */
|
|
26017
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25744
26018
|
type: "button",
|
|
25745
26019
|
onClick: handleCancelOAuth,
|
|
25746
26020
|
className: "flex-1 h-11 px-4 bg-transparent border border-border text-foreground rounded-lg font-medium hover:bg-muted/50 transition-colors",
|
|
25747
26021
|
children: "Cancel"
|
|
25748
26022
|
}),
|
|
25749
|
-
/* @__PURE__ */
|
|
26023
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25750
26024
|
type: "button",
|
|
25751
26025
|
onClick: handleOpenPopup,
|
|
25752
26026
|
disabled: isOpeningPopup,
|
|
25753
26027
|
className: "flex-1 h-11 px-4 bg-foreground text-background rounded-lg font-medium hover:bg-foreground/90 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",
|
|
25754
|
-
children: isOpeningPopup ? /* @__PURE__ */
|
|
26028
|
+
children: isOpeningPopup ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25755
26029
|
className: "w-4 h-4 animate-spin"
|
|
25756
26030
|
}) : /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25757
26031
|
children: [
|
|
25758
26032
|
"Continue",
|
|
25759
|
-
/* @__PURE__ */
|
|
26033
|
+
/* @__PURE__ */ jsx103(ExternalLink10, {
|
|
25760
26034
|
className: "w-4 h-4"
|
|
25761
26035
|
})
|
|
25762
26036
|
]
|
|
@@ -25768,11 +26042,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25768
26042
|
}) : /* @__PURE__ */ jsxs91("div", {
|
|
25769
26043
|
className: "p-6",
|
|
25770
26044
|
children: [
|
|
25771
|
-
/* @__PURE__ */
|
|
26045
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25772
26046
|
className: "text-sm text-muted-foreground mb-4",
|
|
25773
26047
|
children: "Paste the authorization code:"
|
|
25774
26048
|
}),
|
|
25775
|
-
/* @__PURE__ */
|
|
26049
|
+
/* @__PURE__ */ jsx103("input", {
|
|
25776
26050
|
type: "text",
|
|
25777
26051
|
ref: oauthCodeInputRef,
|
|
25778
26052
|
value: oauthCodeInput,
|
|
@@ -25789,18 +26063,18 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25789
26063
|
/* @__PURE__ */ jsxs91("div", {
|
|
25790
26064
|
className: "flex gap-3",
|
|
25791
26065
|
children: [
|
|
25792
|
-
/* @__PURE__ */
|
|
26066
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25793
26067
|
type: "button",
|
|
25794
26068
|
onClick: handleCancelOAuth,
|
|
25795
26069
|
className: "flex-1 h-11 px-4 bg-transparent border border-border text-foreground rounded-lg font-medium hover:bg-muted/50 transition-colors",
|
|
25796
26070
|
children: "Cancel"
|
|
25797
26071
|
}),
|
|
25798
|
-
/* @__PURE__ */
|
|
26072
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25799
26073
|
type: "button",
|
|
25800
26074
|
onClick: handleExchangeCode,
|
|
25801
26075
|
disabled: !oauthCodeInput.trim() || isExchangingCode,
|
|
25802
26076
|
className: "flex-1 h-11 px-4 bg-foreground text-background rounded-lg font-medium hover:bg-foreground/90 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",
|
|
25803
|
-
children: isExchangingCode ? /* @__PURE__ */
|
|
26077
|
+
children: isExchangingCode ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25804
26078
|
className: "w-4 h-4 animate-spin"
|
|
25805
26079
|
}) : "Connect"
|
|
25806
26080
|
})
|
|
@@ -25811,7 +26085,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25811
26085
|
]
|
|
25812
26086
|
})
|
|
25813
26087
|
}),
|
|
25814
|
-
copilotModalOpen && /* @__PURE__ */
|
|
26088
|
+
copilotModalOpen && /* @__PURE__ */ jsx103("div", {
|
|
25815
26089
|
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
25816
26090
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25817
26091
|
className: "bg-background border border-border rounded-xl w-full max-w-lg mx-6 shadow-2xl",
|
|
@@ -25819,11 +26093,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25819
26093
|
/* @__PURE__ */ jsxs91("div", {
|
|
25820
26094
|
className: "flex items-center gap-3 p-6 border-b border-border",
|
|
25821
26095
|
children: [
|
|
25822
|
-
/* @__PURE__ */
|
|
26096
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25823
26097
|
provider: "copilot",
|
|
25824
26098
|
size: 24
|
|
25825
26099
|
}),
|
|
25826
|
-
/* @__PURE__ */
|
|
26100
|
+
/* @__PURE__ */ jsx103("h3", {
|
|
25827
26101
|
className: "text-lg font-semibold",
|
|
25828
26102
|
children: "Connect GitHub Copilot"
|
|
25829
26103
|
})
|
|
@@ -25835,13 +26109,13 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25835
26109
|
/* @__PURE__ */ jsxs91("div", {
|
|
25836
26110
|
className: "flex items-center gap-2",
|
|
25837
26111
|
children: [
|
|
25838
|
-
/* @__PURE__ */
|
|
26112
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25839
26113
|
type: "button",
|
|
25840
26114
|
onClick: () => handleCopilotSwitchMode("oauth"),
|
|
25841
26115
|
className: `px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${copilotAuthMode === "oauth" ? "bg-foreground text-background" : "bg-muted text-muted-foreground hover:text-foreground"}`,
|
|
25842
26116
|
children: "OAuth"
|
|
25843
26117
|
}),
|
|
25844
|
-
/* @__PURE__ */
|
|
26118
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25845
26119
|
type: "button",
|
|
25846
26120
|
onClick: () => handleCopilotSwitchMode("token"),
|
|
25847
26121
|
className: `px-3 py-1.5 rounded-lg text-sm font-medium transition-colors ${copilotAuthMode === "token" ? "bg-foreground text-background" : "bg-muted text-muted-foreground hover:text-foreground"}`,
|
|
@@ -25851,30 +26125,30 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25851
26125
|
}),
|
|
25852
26126
|
copilotAuthMode === "oauth" ? /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25853
26127
|
children: [
|
|
25854
|
-
/* @__PURE__ */
|
|
26128
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25855
26129
|
className: "text-sm text-muted-foreground",
|
|
25856
26130
|
children: "Enter this code on GitHub to authorize:"
|
|
25857
26131
|
}),
|
|
25858
|
-
/* @__PURE__ */
|
|
26132
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25859
26133
|
className: "flex items-center justify-center gap-3",
|
|
25860
|
-
children: copilotLoading ? /* @__PURE__ */
|
|
26134
|
+
children: copilotLoading ? /* @__PURE__ */ jsx103("div", {
|
|
25861
26135
|
className: "bg-muted px-6 py-3 rounded-lg animate-pulse",
|
|
25862
|
-
children: /* @__PURE__ */
|
|
26136
|
+
children: /* @__PURE__ */ jsx103("div", {
|
|
25863
26137
|
className: "h-9 w-48 bg-muted-foreground/20 rounded"
|
|
25864
26138
|
})
|
|
25865
26139
|
}) : copilotDevice ? /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25866
26140
|
children: [
|
|
25867
|
-
/* @__PURE__ */
|
|
26141
|
+
/* @__PURE__ */ jsx103("code", {
|
|
25868
26142
|
className: "text-3xl font-mono font-bold tracking-widest text-foreground bg-muted px-6 py-3 rounded-lg select-all",
|
|
25869
26143
|
children: copilotDevice.userCode
|
|
25870
26144
|
}),
|
|
25871
|
-
/* @__PURE__ */
|
|
26145
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25872
26146
|
type: "button",
|
|
25873
26147
|
onClick: handleCopilotCopyCode,
|
|
25874
26148
|
className: "p-2 text-muted-foreground hover:text-foreground transition-colors",
|
|
25875
|
-
children: copilotCodeCopied ? /* @__PURE__ */
|
|
26149
|
+
children: copilotCodeCopied ? /* @__PURE__ */ jsx103(Check13, {
|
|
25876
26150
|
className: "w-5 h-5 text-green-500"
|
|
25877
|
-
}) : /* @__PURE__ */
|
|
26151
|
+
}) : /* @__PURE__ */ jsx103(Copy5, {
|
|
25878
26152
|
className: "w-5 h-5"
|
|
25879
26153
|
})
|
|
25880
26154
|
})
|
|
@@ -25884,37 +26158,37 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25884
26158
|
]
|
|
25885
26159
|
}) : /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25886
26160
|
children: [
|
|
25887
|
-
/* @__PURE__ */
|
|
26161
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25888
26162
|
className: "text-sm text-muted-foreground",
|
|
25889
26163
|
children: "Paste a GitHub token with Copilot model access."
|
|
25890
26164
|
}),
|
|
25891
|
-
/* @__PURE__ */
|
|
26165
|
+
/* @__PURE__ */ jsx103("input", {
|
|
25892
26166
|
type: "password",
|
|
25893
26167
|
value: copilotTokenInput,
|
|
25894
26168
|
onChange: (e) => setCopilotTokenInput(e.target.value),
|
|
25895
26169
|
placeholder: "gho_...",
|
|
25896
26170
|
className: "w-full h-11 px-4 bg-muted/50 border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus:border-foreground/30 transition-colors"
|
|
25897
26171
|
}),
|
|
25898
|
-
copilotAuthMethods?.ghImport.available && /* @__PURE__ */
|
|
26172
|
+
copilotAuthMethods?.ghImport.available && /* @__PURE__ */ jsx103("button", {
|
|
25899
26173
|
type: "button",
|
|
25900
26174
|
onClick: handleCopilotImportFromGh,
|
|
25901
26175
|
disabled: copilotGhImporting,
|
|
25902
26176
|
className: "w-full h-10 px-4 bg-muted text-foreground rounded-lg font-medium hover:bg-muted/80 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",
|
|
25903
|
-
children: copilotGhImporting ? /* @__PURE__ */
|
|
26177
|
+
children: copilotGhImporting ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25904
26178
|
className: "w-4 h-4 animate-spin"
|
|
25905
26179
|
}) : "Import from GH CLI"
|
|
25906
26180
|
}),
|
|
25907
|
-
copilotAuthMethods?.ghImport.available && !copilotAuthMethods.ghImport.authenticated && /* @__PURE__ */
|
|
26181
|
+
copilotAuthMethods?.ghImport.available && !copilotAuthMethods.ghImport.authenticated && /* @__PURE__ */ jsx103("p", {
|
|
25908
26182
|
className: "text-xs text-muted-foreground",
|
|
25909
26183
|
children: copilotAuthMethods.ghImport.reason || "GitHub CLI is not authenticated"
|
|
25910
26184
|
}),
|
|
25911
|
-
copilotAuthMethods && !copilotAuthMethods.ghImport.available && copilotAuthMethods.ghImport.reason && /* @__PURE__ */
|
|
26185
|
+
copilotAuthMethods && !copilotAuthMethods.ghImport.available && copilotAuthMethods.ghImport.reason && /* @__PURE__ */ jsx103("p", {
|
|
25912
26186
|
className: "text-xs text-muted-foreground",
|
|
25913
26187
|
children: copilotAuthMethods.ghImport.reason
|
|
25914
26188
|
})
|
|
25915
26189
|
]
|
|
25916
26190
|
}),
|
|
25917
|
-
copilotDiagnostics && copilotDiagnostics.tokenSources.length > 0 && /* @__PURE__ */
|
|
26191
|
+
copilotDiagnostics && copilotDiagnostics.tokenSources.length > 0 && /* @__PURE__ */ jsx103("div", {
|
|
25918
26192
|
className: "text-xs text-muted-foreground space-y-1",
|
|
25919
26193
|
children: copilotDiagnostics.tokenSources.map((source) => /* @__PURE__ */ jsxs91("div", {
|
|
25920
26194
|
children: [
|
|
@@ -25926,14 +26200,14 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25926
26200
|
]
|
|
25927
26201
|
}, source.source))
|
|
25928
26202
|
}),
|
|
25929
|
-
copilotError && /* @__PURE__ */
|
|
26203
|
+
copilotError && /* @__PURE__ */ jsx103("p", {
|
|
25930
26204
|
className: "text-sm text-red-500 text-center",
|
|
25931
26205
|
children: copilotError
|
|
25932
26206
|
}),
|
|
25933
26207
|
copilotPolling && copilotAuthMode === "oauth" && /* @__PURE__ */ jsxs91("div", {
|
|
25934
26208
|
className: "flex items-center justify-center gap-2 text-sm text-muted-foreground",
|
|
25935
26209
|
children: [
|
|
25936
|
-
/* @__PURE__ */
|
|
26210
|
+
/* @__PURE__ */ jsx103(Loader216, {
|
|
25937
26211
|
className: "w-4 h-4 animate-spin"
|
|
25938
26212
|
}),
|
|
25939
26213
|
"Waiting for authorization..."
|
|
@@ -25942,33 +26216,33 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25942
26216
|
/* @__PURE__ */ jsxs91("div", {
|
|
25943
26217
|
className: "flex gap-3",
|
|
25944
26218
|
children: [
|
|
25945
|
-
/* @__PURE__ */
|
|
26219
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25946
26220
|
type: "button",
|
|
25947
26221
|
onClick: handleCancelCopilot,
|
|
25948
26222
|
className: "flex-1 h-11 px-4 bg-transparent border border-border text-foreground rounded-lg font-medium hover:bg-muted/50 transition-colors",
|
|
25949
26223
|
children: "Cancel"
|
|
25950
26224
|
}),
|
|
25951
|
-
copilotAuthMode === "oauth" ? /* @__PURE__ */
|
|
26225
|
+
copilotAuthMode === "oauth" ? /* @__PURE__ */ jsx103("button", {
|
|
25952
26226
|
type: "button",
|
|
25953
26227
|
onClick: handleCopilotOpenGithub,
|
|
25954
26228
|
disabled: copilotPolling || copilotLoading,
|
|
25955
26229
|
className: "flex-1 h-11 px-4 bg-foreground text-background rounded-lg font-medium hover:bg-foreground/90 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",
|
|
25956
|
-
children: copilotPolling || copilotLoading ? /* @__PURE__ */
|
|
26230
|
+
children: copilotPolling || copilotLoading ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25957
26231
|
className: "w-4 h-4 animate-spin"
|
|
25958
26232
|
}) : /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25959
26233
|
children: [
|
|
25960
26234
|
"Open GitHub",
|
|
25961
|
-
/* @__PURE__ */
|
|
26235
|
+
/* @__PURE__ */ jsx103(ExternalLink10, {
|
|
25962
26236
|
className: "w-4 h-4"
|
|
25963
26237
|
})
|
|
25964
26238
|
]
|
|
25965
26239
|
})
|
|
25966
|
-
}) : /* @__PURE__ */
|
|
26240
|
+
}) : /* @__PURE__ */ jsx103("button", {
|
|
25967
26241
|
type: "button",
|
|
25968
26242
|
onClick: handleCopilotSaveToken,
|
|
25969
26243
|
disabled: !copilotTokenInput.trim() || copilotTokenSaving,
|
|
25970
26244
|
className: "flex-1 h-11 px-4 bg-foreground text-background rounded-lg font-medium hover:bg-foreground/90 transition-colors disabled:opacity-50 flex items-center justify-center gap-2",
|
|
25971
|
-
children: copilotTokenSaving ? /* @__PURE__ */
|
|
26245
|
+
children: copilotTokenSaving ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25972
26246
|
className: "w-4 h-4 animate-spin"
|
|
25973
26247
|
}) : "Save token"
|
|
25974
26248
|
})
|
|
@@ -25984,10 +26258,10 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25984
26258
|
});
|
|
25985
26259
|
|
|
25986
26260
|
// src/components/onboarding/steps/DefaultsStep.tsx
|
|
25987
|
-
import { memo as
|
|
25988
|
-
import { Loader2 as
|
|
25989
|
-
import { jsx as
|
|
25990
|
-
var DefaultsStep =
|
|
26261
|
+
import { memo as memo47, useState as useState45, useEffect as useEffect47, useId as useId3, useRef as useRef32 } from "react";
|
|
26262
|
+
import { Loader2 as Loader217, ArrowLeft, Sparkles as Sparkles8, ChevronDown as ChevronDown12 } from "lucide-react";
|
|
26263
|
+
import { jsx as jsx104, jsxs as jsxs92, Fragment as Fragment40 } from "react/jsx-runtime";
|
|
26264
|
+
var DefaultsStep = memo47(function DefaultsStep2({
|
|
25991
26265
|
authStatus,
|
|
25992
26266
|
onComplete,
|
|
25993
26267
|
onBack,
|
|
@@ -26072,9 +26346,9 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26072
26346
|
}
|
|
26073
26347
|
};
|
|
26074
26348
|
if (isLoading) {
|
|
26075
|
-
return /* @__PURE__ */
|
|
26349
|
+
return /* @__PURE__ */ jsx104("div", {
|
|
26076
26350
|
className: "min-h-screen flex items-center justify-center",
|
|
26077
|
-
children: /* @__PURE__ */
|
|
26351
|
+
children: /* @__PURE__ */ jsx104(Loader217, {
|
|
26078
26352
|
className: "w-8 h-8 animate-spin text-muted-foreground"
|
|
26079
26353
|
})
|
|
26080
26354
|
});
|
|
@@ -26090,11 +26364,11 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26090
26364
|
/* @__PURE__ */ jsxs92("div", {
|
|
26091
26365
|
className: "flex items-center gap-3",
|
|
26092
26366
|
children: [
|
|
26093
|
-
/* @__PURE__ */
|
|
26367
|
+
/* @__PURE__ */ jsx104(ProviderLogo, {
|
|
26094
26368
|
provider: "ottorouter",
|
|
26095
26369
|
size: 24
|
|
26096
26370
|
}),
|
|
26097
|
-
/* @__PURE__ */
|
|
26371
|
+
/* @__PURE__ */ jsx104("span", {
|
|
26098
26372
|
className: "font-semibold text-foreground",
|
|
26099
26373
|
children: "otto"
|
|
26100
26374
|
})
|
|
@@ -26103,7 +26377,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26103
26377
|
/* @__PURE__ */ jsxs92("div", {
|
|
26104
26378
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
26105
26379
|
children: [
|
|
26106
|
-
/* @__PURE__ */
|
|
26380
|
+
/* @__PURE__ */ jsx104("span", {
|
|
26107
26381
|
className: "w-2 h-2 rounded-full bg-blue-500"
|
|
26108
26382
|
}),
|
|
26109
26383
|
"Step 2 of 2"
|
|
@@ -26111,7 +26385,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26111
26385
|
})
|
|
26112
26386
|
]
|
|
26113
26387
|
}),
|
|
26114
|
-
/* @__PURE__ */
|
|
26388
|
+
/* @__PURE__ */ jsx104("div", {
|
|
26115
26389
|
className: `flex-1 px-4 sm:px-6 lg:px-12 pb-32 ${hideHeader ? "pt-8 sm:pt-10 lg:pt-14" : "pt-6 sm:pt-8 lg:pt-12"}`,
|
|
26116
26390
|
children: /* @__PURE__ */ jsxs92("div", {
|
|
26117
26391
|
className: "max-w-7xl mx-auto",
|
|
@@ -26119,11 +26393,11 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26119
26393
|
/* @__PURE__ */ jsxs92("div", {
|
|
26120
26394
|
className: "mb-10",
|
|
26121
26395
|
children: [
|
|
26122
|
-
/* @__PURE__ */
|
|
26396
|
+
/* @__PURE__ */ jsx104("h1", {
|
|
26123
26397
|
className: "text-3xl lg:text-4xl font-semibold text-foreground mb-3",
|
|
26124
26398
|
children: "Configure Defaults"
|
|
26125
26399
|
}),
|
|
26126
|
-
/* @__PURE__ */
|
|
26400
|
+
/* @__PURE__ */ jsx104("p", {
|
|
26127
26401
|
className: "text-lg text-muted-foreground",
|
|
26128
26402
|
children: "Set your preferences. You can change these anytime in settings."
|
|
26129
26403
|
})
|
|
@@ -26135,7 +26409,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26135
26409
|
/* @__PURE__ */ jsxs92("div", {
|
|
26136
26410
|
className: "md:col-span-2",
|
|
26137
26411
|
children: [
|
|
26138
|
-
/* @__PURE__ */
|
|
26412
|
+
/* @__PURE__ */ jsx104("label", {
|
|
26139
26413
|
htmlFor: providerId,
|
|
26140
26414
|
className: "block text-sm font-medium text-muted-foreground mb-2",
|
|
26141
26415
|
children: "Default Provider"
|
|
@@ -26143,7 +26417,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26143
26417
|
/* @__PURE__ */ jsxs92("div", {
|
|
26144
26418
|
className: "relative",
|
|
26145
26419
|
children: [
|
|
26146
|
-
/* @__PURE__ */
|
|
26420
|
+
/* @__PURE__ */ jsx104("select", {
|
|
26147
26421
|
id: providerId,
|
|
26148
26422
|
value: selectedProvider,
|
|
26149
26423
|
onChange: (e) => {
|
|
@@ -26151,12 +26425,12 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26151
26425
|
setSelectedProvider(e.target.value);
|
|
26152
26426
|
},
|
|
26153
26427
|
className: "w-full px-4 py-3 bg-card border border-border rounded-xl text-foreground appearance-none cursor-pointer focus:outline-none focus:border-ring transition-colors",
|
|
26154
|
-
children: availableProviders.map((p) => /* @__PURE__ */
|
|
26428
|
+
children: availableProviders.map((p) => /* @__PURE__ */ jsx104("option", {
|
|
26155
26429
|
value: p,
|
|
26156
26430
|
children: authStatus.providers[p]?.label || p
|
|
26157
26431
|
}, p))
|
|
26158
26432
|
}),
|
|
26159
|
-
/* @__PURE__ */
|
|
26433
|
+
/* @__PURE__ */ jsx104(ChevronDown12, {
|
|
26160
26434
|
className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground pointer-events-none"
|
|
26161
26435
|
})
|
|
26162
26436
|
]
|
|
@@ -26166,7 +26440,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26166
26440
|
/* @__PURE__ */ jsxs92("div", {
|
|
26167
26441
|
className: "md:col-span-2",
|
|
26168
26442
|
children: [
|
|
26169
|
-
/* @__PURE__ */
|
|
26443
|
+
/* @__PURE__ */ jsx104("label", {
|
|
26170
26444
|
htmlFor: modelId,
|
|
26171
26445
|
className: "block text-sm font-medium text-muted-foreground mb-2",
|
|
26172
26446
|
children: "Default Model"
|
|
@@ -26174,17 +26448,17 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26174
26448
|
/* @__PURE__ */ jsxs92("div", {
|
|
26175
26449
|
className: "relative",
|
|
26176
26450
|
children: [
|
|
26177
|
-
/* @__PURE__ */
|
|
26451
|
+
/* @__PURE__ */ jsx104("select", {
|
|
26178
26452
|
id: modelId,
|
|
26179
26453
|
value: selectedModel,
|
|
26180
26454
|
onChange: (e) => setSelectedModel(e.target.value),
|
|
26181
26455
|
className: "w-full px-4 py-3 bg-card border border-border rounded-xl text-foreground appearance-none cursor-pointer focus:outline-none focus:border-ring transition-colors",
|
|
26182
|
-
children: currentProviderModels.map((m) => /* @__PURE__ */
|
|
26456
|
+
children: currentProviderModels.map((m) => /* @__PURE__ */ jsx104("option", {
|
|
26183
26457
|
value: m.id,
|
|
26184
26458
|
children: m.label || m.id
|
|
26185
26459
|
}, m.id))
|
|
26186
26460
|
}),
|
|
26187
|
-
/* @__PURE__ */
|
|
26461
|
+
/* @__PURE__ */ jsx104(ChevronDown12, {
|
|
26188
26462
|
className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground pointer-events-none"
|
|
26189
26463
|
})
|
|
26190
26464
|
]
|
|
@@ -26193,7 +26467,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26193
26467
|
}),
|
|
26194
26468
|
/* @__PURE__ */ jsxs92("div", {
|
|
26195
26469
|
children: [
|
|
26196
|
-
/* @__PURE__ */
|
|
26470
|
+
/* @__PURE__ */ jsx104("label", {
|
|
26197
26471
|
htmlFor: agentId,
|
|
26198
26472
|
className: "block text-sm font-medium text-muted-foreground mb-2",
|
|
26199
26473
|
children: "Default Agent"
|
|
@@ -26201,17 +26475,17 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26201
26475
|
/* @__PURE__ */ jsxs92("div", {
|
|
26202
26476
|
className: "relative",
|
|
26203
26477
|
children: [
|
|
26204
|
-
/* @__PURE__ */
|
|
26478
|
+
/* @__PURE__ */ jsx104("select", {
|
|
26205
26479
|
id: agentId,
|
|
26206
26480
|
value: selectedAgent,
|
|
26207
26481
|
onChange: (e) => setSelectedAgent(e.target.value),
|
|
26208
26482
|
className: "w-full px-4 py-3 bg-card border border-border rounded-xl text-foreground appearance-none cursor-pointer focus:outline-none focus:border-ring transition-colors",
|
|
26209
|
-
children: (config2?.agents || ["build"]).map((a) => /* @__PURE__ */
|
|
26483
|
+
children: (config2?.agents || ["build"]).map((a) => /* @__PURE__ */ jsx104("option", {
|
|
26210
26484
|
value: a,
|
|
26211
26485
|
children: a
|
|
26212
26486
|
}, a))
|
|
26213
26487
|
}),
|
|
26214
|
-
/* @__PURE__ */
|
|
26488
|
+
/* @__PURE__ */ jsx104(ChevronDown12, {
|
|
26215
26489
|
className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground pointer-events-none"
|
|
26216
26490
|
})
|
|
26217
26491
|
]
|
|
@@ -26220,7 +26494,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26220
26494
|
}),
|
|
26221
26495
|
/* @__PURE__ */ jsxs92("div", {
|
|
26222
26496
|
children: [
|
|
26223
|
-
/* @__PURE__ */
|
|
26497
|
+
/* @__PURE__ */ jsx104("label", {
|
|
26224
26498
|
htmlFor: approvalId,
|
|
26225
26499
|
className: "block text-sm font-medium text-muted-foreground mb-2",
|
|
26226
26500
|
children: "Tool Approval"
|
|
@@ -26234,59 +26508,59 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26234
26508
|
onChange: (e) => setSelectedApproval(e.target.value),
|
|
26235
26509
|
className: "w-full px-4 py-3 bg-card border border-border rounded-xl text-foreground appearance-none cursor-pointer focus:outline-none focus:border-ring transition-colors",
|
|
26236
26510
|
children: [
|
|
26237
|
-
/* @__PURE__ */
|
|
26511
|
+
/* @__PURE__ */ jsx104("option", {
|
|
26238
26512
|
value: "auto",
|
|
26239
26513
|
children: "Auto - run without asking"
|
|
26240
26514
|
}),
|
|
26241
|
-
/* @__PURE__ */
|
|
26515
|
+
/* @__PURE__ */ jsx104("option", {
|
|
26242
26516
|
value: "dangerous",
|
|
26243
26517
|
children: "Dangerous - approve writes only"
|
|
26244
26518
|
}),
|
|
26245
|
-
/* @__PURE__ */
|
|
26519
|
+
/* @__PURE__ */ jsx104("option", {
|
|
26246
26520
|
value: "yolo",
|
|
26247
26521
|
children: "YOLO - skip approvals except hard safety blocks"
|
|
26248
26522
|
}),
|
|
26249
|
-
/* @__PURE__ */
|
|
26523
|
+
/* @__PURE__ */ jsx104("option", {
|
|
26250
26524
|
value: "all",
|
|
26251
26525
|
children: "All - approve every tool"
|
|
26252
26526
|
})
|
|
26253
26527
|
]
|
|
26254
26528
|
}),
|
|
26255
|
-
/* @__PURE__ */
|
|
26529
|
+
/* @__PURE__ */ jsx104(ChevronDown12, {
|
|
26256
26530
|
className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground pointer-events-none"
|
|
26257
26531
|
})
|
|
26258
26532
|
]
|
|
26259
26533
|
}),
|
|
26260
|
-
/* @__PURE__ */
|
|
26534
|
+
/* @__PURE__ */ jsx104("p", {
|
|
26261
26535
|
className: "mt-2 text-sm text-muted-foreground",
|
|
26262
26536
|
children: "Controls when tool executions need approval. YOLO still blocks extreme destructive commands."
|
|
26263
26537
|
})
|
|
26264
26538
|
]
|
|
26265
26539
|
}),
|
|
26266
|
-
/* @__PURE__ */
|
|
26540
|
+
/* @__PURE__ */ jsx104("div", {
|
|
26267
26541
|
className: "md:col-span-2",
|
|
26268
26542
|
children: /* @__PURE__ */ jsxs92("div", {
|
|
26269
26543
|
className: "flex items-center justify-between px-4 py-3 bg-card border border-border rounded-xl",
|
|
26270
26544
|
children: [
|
|
26271
26545
|
/* @__PURE__ */ jsxs92("div", {
|
|
26272
26546
|
children: [
|
|
26273
|
-
/* @__PURE__ */
|
|
26547
|
+
/* @__PURE__ */ jsx104("span", {
|
|
26274
26548
|
className: "text-sm font-medium text-foreground",
|
|
26275
26549
|
children: "Guided Mode"
|
|
26276
26550
|
}),
|
|
26277
|
-
/* @__PURE__ */
|
|
26551
|
+
/* @__PURE__ */ jsx104("p", {
|
|
26278
26552
|
className: "text-sm text-muted-foreground mt-0.5",
|
|
26279
26553
|
children: "AI will run commands and manage services for you instead of giving instructions"
|
|
26280
26554
|
})
|
|
26281
26555
|
]
|
|
26282
26556
|
}),
|
|
26283
|
-
/* @__PURE__ */
|
|
26557
|
+
/* @__PURE__ */ jsx104("button", {
|
|
26284
26558
|
type: "button",
|
|
26285
26559
|
role: "switch",
|
|
26286
26560
|
"aria-checked": guidedMode,
|
|
26287
26561
|
onClick: () => setGuidedMode(!guidedMode),
|
|
26288
26562
|
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 ${guidedMode ? "bg-primary" : "bg-muted"}`,
|
|
26289
|
-
children: /* @__PURE__ */
|
|
26563
|
+
children: /* @__PURE__ */ jsx104("span", {
|
|
26290
26564
|
className: `inline-block h-4 w-4 transform rounded-full transition-transform ${guidedMode ? "translate-x-6" : "translate-x-1"} ${guidedMode ? "bg-primary-foreground" : "bg-foreground"}`
|
|
26291
26565
|
})
|
|
26292
26566
|
})
|
|
@@ -26298,7 +26572,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26298
26572
|
]
|
|
26299
26573
|
})
|
|
26300
26574
|
}),
|
|
26301
|
-
/* @__PURE__ */
|
|
26575
|
+
/* @__PURE__ */ jsx104("div", {
|
|
26302
26576
|
className: "fixed bottom-0 left-0 right-0 px-4 sm:px-6 py-4 border-t border-border bg-background",
|
|
26303
26577
|
children: /* @__PURE__ */ jsxs92("div", {
|
|
26304
26578
|
className: "max-w-7xl mx-auto flex items-center justify-between",
|
|
@@ -26308,20 +26582,20 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26308
26582
|
onClick: onBack,
|
|
26309
26583
|
className: "flex items-center gap-2 px-4 py-3 text-muted-foreground hover:text-foreground transition-colors",
|
|
26310
26584
|
children: [
|
|
26311
|
-
/* @__PURE__ */
|
|
26585
|
+
/* @__PURE__ */ jsx104(ArrowLeft, {
|
|
26312
26586
|
className: "w-4 h-4"
|
|
26313
26587
|
}),
|
|
26314
26588
|
"Back"
|
|
26315
26589
|
]
|
|
26316
26590
|
}),
|
|
26317
|
-
/* @__PURE__ */
|
|
26591
|
+
/* @__PURE__ */ jsx104("button", {
|
|
26318
26592
|
type: "button",
|
|
26319
26593
|
onClick: handleFinish,
|
|
26320
26594
|
disabled: isSaving,
|
|
26321
26595
|
className: "flex items-center gap-2 px-6 py-3 bg-primary text-primary-foreground rounded-lg font-medium hover:bg-primary/90 transition-colors disabled:opacity-50",
|
|
26322
26596
|
children: isSaving ? /* @__PURE__ */ jsxs92(Fragment40, {
|
|
26323
26597
|
children: [
|
|
26324
|
-
/* @__PURE__ */
|
|
26598
|
+
/* @__PURE__ */ jsx104(Loader217, {
|
|
26325
26599
|
className: "w-4 h-4 animate-spin"
|
|
26326
26600
|
}),
|
|
26327
26601
|
"Setting up..."
|
|
@@ -26329,7 +26603,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26329
26603
|
}) : /* @__PURE__ */ jsxs92(Fragment40, {
|
|
26330
26604
|
children: [
|
|
26331
26605
|
"Start Using otto",
|
|
26332
|
-
/* @__PURE__ */
|
|
26606
|
+
/* @__PURE__ */ jsx104(Sparkles8, {
|
|
26333
26607
|
className: "w-4 h-4"
|
|
26334
26608
|
})
|
|
26335
26609
|
]
|
|
@@ -26343,8 +26617,8 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26343
26617
|
});
|
|
26344
26618
|
|
|
26345
26619
|
// src/components/onboarding/OnboardingModal.tsx
|
|
26346
|
-
import { jsx as
|
|
26347
|
-
var OnboardingModal =
|
|
26620
|
+
import { jsx as jsx105, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
26621
|
+
var OnboardingModal = memo48(function OnboardingModal2({
|
|
26348
26622
|
hideHeader = false
|
|
26349
26623
|
}) {
|
|
26350
26624
|
const isOpen = useOnboardingStore((s) => s.isOpen);
|
|
@@ -26376,7 +26650,7 @@ var OnboardingModal = memo47(function OnboardingModal2({
|
|
|
26376
26650
|
return /* @__PURE__ */ jsxs93("div", {
|
|
26377
26651
|
className: "fixed inset-0 z-[9999] bg-background text-foreground overflow-y-auto",
|
|
26378
26652
|
children: [
|
|
26379
|
-
currentStep === "wallet" && /* @__PURE__ */
|
|
26653
|
+
currentStep === "wallet" && /* @__PURE__ */ jsx105(ProviderSetupStep, {
|
|
26380
26654
|
authStatus,
|
|
26381
26655
|
onSetupWallet: setupWallet,
|
|
26382
26656
|
onImportWallet: importWallet,
|
|
@@ -26397,7 +26671,7 @@ var OnboardingModal = memo47(function OnboardingModal2({
|
|
|
26397
26671
|
onImportCopilotTokenFromGh: importCopilotTokenFromGh,
|
|
26398
26672
|
onGetCopilotDiagnostics: getCopilotDiagnostics
|
|
26399
26673
|
}),
|
|
26400
|
-
currentStep === "defaults" && /* @__PURE__ */
|
|
26674
|
+
currentStep === "defaults" && /* @__PURE__ */ jsx105(DefaultsStep, {
|
|
26401
26675
|
authStatus,
|
|
26402
26676
|
onComplete: completeOnboarding,
|
|
26403
26677
|
onBack: prevStep,
|
|
@@ -26477,4 +26751,4 @@ export {
|
|
|
26477
26751
|
AssistantMessageGroup
|
|
26478
26752
|
};
|
|
26479
26753
|
|
|
26480
|
-
//# debugId=
|
|
26754
|
+
//# debugId=7F0EBE4B932F92B664756E2164756E21
|