turbollm 1.7.2 → 1.7.3

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.
Files changed (115) hide show
  1. package/README.md +13 -11
  2. package/dist/chunk-TPYU5ZAX.js +175 -0
  3. package/dist/cli.js +2124 -1948
  4. package/dist/distiller-UROKYEBN.js +9 -0
  5. package/dist/webdist/assets/AgentEditPage-DLuckXeR.js +1 -0
  6. package/dist/webdist/assets/ChatScreen-BOZjtqGu.js +65 -0
  7. package/dist/webdist/assets/CustomizeScreen-DoVGTM4C.js +4 -0
  8. package/dist/webdist/assets/DeveloperScreen-BJ7m4ZxK.js +1 -0
  9. package/dist/webdist/assets/EnginesScreen-D3b9VNx0.js +7 -0
  10. package/dist/webdist/assets/{MessageBubble-COuZ8jTd.js → MessageBubble-mJwFfOab.js} +15 -16
  11. package/dist/webdist/assets/ModelDetailDialog-M2tPWvP4.js +1 -0
  12. package/dist/webdist/assets/ModelDirs-CaIf1TUh.js +1 -0
  13. package/dist/webdist/assets/{ModelsScreen-DncNvsj6.js → ModelsScreen--sPDS_sx.js} +2 -2
  14. package/dist/webdist/assets/SettingsScreen-lBpo_MAD.js +1 -0
  15. package/dist/webdist/assets/SkillEditPage-B5S9Gtlh.js +1 -0
  16. package/dist/webdist/assets/WorkspaceScreen-Cpm-gLG1.js +1 -0
  17. package/dist/webdist/assets/agent-api-B3GXwr4Y.js +1 -0
  18. package/dist/webdist/assets/{arc-BrQAHE5c.js → arc-CRcL8nar.js} +1 -1
  19. package/dist/webdist/assets/{architectureDiagram-3BPJPVTR-DzOwDk0E.js → architectureDiagram-3BPJPVTR-BmOKGMd0.js} +1 -1
  20. package/dist/webdist/assets/{blockDiagram-GPEHLZMM-Cbs2lNCh.js → blockDiagram-GPEHLZMM-C4vusmQ-.js} +1 -1
  21. package/dist/webdist/assets/{c4Diagram-AAUBKEIU-BAull9Yv.js → c4Diagram-AAUBKEIU-DdY0YXKs.js} +1 -1
  22. package/dist/webdist/assets/channel-BB6NPD_B.js +1 -0
  23. package/dist/webdist/assets/chat-api-DrMO_g5m.js +3 -0
  24. package/dist/webdist/assets/check-BLFw3EpE.js +1 -0
  25. package/dist/webdist/assets/chevron-left-CfyO2AXW.js +1 -0
  26. package/dist/webdist/assets/chevron-right--1OIa5uV.js +1 -0
  27. package/dist/webdist/assets/{chunk-2J33WTMH-B38k4sJL.js → chunk-2J33WTMH-DzCJsNN1.js} +1 -1
  28. package/dist/webdist/assets/{chunk-4BX2VUAB-VxAkYvb7.js → chunk-4BX2VUAB-BNPfO47j.js} +1 -1
  29. package/dist/webdist/assets/{chunk-55IACEB6-CAz9ZWyR.js → chunk-55IACEB6-_vELiE2B.js} +1 -1
  30. package/dist/webdist/assets/{chunk-727SXJPM-CvLX5ghS.js → chunk-727SXJPM-CsQCgUxY.js} +1 -1
  31. package/dist/webdist/assets/{chunk-AQP2D5EJ-CZ0fsnc1.js → chunk-AQP2D5EJ-G0waQ7sq.js} +1 -1
  32. package/dist/webdist/assets/{chunk-FMBD7UC4-tjHz_yw8.js → chunk-FMBD7UC4-CkNtvlrw.js} +1 -1
  33. package/dist/webdist/assets/{chunk-ND2GUHAM-DVSh5E5_.js → chunk-ND2GUHAM-DGnw4n1I.js} +1 -1
  34. package/dist/webdist/assets/{chunk-QZHKN3VN-D1rUM2SU.js → chunk-QZHKN3VN-BpJ4HH0V.js} +1 -1
  35. package/dist/webdist/assets/circle-check-ByN99MCf.js +1 -0
  36. package/dist/webdist/assets/classDiagram-4FO5ZUOK-DwCs4wFr.js +1 -0
  37. package/dist/webdist/assets/classDiagram-v2-Q7XG4LA2-DwCs4wFr.js +1 -0
  38. package/dist/webdist/assets/collapsible-B_M28W08.js +1 -0
  39. package/dist/webdist/assets/{common-BD4Wa3KL.js → common-Cy1uxtS_.js} +1 -1
  40. package/dist/webdist/assets/{copy-button-DypRNkqI.js → copy-button-DgYGL35x.js} +1 -1
  41. package/dist/webdist/assets/{cose-bilkent-S5V4N54A-DIUqY7o2.js → cose-bilkent-S5V4N54A-fol9bGNP.js} +1 -1
  42. package/dist/webdist/assets/{dagre-BM42HDAG-BzTcsgZ1.js → dagre-BM42HDAG-kyg4YiiE.js} +1 -1
  43. package/dist/webdist/assets/{diagram-2AECGRRQ-DanHH-W_.js → diagram-2AECGRRQ-CK_mQs9l.js} +1 -1
  44. package/dist/webdist/assets/{diagram-5GNKFQAL-DQ5sWHUL.js → diagram-5GNKFQAL-MBl66jsh.js} +1 -1
  45. package/dist/webdist/assets/{diagram-KO2AKTUF-Jqr_pLwu.js → diagram-KO2AKTUF-IxjaUqTu.js} +1 -1
  46. package/dist/webdist/assets/{diagram-LMA3HP47-BZ89-cp0.js → diagram-LMA3HP47-Cc_fuuLo.js} +1 -1
  47. package/dist/webdist/assets/{diagram-OG6HWLK6-cidBc5qa.js → diagram-OG6HWLK6-DvprGLFT.js} +1 -1
  48. package/dist/webdist/assets/{dialog-3hyZ9j4e.js → dialog-d6eLRBbl.js} +1 -1
  49. package/dist/webdist/assets/{erDiagram-TEJ5UH35-DEAKZN7b.js → erDiagram-TEJ5UH35-BEebeQO0.js} +1 -1
  50. package/dist/webdist/assets/{flowDiagram-I6XJVG4X-Cyx8gMzN.js → flowDiagram-I6XJVG4X--NtrYHee.js} +1 -1
  51. package/dist/webdist/assets/folder-input-C5Td4Oz0.js +1 -0
  52. package/dist/webdist/assets/{ganttDiagram-6RSMTGT7-CqXYW44d.js → ganttDiagram-6RSMTGT7-DOx3A2YH.js} +1 -1
  53. package/dist/webdist/assets/{gitGraphDiagram-PVQCEYII-0dv_zKYA.js → gitGraphDiagram-PVQCEYII-BEY69HKU.js} +1 -1
  54. package/dist/webdist/assets/index-B8H9eSFq.css +1 -0
  55. package/dist/webdist/assets/{index-DHmOrvk5.js → index-Tpho8qZ0.js} +1 -1
  56. package/dist/webdist/assets/index-tVO2x-Rw.js +10 -0
  57. package/dist/webdist/assets/{infoDiagram-5YYISTIA-PxeM6E3u.js → infoDiagram-5YYISTIA-C4X5I5eI.js} +1 -1
  58. package/dist/webdist/assets/{ishikawaDiagram-YF4QCWOH-BnNdTjj1.js → ishikawaDiagram-YF4QCWOH-BhUZzSmP.js} +1 -1
  59. package/dist/webdist/assets/{journeyDiagram-JHISSGLW-D3AHUGxz.js → journeyDiagram-JHISSGLW-R-rmKLZ-.js} +1 -1
  60. package/dist/webdist/assets/{kanban-definition-UN3LZRKU-YARl6SUt.js → kanban-definition-UN3LZRKU-DUcDGDiT.js} +1 -1
  61. package/dist/webdist/assets/{linear-CMEhaWGh.js → linear-Cbr5iYFb.js} +1 -1
  62. package/dist/webdist/assets/{mermaid.core-Dfl2pPvv.js → mermaid.core-DJVxydy1.js} +4 -4
  63. package/dist/webdist/assets/{mindmap-definition-RKZ34NQL-BojWC6jk.js → mindmap-definition-RKZ34NQL-BSOgl-Cn.js} +1 -1
  64. package/dist/webdist/assets/pencil-Blh_Q7or.js +1 -0
  65. package/dist/webdist/assets/personas-Dm0JD8kn.js +305 -0
  66. package/dist/webdist/assets/{pieDiagram-4H26LBE5-cjsdMtJJ.js → pieDiagram-4H26LBE5-BwQ854zg.js} +1 -1
  67. package/dist/webdist/assets/plus-D4IwdkJ3.js +1 -0
  68. package/dist/webdist/assets/{quadrantDiagram-W4KKPZXB-DYVcgQuL.js → quadrantDiagram-W4KKPZXB-BOQGjhZD.js} +1 -1
  69. package/dist/webdist/assets/{radix-BY-fjzwm.js → radix-DVGeLgPN.js} +2 -2
  70. package/dist/webdist/assets/{refresh-cw-Cco9RapO.js → refresh-cw-BVSLL9xa.js} +1 -1
  71. package/dist/webdist/assets/{requirementDiagram-4Y6WPE33-Dkj58nhB.js → requirementDiagram-4Y6WPE33-b3dNYy6K.js} +1 -1
  72. package/dist/webdist/assets/rotate-ccw-B7QiZxpr.js +1 -0
  73. package/dist/webdist/assets/{sankeyDiagram-5OEKKPKP-l3GwUuNl.js → sankeyDiagram-5OEKKPKP-C26ntsbR.js} +1 -1
  74. package/dist/webdist/assets/{save-CSISNMk8.js → save-DI4M5kP-.js} +1 -1
  75. package/dist/webdist/assets/{sequenceDiagram-3UESZ5HK-CWj1Dplo.js → sequenceDiagram-3UESZ5HK-Bp8i1DIR.js} +1 -1
  76. package/dist/webdist/assets/{skeleton-CBRf-twG.js → skeleton-D6toQA7p.js} +1 -1
  77. package/dist/webdist/assets/star-BCxsXqcv.js +1 -0
  78. package/dist/webdist/assets/{stateDiagram-AJRCARHV-zbnPRcoE.js → stateDiagram-AJRCARHV-CmZpIELB.js} +1 -1
  79. package/dist/webdist/assets/stateDiagram-v2-BHNVJYJU-CswfYrBO.js +1 -0
  80. package/dist/webdist/assets/{timeline-definition-PNZ67QCA-C_zAo1WZ.js → timeline-definition-PNZ67QCA-slNuxmat.js} +1 -1
  81. package/dist/webdist/assets/{trash-2-DJmVqx0w.js → trash-2-DGVXsIsP.js} +1 -1
  82. package/dist/webdist/assets/{vendor-W5GIuFcv.js → vendor-BE0HADM8.js} +1 -1
  83. package/dist/webdist/assets/{vennDiagram-CIIHVFJN-DxfcocQu.js → vennDiagram-CIIHVFJN-Lf4xPS3i.js} +1 -1
  84. package/dist/webdist/assets/{vram-Dn53zt7R.js → vram-DVAmNgRC.js} +1 -1
  85. package/dist/webdist/assets/{wardley-L42UT6IY-BnZ8BinJ.js → wardley-L42UT6IY-DbEeYkcX.js} +1 -1
  86. package/dist/webdist/assets/{wardleyDiagram-YWT4CUSO-DMk9z7hr.js → wardleyDiagram-YWT4CUSO-WNGbDcCj.js} +1 -1
  87. package/dist/webdist/assets/wrench-DzoqtmhJ.js +1 -0
  88. package/dist/webdist/assets/{xychartDiagram-2RQKCTM6-BUtTPXPF.js → xychartDiagram-2RQKCTM6-D2kBZ8cG.js} +1 -1
  89. package/dist/webdist/index.html +4 -4
  90. package/package.json +1 -1
  91. package/dist/webdist/assets/AgentsScreen-sMeMB3IQ.js +0 -2
  92. package/dist/webdist/assets/ChatScreen-rXB7PrWJ.js +0 -65
  93. package/dist/webdist/assets/CustomizeScreen-BBwvtk28.js +0 -4
  94. package/dist/webdist/assets/DeveloperScreen-fXV-qXB5.js +0 -1
  95. package/dist/webdist/assets/EnginesScreen-CrmYzhio.js +0 -7
  96. package/dist/webdist/assets/ModelDetailDialog-Dlt5uF3h.js +0 -1
  97. package/dist/webdist/assets/ModelDirs-BYN-DmHL.js +0 -1
  98. package/dist/webdist/assets/SettingsScreen-DXX3r4Ep.js +0 -1
  99. package/dist/webdist/assets/arrow-left-Dp4XRnbs.js +0 -1
  100. package/dist/webdist/assets/channel-Bt5-ol5R.js +0 -1
  101. package/dist/webdist/assets/check-jMeH6YsH.js +0 -1
  102. package/dist/webdist/assets/chevron-down-C5ZMFCtb.js +0 -1
  103. package/dist/webdist/assets/chevron-right-DNVnXbZ1.js +0 -1
  104. package/dist/webdist/assets/circle-check-qnghY_qF.js +0 -1
  105. package/dist/webdist/assets/circle-x-FM28MwOL.js +0 -1
  106. package/dist/webdist/assets/classDiagram-4FO5ZUOK-jfnUpxOr.js +0 -1
  107. package/dist/webdist/assets/classDiagram-v2-Q7XG4LA2-jfnUpxOr.js +0 -1
  108. package/dist/webdist/assets/collapsible-CwqYFc9v.js +0 -1
  109. package/dist/webdist/assets/index-B_WtFoLC.css +0 -1
  110. package/dist/webdist/assets/index-CriwC5VH.js +0 -10
  111. package/dist/webdist/assets/pencil-CS33zp9q.js +0 -1
  112. package/dist/webdist/assets/personas-CzcXp8zg.js +0 -75
  113. package/dist/webdist/assets/plus-BO3vGy6f.js +0 -1
  114. package/dist/webdist/assets/stateDiagram-v2-BHNVJYJU-Ukx8AVKZ.js +0 -1
  115. package/dist/webdist/assets/wrench-Di5WLTz2.js +0 -1
@@ -0,0 +1,4 @@
1
+ import{j as e}from"./radix-DVGeLgPN.js";import{b as q1,r as u,c as s0}from"./vendor-BE0HADM8.js";import{S as n0}from"./common-Cy1uxtS_.js";import{g as D1,u as r0,a as l0,B as f,t as p,A as N,b as c0,d as o0,e as i0,q as R1,P as d0,f as m0,G as x0,L as q,X as _}from"./index-tVO2x-Rw.js";import{i as p0,a as n1,l as h0,f as u0}from"./agent-api-B3GXwr4Y.js";import{P as O}from"./plus-D4IwdkJ3.js";import{F as g0}from"./folder-input-C5Td4Oz0.js";import{S as U,W as H1,A as v0}from"./wrench-DzoqtmhJ.js";import{r as f0,a as b0,b as y0}from"./personas-Dm0JD8kn.js";import{S as k0}from"./star-BCxsXqcv.js";import{R as j0}from"./rotate-ccw-B7QiZxpr.js";import{C as V1}from"./check-BLFw3EpE.js";import{P as N0}from"./pencil-Blh_Q7or.js";import{T as C0}from"./trash-2-DGVXsIsP.js";import{C as S0}from"./chevron-right--1OIa5uV.js";const z0=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],B1=D1("bot",z0);const A0=[["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"}]],M0=D1("upload",A0),K=[{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))],L0=["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"},k1={path:"M24 0V24l-9.365-8.045V24H0V0ZM2.942 21.087h8.751V9.563l9.365 8.204V2.919L2.942 2.914Z",hex:"34D59A"},j1={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"},M1={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"},w1={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"},P0={github:{path:m1.path,hex:m1.hex},linear:{path:v1.path,hex:v1.hex},notion:{path:j1.path,hex:j1.hex},figma:{path:i1.path,hex:i1.hex},stripe:{path:L1.path,hex:L1.hex},atlassian:{path:r1.path,hex:r1.hex},sentry:{path:w1.path,hex:w1.hex},supabase:{path:P1.path,hex:P1.hex},neon:{path:k1.path,hex:k1.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:M1.path,hex:M1.hex}};function I0({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(H1,{size:10})," ",a.tools.join(", ")]})]})}function E0(){const a=q1(),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(k){p.error(k instanceof N?k.message:"Could not start learning.")}finally{o(!1)}}},c=u.useRef(null),i=async x=>{const k=x.target.files?.[0];if(x.target.value="",!!k)try{const C=await k.text(),M=await p0(C);s.invalidateQueries({queryKey:n1.list()}),p.success(`Imported skill: ${M.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(M0,{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(I0,{skill:x,onOpen:()=>a(`/skills/${x.id}`)},x.id))})]})}function F0({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(k0,{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(H1,{size:10}),m?`${m} skill${m===1?"":"s"}`:null,m&&h?" · ":null,h?`${h} tool${h===1?"":"s"}`:null]}):null]})}function T0(){const a=q1(),s=c0(),n=o0(),r=i0(),d=f0(s.data??[],n.data??{}),[m,h]=u.useState(()=>b0()),o=i=>{y0(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(F0,{agent:i,isDefault:i.id===m,onOpen:()=>a(`/agents/${i.id}`),onSetDefault:()=>o(i),onReset:()=>v(i)},i.id))})]})}const q0=[{id:"agents",label:"Agents",icon:B1},{id:"skills",label:"Skills",icon:U},{id:"mcp",label:"MCP Servers",icon:d0}];function ce(){const{query:a}=R1(),s=a.data,[n,r]=s0(),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-6 py-6",children:[e.jsx(n0,{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:q0.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(T0,{}):m==="skills"?e.jsx(E0,{}):e.jsx(U0,{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 R0(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 H0(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?P0[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:H0(a)})}function V0({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 B0({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(V1,{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(V0,{auth:a.auth}):e.jsx(B0,{uvx:a.uvx})]})]})]}),e.jsx("p",{className:"text-[11px] leading-relaxed text-muted",children:a.desc})]})}function O0({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(q,{size:13,className:"animate-spin"}),"Add server"]})]})}function _0({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(q,{size:13,className:"animate-spin"}),"Add server"]})]})}function U0({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"),[k,C]=u.useState("All"),[M,Z]=u.useState(null),[D,G]=u.useState(""),[$,Q]=u.useState(""),[Y,W]=u.useState({}),[R,X]=u.useState(null),[P,H]=u.useState(""),J=s.provider==="tavily"?s.tavilyKeySet:s.provider==="kagi"?s.kagiKeySet:!!s.searxngUrl?.trim(),S=J?K.find(t=>t.id===s.provider):void 0,K1=u.useMemo(()=>new Set(a.map(t=>t.url).filter(Boolean)),[a]),O1=u.useMemo(()=>new Set(a.map(t=>t.name)),[a]),_1=t=>"url"in t?K1.has(t.url):O1.has(t.name),U1=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),H(""),Z(null)},Z1=t=>{x(t),C("All"),z(null)},G1=i==="cloud"?w0:L0,$1=(i==="cloud"?F:T).filter(t=>k==="All"||t.cat===k),Q1=t=>{d(t.id),h(D0(t)),v("edit")},e1=()=>{const t=R0(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)},Y1=(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.")})},W1=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:X1}=R1(),J1=(t,l)=>{const g={provider:t};t==="searxng"?g.searxngUrl=l:l.trim()&&(g[t==="tavily"?"tavilyApiKey":"kagiApiKey"]=l),X1.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.")})},e0=t=>{n.add.mutate({name:t.name,transport:"sse",url:t.url,enabled:!0,...D.trim()?{apiKey:D.trim()}:{}},{onSuccess:()=>{p.success(`${t.name} connected`),z(null)},onError:l=>p.error(l instanceof N?l.message:"Could not add server.")})},t0=t=>{const[l,...g]=t.cmd.trim().split(/\s+/),b=$.trim(),a0=b?(b.match(/[^\s"]+|"[^"]*"/g)??[]).map(y=>y.replace(/^"|"$/g,"")):[],a1=[...g,...a0],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.")})},w=n.add.isPending||n.update.isPending,j=m,V=i==="cloud"?F.find(t=>t.id===M):void 0,B=i==="local"?T.find(t=>t.id===M):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:j.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:j.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))})]}),j.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:j.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:j.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:j.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:j.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:j.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:j.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:w,children:[w&&e.jsx(q,{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(v0,{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:w,children:[w&&e.jsx(q,{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:K.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(V1,{size:10})," Active"]})]},t.id)})}),R&&(()=>{const t=K.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=>H(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=>H(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:()=>J1(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:()=>Z1(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:G1.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:k===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:$1.map(t=>e.jsx(K0,{entry:t,tab:i,isSelected:M===t.id,isConnected:_1(t),onSelect:()=>z(M===t.id?null:t.id)},t.id))}),V&&e.jsx(O0,{entry:V,apiKey:D,onApiKeyChange:G,onClose:()=>z(null),onConnect:()=>e0(V),busy:w}),B&&e.jsx(_0,{entry:B,extraArg:$,onExtraArgChange:Q,envs:Y,onEnvChange:(t,l)=>W(g=>({...g,[t]:l})),onClose:()=>z(null),onAdd:()=>t0(B),busy:w})]}),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:U1(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:()=>W1(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:()=>Q1(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:()=>Y1(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-DVGeLgPN.js";import{g as u,p as N,q as v,B as b,r as k,a as C,f as w,t as h,A as f,s as S}from"./index-tVO2x-Rw.js";import{r as x}from"./vendor-BE0HADM8.js";import{C as y}from"./copy-button-DgYGL35x.js";import{S as I}from"./common-Cy1uxtS_.js";import{C as P,a as A,b as E}from"./collapsible-B_M28W08.js";import{f as T}from"./chat-api-DrMO_g5m.js";import{f as L}from"./MessageBubble-mJwFfOab.js";import{E as _}from"./refresh-cw-BVSLL9xa.js";import{T as D}from"./trash-2-DGVXsIsP.js";import{P as R}from"./plus-D4IwdkJ3.js";import{C as z}from"./chevron-right--1OIa5uV.js";import"./check-BLFw3EpE.js";import"./circle-check-ByN99MCf.js";import"./pencil-Blh_Q7or.js";import"./index-Tpho8qZ0.js";const M=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],O=u("cloud",M);const K=[["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"}]],q=u("globe",K);const G=[["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"}]],$=u("key",G);const B=[["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"}]],U=u("rocket",B);const H=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Q=u("shield-check",H);const F=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],V=u("terminal",F),g=window.location.origin,J=[{method:"POST",path:"/v1/chat/completions",desc:"OpenAI Chat Completions"},{method:"POST",path:"/v1/messages",desc:"Anthropic Messages"},{method:"GET",path:"/v1/models",desc:"OpenAI Models List"},{method:"GET",path:"/api/v1/status",desc:"Daemon Status"},{method:"GET",path:"/api/v1/engines",desc:"Engine Registry"},{method:"GET",path:"/api/v1/models",desc:"Model Library"},{method:"GET",path:"/api/v1/keys",desc:"API Keys"}],W=[{id:"claude-code",name:"Claude Code",desc:"turbollm launch claude — Anthropic-compatible endpoint"},{id:"opencode",name:"opencode",desc:"turbollm launch opencode — AI SDK provider config"},{id:"kilo",name:"Kilo Code",desc:"turbollm launch kilo — kilo.jsonc provider entry"},{id:"openclaw",name:"openclaw",desc:"turbollm launch openclaw — provider + default model"},{id:"hermes",name:"Hermes Agent",desc:"turbollm launch hermes — hermes config set"},{id:"qwen",name:"Qwen Code",desc:"OpenAI-compatible (OPENAI_BASE_URL)"}];function ke(){const{data:t}=N(),o=!!t?.features?.includes("cloud-deploy");return e.jsxs("div",{className:"w-full px-6 py-6",children:[e.jsx(I,{title:"Developer",description:"Server URLs, API endpoints, keys, and CLI setup."}),e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx(Y,{}),o&&e.jsx(X,{}),e.jsx(ee,{}),e.jsx(se,{}),e.jsx(oe,{}),e.jsx(ne,{})]})]})}function Y(){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(q,{size:15,className:"text-accent"}),e.jsx("h2",{className:"text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Server"})]}),e.jsxs("div",{className:"flex items-center justify-between py-1",children:[e.jsx("span",{className:"text-[13px] text-muted",children:"Local URL"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("code",{className:"font-mono text-[13px] text-ink",children:g}),e.jsx(y,{text:g})]})]})]})}const Z="";function X(){const{query:t,save:o}=v(),[l,c]=x.useState("");x.useEffect(()=>{t.data&&c(t.data.cloudDeploy?.runpodTemplateId??"")},[t.data]);const d=(t.data?.cloudDeploy?.runpodTemplateId??"").trim(),n=l.trim()!==d,i=d||Z,p=()=>{o.mutate({cloudDeploy:{runpodTemplateId:l.trim()}},{onError:r=>h.error(r instanceof f?r.message:"Could not save the template id.")})},a=()=>{i&&window.open(`https://runpod.io/console/deploy?template=${encodeURIComponent(i)}`,"_blank","noopener,noreferrer")};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(O,{size:15,className:"text-accent"}),e.jsx("h2",{className:"text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Cloud Deploy"})]}),e.jsxs("p",{className:"mb-3 text-[12px] text-muted",children:["Run TurboLLM on a rented GPU box, reachable over the internet via"," ",e.jsx("code",{className:"font-mono text-[11px] text-ink",children:"--tunnel"}),". RunPod is the only provider for now — click below to deploy the official TurboLLM template, no setup required. Running a custom fork? Paste your own RunPod Template ID to override it (see ",e.jsx("code",{className:"font-mono text-[11px] text-ink",children:"deploy/runpod/README.md"}),")."]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:l,onChange:r=>c(r.target.value),placeholder:"Custom Template ID (optional)",className:"flex-1 rounded-md border border-border bg-bg px-2.5 py-1.5 font-mono text-[13px] text-ink outline-none placeholder:text-faint focus:border-[color:var(--accent)]",onKeyDown:r=>r.key==="Enter"&&n&&p()}),e.jsx(b,{size:"sm",variant:"outline",onClick:p,disabled:!n||o.isPending,children:o.isPending?"Saving…":"Save"})]}),e.jsxs(b,{className:"mt-3 w-full",onClick:a,disabled:!i||n,title:i?n?"Save your changes first":`Opens RunPod's console in a new tab${d?" (using your custom template)":""}`:"No template configured yet",children:[e.jsx(U,{size:14}),"Deploy on RunPod",e.jsx(_,{size:12})]})]})}function ee(){const{query:t,create:o,revoke:l}=k(),[c,d]=x.useState(""),[n,i]=x.useState(null),p=t.data?.keys??[],a=()=>{const s=c.trim();s&&o.mutate(s,{onSuccess:m=>{d(""),i(m.key)},onError:m=>h.error(m instanceof f?m.message:"Could not create key.")})},r=(s,m)=>{l.mutate(s,{onSuccess:()=>{n?.startsWith(m)&&i(null)},onError:j=>h.error(j instanceof f?j.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($,{size:15,className:"text-accent"}),e.jsx("h2",{className:"text-[13px] font-semibold uppercase tracking-wide text-faint",children:"API Keys"})]}),n&&e.jsxs("div",{className:"mb-4 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:n}),e.jsx(y,{text:n})]})]}),p.length===0&&!n&&e.jsx("p",{className:"mb-3 text-[13px] text-faint",children:"No API keys yet."}),p.length>0&&e.jsx("div",{className:"mb-3 divide-y divide-border rounded-md border border-border",children:p.map(s=>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:s.name}),e.jsxs("span",{className:"ml-2 font-mono text-[11px] text-faint",children:[s.prefix,"…"]})]}),e.jsx("button",{type:"button",onClick:()=>r(s.id,s.prefix),className:"rounded p-1 text-faint transition-colors hover:text-err",title:"Revoke key",children:e.jsx(D,{size:14})})]},s.id))}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{value:c,onChange:s=>d(s.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:s=>s.key==="Enter"&&a()}),e.jsxs(b,{size:"sm",onClick:a,disabled:!c.trim()||o.isPending,children:[e.jsx(R,{size:13}),o.isPending?"Creating…":"Create"]})]})]})}const te=[{value:"ask",label:"Ask"},{value:"allow",label:"Allow"},{value:"deny",label:"Deny"}];function se(){const[t,o]=x.useState(!1),l=C({queryKey:["available-tools"],queryFn:T}),{query:c,save:d}=v(),n=l.data??[],i=c.data?.toolPolicies??{},p=(a,r)=>{d.mutate({toolPolicies:{...i,[a]:r}},{onError:s=>h.error(s instanceof f?s.message:"Could not update tool permission.")})};return e.jsxs(P,{open:t,onOpenChange:o,className:"rounded-lg border border-border bg-panel p-4",children:[e.jsxs(A,{className:"flex w-full items-center gap-2 text-left",children:[e.jsx(z,{size:14,className:w("shrink-0 text-faint transition-transform",t&&"rotate-90")}),e.jsx(Q,{size:15,className:"text-accent"}),e.jsx("h2",{className:"text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Tool permissions"})]}),e.jsxs(E,{children:[e.jsx("p",{className:"mb-3 mt-3 text-[12px] text-muted",children:"Control whether each tool the model can call runs automatically, is always blocked, or asks for your approval in chat each time."}),l.isLoading&&e.jsx("p",{className:"text-[13px] text-faint",children:"Loading tools…"}),!l.isLoading&&n.length===0&&e.jsx("p",{className:"text-[13px] text-faint",children:"No tools available."}),n.length>0&&e.jsx("div",{className:"divide-y divide-border rounded-md border border-border",children:n.map(a=>{const r=i[a.name]??"ask";return e.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 py-2.5",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"font-mono text-[13px] font-medium text-ink",children:L(a.name)}),a.description&&e.jsx("div",{className:"truncate text-[11px] text-faint",title:a.description,children:a.description})]}),e.jsx("div",{className:"flex shrink-0 overflow-hidden rounded-lg border border-border",children:te.map(({value:s,label:m})=>e.jsx("button",{type:"button",onClick:()=>p(a.name,s),disabled:d.isPending,className:"px-3 py-1.5 text-[12px] transition-colors disabled:opacity-60",style:{background:r===s?"var(--accent)":"transparent",color:r===s?"var(--on-accent)":"var(--muted)"},children:m},s))})]},a.name)})})]})]})}function oe(){return e.jsxs("section",{className:"rounded-lg border border-border bg-panel p-4",children:[e.jsx("h2",{className:"mb-3 text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Available APIs"}),e.jsx("div",{className:"divide-y divide-border rounded-md border border-border",children:J.map(({method:t,path:o,desc:l})=>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:t==="GET"?"color-mix(in srgb, var(--ok) 15%, transparent)":"color-mix(in srgb, var(--accent) 15%, transparent)",color:t==="GET"?"var(--ok)":"var(--accent)"},children:t}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-[13px] text-ink",children:o}),e.jsx("span",{className:"hidden shrink-0 text-[11px] text-muted sm:block",children:l}),e.jsx(y,{text:`${g}${o}`})]},o))})]})}function ne(){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(V,{size:15,className:"text-accent"}),e.jsx("h2",{className:"text-[13px] font-semibold uppercase tracking-wide text-faint",children:"Connect a CLI"})]}),e.jsx("div",{className:"flex flex-col gap-2.5",children:W.map(t=>e.jsx(ae,{cli:t},t.id))})]})}function ae({cli:t}){const[o,l]=x.useState(null),[c,d]=x.useState(!1),[n,i]=x.useState(!1),p=()=>{if(n){i(!1);return}if(o){i(!0);return}d(!0),S(t.id).then(a=>{l(a),i(!0)}).catch(()=>h.error("Could not fetch setup snippets.")).finally(()=>d(!1))};return e.jsxs("div",{className:"rounded-md border border-border bg-bg",children:[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-semibold text-ink",children:t.name}),e.jsx("span",{className:"ml-2 text-[11px] text-muted",children:t.desc})]}),e.jsx(b,{size:"sm",variant:n?"outline":"default",onClick:p,disabled:c,children:c?"Loading…":n?"Hide":"Get setup"})]}),n&&o&&e.jsx("div",{className:"flex flex-col gap-2.5 border-t border-border px-3 pb-3 pt-2.5",children:o.steps.map((a,r)=>e.jsx(re,{step:a},r))})]})}function re({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(y,{text:t.snippet,className:"absolute right-2 top-2"})]})]})}export{ke as DeveloperScreen};
@@ -0,0 +1,7 @@
1
+ import{j as e,r as sn,s as tn}from"./radix-DVGeLgPN.js";import{r as v}from"./vendor-BE0HADM8.js";import{g as O,H as an,B as S,A as C,J as ln,K as Z,M as rn,L as V,I as ke,t as k,N as on,q as cn,p as le,O as Pe,X as dn,Q as W,m as un,S as mn,f as de,R as xn,T as pn,U as Ee,V as he,W as $e,Y as Be,k as Me,Z as hn,v as Ne,E as fn,_ as gn,$ as bn}from"./index-tVO2x-Rw.js";import{C as jn,D as se,j as te,E as Ue,k as ae,l as z,m as Q,A as Re,a as ze,b as Ie,c as Te,d as _e,f as Fe,h as Oe,i as qe,p as vn}from"./vram-DVAmNgRC.js";import{I as K,S as kn}from"./common-Cy1uxtS_.js";import{B as T,S as ce}from"./skeleton-D6toQA7p.js";import{D as fe,a as ge,b as G,c as H,d as ie,F as Nn,e as Y,f as ye}from"./dialog-d6eLRBbl.js";import{C as F}from"./check-BLFw3EpE.js";import{P as Ge}from"./plus-D4IwdkJ3.js";import{a as X,C as ue}from"./circle-check-ByN99MCf.js";import{A as we,S as be,W as yn}from"./wrench-DzoqtmhJ.js";import{E as re,R as He}from"./refresh-cw-BVSLL9xa.js";import{a as wn,C as Ve}from"./copy-button-DgYGL35x.js";import{c as Ke,C as Cn,a as Sn,b as Dn}from"./collapsible-B_M28W08.js";import{C as An}from"./chevron-right--1OIa5uV.js";const Ln=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],Pn=O("arrow-up",Ln);const En=[["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"}]],$n=O("file",En);const Bn=[["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"}]],Mn=O("folder-open",Bn);const Un=[["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"}]],Rn=O("hammer",Un);const zn=[["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"}]],In=O("layers",zn);const Tn=[["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"}]],Ye=O("rotate-cw",Tn);const _n=[["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"}]],Fn=O("search-x",_n);function On({open:n,onOpenChange:s,onSelect:i,mode:a="file",title:m,description:c}){const[d,r]=v.useState(null),{data:u,isFetching:x,error:p,refetch:y}=an(d,n);v.useEffect(()=>{n&&r(null)},[n]);const g=N=>{i(N),s(!1)};return e.jsx(fe,{open:n,onOpenChange:s,children:e.jsxs(ge,{className:"max-w-lg",children:[e.jsxs(G,{children:[e.jsx(H,{children:m??(a==="folder"?"Choose engine folder":"Browse for binary")}),e.jsx(ie,{children:c||(a==="folder"?e.jsxs(e.Fragment,{children:["Open the folder that contains your engine build, 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"}),". Limited to your home directory."]}):e.jsxs(e.Fragment,{children:["Navigate to the compiled ",e.jsx("code",{className:"font-mono",children:"llama-server"})," executable and click it to select. Limited to your home directory."]}))})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(S,{variant:"outline",size:"iconSm",onClick:()=>u?.parent!=null&&r(u.parent),disabled:!u||u.parent==null||x,"aria-label":"Up one folder",children:e.jsx(Pn,{size:16})}),e.jsx("div",{className:"min-w-0 flex-1 truncate rounded-md border border-border bg-panel-2 px-2.5 py-1.5 font-mono text-[12px] text-muted",title:u?.path??"",children:u?.path??"…"}),e.jsx(S,{variant:"outline",size:"iconSm",onClick:()=>{y()},disabled:x,"aria-label":"Refresh",children:e.jsx(Ye,{size:16,className:x?"animate-spin":void 0})})]}),p?e.jsx(K,{message:p instanceof C?p.message:"Could not read that folder.",onRetry:()=>{y()},className:"mt-3"}):e.jsxs("ul",{className:"mt-3 max-h-[320px] overflow-y-auto rounded-md border border-border",children:[u&&u.entries.length===0&&e.jsx("li",{className:"px-3 py-6 text-center text-[13px] text-muted",children:"This folder is empty."}),u?.entries.map(N=>{const b=a==="folder"&&!N.isDir;return e.jsx("li",{children:e.jsxs("button",{type:"button",disabled:b,onClick:()=>N.isDir?r(N.path):g(N.path),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-[13px] text-ink "+(b?"cursor-default text-faint":"hover:bg-panel-2"),children:[N.isDir?e.jsx(Nn,{size:16,className:"shrink-0 text-muted"}):e.jsx($n,{size:16,className:b?"shrink-0 text-faint":"shrink-0 text-muted"}),e.jsx("span",{className:"min-w-0 flex-1 truncate font-mono",children:ln(N.name,48)}),a!=="folder"&&!N.isDir&&e.jsx("span",{className:"shrink-0 text-[11px] text-muted",children:"Select"})]})},N.path)})]}),e.jsxs(Y,{children:[e.jsx(S,{variant:"outline",onClick:()=>s(!1),children:"Cancel"}),a!=="file"&&e.jsxs(S,{onClick:()=>u?.path&&g(u.path),disabled:!u?.path||x,children:[e.jsx(F,{size:16})," Select this folder"]})]})]})})}function je({open:n,onOpenChange:s,defaultSourceRepo:i,trigger:a}={}){const[m,c]=v.useState(!1),d=n!==void 0,r=d?n:m,u=w=>{d||c(w),s?.(w)},[x,p]=v.useState("choose"),[y,g]=v.useState(null),[N,b]=v.useState(""),[$,D]=v.useState(""),[R,P]=v.useState(""),[A,E]=v.useState(""),[U,l]=v.useState(null),[h,t]=v.useState(null),{add:o}=Z(),f=rn();v.useEffect(()=>{r&&i&&E(i)},[r,i]);const L=()=>{p("choose"),g(null),b(""),D(""),P(""),E(""),l(null),t(null)},q=w=>{t(null),l(null),p("scanning"),f.mutate(w,{onSuccess:j=>{if(!j.found){p("notfound");return}b(j.binPath),D(j.version),P(j.suggestedName),p("confirm")},onError:j=>{t(j instanceof C?j.message:"Could not scan that location."),p("choose")}})},I=()=>{l(null),t(null);const w=A.trim();o.mutate({name:R.trim(),binPath:N,...w?{sourceRepo:w}:{}},{onSuccess:j=>{j.warning==="no_version"?k.warning("Engine added, but its version could not be detected."):k.success("Engine added"),u(!1),L()},onError:j=>{const B=j instanceof C?j.code:"",_=j instanceof C?j.message:"Could not add engine.";B==="name_already_taken"?l(_):t(_)}})};return e.jsxs(fe,{open:r,onOpenChange:w=>{u(w),w||L()},children:[a!==void 0?a!==null&&e.jsx(ye,{asChild:!0,children:a}):e.jsx(ye,{asChild:!0,children:e.jsxs(S,{children:[e.jsx(Ge,{size:16})," Add engine"]})}),e.jsxs(ge,{children:[x==="choose"&&e.jsxs(e.Fragment,{children:[e.jsxs(G,{children:[e.jsx(H,{children:"Add your own engine"}),e.jsx(ie,{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(S,{onClick:()=>g("folder"),className:"w-full",children:[e.jsx(Mn,{size:16})," Choose folder…"]}),e.jsx("button",{type:"button",onClick:()=>g("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"}),h&&e.jsx(K,{message:h})]}),e.jsx(Y,{children:e.jsx(S,{variant:"outline",onClick:()=>u(!1),children:"Cancel"})})]}),x==="scanning"&&e.jsxs(e.Fragment,{children:[e.jsx(G,{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(V,{size:18,className:"shrink-0 animate-spin text-ink"}),"Looking for the server binary…"]})]}),x==="confirm"&&e.jsxs(e.Fragment,{children:[e.jsxs(G,{children:[e.jsx(H,{children:"Confirm engine"}),e.jsx(ie,{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"}),$&&$.toLowerCase()!=="unknown"?e.jsxs(e.Fragment,{children:[" · ",e.jsx("span",{className:"text-muted",children:$})]}):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(ke,{value:R,onChange:w=>P(w.target.value),autoFocus:!0}),e.jsx("span",{className:"text-[12px] text-muted",children:"Any label you choose — shown in the engine list."}),U&&e.jsx(K,{message:U})]}),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:N,children:N})]}),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(ke,{value:A,onChange:w=>E(w.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."})]}),h&&e.jsx(K,{message:h})]}),e.jsxs(Y,{children:[e.jsxs(S,{variant:"outline",onClick:()=>p("choose"),disabled:o.isPending,children:[e.jsx(we,{size:16})," Back"]}),e.jsx(S,{onClick:I,disabled:R.trim().length===0||o.isPending,children:o.isPending?"Adding…":"Add engine"})]})]}),x==="notfound"&&e.jsxs(e.Fragment,{children:[e.jsx(G,{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(Fn,{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(Y,{children:[e.jsxs(S,{variant:"outline",onClick:()=>p("choose"),children:[e.jsx(we,{size:16})," Back"]}),e.jsx(S,{onClick:()=>g("file"),children:"Pick the binary directly"})]})]}),e.jsx(On,{open:y!==null,mode:y==="file"?"file":"folder",onOpenChange:w=>{w||g(null)},onSelect:w=>{g(null),q(w)}})]})]})}const qn=["-DGGML_CUDA=ON","-DCMAKE_BUILD_TYPE=Release","-DCMAKE_CUDA_FLAGS=-allow-unsupported-compiler"],Gn=["cudart64_","cublas64_","cublaslt64_","nvrtc64_","nvrtc-builtins64_","nvjitlink_"],Hn=["libcudart.so","libcublas.so","libcublasLt.so","libnvrtc.so","libnvrtc-builtins.so","libnvJitLink.so"];function Vn(n,s,i){const a=(s??"").trim(),m=a?`git clone --branch ${a} --depth 1 ${n} turbo-build`:`git clone --depth 1 ${n} turbo-build`,c=`cmake -B build ${qn.join(" ")}`;if(i==="linux"){const r=["lib64","lib","targets/x86_64-linux/lib"].flatMap(u=>Hn.map(x=>`$CUDA_ROOT/${u}/${x}*`)).join(" ");return[m,"cd turbo-build",c,"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 d=["bin","bin\\x64"].flatMap(r=>Gn.map(u=>`"%CUDA_PATH%\\${r}\\${u}*.dll"`)).join(" ");return[m,"cd turbo-build",c,"cmake --build build --config Release -j --target llama-server",`for %f in (${d}) 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 Kn={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 me({open:n,onOpenChange:s,repoUrl:i,engineName:a,branch:m,mode:c="build"}){const d=on(n),r=cn(),u=le(),x=Pe(),[p,y]=v.useState(!1),[g,N]=v.useState(!1),[b,$]=v.useState(null),D=r.query.data?.build.toolchainDirs??[],[R,P]=v.useState(null),A=R??D,E=d.data?.os??"windows",l=Vn(i,m,E).join(`
2
+ `),h=d.data?.supported??null,t=d.data?.tools??[],o=t.filter(M=>(M.id==="git"||M.id==="cmake"||M.id==="cuda")&&!M.found),f=u.data?.engineBuild,L=!!f?.active,q=!!u.data?.engineProvision?.active,I=b!==null||L,w=t.some(M=>M.id==="cuda"&&!M.found),j=h===!0&&o.length===0&&!L&&!q;v.useEffect(()=>{!b||!f||f.active||(f.phase==="done"?b==="cuda"?(d.refetch(),r.query.refetch(),$(null)):x.refresh():f.phase==="error"&&b==="build"&&x.refresh())},[b,f?.active,f?.phase]);const B=v.useRef(null);v.useEffect(()=>{B.current&&(B.current.scrollTop=B.current.scrollHeight)},[f?.log]);const _=()=>{navigator.clipboard.writeText(l).then(()=>{y(!0),setTimeout(()=>y(!1),1500)})},ee=async()=>{await r.save.mutateAsync({build:{toolchainDirs:A.map(M=>M.trim()).filter(Boolean)}}),P(null),d.refetch()},Ze=()=>{$("build"),x.start.mutate({repoUrl:i,branch:m,name:a})},en=()=>{$("cuda"),x.cuda.mutate()},nn=c==="rebuild"?"Rebuild now":"Build it for me";return e.jsxs(fe,{open:n,onOpenChange:s,children:[e.jsxs(ge,{className:"max-w-lg",children:[e.jsxs(G,{children:[e.jsxs(H,{children:[c==="rebuild"?"Rebuild":"Build"," ",a," from source"]}),e.jsx(ie,{children:c==="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."})]}),d.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(V,{size:18,className:"shrink-0 animate-spin text-ink"}),"Checking your build tools…"]}):h===!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:t.map(M=>e.jsx(Wn,{tool:M,onDownload:M.id==="cuda"&&!M.found&&!I&&E==="windows"?en:void 0},M.id))}),w&&!I&&e.jsx("p",{className:"text-[11px] text-faint",children:E==="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."]}),A.map((M,oe)=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("input",{value:M,onChange:ve=>{const ne=[...A];ne[oe]=ve.target.value,P(ne)},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:()=>P(A.filter((ve,ne)=>ne!==oe)),className:"shrink-0 rounded-md p-1 text-faint hover:text-ink","aria-label":"Remove folder",children:e.jsx(dn,{size:14})})]},oe)),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("button",{type:"button",onClick:()=>P([...A,""]),className:"inline-flex items-center gap-1 text-[12px] text-muted hover:text-ink",children:[e.jsx(Ge,{size:13})," Add folder"]}),e.jsxs("button",{type:"button",onClick:()=>{ee()},disabled:r.save.isPending||d.isFetching,className:"inline-flex items-center gap-1 text-[12px] text-accent hover:underline disabled:opacity-50",children:[r.save.isPending||d.isFetching?e.jsx(V,{size:13,className:"animate-spin"}):e.jsx(He,{size:13}),"Re-check"]})]})]})]}),I&&f&&e.jsx(Yn,{build:f,kind:b==="cuda"?"cuda":"build",logRef:B,onCancel:()=>x.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:E==="linux"?"Linux + CUDA":"Windows + CUDA"}),e.jsxs("button",{type:"button",onClick:_,className:"inline-flex items-center gap-1 text-[12px] text-muted hover:text-ink",children:[p?e.jsx(X,{size:13,style:{color:"var(--ok)"}}):e.jsx(wn,{size:13}),p?"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(Y,{children:[e.jsx(S,{variant:"outline",onClick:()=>s(!1),children:"Close"}),h!==!1&&e.jsxs(e.Fragment,{children:[e.jsx(S,{variant:"outline",onClick:()=>N(!0),disabled:d.isLoading||L,children:"I've built it"}),e.jsxs(S,{onClick:Ze,disabled:!j,children:[e.jsx(Rn,{size:15,className:"mr-1.5"}),L?"Building…":nn]})]})]})]}),e.jsx(je,{open:g,onOpenChange:N,defaultSourceRepo:i,trigger:null})]})}function Yn({build:n,kind:s,logRef:i,onCancel:a,onClose:m}){const c=n.phase==="error",d=n.phase==="done",r=c?"var(--err, #ef4444)":d?"var(--ok)":"var(--accent)";return d&&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(S,{onClick:m,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(V,{size:15,className:"shrink-0 animate-spin",style:{color:r}}):c?e.jsx(Ke,{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:Kn[n.phase]}),n.active&&e.jsx("button",{type:"button",onClick:a,className:"ml-auto text-[12px] text-faint hover:text-ink",children:"Cancel"})]}),c&&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 Wn({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(Ke,{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(W,{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 Qn({status:n,activeEngineName:s}){const i=n?.engine.state??"stopped",a=n?.engine.error,m=n?.model?.loadElapsedMs,c=i==="running"?n?.engineStats??null:null,d=i==="running"?n?.liveGeneration??null:null,r=un(),u=Z(),x=i==="running"||i==="starting",p=i==="running"||i==="error",y=()=>r.eject.mutate(void 0,{onError:N=>k.error(N instanceof C?N.message:"Could not stop the engine.")}),g=()=>u.restart.mutate(void 0,{onError:N=>k.error(N instanceof C?N.message:"Could not restart the engine.")});return e.jsxs("div",{className:"rounded-[var(--radius)] border border-[color:var(--accent)] bg-panel p-4",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[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(mn,{state:i}),i==="starting"&&m!=null&&e.jsxs("span",{className:"text-[13px] text-muted",children:["Loading model… (",Math.round(m/1e3),"s)"]}),i==="running"&&n?.model&&e.jsx("span",{className:"text-[13px] text-muted truncate",children:n.model.name}),i==="running"&&!d&&(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})`:"","…"]}),p&&e.jsxs(S,{size:"sm",variant:"outline",className:"ml-auto",onClick:g,disabled:u.restart.isPending,title:"Restart the engine",children:[e.jsx(Ye,{size:14}),"Restart"]}),x&&e.jsxs(S,{size:"sm",variant:"outline",className:p?"":"ml-auto",onClick:y,disabled:r.eject.isPending,title:"Stop the engine and unload the model",children:[e.jsx(jn,{size:14}),"Stop & unload"]})]}),(d||c)&&e.jsx(Xn,{live:d,stats:c}),i==="error"&&a&&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:[a.message,a.exitCode!=null&&` (exit ${a.exitCode})`]}),e.jsx(Ve,{text:(a?.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:(a.logTail??[]).join(`
6
+ `)||"No log output captured."})]})]})}function Xn({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(Jn,{stats:s})]})}function Jn({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(Zn(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 Zn(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 We=v.forwardRef(({className:n,...s},i)=>e.jsx(sn,{ref:i,className:de("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(tn,{className:de("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]")})}));We.displayName="Switch";const Se=2e3;function es({open:n,onOpenChange:s}){const[i,a]=v.useState([]),[m,c]=v.useState(!0),d=v.useRef(null);return v.useEffect(()=>{if(!n)return;let r=!1;xn(200).then(x=>{r||a(x.lines??[])}).catch(()=>{});const u=new EventSource(pn);return u.addEventListener("line",x=>{try{const p=JSON.parse(x.data);typeof p.line=="string"&&a(y=>{const g=[...y,p.line];return g.length>Se?g.slice(g.length-Se):g})}catch{}}),u.onerror=()=>{},()=>{r=!0,u.close()}},[n]),v.useEffect(()=>{m&&d.current&&(d.current.scrollTop=d.current.scrollHeight)},[i,m]),e.jsxs(Cn,{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(Sn,{className:"flex items-center gap-1.5 text-[13px] font-medium text-ink",children:[e.jsx(An,{size:14,className:de("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(We,{checked:m,onCheckedChange:c}),"Auto-scroll"]}),e.jsx(Ve,{text:i.join(`
7
+ `),label:"Copy all",size:14})]})]}),e.jsx(Dn,{children:e.jsx("div",{ref:d,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,u)=>e.jsx("div",{className:"whitespace-pre-wrap break-all",children:r},u))})})]})}const ns={cuda:"~550 MB",rocm:"~320 MB",sycl:"~110 MB",vulkan:"~40 MB",metal:"~11 MB",cpu:"~16 MB"},ss={cuda:"CUDA",rocm:"ROCm",sycl:"SYCL",vulkan:"Vulkan",metal:"Metal",cpu:"CPU"},De={off:"Off",notify:"Notify",auto:"Auto"};function ts(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 m=Math.floor(a/60);return m<24?`${m}h ago`:`${Math.floor(m/24)}d ago`}function as({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 ${ts(n.checkedAt)}`:""]}):null}function Qe({filter:n}={}){const{data:s}=le(),i=!!s?.engineProvision?.active,{data:a,isLoading:m}=Ee(i),{data:c}=he(i),d=$e(),r=Be(),u=Z(),[x,p]=v.useState(null);if(m||!a)return null;const y=l=>l?c?.updates[l]:void 0,g=l=>(l?c?.policies[l]:void 0)??"notify",N=(l,h,t)=>{l&&r.mutate({id:l,policy:h},{onSuccess:()=>k.success(`${t} auto-update: ${De[h]}`),onError:o=>k.error(o instanceof C?o.message:"Could not change auto-update.")})},b=i||d.backend.isPending||d.remove.isPending||d.enableBackend.isPending||d.updateBackend.isPending||u.remove.isPending,$=a.gpus[0]?.name,D=l=>d.backend.mutate(l,{onError:h=>k.error(h instanceof C?h.message:"Could not download backend.")}),R=l=>d.enableBackend.mutate(l,{onSuccess:()=>k.success("Backend enabled"),onError:h=>k.error(h instanceof C?h.message:"Could not enable backend.")}),P=(l,h)=>u.remove.mutate(l,{onSuccess:()=>k.success(`${h} disabled`),onError:t=>k.error(t instanceof C?t.message:"Could not disable backend.")}),A=l=>d.updateBackend.mutate(l,{onSuccess:h=>h?.alreadyLatest?k.success(`You're on the latest build${h.build?` (${h.build})`:""}`):k.success("Downloading the latest build…"),onError:h=>k.error(h instanceof C?h.message:"Could not update backend.")}),E=l=>d.remove.mutate(l,{onSuccess:()=>{k.success(`${x?.label??"Backend"} deleted`),p(null)},onError:h=>{p(null),k.error(h instanceof C?h.message:"Could not delete backend.")}}),U=a.backends.filter(l=>n==="recommended"?l.recommended:n==="others"?!l.recommended:!0);return e.jsxs(e.Fragment,{children:[U.map(l=>{const h=y(l.engineId),t=g(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 (",ss[l.id]??l.label,")"]}),l.recommended&&e.jsxs("span",{className:"flex items-center gap-0.5 text-[11px] text-accent",children:[e.jsx(be,{size:10})," recommended"]}),l.installed&&!l.enabled&&e.jsx(T,{variant:"mono",children:"Disabled"}),l.installed&&l.enabled&&h?.hasUpdate&&e.jsx(T,{variant:"accent",children:"Update available"})]}),e.jsx("div",{className:"mt-0.5 text-[12px] text-muted",children:l.installed?`Installed · ${$??"GPU detected"}`:`Not installed · ${ns[l.id]??"download to use"}`}),l.installed&&l.enabled&&e.jsx("div",{className:"mt-0.5",children:e.jsx(as,{st:h})})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2",children:l.installed?e.jsx(e.Fragment,{children:e.jsxs(se,{children:[e.jsx(te,{"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(Ue,{size:16})}),e.jsxs(ae,{align:"end",children:[e.jsxs(z,{onSelect:()=>A(l.id),disabled:i,children:[e.jsx(W,{size:14})," ",h?.hasUpdate?"Update now":"Check for update"]}),l.enabled?e.jsx(z,{onSelect:()=>l.engineId&&P(l.engineId,l.label),children:"Disable"}):e.jsx(z,{onSelect:()=>R(l.id),children:"Enable"}),l.enabled&&l.engineId&&e.jsxs(e.Fragment,{children:[e.jsx(Q,{}),e.jsx("div",{className:"px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-faint",children:"Auto-update"}),["off","notify","auto"].map(o=>e.jsxs(z,{onSelect:()=>N(l.engineId,o,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:t===o&&e.jsx(F,{size:13,className:"text-accent"})}),De[o]]},o))]}),e.jsx(Q,{}),e.jsx(z,{destructive:!0,onSelect:()=>p({id:l.id,label:l.label}),children:"Delete"})]})]})}):e.jsxs(S,{size:"sm",variant:"outline",disabled:b,onClick:()=>D(l.id),children:[i?e.jsx(V,{size:13,className:"animate-spin"}):e.jsx(W,{size:13}),"Download"]})})]},l.id)}),e.jsx(Re,{open:!!x,onOpenChange:l=>{l||p(null)},children:e.jsxs(ze,{children:[e.jsxs(Ie,{children:[e.jsxs(Te,{children:["Delete ",x?.label,"?"]}),e.jsx(_e,{children:"Files for this engine are removed from disk. Your models are not affected."})]}),e.jsxs(Fe,{children:[e.jsx(Oe,{children:"Cancel"}),e.jsx(qe,{onClick:()=>x&&E(x.id),disabled:d.remove.isPending,children:"Delete"})]})]})})]})}function is(n){return/[\\/]engines[\\/]llama\.cpp-/.test(n)}function ls(n){if(is(n.binPath)){const s=J(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 rs={"official-llama":"llama.cpp",koboldcpp:"KoboldCpp",mlx:"MLX",vllm:"vLLM",turboquant:"TurboQuant"};function os(n,s){if(n.startsWith("official-llama-")){const i=n.slice(15);return`llama.cpp (${Xe[i]??i.toUpperCase()})`}return rs[n]??s[0]?.name??n}const Xe={cuda:"CUDA",rocm:"ROCm",sycl:"SYCL",vulkan:"Vulkan",metal:"Metal",cpu:"CPU"};function J(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 Ae(n){const s=J(n.binPath);if(s){const i=Xe[s.backend]??s.backend.toUpperCase();return`${s.tag} · ${i}`}return n.version||n.name}function cs(n){let s=null,i=-1/0;for(const a of n){const m=J(a.binPath),c=xe(m?.tag);c!=null&&c>i&&(i=c,s=a.id)}return s}function ds(n){const s=[],i=new Map;for(const a of n){const m=ls(a);let c=i.get(m);c||(c=[],i.set(m,c),s.push(m)),c.push(a)}return s.map(a=>{const c=[...i.get(a)].sort((d,r)=>{const u=xe(J(d.binPath)?.tag);return(xe(J(r.binPath)?.tag)??-1)-(u??-1)});return{key:a,label:os(a,c),members:c,latestId:cs(c)}})}function us(n,s){const i=n.members.find(a=>a.id===s);if(i)return i;if(n.latestId){const a=n.members.find(m=>m.id===n.latestId);if(a)return a}return n.members[0]}const ms="https://github.com/mohitsoni48/TurboLLM/issues/new?template=engine-request.yml",xs=n=>/[\\/]engines[\\/]llama\.cpp-/.test(n);function Je(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 ps(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(xs(n.binPath)){const i=s?.backends.find(a=>a.active);return i?`llama.cpp · ${i.label}`:"llama.cpp"}return n.name}function Is(){const n=Me(),{data:s}=le(),i=!!s?.engineProvision?.active,a=hn(i),m=Ee(i),c=Ne(p=>p.logPanelOpen),d=Ne(p=>p.setLogPanelOpen),r=n.data,u=r?.activeEngineId??"",x=r?.engines.find(p=>p.id===u)??null;return e.jsxs("div",{className:"w-full px-6 py-6",children:[e.jsx(kn,{title:"Engines",description:"Switch the running engine up top. Install and manage engines below.",actions:e.jsx(je,{})}),e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx(hs,{rec:a.data,list:r,backends:m.data,activeEngine:x}),x&&e.jsx(Qn,{status:s,activeEngineName:x.name}),n.isError?e.jsx(K,{message:n.error instanceof C?n.error.message:"Could not load engines.",onRetry:()=>{n.refetch()}}):e.jsx(fs,{rec:a.data,isLoading:a.isLoading,activeCatalogId:x?Je(x):null,provisioning:i}),e.jsx(bs,{}),x&&e.jsx(es,{open:c,onOpenChange:d})]})]})}function hs({rec:n,list:s,backends:i,activeEngine:a}){const m=Z(),{data:c}=fn(),{data:d}=he(),{data:r}=le(),u=Pe(),[x,p]=v.useState(!1),y=v.useRef(!1),g=r?.engineBuild,N=!!g?.active;v.useEffect(()=>{y.current&&!N&&g&&(u.refresh(),g.phase==="done"&&g.engine&&g.engine!=="CUDA Toolkit"?k.success(`${g.engine} built and added — it's now your active engine.`):g.phase==="error"&&g.error&&g.engine!=="CUDA Toolkit"&&k.error(g.error)),y.current=N},[N]);const b=a?d?.updates[a.id]:void 0,$=!!b?.rebuild&&!!b?.hasUpdate&&!!a?.sourceRepo,D=n?.hardware,R=vn(c?.gpus??[]),P=D?.gpuName??R.gpuName,A=D?.vramMb??R.vramMb,E=D?Le(D.platform):c?.os.split("/")[0]?Le(c.os.split("/")[0]):"",U=[P??"CPU-only",A>0?`${(A/1024).toFixed(0)} GB`:null,E||null].filter(Boolean).join(" · "),l=s?.engines??[],h=v.useMemo(()=>ds(l),[l]),t=a?h.find(j=>j.members.some(B=>B.id===a.id))??null:null,o=a?ps(a,i):null,f=n?.recommendation.recommended?.engineId,L=!!a&&!!f&&Je(a)===f,q=m.activate.isPending,I=j=>{j!==a?.id&&m.activate.mutate(j,{onError:B=>k.error(B instanceof C?B.message:"Could not switch engine.")})},w=j=>{const B=us(j,a?.id??null);B&&I(B.id)};return e.jsxs("div",{className:"rounded-lg border border-border bg-panel p-4",style:{background:"color-mix(in srgb, var(--ok) 5%, var(--panel))"},children:[e.jsxs("div",{className:"flex flex-wrap items-center 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(gn,{size:13,className:"shrink-0",style:{color:"var(--ok)"}}),"Your hardware"]}),e.jsx("div",{className:"mt-0.5 truncate text-sm font-semibold text-ink",children:U||"Detecting…"})]}),e.jsxs("div",{className:"flex flex-col items-start gap-1 md:items-end",children:[e.jsx("span",{className:"text-[11px] font-medium uppercase tracking-wide text-faint",children:"Running now"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:justify-end",children:[e.jsxs(se,{children:[e.jsxs(te,{disabled:q||h.length===0,className:"flex h-9 min-w-[220px] 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",children:[e.jsx("span",{className:"flex h-2 w-2 shrink-0 rounded-full",style:{background:a?"var(--ok)":"var(--faint)"}}),e.jsx("span",{className:"flex-1 truncate text-left",children:t?.label??(h.length?"No engine active":"No engine installed")}),e.jsx(ue,{size:14,className:"shrink-0 text-muted"})]}),e.jsxs(ae,{align:"end",className:"w-[280px]",children:[e.jsx("div",{className:"px-2 py-1.5 text-[11px] font-medium uppercase tracking-wide text-faint",children:"Installed engines"}),h.length===0&&e.jsx("div",{className:"px-2 py-1.5 text-[12px] text-muted",children:"Install an engine below to get started."}),h.map(j=>{const B=j.members.some(ee=>!!d?.updates[ee.id]?.rebuild&&!!d?.updates[ee.id]?.hasUpdate),_=j.key===t?.key;return e.jsxs(z,{onSelect:()=>w(j),className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:_&&e.jsx(F,{size:14,className:"text-accent"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:j.label}),j.members.length>1&&e.jsxs("span",{className:"shrink-0 text-[11px] text-faint",children:[j.members.length," builds"]}),B&&e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:"var(--accent)"},children:"rebuild"}),_&&e.jsx("span",{className:"shrink-0 text-[11px] text-accent",children:"active"})]},j.key)}),e.jsx(Q,{}),e.jsx("div",{className:"px-2 py-1.5 text-[11px] text-faint",children:"Install more engines below ↓"})]})]}),t&&t.members.length>1&&e.jsxs(se,{children:[e.jsxs(te,{disabled:q,className:"flex h-9 min-w-[160px] 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",children:[e.jsx(In,{size:14,className:"shrink-0 text-accent"}),e.jsx("span",{className:"flex-1 truncate text-left",children:a?Ae(a):"Choose a build"}),e.jsx(ue,{size:14,className:"shrink-0 text-muted"})]}),e.jsxs(ae,{align:"end",className:"w-[260px]",children:[e.jsx("div",{className:"px-2 py-1.5 text-[11px] font-medium uppercase tracking-wide text-faint",children:"Version"}),t.members.map(j=>e.jsxs(z,{onSelect:()=>I(j.id),className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:j.id===a?.id&&e.jsx(F,{size:14,className:"text-accent"})}),e.jsx("span",{className:"min-w-0 flex-1 truncate text-ink",children:Ae(j)}),j.id===t.latestId&&e.jsx("span",{className:"shrink-0 text-[11px]",style:{color:"var(--ok)"},children:"latest"})]},j.id))]})]})]}),o&&e.jsx("span",{className:"text-[11px] text-muted",children:o}),L&&e.jsxs("span",{className:"flex items-center gap-1 text-[11px]",style:{color:"var(--ok)"},children:[e.jsx(be,{size:11})," recommended for your hardware"]}),$&&e.jsxs("button",{type:"button",onClick:()=>p(!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(yn,{size:11,className:"shrink-0"}),"Rebuild available",b?.installed&&b?.latest?` · ${b.installed} → ${b.latest}`:""]})]})]}),$&&a?.sourceRepo&&e.jsx(me,{open:x,onOpenChange:p,repoUrl:a.sourceRepo,branch:a.sourceBranch,engineName:a.name,mode:"rebuild"})]})}function fs({rec:n,isLoading:s,activeCatalogId:i,provisioning:a}){const m=bn(a),{data:c}=Me(),{data:d}=he(a),r=$e(),u=Z(),x=Be(),[p,y]=v.useState(null),g=v.useMemo(()=>{const t=new Map;for(const o of m.data?.engines??[])t.set(o.id,o);return t},[m.data]);if(s||!n)return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(pe,{children:"Install & manage"}),e.jsx(ce,{className:"h-16 w-full"}),e.jsx(ce,{className:"h-16 w-full"}),e.jsx(ce,{className:"h-16 w-full"})]});const N=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||u.remove.isPending||u.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,$=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,D=t=>{const o=c?.engines??[];if(t.sourceEngineId)return t.sourceEngineId;if(t.provision==="pip")return o.find(f=>f.kind===t.kind)?.id;if(t.id==="turboquant")return o.find(f=>/[\\/]engines[\\/]turboquant[\\/]/.test(f.binPath))?.id;if(t.id==="koboldcpp"||t.id==="llamafile")return o.find(f=>f.kind===t.kind)?.id},R=t=>{const o=b(t);o&&o.mutate(void 0,{onError:f=>k.error(f instanceof C?f.message:`Could not install ${t.name}.`)})},P=t=>{if(t.sourceBuilt&&t.sourceBinPath){u.add.mutate({binPath:t.sourceBinPath,name:t.name,sourceRepo:t.homepage,sourceBranch:t.sourceBranch||void 0},{onSuccess:()=>k.success(`${t.name} enabled`),onError:f=>k.error(f instanceof C?f.message:`Could not enable ${t.name}.`)});return}const o=b(t);o&&o.mutate(void 0,{onSuccess:()=>k.success(`${t.name} enabled`),onError:f=>k.error(f instanceof C?f.message:`Could not enable ${t.name}.`)})},A=t=>{const o=D(t);if(!o){k.error(`Could not find the installed ${t.name} engine.`);return}u.remove.mutate(o,{onSuccess:()=>k.success(`${t.name} disabled`),onError:f=>k.error(f instanceof C?f.message:`Could not disable ${t.name}.`)})},E=t=>{const o=$(t);o&&o.mutate(void 0,{onSuccess:()=>k.success(`Updating ${t.name} to the latest release…`),onError:f=>k.error(f instanceof C?f.message:`Could not update ${t.name}.`)})},U=(t,o)=>{const f=D(t);if(!f){k.error(`Could not find the installed ${t.name} engine.`);return}x.mutate({id:f,policy:o},{onError:L=>k.error(L instanceof C?L.message:"Could not change auto-update.")})},l=t=>{const o=D(t);if(!o){k.error(`Could not find the installed ${t.name} engine to delete.`);return}y({e:t,registryId:o})},h=()=>{p&&u.purge.mutate(p.registryId,{onSuccess:()=>{k.success(`${p.e.name} deleted`),y(null)},onError:t=>{y(null),k.error(t instanceof C?t.message:`Could not delete ${p.e.name}.`)}})};return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx(pe,{children:"Install & manage"}),n.recommendation.fits.filter(t=>{const o=g.get(t.engine.id);return t.engine.id==="vllm"||!o||o.supportedHere!==!1}).map(t=>{if(t.engine.id==="llama.cpp")return e.jsx(Qe,{filter:"recommended"},t.engine.id);const o=D(g.get(t.engine.id)??t.engine);return e.jsx(gs,{fit:t,catalog:g.get(t.engine.id),isActive:i===t.engine.id,anyPending:N,provisioning:a,updateStatus:o?d?.updates[o]:void 0,policy:(o?d?.policies[o]:void 0)??"notify",installFor:b,onInstall:R,onEnable:P,onDisable:A,onUpdate:E,onDelete:l,onSetPolicy:U},t.engine.id)}),e.jsxs("div",{className:"flex items-center gap-3 rounded-[var(--radius)] border border-dashed border-border-strong bg-panel p-4",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-semibold text-ink",children:"Add your own engine"}),e.jsx("div",{className:"mt-0.5 text-[12px] text-muted",children:"Point TurboLLM at any llama-server compatible binary — mainline llama.cpp or a community fork."})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(je,{})})]}),e.jsxs("a",{href:ms,target:"_blank",rel:"noreferrer",className:"mt-1 inline-flex items-center gap-1 self-start text-[12px] text-muted hover:text-ink",children:["Don't see your engine? Register it ",e.jsx(re,{size:11})]}),e.jsx(Re,{open:!!p,onOpenChange:t=>{t||y(null)},children:e.jsxs(ze,{children:[e.jsxs(Ie,{children:[e.jsxs(Te,{children:["Delete ",p?.e.name,"?"]}),e.jsx(_e,{children:"Files for this engine are removed from disk. Your models are not affected."})]}),e.jsxs(Fe,{children:[e.jsx(Oe,{children:"Cancel"}),e.jsx(qe,{onClick:h,disabled:u.purge.isPending,children:"Delete"})]})]})})]})}function gs({fit:n,catalog:s,isActive:i,anyPending:a,provisioning:m,updateStatus:c,policy:d,installFor:r,onInstall:u,onEnable:x,onDisable:p,onUpdate:y,onDelete:g,onSetPolicy:N}){const b=n.engine,[$,D]=v.useState(!1),[R,P]=v.useState(!1),A=b.id==="llama.cpp",E=!!s?.sourceBuilt,U=n.compatible.length===0,l=!U&&n.compatible.every(L=>!L.hasPrebuilt),h=b.support==="experimental",t=!!s?.installed,o=!!s?.enabled,f=t&&!o;return e.jsxs("div",{className:"flex items-start gap-3 rounded-[var(--radius)] border border-border bg-panel p-4",style:U?{opacity:.65}:void 0,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.jsx("span",{className:"text-sm font-semibold text-ink",children:b.name}),n.recommended?e.jsxs(T,{variant:"accent",children:[e.jsx(be,{size:10})," Recommended for you"]}):i?e.jsxs("span",{className:"flex items-center gap-1 text-[11px] font-medium",style:{color:"var(--ok)"},children:[e.jsx(F,{size:11})," Active"]}):o?e.jsxs("span",{className:"flex items-center gap-1 text-[11px] font-medium text-muted",children:[e.jsx(F,{size:11})," Installed"]}):null,h&&e.jsx(T,{variant:"mono",children:"experimental"}),b.id==="vllm"&&e.jsx(T,{variant:"mono",children:"For power users"}),f&&e.jsx(T,{variant:"mono",children:"Disabled"}),o&&c?.hasUpdate&&!c?.rebuild&&e.jsx(T,{variant:"accent",children:"Update available"}),U&&n.incompatibleReason&&e.jsx(T,{variant:"mono",children:n.incompatibleReason}),s&&e.jsxs("a",{href:s.homepage,target:"_blank",rel:"noreferrer",className:"flex items-center gap-0.5 text-[11px] text-muted hover:text-ink",title:s.homepage,children:[e.jsx(re,{size:10})," docs"]})]}),e.jsx("div",{className:"mt-0.5 text-[12px] text-muted",children:b.description}),A&&e.jsx("div",{className:"mt-1 text-[11px] text-faint",children:"Pick a specific GPU build in Advanced below."}),!A&&o&&e.jsx("div",{className:"mt-1",children:e.jsx(ks,{st:c})})]}),e.jsx("div",{className:"flex shrink-0 items-center gap-2 pt-0.5",children:A?e.jsx("span",{className:"text-[12px] text-faint",children:"built-in"}):s?t?e.jsxs(e.Fragment,{children:[e.jsxs(se,{children:[e.jsx(te,{"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(Ue,{size:16})}),e.jsxs(ae,{align:"end",children:[E?e.jsxs(z,{onSelect:()=>P(!0),disabled:a,children:[e.jsx(He,{size:14})," ",c?.hasUpdate?"Rebuild (new commit)":"Rebuild"]}):e.jsxs(z,{onSelect:()=>y(s),disabled:m,children:[e.jsx(W,{size:14})," ",c?.hasUpdate?"Update now":"Update"]}),o?e.jsx(z,{onSelect:()=>p(s),children:"Disable"}):e.jsx(z,{onSelect:()=>x(s),children:"Enable"}),o&&e.jsxs(e.Fragment,{children:[e.jsx(Q,{}),e.jsx("div",{className:"px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-faint",children:"Auto-update"}),["off","notify","auto"].map(L=>e.jsxs(z,{onSelect:()=>N(s,L),className:"flex items-center gap-2",children:[e.jsx("span",{className:"flex h-4 w-4 shrink-0 items-center justify-center",children:d===L&&e.jsx(F,{size:13,className:"text-accent"})}),js[L]]},L))]}),e.jsx(Q,{}),e.jsx(z,{destructive:!0,onSelect:()=>g(s),children:"Delete"})]})]}),E&&s&&e.jsx(me,{open:R,onOpenChange:P,repoUrl:s.homepage,branch:s.sourceBranch||void 0,engineName:b.name,mode:"rebuild"})]}):l?e.jsxs(e.Fragment,{children:[e.jsx(S,{size:"sm",variant:"outline",onClick:()=>D(!0),title:"No prebuilt binary — build it from source with a guided walkthrough.",children:"Build from source"}),e.jsx(me,{open:$,onOpenChange:D,repoUrl:s.homepage,engineName:b.name})]}):e.jsxs(S,{size:"sm",variant:"outline",disabled:a||U||s.comingSoon||!r(s),onClick:()=>u(s),title:s.comingSoon?"Not yet available":U?n.incompatibleReason??"Not supported on this hardware":`Install ${b.name}`,children:[r(s)?.isPending?e.jsx(V,{size:13,className:"animate-spin"}):e.jsx(W,{size:13}),s.comingSoon?"Coming soon":"Install"]}):null})]})}function bs(){const[n,s]=v.useState(!1);return e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsxs("button",{type:"button",onClick:()=>s(i=>!i),"aria-expanded":n,className:"flex w-full items-center gap-2 text-left",children:[e.jsx(ue,{size:14,className:"shrink-0 text-muted transition-transform",style:{transform:n?"rotate(0deg)":"rotate(-90deg)"}}),e.jsx(pe,{children:"Other llama.cpp builds"}),e.jsx("span",{className:"text-[11px] text-faint",children:"ROCm · CPU · Vulkan · SYCL"})]}),n&&e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("p",{className:"text-[12px] text-muted",children:"The other GPU/CPU backends for llama.cpp. Download one, then switch to it from the engine dropdown up top. The recommended backend is in “Install & manage”."}),e.jsx(Qe,{filter:"others"})]})]})}const js={off:"Off",notify:"Notify",auto:"Auto"};function vs(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 m=Math.floor(a/60);return m<24?`${m}h ago`:`${Math.floor(m/24)}d ago`}function ks({st:n,repoUrl:s}){return n?n.error==="offline"?e.jsx("span",{className:"text-[11px] text-faint",children:"Couldn't check for updates (offline)"}):n.error==="no_source"||!n.comparable?e.jsx("span",{className:"text-[11px] text-faint",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-faint",children:["Up to date · ",n.latest??n.installed,n.checkedAt?` · checked ${vs(n.checkedAt)}`:""]}):null}function pe({children:n}){return e.jsx("p",{className:"text-[11px] font-medium uppercase tracking-wide text-faint",children:n})}const Ns={darwin:"macOS",win32:"Windows",linux:"Linux"};function Le(n){return Ns[n]??n}export{Is as EnginesScreen};