vskill 0.5.105 → 0.5.106

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.
@@ -1 +1 @@
1
- {"version":3,"file":"eval-server.js","sourceRoot":"","sources":["../../src/eval-server/eval-server.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,gDAAgD;AAChD,EAAE;AACF,yEAAyE;AACzE,0EAA0E;AAC1E,iEAAiE;AACjE,4EAA4E;AAC5E,mEAAmE;AACnE,8EAA8E;AAE9E,2EAA2E;AAC3E,yEAAyE;AACzE,4CAA4C;AAC5C,OAAO,qBAAqB,CAAC;AAE7B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,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AC,CAAC;QACnB,GAAG,CAAC,GAAG,CAAC,+CAA+C,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
@@ -70,6 +70,13 @@ export function registerIntegrationRoutes(router, root) {
70
70
  // -------------------------------------------------------------------------
71
71
  router.get("/api/credentials/:plugin/:skill", async (req, res, params) => {
72
72
  const skillDir = resolveSkillDir(root, params.plugin, params.skill);
73
+ // Skills without evals/evals.json have no integration-test credentials.
74
+ // Return empty list with 200 — a missing evals file is a valid state, not
75
+ // a client error. Malformed evals.json still surfaces as 400 below.
76
+ if (!existsSync(join(skillDir, "evals", "evals.json"))) {
77
+ sendJson(res, { credentials: [] }, 200, req);
78
+ return;
79
+ }
73
80
  try {
74
81
  // Load evals and collect all requiredCredentials from integration tests
75
82
  const evalsFile = loadAndValidateEvals(skillDir);
@@ -1 +1 @@
1
- {"version":3,"file":"integration-routes.js","sourceRoot":"","sources":["../../src/eval-server/integration-routes.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,4EAA4E;AAC5E,8EAA8E;AAE9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACxH,OAAO,EAAE,kBAAkB,EAAc,SAAS,EAAsB,MAAM,+BAA+B,CAAC;AAG9G,MAAM,UAAU,yBAAyB,CAAC,MAAc,EAAE,IAAY;IACpE,4EAA4E;IAC5E,0EAA0E;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AAS,GAAG,SAAS,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,iCAAiC;YAEzE,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YAClD,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;YACpC,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC5D,IAAI,EAAE,GAAG;gBACT,WAAW,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;gBACxD,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,SAAS,IAAI,SAAS,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBACtE,MAAM,EAAE,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,OAAgB,CAAC,CAAC,CAAC,SAAkB;aAClE,CAAC,CAAC,CAAC;YAEJ,QAAQ,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACjD,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,QAAQ,CAAC,GAAG,EAAE,EAAE,KAAK,EAAG,GAAa,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;QACzE,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,18 @@
1
+ import * as http from "node:http";
2
+ export declare function getPlatformBaseUrl(): string;
3
+ /**
4
+ * Decide whether a given request URL should be proxied to the platform.
5
+ * Today the contract is: any unhandled `/api/v1/skills/*` request goes to
6
+ * the platform. Other `/api/...` paths remain owned by the eval-server.
7
+ */
8
+ export declare function shouldProxyToPlatform(url: string | undefined): boolean;
9
+ /**
10
+ * Proxy a single HTTP request from the studio to the platform.
11
+ * SSE-safe: streams the upstream body chunks directly to the response so
12
+ * `text/event-stream` connections stay open.
13
+ *
14
+ * Resolves once the proxy pipeline finishes (either side ended) — callers
15
+ * can `await` to know the response has been written, but typical use is
16
+ * fire-and-forget within an HTTP server handler.
17
+ */
18
+ export declare function proxyToPlatform(req: http.IncomingMessage, res: http.ServerResponse, baseUrl?: string): Promise<void>;
@@ -0,0 +1,153 @@
1
+ // ---------------------------------------------------------------------------
2
+ // platform-proxy.ts — forward unhandled /api/v1/skills/* requests from the
3
+ // Skill Studio (eval-server, port-hashed e.g. 3162) to the vskill-platform
4
+ // (Next.js / Cloudflare Worker, default http://localhost:3017 in dev).
5
+ //
6
+ // Why this exists (0712 US-003 follow-up T-016A/B):
7
+ // The studio frontend (src/eval-ui) issues *relative* fetches such as
8
+ // `/api/v1/skills/check-updates` and `/api/v1/skills/stream`. Those land
9
+ // on the eval-server itself, which has no handler for them and returns
10
+ // `{"error":"Not found"}` 404. Production deploys the studio behind the
11
+ // platform (same origin), so relative URLs resolve to the platform; in
12
+ // local dev the studio is served by the eval-server CLI (`vskill studio`),
13
+ // which is a *different* process from the platform. This helper closes
14
+ // the gap by transparently proxying any unhandled `/api/v1/skills/*` path
15
+ // to the platform target.
16
+ //
17
+ // Design notes:
18
+ // - Target URL is configurable via `VSKILL_PLATFORM_URL` env (default
19
+ // `http://localhost:3017`). Must include scheme + host + port.
20
+ // - Method, headers (minus hop-by-hop), query string, and request body
21
+ // stream are forwarded verbatim. Response status, headers, and body
22
+ // stream are piped back so SSE (`text/event-stream`) connections stay
23
+ // long-lived without buffering.
24
+ // - Path prefix is preserved exactly (`/api/v1/skills/...`) — the
25
+ // platform routes match the same paths.
26
+ // - Connection failures upstream return a `502 Bad Gateway` JSON
27
+ // envelope so the studio's fetch error handlers see a structured
28
+ // response rather than a hung socket.
29
+ // ---------------------------------------------------------------------------
30
+ import * as http from "node:http";
31
+ import * as https from "node:https";
32
+ const DEFAULT_PLATFORM_URL = "http://localhost:3017";
33
+ // Hop-by-hop headers per RFC 2616 §13.5.1 — never forward these on a proxy.
34
+ const HOP_BY_HOP = new Set([
35
+ "connection",
36
+ "keep-alive",
37
+ "proxy-authenticate",
38
+ "proxy-authorization",
39
+ "te",
40
+ "trailers",
41
+ "transfer-encoding",
42
+ "upgrade",
43
+ "host",
44
+ "content-length",
45
+ ]);
46
+ export function getPlatformBaseUrl() {
47
+ const raw = process.env.VSKILL_PLATFORM_URL;
48
+ if (typeof raw === "string" && raw.length > 0) {
49
+ return raw.replace(/\/$/, "");
50
+ }
51
+ return DEFAULT_PLATFORM_URL;
52
+ }
53
+ /**
54
+ * Decide whether a given request URL should be proxied to the platform.
55
+ * Today the contract is: any unhandled `/api/v1/skills/*` request goes to
56
+ * the platform. Other `/api/...` paths remain owned by the eval-server.
57
+ */
58
+ export function shouldProxyToPlatform(url) {
59
+ if (!url)
60
+ return false;
61
+ return url.startsWith("/api/v1/skills/");
62
+ }
63
+ function pickHeadersForUpstream(src) {
64
+ const out = {};
65
+ for (const [k, v] of Object.entries(src)) {
66
+ if (typeof v === "undefined")
67
+ continue;
68
+ if (HOP_BY_HOP.has(k.toLowerCase()))
69
+ continue;
70
+ out[k] = Array.isArray(v) ? v.join(", ") : String(v);
71
+ }
72
+ // Preserve client-IP intent for any future platform-side observability.
73
+ const xff = out["x-forwarded-for"];
74
+ out["x-forwarded-for"] = xff ? `${xff}, 127.0.0.1` : "127.0.0.1";
75
+ return out;
76
+ }
77
+ function pickHeadersForDownstream(src) {
78
+ const out = {};
79
+ for (const [k, v] of Object.entries(src)) {
80
+ if (typeof v === "undefined")
81
+ continue;
82
+ if (HOP_BY_HOP.has(k.toLowerCase()))
83
+ continue;
84
+ out[k] = v;
85
+ }
86
+ return out;
87
+ }
88
+ /**
89
+ * Proxy a single HTTP request from the studio to the platform.
90
+ * SSE-safe: streams the upstream body chunks directly to the response so
91
+ * `text/event-stream` connections stay open.
92
+ *
93
+ * Resolves once the proxy pipeline finishes (either side ended) — callers
94
+ * can `await` to know the response has been written, but typical use is
95
+ * fire-and-forget within an HTTP server handler.
96
+ */
97
+ export function proxyToPlatform(req, res, baseUrl = getPlatformBaseUrl()) {
98
+ return new Promise((resolve) => {
99
+ const target = new URL(req.url ?? "/", baseUrl);
100
+ const transport = target.protocol === "https:" ? https : http;
101
+ const upstreamReq = transport.request({
102
+ protocol: target.protocol,
103
+ hostname: target.hostname,
104
+ port: target.port || (target.protocol === "https:" ? 443 : 80),
105
+ path: `${target.pathname}${target.search}`,
106
+ method: req.method,
107
+ headers: pickHeadersForUpstream(req.headers),
108
+ }, (upstreamRes) => {
109
+ const status = upstreamRes.statusCode ?? 502;
110
+ const headers = pickHeadersForDownstream(upstreamRes.headers);
111
+ try {
112
+ res.writeHead(status, headers);
113
+ }
114
+ catch {
115
+ // Headers already sent — fall through to pipe; `res.write` will
116
+ // continue on the existing stream.
117
+ }
118
+ upstreamRes.on("end", () => resolve());
119
+ upstreamRes.on("error", () => {
120
+ if (!res.writableEnded)
121
+ res.end();
122
+ resolve();
123
+ });
124
+ upstreamRes.pipe(res);
125
+ });
126
+ upstreamReq.on("error", (err) => {
127
+ if (!res.headersSent) {
128
+ res.writeHead(502, { "content-type": "application/json" });
129
+ }
130
+ if (!res.writableEnded) {
131
+ res.end(JSON.stringify({
132
+ error: "platform_unreachable",
133
+ message: `vskill-platform proxy failed: ${err.message}`,
134
+ target: target.origin,
135
+ }));
136
+ }
137
+ resolve();
138
+ });
139
+ // Close upstream cleanly when the client disconnects (esp. EventSource
140
+ // unmounts) so we don't leak sockets on long-lived SSE streams.
141
+ res.on("close", () => {
142
+ try {
143
+ upstreamReq.destroy();
144
+ }
145
+ catch {
146
+ /* noop */
147
+ }
148
+ });
149
+ // Forward the request body (if any) — req is a readable stream.
150
+ req.pipe(upstreamReq);
151
+ });
152
+ }
153
+ //# sourceMappingURL=platform-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform-proxy.js","sourceRoot":"","sources":["../../src/eval-server/platform-proxy.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,2EAA2E;AAC3E,2EAA2E;AAC3E,uEAAuE;AACvE,EAAE;AACF,oDAAoD;AACpD,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,yEAAyE;AACzE,6EAA6E;AAC7E,yEAAyE;AACzE,4EAA4E;AAC5E,4BAA4B;AAC5B,EAAE;AACF,gBAAgB;AAChB,wEAAwE;AACxE,mEAAmE;AACnE,yEAAyE;AACzE,wEAAwE;AACxE,0EAA0E;AAC1E,oCAAoC;AACpC,oEAAoE;AACpE,4CAA4C;AAC5C,mEAAmE;AACnE,qEAAqE;AACrE,0CAA0C;AAC1C,8EAA8E;AAE9E,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAErD,4EAA4E;AAC5E,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC;IACzB,YAAY;IACZ,YAAY;IACZ,oBAAoB;IACpB,qBAAqB;IACrB,IAAI;IACJ,UAAU;IACV,mBAAmB;IACnB,SAAS;IACT,MAAM;IACN,gBAAgB;CACjB,CAAC,CAAC;AAEH,MAAM,UAAU,kBAAkB;IAChC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAC5C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,oBAAoB,CAAC;AAC9B,CAAC;AAED;;;;GAIG;AACH,M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AAC,OAAO,EAAE,GAAG,EAAE;gBAC3B,IAAI,CAAC,GAAG,CAAC,aAAa;oBAAE,GAAG,CAAC,GAAG,EAAE,CAAC;gBAClC,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;YACH,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACxB,CAAC,CACF,CAAC;QAEF,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YAC9B,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;gBACrB,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAC7D,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,CAAC;gBACvB,GAAG,CAAC,GAAG,CACL,IAAI,CAAC,SAAS,CAAC;oBACb,KAAK,EAAE,sBAAsB;oBAC7B,OAAO,EAAE,iCAAiC,GAAG,CAAC,OAAO,EAAE;oBACvD,MAAM,EAAE,MAAM,CAAC,MAAM;iBACtB,CAAC,CACH,CAAC;YACJ,CAAC;YACD,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;QAEH,uEAAuE;QACvE,gEAAgE;QAChE,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACnB,IAAI,CAAC;gBACH,WAAW,CAAC,OAAO,EAAE,CAAC;YACxB,CAAC;YAAC,MAAM,CAAC;gBACP,UAAU;YACZ,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,gEAAgE;QAChE,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,35 @@
1
+ /** Test-only: clear the in-process resolver cache between cases. */
2
+ export declare function resetResolverCache(): void;
3
+ /**
4
+ * Parse a GitHub remote URL to `{ owner, repo }`. Returns null for non-GitHub
5
+ * hosts or malformed input. Repo capture accepts dots (e.g. `pages.github.io`)
6
+ * and strips an optional trailing `.git`.
7
+ */
8
+ export declare function parseGitHubRemoteUrl(url: string): {
9
+ owner: string;
10
+ repo: string;
11
+ } | null;
12
+ /**
13
+ * Locate an authored skill on disk under `<root>/plugins/<plugin>/skills/<skill>/SKILL.md`.
14
+ * Returns the absolute directory containing SKILL.md, or null if not found.
15
+ * On duplicates across plugins, returns the lexicographically first match.
16
+ *
17
+ * Security: rejects path-separator or `..` segments in `skill`/`plugin` and
18
+ * verifies the resolved dir lives under `<root>/plugins/`.
19
+ */
20
+ export declare function findAuthoredSkillDir(root: string, skill: string): Promise<string | null>;
21
+ /**
22
+ * Run `git -C <dir> config --get remote.origin.url` and parse to owner/repo.
23
+ * Returns null if git is missing, the dir is not a git repo, the remote is
24
+ * absent, or the URL is not a parsable GitHub URL.
25
+ */
26
+ export declare function readGitOriginOwnerRepo(dir: string): Promise<{
27
+ owner: string;
28
+ repo: string;
29
+ } | null>;
30
+ /**
31
+ * Resolve a bare skill name to `owner/repo/skill`. Order: cache → lockfile →
32
+ * authored-skill on disk + git remote → bare-name fallback. Every outcome is
33
+ * cached so a successful resolution shells out to git at most once per process.
34
+ */
35
+ export declare function resolveSkillApiName(skill: string, root: string): Promise<string>;
@@ -0,0 +1,146 @@
1
+ // Hierarchical skill-name resolver for the eval-server.
2
+ //
3
+ // Why: Studio's Versions tab queries verified-skill.com with `owner/repo/skill`,
4
+ // but the eval-server only sees a bare skill segment. Lockfile lookup covers
5
+ // installed skills; authored skills (in this repo's plugins/ tree) need a
6
+ // git-remote fallback. Failure of any branch silently returns the bare name so
7
+ // the proxy's "no VCS surface" empty envelope is preserved.
8
+ import { execFile } from "node:child_process";
9
+ import { access, readdir, stat } from "node:fs/promises";
10
+ import { join, resolve, sep } from "node:path";
11
+ import { readLockfile } from "../lockfile/lockfile.js";
12
+ import { parseSource } from "../resolvers/source-resolver.js";
13
+ const GIT_TIMEOUT_MS = 5_000;
14
+ const GITHUB_URL_PATTERNS = [
15
+ /^https?:\/\/github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/,
16
+ /^git@github\.com:([^/]+)\/(.+?)(?:\.git)?$/,
17
+ /^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?$/,
18
+ ];
19
+ // Single-root assumption: keyed by skill name only. The eval-server runs with a
20
+ // single repo root for its lifetime, so callers passing different roots would
21
+ // observe stale results. Acceptable for the current design.
22
+ //
23
+ // Cache stores both successes (`owner/repo/skill`) AND fallbacks (bare name) for
24
+ // the eval-server process lifetime. A skill that gains a git remote mid-session
25
+ // will still proxy with its bare name until restart — Studio sessions are short
26
+ // enough that this is acceptable.
27
+ const resolverCache = new Map();
28
+ /** Test-only: clear the in-process resolver cache between cases. */
29
+ export function resetResolverCache() {
30
+ resolverCache.clear();
31
+ }
32
+ function isUnsafeSegment(s) {
33
+ return !s || s === "." || s === ".." || s.includes("/") || s.includes("\\");
34
+ }
35
+ function rememberAndReturn(skill, value) {
36
+ resolverCache.set(skill, value);
37
+ return value;
38
+ }
39
+ /**
40
+ * Parse a GitHub remote URL to `{ owner, repo }`. Returns null for non-GitHub
41
+ * hosts or malformed input. Repo capture accepts dots (e.g. `pages.github.io`)
42
+ * and strips an optional trailing `.git`.
43
+ */
44
+ export function parseGitHubRemoteUrl(url) {
45
+ if (!url || typeof url !== "string")
46
+ return null;
47
+ const trimmed = url.trim();
48
+ for (const re of GITHUB_URL_PATTERNS) {
49
+ const m = trimmed.match(re);
50
+ if (!m || !m[1] || !m[2])
51
+ continue;
52
+ const repo = m[2].replace(/\/+$/, "");
53
+ if (!repo || repo.includes("/"))
54
+ continue;
55
+ return { owner: m[1], repo };
56
+ }
57
+ return null;
58
+ }
59
+ /**
60
+ * Locate an authored skill on disk under `<root>/plugins/<plugin>/skills/<skill>/SKILL.md`.
61
+ * Returns the absolute directory containing SKILL.md, or null if not found.
62
+ * On duplicates across plugins, returns the lexicographically first match.
63
+ *
64
+ * Security: rejects path-separator or `..` segments in `skill`/`plugin` and
65
+ * verifies the resolved dir lives under `<root>/plugins/`.
66
+ */
67
+ export async function findAuthoredSkillDir(root, skill) {
68
+ if (isUnsafeSegment(skill))
69
+ return null;
70
+ const pluginsDir = resolve(root, "plugins");
71
+ const pluginsRootPrefix = pluginsDir.endsWith(sep) ? pluginsDir : pluginsDir + sep;
72
+ let plugins;
73
+ try {
74
+ plugins = (await readdir(pluginsDir)).sort();
75
+ }
76
+ catch {
77
+ return null;
78
+ }
79
+ for (const plugin of plugins) {
80
+ if (isUnsafeSegment(plugin))
81
+ continue;
82
+ const skillDir = resolve(pluginsDir, plugin, "skills", skill);
83
+ if (!skillDir.startsWith(pluginsRootPrefix))
84
+ continue;
85
+ try {
86
+ const st = await stat(skillDir);
87
+ if (!st.isDirectory())
88
+ continue;
89
+ await access(join(skillDir, "SKILL.md"));
90
+ return skillDir;
91
+ }
92
+ catch {
93
+ // missing or unreadable — try next plugin
94
+ }
95
+ }
96
+ return null;
97
+ }
98
+ /**
99
+ * Run `git -C <dir> config --get remote.origin.url` and parse to owner/repo.
100
+ * Returns null if git is missing, the dir is not a git repo, the remote is
101
+ * absent, or the URL is not a parsable GitHub URL.
102
+ */
103
+ export function readGitOriginOwnerRepo(dir) {
104
+ return new Promise((resolveCb) => {
105
+ execFile("git", ["-C", dir, "config", "--get", "remote.origin.url"], { timeout: GIT_TIMEOUT_MS }, (err, stdoutOrResult) => {
106
+ if (err)
107
+ return resolveCb(null);
108
+ // Node typing differs across overloads; normalize to a string body.
109
+ const stdout = typeof stdoutOrResult === "string"
110
+ ? stdoutOrResult
111
+ : stdoutOrResult?.stdout ?? "";
112
+ resolveCb(parseGitHubRemoteUrl(stdout.trim()));
113
+ });
114
+ });
115
+ }
116
+ /**
117
+ * Resolve a bare skill name to `owner/repo/skill`. Order: cache → lockfile →
118
+ * authored-skill on disk + git remote → bare-name fallback. Every outcome is
119
+ * cached so a successful resolution shells out to git at most once per process.
120
+ */
121
+ export async function resolveSkillApiName(skill, root) {
122
+ const cached = resolverCache.get(skill);
123
+ if (cached !== undefined)
124
+ return cached;
125
+ const lock = readLockfile();
126
+ const entry = lock?.skills?.[skill];
127
+ if (entry?.source) {
128
+ const parsed = parseSource(entry.source);
129
+ if ((parsed.type === "github" ||
130
+ parsed.type === "github-plugin" ||
131
+ parsed.type === "marketplace") &&
132
+ parsed.owner &&
133
+ parsed.repo) {
134
+ return rememberAndReturn(skill, `${parsed.owner}/${parsed.repo}/${skill}`);
135
+ }
136
+ return rememberAndReturn(skill, skill);
137
+ }
138
+ const skillDir = await findAuthoredSkillDir(root, skill);
139
+ if (!skillDir)
140
+ return rememberAndReturn(skill, skill);
141
+ const remote = await readGitOriginOwnerRepo(skillDir);
142
+ if (!remote)
143
+ return rememberAndReturn(skill, skill);
144
+ return rememberAndReturn(skill, `${remote.owner}/${remote.repo}/${skill}`);
145
+ }
146
+ //# sourceMappingURL=skill-name-resolver.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-name-resolver.js","sourceRoot":"","sources":["../../src/eval-server/skill-name-resolver.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,EAAE;AACF,iFAAiF;AACjF,6EAA6E;AAC7E,0EAA0E;AAC1E,+EAA+E;AAC/E,4DAA4D;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,MAAM,cAAc,GAAG,KAAK,CAAC;AAE7B,MAAM,mBAAmB,GAAa;IACpC,uDAAuD;IACvD,4CAA4C;IAC5C,qDAAqD;CACtD,CAAC;AAEF,gFAAgF;AAChF,8EAA8E;AAC9E,4DAA4D;AAC5D,EAAE;A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AAI,KAAK,EAAE,CAAC,CAAC;QAC7E,CAAC;QACD,OAAO,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzD,IAAI,CAAC,QAAQ;QAAE,OAAO,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAEtD,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI,CAAC,MAAM;QAAE,OAAO,iBAAiB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAEpD,OAAO,iBAAiB,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;AAC7E,CAAC"}
@@ -1 +1 @@
1
- import{r as a,j as o,s as g}from"./index-C_-YXE6O.js";/* empty css */function h(r,i){if(!i)return 1;const n=i.toLowerCase(),c=[r.label,r.description??"",...r.keywords??[]].join(" ").toLowerCase();if(c.startsWith(n))return 100;const s=r.label.toLowerCase();if(s.startsWith(n))return 90;if(s.includes(n))return 80;if(c.includes(n))return 60;let l=0;for(const u of c)if(u===n[l]&&l++,l===n.length)return 40;return 0}function j({open:r,onClose:i,commands:n,placeholder:c=g.palette.inputPlaceholder}){const[s,l]=a.useState(""),[u,f]=a.useState(0),m=a.useRef(null),v=a.useRef(null),b=a.useRef(null),p=a.useMemo(()=>n.map(e=>({c:e,s:h(e,s)})).filter(e=>e.s>0).sort((e,x)=>x.s-e.s).map(e=>e.c),[n,s]);if(a.useEffect(()=>{if(r)return m.current=document.activeElement??null,l(""),f(0),requestAnimationFrame(()=>{var t;return(t=v.current)==null?void 0:t.focus()}),()=>{var t,e;(e=(t=m.current)==null?void 0:t.focus)==null||e.call(t),m.current=null}},[r]),a.useEffect(()=>{f(0)},[s]),a.useEffect(()=>{if(!r)return;function t(e){var x;if(e.key==="Escape"){e.preventDefault(),i();return}if(e.key==="ArrowDown"){e.preventDefault(),f(d=>Math.min(d+1,Math.max(p.length-1,0)));return}if(e.key==="ArrowUp"){e.preventDefault(),f(d=>Math.max(d-1,0));return}if(e.key==="Enter"){const d=p[u];d&&(e.preventDefault(),d.onInvoke(),i());return}e.key==="Tab"&&(e.preventDefault(),(x=v.current)==null||x.focus())}return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[r,i,p,u]),!r)return null;const y="command-palette-listbox";return o.jsx("div",{"data-testid":"command-palette",role:"presentation",onClick:t=>{t.target===t.currentTarget&&i()},style:{position:"fixed",inset:0,background:"color-mix(in srgb, var(--bg-canvas) 70%, transparent)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh",zIndex:60},children:o.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":"Command palette",style:{width:"min(560px, 92vw)",background:"var(--bg-canvas)",border:"1px solid var(--border-default)",borderRadius:8,boxShadow:"0 24px 64px rgba(0,0,0,0.2)",overflow:"hidden",fontFamily:"var(--font-sans)",color:"var(--text-primary)"},children:[o.jsx("div",{role:"combobox","aria-expanded":"true","aria-controls":y,"aria-haspopup":"listbox",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-default)"},children:o.jsx("input",{ref:v,type:"text",value:s,onChange:t=>l(t.currentTarget.value),"aria-label":"Command","aria-autocomplete":"list","aria-controls":y,placeholder:c,style:{width:"100%",border:"none",outline:"none",background:"transparent",color:"var(--text-primary)",fontFamily:"var(--font-sans)",fontSize:14,padding:"6px 0"}})}),o.jsxs("ul",{id:y,role:"listbox",style:{listStyle:"none",margin:0,padding:"4px 0",maxHeight:320,overflow:"auto"},children:[p.length===0&&o.jsx("li",{role:"option","aria-selected":"false",style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:12},children:g.palette.emptyResults}),p.map((t,e)=>o.jsxs("li",{role:"option","aria-selected":e===u,onMouseEnter:()=>f(e),onClick:()=>{t.onInvoke(),i()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:e===u?"color-mix(in srgb, var(--accent-surface) 10%, transparent)":"transparent",cursor:"pointer",fontSize:13},children:[o.jsx("span",{children:t.label}),t.description&&o.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)",marginLeft:12},children:t.description})]},t.id))]})]})})}export{j as CommandPalette,j as default,h as scoreCommand};
1
+ import{r as a,j as o,s as g}from"./index-KIcQ5e5a.js";/* empty css */function h(r,i){if(!i)return 1;const n=i.toLowerCase(),c=[r.label,r.description??"",...r.keywords??[]].join(" ").toLowerCase();if(c.startsWith(n))return 100;const s=r.label.toLowerCase();if(s.startsWith(n))return 90;if(s.includes(n))return 80;if(c.includes(n))return 60;let l=0;for(const u of c)if(u===n[l]&&l++,l===n.length)return 40;return 0}function j({open:r,onClose:i,commands:n,placeholder:c=g.palette.inputPlaceholder}){const[s,l]=a.useState(""),[u,f]=a.useState(0),m=a.useRef(null),v=a.useRef(null),b=a.useRef(null),p=a.useMemo(()=>n.map(e=>({c:e,s:h(e,s)})).filter(e=>e.s>0).sort((e,x)=>x.s-e.s).map(e=>e.c),[n,s]);if(a.useEffect(()=>{if(r)return m.current=document.activeElement??null,l(""),f(0),requestAnimationFrame(()=>{var t;return(t=v.current)==null?void 0:t.focus()}),()=>{var t,e;(e=(t=m.current)==null?void 0:t.focus)==null||e.call(t),m.current=null}},[r]),a.useEffect(()=>{f(0)},[s]),a.useEffect(()=>{if(!r)return;function t(e){var x;if(e.key==="Escape"){e.preventDefault(),i();return}if(e.key==="ArrowDown"){e.preventDefault(),f(d=>Math.min(d+1,Math.max(p.length-1,0)));return}if(e.key==="ArrowUp"){e.preventDefault(),f(d=>Math.max(d-1,0));return}if(e.key==="Enter"){const d=p[u];d&&(e.preventDefault(),d.onInvoke(),i());return}e.key==="Tab"&&(e.preventDefault(),(x=v.current)==null||x.focus())}return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[r,i,p,u]),!r)return null;const y="command-palette-listbox";return o.jsx("div",{"data-testid":"command-palette",role:"presentation",onClick:t=>{t.target===t.currentTarget&&i()},style:{position:"fixed",inset:0,background:"color-mix(in srgb, var(--bg-canvas) 70%, transparent)",display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"12vh",zIndex:60},children:o.jsxs("div",{ref:b,role:"dialog","aria-modal":"true","aria-label":"Command palette",style:{width:"min(560px, 92vw)",background:"var(--bg-canvas)",border:"1px solid var(--border-default)",borderRadius:8,boxShadow:"0 24px 64px rgba(0,0,0,0.2)",overflow:"hidden",fontFamily:"var(--font-sans)",color:"var(--text-primary)"},children:[o.jsx("div",{role:"combobox","aria-expanded":"true","aria-controls":y,"aria-haspopup":"listbox",style:{padding:"8px 12px",borderBottom:"1px solid var(--border-default)"},children:o.jsx("input",{ref:v,type:"text",value:s,onChange:t=>l(t.currentTarget.value),"aria-label":"Command","aria-autocomplete":"list","aria-controls":y,placeholder:c,style:{width:"100%",border:"none",outline:"none",background:"transparent",color:"var(--text-primary)",fontFamily:"var(--font-sans)",fontSize:14,padding:"6px 0"}})}),o.jsxs("ul",{id:y,role:"listbox",style:{listStyle:"none",margin:0,padding:"4px 0",maxHeight:320,overflow:"auto"},children:[p.length===0&&o.jsx("li",{role:"option","aria-selected":"false",style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:12},children:g.palette.emptyResults}),p.map((t,e)=>o.jsxs("li",{role:"option","aria-selected":e===u,onMouseEnter:()=>f(e),onClick:()=>{t.onInvoke(),i()},style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 12px",background:e===u?"color-mix(in srgb, var(--accent-surface) 10%, transparent)":"transparent",cursor:"pointer",fontSize:13},children:[o.jsx("span",{children:t.label}),t.description&&o.jsx("span",{style:{fontSize:11,color:"var(--text-secondary)",marginLeft:12},children:t.description})]},t.id))]})]})})}export{j as CommandPalette,j as default,h as scoreCommand};
@@ -0,0 +1,12 @@
1
+ import{j as e,u as H,a as O,R as G,r as c,g as E,b as R,w as _,c as $,t as j,L as S,P as q,E as U,d as K,S as Y}from"./index-KIcQ5e5a.js";/* empty css */const V=[{key:"slashCommands",label:"Slash"},{key:"hooks",label:"Hooks"},{key:"mcp",label:"MCP"},{key:"customSystemPrompt",label:"Prompt"}];function Q({supported:l,label:a}){return e.jsx("span",{style:{display:"inline-block",fontSize:10,padding:"1px 5px",borderRadius:3,marginRight:3,background:l?"var(--color-success-bg, #d4edda)":"var(--surface-3, #2a2a2a)",color:l?"var(--color-success, #28a745)":"var(--text-tertiary, #666)",border:`1px solid ${l?"var(--color-success, #28a745)":"var(--border-subtle, #333)"}`},children:a})}function T({agent:l,checked:a,onToggle:x}){return e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"pointer",border:l.installed?"1px solid var(--color-primary, #6366f1)":"1px solid var(--border-subtle, #333)",background:a?"var(--surface-2, #1e1e1e)":"transparent"},children:[e.jsx("input",{type:"checkbox",checked:a,onChange:x,style:{accentColor:"var(--color-primary, #6366f1)"}}),e.jsxs("div",{style:{flex:1},children:[e.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[e.jsx("span",{style:{fontWeight:500,fontSize:13,color:"var(--text-primary, #fff)"},children:l.displayName}),l.installed&&e.jsx("span",{style:{fontSize:10,padding:"1px 5px",borderRadius:3,background:"var(--color-primary-bg, #312e81)",color:"var(--color-primary, #6366f1)"},children:"installed"})]}),e.jsx("div",{style:{marginTop:3},children:V.map(i=>e.jsx(Q,{supported:l.featureSupport[i.key],label:i.label},i.key))})]})]})}function Z({agents:l,selectedIds:a,onChange:x}){const i=new Set(a),g=l.filter(o=>o.isUniversal),v=l.filter(o=>!o.isUniversal),m=o=>{const h=i.has(o)?a.filter(b=>b!==o):[...a,o];x(h)};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[g.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Universal Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:g.map(o=>e.jsx(T,{agent:o,checked:i.has(o.id),onToggle:()=>m(o.id)},o.id))})]}),v.length>0&&e.jsxs("div",{children:[e.jsx("div",{style:{fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em",color:"var(--text-tertiary, #999)",marginBottom:6},children:"Other Agents"}),e.jsx("div",{style:{display:"flex",flexDirection:"column",gap:4},children:v.map(o=>e.jsx(T,{agent:o,checked:i.has(o.id),onToggle:()=>m(o.id)},o.id))})]})]})}const p={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function J(l){return l?/API usage limits|usage limit/i.test(l)&&/regain access|reset/i.test(l):!1}function X(l){const a=l.match(/regain access on ([^"\\]+?)(?:\s*UTC)?["\\]/i)??l.match(/regain access on ([^"\\]+)/i);return a?`Resets ${a[1].trim()} UTC`:"Quota resets at the start of your next billing period"}function k(l){switch(l){case"claude-cli":return"Uses your logged-in Claude Code session (Pro/Max subscription). No API key. When your quota runs out, excess usage is billed at API rates if you've enabled extra usage.";case"anthropic":return"Direct Anthropic API — pay-per-token. Full Opus / Sonnet / Haiku catalog. Requires ANTHROPIC_API_KEY.";case"openrouter":return"One API key → 300+ models from Anthropic, OpenAI (GPT-5 / o4-mini), Google (Gemini), Meta (Llama) and more. Same prices as direct.";case"ollama":return"Local models on your machine (Llama, Qwen, Mistral, etc.). Zero cost, zero data leaves your laptop.";case"lm-studio":return"Local models via LM Studio's OpenAI-compatible server. Works offline. Pick any model you've loaded in LM Studio.";default:return""}}function L({size:l=14,color:a="currentColor"}){return e.jsx("svg",{width:l,height:l,viewBox:"0 0 24 24",fill:"none",stroke:a,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:e.jsx("path",{d:"M12 3l1.912 5.813a2 2 0 001.275 1.275L21 12l-5.813 1.912a2 2 0 00-1.275 1.275L12 21l-1.912-5.813a2 2 0 00-1.275-1.275L3 12l5.813-1.912a2 2 0 001.275-1.275L12 3z"})})}function te(){const l=H(),{config:a}=O(),x=G.useMemo(()=>{if(typeof window>"u")return{};const t=window.location.hash,s=t.indexOf("?");if(s===-1)return{};const u=new URLSearchParams(t.slice(s+1)),d={};for(const n of["mode","skillName","description","pluginName"]){const f=u.get(n);f&&(d[n]=f)}return d},[]),[i,g]=c.useState("claude-cli"),[v,m]=c.useState("sonnet"),[o,h]=c.useState(!1),[b,P]=c.useState(null),w=c.useRef(!1),[C,I]=c.useState([]),[F,z]=c.useState(()=>E("activeAgent",null));c.useEffect(()=>{function t(){z(E("activeAgent",null))}return window.addEventListener("studio:agent-changed",t),window.addEventListener("storage",t),()=>{window.removeEventListener("studio:agent-changed",t),window.removeEventListener("storage",t)}},[]);const B=F!=="claude-code";c.useEffect(()=>{fetch("/api/agents/installed").then(t=>t.json()).then(t=>{t.agents&&I(t.agents)}).catch(()=>{})},[]),c.useEffect(()=>{var d;if(!a)return;const t=a.providers.filter(n=>n.available),s=R().skillGenModel;if(t.length===0){w.current=!0;return}if(s&&typeof s=="object"&&typeof s.provider=="string"&&typeof s.model=="string"){const n=t.find(N=>N.id===s.provider),f=n==null?void 0:n.models.some(N=>N.id===s.model);if(n&&f){g(s.provider),m(s.model),h(!0),w.current=!0;return}P({provider:s.provider,model:s.model})}if(t.find(n=>n.id==="claude-cli"))g("claude-cli"),m("sonnet");else{const n=t[0];g(n.id),m(((d=n.models[0])==null?void 0:d.id)??"")}h(!1),w.current=!0},[a]),c.useEffect(()=>{const t=s=>{if(s.key!==null&&!s.key.includes("vskill.studio.prefs"))return;const d=R().skillGenModel;d&&typeof d=="object"&&typeof d.provider=="string"&&typeof d.model=="string"&&(g(d.provider),m(d.model),h(!0))};return window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)},[]);const A=c.useCallback((t,s)=>{_("skillGenModel",{provider:t,model:s}),h(!0)},[]),D=c.useCallback(()=>({provider:i,model:v}),[i,v]),W=x.mode==="standalone"?3:void 0,r=$({onCreated:(t,s)=>l(`/skills/${t}/${s}`),resolveAiConfigOverride:D,forceLayout:W});c.useEffect(()=>{x.skillName&&!r.name&&r.setName(j(x.skillName)),x.description&&!r.description&&r.setDescription(x.description),x.description&&!r.aiPrompt&&r.setAiPrompt(x.description),x.pluginName&&!r.plugin&&r.setPlugin(j(x.pluginName))},[]);const y=a==null?void 0:a.providers.find(t=>t.id===i&&t.available),M=c.useMemo(()=>{const t=["---"];return r.description?t.push(`description: "${r.description.replace(/"/g,'\\"')}"`):t.push('description: ""'),r.allowedTools.trim()&&t.push(`allowed-tools: ${r.allowedTools.trim()}`),r.model&&t.push(`model: ${r.model}`),r.targetAgents.length>0&&t.push(`target-agents: ${r.targetAgents.join(", ")}`),t.push("---"),t.push(""),r.body.trim()?t.push(r.body.trim()):(t.push(`# /${r.name||"skill-name"}`),t.push(""),t.push("You are a helpful assistant.")),t.join(`
2
+ `)},[r.name,r.description,r.model,r.allowedTools,r.body]);return e.jsxs("div",{className:"px-4 py-6 sm:px-6 sm:py-7 lg:px-10 lg:py-8 max-w-6xl",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("div",{className:"flex items-center gap-2 text-[12px] mb-3",style:{color:"var(--text-tertiary)"},children:[e.jsx(S,{to:"/",className:"hover:underline",style:{color:"var(--text-tertiary)"},children:"Skills"}),e.jsx("span",{children:"/"}),e.jsx("span",{style:{color:"var(--text-secondary)"},children:"New Skill"})]}),e.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("h2",{className:"text-[22px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),e.jsx("p",{className:"text-[13px] mt-1",style:{color:"var(--text-tertiary)"},children:"Define your skill's metadata, content, and placement"})]}),e.jsxs("div",{className:"inline-flex rounded-lg p-1 self-start sm:self-auto sm:flex-shrink-0",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},children:[e.jsx("button",{onClick:()=>r.setMode("ai"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:r.mode==="ai"?"var(--purple-muted)":"transparent",color:r.mode==="ai"?"var(--purple)":"var(--text-tertiary)",boxShadow:r.mode==="ai"?"0 1px 3px rgba(0,0,0,0.08)":"none"},children:e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(L,{size:14}),"AI-Assisted"]})}),e.jsx("button",{onClick:()=>r.setMode("manual"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:r.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:r.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:r.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:"Manual"})]})]})]}),r.layoutLoading&&e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"}),e.jsx("div",{className:"skeleton h-10 w-full rounded-lg"})]}),!r.layoutLoading&&r.layout&&r.mode==="ai"&&e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6 animate-fade-in",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[e.jsx("div",{className:"w-6 h-6 rounded-md flex items-center justify-center",style:{background:"var(--purple-muted)"},children:e.jsx(L,{size:13,color:"var(--purple)"})}),"Describe Your Skill"]}),e.jsx("textarea",{ref:r.promptRef,value:r.aiPrompt,onChange:t=>r.setAiPrompt(t.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
3
+
4
+ Include any specific behaviors, constraints, or output formats you want.`,rows:6,disabled:r.generating,className:"w-full px-3 py-2.5 rounded-lg text-[13px] resize-y",style:{...p,minHeight:"140px"},onKeyDown:t=>{t.key==="Enter"&&(t.metaKey||t.ctrlKey)&&(t.preventDefault(),r.handleGenerate())}}),e.jsx("p",{className:"text-[11px] mt-2",style:{color:"var(--text-quaternary, var(--text-tertiary))"},children:"Cmd+Enter to generate"})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3 flex items-center gap-2",style:{color:"var(--text-primary)"},children:[e.jsx("span",{children:"Source Model"}),!o&&i==="claude-cli"&&v==="sonnet"&&e.jsx("span",{className:"text-[10px] font-normal uppercase tracking-wider px-1.5 py-0.5 rounded",style:{color:"var(--text-tertiary)",background:"var(--surface-2)"},children:"Default"})]}),b&&e.jsxs("div",{role:"status",className:"mb-3 px-3 py-2 rounded-lg text-[12px] flex items-center justify-between gap-3",style:{background:"var(--surface-2)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)"},children:[e.jsxs("span",{children:["Previous selection ",e.jsxs("code",{children:[b.provider,"/",b.model]})," unavailable — reverted to default."]}),e.jsx("button",{onClick:()=>P(null),className:"text-[11px]",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},"aria-label":"Dismiss notice",children:"✕"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",title:y?void 0:"Install a provider (Ollama / LM Studio / OpenRouter) or run `claude login` to enable model selection.",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Provider"}),e.jsx("select",{value:i,onChange:t=>{var n;const s=t.target.value;g(s);const u=a==null?void 0:a.providers.find(f=>f.id===s),d=((n=u==null?void 0:u.models[0])==null?void 0:n.id)??v;u!=null&&u.models[0]&&m(d),A(s,d)},disabled:r.generating||!y,title:y?k(i)||void 0:"Install a provider (Ollama / LM Studio / OpenRouter) or run `claude login` to enable model selection.",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p,children:a==null?void 0:a.providers.filter(t=>t.available).map(t=>e.jsx("option",{value:t.id,title:k(t.id),children:t.label},t.id))}),k(i)&&e.jsxs("div",{className:"mt-1.5 text-[11px]",style:{color:"var(--text-tertiary)",lineHeight:1.5},children:[k(i),i==="claude-cli"&&e.jsxs(e.Fragment,{children:[" ",e.jsx("a",{href:"https://claude.com/settings/usage",target:"_blank",rel:"noreferrer",style:{color:"var(--color-accent, #2f6f8f)",textDecoration:"underline"},children:"Enable extra usage →"})]})]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Model"}),e.jsx("select",{value:v,onChange:t=>{const s=t.target.value;m(s),A(i,s)},disabled:r.generating||!y,className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p,children:y==null?void 0:y.models.map(t=>e.jsx("option",{value:t.id,children:t.label},t.id))})]})]})]}),B&&C.length>0&&e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:["Target Agents",e.jsx("span",{className:"text-[11px] font-normal ml-2",style:{color:"var(--text-tertiary)"},children:"(optional — leave empty for Claude Code default)"})]}),e.jsx(Z,{agents:C,selectedIds:r.targetAgents,onChange:r.setTargetAgents})]}),r.generating&&r.aiProgress.length>0&&e.jsx("div",{children:e.jsx(q,{entries:r.aiProgress,isRunning:!0})}),r.aiError&&e.jsx("div",{children:J(r.aiError)?e.jsxs("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--yellow-muted)",color:"var(--text-primary)",border:"1px solid var(--yellow)"},children:[e.jsx("div",{style:{fontWeight:600,marginBottom:4},children:"Your Claude Max subscription quota is exhausted"}),e.jsxs("div",{style:{fontSize:12,color:"var(--text-secondary)",lineHeight:1.5,marginBottom:8},children:[X(r.aiError),". Switch to another provider (Anthropic API, OpenRouter, or a local model) or enable extra usage to continue past your monthly quota."]}),e.jsxs("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[e.jsx("a",{href:"https://claude.com/settings/usage",target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",padding:"4px 10px",fontSize:12,fontWeight:500,color:"var(--color-paper, #fff)",background:"var(--color-accent, #2f6f8f)",borderRadius:4,textDecoration:"none"},children:"Enable extra usage →"}),e.jsx("button",{onClick:r.clearAiError,style:{padding:"4px 10px",fontSize:12,color:"var(--text-primary)",background:"transparent",border:"1px solid var(--border-default)",borderRadius:4,cursor:"pointer"},children:"Dismiss"})]})]}):r.aiClassifiedError?e.jsx(U,{error:r.aiClassifiedError,onRetry:r.handleGenerate,onDismiss:r.clearAiError}):e.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid var(--red-muted)"},children:r.aiError})}),e.jsxs("div",{className:"flex items-center gap-3",children:[r.generating?e.jsx("button",{onClick:r.handleCancelGenerate,className:"px-6 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:"var(--surface-3)",color:"var(--text-secondary)"},children:"Cancel Generation"}):e.jsxs("button",{onClick:r.handleGenerate,disabled:!r.aiPrompt.trim(),className:"px-6 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150 flex items-center gap-2",style:{background:r.aiPrompt.trim()?"var(--color-action, #2F5B8E)":"var(--surface-3)",color:r.aiPrompt.trim()?"var(--color-action-ink, #FFFFFF)":"var(--text-tertiary)",cursor:r.aiPrompt.trim()?"pointer":"not-allowed"},children:[e.jsx(L,{size:14})," Generate Skill"]}),e.jsx(S,{to:"/",className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)"},children:"Cancel"})]})]}),e.jsx("div",{className:"w-full lg:w-[340px] lg:flex-shrink-0",children:e.jsx("div",{className:"lg:sticky lg:top-8",children:e.jsxs("div",{className:"glass-card p-4",children:[e.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"SKILL.md Preview"}),e.jsx("pre",{className:"text-[11px] font-mono leading-relaxed overflow-auto max-h-[500px] p-3 rounded-lg",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:M})]})})})]}),!r.layoutLoading&&r.layout&&r.mode==="manual"&&e.jsx("div",{className:"animate-fade-in",children:e.jsxs("div",{className:"flex flex-col lg:flex-row gap-6",children:[e.jsxs("div",{className:"flex-1 min-w-0 space-y-5",children:[e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Location"}),r.creatableLayouts.length>1&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Layout"}),e.jsxs("div",{className:"flex gap-2",children:[r.creatableLayouts.map(t=>e.jsx("button",{onClick:()=>{r.setSelectedLayout(t.layout);const s=t.existingPlugins[0];r.setPlugin(s||""),r.setNewPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:r.selectedLayout===t.layout?"var(--accent)":"var(--surface-3)",color:r.selectedLayout===t.layout?"var(--color-paper)":"var(--text-secondary)",border:`1px solid ${r.selectedLayout===t.layout?"var(--accent)":"var(--border-subtle)"}`},children:t.label},t.layout)),!r.creatableLayouts.find(t=>t.layout===3)&&e.jsx("button",{onClick:()=>{r.setSelectedLayout(3),r.setPlugin("")},className:"px-3 py-1.5 rounded-lg text-[12px] font-medium transition-all duration-150",style:{background:r.selectedLayout===3?"var(--accent)":"var(--surface-3)",color:r.selectedLayout===3?"var(--color-paper)":"var(--text-secondary)",border:`1px solid ${r.selectedLayout===3?"var(--accent)":"var(--border-subtle)"}`},children:"Root skills/"})]})]}),r.selectedLayout!==3&&e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Plugin"}),e.jsxs("select",{value:r.plugin,onChange:t=>{r.setPlugin(t.target.value),r.setNewPlugin("")},className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p,children:[r.availablePlugins.map(t=>e.jsx("option",{value:t,children:t},t)),e.jsx("option",{value:"__new__",children:"+ New plugin..."})]}),r.plugin==="__new__"&&e.jsx("input",{type:"text",value:r.newPlugin,onChange:t=>r.setNewPlugin(j(t.target.value)),placeholder:"my-plugin",className:"w-full mt-2 px-3 py-2 rounded-lg text-[13px]",style:p})]}),e.jsx("div",{className:"px-3 py-2 rounded-lg text-[11px] font-mono",style:{background:"var(--surface-0)",color:"var(--text-tertiary)",border:"1px solid var(--border-subtle)",wordBreak:"break-all",lineHeight:1.55},children:r.pathPreview})]}),r.showPluginRecommendation&&r.pluginLayoutInfo&&r.selectedLayout===3&&e.jsxs("div",{className:"px-4 py-3 rounded-lg text-[12px] animate-fade-in flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",style:{background:"var(--accent-muted)",color:"var(--text-secondary)",border:"1px solid var(--accent-muted)"},children:[e.jsxs("div",{className:"flex items-start gap-2 min-w-0",children:[e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("circle",{cx:"12",cy:"12",r:"10"}),e.jsx("line",{x1:"12",y1:"16",x2:"12",y2:"12"}),e.jsx("line",{x1:"12",y1:"8",x2:"12.01",y2:"8"})]}),e.jsxs("span",{children:["Plugins detected (",e.jsx("strong",{children:r.pluginLayoutInfo.plugins.slice(0,3).join(", ")}),"). Add this skill to a plugin for better organization."]})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[e.jsx("button",{onClick:r.applyPluginRecommendation,className:"px-3 py-1 rounded-md text-[11px] font-medium",style:{background:"var(--accent)",color:"var(--color-paper)",border:"none",cursor:"pointer"},children:"Use plugin"}),e.jsx("button",{onClick:()=>r.setShowPluginRecommendation(!1),className:"w-5 h-5 rounded flex items-center justify-center",style:{color:"var(--text-tertiary)",background:"none",border:"none",cursor:"pointer"},children:e.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsx("h3",{className:"text-[13px] font-semibold mb-3",style:{color:"var(--text-primary)"},children:"Skill Details"}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:["Name ",e.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),e.jsx("input",{type:"text",value:r.name,onChange:t=>r.setName(j(t.target.value,!1)),placeholder:"my-skill",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p})]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:["Description ",e.jsx("span",{style:{color:"var(--red)"},children:"*"})]}),e.jsx("textarea",{value:r.description,onChange:t=>r.setDescription(t.target.value),placeholder:"Brief description — used for auto-activation keywords",rows:3,className:"w-full px-3 py-2 rounded-lg text-[13px] resize-y",style:{...p,minHeight:"72px"}}),e.jsx("p",{className:"text-[11px] mt-1",style:{color:"var(--text-tertiary)"},children:"This text is used by Claude to decide when to activate the skill"})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-4 mb-4",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Model"}),e.jsxs("select",{value:r.model,onChange:t=>r.setModel(t.target.value),className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p,children:[e.jsx("option",{value:"",children:"Any (default)"}),e.jsx("option",{value:"opus",children:"Opus"}),e.jsx("option",{value:"sonnet",children:"Sonnet"}),e.jsx("option",{value:"haiku",children:"Haiku"})]})]}),e.jsxs("div",{className:"flex-1",children:[e.jsx("label",{className:"text-[11px] font-medium uppercase tracking-wider mb-2 block",style:{color:"var(--text-tertiary)"},children:"Allowed Tools"}),e.jsx("input",{type:"text",value:r.allowedTools,onChange:t=>r.setAllowedTools(t.target.value),placeholder:"Read, Write, Edit, Bash, Glob, Grep",className:"w-full px-3 py-2 rounded-lg text-[13px]",style:p})]})]})]}),e.jsxs("div",{className:"glass-card p-5",children:[e.jsxs("div",{className:"flex items-center justify-between mb-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[e.jsx("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center",style:{background:"var(--accent-muted)"},children:e.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"var(--accent)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),e.jsx("polyline",{points:"14 2 14 8 20 8"}),e.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),e.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]})}),e.jsxs("div",{children:[e.jsx("span",{className:"text-[13px] font-semibold",style:{color:"var(--text-primary)"},children:"SKILL.md"}),e.jsx("span",{className:"text-[11px] ml-2",style:{color:"var(--text-tertiary)"},children:"Skill Definition"})]})]}),e.jsx("div",{className:"flex items-center",style:{background:"var(--surface-2)",borderRadius:8,padding:2,gap:1},children:["write","preview"].map(t=>e.jsxs("button",{onClick:()=>r.setBodyViewMode(t),className:"flex items-center gap-1 rounded-md transition-all duration-150",style:{padding:"4px 10px",background:r.bodyViewMode===t?"var(--surface-4)":"transparent",color:r.bodyViewMode===t?"var(--text-primary)":"var(--text-tertiary)",fontSize:11,fontWeight:r.bodyViewMode===t?600:400,border:"none",cursor:"pointer"},children:[t==="write"?e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("polyline",{points:"16 18 22 12 16 6"}),e.jsx("polyline",{points:"8 6 2 12 8 18"})]}):e.jsxs("svg",{width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:[e.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),e.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),e.jsx("span",{children:t==="write"?"Write":"Preview"})]},t))})]}),r.bodyViewMode==="write"?e.jsx("textarea",{value:r.body,onChange:t=>r.setBody(t.target.value),placeholder:`# /my-skill
5
+
6
+ You are an expert at...
7
+
8
+ ## Workflow
9
+
10
+ 1. First, understand the request
11
+ 2. Then, implement the solution
12
+ 3. Finally, verify the result`,rows:12,className:"w-full px-3 py-2 rounded-lg text-[13px] font-mono resize-y",style:{...p,minHeight:"200px"}}):r.body.trim()?e.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"200px",maxHeight:"400px",overflowY:"auto"},dangerouslySetInnerHTML:{__html:K(r.body)}}):e.jsx("div",{className:"text-[13px] leading-relaxed overflow-x-auto rounded-lg px-4 py-3",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",minHeight:"200px",maxHeight:"400px",overflowY:"auto"},children:e.jsx("span",{style:{color:"var(--text-tertiary)"},children:"Start writing to see preview"})})]}),e.jsx(Y,{skillName:r.name||"{skill}",hasEvals:!1,isDraft:r.draftSaved}),r.error&&e.jsx("div",{className:"px-4 py-3 rounded-lg text-[13px]",style:{background:"var(--red-muted)",color:"var(--red)",border:"1px solid var(--red-muted)"},children:r.error}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:r.handleCreate,disabled:r.creating||!r.name||!r.description,className:"px-5 py-2.5 rounded-lg text-[13px] font-medium transition-all duration-150",style:{background:r.creating||!r.name||!r.description?"var(--surface-3)":"var(--color-action, #2F5B8E)",color:r.creating||!r.name||!r.description?"var(--text-tertiary)":"var(--color-action-ink, #FFFFFF)",cursor:r.creating||!r.name||!r.description?"not-allowed":"pointer",opacity:r.creating?.7:1},children:r.creating?"Creating...":"Create Skill"}),e.jsx(S,{to:"/",className:"px-4 py-2.5 rounded-lg text-[13px] font-medium",style:{color:"var(--text-secondary)"},children:"Cancel"})]})]}),e.jsx("div",{className:"w-full lg:w-[340px] lg:flex-shrink-0",children:e.jsx("div",{className:"lg:sticky lg:top-8",children:e.jsxs("div",{className:"glass-card p-4",children:[e.jsx("h3",{className:"text-[11px] font-semibold uppercase tracking-wider mb-3",style:{color:"var(--text-tertiary)"},children:"SKILL.md Preview"}),e.jsx("pre",{className:"text-[11px] font-mono leading-relaxed overflow-auto max-h-[500px] p-3 rounded-lg",style:{background:"var(--surface-0)",color:"var(--text-secondary)",border:"1px solid var(--border-subtle)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:M})]})})})]})})]})}export{te as CreateSkillPage};
@@ -1 +1 @@
1
- import{r as u,j as t}from"./index-C_-YXE6O.js";/* empty css */function v(s,r){const[x,m]=s.split("."),[f,o]=r.split("."),n=Number(x),i=Number(m),l=Number(f),d=Number(o);return!Number.isFinite(n)||!Number.isFinite(l)?(console.warn(`[semverBump] unparseable version: installed=${s} latest=${r}`),"patch"):l>n?"major":!Number.isFinite(i)||!Number.isFinite(d)?(console.warn(`[semverBump] unparseable minor: installed=${s} latest=${r}`),"patch"):d>i?"minor":"patch"}const g={major:{bg:"var(--red-muted)",text:"var(--red)"},minor:{bg:"var(--yellow-muted)",text:"var(--yellow)"},patch:{bg:"var(--green-muted)",text:"var(--green)"}};function j({updates:s,isRefreshing:r,onRefresh:x,onSelectSkill:m,onViewAll:f,onClose:o,anchorRef:n,diffSummariesById:i}){const l=u.useRef(null),d=u.useRef(null);u.useEffect(()=>{var e;(e=d.current)==null||e.focus()},[]),u.useEffect(()=>{function e(a){l.current&&(l.current.contains(a.target)||n!=null&&n.current&&n.current.contains(a.target)||o())}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o,n]),u.useEffect(()=>{function e(a){var p;a.key==="Escape"&&(a.preventDefault(),o(),(p=n==null?void 0:n.current)==null||p.focus())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o,n]);const c=s.filter(e=>e.updateAvailable);return t.jsxs("div",{ref:l,role:"dialog","aria-modal":"false","aria-label":"Skill update summary","data-testid":"update-dropdown",style:{position:"absolute",top:"calc(100% + 6px)",right:0,width:320,maxHeight:400,overflow:"auto",background:"var(--bg-surface)",border:"1px solid var(--border-default)",borderRadius:8,padding:10,zIndex:1e3,fontFamily:"var(--font-sans)",display:"flex",flexDirection:"column",gap:6},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"2px 4px 6px",borderBottom:"1px solid var(--border-default)"},children:[t.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:c.length===0?"No updates available":`${c.length} updates available`}),t.jsx("button",{type:"button","data-testid":"update-dropdown-refresh",onClick:x,disabled:r,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono)",cursor:r?"not-allowed":"pointer",padding:"2px 6px"},children:r?"Refreshing…":"Refresh"})]}),c.length>0?t.jsx("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:c.map((e,a)=>{const p=e.latest?v(e.installed,e.latest):"patch",y=g[p],b=i==null?void 0:i.get(e.name);return t.jsx("li",{style:{margin:0},children:t.jsxs("button",{ref:a===0?d:void 0,type:"button","data-testid":"update-dropdown-row","data-skill-name":e.name,onClick:()=>m(e),style:{display:"flex",alignItems:"flex-start",gap:8,width:"100%",padding:"6px 8px",background:"transparent",border:"none",borderRadius:4,cursor:"pointer",color:"var(--text-primary)",fontFamily:"inherit",fontSize:12,textAlign:"left"},children:[t.jsx("span",{"aria-hidden":"true","data-testid":"update-dropdown-bump-dot","data-bump":p,style:{width:8,height:8,borderRadius:"50%",background:y.text,flexShrink:0,marginTop:4}}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0,flex:1},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[t.jsx("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),t.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:[e.installed," → ",e.latest??"?"]})]}),b&&t.jsx("span",{"data-testid":"update-dropdown-diff-summary",style:{fontSize:11,color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b})]})]})},e.name)})}):t.jsx("div",{style:{padding:"12px 4px",fontSize:12,color:"var(--text-secondary)"},children:"All installed skills are up to date."}),t.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"4px 4px 0",borderTop:"1px solid var(--border-default)",marginTop:2},children:t.jsx("button",{type:"button","data-testid":"update-dropdown-view-all",onClick:f,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-sans)",cursor:"pointer",padding:"4px 6px"},children:"View all"})})]})}export{j as default};
1
+ import{r as u,j as t}from"./index-KIcQ5e5a.js";/* empty css */function v(s,r){const[x,m]=s.split("."),[f,o]=r.split("."),n=Number(x),i=Number(m),l=Number(f),d=Number(o);return!Number.isFinite(n)||!Number.isFinite(l)?(console.warn(`[semverBump] unparseable version: installed=${s} latest=${r}`),"patch"):l>n?"major":!Number.isFinite(i)||!Number.isFinite(d)?(console.warn(`[semverBump] unparseable minor: installed=${s} latest=${r}`),"patch"):d>i?"minor":"patch"}const g={major:{bg:"var(--red-muted)",text:"var(--red)"},minor:{bg:"var(--yellow-muted)",text:"var(--yellow)"},patch:{bg:"var(--green-muted)",text:"var(--green)"}};function j({updates:s,isRefreshing:r,onRefresh:x,onSelectSkill:m,onViewAll:f,onClose:o,anchorRef:n,diffSummariesById:i}){const l=u.useRef(null),d=u.useRef(null);u.useEffect(()=>{var e;(e=d.current)==null||e.focus()},[]),u.useEffect(()=>{function e(a){l.current&&(l.current.contains(a.target)||n!=null&&n.current&&n.current.contains(a.target)||o())}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[o,n]),u.useEffect(()=>{function e(a){var p;a.key==="Escape"&&(a.preventDefault(),o(),(p=n==null?void 0:n.current)==null||p.focus())}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o,n]);const c=s.filter(e=>e.updateAvailable);return t.jsxs("div",{ref:l,role:"dialog","aria-modal":"false","aria-label":"Skill update summary","data-testid":"update-dropdown",style:{position:"absolute",top:"calc(100% + 6px)",right:0,width:320,maxHeight:400,overflow:"auto",background:"var(--bg-surface)",border:"1px solid var(--border-default)",borderRadius:8,padding:10,zIndex:1e3,fontFamily:"var(--font-sans)",display:"flex",flexDirection:"column",gap:6},children:[t.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"2px 4px 6px",borderBottom:"1px solid var(--border-default)"},children:[t.jsx("span",{style:{fontSize:12,fontWeight:600,color:"var(--text-primary)"},children:c.length===0?"No updates available":`${c.length} updates available`}),t.jsx("button",{type:"button","data-testid":"update-dropdown-refresh",onClick:x,disabled:r,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-mono)",cursor:r?"not-allowed":"pointer",padding:"2px 6px"},children:r?"Refreshing…":"Refresh"})]}),c.length>0?t.jsx("ul",{role:"list",style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:2},children:c.map((e,a)=>{const p=e.latest?v(e.installed,e.latest):"patch",y=g[p],b=i==null?void 0:i.get(e.name);return t.jsx("li",{style:{margin:0},children:t.jsxs("button",{ref:a===0?d:void 0,type:"button","data-testid":"update-dropdown-row","data-skill-name":e.name,onClick:()=>m(e),style:{display:"flex",alignItems:"flex-start",gap:8,width:"100%",padding:"6px 8px",background:"transparent",border:"none",borderRadius:4,cursor:"pointer",color:"var(--text-primary)",fontFamily:"inherit",fontSize:12,textAlign:"left"},children:[t.jsx("span",{"aria-hidden":"true","data-testid":"update-dropdown-bump-dot","data-bump":p,style:{width:8,height:8,borderRadius:"50%",background:y.text,flexShrink:0,marginTop:4}}),t.jsxs("span",{style:{display:"flex",flexDirection:"column",gap:2,minWidth:0,flex:1},children:[t.jsxs("span",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[t.jsx("span",{style:{minWidth:0,flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),t.jsxs("span",{style:{fontFamily:"var(--font-mono)",fontSize:10,color:"var(--text-secondary)",fontVariantNumeric:"tabular-nums"},children:[e.installed," → ",e.latest??"?"]})]}),b&&t.jsx("span",{"data-testid":"update-dropdown-diff-summary",style:{fontSize:11,color:"var(--text-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:b})]})]})},e.name)})}):t.jsx("div",{style:{padding:"12px 4px",fontSize:12,color:"var(--text-secondary)"},children:"All installed skills are up to date."}),t.jsx("div",{style:{display:"flex",justifyContent:"flex-end",padding:"4px 4px 0",borderTop:"1px solid var(--border-default)",marginTop:2},children:t.jsx("button",{type:"button","data-testid":"update-dropdown-view-all",onClick:f,style:{background:"transparent",border:"none",color:"var(--text-secondary)",fontSize:11,fontFamily:"var(--font-sans)",cursor:"pointer",padding:"4px 6px"},children:"View all"})})]})}export{j as default};