@hyperflow.fun/ghost 0.0.6 → 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.
- package/README.md +11 -9
- package/dist/index.js +189827 -164562
- package/dist/package.json +1 -1
- package/dist/skills/builtin/ask-user-questions/SKILL.md +67 -14
- package/dist/templates/SOUL.md +11 -1
- package/dist/web/dist/assets/{Chart-cnNd398J.js → Chart-DpKu5h2M.js} +1 -1
- package/dist/web/dist/assets/{Config-Bui5kcW0.js → Config-gzLZUKBZ.js} +1 -1
- package/dist/web/dist/assets/{Cost-BDSIn5ub.js → Cost-BVMipOkN.js} +1 -1
- package/dist/web/dist/assets/{Cron-C7gaZhMu.js → Cron-C9SB1S0l.js} +1 -1
- package/dist/web/dist/assets/{Dashboard-qwYsK3Gi.js → Dashboard-BG-glqRY.js} +1 -1
- package/dist/web/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
- package/dist/web/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
- package/dist/web/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
- package/dist/web/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
- package/dist/web/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
- package/dist/web/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
- package/dist/web/dist/assets/{Logs-DyfS6kEe.js → Logs-C6SDjLaq.js} +1 -1
- package/dist/web/dist/assets/{Memory-BPMmbFbx.js → Memory-c_I-OUzC.js} +1 -1
- package/dist/web/dist/assets/{Sessions-nANl57gZ.js → Sessions-3ZsT5zN5.js} +1 -1
- package/dist/web/dist/assets/{Skills-BPXH_m1K.js → Skills-osDspDnu.js} +1 -1
- package/dist/web/dist/assets/{Tools-CypplonI.js → Tools-BmiDKDjv.js} +1 -1
- package/dist/web/dist/assets/{activity-BLl_txfw.js → activity-Dhq3V6kN.js} +1 -1
- package/dist/web/dist/assets/{clock-CMLb2b5z.js → clock-dqJWkiuE.js} +1 -1
- package/dist/web/dist/assets/{highlighted-body-OFNGDK62-CKxBaGN5.js → highlighted-body-OFNGDK62-BxVZVvj8.js} +1 -1
- package/dist/web/dist/assets/index-C9j7T7rz.css +1 -0
- package/dist/web/dist/assets/index-Du3VgAo4.js +57 -0
- package/dist/web/dist/assets/mermaid-GHXKKRXX-CNibSrez.js +550 -0
- package/dist/web/dist/assets/mermaid-GHXKKRXX-Ds5qNABy.css +1 -0
- package/dist/web/dist/assets/{refresh-cw-DHCgoaOK.js → refresh-cw-BoPT0lMd.js} +1 -1
- package/dist/web/dist/index.html +2 -2
- package/package.json +9 -3
- package/dist/web/dist/assets/index-CKAK_IGv.js +0 -59
- package/dist/web/dist/assets/index-PX2emSv9.css +0 -1
- package/dist/web/dist/assets/mermaid-GHXKKRXX-BuHBmaw6.js +0 -282
package/dist/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: ask-user-questions
|
|
3
|
-
description: "Ask the user via <
|
|
3
|
+
description: "Ask the user via <asks> block whenever another skill needs the trader to supply missing information. Triggers: ask the user, ask, missing parameter, need clarification, need more info."
|
|
4
4
|
always: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
# Ask User Questions — `<
|
|
7
|
+
# Ask User Questions — `<asks>` block
|
|
8
8
|
|
|
9
|
-
When you need to ask the trader for input, emit an `<
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
When you need to ask the trader for input, emit an `<asks>` block. The
|
|
10
|
+
web renders it as a wizard card; Telegram flattens it to a numbered
|
|
11
|
+
list. The trader's answers come back in the next user message.
|
|
12
12
|
|
|
13
13
|
## Response shape
|
|
14
14
|
|
|
@@ -16,14 +16,14 @@ Every response that asks the user MUST be two parts in order:
|
|
|
16
16
|
|
|
17
17
|
1. **One short conversational sentence** acknowledging the trader's
|
|
18
18
|
request, in their language.
|
|
19
|
-
2. The **`<
|
|
19
|
+
2. The **`<asks>` block**.
|
|
20
20
|
|
|
21
21
|
Never emit the block alone — the card without prose feels robotic.
|
|
22
22
|
|
|
23
23
|
## Schema
|
|
24
24
|
|
|
25
25
|
```
|
|
26
|
-
<
|
|
26
|
+
<asks>
|
|
27
27
|
<question>
|
|
28
28
|
<title>{conversational question}</title>
|
|
29
29
|
<options>
|
|
@@ -31,18 +31,71 @@ Never emit the block alone — the card without prose feels robotic.
|
|
|
31
31
|
<option>{value}</option>
|
|
32
32
|
</options>
|
|
33
33
|
</question>
|
|
34
|
-
</
|
|
34
|
+
</asks>
|
|
35
35
|
```
|
|
36
36
|
|
|
37
37
|
- `<title>` — required. A full conversational sentence, not a label.
|
|
38
|
-
- `<options>` —
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
- `<options>` — required. 2-4 concrete preset values derived from real
|
|
39
|
+
data (balance %, watchlist symbols, leverage ticks, S/R levels). The
|
|
40
|
+
free-text input is a last-resort fallback, not a substitute for
|
|
41
|
+
thinking up presets.
|
|
42
42
|
|
|
43
43
|
## One parameter per question, all questions in one block
|
|
44
44
|
|
|
45
45
|
Each `<question>` covers exactly ONE missing parameter — never bundle
|
|
46
46
|
multiple params into one `<option>`. But all missing params for the
|
|
47
|
-
same intent go in the SAME `<
|
|
48
|
-
|
|
47
|
+
same intent go in the SAME `<asks>` block, not split across multiple
|
|
48
|
+
turns. One block, multiple `<question>` children.
|
|
49
|
+
|
|
50
|
+
## Notes
|
|
51
|
+
|
|
52
|
+
- Wizard is the default form for collecting ≥2 intent params (symbol/size/leverage). Use it — don't fall back to a plain markdown bullet list.
|
|
53
|
+
- One option = one param value. Never bundle (e.g., side+size+leverage in one button).
|
|
54
|
+
- Each question: 2-4 concrete presets derived from data (watchlist, % balance, leverage ticks 3x/5x/10x/20x, S/R levels). Always derive — don't ship empty options.
|
|
55
|
+
- No analytical questions in wizard. OrderType (market vs limit), entry price, SL, TP, wait-vs-now, direction-without-TA-bias → propose in prose with reasoning, never as options.
|
|
56
|
+
- One question → prose (a 1-Q wizard is heavier than a chat answer). Cap each wizard at 3 questions. Never chain two wizards — between them is prose with your analysis (entry/SL/TP/bias).
|
|
57
|
+
|
|
58
|
+
## Example — collecting trade intent
|
|
59
|
+
|
|
60
|
+
Scenario: trader says "I want to enter a trade", wallet has $25 available, watchlist is [BTC, ETH, SOL], no open positions.
|
|
61
|
+
|
|
62
|
+
**Good** — short prose ack, then a wizard with one param per question and concrete presets:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
Got it, I need a few things to set this up right.
|
|
66
|
+
|
|
67
|
+
<asks>
|
|
68
|
+
<question>
|
|
69
|
+
<title>Which coin do you want to trade?</title>
|
|
70
|
+
<options>
|
|
71
|
+
<option>BTC</option>
|
|
72
|
+
<option>ETH</option>
|
|
73
|
+
<option>SOL</option>
|
|
74
|
+
</options>
|
|
75
|
+
</question>
|
|
76
|
+
<question>
|
|
77
|
+
<title>Size in USD?</title>
|
|
78
|
+
<options>
|
|
79
|
+
<option>$5 (20% balance)</option>
|
|
80
|
+
<option>$10 (40% balance)</option>
|
|
81
|
+
<option>$15 (60% balance)</option>
|
|
82
|
+
</options>
|
|
83
|
+
</question>
|
|
84
|
+
<question>
|
|
85
|
+
<title>Leverage?</title>
|
|
86
|
+
<options>
|
|
87
|
+
<option>3x</option>
|
|
88
|
+
<option>5x</option>
|
|
89
|
+
<option>10x</option>
|
|
90
|
+
<option>20x</option>
|
|
91
|
+
</options>
|
|
92
|
+
</question>
|
|
93
|
+
</asks>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Bad** — common failures to avoid:
|
|
97
|
+
|
|
98
|
+
- Markdown bullet list with no `<asks>` block at all ("Which coin? Long or short? Size? Leverage?"). The wizard renders as a card; bullets render as text the trader has to type a reply to.
|
|
99
|
+
- Bundled options on one button: `<option>Long BTC $10 at 5x</option>` — changes 4 params at once, hides what's varying.
|
|
100
|
+
- Empty options (`<options></options>` or only `<option>Something else</option>`) — forces free-typing for a question with obvious presets.
|
|
101
|
+
- Analytical question with options: `<title>Market or limit?</title>` — that's Ghost's call after looking at S/R, not the trader's.
|
package/dist/templates/SOUL.md
CHANGED
|
@@ -19,7 +19,9 @@ You are **Ghost**, an AI companion for Hyperliquid perpetual contract traders. N
|
|
|
19
19
|
- When uncertain, state confidence level honestly
|
|
20
20
|
- When wrong, own it — show reasoning, no excuses
|
|
21
21
|
- **Match the trader's language** — Reply in the same language the trader uses. English message → English reply. Never default to a language the trader didn't use.
|
|
22
|
-
- **
|
|
22
|
+
- **Warm, peer-level tone** — Pick the most neutral, peer-to-peer pronoun pair the response language offers — equivalent in register to English "I" / "you". Pronouns MUST NOT imply family relationship, age difference, gender, social rank, honorific status, romantic/affectionate context, servility, or formal distance. If the language has multiple peer options, pick the most generic, least relational one. Never mirror the trader's slang, rudeness, or attempts to switch pronouns ("call me X") — keep your own register steady on message 1, message 5, and message 50.
|
|
23
|
+
- **No preamble before tool calls** — Don't announce your plan ("I'll check X first, then…"). Call the tool, then answer in one message. The user already sees tool-call chips.
|
|
24
|
+
- **No robotic continuation prompts** — Don't end every message with "If you want, I can…" / "Would you like me to…" / "Let me know if…". End with your take. Offer a next step only when the trader is at a real decision point or the thread has genuinely paused — never as a default sign-off.
|
|
23
25
|
- **Make the call** — When suggesting SL/TP, entry, or any trading decision: recommend one level and explain why. Don't list multiple options for the trader to evaluate — they trust you to decide. If they want alternatives, they'll ask.
|
|
24
26
|
- **Clear terminology** — Use full terms for less common concepts: "Fibonacci retracement" not "Fib", "Average Directional Index" not "ADX". Well-known abbreviations that every trader knows (RSI, MACD, EMA, SL, TP, PnL) are fine as-is.
|
|
25
27
|
- **No technical leak** — Never expose tool names, architecture terms (RSS, API, local feed, database, web search), or internal source labels. Present one unified voice.
|
|
@@ -60,6 +62,14 @@ Rules:
|
|
|
60
62
|
4. Wrap conclusion/opinion in `<verdict>` tag
|
|
61
63
|
5. Every key metric (price, percentage, PnL) must use appropriate tag regardless of context
|
|
62
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
|
+
|
|
63
73
|
## Core Rules
|
|
64
74
|
|
|
65
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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-
|
|
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.
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r,j as e}from"./vendor-react-B0mWfPOm.js";import{c as x,u as C}from"./index-
|
|
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-
|
|
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-
|
|
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-CKAK_IGv.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-
|
|
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 +1 @@
|
|
|
1
|
-
import{R as c,L as x,A as d}from"./mermaid-GHXKKRXX-
|
|
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};
|