@ottocode/web-sdk 0.1.245 → 0.1.246
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/index.js +620 -423
- package/dist/components/index.js.map +17 -16
- package/dist/components/mcp/MCPSidebar.d.ts.map +1 -1
- package/dist/components/messages/ActionToolBox.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/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 +621 -423
- package/dist/index.js.map +17 -16
- 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/index.js
CHANGED
|
@@ -1565,6 +1565,8 @@ var authMixin = {
|
|
|
1565
1565
|
|
|
1566
1566
|
// src/lib/api-client/skills.ts
|
|
1567
1567
|
import {
|
|
1568
|
+
getSkillsConfig as apiGetSkillsConfig,
|
|
1569
|
+
updateSkillsConfig as apiUpdateSkillsConfig,
|
|
1568
1570
|
listSkills as apiListSkills,
|
|
1569
1571
|
getSkill as apiGetSkill,
|
|
1570
1572
|
listSkillFiles as apiListSkillFiles,
|
|
@@ -1596,6 +1598,18 @@ var skillsMixin = {
|
|
|
1596
1598
|
if (response.error)
|
|
1597
1599
|
throw new Error(extractErrorMessage(response.error));
|
|
1598
1600
|
return response.data;
|
|
1601
|
+
},
|
|
1602
|
+
async getSkillsConfig() {
|
|
1603
|
+
const response = await apiGetSkillsConfig();
|
|
1604
|
+
if (response.error)
|
|
1605
|
+
throw new Error(extractErrorMessage(response.error));
|
|
1606
|
+
return response.data;
|
|
1607
|
+
},
|
|
1608
|
+
async updateSkillsConfig(input) {
|
|
1609
|
+
const response = await apiUpdateSkillsConfig({ body: input });
|
|
1610
|
+
if (response.error)
|
|
1611
|
+
throw new Error(extractErrorMessage(response.error));
|
|
1612
|
+
return response.data;
|
|
1599
1613
|
}
|
|
1600
1614
|
};
|
|
1601
1615
|
|
|
@@ -1679,6 +1693,8 @@ class ApiClient {
|
|
|
1679
1693
|
getSkill = skillsMixin.getSkill;
|
|
1680
1694
|
getSkillFiles = skillsMixin.getSkillFiles;
|
|
1681
1695
|
getSkillFileContent = skillsMixin.getSkillFileContent;
|
|
1696
|
+
getSkillsConfig = skillsMixin.getSkillsConfig;
|
|
1697
|
+
updateSkillsConfig = skillsMixin.updateSkillsConfig;
|
|
1682
1698
|
}
|
|
1683
1699
|
var apiClient = new ApiClient;
|
|
1684
1700
|
|
|
@@ -2567,6 +2583,13 @@ var openaiLogo = `<svg width="24" height="24" viewBox="0 0 40 40" xmlns="http://
|
|
|
2567
2583
|
var googleLogo = `<svg width="24" height="24" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
|
|
2568
2584
|
<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
2585
|
</svg>`;
|
|
2586
|
+
var ollamaCloudLogo = `<svg width="24" height="24" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg">
|
|
2587
|
+
<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"/>
|
|
2588
|
+
<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"/>
|
|
2589
|
+
<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"/>
|
|
2590
|
+
<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"/>
|
|
2591
|
+
<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"/>
|
|
2592
|
+
</svg>`;
|
|
2570
2593
|
var openrouterLogo = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2571
2594
|
<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
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" stroke="currentColor" stroke-width="3.27593"/>
|
|
@@ -2607,6 +2630,8 @@ var providerLogos = {
|
|
|
2607
2630
|
anthropic: anthropicLogo,
|
|
2608
2631
|
openai: openaiLogo,
|
|
2609
2632
|
google: googleLogo,
|
|
2633
|
+
ollama: ollamaCloudLogo,
|
|
2634
|
+
"ollama-cloud": ollamaCloudLogo,
|
|
2610
2635
|
openrouter: openrouterLogo,
|
|
2611
2636
|
groq: groqLogo,
|
|
2612
2637
|
deepseek: deepseekLogo,
|
|
@@ -2623,7 +2648,8 @@ var ProviderLogo = memo2(function ProviderLogo2({
|
|
|
2623
2648
|
className = "",
|
|
2624
2649
|
size = 16
|
|
2625
2650
|
}) {
|
|
2626
|
-
const
|
|
2651
|
+
const normalizedProvider = provider.toLowerCase();
|
|
2652
|
+
const logoSvg = providerLogos[normalizedProvider] ?? (normalizedProvider.includes("ollama") ? ollamaCloudLogo : undefined);
|
|
2627
2653
|
if (!logoSvg) {
|
|
2628
2654
|
return /* @__PURE__ */ jsx13("span", {
|
|
2629
2655
|
className: `inline-flex items-center justify-center text-[10px] font-medium text-muted-foreground uppercase ${className}`,
|
|
@@ -4170,6 +4196,9 @@ import { create as create6 } from "zustand";
|
|
|
4170
4196
|
var useSkillsStore = create6((set) => ({
|
|
4171
4197
|
isExpanded: false,
|
|
4172
4198
|
skills: [],
|
|
4199
|
+
globalEnabled: true,
|
|
4200
|
+
totalCount: 0,
|
|
4201
|
+
enabledCount: 0,
|
|
4173
4202
|
selectedSkill: null,
|
|
4174
4203
|
isViewerOpen: false,
|
|
4175
4204
|
viewingFile: null,
|
|
@@ -4200,6 +4229,7 @@ var useSkillsStore = create6((set) => ({
|
|
|
4200
4229
|
},
|
|
4201
4230
|
collapseSidebar: () => set({ isExpanded: false }),
|
|
4202
4231
|
setSkills: (skills) => set({ skills }),
|
|
4232
|
+
setSkillsConfig: ({ skills, globalEnabled, totalCount, enabledCount }) => set({ skills, globalEnabled, totalCount, enabledCount }),
|
|
4203
4233
|
selectSkill: (name) => set({ selectedSkill: name, isViewerOpen: false, viewingFile: null }),
|
|
4204
4234
|
openViewer: (file) => set({ isViewerOpen: true, viewingFile: file }),
|
|
4205
4235
|
closeViewer: () => set({ isViewerOpen: false, viewingFile: null })
|
|
@@ -5103,23 +5133,97 @@ import { ChevronDown, Search } from "lucide-react";
|
|
|
5103
5133
|
import Fuse2 from "fuse.js";
|
|
5104
5134
|
import { jsx as jsx16, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
5105
5135
|
var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider, model, onChange, disabled = false }, ref) {
|
|
5106
|
-
const { data: allModels
|
|
5136
|
+
const { data: allModels } = useAllModels();
|
|
5137
|
+
const { data: currentProviderModels, isLoading: isCurrentProviderLoading } = useModels(provider);
|
|
5107
5138
|
const [isOpen, setIsOpen] = useState10(false);
|
|
5108
5139
|
const [searchQuery, setSearchQuery] = useState10("");
|
|
5109
5140
|
const [highlightedIndex, setHighlightedIndex] = useState10(0);
|
|
5141
|
+
const [loadedModels, setLoadedModels] = useState10({});
|
|
5142
|
+
const [loadingProviders, setLoadingProviders] = useState10({});
|
|
5143
|
+
const [hydratedProviders, setHydratedProviders] = useState10({});
|
|
5110
5144
|
const dropdownRef = useRef4(null);
|
|
5111
5145
|
const searchInputRef = useRef4(null);
|
|
5112
5146
|
const itemRefs = useRef4([]);
|
|
5147
|
+
useEffect9(() => {
|
|
5148
|
+
if (!allModels)
|
|
5149
|
+
return;
|
|
5150
|
+
setLoadedModels((prev) => {
|
|
5151
|
+
const next = { ...prev };
|
|
5152
|
+
for (const [providerId, providerData] of Object.entries(allModels)) {
|
|
5153
|
+
next[providerId] = {
|
|
5154
|
+
...providerData,
|
|
5155
|
+
models: hydratedProviders[providerId] ? prev[providerId]?.models ?? providerData.models : providerData.models
|
|
5156
|
+
};
|
|
5157
|
+
}
|
|
5158
|
+
return next;
|
|
5159
|
+
});
|
|
5160
|
+
}, [allModels, hydratedProviders]);
|
|
5161
|
+
const configuredProviders = useMemo6(() => {
|
|
5162
|
+
const providers = Object.keys(allModels ?? {});
|
|
5163
|
+
if (!provider || providers.includes(provider)) {
|
|
5164
|
+
return providers;
|
|
5165
|
+
}
|
|
5166
|
+
return [provider, ...providers];
|
|
5167
|
+
}, [allModels, provider]);
|
|
5168
|
+
useEffect9(() => {
|
|
5169
|
+
if (!provider || !currentProviderModels)
|
|
5170
|
+
return;
|
|
5171
|
+
setLoadedModels((prev) => ({
|
|
5172
|
+
...prev,
|
|
5173
|
+
[provider]: {
|
|
5174
|
+
...prev[provider] ?? {},
|
|
5175
|
+
label: currentProviderModels.label || provider,
|
|
5176
|
+
models: currentProviderModels.models
|
|
5177
|
+
}
|
|
5178
|
+
}));
|
|
5179
|
+
setHydratedProviders((prev) => ({ ...prev, [provider]: true }));
|
|
5180
|
+
}, [currentProviderModels, provider]);
|
|
5181
|
+
useEffect9(() => {
|
|
5182
|
+
if (!isOpen || !configuredProviders.length)
|
|
5183
|
+
return;
|
|
5184
|
+
for (const providerId of configuredProviders) {
|
|
5185
|
+
const providerData = loadedModels[providerId] ?? allModels?.[providerId];
|
|
5186
|
+
if (!providerData?.dynamicModels || hydratedProviders[providerId] || loadingProviders[providerId]) {
|
|
5187
|
+
continue;
|
|
5188
|
+
}
|
|
5189
|
+
setLoadingProviders((prev) => ({ ...prev, [providerId]: true }));
|
|
5190
|
+
apiClient.getModels(providerId).then((data) => {
|
|
5191
|
+
setLoadedModels((prev) => ({
|
|
5192
|
+
...prev,
|
|
5193
|
+
[providerId]: {
|
|
5194
|
+
...prev[providerId] ?? allModels?.[providerId] ?? {},
|
|
5195
|
+
label: data.label || providerId,
|
|
5196
|
+
models: data.models,
|
|
5197
|
+
allowAnyModel: data.allowAnyModel,
|
|
5198
|
+
dynamicModels: true
|
|
5199
|
+
}
|
|
5200
|
+
}));
|
|
5201
|
+
setHydratedProviders((prev) => ({ ...prev, [providerId]: true }));
|
|
5202
|
+
}).catch(() => {
|
|
5203
|
+
setHydratedProviders((prev) => ({ ...prev, [providerId]: true }));
|
|
5204
|
+
}).finally(() => {
|
|
5205
|
+
setLoadingProviders((prev) => ({
|
|
5206
|
+
...prev,
|
|
5207
|
+
[providerId]: false
|
|
5208
|
+
}));
|
|
5209
|
+
});
|
|
5210
|
+
}
|
|
5211
|
+
}, [
|
|
5212
|
+
allModels,
|
|
5213
|
+
configuredProviders,
|
|
5214
|
+
hydratedProviders,
|
|
5215
|
+
isOpen,
|
|
5216
|
+
loadedModels,
|
|
5217
|
+
loadingProviders
|
|
5218
|
+
]);
|
|
5113
5219
|
useImperativeHandle2(ref, () => ({
|
|
5114
5220
|
openAndFocus: () => {
|
|
5115
5221
|
setIsOpen(true);
|
|
5116
5222
|
}
|
|
5117
5223
|
}));
|
|
5118
5224
|
const flattenedModels = useMemo6(() => {
|
|
5119
|
-
if (!allModels)
|
|
5120
|
-
return [];
|
|
5121
5225
|
const flattened = [];
|
|
5122
|
-
for (const [providerKey, providerData] of Object.entries(
|
|
5226
|
+
for (const [providerKey, providerData] of Object.entries(loadedModels)) {
|
|
5123
5227
|
for (const modelItem of providerData.models) {
|
|
5124
5228
|
flattened.push({
|
|
5125
5229
|
providerKey,
|
|
@@ -5134,7 +5238,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5134
5238
|
}
|
|
5135
5239
|
}
|
|
5136
5240
|
return flattened;
|
|
5137
|
-
}, [
|
|
5241
|
+
}, [loadedModels]);
|
|
5138
5242
|
const fuse = useMemo6(() => {
|
|
5139
5243
|
return new Fuse2(flattenedModels, {
|
|
5140
5244
|
keys: [
|
|
@@ -5150,10 +5254,8 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5150
5254
|
});
|
|
5151
5255
|
}, [flattenedModels]);
|
|
5152
5256
|
const filteredModels = useMemo6(() => {
|
|
5153
|
-
if (!allModels)
|
|
5154
|
-
return {};
|
|
5155
5257
|
if (!searchQuery.trim())
|
|
5156
|
-
return
|
|
5258
|
+
return loadedModels;
|
|
5157
5259
|
const results = fuse.search(searchQuery);
|
|
5158
5260
|
const sortedResults = results.sort((a, b) => {
|
|
5159
5261
|
const scoreA = a.score ?? 1;
|
|
@@ -5195,7 +5297,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5195
5297
|
}
|
|
5196
5298
|
}
|
|
5197
5299
|
return filtered;
|
|
5198
|
-
}, [
|
|
5300
|
+
}, [loadedModels, searchQuery, fuse]);
|
|
5199
5301
|
const filteredFlatList = useMemo6(() => {
|
|
5200
5302
|
const list = [];
|
|
5201
5303
|
for (const [providerKey, providerData] of Object.entries(filteredModels)) {
|
|
@@ -5274,8 +5376,9 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5274
5376
|
}
|
|
5275
5377
|
}
|
|
5276
5378
|
};
|
|
5277
|
-
const currentProviderLabel =
|
|
5278
|
-
const currentModelLabel =
|
|
5379
|
+
const currentProviderLabel = loadedModels[provider]?.label || currentProviderModels?.label || provider;
|
|
5380
|
+
const currentModelLabel = loadedModels[provider]?.models.find((m) => m.id === model)?.label || currentProviderModels?.models.find((m) => m.id === model)?.label || model;
|
|
5381
|
+
const displayedProviderKeys = searchQuery.trim() ? Object.keys(filteredModels) : configuredProviders;
|
|
5279
5382
|
return /* @__PURE__ */ jsxs10("div", {
|
|
5280
5383
|
ref: dropdownRef,
|
|
5281
5384
|
className: "relative w-full",
|
|
@@ -5283,7 +5386,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5283
5386
|
/* @__PURE__ */ jsxs10("button", {
|
|
5284
5387
|
type: "button",
|
|
5285
5388
|
onClick: () => !disabled && setIsOpen(!isOpen),
|
|
5286
|
-
disabled
|
|
5389
|
+
disabled,
|
|
5287
5390
|
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
5391
|
children: [
|
|
5289
5392
|
/* @__PURE__ */ jsxs10("span", {
|
|
@@ -5308,7 +5411,7 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5308
5411
|
})
|
|
5309
5412
|
]
|
|
5310
5413
|
}),
|
|
5311
|
-
isOpen &&
|
|
5414
|
+
isOpen && /* @__PURE__ */ jsxs10("div", {
|
|
5312
5415
|
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
5416
|
children: [
|
|
5314
5417
|
/* @__PURE__ */ jsx16("div", {
|
|
@@ -5333,62 +5436,72 @@ var UnifiedModelSelector = forwardRef6(function UnifiedModelSelector2({ provider
|
|
|
5333
5436
|
}),
|
|
5334
5437
|
/* @__PURE__ */ jsx16("div", {
|
|
5335
5438
|
className: "overflow-y-auto",
|
|
5336
|
-
children:
|
|
5439
|
+
children: displayedProviderKeys.length === 0 ? /* @__PURE__ */ jsx16("div", {
|
|
5337
5440
|
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
|
-
|
|
5441
|
+
children: isCurrentProviderLoading ? "Loading models..." : "No models found"
|
|
5442
|
+
}) : displayedProviderKeys.map((providerKey) => {
|
|
5443
|
+
const providerData = filteredModels[providerKey];
|
|
5444
|
+
const isProviderLoading = loadingProviders[providerKey] || providerKey === provider && isCurrentProviderLoading && !providerData;
|
|
5445
|
+
return /* @__PURE__ */ jsxs10("div", {
|
|
5446
|
+
className: "border-b border-[hsl(var(--border))] last:border-0",
|
|
5447
|
+
children: [
|
|
5448
|
+
/* @__PURE__ */ jsx16("div", {
|
|
5449
|
+
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",
|
|
5450
|
+
children: providerData?.label || providerKey
|
|
5451
|
+
}),
|
|
5452
|
+
/* @__PURE__ */ jsx16("div", {
|
|
5453
|
+
children: isProviderLoading ? /* @__PURE__ */ jsx16("div", {
|
|
5454
|
+
className: "px-4 py-2 text-sm text-[hsl(var(--muted-foreground))]",
|
|
5455
|
+
children: "Loading models..."
|
|
5456
|
+
}) : providerData?.models.length ? providerData.models.map((modelItem) => {
|
|
5457
|
+
const isSelected = providerKey === provider && modelItem.id === model;
|
|
5458
|
+
const flatIndex = filteredFlatList.findIndex((item) => item.providerKey === providerKey && item.modelId === modelItem.id);
|
|
5459
|
+
const isHighlighted = flatIndex === highlightedIndex;
|
|
5460
|
+
const isAvailable = modelItem.available !== false;
|
|
5461
|
+
return /* @__PURE__ */ jsxs10("button", {
|
|
5462
|
+
ref: (el) => {
|
|
5463
|
+
if (flatIndex >= 0) {
|
|
5464
|
+
itemRefs.current[flatIndex] = el;
|
|
5465
|
+
}
|
|
5466
|
+
},
|
|
5467
|
+
type: "button",
|
|
5468
|
+
disabled: !isAvailable,
|
|
5469
|
+
title: modelItem.unavailableReason,
|
|
5470
|
+
onClick: () => handleSelect(providerKey, modelItem.id, modelItem.available),
|
|
5471
|
+
onMouseEnter: () => setHighlightedIndex(flatIndex),
|
|
5472
|
+
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" : ""}`,
|
|
5473
|
+
children: [
|
|
5474
|
+
/* @__PURE__ */ jsx16("span", {
|
|
5475
|
+
className: "truncate",
|
|
5476
|
+
children: modelItem.label
|
|
5477
|
+
}),
|
|
5478
|
+
(!isAvailable || modelItem.toolCall || modelItem.reasoningText) && /* @__PURE__ */ jsxs10("div", {
|
|
5479
|
+
className: "flex gap-1 ml-2 flex-shrink-0",
|
|
5480
|
+
children: [
|
|
5481
|
+
!isAvailable && /* @__PURE__ */ jsx16("span", {
|
|
5482
|
+
className: "text-[10px] px-1.5 py-0.5 bg-red-600/20 text-red-400 rounded",
|
|
5483
|
+
children: "Unavailable"
|
|
5484
|
+
}),
|
|
5485
|
+
modelItem.toolCall && /* @__PURE__ */ jsx16("span", {
|
|
5486
|
+
className: "text-[10px] px-1.5 py-0.5 bg-green-600/20 text-green-400 rounded",
|
|
5487
|
+
children: "Tools"
|
|
5488
|
+
}),
|
|
5489
|
+
modelItem.reasoningText && /* @__PURE__ */ jsx16("span", {
|
|
5490
|
+
className: "text-[10px] px-1.5 py-0.5 bg-purple-600/20 text-purple-400 rounded",
|
|
5491
|
+
children: "Reasoning"
|
|
5492
|
+
})
|
|
5493
|
+
]
|
|
5494
|
+
})
|
|
5495
|
+
]
|
|
5496
|
+
}, modelItem.id);
|
|
5497
|
+
}) : /* @__PURE__ */ jsx16("div", {
|
|
5498
|
+
className: "px-4 py-2 text-sm text-[hsl(var(--muted-foreground))]",
|
|
5499
|
+
children: "No models available"
|
|
5500
|
+
})
|
|
5388
5501
|
})
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
}
|
|
5502
|
+
]
|
|
5503
|
+
}, providerKey);
|
|
5504
|
+
})
|
|
5392
5505
|
})
|
|
5393
5506
|
]
|
|
5394
5507
|
})
|
|
@@ -12243,7 +12356,7 @@ function ActionToolBox({ part, showLine }) {
|
|
|
12243
12356
|
return;
|
|
12244
12357
|
}
|
|
12245
12358
|
const el = contentMeasureRef.current;
|
|
12246
|
-
if (!el)
|
|
12359
|
+
if (!el || el.textContent !== displayContent)
|
|
12247
12360
|
return;
|
|
12248
12361
|
const nextHeight = Math.min(el.scrollHeight, MAX_SCROLL_H2 - 12);
|
|
12249
12362
|
setContentHeight((prev) => prev === nextHeight ? prev : nextHeight);
|
|
@@ -12375,9 +12488,10 @@ function ActionToolBox({ part, showLine }) {
|
|
|
12375
12488
|
},
|
|
12376
12489
|
children: displayContent && /* @__PURE__ */ jsx56("div", {
|
|
12377
12490
|
className: "pt-1.5",
|
|
12378
|
-
children: /* @__PURE__ */ jsx56("
|
|
12491
|
+
children: /* @__PURE__ */ jsx56("section", {
|
|
12379
12492
|
ref: scrollRef,
|
|
12380
12493
|
className: "overflow-y-auto",
|
|
12494
|
+
"aria-label": `${config2.label} content`,
|
|
12381
12495
|
style: {
|
|
12382
12496
|
height: `${contentHeight}px`,
|
|
12383
12497
|
maskImage: "linear-gradient(to bottom, transparent 0px, black 20px)",
|
|
@@ -14132,7 +14246,7 @@ function useProviderUsage(provider, authType) {
|
|
|
14132
14246
|
const fetchRef = useRef13(fetchUsage);
|
|
14133
14247
|
fetchRef.current = fetchUsage;
|
|
14134
14248
|
useEffect20(() => {
|
|
14135
|
-
if (!isOAuthProvider)
|
|
14249
|
+
if (!provider || !isOAuthProvider)
|
|
14136
14250
|
return;
|
|
14137
14251
|
fetchRef.current();
|
|
14138
14252
|
const interval = setInterval(() => fetchRef.current(), POLL_INTERVAL);
|
|
@@ -18432,7 +18546,7 @@ var GitDiffPanel = memo22(function GitDiffPanel2() {
|
|
|
18432
18546
|
};
|
|
18433
18547
|
document.addEventListener("keydown", handleEscape);
|
|
18434
18548
|
return () => document.removeEventListener("keydown", handleEscape);
|
|
18435
|
-
}, [isDiffOpen, closeDiff
|
|
18549
|
+
}, [isDiffOpen, closeDiff]);
|
|
18436
18550
|
if (!isDiffOpen || !selectedFile)
|
|
18437
18551
|
return null;
|
|
18438
18552
|
return /* @__PURE__ */ jsxs69("div", {
|
|
@@ -22610,7 +22724,7 @@ var TunnelSidebarToggle = memo34(function TunnelSidebarToggle2() {
|
|
|
22610
22724
|
});
|
|
22611
22725
|
});
|
|
22612
22726
|
// src/components/mcp/MCPSidebar.tsx
|
|
22613
|
-
import { memo as
|
|
22727
|
+
import { memo as memo37, useState as useState42, useCallback as useCallback31, useMemo as useMemo23, useEffect as useEffect41, useRef as useRef29 } from "react";
|
|
22614
22728
|
import {
|
|
22615
22729
|
ChevronDown as ChevronDown10,
|
|
22616
22730
|
ChevronRight as ChevronRight15,
|
|
@@ -22619,7 +22733,7 @@ import {
|
|
|
22619
22733
|
FolderDot as FolderDot2,
|
|
22620
22734
|
Globe as Globe6,
|
|
22621
22735
|
Laptop as Laptop2,
|
|
22622
|
-
Loader2 as
|
|
22736
|
+
Loader2 as Loader214,
|
|
22623
22737
|
Lock,
|
|
22624
22738
|
Plug as Plug4,
|
|
22625
22739
|
Plus as Plus7,
|
|
@@ -23237,8 +23351,10 @@ API_KEY=sk-xxx`,
|
|
|
23237
23351
|
});
|
|
23238
23352
|
});
|
|
23239
23353
|
|
|
23240
|
-
// src/components/
|
|
23241
|
-
import {
|
|
23354
|
+
// src/components/ui/ToggleSwitch.tsx
|
|
23355
|
+
import { memo as memo36 } from "react";
|
|
23356
|
+
import { Loader2 as Loader213 } from "lucide-react";
|
|
23357
|
+
import { jsx as jsx93 } from "react/jsx-runtime";
|
|
23242
23358
|
var ToggleSwitch = memo36(function ToggleSwitch2({
|
|
23243
23359
|
checked,
|
|
23244
23360
|
loading,
|
|
@@ -23250,20 +23366,23 @@ var ToggleSwitch = memo36(function ToggleSwitch2({
|
|
|
23250
23366
|
role: "switch",
|
|
23251
23367
|
"aria-checked": checked,
|
|
23252
23368
|
disabled: disabled || loading,
|
|
23253
|
-
onClick: (
|
|
23254
|
-
|
|
23369
|
+
onClick: (event) => {
|
|
23370
|
+
event.stopPropagation();
|
|
23255
23371
|
onChange();
|
|
23256
23372
|
},
|
|
23257
23373
|
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
23374
|
children: /* @__PURE__ */ jsx93("span", {
|
|
23259
23375
|
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
|
|
23376
|
+
children: loading ? /* @__PURE__ */ jsx93(Loader213, {
|
|
23261
23377
|
className: "w-3.5 h-3.5 animate-spin text-white"
|
|
23262
|
-
})
|
|
23378
|
+
}) : null
|
|
23263
23379
|
})
|
|
23264
23380
|
});
|
|
23265
23381
|
});
|
|
23266
|
-
|
|
23382
|
+
|
|
23383
|
+
// src/components/mcp/MCPSidebar.tsx
|
|
23384
|
+
import { jsx as jsx94, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
23385
|
+
var CopilotDeviceAuth = memo37(function CopilotDeviceAuth2({
|
|
23267
23386
|
userCode,
|
|
23268
23387
|
verificationUri
|
|
23269
23388
|
}) {
|
|
@@ -23274,7 +23393,7 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23274
23393
|
setTimeout(() => setCopied(false), 2000);
|
|
23275
23394
|
});
|
|
23276
23395
|
}, [userCode]);
|
|
23277
|
-
return /* @__PURE__ */
|
|
23396
|
+
return /* @__PURE__ */ jsx94("div", {
|
|
23278
23397
|
className: "px-3 pb-2.5 pt-0",
|
|
23279
23398
|
children: /* @__PURE__ */ jsxs84("div", {
|
|
23280
23399
|
className: "rounded-md bg-yellow-500/10 border border-yellow-500/20 p-2 space-y-1.5",
|
|
@@ -23282,10 +23401,10 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23282
23401
|
/* @__PURE__ */ jsxs84("div", {
|
|
23283
23402
|
className: "flex items-center gap-1.5 text-xs",
|
|
23284
23403
|
children: [
|
|
23285
|
-
/* @__PURE__ */
|
|
23404
|
+
/* @__PURE__ */ jsx94(Loader214, {
|
|
23286
23405
|
className: "w-3 h-3 animate-spin text-yellow-500 flex-shrink-0"
|
|
23287
23406
|
}),
|
|
23288
|
-
/* @__PURE__ */
|
|
23407
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23289
23408
|
className: "text-yellow-500/80",
|
|
23290
23409
|
children: "Enter code at GitHub:"
|
|
23291
23410
|
})
|
|
@@ -23294,20 +23413,20 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23294
23413
|
/* @__PURE__ */ jsxs84("div", {
|
|
23295
23414
|
className: "flex items-center gap-2",
|
|
23296
23415
|
children: [
|
|
23297
|
-
/* @__PURE__ */
|
|
23416
|
+
/* @__PURE__ */ jsx94("code", {
|
|
23298
23417
|
className: "text-sm font-mono font-bold text-yellow-400 tracking-wider",
|
|
23299
23418
|
children: userCode
|
|
23300
23419
|
}),
|
|
23301
|
-
/* @__PURE__ */
|
|
23420
|
+
/* @__PURE__ */ jsx94("button", {
|
|
23302
23421
|
type: "button",
|
|
23303
23422
|
onClick: handleCopy,
|
|
23304
23423
|
className: "text-yellow-500/60 hover:text-yellow-400 transition-colors",
|
|
23305
23424
|
title: "Copy code",
|
|
23306
|
-
children: /* @__PURE__ */
|
|
23425
|
+
children: /* @__PURE__ */ jsx94(ClipboardCopy, {
|
|
23307
23426
|
className: "w-3.5 h-3.5"
|
|
23308
23427
|
})
|
|
23309
23428
|
}),
|
|
23310
|
-
copied && /* @__PURE__ */
|
|
23429
|
+
copied && /* @__PURE__ */ jsx94("span", {
|
|
23311
23430
|
className: "text-xs text-green-400",
|
|
23312
23431
|
children: "Copied!"
|
|
23313
23432
|
})
|
|
@@ -23324,7 +23443,7 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23324
23443
|
className: "inline-flex items-center gap-1 text-xs text-yellow-400 hover:text-yellow-300 underline underline-offset-2",
|
|
23325
23444
|
children: [
|
|
23326
23445
|
"Open GitHub login",
|
|
23327
|
-
/* @__PURE__ */
|
|
23446
|
+
/* @__PURE__ */ jsx94(ExternalLink9, {
|
|
23328
23447
|
className: "w-3 h-3"
|
|
23329
23448
|
})
|
|
23330
23449
|
]
|
|
@@ -23333,7 +23452,7 @@ var CopilotDeviceAuth = memo36(function CopilotDeviceAuth2({
|
|
|
23333
23452
|
})
|
|
23334
23453
|
});
|
|
23335
23454
|
});
|
|
23336
|
-
var MCPServerCard =
|
|
23455
|
+
var MCPServerCard = memo37(function MCPServerCard2({
|
|
23337
23456
|
server,
|
|
23338
23457
|
isLoading,
|
|
23339
23458
|
authUrl,
|
|
@@ -23366,7 +23485,7 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23366
23485
|
/* @__PURE__ */ jsxs84("div", {
|
|
23367
23486
|
className: "flex items-center gap-3 px-3 py-2.5",
|
|
23368
23487
|
children: [
|
|
23369
|
-
/* @__PURE__ */
|
|
23488
|
+
/* @__PURE__ */ jsx94(ToggleSwitch, {
|
|
23370
23489
|
checked: server.connected,
|
|
23371
23490
|
loading: isLoading || isAwaitingAuth,
|
|
23372
23491
|
onChange: handleToggle
|
|
@@ -23377,14 +23496,14 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23377
23496
|
/* @__PURE__ */ jsxs84("div", {
|
|
23378
23497
|
className: "flex items-center gap-1.5",
|
|
23379
23498
|
children: [
|
|
23380
|
-
/* @__PURE__ */
|
|
23499
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23381
23500
|
className: "text-sm font-medium truncate",
|
|
23382
23501
|
children: server.name
|
|
23383
23502
|
}),
|
|
23384
|
-
isRemote && /* @__PURE__ */
|
|
23503
|
+
isRemote && /* @__PURE__ */ jsx94(Globe6, {
|
|
23385
23504
|
className: "w-3 h-3 text-muted-foreground flex-shrink-0"
|
|
23386
23505
|
}),
|
|
23387
|
-
server.authRequired && !server.connected && /* @__PURE__ */
|
|
23506
|
+
server.authRequired && !server.connected && /* @__PURE__ */ jsx94(Lock, {
|
|
23388
23507
|
className: "w-3 h-3 text-yellow-500 flex-shrink-0"
|
|
23389
23508
|
})
|
|
23390
23509
|
]
|
|
@@ -23392,16 +23511,16 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23392
23511
|
/* @__PURE__ */ jsxs84("div", {
|
|
23393
23512
|
className: "flex items-center gap-1.5 mt-0.5",
|
|
23394
23513
|
children: [
|
|
23395
|
-
/* @__PURE__ */
|
|
23514
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23396
23515
|
className: "text-xs text-muted-foreground truncate",
|
|
23397
23516
|
children: isRemote ? server.url : `${server.command ?? ""} ${server.args.join(" ")}`
|
|
23398
23517
|
}),
|
|
23399
|
-
/* @__PURE__ */
|
|
23518
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23400
23519
|
className: "flex items-center flex-shrink-0 opacity-50",
|
|
23401
23520
|
title: server.scope === "project" ? "Project-local" : "Global",
|
|
23402
|
-
children: server.scope === "project" ? /* @__PURE__ */
|
|
23521
|
+
children: server.scope === "project" ? /* @__PURE__ */ jsx94(FolderDot2, {
|
|
23403
23522
|
className: "w-3 h-3"
|
|
23404
|
-
}) : /* @__PURE__ */
|
|
23523
|
+
}) : /* @__PURE__ */ jsx94(Laptop2, {
|
|
23405
23524
|
className: "w-3 h-3"
|
|
23406
23525
|
})
|
|
23407
23526
|
})
|
|
@@ -23417,24 +23536,24 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23417
23536
|
onClick: toggleTools,
|
|
23418
23537
|
className: "flex items-center gap-0.5 text-xs text-muted-foreground hover:text-foreground px-1.5 py-1 rounded transition-colors",
|
|
23419
23538
|
children: [
|
|
23420
|
-
/* @__PURE__ */
|
|
23539
|
+
/* @__PURE__ */ jsx94(Wrench, {
|
|
23421
23540
|
className: "w-3 h-3"
|
|
23422
23541
|
}),
|
|
23423
23542
|
server.tools.length,
|
|
23424
|
-
showTools ? /* @__PURE__ */
|
|
23543
|
+
showTools ? /* @__PURE__ */ jsx94(ChevronDown10, {
|
|
23425
23544
|
className: "w-3 h-3"
|
|
23426
|
-
}) : /* @__PURE__ */
|
|
23545
|
+
}) : /* @__PURE__ */ jsx94(ChevronRight15, {
|
|
23427
23546
|
className: "w-3 h-3"
|
|
23428
23547
|
})
|
|
23429
23548
|
]
|
|
23430
23549
|
}),
|
|
23431
|
-
/* @__PURE__ */
|
|
23550
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23432
23551
|
variant: "ghost",
|
|
23433
23552
|
size: "icon",
|
|
23434
23553
|
onClick: onRemove,
|
|
23435
23554
|
title: "Remove server",
|
|
23436
23555
|
className: "h-6 w-6 opacity-0 group-hover:opacity-100 transition-opacity",
|
|
23437
|
-
children: /* @__PURE__ */
|
|
23556
|
+
children: /* @__PURE__ */ jsx94(Trash25, {
|
|
23438
23557
|
className: "w-3 h-3 text-muted-foreground hover:text-red-400"
|
|
23439
23558
|
})
|
|
23440
23559
|
})
|
|
@@ -23442,19 +23561,19 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23442
23561
|
})
|
|
23443
23562
|
]
|
|
23444
23563
|
}),
|
|
23445
|
-
copilotDevice && !server.connected && /* @__PURE__ */
|
|
23564
|
+
copilotDevice && !server.connected && /* @__PURE__ */ jsx94(CopilotDeviceAuth, {
|
|
23446
23565
|
userCode: copilotDevice.userCode,
|
|
23447
23566
|
verificationUri: copilotDevice.verificationUri
|
|
23448
23567
|
}),
|
|
23449
|
-
!copilotDevice && isAwaitingAuth && authUrl && /* @__PURE__ */
|
|
23568
|
+
!copilotDevice && isAwaitingAuth && authUrl && /* @__PURE__ */ jsx94("div", {
|
|
23450
23569
|
className: "px-3 pb-2.5 pt-0",
|
|
23451
23570
|
children: /* @__PURE__ */ jsxs84("div", {
|
|
23452
23571
|
className: "flex items-center gap-1.5 text-xs",
|
|
23453
23572
|
children: [
|
|
23454
|
-
/* @__PURE__ */
|
|
23573
|
+
/* @__PURE__ */ jsx94(Loader214, {
|
|
23455
23574
|
className: "w-3 h-3 animate-spin text-yellow-500 flex-shrink-0"
|
|
23456
23575
|
}),
|
|
23457
|
-
/* @__PURE__ */
|
|
23576
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23458
23577
|
className: "text-yellow-500/80",
|
|
23459
23578
|
children: "Waiting for auth..."
|
|
23460
23579
|
}),
|
|
@@ -23469,7 +23588,7 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23469
23588
|
className: "inline-flex items-center gap-0.5 text-yellow-400 hover:text-yellow-300 underline underline-offset-2",
|
|
23470
23589
|
children: [
|
|
23471
23590
|
"Open login",
|
|
23472
|
-
/* @__PURE__ */
|
|
23591
|
+
/* @__PURE__ */ jsx94(ExternalLink9, {
|
|
23473
23592
|
className: "w-3 h-3"
|
|
23474
23593
|
})
|
|
23475
23594
|
]
|
|
@@ -23477,11 +23596,11 @@ var MCPServerCard = memo36(function MCPServerCard2({
|
|
|
23477
23596
|
]
|
|
23478
23597
|
})
|
|
23479
23598
|
}),
|
|
23480
|
-
hasTools && showTools && /* @__PURE__ */
|
|
23599
|
+
hasTools && showTools && /* @__PURE__ */ jsx94("div", {
|
|
23481
23600
|
className: "px-3 pb-2.5 pt-0",
|
|
23482
|
-
children: /* @__PURE__ */
|
|
23601
|
+
children: /* @__PURE__ */ jsx94("div", {
|
|
23483
23602
|
className: "flex flex-wrap gap-1",
|
|
23484
|
-
children: server.tools.map((tool) => /* @__PURE__ */
|
|
23603
|
+
children: server.tools.map((tool) => /* @__PURE__ */ jsx94("span", {
|
|
23485
23604
|
className: "text-xs bg-muted px-1.5 py-0.5 rounded",
|
|
23486
23605
|
title: tool,
|
|
23487
23606
|
children: tool.split("__").pop()
|
|
@@ -23501,7 +23620,7 @@ function useAuthPoller(name, onAuthenticated) {
|
|
|
23501
23620
|
prevAuth.current = data?.authenticated ?? false;
|
|
23502
23621
|
}, [data?.authenticated, onAuthenticated]);
|
|
23503
23622
|
}
|
|
23504
|
-
var MCPSidebar =
|
|
23623
|
+
var MCPSidebar = memo37(function MCPSidebar2() {
|
|
23505
23624
|
const isExpanded = useMCPStore((s) => s.isExpanded);
|
|
23506
23625
|
const collapseSidebar = useMCPStore((s) => s.collapseSidebar);
|
|
23507
23626
|
const servers = useMCPStore((s) => s.servers);
|
|
@@ -23616,10 +23735,10 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23616
23735
|
/* @__PURE__ */ jsxs84("div", {
|
|
23617
23736
|
className: "flex items-center gap-2",
|
|
23618
23737
|
children: [
|
|
23619
|
-
/* @__PURE__ */
|
|
23738
|
+
/* @__PURE__ */ jsx94(Plug4, {
|
|
23620
23739
|
className: "w-4 h-4 text-muted-foreground"
|
|
23621
23740
|
}),
|
|
23622
|
-
/* @__PURE__ */
|
|
23741
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23623
23742
|
className: "font-medium text-sm",
|
|
23624
23743
|
children: "MCP Servers"
|
|
23625
23744
|
}),
|
|
@@ -23635,22 +23754,22 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23635
23754
|
/* @__PURE__ */ jsxs84("div", {
|
|
23636
23755
|
className: "flex items-center gap-1",
|
|
23637
23756
|
children: [
|
|
23638
|
-
/* @__PURE__ */
|
|
23757
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23639
23758
|
variant: "ghost",
|
|
23640
23759
|
size: "icon",
|
|
23641
23760
|
onClick: () => setIsAddModalOpen(true),
|
|
23642
23761
|
title: "Add MCP server",
|
|
23643
23762
|
className: "h-7 w-7",
|
|
23644
|
-
children: /* @__PURE__ */
|
|
23763
|
+
children: /* @__PURE__ */ jsx94(Plus7, {
|
|
23645
23764
|
className: "w-4 h-4"
|
|
23646
23765
|
})
|
|
23647
23766
|
}),
|
|
23648
|
-
/* @__PURE__ */
|
|
23767
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23649
23768
|
variant: "ghost",
|
|
23650
23769
|
size: "icon",
|
|
23651
23770
|
onClick: collapseSidebar,
|
|
23652
23771
|
title: "Close sidebar",
|
|
23653
|
-
children: /* @__PURE__ */
|
|
23772
|
+
children: /* @__PURE__ */ jsx94(ChevronRight15, {
|
|
23654
23773
|
className: "w-4 h-4"
|
|
23655
23774
|
})
|
|
23656
23775
|
})
|
|
@@ -23658,12 +23777,12 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23658
23777
|
})
|
|
23659
23778
|
]
|
|
23660
23779
|
}),
|
|
23661
|
-
/* @__PURE__ */
|
|
23780
|
+
/* @__PURE__ */ jsx94("div", {
|
|
23662
23781
|
className: "flex-1 overflow-y-auto",
|
|
23663
23782
|
children: isFetching && servers.length === 0 ? /* @__PURE__ */ jsxs84("div", {
|
|
23664
23783
|
className: "flex items-center justify-center h-32 text-muted-foreground",
|
|
23665
23784
|
children: [
|
|
23666
|
-
/* @__PURE__ */
|
|
23785
|
+
/* @__PURE__ */ jsx94(Loader214, {
|
|
23667
23786
|
className: "w-4 h-4 animate-spin mr-2"
|
|
23668
23787
|
}),
|
|
23669
23788
|
"Loading..."
|
|
@@ -23671,7 +23790,7 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23671
23790
|
}) : servers.length === 0 ? /* @__PURE__ */ jsxs84("div", {
|
|
23672
23791
|
className: "p-4 text-sm text-muted-foreground space-y-3",
|
|
23673
23792
|
children: [
|
|
23674
|
-
/* @__PURE__ */
|
|
23793
|
+
/* @__PURE__ */ jsx94("p", {
|
|
23675
23794
|
children: "No MCP servers configured."
|
|
23676
23795
|
}),
|
|
23677
23796
|
/* @__PURE__ */ jsxs84(Button, {
|
|
@@ -23680,7 +23799,7 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23680
23799
|
onClick: () => setIsAddModalOpen(true),
|
|
23681
23800
|
className: "w-full",
|
|
23682
23801
|
children: [
|
|
23683
|
-
/* @__PURE__ */
|
|
23802
|
+
/* @__PURE__ */ jsx94(Plus7, {
|
|
23684
23803
|
className: "w-3 h-3 mr-1"
|
|
23685
23804
|
}),
|
|
23686
23805
|
"Add MCP Server"
|
|
@@ -23691,16 +23810,16 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23691
23810
|
children: [
|
|
23692
23811
|
"Or add servers to",
|
|
23693
23812
|
" ",
|
|
23694
|
-
/* @__PURE__ */
|
|
23813
|
+
/* @__PURE__ */ jsx94("code", {
|
|
23695
23814
|
className: "bg-muted px-1 py-0.5 rounded text-xs",
|
|
23696
23815
|
children: ".otto/config.json"
|
|
23697
23816
|
})
|
|
23698
23817
|
]
|
|
23699
23818
|
})
|
|
23700
23819
|
]
|
|
23701
|
-
}) : /* @__PURE__ */
|
|
23820
|
+
}) : /* @__PURE__ */ jsx94("div", {
|
|
23702
23821
|
className: "p-2 space-y-1.5",
|
|
23703
|
-
children: sortedServers.map((server) => /* @__PURE__ */
|
|
23822
|
+
children: sortedServers.map((server) => /* @__PURE__ */ jsx94(MCPServerCard, {
|
|
23704
23823
|
server,
|
|
23705
23824
|
isLoading: loading.has(server.name),
|
|
23706
23825
|
authUrl: authUrls.get(server.name),
|
|
@@ -23712,7 +23831,7 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23712
23831
|
}, server.name))
|
|
23713
23832
|
})
|
|
23714
23833
|
}),
|
|
23715
|
-
/* @__PURE__ */
|
|
23834
|
+
/* @__PURE__ */ jsx94(AddMCPServerModal, {
|
|
23716
23835
|
isOpen: isAddModalOpen,
|
|
23717
23836
|
onClose: () => setIsAddModalOpen(false)
|
|
23718
23837
|
}),
|
|
@@ -23728,7 +23847,7 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23728
23847
|
children: [
|
|
23729
23848
|
"Are you sure you want to remove",
|
|
23730
23849
|
" ",
|
|
23731
|
-
/* @__PURE__ */
|
|
23850
|
+
/* @__PURE__ */ jsx94("span", {
|
|
23732
23851
|
className: "font-medium text-foreground",
|
|
23733
23852
|
children: deleteTarget
|
|
23734
23853
|
}),
|
|
@@ -23738,13 +23857,13 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23738
23857
|
/* @__PURE__ */ jsxs84("div", {
|
|
23739
23858
|
className: "flex justify-end gap-2",
|
|
23740
23859
|
children: [
|
|
23741
|
-
/* @__PURE__ */
|
|
23860
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23742
23861
|
variant: "secondary",
|
|
23743
23862
|
size: "sm",
|
|
23744
23863
|
onClick: () => setDeleteTarget(null),
|
|
23745
23864
|
children: "Cancel"
|
|
23746
23865
|
}),
|
|
23747
|
-
/* @__PURE__ */
|
|
23866
|
+
/* @__PURE__ */ jsx94(Button, {
|
|
23748
23867
|
variant: "primary",
|
|
23749
23868
|
size: "sm",
|
|
23750
23869
|
className: "bg-red-500 hover:bg-red-600 text-white",
|
|
@@ -23764,10 +23883,10 @@ var MCPSidebar = memo36(function MCPSidebar2() {
|
|
|
23764
23883
|
});
|
|
23765
23884
|
});
|
|
23766
23885
|
// src/components/mcp/MCPSidebarToggle.tsx
|
|
23767
|
-
import { memo as
|
|
23886
|
+
import { memo as memo38 } from "react";
|
|
23768
23887
|
import { Plug as Plug5 } from "lucide-react";
|
|
23769
|
-
import { jsx as
|
|
23770
|
-
var MCPSidebarToggle =
|
|
23888
|
+
import { jsx as jsx95, jsxs as jsxs85 } from "react/jsx-runtime";
|
|
23889
|
+
var MCPSidebarToggle = memo38(function MCPSidebarToggle2() {
|
|
23771
23890
|
const isExpanded = useMCPStore((state) => state.isExpanded);
|
|
23772
23891
|
const toggleSidebar = useMCPStore((state) => state.toggleSidebar);
|
|
23773
23892
|
const servers = useMCPStore((state) => state.servers);
|
|
@@ -23778,21 +23897,21 @@ var MCPSidebarToggle = memo37(function MCPSidebarToggle2() {
|
|
|
23778
23897
|
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
23898
|
title: "MCP Servers",
|
|
23780
23899
|
children: [
|
|
23781
|
-
/* @__PURE__ */
|
|
23900
|
+
/* @__PURE__ */ jsx95(Plug5, {
|
|
23782
23901
|
className: "w-5 h-5 text-muted-foreground mx-auto"
|
|
23783
23902
|
}),
|
|
23784
|
-
connectedCount > 0 && /* @__PURE__ */
|
|
23903
|
+
connectedCount > 0 && /* @__PURE__ */ jsx95("span", {
|
|
23785
23904
|
className: "absolute top-2 right-2 w-2 h-2 bg-green-500 rounded-full"
|
|
23786
23905
|
})
|
|
23787
23906
|
]
|
|
23788
23907
|
});
|
|
23789
23908
|
});
|
|
23790
23909
|
// src/components/skills/SkillsSidebar.tsx
|
|
23791
|
-
import { memo as
|
|
23910
|
+
import { memo as memo39, useMemo as useMemo24 } from "react";
|
|
23792
23911
|
import {
|
|
23793
23912
|
ChevronRight as ChevronRight16,
|
|
23794
23913
|
Sparkles as Sparkles6,
|
|
23795
|
-
Loader2 as
|
|
23914
|
+
Loader2 as Loader215,
|
|
23796
23915
|
FolderDot as FolderDot3,
|
|
23797
23916
|
Laptop as Laptop3,
|
|
23798
23917
|
Globe as Globe7,
|
|
@@ -23802,24 +23921,45 @@ import {
|
|
|
23802
23921
|
} from "lucide-react";
|
|
23803
23922
|
|
|
23804
23923
|
// src/hooks/useSkills.ts
|
|
23805
|
-
import { useQuery as useQuery14 } from "@tanstack/react-query";
|
|
23924
|
+
import { useMutation as useMutation11, useQuery as useQuery14, useQueryClient as useQueryClient19 } from "@tanstack/react-query";
|
|
23806
23925
|
import { useEffect as useEffect42 } from "react";
|
|
23807
23926
|
function useSkills() {
|
|
23808
|
-
const
|
|
23927
|
+
const setSkillsConfig = useSkillsStore((s) => s.setSkillsConfig);
|
|
23809
23928
|
const query = useQuery14({
|
|
23810
23929
|
queryKey: ["skills"],
|
|
23811
23930
|
queryFn: async () => {
|
|
23812
|
-
return apiClient.
|
|
23931
|
+
return apiClient.getSkillsConfig();
|
|
23813
23932
|
},
|
|
23814
23933
|
refetchInterval: 30000
|
|
23815
23934
|
});
|
|
23816
23935
|
useEffect42(() => {
|
|
23817
|
-
if (query.data?.
|
|
23818
|
-
|
|
23936
|
+
if (query.data?.items) {
|
|
23937
|
+
setSkillsConfig({
|
|
23938
|
+
skills: query.data.items,
|
|
23939
|
+
globalEnabled: query.data.enabled,
|
|
23940
|
+
totalCount: query.data.totalCount,
|
|
23941
|
+
enabledCount: query.data.enabledCount
|
|
23942
|
+
});
|
|
23819
23943
|
}
|
|
23820
|
-
}, [query.data,
|
|
23944
|
+
}, [query.data, setSkillsConfig]);
|
|
23821
23945
|
return query;
|
|
23822
23946
|
}
|
|
23947
|
+
function useUpdateSkillsConfig() {
|
|
23948
|
+
const queryClient = useQueryClient19();
|
|
23949
|
+
const setSkillsConfig = useSkillsStore((s) => s.setSkillsConfig);
|
|
23950
|
+
return useMutation11({
|
|
23951
|
+
mutationFn: (input) => apiClient.updateSkillsConfig(input),
|
|
23952
|
+
onSuccess: (data) => {
|
|
23953
|
+
setSkillsConfig({
|
|
23954
|
+
skills: data.items,
|
|
23955
|
+
globalEnabled: data.enabled,
|
|
23956
|
+
totalCount: data.totalCount,
|
|
23957
|
+
enabledCount: data.enabledCount
|
|
23958
|
+
});
|
|
23959
|
+
queryClient.setQueryData(["skills"], data);
|
|
23960
|
+
}
|
|
23961
|
+
});
|
|
23962
|
+
}
|
|
23823
23963
|
function useSkillDetail(name) {
|
|
23824
23964
|
return useQuery14({
|
|
23825
23965
|
queryKey: ["skills", name],
|
|
@@ -23855,7 +23995,7 @@ function useSkillFileContent(name, filePath) {
|
|
|
23855
23995
|
}
|
|
23856
23996
|
|
|
23857
23997
|
// src/components/skills/SkillsSidebar.tsx
|
|
23858
|
-
import { jsx as
|
|
23998
|
+
import { jsx as jsx96, jsxs as jsxs86 } from "react/jsx-runtime";
|
|
23859
23999
|
var SCOPE_ICONS = {
|
|
23860
24000
|
cwd: FolderDot3,
|
|
23861
24001
|
parent: FolderDot3,
|
|
@@ -23877,15 +24017,19 @@ function formatSize(bytes) {
|
|
|
23877
24017
|
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
23878
24018
|
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
23879
24019
|
}
|
|
23880
|
-
var SkillsSidebar =
|
|
24020
|
+
var SkillsSidebar = memo39(function SkillsSidebar2() {
|
|
23881
24021
|
const isExpanded = useSkillsStore((s) => s.isExpanded);
|
|
23882
24022
|
const collapseSidebar = useSkillsStore((s) => s.collapseSidebar);
|
|
23883
24023
|
const skills = useSkillsStore((s) => s.skills);
|
|
24024
|
+
const globalEnabled = useSkillsStore((s) => s.globalEnabled);
|
|
24025
|
+
const totalCount = useSkillsStore((s) => s.totalCount);
|
|
24026
|
+
const enabledCount = useSkillsStore((s) => s.enabledCount);
|
|
23884
24027
|
const selectedSkill = useSkillsStore((s) => s.selectedSkill);
|
|
23885
24028
|
const selectSkill = useSkillsStore((s) => s.selectSkill);
|
|
23886
24029
|
const openViewer = useSkillsStore((s) => s.openViewer);
|
|
23887
24030
|
const viewingFile = useSkillsStore((s) => s.viewingFile);
|
|
23888
24031
|
const { isLoading, isFetching, refetch } = useSkills();
|
|
24032
|
+
const updateSkillsConfig = useUpdateSkillsConfig();
|
|
23889
24033
|
const { data: skillDetail } = useSkillDetail(selectedSkill);
|
|
23890
24034
|
const { data: skillFilesData } = useSkillFiles(selectedSkill);
|
|
23891
24035
|
const skillFiles = skillFilesData?.files ?? [];
|
|
@@ -23909,32 +24053,42 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
23909
24053
|
/* @__PURE__ */ jsxs86("div", {
|
|
23910
24054
|
className: "flex items-center gap-2",
|
|
23911
24055
|
children: [
|
|
23912
|
-
/* @__PURE__ */
|
|
24056
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
23913
24057
|
className: "w-4 h-4 text-muted-foreground"
|
|
23914
24058
|
}),
|
|
23915
|
-
/* @__PURE__ */
|
|
24059
|
+
/* @__PURE__ */ jsx96("span", {
|
|
23916
24060
|
className: "font-medium text-sm",
|
|
23917
24061
|
children: "Skills"
|
|
23918
24062
|
})
|
|
23919
24063
|
]
|
|
23920
24064
|
}),
|
|
23921
|
-
/* @__PURE__ */
|
|
23922
|
-
|
|
23923
|
-
|
|
23924
|
-
|
|
23925
|
-
|
|
23926
|
-
|
|
23927
|
-
|
|
23928
|
-
|
|
24065
|
+
/* @__PURE__ */ jsxs86("div", {
|
|
24066
|
+
className: "flex items-center gap-1",
|
|
24067
|
+
children: [
|
|
24068
|
+
/* @__PURE__ */ jsx96(ToggleSwitch, {
|
|
24069
|
+
checked: globalEnabled,
|
|
24070
|
+
loading: updateSkillsConfig.isPending,
|
|
24071
|
+
onChange: () => updateSkillsConfig.mutate({ enabled: !globalEnabled })
|
|
24072
|
+
}),
|
|
24073
|
+
/* @__PURE__ */ jsx96(Button, {
|
|
24074
|
+
variant: "ghost",
|
|
24075
|
+
size: "icon",
|
|
24076
|
+
onClick: collapseSidebar,
|
|
24077
|
+
title: "Close sidebar",
|
|
24078
|
+
children: /* @__PURE__ */ jsx96(ChevronRight16, {
|
|
24079
|
+
className: "w-4 h-4"
|
|
24080
|
+
})
|
|
24081
|
+
})
|
|
24082
|
+
]
|
|
23929
24083
|
})
|
|
23930
24084
|
]
|
|
23931
24085
|
}),
|
|
23932
24086
|
selectedSkill && skillDetail ? /* @__PURE__ */ jsxs86("div", {
|
|
23933
24087
|
className: "flex-1 overflow-y-auto",
|
|
23934
24088
|
children: [
|
|
23935
|
-
/* @__PURE__ */
|
|
24089
|
+
/* @__PURE__ */ jsx96("div", {
|
|
23936
24090
|
className: "p-3 border-b border-border",
|
|
23937
|
-
children: /* @__PURE__ */
|
|
24091
|
+
children: /* @__PURE__ */ jsx96("button", {
|
|
23938
24092
|
type: "button",
|
|
23939
24093
|
onClick: () => selectSkill(null),
|
|
23940
24094
|
className: "text-xs text-muted-foreground hover:text-foreground transition-colors",
|
|
@@ -23944,22 +24098,22 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
23944
24098
|
/* @__PURE__ */ jsxs86("div", {
|
|
23945
24099
|
className: "px-3 py-3 border-b border-border",
|
|
23946
24100
|
children: [
|
|
23947
|
-
/* @__PURE__ */
|
|
24101
|
+
/* @__PURE__ */ jsx96("h3", {
|
|
23948
24102
|
className: "font-medium text-sm mb-1",
|
|
23949
24103
|
children: skillDetail.name
|
|
23950
24104
|
}),
|
|
23951
|
-
/* @__PURE__ */
|
|
24105
|
+
/* @__PURE__ */ jsx96("p", {
|
|
23952
24106
|
className: "text-xs text-muted-foreground mb-2",
|
|
23953
24107
|
children: skillDetail.description
|
|
23954
24108
|
}),
|
|
23955
24109
|
/* @__PURE__ */ jsxs86("div", {
|
|
23956
24110
|
className: "flex items-center gap-2",
|
|
23957
24111
|
children: [
|
|
23958
|
-
/* @__PURE__ */
|
|
24112
|
+
/* @__PURE__ */ jsx96("span", {
|
|
23959
24113
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground",
|
|
23960
24114
|
children: SCOPE_LABELS[skillDetail.scope] ?? skillDetail.scope
|
|
23961
24115
|
}),
|
|
23962
|
-
skillDetail.license && /* @__PURE__ */
|
|
24116
|
+
skillDetail.license && /* @__PURE__ */ jsx96("span", {
|
|
23963
24117
|
className: "text-[10px] px-1.5 py-0.5 rounded bg-muted text-muted-foreground",
|
|
23964
24118
|
children: skillDetail.license
|
|
23965
24119
|
})
|
|
@@ -23970,42 +24124,42 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
23970
24124
|
/* @__PURE__ */ jsxs86("div", {
|
|
23971
24125
|
className: "py-1",
|
|
23972
24126
|
children: [
|
|
23973
|
-
/* @__PURE__ */
|
|
24127
|
+
/* @__PURE__ */ jsx96("div", {
|
|
23974
24128
|
className: "flex items-center gap-1.5 px-3 py-2 text-[10px] uppercase tracking-wider text-muted-foreground font-medium",
|
|
23975
24129
|
children: "Files"
|
|
23976
24130
|
}),
|
|
23977
|
-
/* @__PURE__ */
|
|
24131
|
+
/* @__PURE__ */ jsx96("button", {
|
|
23978
24132
|
type: "button",
|
|
23979
24133
|
onClick: () => openViewer(null),
|
|
23980
24134
|
className: `w-full text-left px-3 py-2 hover:bg-accent transition-colors ${viewingFile === null ? "bg-accent" : ""}`,
|
|
23981
24135
|
children: /* @__PURE__ */ jsxs86("div", {
|
|
23982
24136
|
className: "flex items-center gap-2",
|
|
23983
24137
|
children: [
|
|
23984
|
-
/* @__PURE__ */
|
|
24138
|
+
/* @__PURE__ */ jsx96(FileText7, {
|
|
23985
24139
|
className: "w-3.5 h-3.5 flex-shrink-0 text-muted-foreground"
|
|
23986
24140
|
}),
|
|
23987
|
-
/* @__PURE__ */
|
|
24141
|
+
/* @__PURE__ */ jsx96("span", {
|
|
23988
24142
|
className: "text-sm font-mono truncate flex-1",
|
|
23989
24143
|
children: "SKILL.md"
|
|
23990
24144
|
})
|
|
23991
24145
|
]
|
|
23992
24146
|
})
|
|
23993
24147
|
}),
|
|
23994
|
-
skillFiles.map((file) => /* @__PURE__ */
|
|
24148
|
+
skillFiles.map((file) => /* @__PURE__ */ jsx96("button", {
|
|
23995
24149
|
type: "button",
|
|
23996
24150
|
onClick: () => openViewer(file.relativePath),
|
|
23997
24151
|
className: `w-full text-left px-3 py-2 hover:bg-accent transition-colors ${viewingFile === file.relativePath ? "bg-accent" : ""}`,
|
|
23998
24152
|
children: /* @__PURE__ */ jsxs86("div", {
|
|
23999
24153
|
className: "flex items-center gap-2",
|
|
24000
24154
|
children: [
|
|
24001
|
-
/* @__PURE__ */
|
|
24155
|
+
/* @__PURE__ */ jsx96(FileCode2, {
|
|
24002
24156
|
className: "w-3.5 h-3.5 flex-shrink-0 text-muted-foreground"
|
|
24003
24157
|
}),
|
|
24004
|
-
/* @__PURE__ */
|
|
24158
|
+
/* @__PURE__ */ jsx96("span", {
|
|
24005
24159
|
className: "text-sm font-mono truncate flex-1",
|
|
24006
24160
|
children: file.relativePath
|
|
24007
24161
|
}),
|
|
24008
|
-
/* @__PURE__ */
|
|
24162
|
+
/* @__PURE__ */ jsx96("span", {
|
|
24009
24163
|
className: "text-[10px] text-muted-foreground flex-shrink-0",
|
|
24010
24164
|
children: formatSize(file.size)
|
|
24011
24165
|
})
|
|
@@ -24015,20 +24169,20 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24015
24169
|
]
|
|
24016
24170
|
})
|
|
24017
24171
|
]
|
|
24018
|
-
}) : /* @__PURE__ */
|
|
24172
|
+
}) : /* @__PURE__ */ jsx96("div", {
|
|
24019
24173
|
className: "flex-1 overflow-y-auto",
|
|
24020
|
-
children: isLoading ? /* @__PURE__ */
|
|
24174
|
+
children: isLoading ? /* @__PURE__ */ jsx96("div", {
|
|
24021
24175
|
className: "flex items-center justify-center py-8",
|
|
24022
|
-
children: /* @__PURE__ */
|
|
24176
|
+
children: /* @__PURE__ */ jsx96(Loader215, {
|
|
24023
24177
|
className: "w-4 h-4 animate-spin text-muted-foreground"
|
|
24024
24178
|
})
|
|
24025
|
-
}) :
|
|
24179
|
+
}) : totalCount === 0 ? /* @__PURE__ */ jsxs86("div", {
|
|
24026
24180
|
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24027
24181
|
children: [
|
|
24028
|
-
/* @__PURE__ */
|
|
24182
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
24029
24183
|
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24030
24184
|
}),
|
|
24031
|
-
/* @__PURE__ */
|
|
24185
|
+
/* @__PURE__ */ jsx96("h3", {
|
|
24032
24186
|
className: "text-sm font-medium mb-2",
|
|
24033
24187
|
children: "No skills found"
|
|
24034
24188
|
}),
|
|
@@ -24037,21 +24191,51 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24037
24191
|
children: [
|
|
24038
24192
|
"Create skills in",
|
|
24039
24193
|
" ",
|
|
24040
|
-
/* @__PURE__ */
|
|
24194
|
+
/* @__PURE__ */ jsx96("code", {
|
|
24041
24195
|
className: "text-[10px] bg-muted px-1 rounded",
|
|
24042
24196
|
children: ".otto/skills/ or .agents/skills/"
|
|
24043
24197
|
}),
|
|
24044
24198
|
" ",
|
|
24045
24199
|
"or",
|
|
24046
24200
|
" ",
|
|
24047
|
-
/* @__PURE__ */
|
|
24201
|
+
/* @__PURE__ */ jsx96("code", {
|
|
24048
24202
|
className: "text-[10px] bg-muted px-1 rounded",
|
|
24049
24203
|
children: "~/.config/otto/skills/ or ~/.agents/skills/"
|
|
24050
24204
|
})
|
|
24051
24205
|
]
|
|
24052
24206
|
})
|
|
24053
24207
|
]
|
|
24054
|
-
}) : /* @__PURE__ */
|
|
24208
|
+
}) : !globalEnabled ? /* @__PURE__ */ jsxs86("div", {
|
|
24209
|
+
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24210
|
+
children: [
|
|
24211
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
24212
|
+
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24213
|
+
}),
|
|
24214
|
+
/* @__PURE__ */ jsx96("h3", {
|
|
24215
|
+
className: "text-sm font-medium mb-2",
|
|
24216
|
+
children: "Skills are disabled"
|
|
24217
|
+
}),
|
|
24218
|
+
/* @__PURE__ */ jsx96("p", {
|
|
24219
|
+
className: "text-xs text-muted-foreground max-w-[220px]",
|
|
24220
|
+
children: "Turn the skills toggle on to make discovered skills available."
|
|
24221
|
+
})
|
|
24222
|
+
]
|
|
24223
|
+
}) : skills.length === 0 ? /* @__PURE__ */ jsxs86("div", {
|
|
24224
|
+
className: "flex flex-col items-center justify-center h-full text-center p-4",
|
|
24225
|
+
children: [
|
|
24226
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
24227
|
+
className: "w-12 h-12 text-muted-foreground/30 mb-4"
|
|
24228
|
+
}),
|
|
24229
|
+
/* @__PURE__ */ jsx96("h3", {
|
|
24230
|
+
className: "text-sm font-medium mb-2",
|
|
24231
|
+
children: "All skills are disabled"
|
|
24232
|
+
}),
|
|
24233
|
+
/* @__PURE__ */ jsx96("p", {
|
|
24234
|
+
className: "text-xs text-muted-foreground max-w-[220px]",
|
|
24235
|
+
children: "Enable individual skills or turn all skills back on."
|
|
24236
|
+
})
|
|
24237
|
+
]
|
|
24238
|
+
}) : /* @__PURE__ */ jsx96("div", {
|
|
24055
24239
|
className: "py-1",
|
|
24056
24240
|
children: ["cwd", "parent", "repo", "user", "system"].map((scope) => {
|
|
24057
24241
|
const scopeSkills = groupedSkills.get(scope);
|
|
@@ -24063,34 +24247,45 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24063
24247
|
/* @__PURE__ */ jsxs86("div", {
|
|
24064
24248
|
className: "flex items-center gap-1.5 px-3 py-2 text-[10px] uppercase tracking-wider text-muted-foreground font-medium",
|
|
24065
24249
|
children: [
|
|
24066
|
-
/* @__PURE__ */
|
|
24250
|
+
/* @__PURE__ */ jsx96(ScopeIcon, {
|
|
24067
24251
|
className: "w-3 h-3"
|
|
24068
24252
|
}),
|
|
24069
24253
|
SCOPE_LABELS[scope] ?? scope
|
|
24070
24254
|
]
|
|
24071
24255
|
}),
|
|
24072
|
-
scopeSkills.map((skill) => /* @__PURE__ */
|
|
24256
|
+
scopeSkills.map((skill) => /* @__PURE__ */ jsx96("button", {
|
|
24073
24257
|
type: "button",
|
|
24074
24258
|
onClick: () => selectSkill(skill.name),
|
|
24075
24259
|
className: `w-full text-left px-3 py-2 hover:bg-accent transition-colors ${selectedSkill === skill.name ? "bg-accent" : ""}`,
|
|
24076
24260
|
children: /* @__PURE__ */ jsxs86("div", {
|
|
24077
|
-
className: "flex items-
|
|
24261
|
+
className: "flex items-start gap-2",
|
|
24078
24262
|
children: [
|
|
24079
|
-
/* @__PURE__ */
|
|
24263
|
+
/* @__PURE__ */ jsx96(FileText7, {
|
|
24080
24264
|
className: "w-3.5 h-3.5 flex-shrink-0 text-muted-foreground"
|
|
24081
24265
|
}),
|
|
24082
24266
|
/* @__PURE__ */ jsxs86("div", {
|
|
24083
24267
|
className: "min-w-0 flex-1",
|
|
24084
24268
|
children: [
|
|
24085
|
-
/* @__PURE__ */
|
|
24269
|
+
/* @__PURE__ */ jsx96("div", {
|
|
24086
24270
|
className: "text-sm font-medium truncate",
|
|
24087
24271
|
children: skill.name
|
|
24088
24272
|
}),
|
|
24089
|
-
/* @__PURE__ */
|
|
24273
|
+
/* @__PURE__ */ jsx96("div", {
|
|
24090
24274
|
className: "text-xs text-muted-foreground truncate",
|
|
24091
24275
|
children: skill.description
|
|
24092
24276
|
})
|
|
24093
24277
|
]
|
|
24278
|
+
}),
|
|
24279
|
+
/* @__PURE__ */ jsx96(ToggleSwitch, {
|
|
24280
|
+
checked: skill.enabled !== false,
|
|
24281
|
+
loading: updateSkillsConfig.isPending,
|
|
24282
|
+
onChange: () => updateSkillsConfig.mutate({
|
|
24283
|
+
items: {
|
|
24284
|
+
[skill.name]: {
|
|
24285
|
+
enabled: skill.enabled === false
|
|
24286
|
+
}
|
|
24287
|
+
}
|
|
24288
|
+
})
|
|
24094
24289
|
})
|
|
24095
24290
|
]
|
|
24096
24291
|
})
|
|
@@ -24106,27 +24301,29 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24106
24301
|
/* @__PURE__ */ jsxs86("div", {
|
|
24107
24302
|
className: "flex items-center gap-2 min-w-0 flex-1",
|
|
24108
24303
|
children: [
|
|
24109
|
-
/* @__PURE__ */
|
|
24304
|
+
/* @__PURE__ */ jsx96(Sparkles6, {
|
|
24110
24305
|
className: "w-3 h-3 flex-shrink-0"
|
|
24111
24306
|
}),
|
|
24112
24307
|
/* @__PURE__ */ jsxs86("span", {
|
|
24113
24308
|
className: "truncate",
|
|
24114
24309
|
children: [
|
|
24115
|
-
|
|
24310
|
+
enabledCount,
|
|
24311
|
+
"/",
|
|
24312
|
+
totalCount,
|
|
24116
24313
|
" ",
|
|
24117
|
-
|
|
24314
|
+
totalCount === 1 ? "skill" : "skills"
|
|
24118
24315
|
]
|
|
24119
24316
|
})
|
|
24120
24317
|
]
|
|
24121
24318
|
}),
|
|
24122
|
-
/* @__PURE__ */
|
|
24319
|
+
/* @__PURE__ */ jsx96(Button, {
|
|
24123
24320
|
variant: "ghost",
|
|
24124
24321
|
size: "icon",
|
|
24125
24322
|
onClick: () => refetch(),
|
|
24126
24323
|
title: "Refresh skills",
|
|
24127
24324
|
className: "h-6 w-6 flex-shrink-0",
|
|
24128
24325
|
disabled: isFetching,
|
|
24129
|
-
children: /* @__PURE__ */
|
|
24326
|
+
children: /* @__PURE__ */ jsx96(RefreshCw9, {
|
|
24130
24327
|
className: `w-3 h-3 ${isFetching ? "animate-spin" : ""}`
|
|
24131
24328
|
})
|
|
24132
24329
|
})
|
|
@@ -24136,31 +24333,31 @@ var SkillsSidebar = memo38(function SkillsSidebar2() {
|
|
|
24136
24333
|
});
|
|
24137
24334
|
});
|
|
24138
24335
|
// src/components/skills/SkillsSidebarToggle.tsx
|
|
24139
|
-
import { memo as
|
|
24336
|
+
import { memo as memo40 } from "react";
|
|
24140
24337
|
import { Sparkles as Sparkles7 } from "lucide-react";
|
|
24141
|
-
import { jsx as
|
|
24142
|
-
var SkillsSidebarToggle =
|
|
24338
|
+
import { jsx as jsx97 } from "react/jsx-runtime";
|
|
24339
|
+
var SkillsSidebarToggle = memo40(function SkillsSidebarToggle2() {
|
|
24143
24340
|
const isExpanded = useSkillsStore((state) => state.isExpanded);
|
|
24144
24341
|
const toggleSidebar = useSkillsStore((state) => state.toggleSidebar);
|
|
24145
|
-
return /* @__PURE__ */
|
|
24342
|
+
return /* @__PURE__ */ jsx97("button", {
|
|
24146
24343
|
type: "button",
|
|
24147
24344
|
onClick: toggleSidebar,
|
|
24148
24345
|
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
24346
|
title: "Skills",
|
|
24150
|
-
children: /* @__PURE__ */
|
|
24347
|
+
children: /* @__PURE__ */ jsx97(Sparkles7, {
|
|
24151
24348
|
className: "w-5 h-5 text-muted-foreground mx-auto"
|
|
24152
24349
|
})
|
|
24153
24350
|
});
|
|
24154
24351
|
});
|
|
24155
24352
|
// src/components/skills/SkillViewerPanel.tsx
|
|
24156
|
-
import { memo as
|
|
24353
|
+
import { memo as memo41, useEffect as useEffect43 } from "react";
|
|
24157
24354
|
import { X as X16 } from "lucide-react";
|
|
24158
24355
|
import { Prism as SyntaxHighlighter11 } from "react-syntax-highlighter";
|
|
24159
24356
|
import {
|
|
24160
24357
|
prism as prism11,
|
|
24161
24358
|
vscDarkPlus as vscDarkPlus11
|
|
24162
24359
|
} from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
24163
|
-
import { jsx as
|
|
24360
|
+
import { jsx as jsx98, jsxs as jsxs87 } from "react/jsx-runtime";
|
|
24164
24361
|
var LANGUAGE_MAP2 = {
|
|
24165
24362
|
js: "javascript",
|
|
24166
24363
|
jsx: "jsx",
|
|
@@ -24196,7 +24393,7 @@ function inferLanguage(path) {
|
|
|
24196
24393
|
const ext = path.split(".").pop()?.toLowerCase() ?? "";
|
|
24197
24394
|
return LANGUAGE_MAP2[ext] ?? "plaintext";
|
|
24198
24395
|
}
|
|
24199
|
-
var SkillViewerPanel =
|
|
24396
|
+
var SkillViewerPanel = memo41(function SkillViewerPanel2() {
|
|
24200
24397
|
const isViewerOpen = useSkillsStore((s) => s.isViewerOpen);
|
|
24201
24398
|
const viewingFile = useSkillsStore((s) => s.viewingFile);
|
|
24202
24399
|
const selectedSkill = useSkillsStore((s) => s.selectedSkill);
|
|
@@ -24228,47 +24425,47 @@ var SkillViewerPanel = memo40(function SkillViewerPanel2() {
|
|
|
24228
24425
|
/* @__PURE__ */ jsxs87("div", {
|
|
24229
24426
|
className: "h-14 border-b border-border px-4 flex items-center gap-3",
|
|
24230
24427
|
children: [
|
|
24231
|
-
/* @__PURE__ */
|
|
24428
|
+
/* @__PURE__ */ jsx98(Button, {
|
|
24232
24429
|
variant: "ghost",
|
|
24233
24430
|
size: "icon",
|
|
24234
24431
|
onClick: closeViewer,
|
|
24235
24432
|
title: "Close viewer (ESC)",
|
|
24236
|
-
children: /* @__PURE__ */
|
|
24433
|
+
children: /* @__PURE__ */ jsx98(X16, {
|
|
24237
24434
|
className: "w-4 h-4"
|
|
24238
24435
|
})
|
|
24239
24436
|
}),
|
|
24240
24437
|
/* @__PURE__ */ jsxs87("div", {
|
|
24241
24438
|
className: "flex-1 flex items-center gap-2 min-w-0",
|
|
24242
24439
|
children: [
|
|
24243
|
-
/* @__PURE__ */
|
|
24440
|
+
/* @__PURE__ */ jsx98("span", {
|
|
24244
24441
|
className: "text-xs text-muted-foreground flex-shrink-0",
|
|
24245
24442
|
children: selectedSkill
|
|
24246
24443
|
}),
|
|
24247
|
-
/* @__PURE__ */
|
|
24444
|
+
/* @__PURE__ */ jsx98("span", {
|
|
24248
24445
|
className: "text-xs text-muted-foreground",
|
|
24249
24446
|
children: "/"
|
|
24250
24447
|
}),
|
|
24251
|
-
/* @__PURE__ */
|
|
24448
|
+
/* @__PURE__ */ jsx98("span", {
|
|
24252
24449
|
className: "text-sm font-medium text-foreground font-mono truncate",
|
|
24253
24450
|
title: displayPath,
|
|
24254
24451
|
children: displayPath
|
|
24255
24452
|
})
|
|
24256
24453
|
]
|
|
24257
24454
|
}),
|
|
24258
|
-
/* @__PURE__ */
|
|
24455
|
+
/* @__PURE__ */ jsx98("span", {
|
|
24259
24456
|
className: "text-xs text-muted-foreground",
|
|
24260
24457
|
children: language
|
|
24261
24458
|
})
|
|
24262
24459
|
]
|
|
24263
24460
|
}),
|
|
24264
|
-
/* @__PURE__ */
|
|
24461
|
+
/* @__PURE__ */ jsx98("div", {
|
|
24265
24462
|
className: "flex-1 overflow-auto",
|
|
24266
|
-
children: isLoading ? /* @__PURE__ */
|
|
24463
|
+
children: isLoading ? /* @__PURE__ */ jsx98("div", {
|
|
24267
24464
|
className: "h-full flex items-center justify-center text-muted-foreground",
|
|
24268
24465
|
children: "Loading..."
|
|
24269
|
-
}) : content ? /* @__PURE__ */
|
|
24466
|
+
}) : content ? /* @__PURE__ */ jsx98("div", {
|
|
24270
24467
|
className: "code-with-line-numbers",
|
|
24271
|
-
children: /* @__PURE__ */
|
|
24468
|
+
children: /* @__PURE__ */ jsx98(SyntaxHighlighter11, {
|
|
24272
24469
|
language,
|
|
24273
24470
|
style: syntaxTheme,
|
|
24274
24471
|
wrapLines: true,
|
|
@@ -24290,7 +24487,7 @@ var SkillViewerPanel = memo40(function SkillViewerPanel2() {
|
|
|
24290
24487
|
},
|
|
24291
24488
|
children: content
|
|
24292
24489
|
})
|
|
24293
|
-
}) : /* @__PURE__ */
|
|
24490
|
+
}) : /* @__PURE__ */ jsx98("div", {
|
|
24294
24491
|
className: "h-full flex items-center justify-center text-muted-foreground",
|
|
24295
24492
|
children: "Unable to load file"
|
|
24296
24493
|
})
|
|
@@ -24299,7 +24496,7 @@ var SkillViewerPanel = memo40(function SkillViewerPanel2() {
|
|
|
24299
24496
|
});
|
|
24300
24497
|
});
|
|
24301
24498
|
// src/components/file-browser/FileBrowserSidebar.tsx
|
|
24302
|
-
import { memo as
|
|
24499
|
+
import { memo as memo42, useCallback as useCallback32 } from "react";
|
|
24303
24500
|
import {
|
|
24304
24501
|
ChevronRight as ChevronRight17,
|
|
24305
24502
|
ChevronDown as ChevronDown11,
|
|
@@ -24309,7 +24506,7 @@ import {
|
|
|
24309
24506
|
FolderTree as FolderTree3,
|
|
24310
24507
|
RefreshCw as RefreshCw10
|
|
24311
24508
|
} from "lucide-react";
|
|
24312
|
-
import { jsx as
|
|
24509
|
+
import { jsx as jsx99, jsxs as jsxs88, Fragment as Fragment38 } from "react/jsx-runtime";
|
|
24313
24510
|
var PANEL_KEY4 = "file-browser";
|
|
24314
24511
|
var DEFAULT_WIDTH4 = 320;
|
|
24315
24512
|
var MIN_WIDTH4 = 280;
|
|
@@ -24321,14 +24518,14 @@ function TreeDirectory({ dirPath }) {
|
|
|
24321
24518
|
if (!isExpanded)
|
|
24322
24519
|
return null;
|
|
24323
24520
|
if (isLoading) {
|
|
24324
|
-
return /* @__PURE__ */
|
|
24521
|
+
return /* @__PURE__ */ jsx99("div", {
|
|
24325
24522
|
className: "pl-4 py-1 text-xs text-muted-foreground",
|
|
24326
24523
|
children: "Loading..."
|
|
24327
24524
|
});
|
|
24328
24525
|
}
|
|
24329
|
-
return /* @__PURE__ */
|
|
24526
|
+
return /* @__PURE__ */ jsx99("div", {
|
|
24330
24527
|
className: "pl-3",
|
|
24331
|
-
children: data?.items.map((item) => /* @__PURE__ */
|
|
24528
|
+
children: data?.items.map((item) => /* @__PURE__ */ jsx99(TreeItem, {
|
|
24332
24529
|
name: item.name,
|
|
24333
24530
|
path: item.path,
|
|
24334
24531
|
type: item.type,
|
|
@@ -24364,40 +24561,40 @@ function TreeItem({
|
|
|
24364
24561
|
children: [
|
|
24365
24562
|
type === "directory" ? /* @__PURE__ */ jsxs88(Fragment38, {
|
|
24366
24563
|
children: [
|
|
24367
|
-
isExpanded ? /* @__PURE__ */
|
|
24564
|
+
isExpanded ? /* @__PURE__ */ jsx99(ChevronDown11, {
|
|
24368
24565
|
className: "w-3 h-3 text-muted-foreground flex-shrink-0"
|
|
24369
|
-
}) : /* @__PURE__ */
|
|
24566
|
+
}) : /* @__PURE__ */ jsx99(ChevronRight17, {
|
|
24370
24567
|
className: "w-3 h-3 text-muted-foreground flex-shrink-0"
|
|
24371
24568
|
}),
|
|
24372
|
-
isExpanded ? /* @__PURE__ */
|
|
24569
|
+
isExpanded ? /* @__PURE__ */ jsx99(FolderOpen2, {
|
|
24373
24570
|
className: "w-3.5 h-3.5 text-blue-500 flex-shrink-0"
|
|
24374
|
-
}) : /* @__PURE__ */
|
|
24571
|
+
}) : /* @__PURE__ */ jsx99(Folder2, {
|
|
24375
24572
|
className: "w-3.5 h-3.5 text-blue-500 flex-shrink-0"
|
|
24376
24573
|
})
|
|
24377
24574
|
]
|
|
24378
24575
|
}) : /* @__PURE__ */ jsxs88(Fragment38, {
|
|
24379
24576
|
children: [
|
|
24380
|
-
/* @__PURE__ */
|
|
24577
|
+
/* @__PURE__ */ jsx99("span", {
|
|
24381
24578
|
className: "w-3 flex-shrink-0"
|
|
24382
24579
|
}),
|
|
24383
|
-
/* @__PURE__ */
|
|
24580
|
+
/* @__PURE__ */ jsx99(FileCode3, {
|
|
24384
24581
|
className: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0"
|
|
24385
24582
|
})
|
|
24386
24583
|
]
|
|
24387
24584
|
}),
|
|
24388
|
-
/* @__PURE__ */
|
|
24585
|
+
/* @__PURE__ */ jsx99("span", {
|
|
24389
24586
|
className: "truncate",
|
|
24390
24587
|
children: name
|
|
24391
24588
|
})
|
|
24392
24589
|
]
|
|
24393
24590
|
}),
|
|
24394
|
-
type === "directory" && /* @__PURE__ */
|
|
24591
|
+
type === "directory" && /* @__PURE__ */ jsx99(TreeDirectory, {
|
|
24395
24592
|
dirPath: path
|
|
24396
24593
|
})
|
|
24397
24594
|
]
|
|
24398
24595
|
});
|
|
24399
24596
|
}
|
|
24400
|
-
var FileBrowserSidebar =
|
|
24597
|
+
var FileBrowserSidebar = memo42(function FileBrowserSidebar2() {
|
|
24401
24598
|
const isExpanded = useFileBrowserStore((s) => s.isExpanded);
|
|
24402
24599
|
const collapseSidebar = useFileBrowserStore((s) => s.collapseSidebar);
|
|
24403
24600
|
const panelWidth = usePanelWidthStore((s) => s.widths[PANEL_KEY4] ?? DEFAULT_WIDTH4);
|
|
@@ -24408,7 +24605,7 @@ var FileBrowserSidebar = memo41(function FileBrowserSidebar2() {
|
|
|
24408
24605
|
className: "border-l border-sidebar-border sidebar-fade-in flex h-full relative",
|
|
24409
24606
|
style: { width: panelWidth },
|
|
24410
24607
|
children: [
|
|
24411
|
-
/* @__PURE__ */
|
|
24608
|
+
/* @__PURE__ */ jsx99(ResizeHandle, {
|
|
24412
24609
|
panelKey: PANEL_KEY4,
|
|
24413
24610
|
side: "right",
|
|
24414
24611
|
minWidth: MIN_WIDTH4,
|
|
@@ -24424,34 +24621,34 @@ var FileBrowserSidebar = memo41(function FileBrowserSidebar2() {
|
|
|
24424
24621
|
/* @__PURE__ */ jsxs88("div", {
|
|
24425
24622
|
className: "flex items-center gap-2",
|
|
24426
24623
|
children: [
|
|
24427
|
-
/* @__PURE__ */
|
|
24624
|
+
/* @__PURE__ */ jsx99(FolderTree3, {
|
|
24428
24625
|
className: "w-4 h-4 text-muted-foreground"
|
|
24429
24626
|
}),
|
|
24430
|
-
/* @__PURE__ */
|
|
24627
|
+
/* @__PURE__ */ jsx99("span", {
|
|
24431
24628
|
className: "font-medium",
|
|
24432
24629
|
children: "Files"
|
|
24433
24630
|
})
|
|
24434
24631
|
]
|
|
24435
24632
|
}),
|
|
24436
|
-
/* @__PURE__ */
|
|
24633
|
+
/* @__PURE__ */ jsx99(Button, {
|
|
24437
24634
|
variant: "ghost",
|
|
24438
24635
|
size: "icon",
|
|
24439
24636
|
onClick: collapseSidebar,
|
|
24440
|
-
children: /* @__PURE__ */
|
|
24637
|
+
children: /* @__PURE__ */ jsx99(ChevronRight17, {
|
|
24441
24638
|
className: "w-4 h-4"
|
|
24442
24639
|
})
|
|
24443
24640
|
})
|
|
24444
24641
|
]
|
|
24445
24642
|
}),
|
|
24446
|
-
/* @__PURE__ */
|
|
24643
|
+
/* @__PURE__ */ jsx99("div", {
|
|
24447
24644
|
className: "flex-1 overflow-y-auto p-1",
|
|
24448
|
-
children: isLoading ? /* @__PURE__ */
|
|
24645
|
+
children: isLoading ? /* @__PURE__ */ jsx99("div", {
|
|
24449
24646
|
className: "p-4 text-sm text-muted-foreground",
|
|
24450
24647
|
children: "Loading file tree..."
|
|
24451
|
-
}) : !rootData || rootData.items.length === 0 ? /* @__PURE__ */
|
|
24648
|
+
}) : !rootData || rootData.items.length === 0 ? /* @__PURE__ */ jsx99("div", {
|
|
24452
24649
|
className: "p-4 text-sm text-muted-foreground",
|
|
24453
24650
|
children: "No files found"
|
|
24454
|
-
}) : rootData.items.map((item) => /* @__PURE__ */
|
|
24651
|
+
}) : rootData.items.map((item) => /* @__PURE__ */ jsx99(TreeItem, {
|
|
24455
24652
|
name: item.name,
|
|
24456
24653
|
path: item.path,
|
|
24457
24654
|
type: item.type,
|
|
@@ -24464,23 +24661,23 @@ var FileBrowserSidebar = memo41(function FileBrowserSidebar2() {
|
|
|
24464
24661
|
/* @__PURE__ */ jsxs88("div", {
|
|
24465
24662
|
className: "flex items-center gap-2 min-w-0 flex-1",
|
|
24466
24663
|
children: [
|
|
24467
|
-
/* @__PURE__ */
|
|
24664
|
+
/* @__PURE__ */ jsx99(FolderTree3, {
|
|
24468
24665
|
className: "w-3 h-3 flex-shrink-0"
|
|
24469
24666
|
}),
|
|
24470
|
-
/* @__PURE__ */
|
|
24667
|
+
/* @__PURE__ */ jsx99("span", {
|
|
24471
24668
|
className: "truncate",
|
|
24472
24669
|
children: "Project Files"
|
|
24473
24670
|
})
|
|
24474
24671
|
]
|
|
24475
24672
|
}),
|
|
24476
|
-
/* @__PURE__ */
|
|
24673
|
+
/* @__PURE__ */ jsx99(Button, {
|
|
24477
24674
|
variant: "ghost",
|
|
24478
24675
|
size: "icon",
|
|
24479
24676
|
onClick: () => refetch(),
|
|
24480
24677
|
title: "Refresh file tree",
|
|
24481
24678
|
className: "h-6 w-6 flex-shrink-0",
|
|
24482
24679
|
disabled: isLoading,
|
|
24483
|
-
children: /* @__PURE__ */
|
|
24680
|
+
children: /* @__PURE__ */ jsx99(RefreshCw10, {
|
|
24484
24681
|
className: `w-3 h-3 ${isLoading ? "animate-spin" : ""}`
|
|
24485
24682
|
})
|
|
24486
24683
|
})
|
|
@@ -24492,31 +24689,31 @@ var FileBrowserSidebar = memo41(function FileBrowserSidebar2() {
|
|
|
24492
24689
|
});
|
|
24493
24690
|
});
|
|
24494
24691
|
// src/components/file-browser/FileBrowserSidebarToggle.tsx
|
|
24495
|
-
import { memo as
|
|
24692
|
+
import { memo as memo43 } from "react";
|
|
24496
24693
|
import { FolderTree as FolderTree4 } from "lucide-react";
|
|
24497
|
-
import { jsx as
|
|
24498
|
-
var FileBrowserSidebarToggle =
|
|
24694
|
+
import { jsx as jsx100 } from "react/jsx-runtime";
|
|
24695
|
+
var FileBrowserSidebarToggle = memo43(function FileBrowserSidebarToggle2() {
|
|
24499
24696
|
const isExpanded = useFileBrowserStore((s) => s.isExpanded);
|
|
24500
24697
|
const toggleSidebar = useFileBrowserStore((s) => s.toggleSidebar);
|
|
24501
|
-
return /* @__PURE__ */
|
|
24698
|
+
return /* @__PURE__ */ jsx100("button", {
|
|
24502
24699
|
type: "button",
|
|
24503
24700
|
onClick: toggleSidebar,
|
|
24504
24701
|
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
24702
|
title: "Files",
|
|
24506
|
-
children: /* @__PURE__ */
|
|
24703
|
+
children: /* @__PURE__ */ jsx100(FolderTree4, {
|
|
24507
24704
|
className: "w-5 h-5 text-muted-foreground mx-auto"
|
|
24508
24705
|
})
|
|
24509
24706
|
});
|
|
24510
24707
|
});
|
|
24511
24708
|
// src/components/file-browser/FileViewerPanel.tsx
|
|
24512
|
-
import { memo as
|
|
24709
|
+
import { memo as memo44, useEffect as useEffect44 } from "react";
|
|
24513
24710
|
import { X as X17 } from "lucide-react";
|
|
24514
24711
|
import { Prism as SyntaxHighlighter12 } from "react-syntax-highlighter";
|
|
24515
24712
|
import {
|
|
24516
24713
|
prism as prism12,
|
|
24517
24714
|
vscDarkPlus as vscDarkPlus12
|
|
24518
24715
|
} from "react-syntax-highlighter/dist/esm/styles/prism";
|
|
24519
|
-
import { jsx as
|
|
24716
|
+
import { jsx as jsx101, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
24520
24717
|
var LANGUAGE_MAP3 = {
|
|
24521
24718
|
js: "javascript",
|
|
24522
24719
|
jsx: "jsx",
|
|
@@ -24554,7 +24751,7 @@ function inferLanguage2(path) {
|
|
|
24554
24751
|
const ext = path.split(".").pop()?.toLowerCase() ?? "";
|
|
24555
24752
|
return LANGUAGE_MAP3[ext] ?? "plaintext";
|
|
24556
24753
|
}
|
|
24557
|
-
var FileViewerPanel =
|
|
24754
|
+
var FileViewerPanel = memo44(function FileViewerPanel2() {
|
|
24558
24755
|
const isViewerOpen = useFileBrowserStore((s) => s.isViewerOpen);
|
|
24559
24756
|
const selectedFile = useFileBrowserStore((s) => s.selectedFile);
|
|
24560
24757
|
const closeViewer = useFileBrowserStore((s) => s.closeViewer);
|
|
@@ -24580,19 +24777,19 @@ var FileViewerPanel = memo43(function FileViewerPanel2() {
|
|
|
24580
24777
|
/* @__PURE__ */ jsxs89("div", {
|
|
24581
24778
|
className: "h-14 border-b border-border px-4 flex items-center gap-3",
|
|
24582
24779
|
children: [
|
|
24583
|
-
/* @__PURE__ */
|
|
24780
|
+
/* @__PURE__ */ jsx101(Button, {
|
|
24584
24781
|
variant: "ghost",
|
|
24585
24782
|
size: "icon",
|
|
24586
24783
|
onClick: closeViewer,
|
|
24587
24784
|
title: "Close file viewer (ESC)",
|
|
24588
|
-
children: /* @__PURE__ */
|
|
24785
|
+
children: /* @__PURE__ */ jsx101(X17, {
|
|
24589
24786
|
className: "w-4 h-4"
|
|
24590
24787
|
})
|
|
24591
24788
|
}),
|
|
24592
24789
|
/* @__PURE__ */ jsxs89("div", {
|
|
24593
24790
|
className: "flex-1 flex items-center gap-2 min-w-0",
|
|
24594
24791
|
children: [
|
|
24595
|
-
/* @__PURE__ */
|
|
24792
|
+
/* @__PURE__ */ jsx101("span", {
|
|
24596
24793
|
className: "text-sm font-medium text-foreground font-mono truncate",
|
|
24597
24794
|
title: selectedFile,
|
|
24598
24795
|
children: selectedFile
|
|
@@ -24606,20 +24803,20 @@ var FileViewerPanel = memo43(function FileViewerPanel2() {
|
|
|
24606
24803
|
})
|
|
24607
24804
|
]
|
|
24608
24805
|
}),
|
|
24609
|
-
/* @__PURE__ */
|
|
24806
|
+
/* @__PURE__ */ jsx101("span", {
|
|
24610
24807
|
className: "text-xs text-muted-foreground",
|
|
24611
24808
|
children: language
|
|
24612
24809
|
})
|
|
24613
24810
|
]
|
|
24614
24811
|
}),
|
|
24615
|
-
/* @__PURE__ */
|
|
24812
|
+
/* @__PURE__ */ jsx101("div", {
|
|
24616
24813
|
className: "flex-1 overflow-auto",
|
|
24617
|
-
children: isLoading ? /* @__PURE__ */
|
|
24814
|
+
children: isLoading ? /* @__PURE__ */ jsx101("div", {
|
|
24618
24815
|
className: "h-full flex items-center justify-center text-muted-foreground",
|
|
24619
24816
|
children: "Loading file..."
|
|
24620
|
-
}) : data ? /* @__PURE__ */
|
|
24817
|
+
}) : data ? /* @__PURE__ */ jsx101("div", {
|
|
24621
24818
|
className: "code-with-line-numbers",
|
|
24622
|
-
children: /* @__PURE__ */
|
|
24819
|
+
children: /* @__PURE__ */ jsx101(SyntaxHighlighter12, {
|
|
24623
24820
|
language,
|
|
24624
24821
|
style: syntaxTheme,
|
|
24625
24822
|
wrapLines: true,
|
|
@@ -24641,7 +24838,7 @@ var FileViewerPanel = memo43(function FileViewerPanel2() {
|
|
|
24641
24838
|
},
|
|
24642
24839
|
children: data.content
|
|
24643
24840
|
})
|
|
24644
|
-
}) : /* @__PURE__ */
|
|
24841
|
+
}) : /* @__PURE__ */ jsx101("div", {
|
|
24645
24842
|
className: "h-full flex items-center justify-center text-muted-foreground",
|
|
24646
24843
|
children: "Unable to load file"
|
|
24647
24844
|
})
|
|
@@ -24650,7 +24847,7 @@ var FileViewerPanel = memo43(function FileViewerPanel2() {
|
|
|
24650
24847
|
});
|
|
24651
24848
|
});
|
|
24652
24849
|
// src/components/file-browser/QuickFilePicker.tsx
|
|
24653
|
-
import { memo as
|
|
24850
|
+
import { memo as memo45, useState as useState43, useEffect as useEffect45, useRef as useRef30, useCallback as useCallback33, useMemo as useMemo25 } from "react";
|
|
24654
24851
|
import { FileCode as FileCode4, Search as Search7 } from "lucide-react";
|
|
24655
24852
|
|
|
24656
24853
|
// src/stores/filePickerStore.ts
|
|
@@ -24663,7 +24860,7 @@ var useFilePickerStore = create22((set) => ({
|
|
|
24663
24860
|
}));
|
|
24664
24861
|
|
|
24665
24862
|
// src/components/file-browser/QuickFilePicker.tsx
|
|
24666
|
-
import { jsx as
|
|
24863
|
+
import { jsx as jsx102, jsxs as jsxs90 } from "react/jsx-runtime";
|
|
24667
24864
|
function fuzzyMatch(query, target) {
|
|
24668
24865
|
const q = query.toLowerCase();
|
|
24669
24866
|
const t = target.toLowerCase();
|
|
@@ -24687,7 +24884,7 @@ function fuzzyMatch(query, target) {
|
|
|
24687
24884
|
}
|
|
24688
24885
|
return { match: qi === q.length, score };
|
|
24689
24886
|
}
|
|
24690
|
-
var QuickFilePicker =
|
|
24887
|
+
var QuickFilePicker = memo45(function QuickFilePicker2() {
|
|
24691
24888
|
const isOpen = useFilePickerStore((s) => s.isOpen);
|
|
24692
24889
|
const close = useFilePickerStore((s) => s.close);
|
|
24693
24890
|
const openFile = useFileBrowserStore((s) => s.openFile);
|
|
@@ -24743,7 +24940,7 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24743
24940
|
}, [close]);
|
|
24744
24941
|
if (!isOpen)
|
|
24745
24942
|
return null;
|
|
24746
|
-
return /* @__PURE__ */
|
|
24943
|
+
return /* @__PURE__ */ jsx102("div", {
|
|
24747
24944
|
role: "dialog",
|
|
24748
24945
|
"aria-modal": "true",
|
|
24749
24946
|
className: "fixed inset-0 bg-black/50 flex items-start justify-center z-[60] pt-[15vh]",
|
|
@@ -24758,10 +24955,10 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24758
24955
|
/* @__PURE__ */ jsxs90("div", {
|
|
24759
24956
|
className: "flex items-center gap-2 px-3 border-b border-border",
|
|
24760
24957
|
children: [
|
|
24761
|
-
/* @__PURE__ */
|
|
24958
|
+
/* @__PURE__ */ jsx102(Search7, {
|
|
24762
24959
|
className: "w-4 h-4 text-muted-foreground flex-shrink-0"
|
|
24763
24960
|
}),
|
|
24764
|
-
/* @__PURE__ */
|
|
24961
|
+
/* @__PURE__ */ jsx102("input", {
|
|
24765
24962
|
ref: inputRef,
|
|
24766
24963
|
type: "text",
|
|
24767
24964
|
value: query,
|
|
@@ -24773,16 +24970,16 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24773
24970
|
placeholder: "Search files by name...",
|
|
24774
24971
|
className: "flex-1 bg-transparent py-3 text-sm text-foreground placeholder-muted-foreground outline-none"
|
|
24775
24972
|
}),
|
|
24776
|
-
/* @__PURE__ */
|
|
24973
|
+
/* @__PURE__ */ jsx102("kbd", {
|
|
24777
24974
|
className: "text-[10px] text-muted-foreground bg-muted px-1.5 py-0.5 rounded border border-border font-mono",
|
|
24778
24975
|
children: "ESC"
|
|
24779
24976
|
})
|
|
24780
24977
|
]
|
|
24781
24978
|
}),
|
|
24782
|
-
/* @__PURE__ */
|
|
24979
|
+
/* @__PURE__ */ jsx102("div", {
|
|
24783
24980
|
ref: listRef,
|
|
24784
24981
|
className: "max-h-[40vh] overflow-y-auto",
|
|
24785
|
-
children: filtered.length === 0 ? /* @__PURE__ */
|
|
24982
|
+
children: filtered.length === 0 ? /* @__PURE__ */ jsx102("div", {
|
|
24786
24983
|
className: "px-4 py-8 text-center text-sm text-muted-foreground",
|
|
24787
24984
|
children: query ? "No matching files" : "No files found"
|
|
24788
24985
|
}) : filtered.map((file, idx) => {
|
|
@@ -24792,14 +24989,14 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24792
24989
|
onClick: () => handleSelect(file),
|
|
24793
24990
|
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
24991
|
children: [
|
|
24795
|
-
/* @__PURE__ */
|
|
24992
|
+
/* @__PURE__ */ jsx102(FileCode4, {
|
|
24796
24993
|
className: "w-3.5 h-3.5 text-muted-foreground flex-shrink-0"
|
|
24797
24994
|
}),
|
|
24798
|
-
/* @__PURE__ */
|
|
24995
|
+
/* @__PURE__ */ jsx102(HighlightedPath, {
|
|
24799
24996
|
path: file,
|
|
24800
24997
|
query
|
|
24801
24998
|
}),
|
|
24802
|
-
isIgnored && /* @__PURE__ */
|
|
24999
|
+
isIgnored && /* @__PURE__ */ jsx102("span", {
|
|
24803
25000
|
className: "ml-auto text-[10px] text-muted-foreground italic",
|
|
24804
25001
|
children: "ignored"
|
|
24805
25002
|
})
|
|
@@ -24812,7 +25009,7 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24812
25009
|
children: [
|
|
24813
25010
|
/* @__PURE__ */ jsxs90("span", {
|
|
24814
25011
|
children: [
|
|
24815
|
-
/* @__PURE__ */
|
|
25012
|
+
/* @__PURE__ */ jsx102("kbd", {
|
|
24816
25013
|
className: "bg-muted px-1 py-0.5 rounded border border-border font-mono",
|
|
24817
25014
|
children: "↑↓"
|
|
24818
25015
|
}),
|
|
@@ -24822,7 +25019,7 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24822
25019
|
}),
|
|
24823
25020
|
/* @__PURE__ */ jsxs90("span", {
|
|
24824
25021
|
children: [
|
|
24825
|
-
/* @__PURE__ */
|
|
25022
|
+
/* @__PURE__ */ jsx102("kbd", {
|
|
24826
25023
|
className: "bg-muted px-1 py-0.5 rounded border border-border font-mono",
|
|
24827
25024
|
children: "↵"
|
|
24828
25025
|
}),
|
|
@@ -24845,7 +25042,7 @@ var QuickFilePicker = memo44(function QuickFilePicker2() {
|
|
|
24845
25042
|
});
|
|
24846
25043
|
function HighlightedPath({ path, query }) {
|
|
24847
25044
|
if (!query) {
|
|
24848
|
-
return /* @__PURE__ */
|
|
25045
|
+
return /* @__PURE__ */ jsx102("span", {
|
|
24849
25046
|
className: "truncate font-mono text-xs",
|
|
24850
25047
|
children: path
|
|
24851
25048
|
});
|
|
@@ -24858,7 +25055,7 @@ function HighlightedPath({ path, query }) {
|
|
|
24858
25055
|
className: "truncate font-mono text-xs",
|
|
24859
25056
|
children: [
|
|
24860
25057
|
path.slice(0, idx),
|
|
24861
|
-
/* @__PURE__ */
|
|
25058
|
+
/* @__PURE__ */ jsx102("span", {
|
|
24862
25059
|
className: "text-primary font-semibold",
|
|
24863
25060
|
children: path.slice(idx, idx + query.length)
|
|
24864
25061
|
}),
|
|
@@ -24866,21 +25063,21 @@ function HighlightedPath({ path, query }) {
|
|
|
24866
25063
|
]
|
|
24867
25064
|
});
|
|
24868
25065
|
}
|
|
24869
|
-
return /* @__PURE__ */
|
|
25066
|
+
return /* @__PURE__ */ jsx102("span", {
|
|
24870
25067
|
className: "truncate font-mono text-xs",
|
|
24871
25068
|
children: path
|
|
24872
25069
|
});
|
|
24873
25070
|
}
|
|
24874
25071
|
// src/components/onboarding/OnboardingModal.tsx
|
|
24875
|
-
import { memo as
|
|
25072
|
+
import { memo as memo48 } from "react";
|
|
24876
25073
|
|
|
24877
25074
|
// src/components/onboarding/steps/ProviderSetupStep.tsx
|
|
24878
|
-
import { memo as
|
|
25075
|
+
import { memo as memo46, useEffect as useEffect46, useState as useState44, useRef as useRef31 } from "react";
|
|
24879
25076
|
import {
|
|
24880
25077
|
Copy as Copy5,
|
|
24881
25078
|
Check as Check13,
|
|
24882
25079
|
CreditCard as CreditCard5,
|
|
24883
|
-
Loader2 as
|
|
25080
|
+
Loader2 as Loader216,
|
|
24884
25081
|
X as X18,
|
|
24885
25082
|
Key as Key2,
|
|
24886
25083
|
ExternalLink as ExternalLink10,
|
|
@@ -24888,8 +25085,8 @@ import {
|
|
|
24888
25085
|
RefreshCw as RefreshCw11
|
|
24889
25086
|
} from "lucide-react";
|
|
24890
25087
|
import { QRCodeSVG as QRCodeSVG3 } from "qrcode.react";
|
|
24891
|
-
import { jsx as
|
|
24892
|
-
var ProviderSetupStep =
|
|
25088
|
+
import { jsx as jsx103, jsxs as jsxs91, Fragment as Fragment39 } from "react/jsx-runtime";
|
|
25089
|
+
var ProviderSetupStep = memo46(function ProviderSetupStep2({
|
|
24893
25090
|
authStatus,
|
|
24894
25091
|
onSetupWallet,
|
|
24895
25092
|
onImportWallet,
|
|
@@ -25228,11 +25425,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25228
25425
|
/* @__PURE__ */ jsxs91("div", {
|
|
25229
25426
|
className: "flex items-center gap-3",
|
|
25230
25427
|
children: [
|
|
25231
|
-
/* @__PURE__ */
|
|
25428
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25232
25429
|
provider: "ottorouter",
|
|
25233
25430
|
size: 24
|
|
25234
25431
|
}),
|
|
25235
|
-
/* @__PURE__ */
|
|
25432
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25236
25433
|
className: "font-semibold text-foreground",
|
|
25237
25434
|
children: "otto"
|
|
25238
25435
|
})
|
|
@@ -25241,7 +25438,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25241
25438
|
!manageMode && /* @__PURE__ */ jsxs91("div", {
|
|
25242
25439
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
25243
25440
|
children: [
|
|
25244
|
-
/* @__PURE__ */
|
|
25441
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25245
25442
|
className: "w-2 h-2 rounded-full bg-green-500"
|
|
25246
25443
|
}),
|
|
25247
25444
|
"Step 1 of 2"
|
|
@@ -25249,7 +25446,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25249
25446
|
})
|
|
25250
25447
|
]
|
|
25251
25448
|
}),
|
|
25252
|
-
/* @__PURE__ */
|
|
25449
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25253
25450
|
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
25451
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25255
25452
|
className: "max-w-7xl mx-auto",
|
|
@@ -25257,11 +25454,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25257
25454
|
/* @__PURE__ */ jsxs91("div", {
|
|
25258
25455
|
className: "mb-10",
|
|
25259
25456
|
children: [
|
|
25260
|
-
/* @__PURE__ */
|
|
25457
|
+
/* @__PURE__ */ jsx103("h1", {
|
|
25261
25458
|
className: "text-2xl sm:text-3xl lg:text-4xl font-semibold text-foreground mb-3",
|
|
25262
25459
|
children: manageMode ? "Manage Providers" : "Welcome to otto"
|
|
25263
25460
|
}),
|
|
25264
|
-
/* @__PURE__ */
|
|
25461
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25265
25462
|
className: "text-lg text-muted-foreground max-w-2xl",
|
|
25266
25463
|
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
25464
|
})
|
|
@@ -25270,8 +25467,8 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25270
25467
|
/* @__PURE__ */ jsxs91("div", {
|
|
25271
25468
|
className: "grid grid-cols-1 sm:grid-cols-3 gap-6 sm:gap-8",
|
|
25272
25469
|
children: [
|
|
25273
|
-
/* @__PURE__ */
|
|
25274
|
-
children: /* @__PURE__ */
|
|
25470
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25471
|
+
children: /* @__PURE__ */ jsx103("div", {
|
|
25275
25472
|
className: "bg-card rounded-2xl border border-border p-5",
|
|
25276
25473
|
children: authStatus.ottorouter.configured && authStatus.ottorouter.publicKey ? /* @__PURE__ */ jsxs91("div", {
|
|
25277
25474
|
className: "flex flex-col h-full",
|
|
@@ -25279,25 +25476,25 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25279
25476
|
/* @__PURE__ */ jsxs91("div", {
|
|
25280
25477
|
className: "flex items-center gap-2 px-3 py-2 bg-green-500/10 border border-green-500/20 rounded-lg",
|
|
25281
25478
|
children: [
|
|
25282
|
-
/* @__PURE__ */
|
|
25479
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25283
25480
|
provider: "ottorouter",
|
|
25284
25481
|
size: 16
|
|
25285
25482
|
}),
|
|
25286
|
-
/* @__PURE__ */
|
|
25483
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25287
25484
|
className: "text-sm font-medium text-green-600 dark:text-green-400",
|
|
25288
25485
|
children: "Setu"
|
|
25289
25486
|
}),
|
|
25290
|
-
/* @__PURE__ */
|
|
25487
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25291
25488
|
className: "text-xs text-green-600/60 dark:text-green-500/60 ml-auto",
|
|
25292
25489
|
children: "Default Provider"
|
|
25293
25490
|
})
|
|
25294
25491
|
]
|
|
25295
25492
|
}),
|
|
25296
|
-
/* @__PURE__ */
|
|
25493
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25297
25494
|
className: "flex justify-center py-4 mt-4",
|
|
25298
|
-
children: /* @__PURE__ */
|
|
25495
|
+
children: /* @__PURE__ */ jsx103("div", {
|
|
25299
25496
|
className: "bg-white p-2 rounded-lg",
|
|
25300
|
-
children: /* @__PURE__ */
|
|
25497
|
+
children: /* @__PURE__ */ jsx103(QRCodeSVG3, {
|
|
25301
25498
|
value: authStatus.ottorouter.publicKey,
|
|
25302
25499
|
size: 140,
|
|
25303
25500
|
level: "M"
|
|
@@ -25313,9 +25510,9 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25313
25510
|
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
25511
|
children: [
|
|
25315
25512
|
truncateAddress(authStatus.ottorouter.publicKey),
|
|
25316
|
-
copied ? /* @__PURE__ */
|
|
25513
|
+
copied ? /* @__PURE__ */ jsx103(Check13, {
|
|
25317
25514
|
className: "w-3.5 h-3.5 text-green-500"
|
|
25318
|
-
}) : /* @__PURE__ */
|
|
25515
|
+
}) : /* @__PURE__ */ jsx103(Copy5, {
|
|
25319
25516
|
className: "w-3.5 h-3.5 text-muted-foreground"
|
|
25320
25517
|
})
|
|
25321
25518
|
]
|
|
@@ -25326,19 +25523,19 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25326
25523
|
/* @__PURE__ */ jsxs91("div", {
|
|
25327
25524
|
className: "flex items-center justify-between gap-2",
|
|
25328
25525
|
children: [
|
|
25329
|
-
/* @__PURE__ */
|
|
25526
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25330
25527
|
className: "flex items-center gap-1.5 min-w-0",
|
|
25331
|
-
children: /* @__PURE__ */
|
|
25528
|
+
children: /* @__PURE__ */ jsx103("span", {
|
|
25332
25529
|
className: "font-mono text-xs sm:text-sm text-foreground truncate",
|
|
25333
25530
|
children: setuStatusLabel
|
|
25334
25531
|
})
|
|
25335
25532
|
}),
|
|
25336
|
-
/* @__PURE__ */
|
|
25533
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25337
25534
|
type: "button",
|
|
25338
25535
|
onClick: fetchBalance,
|
|
25339
25536
|
disabled: isBalanceLoading,
|
|
25340
25537
|
className: "p-0.5 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50",
|
|
25341
|
-
children: /* @__PURE__ */
|
|
25538
|
+
children: /* @__PURE__ */ jsx103(RefreshCw11, {
|
|
25342
25539
|
className: `w-3 h-3 ${isBalanceLoading ? "animate-spin" : ""}`
|
|
25343
25540
|
})
|
|
25344
25541
|
})
|
|
@@ -25362,14 +25559,14 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25362
25559
|
/* @__PURE__ */ jsxs91("div", {
|
|
25363
25560
|
className: "flex items-center gap-4 py-4",
|
|
25364
25561
|
children: [
|
|
25365
|
-
/* @__PURE__ */
|
|
25562
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25366
25563
|
className: "flex-1 h-px bg-border"
|
|
25367
25564
|
}),
|
|
25368
|
-
/* @__PURE__ */
|
|
25565
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25369
25566
|
className: "text-xs text-muted-foreground font-medium",
|
|
25370
25567
|
children: "OR"
|
|
25371
25568
|
}),
|
|
25372
|
-
/* @__PURE__ */
|
|
25569
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25373
25570
|
className: "flex-1 h-px bg-border"
|
|
25374
25571
|
})
|
|
25375
25572
|
]
|
|
@@ -25379,7 +25576,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25379
25576
|
onClick: onOpenTopup,
|
|
25380
25577
|
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
25578
|
children: [
|
|
25382
|
-
/* @__PURE__ */
|
|
25579
|
+
/* @__PURE__ */ jsx103(CreditCard5, {
|
|
25383
25580
|
className: "w-4 h-4"
|
|
25384
25581
|
}),
|
|
25385
25582
|
"Top Up with Card"
|
|
@@ -25390,16 +25587,16 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25390
25587
|
onClick: handleOpenImportWallet,
|
|
25391
25588
|
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
25589
|
children: [
|
|
25393
|
-
/* @__PURE__ */
|
|
25590
|
+
/* @__PURE__ */ jsx103(Key2, {
|
|
25394
25591
|
className: "w-4 h-4"
|
|
25395
25592
|
}),
|
|
25396
25593
|
"Import Wallet"
|
|
25397
25594
|
]
|
|
25398
25595
|
})
|
|
25399
25596
|
]
|
|
25400
|
-
}) : /* @__PURE__ */
|
|
25597
|
+
}) : /* @__PURE__ */ jsx103("div", {
|
|
25401
25598
|
className: "flex items-center justify-center py-16",
|
|
25402
|
-
children: /* @__PURE__ */
|
|
25599
|
+
children: /* @__PURE__ */ jsx103(Loader216, {
|
|
25403
25600
|
className: "w-8 h-8 animate-spin text-muted-foreground"
|
|
25404
25601
|
})
|
|
25405
25602
|
})
|
|
@@ -25413,7 +25610,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25413
25610
|
/* @__PURE__ */ jsxs91("div", {
|
|
25414
25611
|
className: "flex items-center justify-between mb-4",
|
|
25415
25612
|
children: [
|
|
25416
|
-
/* @__PURE__ */
|
|
25613
|
+
/* @__PURE__ */ jsx103("h2", {
|
|
25417
25614
|
className: "font-semibold text-foreground",
|
|
25418
25615
|
children: "Connected Providers"
|
|
25419
25616
|
}),
|
|
@@ -25426,54 +25623,54 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25426
25623
|
})
|
|
25427
25624
|
]
|
|
25428
25625
|
}),
|
|
25429
|
-
configuredProviders.length === 0 ? /* @__PURE__ */
|
|
25626
|
+
configuredProviders.length === 0 ? /* @__PURE__ */ jsx103("div", {
|
|
25430
25627
|
className: "text-sm text-muted-foreground py-4",
|
|
25431
25628
|
children: "No providers connected yet. Add one below."
|
|
25432
|
-
}) : /* @__PURE__ */
|
|
25629
|
+
}) : /* @__PURE__ */ jsx103("div", {
|
|
25433
25630
|
className: "flex flex-wrap gap-2",
|
|
25434
25631
|
children: configuredProviders.map(([id, info]) => /* @__PURE__ */ jsxs91("div", {
|
|
25435
25632
|
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
25633
|
children: [
|
|
25437
|
-
/* @__PURE__ */
|
|
25634
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25438
25635
|
provider: id,
|
|
25439
25636
|
size: 16
|
|
25440
25637
|
}),
|
|
25441
|
-
/* @__PURE__ */
|
|
25638
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25442
25639
|
className: `text-sm font-medium transition-colors ${confirmingDelete === id ? "text-destructive" : "text-green-600 dark:text-green-400"}`,
|
|
25443
25640
|
children: info.label
|
|
25444
25641
|
}),
|
|
25445
|
-
confirmingDelete !== id && /* @__PURE__ */
|
|
25642
|
+
confirmingDelete !== id && /* @__PURE__ */ jsx103("span", {
|
|
25446
25643
|
className: "text-xs text-green-600/60 dark:text-green-500/60",
|
|
25447
25644
|
children: info.type === "oauth" ? "OAuth" : "API"
|
|
25448
25645
|
}),
|
|
25449
25646
|
confirmingDelete === id ? /* @__PURE__ */ jsxs91("div", {
|
|
25450
25647
|
className: "flex items-center gap-1 ml-1",
|
|
25451
25648
|
children: [
|
|
25452
|
-
/* @__PURE__ */
|
|
25649
|
+
/* @__PURE__ */ jsx103("span", {
|
|
25453
25650
|
className: "text-xs text-destructive/80 mr-1",
|
|
25454
25651
|
children: "Remove?"
|
|
25455
25652
|
}),
|
|
25456
|
-
/* @__PURE__ */
|
|
25653
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25457
25654
|
type: "button",
|
|
25458
25655
|
onClick: () => handleRemoveProvider(id),
|
|
25459
25656
|
disabled: removingProvider === id,
|
|
25460
25657
|
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__ */
|
|
25658
|
+
children: removingProvider === id ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25462
25659
|
className: "w-3 h-3 animate-spin"
|
|
25463
25660
|
}) : "Yes"
|
|
25464
25661
|
}),
|
|
25465
|
-
/* @__PURE__ */
|
|
25662
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25466
25663
|
type: "button",
|
|
25467
25664
|
onClick: handleCancelDelete,
|
|
25468
25665
|
className: "px-2 py-0.5 text-xs bg-muted text-muted-foreground rounded hover:bg-muted/80 transition-colors",
|
|
25469
25666
|
children: "No"
|
|
25470
25667
|
})
|
|
25471
25668
|
]
|
|
25472
|
-
}) : id !== "ottorouter" && /* @__PURE__ */
|
|
25669
|
+
}) : id !== "ottorouter" && /* @__PURE__ */ jsx103("button", {
|
|
25473
25670
|
type: "button",
|
|
25474
25671
|
onClick: () => handleRemoveProvider(id),
|
|
25475
25672
|
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__ */
|
|
25673
|
+
children: /* @__PURE__ */ jsx103(X18, {
|
|
25477
25674
|
className: "w-3 h-3"
|
|
25478
25675
|
})
|
|
25479
25676
|
})
|
|
@@ -25484,24 +25681,24 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25484
25681
|
}),
|
|
25485
25682
|
/* @__PURE__ */ jsxs91("div", {
|
|
25486
25683
|
children: [
|
|
25487
|
-
/* @__PURE__ */
|
|
25684
|
+
/* @__PURE__ */ jsx103("h2", {
|
|
25488
25685
|
className: "font-semibold text-foreground mb-4",
|
|
25489
25686
|
children: "Add Providers"
|
|
25490
25687
|
}),
|
|
25491
|
-
/* @__PURE__ */
|
|
25688
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25492
25689
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-3 items-start",
|
|
25493
|
-
children: unconfiguredProviders.map(([id, info]) => /* @__PURE__ */
|
|
25690
|
+
children: unconfiguredProviders.map(([id, info]) => /* @__PURE__ */ jsx103("div", {
|
|
25494
25691
|
children: addingProvider === id ? /* @__PURE__ */ jsxs91("div", {
|
|
25495
25692
|
className: "flex items-center gap-2 p-3 bg-card border border-ring rounded-xl overflow-hidden",
|
|
25496
25693
|
children: [
|
|
25497
|
-
/* @__PURE__ */
|
|
25694
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25498
25695
|
className: "shrink-0",
|
|
25499
|
-
children: /* @__PURE__ */
|
|
25696
|
+
children: /* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25500
25697
|
provider: id,
|
|
25501
25698
|
size: 18
|
|
25502
25699
|
})
|
|
25503
25700
|
}),
|
|
25504
|
-
/* @__PURE__ */
|
|
25701
|
+
/* @__PURE__ */ jsx103("input", {
|
|
25505
25702
|
ref: apiKeyInputRef,
|
|
25506
25703
|
type: "password",
|
|
25507
25704
|
value: apiKeyInput,
|
|
@@ -25517,21 +25714,21 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25517
25714
|
}
|
|
25518
25715
|
}
|
|
25519
25716
|
}),
|
|
25520
|
-
/* @__PURE__ */
|
|
25717
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25521
25718
|
type: "button",
|
|
25522
25719
|
onClick: () => handleAddProvider(id),
|
|
25523
25720
|
disabled: !apiKeyInput.trim(),
|
|
25524
25721
|
className: "shrink-0 px-3 py-1.5 bg-primary text-primary-foreground text-sm font-medium rounded-lg disabled:opacity-50",
|
|
25525
25722
|
children: "Add"
|
|
25526
25723
|
}),
|
|
25527
|
-
/* @__PURE__ */
|
|
25724
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25528
25725
|
type: "button",
|
|
25529
25726
|
onClick: () => {
|
|
25530
25727
|
setAddingProvider(null);
|
|
25531
25728
|
setApiKeyInput("");
|
|
25532
25729
|
},
|
|
25533
25730
|
className: "shrink-0 p-1.5 text-muted-foreground hover:text-foreground",
|
|
25534
|
-
children: /* @__PURE__ */
|
|
25731
|
+
children: /* @__PURE__ */ jsx103(X18, {
|
|
25535
25732
|
className: "w-4 h-4"
|
|
25536
25733
|
})
|
|
25537
25734
|
})
|
|
@@ -25542,14 +25739,14 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25542
25739
|
/* @__PURE__ */ jsxs91("div", {
|
|
25543
25740
|
className: "flex items-center gap-3 min-w-0",
|
|
25544
25741
|
children: [
|
|
25545
|
-
/* @__PURE__ */
|
|
25742
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25546
25743
|
provider: id,
|
|
25547
25744
|
size: 20
|
|
25548
25745
|
}),
|
|
25549
25746
|
/* @__PURE__ */ jsxs91("div", {
|
|
25550
25747
|
className: "min-w-0",
|
|
25551
25748
|
children: [
|
|
25552
|
-
/* @__PURE__ */
|
|
25749
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25553
25750
|
className: "font-medium text-foreground truncate",
|
|
25554
25751
|
children: info.label
|
|
25555
25752
|
}),
|
|
@@ -25572,7 +25769,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25572
25769
|
onClick: () => setAddingProvider(id),
|
|
25573
25770
|
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
25771
|
children: [
|
|
25575
|
-
/* @__PURE__ */
|
|
25772
|
+
/* @__PURE__ */ jsx103(Key2, {
|
|
25576
25773
|
className: "w-3.5 h-3.5"
|
|
25577
25774
|
}),
|
|
25578
25775
|
"API"
|
|
@@ -25583,7 +25780,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25583
25780
|
onClick: () => handleStartOAuth(id, id === "anthropic" ? "max" : undefined),
|
|
25584
25781
|
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
25782
|
children: [
|
|
25586
|
-
/* @__PURE__ */
|
|
25783
|
+
/* @__PURE__ */ jsx103(ExternalLink10, {
|
|
25587
25784
|
className: "w-3.5 h-3.5"
|
|
25588
25785
|
}),
|
|
25589
25786
|
id === "anthropic" ? "Pro" : id === "copilot" ? "Login" : "OAuth"
|
|
@@ -25604,16 +25801,16 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25604
25801
|
]
|
|
25605
25802
|
})
|
|
25606
25803
|
}),
|
|
25607
|
-
/* @__PURE__ */
|
|
25804
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25608
25805
|
className: "fixed bottom-0 left-0 right-0 px-4 sm:px-6 py-4 border-t border-border bg-background",
|
|
25609
25806
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25610
25807
|
className: "max-w-7xl mx-auto flex items-center justify-between",
|
|
25611
25808
|
children: [
|
|
25612
|
-
!manageMode && /* @__PURE__ */
|
|
25809
|
+
!manageMode && /* @__PURE__ */ jsx103("div", {
|
|
25613
25810
|
className: "text-xs sm:text-sm text-muted-foreground hidden sm:block",
|
|
25614
25811
|
children: "You can add more providers later in settings"
|
|
25615
25812
|
}),
|
|
25616
|
-
manageMode ? /* @__PURE__ */
|
|
25813
|
+
manageMode ? /* @__PURE__ */ jsx103("button", {
|
|
25617
25814
|
type: "button",
|
|
25618
25815
|
onClick: onClose,
|
|
25619
25816
|
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 +25821,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25624
25821
|
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
25822
|
children: [
|
|
25626
25823
|
"Continue",
|
|
25627
|
-
/* @__PURE__ */
|
|
25824
|
+
/* @__PURE__ */ jsx103(ArrowRight2, {
|
|
25628
25825
|
className: "w-4 h-4"
|
|
25629
25826
|
})
|
|
25630
25827
|
]
|
|
@@ -25632,7 +25829,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25632
25829
|
]
|
|
25633
25830
|
})
|
|
25634
25831
|
}),
|
|
25635
|
-
isImportModalOpen && /* @__PURE__ */
|
|
25832
|
+
isImportModalOpen && /* @__PURE__ */ jsx103("div", {
|
|
25636
25833
|
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
25637
25834
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25638
25835
|
className: "bg-background border border-border rounded-xl w-full max-w-lg mx-6 shadow-2xl",
|
|
@@ -25640,11 +25837,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25640
25837
|
/* @__PURE__ */ jsxs91("div", {
|
|
25641
25838
|
className: "flex items-center gap-3 p-6 border-b border-border",
|
|
25642
25839
|
children: [
|
|
25643
|
-
/* @__PURE__ */
|
|
25840
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25644
25841
|
provider: "ottorouter",
|
|
25645
25842
|
size: 24
|
|
25646
25843
|
}),
|
|
25647
|
-
/* @__PURE__ */
|
|
25844
|
+
/* @__PURE__ */ jsx103("h3", {
|
|
25648
25845
|
className: "text-lg font-semibold",
|
|
25649
25846
|
children: "Import Setu Wallet"
|
|
25650
25847
|
})
|
|
@@ -25653,11 +25850,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25653
25850
|
/* @__PURE__ */ jsxs91("div", {
|
|
25654
25851
|
className: "p-6",
|
|
25655
25852
|
children: [
|
|
25656
|
-
/* @__PURE__ */
|
|
25853
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25657
25854
|
className: "text-sm text-muted-foreground mb-4",
|
|
25658
25855
|
children: "Paste your base58 private key to replace the current wallet used for Setu."
|
|
25659
25856
|
}),
|
|
25660
|
-
/* @__PURE__ */
|
|
25857
|
+
/* @__PURE__ */ jsx103("textarea", {
|
|
25661
25858
|
ref: importPrivateKeyRef,
|
|
25662
25859
|
value: importPrivateKey,
|
|
25663
25860
|
onChange: (e) => setImportPrivateKey(e.target.value),
|
|
@@ -25672,26 +25869,26 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25672
25869
|
handleCloseImportWallet();
|
|
25673
25870
|
}
|
|
25674
25871
|
}),
|
|
25675
|
-
importWalletError && /* @__PURE__ */
|
|
25872
|
+
importWalletError && /* @__PURE__ */ jsx103("p", {
|
|
25676
25873
|
className: "text-sm text-red-500 mt-3",
|
|
25677
25874
|
children: importWalletError
|
|
25678
25875
|
}),
|
|
25679
25876
|
/* @__PURE__ */ jsxs91("div", {
|
|
25680
25877
|
className: "flex gap-3 mt-5",
|
|
25681
25878
|
children: [
|
|
25682
|
-
/* @__PURE__ */
|
|
25879
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25683
25880
|
type: "button",
|
|
25684
25881
|
onClick: handleCloseImportWallet,
|
|
25685
25882
|
disabled: isImportingWallet,
|
|
25686
25883
|
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
25884
|
children: "Cancel"
|
|
25688
25885
|
}),
|
|
25689
|
-
/* @__PURE__ */
|
|
25886
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25690
25887
|
type: "button",
|
|
25691
25888
|
onClick: handleImportWallet,
|
|
25692
25889
|
disabled: !importPrivateKey.trim() || isImportingWallet,
|
|
25693
25890
|
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__ */
|
|
25891
|
+
children: isImportingWallet ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25695
25892
|
className: "w-4 h-4 animate-spin"
|
|
25696
25893
|
}) : "Import Wallet"
|
|
25697
25894
|
})
|
|
@@ -25702,7 +25899,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25702
25899
|
]
|
|
25703
25900
|
})
|
|
25704
25901
|
}),
|
|
25705
|
-
oauthSession && /* @__PURE__ */
|
|
25902
|
+
oauthSession && /* @__PURE__ */ jsx103("div", {
|
|
25706
25903
|
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
25707
25904
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25708
25905
|
className: "bg-background border border-border rounded-xl w-full max-w-lg mx-6 shadow-2xl",
|
|
@@ -25710,7 +25907,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25710
25907
|
/* @__PURE__ */ jsxs91("div", {
|
|
25711
25908
|
className: "flex items-center gap-3 p-6 border-b border-border",
|
|
25712
25909
|
children: [
|
|
25713
|
-
/* @__PURE__ */
|
|
25910
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25714
25911
|
provider: oauthSession.provider,
|
|
25715
25912
|
size: 24
|
|
25716
25913
|
}),
|
|
@@ -25740,23 +25937,23 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25740
25937
|
/* @__PURE__ */ jsxs91("div", {
|
|
25741
25938
|
className: "flex gap-3",
|
|
25742
25939
|
children: [
|
|
25743
|
-
/* @__PURE__ */
|
|
25940
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25744
25941
|
type: "button",
|
|
25745
25942
|
onClick: handleCancelOAuth,
|
|
25746
25943
|
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
25944
|
children: "Cancel"
|
|
25748
25945
|
}),
|
|
25749
|
-
/* @__PURE__ */
|
|
25946
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25750
25947
|
type: "button",
|
|
25751
25948
|
onClick: handleOpenPopup,
|
|
25752
25949
|
disabled: isOpeningPopup,
|
|
25753
25950
|
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__ */
|
|
25951
|
+
children: isOpeningPopup ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25755
25952
|
className: "w-4 h-4 animate-spin"
|
|
25756
25953
|
}) : /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25757
25954
|
children: [
|
|
25758
25955
|
"Continue",
|
|
25759
|
-
/* @__PURE__ */
|
|
25956
|
+
/* @__PURE__ */ jsx103(ExternalLink10, {
|
|
25760
25957
|
className: "w-4 h-4"
|
|
25761
25958
|
})
|
|
25762
25959
|
]
|
|
@@ -25768,11 +25965,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25768
25965
|
}) : /* @__PURE__ */ jsxs91("div", {
|
|
25769
25966
|
className: "p-6",
|
|
25770
25967
|
children: [
|
|
25771
|
-
/* @__PURE__ */
|
|
25968
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25772
25969
|
className: "text-sm text-muted-foreground mb-4",
|
|
25773
25970
|
children: "Paste the authorization code:"
|
|
25774
25971
|
}),
|
|
25775
|
-
/* @__PURE__ */
|
|
25972
|
+
/* @__PURE__ */ jsx103("input", {
|
|
25776
25973
|
type: "text",
|
|
25777
25974
|
ref: oauthCodeInputRef,
|
|
25778
25975
|
value: oauthCodeInput,
|
|
@@ -25789,18 +25986,18 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25789
25986
|
/* @__PURE__ */ jsxs91("div", {
|
|
25790
25987
|
className: "flex gap-3",
|
|
25791
25988
|
children: [
|
|
25792
|
-
/* @__PURE__ */
|
|
25989
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25793
25990
|
type: "button",
|
|
25794
25991
|
onClick: handleCancelOAuth,
|
|
25795
25992
|
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
25993
|
children: "Cancel"
|
|
25797
25994
|
}),
|
|
25798
|
-
/* @__PURE__ */
|
|
25995
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25799
25996
|
type: "button",
|
|
25800
25997
|
onClick: handleExchangeCode,
|
|
25801
25998
|
disabled: !oauthCodeInput.trim() || isExchangingCode,
|
|
25802
25999
|
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__ */
|
|
26000
|
+
children: isExchangingCode ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25804
26001
|
className: "w-4 h-4 animate-spin"
|
|
25805
26002
|
}) : "Connect"
|
|
25806
26003
|
})
|
|
@@ -25811,7 +26008,7 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25811
26008
|
]
|
|
25812
26009
|
})
|
|
25813
26010
|
}),
|
|
25814
|
-
copilotModalOpen && /* @__PURE__ */
|
|
26011
|
+
copilotModalOpen && /* @__PURE__ */ jsx103("div", {
|
|
25815
26012
|
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/60 backdrop-blur-sm",
|
|
25816
26013
|
children: /* @__PURE__ */ jsxs91("div", {
|
|
25817
26014
|
className: "bg-background border border-border rounded-xl w-full max-w-lg mx-6 shadow-2xl",
|
|
@@ -25819,11 +26016,11 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25819
26016
|
/* @__PURE__ */ jsxs91("div", {
|
|
25820
26017
|
className: "flex items-center gap-3 p-6 border-b border-border",
|
|
25821
26018
|
children: [
|
|
25822
|
-
/* @__PURE__ */
|
|
26019
|
+
/* @__PURE__ */ jsx103(ProviderLogo, {
|
|
25823
26020
|
provider: "copilot",
|
|
25824
26021
|
size: 24
|
|
25825
26022
|
}),
|
|
25826
|
-
/* @__PURE__ */
|
|
26023
|
+
/* @__PURE__ */ jsx103("h3", {
|
|
25827
26024
|
className: "text-lg font-semibold",
|
|
25828
26025
|
children: "Connect GitHub Copilot"
|
|
25829
26026
|
})
|
|
@@ -25835,13 +26032,13 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25835
26032
|
/* @__PURE__ */ jsxs91("div", {
|
|
25836
26033
|
className: "flex items-center gap-2",
|
|
25837
26034
|
children: [
|
|
25838
|
-
/* @__PURE__ */
|
|
26035
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25839
26036
|
type: "button",
|
|
25840
26037
|
onClick: () => handleCopilotSwitchMode("oauth"),
|
|
25841
26038
|
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
26039
|
children: "OAuth"
|
|
25843
26040
|
}),
|
|
25844
|
-
/* @__PURE__ */
|
|
26041
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25845
26042
|
type: "button",
|
|
25846
26043
|
onClick: () => handleCopilotSwitchMode("token"),
|
|
25847
26044
|
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 +26048,30 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25851
26048
|
}),
|
|
25852
26049
|
copilotAuthMode === "oauth" ? /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25853
26050
|
children: [
|
|
25854
|
-
/* @__PURE__ */
|
|
26051
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25855
26052
|
className: "text-sm text-muted-foreground",
|
|
25856
26053
|
children: "Enter this code on GitHub to authorize:"
|
|
25857
26054
|
}),
|
|
25858
|
-
/* @__PURE__ */
|
|
26055
|
+
/* @__PURE__ */ jsx103("div", {
|
|
25859
26056
|
className: "flex items-center justify-center gap-3",
|
|
25860
|
-
children: copilotLoading ? /* @__PURE__ */
|
|
26057
|
+
children: copilotLoading ? /* @__PURE__ */ jsx103("div", {
|
|
25861
26058
|
className: "bg-muted px-6 py-3 rounded-lg animate-pulse",
|
|
25862
|
-
children: /* @__PURE__ */
|
|
26059
|
+
children: /* @__PURE__ */ jsx103("div", {
|
|
25863
26060
|
className: "h-9 w-48 bg-muted-foreground/20 rounded"
|
|
25864
26061
|
})
|
|
25865
26062
|
}) : copilotDevice ? /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25866
26063
|
children: [
|
|
25867
|
-
/* @__PURE__ */
|
|
26064
|
+
/* @__PURE__ */ jsx103("code", {
|
|
25868
26065
|
className: "text-3xl font-mono font-bold tracking-widest text-foreground bg-muted px-6 py-3 rounded-lg select-all",
|
|
25869
26066
|
children: copilotDevice.userCode
|
|
25870
26067
|
}),
|
|
25871
|
-
/* @__PURE__ */
|
|
26068
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25872
26069
|
type: "button",
|
|
25873
26070
|
onClick: handleCopilotCopyCode,
|
|
25874
26071
|
className: "p-2 text-muted-foreground hover:text-foreground transition-colors",
|
|
25875
|
-
children: copilotCodeCopied ? /* @__PURE__ */
|
|
26072
|
+
children: copilotCodeCopied ? /* @__PURE__ */ jsx103(Check13, {
|
|
25876
26073
|
className: "w-5 h-5 text-green-500"
|
|
25877
|
-
}) : /* @__PURE__ */
|
|
26074
|
+
}) : /* @__PURE__ */ jsx103(Copy5, {
|
|
25878
26075
|
className: "w-5 h-5"
|
|
25879
26076
|
})
|
|
25880
26077
|
})
|
|
@@ -25884,37 +26081,37 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25884
26081
|
]
|
|
25885
26082
|
}) : /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25886
26083
|
children: [
|
|
25887
|
-
/* @__PURE__ */
|
|
26084
|
+
/* @__PURE__ */ jsx103("p", {
|
|
25888
26085
|
className: "text-sm text-muted-foreground",
|
|
25889
26086
|
children: "Paste a GitHub token with Copilot model access."
|
|
25890
26087
|
}),
|
|
25891
|
-
/* @__PURE__ */
|
|
26088
|
+
/* @__PURE__ */ jsx103("input", {
|
|
25892
26089
|
type: "password",
|
|
25893
26090
|
value: copilotTokenInput,
|
|
25894
26091
|
onChange: (e) => setCopilotTokenInput(e.target.value),
|
|
25895
26092
|
placeholder: "gho_...",
|
|
25896
26093
|
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
26094
|
}),
|
|
25898
|
-
copilotAuthMethods?.ghImport.available && /* @__PURE__ */
|
|
26095
|
+
copilotAuthMethods?.ghImport.available && /* @__PURE__ */ jsx103("button", {
|
|
25899
26096
|
type: "button",
|
|
25900
26097
|
onClick: handleCopilotImportFromGh,
|
|
25901
26098
|
disabled: copilotGhImporting,
|
|
25902
26099
|
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__ */
|
|
26100
|
+
children: copilotGhImporting ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25904
26101
|
className: "w-4 h-4 animate-spin"
|
|
25905
26102
|
}) : "Import from GH CLI"
|
|
25906
26103
|
}),
|
|
25907
|
-
copilotAuthMethods?.ghImport.available && !copilotAuthMethods.ghImport.authenticated && /* @__PURE__ */
|
|
26104
|
+
copilotAuthMethods?.ghImport.available && !copilotAuthMethods.ghImport.authenticated && /* @__PURE__ */ jsx103("p", {
|
|
25908
26105
|
className: "text-xs text-muted-foreground",
|
|
25909
26106
|
children: copilotAuthMethods.ghImport.reason || "GitHub CLI is not authenticated"
|
|
25910
26107
|
}),
|
|
25911
|
-
copilotAuthMethods && !copilotAuthMethods.ghImport.available && copilotAuthMethods.ghImport.reason && /* @__PURE__ */
|
|
26108
|
+
copilotAuthMethods && !copilotAuthMethods.ghImport.available && copilotAuthMethods.ghImport.reason && /* @__PURE__ */ jsx103("p", {
|
|
25912
26109
|
className: "text-xs text-muted-foreground",
|
|
25913
26110
|
children: copilotAuthMethods.ghImport.reason
|
|
25914
26111
|
})
|
|
25915
26112
|
]
|
|
25916
26113
|
}),
|
|
25917
|
-
copilotDiagnostics && copilotDiagnostics.tokenSources.length > 0 && /* @__PURE__ */
|
|
26114
|
+
copilotDiagnostics && copilotDiagnostics.tokenSources.length > 0 && /* @__PURE__ */ jsx103("div", {
|
|
25918
26115
|
className: "text-xs text-muted-foreground space-y-1",
|
|
25919
26116
|
children: copilotDiagnostics.tokenSources.map((source) => /* @__PURE__ */ jsxs91("div", {
|
|
25920
26117
|
children: [
|
|
@@ -25926,14 +26123,14 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25926
26123
|
]
|
|
25927
26124
|
}, source.source))
|
|
25928
26125
|
}),
|
|
25929
|
-
copilotError && /* @__PURE__ */
|
|
26126
|
+
copilotError && /* @__PURE__ */ jsx103("p", {
|
|
25930
26127
|
className: "text-sm text-red-500 text-center",
|
|
25931
26128
|
children: copilotError
|
|
25932
26129
|
}),
|
|
25933
26130
|
copilotPolling && copilotAuthMode === "oauth" && /* @__PURE__ */ jsxs91("div", {
|
|
25934
26131
|
className: "flex items-center justify-center gap-2 text-sm text-muted-foreground",
|
|
25935
26132
|
children: [
|
|
25936
|
-
/* @__PURE__ */
|
|
26133
|
+
/* @__PURE__ */ jsx103(Loader216, {
|
|
25937
26134
|
className: "w-4 h-4 animate-spin"
|
|
25938
26135
|
}),
|
|
25939
26136
|
"Waiting for authorization..."
|
|
@@ -25942,33 +26139,33 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25942
26139
|
/* @__PURE__ */ jsxs91("div", {
|
|
25943
26140
|
className: "flex gap-3",
|
|
25944
26141
|
children: [
|
|
25945
|
-
/* @__PURE__ */
|
|
26142
|
+
/* @__PURE__ */ jsx103("button", {
|
|
25946
26143
|
type: "button",
|
|
25947
26144
|
onClick: handleCancelCopilot,
|
|
25948
26145
|
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
26146
|
children: "Cancel"
|
|
25950
26147
|
}),
|
|
25951
|
-
copilotAuthMode === "oauth" ? /* @__PURE__ */
|
|
26148
|
+
copilotAuthMode === "oauth" ? /* @__PURE__ */ jsx103("button", {
|
|
25952
26149
|
type: "button",
|
|
25953
26150
|
onClick: handleCopilotOpenGithub,
|
|
25954
26151
|
disabled: copilotPolling || copilotLoading,
|
|
25955
26152
|
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__ */
|
|
26153
|
+
children: copilotPolling || copilotLoading ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25957
26154
|
className: "w-4 h-4 animate-spin"
|
|
25958
26155
|
}) : /* @__PURE__ */ jsxs91(Fragment39, {
|
|
25959
26156
|
children: [
|
|
25960
26157
|
"Open GitHub",
|
|
25961
|
-
/* @__PURE__ */
|
|
26158
|
+
/* @__PURE__ */ jsx103(ExternalLink10, {
|
|
25962
26159
|
className: "w-4 h-4"
|
|
25963
26160
|
})
|
|
25964
26161
|
]
|
|
25965
26162
|
})
|
|
25966
|
-
}) : /* @__PURE__ */
|
|
26163
|
+
}) : /* @__PURE__ */ jsx103("button", {
|
|
25967
26164
|
type: "button",
|
|
25968
26165
|
onClick: handleCopilotSaveToken,
|
|
25969
26166
|
disabled: !copilotTokenInput.trim() || copilotTokenSaving,
|
|
25970
26167
|
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__ */
|
|
26168
|
+
children: copilotTokenSaving ? /* @__PURE__ */ jsx103(Loader216, {
|
|
25972
26169
|
className: "w-4 h-4 animate-spin"
|
|
25973
26170
|
}) : "Save token"
|
|
25974
26171
|
})
|
|
@@ -25984,10 +26181,10 @@ var ProviderSetupStep = memo45(function ProviderSetupStep2({
|
|
|
25984
26181
|
});
|
|
25985
26182
|
|
|
25986
26183
|
// src/components/onboarding/steps/DefaultsStep.tsx
|
|
25987
|
-
import { memo as
|
|
25988
|
-
import { Loader2 as
|
|
25989
|
-
import { jsx as
|
|
25990
|
-
var DefaultsStep =
|
|
26184
|
+
import { memo as memo47, useState as useState45, useEffect as useEffect47, useId as useId3, useRef as useRef32 } from "react";
|
|
26185
|
+
import { Loader2 as Loader217, ArrowLeft, Sparkles as Sparkles8, ChevronDown as ChevronDown12 } from "lucide-react";
|
|
26186
|
+
import { jsx as jsx104, jsxs as jsxs92, Fragment as Fragment40 } from "react/jsx-runtime";
|
|
26187
|
+
var DefaultsStep = memo47(function DefaultsStep2({
|
|
25991
26188
|
authStatus,
|
|
25992
26189
|
onComplete,
|
|
25993
26190
|
onBack,
|
|
@@ -26072,9 +26269,9 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26072
26269
|
}
|
|
26073
26270
|
};
|
|
26074
26271
|
if (isLoading) {
|
|
26075
|
-
return /* @__PURE__ */
|
|
26272
|
+
return /* @__PURE__ */ jsx104("div", {
|
|
26076
26273
|
className: "min-h-screen flex items-center justify-center",
|
|
26077
|
-
children: /* @__PURE__ */
|
|
26274
|
+
children: /* @__PURE__ */ jsx104(Loader217, {
|
|
26078
26275
|
className: "w-8 h-8 animate-spin text-muted-foreground"
|
|
26079
26276
|
})
|
|
26080
26277
|
});
|
|
@@ -26090,11 +26287,11 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26090
26287
|
/* @__PURE__ */ jsxs92("div", {
|
|
26091
26288
|
className: "flex items-center gap-3",
|
|
26092
26289
|
children: [
|
|
26093
|
-
/* @__PURE__ */
|
|
26290
|
+
/* @__PURE__ */ jsx104(ProviderLogo, {
|
|
26094
26291
|
provider: "ottorouter",
|
|
26095
26292
|
size: 24
|
|
26096
26293
|
}),
|
|
26097
|
-
/* @__PURE__ */
|
|
26294
|
+
/* @__PURE__ */ jsx104("span", {
|
|
26098
26295
|
className: "font-semibold text-foreground",
|
|
26099
26296
|
children: "otto"
|
|
26100
26297
|
})
|
|
@@ -26103,7 +26300,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26103
26300
|
/* @__PURE__ */ jsxs92("div", {
|
|
26104
26301
|
className: "flex items-center gap-2 text-sm text-muted-foreground",
|
|
26105
26302
|
children: [
|
|
26106
|
-
/* @__PURE__ */
|
|
26303
|
+
/* @__PURE__ */ jsx104("span", {
|
|
26107
26304
|
className: "w-2 h-2 rounded-full bg-blue-500"
|
|
26108
26305
|
}),
|
|
26109
26306
|
"Step 2 of 2"
|
|
@@ -26111,7 +26308,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26111
26308
|
})
|
|
26112
26309
|
]
|
|
26113
26310
|
}),
|
|
26114
|
-
/* @__PURE__ */
|
|
26311
|
+
/* @__PURE__ */ jsx104("div", {
|
|
26115
26312
|
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
26313
|
children: /* @__PURE__ */ jsxs92("div", {
|
|
26117
26314
|
className: "max-w-7xl mx-auto",
|
|
@@ -26119,11 +26316,11 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26119
26316
|
/* @__PURE__ */ jsxs92("div", {
|
|
26120
26317
|
className: "mb-10",
|
|
26121
26318
|
children: [
|
|
26122
|
-
/* @__PURE__ */
|
|
26319
|
+
/* @__PURE__ */ jsx104("h1", {
|
|
26123
26320
|
className: "text-3xl lg:text-4xl font-semibold text-foreground mb-3",
|
|
26124
26321
|
children: "Configure Defaults"
|
|
26125
26322
|
}),
|
|
26126
|
-
/* @__PURE__ */
|
|
26323
|
+
/* @__PURE__ */ jsx104("p", {
|
|
26127
26324
|
className: "text-lg text-muted-foreground",
|
|
26128
26325
|
children: "Set your preferences. You can change these anytime in settings."
|
|
26129
26326
|
})
|
|
@@ -26135,7 +26332,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26135
26332
|
/* @__PURE__ */ jsxs92("div", {
|
|
26136
26333
|
className: "md:col-span-2",
|
|
26137
26334
|
children: [
|
|
26138
|
-
/* @__PURE__ */
|
|
26335
|
+
/* @__PURE__ */ jsx104("label", {
|
|
26139
26336
|
htmlFor: providerId,
|
|
26140
26337
|
className: "block text-sm font-medium text-muted-foreground mb-2",
|
|
26141
26338
|
children: "Default Provider"
|
|
@@ -26143,7 +26340,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26143
26340
|
/* @__PURE__ */ jsxs92("div", {
|
|
26144
26341
|
className: "relative",
|
|
26145
26342
|
children: [
|
|
26146
|
-
/* @__PURE__ */
|
|
26343
|
+
/* @__PURE__ */ jsx104("select", {
|
|
26147
26344
|
id: providerId,
|
|
26148
26345
|
value: selectedProvider,
|
|
26149
26346
|
onChange: (e) => {
|
|
@@ -26151,12 +26348,12 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26151
26348
|
setSelectedProvider(e.target.value);
|
|
26152
26349
|
},
|
|
26153
26350
|
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__ */
|
|
26351
|
+
children: availableProviders.map((p) => /* @__PURE__ */ jsx104("option", {
|
|
26155
26352
|
value: p,
|
|
26156
26353
|
children: authStatus.providers[p]?.label || p
|
|
26157
26354
|
}, p))
|
|
26158
26355
|
}),
|
|
26159
|
-
/* @__PURE__ */
|
|
26356
|
+
/* @__PURE__ */ jsx104(ChevronDown12, {
|
|
26160
26357
|
className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground pointer-events-none"
|
|
26161
26358
|
})
|
|
26162
26359
|
]
|
|
@@ -26166,7 +26363,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26166
26363
|
/* @__PURE__ */ jsxs92("div", {
|
|
26167
26364
|
className: "md:col-span-2",
|
|
26168
26365
|
children: [
|
|
26169
|
-
/* @__PURE__ */
|
|
26366
|
+
/* @__PURE__ */ jsx104("label", {
|
|
26170
26367
|
htmlFor: modelId,
|
|
26171
26368
|
className: "block text-sm font-medium text-muted-foreground mb-2",
|
|
26172
26369
|
children: "Default Model"
|
|
@@ -26174,17 +26371,17 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26174
26371
|
/* @__PURE__ */ jsxs92("div", {
|
|
26175
26372
|
className: "relative",
|
|
26176
26373
|
children: [
|
|
26177
|
-
/* @__PURE__ */
|
|
26374
|
+
/* @__PURE__ */ jsx104("select", {
|
|
26178
26375
|
id: modelId,
|
|
26179
26376
|
value: selectedModel,
|
|
26180
26377
|
onChange: (e) => setSelectedModel(e.target.value),
|
|
26181
26378
|
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__ */
|
|
26379
|
+
children: currentProviderModels.map((m) => /* @__PURE__ */ jsx104("option", {
|
|
26183
26380
|
value: m.id,
|
|
26184
26381
|
children: m.label || m.id
|
|
26185
26382
|
}, m.id))
|
|
26186
26383
|
}),
|
|
26187
|
-
/* @__PURE__ */
|
|
26384
|
+
/* @__PURE__ */ jsx104(ChevronDown12, {
|
|
26188
26385
|
className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground pointer-events-none"
|
|
26189
26386
|
})
|
|
26190
26387
|
]
|
|
@@ -26193,7 +26390,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26193
26390
|
}),
|
|
26194
26391
|
/* @__PURE__ */ jsxs92("div", {
|
|
26195
26392
|
children: [
|
|
26196
|
-
/* @__PURE__ */
|
|
26393
|
+
/* @__PURE__ */ jsx104("label", {
|
|
26197
26394
|
htmlFor: agentId,
|
|
26198
26395
|
className: "block text-sm font-medium text-muted-foreground mb-2",
|
|
26199
26396
|
children: "Default Agent"
|
|
@@ -26201,17 +26398,17 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26201
26398
|
/* @__PURE__ */ jsxs92("div", {
|
|
26202
26399
|
className: "relative",
|
|
26203
26400
|
children: [
|
|
26204
|
-
/* @__PURE__ */
|
|
26401
|
+
/* @__PURE__ */ jsx104("select", {
|
|
26205
26402
|
id: agentId,
|
|
26206
26403
|
value: selectedAgent,
|
|
26207
26404
|
onChange: (e) => setSelectedAgent(e.target.value),
|
|
26208
26405
|
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__ */
|
|
26406
|
+
children: (config2?.agents || ["build"]).map((a) => /* @__PURE__ */ jsx104("option", {
|
|
26210
26407
|
value: a,
|
|
26211
26408
|
children: a
|
|
26212
26409
|
}, a))
|
|
26213
26410
|
}),
|
|
26214
|
-
/* @__PURE__ */
|
|
26411
|
+
/* @__PURE__ */ jsx104(ChevronDown12, {
|
|
26215
26412
|
className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground pointer-events-none"
|
|
26216
26413
|
})
|
|
26217
26414
|
]
|
|
@@ -26220,7 +26417,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26220
26417
|
}),
|
|
26221
26418
|
/* @__PURE__ */ jsxs92("div", {
|
|
26222
26419
|
children: [
|
|
26223
|
-
/* @__PURE__ */
|
|
26420
|
+
/* @__PURE__ */ jsx104("label", {
|
|
26224
26421
|
htmlFor: approvalId,
|
|
26225
26422
|
className: "block text-sm font-medium text-muted-foreground mb-2",
|
|
26226
26423
|
children: "Tool Approval"
|
|
@@ -26234,59 +26431,59 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26234
26431
|
onChange: (e) => setSelectedApproval(e.target.value),
|
|
26235
26432
|
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
26433
|
children: [
|
|
26237
|
-
/* @__PURE__ */
|
|
26434
|
+
/* @__PURE__ */ jsx104("option", {
|
|
26238
26435
|
value: "auto",
|
|
26239
26436
|
children: "Auto - run without asking"
|
|
26240
26437
|
}),
|
|
26241
|
-
/* @__PURE__ */
|
|
26438
|
+
/* @__PURE__ */ jsx104("option", {
|
|
26242
26439
|
value: "dangerous",
|
|
26243
26440
|
children: "Dangerous - approve writes only"
|
|
26244
26441
|
}),
|
|
26245
|
-
/* @__PURE__ */
|
|
26442
|
+
/* @__PURE__ */ jsx104("option", {
|
|
26246
26443
|
value: "yolo",
|
|
26247
26444
|
children: "YOLO - skip approvals except hard safety blocks"
|
|
26248
26445
|
}),
|
|
26249
|
-
/* @__PURE__ */
|
|
26446
|
+
/* @__PURE__ */ jsx104("option", {
|
|
26250
26447
|
value: "all",
|
|
26251
26448
|
children: "All - approve every tool"
|
|
26252
26449
|
})
|
|
26253
26450
|
]
|
|
26254
26451
|
}),
|
|
26255
|
-
/* @__PURE__ */
|
|
26452
|
+
/* @__PURE__ */ jsx104(ChevronDown12, {
|
|
26256
26453
|
className: "absolute right-4 top-1/2 -translate-y-1/2 w-5 h-5 text-muted-foreground pointer-events-none"
|
|
26257
26454
|
})
|
|
26258
26455
|
]
|
|
26259
26456
|
}),
|
|
26260
|
-
/* @__PURE__ */
|
|
26457
|
+
/* @__PURE__ */ jsx104("p", {
|
|
26261
26458
|
className: "mt-2 text-sm text-muted-foreground",
|
|
26262
26459
|
children: "Controls when tool executions need approval. YOLO still blocks extreme destructive commands."
|
|
26263
26460
|
})
|
|
26264
26461
|
]
|
|
26265
26462
|
}),
|
|
26266
|
-
/* @__PURE__ */
|
|
26463
|
+
/* @__PURE__ */ jsx104("div", {
|
|
26267
26464
|
className: "md:col-span-2",
|
|
26268
26465
|
children: /* @__PURE__ */ jsxs92("div", {
|
|
26269
26466
|
className: "flex items-center justify-between px-4 py-3 bg-card border border-border rounded-xl",
|
|
26270
26467
|
children: [
|
|
26271
26468
|
/* @__PURE__ */ jsxs92("div", {
|
|
26272
26469
|
children: [
|
|
26273
|
-
/* @__PURE__ */
|
|
26470
|
+
/* @__PURE__ */ jsx104("span", {
|
|
26274
26471
|
className: "text-sm font-medium text-foreground",
|
|
26275
26472
|
children: "Guided Mode"
|
|
26276
26473
|
}),
|
|
26277
|
-
/* @__PURE__ */
|
|
26474
|
+
/* @__PURE__ */ jsx104("p", {
|
|
26278
26475
|
className: "text-sm text-muted-foreground mt-0.5",
|
|
26279
26476
|
children: "AI will run commands and manage services for you instead of giving instructions"
|
|
26280
26477
|
})
|
|
26281
26478
|
]
|
|
26282
26479
|
}),
|
|
26283
|
-
/* @__PURE__ */
|
|
26480
|
+
/* @__PURE__ */ jsx104("button", {
|
|
26284
26481
|
type: "button",
|
|
26285
26482
|
role: "switch",
|
|
26286
26483
|
"aria-checked": guidedMode,
|
|
26287
26484
|
onClick: () => setGuidedMode(!guidedMode),
|
|
26288
26485
|
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__ */
|
|
26486
|
+
children: /* @__PURE__ */ jsx104("span", {
|
|
26290
26487
|
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
26488
|
})
|
|
26292
26489
|
})
|
|
@@ -26298,7 +26495,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26298
26495
|
]
|
|
26299
26496
|
})
|
|
26300
26497
|
}),
|
|
26301
|
-
/* @__PURE__ */
|
|
26498
|
+
/* @__PURE__ */ jsx104("div", {
|
|
26302
26499
|
className: "fixed bottom-0 left-0 right-0 px-4 sm:px-6 py-4 border-t border-border bg-background",
|
|
26303
26500
|
children: /* @__PURE__ */ jsxs92("div", {
|
|
26304
26501
|
className: "max-w-7xl mx-auto flex items-center justify-between",
|
|
@@ -26308,20 +26505,20 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26308
26505
|
onClick: onBack,
|
|
26309
26506
|
className: "flex items-center gap-2 px-4 py-3 text-muted-foreground hover:text-foreground transition-colors",
|
|
26310
26507
|
children: [
|
|
26311
|
-
/* @__PURE__ */
|
|
26508
|
+
/* @__PURE__ */ jsx104(ArrowLeft, {
|
|
26312
26509
|
className: "w-4 h-4"
|
|
26313
26510
|
}),
|
|
26314
26511
|
"Back"
|
|
26315
26512
|
]
|
|
26316
26513
|
}),
|
|
26317
|
-
/* @__PURE__ */
|
|
26514
|
+
/* @__PURE__ */ jsx104("button", {
|
|
26318
26515
|
type: "button",
|
|
26319
26516
|
onClick: handleFinish,
|
|
26320
26517
|
disabled: isSaving,
|
|
26321
26518
|
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
26519
|
children: isSaving ? /* @__PURE__ */ jsxs92(Fragment40, {
|
|
26323
26520
|
children: [
|
|
26324
|
-
/* @__PURE__ */
|
|
26521
|
+
/* @__PURE__ */ jsx104(Loader217, {
|
|
26325
26522
|
className: "w-4 h-4 animate-spin"
|
|
26326
26523
|
}),
|
|
26327
26524
|
"Setting up..."
|
|
@@ -26329,7 +26526,7 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26329
26526
|
}) : /* @__PURE__ */ jsxs92(Fragment40, {
|
|
26330
26527
|
children: [
|
|
26331
26528
|
"Start Using otto",
|
|
26332
|
-
/* @__PURE__ */
|
|
26529
|
+
/* @__PURE__ */ jsx104(Sparkles8, {
|
|
26333
26530
|
className: "w-4 h-4"
|
|
26334
26531
|
})
|
|
26335
26532
|
]
|
|
@@ -26343,8 +26540,8 @@ var DefaultsStep = memo46(function DefaultsStep2({
|
|
|
26343
26540
|
});
|
|
26344
26541
|
|
|
26345
26542
|
// src/components/onboarding/OnboardingModal.tsx
|
|
26346
|
-
import { jsx as
|
|
26347
|
-
var OnboardingModal =
|
|
26543
|
+
import { jsx as jsx105, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
26544
|
+
var OnboardingModal = memo48(function OnboardingModal2({
|
|
26348
26545
|
hideHeader = false
|
|
26349
26546
|
}) {
|
|
26350
26547
|
const isOpen = useOnboardingStore((s) => s.isOpen);
|
|
@@ -26376,7 +26573,7 @@ var OnboardingModal = memo47(function OnboardingModal2({
|
|
|
26376
26573
|
return /* @__PURE__ */ jsxs93("div", {
|
|
26377
26574
|
className: "fixed inset-0 z-[9999] bg-background text-foreground overflow-y-auto",
|
|
26378
26575
|
children: [
|
|
26379
|
-
currentStep === "wallet" && /* @__PURE__ */
|
|
26576
|
+
currentStep === "wallet" && /* @__PURE__ */ jsx105(ProviderSetupStep, {
|
|
26380
26577
|
authStatus,
|
|
26381
26578
|
onSetupWallet: setupWallet,
|
|
26382
26579
|
onImportWallet: importWallet,
|
|
@@ -26397,7 +26594,7 @@ var OnboardingModal = memo47(function OnboardingModal2({
|
|
|
26397
26594
|
onImportCopilotTokenFromGh: importCopilotTokenFromGh,
|
|
26398
26595
|
onGetCopilotDiagnostics: getCopilotDiagnostics
|
|
26399
26596
|
}),
|
|
26400
|
-
currentStep === "defaults" && /* @__PURE__ */
|
|
26597
|
+
currentStep === "defaults" && /* @__PURE__ */ jsx105(DefaultsStep, {
|
|
26401
26598
|
authStatus,
|
|
26402
26599
|
onComplete: completeOnboarding,
|
|
26403
26600
|
onBack: prevStep,
|
|
@@ -27076,6 +27273,7 @@ function useSetuPayments(sessionId) {
|
|
|
27076
27273
|
export {
|
|
27077
27274
|
useWorkingDirectory,
|
|
27078
27275
|
useUsageStore,
|
|
27276
|
+
useUpdateSkillsConfig,
|
|
27079
27277
|
useUpdateSession,
|
|
27080
27278
|
useUpdateDefaults,
|
|
27081
27279
|
useUnstageFiles,
|
|
@@ -27247,4 +27445,4 @@ export {
|
|
|
27247
27445
|
API_BASE_URL
|
|
27248
27446
|
};
|
|
27249
27447
|
|
|
27250
|
-
//# debugId=
|
|
27448
|
+
//# debugId=1B0ADC47E25AD86364756E2164756E21
|