@hyperflow.fun/ghost 0.0.7 → 0.0.8

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 (86) hide show
  1. package/README.md +11 -9
  2. package/dist/index.js +79692 -44661
  3. package/dist/package.json +1 -1
  4. package/dist/templates/SOUL.md +8 -0
  5. package/dist/web/dist/assets/{Chart-234Kdnfi.js → Chart-DpKu5h2M.js} +1 -1
  6. package/dist/web/dist/assets/{Config-BYGKgURp.js → Config-gzLZUKBZ.js} +1 -1
  7. package/dist/web/dist/assets/{Cost-BQAkdVIa.js → Cost-BVMipOkN.js} +1 -1
  8. package/dist/web/dist/assets/{Cron-D5wFcTwJ.js → Cron-C9SB1S0l.js} +1 -1
  9. package/dist/web/dist/assets/{Dashboard-BdZ2aC9H.js → Dashboard-BG-glqRY.js} +1 -1
  10. package/dist/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  11. package/dist/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  12. package/dist/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  13. package/dist/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  14. package/dist/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  15. package/dist/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  16. package/dist/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  17. package/dist/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  18. package/dist/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  19. package/dist/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  20. package/dist/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  21. package/dist/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  22. package/dist/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  23. package/dist/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  24. package/dist/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  25. package/dist/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  26. package/dist/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  27. package/dist/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  28. package/dist/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  29. package/dist/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  30. package/dist/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  31. package/dist/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  32. package/dist/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  33. package/dist/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  34. package/dist/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  35. package/dist/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  36. package/dist/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  37. package/dist/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  38. package/dist/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  39. package/dist/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  40. package/dist/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  41. package/dist/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  42. package/dist/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  43. package/dist/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  44. package/dist/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  45. package/dist/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  46. package/dist/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  47. package/dist/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  48. package/dist/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  49. package/dist/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  50. package/dist/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  51. package/dist/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  52. package/dist/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  53. package/dist/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  54. package/dist/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  55. package/dist/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  56. package/dist/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  57. package/dist/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  58. package/dist/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  59. package/dist/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  60. package/dist/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  61. package/dist/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  62. package/dist/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  63. package/dist/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  64. package/dist/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  65. package/dist/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  66. package/dist/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  67. package/dist/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  68. package/dist/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  69. package/dist/web/dist/assets/{Logs-D47Y9BIl.js → Logs-C6SDjLaq.js} +1 -1
  70. package/dist/web/dist/assets/{Memory-BexXuxoQ.js → Memory-c_I-OUzC.js} +1 -1
  71. package/dist/web/dist/assets/{Sessions-D3walnqk.js → Sessions-3ZsT5zN5.js} +1 -1
  72. package/dist/web/dist/assets/{Skills-pAthDu4_.js → Skills-osDspDnu.js} +1 -1
  73. package/dist/web/dist/assets/{Tools-BFHGHPXB.js → Tools-BmiDKDjv.js} +1 -1
  74. package/dist/web/dist/assets/{activity-DoII5Fp-.js → activity-Dhq3V6kN.js} +1 -1
  75. package/dist/web/dist/assets/{clock-RU3zeFmt.js → clock-dqJWkiuE.js} +1 -1
  76. package/dist/web/dist/assets/{highlighted-body-OFNGDK62-y6A7wCrG.js → highlighted-body-OFNGDK62-BxVZVvj8.js} +1 -1
  77. package/dist/web/dist/assets/index-C9j7T7rz.css +1 -0
  78. package/dist/web/dist/assets/index-Du3VgAo4.js +57 -0
  79. package/dist/web/dist/assets/mermaid-GHXKKRXX-CNibSrez.js +550 -0
  80. package/dist/web/dist/assets/mermaid-GHXKKRXX-Ds5qNABy.css +1 -0
  81. package/dist/web/dist/assets/{refresh-cw-BYmwU45d.js → refresh-cw-BoPT0lMd.js} +1 -1
  82. package/dist/web/dist/index.html +2 -2
  83. package/package.json +6 -1
  84. package/dist/web/dist/assets/index-BcTR6SiD.js +0 -59
  85. package/dist/web/dist/assets/index-PX2emSv9.css +0 -1
  86. package/dist/web/dist/assets/mermaid-GHXKKRXX-DC3T5XzO.js +0 -282
package/dist/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@hyperflow.fun/ghost",
3
- "version": "0.0.7"
3
+ "version": "0.0.8"
4
4
  }
@@ -62,6 +62,14 @@ Rules:
62
62
  4. Wrap conclusion/opinion in `<verdict>` tag
63
63
  5. Every key metric (price, percentage, PnL) must use appropriate tag regardless of context
64
64
 
65
+ ## Math and Formulas
66
+
67
+ When you need to show a formula (RSI, Kelly criterion, EMA smoothing, etc.):
68
+
69
+ - **Block formulas: use `$$ ... $$`.** Reserve for multi-symbol expressions where typeset rendering helps comprehension (Kelly, volatility, MACD definition).
70
+ - **Inline math: use `$ x $`.** Renders typeset inline — works inside table cells, captions, and flowing prose. Examples: `$R_p$`, `$\sigma_p$`, `$R_p - R_f$`.
71
+ - **Don't use `\[ ... \]` or `\( ... \)` (LaTeX-escape delimiters).** The renderer normalises them but `\[ ... \]` introduces extra line breaks. Use `$$ ... $$` and `$ ... $` directly.
72
+
65
73
  ## Core Rules
66
74
 
67
75
  1. **Converse before acting** — Engage in natural back-and-forth dialogue. Ask clarifying questions when info is missing. Never dump everything in one response.
@@ -1 +1 @@
1
- import{u as d,r as h,j as s}from"./vendor-react-B0mWfPOm.js";import{a as u,C as g}from"./index-BcTR6SiD.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";function _(){const[e]=d(),a=e.get("symbol")??"",t=e.get("interval")??"4h",i=e.get("indicators")??void 0,m=e.get("levels")??void 0,o=e.get("headless")==="1",{loading:n,error:c}=u(a||"__missing__",t,i),r=a.length>0;h.useEffect(()=>{if(!r||c){window.__chartReady=!0;return}n||requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.__chartReady=!0})})},[n,c,r]);const l=o?"chart-page chart-page--headless":"chart-page";return r?s.jsx("div",{className:l,children:s.jsx(g,{symbol:a,interval:t,indicators:i,levels:m,headless:o})}):s.jsx("div",{className:l,children:s.jsx("p",{className:"chart-error",children:"symbol required"})})}export{_ as default};
1
+ import{u as d,r as h,j as s}from"./vendor-react-B0mWfPOm.js";import{a as u,C as g}from"./index-Du3VgAo4.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";function _(){const[e]=d(),a=e.get("symbol")??"",t=e.get("interval")??"4h",i=e.get("indicators")??void 0,m=e.get("levels")??void 0,o=e.get("headless")==="1",{loading:n,error:c}=u(a||"__missing__",t,i),r=a.length>0;h.useEffect(()=>{if(!r||c){window.__chartReady=!0;return}n||requestAnimationFrame(()=>{requestAnimationFrame(()=>{window.__chartReady=!0})})},[n,c,r]);const l=o?"chart-page chart-page--headless":"chart-page";return r?s.jsx("div",{className:l,children:s.jsx(g,{symbol:a,interval:t,indicators:i,levels:m,headless:o})}):s.jsx("div",{className:l,children:s.jsx("p",{className:"chart-error",children:"symbol required"})})}export{_ as default};
@@ -1 +1 @@
1
- import{j as e}from"./vendor-react-B0mWfPOm.js";import{S as t}from"./index-BcTR6SiD.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";function o(){return e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t,{className:"h-5 w-5 text-blue-400"}),e.jsx("h2",{className:"text-body-sm-medium text-white",children:"Configuration"})]}),e.jsxs("div",{className:"bg-gray-900 rounded-[4px] border border-gray-800 p-8 text-center",children:[e.jsx(t,{className:"h-12 w-12 text-gray-600 mx-auto mb-4"}),e.jsx("p",{className:"text-label-lg text-gray-400",children:"Coming Soon"}),e.jsx("p",{className:"text-caption text-gray-500 mt-2",children:"Configuration management via WebSocket is not yet available. Edit your config file directly or use the CLI."})]})]})}export{o as default};
1
+ import{j as e}from"./vendor-react-B0mWfPOm.js";import{S as t}from"./index-Du3VgAo4.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";function o(){return e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(t,{className:"h-5 w-5 text-blue-400"}),e.jsx("h2",{className:"text-body-sm-medium text-white",children:"Configuration"})]}),e.jsxs("div",{className:"bg-gray-900 rounded-[4px] border border-gray-800 p-8 text-center",children:[e.jsx(t,{className:"h-12 w-12 text-gray-600 mx-auto mb-4"}),e.jsx("p",{className:"text-label-lg text-gray-400",children:"Coming Soon"}),e.jsx("p",{className:"text-caption text-gray-500 mt-2",children:"Configuration management via WebSocket is not yet available. Edit your config file directly or use the CLI."})]})]})}export{o as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./vendor-react-B0mWfPOm.js";import{c as s}from"./index-BcTR6SiD.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
1
+ import{j as e}from"./vendor-react-B0mWfPOm.js";import{c as s}from"./index-Du3VgAo4.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as s,j as e}from"./vendor-react-B0mWfPOm.js";import{c as u,u as J,P as q,X as I,b as X}from"./index-BcTR6SiD.js";import{C as k}from"./clock-RU3zeFmt.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
1
+ import{r as s,j as e}from"./vendor-react-B0mWfPOm.js";import{c as u,u as J,P as q,X as I,b as X}from"./index-Du3VgAo4.js";import{C as k}from"./clock-dqJWkiuE.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as l,j as e}from"./vendor-react-B0mWfPOm.js";import{c as d,u as x}from"./index-BcTR6SiD.js";import{C as p}from"./clock-RU3zeFmt.js";import{A as m}from"./activity-DoII5Fp-.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
1
+ import{r as l,j as e}from"./vendor-react-B0mWfPOm.js";import{c as d,u as x}from"./index-Du3VgAo4.js";import{C as p}from"./clock-dqJWkiuE.js";import{A as m}from"./activity-Dhq3V6kN.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r,j as e}from"./vendor-react-B0mWfPOm.js";import{c as x,u as C}from"./index-BcTR6SiD.js";import{A as w}from"./activity-DoII5Fp-.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
1
+ import{r,j as e}from"./vendor-react-B0mWfPOm.js";import{c as x,u as C}from"./index-Du3VgAo4.js";import{A as w}from"./activity-Dhq3V6kN.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as t,j as e}from"./vendor-react-B0mWfPOm.js";import{c as h,u as j,b as w}from"./index-BcTR6SiD.js";import{R as N}from"./refresh-cw-BYmwU45d.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
1
+ import{r as t,j as e}from"./vendor-react-B0mWfPOm.js";import{c as h,u as j,b as w}from"./index-Du3VgAo4.js";import{R as N}from"./refresh-cw-BoPT0lMd.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{r as a,j as e}from"./vendor-react-B0mWfPOm.js";import{c as j,u as C,X as E,b as M}from"./index-BcTR6SiD.js";import{R as D}from"./refresh-cw-BYmwU45d.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
1
+ import{r as a,j as e}from"./vendor-react-B0mWfPOm.js";import{c as j,u as C,X as E,b as M}from"./index-Du3VgAo4.js";import{R as D}from"./refresh-cw-BoPT0lMd.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{r as o,j as e}from"./vendor-react-B0mWfPOm.js";import{T as C,u as D}from"./index-BcTR6SiD.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";function E({onClose:t,onUploaded:c}){const[v,i]=o.useState(!1),[x,p]=o.useState(null),[y,u]=o.useState(!1),m=o.useRef(null),f=async(r,l=!1)=>{var b,g,N,w;i(!0),p(null);try{const n=new FormData;n.append("file",r),l&&n.append("overwrite","true");const s=await(await fetch("/skills/upload",{method:"POST",body:n})).json();if(s.ok)t(),c();else if(s.conflict){const h=((N=(g=(b=s.errors)==null?void 0:b[0])==null?void 0:g.match(/"(.+?)"/))==null?void 0:N[1])??"unknown";confirm(`Skill "${h}" already exists. Overwrite?`)&&await f(r,!0)}else p(((w=s.errors)==null?void 0:w.join(", "))??"Upload failed")}catch(n){p(n instanceof Error?n.message:"Upload failed")}finally{i(!1)}},S=r=>{var b;const l=(b=r.target.files)==null?void 0:b[0];l&&f(l),r.target.value=""},j=r=>{r.preventDefault(),u(!1);const l=r.dataTransfer.files[0];l&&f(l)},k=y?"border-[rgba(59,247,191,0.4)]":"border-[var(--color-border-default)] hover:border-[rgba(59,247,191,0.4)] focus-visible:border-[rgba(59,247,191,0.4)]";return e.jsxs(C,{open:!0,title:"Upload Skill",onClose:()=>{t(),p(null)},width:600,children:[e.jsxs("div",{onDrop:j,onDragOver:r=>r.preventDefault(),onClick:()=>{var r;return(r=m.current)==null?void 0:r.click()},onDragEnter:()=>u(!0),onDragLeave:()=>u(!1),className:`border-2 border-dashed rounded-[4px] p-8 text-center cursor-pointer transition-[border-color] duration-fast ease-out ${k}`,children:[e.jsx("div",{className:"text-[24px] text-[var(--color-text-secondary)] mb-3",children:"↑"}),e.jsx("p",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"Drag & drop a skill file, or click to browse"}),e.jsx("p",{className:"text-caption text-[var(--color-text-secondary)] mt-2",children:"Accepts .md (single SKILL.md) or .skill/.zip (skill archive)"})]}),e.jsx("input",{ref:m,type:"file",accept:".md,.skill,.zip",onChange:S,className:"hidden"}),v&&e.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[e.jsx("div",{"data-spinning":!0,className:"w-2 h-2 rounded-full border-2 border-[var(--color-brand-default)] border-t-transparent",style:{animation:"spin 0.8s linear infinite"}}),e.jsx("span",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"Uploading…"})]}),x&&e.jsx("div",{className:"mt-4 p-3 bg-[var(--color-error-subtle)] border border-[rgba(239,68,68,0.4)] rounded-[4px] text-[var(--color-error-text)] text-body-sm",children:x})]})}function U({skill:t,isExpanded:c,onToggleExpanded:v,onToggleEnabled:i,deleteConfirm:x,onRequestDelete:p,onCancelDelete:y,onConfirmDelete:u}){return e.jsxs("div",{className:"bg-[var(--color-surface-base)] border border-[var(--color-border-default)] rounded-[2px] overflow-hidden",children:[e.jsxs("button",{type:"button",className:"block p-4 cursor-pointer bg-transparent border-0 w-full text-left hover:bg-white/[0.02] focus-visible:bg-white/[0.02] transition-colors duration-fast ease-out",onClick:v,"aria-expanded":c,children:[e.jsxs("span",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[t.emoji?e.jsx("span",{className:"text-label-lg flex-shrink-0",children:t.emoji}):e.jsx("span",{className:"text-body-sm text-[#00ff88] flex-shrink-0 mt-0.5",children:"◈"}),e.jsx("span",{className:"text-body-lg-semibold text-[var(--color-text-primary)] overflow-hidden text-ellipsis whitespace-nowrap",children:t.name})]}),e.jsxs("span",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("span",{className:t.source==="builtin"?"text-caption px-1.5 py-0.5 rounded bg-[rgba(127,143,158,0.15)] text-[var(--color-text-secondary)] flex-shrink-0":"text-caption px-1.5 py-0.5 rounded bg-[rgba(0,255,136,0.1)] text-[#00ff88] flex-shrink-0",children:t.source==="builtin"?"builtin":"user"}),e.jsx("span",{className:"text-label-lg text-[var(--color-text-secondary)] flex-shrink-0 mt-0.5 transition-colors duration-fast ease-out",children:c?"▾":"▸"})]})]}),e.jsx("span",{className:c?"block text-body-sm text-[var(--color-text-secondary)] mt-2.5":"block text-body-sm text-[var(--color-text-secondary)] mt-2.5 overflow-hidden [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]",children:t.description})]}),c&&e.jsxs("div",{className:"border-t border-[var(--color-border-default)] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-caption text-[var(--color-text-secondary)] leading-[1.8]",children:[e.jsx("span",{className:"text-[var(--color-text-secondary)] min-w-[80px]",children:"source"}),e.jsx("span",{className:t.source==="builtin"?"text-[var(--color-text-primary)]":"text-[#00ff88]",children:t.source})]}),e.jsxs("div",{className:"flex items-center gap-2 text-caption text-[var(--color-text-secondary)] leading-[1.8]",children:[e.jsx("span",{className:"text-[var(--color-text-secondary)] min-w-[80px]",children:"available"}),e.jsx("span",{className:t.available?"text-[#00ff88]":"text-[#febc2e]",children:t.available?"yes":"no"})]}),t.always!==void 0&&e.jsxs("div",{className:"flex items-center gap-2 text-caption text-[var(--color-text-secondary)] leading-[1.8]",children:[e.jsx("span",{className:"text-[var(--color-text-secondary)] min-w-[80px]",children:"always-on"}),e.jsx("span",{className:t.always?"text-[#00ff88]":"text-[var(--color-text-primary)]",children:t.always?"yes":"no"})]}),!t.available&&t.missing&&t.missing.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-caption text-[var(--color-text-secondary)] leading-[1.8]",children:[e.jsx("span",{className:"text-[var(--color-text-secondary)] min-w-[80px]",children:"missing"}),e.jsx("span",{className:"text-[#febc2e]",children:t.missing.join(", ")})]})]}),e.jsxs("div",{className:"border-t border-[var(--color-border-default)] px-4 py-2.5 flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:m=>i(m.target.checked),"aria-label":`${t.enabled?"Disable":"Enable"} skill ${t.name}`,className:"absolute opacity-0 w-0 h-0"}),e.jsx("div",{className:t.enabled?"w-9 h-5 rounded-full relative transition-colors duration-fast ease-out bg-[rgba(0,255,136,0.3)]":"w-9 h-5 rounded-full relative transition-colors duration-fast ease-out bg-border"}),e.jsx("div",{className:t.enabled?"absolute top-0.5 w-4 h-4 rounded-full bg-[#00ff88] transition-[left] duration-fast ease-out left-[18px]":"absolute top-0.5 w-4 h-4 rounded-full bg-[var(--color-text-secondary)] transition-[left] duration-fast ease-out left-0.5"})]}),e.jsx("span",{className:"text-caption text-[var(--color-text-secondary)]",children:t.enabled?"Enabled":"Disabled"})]}),t.source==="workspace"&&e.jsx(e.Fragment,{children:x?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-caption text-[#ff5555]",children:"Delete?"}),e.jsx("button",{onClick:u,className:"bg-transparent border-0 text-[#ff5555] hover:text-[#ff8888] focus-visible:text-[#ff8888] text-caption cursor-pointer px-1 py-0.5 transition-colors duration-fast ease-out",children:"Yes"}),e.jsx("button",{onClick:y,className:"bg-transparent border-0 text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:text-[var(--color-text-primary)] text-caption cursor-pointer px-1 py-0.5 transition-colors duration-fast ease-out",children:"No"})]}):e.jsx("button",{onClick:p,"aria-label":`Delete skill ${t.name}`,title:`Delete skill ${t.name}`,className:"bg-transparent border-0 text-[var(--color-text-secondary)] hover:text-[#ff5555] focus-visible:text-[#ff5555] text-label-lg cursor-pointer px-1 py-0.5 transition-colors duration-fast ease-out",children:"✕"})})]})]})}function R(){const{request:t,connected:c}=D(),[v,i]=o.useState([]),[x,p]=o.useState(""),[y,u]=o.useState(!0),[m,f]=o.useState(null),[S,j]=o.useState(!1),[k,r]=o.useState(null),[l,b]=o.useState(null),g=o.useCallback(()=>{c&&t("skills.list").then(a=>{i(a.skills),f(null)}).catch(a=>f(a instanceof Error?a.message:"Failed to load skills")).finally(()=>u(!1))},[c,t]);o.useEffect(()=>{g()},[g]);const N=async(a,s)=>{i(h=>h.map(d=>d.name===a?{...d,enabled:s}:d));try{await t("skills.toggle",{name:a,enabled:s})}catch{i(h=>h.map(d=>d.name===a?{...d,enabled:!s}:d))}},w=async a=>{try{const s=await t("skills.delete",{name:a});s.ok?i(h=>h.filter(d=>d.name!==a)):f(s.error??"Failed to delete skill")}catch(s){f(s instanceof Error?s.message:"Failed to delete skill")}r(null)},n=v.filter(a=>a.name.toLowerCase().includes(x.toLowerCase())||a.description.toLowerCase().includes(x.toLowerCase()));return m&&v.length===0?e.jsx("div",{className:"p-6 flex flex-col gap-6 bg-[var(--color-surface-canvas)] h-full overflow-y-auto box-border",children:e.jsxs("div",{className:"p-4 bg-[rgba(255,85,85,0.06)] border border-[rgba(255,85,85,0.3)] rounded-[4px] text-[#ff5555] text-body-sm",children:["Failed to load skills: ",m]})}):y?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("span",{className:"text-[#00ff88] text-body-sm",children:"Loading…"})}):e.jsxs("div",{className:"p-6 flex flex-col gap-6 bg-[var(--color-surface-canvas)] h-full overflow-y-auto box-border",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"relative max-w-[400px] flex-1",children:[e.jsx("label",{htmlFor:"skills-search-input",className:"sr-only",children:"Search skills"}),e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-body-sm text-[var(--color-text-secondary)] pointer-events-none",children:"⌕"}),e.jsx("input",{id:"skills-search-input",type:"search",value:x,onChange:a=>p(a.target.value),placeholder:"Search skills…",spellCheck:!1,className:"w-full bg-surface-canvas border border-[var(--color-border-default)] focus:border-[rgba(0,255,136,0.4)] rounded-[4px] pl-8 pr-3.5 py-2.5 text-body-sm text-[var(--color-text-primary)] outline-none transition-colors duration-fast ease-out box-border"})]}),e.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-2 bg-[rgba(0,255,136,0.1)] hover:bg-[rgba(0,255,136,0.18)] focus-visible:bg-[rgba(0,255,136,0.18)] border border-[rgba(0,255,136,0.3)] hover:border-[rgba(0,255,136,0.5)] focus-visible:border-[rgba(0,255,136,0.5)] rounded-[4px] px-5 py-2.5 text-[#00ff88] text-body-sm-medium cursor-pointer transition-colors duration-fast ease-out",children:["+"," Upload Skill"]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("span",{className:"text-label-lg text-[#00ff88]",children:"⧈"}),e.jsxs("span",{className:"text-body-sm-medium text-[var(--color-text-primary)]",children:["Skills (",n.length,")"]})]}),n.length===0?e.jsx("p",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"No skills match your search."}):e.jsx("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(380px,1fr))]",children:n.map(a=>e.jsx(U,{skill:a,isExpanded:l===a.name,onToggleExpanded:()=>b(l===a.name?null:a.name),onToggleEnabled:s=>N(a.name,s),deleteConfirm:k===a.name,onRequestDelete:()=>r(a.name),onCancelDelete:()=>r(null),onConfirmDelete:()=>w(a.name)},a.name))})]}),S&&e.jsx(E,{onClose:()=>j(!1),onUploaded:g})]})}export{R as default};
1
+ import{r as o,j as e}from"./vendor-react-B0mWfPOm.js";import{T as C,u as D}from"./index-Du3VgAo4.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";function E({onClose:t,onUploaded:c}){const[v,i]=o.useState(!1),[x,p]=o.useState(null),[y,u]=o.useState(!1),m=o.useRef(null),f=async(r,l=!1)=>{var b,g,N,w;i(!0),p(null);try{const n=new FormData;n.append("file",r),l&&n.append("overwrite","true");const s=await(await fetch("/skills/upload",{method:"POST",body:n})).json();if(s.ok)t(),c();else if(s.conflict){const h=((N=(g=(b=s.errors)==null?void 0:b[0])==null?void 0:g.match(/"(.+?)"/))==null?void 0:N[1])??"unknown";confirm(`Skill "${h}" already exists. Overwrite?`)&&await f(r,!0)}else p(((w=s.errors)==null?void 0:w.join(", "))??"Upload failed")}catch(n){p(n instanceof Error?n.message:"Upload failed")}finally{i(!1)}},S=r=>{var b;const l=(b=r.target.files)==null?void 0:b[0];l&&f(l),r.target.value=""},j=r=>{r.preventDefault(),u(!1);const l=r.dataTransfer.files[0];l&&f(l)},k=y?"border-[rgba(59,247,191,0.4)]":"border-[var(--color-border-default)] hover:border-[rgba(59,247,191,0.4)] focus-visible:border-[rgba(59,247,191,0.4)]";return e.jsxs(C,{open:!0,title:"Upload Skill",onClose:()=>{t(),p(null)},width:600,children:[e.jsxs("div",{onDrop:j,onDragOver:r=>r.preventDefault(),onClick:()=>{var r;return(r=m.current)==null?void 0:r.click()},onDragEnter:()=>u(!0),onDragLeave:()=>u(!1),className:`border-2 border-dashed rounded-[4px] p-8 text-center cursor-pointer transition-[border-color] duration-fast ease-out ${k}`,children:[e.jsx("div",{className:"text-[24px] text-[var(--color-text-secondary)] mb-3",children:"↑"}),e.jsx("p",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"Drag & drop a skill file, or click to browse"}),e.jsx("p",{className:"text-caption text-[var(--color-text-secondary)] mt-2",children:"Accepts .md (single SKILL.md) or .skill/.zip (skill archive)"})]}),e.jsx("input",{ref:m,type:"file",accept:".md,.skill,.zip",onChange:S,className:"hidden"}),v&&e.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[e.jsx("div",{"data-spinning":!0,className:"w-2 h-2 rounded-full border-2 border-[var(--color-brand-default)] border-t-transparent",style:{animation:"spin 0.8s linear infinite"}}),e.jsx("span",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"Uploading…"})]}),x&&e.jsx("div",{className:"mt-4 p-3 bg-[var(--color-error-subtle)] border border-[rgba(239,68,68,0.4)] rounded-[4px] text-[var(--color-error-text)] text-body-sm",children:x})]})}function U({skill:t,isExpanded:c,onToggleExpanded:v,onToggleEnabled:i,deleteConfirm:x,onRequestDelete:p,onCancelDelete:y,onConfirmDelete:u}){return e.jsxs("div",{className:"bg-[var(--color-surface-base)] border border-[var(--color-border-default)] rounded-[2px] overflow-hidden",children:[e.jsxs("button",{type:"button",className:"block p-4 cursor-pointer bg-transparent border-0 w-full text-left hover:bg-white/[0.02] focus-visible:bg-white/[0.02] transition-colors duration-fast ease-out",onClick:v,"aria-expanded":c,children:[e.jsxs("span",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[t.emoji?e.jsx("span",{className:"text-label-lg flex-shrink-0",children:t.emoji}):e.jsx("span",{className:"text-body-sm text-[#00ff88] flex-shrink-0 mt-0.5",children:"◈"}),e.jsx("span",{className:"text-body-lg-semibold text-[var(--color-text-primary)] overflow-hidden text-ellipsis whitespace-nowrap",children:t.name})]}),e.jsxs("span",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("span",{className:t.source==="builtin"?"text-caption px-1.5 py-0.5 rounded bg-[rgba(127,143,158,0.15)] text-[var(--color-text-secondary)] flex-shrink-0":"text-caption px-1.5 py-0.5 rounded bg-[rgba(0,255,136,0.1)] text-[#00ff88] flex-shrink-0",children:t.source==="builtin"?"builtin":"user"}),e.jsx("span",{className:"text-label-lg text-[var(--color-text-secondary)] flex-shrink-0 mt-0.5 transition-colors duration-fast ease-out",children:c?"▾":"▸"})]})]}),e.jsx("span",{className:c?"block text-body-sm text-[var(--color-text-secondary)] mt-2.5":"block text-body-sm text-[var(--color-text-secondary)] mt-2.5 overflow-hidden [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]",children:t.description})]}),c&&e.jsxs("div",{className:"border-t border-[var(--color-border-default)] p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-caption text-[var(--color-text-secondary)] leading-[1.8]",children:[e.jsx("span",{className:"text-[var(--color-text-secondary)] min-w-[80px]",children:"source"}),e.jsx("span",{className:t.source==="builtin"?"text-[var(--color-text-primary)]":"text-[#00ff88]",children:t.source})]}),e.jsxs("div",{className:"flex items-center gap-2 text-caption text-[var(--color-text-secondary)] leading-[1.8]",children:[e.jsx("span",{className:"text-[var(--color-text-secondary)] min-w-[80px]",children:"available"}),e.jsx("span",{className:t.available?"text-[#00ff88]":"text-[#febc2e]",children:t.available?"yes":"no"})]}),t.always!==void 0&&e.jsxs("div",{className:"flex items-center gap-2 text-caption text-[var(--color-text-secondary)] leading-[1.8]",children:[e.jsx("span",{className:"text-[var(--color-text-secondary)] min-w-[80px]",children:"always-on"}),e.jsx("span",{className:t.always?"text-[#00ff88]":"text-[var(--color-text-primary)]",children:t.always?"yes":"no"})]}),!t.available&&t.missing&&t.missing.length>0&&e.jsxs("div",{className:"flex items-center gap-2 text-caption text-[var(--color-text-secondary)] leading-[1.8]",children:[e.jsx("span",{className:"text-[var(--color-text-secondary)] min-w-[80px]",children:"missing"}),e.jsx("span",{className:"text-[#febc2e]",children:t.missing.join(", ")})]})]}),e.jsxs("div",{className:"border-t border-[var(--color-border-default)] px-4 py-2.5 flex items-center justify-between",children:[e.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:"checkbox",checked:t.enabled,onChange:m=>i(m.target.checked),"aria-label":`${t.enabled?"Disable":"Enable"} skill ${t.name}`,className:"absolute opacity-0 w-0 h-0"}),e.jsx("div",{className:t.enabled?"w-9 h-5 rounded-full relative transition-colors duration-fast ease-out bg-[rgba(0,255,136,0.3)]":"w-9 h-5 rounded-full relative transition-colors duration-fast ease-out bg-border"}),e.jsx("div",{className:t.enabled?"absolute top-0.5 w-4 h-4 rounded-full bg-[#00ff88] transition-[left] duration-fast ease-out left-[18px]":"absolute top-0.5 w-4 h-4 rounded-full bg-[var(--color-text-secondary)] transition-[left] duration-fast ease-out left-0.5"})]}),e.jsx("span",{className:"text-caption text-[var(--color-text-secondary)]",children:t.enabled?"Enabled":"Disabled"})]}),t.source==="workspace"&&e.jsx(e.Fragment,{children:x?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-caption text-[#ff5555]",children:"Delete?"}),e.jsx("button",{onClick:u,className:"bg-transparent border-0 text-[#ff5555] hover:text-[#ff8888] focus-visible:text-[#ff8888] text-caption cursor-pointer px-1 py-0.5 transition-colors duration-fast ease-out",children:"Yes"}),e.jsx("button",{onClick:y,className:"bg-transparent border-0 text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] focus-visible:text-[var(--color-text-primary)] text-caption cursor-pointer px-1 py-0.5 transition-colors duration-fast ease-out",children:"No"})]}):e.jsx("button",{onClick:p,"aria-label":`Delete skill ${t.name}`,title:`Delete skill ${t.name}`,className:"bg-transparent border-0 text-[var(--color-text-secondary)] hover:text-[#ff5555] focus-visible:text-[#ff5555] text-label-lg cursor-pointer px-1 py-0.5 transition-colors duration-fast ease-out",children:"✕"})})]})]})}function R(){const{request:t,connected:c}=D(),[v,i]=o.useState([]),[x,p]=o.useState(""),[y,u]=o.useState(!0),[m,f]=o.useState(null),[S,j]=o.useState(!1),[k,r]=o.useState(null),[l,b]=o.useState(null),g=o.useCallback(()=>{c&&t("skills.list").then(a=>{i(a.skills),f(null)}).catch(a=>f(a instanceof Error?a.message:"Failed to load skills")).finally(()=>u(!1))},[c,t]);o.useEffect(()=>{g()},[g]);const N=async(a,s)=>{i(h=>h.map(d=>d.name===a?{...d,enabled:s}:d));try{await t("skills.toggle",{name:a,enabled:s})}catch{i(h=>h.map(d=>d.name===a?{...d,enabled:!s}:d))}},w=async a=>{try{const s=await t("skills.delete",{name:a});s.ok?i(h=>h.filter(d=>d.name!==a)):f(s.error??"Failed to delete skill")}catch(s){f(s instanceof Error?s.message:"Failed to delete skill")}r(null)},n=v.filter(a=>a.name.toLowerCase().includes(x.toLowerCase())||a.description.toLowerCase().includes(x.toLowerCase()));return m&&v.length===0?e.jsx("div",{className:"p-6 flex flex-col gap-6 bg-[var(--color-surface-canvas)] h-full overflow-y-auto box-border",children:e.jsxs("div",{className:"p-4 bg-[rgba(255,85,85,0.06)] border border-[rgba(255,85,85,0.3)] rounded-[4px] text-[#ff5555] text-body-sm",children:["Failed to load skills: ",m]})}):y?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("span",{className:"text-[#00ff88] text-body-sm",children:"Loading…"})}):e.jsxs("div",{className:"p-6 flex flex-col gap-6 bg-[var(--color-surface-canvas)] h-full overflow-y-auto box-border",children:[e.jsxs("div",{className:"flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"relative max-w-[400px] flex-1",children:[e.jsx("label",{htmlFor:"skills-search-input",className:"sr-only",children:"Search skills"}),e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-body-sm text-[var(--color-text-secondary)] pointer-events-none",children:"⌕"}),e.jsx("input",{id:"skills-search-input",type:"search",value:x,onChange:a=>p(a.target.value),placeholder:"Search skills…",spellCheck:!1,className:"w-full bg-surface-canvas border border-[var(--color-border-default)] focus:border-[rgba(0,255,136,0.4)] rounded-[4px] pl-8 pr-3.5 py-2.5 text-body-sm text-[var(--color-text-primary)] outline-none transition-colors duration-fast ease-out box-border"})]}),e.jsxs("button",{onClick:()=>j(!0),className:"flex items-center gap-2 bg-[rgba(0,255,136,0.1)] hover:bg-[rgba(0,255,136,0.18)] focus-visible:bg-[rgba(0,255,136,0.18)] border border-[rgba(0,255,136,0.3)] hover:border-[rgba(0,255,136,0.5)] focus-visible:border-[rgba(0,255,136,0.5)] rounded-[4px] px-5 py-2.5 text-[#00ff88] text-body-sm-medium cursor-pointer transition-colors duration-fast ease-out",children:["+"," Upload Skill"]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("span",{className:"text-label-lg text-[#00ff88]",children:"⧈"}),e.jsxs("span",{className:"text-body-sm-medium text-[var(--color-text-primary)]",children:["Skills (",n.length,")"]})]}),n.length===0?e.jsx("p",{className:"text-body-sm text-[var(--color-text-secondary)]",children:"No skills match your search."}):e.jsx("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(380px,1fr))]",children:n.map(a=>e.jsx(U,{skill:a,isExpanded:l===a.name,onToggleExpanded:()=>b(l===a.name?null:a.name),onToggleEnabled:s=>N(a.name,s),deleteConfirm:k===a.name,onRequestDelete:()=>r(a.name),onCancelDelete:()=>r(null),onConfirmDelete:()=>w(a.name)},a.name))})]}),S&&e.jsx(E,{onClose:()=>j(!1),onUploaded:g})]})}export{R as default};
@@ -1 +1 @@
1
- import{r as a,j as e}from"./vendor-react-B0mWfPOm.js";import{u as h}from"./index-BcTR6SiD.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";function N(){const{request:l,connected:n}=h(),[i,d]=a.useState([]),[r,x]=a.useState(""),[m,p]=a.useState(null),[u,f]=a.useState(!0),[c,b]=a.useState(null);a.useEffect(()=>{n&&l("tools.list").then(t=>d(t.tools)).catch(t=>b(t instanceof Error?t.message:"Failed to load tools")).finally(()=>f(!1))},[n,l]);const o=i.filter(t=>t.name.toLowerCase().includes(r.toLowerCase())||t.description.toLowerCase().includes(r.toLowerCase()));return c?e.jsx("div",{className:"p-6 flex flex-col gap-6 bg-[var(--color-surface-canvas)] h-full overflow-y-auto box-border",children:e.jsxs("div",{className:"p-4 bg-[rgba(255,85,85,0.06)] border border-[rgba(255,85,85,0.3)] rounded-[4px] text-[#ff5555] text-body-sm",children:["Failed to load tools: ",c]})}):u?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("span",{className:"text-[#00ff88] text-body-sm",children:"Loading…"})}):e.jsxs("div",{className:"p-6 flex flex-col gap-6 bg-[var(--color-surface-canvas)] h-full overflow-y-auto box-border",children:[e.jsxs("div",{className:"relative max-w-[400px] flex-1",children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-body-sm text-[#3a4a5a] pointer-events-none",children:"⌕"}),e.jsx("input",{type:"text",value:r,onChange:t=>x(t.target.value),placeholder:"Search tools…",className:"w-full bg-surface-canvas border border-[var(--color-border-default)] focus:border-[rgba(0,255,136,0.4)] rounded-[4px] pl-8 pr-3.5 py-2.5 text-body-sm text-[var(--color-text-primary)] outline-none transition-colors duration-fast ease-out box-border"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("span",{className:"text-label-lg text-[#00ff88]",children:"⚒"}),e.jsxs("span",{className:"text-body-sm-medium text-[var(--color-text-primary)]",children:["Agent Tools (",o.length,")"]})]}),o.length===0?e.jsx("p",{className:"text-body-sm text-[#3a4a5a]",children:"No tools match your search."}):e.jsx("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(380px,1fr))]",children:o.map(t=>{const s=m===t.name;return e.jsxs("div",{className:"bg-[var(--color-surface-base)] border border-[var(--color-border-default)] rounded-[2px] overflow-hidden",children:[e.jsxs("button",{type:"button",className:"block p-4 cursor-pointer bg-transparent border-0 w-full text-left hover:bg-white/[0.02] focus-visible:bg-white/[0.02] transition-colors duration-fast ease-out",onClick:()=>p(s?null:t.name),"aria-expanded":s,children:[e.jsxs("span",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-body-sm text-[#00ff88] flex-shrink-0 mt-0.5",children:"◈"}),e.jsx("span",{className:"text-body-lg-semibold text-[var(--color-text-primary)] overflow-hidden text-ellipsis whitespace-nowrap",children:t.name})]}),e.jsx("span",{className:"text-label-lg text-[#3a4a5a] flex-shrink-0 mt-0.5 transition-colors duration-fast ease-out",children:s?"▾":"▸"})]}),e.jsx("span",{className:s?"block text-body-sm text-[var(--color-text-secondary)] mt-2.5":"block text-body-sm text-[var(--color-text-secondary)] mt-2.5 overflow-hidden [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]",children:t.description})]}),s&&t.parameters!=null&&e.jsxs("div",{className:"border-t border-[var(--color-border-default)] p-4",children:[e.jsx("p",{className:"text-caption text-[#3a4a5a] tracking-[0.5px] uppercase mb-2",children:"Parameter Schema"}),e.jsx("pre",{className:"text-caption text-[var(--color-text-primary)] bg-surface-canvas rounded-[4px] p-3 overflow-x-auto max-h-64 overflow-y-auto m-0 border border-[var(--color-border-default)]",children:JSON.stringify(t.parameters,null,2)})]})]},t.name)})})]})]})}export{N as default};
1
+ import{r as a,j as e}from"./vendor-react-B0mWfPOm.js";import{u as h}from"./index-Du3VgAo4.js";import"./vendor-viem-wp7lz4Hc.js";import"./vendor-charts-CfOL2F-E.js";function N(){const{request:l,connected:n}=h(),[i,d]=a.useState([]),[r,x]=a.useState(""),[m,p]=a.useState(null),[u,f]=a.useState(!0),[c,b]=a.useState(null);a.useEffect(()=>{n&&l("tools.list").then(t=>d(t.tools)).catch(t=>b(t instanceof Error?t.message:"Failed to load tools")).finally(()=>f(!1))},[n,l]);const o=i.filter(t=>t.name.toLowerCase().includes(r.toLowerCase())||t.description.toLowerCase().includes(r.toLowerCase()));return c?e.jsx("div",{className:"p-6 flex flex-col gap-6 bg-[var(--color-surface-canvas)] h-full overflow-y-auto box-border",children:e.jsxs("div",{className:"p-4 bg-[rgba(255,85,85,0.06)] border border-[rgba(255,85,85,0.3)] rounded-[4px] text-[#ff5555] text-body-sm",children:["Failed to load tools: ",c]})}):u?e.jsx("div",{className:"flex items-center justify-center h-64",children:e.jsx("span",{className:"text-[#00ff88] text-body-sm",children:"Loading…"})}):e.jsxs("div",{className:"p-6 flex flex-col gap-6 bg-[var(--color-surface-canvas)] h-full overflow-y-auto box-border",children:[e.jsxs("div",{className:"relative max-w-[400px] flex-1",children:[e.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-body-sm text-[#3a4a5a] pointer-events-none",children:"⌕"}),e.jsx("input",{type:"text",value:r,onChange:t=>x(t.target.value),placeholder:"Search tools…",className:"w-full bg-surface-canvas border border-[var(--color-border-default)] focus:border-[rgba(0,255,136,0.4)] rounded-[4px] pl-8 pr-3.5 py-2.5 text-body-sm text-[var(--color-text-primary)] outline-none transition-colors duration-fast ease-out box-border"})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("span",{className:"text-label-lg text-[#00ff88]",children:"⚒"}),e.jsxs("span",{className:"text-body-sm-medium text-[var(--color-text-primary)]",children:["Agent Tools (",o.length,")"]})]}),o.length===0?e.jsx("p",{className:"text-body-sm text-[#3a4a5a]",children:"No tools match your search."}):e.jsx("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(380px,1fr))]",children:o.map(t=>{const s=m===t.name;return e.jsxs("div",{className:"bg-[var(--color-surface-base)] border border-[var(--color-border-default)] rounded-[2px] overflow-hidden",children:[e.jsxs("button",{type:"button",className:"block p-4 cursor-pointer bg-transparent border-0 w-full text-left hover:bg-white/[0.02] focus-visible:bg-white/[0.02] transition-colors duration-fast ease-out",onClick:()=>p(s?null:t.name),"aria-expanded":s,children:[e.jsxs("span",{className:"flex items-start justify-between gap-2",children:[e.jsxs("span",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-body-sm text-[#00ff88] flex-shrink-0 mt-0.5",children:"◈"}),e.jsx("span",{className:"text-body-lg-semibold text-[var(--color-text-primary)] overflow-hidden text-ellipsis whitespace-nowrap",children:t.name})]}),e.jsx("span",{className:"text-label-lg text-[#3a4a5a] flex-shrink-0 mt-0.5 transition-colors duration-fast ease-out",children:s?"▾":"▸"})]}),e.jsx("span",{className:s?"block text-body-sm text-[var(--color-text-secondary)] mt-2.5":"block text-body-sm text-[var(--color-text-secondary)] mt-2.5 overflow-hidden [display:-webkit-box] [-webkit-line-clamp:2] [-webkit-box-orient:vertical]",children:t.description})]}),s&&t.parameters!=null&&e.jsxs("div",{className:"border-t border-[var(--color-border-default)] p-4",children:[e.jsx("p",{className:"text-caption text-[#3a4a5a] tracking-[0.5px] uppercase mb-2",children:"Parameter Schema"}),e.jsx("pre",{className:"text-caption text-[var(--color-text-primary)] bg-surface-canvas rounded-[4px] p-3 overflow-x-auto max-h-64 overflow-y-auto m-0 border border-[var(--color-border-default)]",children:JSON.stringify(t.parameters,null,2)})]})]},t.name)})})]})]})}export{N as default};
@@ -1,4 +1,4 @@
1
- import{c as t}from"./index-BcTR6SiD.js";/**
1
+ import{c as t}from"./index-Du3VgAo4.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1,4 +1,4 @@
1
- import{c}from"./index-BcTR6SiD.js";/**
1
+ import{c}from"./index-Du3VgAo4.js";/**
2
2
  * @license lucide-react v0.468.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
@@ -1 +1 @@
1
- import{R as c,L as x,A as d}from"./mermaid-GHXKKRXX-DC3T5XzO.js";import{r as s,j as f}from"./vendor-react-B0mWfPOm.js";import"./vendor-viem-wp7lz4Hc.js";import"./index-BcTR6SiD.js";import"./vendor-charts-CfOL2F-E.js";var b=({code:i,language:e,raw:t,className:m,startLine:u,lineNumbers:n,...g})=>{let{shikiTheme:o}=s.useContext(c),r=x(),[h,a]=s.useState(t);return s.useEffect(()=>{if(!r){a(t);return}let l=r.highlight({code:i,language:e,themes:o},p=>{a(p)});l&&a(l)},[i,e,o,r,t]),f.jsx(d,{className:m,language:e,lineNumbers:n,result:h,startLine:u,...g})};export{b as HighlightedCodeBlockBody};
1
+ import{R as c,L as x,A as d}from"./mermaid-GHXKKRXX-CNibSrez.js";import{r as s,j as f}from"./vendor-react-B0mWfPOm.js";import"./vendor-viem-wp7lz4Hc.js";import"./index-Du3VgAo4.js";import"./vendor-charts-CfOL2F-E.js";var b=({code:i,language:e,raw:t,className:m,startLine:u,lineNumbers:n,...g})=>{let{shikiTheme:o}=s.useContext(c),r=x(),[h,a]=s.useState(t);return s.useEffect(()=>{if(!r){a(t);return}let l=r.highlight({code:i,language:e,themes:o},p=>{a(p)});l&&a(l)},[i,e,o,r,t]),f.jsx(d,{className:m,language:e,lineNumbers:n,result:h,startLine:u,...g})};export{b as HighlightedCodeBlockBody};