turbollm 1.7.2 → 1.7.4
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/README.md +23 -20
- package/dist/chunk-TPYU5ZAX.js +175 -0
- package/dist/cli.js +2125 -1948
- package/dist/distiller-UROKYEBN.js +9 -0
- package/dist/webdist/assets/AgentEditPage-BOnwuNEo.js +1 -0
- package/dist/webdist/assets/ChatScreen-C-etPxFP.js +65 -0
- package/dist/webdist/assets/CustomizeScreen-CBS-4CGF.js +4 -0
- package/dist/webdist/assets/DeveloperScreen-Dm9p8rsC.js +1 -0
- package/dist/webdist/assets/EnginesScreen-KF8kClsH.js +7 -0
- package/dist/webdist/assets/FsBrowser-Un46d4qe.js +1 -0
- package/dist/webdist/assets/{MessageBubble-COuZ8jTd.js → MessageBubble-5F87qAxY.js} +15 -16
- package/dist/webdist/assets/ModelsScreen-6VbHhlyf.js +2 -0
- package/dist/webdist/assets/SettingsScreen-DjoLkPpP.js +1 -0
- package/dist/webdist/assets/SkillEditPage-C5Evktgw.js +1 -0
- package/dist/webdist/assets/WorkspaceScreen-CiKb7f1I.js +1 -0
- package/dist/webdist/assets/agent-api-D3hMsrHk.js +1 -0
- package/dist/webdist/assets/{arc-BrQAHE5c.js → arc-BhnuNjta.js} +1 -1
- package/dist/webdist/assets/{architectureDiagram-3BPJPVTR-DzOwDk0E.js → architectureDiagram-3BPJPVTR-c3DASz95.js} +1 -1
- package/dist/webdist/assets/{arrow-left-Dp4XRnbs.js → arrow-left-BZ7U2kS9.js} +1 -1
- package/dist/webdist/assets/{blockDiagram-GPEHLZMM-Cbs2lNCh.js → blockDiagram-GPEHLZMM-CkpfHyuv.js} +1 -1
- package/dist/webdist/assets/bot-B3GTFQ2J.js +1 -0
- package/dist/webdist/assets/{c4Diagram-AAUBKEIU-BAull9Yv.js → c4Diagram-AAUBKEIU-B5dn9Zuf.js} +1 -1
- package/dist/webdist/assets/channel-CJpy6WaL.js +1 -0
- package/dist/webdist/assets/chat-api-Dz6qvO1a.js +3 -0
- package/dist/webdist/assets/check-C39bHy3w.js +1 -0
- package/dist/webdist/assets/chevron-left-Bm2f38an.js +1 -0
- package/dist/webdist/assets/chevron-right-DGQJG4QN.js +1 -0
- package/dist/webdist/assets/{chunk-2J33WTMH-B38k4sJL.js → chunk-2J33WTMH-_x1EGF5n.js} +1 -1
- package/dist/webdist/assets/{chunk-4BX2VUAB-VxAkYvb7.js → chunk-4BX2VUAB-pQD6zp-n.js} +1 -1
- package/dist/webdist/assets/{chunk-55IACEB6-CAz9ZWyR.js → chunk-55IACEB6-DIsjXVDw.js} +1 -1
- package/dist/webdist/assets/{chunk-727SXJPM-CvLX5ghS.js → chunk-727SXJPM-CHDF4RtM.js} +1 -1
- package/dist/webdist/assets/{chunk-AQP2D5EJ-CZ0fsnc1.js → chunk-AQP2D5EJ-CaQFwmUk.js} +1 -1
- package/dist/webdist/assets/{chunk-FMBD7UC4-tjHz_yw8.js → chunk-FMBD7UC4-DENyT0Cw.js} +1 -1
- package/dist/webdist/assets/{chunk-ND2GUHAM-DVSh5E5_.js → chunk-ND2GUHAM-Cv6Yek6j.js} +1 -1
- package/dist/webdist/assets/{chunk-QZHKN3VN-D1rUM2SU.js → chunk-QZHKN3VN-9ATQymUl.js} +1 -1
- package/dist/webdist/assets/circle-x-DsCSoQSk.js +1 -0
- package/dist/webdist/assets/classDiagram-4FO5ZUOK-BwNVmSJo.js +1 -0
- package/dist/webdist/assets/classDiagram-v2-Q7XG4LA2-BwNVmSJo.js +1 -0
- package/dist/webdist/assets/collapsible-Bqsm-UEI.js +1 -0
- package/dist/webdist/assets/common-DHHaSVnF.js +1 -0
- package/dist/webdist/assets/{cose-bilkent-S5V4N54A-DIUqY7o2.js → cose-bilkent-S5V4N54A-r9UktTKw.js} +1 -1
- package/dist/webdist/assets/{dagre-BM42HDAG-BzTcsgZ1.js → dagre-BM42HDAG-BnhFpJ0u.js} +1 -1
- package/dist/webdist/assets/{diagram-2AECGRRQ-DanHH-W_.js → diagram-2AECGRRQ-C8R_FKFE.js} +1 -1
- package/dist/webdist/assets/{diagram-5GNKFQAL-DQ5sWHUL.js → diagram-5GNKFQAL-Cy3ObA7-.js} +1 -1
- package/dist/webdist/assets/{diagram-KO2AKTUF-Jqr_pLwu.js → diagram-KO2AKTUF-BKMSyIfH.js} +1 -1
- package/dist/webdist/assets/{diagram-LMA3HP47-BZ89-cp0.js → diagram-LMA3HP47-M3eYUN5j.js} +1 -1
- package/dist/webdist/assets/{diagram-OG6HWLK6-cidBc5qa.js → diagram-OG6HWLK6-9mfuWNo6.js} +1 -1
- package/dist/webdist/assets/dialog-DTDvWQ5-.js +1 -0
- package/dist/webdist/assets/{erDiagram-TEJ5UH35-DEAKZN7b.js → erDiagram-TEJ5UH35-3pYBvVYw.js} +1 -1
- package/dist/webdist/assets/{flowDiagram-I6XJVG4X-Cyx8gMzN.js → flowDiagram-I6XJVG4X-DkeUYo0c.js} +1 -1
- package/dist/webdist/assets/folder-input-CjdiPWWo.js +1 -0
- package/dist/webdist/assets/{ganttDiagram-6RSMTGT7-CqXYW44d.js → ganttDiagram-6RSMTGT7-Co8G6rQq.js} +1 -1
- package/dist/webdist/assets/{gitGraphDiagram-PVQCEYII-0dv_zKYA.js → gitGraphDiagram-PVQCEYII-BeKTVG6x.js} +1 -1
- package/dist/webdist/assets/{index-DHmOrvk5.js → index-BiJl342p.js} +17 -17
- package/dist/webdist/assets/index-CxonSCte.css +1 -0
- package/dist/webdist/assets/index-MBZ7hSNo.js +10 -0
- package/dist/webdist/assets/{infoDiagram-5YYISTIA-PxeM6E3u.js → infoDiagram-5YYISTIA-CSNZJB_2.js} +1 -1
- package/dist/webdist/assets/{ishikawaDiagram-YF4QCWOH-BnNdTjj1.js → ishikawaDiagram-YF4QCWOH-Bl5G3Tv8.js} +1 -1
- package/dist/webdist/assets/{journeyDiagram-JHISSGLW-D3AHUGxz.js → journeyDiagram-JHISSGLW-8vGboHEi.js} +1 -1
- package/dist/webdist/assets/{kanban-definition-UN3LZRKU-YARl6SUt.js → kanban-definition-UN3LZRKU-Exhgn-QL.js} +1 -1
- package/dist/webdist/assets/{linear-CMEhaWGh.js → linear-BQ7-Rkhb.js} +1 -1
- package/dist/webdist/assets/{mermaid.core-Dfl2pPvv.js → mermaid.core-CQX56k_o.js} +4 -4
- package/dist/webdist/assets/{mindmap-definition-RKZ34NQL-BojWC6jk.js → mindmap-definition-RKZ34NQL-Bo7PZvAB.js} +1 -1
- package/dist/webdist/assets/pencil-D52zQ528.js +1 -0
- package/dist/webdist/assets/personas-BvApKJbI.js +305 -0
- package/dist/webdist/assets/{pieDiagram-4H26LBE5-cjsdMtJJ.js → pieDiagram-4H26LBE5-q8hQguI2.js} +1 -1
- package/dist/webdist/assets/{quadrantDiagram-W4KKPZXB-DYVcgQuL.js → quadrantDiagram-W4KKPZXB-D7oJYa2u.js} +1 -1
- package/dist/webdist/assets/{radix-BY-fjzwm.js → radix-DHuxYtIT.js} +2 -2
- package/dist/webdist/assets/refresh-cw-CCa9KASO.js +1 -0
- package/dist/webdist/assets/{requirementDiagram-4Y6WPE33-Dkj58nhB.js → requirementDiagram-4Y6WPE33-BB3AxfxX.js} +1 -1
- package/dist/webdist/assets/rotate-ccw-CjT25zbE.js +1 -0
- package/dist/webdist/assets/{sankeyDiagram-5OEKKPKP-l3GwUuNl.js → sankeyDiagram-5OEKKPKP-rBs95ARp.js} +1 -1
- package/dist/webdist/assets/{sequenceDiagram-3UESZ5HK-CWj1Dplo.js → sequenceDiagram-3UESZ5HK-Dl8lIjVG.js} +1 -1
- package/dist/webdist/assets/star-CGoRw01k.js +1 -0
- package/dist/webdist/assets/{stateDiagram-AJRCARHV-zbnPRcoE.js → stateDiagram-AJRCARHV-CLoQmP-w.js} +1 -1
- package/dist/webdist/assets/stateDiagram-v2-BHNVJYJU-ByjTcwsY.js +1 -0
- package/dist/webdist/assets/{timeline-definition-PNZ67QCA-C_zAo1WZ.js → timeline-definition-PNZ67QCA-xQjF3Uja.js} +1 -1
- package/dist/webdist/assets/{trash-2-DJmVqx0w.js → trash-2-DtSyrOcz.js} +1 -1
- package/dist/webdist/assets/useIsDesktop-BFaxGM2l.js +1 -0
- package/dist/webdist/assets/{vendor-W5GIuFcv.js → vendor-BE0HADM8.js} +1 -1
- package/dist/webdist/assets/{vennDiagram-CIIHVFJN-DxfcocQu.js → vennDiagram-CIIHVFJN-CAcPzo7k.js} +1 -1
- package/dist/webdist/assets/{wardley-L42UT6IY-BnZ8BinJ.js → wardley-L42UT6IY-BPakyqHF.js} +1 -1
- package/dist/webdist/assets/{wardleyDiagram-YWT4CUSO-DMk9z7hr.js → wardleyDiagram-YWT4CUSO-DFeQJlAo.js} +1 -1
- package/dist/webdist/assets/wrench-BhEqkhsG.js +1 -0
- package/dist/webdist/assets/{xychartDiagram-2RQKCTM6-BUtTPXPF.js → xychartDiagram-2RQKCTM6-CmW19GSM.js} +1 -1
- package/dist/webdist/index.html +4 -4
- package/package.json +1 -1
- package/dist/webdist/assets/AgentsScreen-sMeMB3IQ.js +0 -2
- package/dist/webdist/assets/ChatScreen-rXB7PrWJ.js +0 -65
- package/dist/webdist/assets/CustomizeScreen-BBwvtk28.js +0 -4
- package/dist/webdist/assets/DeveloperScreen-fXV-qXB5.js +0 -1
- package/dist/webdist/assets/EnginesScreen-CrmYzhio.js +0 -7
- package/dist/webdist/assets/ModelDetailDialog-Dlt5uF3h.js +0 -1
- package/dist/webdist/assets/ModelDirs-BYN-DmHL.js +0 -1
- package/dist/webdist/assets/ModelsScreen-DncNvsj6.js +0 -2
- package/dist/webdist/assets/SettingsScreen-DXX3r4Ep.js +0 -1
- package/dist/webdist/assets/channel-Bt5-ol5R.js +0 -1
- package/dist/webdist/assets/check-jMeH6YsH.js +0 -1
- package/dist/webdist/assets/chevron-down-C5ZMFCtb.js +0 -1
- package/dist/webdist/assets/chevron-right-DNVnXbZ1.js +0 -1
- package/dist/webdist/assets/circle-check-qnghY_qF.js +0 -1
- package/dist/webdist/assets/circle-x-FM28MwOL.js +0 -1
- package/dist/webdist/assets/classDiagram-4FO5ZUOK-jfnUpxOr.js +0 -1
- package/dist/webdist/assets/classDiagram-v2-Q7XG4LA2-jfnUpxOr.js +0 -1
- package/dist/webdist/assets/collapsible-CwqYFc9v.js +0 -1
- package/dist/webdist/assets/common-BD4Wa3KL.js +0 -1
- package/dist/webdist/assets/copy-button-DypRNkqI.js +0 -1
- package/dist/webdist/assets/dialog-3hyZ9j4e.js +0 -1
- package/dist/webdist/assets/index-B_WtFoLC.css +0 -1
- package/dist/webdist/assets/index-CriwC5VH.js +0 -10
- package/dist/webdist/assets/pencil-CS33zp9q.js +0 -1
- package/dist/webdist/assets/personas-CzcXp8zg.js +0 -75
- package/dist/webdist/assets/plus-BO3vGy6f.js +0 -1
- package/dist/webdist/assets/refresh-cw-Cco9RapO.js +0 -1
- package/dist/webdist/assets/save-CSISNMk8.js +0 -1
- package/dist/webdist/assets/skeleton-CBRf-twG.js +0 -1
- package/dist/webdist/assets/stateDiagram-v2-BHNVJYJU-Ukx8AVKZ.js +0 -1
- package/dist/webdist/assets/vram-Dn53zt7R.js +0 -1
- package/dist/webdist/assets/wrench-Di5WLTz2.js +0 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{j as e}from"./radix-DHuxYtIT.js";import{b as D1,r as u,c as a0}from"./vendor-BE0HADM8.js";import{S as s0}from"./common-DHHaSVnF.js";import{g as n0,u as r0,a as l0,B as f,t as p,A as N,b as c0,d as o0,e as i0,s as q1,P as d0,f as m0,v as x0,L as D,X as _}from"./index-MBZ7hSNo.js";import{i as p0,a as n1,l as h0,f as u0}from"./agent-api-D3hMsrHk.js";import{P as O,S as U,W as R1}from"./wrench-BhEqkhsG.js";import{F as g0}from"./folder-input-CjdiPWWo.js";import{r as v0,g as f0,s as b0}from"./personas-BvApKJbI.js";import{B as B1}from"./bot-B3GTFQ2J.js";import{S as y0}from"./star-CGoRw01k.js";import{R as j0}from"./rotate-ccw-CjT25zbE.js";import{A as k0}from"./arrow-left-BZ7U2kS9.js";import{C as H1}from"./check-C39bHy3w.js";import{P as N0}from"./pencil-D52zQ528.js";import{T as C0}from"./trash-2-DtSyrOcz.js";import{C as S0}from"./chevron-right-DGQJG4QN.js";const z0=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],A0=n0("upload",z0),V=[{id:"tavily",name:"Tavily",desc:"AI-search API tuned for LLMs."},{id:"kagi",name:"Kagi",desc:"Premium search with no ads or tracking.",iconSlug:"kagi"},{id:"searxng",name:"SearXNG",desc:"Self-hosted meta-search, fully local — no API key required.",iconSlug:"searxng"}],F=[{id:"github",name:"GitHub",cat:"Dev Tools",desc:"Issues, PRs, code search, and repo management.",auth:"key",color:"#24292e",iconSlug:"github",url:"https://api.githubcopilot.com/mcp/",keyNote:"Use a GitHub Personal Access Token (PAT) from github.com → Settings → Developer settings → PATs."},{id:"linear",name:"Linear",cat:"Project Mgmt",desc:"Issues, projects, sprints, and cycles.",auth:"key",color:"#5e6ad2",iconSlug:"linear",url:"https://mcp.linear.app/mcp",keyNote:"Generate an API key at linear.app → Settings → API."},{id:"stripe",name:"Stripe",cat:"Payments",desc:"Charges, customers, and subscriptions.",auth:"key",color:"#4f46bf",iconSlug:"stripe",url:"https://mcp.stripe.com",keyNote:"Use a restricted key (rk_live_… or rk_test_…) from dashboard.stripe.com → Developers → API keys. Prefer restricted keys over secret keys."},{id:"atlassian",name:"Atlassian",cat:"Project Mgmt",desc:"Jira, Confluence, Bitbucket, and Compass.",auth:"key",color:"#0040a0",iconSlug:"atlassian",url:"https://mcp.atlassian.com/v1/mcp",keyNote:"Requires a service-account API key (Bearer). Personal API tokens use Basic auth and won't work here. Generate a service-account key from admin.atlassian.com → API keys."},{id:"neon",name:"Neon",cat:"Database",desc:"Serverless Postgres — branches and queries.",auth:"key",color:"#007a44",iconSlug:"neon",url:"https://mcp.neon.tech/mcp",keyNote:"Generate an API key at console.neon.tech → Account → API Keys."},{id:"supabase",name:"Supabase",cat:"Database",desc:"Tables, auth, storage, and edge functions.",auth:"key",color:"#136b46",iconSlug:"supabase",url:"https://mcp.supabase.com/mcp",keyNote:"Generate a personal access token at supabase.com → Account → Access Tokens."},{id:"cloudflare",name:"Cloudflare",cat:"Cloud",desc:"Workers, KV, D1, R2, and DNS management.",auth:"key",color:"#f48120",iconSlug:"cloudflare",url:"https://mcp.cloudflare.com/mcp",keyNote:"Create an API token at dash.cloudflare.com → Profile → API Tokens. Note: tokens with IP address filtering enabled do not work."},{id:"zapier",name:"Zapier",cat:"Automation",desc:"Trigger and query 7,000+ app automations.",auth:"key",color:"#ff4a00",iconSlug:"zapier",url:"https://mcp.zapier.com/api/v1/connect",keyNote:"Get a connection token from zapier.com/mcp — Zapier issues a per-server token that you paste here."},{id:"apify",name:"Apify",cat:"Automation",desc:"Run web scrapers, browse the web with RAG, and query Apify datasets.",auth:"key",color:"#00c45a",url:"https://mcp.apify.com",keyNote:"Get an API token at console.apify.com → Settings → API & Integrations."},{id:"mixpanel",name:"Mixpanel",cat:"Analytics",desc:"Query events, funnels, retention, and user profiles.",auth:"key",color:"#7856ff",iconSlug:"mixpanel",url:"https://mcp.mixpanel.com/mcp",keyNote:'Create a service account at mixpanel.com → Settings → Service Accounts, then run: echo -n "username:secret" | base64 — and paste "Basic <that-base64>" here (include the word Basic).'}],T=[{id:"filesystem",name:"Filesystem",cat:"File System",desc:"Read/write local files with a configurable path allow-list.",cmd:"npx -y @modelcontextprotocol/server-filesystem",envs:[],argNote:"Provide the directory path(s) to allow access to as command arguments."},{id:"memory",name:"Memory",cat:"AI",desc:"Persistent knowledge graph across sessions.",cmd:"npx -y @modelcontextprotocol/server-memory",envs:[]},{id:"brave",name:"Brave Search",cat:"Search",desc:"Web and news search via Brave Search API.",cmd:"npx -y @modelcontextprotocol/server-brave-search",iconSlug:"brave",envs:[{key:"BRAVE_API_KEY",desc:"From search.brave.com → API",required:!0}]},{id:"postgres",name:"PostgreSQL",cat:"Database",desc:"Natural-language queries against PostgreSQL.",cmd:"npx -y @modelcontextprotocol/server-postgres",iconSlug:"postgresql",envs:[],argNote:"Provide the connection string as an argument: postgresql://user:pass@host/db"},{id:"sqlite",name:"SQLite",cat:"Database",desc:"Query and inspect local SQLite databases.",cmd:"npx -y @modelcontextprotocol/server-sqlite",envs:[],argNote:"Provide the path to your .sqlite file as an argument."},{id:"puppeteer",name:"Puppeteer",cat:"Browser",desc:"Headless Chromium for screenshots and form automation.",cmd:"npx -y @modelcontextprotocol/server-puppeteer",iconSlug:"puppeteer",envs:[]},{id:"playwright",name:"Playwright",cat:"Browser",desc:"DOM-aware browser automation from Microsoft.",cmd:"npx @playwright/mcp@latest",envs:[]},{id:"sequential",name:"Sequential Thinking",cat:"AI",desc:"Dynamic step-by-step reasoning scaffold.",cmd:"npx -y @modelcontextprotocol/server-sequentialthinking",envs:[]},{id:"fetch",name:"Fetch",cat:"Web",desc:"Fetch any URL and convert to LLM-friendly markdown.",cmd:"uvx mcp-server-fetch",envs:[],uvx:!0},{id:"git",name:"Git",cat:"Dev Tools",desc:"Commit, diff, log, branch, and blame operations.",cmd:"uvx mcp-server-git",iconSlug:"git",envs:[],uvx:!0,argNote:"Provide --repository /path/to/your/repo as an argument."},{id:"gdrive",name:"Google Drive",cat:"File System",desc:"Search and read files from Google Drive.",cmd:"npx -y @modelcontextprotocol/server-google-drive",iconSlug:"googledrive",envs:[{key:"GDRIVE_CREDENTIALS_JSON",desc:"Path to your credentials.json file",required:!0}]},{id:"redis",name:"Redis",cat:"Database",desc:"Read and write Redis keys, hashes, lists, and streams.",cmd:"uvx mcp-server-redis",iconSlug:"redis",uvx:!0,envs:[{key:"REDIS_HOST",desc:"Redis host (default: localhost)",required:!1},{key:"REDIS_PORT",desc:"Redis port (default: 6379)",required:!1},{key:"REDIS_PASSWORD",desc:"Redis password if auth is enabled",required:!1}]},{id:"mysql",name:"MySQL",cat:"Database",desc:"Query and manage MySQL databases with natural language.",cmd:"uvx mcp-server-mysql",iconSlug:"mysql",uvx:!0,envs:[{key:"MYSQL_HOST",desc:"MySQL host (default: localhost)",required:!1},{key:"MYSQL_USER",desc:"Database user",required:!0},{key:"MYSQL_PASSWORD",desc:"Database password",required:!0},{key:"MYSQL_DATABASE",desc:"Target database name",required:!0}]},{id:"docker",name:"Docker",cat:"Dev Tools",desc:"Manage containers, images, volumes, and networks.",cmd:"uvx docker-mcp",iconSlug:"docker",uvx:!0,envs:[]},{id:"kubernetes",name:"Kubernetes",cat:"Dev Tools",desc:"Inspect pods, deployments, services, and cluster state.",cmd:"npx -y mcp-server-kubernetes",iconSlug:"kubernetes",envs:[]},{id:"excel",name:"Excel",cat:"Productivity",desc:"Read and write Excel (.xlsx) spreadsheet files.",cmd:"npx -y @negokaz/excel-mcp-server",envs:[],argNote:"Set EXCEL_FILE_PATH env var or pass the path as an argument."},{id:"pdf",name:"PDF Reader",cat:"File System",desc:"Extract text and metadata from local PDF files.",cmd:"npx -y @sylphlab/pdf-reader-mcp",envs:[]},{id:"youtube",name:"YouTube Transcript",cat:"Web",desc:"Fetch full transcripts from any YouTube video.",cmd:"uvx mcp-youtube-transcript",iconSlug:"youtube",uvx:!0,envs:[]},{id:"obsidian",name:"Obsidian",cat:"Productivity",desc:"Search and read notes from a local Obsidian vault.",cmd:"npx -y obsidian-mcp-server@latest",iconSlug:"obsidian",envs:[{key:"OBSIDIAN_API_KEY",desc:"From the Local REST API community plugin settings",required:!0},{key:"OBSIDIAN_HOST",desc:"Obsidian REST API host (default: localhost)",required:!1}]},{id:"comfyui",name:"ComfyUI MCP",cat:"AI",desc:"Control a local ComfyUI to generate images/video, run workflows, and download models.",cmd:"npx -y comfyui-mcp",envs:[{key:"COMFYUI_URL",desc:"ComfyUI server URL (default: http://127.0.0.1:8188)",required:!1},{key:"CIVITAI_API_TOKEN",desc:"For downloading models from CivitAI",required:!1},{key:"HUGGINGFACE_TOKEN",desc:"For downloading models from Hugging Face",required:!1}]}],w0=["All",...new Set(F.map(a=>a.cat))],M0=["All",...new Set(T.map(a=>a.cat))],r1={path:"M7.12 11.084a.683.683 0 00-1.16.126L.075 22.974a.703.703 0 00.63 1.018h8.19a.678.678 0 00.63-.39c1.767-3.65.696-9.203-2.406-12.52zM11.434.386a15.515 15.515 0 00-.906 15.317l3.95 7.9a.703.703 0 00.628.388h8.19a.703.703 0 00.63-1.017L12.63.38a.664.664 0 00-1.196.006z",hex:"0052CC"},l1={path:"M15.68 0l2.096 2.38s1.84-.512 2.709.358c.868.87 1.584 1.638 1.584 1.638l-.562 1.381.715 2.047s-2.104 7.98-2.35 8.955c-.486 1.919-.818 2.66-2.198 3.633-1.38.972-3.884 2.66-4.293 2.916-.409.256-.92.692-1.38.692-.46 0-.97-.436-1.38-.692a185.796 185.796 0 01-4.293-2.916c-1.38-.973-1.712-1.714-2.197-3.633-.247-.975-2.351-8.955-2.351-8.955l.715-2.047-.562-1.381s.716-.768 1.585-1.638c.868-.87 2.708-.358 2.708-.358L8.321 0h7.36zm-3.679 14.936c-.14 0-1.038.317-1.758.69-.72.373-1.242.637-1.409.742-.167.104-.065.301.087.409.152.107 2.194 1.69 2.393 1.866.198.175.489.464.687.464.198 0 .49-.29.688-.464.198-.175 2.24-1.759 2.392-1.866.152-.108.254-.305.087-.41-.167-.104-.689-.368-1.41-.741-.72-.373-1.617-.69-1.757-.69zm0-11.278s-.409.001-1.022.206-1.278.46-1.584.46c-.307 0-2.581-.434-2.581-.434S4.119 7.152 4.119 7.849c0 .697.339.881.68 1.243l2.02 2.149c.192.203.59.511.356 1.066-.235.555-.58 1.26-.196 1.977.384.716 1.042 1.194 1.464 1.115.421-.08 1.412-.598 1.776-.834.364-.237 1.518-1.19 1.518-1.554 0-.365-1.193-1.02-1.413-1.168-.22-.15-1.226-.725-1.247-.95-.02-.227-.012-.293.284-.851.297-.559.831-1.304.742-1.8-.089-.495-.95-.753-1.565-.986-.615-.232-1.799-.671-1.947-.74-.148-.068-.11-.133.339-.175.448-.043 1.719-.212 2.292-.052.573.16 1.552.403 1.632.532.079.13.149.134.067.579-.081.445-.5 2.581-.541 2.96-.04.38-.12.63.288.724.409.094 1.097.256 1.333.256s.924-.162 1.333-.256c.408-.093.329-.344.288-.723-.04-.38-.46-2.516-.541-2.961-.082-.445-.012-.45.067-.579.08-.129 1.059-.372 1.632-.532.573-.16 1.845.009 2.292.052.449.042.487.107.339.175-.148.069-1.332.508-1.947.74-.615.233-1.476.49-1.565.986-.09.496.445 1.241.742 1.8.297.558.304.624.284.85-.02.226-1.026.802-1.247.95-.22.15-1.413.804-1.413 1.169 0 .364 1.154 1.317 1.518 1.554.364.236 1.355.755 1.776.834.422.079 1.08-.4 1.464-1.115.384-.716.039-1.422-.195-1.977-.235-.555.163-.863.355-1.066l2.02-2.149c.341-.362.68-.546.68-1.243 0-.697-2.695-3.96-2.695-3.96s-2.274.436-2.58.436c-.307 0-.972-.256-1.585-.461-.613-.205-1.022-.206-1.022-.206z",hex:"FB542B"},c1={path:"M16.5088 16.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559 0 0 1-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489 2.1601-.8868 2.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039 0-4.6284 1.6177-5.3876 3.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665 1.083-2.2861 2.2856-.0283.31-.0069.6128.0635.894C1.5683 13.171 0 14.7754 0 16.752c0 .1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909 0 .1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771 0-.1611 0-.2383.0112-.0566 0-.1054.0415-.127.0976l-.3378 1.1744c-.1475.5068-.0918.9707.1543 1.3164.2256.3164.6055.498 1.0625.5195l1.8437.1133c.0557 0 .1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527 1.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771 0 .1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803 0-2.6025-2.125-4.727-4.7344-4.727",hex:"F38020"},o1={path:"M13.983 11.078h2.119a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.119a.185.185 0 00-.185.185v1.888c0 .102.083.185.185.185m-2.954-5.43h2.118a.186.186 0 00.186-.186V3.574a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m0 2.716h2.118a.187.187 0 00.186-.186V6.29a.186.186 0 00-.186-.185h-2.118a.185.185 0 00-.185.185v1.887c0 .102.082.185.185.186m-2.93 0h2.12a.186.186 0 00.184-.186V6.29a.185.185 0 00-.185-.185H8.1a.185.185 0 00-.185.185v1.887c0 .102.083.185.185.186m-2.964 0h2.119a.186.186 0 00.185-.186V6.29a.185.185 0 00-.185-.185H5.136a.186.186 0 00-.186.185v1.887c0 .102.084.185.186.186m5.893 2.715h2.118a.186.186 0 00.186-.185V9.006a.186.186 0 00-.186-.186h-2.118a.185.185 0 00-.185.185v1.888c0 .102.082.185.185.185m-2.93 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.083.185.185.185m-2.964 0h2.119a.185.185 0 00.185-.185V9.006a.185.185 0 00-.184-.186h-2.12a.186.186 0 00-.186.186v1.887c0 .102.084.185.186.185m-2.92 0h2.12a.185.185 0 00.184-.185V9.006a.185.185 0 00-.184-.186h-2.12a.185.185 0 00-.184.185v1.888c0 .102.082.185.185.185M23.763 9.89c-.065-.051-.672-.51-1.954-.51-.338.001-.676.03-1.01.087-.248-1.7-1.653-2.53-1.716-2.566l-.344-.199-.226.327c-.284.438-.49.922-.612 1.43-.23.97-.09 1.882.403 2.661-.595.332-1.55.413-1.744.42H.751a.751.751 0 00-.75.748 11.376 11.376 0 00.692 4.062c.545 1.428 1.355 2.48 2.41 3.124 1.18.723 3.1 1.137 5.275 1.137.983.003 1.963-.086 2.93-.266a12.248 12.248 0 003.823-1.389c.98-.567 1.86-1.288 2.61-2.136 1.252-1.418 1.998-2.997 2.553-4.4h.221c1.372 0 2.215-.549 2.68-1.009.309-.293.55-.65.707-1.046l.098-.288Z",hex:"2496ED"},i1={path:"M15.852 8.981h-4.588V0h4.588c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.491-4.49 4.491zM12.735 7.51h3.117c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-3.117V7.51zm0 1.471H8.148c-2.476 0-4.49-2.014-4.49-4.49S5.672 0 8.148 0h4.588v8.981zm-4.587-7.51c-1.665 0-3.019 1.355-3.019 3.019s1.354 3.02 3.019 3.02h3.117V1.471H8.148zm4.587 15.019H8.148c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h4.588v8.98zM8.148 8.981c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h3.117V8.981H8.148zM8.172 24c-2.489 0-4.515-2.014-4.515-4.49s2.014-4.49 4.49-4.49h4.588v4.441c0 2.503-2.047 4.539-4.563 4.539zm-.024-7.51a3.023 3.023 0 0 0-3.019 3.019c0 1.665 1.365 3.019 3.044 3.019 1.705 0 3.093-1.376 3.093-3.068v-2.97H8.148zm7.704 0h-.098c-2.476 0-4.49-2.014-4.49-4.49s2.014-4.49 4.49-4.49h.098c2.476 0 4.49 2.014 4.49 4.49s-2.014 4.49-4.49 4.49zm-.097-7.509c-1.665 0-3.019 1.355-3.019 3.019s1.355 3.019 3.019 3.019h.098c1.665 0 3.019-1.355 3.019-3.019s-1.355-3.019-3.019-3.019h-.098z",hex:"F24E1E"},d1={path:"M13.09 23.549a1.54 1.54 0 0 1-2.18 0L.451 13.089a1.54 1.54 0 0 1 0-2.179l7.191-7.19 2.733 2.733a1.85 1.85 0 0 0 .964 2.326v6.66a1.849 1.849 0 1 0 1.54 0V8.957l2.508 2.508a1.85 1.85 0 1 0 1.09-1.09l-2.634-2.634a1.85 1.85 0 0 0-2.378-2.377L8.73 2.63 10.91.451a1.54 1.54 0 0 1 2.179 0l10.459 10.46a1.54 1.54 0 0 1 0 2.179z",hex:"F03C2E"},m1={path:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12",hex:"181717"},x1={path:"M12.48 10.92v3.28h7.84c-.24 1.84-.853 3.187-1.787 4.133-1.147 1.147-2.933 2.4-6.053 2.4-4.827 0-8.6-3.893-8.6-8.72s3.773-8.72 8.6-8.72c2.6 0 4.507 1.027 5.907 2.347l2.307-2.307C18.747 1.44 16.133 0 12.48 0 5.867 0 .307 5.387.307 12s5.56 12 12.173 12c3.573 0 6.267-1.173 8.373-3.36 2.16-2.16 2.84-5.213 2.84-7.667 0-.76-.053-1.467-.173-2.053H12.48z",hex:"4285F4"},p1={path:"M12.01 1.485c-2.082 0-3.754.02-3.743.047.01.02 1.708 3.001 3.774 6.62l3.76 6.574h3.76c2.081 0 3.753-.02 3.742-.047-.005-.02-1.708-3.001-3.775-6.62l-3.76-6.574zm-4.76 1.73a789.828 789.861 0 0 0-3.63 6.319L0 15.868l1.89 3.298 1.885 3.297 3.62-6.335 3.618-6.33-1.88-3.287C8.1 4.704 7.255 3.22 7.25 3.214zm2.259 12.653-.203.348c-.114.198-.96 1.672-1.88 3.287a423.93 423.948 0 0 1-1.698 2.97c-.01.026 3.24.042 7.222.042h7.244l1.796-3.157c.992-1.734 1.85-3.23 1.906-3.323l.104-.167h-7.249z",hex:"4285F4"},h1={path:"M18.164 7.93V5.084a2.198 2.198 0 001.267-1.978v-.067A2.2 2.2 0 0017.238.845h-.067a2.2 2.2 0 00-2.193 2.193v.067a2.196 2.196 0 001.252 1.973l.013.006v2.852a6.22 6.22 0 00-2.969 1.31l.012-.01-7.828-6.095A2.497 2.497 0 104.3 4.656l-.012.006 7.697 5.991a6.176 6.176 0 00-1.038 3.446c0 1.343.425 2.588 1.147 3.607l-.013-.02-2.342 2.343a1.968 1.968 0 00-.58-.095h-.002a2.033 2.033 0 102.033 2.033 1.978 1.978 0 00-.1-.595l.005.014 2.317-2.317a6.247 6.247 0 104.782-11.134l-.036-.005zm-.964 9.378a3.206 3.206 0 113.215-3.207v.002a3.206 3.206 0 01-3.207 3.207z",hex:"FF7A59"},u1={path:"M14.4829 18.392h-5.109c-1.3827 0-1.6231-1.5076-1.3827-2.1106.1203-.3015.4208-.7236.6612-1.0251.9618.5427 2.1039.8442 3.306.8442 3.847 0 6.9126-3.1357 6.9126-6.9347 0-2.0502-.9016-3.8593-2.2843-5.186l.1805-.1808c.3605-.3618.9016-.603 1.4426-.5427l.8414.0603V0h-1.4425c-1.683 0-3.0656 1.0251-3.6667 2.4724-.6011-.181-1.2622-.3016-1.9234-.3016-3.847 0-6.9126 3.1357-6.9126 6.9347 0 1.5076.481 2.9548 1.3225 4.1005-.1203.1206-.3005.2412-.4208.3015l-.1803.181c-1.3826 1.3266-2.0436 3.015-1.6832 4.9448.1805 1.025 1.0821 2.1105 1.9838 2.7134.601.4222 1.3824.6031 2.1637.6031l5.7706-.2413c.6612 0 1.2623.3015 1.6228.9046L16.4065 24l3.5464-1.206-.6011-1.3268c-.9016-1.8692-2.765-3.0752-4.869-3.0752M12.0186 5.8493c1.8033 0 3.306 1.5075 3.306 3.3165s-1.5027 3.3166-3.306 3.3166-3.306-1.5075-3.306-3.3166c0-1.8693 1.4426-3.3166 3.306-3.3166",hex:"FFB319"},g1={path:"M10.204 14.35l.007.01-.999 2.413a5.171 5.171 0 0 1-2.075-2.597l2.578-.437.004.005a.44.44 0 0 1 .484.606zm-.833-2.129a.44.44 0 0 0 .173-.756l.002-.011L7.585 9.7a5.143 5.143 0 0 0-.73 3.255l2.514-.725.002-.009zm1.145-1.98a.44.44 0 0 0 .699-.337l.01-.005.15-2.62a5.144 5.144 0 0 0-3.01 1.442l2.147 1.523.004-.002zm.76 2.75l.723.349.722-.347.18-.78-.5-.623h-.804l-.5.623.179.779zm1.5-3.095a.44.44 0 0 0 .7.336l.008.003 2.134-1.513a5.188 5.188 0 0 0-2.992-1.442l.148 2.615.002.001zm10.876 5.97l-5.773 7.181a1.6 1.6 0 0 1-1.248.594l-9.261.003a1.6 1.6 0 0 1-1.247-.596l-5.776-7.18a1.583 1.583 0 0 1-.307-1.34L2.1 5.573c.108-.47.425-.864.863-1.073L11.305.513a1.606 1.606 0 0 1 1.385 0l8.345 3.985c.438.209.755.604.863 1.073l2.062 8.955c.108.47-.005.963-.308 1.34zm-3.289-2.057c-.042-.01-.103-.026-.145-.034-.174-.033-.315-.025-.479-.038-.35-.037-.638-.067-.895-.148-.105-.04-.18-.165-.216-.216l-.201-.059a6.45 6.45 0 0 0-.105-2.332 6.465 6.465 0 0 0-.936-2.163c.052-.047.15-.133.177-.159.008-.09.001-.183.094-.282.197-.185.444-.338.743-.522.142-.084.273-.137.415-.242.032-.024.076-.062.11-.089.24-.191.295-.52.123-.736-.172-.216-.506-.236-.745-.045-.034.027-.08.062-.111.088-.134.116-.217.23-.33.35-.246.25-.45.458-.673.609-.097.056-.239.037-.303.033l-.19.135a6.545 6.545 0 0 0-4.146-2.003l-.012-.223c-.065-.062-.143-.115-.163-.25-.022-.268.015-.557.057-.905.023-.163.061-.298.068-.475.001-.04-.001-.099-.001-.142 0-.306-.224-.555-.5-.555-.275 0-.499.249-.499.555l.001.014c0 .041-.002.092 0 .128.006.177.044.312.067.475.042.348.078.637.056.906a.545.545 0 0 1-.162.258l-.012.211a6.424 6.424 0 0 0-4.166 2.003 8.373 8.373 0 0 1-.18-.128c-.09.012-.18.04-.297-.029-.223-.15-.427-.358-.673-.608-.113-.12-.195-.234-.329-.349-.03-.026-.077-.062-.111-.088a.594.594 0 0 0-.348-.132.481.481 0 0 0-.398.176c-.172.216-.117.546.123.737l.007.005.104.083c.142.105.272.159.414.242.299.185.546.338.743.522.076.082.09.226.1.288l.16.143a6.462 6.462 0 0 0-1.02 4.506l-.208.06c-.055.072-.133.184-.215.217-.257.081-.546.11-.895.147-.164.014-.305.006-.48.039-.037.007-.09.02-.133.03l-.004.002-.007.002c-.295.071-.484.342-.423.608.061.267.349.429.645.365l.007-.001.01-.003.129-.029c.17-.046.294-.113.448-.172.33-.118.604-.217.87-.256.112-.009.23.069.288.101l.217-.037a6.5 6.5 0 0 0 2.88 3.596l-.09.218c.033.084.069.199.044.282-.097.252-.263.517-.452.813-.091.136-.185.242-.268.399-.02.037-.045.095-.064.134-.128.275-.034.591.213.71.248.12.556-.007.69-.282v-.002c.02-.039.046-.09.062-.127.07-.162.094-.301.144-.458.132-.332.205-.68.387-.897.05-.06.13-.082.215-.105l.113-.205a6.453 6.453 0 0 0 4.609.012l.106.192c.086.028.18.042.256.155.136.232.229.507.342.84.05.156.074.295.145.457.016.037.043.09.062.129.133.276.442.402.69.282.247-.118.341-.435.213-.71-.02-.039-.045-.096-.065-.134-.083-.156-.177-.261-.268-.398-.19-.296-.346-.541-.443-.793-.04-.13.007-.21.038-.294-.018-.022-.059-.144-.083-.202a6.499 6.499 0 0 0 2.88-3.622c.064.01.176.03.213.038.075-.05.144-.114.28-.104.266.039.54.138.87.256.154.06.277.128.448.173.036.01.088.019.13.028l.009.003.007.001c.297.064.584-.098.645-.365.06-.266-.128-.537-.423-.608zM16.4 9.701l-1.95 1.746v.005a.44.44 0 0 0 .173.757l.003.01 2.526.728a5.199 5.199 0 0 0-.108-1.674A5.208 5.208 0 0 0 16.4 9.7zm-4.013 5.325a.437.437 0 0 0-.404-.232.44.44 0 0 0-.372.233h-.002l-1.268 2.292a5.164 5.164 0 0 0 3.326.003l-1.27-2.296h-.01zm1.888-1.293a.44.44 0 0 0-.27.036.44.44 0 0 0-.214.572l-.003.004 1.01 2.438a5.15 5.15 0 0 0 2.081-2.615l-2.6-.44-.004.005z",hex:"326CE5"},v1={path:"M2.886 4.18A11.982 11.982 0 0 1 11.99 0C18.624 0 24 5.376 24 12.009c0 3.64-1.62 6.903-4.18 9.105L2.887 4.18ZM1.817 5.626l16.556 16.556c-.524.33-1.075.62-1.65.866L.951 7.277c.247-.575.537-1.126.866-1.65ZM.322 9.163l14.515 14.515c-.71.172-1.443.282-2.195.322L0 11.358a12 12 0 0 1 .322-2.195Zm-.17 4.862 9.823 9.824a12.02 12.02 0 0 1-9.824-9.824Z",hex:"5E6AD2"},f1={path:"M6.967 9.996h3.053c-.763-.477-1.048-1.145-1.431-2.384L7.443 3.366C6.919 1.458 6.49.551 4.39.551H.004v1.145h.621c1.286 0 1.431.477 1.814 1.908L3.44 7.326c.524 1.814 1.337 2.67 3.53 2.67h-.003Zm7.06 0h3.053c2.194 0 2.956-.86 3.484-2.67l1.001-3.722c.382-1.431.57-1.908 1.814-1.908H24V.551h-4.34c-2.146 0-2.576.86-3.053 2.815l-1.145 4.246c-.384 1.286-.673 1.907-1.435 2.384Zm-4.007 4.008h4.007V9.996H10.02v4.008ZM0 23.449h4.39c2.1 0 2.529-.907 3.053-2.815l1.146-4.246c.383-1.239.668-1.907 1.431-2.384H6.967c-2.194 0-3.007.86-3.531 2.67l-1.001 3.722c-.383 1.431-.524 1.907-1.814 1.907H0v1.146Zm19.65 0h4.343v-1.146h-.622c-1.239 0-1.431-.476-1.814-1.907l-1.001-3.722c-.524-1.814-1.286-2.67-3.483-2.67h-3.046c.762.477 1.041 1.098 1.424 2.384l1.145 4.246c.477 1.955.907 2.815 3.054 2.815Z",hex:"7856FF"},b1={path:"M17.193 9.555c-1.264-5.58-4.252-7.414-4.573-8.115-.28-.394-.53-.954-.735-1.44-.036.495-.055.685-.523 1.184-.723.566-4.438 3.682-4.74 10.02-.282 5.912 4.27 9.435 4.888 9.884l.07.05A73.49 73.49 0 0111.91 24h.481c.114-1.032.284-2.056.51-3.07.417-.296.604-.463.85-.693a11.342 11.342 0 003.639-8.464c.01-.814-.103-1.662-.197-2.218zm-5.336 8.195s0-8.291.275-8.29c.213 0 .49 10.695.49 10.695-.381-.045-.765-1.76-.765-2.405z",hex:"47A248"},y1={path:"M16.405 5.501c-.115 0-.193.014-.274.033v.013h.014c.054.104.146.18.214.273.054.107.1.214.154.32l.014-.015c.094-.066.14-.172.14-.333-.04-.047-.046-.094-.08-.14-.04-.067-.126-.1-.18-.153zM5.77 18.695h-.927a50.854 50.854 0 00-.27-4.41h-.008l-1.41 4.41H2.45l-1.4-4.41h-.01a72.892 72.892 0 00-.195 4.41H0c.055-1.966.192-3.81.41-5.53h1.15l1.335 4.064h.008l1.347-4.064h1.095c.242 2.015.384 3.86.428 5.53zm4.017-4.08c-.378 2.045-.876 3.533-1.492 4.46-.482.716-1.01 1.073-1.583 1.073-.153 0-.34-.046-.566-.138v-.494c.11.017.24.026.386.026.268 0 .483-.075.647-.222.197-.18.295-.382.295-.605 0-.155-.077-.47-.23-.944L6.23 14.615h.91l.727 2.36c.164.536.233.91.205 1.123.4-1.064.678-2.227.835-3.483zm12.325 4.08h-2.63v-5.53h.885v4.85h1.745zm-3.32.135l-1.016-.5c.09-.076.177-.158.255-.25.433-.506.648-1.258.648-2.253 0-1.83-.718-2.746-2.155-2.746-.704 0-1.254.232-1.65.697-.43.508-.646 1.256-.646 2.245 0 .972.19 1.686.574 2.14.35.41.877.615 1.583.615.264 0 .506-.033.725-.098l1.325.772.36-.622zM15.5 17.588c-.225-.36-.337-.94-.337-1.736 0-1.393.424-2.09 1.27-2.09.443 0 .77.167.977.5.224.362.336.936.336 1.723 0 1.404-.424 2.108-1.27 2.108-.445 0-.77-.167-.978-.5zm-1.658-.425c0 .47-.172.856-.516 1.156-.344.3-.803.45-1.384.45-.543 0-1.064-.172-1.573-.515l.237-.476c.438.22.833.328 1.19.328.332 0 .593-.073.783-.22a.754.754 0 00.3-.615c0-.33-.23-.61-.648-.845-.388-.213-1.163-.657-1.163-.657-.422-.307-.632-.636-.632-1.177 0-.45.157-.81.47-1.085.315-.278.72-.415 1.22-.415.512 0 .98.136 1.4.41l-.213.476a2.726 2.726 0 00-1.064-.23c-.283 0-.502.068-.654.206a.685.685 0 00-.248.524c0 .328.234.61.666.85.393.215 1.187.67 1.187.67.433.305.648.63.648 1.168zm9.382-5.852c-.535-.014-.95.04-1.297.188-.1.04-.26.04-.274.167.055.053.063.14.11.214.08.134.218.313.346.407.14.11.28.216.427.31.26.16.555.255.81.416.145.094.293.213.44.313.073.05.12.14.214.172v-.02c-.046-.06-.06-.147-.105-.214-.067-.067-.134-.127-.2-.193a3.223 3.223 0 00-.695-.675c-.214-.146-.682-.35-.77-.595l-.013-.014c.146-.013.32-.066.46-.106.227-.06.435-.047.67-.106.106-.027.213-.06.32-.094v-.06c-.12-.12-.21-.283-.334-.395a8.867 8.867 0 00-1.104-.823c-.21-.134-.476-.22-.697-.334-.08-.04-.214-.06-.26-.127-.12-.146-.19-.34-.275-.514a17.69 17.69 0 01-.547-1.163c-.12-.262-.193-.523-.34-.763-.69-1.137-1.437-1.826-2.586-2.5-.247-.14-.543-.2-.856-.274-.167-.008-.334-.02-.5-.027-.11-.047-.216-.174-.31-.235-.38-.24-1.364-.76-1.644-.072-.18.434.267.862.422 1.082.115.153.26.328.34.5.047.116.06.235.107.356.106.294.207.622.347.897.073.14.153.287.247.413.054.073.146.107.167.227-.094.136-.1.334-.154.5-.24.757-.146 1.693.194 2.25.107.166.362.534.703.393.3-.12.234-.5.32-.835.02-.08.007-.133.048-.187v.015c.094.188.188.367.274.555.206.328.566.668.867.895.16.12.287.328.487.402v-.02h-.015c-.043-.058-.1-.086-.154-.133a3.445 3.445 0 01-.35-.4 8.76 8.76 0 01-.747-1.218c-.11-.21-.202-.436-.29-.643-.04-.08-.04-.2-.107-.24-.1.146-.247.273-.32.453-.127.288-.14.642-.188 1.01-.027.007-.014 0-.027.014-.214-.052-.287-.274-.367-.46-.2-.475-.233-1.238-.06-1.785.047-.14.247-.582.167-.716-.042-.127-.174-.2-.247-.303a2.478 2.478 0 01-.24-.427c-.16-.374-.24-.788-.414-1.162-.08-.173-.22-.354-.334-.513-.127-.18-.267-.307-.368-.52-.033-.073-.08-.194-.027-.274.014-.054.042-.075.094-.09.088-.072.335.022.422.062.247.1.455.194.662.334.094.066.195.193.315.226h.14c.214.047.455.014.655.073.355.114.675.28.962.46a5.953 5.953 0 012.085 2.286c.08.154.115.295.188.455.14.33.313.663.455.982.14.315.275.636.476.897.1.14.502.213.682.286.133.06.34.115.46.188.23.14.454.3.67.454.11.076.443.243.463.378z",hex:"4479A1"},j1={path:"M24 0V24l-9.365-8.045V24H0V0ZM2.942 21.087h8.751V9.563l9.365 8.204V2.919L2.942 2.914Z",hex:"34D59A"},k1={path:"M4.459 4.208c.746.606 1.026.56 2.428.466l13.215-.793c.28 0 .047-.28-.046-.326L17.86 1.968c-.42-.326-.981-.7-2.055-.607L3.01 2.295c-.466.046-.56.28-.374.466zm.793 3.08v13.904c0 .747.373 1.027 1.214.98l14.523-.84c.841-.046.935-.56.935-1.167V6.354c0-.606-.233-.933-.748-.887l-15.177.887c-.56.047-.747.327-.747.933zm14.337.745c.093.42 0 .84-.42.888l-.7.14v10.264c-.608.327-1.168.514-1.635.514-.748 0-.935-.234-1.495-.933l-4.577-7.186v6.952L12.21 19s0 .84-1.168.84l-3.222.186c-.093-.186 0-.653.327-.746l.84-.233V9.854L7.822 9.76c-.094-.42.14-1.026.793-1.073l3.456-.233 4.764 7.279v-6.44l-1.215-.139c-.093-.514.28-.887.747-.933zM1.936 1.035l13.31-.98c1.634-.14 2.055-.047 3.082.7l4.249 2.986c.7.513.934.653.934 1.213v16.378c0 1.026-.373 1.634-1.68 1.726l-15.458.934c-.98.047-1.448-.093-1.962-.747l-3.129-4.06c-.56-.747-.793-1.306-.793-1.96V2.667c0-.839.374-1.54 1.447-1.632z",hex:"000000"},N1={path:"M19.355 18.538a68.967 68.959 0 0 0 1.858-2.954.81.81 0 0 0-.062-.9c-.516-.685-1.504-2.075-2.042-3.362-.553-1.321-.636-3.375-.64-4.377a1.707 1.707 0 0 0-.358-1.05l-3.198-4.064a3.744 3.744 0 0 1-.076.543c-.106.503-.307 1.004-.536 1.5-.134.29-.29.6-.446.914l-.31.626c-.516 1.068-.997 2.227-1.132 3.59-.124 1.26.046 2.73.815 4.481.128.011.257.025.386.044a6.363 6.363 0 0 1 3.326 1.505c.916.79 1.744 1.922 2.415 3.5zM8.199 22.569c.073.012.146.02.22.02.78.024 2.095.092 3.16.29.87.16 2.593.64 4.01 1.055 1.083.316 2.198-.548 2.355-1.664.114-.814.33-1.735.725-2.58l-.01.005c-.67-1.87-1.522-3.078-2.416-3.849a5.295 5.295 0 0 0-2.778-1.257c-1.54-.216-2.952.19-3.84.45.532 2.218.368 4.829-1.425 7.531zM5.533 9.938c-.023.1-.056.197-.098.29L2.82 16.059a1.602 1.602 0 0 0 .313 1.772l4.116 4.24c2.103-3.101 1.796-6.02.836-8.3-.728-1.73-1.832-3.081-2.55-3.831zM9.32 14.01c.615-.183 1.606-.465 2.745-.534-.683-1.725-.848-3.233-.716-4.577.154-1.552.7-2.847 1.235-3.95.113-.235.223-.454.328-.664.149-.297.288-.577.419-.86.217-.47.379-.885.46-1.27.08-.38.08-.72-.014-1.043-.095-.325-.297-.675-.68-1.06a1.6 1.6 0 0 0-1.475.36l-4.95 4.452a1.602 1.602 0 0 0-.513.952l-.427 2.83c.672.59 2.328 2.316 3.335 4.711.09.21.175.43.253.653z",hex:"7C3AED"},C1={path:"M23.5594 14.7228a.5269.5269 0 0 0-.0563-.1191c-.139-.2632-.4768-.3418-1.0074-.2321-1.6533.3411-2.2935.1312-2.5256-.0191 1.342-2.0482 2.445-4.522 3.0411-6.8297.2714-1.0507.7982-3.5237.1222-4.7316a1.5641 1.5641 0 0 0-.1509-.235C21.6931.9086 19.8007.0248 17.5099.0005c-1.4947-.0158-2.7705.3461-3.1161.4794a9.449 9.449 0 0 0-.5159-.0816 8.044 8.044 0 0 0-1.3114-.1278c-1.1822-.0184-2.2038.2642-3.0498.8406-.8573-.3211-4.7888-1.645-7.2219.0788C.9359 2.1526.3086 3.8733.4302 6.3043c.0409.818.5069 3.334 1.2423 5.7436.4598 1.5065.9387 2.7019 1.4334 3.582.553.9942 1.1259 1.5933 1.7143 1.7895.4474.1491 1.1327.1441 1.8581-.7279.8012-.9635 1.5903-1.8258 1.9446-2.2069.4351.2355.9064.3625 1.39.3772a.0569.0569 0 0 0 .0004.0041 11.0312 11.0312 0 0 0-.2472.3054c-.3389.4302-.4094.5197-1.5002.7443-.3102.064-1.1344.2339-1.1464.8115-.0025.1224.0329.2309.0919.3268.2269.4231.9216.6097 1.015.6331 1.3345.3335 2.5044.092 3.3714-.6787-.017 2.231.0775 4.4174.3454 5.0874.2212.5529.7618 1.9045 2.4692 1.9043.2505 0 .5263-.0291.8296-.0941 1.7819-.3821 2.5557-1.1696 2.855-2.9059.1503-.8707.4016-2.8753.5388-4.1012.0169-.0703.0357-.1207.057-.1362.0007-.0005.0697-.0471.4272.0307a.3673.3673 0 0 0 .0443.0068l.2539.0223.0149.001c.8468.0384 1.9114-.1426 2.5312-.4308.6438-.2988 1.8057-1.0323 1.5951-1.6698zM2.371 11.8765c-.7435-2.4358-1.1779-4.8851-1.2123-5.5719-.1086-2.1714.4171-3.6829 1.5623-4.4927 1.8367-1.2986 4.8398-.5408 6.108-.13-.0032.0032-.0066.0061-.0098.0094-2.0238 2.044-1.9758 5.536-1.9708 5.7495-.0002.0823.0066.1989.0162.3593.0348.5873.0996 1.6804-.0735 2.9184-.1609 1.1504.1937 2.2764.9728 3.0892.0806.0841.1648.1631.2518.2374-.3468.3714-1.1004 1.1926-1.9025 2.1576-.5677.6825-.9597.5517-1.0886.5087-.3919-.1307-.813-.5871-1.2381-1.3223-.4796-.839-.9635-2.0317-1.4155-3.5126zm6.0072 5.0871c-.1711-.0428-.3271-.1132-.4322-.1772.0889-.0394.2374-.0902.4833-.1409 1.2833-.2641 1.4815-.4506 1.9143-1.0002.0992-.126.2116-.2687.3673-.4426a.3549.3549 0 0 0 .0737-.1298c.1708-.1513.2724-.1099.4369-.0417.156.0646.3078.26.3695.4752.0291.1016.0619.2945-.0452.4444-.9043 1.2658-2.2216 1.2494-3.1676 1.0128zm2.094-3.988-.0525.141c-.133.3566-.2567.6881-.3334 1.003-.6674-.0021-1.3168-.2872-1.8105-.8024-.6279-.6551-.9131-1.5664-.7825-2.5004.1828-1.3079.1153-2.4468.079-3.0586-.005-.0857-.0095-.1607-.0122-.2199.2957-.2621 1.6659-.9962 2.6429-.7724.4459.1022.7176.4057.8305.928.5846 2.7038.0774 3.8307-.3302 4.7363-.084.1866-.1633.3629-.2311.5454zm7.3637 4.5725c-.0169.1768-.0358.376-.0618.5959l-.146.4383a.3547.3547 0 0 0-.0182.1077c-.0059.4747-.054.6489-.115.8693-.0634.2292-.1353.4891-.1794 1.0575-.11 1.4143-.8782 2.2267-2.4172 2.5565-1.5155.3251-1.7843-.4968-2.0212-1.2217a6.5824 6.5824 0 0 0-.0769-.2266c-.2154-.5858-.1911-1.4119-.1574-2.5551.0165-.5612-.0249-1.9013-.3302-2.6462.0044-.2932.0106-.5909.019-.8918a.3529.3529 0 0 0-.0153-.1126 1.4927 1.4927 0 0 0-.0439-.208c-.1226-.4283-.4213-.7866-.7797-.9351-.1424-.059-.4038-.1672-.7178-.0869.067-.276.1831-.5875.309-.9249l.0529-.142c.0595-.16.134-.3257.213-.5012.4265-.9476 1.0106-2.2453.3766-5.1772-.2374-1.0981-1.0304-1.6343-2.2324-1.5098-.7207.0746-1.3799.3654-1.7088.5321a5.6716 5.6716 0 0 0-.1958.1041c.0918-1.1064.4386-3.1741 1.7357-4.4823a4.0306 4.0306 0 0 1 .3033-.276.3532.3532 0 0 0 .1447-.0644c.7524-.5706 1.6945-.8506 2.802-.8325.4091.0067.8017.0339 1.1742.081 1.939.3544 3.2439 1.4468 4.0359 2.3827.8143.9623 1.2552 1.9315 1.4312 2.4543-1.3232-.1346-2.2234.1268-2.6797.779-.9926 1.4189.543 4.1729 1.2811 5.4964.1353.2426.2522.4522.2889.5413.2403.5825.5515.9713.7787 1.2552.0696.087.1372.1714.1885.245-.4008.1155-1.1208.3825-1.0552 1.717-.0123.1563-.0423.4469-.0834.8148-.0461.2077-.0702.4603-.0994.7662zm.8905-1.6211c-.0405-.8316.2691-.9185.5967-1.0105a2.8566 2.8566 0 0 0 .135-.0406 1.202 1.202 0 0 0 .1342.103c.5703.3765 1.5823.4213 3.0068.1344-.2016.1769-.5189.3994-.9533.6011-.4098.1903-1.0957.333-1.7473.3636-.7197.0336-1.0859-.0807-1.1721-.151zm.5695-9.2712c-.0059.3508-.0542.6692-.1054 1.0017-.055.3576-.112.7274-.1264 1.1762-.0142.4368.0404.8909.0932 1.3301.1066.887.216 1.8003-.2075 2.7014a3.5272 3.5272 0 0 1-.1876-.3856c-.0527-.1276-.1669-.3326-.3251-.6162-.6156-1.1041-2.0574-3.6896-1.3193-4.7446.3795-.5427 1.3408-.5661 2.1781-.463zm.2284 7.0137a12.3762 12.3762 0 0 0-.0853-.1074l-.0355-.0444c.7262-1.1995.5842-2.3862.4578-3.4385-.0519-.4318-.1009-.8396-.0885-1.2226.0129-.4061.0666-.7543.1185-1.0911.0639-.415.1288-.8443.1109-1.3505.0134-.0531.0188-.1158.0118-.1902-.0457-.4855-.5999-1.938-1.7294-3.253-.6076-.7073-1.4896-1.4972-2.6889-2.0395.5251-.1066 1.2328-.2035 2.0244-.1859 2.0515.0456 3.6746.8135 4.8242 2.2824a.908.908 0 0 1 .0667.1002c.7231 1.3556-.2762 6.2751-2.9867 10.5405zm-8.8166-6.1162c-.025.1794-.3089.4225-.6211.4225a.5821.5821 0 0 1-.0809-.0056c-.1873-.026-.3765-.144-.5059-.3156-.0458-.0605-.1203-.178-.1055-.2844.0055-.0401.0261-.0985.0925-.1488.1182-.0894.3518-.1226.6096-.0867.3163.0441.6426.1938.6113.4186zm7.9305-.4114c.0111.0792-.049.201-.1531.3102-.0683.0717-.212.1961-.4079.2232a.5456.5456 0 0 1-.075.0052c-.2935 0-.5414-.2344-.5607-.3717-.024-.1765.2641-.3106.5611-.352.297-.0414.6111.0088.6356.1851z",hex:"4169E1"},S1={path:"M17.89 17.86h.397v.174h.028a.466.466 0 0 1 .619-.155l-.11.373a.364.364 0 0 0-.184-.043.288.288 0 0 0-.243.11.471.471 0 0 0-.082.29v.635h-.424zm-.26 1.048a.766.766 0 0 1-.27.28.741.741 0 0 1-.398.101.822.822 0 0 1-.3-.054.752.752 0 0 1-.237-.155.704.704 0 0 1-.214-.529c0-.1.018-.194.056-.282a.719.719 0 0 1 .156-.235.725.725 0 0 1 .529-.22.75.75 0 0 1 .302.056.642.642 0 0 1 .353.384.846.846 0 0 1 .037.402h-1.02c.02.09.063.156.127.198a.387.387 0 0 0 .214.062.345.345 0 0 0 .32-.18zm-.376-.54a.227.227 0 0 0-.03-.074.21.21 0 0 0-.058-.07.264.264 0 0 0-.093-.054.325.325 0 0 0-.43.198zm-1.242.54a.766.766 0 0 1-.27.28.741.741 0 0 1-.397.101.822.822 0 0 1-.3-.054.752.752 0 0 1-.237-.155.704.704 0 0 1-.215-.529c0-.1.019-.194.057-.282a.719.719 0 0 1 .155-.235.725.725 0 0 1 .529-.22c.115 0 .215.018.302.056a.642.642 0 0 1 .353.384.846.846 0 0 1 .037.402h-1.02c.02.09.063.156.127.198a.387.387 0 0 0 .215.062.345.345 0 0 0 .32-.18zm-.376-.54a.227.227 0 0 0-.028-.074.21.21 0 0 0-.06-.07.264.264 0 0 0-.093-.054.325.325 0 0 0-.43.198zm-1.918-.144l-.243-.004.004-.388.25.012-.007-.41.412.004-.016.39.367.02-.012.355-.365.008.013.47c-.012.092.022.145.027.194.08.1.137.068.137.068.02-.008.162-.027.177-.038l.04.388c-.138.082-.377.036-.377.036-.253-.037-.383-.217-.384-.293-.025-.068-.018-.21-.029-.29zm-.412.717c-.037.126-.172.218-.283.285a.772.772 0 0 1-.406.11.944.944 0 0 1-.32-.077c-.09-.038-.165-.113-.233-.18-.068-.065-.093-.142-.131-.23a.822.822 0 0 1-.045-.31c-.015-.194.126-.378.212-.505.28-.238.49-.22.49-.22.387-.075.696.288.718.437.03.086.022.18.022.28-.005.054 0 .05-.031.125h-1.037c.02.09.063.192.104.24.048.06.128.06.207.06.079 0 .163.002.214-.032.053-.034.172-.072.203-.125zm-.37-.558a.41.41 0 0 0-.04-.097c-.014-.026-.05-.046-.076-.066-.024-.023-.071-.037-.109-.05a.31.31 0 0 0-.121-.023.274.274 0 0 0-.168.053c-.057.037-.097.12-.123.19zm-2.34-.372h.028a.388.388 0 0 1 .147-.138.498.498 0 0 1 .254-.06.623.623 0 0 1 .467.207.696.696 0 0 1 .147.232c.036.09.053.19.053.3a.8.8 0 0 1-.053.3.729.729 0 0 1-.147.234.647.647 0 0 1-.467.203.518.518 0 0 1-.254-.056.409.409 0 0 1-.147-.142h-.028l.028.198v.565H10.2V17.86h.396zm.336.198a.34.34 0 0 0-.31.201.37.37 0 0 0-.026.141c0 .053.008.101.025.145a.362.362 0 0 0 .074.107c.032.028.068.05.107.068a.378.378 0 0 0 .257 0 .348.348 0 0 0 .108-.068.304.304 0 0 0 .073-.107.358.358 0 0 0 .028-.145.338.338 0 0 0-.336-.342zm-2.026-.198h.03a.388.388 0 0 1 .146-.138.498.498 0 0 1 .254-.06.623.623 0 0 1 .466.207.696.696 0 0 1 .147.232c.036.09.054.19.054.3a.8.8 0 0 1-.054.3.729.729 0 0 1-.147.234.647.647 0 0 1-.466.203.518.518 0 0 1-.254-.056.409.409 0 0 1-.147-.142h-.029l.03.198v.565H8.51V17.86h.395zm.337.198a.34.34 0 0 0-.31.201.37.37 0 0 0-.027.141c0 .053.01.101.026.145a.362.362 0 0 0 .073.107c.032.028.068.05.108.068a.378.378 0 0 0 .257 0 .348.348 0 0 0 .107-.068.303.303 0 0 0 .074-.107.358.358 0 0 0 .028-.145.338.338 0 0 0-.21-.316.32.32 0 0 0-.126-.026zm-1.433.86h-.028a.47.47 0 0 1-.424.22c-.174 0-.303-.055-.387-.167a.703.703 0 0 1-.128-.438v-.825h.424v.777c0 .076.018.138.054.187.036.047.091.07.167.07a.245.245 0 0 0 .217-.11.497.497 0 0 0 .077-.288v-.636h.424v1.385H7.81zm-2.594.175V17.22h.724a.82.82 0 0 1 .285.048.677.677 0 0 1 .23.136.589.589 0 0 1 .15.206.67.67 0 0 1 .053.27.657.657 0 0 1-.054.267.617.617 0 0 1-.379.342.818.818 0 0 1-.285.048h-.283v.707zm.738-1.125c.092 0 .16-.023.206-.068a.234.234 0 0 0 .068-.172.234.234 0 0 0-.068-.173c-.045-.045-.114-.068-.206-.068h-.297v.48zM18.04 2.758l-.594.05.236 2.932.626.363zm-12.016.01L5.728 6.01l.624-.3.266-2.89zm-.49 5.183l-.044.557-1.247 3.137c-.216.224-.308.514-.307.825L3.93 22.84c0 .669.49 1.16 1.158 1.16H18.82c.67 0 1.25-.444 1.25-1.11V12.485c0-.306-.1-.56-.286-.774L18.44 7.748l-.006-.068-.575.257.267 3.33H5.846l.237-2.615.226-.588L6.143 8l.002-.03zm13.112 2.34l.323.987c-.088-.014-.158-.006-.245-.01zm-13.316.232l-.084.744c-.058-.005-.12.005-.172.007zm-.18 1.134l13.67.008c.47 0 .853.344.853.815v.796H4.313v-.796c0-.47.364-.823.837-.823zm.135.553a.27.27 0 0 0-.272.27c0 .36.542.36.542 0a.27.27 0 0 0-.27-.27zm.92 0c-.36 0-.36.54 0 .54s.362-.54.002-.54zm.896 0c-.39-.034-.39.572 0 .538.33-.028.33-.51 0-.538zm-2.788 1.424h15.36v9.153c0 .595-.38.846-.853.845l-13.668-.004a.828.828 0 0 1-.84-.841zm1.883 4.42c.07-.117.07-.11.068-.186-.008-.073-.004-.076-.053-.135-.054-.054-.123-.138-.2-.134h-.387l-.02.55h.407c.122-.002.16-.084.185-.094zm-.185-.83a.58.58 0 0 1 .442.171c.11.117.164.273.164.465a.65.65 0 0 1-.16.462c-.117.12-.263.21-.43.203l-.4.008-.004.774-.412-.013-.005-2.088zm1.793 1.26l-.012-.624.366-.004.004 1.435-.36.004v-.122a.582.582 0 0 1-.432.15.557.557 0 0 1-.413-.156c-.103-.11-.13-.31-.123-.46l-.004-.847h.372l-.008.77a.328.328 0 0 0 .075.23.25.25 0 0 0 .198.09c.225 0 .336-.156.336-.468zm1.805.077a.36.36 0 0 0-.11-.272c-.07-.073-.115-.118-.218-.115-.1 0-.186.018-.266.094a.388.388 0 0 0-.116.293c0 .12.038.217.117.29.07.073.168.114.27.114.102.003.166-.053.238-.126.087-.094.06-.21.085-.278zm-.262-.76c.176 0 .333.11.466.245a.71.71 0 0 1 .197.515.7.7 0 0 1-.197.512c-.093.16-.31.255-.486.254-.16.005-.36-.066-.428-.197l.004.76-.4.006-.02-2.04.416-.02v.157c.126-.103.285-.2.448-.193zm2.002.764c-.014-.16-.044-.203-.117-.283-.072-.074-.117-.087-.22-.085-.1 0-.178-.005-.257.07a.388.388 0 0 0-.116.294c0 .12.038.217.116.29.07.073.168.114.27.114.102.003.154-.065.226-.137.073-.08.086-.175.098-.263zm-.318-.75c.177 0 .389.096.522.23a.712.712 0 0 1 .198.516.7.7 0 0 1-.198.512c-.105.15-.344.255-.522.254a.475.475 0 0 1-.392-.197v.75l-.405.01-.023-2.034h.428v.137c.126-.103.23-.183.392-.177zm1.268.576l.637-.008c-.017-.074-.063-.12-.124-.166a.357.357 0 0 0-.406.003c-.085.068-.054.056-.107.17zm.313-.575c.179-.003.425.078.552.203.133.13.157.308.166.512l-.031.125h-1.03c.02.095.044.186.104.244.059.056.153.07.234.07a.5.5 0 0 0 .383-.17l.316.141c-.046.14-.187.223-.304.296a.757.757 0 0 1-.408.094c-.184.003-.378-.116-.507-.247a.718.718 0 0 1-.2-.523c0-.21.094-.382.23-.518.13-.132.31-.232.495-.227zm1.673 1.127c.08-.003.11.002.178-.038l.04.388c-.107.063-.135.038-.26.042a.633.633 0 0 1-.416-.155c-.094-.09-.097-.26-.097-.443l-.012-.513-.243-.004.004-.388.25.012-.007-.41.412.004-.016.39.367.02-.012.355-.365.008.003.507c.002.155.042.225.175.225zm.75-.54h.654a.32.32 0 0 0-.12-.186.357.357 0 0 0-.407.003.3.3 0 0 0-.127.184zm.338-.587c.185 0 .368.092.5.22.133.13.173.295.183.5v.12h-1.03a.4.4 0 0 0 .12.228.31.31 0 0 0 .218.086c.155 0 .297-.06.367-.18l.3.15c-.05.13-.12.19-.238.262a.958.958 0 0 1-.452.125.712.712 0 0 1-.502-.224.77.77 0 0 1-.208-.542c0-.21.106-.382.24-.518.132-.132.316-.232.5-.227zm1.27.587h.654a.32.32 0 0 0-.12-.186.357.357 0 0 0-.407.003.3.3 0 0 0-.127.184zm.337-.587a.74.74 0 0 1 .5.22c.134.13.174.295.184.5v.12h-1.03a.4.4 0 0 0 .12.228.31.31 0 0 0 .217.086c.154 0 .297-.06.368-.18l.3.15c-.05.13-.12.19-.238.262a.957.957 0 0 1-.454.125.713.713 0 0 1-.5-.224.77.77 0 0 1-.208-.542c0-.21.106-.382.24-.518.13-.132.315-.232.5-.227zm1.938.04l-.067.364-.18-.023c-.322 0-.36.207-.36.595v.49l-.393.005.008-1.43h.365l-.004.22c.145-.17.215-.286.63-.22zM17.535 7.91l.02-.366 1.317-.687.007.396zM5.04 6.84l1.35.68-.008.393-1.314-.65zm7.21-1.748l4.839 2.448v.392l-4.851-2.46zM6.874 7.51l4.894-2.42-.007.374-4.893 2.444zm3.467-3.974L5.418 1.099 6.64.494l5.352 2.744L17.335.466l1.257.65-4.926 2.478c-.196.098-.13.388.067.486l4.838 2.42-1.22.622-5.353-2.697L6.62 7.129l-1.273-.634 4.998-2.483a.266.266 0 0 0-.004-.477zM5.059 1.888l.007-.377 4.607 2.276-.348.2zm9.648 2.077l-.41-.184 4.596-2.303-.028.412zm.422.306l4.124-2.07a.124.124 0 0 0 .07-.11v-.98c0-.046-.008-.136-.05-.157l-1.94-.94a.124.124 0 0 0-.113 0l-5.167 2.623a.123.123 0 0 1-.11 0L6.679.015a.124.124 0 0 0-.11 0L4.616.938c-.04.02-.02.11-.02.157v.995c0 .047.026.09.07.11l4.14 2.047L4.69 6.239c-.04.02-.108.062-.11.108l.017 1.034a.123.123 0 0 0 .068.113l1.933.986c.034.018.122.03.157.014l5.186-2.602a.124.124 0 0 1 .11 0l5.12 2.603a.124.124 0 0 0 .11 0l1.972-.954c.042-.02.103-.05.104-.096l-.007-1.033c0-.047-.047-.15-.09-.17z",hex:"40B5A4"},z1={path:"M22.71 13.145c-1.66 2.092-3.452 4.483-7.038 4.483-3.203 0-4.397-2.825-4.48-5.12.701 1.484 2.073 2.685 4.214 2.63 4.117-.133 6.94-3.852 6.94-7.239 0-4.05-3.022-6.972-8.268-6.972-3.752 0-8.4 1.428-11.455 3.685C2.59 6.937 3.885 9.958 4.35 9.626c2.648-1.904 4.748-3.13 6.784-3.744C8.12 9.244.886 17.05 0 18.425c.1 1.261 1.66 4.648 2.424 4.648.232 0 .431-.133.664-.365a100.49 100.49 0 0 0 5.54-6.765c.222 3.104 1.748 6.898 6.014 6.898 3.819 0 7.604-2.756 9.33-8.965.2-.764-.73-1.361-1.261-.73zm-4.349-5.013c0 1.959-1.926 2.922-3.685 2.922-.941 0-1.664-.247-2.235-.568 1.051-1.592 2.092-3.225 3.21-4.973 1.972.334 2.71 1.43 2.71 2.619z",hex:"FF4438"},A1={path:"M19.199 24C19.199 13.467 10.533 4.8 0 4.8V0c13.165 0 24 10.835 24 24h-4.801zM3.291 17.415c1.814 0 3.293 1.479 3.293 3.295 0 1.813-1.485 3.29-3.301 3.29C1.47 24 0 22.526 0 20.71s1.475-3.294 3.291-3.295zM15.909 24h-4.665c0-6.169-5.075-11.245-11.244-11.245V8.09c8.727 0 15.909 7.184 15.909 15.91z",hex:"FFA500"},w1={path:"m13.716 17.261 6.873 6.582L24 20.282l-6.824-6.536a9.11 9.11 0 0 0 1.143-4.43c0-5.055-4.105-9.159-9.16-9.159S0 4.261 0 9.316c0 5.055 4.104 9.159 9.159 9.159a9.11 9.11 0 0 0 4.557-1.214ZM9.159 2.773a6.546 6.546 0 0 1 6.543 6.543 6.545 6.545 0 0 1-6.543 6.542 6.545 6.545 0 0 1-6.542-6.542 6.545 6.545 0 0 1 6.542-6.543ZM7.26 5.713a4.065 4.065 0 0 1 4.744.747 4.064 4.064 0 0 1 .707 4.749l1.157.611a5.376 5.376 0 0 0-.935-6.282 5.377 5.377 0 0 0-6.274-.987l.601 1.162Z",hex:"3050FF"},M1={path:"M13.91 2.505c-.873-1.448-2.972-1.448-3.844 0L6.904 7.92a15.478 15.478 0 0 1 8.53 12.811h-2.221A13.301 13.301 0 0 0 5.784 9.814l-2.926 5.06a7.65 7.65 0 0 1 4.435 5.848H2.194a.365.365 0 0 1-.298-.534l1.413-2.402a5.16 5.16 0 0 0-1.614-.913L.296 19.275a2.182 2.182 0 0 0 .812 2.999 2.24 2.24 0 0 0 1.086.288h6.983a9.322 9.322 0 0 0-3.845-8.318l1.11-1.922a11.47 11.47 0 0 1 4.95 10.24h5.915a17.242 17.242 0 0 0-7.885-15.28l2.244-3.845a.37.37 0 0 1 .504-.13c.255.14 9.75 16.708 9.928 16.9a.365.365 0 0 1-.327.543h-2.287c.029.612.029 1.223 0 1.831h2.297a2.206 2.206 0 0 0 1.922-3.31z",hex:"362D59"},L1={path:"M13.976 9.15c-2.172-.806-3.356-1.426-3.356-2.409 0-.831.683-1.305 1.901-1.305 2.227 0 4.515.858 6.09 1.631l.89-5.494C18.252.975 15.697 0 12.165 0 9.667 0 7.589.654 6.104 1.872 4.56 3.147 3.757 4.992 3.757 7.218c0 4.039 2.467 5.76 6.476 7.219 2.585.92 3.445 1.574 3.445 2.583 0 .98-.84 1.545-2.354 1.545-1.875 0-4.965-.921-6.99-2.109l-.9 5.555C5.175 22.99 8.385 24 11.714 24c2.641 0 4.843-.624 6.328-1.813 1.664-1.305 2.525-3.236 2.525-5.732 0-4.128-2.524-5.851-6.594-7.305h.003z",hex:"635BFF"},P1={path:"M11.9 1.036c-.015-.986-1.26-1.41-1.874-.637L.764 12.05C-.33 13.427.65 15.455 2.409 15.455h9.579l.113 7.51c.014.985 1.259 1.408 1.873.636l9.262-11.653c1.093-1.375.113-3.403-1.645-3.403h-9.642z",hex:"3FCF8E"},I1={path:"m12 1.608 12 20.784H0Z",hex:"000000"},E1={path:"M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",hex:"FF0000"},F1={path:"M4.157 0A4.151 4.151 0 0 0 0 4.161v15.678A4.151 4.151 0 0 0 4.157 24h15.682A4.152 4.152 0 0 0 24 19.839V4.161A4.152 4.152 0 0 0 19.839 0H4.157Zm10.61 8.761h.03a.577.577 0 0 1 .23.038.585.585 0 0 1 .201.124.63.63 0 0 1 .162.431.612.612 0 0 1-.162.435.58.58 0 0 1-.201.128.58.58 0 0 1-.23.042.529.529 0 0 1-.235-.042.585.585 0 0 1-.332-.328.559.559 0 0 1-.038-.235.613.613 0 0 1 .17-.431.59.59 0 0 1 .405-.162Zm2.853 1.572c.03.004.061.004.095.004.325-.011.646.064.937.219.238.144.431.355.552.609.128.279.189.582.185.888v.193a2 2 0 0 1 0 .219h-2.498c.003.227.075.45.204.642a.78.78 0 0 0 .646.265.714.714 0 0 0 .484-.136.642.642 0 0 0 .23-.318l.915.257a1.398 1.398 0 0 1-.28.537c-.14.159-.321.284-.521.355a2.234 2.234 0 0 1-.836.136 1.923 1.923 0 0 1-1.001-.245 1.618 1.618 0 0 1-.665-.703 2.221 2.221 0 0 1-.227-1.036 1.95 1.95 0 0 1 .48-1.398 1.9 1.9 0 0 1 1.3-.488Zm-9.607.023c.162.004.325.026.48.079.207.065.4.174.563.314.26.302.393.692.366 1.088v2.276H8.53l-.109-.711h-.065c-.064.163-.155.31-.272.439a1.122 1.122 0 0 1-.374.264 1.023 1.023 0 0 1-.453.083 1.334 1.334 0 0 1-.866-.264.965.965 0 0 1-.329-.801.993.993 0 0 1 .076-.431 1.02 1.02 0 0 1 .242-.363 1.478 1.478 0 0 1 1.043-.303h.952v-.181a.696.696 0 0 0-.136-.454.553.553 0 0 0-.438-.154.695.695 0 0 0-.378.086.48.48 0 0 0-.193.254l-.99-.144a1.26 1.26 0 0 1 .257-.563c.14-.174.321-.302.533-.378.261-.091.54-.136.82-.129.053-.003.106-.007.163-.007Zm4.384.007c.174 0 .347.038.506.114.182.083.34.211.458.374.257.423.377.911.351 1.406a2.53 2.53 0 0 1-.355 1.448 1.148 1.148 0 0 1-1.009.517c-.204 0-.401-.045-.582-.136a1.052 1.052 0 0 1-.48-.457 1.298 1.298 0 0 1-.114-.234h-.045l.004 1.784h-1.059v-4.713h.904l.117.805h.057c.068-.208.177-.401.328-.56a1.129 1.129 0 0 1 .843-.344h.076v-.004Zm7.559.084h.903l.113.805h.053a1.37 1.37 0 0 1 .235-.484.813.813 0 0 1 .313-.242.82.82 0 0 1 .39-.076h.234v1.051h-.401a.662.662 0 0 0-.313.008.623.623 0 0 0-.272.155.663.663 0 0 0-.174.26.683.683 0 0 0-.027.314v1.875h-1.054v-3.666Zm-17.515.003h3.262v.896L3.73 13.104l.034.113h1.973l.042.9H2.4v-.9l1.931-1.754-.045-.117H2.441v-.896Zm11.815 0h1.055v3.659h-1.055V10.45Zm3.443.684.019.016a.69.69 0 0 0-.351.045.756.756 0 0 0-.287.204c-.11.155-.174.336-.189.522h1.545c-.034-.526-.257-.787-.74-.787h.003Zm-5.718.163c-.026 0-.057 0-.083.004a.78.78 0 0 0-.31.053.746.746 0 0 0-.257.189 1.016 1.016 0 0 0-.204.695v.064c-.015.257.057.507.204.711a.634.634 0 0 0 .253.196.638.638 0 0 0 .314.061.644.644 0 0 0 .578-.265c.14-.223.204-.48.189-.74a1.216 1.216 0 0 0-.181-.711.677.677 0 0 0-.503-.257Zm-4.509 1.266a.464.464 0 0 0-.268.102.373.373 0 0 0-.114.276c0 .053.008.106.027.155a.375.375 0 0 0 .087.132.576.576 0 0 0 .397.11v.004a.863.863 0 0 0 .563-.182.573.573 0 0 0 .211-.457v-.14h-.903Z",hex:"FF4F00"},L0={github:{path:m1.path,hex:m1.hex},linear:{path:v1.path,hex:v1.hex},notion:{path:k1.path,hex:k1.hex},figma:{path:i1.path,hex:i1.hex},stripe:{path:L1.path,hex:L1.hex},atlassian:{path:r1.path,hex:r1.hex},sentry:{path:M1.path,hex:M1.hex},supabase:{path:P1.path,hex:P1.hex},neon:{path:j1.path,hex:j1.hex},cloudflare:{path:c1.path,hex:c1.hex},zapier:{path:F1.path,hex:F1.hex},vercel:{path:I1.path,hex:I1.hex},hubspot:{path:h1.path,hex:h1.hex},mixpanel:{path:f1.path,hex:f1.hex},google:{path:x1.path,hex:x1.hex},postgresql:{path:C1.path,hex:C1.hex},git:{path:d1.path,hex:d1.hex},puppeteer:{path:S1.path,hex:S1.hex},googledrive:{path:p1.path,hex:p1.hex},brave:{path:l1.path,hex:l1.hex},docker:{path:o1.path,hex:o1.hex},redis:{path:z1.path,hex:z1.hex},mongodb:{path:b1.path,hex:b1.hex},obsidian:{path:N1.path,hex:N1.hex},youtube:{path:E1.path,hex:E1.hex},rss:{path:A1.path,hex:A1.hex},kubernetes:{path:g1.path,hex:g1.hex},mysql:{path:y1.path,hex:y1.hex},kagi:{path:u1.path,hex:u1.hex},searxng:{path:w1.path,hex:w1.hex}};function P0({skill:a,onOpen:s}){return e.jsxs("button",{type:"button",onClick:s,className:"flex flex-col gap-2 rounded-xl border border-border bg-panel px-4 py-3.5 text-left transition-colors hover:border-accent hover:bg-panel-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-lg",style:{background:"color-mix(in srgb, var(--accent) 14%, transparent)"},children:e.jsx(U,{size:15,className:"text-accent"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[14px] font-medium text-ink",children:a.name}),a.builtin&&e.jsx("span",{className:"shrink-0 rounded-sm bg-panel-2 px-1.5 py-0.5 text-[10px] text-faint",children:"built-in"})]}),a.description&&e.jsx("p",{className:"line-clamp-2 text-[12px] text-muted",children:a.description}),a.tools.length>0&&e.jsxs("p",{className:"mt-auto flex items-center gap-1 truncate text-[11px] text-faint",children:[e.jsx(R1,{size:10})," ",a.tools.join(", ")]})]})}function I0(){const a=D1(),s=r0(),n=l0({queryKey:n1.list(),queryFn:u0,staleTime:0}),r=n.data??[],[d,m]=u.useState(""),[h,o]=u.useState(!1),v=async()=>{const x=d.trim();if(x){o(!0);try{await h0(x),p.success(`Learning a skill from ${x}… (runs in the background)`),m("")}catch(j){p.error(j instanceof N?j.message:"Could not start learning.")}finally{o(!1)}}},c=u.useRef(null),i=async x=>{const j=x.target.files?.[0];if(x.target.value="",!!j)try{const C=await j.text(),w=await p0(C);s.invalidateQueries({queryKey:n1.list()}),p.success(`Imported skill: ${w.name}`)}catch(C){p.error(C instanceof N?C.message:"Could not import that file.")}};return e.jsxs("section",{className:"rounded-lg border border-border bg-panel p-4",children:[e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"mb-1 text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Skills"}),e.jsx("p",{className:"text-[12px] text-muted",children:"The shared library — enable any of these in a chat, or via '/' in the composer."})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx("input",{ref:c,type:"file",accept:".md,text/markdown",hidden:!0,onChange:x=>{i(x)}}),e.jsxs(f,{size:"sm",variant:"outline",onClick:()=>c.current?.click(),children:[e.jsx(A0,{size:14})," Upload SKILL.md"]}),e.jsxs(f,{size:"sm",onClick:()=>a("/skills/new"),children:[e.jsx(O,{size:14})," New skill"]})]})]}),e.jsxs("div",{className:"mb-3 flex flex-col gap-1.5 rounded-lg border border-border bg-panel-2 px-3 py-2.5",children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-[12px] text-muted",children:[e.jsx(g0,{size:12})," Learn a skill from a folder"]}),e.jsxs("div",{className:"flex gap-1.5",children:[e.jsx("input",{className:"min-w-0 flex-1 rounded-md border border-border bg-bg px-2.5 py-1.5 font-mono text-[12px] text-ink outline-none focus:border-accent placeholder:text-faint",placeholder:"/absolute/path/to/folder",value:d,onChange:x=>m(x.target.value),onKeyDown:x=>{x.key==="Enter"&&v()}}),e.jsx(f,{size:"sm",variant:"outline",disabled:h||!d.trim(),onClick:()=>{v()},children:"Learn"})]})]}),n.isLoading?e.jsx("p",{className:"py-8 text-center text-[13px] text-faint",children:"Loading…"}):r.length===0?e.jsxs("div",{className:"flex flex-col items-center gap-3 py-10",children:[e.jsx(U,{size:28,className:"text-faint"}),e.jsx("p",{className:"text-[13px] text-muted",children:"No skills yet."}),e.jsxs(f,{size:"sm",variant:"outline",onClick:()=>a("/skills/new"),children:[e.jsx(O,{size:14})," Create your first skill"]})]}):e.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(185px, 1fr))"},children:r.map(x=>e.jsx(P0,{skill:x,onOpen:()=>a(`/skills/${x.id}`)},x.id))})]})}function E0({agent:a,isDefault:s,onOpen:n,onSetDefault:r,onReset:d}){const m=a.skillIds?.length,h=a.tools?.length;return e.jsxs("div",{role:"button",tabIndex:0,onClick:n,onKeyDown:o=>{o.key==="Enter"&&n()},className:"flex flex-col gap-2 rounded-xl border border-border bg-panel px-4 py-3.5 text-left transition-colors hover:border-accent hover:bg-panel-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-lg",style:{background:"color-mix(in srgb, var(--accent) 14%, transparent)"},children:e.jsx(B1,{size:15,className:"text-accent"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-[14px] font-medium text-ink",children:a.name}),e.jsx("button",{type:"button",title:s?"Default agent for new chats":"Set as default agent",onClick:o=>{o.stopPropagation(),r()},className:"shrink-0 rounded p-0.5 text-faint transition-colors hover:text-accent",children:e.jsx(y0,{size:14,className:s?"fill-current text-accent":void 0})}),a.overridden&&e.jsx("button",{type:"button",title:"Reset to default",onClick:o=>{o.stopPropagation(),d()},className:"shrink-0 rounded p-0.5 text-faint transition-colors hover:text-accent",children:e.jsx(j0,{size:13})}),a.builtin&&e.jsx("span",{className:"shrink-0 rounded-sm bg-panel-2 px-1.5 py-0.5 text-[10px] text-faint",children:a.overridden?"modified":"built-in"})]}),a.description&&e.jsx("p",{className:"line-clamp-2 text-[12px] text-muted",children:a.description}),m||h?e.jsxs("p",{className:"mt-auto flex items-center gap-1 truncate text-[11px] text-faint",children:[e.jsx(R1,{size:10}),m?`${m} skill${m===1?"":"s"}`:null,m&&h?" · ":null,h?`${h} tool${h===1?"":"s"}`:null]}):null]})}function F0(){const a=D1(),s=c0(),n=o0(),r=i0(),d=v0(s.data??[],n.data??{}),[m,h]=u.useState(()=>f0()),o=i=>{b0(i.id),h(i.id),p.success(`${i.name} is now the default agent for new chats.`)},v=i=>{r.reset.mutate(i.id,{onSuccess:()=>p.success(`${i.name} reset to its default.`),onError:x=>p.error(x instanceof N?x.message:"Could not reset agent.")})},c=s.isLoading||n.isLoading;return e.jsxs("section",{className:"rounded-lg border border-border bg-panel p-4",children:[e.jsxs("div",{className:"mb-3 flex items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"mb-1 text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Agents"}),e.jsx("p",{className:"text-[12px] text-muted",children:"Pick one when starting a new chat. Built-in agents can be edited in place (Reset restores the default) — or create your own with a custom system prompt and a skill/tool allow-list."})]}),e.jsxs(f,{size:"sm",onClick:()=>a("/agents/new"),className:"shrink-0",children:[e.jsx(O,{size:14})," New agent"]})]}),c?e.jsx("p",{className:"py-8 text-center text-[13px] text-faint",children:"Loading…"}):e.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(185px, 1fr))"},children:d.map(i=>e.jsx(E0,{agent:i,isDefault:i.id===m,onOpen:()=>a(`/agents/${i.id}`),onSetDefault:()=>o(i),onReset:()=>v(i)},i.id))})]})}const T0=[{id:"agents",label:"Agents",icon:B1},{id:"skills",label:"Skills",icon:U},{id:"mcp",label:"MCP Servers",icon:d0}];function ce(){const{query:a}=q1(),s=a.data,[n,r]=a0(),d=n.get("tab"),m=d==="mcp"?"mcp":d==="skills"?"skills":"agents",h=o=>r(o==="agents"?{}:{tab:o},{replace:!0});return e.jsxs("div",{className:"flex w-full flex-col gap-4 px-4 py-6 md:px-6",children:[e.jsx(s0,{title:"Customize",description:"Add agents, skills, and external providers the model can call during conversations."}),e.jsx("div",{className:"inline-flex w-fit rounded-md border border-border p-0.5",children:T0.map(({id:o,label:v,icon:c})=>e.jsxs("button",{type:"button",onClick:()=>h(o),className:m0("flex items-center gap-1.5 rounded px-3 py-1.5 text-[13px] font-medium transition-colors",m===o?"bg-accent/12 text-accent":"text-muted hover:text-ink"),children:[e.jsx(c,{size:14}),v]},o))}),m==="agents"?e.jsx(F0,{}):m==="skills"?e.jsx(I0,{}):e.jsx(_0,{servers:s?.mcp?.servers??[],search:s?.search??{provider:"tavily",tavilyKeySet:!1,kagiKeySet:!1,searxngUrl:""}})]})}const T1=()=>({name:"",transport:"stdio",command:"",argsStr:"",envStr:"",url:"",apiKey:"",enabled:!0});function D0(a){return{name:a.name,transport:a.transport,command:a.command??"",argsStr:(a.args??[]).join(", "),envStr:Object.entries(a.env??{}).map(([s,n])=>`${s}=${n}`).join(`
|
|
2
|
+
`),url:a.url??"",apiKey:a.apiKey??"",enabled:a.enabled}}function q0(a){const s=a.argsStr.trim()?a.argsStr.split(",").map(r=>r.trim()).filter(Boolean):[],n={};for(const r of a.envStr.split(`
|
|
3
|
+
`)){const d=r.indexOf("=");d>0&&(n[r.slice(0,d).trim()]=r.slice(d+1).trim())}return{name:a.name.trim(),transport:a.transport,command:a.transport==="stdio"&&a.command.trim()||void 0,args:a.transport==="stdio"&&s.length?s:void 0,env:a.transport==="stdio"&&Object.keys(n).length?n:void 0,url:a.transport==="sse"&&a.url.trim()||void 0,apiKey:a.transport==="sse"&&a.apiKey.trim()?a.apiKey.trim():void 0,enabled:a.enabled}}function R0(a){const s=a.split(/\s+/);return s.length>=2?(s[0][0]+s[1][0]).toUpperCase():a.slice(0,2).toUpperCase()}function L(a){const s=["#2563eb","#7c3aed","#db2777","#dc2626","#d97706","#059669","#0891b2"];let n=0;for(const r of a)n=n*31+r.charCodeAt(0)&2147483647;return s[n%s.length]}function A({name:a,color:s,iconSlug:n}){const r=n?L0[n]:void 0;return r?e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg",style:{background:`#${r.hex}`},children:e.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18",fill:"#fff","aria-hidden":"true",children:e.jsx("path",{d:r.path})})}):e.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg text-[12px] font-bold text-white",style:{background:s},children:R0(a)})}function B0({auth:a}){const s=a==="oauth"?"OAuth":a==="key"?"API Key":"OAuth/Key",n=a==="oauth"?"color-mix(in srgb, #d97706 18%, transparent)":a==="key"?"color-mix(in srgb, var(--ok) 18%, transparent)":"color-mix(in srgb, var(--accent) 18%, transparent)",r=a==="oauth"?"#d97706":a==="key"?"var(--ok)":"var(--accent)";return e.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:{background:n,color:r},children:s})}function H0({uvx:a}){return e.jsx("span",{className:"rounded px-1.5 py-0.5 text-[10px] font-medium",style:a?{background:"color-mix(in srgb, #7c3aed 18%, transparent)",color:"#7c3aed"}:{background:"color-mix(in srgb, var(--accent) 18%, transparent)",color:"var(--accent)"},children:a?"uvx":"npx"})}function K0({entry:a,tab:s,isSelected:n,isConnected:r,onSelect:d}){const m=s==="cloud"?a.color:L(a.name);return e.jsxs("button",{type:"button",onClick:d,className:"relative flex flex-col gap-2 rounded-lg border bg-panel-2 p-3 text-left transition-colors hover:bg-bg",style:{borderColor:n?"var(--accent)":r?"color-mix(in srgb, var(--ok) 50%, transparent)":"var(--border, #e2e2e2)"},children:[r&&e.jsxs("span",{className:"absolute right-2 top-2 flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-semibold",style:{background:"color-mix(in srgb, var(--ok) 15%, transparent)",color:"var(--ok)"},children:[e.jsx(H1,{size:8})," Connected"]}),e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(A,{name:a.name,color:m,iconSlug:a.iconSlug}),e.jsxs("div",{className:"min-w-0 flex-1 pr-14",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold text-ink",children:a.name}),e.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-1",children:[e.jsx("span",{className:"text-[10px] text-faint",children:a.cat}),e.jsx("span",{className:"text-[10px] text-faint",children:"·"}),s==="cloud"?e.jsx(B0,{auth:a.auth}):e.jsx(H0,{uvx:a.uvx})]})]})]}),e.jsx("p",{className:"text-[11px] leading-relaxed text-muted",children:a.desc})]})}function V0({entry:a,apiKey:s,onApiKeyChange:n,onClose:r,onConnect:d,busy:m}){const h=a.auth!=="oauth";return e.jsxs("div",{className:"mt-3 flex flex-col gap-3 rounded-lg border bg-panel-2 p-3",style:{borderColor:"color-mix(in srgb, var(--accent) 40%, transparent)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{name:a.name,color:a.color,iconSlug:a.iconSlug}),e.jsxs("span",{className:"text-[13px] font-medium text-ink",children:["Connect ",a.name]})]}),e.jsx("button",{type:"button",onClick:r,className:"rounded p-1 text-faint transition-colors hover:text-ink",children:e.jsx(_,{size:13})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"Server URL"}),e.jsx("input",{type:"text",value:a.url,readOnly:!0,className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-faint outline-none"})]}),h?e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"API Key / Token"}),e.jsx("input",{type:"password",value:s,onChange:o=>n(o.target.value),placeholder:"Paste your token here",autoComplete:"off",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"}),a.keyNote&&e.jsx("p",{className:"text-[11px] text-faint",children:a.keyNote})]}):e.jsxs("p",{className:"rounded-md border border-border bg-bg px-3 py-2 text-[12px] text-muted",children:[a.name," uses OAuth — add the server and authenticate via the provider developer console.",a.keyNote&&e.jsxs(e.Fragment,{children:[" ",a.keyNote]})]}),e.jsxs(f,{size:"sm",onClick:d,disabled:m||h&&!s.trim(),children:[m&&e.jsx(D,{size:13,className:"animate-spin"}),"Add server"]})]})}function O0({entry:a,extraArg:s,onExtraArgChange:n,envs:r,onEnvChange:d,onClose:m,onAdd:h,busy:o}){const v=a.envs.filter(c=>c.required).every(c=>r[c.key]?.trim());return e.jsxs("div",{className:"mt-3 flex flex-col gap-3 rounded-lg border bg-panel-2 p-3",style:{borderColor:"color-mix(in srgb, var(--accent) 40%, transparent)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{name:a.name,color:L(a.name),iconSlug:a.iconSlug}),e.jsxs("span",{className:"text-[13px] font-medium text-ink",children:["Add ",a.name]})]}),e.jsx("button",{type:"button",onClick:m,className:"rounded p-1 text-faint transition-colors hover:text-ink",children:e.jsx(_,{size:13})})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"Command"}),e.jsx("input",{type:"text",value:a.cmd,readOnly:!0,className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-faint outline-none"})]}),a.argNote&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"Argument"}),e.jsx("input",{type:"text",value:s,onChange:c=>n(c.target.value),placeholder:"e.g. /path/to/directory",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"}),e.jsx("p",{className:"text-[11px] text-faint",children:a.argNote})]}),a.envs.map(c=>e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("label",{className:"flex items-center gap-1 text-[12px] text-muted",children:[e.jsx("span",{className:"font-mono",children:c.key}),c.required&&e.jsx("span",{className:"text-[10px]",style:{color:"var(--err)"},children:"required"})]}),e.jsx("input",{type:c.required?"password":"text",value:r[c.key]??"",onChange:i=>d(c.key,i.target.value),placeholder:c.desc,autoComplete:"off",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"})]},c.key)),a.uvx&&e.jsxs("p",{className:"rounded-md border border-border bg-bg px-3 py-2 text-[11px] text-muted",children:["Requires ",e.jsx("span",{className:"font-mono text-ink",children:"uv"})," — install with"," ",e.jsx("span",{className:"font-mono text-ink",children:"pip install uv"}),"."]}),e.jsxs(f,{size:"sm",onClick:h,disabled:o||!v,children:[o&&e.jsx(D,{size:13,className:"animate-spin"}),"Add server"]})]})}function _0({servers:a,search:s}){const n=x0(),[r,d]=u.useState(null),[m,h]=u.useState(T1()),[o,v]=u.useState("marketplace"),c=t=>h(l=>({...l,...t})),[i,x]=u.useState("cloud"),[j,C]=u.useState("All"),[w,Z]=u.useState(null),[q,G]=u.useState(""),[$,Q]=u.useState(""),[Y,W]=u.useState({}),[R,X]=u.useState(null),[P,B]=u.useState(""),J=s.provider==="tavily"?s.tavilyKeySet:s.provider==="kagi"?s.kagiKeySet:!!s.searxngUrl?.trim(),S=J?V.find(t=>t.id===s.provider):void 0,K1=u.useMemo(()=>new Set(a.map(t=>t.url).filter(Boolean)),[a]),V1=u.useMemo(()=>new Set(a.map(t=>t.name)),[a]),O1=t=>"url"in t?K1.has(t.url):V1.has(t.name),_1=t=>F.find(l=>l.url===t.url)?.iconSlug??T.find(l=>l.name===t.name)?.iconSlug,z=t=>{Z(t),G(""),Q(""),W({}),X(null)},I=t=>{X(t),B(""),Z(null)},U1=t=>{x(t),C("All"),z(null)},Z1=i==="cloud"?w0:M0,G1=(i==="cloud"?F:T).filter(t=>j==="All"||t.cat===j),$1=t=>{d(t.id),h(D0(t)),v("edit")},e1=()=>{const t=q0(m);if(!t.name)return void p.error("Server name is required.");if(t.transport==="stdio"&&!t.command)return void p.error("Command is required.");if(t.transport==="sse"&&!t.url)return void p.error("URL is required.");const l=o==="edit"&&r,g={onSuccess:()=>{p.success(l?"MCP server updated":"MCP server added"),v("marketplace"),d(null)},onError:b=>p.error(b instanceof N?b.message:"Could not save server.")};l?n.update.mutate({id:r,patch:t},g):n.add.mutate(t,g)},Q1=(t,l)=>{window.confirm(`Remove MCP server "${l}"?`)&&n.remove.mutate(t,{onError:g=>p.error(g instanceof N?g.message:"Could not remove server.")})},Y1=t=>{n.update.mutate({id:t.id,patch:{enabled:!t.enabled}},{onError:l=>p.error(l instanceof N?l.message:"Could not update server.")})},{save:W1}=q1(),X1=(t,l)=>{const g={provider:t};t==="searxng"?g.searxngUrl=l:l.trim()&&(g[t==="tavily"?"tavilyApiKey":"kagiApiKey"]=l),W1.mutate({search:g},{onSuccess:()=>{const b=t==="tavily"?"Tavily":t==="kagi"?"Kagi":"SearXNG";p.success(`Search set to ${b}`),I(null)},onError:b=>p.error(b instanceof N?b.message:"Could not save search settings.")})},J1=t=>{n.add.mutate({name:t.name,transport:"sse",url:t.url,enabled:!0,...q.trim()?{apiKey:q.trim()}:{}},{onSuccess:()=>{p.success(`${t.name} connected`),z(null)},onError:l=>p.error(l instanceof N?l.message:"Could not add server.")})},e0=t=>{const[l,...g]=t.cmd.trim().split(/\s+/),b=$.trim(),t0=b?(b.match(/[^\s"]+|"[^"]*"/g)??[]).map(y=>y.replace(/^"|"$/g,"")):[],a1=[...g,...t0],E={};for(const[y,s1]of Object.entries(Y))s1.trim()&&(E[y]=s1.trim());for(const y of t.envs)if(y.required&&!E[y.key])return void p.error(`${y.key} is required.`);n.add.mutate({name:t.name,transport:"stdio",command:l,args:a1.length?a1:void 0,enabled:!0,...Object.keys(E).length?{env:E}:{}},{onSuccess:()=>{p.success(`${t.name} added`),z(null)},onError:y=>p.error(y instanceof N?y.message:"Could not add server.")})},M=n.add.isPending||n.update.isPending,k=m,H=i==="cloud"?F.find(t=>t.id===w):void 0,K=i==="local"?T.find(t=>t.id===w):void 0,t1=()=>e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"Name"}),e.jsx("input",{type:"text",value:k.name,onChange:t=>c({name:t.target.value}),placeholder:"My Tool Server",className:"rounded-md border border-border bg-bg px-2 py-1.5 text-[13px] text-ink outline-none"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"Transport"}),e.jsx("div",{className:"flex gap-4",children:["stdio","sse"].map(t=>e.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-[13px] text-ink",children:[e.jsx("input",{type:"radio",name:"mcp-transport",checked:k.transport===t,onChange:()=>c({transport:t}),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"font-mono",children:t}),e.jsx("span",{className:"text-[11px] text-faint",children:t==="stdio"?"(subprocess)":"(HTTP)"})]},t))})]}),k.transport==="stdio"?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"Command"}),e.jsx("input",{type:"text",value:k.command,onChange:t=>c({command:t.target.value}),placeholder:"npx -y @modelcontextprotocol/server-filesystem",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("label",{className:"text-[12px] text-muted",children:["Args ",e.jsx("span",{className:"text-faint",children:"(comma-separated, optional)"})]}),e.jsx("input",{type:"text",value:k.argsStr,onChange:t=>c({argsStr:t.target.value}),placeholder:"--port, 3000",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("label",{className:"text-[12px] text-muted",children:["Env vars ",e.jsx("span",{className:"text-faint",children:"(KEY=VALUE, one per line, optional)"})]}),e.jsx("textarea",{rows:2,value:k.envStr,onChange:t=>c({envStr:t.target.value}),placeholder:`API_KEY=abc123
|
|
4
|
+
DEBUG=true`,className:"resize-none rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"})]})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"URL"}),e.jsx("input",{type:"text",value:k.url,onChange:t=>c({url:t.target.value}),placeholder:"http://localhost:3000",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"})]}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("label",{className:"text-[12px] text-muted",children:["API Key ",e.jsx("span",{className:"text-faint",children:"(optional — Bearer token)"})]}),e.jsx("input",{type:"password",value:k.apiKey,onChange:t=>c({apiKey:t.target.value}),placeholder:"sk-…",autoComplete:"off",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"})]})]}),e.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-[13px] text-ink",children:[e.jsx("input",{type:"checkbox",checked:k.enabled,onChange:t=>c({enabled:t.target.checked}),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),"Enable immediately"]})]});return e.jsxs("section",{className:"rounded-lg border border-border bg-panel p-4",children:[e.jsx("h2",{className:"mb-1 text-[13px] font-semibold uppercase tracking-wide text-faint",children:"MCP Servers"}),e.jsx("p",{className:"mb-3 text-[12px] text-muted",children:"Connect external tool providers via the Model Context Protocol."}),o==="edit"&&e.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-panel-2 p-3",children:[e.jsx("div",{className:"text-[13px] font-medium text-ink",children:"Edit server"}),t1(),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(f,{size:"sm",onClick:e1,disabled:M,children:[M&&e.jsx(D,{size:13,className:"animate-spin"}),"Update"]}),e.jsx(f,{variant:"outline",size:"sm",onClick:()=>{v("marketplace"),d(null)},children:"Cancel"})]})]}),o==="manual"&&e.jsxs("div",{className:"flex flex-col gap-3 rounded-lg border border-border bg-panel-2 p-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{type:"button",onClick:()=>v("marketplace"),className:"rounded p-1 text-faint transition-colors hover:text-ink",children:e.jsx(k0,{size:13})}),e.jsx("div",{className:"text-[13px] font-medium text-ink",children:"Add server manually"})]}),t1(),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(f,{size:"sm",onClick:e1,disabled:M,children:[M&&e.jsx(D,{size:13,className:"animate-spin"}),"Add"]}),e.jsx(f,{variant:"outline",size:"sm",onClick:()=>v("marketplace"),children:"Cancel"})]})]}),o==="marketplace"&&e.jsxs("div",{children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-1.5 rounded-lg border border-border bg-panel-2 p-3",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-faint",children:"Built-in web search"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:V.map(t=>{const l=s.provider===t.id&&J,g=R===t.id;return e.jsxs("button",{type:"button",onClick:()=>I(g?null:t.id),className:"flex items-center gap-2 rounded-lg border bg-panel px-2.5 py-1.5 text-left transition-colors hover:bg-bg",style:{borderColor:g?"var(--accent)":l?"color-mix(in srgb, var(--ok) 50%, transparent)":"var(--border, #e2e2e2)"},children:[e.jsx(A,{name:t.name,color:L(t.name),iconSlug:t.iconSlug}),e.jsx("span",{className:"text-[13px] font-medium text-ink",children:t.name}),l&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[10px] font-semibold",style:{color:"var(--ok)"},children:[e.jsx(H1,{size:10})," Active"]})]},t.id)})}),R&&(()=>{const t=V.find(l=>l.id===R);return e.jsxs("div",{className:"mt-1.5 flex flex-col gap-3 rounded-lg border bg-panel p-3",style:{borderColor:"color-mix(in srgb, var(--accent) 40%, transparent)"},children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{name:t.name,color:L(t.name),iconSlug:t.iconSlug}),e.jsxs("span",{className:"text-[13px] font-medium text-ink",children:["Configure ",t.name]})]}),e.jsx("button",{type:"button",onClick:()=>I(null),className:"rounded p-1 text-faint transition-colors hover:text-ink",children:e.jsx(_,{size:13})})]}),e.jsx("p",{className:"text-[11px] leading-relaxed text-muted",children:t.desc}),t.id==="searxng"?e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-[12px] text-muted",children:"SearXNG URL"}),e.jsx("input",{type:"text",value:P,onChange:l=>B(l.target.value),placeholder:"http://localhost:8080",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"})]}):e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("label",{className:"text-[12px] text-muted",children:[t.name," API Key"]}),e.jsx("input",{type:"password",value:P,onChange:l=>B(l.target.value),placeholder:t.id==="tavily"?"tvly-…":"kg-…",autoComplete:"off",className:"rounded-md border border-border bg-bg px-2 py-1.5 font-mono text-[12px] text-ink outline-none"})]}),e.jsx(f,{size:"sm",onClick:()=>X1(t.id,P),disabled:!P.trim(),children:"Save & make active"})]})})()]}),e.jsx("div",{className:"mb-3 inline-flex rounded-md border border-border p-0.5",children:["cloud","local","connected"].map(t=>e.jsx("button",{type:"button",onClick:()=>U1(t),className:`rounded px-3 py-1 text-[13px] capitalize transition-colors ${i===t?"bg-bg text-ink":"text-muted hover:text-ink"}`,children:t==="connected"?`Connected${a.length>0?` (${a.length})`:""}`:t==="cloud"?"Cloud":"Local"},t))}),i!=="connected"&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-3 flex flex-wrap gap-1.5",children:Z1.map(t=>e.jsx("button",{type:"button",onClick:()=>{C(t),z(null)},className:"rounded-full px-2.5 py-0.5 text-[11px] font-medium transition-colors",style:j===t?{background:"var(--accent)",color:"#fff"}:{background:"color-mix(in srgb, var(--muted) 12%, transparent)",color:"var(--muted)"},children:t},t))}),e.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(185px, 1fr))"},children:G1.map(t=>e.jsx(K0,{entry:t,tab:i,isSelected:w===t.id,isConnected:O1(t),onSelect:()=>z(w===t.id?null:t.id)},t.id))}),H&&e.jsx(V0,{entry:H,apiKey:q,onApiKeyChange:G,onClose:()=>z(null),onConnect:()=>J1(H),busy:M}),K&&e.jsx(O0,{entry:K,extraArg:$,onExtraArgChange:Q,envs:Y,onEnvChange:(t,l)=>W(g=>({...g,[t]:l})),onClose:()=>z(null),onAdd:()=>e0(K),busy:M})]}),i==="connected"&&e.jsx("div",{children:a.length===0&&!S?e.jsx("p",{className:"py-8 text-center text-[12px] text-muted",children:"No MCP servers connected yet. Add one from the Cloud or Local tab."}):e.jsxs("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(185px, 1fr))"},children:[S&&e.jsxs("div",{className:"relative flex flex-col gap-2 rounded-lg border bg-panel-2 p-3",style:{borderColor:"color-mix(in srgb, var(--ok) 50%, transparent)"},children:[e.jsx("span",{className:"absolute right-2 top-2 flex items-center gap-0.5 rounded px-1 py-0.5 text-[9px] font-semibold",style:{background:"color-mix(in srgb, var(--ok) 15%, transparent)",color:"var(--ok)"},children:"Built-in"}),e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(A,{name:S.name,color:L(S.name),iconSlug:S.iconSlug}),e.jsxs("div",{className:"min-w-0 flex-1 pr-14",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold text-ink",children:S.name}),e.jsx("div",{className:"mt-0.5 text-[10px] text-faint",children:"Web search"})]})]}),e.jsx("button",{type:"button",onClick:()=>I(S.id),className:"mt-1 self-start text-[12px] text-muted transition-colors hover:text-ink",children:"Manage"})]}),a.map(t=>e.jsxs("div",{className:"relative flex flex-col gap-2 rounded-lg border bg-panel-2 p-3",children:[e.jsxs("div",{className:"flex items-start gap-2.5",children:[e.jsx(A,{name:t.name,color:L(t.name),iconSlug:_1(t)}),e.jsxs("div",{className:"min-w-0 flex-1 pr-14",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold text-ink",children:t.name}),e.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-1",children:e.jsx("span",{className:"rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",style:{background:t.transport==="sse"?"color-mix(in srgb, var(--accent) 15%, transparent)":"color-mix(in srgb, var(--muted) 20%, transparent)",color:t.transport==="sse"?"var(--accent)":"var(--muted)"},children:t.transport})})]})]}),e.jsx("span",{className:"hidden max-w-[220px] shrink-0 truncate font-mono text-[11px] text-faint sm:block",title:t.transport==="stdio"?t.command:t.url,children:t.transport==="stdio"?t.command?.split(/[\\/]/).slice(-1)[0]:t.url}),e.jsxs("div",{className:"flex items-center gap-2 pt-1",children:[e.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5 text-[12px] text-ink",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:()=>Y1(t),className:"h-3.5 w-3.5 accent-[var(--accent)]"}),e.jsx("span",{className:"text-[11px]",children:t.enabled?"Enabled":"Disabled"})]}),e.jsxs("div",{className:"ml-auto flex gap-1",children:[e.jsx("button",{type:"button",onClick:()=>$1(t),title:"Edit",className:"rounded p-1 text-faint transition-colors hover:bg-bg hover:text-ink",children:e.jsx(N0,{size:12})}),e.jsx("button",{type:"button",onClick:()=>Q1(t.id,t.name),title:"Delete",className:"rounded p-1 transition-colors hover:bg-bg",style:{color:"var(--err)"},children:e.jsx(C0,{size:12})})]})]})]},t.id))]})}),e.jsxs("button",{type:"button",onClick:()=>{v("manual"),h(T1()),d(null)},className:"mt-4 flex items-center gap-1 text-[12px] text-faint transition-colors hover:text-ink",children:["Add server manually ",e.jsx(S0,{size:11})]})]})]})}export{ce as CustomizeScreen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./radix-DHuxYtIT.js";import{r as l}from"./vendor-BE0HADM8.js";import{g as m,o as N,B as k,C,f as w,t as j,A as g,a as S,L as A,p as P}from"./index-MBZ7hSNo.js";import{C as x,a as I,b as E,c as T}from"./collapsible-Bqsm-UEI.js";import{S as z}from"./common-DHHaSVnF.js";import{T as L}from"./trash-2-DtSyrOcz.js";import{P as O,S as _,W as M}from"./wrench-BhEqkhsG.js";import{B}from"./bot-B3GTFQ2J.js";import{C as K}from"./chevron-right-DGQJG4QN.js";import"./check-C39bHy3w.js";const q=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],R=m("globe",q);const $=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],G=m("key",$);const W=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],D=m("plug",W);const V=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],v=m("terminal",V),h=window.location.origin,H=[{method:"POST",path:"/v1/chat/completions",desc:"OpenAI Chat Completions"},{method:"POST",path:"/v1/messages",desc:"Anthropic Messages"},{method:"POST",path:"/v1/embeddings",desc:"OpenAI Embeddings"},{method:"GET",path:"/v1/models",desc:"Models list"}],d=[{id:"claude-code",name:"Claude Code",hint:"turbollm launch claude",icon:_},{id:"opencode",name:"opencode",hint:"turbollm launch opencode",icon:C},{id:"kilo",name:"Kilo Code",hint:"turbollm launch kilo",icon:M},{id:"openclaw",name:"openclaw",hint:"turbollm launch openclaw",icon:v},{id:"hermes",name:"Hermes Agent",hint:"turbollm launch hermes",icon:B},{id:"qwen",name:"Qwen Code",hint:"OpenAI-compatible",icon:D}];function de(){return e.jsxs("div",{className:"w-full px-4 py-6 md:px-6",children:[e.jsx(z,{title:"Developer",description:"Point Claude Code, Codex, or any OpenAI / Anthropic app at this machine."}),e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Q,{}),e.jsx(U,{}),e.jsx(Y,{})]})]})}function Q(){const{query:t,create:n,revoke:a}=N(),[s,c]=l.useState(""),[i,u]=l.useState(null),p=t.data?.keys??[],b=()=>{const r=s.trim();r&&n.mutate(r,{onSuccess:o=>{c(""),u(o.key)},onError:o=>j.error(o instanceof g?o.message:"Could not create key.")})},y=(r,o)=>{a.mutate(r,{onSuccess:()=>{i?.startsWith(o)&&u(null)},onError:f=>j.error(f instanceof g?f.message:"Could not revoke key.")})};return e.jsxs("section",{className:"rounded-lg border border-border bg-panel p-4",children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(R,{size:15,className:"text-accent"}),e.jsx("h2",{className:"text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Connection"})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-border bg-bg px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-[11px] text-muted",children:"Server URL"}),e.jsx("code",{className:"font-mono text-[13px] text-ink",children:h})]}),e.jsx(x,{text:h})]}),e.jsxs("div",{className:"mt-4",children:[e.jsxs("div",{className:"mb-2 flex items-center gap-1.5 text-[12px] font-medium text-muted",children:[e.jsx(G,{size:13})," API keys"]}),i&&e.jsxs("div",{className:"mb-3 rounded-md border p-3",style:{borderColor:"var(--ok)",background:"color-mix(in srgb, var(--ok) 8%, transparent)"},children:[e.jsx("p",{className:"mb-1.5 text-[12px] font-medium",style:{color:"var(--ok)"},children:"Key created — copy it now, it won't be shown again."}),e.jsxs("div",{className:"flex items-center gap-2 rounded border border-border bg-bg px-2 py-1.5",children:[e.jsx("code",{className:"min-w-0 flex-1 break-all font-mono text-[12px] text-ink",children:i}),e.jsx(x,{text:i})]})]}),p.length===0&&!i&&e.jsx("p",{className:"mb-3 text-[13px] text-faint",children:"No API keys yet. Create one to connect from another device or an external app."}),p.length>0&&e.jsx("div",{className:"mb-3 divide-y divide-border rounded-md border border-border",children:p.map(r=>e.jsxs("div",{className:"flex items-center justify-between px-3 py-2.5",children:[e.jsxs("div",{children:[e.jsx("span",{className:"text-[13px] font-medium text-ink",children:r.name}),e.jsxs("span",{className:"ml-2 font-mono text-[11px] text-faint",children:[r.prefix,"…"]})]}),e.jsx("button",{type:"button",onClick:()=>y(r.id,r.prefix),className:"rounded p-1 text-faint transition-colors hover:text-err",title:"Revoke key",children:e.jsx(L,{size:14})})]},r.id))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:s,onChange:r=>c(r.target.value),placeholder:"Key name (e.g. claude-code)",className:"flex-1 rounded-md border border-border bg-bg px-2.5 py-1.5 text-[13px] text-ink outline-none placeholder:text-faint focus:border-[color:var(--accent)]",onKeyDown:r=>r.key==="Enter"&&b()}),e.jsxs(k,{size:"sm",onClick:b,disabled:!s.trim()||n.isPending,children:[e.jsx(O,{size:13}),n.isPending?"Creating…":"New key"]})]})]})]})}function U(){const[t,n]=l.useState(d[0].id),a=d.find(s=>s.id===t)??d[0];return e.jsxs("section",{children:[e.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[e.jsx(v,{size:15,className:"text-accent"}),e.jsx("h2",{className:"text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Connect an app"})]}),e.jsx("div",{className:"grid gap-2",style:{gridTemplateColumns:"repeat(auto-fill, minmax(180px, 1fr))"},children:d.map(s=>e.jsx(F,{cli:s,selected:s.id===t,onSelect:()=>n(s.id)},s.id))}),e.jsx(J,{cli:a},a.id)]})}function F({cli:t,selected:n,onSelect:a}){const s=t.icon;return e.jsxs("button",{type:"button",onClick:a,className:"flex items-center gap-2.5 rounded-[10px] border bg-panel px-3 py-2.5 text-left transition-colors hover:border-[color:var(--accent)]",style:{borderColor:n?"var(--accent)":"var(--border)",borderWidth:n?2:1},children:[e.jsx("span",{className:"grid h-8 w-8 shrink-0 place-items-center rounded-lg bg-panel-2 text-muted",children:e.jsx(s,{size:16})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"truncate text-[13px] font-medium text-ink",children:t.name}),e.jsx("div",{className:"truncate font-mono text-[11px] text-muted",children:t.hint})]})]})}function J({cli:t}){const n=S({queryKey:["connect",t.id],queryFn:()=>P(t.id)});return e.jsxs("div",{className:"mt-3 rounded-xl border bg-panel p-4",style:{borderColor:"color-mix(in srgb, var(--accent) 45%, var(--border))"},children:[e.jsxs("div",{className:"mb-3 text-[13px] font-medium text-ink",children:[t.name," — setup"]}),n.isLoading&&e.jsxs("div",{className:"flex items-center gap-2 text-[13px] text-muted",children:[e.jsx(A,{size:14,className:"animate-spin"})," Loading…"]}),n.isError&&e.jsx("p",{className:"text-[13px]",style:{color:"var(--err)"},children:"Could not fetch setup snippets."}),n.data&&e.jsx("div",{className:"flex flex-col gap-2.5",children:n.data.steps.map((a,s)=>e.jsx(X,{step:a},s))})]})}function X({step:t}){return e.jsxs("div",{children:[e.jsx("div",{className:"mb-1 text-[11px] text-faint",children:t.label}),e.jsxs("div",{className:"relative rounded border border-border bg-panel-2",children:[e.jsx("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all px-3 py-2 pr-10 font-mono text-[12px] leading-relaxed text-ink",children:t.snippet}),e.jsx(x,{text:t.snippet,className:"absolute right-2 top-2"})]})]})}function Y(){const[t,n]=l.useState(!1);return e.jsxs(I,{open:t,onOpenChange:n,className:"rounded-lg border border-border bg-panel p-4",children:[e.jsxs(E,{className:"flex w-full items-center gap-2 text-left",children:[e.jsx(K,{size:14,className:w("shrink-0 text-faint transition-transform",t&&"rotate-90")}),e.jsx("h2",{className:"text-[13px] font-semibold uppercase tracking-wide text-faint",children:"API reference"}),e.jsx("span",{className:"ml-auto text-[11px] text-muted",children:"OpenAI + Anthropic compatible"})]}),e.jsx(T,{children:e.jsx("div",{className:"mt-3 divide-y divide-border rounded-md border border-border",children:H.map(({method:a,path:s,desc:c})=>e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[e.jsx("span",{className:"w-10 shrink-0 rounded px-1 py-0.5 text-center font-mono text-[10px] font-bold uppercase",style:{background:a==="GET"?"color-mix(in srgb, var(--ok) 15%, transparent)":"color-mix(in srgb, var(--accent) 15%, transparent)",color:a==="GET"?"var(--ok)":"var(--accent)"},children:a}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-ink",children:s}),e.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted sm:block",children:c}),e.jsx(x,{text:`${h}${s}`})]},s))})})]})}export{de as DeveloperScreen};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{j as e,r as on,s as cn}from"./radix-DHuxYtIT.js";import{r as N}from"./vendor-BE0HADM8.js";import{g as O,f as ne,N as dn,O as Q,Q as un,B as D,L as q,I as je,A,t as k,R as mn,s as pn,n as le,S as Le,X as xn,T as F,k as hn,U as Ue,V as fn,W as gn,Y as Ie,Z as he,_ as Ee,$ as Be,i as Re,a0 as bn,x as ve,K as jn,E as se,a1 as vn,D as fe}from"./index-MBZ7hSNo.js";import{D as $e,o as ke,j as ze,k as V,l as H,m as de,n as J,C as kn,p as te,q as ae,E as Oe,r as ie,s as $,t as W,A as _e,a as Ge,b as Te,c as Fe,d as qe,f as Ve,h as He,i as We,u as Nn,Z as Ne,G as yn}from"./dialog-DTDvWQ5-.js";import{I as ee,S as wn}from"./common-DHHaSVnF.js";import{F as Cn,R as An,S as Z}from"./FsBrowser-Un46d4qe.js";import{P as Xe,S as Sn,W as Ke}from"./wrench-BhEqkhsG.js";import{a as X,E as re,R as Qe,C as ue}from"./refresh-cw-CCa9KASO.js";import{A as ye}from"./arrow-left-BZ7U2kS9.js";import{d as Pn,C as Ye,a as Dn,b as Mn,c as Ln}from"./collapsible-Bqsm-UEI.js";import{C as Ze}from"./circle-x-DsCSoQSk.js";import{C as Un}from"./chevron-right-DGQJG4QN.js";import{C as T}from"./check-C39bHy3w.js";const In=[["path",{d:"M12.67 19a2 2 0 0 0 1.416-.588l6.154-6.172a6 6 0 0 0-8.49-8.49L5.586 9.914A2 2 0 0 0 5 11.328V18a1 1 0 0 0 1 1z",key:"18jl4k"}],["path",{d:"M16 8 2 22",key:"vp34q"}],["path",{d:"M17.5 15H9",key:"1oz8nu"}]],En=O("feather",In);const Bn=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],Rn=O("flame",Bn);const $n=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],zn=O("folder-open",$n);const On=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],_n=O("hammer",On);const Gn=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],ge=O("layers",Gn);const Tn=[["path",{d:"M5 12h14",key:"1ays0h"}]],Fn=O("minus",Tn);const qn=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],Vn=O("network",qn);const Hn=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Je=O("package",Hn);const Wn=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09",key:"u4xsad"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z",key:"676m9"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05",key:"92ym6u"}]],Xn=O("rocket",Wn);const Kn=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],Qn=O("search-x",Kn);const Yn=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],we=O("server",Yn),Zn=dn("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[12px] font-medium leading-none",{variants:{variant:{default:"bg-panel-2 text-muted",accent:"bg-[color:color-mix(in_srgb,var(--accent)_14%,transparent)] text-accent",mono:"bg-panel-2 text-muted font-mono"}},defaultVariants:{variant:"default"}});function me({className:n,variant:s,...i}){return e.jsx("span",{className:ne(Zn({variant:s}),n),...i})}function en({open:n,onOpenChange:s,defaultSourceRepo:i,trigger:a}={}){const[o,u]=N.useState(!1),c=n!==void 0,r=c?n:o,f=p=>{c||u(p),s?.(p)},[g,h]=N.useState("choose"),[C,v]=N.useState(null),[S,b]=N.useState(""),[y,P]=N.useState(""),[B,M]=N.useState(""),[L,U]=N.useState(""),[z,l]=N.useState(null),[m,w]=N.useState(null),{add:t}=Q(),d=un();N.useEffect(()=>{r&&i&&U(i)},[r,i]);const j=()=>{h("choose"),v(null),b(""),P(""),M(""),U(""),l(null),w(null)},I=p=>{w(null),l(null),h("scanning"),d.mutate(p,{onSuccess:x=>{if(!x.found){h("notfound");return}b(x.binPath),P(x.version),M(x.suggestedName),h("confirm")},onError:x=>{w(x instanceof A?x.message:"Could not scan that location."),h("choose")}})},_=()=>{l(null),w(null);const p=L.trim();t.mutate({name:B.trim(),binPath:S,...p?{sourceRepo:p}:{}},{onSuccess:x=>{x.warning==="no_version"?k.warning("Engine added, but its version could not be detected."):k.success("Engine added"),f(!1),j()},onError:x=>{const R=x instanceof A?x.code:"",G=x instanceof A?x.message:"Could not add engine.";R==="name_already_taken"?l(G):w(G)}})};return e.jsxs($e,{open:r,onOpenChange:p=>{f(p),p||j()},children:[a!==void 0?a!==null&&e.jsx(ke,{asChild:!0,children:a}):e.jsx(ke,{asChild:!0,children:e.jsxs(D,{children:[e.jsx(Xe,{size:16})," Add engine"]})}),e.jsxs(ze,{children:[g==="choose"&&e.jsxs(e.Fragment,{children:[e.jsxs(V,{children:[e.jsx(H,{children:"Add your own engine"}),e.jsx(de,{children:"Bring any llama.cpp-compatible build or community fork. Pick the folder it lives in and we'll find the server binary for you."})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs(D,{onClick:()=>v("folder"),className:"w-full",children:[e.jsx(zn,{size:16})," Choose folder…"]}),e.jsx("button",{type:"button",onClick:()=>v("file"),className:"text-[12px] text-muted underline-offset-2 hover:text-ink hover:underline",children:"or pick the binary directly"}),e.jsx("p",{className:"text-[12px] text-faint",children:"Works with: ik_llama.cpp · TurboQuant · llama.cpp builds · any fork"}),m&&e.jsx(ee,{message:m})]}),e.jsx(J,{children:e.jsx(D,{variant:"outline",onClick:()=>f(!1),children:"Cancel"})})]}),g==="scanning"&&e.jsxs(e.Fragment,{children:[e.jsx(V,{children:e.jsx(H,{children:"Add your own engine"})}),e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-panel p-4 text-[13px] text-muted",children:[e.jsx(q,{size:18,className:"shrink-0 animate-spin text-ink"}),"Looking for the server binary…"]})]}),g==="confirm"&&e.jsxs(e.Fragment,{children:[e.jsxs(V,{children:[e.jsx(H,{children:"Confirm engine"}),e.jsx(de,{children:"Review what we found, then add it."})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5 rounded-lg border border-border bg-panel p-3 text-[13px] text-ink",children:[e.jsx(X,{size:16,className:"shrink-0",style:{color:"var(--ok)"}}),e.jsxs("span",{children:["Found ",e.jsx("code",{className:"font-mono",children:"llama-server"}),y&&y.toLowerCase()!=="unknown"?e.jsxs(e.Fragment,{children:[" · ",e.jsx("span",{className:"text-muted",children:y})]}):null]})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[13px] font-medium text-ink",children:"Name"}),e.jsx(je,{value:B,onChange:p=>M(p.target.value),autoFocus:!0}),e.jsx("span",{className:"text-[12px] text-muted",children:"Any label you choose — shown in the engine list."}),z&&e.jsx(ee,{message:z})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[13px] font-medium text-ink",children:"Binary"}),e.jsx("div",{className:"truncate rounded-md border border-border bg-panel-2 px-2.5 py-1.5 font-mono text-[12px] text-muted",title:S,children:S})]}),e.jsxs("label",{className:"flex flex-col gap-1.5",children:[e.jsx("span",{className:"text-[13px] font-medium text-ink",children:"Source repo URL (optional)"}),e.jsx(je,{value:L,onChange:p=>U(p.target.value),placeholder:"https://github.com/owner/repo"}),e.jsx("span",{className:"text-[12px] text-muted",children:"Paste the GitHub repo you built this from — lets TurboLLM tell you when a newer build is available."})]}),m&&e.jsx(ee,{message:m})]}),e.jsxs(J,{children:[e.jsxs(D,{variant:"outline",onClick:()=>h("choose"),disabled:t.isPending,children:[e.jsx(ye,{size:16})," Back"]}),e.jsx(D,{onClick:_,disabled:B.trim().length===0||t.isPending,children:t.isPending?"Adding…":"Add engine"})]})]}),g==="notfound"&&e.jsxs(e.Fragment,{children:[e.jsx(V,{children:e.jsx(H,{children:"No engine found"})}),e.jsxs("div",{className:"flex items-start gap-2.5 rounded-lg border border-border bg-panel p-4 text-[13px] text-muted",children:[e.jsx(Qn,{size:18,className:"mt-0.5 shrink-0 text-faint"}),e.jsxs("span",{children:["We couldn't find ",e.jsx("code",{className:"font-mono",children:"llama-server"})," in that folder. Pick the folder that contains it, or select the binary directly."]})]}),e.jsxs(J,{children:[e.jsxs(D,{variant:"outline",onClick:()=>h("choose"),children:[e.jsx(ye,{size:16})," Back"]}),e.jsx(D,{onClick:()=>v("file"),children:"Pick the binary directly"})]})]}),e.jsx(Cn,{open:C!==null,mode:C==="file"?"file":"folder",onOpenChange:p=>{p||v(null)},onSelect:p=>{v(null),I(p)}})]})]})}const Jn=["-DGGML_CUDA=ON","-DCMAKE_BUILD_TYPE=Release","-DCMAKE_CUDA_FLAGS=-allow-unsupported-compiler"],es=["cudart64_","cublas64_","cublaslt64_","nvrtc64_","nvrtc-builtins64_","nvjitlink_"],ns=["libcudart.so","libcublas.so","libcublasLt.so","libnvrtc.so","libnvrtc-builtins.so","libnvJitLink.so"];function ss(n,s,i){const a=(s??"").trim(),o=a?`git clone --branch ${a} --depth 1 ${n} turbo-build`:`git clone --depth 1 ${n} turbo-build`,u=`cmake -B build ${Jn.join(" ")}`;if(i==="linux"){const r=["lib64","lib","targets/x86_64-linux/lib"].flatMap(f=>ns.map(g=>`$CUDA_ROOT/${f}/${g}*`)).join(" ");return[o,"cd turbo-build",u,"cmake --build build -j --target llama-server",'CUDA_ROOT="$(dirname "$(dirname "$(command -v nvcc)")")"',`cp ${r} build/bin/ 2>/dev/null`,'# Built binary + its CUDA runtime libs: build/bin/llama-server — add it via "Add your own engine".']}const c=["bin","bin\\x64"].flatMap(r=>es.map(f=>`"%CUDA_PATH%\\${r}\\${f}*.dll"`)).join(" ");return[o,"cd turbo-build",u,"cmake --build build --config Release -j --target llama-server",`for %f in (${c}) do copy /y "%f" "build\\bin\\Release\\" >nul 2>&1`,'# Built binary + its CUDA runtime DLLs: build\\bin\\Release\\llama-server.exe — add it via "Add your own engine".']}const ts={provisioning:"Downloading CUDA Toolkit…",preparing:"Preparing…",cloning:"Cloning the repository…",configuring:"Configuring (cmake)…",compiling:"Compiling llama-server… this can take several minutes",registering:"Registering the built engine…",done:"Built and registered ✓",error:"Build failed"};function pe({open:n,onOpenChange:s,repoUrl:i,engineName:a,branch:o,mode:u="build"}){const c=mn(n),r=pn(),f=le(),g=Le(),[h,C]=N.useState(!1),[v,S]=N.useState(!1),[b,y]=N.useState(null),P=r.query.data?.build.toolchainDirs??[],[B,M]=N.useState(null),L=B??P,U=c.data?.os??"windows",l=ss(i,o,U).join(`
|
|
2
|
+
`),m=c.data?.supported??null,w=c.data?.tools??[],t=w.filter(E=>(E.id==="git"||E.id==="cmake"||E.id==="cuda")&&!E.found),d=f.data?.engineBuild,j=!!d?.active,I=!!f.data?.engineProvision?.active,_=b!==null||j,p=w.some(E=>E.id==="cuda"&&!E.found),x=m===!0&&t.length===0&&!j&&!I;N.useEffect(()=>{!b||!d||d.active||(d.phase==="done"?b==="cuda"?(c.refetch(),r.query.refetch(),y(null)):g.refresh():d.phase==="error"&&b==="build"&&g.refresh())},[b,d?.active,d?.phase]);const R=N.useRef(null);N.useEffect(()=>{R.current&&(R.current.scrollTop=R.current.scrollHeight)},[d?.log]);const G=()=>{navigator.clipboard.writeText(l).then(()=>{C(!0),setTimeout(()=>C(!1),1500)})},tn=async()=>{await r.save.mutateAsync({build:{toolchainDirs:L.map(E=>E.trim()).filter(Boolean)}}),M(null),c.refetch()},an=()=>{y("build"),g.start.mutate({repoUrl:i,branch:o,name:a})},ln=()=>{y("cuda"),g.cuda.mutate()},rn=u==="rebuild"?"Rebuild now":"Build it for me";return e.jsxs($e,{open:n,onOpenChange:s,children:[e.jsxs(ze,{className:"max-w-lg",children:[e.jsxs(V,{children:[e.jsxs(H,{children:[u==="rebuild"?"Rebuild":"Build"," ",a," from source"]}),e.jsx(de,{children:u==="rebuild"?"A newer commit is available — recompile from source and replace the binary.":"No prebuilt binary for your system — compile it here, or build it yourself and add it."})]}),c.isLoading?e.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-panel p-4 text-[13px] text-muted",children:[e.jsx(q,{size:18,className:"shrink-0 animate-spin text-ink"}),"Checking your build tools…"]}):m===!1?e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"rounded-lg border border-border bg-panel p-4 text-[13px] text-muted",children:["In-app build is currently ",e.jsx("span",{className:"font-medium text-ink",children:"Windows or Linux, with CUDA,"})," only. On your system, clone the repo and follow its upstream build instructions, then add the resulting ",e.jsx("code",{className:"font-mono",children:"llama-server"})," binary via “Add your own engine”."]}),e.jsxs("a",{href:i,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 self-start text-[13px] text-accent hover:underline",children:["Open ",a," repo + build docs ",e.jsx(re,{size:13})]})]}):e.jsxs("div",{className:"flex max-h-[60vh] flex-col gap-4 overflow-y-auto",children:[e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-faint",children:"Build prerequisites"}),e.jsx("div",{className:"flex flex-col gap-1.5 rounded-lg border border-border bg-panel p-3",children:w.map(E=>e.jsx(is,{tool:E,onDownload:E.id==="cuda"&&!E.found&&!_&&U==="windows"?ln:void 0},E.id))}),p&&!_&&e.jsx("p",{className:"text-[11px] text-faint",children:U==="windows"?e.jsxs(e.Fragment,{children:["No CUDA Toolkit found. ",e.jsx("span",{className:"text-muted",children:"Download CUDA"})," grabs NVIDIA’s official build components (~0.5 GB) automatically — no installer needed."]}):"No CUDA Toolkit found. Install it via your distro’s package manager or NVIDIA’s installer, then re-check."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-faint",children:"Build environment"}),e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-border bg-panel p-3",children:[e.jsxs("p",{className:"text-[12px] text-muted",children:["If your CUDA Toolkit or compiler lives in a conda env or a custom location (not on the system PATH), add that folder — e.g. the env’s ",e.jsx("code",{className:"font-mono",children:"bin"})," — so TurboLLM finds ",e.jsx("code",{className:"font-mono",children:"nvcc"}),". Then re-check."]}),L.map((E,oe)=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:E,onChange:be=>{const Y=[...L];Y[oe]=be.target.value,M(Y)},placeholder:"C:\\\\Users\\\\you\\\\miniconda3\\\\envs\\\\cuda\\\\Library\\\\bin",className:"min-w-0 flex-1 rounded-md border border-border bg-panel-2 px-2 py-1 font-mono text-[12px] text-ink outline-none focus:border-accent"}),e.jsx("button",{type:"button",onClick:()=>M(L.filter((be,Y)=>Y!==oe)),className:"shrink-0 rounded-md p-1 text-faint hover:text-ink","aria-label":"Remove folder",children:e.jsx(xn,{size:14})})]},oe)),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("button",{type:"button",onClick:()=>M([...L,""]),className:"inline-flex items-center gap-1 text-[12px] text-muted hover:text-ink",children:[e.jsx(Xe,{size:13})," Add folder"]}),e.jsxs("button",{type:"button",onClick:()=>{tn()},disabled:r.save.isPending||c.isFetching,className:"inline-flex items-center gap-1 text-[12px] text-accent hover:underline disabled:opacity-50",children:[r.save.isPending||c.isFetching?e.jsx(q,{size:13,className:"animate-spin"}):e.jsx(Qe,{size:13}),"Re-check"]})]})]})]}),_&&d&&e.jsx(as,{build:d,kind:b==="cuda"?"cuda":"build",logRef:R,onCancel:()=>g.cancel.mutate(),onClose:()=>s(!1)}),e.jsxs("details",{className:"group",children:[e.jsx("summary",{className:"cursor-pointer list-none text-[11px] font-medium uppercase tracking-wide text-faint hover:text-muted",children:"Or build it yourself (manual commands)"}),e.jsxs("div",{className:"mt-1.5 flex flex-col gap-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("p",{className:"text-[11px] text-faint",children:U==="linux"?"Linux + CUDA":"Windows + CUDA"}),e.jsxs("button",{type:"button",onClick:G,className:"inline-flex items-center gap-1 text-[12px] text-muted hover:text-ink",children:[h?e.jsx(X,{size:13,style:{color:"var(--ok)"}}):e.jsx(Pn,{size:13}),h?"Copied":"Copy"]})]}),e.jsx("pre",{className:"overflow-x-auto rounded-lg border border-border bg-panel-2 p-3 font-mono text-[12px] leading-relaxed text-ink",children:l})]})]})]}),e.jsxs(J,{children:[e.jsx(D,{variant:"outline",onClick:()=>s(!1),children:"Close"}),m!==!1&&e.jsxs(e.Fragment,{children:[e.jsx(D,{variant:"outline",onClick:()=>S(!0),disabled:c.isLoading||j,children:"I've built it"}),e.jsxs(D,{onClick:an,disabled:!x,children:[e.jsx(_n,{size:15,className:"mr-1.5"}),j?"Building…":rn]})]})]})]}),e.jsx(en,{open:v,onOpenChange:S,defaultSourceRepo:i,trigger:null})]})}function as({build:n,kind:s,logRef:i,onCancel:a,onClose:o}){const u=n.phase==="error",c=n.phase==="done",r=u?"var(--err, #ef4444)":c?"var(--ok)":"var(--accent)";return c&&s==="build"?e.jsxs("div",{className:"flex flex-col items-center gap-3 rounded-lg border p-5 text-center",style:{borderColor:"color-mix(in srgb, var(--ok) 40%, var(--border))",background:"color-mix(in srgb, var(--ok) 8%, transparent)"},children:[e.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-full",style:{background:"color-mix(in srgb, var(--ok) 18%, transparent)"},children:e.jsx(X,{size:28,style:{color:"var(--ok)"}})}),e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("p",{className:"text-[15px] font-semibold text-ink",children:"Engine ready 🎉"}),e.jsxs("p",{className:"text-[13px] text-muted",children:[e.jsx("span",{className:"font-medium text-ink",children:n.engine})," was built from source, bundled with its CUDA runtime, and set as your active engine. Load a model to start using it."]})]}),e.jsxs("details",{className:"w-full",children:[e.jsx("summary",{className:"cursor-pointer list-none text-[11px] uppercase tracking-wide text-faint hover:text-muted",children:"Build log"}),e.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto rounded-md border border-border bg-panel-2 p-2 text-left font-mono text-[11px] leading-relaxed text-muted",children:n.log.join(`
|
|
3
|
+
`)})]}),e.jsx(D,{onClick:o,className:"mt-1",children:"Done"})]}):e.jsxs("div",{className:"flex flex-col gap-2 rounded-lg border border-border bg-panel p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.active?e.jsx(q,{size:15,className:"shrink-0 animate-spin",style:{color:r}}):u?e.jsx(Ze,{size:15,className:"shrink-0",style:{color:r}}):e.jsx(X,{size:15,className:"shrink-0",style:{color:r}}),e.jsx("span",{className:"text-ink",children:ts[n.phase]}),n.active&&e.jsx("button",{type:"button",onClick:a,className:"ml-auto text-[12px] text-faint hover:text-ink",children:"Cancel"})]}),u&&n.error&&e.jsx("p",{className:"text-[12px]",style:{color:r},children:n.error}),n.log.length>0&&e.jsx("pre",{ref:i,className:"max-h-40 overflow-auto rounded-md border border-border bg-panel-2 p-2 font-mono text-[11px] leading-relaxed text-muted",children:n.log.join(`
|
|
4
|
+
`)})]})}function is({tool:n,onDownload:s}){return e.jsxs("div",{className:"flex items-center gap-2 text-[13px]",children:[n.found?e.jsx(X,{size:15,className:"shrink-0",style:{color:"var(--ok)"}}):e.jsx(Ze,{size:15,className:"shrink-0 text-faint"}),e.jsx("span",{className:"text-ink",children:n.name}),n.found&&n.version&&e.jsx("span",{className:"text-[12px] text-muted",children:n.version}),!n.found&&e.jsxs("span",{className:"ml-auto inline-flex items-center gap-3",children:[s&&e.jsxs("button",{type:"button",onClick:s,className:"inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[12px] font-medium transition-colors hover:opacity-80",style:{background:"color-mix(in srgb, var(--accent) 15%, transparent)",color:"var(--accent)"},children:[e.jsx(F,{size:12})," Download CUDA"]}),e.jsxs("a",{href:n.installUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[12px] text-accent hover:underline",children:[s?"or install manually":"Install"," ",e.jsx(re,{size:11})]})]})]})}function ls({status:n,activeEngineName:s,embedded:i=!1}){const a=n?.engine.state??"stopped",o=n?.engine.error,u=n?.model?.loadElapsedMs,c=a==="running"?n?.engineStats??null:null,r=a==="running"?n?.liveGeneration??null:null,f=hn(),g=Q(),h=a==="running"||a==="starting",C=a==="running"||a==="error",v=()=>f.eject.mutate(void 0,{onError:y=>k.error(y instanceof A?y.message:"Could not stop the engine.")}),S=()=>g.restart.mutate(void 0,{onError:y=>k.error(y instanceof A?y.message:"Could not restart the engine.")}),b=e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[!i&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[12px] text-muted",children:"Active engine"}),e.jsx("div",{className:"text-sm font-semibold text-ink",children:s??"None active"})]}),e.jsx(Ue,{state:a}),a==="starting"&&u!=null&&e.jsxs("span",{className:"text-[13px] text-muted",children:["Loading model… (",Math.round(u/1e3),"s)"]}),a==="running"&&n?.model&&e.jsx("span",{className:"text-[13px] text-muted truncate",children:n.model.name}),a==="running"&&!r&&(c?.activeRequests??0)>0&&e.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[12px] font-medium",style:{background:"color-mix(in srgb, var(--accent) 12%, transparent)",color:"var(--accent)"},title:"The engine is actively generating",children:[e.jsx("span",{className:"tllm-pulse inline-block h-1.5 w-1.5 rounded-full",style:{background:"var(--accent)"}}),"Generating",(c?.activeRequests??0)>1?` (${c?.activeRequests})`:"","…"]}),C&&e.jsxs(D,{size:"sm",variant:"outline",className:"ml-auto",onClick:S,disabled:g.restart.isPending,title:"Restart the engine",children:[e.jsx(An,{size:14}),"Restart"]}),h&&e.jsxs(D,{size:"sm",variant:"outline",className:C?"":"ml-auto",onClick:v,disabled:f.eject.isPending,title:"Stop the engine and unload the model",children:[e.jsx(kn,{size:14}),"Stop & unload"]})]}),(r||c)&&e.jsx(rs,{live:r,stats:c}),a==="error"&&o&&e.jsxs("div",{className:"mt-3",children:[e.jsxs("div",{className:"mb-1.5 flex items-center justify-between",children:[e.jsxs("span",{className:"text-[13px] font-medium",style:{color:"var(--err)"},children:[o.message,o.exitCode!=null&&` (exit ${o.exitCode})`]}),e.jsx(Ye,{text:(o?.logTail??[]).join(`
|
|
5
|
+
`),label:"Copy",size:14})]}),e.jsx("pre",{className:"max-h-48 overflow-auto rounded-md px-3 py-2 font-mono text-[12px] leading-[1.5]",style:{background:"var(--log-bg)",color:"var(--log-err-ink)"},children:(o.logTail??[]).join(`
|
|
6
|
+
`)||"No log output captured."})]})]});return i?b:e.jsx("div",{className:"rounded-[var(--radius)] border border-[color:var(--accent)] bg-panel p-4",children:b})}function rs({live:n,stats:s}){return e.jsxs("div",{className:"mt-3 border-t border-border pt-2",children:[n&&(n.phase==="prompt"?e.jsxs("div",{className:"mb-1.5 flex items-center gap-2 text-[13px] text-ink",children:[e.jsx("span",{className:"shrink-0",children:"Processing prompt"}),e.jsx("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-panel-2",children:e.jsx("div",{className:"h-full rounded-full transition-[width] duration-300",style:{width:`${Math.max(0,Math.min(100,n.pct))}%`,background:"var(--accent)"}})}),e.jsxs("span",{className:"shrink-0 tabular-nums font-medium",style:{color:"var(--accent)"},children:[n.pct,"%"]})]}):e.jsxs("div",{className:"mb-1.5 flex items-center gap-2 text-[13px] text-ink",children:[e.jsx("span",{className:"tllm-pulse inline-block h-1.5 w-1.5 shrink-0 rounded-full",style:{background:"var(--accent)"}}),e.jsxs("span",{className:"tabular-nums font-medium",style:{color:"var(--accent)"},children:[n.outputTokens.toLocaleString()," tok"]}),e.jsx("span",{className:"text-muted",children:"generated"})]})),s&&e.jsx(os,{stats:s})]})}function os({stats:n}){const s=[];return s.push(`${n.requests} ${n.requests===1?"request":"requests"}`),(n.inputTokens>0||n.outputTokens>0)&&s.push(`${Ce(n.inputTokens)} in / ${Ce(n.outputTokens)} out`),n.avgPromptTps>0&&s.push(`${n.avgPromptTps.toFixed(0)} tok/s prefill`),n.avgGenTps>0&&s.push(`${n.avgGenTps.toFixed(1)} tok/s gen`),s.push(cs(n.sinceMs)),e.jsx("div",{className:"text-[12px] text-muted",title:"Session totals — reset when the engine stops or restarts",children:s.join(" · ")})}function Ce(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${(n/1e3).toFixed(1)}k`:String(n)}function cs(n){const s=Math.floor(n/1e3);if(s<60)return`${s}s session`;const i=Math.floor(s/60);return i<60?`${i}m session`:`${Math.floor(i/60)}h ${i%60}m session`}const nn=N.forwardRef(({className:n,...s},i)=>e.jsx(on,{ref:i,className:ne("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border border-transparent transition-colors","data-[state=unchecked]:bg-border-strong data-[state=checked]:bg-accent","disabled:cursor-not-allowed disabled:opacity-50",n),...s,children:e.jsx(cn,{className:ne("pointer-events-none block h-4 w-4 rounded-full bg-panel shadow-[var(--shadow-1)] transition-transform","data-[state=unchecked]:translate-x-0.5 data-[state=checked]:translate-x-[18px]")})}));nn.displayName="Switch";const Ae=2e3;function ds({open:n,onOpenChange:s}){const[i,a]=N.useState([]),[o,u]=N.useState(!0),c=N.useRef(null);return N.useEffect(()=>{if(!n)return;let r=!1;fn(200).then(g=>{r||a(g.lines??[])}).catch(()=>{});const f=new EventSource(gn);return f.addEventListener("line",g=>{try{const h=JSON.parse(g.data);typeof h.line=="string"&&a(C=>{const v=[...C,h.line];return v.length>Ae?v.slice(v.length-Ae):v})}catch{}}),f.onerror=()=>{},()=>{r=!0,f.close()}},[n]),N.useEffect(()=>{o&&c.current&&(c.current.scrollTop=c.current.scrollHeight)},[i,o]),e.jsxs(Dn,{open:n,onOpenChange:s,className:"rounded-[var(--radius)] border border-border bg-panel",children:[e.jsxs("div",{className:"flex items-center justify-between px-3 py-2",children:[e.jsxs(Mn,{className:"flex items-center gap-1.5 text-[13px] font-medium text-ink",children:[e.jsx(Un,{size:14,className:ne("transition-transform",n&&"rotate-90")}),"Engine log"]}),n&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("label",{className:"flex items-center gap-1.5 text-[12px] text-muted",children:[e.jsx(nn,{checked:o,onCheckedChange:u}),"Auto-scroll"]}),e.jsx(Ye,{text:i.join(`
|
|
7
|
+
`),label:"Copy all",size:14})]})]}),e.jsx(Ln,{children:e.jsx("div",{ref:c,className:"max-h-80 overflow-auto rounded-b-[var(--radius)] px-3 py-2 font-mono text-[12px] leading-[1.5]",style:{background:"var(--log-bg)",color:"var(--log-ink)"},children:i.length===0?e.jsx("span",{style:{color:"var(--log-faint)"},children:"No log output yet."}):i.map((r,f)=>e.jsx("div",{className:"whitespace-pre-wrap break-all",children:r},f))})})]})}const us={cuda:"~550 MB",rocm:"~320 MB",sycl:"~110 MB",vulkan:"~40 MB",metal:"~11 MB",cpu:"~16 MB"},ms={cuda:"CUDA",rocm:"ROCm",sycl:"SYCL",vulkan:"Vulkan",metal:"Metal",cpu:"CPU"},Se={off:"Off",notify:"Notify",auto:"Auto"};function ps(n){const s=new Date(n).getTime();if(!Number.isFinite(s))return"";const i=Date.now()-s;if(i<6e4)return"just now";const a=Math.floor(i/6e4);if(a<60)return`${a}m ago`;const o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function xs({st:n}){return n?n.error==="offline"?e.jsx("span",{className:"text-[12px] text-muted",children:"Couldn't check for updates (offline)"}):n.error==="no_source"||!n.comparable?e.jsx("span",{className:"text-[12px] text-muted",children:"Update status unavailable for this build"}):n.hasUpdate&&n.latest?e.jsxs("span",{className:"text-[12px]",style:{color:"var(--accent)"},children:["Update available · ",n.installed||"?"," → ",n.latest]}):e.jsxs("span",{className:"text-[12px] text-muted",children:["Up to date · ",n.latest??n.installed,n.checkedAt?` · checked ${ps(n.checkedAt)}`:""]}):null}function hs({filter:n}={}){const{data:s}=le(),i=!!s?.engineProvision?.active,{data:a,isLoading:o}=Ie(i),{data:u}=he(i),c=Ee(),r=Be(),f=Q(),[g,h]=N.useState(null);if(o||!a)return null;const C=l=>l?u?.updates[l]:void 0,v=l=>(l?u?.policies[l]:void 0)??"notify",S=(l,m,w)=>{l&&r.mutate({id:l,policy:m},{onSuccess:()=>k.success(`${w} auto-update: ${Se[m]}`),onError:t=>k.error(t instanceof A?t.message:"Could not change auto-update.")})},b=i||c.backend.isPending||c.remove.isPending||c.enableBackend.isPending||c.updateBackend.isPending||f.remove.isPending,y=a.gpus[0]?.name,P=l=>c.backend.mutate(l,{onError:m=>k.error(m instanceof A?m.message:"Could not download backend.")}),B=l=>c.enableBackend.mutate(l,{onSuccess:()=>k.success("Backend enabled"),onError:m=>k.error(m instanceof A?m.message:"Could not enable backend.")}),M=(l,m)=>f.remove.mutate(l,{onSuccess:()=>k.success(`${m} disabled`),onError:w=>k.error(w instanceof A?w.message:"Could not disable backend.")}),L=l=>c.updateBackend.mutate(l,{onSuccess:m=>m?.alreadyLatest?k.success(`You're on the latest build${m.build?` (${m.build})`:""}`):k.success("Downloading the latest build…"),onError:m=>k.error(m instanceof A?m.message:"Could not update backend.")}),U=l=>c.remove.mutate(l,{onSuccess:()=>{k.success(`${g?.label??"Backend"} deleted`),h(null)},onError:m=>{h(null),k.error(m instanceof A?m.message:"Could not delete backend.")}}),z=a.backends.filter(l=>n==="recommended"?l.recommended:n==="others"?!l.recommended:!0);return e.jsxs(e.Fragment,{children:[z.map(l=>{const m=C(l.engineId),w=v(l.engineId);return e.jsxs("div",{className:"flex items-center gap-3 rounded-[var(--radius)] border border-border bg-panel p-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsxs("span",{className:"text-sm font-semibold text-ink",children:["llama.cpp (",ms[l.id]??l.label,")"]}),l.recommended&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[11px] text-accent",children:[e.jsx(Sn,{size:10})," recommended"]}),l.installed&&!l.enabled&&e.jsx(me,{variant:"mono",children:"Disabled"}),l.installed&&l.enabled&&m?.hasUpdate&&e.jsx(me,{variant:"accent",children:"Update available"})]}),e.jsx("div",{className:"mt-0.5 text-[12px] text-muted",children:l.installed?`Installed · ${y??"GPU detected"}`:`Not installed · ${us[l.id]??"download to use"}`}),l.installed&&l.enabled&&e.jsx("div",{className:"mt-0.5",children:e.jsx(xs,{st:m})})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:l.installed?e.jsx(e.Fragment,{children:e.jsxs(te,{children:[e.jsx(ae,{"aria-label":`Actions for ${l.label}`,disabled:b,className:"grid h-8 w-8 place-items-center rounded-md text-muted hover:bg-panel-2 hover:text-ink disabled:opacity-50",children:e.jsx(Oe,{size:16})}),e.jsxs(ie,{align:"end",children:[e.jsxs($,{onSelect:()=>L(l.id),disabled:i,children:[e.jsx(F,{size:14})," ",m?.hasUpdate?"Update now":"Check for update"]}),l.enabled?e.jsx($,{onSelect:()=>l.engineId&&M(l.engineId,l.label),children:"Disable"}):e.jsx($,{onSelect:()=>B(l.id),children:"Enable"}),l.enabled&&l.engineId&&e.jsxs(e.Fragment,{children:[e.jsx(W,{}),e.jsx("div",{className:"px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-faint",children:"Auto-update"}),["off","notify","auto"].map(t=>e.jsxs($,{onSelect:()=>S(l.engineId,t,l.label),className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:w===t&&e.jsx(T,{size:13,className:"text-accent"})}),Se[t]]},t))]}),e.jsx(W,{}),e.jsx($,{destructive:!0,onSelect:()=>h({id:l.id,label:l.label}),children:"Delete"})]})]})}):e.jsxs(D,{size:"sm",variant:"outline",disabled:b,onClick:()=>P(l.id),children:[i?e.jsx(q,{size:13,className:"animate-spin"}):e.jsx(F,{size:13}),"Download"]})})]},l.id)}),e.jsx(_e,{open:!!g,onOpenChange:l=>{l||h(null)},children:e.jsxs(Ge,{children:[e.jsxs(Te,{children:[e.jsxs(Fe,{children:["Delete ",g?.label,"?"]}),e.jsx(qe,{children:"Files for this engine are removed from disk. Your models are not affected."})]}),e.jsxs(Ve,{children:[e.jsx(He,{children:"Cancel"}),e.jsx(We,{onClick:()=>g&&U(g.id),disabled:c.remove.isPending,children:"Delete"})]})]})})]})}function fs(n){return/[\\/]engines[\\/]llama\.cpp-/.test(n)}function gs(n){if(fs(n.binPath)){const s=K(n.binPath)?.backend;return s?`official-llama-${s}`:"official-llama"}return n.kind==="koboldcpp"||n.kind==="mlx"||n.kind==="vllm"?n.kind:/[\\/]engines[\\/]turboquant[\\/]/.test(n.binPath)?"turboquant":`user:${n.id}`}const bs={"official-llama":"llama.cpp",koboldcpp:"KoboldCpp",mlx:"MLX",vllm:"vLLM",turboquant:"TurboQuant"};function js(n,s){if(n.startsWith("official-llama-")){const i=n.slice(15);return`llama.cpp (${sn[i]??i.toUpperCase()})`}return bs[n]??s[0]?.name??n}const sn={cuda:"CUDA",rocm:"ROCm",sycl:"SYCL",vulkan:"Vulkan",metal:"Metal",cpu:"CPU"};function K(n){const s=n.match(/llama\.cpp-([^/\\]+)-(cuda|rocm|sycl|vulkan|metal|cpu)/);return s?{tag:s[1],backend:s[2]}:null}function xe(n){if(!n)return null;const s=n.match(/b(\d+)/);return s?Number(s[1]):null}function Pe(n){const s=K(n.binPath);if(s){const i=sn[s.backend]??s.backend.toUpperCase();return`${s.tag} · ${i}`}return n.version||n.name}function vs(n){let s=null,i=-1/0;for(const a of n){const o=K(a.binPath),u=xe(o?.tag);u!=null&&u>i&&(i=u,s=a.id)}return s}function ks(n){const s=[],i=new Map;for(const a of n){const o=gs(a);let u=i.get(o);u||(u=[],i.set(o,u),s.push(o)),u.push(a)}return s.map(a=>{const u=[...i.get(a)].sort((c,r)=>{const f=xe(K(c.binPath)?.tag);return(xe(K(r.binPath)?.tag)??-1)-(f??-1)});return{key:a,label:js(a,u),members:u,latestId:vs(u)}})}function Ns(n,s){const i=n.members.find(a=>a.id===s);if(i)return i;if(n.latestId){const a=n.members.find(o=>o.id===n.latestId);if(a)return a}return n.members[0]}const ys="https://github.com/mohitsoni48/TurboLLM/issues/new?template=engine-request.yml",ws=n=>/[\\/]engines[\\/]llama\.cpp-/.test(n);function Cs(n){return n.kind==="mlx"?"mlx":n.kind==="vllm"?"vllm":n.kind==="koboldcpp"?"koboldcpp":n.kind==="llamafile"?"llamafile":/[\\/]engines[\\/]turboquant[\\/]/.test(n.binPath)?"turboquant":"llama.cpp"}function As(n,s){if(n.kind==="mlx")return"MLX · Apple Metal";if(n.kind==="vllm")return"vLLM";if(n.kind==="koboldcpp")return"KoboldCpp";if(n.kind==="llamafile")return"llamafile";if(ws(n.binPath)){const i=s?.backends.find(a=>a.active);return i?`llama.cpp · ${i.label}`:"llama.cpp"}return n.name}const Ss={"llama.cpp":{icon:fe,tagline:"The universal default",format:"GGUF",pros:["Runs on any GPU or CPU","Widest model support — every GGUF quant","Best-in-class CPU/GPU layer offload","Mature, with an OpenAI-compatible server"],cons:["Weaker under many concurrent users","GGUF only — find or convert models","Several prebuilt backends to pick from"]},turboquant:{icon:Ne,tagline:"Max context + speed",format:"GGUF",pros:["More context in the same VRAM","KV compression (~3.8–6.4× vs F16)","NextN speculative decoding for throughput","Keeps GGUF models + the llama-server API"],cons:["KV quant can slightly affect quality","Speculative gains are model-specific","Single-maintainer fork; upstream lag"]},vllm:{icon:we,tagline:"Server-grade throughput",format:"safetensors",pros:["Best throughput under concurrent load","PagedAttention serves 2–4× more users","Continuous batching saturates the GPU","Built-in OpenAI-compatible server"],cons:["NVIDIA/Linux-first; Windows needs WSL2","Heavy multi-GB install (PyTorch)","Slower single-request latency"]},sglang:{icon:Vn,tagline:"Throughput + structured output",format:"safetensors",pros:["Near-zero-overhead JSON / grammar output","RadixAttention prefix caching","Very high throughput + batching","OpenAI-compatible server out of the box"],cons:["Linux + NVIDIA only","Heavy install; needs recent CUDA","Overkill for a single desktop user"]},mlx:{icon:se,tagline:"Native Apple Silicon",format:"MLX",pros:["Fastest tok/s on Apple Silicon (small models)","Built on Apple's optimized MLX framework","Ships an OpenAI-compatible mlx_lm.server","One-line install, no compiling"],cons:["macOS / Apple Silicon only","New models hit GGUF first, MLX lags","Weak for high-concurrency serving"]},"ik_llama.cpp":{icon:Rn,tagline:"CPU + big-MoE specialist",format:"GGUF",pros:["SOTA low-bit IQK / Trellis quants","Best-in-class CPU + hybrid MoE speed","Strong DeepSeek MLA / FlashMLA performance","Same llama-server + GGUF flow"],cons:["No prebuilts — build from source","CPU + CUDA only (no ROCm/Metal)","Some quant types are fork-only"]},koboldcpp:{icon:En,tagline:"One file, creative tooling",format:"GGUF",pros:["Single-file executable, zero install","OpenAI + KoboldAI APIs","Built-in image, TTS and Whisper endpoints","Rich roleplay / story tooling"],cons:["GGUF / GGML only","Effectively one maintainer","Roleplay-focused UI is niche"]},llamafile:{icon:Je,tagline:"One portable file",format:"GGUF",pros:["Single portable file, no install","One file bundles model + runtime","Runs across Windows / macOS / Linux","OpenAI + Anthropic-compatible server"],cons:["Windows caps executables at 4 GB","Release cadence has slowed","Occasional GPU driver issues"]},exllamav3:{icon:yn,tagline:"Big models on limited NVIDIA VRAM",format:"EXL3 / EXL2",pros:["EXL3 stays coherent at very low bitrates","Strong quality at 2–3 bpw on consumer NVIDIA","Fast GPU inference, low first-token latency","OpenAI-compatible via TabbyAPI"],cons:["Windows / Linux CUDA only — no macOS/AMD","EXL3 format, not GGUF","TabbyAPI is a maturing hobby server"]},"rapid-mlx":{icon:Xn,tagline:"Fastest on Apple Silicon",format:"MLX",pros:["Fastest MLX path (vendor claims 2–4× Ollama)","Drop-in OpenAI + Anthropic server","Continuous batching + prompt caching","17 tool-call parsers with recovery"],cons:["macOS Apple Silicon only","MLX-format models only, no GGUF","Beta; single-maintainer project"]},nexa:{icon:se,tagline:"CPU · GPU · NPU, on-device",format:"GGUF · MLX · .nexa",pros:["Rare NPU support: Qualcomm, Intel, Apple ANE","Runs GGUF, MLX and .nexa formats","Day-0 support for new architectures","OpenAI-compatible server, Qualcomm-backed"],cons:["NPU path needs a free license key","NexaML engine is proprietary",".nexa format locks you in"]},ktransformers:{icon:ge,tagline:"Huge MoE on one GPU + RAM",format:"GGUF · safetensors",pros:["Runs DeepSeek-class MoE on one consumer GPU","Hybrid uses big RAM, not just VRAM","Intel AMX / AVX-512 kernels give real speedups","OpenAI-compatible server + web UI"],cons:["No prebuilts; compile from source","Research project, experimental","Best speed needs Intel AMX + lots of RAM"]},lmdeploy:{icon:we,tagline:"High-throughput NVIDIA serving",format:"safetensors / AWQ",pros:["TurboMind kernels can beat vLLM throughput","Strong AWQ / MXFP4 / FP8 quant support","OpenAI-compatible api_server","Prebuilt pip wheels (incl. Windows)"],cons:["No GGUF — needs HF / AWQ weights","NVIDIA-CUDA only","Windows limited to a single GPU"]},"tensorrt-llm":{icon:Ne,tagline:"Peak NVIDIA throughput",format:"safetensors",pros:["Peak throughput on NVIDIA GPUs","OpenAI-compatible trtllm-serve","PyTorch backend skips engine builds","FP8 / FP4 / INT4 for Blackwell / Hopper"],cons:["NVIDIA + Linux only (Docker)","TensorRT backend needs per-model builds","Heavyweight setup"]}},Ps={icon:fe,tagline:"Inference engine",format:"",pros:[],cons:[]},Ds=n=>Ss[n]??Ps,Ms={ok:"var(--ok)",caution:"var(--warn)",none:"var(--err)"};function Ls(n){return n.compatible.length===0?{level:"none",label:n.incompatibleReason??"Not supported on your hardware"}:n.compatible.every(s=>!s.hasPrebuilt)?{level:"caution",label:"Runs after a build"}:{level:"ok",label:"Compatible"}}function Us({level:n,label:s}){const i=Ms[n];return e.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-medium",style:{background:`color-mix(in srgb, ${i} 12%, transparent)`,color:i},children:[e.jsx("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full",style:{background:i}}),s]})}const Is={nvidia:"NVIDIA",amd:"AMD",intel:"Intel",apple:"Apple"};function Es(n){const s=n.compatible[0]??n.variants[0],i=s?.requires?.gpuVendor?.map(u=>Is[u]??u).join(" / "),a=s?.requires?.minVramMb?`${Math.round(s.requires.minVramMb/1024)} GB+`:null,o=[i,a].filter(Boolean);return o.length?o.join(" · "):"Any GPU / CPU"}const Bs={win32:"Win",linux:"Linux",darwin:"Mac"};function Rs(n){return n.map(s=>Bs[s]??s).join(" · ")}function tt(){const n=Re(),{data:s}=le(),i=!!s?.engineProvision?.active,a=bn(i),o=Ie(i),u=ve(h=>h.logPanelOpen),c=ve(h=>h.setLogPanelOpen),r=n.data,f=r?.activeEngineId??"",g=r?.engines.find(h=>h.id===f)??null;return e.jsxs("div",{className:"w-full px-4 py-6 md:px-6",children:[e.jsx(wn,{title:"Engines",description:"Pick the engine that fits your hardware. Each card shows what it’s good at, its trade-offs, and whether it runs on your machine."}),e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx($s,{rec:a.data,list:r,backends:o.data,activeEngine:g}),n.isError?e.jsx(ee,{message:n.error instanceof A?n.error.message:"Could not load engines.",onRetry:()=>{n.refetch()}}):e.jsx(zs,{rec:a.data,isLoading:a.isLoading,activeCatalogId:g?Cs(g):null,provisioning:i}),g&&e.jsx(ds,{open:u,onOpenChange:c})]})]})}function $s({rec:n,list:s,backends:i,activeEngine:a}){const o=Q(),{data:u}=jn(),{data:c}=he(),{data:r}=le(),f=Le(),[g,h]=N.useState(!1),C=N.useRef(!1),v=r?.engineBuild,S=!!v?.active;N.useEffect(()=>{C.current&&!S&&v&&(f.refresh(),v.phase==="done"&&v.engine&&v.engine!=="CUDA Toolkit"?k.success(`${v.engine} built and added — it's now your active engine.`):v.phase==="error"&&v.error&&v.engine!=="CUDA Toolkit"&&k.error(v.error)),C.current=S},[S]);const b=a?c?.updates[a.id]:void 0,y=!!b?.rebuild&&!!b?.hasUpdate&&!!a?.sourceRepo,P=n?.hardware,B=Nn(u?.gpus??[]),M=P?.gpuName??B.gpuName,L=P?.vramMb??B.vramMb,U=P?Me(P.platform):u?.os.split("/")[0]?Me(u.os.split("/")[0]):"",z=[M??"CPU-only",L>0?`${(L/1024).toFixed(0)} GB`:null,U||null].filter(Boolean).join(" · "),l=s?.engines??[],m=N.useMemo(()=>ks(l),[l]),w=a?m.find(p=>p.members.some(x=>x.id===a.id))??null:null,t=a?As(a,i):null,d=o.activate.isPending,j=r?.engine.state??"stopped",I=p=>{p!==a?.id&&o.activate.mutate(p,{onError:x=>k.error(x instanceof A?x.message:"Could not switch engine.")})},_=p=>{const x=Ns(p,a?.id??null);x&&I(x.id)};return e.jsxs("div",{className:"rounded-lg border border-border bg-panel p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[12px] font-medium text-muted",children:[e.jsx(se,{size:13,className:"shrink-0 text-accent"}),"Your hardware"]}),e.jsx("div",{className:"mt-1 truncate text-base font-semibold text-ink",children:z||"Detecting…"})]}),e.jsxs("div",{className:"flex flex-col items-start gap-1.5 md:items-end",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-muted",children:"Running now"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[e.jsxs(te,{children:[e.jsxs(ae,{disabled:d||m.length===0,className:"flex h-9 w-full min-w-0 items-center gap-2 rounded-lg border border-border bg-bg px-3 text-[13px] text-ink transition-colors hover:border-[color:var(--accent)] disabled:opacity-60 md:w-auto md:min-w-[220px]",children:[e.jsx(Ue,{state:j,dotOnly:!0,className:"shrink-0"}),e.jsx("span",{className:"flex-1 truncate text-left",children:w?.label??(m.length?"No engine active":"No engine installed")}),e.jsx(ue,{size:14,className:"shrink-0 text-muted"})]}),e.jsxs(ie,{align:"end",className:"w-[280px]",children:[e.jsx("div",{className:"px-2 py-1.5 text-[11px] font-medium uppercase tracking-wide text-muted",children:"Installed engines"}),m.length===0&&e.jsx("div",{className:"px-2 py-1.5 text-[12px] text-muted",children:"Install an engine below to get started."}),m.map(p=>{const x=p.members.some(G=>!!c?.updates[G.id]?.rebuild&&!!c?.updates[G.id]?.hasUpdate),R=p.key===w?.key;return e.jsxs($,{onSelect:()=>_(p),className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:R&&e.jsx(T,{size:14,className:"text-accent"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:p.label}),p.members.length>1&&e.jsxs("span",{className:"shrink-0 text-[11px] text-muted",children:[p.members.length," builds"]}),x&&e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:"var(--accent)"},children:"rebuild"}),R&&e.jsx("span",{className:"shrink-0 text-[11px] text-accent",children:"active"})]},p.key)}),e.jsx(W,{}),e.jsx("div",{className:"px-2 py-1.5 text-[11px] text-muted",children:"Install more engines below ↓"})]})]}),w&&w.members.length>1&&e.jsxs(te,{children:[e.jsxs(ae,{disabled:d,className:"flex h-9 w-full min-w-0 items-center gap-2 rounded-lg border border-border bg-bg px-3 text-[13px] text-ink transition-colors hover:border-[color:var(--accent)] disabled:opacity-60 md:w-auto md:min-w-[160px]",children:[e.jsx(ge,{size:14,className:"shrink-0 text-accent"}),e.jsx("span",{className:"flex-1 truncate text-left",children:a?Pe(a):"Choose a build"}),e.jsx(ue,{size:14,className:"shrink-0 text-muted"})]}),e.jsxs(ie,{align:"end",className:"w-[260px]",children:[e.jsx("div",{className:"px-2 py-1.5 text-[11px] font-medium uppercase tracking-wide text-muted",children:"Build"}),w.members.map(p=>e.jsxs($,{onSelect:()=>I(p.id),className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:p.id===a?.id&&e.jsx(T,{size:14,className:"text-accent"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:Pe(p)}),p.id===w.latestId&&e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:"var(--ok)"},children:"latest"})]},p.id))]})]})]}),t&&e.jsx("span",{className:"text-[11px] text-muted",children:t}),y&&e.jsxs("button",{type:"button",onClick:()=>h(!0),className:"inline-flex items-center gap-1 rounded-md px-2 py-0.5 text-[11px] font-medium transition-colors hover:opacity-80",style:{background:"color-mix(in srgb, var(--accent) 15%, transparent)",color:"var(--accent)"},children:[e.jsx(Ke,{size:11,className:"shrink-0"}),"Rebuild available",b?.installed&&b?.latest?` · ${b.installed} → ${b.latest}`:""]})]})]}),a&&e.jsx("div",{className:"mt-4 border-t border-border pt-3",children:e.jsx(ls,{status:r,activeEngineName:a.name,embedded:!0})}),y&&a?.sourceRepo&&e.jsx(pe,{open:g,onOpenChange:h,repoUrl:a.sourceRepo,branch:a.sourceBranch,engineName:a.name,mode:"rebuild"})]})}function zs({rec:n,isLoading:s,activeCatalogId:i,provisioning:a}){const o=vn(a),{data:u}=Re(),{data:c}=he(a),r=Ee(),f=Q(),g=Be(),[h,C]=N.useState(null),v=N.useMemo(()=>{const t=new Map;for(const d of o.data?.engines??[])t.set(d.id,d);return t},[o.data]);if(s||!n)return e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx(De,{children:"Install & manage"}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[e.jsx(Z,{className:"h-52 w-full"}),e.jsx(Z,{className:"h-52 w-full"}),e.jsx(Z,{className:"h-52 w-full"}),e.jsx(Z,{className:"h-52 w-full"})]})]});const S=a||r.vllm.isPending||r.mlx.isPending||r.turboquant.isPending||r.koboldcpp.isPending||r.llamafile.isPending||r.updateVllm.isPending||r.updateMlx.isPending||r.updateTurboquant.isPending||r.updateKoboldcpp.isPending||r.updateLlamafile.isPending||f.remove.isPending||f.purge.isPending,b=t=>t.installEndpoint==="/api/v1/engines/vllm"?r.vllm:t.installEndpoint==="/api/v1/engines/mlx"?r.mlx:t.installEndpoint==="/api/v1/engines/turboquant"?r.turboquant:t.installEndpoint==="/api/v1/engines/koboldcpp"?r.koboldcpp:t.installEndpoint==="/api/v1/engines/llamafile"?r.llamafile:null,y=t=>t.installEndpoint==="/api/v1/engines/vllm"?r.updateVllm:t.installEndpoint==="/api/v1/engines/mlx"?r.updateMlx:t.installEndpoint==="/api/v1/engines/turboquant"?r.updateTurboquant:t.installEndpoint==="/api/v1/engines/koboldcpp"?r.updateKoboldcpp:t.installEndpoint==="/api/v1/engines/llamafile"?r.updateLlamafile:null,P=t=>{const d=u?.engines??[];if(t.sourceEngineId)return t.sourceEngineId;if(t.provision==="pip")return d.find(j=>j.kind===t.kind)?.id;if(t.id==="turboquant")return d.find(j=>/[\\/]engines[\\/]turboquant[\\/]/.test(j.binPath))?.id;if(t.id==="koboldcpp"||t.id==="llamafile")return d.find(j=>j.kind===t.kind)?.id},B=t=>{const d=b(t);d&&d.mutate(void 0,{onError:j=>k.error(j instanceof A?j.message:`Could not install ${t.name}.`)})},M=t=>{if(t.sourceBuilt&&t.sourceBinPath){f.add.mutate({binPath:t.sourceBinPath,name:t.name,sourceRepo:t.homepage,sourceBranch:t.sourceBranch||void 0},{onSuccess:()=>k.success(`${t.name} enabled`),onError:j=>k.error(j instanceof A?j.message:`Could not enable ${t.name}.`)});return}const d=b(t);d&&d.mutate(void 0,{onSuccess:()=>k.success(`${t.name} enabled`),onError:j=>k.error(j instanceof A?j.message:`Could not enable ${t.name}.`)})},L=t=>{const d=P(t);if(!d){k.error(`Could not find the installed ${t.name} engine.`);return}f.remove.mutate(d,{onSuccess:()=>k.success(`${t.name} disabled`),onError:j=>k.error(j instanceof A?j.message:`Could not disable ${t.name}.`)})},U=t=>{const d=y(t);d&&d.mutate(void 0,{onSuccess:()=>k.success(`Updating ${t.name} to the latest release…`),onError:j=>k.error(j instanceof A?j.message:`Could not update ${t.name}.`)})},z=(t,d)=>{const j=P(t);if(!j){k.error(`Could not find the installed ${t.name} engine.`);return}g.mutate({id:j,policy:d},{onError:I=>k.error(I instanceof A?I.message:"Could not change auto-update.")})},l=t=>{const d=P(t);if(!d){k.error(`Could not find the installed ${t.name} engine to delete.`);return}C({e:t,registryId:d})},m=()=>{h&&f.purge.mutate(h.registryId,{onSuccess:()=>{k.success(`${h.e.name} deleted`),C(null)},onError:t=>{C(null),k.error(t instanceof A?t.message:`Could not delete ${h.e.name}.`)}})},w=n.recommendation.fits.filter(t=>{const d=v.get(t.engine.id);return t.engine.id==="vllm"||!d||d.supportedHere!==!1}).sort((t,d)=>(t.compatible.length===0?1:0)-(d.compatible.length===0?1:0));return e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx(De,{children:"Install & manage"}),e.jsx("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:w.map(t=>{const d=P(v.get(t.engine.id)??t.engine);return e.jsx(Os,{fit:t,catalog:v.get(t.engine.id),isActive:i===t.engine.id,anyPending:S,provisioning:a,updateStatus:d?c?.updates[d]:void 0,policy:(d?c?.policies[d]:void 0)??"notify",installFor:b,onInstall:B,onEnable:M,onDisable:L,onUpdate:U,onDelete:l,onSetPolicy:z},t.engine.id)})}),e.jsxs("div",{className:"mt-1 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-dashed border-border-strong bg-panel px-4 py-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"text-sm font-medium text-ink",children:"Add your own engine"}),e.jsx("span",{className:"text-[12px] text-muted",children:" — point at any llama-server compatible binary, or ask for a new one."})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-3",children:[e.jsxs("a",{href:ys,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[12px] text-muted hover:text-ink",children:["Request an engine ",e.jsx(re,{size:11})]}),e.jsx(en,{})]})]}),e.jsx(_e,{open:!!h,onOpenChange:t=>{t||C(null)},children:e.jsxs(Ge,{children:[e.jsxs(Te,{children:[e.jsxs(Fe,{children:["Delete ",h?.e.name,"?"]}),e.jsx(qe,{children:"Files for this engine are removed from disk. Your models are not affected."})]}),e.jsxs(Ve,{children:[e.jsx(He,{children:"Cancel"}),e.jsx(We,{onClick:m,disabled:f.purge.isPending,children:"Delete"})]})]})})]})}function Os({fit:n,catalog:s,isActive:i,anyPending:a,provisioning:o,updateStatus:u,policy:c,installFor:r,onInstall:f,onEnable:g,onDisable:h,onUpdate:C,onDelete:v,onSetPolicy:S}){const b=n.engine,y=Ds(b.id),P=y.icon,[B,M]=N.useState(!1),[L,U]=N.useState(!1),[z,l]=N.useState(!1),m=b.id==="llama.cpp",w=!!s?.sourceBuilt,t=n.compatible.length===0,d=!t&&n.compatible.every(x=>!x.hasPrebuilt),j=!!s?.installed,I=!!s?.enabled,_=j&&!I,p=Ls(n);return e.jsxs("div",{className:"flex flex-col rounded-xl border border-border bg-panel p-4",children:[e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"grid h-9 w-9 shrink-0 place-items-center rounded-[9px] bg-panel-2 text-muted",children:e.jsx(P,{size:18})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[e.jsx("span",{className:"text-sm font-semibold text-ink",children:b.name}),i?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium",style:{color:"var(--ok)"},children:[e.jsx(T,{size:11})," Active"]}):I?e.jsxs("span",{className:"inline-flex items-center gap-1 text-[11px] font-medium text-muted",children:[e.jsx(T,{size:11})," Installed"]}):_?e.jsx(me,{variant:"mono",children:"Disabled"}):null]}),e.jsx("div",{className:"mt-0.5 text-[12px] text-muted",children:y.tagline||b.description})]}),e.jsx(Us,{level:p.level,label:p.label})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[e.jsx(ce,{icon:e.jsx(se,{size:11}),children:Es(n)}),e.jsx(ce,{icon:e.jsx(fe,{size:11}),children:Rs(b.platforms)}),y.format&&e.jsx(ce,{icon:e.jsx(Je,{size:11}),children:y.format})]}),(y.pros.length>0||y.cons.length>0)&&e.jsxs("div",{className:"mt-3 grid grid-cols-1 gap-x-4 gap-y-3 sm:grid-cols-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-semibold",style:{color:"var(--ok)"},children:"Pros"}),e.jsx("ul",{className:"mt-1.5 flex flex-col gap-1.5",children:y.pros.map((x,R)=>e.jsxs("li",{className:"flex gap-1.5 text-[12px] leading-snug text-ink",children:[e.jsx(T,{size:13,className:"mt-px shrink-0",style:{color:"var(--ok)"}}),e.jsx("span",{children:x})]},R))})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[11px] font-semibold",style:{color:"var(--warn)"},children:"Cons"}),e.jsx("ul",{className:"mt-1.5 flex flex-col gap-1.5",children:y.cons.map((x,R)=>e.jsxs("li",{className:"flex gap-1.5 text-[12px] leading-snug text-ink",children:[e.jsx(Fn,{size:13,className:"mt-px shrink-0",style:{color:"var(--warn)"}}),e.jsx("span",{children:x})]},R))})]})]}),e.jsxs("div",{className:"mt-3 flex items-center justify-between gap-2 border-t border-border pt-3",children:[s?e.jsxs("a",{href:s.homepage,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1 text-[11px] text-muted hover:text-ink",title:s.homepage,children:[e.jsx(re,{size:11})," docs"]}):e.jsx("span",{}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:m?e.jsxs(D,{size:"sm",variant:"outline",onClick:()=>l(x=>!x),children:[e.jsx(ge,{size:13})," Manage GPU builds",e.jsx(ue,{size:13,className:"transition-transform",style:{transform:z?"rotate(180deg)":"none"}})]}):s?j?e.jsxs(e.Fragment,{children:[I&&u?.hasUpdate&&!w&&e.jsxs(D,{size:"sm",variant:"outline",disabled:o,onClick:()=>C(s),children:[e.jsx(F,{size:13})," Update"]}),e.jsxs(te,{children:[e.jsx(ae,{"aria-label":`Actions for ${b.name}`,disabled:a,className:"grid h-8 w-8 place-items-center rounded-md text-muted hover:bg-panel-2 hover:text-ink disabled:opacity-50",children:e.jsx(Oe,{size:16})}),e.jsxs(ie,{align:"end",children:[w?e.jsxs($,{onSelect:()=>U(!0),disabled:a,children:[e.jsx(Qe,{size:14})," ",u?.hasUpdate?"Rebuild (new commit)":"Rebuild"]}):e.jsxs($,{onSelect:()=>C(s),disabled:o,children:[e.jsx(F,{size:14})," ",u?.hasUpdate?"Update now":"Check for update"]}),I?e.jsx($,{onSelect:()=>h(s),children:"Disable"}):e.jsx($,{onSelect:()=>g(s),children:"Enable"}),I&&e.jsxs(e.Fragment,{children:[e.jsx(W,{}),e.jsx("div",{className:"px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-muted",children:"Auto-update"}),["off","notify","auto"].map(x=>e.jsxs($,{onSelect:()=>S(s,x),className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:c===x&&e.jsx(T,{size:13,className:"text-accent"})}),_s[x]]},x))]}),e.jsx(W,{}),e.jsx($,{destructive:!0,onSelect:()=>v(s),children:"Delete"})]})]}),w&&s&&e.jsx(pe,{open:L,onOpenChange:U,repoUrl:s.homepage,branch:s.sourceBranch||void 0,engineName:b.name,mode:"rebuild"})]}):d?e.jsxs(e.Fragment,{children:[e.jsxs(D,{size:"sm",variant:"outline",onClick:()=>M(!0),title:"No prebuilt binary — build it from source with a guided walkthrough.",children:[e.jsx(Ke,{size:13})," Build from source"]}),e.jsx(pe,{open:B,onOpenChange:M,repoUrl:s.homepage,engineName:b.name})]}):e.jsxs(D,{size:"sm",disabled:a||t||!r(s),onClick:()=>f(s),title:t?n.incompatibleReason??"Not supported on this hardware":`Install ${b.name}`,children:[r(s)?.isPending?e.jsx(q,{size:13,className:"animate-spin"}):e.jsx(F,{size:13}),"Install"]}):null})]}),m&&z&&e.jsxs("div",{className:"mt-3 flex flex-col gap-2 border-t border-border pt-3",children:[e.jsx("p",{className:"text-[12px] text-muted",children:"Download or update a GPU backend below. Pick the active build from “Running now” at the top."}),e.jsx(hs,{})]}),!m&&I&&e.jsx("div",{className:"mt-2",children:e.jsx(Ts,{st:u})})]})}function ce({icon:n,children:s}){return e.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-panel-2 px-2 py-1 text-[11px] text-ink",children:[e.jsx("span",{className:"shrink-0 text-muted",children:n}),s]})}const _s={off:"Off",notify:"Notify",auto:"Auto"};function Gs(n){const s=new Date(n).getTime();if(!Number.isFinite(s))return"";const i=Date.now()-s;if(i<6e4)return"just now";const a=Math.floor(i/6e4);if(a<60)return`${a}m ago`;const o=Math.floor(a/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function Ts({st:n,repoUrl:s}){return n?n.error==="offline"?e.jsx("span",{className:"text-[11px] text-muted",children:"Couldn't check for updates (offline)"}):n.error==="no_source"||!n.comparable?e.jsx("span",{className:"text-[11px] text-muted",children:"Update status unavailable"}):n.rebuild&&n.hasUpdate?e.jsxs("span",{className:"text-[11px]",style:{color:"var(--accent)"},children:["Newer source available · rebuild"," ",s&&e.jsx("a",{href:s,target:"_blank",rel:"noreferrer",className:"underline-offset-2 hover:underline",children:"(open repo)"})]}):n.hasUpdate&&n.latest?e.jsxs("span",{className:"text-[11px]",style:{color:"var(--accent)"},children:["Update available · ",n.installed||"?"," → ",n.latest]}):e.jsxs("span",{className:"text-[11px] text-muted",children:["Up to date · ",n.latest??n.installed,n.checkedAt?` · checked ${Gs(n.checkedAt)}`:""]}):null}function De({children:n}){return e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-muted",children:n})}const Fs={darwin:"macOS",win32:"Windows",linux:"Linux"};function Me(n){return Fs[n]??n}export{tt as EnginesScreen};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./radix-DHuxYtIT.js";import{g as d,f as y,q as N,B as o,A as w,r as C}from"./index-MBZ7hSNo.js";import{r as c}from"./vendor-BE0HADM8.js";import{D,j as z,k as F,l as S,m as _,F as E,n as M}from"./dialog-DTDvWQ5-.js";import{I as R}from"./common-DHHaSVnF.js";import{C as A}from"./check-C39bHy3w.js";const B=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],I=d("arrow-right",B);const P=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],q=d("arrow-up",P);const T=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],$=d("file",T);const G=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],L=d("rotate-cw",G);function Q({className:s,...r}){return e.jsx("div",{className:y("tllm-pulse rounded-md bg-panel-2",s),...r})}function X({open:s,onOpenChange:r,onSelect:k,mode:i="file",title:v,description:m}){const[b,l]=c.useState(null),{data:a,isFetching:n,error:h,refetch:f}=N(b,s);c.useEffect(()=>{s&&l(null)},[s]);const[p,u]=c.useState("");c.useEffect(()=>{a?.path&&a.path!=="::drives"&&u(a.path)},[a?.path]);const j=()=>{const t=p.trim();t&&l(t)},g=t=>{k(t),r(!1)};return e.jsx(D,{open:s,onOpenChange:r,children:e.jsxs(z,{className:"max-w-lg",children:[e.jsxs(F,{children:[e.jsx(S,{children:v??(i==="folder"?"Choose engine folder":"Browse for binary")}),e.jsx(_,{children:m||(i==="folder"?e.jsxs(e.Fragment,{children:["Open the folder that contains your engine build — on any drive — then click"," ",e.jsx("span",{className:"font-medium text-ink",children:"Select this folder"}),". We'll scan it for ",e.jsx("code",{className:"font-mono",children:"llama-server"}),"."]}):e.jsxs(e.Fragment,{children:["Navigate to the compiled ",e.jsx("code",{className:"font-mono",children:"llama-server"})," executable on any drive and click it to select."]}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{variant:"outline",size:"iconSm",onClick:()=>a?.parent!=null&&l(a.parent),disabled:!a||a.parent==null||n,"aria-label":"Up one folder",children:e.jsx(q,{size:16})}),e.jsx("input",{value:p,onChange:t=>u(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),j())},placeholder:a?.path==="::drives"?"This PC — paste or type a path":"Paste or type a path",spellCheck:!1,"aria-label":"Path",className:"min-w-0 flex-1 rounded-md border border-border bg-bg px-2.5 py-1.5 font-mono text-[12px] text-ink outline-none placeholder:text-faint focus:border-[color:var(--accent)]"}),e.jsx(o,{variant:"outline",size:"iconSm",onClick:j,disabled:!p.trim()||n,"aria-label":"Go to path",title:"Go to this path",children:e.jsx(I,{size:16})}),e.jsx(o,{variant:"outline",size:"iconSm",onClick:()=>{f()},disabled:n,"aria-label":"Refresh",children:e.jsx(L,{size:16,className:n?"animate-spin":void 0})})]}),h?e.jsx(R,{message:h instanceof w?h.message:"Could not read that folder.",onRetry:()=>{f()},className:"mt-3"}):e.jsxs("ul",{className:"mt-3 max-h-[320px] overflow-y-auto rounded-md border border-border",children:[a&&a.entries.length===0&&e.jsx("li",{className:"px-3 py-6 text-center text-[13px] text-muted",children:"This folder is empty."}),a?.entries.map(t=>{const x=i==="folder"&&!t.isDir;return e.jsx("li",{children:e.jsxs("button",{type:"button",disabled:x,onClick:()=>t.isDir?l(t.path):g(t.path),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-[13px] text-ink "+(x?"cursor-default text-faint":"hover:bg-panel-2"),children:[t.isDir?e.jsx(E,{size:16,className:"shrink-0 text-muted"}):e.jsx($,{size:16,className:x?"shrink-0 text-faint":"shrink-0 text-muted"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:C(t.name,48)}),i!=="folder"&&!t.isDir&&e.jsx("span",{className:"shrink-0 text-[11px] text-muted",children:"Select"})]})},t.path)})]}),e.jsxs(M,{children:[e.jsx(o,{variant:"outline",onClick:()=>r(!1),children:"Cancel"}),i!=="file"&&e.jsxs(o,{onClick:()=>a?.path&&g(a.path),disabled:!a?.path||n||a.path==="::drives",children:[e.jsx(A,{size:16})," Select this folder"]})]})]})})}export{X as F,L as R,Q as S};
|