modular-studio 1.0.5 → 1.1.0

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 (232) hide show
  1. package/README.md +122 -122
  2. package/dist/assets/Badge-Bsy2H_p2.js +1 -0
  3. package/dist/assets/GraphPanel-D4X3faxA.js +47 -0
  4. package/dist/assets/{Input-Bgp734xs.js → Input-Dyb88Erk.js} +1 -1
  5. package/dist/assets/KnowledgeTab-BccWz7Np.js +5 -0
  6. package/dist/assets/MemoryTab-Y_66cE01.js +16 -0
  7. package/dist/assets/QualificationTab-Dm9dEIpM.js +1 -0
  8. package/dist/assets/ReviewTab-BrfXSyyf.js +104 -0
  9. package/dist/assets/{Section-DoJrmytO.js → Section-68XDCFTl.js} +1 -1
  10. package/dist/assets/TestTab-CLKRT63X.js +42 -0
  11. package/dist/assets/ToolsTab-xumi9Uds.js +1 -0
  12. package/dist/assets/icons-CS8RUPBi.js +1 -0
  13. package/dist/assets/index-B2bm0161.css +1 -0
  14. package/dist/assets/index-C626nWuA.js +422 -0
  15. package/dist/assets/services-BDk6yY4o.js +369 -0
  16. package/dist/index.html +18 -18
  17. package/dist-server/bin/modular-mcp.js +1 -0
  18. package/dist-server/server/index.d.ts.map +1 -1
  19. package/dist-server/server/index.js +34 -0
  20. package/dist-server/server/mcp/manager.d.ts +3 -0
  21. package/dist-server/server/mcp/manager.d.ts.map +1 -1
  22. package/dist-server/server/mcp/manager.js +80 -5
  23. package/dist-server/server/migrations/index.d.ts +11 -0
  24. package/dist-server/server/migrations/index.d.ts.map +1 -0
  25. package/dist-server/server/migrations/index.js +57 -0
  26. package/dist-server/server/routes/agents.d.ts.map +1 -1
  27. package/dist-server/server/routes/agents.js +27 -0
  28. package/dist-server/server/routes/analytics.d.ts +3 -0
  29. package/dist-server/server/routes/analytics.d.ts.map +1 -0
  30. package/dist-server/server/routes/analytics.js +24 -0
  31. package/dist-server/server/routes/cache.d.ts +3 -0
  32. package/dist-server/server/routes/cache.d.ts.map +1 -0
  33. package/dist-server/server/routes/cache.js +55 -0
  34. package/dist-server/server/routes/connectors/airtable.d.ts +7 -0
  35. package/dist-server/server/routes/connectors/airtable.d.ts.map +1 -0
  36. package/dist-server/server/routes/connectors/airtable.js +119 -0
  37. package/dist-server/server/routes/connectors/confluence.d.ts +7 -0
  38. package/dist-server/server/routes/connectors/confluence.d.ts.map +1 -0
  39. package/dist-server/server/routes/connectors/confluence.js +176 -0
  40. package/dist-server/server/routes/connectors/github.d.ts +7 -0
  41. package/dist-server/server/routes/connectors/github.d.ts.map +1 -0
  42. package/dist-server/server/routes/connectors/github.js +195 -0
  43. package/dist-server/server/routes/connectors/gmail.d.ts +7 -0
  44. package/dist-server/server/routes/connectors/gmail.d.ts.map +1 -0
  45. package/dist-server/server/routes/connectors/gmail.js +115 -0
  46. package/dist-server/server/routes/connectors/google-docs.d.ts +10 -0
  47. package/dist-server/server/routes/connectors/google-docs.d.ts.map +1 -0
  48. package/dist-server/server/routes/connectors/google-docs.js +165 -0
  49. package/dist-server/server/routes/connectors/google-drive.d.ts +7 -0
  50. package/dist-server/server/routes/connectors/google-drive.d.ts.map +1 -0
  51. package/dist-server/server/routes/connectors/google-drive.js +163 -0
  52. package/dist-server/server/routes/connectors/google-sheets.d.ts +7 -0
  53. package/dist-server/server/routes/connectors/google-sheets.d.ts.map +1 -0
  54. package/dist-server/server/routes/connectors/google-sheets.js +90 -0
  55. package/dist-server/server/routes/connectors/hubspot.d.ts +7 -0
  56. package/dist-server/server/routes/connectors/hubspot.d.ts.map +1 -0
  57. package/dist-server/server/routes/connectors/hubspot.js +134 -0
  58. package/dist-server/server/routes/connectors/index.d.ts +6 -0
  59. package/dist-server/server/routes/connectors/index.d.ts.map +1 -0
  60. package/dist-server/server/routes/connectors/index.js +38 -0
  61. package/dist-server/server/routes/connectors/jira.d.ts +7 -0
  62. package/dist-server/server/routes/connectors/jira.d.ts.map +1 -0
  63. package/dist-server/server/routes/connectors/jira.js +151 -0
  64. package/dist-server/server/routes/connectors/linear.d.ts +7 -0
  65. package/dist-server/server/routes/connectors/linear.d.ts.map +1 -0
  66. package/dist-server/server/routes/connectors/linear.js +154 -0
  67. package/dist-server/server/routes/connectors/notion.d.ts +10 -0
  68. package/dist-server/server/routes/connectors/notion.d.ts.map +1 -0
  69. package/dist-server/server/routes/connectors/notion.js +201 -0
  70. package/dist-server/server/routes/connectors/plane.d.ts +10 -0
  71. package/dist-server/server/routes/connectors/plane.d.ts.map +1 -0
  72. package/dist-server/server/routes/connectors/plane.js +189 -0
  73. package/dist-server/server/routes/connectors/shared.d.ts +25 -0
  74. package/dist-server/server/routes/connectors/shared.d.ts.map +1 -0
  75. package/dist-server/server/routes/connectors/shared.js +202 -0
  76. package/dist-server/server/routes/connectors/slack.d.ts +7 -0
  77. package/dist-server/server/routes/connectors/slack.d.ts.map +1 -0
  78. package/dist-server/server/routes/connectors/slack.js +153 -0
  79. package/dist-server/server/routes/connectors.d.ts.map +1 -1
  80. package/dist-server/server/routes/connectors.js +47 -17
  81. package/dist-server/server/routes/cost.d.ts +3 -0
  82. package/dist-server/server/routes/cost.d.ts.map +1 -0
  83. package/dist-server/server/routes/cost.js +113 -0
  84. package/dist-server/server/routes/graph.d.ts +11 -0
  85. package/dist-server/server/routes/graph.d.ts.map +1 -0
  86. package/dist-server/server/routes/graph.js +213 -0
  87. package/dist-server/server/routes/lessons.d.ts +3 -0
  88. package/dist-server/server/routes/lessons.d.ts.map +1 -0
  89. package/dist-server/server/routes/lessons.js +160 -0
  90. package/dist-server/server/routes/llm.d.ts.map +1 -1
  91. package/dist-server/server/routes/llm.js +85 -18
  92. package/dist-server/server/routes/memory.d.ts.map +1 -1
  93. package/dist-server/server/routes/memory.js +31 -0
  94. package/dist-server/server/routes/metaprompt-v2.d.ts +3 -0
  95. package/dist-server/server/routes/metaprompt-v2.d.ts.map +1 -0
  96. package/dist-server/server/routes/metaprompt-v2.js +104 -0
  97. package/dist-server/server/routes/qualification.d.ts.map +1 -1
  98. package/dist-server/server/routes/qualification.js +342 -334
  99. package/dist-server/server/routes/repo-index.d.ts.map +1 -1
  100. package/dist-server/server/routes/repo-index.js +7 -0
  101. package/dist-server/server/routes/skills-search.d.ts.map +1 -1
  102. package/dist-server/server/routes/skills-search.js +192 -26
  103. package/dist-server/server/routes/tool-analytics.d.ts +3 -0
  104. package/dist-server/server/routes/tool-analytics.d.ts.map +1 -0
  105. package/dist-server/server/routes/tool-analytics.js +47 -0
  106. package/dist-server/server/services/adapters/hindsightAdapter.d.ts +28 -0
  107. package/dist-server/server/services/adapters/hindsightAdapter.d.ts.map +1 -0
  108. package/dist-server/server/services/adapters/hindsightAdapter.js +63 -0
  109. package/dist-server/server/services/adapters/postgresAdapter.js +30 -30
  110. package/dist-server/server/services/adapters/sqliteAdapter.d.ts +1 -0
  111. package/dist-server/server/services/adapters/sqliteAdapter.d.ts.map +1 -1
  112. package/dist-server/server/services/adapters/sqliteAdapter.js +66 -36
  113. package/dist-server/server/services/agentStore.d.ts +2 -1
  114. package/dist-server/server/services/agentStore.d.ts.map +1 -1
  115. package/dist-server/server/services/agentStore.js +2 -1
  116. package/dist-server/server/services/correctionDetector.d.ts +22 -0
  117. package/dist-server/server/services/correctionDetector.d.ts.map +1 -0
  118. package/dist-server/server/services/correctionDetector.js +91 -0
  119. package/dist-server/server/services/credentialStore.d.ts +10 -0
  120. package/dist-server/server/services/credentialStore.d.ts.map +1 -0
  121. package/dist-server/server/services/credentialStore.js +123 -0
  122. package/dist-server/server/services/hindsightClient.d.ts +15 -0
  123. package/dist-server/server/services/hindsightClient.d.ts.map +1 -0
  124. package/dist-server/server/services/hindsightClient.js +48 -0
  125. package/dist-server/server/services/lessonExtractor.d.ts +21 -0
  126. package/dist-server/server/services/lessonExtractor.d.ts.map +1 -0
  127. package/dist-server/server/services/lessonExtractor.js +92 -0
  128. package/dist-server/server/services/repoIndexer.d.ts +7 -1
  129. package/dist-server/server/services/repoIndexer.d.ts.map +1 -1
  130. package/dist-server/server/services/repoIndexer.js +295 -94
  131. package/dist-server/server/services/responseCache.d.ts +24 -0
  132. package/dist-server/server/services/responseCache.d.ts.map +1 -0
  133. package/dist-server/server/services/responseCache.js +163 -0
  134. package/dist-server/server/services/sqliteStore.d.ts +72 -0
  135. package/dist-server/server/services/sqliteStore.d.ts.map +1 -1
  136. package/dist-server/server/services/sqliteStore.js +291 -13
  137. package/dist-server/src/config.d.ts +2 -0
  138. package/dist-server/src/config.d.ts.map +1 -0
  139. package/dist-server/src/config.js +3 -0
  140. package/dist-server/src/graph/db.d.ts +46 -0
  141. package/dist-server/src/graph/db.d.ts.map +1 -0
  142. package/dist-server/src/graph/db.js +241 -0
  143. package/dist-server/src/graph/extractors/code.d.ts +12 -0
  144. package/dist-server/src/graph/extractors/code.d.ts.map +1 -0
  145. package/dist-server/src/graph/extractors/code.js +239 -0
  146. package/dist-server/src/graph/extractors/cross-type.d.ts +16 -0
  147. package/dist-server/src/graph/extractors/cross-type.d.ts.map +1 -0
  148. package/dist-server/src/graph/extractors/cross-type.js +67 -0
  149. package/dist-server/src/graph/extractors/markdown.d.ts +29 -0
  150. package/dist-server/src/graph/extractors/markdown.d.ts.map +1 -0
  151. package/dist-server/src/graph/extractors/markdown.js +224 -0
  152. package/dist-server/src/graph/extractors/yaml.d.ts +15 -0
  153. package/dist-server/src/graph/extractors/yaml.d.ts.map +1 -0
  154. package/dist-server/src/graph/extractors/yaml.js +104 -0
  155. package/dist-server/src/graph/index.d.ts +62 -0
  156. package/dist-server/src/graph/index.d.ts.map +1 -0
  157. package/dist-server/src/graph/index.js +67 -0
  158. package/dist-server/src/graph/packer.d.ts +19 -0
  159. package/dist-server/src/graph/packer.d.ts.map +1 -0
  160. package/dist-server/src/graph/packer.js +134 -0
  161. package/dist-server/src/graph/resolver.d.ts +12 -0
  162. package/dist-server/src/graph/resolver.d.ts.map +1 -0
  163. package/dist-server/src/graph/resolver.js +81 -0
  164. package/dist-server/src/graph/scanner.d.ts +34 -0
  165. package/dist-server/src/graph/scanner.d.ts.map +1 -0
  166. package/dist-server/src/graph/scanner.js +252 -0
  167. package/dist-server/src/graph/traverser.d.ts +17 -0
  168. package/dist-server/src/graph/traverser.d.ts.map +1 -0
  169. package/dist-server/src/graph/traverser.js +185 -0
  170. package/dist-server/src/graph/types.d.ts +117 -0
  171. package/dist-server/src/graph/types.d.ts.map +1 -0
  172. package/dist-server/src/graph/types.js +63 -0
  173. package/dist-server/src/metaprompt/v2/assembler.d.ts +3 -0
  174. package/dist-server/src/metaprompt/v2/assembler.d.ts.map +1 -0
  175. package/dist-server/src/metaprompt/v2/assembler.js +261 -0
  176. package/dist-server/src/metaprompt/v2/context-strategist.d.ts +3 -0
  177. package/dist-server/src/metaprompt/v2/context-strategist.d.ts.map +1 -0
  178. package/dist-server/src/metaprompt/v2/context-strategist.js +173 -0
  179. package/dist-server/src/metaprompt/v2/evaluator.d.ts +3 -0
  180. package/dist-server/src/metaprompt/v2/evaluator.d.ts.map +1 -0
  181. package/dist-server/src/metaprompt/v2/evaluator.js +281 -0
  182. package/dist-server/src/metaprompt/v2/index.d.ts +41 -0
  183. package/dist-server/src/metaprompt/v2/index.d.ts.map +1 -0
  184. package/dist-server/src/metaprompt/v2/index.js +90 -0
  185. package/dist-server/src/metaprompt/v2/parser.d.ts +3 -0
  186. package/dist-server/src/metaprompt/v2/parser.d.ts.map +1 -0
  187. package/dist-server/src/metaprompt/v2/parser.js +138 -0
  188. package/dist-server/src/metaprompt/v2/pattern-selector.d.ts +3 -0
  189. package/dist-server/src/metaprompt/v2/pattern-selector.d.ts.map +1 -0
  190. package/dist-server/src/metaprompt/v2/pattern-selector.js +154 -0
  191. package/dist-server/src/metaprompt/v2/researcher.d.ts +3 -0
  192. package/dist-server/src/metaprompt/v2/researcher.d.ts.map +1 -0
  193. package/dist-server/src/metaprompt/v2/researcher.js +194 -0
  194. package/dist-server/src/metaprompt/v2/tool-discovery.d.ts +74 -0
  195. package/dist-server/src/metaprompt/v2/tool-discovery.d.ts.map +1 -0
  196. package/dist-server/src/metaprompt/v2/tool-discovery.js +290 -0
  197. package/dist-server/src/metaprompt/v2/types.d.ts +154 -0
  198. package/dist-server/src/metaprompt/v2/types.d.ts.map +1 -0
  199. package/dist-server/src/metaprompt/v2/types.js +2 -0
  200. package/dist-server/src/services/contradictionDetector.js +1 -1
  201. package/dist-server/src/services/llmService.d.ts +61 -0
  202. package/dist-server/src/services/llmService.d.ts.map +1 -0
  203. package/dist-server/src/services/llmService.js +222 -0
  204. package/dist-server/src/store/knowledgeBase.d.ts +6 -1
  205. package/dist-server/src/store/knowledgeBase.d.ts.map +1 -1
  206. package/dist-server/src/store/knowledgeBase.js +0 -1
  207. package/dist-server/src/store/lessonStore.d.ts +26 -0
  208. package/dist-server/src/store/lessonStore.d.ts.map +1 -0
  209. package/dist-server/src/store/lessonStore.js +64 -0
  210. package/dist-server/src/store/mcp-registry.d.ts +29 -0
  211. package/dist-server/src/store/mcp-registry.d.ts.map +1 -0
  212. package/dist-server/src/store/mcp-registry.js +1303 -0
  213. package/dist-server/src/store/memoryStore.d.ts +12 -1
  214. package/dist-server/src/store/memoryStore.d.ts.map +1 -1
  215. package/dist-server/src/store/memoryStore.js +9 -0
  216. package/dist-server/src/types/registry.types.d.ts +13 -0
  217. package/dist-server/src/types/registry.types.d.ts.map +1 -0
  218. package/dist-server/src/types/registry.types.js +2 -0
  219. package/dist-server/tsconfig.server.tsbuildinfo +1 -1
  220. package/package.json +15 -1
  221. package/scripts/cleanup-worktrees.ps1 +29 -0
  222. package/dist/assets/Badge-22Ai0eyi.js +0 -1
  223. package/dist/assets/KnowledgeTab-DABxirZh.js +0 -4
  224. package/dist/assets/MemoryTab-DZeYElIT.js +0 -16
  225. package/dist/assets/QualificationTab-Dfpy3J30.js +0 -1
  226. package/dist/assets/ReviewTab-SD8lQuCc.js +0 -103
  227. package/dist/assets/TestTab-PDyMF8Fw.js +0 -33
  228. package/dist/assets/ToolsTab-B83qGCmG.js +0 -1
  229. package/dist/assets/icons-C2EV-le6.js +0 -1
  230. package/dist/assets/index-DkpMAxX7.css +0 -1
  231. package/dist/assets/index-q24ug5Qs.js +0 -143
  232. package/dist/assets/services-BaKotDf0.js +0 -343
@@ -0,0 +1,42 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jszip.min-wf-D3Ix_.js","assets/vendor-D1h_O76p.js","assets/services-BDk6yY4o.js","assets/stores-CeKWz7ou.js"])))=>i.map(i=>d[i]);
2
+ import{r as y,j as e}from"./vendor-D1h_O76p.js";import{u as v,e as ge,d as ct,S as De}from"./index-C626nWuA.js";import{useConversationStore as P}from"./conversationStore-CkfEU2eV.js";import{_ as xe,n as Y,o as K,a as We,u as B,p as ae,r as Se,q as dt,A as ze,e as J,t as be,v as pt,w as xt,m as ut,x as mt,y as ft,z as ht,B as yt,C as gt,E as $e,F as bt,G as jt}from"./services-BDk6yY4o.js";import{a4 as Ce,ao as Ne,Q as Fe,a3 as Ue,a8 as He,ay as Ke,an as vt,a as O,C as W,Z as oe,B as ue,V as me,aj as kt,W as qe,X as Ye,P as Ve,az as Ze,aA as St,a1 as Nt,aB as wt,c as Ct,U as Ft,ax as Mt,aC as Tt,h as we,aD as Et,a0 as Dt,w as Pe,ag as zt,n as $t,x as fe,G as Pt,aE as Re,i as Le,J as Rt,as as Lt,aF as At}from"./icons-CS8RUPBi.js";import{M as It,r as Bt}from"./markdown-DWF7F0i0.js";import"./stores-CeKWz7ou.js";function pe(t){return t?t.includes(`
3
+ `)?`|
4
+ ${t.split(`
5
+ `).map(s=>" "+s).join(`
6
+ `)}`:/[:#"'{}\[\],&*?|>!%@`]/.test(t)?`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`:t:'""'}function Ae(t,s=0){const o=" ".repeat(s);return t.map(r=>`${o}- ${pe(r)}`).join(`
7
+ `)}function Gt(t){const s=t.agentMeta,o=t.agentConfig,r=[];return r.push(`name: ${pe(s.name||"Untitled Agent")}`),s.description&&r.push(`description: ${pe(s.description)}`),r.push('version: "1.0.0"'),s.tags?.length&&r.push(`tags:
8
+ ${Ae(s.tags)}`),s.avatar&&r.push(`avatar: ${s.avatar}`),s.icon&&r.push(`icon: ${s.icon}`),r.push(""),r.push("# Runtime"),r.push(`model: ${pe(t.selectedModel)}`),o?.temperature!==void 0&&r.push(`temperature: ${o.temperature}`),o?.planningMode&&r.push(`planning: ${o.planningMode}`),r.push(`token_budget: ${t.tokenBudget}`),r.push(""),r.push("# Output"),r.push(`output_format: ${t.outputFormat}`),t.outputFormats.length>1&&r.push(`output_formats:
9
+ ${Ae(t.outputFormats)}`),r.join(`
10
+ `)+`
11
+ `}function _t(t){const s=t.instructionState,o=t.agentMeta,r=[];if(r.push(`# ${o.name||"Agent"}`),r.push(""),o.description&&(r.push(o.description),r.push("")),s?.persona&&(r.push("## Persona"),r.push(""),r.push(s.persona),r.push("")),s?.tone&&s.tone!=="neutral"&&(r.push(`**Tone:** ${s.tone}`),r.push("")),s?.expertise&&s.expertise!==3){const n=["Beginner","Novice","Intermediate","Advanced","Expert"];r.push(`**Expertise:** ${n[s.expertise-1]} (${s.expertise}/5)`),r.push("")}return r.join(`
12
+ `)}function Ot(t){const s=t.instructionState,o=["# Instructions",""];s?.objectives?.primary&&(o.push("## Objective"),o.push(""),o.push(s.objectives.primary),o.push(""),s.objectives.successCriteria.length>0&&(o.push("### Success Criteria"),o.push(""),s.objectives.successCriteria.forEach(n=>o.push(`- ${n}`)),o.push("")),s.objectives.failureModes.length>0&&(o.push("### Failure Modes to Avoid"),o.push(""),s.objectives.failureModes.forEach(n=>o.push(`- ${n}`)),o.push("")));const r=[];if(s?.constraints){const n=s.constraints;n.neverMakeUp&&r.push("Never fabricate information or make up facts"),n.askBeforeActions&&r.push("Ask for permission before taking significant actions"),n.stayInScope&&r.push(`Stay within scope${n.scopeDefinition?": "+n.scopeDefinition:""}`),n.useOnlyTools&&r.push("Only use tools and capabilities that are explicitly provided"),n.limitWords&&r.push(`Keep responses under ${n.wordLimit} words`),n.customConstraints&&n.customConstraints.split(`
13
+ `).filter(Boolean).forEach(l=>r.push(l.trim()))}return r.length>0&&(o.push("## Constraints"),o.push(""),r.forEach(n=>o.push(`- ${n}`)),o.push("")),t.workflowSteps&&t.workflowSteps.length>0&&(o.push("## Workflow"),o.push(""),t.workflowSteps.forEach((n,l)=>{o.push(`${l+1}. **${n.label}** — ${n.action}`)}),o.push("")),t.prompt&&!s?.persona&&!s?.objectives?.primary&&(o.push("## Additional Instructions"),o.push(""),o.push(t.prompt),o.push("")),o.join(`
14
+ `)}function Wt(t){const s=["# Tools",""],o=t.mcpServers.filter(n=>n.enabled&&n.added),r=t.skills.filter(n=>n.enabled&&n.added);return o.length>0&&(s.push("## MCP Servers"),s.push(""),o.forEach(n=>{s.push(`### ${n.name}`),s.push(""),n.description&&s.push(n.description),s.push(""),s.push("```yaml"),s.push(`id: ${n.id}`),s.push("transport: stdio"),s.push("command: npx"),s.push(`args: ["@${n.id}/mcp"]`),s.push("```"),s.push("")})),r.length>0&&(s.push("## Skills"),s.push(""),r.forEach(n=>{s.push(`- **${n.name}**${n.description?" — "+n.description:""}`)}),s.push("")),o.length===0&&r.length===0&&(s.push("No tools configured."),s.push("")),s.join(`
15
+ `)}function Ut(t){const s=["# Knowledge",""],o=t.channels.filter(n=>n.enabled),r=(t.connectors??[]).filter(n=>n.enabled);return o.length>0&&(s.push("## Sources"),s.push(""),o.forEach(n=>{const l=n.knowledgeType||"signal";s.push(`### ${n.name||n.path}`),s.push(""),s.push(`- **Path:** \`${n.path}\``),s.push(`- **Type:** ${l}`),n.content&&s.push(`- **Content Preview:** ${n.content.slice(0,100)}${n.content.length>100?"...":""}`),n.hint&&s.push(`- **Hint:** ${n.hint}`),s.push("")})),r.length>0&&(s.push("## Connectors"),s.push(""),r.forEach(n=>{s.push(`- **${n.name}** (${n.service}) — ${n.direction}${n.hint?", scope: "+n.hint:""}`)}),s.push("")),s.push("## Budget"),s.push(""),s.push(`Token budget: ${t.tokenBudget}`),s.push(""),s.join(`
16
+ `)}function Ht(t){return["# Memory","","<!-- Initial memory for this agent. Add seed context, key facts, or preferences here. -->",""].join(`
17
+ `)}function Je(t){return{"agent.yaml":Gt(t),"SOUL.md":_t(t),"INSTRUCTIONS.md":Ot(t),"TOOLS.md":Wt(t),"KNOWLEDGE.md":Ut(t),"MEMORY.md":Ht()}}async function Kt(t){const s=Je(t),o=(t.agentMeta.name||"modular-agent").toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"");try{const r=(await xe(async()=>{const{default:i}=await import("./jszip.min-wf-D3Ix_.js").then(p=>p.j);return{default:i}},__vite__mapDeps([0,1]))).default,n=new r,l=n.folder(o);for(const[i,p]of Object.entries(s))l.file(i,p);const d=await n.generateAsync({type:"blob"}),a=URL.createObjectURL(d),c=document.createElement("a");c.href=a,c.download=`${o}.zip`,c.click(),URL.revokeObjectURL(a)}catch{for(const[r,n]of Object.entries(s)){const l=new Blob([n],{type:"text/plain"}),d=URL.createObjectURL(l),a=document.createElement("a");a.href=d,a.download=r,a.click(),URL.revokeObjectURL(d)}}}function Xe(t){const s={};return t["agent.yaml"]&&(s.agentYaml=Qe(t["agent.yaml"])),t["SOUL.md"]&&(s.soul=t["SOUL.md"]),t["INSTRUCTIONS.md"]&&(s.instructions=t["INSTRUCTIONS.md"]),t["TOOLS.md"]&&(s.tools=t["TOOLS.md"]),t["KNOWLEDGE.md"]&&(s.knowledge=t["KNOWLEDGE.md"]),t["MEMORY.md"]&&(s.memory=t["MEMORY.md"]),s}function Qe(t){const s={};let o=null,r="";for(const n of t.split(`
18
+ `)){const l=n.trim();if(!l||l.startsWith("#"))continue;if(l.startsWith("- ")&&o!==null){o.push(l.slice(2).replace(/^["']|["']$/g,"")),s[r]=o;continue}o=null;const d=l.indexOf(":");if(d===-1)continue;const a=l.slice(0,d).trim();if(a==="__proto__"||a==="constructor"||a==="prototype")continue;const c=l.slice(d+1).trim();if(!c){r=a,o=[];continue}const i=c.replace(/^["']|["']$/g,"");i==="true"?s[a]=!0:i==="false"?s[a]=!1:/^\d+(\.\d+)?$/.test(i)?s[a]=Number(i):s[a]=i}return s}function et(t){const s={};if(t.agentYaml){const o=t.agentYaml;s.agentMeta={name:o.name||"",description:o.description||"",avatar:o.avatar||"",icon:o.icon||"",category:o.category||"general",tags:Array.isArray(o.tags)?o.tags:[]},o.model&&(s.selectedModel=o.model),o.token_budget&&(s.tokenBudget=o.token_budget),o.output_format&&(s.outputFormat=o.output_format),s.agentConfig={temperature:o.temperature??.7,planningMode:o.planning??"single-shot",model:o.model??""}}if(t.soul||t.instructions){const o={persona:"",tone:"neutral",expertise:3,constraints:{neverMakeUp:!1,askBeforeActions:!1,stayInScope:!1,useOnlyTools:!1,limitWords:!1,wordLimit:500,customConstraints:"",scopeDefinition:""},objectives:{primary:"",successCriteria:[],failureModes:[]},rawPrompt:"",autoSync:!1};if(t.soul){const r=t.soul.split(`
19
+ `);let n="",l="";for(const d of r){const a=d.trim();a.startsWith("## ")?(n==="persona"&&l.trim()&&(o.persona=l.trim()),n=a.toLowerCase().includes("persona")?"persona":"",l=""):!a.startsWith("#")&&a&&(n||!o.persona)&&(l+=d+`
20
+ `,!o.persona&&!n&&(o.persona=l.trim()))}n==="persona"&&l.trim()&&(o.persona=l.trim())}if(t.instructions){const r=t.instructions.split(`
21
+ `);let n="",l=!1,d=[];for(const a of r){const c=a.trim();if(c.startsWith("## ")){n==="successCriteria"&&d.length>0?o.objectives.successCriteria=d:n==="failureModes"&&d.length>0&&(o.objectives.failureModes=d);const i=c.toLowerCase();i.includes("objective")?n="objective":i.includes("constraint")&&(n="constraints"),l=!1,d=[]}else if(c.startsWith("### ")){const i=c.toLowerCase();i.includes("success")?(n="successCriteria",l=!0,d=[]):i.includes("failure")&&(n="failureModes",l=!0,d=[])}else if(c.startsWith("- ")){if(l)d.push(c.substring(2));else if(n==="constraints"){const i=c.substring(2);if((i.toLowerCase().includes("never fabricate")||i.toLowerCase().includes("never make up"))&&(o.constraints.neverMakeUp=!0),i.toLowerCase().includes("ask")&&i.toLowerCase().includes("permission")&&(o.constraints.askBeforeActions=!0),i.toLowerCase().includes("scope")&&(o.constraints.stayInScope=!0),i.toLowerCase().includes("only use tools")&&(o.constraints.useOnlyTools=!0),i.toLowerCase().includes("word")&&/\d+/.test(i)){o.constraints.limitWords=!0;const p=i.match(/(\d+)/);p&&(o.constraints.wordLimit=parseInt(p[1]))}}}else n==="objective"&&c&&!c.startsWith("#")&&(o.objectives.primary||(o.objectives.primary=c))}n==="successCriteria"&&d.length>0?o.objectives.successCriteria=d:n==="failureModes"&&d.length>0&&(o.objectives.failureModes=d)}s.instructionState=o}return s}async function tt(t){try{const s=(await xe(async()=>{const{default:g}=await import("./jszip.min-wf-D3Ix_.js").then(f=>f.j);return{default:g}},__vite__mapDeps([0,1]))).default,o=new s,r=10*1024*1024;if(t.size>r)throw new Error(`ZIP file too large (${(t.size/1024/1024).toFixed(1)}MB). Maximum is 10MB.`);const n=await o.loadAsync(t),l=2*1024*1024,d={},a=["agent.yaml","SOUL.md","INSTRUCTIONS.md","TOOLS.md","KNOWLEDGE.md","MEMORY.md"];for(const[g,f]of Object.entries(n.files)){if(f.dir)continue;const h=g.split("/").pop()||"";if(a.includes(h))try{const b=await f.async("text");if(b.length>l){console.warn(`Skipping ${h}: exceeds 2MB limit`);continue}d[h]=b}catch(b){console.warn(`Failed to read ${h}:`,b)}}if(!d["agent.yaml"])throw new Error("agent.yaml is required but not found in the ZIP file");const c=Xe(d),i=et(c),{useConsoleStore:p}=await xe(async()=>{const{useConsoleStore:g}=await import("./services-BDk6yY4o.js").then(f=>f.$);return{useConsoleStore:g}},__vite__mapDeps([2,3,1]));p.getState().restoreFullState(i)}catch(s){throw console.error("Import failed:",s),s instanceof Error?s:new Error("Unknown import error")}}const qt=Object.freeze(Object.defineProperty({__proto__:null,agentDirectoryToState:et,downloadAgentDirectory:Kt,exportAgentDirectory:Je,importAgentFromZip:tt,parseAgentDirectory:Xe,parseSimpleYaml:Qe},Symbol.toStringTag,{value:"Module"}));function Yt({stats:t,traceId:s}){const[o,r]=y.useState(!1),n=v(),l=Y(b=>b.selectTrace),d=Y(b=>b.selectedTraceId),a=s!=null&&d===s,c=t.totalContextTokens||0,i=t.retrieval?.selectedChunks||0,p=t.retrieval?.retrievalMs||0,x=t.retrieval?.embeddingMs||0,g=p+x,f=t.retrieval?.queryType||"none",h=t.toolTurns||0;return e.jsxs("div",{className:"mt-2 border rounded-md overflow-hidden transition-all duration-200",style:{border:`1px solid ${a?"#FE5000":n.borderSubtle}`,background:n.isDark?"#0d0d10":"#f8f8fa",fontFamily:"'Geist Mono', monospace"},children:[e.jsxs("div",{className:"flex items-center",children:[e.jsxs("button",{onClick:()=>r(!o),title:o?"Collapse trace":"Expand trace",className:"flex-1 px-3 py-2 text-left text-xs flex items-center justify-between hover:opacity-80 transition-opacity border-none bg-transparent cursor-pointer",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[e.jsxs("span",{children:["📊 ",c," tokens • ",i," sources • ",g,"ms",h>0&&` • ${h} tool calls`]}),e.jsx("span",{className:"text-[10px]",style:{color:"#FE5000"},children:o?"▼":"▶"})]}),s&&e.jsx("button",{onClick:b=>{b.stopPropagation(),l(a?null:s)},className:"px-2 py-1.5 text-[10px] border-none cursor-pointer rounded-r-md transition-colors",style:{background:a?"#FE500020":"transparent",color:a?"#FE5000":n.textFaint,fontFamily:"'Geist Mono', monospace"},title:a?"Deselect trace":"Select trace",children:a?"📍":"○"})]}),o&&e.jsxs("div",{className:"px-3 pb-3 pt-1 text-xs space-y-2 border-t",style:{borderTop:`1px solid ${n.borderSubtle}`,color:n.textSecondary},children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Context tokens:"}),e.jsx("span",{style:{color:n.textPrimary},children:c.toLocaleString()})]}),t.retrieval&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Retrieval mode:"}),e.jsx("span",{style:{color:n.textPrimary},children:f})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Sources selected:"}),e.jsxs("span",{style:{color:n.textPrimary},children:[i," / ",t.retrieval.totalChunks]})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Retrieval time:"}),e.jsxs("span",{style:{color:n.textPrimary},children:[p,"ms"]})]}),x>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Embedding time:"}),e.jsxs("span",{style:{color:n.textPrimary},children:[x,"ms"]})]})]}),h>0&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"Tool turns:"}),e.jsx("span",{style:{color:n.textPrimary},children:h})]}),t.systemTokens&&t.systemTokens!==c&&e.jsxs("div",{className:"flex justify-between",children:[e.jsx("span",{children:"System tokens:"}),e.jsx("span",{style:{color:n.textPrimary},children:t.systemTokens.toLocaleString()})]}),t.memory&&e.jsxs("div",{className:"pt-1 border-t",style:{borderTop:`1px solid ${n.borderSubtle}`},children:[e.jsx("div",{className:"text-[10px] mb-1",style:{color:n.textDim},children:"Memory"}),e.jsxs("div",{className:"flex justify-between text-[11px]",children:[e.jsx("span",{children:"Facts written:"}),e.jsx("span",{style:{color:n.textPrimary},children:t.memory.writtenFacts})]}),t.memory.recalledFacts>0&&e.jsxs("div",{className:"flex justify-between text-[11px]",children:[e.jsx("span",{children:"Facts recalled:"}),e.jsx("span",{style:{color:n.textPrimary},children:t.memory.recalledFacts})]})]})]})]})}const Vt={toolCalling:"Tool Calling",streaming:"Streaming",structuredOutput:"Structured Output",memoryHooks:"Memory Hooks",agentLoop:"Agent Loop",mcpBridge:"MCP Bridge"},D="supported",I="degraded",se="unsupported",ie={anthropic:{toolCalling:{status:D},streaming:{status:D},structuredOutput:{status:D},memoryHooks:{status:D},agentLoop:{status:D},mcpBridge:{status:D}},"claude-agent-sdk":{toolCalling:{status:D},streaming:{status:D},structuredOutput:{status:D},memoryHooks:{status:D},agentLoop:{status:D},mcpBridge:{status:D}},openai:{toolCalling:{status:D},streaming:{status:D},structuredOutput:{status:D},memoryHooks:{status:I,note:"Requires external memory layer"},agentLoop:{status:D},mcpBridge:{status:I,note:"Via OpenAI-compatible proxy"}},google:{toolCalling:{status:D},streaming:{status:D},structuredOutput:{status:I,note:"JSON mode only, no strict schema"},memoryHooks:{status:se,note:"Not natively supported"},agentLoop:{status:I,note:"Manual orchestration required"},mcpBridge:{status:se,note:"No MCP support"}},openrouter:{toolCalling:{status:I,note:"Depends on underlying model"},streaming:{status:D},structuredOutput:{status:I,note:"Depends on underlying model"},memoryHooks:{status:I,note:"Depends on underlying model"},agentLoop:{status:I,note:"Depends on underlying model"},mcpBridge:{status:se,note:"Not available through proxy"}},custom:{toolCalling:{status:I,note:"Depends on implementation"},streaming:{status:I,note:"Depends on implementation"},structuredOutput:{status:I,note:"Depends on implementation"},memoryHooks:{status:se,note:"Unknown provider"},agentLoop:{status:I,note:"Depends on implementation"},mcpBridge:{status:se,note:"Unknown provider"}}};function Zt(t){return ie[t]?ie[t]:(t.startsWith("custom"),ie.custom)}function Jt(t,s){const o=[];for(const r of s){const n=t[r],l=Vt[r];n.status==="unsupported"?o.push({level:"error",capability:r,message:`${l} is not supported by this provider${n.note?`: ${n.note}`:""}`}):n.status==="degraded"?o.push({level:"warning",capability:r,message:`${l} has limited support${n.note?`: ${n.note}`:""}`}):o.push({level:"ok",capability:r,message:`${l} is fully supported`})}return o}function Xt({matrix:t,requiredCapabilities:s}){const o=v();if(s.length===0)return null;const r=Jt(t,s),n=r.filter(d=>d.level==="error"),l=r.filter(d=>d.level==="warning");return n.length===0&&l.length===0?null:e.jsxs("div",{className:"flex flex-col gap-1.5",children:[n.map(d=>e.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg text-[12px]",style:{background:o.statusErrorBg,color:o.statusError,border:`1px solid ${o.statusError}30`},role:"alert",children:[e.jsx(Ce,{size:12,className:"shrink-0 mt-0.5"}),e.jsx("span",{children:d.message})]},d.capability)),l.map(d=>e.jsxs("div",{className:"flex items-start gap-2 px-3 py-2 rounded-lg text-[12px]",style:{background:o.statusWarningBg,color:o.statusWarning,border:`1px solid ${o.statusWarning}30`},role:"status",children:[e.jsx(Ne,{size:12,className:"shrink-0 mt-0.5"}),e.jsx("span",{children:d.message})]},d.capability))]})}const Qt={observation:"#3498db",inference:"#f1c40f",decision:"#2ecc71",hypothesis:"#9b59b6",contract:"#FE5000"};function st({fact:t}){const s=Qt[t.epistemicType]??"#888";return e.jsx("span",{style:{fontSize:12,padding:"2px 6px",borderRadius:4,background:s+"15",color:s,fontFamily:"'Geist Mono', monospace"},children:t.key})}function es({text:t}){const[s,o]=y.useState(!1);return e.jsx("button",{type:"button",onClick:()=>{navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),1500)},style:{background:"none",border:"none",cursor:"pointer",padding:2,opacity:.6},title:"Copy output",children:s?e.jsx(me,{size:12,style:{color:"#2ecc71"}}):e.jsx(kt,{size:12})})}function ts({agent:t,expanded:s}){const o=v(),[r,n]=y.useState(s??!1),l={waiting:e.jsx(vt,{size:14,style:{color:o.textDim}}),running:e.jsx(Fe,{size:14,className:"animate-spin",style:{color:"#FE5000"}}),completed:e.jsx(Ue,{size:14,style:{color:"#2ecc71"}}),error:e.jsx(Ce,{size:14,style:{color:"#dc2626"}})}[t.status],d=t.status==="completed"?t.output:t.currentMessage,a=(d?.length??0)>300;return e.jsxs("div",{style:{padding:12,borderRadius:8,border:`1px solid ${t.status==="running"?"#FE500040":o.border}`,background:t.status==="running"?"#FE500008":o.surface},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:d?8:0},children:[l,e.jsx("span",{style:{fontSize:14,fontWeight:600,color:o.textPrimary,fontFamily:"'Geist Mono', monospace"},children:t.name}),t.isAgentSdk&&e.jsx("span",{style:{fontSize:10,padding:"2px 6px",borderRadius:4,background:"#FE500015",color:"#FE5000",fontFamily:"'Geist Mono', monospace",fontWeight:600,border:"1px solid #FE500030"},children:"Agent SDK"}),e.jsxs("span",{style:{fontSize:12,color:o.textDim,marginLeft:"auto",display:"flex",alignItems:"center",gap:6},children:[t.status==="running"?`Turn ${t.turns}`:t.status,t.tokens&&(t.tokens.input>0||t.tokens.output>0)&&e.jsxs("span",{style:{fontSize:11,color:o.textFaint},children:[((t.tokens.input+t.tokens.output)/1e3).toFixed(1),"k tok"]})]})]}),d&&e.jsxs("div",{style:{position:"relative"},children:[e.jsx("div",{style:{fontSize:13,padding:10,borderRadius:6,background:o.inputBg,color:o.textPrimary,lineHeight:1.6,whiteSpace:"pre-wrap",overflowY:"auto",maxHeight:r?"none":200},children:d}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,marginTop:4},children:[a&&e.jsx("button",{type:"button",onClick:()=>n(!r),style:{background:"none",border:"none",cursor:"pointer",padding:"2px 6px",fontSize:12,color:"#FE5000",display:"flex",alignItems:"center",gap:4,fontFamily:"'Geist Mono', monospace"},children:r?e.jsxs(e.Fragment,{children:[e.jsx(O,{size:12})," Collapse"]}):e.jsxs(e.Fragment,{children:[e.jsx(W,{size:12})," Expand (",Math.ceil((d?.length??0)/1e3),"k chars)"]})}),d&&e.jsx(es,{text:d})]})]}),t.toolCalls.length>0&&e.jsxs("div",{style:{marginTop:8},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[e.jsx(oe,{size:12,style:{color:"#2ecc71"}}),e.jsxs("span",{style:{fontSize:12,fontWeight:600,color:o.textSecondary,fontFamily:"'Geist Mono', monospace"},children:["Tool Calls (",t.toolCalls.length,")"]})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.toolCalls.map((c,i)=>e.jsxs("div",{style:{fontSize:12,padding:6,borderRadius:4,background:"#2ecc7115",border:"1px solid #2ecc7130",color:o.textSecondary,fontFamily:"'Geist Mono', monospace"},children:[e.jsx("div",{style:{fontWeight:600,color:"#2ecc71",marginBottom:2},children:c.tool}),c.args&&e.jsx("div",{style:{color:o.textDim,fontSize:11,lineHeight:1.4},children:c.args.length>100?c.args.slice(0,100)+"…":c.args})]},i))})]}),t.facts.length>0&&e.jsx("div",{style:{marginTop:8,display:"flex",flexWrap:"wrap",gap:4},children:t.facts.map((c,i)=>e.jsx(st,{fact:c},i))})]})}function ss({facts:t}){const s=v();return t.length===0?null:e.jsxs("div",{style:{padding:12,borderRadius:8,border:`1px solid ${s.border}`,background:s.surface},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[e.jsx(ue,{size:14,style:{color:"#FE5000"}}),e.jsxs("span",{style:{fontSize:13,fontWeight:600,color:s.textPrimary,fontFamily:"'Geist Mono', monospace"},children:["Shared Memory (",t.length,")"]})]}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:t.map((o,r)=>e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:8},children:[e.jsx(st,{fact:o}),e.jsx("span",{style:{fontSize:12,color:s.textDim,flex:1},children:o.value})]},r))})]})}function os(){const t=v(),s=K(f=>f.status),o=K(f=>f.agents),r=K(f=>f.sharedFacts),n=K(f=>f.startedAt),l=K(f=>f.completedAt),d=K(f=>f.error),[a,c]=y.useState(!1),[i,p]=y.useState(()=>Date.now());if(y.useEffect(()=>{if(s!=="running")return;const f=setInterval(()=>p(Date.now()),1e3);return()=>clearInterval(f)},[s]),s==="idle")return null;const x=l&&n?((l-n)/1e3).toFixed(1):n?((i-n)/1e3).toFixed(0):"0",g=e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12,height:"100%"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[s==="running"&&e.jsx(Fe,{size:14,className:"animate-spin",style:{color:"#FE5000"}}),s==="completed"&&e.jsx(Ue,{size:14,style:{color:"#2ecc71"}}),s==="error"&&e.jsx(Ce,{size:14,style:{color:"#dc2626"}}),e.jsx("span",{style:{fontSize:13,fontWeight:600,color:t.textPrimary},children:s==="running"?"Running...":s==="completed"?"Completed":"Error"}),e.jsxs("span",{style:{fontSize:12,color:t.textDim},children:[x,"s"]}),e.jsx("button",{type:"button",onClick:()=>c(!a),style:{marginLeft:"auto",background:"none",border:"none",cursor:"pointer",padding:4,color:t.textDim},title:a?"Minimize":"Maximize results",children:a?e.jsx(He,{size:14}):e.jsx(Ke,{size:14})})]}),d&&e.jsx("div",{style:{fontSize:13,color:"#dc2626",padding:8,borderRadius:6,background:"#dc262610"},children:d}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,flex:1,overflowY:"auto"},children:o.map(f=>e.jsx(ts,{agent:f,expanded:a},f.agentId))}),e.jsx(ss,{facts:r})]});return a?e.jsx("div",{style:{position:"fixed",inset:0,zIndex:100,background:t.bg,padding:24,overflowY:"auto"},children:g}):g}function ns({retrieval:t}){const s=v();if(!t)return null;const o=new Map;for(const x of t.chunks){const g=o.get(x.source)||[];g.push(x),o.set(x.source,g)}const r=x=>({"ground-truth":"#e74c3c",signal:"#f1c40f",evidence:"#3498db",framework:"#2ecc71",guideline:"#FE5000",hypothesis:"#9b59b6"})[x]||s.textDim,n=x=>({"ground-truth":"🔴 Ground Truth",signal:"🟡 Signal",evidence:"🔵 Evidence",framework:"🟢 Framework",guideline:"📏 Guideline",hypothesis:"🟣 Hypothesis"})[x]||x,l=x=>{const g={direct:{background:"#2ecc71",color:"#fff"},"parent-expansion":{background:"#f1c40f",color:"#333"},"sibling-coherence":{background:"#3498db",color:"#fff"},unknown:{background:s.border,color:s.textDim}};return g[x]||g.unknown},d=x=>({direct:"● Direct match","parent-expansion":"↑ Parent expanded","sibling-coherence":"↔ Sibling context",unknown:"? Unknown"})[x]||x,a=x=>({direct:"●","parent-expansion":"↑","sibling-coherence":"↔",unknown:"?"})[x]||"?",c=Array.from(o.keys()),i=t.chunks.length,p=t.chunks.reduce((x,g)=>x+g.tokens,0);return e.jsxs("div",{style:{maxHeight:400,overflowY:"auto",padding:12,fontFamily:"'Geist Mono', monospace",fontSize:12},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:12,paddingBottom:8,borderBottom:`1px solid ${s.border}30`},children:[e.jsx("span",{style:{fontSize:10,color:s.textDim,textTransform:"uppercase",fontWeight:700},children:"Retrieved Context"}),e.jsxs("span",{style:{fontSize:10,color:s.textDim},children:[i," chunks selected → ",p.toLocaleString()," tokens sent to LLM",t.originalTokens&&t.originalTokens>p&&e.jsxs("span",{style:{color:"#2ecc71",marginLeft:4},children:["(compressed from ",t.originalTokens.toLocaleString(),")"]})]}),e.jsxs("span",{style:{fontSize:10,color:s.textDim,marginLeft:"auto"},children:["Budget: ",t.budgetUsed.toLocaleString()," / ",t.budgetTotal.toLocaleString()," tokens"]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:10},children:c.map((x,g)=>{const f=o.get(x)||[],h=f.reduce((N,F)=>N+F.tokens,0),b=f[0]?.knowledgeType||"signal",C=f.reduce((N,F)=>{const $=F.inclusionReason||"unknown";return N[$]=(N[$]||0)+1,N},{});return e.jsxs("div",{style:{width:280,border:`1px solid ${s.border}40`,borderRadius:8,padding:10,background:s.isDark?"#ffffff04":"#00000003"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:8},children:[e.jsx("div",{style:{width:8,height:8,borderRadius:"50%",background:r(b),flexShrink:0}}),e.jsx("div",{style:{fontSize:12,fontWeight:600,color:s.textPrimary,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},children:x.split("/").pop()||x}),e.jsxs("span",{style:{fontSize:10,color:"#FE5000",fontWeight:600,flexShrink:0},children:[h.toLocaleString()," tok"]})]}),e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:6},children:[e.jsx("span",{style:{fontSize:9,color:s.textDim},children:n(b)}),e.jsxs("span",{style:{fontSize:9,color:s.textDim,marginLeft:"auto"},children:[f.length," chunk",f.length>1?"s":""]})]}),e.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:4,marginBottom:8},children:Object.entries(C).map(([N,F])=>e.jsxs("span",{title:d(N),style:{fontSize:9,padding:"2px 5px",borderRadius:3,...l(N)},children:[a(N)," ",F]},N))}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:2},children:[f.sort((N,F)=>F.relevanceScore-N.relevanceScore).slice(0,5).map((N,F)=>e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[e.jsx("div",{style:{width:20,height:3,borderRadius:1,background:"#333",overflow:"hidden",flexShrink:0},children:e.jsx("div",{style:{width:`${N.relevanceScore*100}%`,height:"100%",background:"#2ecc71"}})}),e.jsxs("span",{style:{fontSize:9,width:22,textAlign:"right",color:s.textDim,flexShrink:0},children:[(N.relevanceScore*100).toFixed(0),"%"]}),e.jsx("span",{style:{fontSize:10,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",color:s.textPrimary},children:N.section}),e.jsx("span",{style:{fontSize:8,color:s.textFaint,flexShrink:0},children:N.tokens})]},F)),f.length>5&&e.jsxs("span",{style:{fontSize:9,color:s.textDim,paddingTop:2},children:["+",f.length-5," more"]})]})]},g)})}),e.jsxs("div",{style:{display:"flex",gap:12,marginTop:12,paddingTop:8,borderTop:`1px solid ${s.border}30`,flexWrap:"wrap"},children:[e.jsx("span",{style:{fontSize:9,color:s.textDim,fontWeight:600},children:"HOW CHUNKS ARE SELECTED:"}),[{icon:"●",label:"Direct match (semantic similarity)",color:"#2ecc71"},{icon:"↑",label:"Parent expanded (tree context)",color:"#f1c40f"},{icon:"↔",label:"Sibling coherence (related sections)",color:"#3498db"}].map(x=>e.jsxs("span",{style:{fontSize:9,color:x.color,display:"flex",alignItems:"center",gap:3},children:[e.jsx("span",{style:{fontWeight:700},children:x.icon})," ",x.label]},x.icon))]})]})}function rs(t){if(!t)return"";const s=Object.entries(t).map(([o,r])=>`${o}: ${JSON.stringify(r)}`).join(", ");return s.length>80?s.slice(0,77)+"...":s}function ls({event:t,resultEvent:s,defaultExpanded:o=!1}){const r=v(),[n,l]=y.useState(o),d=!s,a=s?.type==="tool_error",c=s?.type==="tool_result",i=d?"#3498db":a?"#e74c3c":"#2ecc71",p=d?"#3498db30":a?"#e74c3c30":"#2ecc7130";return e.jsxs("div",{style:{border:`1px solid ${p}`,borderRadius:6,overflow:"hidden",background:r.isDark?"#13131a":"#f8f8fc",marginBottom:4},children:[e.jsxs("button",{type:"button",onClick:()=>l(x=>!x),className:"flex items-center gap-2 w-full text-left border-none cursor-pointer",style:{padding:"6px 10px",background:"transparent",minHeight:36},children:[e.jsx(qe,{size:12,style:{color:i,flexShrink:0}}),e.jsx("span",{style:{fontFamily:"'Geist Mono', monospace",fontSize:12,color:r.textPrimary,fontWeight:500},children:t.toolName}),t.serverName&&e.jsx("span",{style:{fontSize:10,padding:"1px 5px",borderRadius:3,background:r.isDark?"#2a2a35":"#e8e8f0",color:r.textDim,fontFamily:"'Geist Mono', monospace"},children:t.serverName}),e.jsxs("span",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:4},children:[d&&e.jsx(Fe,{size:12,style:{color:"#3498db",animation:"spin 1s linear infinite"}}),c&&e.jsx(me,{size:12,style:{color:"#2ecc71"}}),a&&e.jsx(Ye,{size:12,style:{color:"#e74c3c"}}),s?.durationMs!=null&&e.jsxs("span",{style:{fontFamily:"'Geist Mono', monospace",fontSize:10,color:r.textFaint},children:[s.durationMs,"ms"]})]}),e.jsx("style",{children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"})]}),!n&&t.args&&e.jsx("div",{style:{padding:"0 10px 6px",fontFamily:"'Geist Mono', monospace",fontSize:11,color:r.textFaint,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:rs(t.args)}),n&&e.jsxs("div",{style:{borderTop:`1px solid ${r.border}`,padding:"8px 10px",display:"flex",flexDirection:"column",gap:8},children:[t.args&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:r.textDim,fontFamily:"'Geist Sans', sans-serif",marginBottom:3},children:"Arguments"}),e.jsx("pre",{style:{margin:0,fontFamily:"'Geist Mono', monospace",fontSize:11,color:r.textSecondary,background:r.isDark?"#0d0d12":"#ebebf5",borderRadius:4,padding:"6px 8px",overflowX:"auto",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:JSON.stringify(t.args,null,2)})]}),s&&(s.result||s.error)&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:10,color:r.textDim,fontFamily:"'Geist Sans', sans-serif",marginBottom:3},children:s.error?"Error":"Result"}),e.jsx("pre",{style:{margin:0,fontFamily:"'Geist Mono', monospace",fontSize:11,color:a?"#e74c3c":r.textSecondary,background:r.isDark?"#0d0d12":"#ebebf5",borderRadius:4,padding:"6px 8px",overflowX:"auto",overflowY:"auto",maxHeight:300,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:s.error??s.result})]})]})]})}function ot({current:t,max:s,running:o}){const r=v(),n=s>0?Math.min(t/s,1):0;return e.jsxs("div",{className:"flex items-center gap-2",style:{fontFamily:"'Geist Mono', monospace",fontSize:11},children:[e.jsxs("span",{style:{color:r.textDim},children:["Turn ",t,"/",s]}),e.jsx("div",{style:{width:80,height:4,borderRadius:2,background:r.isDark?"#2a2a30":"#e0e0e8",overflow:"hidden"},children:e.jsx("div",{style:{width:`${n*100}%`,height:"100%",borderRadius:2,background:o?"#3498db":"#2ecc71",transition:"width 300ms ease",animation:o?"pulse 1.5s ease-in-out infinite":"none"}})}),e.jsx("style",{children:`
22
+ @keyframes pulse {
23
+ 0%, 100% { opacity: 1; }
24
+ 50% { opacity: 0.5; }
25
+ }
26
+ `})]})}function as(t){const s=[];let o=null;for(const r of t)r.type==="turn_start"?(o={turnNumber:r.turnNumber??s.length+1,events:[]},s.push(o)):o?o.events.push(r):(o={turnNumber:1,events:[r]},s.push(o));return s}function is({events:t,currentTurn:s,maxTurns:o,running:r,thinking:n}){const l=v(),d=y.useRef(null);y.useEffect(()=>{d.current?.scrollIntoView({behavior:"smooth"})},[t.length]);const a=as(t);return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(r||t.length>0)&&e.jsx(ot,{current:s,max:o,running:r}),a.map(c=>{const i=c.events.filter(h=>h.type==="tool_start"),p=c.events.filter(h=>h.type==="tool_result"||h.type==="tool_error"),x=new Map;p.forEach((h,b)=>x.set(b,h));const g=c.events.filter(h=>h.type==="thinking"),f=c.events.filter(h=>h.type==="done"||h.type==="turn_end");return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",style:{marginBottom:6},children:[e.jsx(Ve,{size:10,style:{color:"#FE5000",flexShrink:0}}),e.jsxs("span",{style:{fontFamily:"'Geist Mono', monospace",fontSize:10,color:l.textFaint,textTransform:"uppercase",letterSpacing:"0.05em"},children:["Turn ",c.turnNumber]}),e.jsx("div",{style:{flex:1,height:1,background:l.border}})]}),g.map(h=>e.jsxs("div",{className:"flex items-start gap-2",style:{marginBottom:4},children:[e.jsx(ue,{size:12,style:{color:"#9b59b6",flexShrink:0,marginTop:2}}),e.jsx("span",{style:{fontFamily:"'Geist Sans', sans-serif",fontSize:12,color:l.textDim,fontStyle:"italic"},children:h.result})]},h.id)),i.map((h,b)=>e.jsx(ls,{event:h,resultEvent:x.get(b)},h.id)),f.map(h=>h.result?e.jsxs("div",{className:"flex items-start gap-2",style:{marginTop:4},children:[e.jsx(Ze,{size:12,style:{color:l.textDim,flexShrink:0,marginTop:2}}),e.jsx("span",{style:{fontFamily:"'Geist Sans', sans-serif",fontSize:12,color:l.textSecondary},children:h.result})]},h.id):null)]},c.turnNumber)}),n&&r&&e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(ue,{size:12,style:{color:"#9b59b6",flexShrink:0,marginTop:2}}),e.jsx("span",{style:{fontFamily:"'Geist Sans', sans-serif",fontSize:12,color:l.textDim,fontStyle:"italic"},children:n})]}),e.jsx("div",{ref:d})]})}function cs(){const t=v(),s=P(f=>f.lastPipelineStats),o=B(f=>f.channels),r=J(f=>f.providers),n=J(f=>f.selectedProviderId),d=r.find(f=>f.id===n)?.models?.[0]?.id??"claude-3-5-sonnet-20241022",a=s?.model??d,c=s?.totalContextTokens??o.filter(f=>f.enabled).reduce((f,h)=>f+(h.baseTokens??0),0)+4e3,i=bt(a),p={haiku:"Haiku",sonnet:"Sonnet",opus:"Opus"},x={haiku:"#2ecc71",sonnet:"#3498db",opus:"#9b59b6"};if(s?.costUsd!=null){const f=s.inputTokens?Math.round((s.cachedTokens??0)/s.inputTokens*100):0;return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 text-[11px]",style:{fontFamily:"'Geist Mono', monospace",color:t.textDim},children:[e.jsx("span",{children:"Actual"}),e.jsxs("span",{style:{color:t.textPrimary},children:["$",s.costUsd.toFixed(5)]}),e.jsx("span",{className:"px-1 rounded",style:{background:(x[i]??"#888")+"18",color:x[i]??"#888"},children:p[i]??i}),f>0&&e.jsxs("span",{style:{color:"#2ecc71"},children:[f,"% cached"]})]})}const g=jt(a,c);return e.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 text-[11px]",style:{fontFamily:"'Geist Mono', monospace",color:t.textDim},children:[e.jsx("span",{children:"Est."}),e.jsxs("span",{style:{color:t.textPrimary},children:["$",g.netCost.toFixed(5)]}),e.jsx("span",{className:"px-1 rounded",style:{background:(x[i]??"#888")+"18",color:x[i]??"#888"},children:p[i]??i})]})}function ds(){const t=v(),s=P(p=>p.lastPipelineStats),[o,r]=y.useState(!1);if(!s)return null;const n=s.pipeline,l=p=>p>=1e3?`${(p/1e3).toFixed(1)}K`:`${p}`,d=["#2ecc71","#3498db","#f1c40f","#e67e22","#999"],a=["Full","Detail","Summary","Headlines","Mention"],c=p=>p>.5?"#2ecc71":p>.3?"#f1c40f":"#e74c3c",i=p=>{switch(p){case"factual":return"#3498db";case"analytical":return"#e67e22";case"exploratory":return"#9b59b6";default:return t.textDim}};return e.jsxs("div",{style:{borderTop:`1px solid ${t.border}`},children:[s.retrieval&&e.jsxs("div",{className:"flex items-center gap-3 px-4 py-1.5",style:{fontFamily:"'Geist Mono', monospace",fontSize:11,borderBottom:`1px solid ${t.border}30`},children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{style:{color:t.textDim},children:"Diversity"}),e.jsx("div",{style:{width:40,height:4,borderRadius:2,background:"#333",overflow:"hidden"},children:e.jsx("div",{style:{width:`${s.retrieval.diversityScore*100}%`,height:"100%",background:c(s.retrieval.diversityScore),borderRadius:2}})}),e.jsxs("span",{style:{fontFamily:"'Geist Mono', monospace",color:c(s.retrieval.diversityScore),fontSize:11},children:[(s.retrieval.diversityScore*100).toFixed(0),"%"]})]}),e.jsxs("span",{style:{color:t.textDim},children:[s.retrieval.selectedChunks,"/",s.retrieval.totalChunks," chunks"]}),e.jsxs("span",{style:{color:t.textDim},children:["Budget ",Math.round(s.retrieval.budgetUsed/s.retrieval.budgetTotal*100),"%"]}),e.jsx("span",{style:{fontSize:10,padding:"1px 5px",borderRadius:3,background:i(s.retrieval.queryType)+"15",color:i(s.retrieval.queryType)},children:s.retrieval.queryType}),e.jsxs("span",{style:{fontSize:11,color:t.textFaint,marginLeft:"auto"},children:[s.retrieval.embeddingMs+s.retrieval.retrievalMs,"ms"]}),s.retrieval.collapseWarning&&e.jsx("span",{style:{fontSize:11,color:"#e74c3c"},children:"⚠ Low diversity"})]}),e.jsxs("button",{type:"button",onClick:()=>r(!o),className:"flex items-center gap-3 px-4 py-1.5 text-[13px] w-full border-none cursor-pointer min-h-[44px]",style:{fontFamily:"'Geist Mono', monospace",color:t.textDim,background:"transparent",transition:"background-color 150ms"},onMouseEnter:p=>{p.currentTarget.style.background=t.isDark?"#ffffff08":"#00000005"},onMouseLeave:p=>{p.currentTarget.style.background="transparent"},"aria-label":"Toggle pipeline statistics","aria-expanded":o,children:[e.jsx(oe,{size:9,style:{color:"#FE5000",flexShrink:0}}),e.jsxs("span",{title:"Total context tokens sent to LLM",children:["Context: ",l(s.totalContextTokens)]}),e.jsxs("span",{title:"System prompt tokens (persona + instructions)",children:["System: ",l(s.systemTokens)]}),n&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{title:"How much the knowledge was compressed before sending",style:{color:n.compression.ratio<.8?"#2ecc71":t.textDim},children:["Compressed: ",Math.round((1-n.compression.ratio)*100),"%"]}),e.jsxs("span",{title:"Number of knowledge sources indexed",children:[n.sources.length," source",n.sources.length!==1?"s":""]}),e.jsxs("span",{title:"Pipeline processing time",children:[n.timing.totalMs,"ms"]})]}),e.jsx(O,{size:8,style:{transform:o?"none":"rotate(-90deg)",transition:"transform 150ms"}})]}),o&&e.jsx("div",{style:{maxHeight:280,overflowY:"auto",borderBottom:`1px solid ${t.border}30`},children:s.retrieval?e.jsx(ns,{retrieval:s.retrieval}):s.heatmap.length>0&&e.jsx("div",{className:"px-4 pb-2 flex flex-col gap-2",children:s.heatmap.map(p=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"text-[12px] font-medium",style:{color:t.textPrimary},children:p.name}),e.jsx("span",{className:"text-[12px] px-1.5 py-0.5 rounded",style:{fontFamily:"'Geist Mono', monospace",background:d[p.depth]+"18",color:d[p.depth]},children:a[p.depth]}),e.jsxs("span",{className:"text-[12px]",style:{fontFamily:"'Geist Mono', monospace",color:t.textFaint},children:[l(p.filteredTokens),"/",l(p.totalTokens)]})]}),p.headings.length>0&&e.jsxs("div",{className:"flex flex-col gap-0.5 pl-2",children:[p.headings.slice(0,8).map(x=>{const g=Math.max(...p.headings.map(b=>b.tokens),1),f=Math.max(5,x.tokens/g*100),h=d[Math.min(x.depth,4)];return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"text-[10px] truncate w-20 text-right",style:{fontFamily:"'Geist Mono', monospace",color:t.textFaint},children:x.title}),e.jsx("div",{style:{flex:1,height:3,background:`${h}18`,borderRadius:1,overflow:"hidden"},children:e.jsx("div",{style:{width:`${f}%`,height:"100%",background:h,borderRadius:1}})}),e.jsx("span",{className:"text-[8px] w-6 text-right",style:{fontFamily:"'Geist Mono', monospace",color:t.textFaint},children:l(x.tokens)})]},x.nodeId)}),p.headings.length>8&&e.jsxs("span",{className:"text-[12px]",style:{fontFamily:"'Geist Mono', monospace",color:t.textFaint},children:["+",p.headings.length-8," more"]})]})]},p.path))})})]})}function ps(){const t=v(),[s,o]=y.useState(null);return y.useEffect(()=>{const r=n=>{const l=n.detail;o(l.action);const d=setTimeout(()=>o(null),4e3);return()=>clearTimeout(d)};return window.addEventListener("instinct-learned",r),()=>window.removeEventListener("instinct-learned",r)},[]),s?e.jsxs("div",{className:"fixed bottom-6 right-6 z-50 px-4 py-3 rounded-xl shadow-lg text-[13px] max-w-xs",style:{background:t.isDark?"#1c1c20":"#fff",border:"1px solid #FE500040",color:t.textPrimary,fontFamily:"'Geist Sans', sans-serif"},children:[e.jsx("span",{style:{marginRight:6},children:"🧠"}),e.jsx("span",{style:{color:t.textDim,marginRight:4},children:"Lesson captured:"}),e.jsx("span",{style:{fontStyle:"italic",color:t.textSecondary},children:s.length>80?s.slice(0,80)+"...":s})]}):null}function xs(){const t=v(),[s,o]=y.useState(null);return y.useEffect(()=>{const r=n=>{const l=n.detail;o(l);const d=setTimeout(()=>o(null),5e3);return()=>clearTimeout(d)};return window.addEventListener("smart-retrieval-refined",r),()=>window.removeEventListener("smart-retrieval-refined",r)},[]),s?e.jsxs("div",{className:"fixed bottom-16 right-6 z-50 px-4 py-3 rounded-xl shadow-lg text-[13px] max-w-sm",style:{background:t.isDark?"#1c1c20":"#fff",border:"1px solid #FE500040",color:t.textPrimary,fontFamily:"'Geist Sans', sans-serif"},children:[e.jsx("span",{style:{marginRight:6},children:"🔄"}),e.jsx("span",{style:{color:t.textDim,marginRight:4},children:"Smart Retrieval found"}),e.jsx("span",{style:{fontStyle:"italic",color:t.textSecondary},children:s.found.length>40?s.found.slice(0,40)+"...":s.found}),e.jsx("span",{style:{color:t.textDim},children:" — replaced "}),e.jsx("span",{style:{color:t.textSecondary},children:s.replaced}),e.jsx("span",{style:{color:t.textDim},children:" (relevance: "}),e.jsx("span",{style:{fontFamily:"'Geist Mono', monospace",color:"#10b981"},children:s.relevance}),e.jsx("span",{style:{color:t.textDim},children:")"})]}):null}function us({messageContent:t,agentId:s,streaming:o}){const r=v(),n=B(u=>u.selectedModel),l=J(u=>u.selectedProviderId),[d,a]=y.useState(!1),[c,i]=y.useState(""),[p,x]=y.useState(!1),[g,f]=y.useState(null),[h,b]=y.useState(!1);if(o||!t.trim())return null;const C=async()=>{if(c.trim()){x(!0);try{const u=n.indexOf("::"),w=u>0?n.slice(0,u):l,M=u>0?n.slice(u+2):n,j=await fetch("/api/lessons/extract",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userMessage:c,previousAssistant:t,providerId:w,model:M,agentId:s})});if(j.ok){const k=await j.json();k.lesson&&f({rule:k.lesson.rule,domain:k.lesson.domain,confidence:k.lesson.confidence,id:k.lesson.id})}}finally{x(!1)}}},N=async()=>{if(g){try{await fetch(`/api/lessons/${g.id}/confidence`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({confidence:Math.min(1,g.confidence+.2)})})}catch{}b(!0),setTimeout(()=>{a(!1),f(null),b(!1),i("")},1500)}},F=g?Math.round(g.confidence*100):0,$=F>=70?"#2ecc71":F>=50?"#f1c40f":"#e74c3c";return e.jsx("div",{className:"mt-1",style:{fontFamily:"'Geist Mono', monospace"},children:d?e.jsxs("div",{className:"mt-2 rounded-lg p-3 flex flex-col gap-2",style:{background:r.isDark?"#ffffff06":"#00000005",border:`1px solid ${r.border}`},children:[e.jsx("div",{className:"text-[11px]",style:{color:r.textDim},children:"What should the agent have done differently?"}),e.jsx("textarea",{value:c,onChange:u=>i(u.target.value),placeholder:"Describe the correction...",rows:2,className:"w-full px-2 py-1.5 rounded text-[12px] outline-none resize-none",style:{background:r.inputBg,border:`1px solid ${r.border}`,color:r.textPrimary,fontFamily:"'Geist Sans', sans-serif"}}),g?h?e.jsx("div",{className:"text-[11px]",style:{color:"#2ecc71"},children:"✓ Lesson saved"}):e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{className:"rounded p-2 text-[12px]",style:{background:r.isDark?"#ffffff08":"#00000006",border:`1px solid ${r.border}`},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[e.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px]",style:{background:"#FE500015",color:"#FE5000"},children:g.domain}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{style:{width:48,height:4,borderRadius:2,background:"#333"},children:e.jsx("div",{style:{width:`${F}%`,height:"100%",borderRadius:2,background:$}})}),e.jsxs("span",{className:"text-[10px]",style:{color:$},children:[F,"%"]})]})]}),e.jsx("div",{style:{color:r.textSecondary},children:g.rule})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:N,className:"text-[11px] px-3 py-1.5 rounded cursor-pointer border-none",style:{background:"#2ecc71",color:"#fff"},children:"Save"}),e.jsx("button",{type:"button",onClick:()=>f(null),className:"text-[11px] px-2 py-1 rounded cursor-pointer border-none",style:{background:"transparent",color:r.textFaint},children:"Edit"}),e.jsx("button",{type:"button",onClick:()=>{a(!1),f(null),i("")},className:"text-[11px] px-2 py-1 rounded cursor-pointer border-none",style:{background:"transparent",color:r.textFaint},children:"Discard"})]})]}):e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{type:"button",onClick:C,disabled:p||!c.trim(),className:"text-[11px] px-3 py-1.5 rounded cursor-pointer border-none",style:{background:"#FE5000",color:"#fff",opacity:p||!c.trim()?.5:1},children:p?"Extracting...":"Extract lesson"}),e.jsx("button",{type:"button",onClick:()=>{a(!1),i("")},className:"text-[11px] px-2 py-1 rounded cursor-pointer border-none",style:{background:"transparent",color:r.textFaint},children:"Cancel"})]})]}):e.jsx("div",{className:"flex gap-2 items-center px-1 py-0.5",children:e.jsx("button",{type:"button",onClick:()=>a(!0),className:"text-[11px] px-2 py-1 rounded cursor-pointer border-none",style:{background:r.isDark?"#ffffff08":"#00000005",color:r.textFaint},title:"Correct this response",children:"✏️ Correct"})})})}function ms({agentId:t}){const s=v(),[o,r]=y.useState(!1),[n,l]=y.useState([]);y.useEffect(()=>{if(!t)return;const i=()=>{fetch(`/api/lessons/${encodeURIComponent(t)}/active`).then(x=>x.ok?x.json():{instincts:[]}).then(x=>l(x.instincts)).catch(()=>{})};i();const p=setInterval(i,1e4);return()=>clearInterval(p)},[t]);const d=n.length,a=d>0?Math.round(n.reduce((i,p)=>i+p.confidence,0)/d*100):0,c={accuracy:"#3498db","output-style":"#9b59b6",safety:"#e74c3c",workflow:"#2ecc71",general:"#95a5a6"};return d===0?null:e.jsxs("div",{className:"absolute bottom-20 right-4 z-40",style:{fontFamily:"'Geist Mono', monospace"},children:[o&&e.jsxs("div",{className:"mb-2 rounded-xl p-3 max-h-64 overflow-y-auto text-[12px]",style:{background:s.isDark?"#1c1c20":"#fff",border:`1px solid ${s.border}`,width:280,boxShadow:"0 4px 20px rgba(0,0,0,0.2)"},children:[e.jsx("div",{className:"text-[11px] font-semibold mb-2",style:{color:s.textPrimary},children:"Active Instincts"}),n.map(i=>{const p=Math.round(i.confidence*100),x=c[i.domain]??"#95a5a6";return e.jsxs("div",{className:"mb-2 pb-2",style:{borderBottom:`1px solid ${s.border}30`},children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-0.5",children:[e.jsx("span",{className:"px-1 py-0.5 rounded text-[9px]",style:{background:x+"18",color:x},children:i.domain}),e.jsx("div",{style:{flex:1,height:3,background:"#33333320",borderRadius:2},children:e.jsx("div",{style:{width:`${p}%`,height:"100%",borderRadius:2,background:x}})}),e.jsxs("span",{className:"text-[10px]",style:{color:x},children:[p,"%"]})]}),e.jsx("div",{style:{color:s.textSecondary,lineHeight:1.4},children:i.action.length>80?i.action.slice(0,80)+"...":i.action})]},i.id)})]}),e.jsxs("button",{type:"button",onClick:()=>r(!o),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full text-[11px] cursor-pointer border-none shadow-md",style:{background:s.isDark?"#1c1c20":"#fff",color:s.textSecondary,border:`1px solid ${s.border}`},title:"Active instincts",children:["🧠 ",e.jsxs("span",{children:[d," lesson",d!==1?"s":""]}),d>0&&e.jsxs("span",{style:{color:"#FE5000"},children:["· avg ",a,"%"]})]})]})}function fs(){const t=v(),s=We(m=>m.agentId)??"",o=P(m=>m.messages),r=P(m=>m.inputText),n=P(m=>m.setInputText),l=P(m=>m.streaming),d=P(m=>m.addMessage),a=P(m=>m.setStreaming),c=P(m=>m.updateLastAssistant),i=P(m=>m.setLastPipelineStats),p=B(m=>m.channels),x=B(m=>m.connectors),g=B(m=>m.mcpServers),f=B(m=>m.agentMeta),h=B(m=>m.navigationMode),b=ae(m=>m.events),C=ae(m=>m.currentTurn),N=ae(m=>m.maxTurns),F=ae(m=>m.running),$=(()=>{const m=["streaming"];return x.length>0&&m.push("toolCalling"),g.length>0&&m.push("mcpBridge"),m})(),u=Se(),w=Zt(u.providerId||"custom"),M=y.useRef(null);y.useEffect(()=>{const m=window.matchMedia("(prefers-reduced-motion: reduce)").matches;M.current?.scrollIntoView({behavior:m?"auto":"smooth"})},[o]);const j=y.useCallback(async()=>{if(!r.trim()||l)return;const m=r.trim();n(""),d({role:"user",content:m}),d({role:"assistant",content:""}),a(!0);let _="";try{const{providerId:S,model:R,error:z}=Se();if(z){c(z),a(!1);return}await dt({userMessage:m,channels:p,connectors:x,history:o.filter(T=>!(T.role==="assistant"&&T.content.trim()==="")).map(T=>({role:T.role,content:T.content})),agentMeta:{name:f.name,description:f.description,avatar:f.avatar,tags:f.tags},providerId:S,model:R,navigationMode:h,tokenBudget:B.getState().tokenBudget??void 0,onChunk:T=>{_+=T,c(_)},onDone:T=>{i(T);const U=P.getState().messages,L=[...U].reverse().find(G=>G.role==="assistant");L&&P.setState({messages:U.map(G=>G.id===L.id?{...G,pipelineStats:T,traceId:T.traceId}:G)})},onError:T=>{c(_+`
27
+
28
+ _Error: ${T.message}_`)}})}catch(S){c(_+`
29
+
30
+ _Error: ${S instanceof Error?S.message:"Unknown error"}_`)}finally{a(!1)}},[r,l,o,p,x,f,h,n,d,a,c,i]),k=m=>{(m.metaKey||m.ctrlKey)&&m.key==="Enter"&&(m.preventDefault(),j())};return e.jsxs("div",{className:"relative flex flex-col flex-1 min-h-0",children:[e.jsx(ms,{agentId:s}),e.jsxs("div",{className:"flex-1 overflow-y-auto px-4 py-3 flex flex-col gap-3","aria-live":"polite","aria-relevant":"additions",children:[o.length===0&&e.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:e.jsxs("div",{className:"max-w-md text-center space-y-4",children:[e.jsx("div",{className:"text-[16px] font-semibold",style:{color:t.textPrimary,fontFamily:"'Geist Mono', monospace"},children:"Ready to test your agent"}),e.jsx("div",{className:"text-[13px] leading-relaxed",style:{color:t.textDim},children:"Start a conversation to see how your agent responds with the current knowledge and configuration."}),e.jsxs("div",{className:"flex flex-wrap gap-2 justify-center mt-6",children:[e.jsx("button",{type:"button",onClick:()=>n("What is this codebase about?"),title:"Ask about codebase",className:"px-3 py-2 rounded-lg border cursor-pointer text-[12px] hover:border-[#FE5000] transition-colors",style:{background:t.surface,border:`1px solid ${t.border}`,color:t.textSecondary,fontFamily:"'Geist Mono', monospace"},children:"What is this codebase about?"}),e.jsx("button",{type:"button",onClick:()=>n("Explain the main architecture"),title:"Ask about architecture",className:"px-3 py-2 rounded-lg border cursor-pointer text-[12px] hover:border-[#FE5000] transition-colors",style:{background:t.surface,border:`1px solid ${t.border}`,color:t.textSecondary,fontFamily:"'Geist Mono', monospace"},children:"Explain the main architecture"}),e.jsx("button",{type:"button",onClick:()=>n("What are the key features?"),title:"Ask about features",className:"px-3 py-2 rounded-lg border cursor-pointer text-[12px] hover:border-[#FE5000] transition-colors",style:{background:t.surface,border:`1px solid ${t.border}`,color:t.textSecondary,fontFamily:"'Geist Mono', monospace"},children:"What are the key features?"})]})]})}),o.map((m,_)=>e.jsxs("div",{className:"max-w-[85%] px-3.5 py-2.5 rounded-xl text-[14px] leading-relaxed",style:{alignSelf:m.role==="user"?"flex-end":"flex-start",background:m.role==="user"?"#FE500015":t.isDark?"#1c1c20":"#f0f0f5",border:`1px solid ${m.role==="user"?"#FE500020":t.border}`,color:m.role==="user"?t.textPrimary:t.textSecondary,borderBottomRightRadius:m.role==="user"?4:12,borderBottomLeftRadius:m.role==="assistant"?4:12},children:[m.role==="assistant"&&l&&b.length>0&&_===o.length-1&&e.jsxs("div",{style:{marginBottom:8},children:[e.jsx(ot,{current:C,max:N,running:F}),e.jsx(is,{events:b,currentTurn:C,maxTurns:N,running:F})]}),m.role==="assistant"?e.jsx(It,{remarkPlugins:[Bt],components:{pre:({children:S})=>e.jsx("pre",{style:{background:t.isDark?"#0d0d10":"#e8e8f0",borderRadius:6,padding:"8px 12px",overflowX:"auto",fontSize:13,margin:"8px 0"},children:S}),code:({children:S,className:R})=>!R?e.jsx("code",{style:{background:t.isDark?"#0d0d10":"#e8e8f0",borderRadius:3,padding:"1px 4px",fontSize:13},children:S}):e.jsx("code",{style:{fontFamily:"'Geist Mono', monospace"},children:S}),a:({href:S,children:R})=>e.jsx("a",{href:S,target:"_blank",rel:"noopener noreferrer",style:{color:"#FE5000",textDecoration:"underline"},children:R}),h1:({children:S})=>e.jsx("h1",{style:{fontSize:16,fontWeight:600,margin:"8px 0 4px"},children:S}),h2:({children:S})=>e.jsx("h2",{style:{fontSize:15,fontWeight:600,margin:"8px 0 4px"},children:S}),h3:({children:S})=>e.jsx("h3",{style:{fontSize:14,fontWeight:600,margin:"6px 0 2px"},children:S}),ul:({children:S})=>e.jsx("ul",{style:{paddingLeft:20,margin:"4px 0"},children:S}),ol:({children:S})=>e.jsx("ol",{style:{paddingLeft:20,margin:"4px 0"},children:S}),li:({children:S})=>e.jsx("li",{style:{marginBottom:2},children:S}),blockquote:({children:S})=>e.jsx("blockquote",{style:{borderLeft:"3px solid #FE5000",paddingLeft:12,margin:"8px 0",color:t.textDim},children:S}),table:({children:S})=>e.jsx("table",{style:{borderCollapse:"collapse",width:"100%",margin:"8px 0",fontSize:13},children:S}),th:({children:S})=>e.jsx("th",{style:{border:`1px solid ${t.border}`,padding:"4px 8px",textAlign:"left",fontWeight:600},children:S}),td:({children:S})=>e.jsx("td",{style:{border:`1px solid ${t.border}`,padding:"4px 8px"},children:S})},children:m.content||(l?"...":"")}):m.content||"",m.role==="assistant"&&m.pipelineStats&&e.jsx(Yt,{stats:m.pipelineStats,traceId:m.traceId}),m.role==="assistant"&&m.content&&e.jsx(us,{messageContent:m.content,agentId:s,streaming:l})]},m.id)),e.jsx("div",{ref:M})]}),$.length>0&&e.jsx("div",{className:"px-4 py-1.5",children:e.jsx(Xt,{matrix:w,requiredCapabilities:$})}),e.jsx(ds,{}),e.jsx(cs,{}),e.jsxs("div",{className:"px-4 py-3 flex gap-2",style:{borderTop:`1px solid ${t.border}`},children:[e.jsx("input",{type:"text",value:r,onChange:m=>n(m.target.value),onKeyDown:k,placeholder:"Test your agent...","aria-label":"Test message",className:"flex-1 px-3.5 py-2.5 rounded-lg outline-none text-[14px]",style:{background:t.inputBg,border:`1px solid ${t.border}`,color:t.textPrimary,fontFamily:"'Geist Sans', sans-serif"}}),e.jsx("button",{type:"button","aria-label":"Send message",title:"Send message",onClick:j,disabled:l||!r.trim(),className:"px-4 rounded-lg cursor-pointer border-none text-[12px] font-semibold tracking-wider uppercase min-h-[44px] min-w-[44px]",style:{background:"#FE5000",color:"#fff",fontFamily:"'Geist Mono', monospace",opacity:l||!r.trim()?.5:1},children:e.jsx(St,{size:12})})]})]})}function hs(){const t=v(),[s,o]=y.useState([{id:"agent-1",name:"Agent 1",rolePrompt:"",repoUrl:"",source:"blank"},{id:"agent-2",name:"Agent 2",rolePrompt:"",repoUrl:"",source:"blank"}]),[r,n]=y.useState(""),[l,d]=y.useState([]),[a,c]=y.useState(null),i=y.useRef(null),p=K(j=>j.status),x=K(j=>j.reset),g=p==="running";y.useEffect(()=>{fetch(`${ze}/agents`).then(j=>j.ok?j.json():{data:[]}).then(j=>{const k=j.data??j??[];d(k.map(m=>({id:m.id,name:m.agentMeta?.name||m.id,description:m.agentMeta?.description||""})))}).catch(()=>{})},[]);const f=()=>{const j=s.length+1;o([...s,{id:`agent-${Date.now()}`,name:`Agent ${j}`,rolePrompt:"",repoUrl:"",source:"blank"}])},h=async(j,k)=>{try{const m=await fetch(`${ze}/agents/${encodeURIComponent(k)}`);if(!m.ok)return;const _=await m.json(),S=_.data??_,R=S.agentMeta??{},z=[],T=S.instructionState??{};R.name&&z.push(`You are ${R.name}. ${R.description||""}`),T.persona&&z.push(`Persona: ${T.persona}`),T.objectives?.primary&&z.push(`Primary Objective: ${T.objectives.primary}`),T.constraints?.customConstraints&&z.push(`Constraints: ${T.constraints.customConstraints}`);const U=z.join(`
31
+
32
+ `);o(L=>L.map(G=>G.id===j?{...G,name:R.name||k,savedSystemPrompt:U,source:k}:G))}catch{}c(null)},b=j=>{s.length<=1||o(s.filter(k=>k.id!==j))},C=(j,k)=>{o(s.map(m=>m.id===j?{...m,...k}:m))},[N,F]=y.useState(null),[$,u]=y.useState(null),w=y.useCallback(async()=>{if(!r.trim()||g)return;F(null),u(null);const{providerId:j,model:k,error:m}=Se();if(m){F(m),console.error("[TeamRunner] Provider error:",m);return}const R=J.getState().providers.find(z=>z.id===j)?.authMethod==="claude-agent-sdk";try{const z=Y.getState(),T=We.getState(),U=P.getState(),L=T.currentVersion||"0.0.0",G=U.conversationId||`conv-${Date.now()}`,ne=z.startTrace(G,L),ee=E=>{z.addEvent(ne,E)},lt=Date.now();let re=be();ee({kind:"retrieval",sourceName:"System Frame",query:"identity + constraints + workflow",resultCount:1,durationMs:Date.now()-lt});const Me=B.getState(),le=Me.channels,te=le.filter(E=>E.enabled);let Z="",Te="",he=null;if(te.length>0){u("Preparing knowledge...");const E=Date.now(),A=await pt(te,ne);Te=A.frameworkBlock,ee({kind:"retrieval",sourceName:"Source Router",query:`${te.length} channels`,resultCount:A.regularChannels?.length??0,durationMs:Date.now()-E});const H=Date.now(),q=await xt(le,A.regularChannels,A.residualKnowledgeBlock,{userMessage:r,navigationMode:"manual",providerId:j,model:k},ne);Z=q.knowledgeBlock,he=q.provenance,ee({kind:"retrieval",sourceName:"Knowledge Pipeline",query:r.substring(0,80),resultCount:te.length,durationMs:Date.now()-H})}const Ee=Me.connectors.filter(E=>E.enabled&&E.direction!=="write");if(Ee.length>0){const A=`<connectors>
33
+ Available data connectors (use via MCP tools):
34
+ ${Ee.map(H=>{const q=H.hint?` (scope: ${H.hint})`:"";return`- ${H.name} [${H.service}] — ${H.direction}${q}`}).join(`
35
+ `)}
36
+ </connectors>`;Z=Z?`${Z}
37
+
38
+ ${A}`:A}const at=ut.getState();let ye="";if(at.longTerm.enabled){u("Recalling memory...");const E=Date.now(),A=await mt({userMessage:r,agentId:"team",traceId:ne});A.contextBlock&&(ye=A.contextBlock),ee({kind:"retrieval",sourceName:"Memory Recall",query:r.substring(0,80),durationMs:Date.now()-E})}if(he&&(re=be(he)),te.length>0||Z||ye){const E=ft(le,ht.getState().getIndex),A=le.some(q=>q.enabled&&q.repoMeta);re=yt({frame:re,orientationBlock:E,hasRepos:A,knowledgeFormatGuide:gt(),frameworkBlock:Te,memoryBlock:ye,knowledgeBlock:Z})}ee({kind:"llm_call",model:k,sourceName:"LLM Request"}),u("Running team..."),F(null);const it={teamId:`team-${Date.now()}`,systemPrompt:re,task:r.trim(),providerId:j,model:k,isAgentSdk:R,agents:s.map(E=>({agentId:E.id,name:E.name,systemPrompt:E.savedSystemPrompt||void 0,rolePrompt:E.rolePrompt||void 0,repoUrl:E.repoUrl||void 0}))};i.current=$e(it),u(null)}catch(z){console.error("[TeamRunner] Knowledge pipeline error:",z),u(null),F(`Knowledge pipeline error: ${z instanceof Error?z.message:"Unknown error"}`);const T=be(),U={teamId:`team-${Date.now()}`,systemPrompt:T,task:r.trim(),providerId:j,model:k,isAgentSdk:R,agents:s.map(L=>({agentId:L.id,name:L.name,systemPrompt:L.savedSystemPrompt||void 0,rolePrompt:L.rolePrompt||void 0,repoUrl:L.repoUrl||void 0}))};i.current=$e(U),u(null)}},[r,s,g]),M=()=>{i.current?.abort(),i.current=null};return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"px-4 py-3 flex flex-col gap-2 overflow-y-auto",style:{maxHeight:"45%"},children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("span",{className:"text-[12px] font-bold tracking-[0.08em] uppercase",style:{fontFamily:"'Geist Mono', monospace",color:t.textDim},children:["Team Agents (",s.length,")"]}),e.jsxs("button",{type:"button",onClick:f,disabled:s.length>=5,className:"flex items-center gap-1 text-[12px] px-2 py-1 rounded cursor-pointer border-none",style:{background:"#FE500015",color:"#FE5000",fontFamily:"'Geist Mono', monospace",opacity:s.length>=5?.4:1},children:[e.jsx(Nt,{size:10})," Add"]})]}),s.map(j=>e.jsxs("div",{style:{padding:10,borderRadius:8,border:`1px solid ${j.source!=="blank"?"#FE500030":t.border}`,background:t.surface},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(wt,{size:12,style:{color:j.source!=="blank"?"#FE5000":t.textDim}}),e.jsx("input",{type:"text",value:j.name,onChange:k=>C(j.id,{name:k.target.value}),className:"flex-1 text-[13px] font-semibold px-1.5 py-0.5 rounded outline-none border-none",style:{background:"transparent",color:t.textPrimary,fontFamily:"'Geist Mono', monospace"}}),e.jsx("button",{type:"button",onClick:()=>c(a===j.id?null:j.id),className:"text-[11px] px-2 py-0.5 rounded cursor-pointer border-none",style:{background:"#FE500010",color:"#FE5000",fontFamily:"'Geist Mono', monospace"},children:j.source!=="blank"?"↻ Swap":"↗ Load"}),s.length>1&&e.jsx("button",{type:"button",onClick:()=>b(j.id),className:"border-none cursor-pointer p-0.5 rounded",style:{background:"transparent",color:t.textDim},children:e.jsx(Ye,{size:12})})]}),a===j.id&&l.length>0&&e.jsxs("div",{className:"mb-2 flex flex-col gap-1 p-2 rounded",style:{background:t.inputBg,border:`1px solid ${t.border}`},children:[e.jsx("span",{className:"text-[11px] uppercase font-bold tracking-[0.08em] mb-1",style:{color:t.textDim,fontFamily:"'Geist Mono', monospace"},children:"Load from library"}),l.map(k=>e.jsxs("button",{type:"button",onClick:()=>h(j.id,k.id),className:"text-left text-[12px] px-2 py-1.5 rounded cursor-pointer border-none w-full",style:{background:"transparent",color:t.textPrimary},onMouseEnter:m=>{m.currentTarget.style.background=t.surfaceHover},onMouseLeave:m=>{m.currentTarget.style.background="transparent"},children:[e.jsx("span",{style:{fontWeight:600},children:k.name}),k.description&&e.jsxs("span",{style:{color:t.textDim,marginLeft:6},children:["— ",k.description.slice(0,40)]})]},k.id)),l.length===0&&e.jsx("span",{className:"text-[12px]",style:{color:t.textFaint},children:"No saved agents. Save one from the Agent Builder first."})]}),j.source!=="blank"&&e.jsx("div",{className:"mb-1.5",children:e.jsxs("span",{className:"text-[11px] px-1.5 py-0.5 rounded",style:{background:"#FE500015",color:"#FE5000",fontFamily:"'Geist Mono', monospace"},children:["↗ ",j.source]})}),e.jsx("input",{type:"text",value:j.rolePrompt,onChange:k=>C(j.id,{rolePrompt:k.target.value}),placeholder:"Role override (optional — appended to agent instructions)",className:"w-full text-[12px] px-2 py-1.5 rounded outline-none mb-1.5",style:{background:t.inputBg,border:`1px solid ${t.borderSubtle}`,color:t.textSecondary}}),e.jsx("input",{type:"text",value:j.repoUrl,onChange:k=>C(j.id,{repoUrl:k.target.value}),placeholder:"Repository URL (optional — e.g., https://github.com/user/repo)",className:"w-full text-[12px] px-2 py-1.5 rounded outline-none",style:{background:t.inputBg,border:`1px solid ${t.borderSubtle}`,color:t.textSecondary}})]},j.id))]}),e.jsxs("div",{className:"px-4 py-2",style:{borderTop:`1px solid ${t.border}`},children:[e.jsx("textarea",{value:r,onChange:j=>n(j.target.value),placeholder:"Describe the task for the team...",rows:3,className:"w-full text-[13px] px-3 py-2.5 rounded-lg outline-none resize-none",style:{background:t.inputBg,border:`1px solid ${t.border}`,color:t.textPrimary,lineHeight:1.5}}),$&&e.jsx("div",{className:"text-[12px] px-3 py-2 rounded mb-2",style:{background:"#10b98115",color:"#10b981",border:"1px solid #10b98130"},children:$}),N&&e.jsx("div",{className:"text-[12px] px-3 py-2 rounded mb-2",style:{background:"#dc262615",color:"#dc2626",border:"1px solid #dc262630"},children:N}),e.jsxs("div",{className:"flex gap-2 mt-2",children:[g?e.jsxs("button",{type:"button",onClick:M,className:"flex items-center gap-1.5 px-4 py-2 rounded-lg cursor-pointer border-none text-[12px] font-bold tracking-[0.08em] uppercase min-h-[44px]",style:{background:"#dc2626",color:"#fff",fontFamily:"'Geist Mono', monospace"},children:[e.jsx(Ct,{size:12})," Stop"]}):e.jsxs("button",{type:"button",onClick:w,disabled:!r.trim(),className:"flex items-center gap-1.5 px-4 py-2 rounded-lg cursor-pointer border-none text-[12px] font-bold tracking-[0.08em] uppercase min-h-[44px]",style:{background:"#FE5000",color:"#fff",fontFamily:"'Geist Mono', monospace",opacity:r.trim()?1:.5},children:[e.jsx(Ve,{size:12})," Run Team"]}),p!=="idle"&&!g&&e.jsx("button",{type:"button",onClick:x,className:"text-[12px] px-3 py-2 rounded-lg cursor-pointer border-none",style:{background:t.border,color:t.textDim},children:"Clear"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3",style:{borderTop:`1px solid ${t.border}`},children:e.jsx(os,{})})]})}function ys(){const t=v(),[s,o]=y.useState(null),[r,n]=y.useState(!1),[l,d]=y.useState(null),[a,c]=y.useState(!1),i=y.useRef(null),p=y.useCallback(()=>{const u=B.getState();return{channels:u.channels,selectedModel:u.selectedModel,outputFormat:u.outputFormat,outputFormats:u.outputFormats,prompt:u.prompt,tokenBudget:u.tokenBudget,mcpServers:u.mcpServers,skills:u.skills,agentMeta:u.agentMeta,agentConfig:u.agentConfig,connectors:u.connectors,instructionState:u.instructionState,workflowSteps:u.workflowSteps}},[]),x=y.useCallback(async()=>{try{const{downloadAgentDirectory:u}=await xe(async()=>{const{downloadAgentDirectory:w}=await Promise.resolve().then(()=>qt);return{downloadAgentDirectory:w}},void 0);await u(p()),o("dir"),setTimeout(()=>o(null),2e3)}catch(u){console.error("Directory export failed:",u)}},[p]),g=y.useCallback(async u=>{try{const w=p();let M,j;u==="md"?(M=ge("claude",w),j=".md"):u==="yaml"?(M=ge("openclaw",w),j=".yaml"):(M=ge("generic",w),j=".json");const k=(w.agentMeta.name||"modular-agent").toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"");ct(M,k,j),await navigator.clipboard.writeText(M),o(u),setTimeout(()=>o(null),2e3)}catch{}},[p]),f=y.useCallback(async u=>{if(!u.name.endsWith(".zip")){d("Please select a ZIP file containing an agent directory");return}n(!0),d(null);try{await tt(u),o("import"),setTimeout(()=>o(null),2e3)}catch(w){const M=w instanceof Error?w.message:"Unknown import error";d(M),setTimeout(()=>d(null),5e3)}finally{n(!1)}},[]),h=y.useCallback(()=>{i.current?.click()},[]),b=y.useCallback(u=>{const w=u.target.files?.[0];w&&f(w),u.target&&(u.target.value="")},[f]),C=y.useCallback(u=>{u.preventDefault(),u.stopPropagation(),c(!0)},[]),N=y.useCallback(u=>{u.preventDefault(),u.stopPropagation(),c(!1)},[]),F=y.useCallback(u=>{u.preventDefault(),u.stopPropagation(),c(!1);const M=Array.from(u.dataTransfer.files).find(j=>j.name.endsWith(".zip"));if(!M){d("Please drop a ZIP file containing an agent directory"),setTimeout(()=>d(null),5e3);return}f(M)},[f]),$=[{id:"dir",icon:Tt,label:"Agent Directory",fmt:".zip",primary:!0},{id:"md",icon:we,label:"Claude Code / .claude",fmt:".md",primary:!1},{id:"yaml",icon:Et,label:"OpenClaw Agent",fmt:".yaml",primary:!1},{id:"json",icon:Dt,label:"Vibe Kanban / BloopAI",fmt:".json",primary:!1}];return e.jsxs("div",{className:"px-4 py-3",style:{borderTop:`1px solid ${t.border}`},onDragOver:C,onDragLeave:N,onDrop:F,children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("div",{className:"text-[12px] font-bold tracking-[0.08em] uppercase mb-2.5",style:{fontFamily:"'Geist Mono', monospace",color:t.textDim},children:"Import from"}),e.jsxs("button",{type:"button","aria-label":"Import agent from ZIP",onClick:h,disabled:r,className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg cursor-pointer w-full text-left min-h-[44px] motion-reduce:transition-none",style:{background:a?"#FE500020":"#FE500010",border:`1px solid ${a?"#FE500060":"#FE500030"}`,transition:"all 150ms",opacity:r?.6:1},onMouseEnter:u=>{r||(u.currentTarget.style.borderColor="#FE500040")},onMouseLeave:u=>{r||(u.currentTarget.style.borderColor="#FE500030")},onFocus:u=>{r||(u.currentTarget.style.borderColor="#FE500040")},onBlur:u=>{r||(u.currentTarget.style.borderColor="#FE500030")},children:[e.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center",style:{background:t.surfaceElevated},children:s==="import"?e.jsx(me,{size:12,style:{color:"#00ff88"}}):r?e.jsx("div",{className:"w-3 h-3 border border-t-0 border-l-0",style:{borderColor:"#FE5000",borderRadius:"50%",animation:"spin 1s linear infinite"}}):e.jsx(Ft,{size:12,style:{color:t.textDim}})}),e.jsx("span",{className:"flex-1 text-[13px]",style:{color:t.textPrimary},children:a?"Drop ZIP file here":r?"Importing...":"Import Agent"}),e.jsx("span",{className:"text-[13px]",style:{fontFamily:"'Geist Mono', monospace",color:t.textDim},children:".zip"})]}),l&&e.jsxs("div",{className:"mt-2 p-2 rounded-lg flex items-start gap-2",style:{background:"#dc262615",border:"1px solid #dc262630"},children:[e.jsx(Mt,{size:14,style:{color:"#dc2626",flexShrink:0,marginTop:1}}),e.jsx("span",{className:"text-[12px] leading-relaxed",style:{color:"#dc2626"},children:l})]}),e.jsx("input",{ref:i,type:"file",accept:".zip",style:{display:"none"},onChange:b,"aria-label":"Import agent ZIP file"})]}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[12px] font-bold tracking-[0.08em] uppercase mb-2.5",style:{fontFamily:"'Geist Mono', monospace",color:t.textDim},children:"Export to"}),e.jsx("div",{className:"flex flex-col gap-1.5",children:$.map(u=>{const w=u.icon,M=u.id==="dir"?x:()=>g(u.id);return e.jsxs("button",{type:"button","aria-label":`Export as ${u.fmt}`,onClick:M,className:"flex items-center gap-2.5 px-3 py-2.5 rounded-lg cursor-pointer w-full text-left min-h-[44px] motion-reduce:transition-none",style:{background:u.primary?"#FE500010":t.isDark?"#1c1c20":"#f0f0f5",border:`1px solid ${u.primary?"#FE500030":t.border}`,transition:"border-color 150ms"},onMouseEnter:j=>{j.currentTarget.style.borderColor="#FE500040"},onMouseLeave:j=>{j.currentTarget.style.borderColor=t.border},onFocus:j=>{j.currentTarget.style.borderColor="#FE500040"},onBlur:j=>{j.currentTarget.style.borderColor=t.border},children:[e.jsx("div",{className:"w-6 h-6 rounded flex items-center justify-center",style:{background:t.surfaceElevated},children:s===u.id?e.jsx(me,{size:12,style:{color:"#00ff88"}}):e.jsx(w,{size:12,style:{color:t.textDim}})}),e.jsx("span",{className:"flex-1 text-[13px]",style:{color:t.textPrimary},children:u.label}),e.jsx("span",{className:"text-[13px]",style:{fontFamily:"'Geist Mono', monospace",color:t.textDim},children:u.fmt})]},u.id)})})]})]})}function ce({onCollapse:t,onExpand:s,onMinimize:o,isExpanded:r}){const n=v(),[l,d]=y.useState("chat");return e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3",style:{borderBottom:`1px solid ${n.border}`},children:[e.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:"#00ff88",boxShadow:"0 0 6px rgba(0,255,136,0.4)"}}),e.jsx("span",{className:"text-[12px] font-bold tracking-[0.08em] uppercase flex-1",style:{fontFamily:"'Geist Mono', monospace",color:n.textSecondary},children:l==="chat"?"Conversation Tester":l==="team"?"Team Runner":l==="traces"?"Execution Traces":"Export"}),e.jsxs("div",{className:"flex gap-0.5 rounded-md overflow-hidden",role:"tablist",style:{border:`1px solid ${n.border}`},children:[e.jsx("button",{type:"button",role:"tab",id:"tab-chat","aria-selected":l==="chat","aria-controls":"tabpanel-chat",onClick:()=>d("chat"),title:"Chat with agent",className:"text-[13px] px-2.5 py-2 cursor-pointer border-none min-h-[44px]",style:{background:l==="chat"?"#FE5000":"transparent",color:l==="chat"?"#fff":n.textDim,fontFamily:"'Geist Mono', monospace"},children:"Chat"}),e.jsx("button",{type:"button",role:"tab",id:"tab-team","aria-selected":l==="team","aria-controls":"tabpanel-team",onClick:()=>d("team"),title:"Run team mode",className:"text-[13px] px-2.5 py-2 cursor-pointer border-none min-h-[44px]",style:{background:l==="team"?"#FE5000":"transparent",color:l==="team"?"#fff":n.textDim,fontFamily:"'Geist Mono', monospace"},children:"Team"}),e.jsx("button",{type:"button",role:"tab",id:"tab-export","aria-selected":l==="export","aria-controls":"tabpanel-export",onClick:()=>d("export"),title:"Export agent",className:"text-[13px] px-2.5 py-2 cursor-pointer border-none min-h-[44px]",style:{background:l==="export"?"#FE5000":"transparent",color:l==="export"?"#fff":n.textDim,fontFamily:"'Geist Mono', monospace"},children:"Export"})]}),r&&o&&e.jsx("button",{type:"button",onClick:o,"aria-label":"Minimize test panel",title:"Minimize panel",className:"w-7 h-7 rounded-md border-none cursor-pointer flex items-center justify-center",style:{background:"transparent",color:n.textDim},children:e.jsx(He,{size:14})}),!r&&s&&e.jsx("button",{type:"button",onClick:s,"aria-label":"Expand test panel",title:"Expand panel",className:"w-7 h-7 rounded-md border-none cursor-pointer flex items-center justify-center",style:{background:"transparent",color:n.textDim},children:e.jsx(Ke,{size:14})}),t&&e.jsx("button",{type:"button",onClick:t,"aria-label":"Collapse test panel",title:"Collapse panel",className:"w-7 h-7 rounded-md border-none cursor-pointer flex items-center justify-center",style:{background:"transparent",color:n.textDim},children:e.jsx(W,{size:14})})]}),l==="chat"&&e.jsx("div",{role:"tabpanel",id:"tabpanel-chat","aria-labelledby":"tab-chat",className:"flex flex-col flex-1 min-h-0",children:e.jsx(fs,{})}),l==="team"&&e.jsx("div",{role:"tabpanel",id:"tabpanel-team","aria-labelledby":"tab-team",className:"flex flex-col flex-1 min-h-0",children:e.jsx(hs,{})}),l==="export"&&e.jsx("div",{role:"tabpanel",id:"tabpanel-export","aria-labelledby":"tab-export",className:"flex-1 overflow-y-auto",children:e.jsx(ys,{})}),e.jsx(ps,{}),e.jsx(xs,{})]})}function de(t){return t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}function gs({segments:t,budget:s,cacheBoundary:o,onSegmentClick:r}){const n=v(),l=y.useRef(null),[d,a]=y.useState(null),c=t.reduce((x,g)=>x+g.tokens,0),i=Math.max(0,s-c),p=(x,g,f,h)=>{const b=l.current?.getBoundingClientRect();a({label:g,tokens:f,pct:h,x:x.clientX-(b?.left??0)})};return e.jsxs("div",{children:[e.jsxs("div",{ref:l,className:"relative w-full rounded overflow-hidden",style:{height:20,background:n.surfaceElevated,border:`1px solid ${n.border}`},children:[e.jsxs("div",{className:"flex h-full",children:[t.map((x,g)=>{const f=s>0?x.tokens/s*100:0;return f<.1?null:e.jsx("div",{style:{width:`${f}%`,background:x.color,opacity:.85,cursor:r?"pointer":"default",minWidth:2},onMouseEnter:h=>p(h,x.label,x.tokens,f),onMouseLeave:()=>a(null),onClick:()=>r?.(x.label)},g)}),i>0&&s>0&&e.jsx("div",{style:{width:`${i/s*100}%`,background:n.border,opacity:.25},onMouseEnter:x=>p(x,"Free",i,i/s*100),onMouseLeave:()=>a(null)})]}),o!=null&&o>0&&s>0&&e.jsx("div",{style:{position:"absolute",top:0,left:`${Math.min(o/s*100,99)}%`,height:"100%",width:2,background:"#22c55e",opacity:.9}}),d&&e.jsxs("div",{style:{position:"absolute",top:"110%",left:Math.min(d.x,(l.current?.clientWidth??200)-130),background:n.surfaceElevated,border:`1px solid ${n.border}`,color:n.textPrimary,padding:"3px 7px",borderRadius:4,fontSize:11,fontFamily:"'Geist Mono', monospace",whiteSpace:"nowrap",zIndex:20,pointerEvents:"none",boxShadow:"0 2px 8px rgba(0,0,0,0.2)"},children:[d.label,": ",de(d.tokens)," (",d.pct.toFixed(1),"%)"]})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-3 gap-y-1 mt-1.5",children:[t.map((x,g)=>e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{style:{width:8,height:8,borderRadius:2,background:x.color,opacity:.85,flexShrink:0}}),e.jsxs("span",{style:{fontSize:10,color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[x.label," ",de(x.tokens)]})]},g)),i>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{style:{width:8,height:8,borderRadius:2,background:n.border,opacity:.4,flexShrink:0}}),e.jsxs("span",{style:{fontSize:10,color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:["Free ",de(i)]})]}),o!=null&&o>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("div",{style:{width:8,height:8,borderRadius:1,background:"#22c55e",opacity:.9,flexShrink:0}}),e.jsxs("span",{style:{fontSize:10,color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:["Cache ",de(o)]})]})]})]})}const nt={system:"#6366f1",knowledge:"#f59e0b",memory:"#8b5cf6",lessons:"#14b8a6",history:"#64748b",tools:"#ef4444"},bs={0:"Full",1:"Detailed",2:"Summary",3:"Brief",4:"Mention"};function js({category:t}){const r={size:12,style:{color:nt[t]??"#888"}};switch(t){case"system":return e.jsx($t,{...r});case"knowledge":return e.jsx(Pe,{...r});case"memory":return e.jsx(ue,{...r});case"lessons":return e.jsx(zt,{...r});case"history":return e.jsx(Ze,{...r});case"tools":return e.jsx(qe,{...r});default:return e.jsx(Pe,{...r})}}function vs(t){return t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}function rt({block:t,onBlockClick:s}){const o=v(),[r,n]=y.useState(!1),l=t.children&&t.children.length>0,d=!!t.content,a=l||d,c=nt[t.category]??"#888";return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-1.5 py-1 px-2 rounded cursor-pointer group",style:{background:r?o.surfaceElevated:"transparent",borderLeft:t.cached?"2px solid #22c55e":"2px solid transparent"},onClick:()=>{a&&n(!r),s?.(t.id)},children:[e.jsx("div",{style:{width:12,color:o.textDim,flexShrink:0},children:a?r?e.jsx(O,{size:12}):e.jsx(W,{size:12}):null}),e.jsx(js,{category:t.category}),e.jsx("span",{className:"flex-1 truncate",style:{fontSize:11,color:o.textSecondary,fontFamily:"'Geist Sans', sans-serif"},children:t.label}),e.jsxs("div",{className:"flex items-center gap-1 flex-shrink-0",children:[t.cached&&e.jsx("span",{style:{fontSize:9,fontFamily:"'Geist Mono', monospace",color:"#22c55e",background:"rgba(34,197,94,0.12)",border:"1px solid rgba(34,197,94,0.3)",borderRadius:3,padding:"0 4px"},children:"cached"}),t.depth!=null&&e.jsx("span",{style:{fontSize:9,fontFamily:"'Geist Mono', monospace",color:c,background:`${c}18`,border:`1px solid ${c}30`,borderRadius:3,padding:"0 4px"},children:bs[t.depth]??`D${t.depth}`}),e.jsx("span",{style:{fontSize:10,fontFamily:"'Geist Mono', monospace",color:o.textDim,minWidth:32,textAlign:"right"},children:vs(t.tokens)})]})]}),r&&e.jsxs("div",{style:{marginLeft:26},children:[d&&e.jsxs("div",{style:{fontSize:10,fontFamily:"'Geist Mono', monospace",color:o.textDim,background:o.surfaceElevated,border:`1px solid ${o.border}`,borderRadius:4,padding:"6px 8px",margin:"2px 0 4px 0",whiteSpace:"pre-wrap",overflowWrap:"break-word",lineHeight:1.5},children:[(t.content??"").split(`
39
+ `).slice(0,5).join(`
40
+ `),(t.content??"").split(`
41
+ `).length>5&&e.jsxs("span",{style:{color:o.textDim,opacity:.6},children:[`
42
+ `,"…"]})]}),l&&t.children.slice().sort((i,p)=>p.tokens-i.tokens).map(i=>e.jsx(rt,{block:i,onBlockClick:s},i.id))]})]})}function ks({blocks:t,onBlockClick:s}){const o=v();if(t.length===0)return e.jsx("div",{style:{fontSize:11,color:o.textDim,textAlign:"center",padding:"12px 0"},children:"No blocks"});const r=[...t].sort((n,l)=>l.tokens-n.tokens);return e.jsx("div",{style:{border:`1px solid ${o.border}`,borderRadius:6,overflow:"hidden"},children:r.map((n,l)=>e.jsx("div",{style:{borderBottom:l<r.length-1?`1px solid ${o.border}`:"none"},children:e.jsx(rt,{block:n,onBlockClick:s})},n.id))})}function Ie(t){const s=v(),o=P(c=>c.lastPipelineStats),[r,n]=y.useState(!1),[l,d]=y.useState(null);y.useEffect(()=>{o&&o!==l&&d(l)},[o]);const a=(c,i)=>{if(!i||!r)return c.toString();const p=c-i,x=p>0?`+${p}`:p.toString(),g=p>0?"#22c55e":p<0?"#ef4444":s.textSecondary;return e.jsxs("span",{className:"flex items-center gap-1",children:[c,e.jsxs("span",{style:{color:g,fontSize:"10px",fontWeight:500},children:["(",x,")"]})]})};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-3 py-2 border-b flex-shrink-0",style:{borderColor:s.border,background:s.surfaceElevated,color:s.textPrimary},children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(fe,{size:14,style:{color:"#FE5000"}}),e.jsx("h3",{className:"text-sm font-medium",style:{fontFamily:"'Geist Sans', sans-serif"},children:"Context Inspector"})]}),l&&e.jsxs("button",{onClick:()=>n(!r),className:"flex items-center gap-1 px-2 py-1 rounded text-[11px] font-medium transition-colors",style:{background:r?"#FE5000":s.surfaceElevated,color:r?"white":s.textSecondary,border:`1px solid ${r?"#FE5000":s.border}`},children:[e.jsx(Pt,{size:12}),"Diff"]})]})}),o&&(()=>{const c=[],i=o;if(i.systemTokens&&c.push({label:"System",tokens:i.systemTokens,color:"#6366f1"}),i.contextBlocks){const p=i.contextBlocks.filter(b=>b.category==="knowledge").reduce((b,C)=>b+C.tokens,0),x=i.contextBlocks.filter(b=>b.category==="memory").reduce((b,C)=>b+C.tokens,0),g=i.contextBlocks.filter(b=>b.category==="lessons").reduce((b,C)=>b+C.tokens,0),f=i.contextBlocks.filter(b=>b.category==="history").reduce((b,C)=>b+C.tokens,0),h=i.contextBlocks.filter(b=>b.category==="tools").reduce((b,C)=>b+C.tokens,0);p&&c.push({label:"Knowledge",tokens:p,color:"#f59e0b"}),x&&c.push({label:"Memory",tokens:x,color:"#8b5cf6"}),g&&c.push({label:"Lessons",tokens:g,color:"#14b8a6"}),f&&c.push({label:"History",tokens:f,color:"#64748b"}),h&&c.push({label:"Tools",tokens:h,color:"#ef4444"})}else{const p=(i.totalContextTokens??0)-(i.systemTokens??0);p>0&&c.push({label:"Knowledge + History",tokens:p,color:"#f59e0b"})}return e.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:s.border},children:e.jsx(gs,{segments:c,budget:i.contextBudget??2e5,cacheBoundary:i.cacheBoundaryTokens})})})(),o?.contextBlocks&&o.contextBlocks.length>0&&e.jsx("div",{className:"px-3 py-2 border-b",style:{borderColor:s.border},children:e.jsx(ks,{blocks:o.contextBlocks.map(c=>({id:c.id,label:c.label,category:c.category,tokens:c.tokens,cached:c.cached,depth:c.depth,compression:c.compression,content:c.preview}))})}),e.jsx("div",{className:"flex-1 overflow-auto p-3",style:{background:s.surface},children:o?e.jsxs("div",{className:"space-y-3",children:[o.pipeline&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("h4",{className:"text-xs font-medium",style:{color:s.textPrimary},children:["Pipeline Context ",r&&l&&"(Current vs Previous)"]}),e.jsxs("div",{className:"text-[11px] space-y-1",style:{color:s.textSecondary},children:[e.jsxs("div",{children:["Total Tokens: ",a(o.totalContextTokens||0,l?.totalContextTokens)]}),e.jsxs("div",{children:["System Tokens: ",a(o.systemTokens||0,l?.systemTokens)]}),e.jsxs("div",{children:["Tool Turns: ",a(o.toolTurns||0,l?.toolTurns)]})]})]}),o.memory&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-xs font-medium",style:{color:s.textPrimary},children:"Memory"}),e.jsx("div",{className:"text-[11px] space-y-1",style:{color:s.textSecondary},children:e.jsx("div",{children:"Memory available"})})]}),o.toolCalls&&o.toolCalls.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-xs font-medium",style:{color:s.textPrimary},children:"Tool Calls"}),e.jsx("div",{className:"text-[11px] space-y-1",style:{color:s.textSecondary},children:e.jsxs("div",{children:["Count: ",a(o.toolCalls.length,l?.toolCalls?.length)]})})]}),o.retrieval&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-xs font-medium",style:{color:s.textPrimary},children:"Retrieval"}),e.jsxs("div",{className:"text-[11px] space-y-1",style:{color:s.textSecondary},children:[e.jsxs("div",{children:["Query Type: ",o.retrieval.queryType]}),e.jsxs("div",{children:["Selected Chunks: ",a(o.retrieval.selectedChunks,l?.retrieval?.selectedChunks)]}),e.jsxs("div",{children:["Budget Used: ",a(o.retrieval.budgetUsed,l?.retrieval?.budgetUsed)]}),e.jsxs("div",{children:["Diversity Score: ",o.retrieval.diversityScore.toFixed(2)]})]})]}),(o.frameworkSummary||l?.frameworkSummary)&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h4",{className:"text-xs font-medium",style:{color:s.textPrimary},children:"Framework Summary"}),e.jsxs("div",{className:"text-[11px] space-y-1",style:{color:s.textSecondary},children:[e.jsxs("div",{children:["Constraints: ",a(o.frameworkSummary?.constraints||0,l?.frameworkSummary?.constraints)]}),e.jsxs("div",{children:["Workflow Steps: ",a(o.frameworkSummary?.workflowSteps||0,l?.frameworkSummary?.workflowSteps)]}),e.jsxs("div",{children:["Tool Hints: ",a(o.frameworkSummary?.toolHints||0,l?.frameworkSummary?.toolHints)]})]})]})]}):e.jsx("div",{className:"text-center text-sm",style:{color:s.textSecondary},children:"No context data available"})})]})}function Ss(t){if(!t)return"";const o=t.replace(/\\/g,"/").split("/").filter(Boolean);if(o.length<=1)return o[0]??t;const r=o[o.length-1];return`${o[o.length-2]} / ${r}`}function Ns(t){return typeof t=="object"&&t!==null&&Array.isArray(t.sources)}function ws(t){return typeof t=="object"&&t!==null&&Array.isArray(t.allocations)}function Cs(t){return typeof t=="object"&&t!==null&&Array.isArray(t.chunks)}function Fs(t){return typeof t=="object"&&t!==null&&"contradictionsFound"in t}function Ms(t){const s=t;return typeof t=="object"&&t!==null&&Array.isArray(s.sources)&&Array.isArray(s.derivationChain)}function Ts(t){return typeof t=="object"&&t!==null&&"hedgingScore"in t&&"cycleCount"in t}function V({data:t}){const s=v(),[o,r]=y.useState(!1);return e.jsxs("div",{className:"px-4 pb-2",children:[e.jsxs("button",{type:"button",onClick:()=>r(n=>!n),className:"flex items-center gap-1 text-xs border-none bg-transparent cursor-pointer",style:{color:s.textFaint},children:[e.jsx(Rt,{size:11}),o?"Hide":"Show"," raw JSON"]}),o&&e.jsx("pre",{className:"mt-2 text-xs overflow-auto max-h-40 rounded p-2",style:{background:s.surfaceElevated,color:s.textDim,fontFamily:"'Geist Mono', monospace"},children:JSON.stringify(t,null,2)})]})}function X({name:t,data:s}){const o=v();return e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"px-4 py-2 text-sm",style:{color:o.textDim},children:["No data available for ",t]}),e.jsx(V,{data:s})]})}function Es({data:t,expanded:s,onToggle:o,pending:r}){const n=v(),l=Ns(t)?t:null,d=l?l.sources.filter(a=>a.included).length:0;return r?e.jsx(Q,{icon:e.jsx(we,{size:14}),label:"Source Assembly",description:"Waiting for sources..."}):e.jsxs("div",{className:"border-b",style:{borderColor:n.border},children:[e.jsxs("button",{type:"button",onClick:o,title:s?"Collapse source assembly":"Expand source assembly",className:"flex items-center gap-3 w-full px-4 py-3 text-left border-none cursor-pointer",style:{background:"transparent",color:n.textPrimary},children:[e.jsx(we,{size:16,style:{color:"#3b82f6"}}),e.jsx("span",{className:"flex-1 font-medium",children:"Source Assembly"}),l&&e.jsxs("span",{className:"text-sm",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[d,"/",l.sources.length," sources"]}),s?e.jsx(O,{size:16}):e.jsx(W,{size:16})]}),s&&e.jsxs(e.Fragment,{children:[l?e.jsx("div",{className:"px-4 pb-4 space-y-2",children:l.sources.map((a,c)=>e.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg",style:{background:a.included?n.surface:n.surfaceElevated,border:`1px solid ${a.included?n.border:n.borderSubtle}`},children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${a.included?"bg-green-500":"bg-gray-400"}`}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-sm",style:{color:n.textPrimary},children:a.name}),e.jsxs("div",{className:"text-xs",style:{color:n.textDim},children:[a.type," • ",a.rawTokens.toLocaleString()," tokens"]})]}),a.reason&&e.jsx("div",{className:"text-xs px-2 py-1 rounded",style:{background:a.included?"#10b98115":"#ef444415",color:a.included?"#10b981":"#ef4444"},children:a.reason})]},c))}):e.jsx(X,{name:"Source Assembly",data:t}),e.jsx(V,{data:t})]})]})}function Ds({data:t,expanded:s,onToggle:o,pending:r}){const n=v();if(r)return e.jsx(Q,{icon:e.jsx(Re,{size:14}),label:"Budget Allocation",description:"Waiting for budget computation..."});const l=ws(t)?t:null,d=l?l.allocations.reduce((i,p)=>i+p.allocatedTokens,0):0,a=l?l.allocations.reduce((i,p)=>i+p.usedTokens,0):0,c=d>0?a/d*100:0;return e.jsxs("div",{className:"border-b",style:{borderColor:n.border},children:[e.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 w-full px-4 py-3 text-left border-none cursor-pointer",style:{background:"transparent",color:n.textPrimary},children:[e.jsx(Re,{size:16,style:{color:"#8b5cf6"}}),e.jsx("span",{className:"flex-1 font-medium",children:"Budget Allocation"}),l&&e.jsxs("span",{className:"text-sm",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[c.toFixed(0),"% utilized"]}),s?e.jsx(O,{size:16}):e.jsx(W,{size:16})]}),s&&e.jsxs(e.Fragment,{children:[l?e.jsx("div",{className:"px-4 pb-4 space-y-3",children:e.jsx("div",{className:"space-y-2",children:l.allocations.map((i,p)=>e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center justify-between text-sm",children:[e.jsx("span",{style:{color:n.textPrimary},children:i.source}),e.jsxs("span",{style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[i.usedTokens.toLocaleString(),"/",i.allocatedTokens.toLocaleString()]})]}),e.jsxs("div",{className:"flex gap-1 h-2 rounded",style:{background:n.surfaceElevated},children:[e.jsx("div",{className:"h-full rounded",style:{width:`${i.percentage}%`,background:i.cappedBySize?"#f59e0b":"#10b981"}}),e.jsx("div",{className:"h-full rounded",style:{width:`${Math.max(0,i.percentage-i.usedTokens/l.totalBudget*100)}%`,background:i.cappedBySize?"#f59e0b30":"#10b98130"}})]}),i.cappedBySize&&e.jsx("div",{className:"text-xs",style:{color:"#f59e0b"},children:"Capped by content size"})]},p))})}):e.jsx(X,{name:"Budget Allocation",data:t}),e.jsx(V,{data:t})]})]})}function zs({data:t,expanded:s,onToggle:o,pending:r}){const n=v();if(r)return e.jsx(Q,{icon:e.jsx(fe,{size:14}),label:"Retrieval",description:"Waiting for context retrieval..."});const l=Cs(t)?t:null,d=l?l.diversityScore>.5?"#10b981":l.diversityScore>.3?"#f59e0b":"#ef4444":n.textDim;return e.jsxs("div",{className:"border-b",style:{borderColor:n.border},children:[e.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 w-full px-4 py-3 text-left border-none cursor-pointer",style:{background:"transparent",color:n.textPrimary},children:[e.jsx(fe,{size:16,style:{color:"#06b6d4"}}),e.jsx("span",{className:"flex-1 font-medium",children:"Retrieval"}),l&&e.jsxs("span",{className:"text-sm",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[l.selectedChunks,"/",l.totalChunks," chunks • ",(l.diversityScore*100).toFixed(0),"% diversity"]}),s?e.jsx(O,{size:16}):e.jsx(W,{size:16})]}),s&&e.jsxs(e.Fragment,{children:[l?e.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded",style:{background:n.surface},children:[e.jsx("div",{className:"text-sm font-medium",style:{color:n.textPrimary},children:"Query Type:"}),e.jsx("span",{className:"px-2 py-1 text-xs rounded",style:{background:l.queryType==="factual"?"#3b82f615":l.queryType==="analytical"?"#f59e0b15":"#8b5cf615",color:l.queryType==="factual"?"#3b82f6":l.queryType==="analytical"?"#f59e0b":"#8b5cf6"},children:l.queryType}),e.jsxs("div",{className:"ml-auto text-sm",style:{color:d},children:["Diversity: ",(l.diversityScore*100).toFixed(1),"%"]})]}),e.jsx("div",{className:"space-y-2 max-h-60 overflow-y-auto",children:l.chunks.sort((a,c)=>c.relevanceScore-a.relevanceScore).map((a,c)=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded",style:{background:n.surface},children:[e.jsxs("div",{className:"w-8 text-xs text-center",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:["#",c+1]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"text-sm font-medium",style:{color:n.textPrimary},children:a.source}),e.jsx("div",{className:"text-xs",style:{color:n.textDim},children:a.section})]}),e.jsx("div",{className:"text-xs px-2 py-1 rounded",style:{background:a.inclusionReason==="direct"?"#10b98115":a.inclusionReason==="parent-expansion"?"#3b82f615":"#8b5cf615",color:a.inclusionReason==="direct"?"#10b981":a.inclusionReason==="parent-expansion"?"#3b82f6":"#8b5cf6"},children:a.inclusionReason.replace("-"," ")}),e.jsx("div",{className:"text-xs",style:{fontFamily:"'Geist Mono', monospace",color:n.textDim},children:a.relevanceScore.toFixed(2)})]},c))})]}):e.jsx(X,{name:"Retrieval",data:t}),e.jsx(V,{data:t})]})]})}function $s({data:t,expanded:s,onToggle:o,pending:r}){const n=v();if(r)return e.jsx(Q,{icon:e.jsx(Ne,{size:14}),label:"Conflict Check",description:"Waiting for contradiction analysis..."});const l=Fs(t)?t:null,d=l?l.contradictionsFound>0:!1;return e.jsxs("div",{className:"border-b",style:{borderColor:n.border},children:[e.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 w-full px-4 py-3 text-left border-none cursor-pointer",style:{background:"transparent",color:n.textPrimary},children:[e.jsx(Ne,{size:16,style:{color:d?"#ef4444":"#10b981"}}),e.jsx("span",{className:"flex-1 font-medium",children:"Contradiction Check"}),l&&e.jsxs("span",{className:"text-sm",style:{color:d?"#ef4444":"#10b981",fontFamily:"'Geist Mono', monospace"},children:[l.contradictionsFound," conflicts"]}),s?e.jsx(O,{size:16}):e.jsx(W,{size:16})]}),s&&e.jsxs(e.Fragment,{children:[l?e.jsx("div",{className:"px-4 pb-4 space-y-3",children:d?e.jsxs("div",{className:"space-y-3",children:[l.conflicts.map((a,c)=>e.jsxs("div",{className:"p-3 rounded-lg border",style:{background:"#ef444415",borderColor:"#ef444430"},children:[e.jsxs("div",{className:"font-medium text-sm mb-2",style:{color:"#ef4444"},children:["Conflict #",c+1]}),e.jsxs("div",{className:"space-y-1 text-sm",children:[e.jsxs("div",{style:{color:n.textPrimary},children:[e.jsx("span",{style:{color:n.textDim},children:"Sources:"})," ",a.sources.join(", ")]}),e.jsxs("div",{style:{color:n.textPrimary},children:[e.jsx("span",{style:{color:n.textDim},children:"Resolved to:"})," ",a.resolvedTo]}),e.jsx("div",{style:{color:n.textDim},children:a.reason}),e.jsxs("div",{className:"text-xs",style:{color:"#f59e0b",fontFamily:"'Geist Mono', monospace"},children:["Confidence: ",(a.confidence*100).toFixed(0),"%"]})]})]},c)),l.annotations.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"text-sm font-medium",style:{color:n.textDim},children:"Resolution Notes:"}),l.annotations.map((a,c)=>e.jsx("div",{className:"text-xs p-2 rounded",style:{background:n.surface,color:n.textDim},children:a},c))]})]}):e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"text-sm",style:{color:"#10b981"},children:"No contradictions detected"}),e.jsx("div",{className:"text-xs mt-1",style:{color:n.textDim},children:"All sources are consistent"})]})}):e.jsx(X,{name:"Contradiction Check",data:t}),e.jsx(V,{data:t})]})]})}function Ps({data:t,expanded:s,onToggle:o,pending:r}){const n=v();if(r)return e.jsx(Q,{icon:e.jsx(Le,{size:14}),label:"Provenance",description:"Waiting for source attribution..."});const l=Ms(t)?t:null,d=l?l.sources.reduce((a,c)=>a+c.transformations.length,0):0;return e.jsxs("div",{className:"border-b",style:{borderColor:n.border},children:[e.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 w-full px-4 py-3 text-left border-none cursor-pointer",style:{background:"transparent",color:n.textPrimary},children:[e.jsx(Le,{size:16,style:{color:"#f59e0b"}}),e.jsx("span",{className:"flex-1 font-medium",children:"Provenance"}),l&&e.jsxs("span",{className:"text-sm",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[l.sources.length," sources • ",d," transforms"]}),s?e.jsx(O,{size:16}):e.jsx(W,{size:16})]}),s&&e.jsxs(e.Fragment,{children:[l?e.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[e.jsx("div",{className:"space-y-2",children:l.derivationChain.map((a,c)=>e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded",style:{background:n.surface},children:[e.jsxs("div",{className:"w-8 text-xs text-center",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:["#",c+1]}),e.jsxs("div",{className:"flex-1 text-sm",children:[e.jsx("span",{style:{color:n.textPrimary},children:a.from}),e.jsx("span",{style:{color:n.textDim,margin:"0 8px"},children:"→"}),e.jsx("span",{style:{color:n.textSecondary},children:a.to})]}),e.jsx("div",{className:"text-xs px-2 py-1 rounded",style:{background:"#f59e0b15",color:"#f59e0b"},children:a.method})]},c))}),l.sources.length>0&&e.jsxs("div",{className:"mt-4",children:[e.jsx("div",{className:"text-sm font-medium mb-2",style:{color:n.textDim},children:"Source Transformations:"}),e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:l.sources.map((a,c)=>e.jsxs("div",{className:"p-2 rounded",style:{background:n.surface},children:[e.jsx("div",{className:"text-sm font-medium mb-1",style:{color:n.textPrimary},title:a.path,children:Ss(a.path)}),e.jsx("div",{className:"text-xs",style:{color:n.textDim},children:a.type}),a.transformations.length>0&&e.jsx("div",{className:"mt-2 space-y-1",children:a.transformations.map((i,p)=>e.jsxs("div",{className:"text-xs flex items-center gap-2",style:{color:n.textDim},children:[e.jsx("span",{children:i.input}),e.jsx("span",{children:"→"}),e.jsx("span",{children:i.output}),e.jsx("span",{className:"ml-auto text-xs px-1 py-0.5 rounded",style:{background:n.surfaceElevated,color:n.textDim},children:i.method})]},p))})]},c))})]})]}):e.jsx(X,{name:"Provenance",data:t}),e.jsx(V,{data:t})]})]})}function Rs({data:t,expanded:s,onToggle:o,pending:r}){const n=v();if(r)return e.jsx(Q,{icon:e.jsx(oe,{size:14}),label:"Smart Retrieval",description:"Waiting for adaptive refinement..."});const l=Ts(t)?t:null,d=l&&l.addedChunks.length>0,a=l?l.avgRelevanceAfter-l.avgRelevanceBefore:0,c=l?.aborted?"#f59e0b":d?"#FE5000":"#10b981";return e.jsxs("div",{className:"border-b",style:{borderColor:n.border},children:[e.jsxs("button",{type:"button",onClick:o,className:"flex items-center gap-3 w-full px-4 py-3 text-left border-none cursor-pointer",style:{background:"transparent",color:n.textPrimary},children:[e.jsx(oe,{size:16,style:{color:c}}),e.jsx("span",{className:"flex-1 font-medium",children:"Smart Retrieval"}),l&&e.jsx("span",{className:"text-sm",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:l.aborted?`aborted · ${l.abortReason}`:d?`+${l.addedChunks.length} chunks · ${a>=0?"+":""}${(a*100).toFixed(1)}% rel`:`score ${(l.hedgingScore*100).toFixed(0)}% · no change`}),s?e.jsx(O,{size:16}):e.jsx(W,{size:16})]}),s&&e.jsxs(e.Fragment,{children:[l?e.jsxs("div",{className:"px-4 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded",style:{background:n.surface},children:[e.jsx("div",{className:"text-sm font-medium",style:{color:n.textPrimary},children:"Hedging Score"}),e.jsx("div",{className:"flex-1 h-2 rounded overflow-hidden",style:{background:n.surfaceElevated},children:e.jsx("div",{className:"h-full rounded",style:{width:`${(l.hedgingScore*100).toFixed(0)}%`,background:l.hedgingScore>=l.threshold?"#FE5000":"#10b981"}})}),e.jsxs("span",{className:"text-xs",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[(l.hedgingScore*100).toFixed(0),"% / threshold ",(l.threshold*100).toFixed(0),"%"]})]}),l.cycleCount>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-sm font-medium",style:{color:n.textDim},children:"Cycle Results"}),e.jsxs("div",{className:"flex items-center gap-4 p-2 rounded text-sm",style:{background:n.surface},children:[e.jsxs("div",{children:[e.jsx("span",{style:{color:n.textDim},children:"Before: "}),e.jsxs("span",{style:{fontFamily:"'Geist Mono', monospace",color:n.textPrimary},children:[(l.avgRelevanceBefore*100).toFixed(1),"%"]})]}),e.jsx("div",{style:{color:n.textFaint},children:"→"}),e.jsxs("div",{children:[e.jsx("span",{style:{color:n.textDim},children:"After: "}),e.jsxs("span",{style:{fontFamily:"'Geist Mono', monospace",color:d?"#10b981":n.textPrimary},children:[(l.avgRelevanceAfter*100).toFixed(1),"%"]})]}),e.jsxs("div",{className:"ml-auto text-xs",style:{color:n.textDim,fontFamily:"'Geist Mono', monospace"},children:[l.durationMs,"ms"]})]}),l.addedChunks.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs font-medium mb-1",style:{color:"#10b981"},children:["Added (",l.addedChunks.length,")"]}),e.jsx("div",{className:"space-y-1 max-h-32 overflow-y-auto",children:l.addedChunks.map((i,p)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs px-2 py-1 rounded",style:{background:"#10b98115"},children:[e.jsx("span",{className:"truncate flex-1",style:{color:n.textSecondary},children:i.source}),e.jsxs("span",{style:{color:"#10b981",fontFamily:"'Geist Mono', monospace"},children:[(i.relevance*100).toFixed(0),"%"]})]},p))})]}),l.droppedChunks.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"text-xs font-medium mb-1",style:{color:n.textDim},children:["Replaced (",l.droppedChunks.length,")"]}),e.jsx("div",{className:"space-y-1 max-h-24 overflow-y-auto",children:l.droppedChunks.map((i,p)=>e.jsxs("div",{className:"flex items-center gap-2 text-xs px-2 py-1 rounded",style:{background:n.surfaceElevated},children:[e.jsx("span",{className:"truncate flex-1 font-mono",style:{color:n.textFaint},children:i.nodeId}),e.jsxs("span",{style:{color:n.textFaint,fontFamily:"'Geist Mono', monospace"},children:[(i.relevance*100).toFixed(0),"%"]})]},p))})]})]}),l.aborted&&e.jsxs("div",{className:"text-xs px-2 py-1 rounded",style:{background:"#f59e0b15",color:"#f59e0b"},children:["Aborted: ",l.abortReason]}),l.cycleCount===0&&!l.aborted&&e.jsx("div",{className:"text-sm text-center py-2",style:{color:n.textDim},children:"Hedging score below threshold — no refinement needed"})]}):e.jsx(X,{name:"Smart Retrieval",data:t}),e.jsx(V,{data:t})]})]})}function Ls({event:t}){const s=v(),o=t.cacheMetrics;if(!o)return null;const r=o.stableTokens+o.volatileTokens>0?Math.round(o.stableTokens/(o.stableTokens+o.volatileTokens)*100):0,n={"anthropic-prefix":"Anthropic Prefix Cache","openai-auto":"OpenAI Auto Cache","google-context-cache":"Google Context Cache",none:"No Caching"};return e.jsxs("div",{className:"px-4 py-3 border-b",style:{borderColor:s.border},children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(oe,{size:14,style:{color:"#10b981"}}),e.jsx("span",{className:"text-sm font-medium",style:{color:s.textPrimary},children:"Cache Strategy"}),e.jsx("span",{className:"ml-auto text-xs px-2 py-0.5 rounded",style:{background:"#10b98115",color:"#10b981",fontFamily:"'Geist Mono', monospace"},children:n[o.strategy]??o.strategy})]}),e.jsxs("div",{className:"flex h-3 rounded overflow-hidden",style:{background:s.surfaceElevated},children:[e.jsx("div",{className:"h-full",style:{width:`${r}%`,background:"#10b981"},title:`Stable: ${o.stableTokens.toLocaleString()} tokens`}),e.jsx("div",{className:"h-full",style:{width:`${100-r}%`,background:"#f59e0b"},title:`Volatile: ${o.volatileTokens.toLocaleString()} tokens`})]}),e.jsxs("div",{className:"flex justify-between mt-1 text-xs",style:{color:s.textDim,fontFamily:"'Geist Mono', monospace"},children:[e.jsxs("span",{style:{color:"#10b981"},children:["● stable ",o.stableTokens.toLocaleString()," tok"]}),e.jsxs("span",{style:{color:"#f59e0b"},children:["● volatile ",o.volatileTokens.toLocaleString()," tok"]}),e.jsxs("span",{children:["~",o.estimatedSavings,"% cached"]})]})]})}const As={retrieval:{color:"#3498db",label:"Retrieval"},llm_call:{color:"#9b59b6",label:"LLM"},tool_call:{color:"#2ecc71",label:"Tool"},error:{color:"#e74c3c",label:"Error"},fact_extracted:{color:"#FE5000",label:"Fact"},token_usage:{color:"#f1c40f",label:"Tokens"},cache:{color:"#10b981",label:"Cache"}};function Is({events:t}){const s=v();return t.length===0?null:e.jsxs("div",{className:"px-4 py-3 space-y-2 border-t",style:{borderColor:s.border},children:[e.jsx("div",{className:"text-xs font-medium mb-2",style:{color:s.textDim},children:"Event Timeline"}),t.map((o,r)=>{const n=As[o.kind]||{color:"#888",label:o.kind},l=o.sourceName||o.toolName||o.model||o.kind,d=(o.inputTokens||0)+(o.outputTokens||0);return e.jsxs("div",{className:"flex items-center gap-3 p-2 rounded",style:{background:s.isDark?"#ffffff06":"#00000006"},children:[e.jsx("div",{className:"w-2 h-2 rounded-full shrink-0",style:{background:n.color}}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-[11px] px-1.5 py-0.5 rounded font-medium",style:{background:`${n.color}20`,color:n.color,fontFamily:"'Geist Mono', monospace"},children:n.label}),e.jsx("span",{className:"text-[12px] font-medium truncate",style:{color:s.textPrimary},children:l})]}),o.query&&e.jsx("div",{className:"text-[11px] mt-0.5 truncate",style:{color:s.textDim},children:o.query})]}),e.jsxs("div",{className:"shrink-0 text-right",children:[o.durationMs!=null&&e.jsxs("div",{className:"text-[11px]",style:{color:s.textDim,fontFamily:"'Geist Mono', monospace"},children:[o.durationMs,"ms"]}),o.resultCount!=null&&e.jsxs("div",{className:"text-[10px]",style:{color:s.textFaint},children:[o.resultCount," results"]}),d>0&&e.jsxs("div",{className:"text-[10px]",style:{color:s.textFaint},children:[d," tok"]})]})]},r)})]})}function Q({icon:t,label:s,description:o}){const r=v();return e.jsxs("div",{className:"px-4 py-3 border-b flex items-center gap-3 opacity-40",style:{borderColor:r.border},children:[e.jsx("div",{style:{color:r.textDim},children:t}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium",style:{color:r.textDim},children:s}),e.jsx("div",{className:"text-xs",style:{color:r.textFaint},children:o})]})]})}const je=["source_assembly","budget_allocation","retrieval","contradiction_check","provenance","adaptive_retrieval"],Bs={source_assembly:"Source",budget_allocation:"Budget",retrieval:"Retrieval",contradiction_check:"Conflicts",provenance:"Provenance",adaptive_retrieval:"Smart"};function Gs({status:t}){const s="w-6 h-6 rounded-full flex items-center justify-center text-xs font-bold shrink-0";return t==="error"?e.jsx("div",{className:s,style:{background:"#ef4444",color:"white"},children:"✕"}):t==="done"?e.jsx("div",{className:s,style:{background:"#10b981",color:"white"},children:"✓"}):t==="active"?e.jsx("div",{className:`${s} animate-pulse`,style:{background:"#FE5000"}}):e.jsx("div",{className:s,style:{background:"#6b7280"}})}function _s({stages:t,hasError:s}){const o=v(),r=je.reduce((n,l,d)=>{const a=t.get(l);return a&&a.durationMs===void 0?d:n},-1);return e.jsx("div",{className:"flex items-start px-4 py-3 border-b",style:{borderColor:o.border},children:je.map((n,l)=>{const d=t.get(n),a=d&&d.durationMs!==void 0,c=d&&d.durationMs===void 0,p=s&&l===r?"error":a?"done":c?"active":"pending",x=a||c;return e.jsxs("div",{className:"flex items-center flex-1 min-w-0",children:[e.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[e.jsx(Gs,{status:p}),e.jsx("span",{className:"text-[10px] text-center leading-tight",style:{color:o.textDim},children:Bs[n]}),d?.durationMs!==void 0&&e.jsxs("span",{className:"text-[10px]",style:{color:o.textFaint,fontFamily:"'Geist Mono', monospace"},children:[d.durationMs,"ms"]})]}),l<je.length-1&&e.jsx("div",{className:"flex-1 h-px mx-1",style:{background:x?"#10b981":"#6b7280",opacity:.5,marginTop:"-14px"}})]},n)})})}function Be(){const t=v(),s=Y(h=>h.getDisplayTrace),o=Y(h=>h.selectedTraceId),r=Y(h=>h.eventVersion),[n,l]=y.useState(new Set),d=y.useRef(null),a=s(),c=a?.events??[],i=c.filter(h=>h.kind==="pipeline_stage"),p=c.findLast(h=>h.kind==="cache"),x=new Map;for(const h of i)if(h.provenanceStages)for(const b of h.provenanceStages)x.set(b.stage,b);const g=h=>{const b=new Set(n);b.has(h)?b.delete(h):b.add(h),l(b)},f=c.some(h=>h.kind==="error");return y.useEffect(()=>{for(const h of i)if(h.provenanceStages)for(const b of h.provenanceStages)b.durationMs!==void 0&&!n.has(b.stage)&&l(C=>new Set([...C,b.stage]))},[r]),y.useEffect(()=>{d.current&&i.length>0&&(d.current.scrollTop=d.current.scrollHeight)},[r,i.length]),a?c.length===0?e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(ve,{selectedTraceId:o,stageCount:0,eventCount:0}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:e.jsx("div",{className:"text-center",children:e.jsx("div",{className:"text-sm",style:{color:t.textDim},children:"Trace started, waiting for events…"})})})]}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(ve,{selectedTraceId:o,stageCount:x.size,eventCount:c.length}),e.jsxs("div",{ref:d,className:"flex-1 overflow-y-auto",children:[x.size>0&&e.jsx(_s,{stages:x,hasError:f}),x.size===0&&e.jsxs("div",{className:"px-4 py-3",children:[e.jsxs("div",{className:"text-sm",style:{color:t.textDim},children:["Trace has ",c.length," event",c.length!==1?"s":""," but no pipeline stages."]}),e.jsx("div",{className:"text-xs mt-1",style:{color:t.textFaint},children:"Events are visible in the timeline below."})]}),e.jsx(Es,{data:x.get("source_assembly")?.data,expanded:n.has("source_assembly"),onToggle:()=>g("source_assembly"),pending:!x.has("source_assembly")}),e.jsx(Ds,{data:x.get("budget_allocation")?.data,expanded:n.has("budget_allocation"),onToggle:()=>g("budget_allocation"),pending:!x.has("budget_allocation")}),e.jsx(zs,{data:x.get("retrieval")?.data,expanded:n.has("retrieval"),onToggle:()=>g("retrieval"),pending:!x.has("retrieval")}),e.jsx($s,{data:x.get("contradiction_check")?.data,expanded:n.has("contradiction_check"),onToggle:()=>g("contradiction_check"),pending:!x.has("contradiction_check")}),e.jsx(Ps,{data:x.get("provenance")?.data,expanded:n.has("provenance"),onToggle:()=>g("provenance"),pending:!x.has("provenance")}),x.has("adaptive_retrieval")&&e.jsx(Rs,{data:x.get("adaptive_retrieval")?.data,expanded:n.has("adaptive_retrieval"),onToggle:()=>g("adaptive_retrieval")}),p&&e.jsx(Ls,{event:p}),e.jsx(Is,{events:c})]})]}):e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(ve,{selectedTraceId:o,stageCount:0,eventCount:0}),e.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"text-sm",style:{color:t.textDim},children:"No trace yet"}),e.jsx("div",{className:"text-xs mt-2",style:{color:t.textFaint},children:"Run a chat in the Test tab to see how your agent processes knowledge through the pipeline."})]})})]})}function ve({selectedTraceId:t,stageCount:s,eventCount:o}){const r=v();return e.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b",style:{borderColor:r.border},children:[e.jsx("div",{className:`w-2 h-2 rounded-full ${t?"bg-blue-500":"bg-green-500 animate-pulse"}`}),e.jsx("span",{className:"text-sm font-medium",style:{color:r.textPrimary},children:"Pipeline Observability"}),t&&e.jsx("button",{type:"button",onClick:()=>Y.getState().selectTrace(null),title:"Stop viewing past trace",className:"text-[10px] px-1.5 py-0.5 rounded border-none cursor-pointer",style:{background:"#3b82f620",color:"#3b82f6",fontFamily:"'Geist Mono', monospace"},children:"viewing past · ✕"}),e.jsxs("span",{className:"ml-auto text-xs",style:{color:r.textDim,fontFamily:"'Geist Mono', monospace"},children:[s," stage",s!==1?"s":""," · ",o," event",o!==1?"s":""]})]})}function Ge({onResize:t,leftWidthPct:s,minWidthPx:o=200,onDoubleClick:r}){const n=v(),[l,d]=y.useState(!1),a=y.useRef(null),c=y.useCallback(g=>{g.preventDefault(),d(!0)},[]),i=y.useCallback(g=>{if(!l||!a.current)return;const f=a.current.parentElement;if(!f)return;const h=f.getBoundingClientRect(),C=(g.clientX-h.left)/h.width*100,N=o/h.width*100,F=100-N,$=Math.max(N,Math.min(F,C));t($)},[l,o,t]),p=y.useCallback(()=>{d(!1)},[]),x=y.useCallback(()=>{r?.()},[r]);return y.useEffect(()=>{if(l)return document.addEventListener("mousemove",i),document.addEventListener("mouseup",p),()=>{document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",p)}},[l,i,p]),e.jsxs("div",{ref:a,className:"relative cursor-col-resize flex-shrink-0",style:{width:"4px",background:l?"#FE5000":"transparent",transition:l?"none":"background-color 0.2s ease"},onMouseDown:c,onDoubleClick:x,children:[e.jsx("div",{className:"absolute inset-y-0 left-1/2 transform -translate-x-1/2 w-1",style:{background:n.border}}),l&&e.jsx("div",{className:"fixed inset-0 cursor-col-resize",style:{zIndex:9999}})]})}const _e="testTab-panelWidths",ke=25,Oe=25;function Vs(){const t=v(),s=P(u=>u.conversationId),o=B(u=>u.selectedModel),r=B(u=>u.setModel),n=J(u=>u.getAllModels),l=J(u=>u.providers),d=y.useMemo(()=>n().map(u=>({value:`${u.providerId}::${u.id}`,label:`${u.providerName} / ${u.label}`})),[n,l]),a=y.useMemo(()=>n().find(w=>`${w.providerId}::${w.id}`===o)?.label||o,[n,l,o]),[c,i]=y.useState(()=>{const u=localStorage.getItem(_e);if(u)try{return JSON.parse(u)}catch{return{left:ke,right:Oe}}return{left:ke,right:Oe}}),[p,x]=y.useState(0),[g,f]=y.useState(!1),[h,b]=y.useState(!1);y.useEffect(()=>{const u=()=>{b(window.innerWidth<1200)};return u(),window.addEventListener("resize",u),()=>window.removeEventListener("resize",u)},[]),y.useEffect(()=>{localStorage.setItem(_e,JSON.stringify(c))},[c]);const C=y.useCallback(u=>{i(w=>({...w,left:u}))},[]),N=y.useCallback(u=>{i(w=>({...w,right:100-u}))},[]),F=y.useCallback(()=>{f(!g),i(g?u=>({...u,left:ke}):u=>({...u,left:0}))},[g]),$=100-c.left-c.right;if(h){const u=[{id:"conversation",label:"Conversation",icon:Lt,component:ce},{id:"context",label:"Context",icon:fe,component:Ie},{id:"pipeline",label:"Pipeline",icon:At,component:Be}],w=u[p]?.component||ce;return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"px-4 py-3",children:[e.jsx("h2",{className:"text-2xl font-semibold mb-2",style:{color:t.textPrimary,fontFamily:"'Geist Sans', sans-serif"},children:"Test Your Agent"}),e.jsx("p",{className:"text-sm mb-3",style:{color:t.textSecondary,lineHeight:1.5},children:"Test your agent with sample conversations, view execution traces, and analyze performance."}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"flex-1 max-w-xs",children:e.jsx(De,{options:d,value:o,onChange:M=>r(M),placeholder:"Select model..."})}),o&&e.jsxs("span",{className:"text-xs px-2 py-1 rounded-full",style:{background:"#FE500015",color:"#FE5000",border:"1px solid #FE500030"},children:["Current: ",a]})]})]}),e.jsx("div",{className:"flex border-b",style:{borderColor:t.border,background:t.surfaceElevated},children:u.map((M,j)=>{const k=M.icon,m=j===p;return e.jsxs("button",{type:"button",onClick:()=>x(j),title:`View ${M.label.toLowerCase()}`,className:"flex items-center gap-2 px-4 py-3 text-sm font-medium border-none bg-transparent",style:{color:m?"#FE5000":t.textSecondary,borderBottom:m?"2px solid #FE5000":"none",fontFamily:"'Geist Sans', sans-serif"},children:[e.jsx(k,{size:14}),M.label]},M.id)})}),e.jsx("div",{className:"flex-1 overflow-hidden",children:p===0?e.jsx(ce,{}):e.jsx(w,{conversationId:s||void 0})})]})}return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"px-4 py-3 flex-shrink-0",children:[e.jsx("h2",{className:"text-2xl font-semibold mb-2",style:{color:t.textPrimary,fontFamily:"'Geist Sans', sans-serif"},children:"Test Your Agent"}),e.jsx("p",{className:"text-sm mb-3",style:{color:t.textSecondary,lineHeight:1.5},children:"Test your agent with sample conversations, view execution traces, and analyze performance."}),e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx("div",{className:"flex-1 max-w-xs",children:e.jsx(De,{options:d,value:o,onChange:u=>r(u),placeholder:"Select model..."})}),o&&e.jsxs("span",{className:"text-xs px-2 py-1 rounded-full",style:{background:"#FE500015",color:"#FE5000",border:"1px solid #FE500030"},children:["Current: ",a]})]})]}),e.jsxs("div",{className:"flex-1 flex overflow-hidden",style:{display:"grid",gridTemplateColumns:`${c.left}% 4px ${$}% 4px ${c.right}%`,gap:0},children:[e.jsx("div",{className:"overflow-hidden border-r overflow-y-auto",style:{borderColor:t.border,background:t.surface,display:c.left===0?"none":"block"},children:e.jsx(Ie,{conversationId:s||void 0})}),e.jsx(Ge,{onResize:C,leftWidthPct:c.left,onDoubleClick:F}),e.jsx("div",{className:"overflow-hidden",style:{background:t.surface},children:e.jsx(ce,{isExpanded:!g,onExpand:()=>f(!1),onMinimize:()=>f(!0)})}),e.jsx(Ge,{onResize:N,leftWidthPct:100-c.right}),e.jsx("div",{className:"overflow-hidden border-l",style:{borderColor:t.border,background:t.surface,display:c.right===0?"none":"block"},children:e.jsx(Be,{})})]})]})}export{Vs as TestTab};
@@ -0,0 +1 @@
1
+ import{r as d,j as t}from"./vendor-D1h_O76p.js";import{u as te,c as m,f as re}from"./index-C626nWuA.js";import{u as l,c as f,T as se,U as oe,V as le}from"./services-BDk6yY4o.js";import{c as ae,p as ne}from"./stores-CeKWz7ou.js";import{f as j,a1 as x,Z as ce,aN as ie,O as de,aF as z,ao as me,aO as ue,aP as xe,_ as R,R as be}from"./icons-CS8RUPBi.js";const k=ae()(ne((r,u)=>({tools:[],addTool:n=>{const c=`cli-${Date.now()}-${Math.random().toString(36).slice(2,7)}`;r({tools:[...u().tools,{...n,id:c}]})},removeTool:n=>r({tools:u().tools.filter(c=>c.id!==n)})}),{name:"cli-tool-store"}));function je(){const r=te(),u=l(e=>e.removeMcp),n=f(e=>e.removeServer),c=f(e=>e.connectServer),i=f(e=>e.servers),b=se(e=>e.mcpHealth),N=m(e=>e.skills),C=m(e=>e.loaded),y=m(e=>e.loading),v=m(e=>e.loadSkills),D=m(e=>e.toggleSkill),S=l(e=>e.setShowSkillPicker),I=l(e=>e.setShowMarketplace),T=l(e=>e.skills),p=l(e=>e.connectors),M=l(e=>e.setShowConnectorPicker),g=k(e=>e.tools),B=k(e=>e.addTool),$=k(e=>e.removeTool),[w,H]=d.useState(null),[o,a]=d.useState({show:!1,name:"",command:"",description:""}),O=()=>{!o.name.trim()||!o.command.trim()||(B({name:o.name.trim(),command:o.command.trim(),description:o.description.trim()}),a({show:!1,name:"",command:"",description:""}))};d.useEffect(()=>{!C&&!y&&v()},[C,y,v]);const P=d.useMemo(()=>new Set(T.filter(e=>e.added).map(e=>e.id)),[T]),h=d.useMemo(()=>N.filter(e=>P.has(e.id)),[N,P]),G=e=>{const s=b[e.id];return s?.status==="error"?"#ef4444":e.status==="connected"&&s?.status==="healthy"?"#22c55e":e.status==="connecting"||s?.status==="checking"?"#f59e0b":e.status==="error"?"#ef4444":"#6b7280"},W=e=>{const s=b[e.id];return s?.status==="error"?"Error":e.status==="connected"&&s?.status==="healthy"?"Connected":e.status==="connecting"||s?.status==="checking"?"Connecting":e.status==="error"?"Error":"Disconnected"},Z=e=>{u(e),n(e)},_=async e=>{try{await c(e)}catch(s){console.error("Failed to reconnect MCP server:",s)}},U=e=>e?new Date(e).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}):"",V=({skill:e})=>{const s=e.enabled;return t.jsx("div",{className:"p-4 rounded-lg border",style:{background:r.surface,borderColor:r.border},children:t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.jsx("h3",{className:"text-sm font-medium truncate",style:{color:r.textPrimary},children:e.name}),t.jsx(re,{skillPath:e.path})]}),e.description&&t.jsx("p",{className:"text-xs mb-2",style:{color:r.textSecondary,lineHeight:1.4},children:e.description})]}),t.jsxs("label",{className:"flex items-center cursor-pointer",title:s?"Disable skill":"Enable skill",children:[t.jsx("input",{type:"checkbox",checked:s,onChange:()=>D(e.id),className:"sr-only"}),t.jsx("div",{className:`w-10 h-6 rounded-full relative transition-colors ${s?"bg-blue-500":""}`,style:{backgroundColor:s?"#3b82f6":r.borderSubtle},children:t.jsx("div",{className:`w-4 h-4 rounded-full bg-white absolute top-1 transition-transform ${s?"translate-x-5":"translate-x-1"}`,style:{boxShadow:"0 1px 3px rgba(0,0,0,0.2)"}})})]})]})})},q=({server:e})=>{const s=b[e.id],E=s?.toolCount??e.tools?.length??0,X=G(e),Y=W(e),ee=e.status==="disconnected"||e.status==="error",F=s?.status==="checking",L=s?.checkedAt?U(s.checkedAt):null,A=s?.errorMessage??void 0;return t.jsxs("div",{className:"p-4 rounded-lg border",style:{background:r.surface,borderColor:r.border},children:[t.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:"w-2 h-2 rounded-full flex-shrink-0",style:{backgroundColor:X},title:A}),t.jsx("h3",{className:"text-sm font-medium",style:{color:r.textPrimary},children:e.name})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("button",{type:"button","aria-label":`Check health of ${e.name}`,title:F?"Checking…":"Run health check",onClick:()=>le(e.id),disabled:F,className:"p-1 rounded hover:bg-gray-100 dark:hover:bg-gray-800 disabled:opacity-40",style:{color:r.textFaint},children:t.jsx(z,{size:13})}),t.jsx("button",{type:"button","aria-label":`Remove ${e.name}`,title:`Remove ${e.name}`,onClick:()=>Z(e.id),className:"text-xs p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/20",style:{color:r.textFaint},children:"×"})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-3 text-xs",style:{color:r.textSecondary},children:[t.jsx("span",{title:A,children:Y}),E>0&&t.jsxs("span",{className:"px-1.5 py-0.5 rounded",style:{background:r.badgeBg,color:r.textDim},children:[E," tools"]}),L&&t.jsxs("span",{style:{color:r.textFaint},children:["checked ",L]})]}),ee&&t.jsxs("button",{type:"button",onClick:()=>_(e.id),title:"Reconnect server",className:"flex items-center gap-1 px-2 py-1 text-xs rounded hover:bg-gray-100 dark:hover:bg-gray-800",style:{color:r.textSecondary},children:[t.jsx(be,{size:10}),"Reconnect"]})]}),s?.errorMessage&&s.status!=="healthy"&&t.jsx("p",{className:"mt-2 text-xs truncate",title:s.errorMessage,style:{color:"#ef4444"},children:s.errorMessage})]})},J={connected:"#22c55e",configured:"#f59e0b",available:"#6b7280"},K=({connector:e})=>{const s=J[e.status]??"#6b7280";return t.jsxs("div",{className:"p-4 rounded-lg border",style:{background:r.surface,borderColor:r.border},children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(j,{size:14,style:{color:r.textFaint}}),t.jsx("span",{className:"text-sm font-medium",style:{color:r.textPrimary},children:e.name})]}),t.jsx("span",{className:"px-1.5 py-0.5 rounded text-xs capitalize",style:{background:s+"20",color:s},children:e.status})]}),e.url&&t.jsx("p",{className:"text-xs mt-1 truncate",style:{color:r.textFaint},children:e.url})]})},Q=({tool:e})=>t.jsx("div",{className:"p-4 rounded-lg border",style:{background:r.surface,borderColor:r.border},children:t.jsxs("div",{className:"flex items-start justify-between gap-3",children:[t.jsxs("div",{className:"flex-1 min-w-0",children:[t.jsx("p",{className:"text-sm font-medium truncate",style:{color:r.textPrimary},children:e.name}),t.jsx("code",{className:"text-xs font-mono block mt-1 truncate",style:{color:r.textSecondary},children:e.command}),e.description&&t.jsx("p",{className:"text-xs mt-1",style:{color:r.textFaint},children:e.description})]}),t.jsx("button",{type:"button","aria-label":`Remove ${e.name}`,title:`Remove ${e.name}`,onClick:()=>$(e.id),className:"text-xs p-1 rounded hover:bg-red-100 dark:hover:bg-red-900/20",style:{color:r.textFaint},children:"×"})]})});return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-semibold mb-2 m-0",style:{color:r.textPrimary,fontFamily:"'Geist Sans', sans-serif"},children:"Tools & Capabilities"}),t.jsx("p",{className:"text-sm",style:{color:r.textSecondary,lineHeight:1.5},children:"Configure the tools and capabilities your agent can use. Skills add specialized functionality while MCP servers provide external integrations."})]}),t.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(j,{size:20,style:{color:"#3b82f6"}}),t.jsx("h3",{className:"text-lg font-medium",style:{color:r.textPrimary},children:"API Connectors"}),t.jsxs("span",{className:"px-2 py-1 rounded text-xs",style:{background:r.badgeBg,color:r.textDim},children:[p.length," total"]})]}),t.jsxs("button",{type:"button",onClick:()=>M(!0),title:"Connect an API service",className:"flex items-center gap-1.5 px-3 py-2 rounded text-sm border transition-colors",style:{borderColor:r.border,color:r.textSecondary},onMouseEnter:e=>{e.currentTarget.style.background="#3b82f610",e.currentTarget.style.borderColor="#3b82f6",e.currentTarget.style.color="#3b82f6"},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.borderColor=r.border,e.currentTarget.style.color=r.textSecondary},children:[t.jsx(x,{size:16}),"Connect"]})]}),p.length===0?t.jsxs("div",{className:"text-center py-8 rounded-lg border-2 border-dashed",style:{borderColor:r.border},children:[t.jsx(j,{size:32,className:"mx-auto mb-3",style:{color:r.textFaint}}),t.jsx("p",{className:"text-sm font-medium mb-1",style:{color:r.textPrimary},children:"No API Connectors"}),t.jsx("p",{className:"text-xs mb-4",style:{color:r.textSecondary},children:"Connect services like Notion, HubSpot, and Slack to give your agent API access."}),t.jsx("button",{type:"button",onClick:()=>M(!0),title:"Connect an API service",className:"px-4 py-2 rounded text-sm transition-colors",style:{background:"#3b82f6",color:"#fff",border:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.background="#2563eb"},onMouseLeave:e=>{e.currentTarget.style.background="#3b82f6"},children:"Connect Service"})]}):t.jsx("div",{className:"space-y-3",children:p.map(e=>t.jsx(K,{connector:e},e.id))})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(ce,{size:20,style:{color:"#f1c40f"}}),t.jsx("h3",{className:"text-lg font-medium",style:{color:r.textPrimary},children:"Skills"}),t.jsxs("span",{className:"px-2 py-1 rounded text-xs",style:{background:r.badgeBg,color:r.textDim},children:[h.length," total"]})]}),t.jsxs("button",{type:"button",onClick:()=>S(!0),title:"Add skills from library",className:"flex items-center gap-1.5 px-3 py-2 rounded text-sm border transition-colors",style:{borderColor:r.border,color:r.textSecondary},onMouseEnter:e=>{e.currentTarget.style.background="#FE500010",e.currentTarget.style.borderColor="#FE5000",e.currentTarget.style.color="#FE5000"},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.borderColor=r.border,e.currentTarget.style.color=r.textSecondary},children:[t.jsx(x,{size:16}),"Add from library"]}),t.jsx("button",{type:"button",onClick:()=>I(!0),title:"Browse marketplace",className:"flex items-center gap-1.5 px-3 py-2 rounded text-sm border transition-colors",style:{borderColor:r.border,color:r.textSecondary},onMouseEnter:e=>{e.currentTarget.style.background=r.surfaceElevated},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:"Marketplace"})]}),y?t.jsx("div",{className:"space-y-3",children:Array.from({length:3}).map((e,s)=>t.jsx("div",{className:"h-20 rounded-lg animate-pulse",style:{background:r.borderSubtle}},s))}):h.length===0?t.jsxs("div",{className:"text-center py-8 rounded-lg border-2 border-dashed",style:{borderColor:r.border},children:[t.jsx(ie,{size:32,className:"mx-auto mb-3",style:{color:r.textFaint}}),t.jsx("p",{className:"text-sm font-medium mb-1",style:{color:r.textPrimary},children:"No Skills Installed"}),t.jsx("p",{className:"text-xs mb-4",style:{color:r.textSecondary},children:"Browse the skill library to add specialized capabilities for your agent."}),t.jsx("button",{type:"button",onClick:()=>S(!0),title:"Browse skill library",className:"px-4 py-2 rounded text-sm transition-colors",style:{background:"#f1c40f",color:"#000",border:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.background="#e1b70f"},onMouseLeave:e=>{e.currentTarget.style.background="#f1c40f"},children:"Browse Skills"})]}):t.jsx("div",{className:"space-y-3",children:h.map(e=>t.jsx(V,{skill:e},e.id))})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(de,{size:20,style:{color:"#2ecc71"}}),t.jsx("h3",{className:"text-lg font-medium",style:{color:r.textPrimary},children:"MCP Servers"}),t.jsxs("span",{className:"px-2 py-1 rounded text-xs",style:{background:r.badgeBg,color:r.textDim},children:[i.length," servers"]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[i.length>0&&t.jsxs("button",{type:"button",onClick:()=>oe(i.map(e=>e.id)),title:"Check health of all MCP servers",className:"flex items-center gap-1.5 px-3 py-2 rounded text-sm border transition-colors",style:{borderColor:r.border,color:r.textSecondary},onMouseEnter:e=>{e.currentTarget.style.background=r.surfaceElevated},onMouseLeave:e=>{e.currentTarget.style.background="transparent"},children:[t.jsx(z,{size:14}),"Check All"]}),t.jsxs("button",{type:"button",onClick:()=>l.getState().setShowConnectionPicker(!0),title:"Connect MCP server",className:"flex items-center gap-1.5 px-3 py-2 rounded text-sm border transition-colors",style:{borderColor:r.border,color:r.textSecondary},onMouseEnter:e=>{e.currentTarget.style.background="#FE500010",e.currentTarget.style.borderColor="#FE5000",e.currentTarget.style.color="#FE5000"},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.borderColor=r.border,e.currentTarget.style.color=r.textSecondary},children:[t.jsx(x,{size:16}),"Connect"]})]})]}),w&&t.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-lg border-l-4",style:{backgroundColor:`${r.statusError}20`,borderLeftColor:r.statusError,color:r.statusError},children:[t.jsx(me,{size:16}),t.jsx("span",{className:"flex-1 text-sm",children:w}),t.jsx("button",{onClick:()=>H(null),className:"px-2 py-1 text-xs rounded transition-colors",style:{background:r.statusError,color:"#fff",border:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.opacity="0.9"},onMouseLeave:e=>{e.currentTarget.style.opacity="1"},children:"Dismiss"})]}),i.length===0?t.jsxs("div",{className:"text-center py-8 rounded-lg border-2 border-dashed",style:{borderColor:r.border},children:[t.jsx(ue,{size:32,className:"mx-auto mb-3",style:{color:r.textFaint}}),t.jsx("p",{className:"text-sm font-medium mb-1",style:{color:r.textPrimary},children:"No MCP Servers"}),t.jsx("p",{className:"text-xs mb-4",style:{color:r.textSecondary},children:"Connect to external integrations to expand your agent's capabilities."}),t.jsxs("button",{type:"button",onClick:()=>l.getState().setShowConnectionPicker(!0),className:"px-4 py-2 rounded text-sm transition-colors",style:{background:"#2ecc71",color:"#fff",border:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.background="#27ae60"},onMouseLeave:e=>{e.currentTarget.style.background="#2ecc71"},children:[t.jsx(xe,{size:16,style:{marginRight:"8px",display:"inline"}}),"Connect Server"]})]}):t.jsx("div",{className:"space-y-3",children:i.map(e=>t.jsx(q,{server:e},e.id))})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(R,{size:20,style:{color:"#a855f7"}}),t.jsx("h3",{className:"text-lg font-medium",style:{color:r.textPrimary},children:"CLI Tools"}),t.jsxs("span",{className:"px-2 py-1 rounded text-xs",style:{background:r.badgeBg,color:r.textDim},children:[g.length," total"]})]}),t.jsxs("button",{type:"button",onClick:()=>a(e=>({...e,show:!e.show})),title:"Add CLI tool",className:"flex items-center gap-1.5 px-3 py-2 rounded text-sm border transition-colors",style:{borderColor:r.border,color:r.textSecondary},onMouseEnter:e=>{e.currentTarget.style.background="#a855f710",e.currentTarget.style.borderColor="#a855f7",e.currentTarget.style.color="#a855f7"},onMouseLeave:e=>{e.currentTarget.style.background="transparent",e.currentTarget.style.borderColor=r.border,e.currentTarget.style.color=r.textSecondary},children:[t.jsx(x,{size:16}),"Add Tool"]})]}),o.show&&t.jsxs("div",{className:"p-4 rounded-lg border space-y-3",style:{background:r.surfaceElevated,borderColor:r.border},children:[t.jsx("input",{type:"text",placeholder:"Tool name",value:o.name,onChange:e=>a(s=>({...s,name:e.target.value})),className:"w-full px-3 py-2 rounded text-sm border",style:{background:r.surface,borderColor:r.border,color:r.textPrimary}}),t.jsx("input",{type:"text",placeholder:"Shell command (e.g. git status)",value:o.command,onChange:e=>a(s=>({...s,command:e.target.value})),className:"w-full px-3 py-2 rounded text-sm border font-mono",style:{background:r.surface,borderColor:r.border,color:r.textPrimary}}),t.jsx("input",{type:"text",placeholder:"Description (optional)",value:o.description,onChange:e=>a(s=>({...s,description:e.target.value})),className:"w-full px-3 py-2 rounded text-sm border",style:{background:r.surface,borderColor:r.border,color:r.textPrimary}}),t.jsxs("div",{className:"flex gap-2 justify-end",children:[t.jsx("button",{type:"button",onClick:()=>a({show:!1,name:"",command:"",description:""}),className:"px-3 py-1.5 rounded text-sm border",style:{borderColor:r.border,color:r.textSecondary,background:"transparent"},children:"Cancel"}),t.jsx("button",{type:"button",onClick:O,disabled:!o.name.trim()||!o.command.trim(),className:"px-3 py-1.5 rounded text-sm",style:{background:"#a855f7",color:"#fff",border:"none",cursor:"pointer",opacity:!o.name.trim()||!o.command.trim()?.5:1},children:"Save"})]})]}),g.length===0&&!o.show?t.jsxs("div",{className:"text-center py-8 rounded-lg border-2 border-dashed",style:{borderColor:r.border},children:[t.jsx(R,{size:32,className:"mx-auto mb-3",style:{color:r.textFaint}}),t.jsx("p",{className:"text-sm font-medium mb-1",style:{color:r.textPrimary},children:"No CLI Tools"}),t.jsx("p",{className:"text-xs mb-4",style:{color:r.textSecondary},children:"Define shell commands your agent can invoke directly."}),t.jsx("button",{type:"button",onClick:()=>a(e=>({...e,show:!0})),title:"Add a CLI tool",className:"px-4 py-2 rounded text-sm transition-colors",style:{background:"#a855f7",color:"#fff",border:"none",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.background="#9333ea"},onMouseLeave:e=>{e.currentTarget.style.background="#a855f7"},children:"Add CLI Tool"})]}):t.jsx("div",{className:"space-y-3",children:g.map(e=>t.jsx(Q,{tool:e},e.id))})]})]})]})}export{je as ToolsTab};
@@ -0,0 +1 @@
1
+ import{r as d}from"./vendor-D1h_O76p.js";const k=(...t)=>t.filter((e,c,o)=>!!e&&e.trim()!==""&&o.indexOf(e)===c).join(" ").trim();const M=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const _=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,c,o)=>o?o.toUpperCase():c.toLowerCase());const s=t=>{const e=_(t);return e.charAt(0).toUpperCase()+e.slice(1)};var v={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const x=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};const m=d.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:c=2,absoluteStrokeWidth:o,className:y="",children:h,iconNode:p,...n},i)=>d.createElement("svg",{ref:i,...v,width:e,height:e,stroke:t,strokeWidth:o?Number(c)*24/Number(e):c,className:k("lucide",y),...!h&&!x(n)&&{"aria-hidden":"true"},...n},[...p.map(([r,l])=>d.createElement(r,l)),...Array.isArray(h)?h:[h]]));const a=(t,e)=>{const c=d.forwardRef(({className:o,...y},h)=>d.createElement(m,{ref:h,iconNode:e,className:k(`lucide-${M(s(t))}`,`lucide-${t}`,o),...y}));return c.displayName=s(t),c};const g=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],D2=a("activity",g);const N=[["path",{d:"M12 6v16",key:"nqf5sj"}],["path",{d:"m19 13 2-1a9 9 0 0 1-18 0l2 1",key:"y7qv08"}],["path",{d:"M9 11h6",key:"1fldmi"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}]],T2=a("anchor",N);const $=[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]],G2=a("arrow-down-right",$);const w=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],W2=a("arrow-left",w);const f=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],E2=a("arrow-up-down",f);const u=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]];a("arrow-up-right",u);const z=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],F2=a("award",z);const b=[["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M3.4 18H12a8 8 0 0 0 8-8V7a4 4 0 0 0-7.28-2.3L2 20",key:"oj1oa8"}],["path",{d:"m20 7 2 .5-2 .5",key:"12nv4d"}],["path",{d:"M10 18v3",key:"1yea0a"}],["path",{d:"M14 17.75V21",key:"1pymcb"}],["path",{d:"M7 18a6 6 0 0 0 3.84-10.61",key:"1npnn0"}]],R2=a("bird",b);const j=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],U2=a("book-open",j);const q=[["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"}]],O2=a("bot",q);const C=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],I2=a("box",C);const V=[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]];a("braces",V);const A=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],K2=a("brain",A);const H=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],X2=a("bug",H);const L=[["path",{d:"M12 5c.67 0 1.35.09 2 .26 1.78-2 5.03-2.84 6.42-2.26 1.4.58-.42 7-.42 7 .57 1.07 1 2.24 1 3.44C21 17.9 16.97 21 12 21s-9-3-9-7.56c0-1.25.5-2.4 1-3.44 0 0-1.89-6.42-.5-7 1.39-.58 4.72.23 6.5 2.23A9.04 9.04 0 0 1 12 5Z",key:"x6xyqk"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M11.25 16.25h1.5L12 17l-.75-.75Z",key:"12kq1m"}]],J2=a("cat",L);const S=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Q2=a("chart-column",S);const P=[["path",{d:"M5 21v-6",key:"1hz6c0"}],["path",{d:"M12 21V3",key:"1lcnhd"}],["path",{d:"M19 21V9",key:"unv183"}]],Y2=a("chart-no-axes-column",P);const Z=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],a0=a("check",Z);const B=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],e0=a("chevron-down",B);const D=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],t0=a("chevron-left",D);const T=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],c0=a("chevron-right",T);const G=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],o0=a("chevron-up",G);const W=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],h0=a("circle-alert",W);const E=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],d0=a("circle-check-big",E);const F=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],y0=a("circle-check",F);const R=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],n0=a("circle-x",R);const U=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],s0=a("circle",U);const O=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],k0=a("clipboard-list",O);const I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],p0=a("clock",I);const K=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],i0=a("cloud",K);const X=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],r0=a("code",X);const J=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}]],l0=a("compass",J);const Q=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],M0=a("copy",Q);const Y=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],_0=a("cpu",Y);const a1=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],v0=a("database",a1);const e1=[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]],x0=a("dog",e1);const t1=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],m0=a("dollar-sign",t1);const c1=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],g0=a("download",c1);const o1=[["path",{d:"M10 11h.01",key:"d2at3l"}],["path",{d:"M14 6h.01",key:"k028ub"}],["path",{d:"M18 6h.01",key:"1v4wsw"}],["path",{d:"M6.5 13.1h.01",key:"1748ia"}],["path",{d:"M22 5c0 9-4 12-6 12s-6-3-6-12c0-2 2-3 6-3s6 1 6 3",key:"172yzv"}],["path",{d:"M17.4 9.9c-.8.8-2 .8-2.8 0",key:"1obv0w"}],["path",{d:"M10.1 7.1C9 7.2 7.7 7.7 6 8.6c-3.5 2-4.7 3.9-3.7 5.6 4.5 7.8 9.5 8.4 11.2 7.4.9-.5 1.9-2.1 1.9-4.7",key:"rqjl8i"}],["path",{d:"M9.1 16.5c.3-1.1 1.4-1.7 2.4-1.4",key:"1mr6wy"}]],N0=a("drama",o1);const h1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],$0=a("external-link",h1);const d1=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],w0=a("eye-off",d1);const y1=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],f0=a("eye",y1);const n1=[["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"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]],u0=a("file-code",n1);const s1=[["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"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],z0=a("file-text",s1);const k1=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],b0=a("files",k1);const p1=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],j0=a("flame",p1);const i1=[["path",{d:"M18 19a5 5 0 0 1-5-5v8",key:"sz5oeg"}],["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],q0=a("folder-git-2",i1);const r1=[["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"}]],C0=a("folder-open",r1);const l1=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],V0=a("folder",l1);const M1=[["path",{d:"M10.5 3 8 9l4 13 4-13-2.5-6",key:"b3dvk1"}],["path",{d:"M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z",key:"7w4byz"}],["path",{d:"M2 9h20",key:"16fsjt"}]],A0=a("gem",M1);const _1=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],H0=a("git-branch",_1);const v1=[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M13 6h3a2 2 0 0 1 2 2v7",key:"1yeb86"}],["path",{d:"M11 18H8a2 2 0 0 1-2-2V9",key:"19pyzm"}]],L0=a("git-compare",v1);const x1=[["circle",{cx:"12",cy:"18",r:"3",key:"1mpf1b"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["path",{d:"M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9",key:"1uq4wg"}],["path",{d:"M12 12v3",key:"158kv8"}]];a("git-fork",x1);const m1=[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]],S0=a("github",m1);const g1=[["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"}]],P0=a("globe",g1);const N1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Z0=a("grid-3x3",N1);const $1=[["path",{d:"M10 16h.01",key:"1bzywj"}],["path",{d:"M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"18tbho"}],["path",{d:"M21.946 12.013H2.054",key:"zqlbp7"}],["path",{d:"M6 16h.01",key:"1pmjb7"}]],B0=a("hard-drive",$1);const w1=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],D0=a("hash",w1);const f1=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],T0=a("heart",f1);const u1=[["path",{d:"M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z",key:"yt0hxn"}]],G0=a("hexagon",u1);const z1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],W0=a("image",z1);const b1=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],E0=a("info",b1);const j1=[["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"}]],F0=a("key",j1);const q1=[["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"}]],R0=a("layers",q1);const C1=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],U0=a("layout-grid",C1);const V1=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],O0=a("library",V1);const A1=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],I0=a("lightbulb",A1);const H1=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],K0=a("link",H1);const L1=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],X0=a("loader-circle",L1);const S1=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],J0=a("loader",S1);const P1=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Q0=a("lock",P1);const Z1=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Y0=a("mail",Z1);const B1=[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]],aa=a("map",B1);const D1=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],ea=a("maximize-2",D1);const T1=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],ta=a("message-circle",T1);const G1=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],ca=a("message-square",G1);const W1=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],oa=a("mic",W1);const E1=[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]],ha=a("microscope",E1);const F1=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],da=a("minimize-2",F1);const R1=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],ya=a("monitor",R1);const U1=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],na=a("moon",U1);const O1=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],sa=a("network",O1);const I1=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],ka=a("package",I1);const K1=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],pa=a("palette",K1);const X1=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M9 21V9",key:"1oto5p"}]],ia=a("panels-top-left",X1);const J1=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],ra=a("pen-tool",J1);const Q1=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],la=a("pencil",Q1);const Y1=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Ma=a("play",Y1);const a2=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],_a=a("plug-zap",a2);const e2=[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]],va=a("plug",e2);const t2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],xa=a("plus",t2);const c2=[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]],ma=a("presentation",c2);const o2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],ga=a("refresh-cw",o2);const h2=[["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"}]],Na=a("rocket",h2);const d2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],$a=a("rotate-ccw",d2);const y2=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],wa=a("save",y2);const n2=[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]],fa=a("scale",n2);const s2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ua=a("search",s2);const k2=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],za=a("send",k2);const p2=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],ba=a("server",p2);const i2=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],ja=a("settings",i2);const r2=[["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"}]],qa=a("shield-check",r2);const l2=[["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"}]],Ca=a("shield",l2);const M2=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Va=a("sparkles",M2);const _2=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Aa=a("square-check-big",_2);const v2=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ha=a("square",v2);const x2=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],La=a("star",x2);const m2=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Sa=a("sun",m2);const g2=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]];a("table-2",g2);const N2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Pa=a("target",N2);const $2=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Za=a("terminal",$2);const w2=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ba=a("trash-2",w2);const f2=[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]],Da=a("trending-down",f2);const u2=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ta=a("triangle-alert",u2);const z2=[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]],Ga=a("triangle",z2);const b2=[["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"}]],Wa=a("upload",b2);const j2=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Ea=a("user",j2);const q2=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],Fa=a("users",q2);const C2=[["path",{d:"M2 6c.6.5 1.2 1 2.5 1C7 7 7 5 9.5 5c2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"knzxuh"}],["path",{d:"M2 12c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"2jd2cc"}],["path",{d:"M2 18c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 2.6 0 2.4 2 5 2 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"rd2r6e"}]],Ra=a("waves",C2);const V2=[["path",{d:"m10.586 5.414-5.172 5.172",key:"4mc350"}],["path",{d:"m18.586 13.414-5.172 5.172",key:"8c96vv"}],["path",{d:"M6 12h12",key:"8npq4p"}],["circle",{cx:"12",cy:"20",r:"2",key:"144qzu"}],["circle",{cx:"12",cy:"4",r:"2",key:"muu5ef"}],["circle",{cx:"20",cy:"12",r:"2",key:"1xzzfp"}],["circle",{cx:"4",cy:"12",r:"2",key:"1hvhnz"}]],Ua=a("waypoints",V2);const A2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],Oa=a("wifi-off",A2);const H2=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],Ia=a("wifi",H2);const L2=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Ka=a("workflow",L2);const S2=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],Xa=a("wrench",S2);const P2=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ja=a("x",P2);const Z2=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],Qa=a("zap",Z2);export{$0 as $,W2 as A,K2 as B,c0 as C,v0 as D,Q2 as E,V0 as F,L0 as G,B0 as H,W0 as I,r0 as J,i0 as K,oa as L,na as M,ma as N,va as O,Ma as P,X0 as Q,$a as R,ja as S,Pa as T,Wa as U,a0 as V,Xa as W,Ja as X,o0 as Y,Qa as Z,Za as _,e0 as a,T0 as a$,g0 as a0,xa as a1,F0 as a2,d0 as a3,n0 as a4,ya as a5,Ua as a6,G2 as a7,da as a8,Z0 as a9,za as aA,Fa as aB,C0 as aC,u0 as aD,fa as aE,D2 as aF,qa as aG,y0 as aH,S0 as aI,q0 as aJ,ga as aK,b0 as aL,sa as aM,O0 as aN,Oa as aO,Ia as aP,J0 as aQ,wa as aR,s0 as aS,ha as aT,N0 as aU,La as aV,A0 as aW,R2 as aX,X2 as aY,J2 as aZ,x0 as a_,_a as aa,w0 as ab,f0 as ac,Ba as ad,ba as ae,R0 as af,I0 as ag,U0 as ah,ka as ai,M0 as aj,O2 as ak,E2 as al,Na as am,p0 as an,Ta as ao,K0 as ap,Q0 as aq,Y2 as ar,ta as as,Aa as at,F2 as au,t0 as av,E0 as aw,h0 as ax,ea as ay,ca as az,Sa as b,Ea as b0,la as b1,m0 as b2,Da as b3,Ha as c,Ca as d,k0 as e,P0 as f,j0 as g,z0 as h,H0 as i,D0 as j,Y0 as k,ra as l,Ga as m,_0 as n,ia as o,I2 as p,Ra as q,l0 as r,Va as s,aa as t,Ka as u,G0 as v,U2 as w,ua as x,pa as y,T2 as z};