vskill 0.5.131 → 0.5.133
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/agents.json +1 -1
- package/dist/commands/update.d.ts +31 -0
- package/dist/commands/update.js +113 -4
- package/dist/commands/update.js.map +1 -1
- package/dist/eval-server/api-routes.js +7 -4
- package/dist/eval-server/api-routes.js.map +1 -1
- package/dist/eval-server/git-routes.d.ts +2 -0
- package/dist/eval-server/git-routes.js +127 -5
- package/dist/eval-server/git-routes.js.map +1 -1
- package/dist/eval-server/skill-name-resolver.d.ts +29 -4
- package/dist/eval-server/skill-name-resolver.js +51 -16
- package/dist/eval-server/skill-name-resolver.js.map +1 -1
- package/dist/eval-ui/assets/{CommandPalette-BIjKkHCC.js → CommandPalette-BRco5VQ_.js} +1 -1
- package/dist/eval-ui/assets/{CreateSkillPage-CmV0WZOn.js → CreateSkillPage-DJqOEoJ4.js} +1 -1
- package/dist/eval-ui/assets/{FindSkillsPalette-BtYgEsVD.js → FindSkillsPalette-DMw8Y-MA.js} +2 -2
- package/dist/eval-ui/assets/{SearchPaletteCore-CAEO357X.js → SearchPaletteCore-cxev8h5r.js} +1 -1
- package/dist/eval-ui/assets/{SkillDetailPanel-AH9wV3VU.js → SkillDetailPanel-7onY0ArQ.js} +1 -1
- package/dist/eval-ui/assets/{UpdateDropdown-BwMxB2Ub.js → UpdateDropdown-CaT7AjS5.js} +1 -1
- package/dist/eval-ui/assets/index-BLduRWyM.js +102 -0
- package/dist/eval-ui/index.html +1 -1
- package/package.json +1 -1
- package/dist/eval-ui/assets/index-ZByf-wxl.js +0 -102
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
// and gh-CLI-based repo creation on top of these primitives.
|
|
11
11
|
// ---------------------------------------------------------------------------
|
|
12
12
|
import { spawn } from "node:child_process";
|
|
13
|
-
import { sendJson, LOCALHOST_ORIGIN_RE } from "./router.js";
|
|
13
|
+
import { sendJson, readBody, LOCALHOST_ORIGIN_RE } from "./router.js";
|
|
14
|
+
import { createLlmClient } from "../eval/llm.js";
|
|
14
15
|
const DEFAULT_TIMEOUT_MS = 60_000;
|
|
15
16
|
function getTimeoutMs() {
|
|
16
17
|
const raw = process.env.GIT_PUBLISH_TIMEOUT_MS;
|
|
@@ -113,13 +114,100 @@ export function makeGetGitRemoteHandler(root) {
|
|
|
113
114
|
sendJson(res, { remoteUrl, branch, hasRemote: remoteUrl.length > 0 }, 200);
|
|
114
115
|
};
|
|
115
116
|
}
|
|
117
|
+
async function collectDiffSummary(root, timeoutMs) {
|
|
118
|
+
const [staged, unstaged, status] = await Promise.all([
|
|
119
|
+
runGitCommand(["diff", "--staged"], root, timeoutMs),
|
|
120
|
+
runGitCommand(["diff"], root, timeoutMs),
|
|
121
|
+
runGitCommand(["status", "--porcelain"], root, timeoutMs),
|
|
122
|
+
]);
|
|
123
|
+
const stagedText = staged.exitCode === 0 ? staged.stdout : "";
|
|
124
|
+
const unstagedText = unstaged.exitCode === 0 ? unstaged.stdout : "";
|
|
125
|
+
const diff = [stagedText, unstagedText].filter(Boolean).join("\n");
|
|
126
|
+
const statusText = status.exitCode === 0 ? status.stdout : "";
|
|
127
|
+
const fileCount = statusText
|
|
128
|
+
.split("\n")
|
|
129
|
+
.filter((l) => l.trim().length > 0).length;
|
|
130
|
+
return { hasChanges: fileCount > 0, diff, fileCount };
|
|
131
|
+
}
|
|
132
|
+
// ---------------------------------------------------------------------------
|
|
133
|
+
// POST /api/git/diff
|
|
134
|
+
//
|
|
135
|
+
// Returns the combined staged + unstaged diff plus a dirty/file-count summary.
|
|
136
|
+
// The UI calls this when the user clicks Publish to decide whether to open
|
|
137
|
+
// the commit-message drawer (dirty) or just push (clean).
|
|
138
|
+
// ---------------------------------------------------------------------------
|
|
139
|
+
export function makePostGitDiffHandler(root) {
|
|
140
|
+
return async function handler(req, res) {
|
|
141
|
+
if (!isRequestAllowed(req)) {
|
|
142
|
+
sendJson(res, { error: "forbidden" }, 403);
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const summary = await collectDiffSummary(root, getTimeoutMs());
|
|
146
|
+
sendJson(res, summary, 200);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
// ---------------------------------------------------------------------------
|
|
150
|
+
// POST /api/git/commit-message
|
|
151
|
+
//
|
|
152
|
+
// Body: `{ provider?: ProviderName, model?: string }` — reuses the user's
|
|
153
|
+
// already-configured studio provider (same one used by AI Edit, Improve,
|
|
154
|
+
// Generate). Runs git diff, sends the patch to the LLM, returns the message.
|
|
155
|
+
// Returns 400 when there are no changes, 500 on LLM error.
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
const COMMIT_MESSAGE_SYSTEM_PROMPT = "You write concise, conventional-commit-style git commit messages. " +
|
|
158
|
+
"Output ONLY the commit message itself — no quotes, no markdown, no preamble. " +
|
|
159
|
+
"Format: a single subject line under 72 chars, optionally followed by a blank " +
|
|
160
|
+
"line and a body wrapped at 72 chars. Use lowercase type prefix when applicable " +
|
|
161
|
+
"(feat:, fix:, refactor:, docs:, test:, chore:). Be specific about what changed " +
|
|
162
|
+
"and why, but stay terse.";
|
|
163
|
+
const DIFF_TRUNCATION_CAP = 10_000;
|
|
164
|
+
export function makePostGitCommitMessageHandler(root) {
|
|
165
|
+
return async function handler(req, res) {
|
|
166
|
+
if (!isRequestAllowed(req)) {
|
|
167
|
+
sendJson(res, { error: "forbidden" }, 403);
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
let body;
|
|
171
|
+
try {
|
|
172
|
+
body = (await readBody(req));
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
sendJson(res, { error: err instanceof Error ? err.message : "invalid body" }, 400);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
const summary = await collectDiffSummary(root, getTimeoutMs());
|
|
179
|
+
if (!summary.hasChanges) {
|
|
180
|
+
sendJson(res, { error: "no changes to commit", hasChanges: false }, 400);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
// Cap diff size so we don't blow context windows / pricing on huge patches.
|
|
184
|
+
let payload = summary.diff;
|
|
185
|
+
let truncated = false;
|
|
186
|
+
if (payload.length > DIFF_TRUNCATION_CAP) {
|
|
187
|
+
payload = payload.slice(0, DIFF_TRUNCATION_CAP);
|
|
188
|
+
truncated = true;
|
|
189
|
+
}
|
|
190
|
+
const userPrompt = `Generate a commit message for the following diff` +
|
|
191
|
+
(truncated ? ` (truncated to first ${DIFF_TRUNCATION_CAP} chars of a larger patch)` : "") +
|
|
192
|
+
`:\n\n${payload}`;
|
|
193
|
+
try {
|
|
194
|
+
const client = createLlmClient({ provider: body.provider, model: body.model });
|
|
195
|
+
const result = await client.generate(COMMIT_MESSAGE_SYSTEM_PROMPT, userPrompt);
|
|
196
|
+
sendJson(res, { message: result.text.trim() }, 200);
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
200
|
+
sendJson(res, { error: msg }, 500);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
116
204
|
// ---------------------------------------------------------------------------
|
|
117
205
|
// POST /api/git/publish
|
|
118
206
|
//
|
|
119
|
-
// Pushes already-committed changes
|
|
120
|
-
//
|
|
121
|
-
//
|
|
122
|
-
//
|
|
207
|
+
// Pushes already-committed changes. When body.commitMessage is provided AND
|
|
208
|
+
// the working tree is dirty, also runs `git add -A && git commit -m "<msg>"`
|
|
209
|
+
// before push. The full 0742 increment may layer dirty-pill, SSE streaming,
|
|
210
|
+
// and gh-CLI repo creation on top.
|
|
123
211
|
// ---------------------------------------------------------------------------
|
|
124
212
|
export function makePostGitPublishHandler(root) {
|
|
125
213
|
return async function handler(req, res) {
|
|
@@ -128,7 +216,37 @@ export function makePostGitPublishHandler(root) {
|
|
|
128
216
|
sendJson(res, { success: false, error: msg, stderr: msg }, 403);
|
|
129
217
|
return;
|
|
130
218
|
}
|
|
219
|
+
let body = {};
|
|
220
|
+
try {
|
|
221
|
+
body = (await readBody(req));
|
|
222
|
+
}
|
|
223
|
+
catch {
|
|
224
|
+
// Empty body / malformed body — fall back to "no commit" mode (today's
|
|
225
|
+
// happy path). We don't fail loudly here because the original 0759
|
|
226
|
+
// contract accepted no body at all.
|
|
227
|
+
}
|
|
131
228
|
const timeout = getTimeoutMs();
|
|
229
|
+
// Optional commit phase. We only commit when the caller supplied a message
|
|
230
|
+
// AND there's something to commit. A clean tree with a stray message is a
|
|
231
|
+
// no-op (we still push, in case there are unpushed commits).
|
|
232
|
+
if (typeof body.commitMessage === "string" && body.commitMessage.trim().length > 0) {
|
|
233
|
+
const status = await runGitCommand(["status", "--porcelain"], root, timeout);
|
|
234
|
+
const dirty = status.exitCode === 0 && status.stdout.trim().length > 0;
|
|
235
|
+
if (dirty) {
|
|
236
|
+
const add = await runGitCommand(["add", "-A"], root, timeout);
|
|
237
|
+
if (add.exitCode !== 0) {
|
|
238
|
+
const errorMsg = (add.stderr || add.stdout).trim() || "git add failed";
|
|
239
|
+
sendJson(res, { success: false, error: errorMsg, stdout: add.stdout, stderr: add.stderr }, 500);
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
const commit = await runGitCommand(["commit", "-m", body.commitMessage], root, timeout);
|
|
243
|
+
if (commit.exitCode !== 0) {
|
|
244
|
+
const errorMsg = (commit.stderr || commit.stdout).trim() || "git commit failed";
|
|
245
|
+
sendJson(res, { success: false, error: errorMsg, stdout: commit.stdout, stderr: commit.stderr }, 500);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
132
250
|
const push = await runGitCommand(["push"], root, timeout);
|
|
133
251
|
if (push.timedOut) {
|
|
134
252
|
const timeoutMsg = "timeout: git push exceeded GIT_PUBLISH_TIMEOUT_MS";
|
|
@@ -166,6 +284,10 @@ export function makePostGitPublishHandler(root) {
|
|
|
166
284
|
export function registerGitRoutes(router, root) {
|
|
167
285
|
const remoteHandler = makeGetGitRemoteHandler(root);
|
|
168
286
|
router.get("/api/git/remote", (req, res) => remoteHandler(req, res));
|
|
287
|
+
const diffHandler = makePostGitDiffHandler(root);
|
|
288
|
+
router.post("/api/git/diff", (req, res) => diffHandler(req, res));
|
|
289
|
+
const commitMessageHandler = makePostGitCommitMessageHandler(root);
|
|
290
|
+
router.post("/api/git/commit-message", (req, res) => commitMessageHandler(req, res));
|
|
169
291
|
const publishHandler = makePostGitPublishHandler(root);
|
|
170
292
|
router.post("/api/git/publish", (req, res) => publishHandler(req, res));
|
|
171
293
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-routes.js","sourceRoot":"","sources":["../../src/eval-server/git-routes.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kDAAkD;AAClD,EAAE;AACF,4DAA4D;AAC5D,qFAAqF;AACrF,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,6EAA6E;AAC7E,6DAA6D;AAC7D,8EAA8E;AAG9E,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAS5D,MAAM,kBAAkB,GAAG,MAAM,CAAC;AAElC,SAAS,YAAY;IACnB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;IAC/C,IAAI,CAAC,GAAG;QAAE,OAAO,kBAAkB,CAAC;IACpC,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IACtB,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC;AAC9D,CAAC;AAED,0EAA0E;AAC1E,mEAAmE;AACnE,SAAS,aAAa,CACpB,IAAuB,EACvB,GAAW,EACX,SAAiB;IAEjB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,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E,IAAY;IAC5D,MAAM,aAAa,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACpD,MAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAErE,MAAM,WAAW,GAAG,sBAAsB,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAElE,MAAM,oBAAoB,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAC;IACnE,MAAM,CAAC,IAAI,CAAC,yBAAyB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,oBAAoB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;IAErF,MAAM,cAAc,GAAG,yBAAyB,CAAC,IAAI,CAAC,CAAC;IACvD,MAAM,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,cAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -41,8 +41,33 @@ export declare function readGitOriginOwnerRepo(dir: string): Promise<{
|
|
|
41
41
|
repo: string;
|
|
42
42
|
} | null>;
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* Decide whether `plugin` is an installed-agent dir (`.claude`, `.cursor`,
|
|
45
|
+
* `.windsurf`, `.codex`, `.openclaw`, `.agent`, `.kiro`, `.gemini`,
|
|
46
|
+
* `.github`, `.aider`, `.copilot`, `.opencode`, `.pi`, ...). The convention
|
|
47
|
+
* is uniform: every supported agent dir starts with `.`.
|
|
48
|
+
*
|
|
49
|
+
* Used by the resolver to pick the right "what is the upstream of this skill"
|
|
50
|
+
* branch: installed-agent views go straight to the lockfile (which records
|
|
51
|
+
* the source the install came from); authoring views run the source-tree
|
|
52
|
+
* probe first so the Studio sees the SAME upstream the author publishes to.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isInstalledAgentDirPlugin(plugin: string | null | undefined): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Resolve a bare skill name to `owner/repo/skill`.
|
|
57
|
+
*
|
|
58
|
+
* 0765: `plugin` is now part of the lookup. When `plugin` identifies an
|
|
59
|
+
* installed-agent dir (e.g. `.claude/scout`), the lockfile-derived upstream
|
|
60
|
+
* wins — the user is looking at a downstream copy whose source is recorded
|
|
61
|
+
* in the lockfile, NOT the same-named source-tree skill in the local repo.
|
|
62
|
+
* For authoring plugins (e.g. `vskill/scout`), the existing 0761 source-tree
|
|
63
|
+
* probe runs first.
|
|
64
|
+
*
|
|
65
|
+
* Cache key is `${plugin}::${skill}` so an installed view of `foo` and an
|
|
66
|
+
* authoring view of `foo` cache independently.
|
|
67
|
+
*
|
|
68
|
+
* Order (authoring view): cache → source-tree → lockfile → authored-skill on
|
|
69
|
+
* disk + git remote → bare-name fallback.
|
|
70
|
+
*
|
|
71
|
+
* Order (installed-agent view): cache → lockfile → bare-name fallback.
|
|
47
72
|
*/
|
|
48
|
-
export declare function resolveSkillApiName(skill: string, root: string): Promise<string>;
|
|
73
|
+
export declare function resolveSkillApiName(skill: string, root: string, plugin?: string | null): Promise<string>;
|
|
@@ -145,14 +145,43 @@ export function readGitOriginOwnerRepo(dir) {
|
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
147
|
/**
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
148
|
+
* Decide whether `plugin` is an installed-agent dir (`.claude`, `.cursor`,
|
|
149
|
+
* `.windsurf`, `.codex`, `.openclaw`, `.agent`, `.kiro`, `.gemini`,
|
|
150
|
+
* `.github`, `.aider`, `.copilot`, `.opencode`, `.pi`, ...). The convention
|
|
151
|
+
* is uniform: every supported agent dir starts with `.`.
|
|
152
|
+
*
|
|
153
|
+
* Used by the resolver to pick the right "what is the upstream of this skill"
|
|
154
|
+
* branch: installed-agent views go straight to the lockfile (which records
|
|
155
|
+
* the source the install came from); authoring views run the source-tree
|
|
156
|
+
* probe first so the Studio sees the SAME upstream the author publishes to.
|
|
157
|
+
*/
|
|
158
|
+
export function isInstalledAgentDirPlugin(plugin) {
|
|
159
|
+
return !!plugin && plugin.startsWith(".");
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Resolve a bare skill name to `owner/repo/skill`.
|
|
163
|
+
*
|
|
164
|
+
* 0765: `plugin` is now part of the lookup. When `plugin` identifies an
|
|
165
|
+
* installed-agent dir (e.g. `.claude/scout`), the lockfile-derived upstream
|
|
166
|
+
* wins — the user is looking at a downstream copy whose source is recorded
|
|
167
|
+
* in the lockfile, NOT the same-named source-tree skill in the local repo.
|
|
168
|
+
* For authoring plugins (e.g. `vskill/scout`), the existing 0761 source-tree
|
|
169
|
+
* probe runs first.
|
|
170
|
+
*
|
|
171
|
+
* Cache key is `${plugin}::${skill}` so an installed view of `foo` and an
|
|
172
|
+
* authoring view of `foo` cache independently.
|
|
173
|
+
*
|
|
174
|
+
* Order (authoring view): cache → source-tree → lockfile → authored-skill on
|
|
175
|
+
* disk + git remote → bare-name fallback.
|
|
176
|
+
*
|
|
177
|
+
* Order (installed-agent view): cache → lockfile → bare-name fallback.
|
|
151
178
|
*/
|
|
152
|
-
export async function resolveSkillApiName(skill, root) {
|
|
153
|
-
const
|
|
179
|
+
export async function resolveSkillApiName(skill, root, plugin = null) {
|
|
180
|
+
const cacheKey = `${plugin ?? ""}::${skill}`;
|
|
181
|
+
const cached = resolverCache.get(cacheKey);
|
|
154
182
|
if (cached !== undefined)
|
|
155
183
|
return cached;
|
|
184
|
+
const installedView = isInstalledAgentDirPlugin(plugin);
|
|
156
185
|
// 0761: source-tree skills (`<root>/skills/<skill>`) are the canonical
|
|
157
186
|
// author copy of a vskill-source skill. The repo's own git remote is the
|
|
158
187
|
// correct upstream regardless of any lockfile entry — lockfile entries
|
|
@@ -161,13 +190,19 @@ export async function resolveSkillApiName(skill, root) {
|
|
|
161
190
|
// user with a `github:anton-abyzov/greet-anton` lockfile install (a
|
|
162
191
|
// separate repo) would see the Versions tab proxy to the WRONG upstream
|
|
163
192
|
// and could overwrite the source skill with content from a foreign repo.
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
193
|
+
//
|
|
194
|
+
// 0765: skip this probe when the user is looking at an installed copy —
|
|
195
|
+
// the lockfile is then authoritative and the source-tree skill (if any)
|
|
196
|
+
// belongs to a *different* upstream than the install.
|
|
197
|
+
if (!installedView) {
|
|
198
|
+
const sourceDir = await findAuthoredSourceTreeSkillDir(root, skill);
|
|
199
|
+
if (sourceDir) {
|
|
200
|
+
const sourceRemote = await readGitOriginOwnerRepo(sourceDir);
|
|
201
|
+
if (sourceRemote) {
|
|
202
|
+
return rememberAndReturn(cacheKey, `${sourceRemote.owner}/${sourceRemote.repo}/${skill}`);
|
|
203
|
+
}
|
|
204
|
+
return rememberAndReturn(cacheKey, skill);
|
|
169
205
|
}
|
|
170
|
-
return rememberAndReturn(skill, skill);
|
|
171
206
|
}
|
|
172
207
|
const lock = readLockfile();
|
|
173
208
|
const entry = lock?.skills?.[skill];
|
|
@@ -178,16 +213,16 @@ export async function resolveSkillApiName(skill, root) {
|
|
|
178
213
|
parsed.type === "marketplace") &&
|
|
179
214
|
parsed.owner &&
|
|
180
215
|
parsed.repo) {
|
|
181
|
-
return rememberAndReturn(
|
|
216
|
+
return rememberAndReturn(cacheKey, `${parsed.owner}/${parsed.repo}/${skill}`);
|
|
182
217
|
}
|
|
183
|
-
return rememberAndReturn(
|
|
218
|
+
return rememberAndReturn(cacheKey, skill);
|
|
184
219
|
}
|
|
185
220
|
const skillDir = await findAuthoredSkillDir(root, skill);
|
|
186
221
|
if (!skillDir)
|
|
187
|
-
return rememberAndReturn(
|
|
222
|
+
return rememberAndReturn(cacheKey, skill);
|
|
188
223
|
const remote = await readGitOriginOwnerRepo(skillDir);
|
|
189
224
|
if (!remote)
|
|
190
|
-
return rememberAndReturn(
|
|
191
|
-
return rememberAndReturn(
|
|
225
|
+
return rememberAndReturn(cacheKey, skill);
|
|
226
|
+
return rememberAndReturn(cacheKey, `${remote.owner}/${remote.repo}/${skill}`);
|
|
192
227
|
}
|
|
193
228
|
//# sourceMappingURL=skill-name-resolver.js.map
|
|
@@ -1 +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;AACF,iFAAiF;AACjF,gFAAgF;AAChF,gFAAgF;AAChF,kCAAkC;AAClC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;AAEhD,oEAAoE;AACpE,MAAM,UAAU,kBAAkB;IAChC,aAAa,CAAC,KAAK,EAAE,CAAC;AACxB,CAAC;AAED,SAAS,eAAe,CAAC,CAAS;IAChC,OAAO,CA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C,IAAI,EAAE,KAAK,CAAC,CAAC;IACzD,IAAI,CAAC,QAAQ;QAAE,OAAO,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEzD,MAAM,MAAM,GAAG,MAAM,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IACtD,IAAI,CAAC,MAAM;QAAE,OAAO,iBAAiB,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IAEvD,OAAO,iBAAiB,CAAC,QAAQ,EAAE,GAAG,MAAM,CAAC,KAAK,IAAI,MAAM,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,j as o,s as g}from"./index-
|
|
1
|
+
import{r as a,j as o,s as g}from"./index-BLduRWyM.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,4 +1,4 @@
|
|
|
1
|
-
import{j as e,R as y,u as Q,a as J,r as v,g as D,b as $,w as Z,c as X,t as P,L as R,P as ee,E as te,d as se,S as re}from"./index-ZByf-wxl.js";/* empty css */const ae=[{key:"slashCommands",label:"Slash"},{key:"hooks",label:"Hooks"},{key:"mcp",label:"MCP"},{key:"customSystemPrompt",label:"Prompt"}];function le({supported:r,label:a}){return e.jsx("span",{style:{display:"inline-block",fontSize:10,padding:"1px 5px",borderRadius:3,marginRight:3,background:r?"var(--color-success-bg, #d4edda)":"var(--surface-3, #2a2a2a)",color:r?"var(--color-success, #28a745)":"var(--text-tertiary, #666)",border:`1px solid ${r?"var(--color-success, #28a745)":"var(--border-subtle, #333)"}`},children:a})}function B({agent:r,checked:a,onToggle:m}){return e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"pointer",border:r.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:m,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:r.displayName}),r.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:ae.map(u=>e.jsx(le,{supported:r.featureSupport[u.key],label:u.label},u.key))})]})]})}function ne({agents:r,selectedIds:a,onChange:m}){const u=new Set(a),n=r.filter(o=>o.isUniversal),l=r.filter(o=>!o.isUniversal),x=o=>{const i=u.has(o)?a.filter(k=>k!==o):[...a,o];m(i)};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[n.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:n.map(o=>e.jsx(B,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]}),l.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:l.map(o=>e.jsx(B,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]})]})}const oe="Cross-universal — emits the same skill to 8 universal agents (Claude, Codex, Cursor, Cline, Gemini CLI, OpenCode, Kimi, Amp). Constrains output to the common schema across all agents. Recommended for portable skills.",ie="Powerful Claude-native engine — Anthropic's built-in skill-creator with a slightly richer schema (more expressive on Claude) but Claude-only. Pick this when you only target Claude Code and want full expressiveness.",de="Generate raw — no engine assistance, you provide the full SKILL.md body.";function ce(r){return[{engine:"vskill",label:"VSkill skill-builder",caption:r.vskillSkillBuilder?`installed${r.vskillVersion?` v${r.vskillVersion}`:""}`:"not installed",tooltip:oe,detected:r.vskillSkillBuilder,installable:!0},{engine:"anthropic-skill-creator",label:"Anthropic skill-creator",caption:r.anthropicSkillCreator?"installed":"not installed",tooltip:ie,detected:r.anthropicSkillCreator,installable:!0},{engine:"none",label:"No engine — generate raw",caption:"always available",tooltip:de,detected:!0,installable:!1}]}function ue(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function xe(r){const{detection:a,selected:m,onSelect:u,onInstallClick:n}=r,l=y.useMemo(()=>ue(),[]),x=y.useMemo(()=>ce(a),[a]),o=l?"":"transition-colors";return e.jsxs("fieldset",{className:"flex flex-col gap-2",children:[e.jsx("legend",{className:"text-xs font-semibold text-gray-700",children:"Authoring engine"}),e.jsx("div",{role:"tablist","aria-label":"Authoring engine",className:"flex flex-col gap-1.5",children:x.map(i=>{const k=m===i.engine,p=!i.detected&&i.installable,b=["flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-sm cursor-pointer",o,k?"border-blue-600 bg-blue-50":"border-gray-300 bg-white hover:border-gray-400"].filter(Boolean).join(" "),h=i.detected?{}:{opacity:.6};return e.jsxs("div",{role:"tab",tabIndex:0,"data-testid":`engine-selector-${i.engine}`,"aria-selected":k?"true":"false",title:i.tooltip,style:h,className:b,onClick:()=>u(i.engine),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),u(i.engine))},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium text-gray-900",children:i.label}),e.jsx("span",{className:"text-xs text-gray-500",children:i.caption})]}),p&&e.jsx("button",{type:"button","data-testid":`install-${i.engine}`,className:"rounded border border-blue-600 px-2 py-1 text-xs font-medium text-blue-700 hover:bg-blue-100",onClick:d=>{d.stopPropagation(),n(i.engine)},children:"Install"})]},i.engine)})})]})}const A="(?:0|[1-9]\\d*)",H="[0-9A-Za-z-]",F=`(?:${A}|\\d*[A-Za-z-]${H}*)`,z=`${H}+`,pe=`(?:-${F}(?:\\.${F})*)`,me=`(?:\\+${z}(?:\\.${z})*)`,ge=new RegExp(`^${A}\\.${A}\\.${A}${pe}?${me}?$`);function V(r){return typeof r!="string"?!1:ge.test(r.trim())}const he="Skill version (semver). Auto-bumps on update unless versioningMode=author.",fe="Must be valid semver (e.g. 1.0.0, 2.1.3-beta.1)";function ve(r){const{value:a,onChange:m,mode:u,onValidityChange:n,versionsHref:l,disabled:x}=r,[o,i]=y.useState(!1),[k,p]=y.useState(()=>V(a)),b=V(a);y.useEffect(()=>{b!==k?(p(b),n==null||n(b)):n&&n(b)},[b]);const h=o&&!b,d=["w-full rounded-md border px-3 py-2 text-sm font-mono",h?"border-red-500 bg-red-50 focus:outline-red-600":"border-gray-300 bg-white focus:outline-blue-600",x?"opacity-60 cursor-not-allowed":""].join(" ");return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-700",htmlFor:"version-input",children:"Version"}),e.jsx("input",{id:"version-input","data-testid":"version-input",type:"text",title:he,value:a,onChange:g=>m(g.currentTarget.value),onBlur:()=>i(!0),"aria-invalid":h?"true":"false","aria-describedby":h?"version-input-helper":void 0,disabled:x,className:d,placeholder:"1.0.0"}),h&&e.jsx("span",{id:"version-input-helper","data-testid":"version-input-helper",className:"text-xs text-red-600",role:"alert",children:fe}),u==="update"&&l&&e.jsx("a",{"data-testid":"version-input-versions-link",href:l,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline",children:"Versions →"})]})}const E={status:"idle",liveTail:"",progress:[],exitCode:null,stderr:"",error:null};function ye(r={}){const a=r.fetchImpl??globalThis.fetch,m=r.eventSourceCtor??globalThis.EventSource,[u,n]=y.useState(E),l=y.useRef(null),x=y.useRef(null);y.useEffect(()=>()=>{var p;(p=x.current)==null||p.close()},[]);const o=y.useCallback(()=>{var p;(p=x.current)==null||p.close(),x.current=null,l.current=null,n(E)},[]),i=y.useCallback(async p=>{if(!m){n({...E,status:"failure",error:"EventSource not available"});return}l.current=p,n({...E,status:"spawning"});let b;try{const d=await a("/api/studio/install-engine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({engine:p})});if(!d.ok){const C=await d.json().catch(()=>({}));n({...E,status:"failure",error:C.remediation??C.error??`HTTP ${d.status}`});return}b=(await d.json()).jobId}catch(d){n({...E,status:"failure",error:d.message});return}const h=new m(`/api/studio/install-engine/${b}/stream`);x.current=h,n(d=>({...d,status:"streaming"})),h.addEventListener("progress",d=>{try{const g=JSON.parse(d.data);n(C=>({...C,liveTail:g.line.length>60?g.line.slice(0,60)+"…":g.line,progress:[...C.progress,g].slice(-200)}))}catch{}}),h.addEventListener("done",d=>{try{const g=JSON.parse(d.data);h.close(),x.current=null,n(C=>({...C,status:g.success?"success":"failure",exitCode:g.exitCode,stderr:g.stderr,error:g.success?null:g.stderr||`exit ${g.exitCode}`}))}catch{h.close(),x.current=null,n(g=>({...g,status:"failure",error:"malformed done event"}))}}),h.addEventListener("error",()=>{h.close(),x.current=null,n(d=>({...d,status:d.status==="streaming"?"failure":d.status,error:d.error??"stream error"}))})},[m,a]),k=y.useCallback(async()=>{const p=l.current;p&&await i(p)},[i]);return{state:u,install:i,retry:k,reset:o}}const be={vskill:"vskill install anton-abyzov/vskill/skill-builder","anthropic-skill-creator":"claude plugin install skill-creator"},je={vskill:"VSkill skill-builder","anthropic-skill-creator":"Anthropic skill-creator"},ke="This runs the command in your terminal as your user. Inspect before approving.";function we(r){const{engine:a,onClose:m,onSuccess:u,hookOpts:n}=r,{state:l,install:x,retry:o}=ye(n),i=be[a],k=je[a],p=y.useRef(!1);return y.useEffect(()=>{l.status==="success"&&!p.current&&(p.current=!0,u())},[l.status,u]),e.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"install-engine-title","data-testid":"install-engine-modal",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-xl",children:[e.jsxs("h2",{id:"install-engine-title",className:"text-lg font-semibold text-gray-900",children:["Install ",k]}),l.status==="idle"&&e.jsx(Ne,{command:i,onCancel:m,onRun:()=>x(a)}),(l.status==="spawning"||l.status==="streaming")&&e.jsx(Ce,{command:i,liveTail:l.liveTail}),l.status==="success"&&e.jsx(Se,{label:k,onClose:m}),l.status==="failure"&&e.jsx(Le,{error:l.error??"Install failed",stderr:l.stderr,progress:l.progress,onRetry:()=>o(),onClose:m})]})})}function G({command:r}){return e.jsxs("pre",{"data-testid":"install-command-preview",className:"my-3 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-green-300",children:["$ ",r]})}function Ne(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Studio will run this command on your behalf:"}),e.jsx(G,{command:r.command}),e.jsx("p",{className:"text-xs text-amber-700","data-testid":"install-security-note",children:ke}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-cancel",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onCancel,children:"Cancel"}),e.jsx("button",{type:"button","data-testid":"install-run",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRun,children:"Run install"})]})]})}function Ce(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Installing…"}),e.jsx(G,{command:r.command}),e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-gray-600",children:[e.jsx("span",{"data-testid":"install-spinner",className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"}),e.jsx("span",{"data-testid":"install-live-tail",className:"font-mono",children:r.liveTail||"starting…"})]})]})}function Se(r){return e.jsxs(e.Fragment,{children:[e.jsxs("p",{"data-testid":"install-success",className:"mt-3 text-sm font-medium text-green-700",children:["✓ ",r.label," installed"]}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onClose,children:"Done"})})]})}function Le(r){const[a,m]=y.useState(!1),u=r.progress.filter(l=>l.stream==="stderr").map(l=>l.line),n=u.length>0?u.join(`
|
|
1
|
+
import{j as e,R as y,u as Q,a as J,r as v,g as D,b as $,w as Z,c as X,t as P,L as R,P as ee,E as te,d as se,S as re}from"./index-BLduRWyM.js";/* empty css */const ae=[{key:"slashCommands",label:"Slash"},{key:"hooks",label:"Hooks"},{key:"mcp",label:"MCP"},{key:"customSystemPrompt",label:"Prompt"}];function le({supported:r,label:a}){return e.jsx("span",{style:{display:"inline-block",fontSize:10,padding:"1px 5px",borderRadius:3,marginRight:3,background:r?"var(--color-success-bg, #d4edda)":"var(--surface-3, #2a2a2a)",color:r?"var(--color-success, #28a745)":"var(--text-tertiary, #666)",border:`1px solid ${r?"var(--color-success, #28a745)":"var(--border-subtle, #333)"}`},children:a})}function B({agent:r,checked:a,onToggle:m}){return e.jsxs("label",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 8px",borderRadius:6,cursor:"pointer",border:r.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:m,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:r.displayName}),r.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:ae.map(u=>e.jsx(le,{supported:r.featureSupport[u.key],label:u.label},u.key))})]})]})}function ne({agents:r,selectedIds:a,onChange:m}){const u=new Set(a),n=r.filter(o=>o.isUniversal),l=r.filter(o=>!o.isUniversal),x=o=>{const i=u.has(o)?a.filter(k=>k!==o):[...a,o];m(i)};return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[n.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:n.map(o=>e.jsx(B,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]}),l.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:l.map(o=>e.jsx(B,{agent:o,checked:u.has(o.id),onToggle:()=>x(o.id)},o.id))})]})]})}const oe="Cross-universal — emits the same skill to 8 universal agents (Claude, Codex, Cursor, Cline, Gemini CLI, OpenCode, Kimi, Amp). Constrains output to the common schema across all agents. Recommended for portable skills.",ie="Powerful Claude-native engine — Anthropic's built-in skill-creator with a slightly richer schema (more expressive on Claude) but Claude-only. Pick this when you only target Claude Code and want full expressiveness.",de="Generate raw — no engine assistance, you provide the full SKILL.md body.";function ce(r){return[{engine:"vskill",label:"VSkill skill-builder",caption:r.vskillSkillBuilder?`installed${r.vskillVersion?` v${r.vskillVersion}`:""}`:"not installed",tooltip:oe,detected:r.vskillSkillBuilder,installable:!0},{engine:"anthropic-skill-creator",label:"Anthropic skill-creator",caption:r.anthropicSkillCreator?"installed":"not installed",tooltip:ie,detected:r.anthropicSkillCreator,installable:!0},{engine:"none",label:"No engine — generate raw",caption:"always available",tooltip:de,detected:!0,installable:!1}]}function ue(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function xe(r){const{detection:a,selected:m,onSelect:u,onInstallClick:n}=r,l=y.useMemo(()=>ue(),[]),x=y.useMemo(()=>ce(a),[a]),o=l?"":"transition-colors";return e.jsxs("fieldset",{className:"flex flex-col gap-2",children:[e.jsx("legend",{className:"text-xs font-semibold text-gray-700",children:"Authoring engine"}),e.jsx("div",{role:"tablist","aria-label":"Authoring engine",className:"flex flex-col gap-1.5",children:x.map(i=>{const k=m===i.engine,p=!i.detected&&i.installable,b=["flex items-center justify-between gap-3 rounded-md border px-3 py-2 text-sm cursor-pointer",o,k?"border-blue-600 bg-blue-50":"border-gray-300 bg-white hover:border-gray-400"].filter(Boolean).join(" "),h=i.detected?{}:{opacity:.6};return e.jsxs("div",{role:"tab",tabIndex:0,"data-testid":`engine-selector-${i.engine}`,"aria-selected":k?"true":"false",title:i.tooltip,style:h,className:b,onClick:()=>u(i.engine),onKeyDown:d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),u(i.engine))},children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"font-medium text-gray-900",children:i.label}),e.jsx("span",{className:"text-xs text-gray-500",children:i.caption})]}),p&&e.jsx("button",{type:"button","data-testid":`install-${i.engine}`,className:"rounded border border-blue-600 px-2 py-1 text-xs font-medium text-blue-700 hover:bg-blue-100",onClick:d=>{d.stopPropagation(),n(i.engine)},children:"Install"})]},i.engine)})})]})}const A="(?:0|[1-9]\\d*)",H="[0-9A-Za-z-]",F=`(?:${A}|\\d*[A-Za-z-]${H}*)`,z=`${H}+`,pe=`(?:-${F}(?:\\.${F})*)`,me=`(?:\\+${z}(?:\\.${z})*)`,ge=new RegExp(`^${A}\\.${A}\\.${A}${pe}?${me}?$`);function V(r){return typeof r!="string"?!1:ge.test(r.trim())}const he="Skill version (semver). Auto-bumps on update unless versioningMode=author.",fe="Must be valid semver (e.g. 1.0.0, 2.1.3-beta.1)";function ve(r){const{value:a,onChange:m,mode:u,onValidityChange:n,versionsHref:l,disabled:x}=r,[o,i]=y.useState(!1),[k,p]=y.useState(()=>V(a)),b=V(a);y.useEffect(()=>{b!==k?(p(b),n==null||n(b)):n&&n(b)},[b]);const h=o&&!b,d=["w-full rounded-md border px-3 py-2 text-sm font-mono",h?"border-red-500 bg-red-50 focus:outline-red-600":"border-gray-300 bg-white focus:outline-blue-600",x?"opacity-60 cursor-not-allowed":""].join(" ");return e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx("label",{className:"text-xs font-semibold text-gray-700",htmlFor:"version-input",children:"Version"}),e.jsx("input",{id:"version-input","data-testid":"version-input",type:"text",title:he,value:a,onChange:g=>m(g.currentTarget.value),onBlur:()=>i(!0),"aria-invalid":h?"true":"false","aria-describedby":h?"version-input-helper":void 0,disabled:x,className:d,placeholder:"1.0.0"}),h&&e.jsx("span",{id:"version-input-helper","data-testid":"version-input-helper",className:"text-xs text-red-600",role:"alert",children:fe}),u==="update"&&l&&e.jsx("a",{"data-testid":"version-input-versions-link",href:l,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 hover:underline",children:"Versions →"})]})}const E={status:"idle",liveTail:"",progress:[],exitCode:null,stderr:"",error:null};function ye(r={}){const a=r.fetchImpl??globalThis.fetch,m=r.eventSourceCtor??globalThis.EventSource,[u,n]=y.useState(E),l=y.useRef(null),x=y.useRef(null);y.useEffect(()=>()=>{var p;(p=x.current)==null||p.close()},[]);const o=y.useCallback(()=>{var p;(p=x.current)==null||p.close(),x.current=null,l.current=null,n(E)},[]),i=y.useCallback(async p=>{if(!m){n({...E,status:"failure",error:"EventSource not available"});return}l.current=p,n({...E,status:"spawning"});let b;try{const d=await a("/api/studio/install-engine",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({engine:p})});if(!d.ok){const C=await d.json().catch(()=>({}));n({...E,status:"failure",error:C.remediation??C.error??`HTTP ${d.status}`});return}b=(await d.json()).jobId}catch(d){n({...E,status:"failure",error:d.message});return}const h=new m(`/api/studio/install-engine/${b}/stream`);x.current=h,n(d=>({...d,status:"streaming"})),h.addEventListener("progress",d=>{try{const g=JSON.parse(d.data);n(C=>({...C,liveTail:g.line.length>60?g.line.slice(0,60)+"…":g.line,progress:[...C.progress,g].slice(-200)}))}catch{}}),h.addEventListener("done",d=>{try{const g=JSON.parse(d.data);h.close(),x.current=null,n(C=>({...C,status:g.success?"success":"failure",exitCode:g.exitCode,stderr:g.stderr,error:g.success?null:g.stderr||`exit ${g.exitCode}`}))}catch{h.close(),x.current=null,n(g=>({...g,status:"failure",error:"malformed done event"}))}}),h.addEventListener("error",()=>{h.close(),x.current=null,n(d=>({...d,status:d.status==="streaming"?"failure":d.status,error:d.error??"stream error"}))})},[m,a]),k=y.useCallback(async()=>{const p=l.current;p&&await i(p)},[i]);return{state:u,install:i,retry:k,reset:o}}const be={vskill:"vskill install anton-abyzov/vskill/skill-builder","anthropic-skill-creator":"claude plugin install skill-creator"},je={vskill:"VSkill skill-builder","anthropic-skill-creator":"Anthropic skill-creator"},ke="This runs the command in your terminal as your user. Inspect before approving.";function we(r){const{engine:a,onClose:m,onSuccess:u,hookOpts:n}=r,{state:l,install:x,retry:o}=ye(n),i=be[a],k=je[a],p=y.useRef(!1);return y.useEffect(()=>{l.status==="success"&&!p.current&&(p.current=!0,u())},[l.status,u]),e.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"install-engine-title","data-testid":"install-engine-modal",className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:e.jsxs("div",{className:"w-full max-w-lg rounded-lg bg-white p-6 shadow-xl",children:[e.jsxs("h2",{id:"install-engine-title",className:"text-lg font-semibold text-gray-900",children:["Install ",k]}),l.status==="idle"&&e.jsx(Ne,{command:i,onCancel:m,onRun:()=>x(a)}),(l.status==="spawning"||l.status==="streaming")&&e.jsx(Ce,{command:i,liveTail:l.liveTail}),l.status==="success"&&e.jsx(Se,{label:k,onClose:m}),l.status==="failure"&&e.jsx(Le,{error:l.error??"Install failed",stderr:l.stderr,progress:l.progress,onRetry:()=>o(),onClose:m})]})})}function G({command:r}){return e.jsxs("pre",{"data-testid":"install-command-preview",className:"my-3 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-green-300",children:["$ ",r]})}function Ne(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Studio will run this command on your behalf:"}),e.jsx(G,{command:r.command}),e.jsx("p",{className:"text-xs text-amber-700","data-testid":"install-security-note",children:ke}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-cancel",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onCancel,children:"Cancel"}),e.jsx("button",{type:"button","data-testid":"install-run",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRun,children:"Run install"})]})]})}function Ce(r){return e.jsxs(e.Fragment,{children:[e.jsx("p",{className:"mt-2 text-sm text-gray-700",children:"Installing…"}),e.jsx(G,{command:r.command}),e.jsxs("div",{className:"mt-3 flex items-center gap-2 text-xs text-gray-600",children:[e.jsx("span",{"data-testid":"install-spinner",className:"inline-block h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"}),e.jsx("span",{"data-testid":"install-live-tail",className:"font-mono",children:r.liveTail||"starting…"})]})]})}function Se(r){return e.jsxs(e.Fragment,{children:[e.jsxs("p",{"data-testid":"install-success",className:"mt-3 text-sm font-medium text-green-700",children:["✓ ",r.label," installed"]}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onClose,children:"Done"})})]})}function Le(r){const[a,m]=y.useState(!1),u=r.progress.filter(l=>l.stream==="stderr").map(l=>l.line),n=u.length>0?u.join(`
|
|
2
2
|
`):r.stderr;return e.jsxs(e.Fragment,{children:[e.jsx("p",{"data-testid":"install-failure",className:"mt-3 text-sm font-medium text-red-700",children:"✗ Install failed"}),e.jsx("p",{className:"mt-1 text-xs text-gray-700",children:r.error}),n&&e.jsxs("details",{className:"mt-3 text-xs",open:a,onToggle:l=>m(l.currentTarget.open),children:[e.jsx("summary",{className:"cursor-pointer text-gray-600",children:"stderr"}),e.jsx("pre",{"data-testid":"install-stderr",className:"mt-2 overflow-x-auto rounded bg-gray-900 px-3 py-2 font-mono text-xs text-red-300",children:n})]}),e.jsxs("div",{className:"mt-4 flex justify-end gap-2",children:[e.jsx("button",{type:"button","data-testid":"install-close",className:"rounded border border-gray-300 px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-50",onClick:r.onClose,children:"Close"}),e.jsx("button",{type:"button","data-testid":"install-retry",className:"rounded bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700",onClick:r.onRetry,children:"Retry"})]})]})}const N={background:"var(--surface-3)",color:"var(--text-primary)",border:"1px solid var(--border-subtle)"};function Ee(r){return r?/API usage limits|usage limit/i.test(r)&&/regain access|reset/i.test(r):!1}function Pe(r){const a=r.match(/regain access on ([^"\\]+?)(?:\s*UTC)?["\\]/i)??r.match(/regain access on ([^"\\]+)/i);return a?`Resets ${a[1].trim()} UTC`:"Quota resets at the start of your next billing period"}function I(r){switch(r){case"claude-cli":return"Uses your logged-in Claude Code session — your existing CLI session handles quota. No API key needed. Overflow runs at standard API rates if extra usage is enabled in your account settings.";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 M({size:r=14,color:a="currentColor"}){return e.jsx("svg",{width:r,height:r,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 r=Q(),{config:a}=J(),[m,u]=v.useState(null),n=y.useMemo(()=>{if(typeof window>"u")return{};const s=window.location.hash,c=s.indexOf("?");if(c===-1)return{};const w=new URLSearchParams(s.slice(c+1)),j={};for(const f of["mode","skillName","description","pluginName"]){const L=w.get(f);L&&(j[f]=L)}return j},[]),[l,x]=v.useState("claude-cli"),[o,i]=v.useState("sonnet"),[k,p]=v.useState(!1),[b,h]=v.useState(null),d=v.useRef(!1),[g,C]=v.useState([]),[W,U]=v.useState(()=>D("activeAgent",null));v.useEffect(()=>{function s(){U(D("activeAgent",null))}return window.addEventListener("studio:agent-changed",s),window.addEventListener("storage",s),()=>{window.removeEventListener("studio:agent-changed",s),window.removeEventListener("storage",s)}},[]);const K=W!=="claude-code";v.useEffect(()=>{fetch("/api/agents/installed").then(s=>s.json()).then(s=>{s.agents&&C(s.agents)}).catch(()=>{})},[]),v.useEffect(()=>{var j;if(!a)return;const s=a.providers.filter(f=>f.available),c=$().skillGenModel;if(s.length===0){d.current=!0;return}if(c&&typeof c=="object"&&typeof c.provider=="string"&&typeof c.model=="string"){const f=s.find(T=>T.id===c.provider),L=f==null?void 0:f.models.some(T=>T.id===c.model);if(f&&L){x(c.provider),i(c.model),p(!0),d.current=!0;return}h({provider:c.provider,model:c.model})}if(s.find(f=>f.id==="claude-cli"))x("claude-cli"),i("sonnet");else{const f=s[0];x(f.id),i(((j=f.models[0])==null?void 0:j.id)??"")}p(!1),d.current=!0},[a]),v.useEffect(()=>{const s=c=>{if(c.key!==null&&!c.key.includes("vskill.studio.prefs"))return;const j=$().skillGenModel;j&&typeof j=="object"&&typeof j.provider=="string"&&typeof j.model=="string"&&(x(j.provider),i(j.model),p(!0))};return window.addEventListener("storage",s),()=>window.removeEventListener("storage",s)},[]);const O=v.useCallback((s,c)=>{Z("skillGenModel",{provider:s,model:c}),p(!0)},[]),Y=v.useCallback(()=>({provider:l,model:o}),[l,o]),q=n.mode==="standalone"?3:void 0,t=X({onCreated:(s,c)=>r(`/skills/${s}/${c}`),resolveAiConfigOverride:Y,forceLayout:q});v.useEffect(()=>{n.skillName&&!t.name&&t.setName(P(n.skillName)),n.description&&!t.description&&t.setDescription(n.description),n.description&&!t.aiPrompt&&t.setAiPrompt(n.description),n.pluginName&&!t.plugin&&t.setPlugin(P(n.pluginName))},[]);const S=a==null?void 0:a.providers.find(s=>s.id===l&&s.available),_=v.useMemo(()=>{const s=["---"];return t.description?s.push(`description: "${t.description.replace(/"/g,'\\"')}"`):s.push('description: ""'),t.allowedTools.trim()&&s.push(`allowed-tools: ${t.allowedTools.trim()}`),t.model&&s.push(`model: ${t.model}`),t.targetAgents.length>0&&s.push(`target-agents: ${t.targetAgents.join(", ")}`),s.push("---"),s.push(""),t.body.trim()?s.push(t.body.trim()):(s.push(`# /${t.name||"skill-name"}`),s.push(""),s.push("You are a helpful assistant.")),s.join(`
|
|
3
3
|
`)},[t.name,t.description,t.model,t.allowedTools,t.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 mx-auto w-full overflow-x-hidden",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(R,{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.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h2",{className:"text-[22px] font-semibold tracking-tight",style:{color:"var(--text-primary)"},children:"Create a New Skill"}),t.standaloneLocked&&e.jsx("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium uppercase tracking-wider px-2 py-0.5 rounded whitespace-nowrap",style:{background:"var(--accent-muted)",color:"var(--accent)",border:"1px solid var(--accent-muted)"},title:"You chose Standalone in the previous step. Plugin selection is disabled.",children:"Standalone"})]}),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 max-w-full",style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)"},role:"tablist","aria-label":"Creation mode",children:[e.jsx("button",{onClick:()=>t.setMode("ai"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:t.mode==="ai"?"var(--purple-muted)":"transparent",color:t.mode==="ai"?"var(--purple)":"var(--text-tertiary)",boxShadow:t.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(M,{size:14}),"AI-Assisted"]})}),e.jsx("button",{onClick:()=>t.setMode("manual"),className:"px-4 py-2 rounded-md text-[13px] font-medium transition-all duration-200",style:{background:t.mode==="manual"?"var(--surface-4, var(--surface-3))":"transparent",color:t.mode==="manual"?"var(--text-primary)":"var(--text-tertiary)",boxShadow:t.mode==="manual"?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:"Manual"})]})]})]}),t.engineDetection&&e.jsx("div",{className:"mb-4",children:e.jsx(xe,{detection:t.engineDetection,selected:t.engine,onSelect:s=>t.setEngine(s),onInstallClick:s=>u(s)})}),t.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"})]}),!t.layoutLoading&&t.layout&&t.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(M,{size:13,color:"var(--purple)"})}),"Describe Your Skill"]}),e.jsx("textarea",{ref:t.promptRef,value:t.aiPrompt,onChange:s=>t.setAiPrompt(s.target.value),placeholder:`e.g., A skill that helps format SQL queries, optimize them for performance, and explain query execution plans.
|
|
4
4
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SearchPaletteCore-
|
|
2
|
-
import{r as t,j as d,_ as l}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SearchPaletteCore-cxev8h5r.js","assets/index-BLduRWyM.js","assets/index-C8DXCPPg.css","assets/fonts-i7Lkz2zN.css","assets/skill-url-C4ekwoGs.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as t,j as d,_ as l}from"./index-BLduRWyM.js";/* empty css */const f=t.lazy(()=>l(()=>import("./SearchPaletteCore-cxev8h5r.js"),__vite__mapDeps([0,1,2,3,4])));function w(){if(typeof window>"u"||typeof window.matchMedia!="function")return!1;try{return window.matchMedia("(prefers-reduced-motion: reduce)").matches}catch{return!1}}function y({onSelect:i,onNavigate:u}={}){const[n,o]=t.useState(!1),s=t.useRef(null),a=w();t.useEffect(()=>{function e(){s.current=document.activeElement??null,o(!0)}return window.addEventListener("openFindSkills",e),()=>window.removeEventListener("openFindSkills",e)},[]),t.useEffect(()=>{if(!n)return;function e(r){r.key==="Escape"&&o(!1)}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[n]),t.useEffect(()=>{if(n)return;const e=s.current;if(e&&typeof e.focus=="function")try{e.focus()}catch{}s.current=null},[n]);const c=t.useCallback((e,r)=>{try{typeof window<"u"&&window.sessionStorage&&window.sessionStorage.setItem("find-skills:last-query",r??"")}catch{}if(o(!1),i)try{i(e,r)}catch{}},[i]);return n?d.jsx("div",{"data-testid":"find-skills-palette-shell","data-reduced-motion":a?"true":"false",children:d.jsx(t.Suspense,{fallback:null,children:d.jsx(f,{initialOpen:!0,onSelect:c,onNavigate:u})})}):null}export{y as FindSkillsPalette,y as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as a,j as t,h as xe}from"./index-ZByf-wxl.js";import{a as ye}from"./skill-url-C4ekwoGs.js";/* empty css */function me(i){return i?i.replace(/<(?!\/?b>)[^>]+>/gi,""):""}function be(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ie(i,p){if(!i)return"";const d=be(i);if(!p)return d;const u=p.trim().split(/\s+/).filter(Boolean);if(u.length===0)return d;const T=u.map(W=>W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),b=new RegExp(`(${T})`,"gi");return d.replace(b,"<b>$1</b>")}function ve(i){return i?i<1e3?String(i):`${(i/1e3).toFixed(1)}k`:""}const ke=[{label:"Security",href:"/skills?category=security"},{label:"Coding",href:"/skills?category=development"},{label:"DevOps",href:"/skills?category=devops"},{label:"Testing",href:"/skills?category=testing"},{label:"Data",href:"/skills?category=data"},{label:"Design",href:"/skills?category=design"}],Se=[{label:"Submit a skill",href:"/submit"},{label:"Browse all skills",href:"/skills"}],J="var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)",c="var(--font-mono, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace)";function Ee({tier:i,isTainted:p,isBlocked:d}){const u={display:"inline-flex",alignItems:"center",padding:"1px 6px",height:16,borderRadius:3,fontFamily:c,fontSize:9.5,fontWeight:600,letterSpacing:"0.04em",whiteSpace:"nowrap",lineHeight:1,textTransform:"uppercase"};if(d)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"BLOCKED",style:{...u,color:"#7A1F1F",background:"#FBE8E5",border:"1px solid #E8B7B0"},children:"BLOCKED"});if(p)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"TAINTED",style:{...u,color:"#7A4A00",background:"#FBEFD3",border:"1px solid #E8C885"},children:"Tainted"});const b={CERTIFIED:{color:"var(--color-installed, #2F6A4A)",bg:"rgba(47,106,74,0.08)",border:"rgba(47,106,74,0.25)"},VERIFIED:{color:"var(--color-focus, #3B6EA8)",bg:"rgba(59,110,168,0.08)",border:"rgba(59,110,168,0.25)"},REJECTED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"},BLOCKED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"}}[i];return b?t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":i,style:{...u,color:b.color,background:b.bg,border:`1px solid ${b.border}`},children:xe(i)}):null}function O(){return t.jsxs("div",{"data-testid":"skeleton-row",style:{padding:"10px 18px",display:"flex",alignItems:"center",gap:10},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[t.jsx("div",{style:{height:12,width:"32%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:9,width:"55%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.18s"}})]}),t.jsx("div",{style:{height:14,width:52,borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.36s"}})]})}function Fe(i){var d,u;const p=(d=i.target)==null?void 0:d.tagName;return!!(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||(u=i.target)!=null&&u.isContentEditable)}const je="/api/v1/studio/search",we="/api/v1/stats",Ae="/api/v1/studio/telemetry/search-select",Re=10,Q=20,Ce=150;function Be({onSelect:i,onNavigate:p,searchUrl:d=je,trendingUrl:u=we,telemetrySelectUrl:T=Ae,maxPages:b=Re,initialOpen:W=!1}={}){const[L,E]=a.useState(W),[o,F]=a.useState(""),[I,h]=a.useState([]),[U,v]=a.useState(0),[j,B]=a.useState(!1),[_,w]=a.useState(1),[H,x]=a.useState(!1),[M,V]=a.useState(!1),[$,k]=a.useState(null),[A,R]=a.useState(!1),Z=a.useRef(null),N=a.useRef(null),z=a.useRef(!1),ee=a.useRef(null),te=a.useRef(null),q=a.useRef(new Map),S=a.useRef(null),[,ue]=a.useState(!1),re=a.useMemo(()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform||""),[]),K=a.useRef(o);a.useEffect(()=>{K.current=o},[o]),a.useEffect(()=>{S.current||fetch(u).then(e=>e.json()).then(e=>{S.current=e.trendingSkills??[],ue(!0)}).catch(()=>{})},[u]),a.useEffect(()=>{const e=r=>{if(r.key==="Escape"){E(!1);return}if(L&&(r.metaKey||r.ctrlKey)&&/^[1-9]$/.test(r.key)){r.preventDefault();const s=Number(r.key)-1;v(s),window.dispatchEvent(new CustomEvent("findSkillsActivateAt",{detail:{index:s}}));return}!r.metaKey&&!r.ctrlKey&&!r.altKey&&r.key.length===1&&!Fe(r)&&(z.current=!0,F(r.key),E(!0))},n=r=>{var y;const l=(y=r.detail)==null?void 0:y.query;l&&(z.current=!0,F(l)),E(!0)};return window.addEventListener("keydown",e),window.addEventListener("openFindSkills",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("openFindSkills",n)}},[L]),a.useLayoutEffect(()=>{var n;if(!L){(n=N.current)==null||n.abort();return}if(z.current)z.current=!1,h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1);else{const r=(()=>{var s;try{return((s=window.sessionStorage)==null?void 0:s.getItem("find-skills:last-query"))??""}catch{return""}})();F(r),h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1)}const e=Z.current;if(e){e.focus({preventScroll:!0});const r=e.value.length;e.setSelectionRange(r,r)}},[L]),a.useEffect(()=>{if(!o.trim()||o.trim().length<2){h([]),x(!1),w(1),k(null);return}const e=6e4,n=o.trim().toLowerCase(),r=q.current.get(n);if(r&&Date.now()-r.timestamp<e){h(r.results),x(r.hasMore),w(1),B(!1),k(null),fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`).then(m=>m.ok?m.json():null).then(m=>{var g;m&&q.current.set(n,{results:m.results||[],hasMore:((g=m.pagination)==null?void 0:g.hasMore)??!1,timestamp:Date.now()})}).catch(()=>{});return}B(!0),k(null);const l=new AbortController,y=setTimeout(async()=>{var m;try{const g=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`,{signal:l.signal});if(g.status>=500){R(!0),h([]),x(!1),k(null);return}if(!g.ok){h([]),x(!1),k(`search failed (${g.status})`);return}const ce=await g.json(),de=ce.results||[],pe=((m=ce.pagination)==null?void 0:m.hasMore)??!1;h(de),x(pe),w(1),R(!1),q.current.set(n,{results:de,hasMore:pe,timestamp:Date.now()})}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return;R(!0),h([]),x(!1),k(null)}finally{l.signal.aborted||B(!1)}},Ce);return()=>{clearTimeout(y),l.abort()}},[o,d]);const C=_>=b,ne=a.useCallback(async()=>{var n,r;if(M||C)return;const e=_+1;V(!0),N.current=new AbortController;try{const s=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=${e}`,{signal:N.current.signal});if(!s.ok)return;const l=await s.json();h(y=>[...y,...l.results||[]]),x(((n=l.pagination)==null?void 0:n.hasMore)??!1),w(e)}catch(s){if(s instanceof DOMException&&s.name==="AbortError")return}finally{(r=N.current)!=null&&r.signal.aborted||V(!1)}},[_,o,M,C,d]);a.useEffect(()=>{const e=ee.current,n=te.current;if(!e||!n||typeof IntersectionObserver>"u")return;const r=new IntersectionObserver(s=>{s[0].isIntersecting&&H&&!j&&!M&&!C&&ne()},{root:n,rootMargin:"100px"});return r.observe(e),()=>r.disconnect()},[H,j,M,C,ne]);const P=e=>({name:e.name,displayName:e.displayName,author:e.author,repoUrl:e.repoUrl,certTier:e.certTier,githubStars:0,highlight:"",category:"",ownerSlug:e.ownerSlug,repoSlug:e.repoSlug,skillSlug:e.skillSlug}),G=(()=>{const e=o.trim();if(A&&e.length>=1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().includes(n)||(r.displayName??"").toLowerCase().includes(n)).slice(0,30).map(P)}if(e.length>=2)return I;if(e.length===1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().startsWith(n)||r.displayName.toLowerCase().startsWith(n)).slice(0,10).map(P)}return e.length===0&&S.current?S.current.slice(0,10).map(P):[]})(),f=[...G.map(e=>{const n=e.skillSlug||e.name.split("/").pop()||e.name,r=e.ownerSlug&&e.repoSlug?`${e.ownerSlug}/${e.repoSlug}`:e.author;return{type:"skill",label:n,publisher:r,name:e.name,command:e.command?e.pluginName?`${e.pluginName}:${e.command}`:e.command:void 0,pluginName:e.pluginName||void 0,meta:e.category||"",certTier:e.certTier,isTainted:e.isTainted,isBlocked:e.isBlocked,repoUrl:e.repoUrl,highlight:e.highlight,githubStars:e.githubStars,category:e.category,href:ye(e.name),sourceResult:e}}),...!o&&G.length===0?ke.map(e=>({type:"category",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[],...!o&&G.length===0?Se.map(e=>({type:"action",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[]],ae=a.useCallback(e=>{try{fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillName:e,q:K.current.trim(),ts:Date.now()}),keepalive:!0}).catch(()=>{})}catch{}},[T]),D=a.useCallback((e,n)=>{if(n&&(ae(n.name),i))try{i(n,K.current.trim())}catch{}if(E(!1),p)try{p(e)}catch{}},[i,p,ae]);a.useEffect(()=>{function e(n){var l;const r=((l=n.detail)==null?void 0:l.index)??-1,s=f[r];s&&D(s.href,s.type==="skill"?s.sourceResult:void 0)}return window.addEventListener("findSkillsActivateAt",e),()=>window.removeEventListener("findSkillsActivateAt",e)},[f,D]);const fe=e=>{if(e.key==="ArrowDown")e.preventDefault(),v(n=>Math.min(n+1,f.length-1));else if(e.key==="ArrowUp")e.preventDefault(),v(n=>Math.max(n-1,0));else if(e.key==="Enter"&&f[U]){const n=f[U];D(n.href,n.type==="skill"?n.sourceResult:void 0)}};if(!L)return null;let ie="";const se=!j&&!$&&!A&&o.trim().length>=2&&I.length===0,Y=j&&I.length===0&&o.trim().length>=2&&!A,oe=o.trim(),le=()=>{R(!1);const e=o;F(""),setTimeout(()=>F(e),0)},ge={position:"fixed",inset:0,background:"color-mix(in srgb, var(--color-ink, #191919) 35%, transparent)",backdropFilter:"blur(6px) saturate(1.1)",WebkitBackdropFilter:"blur(6px) saturate(1.1)"},he={position:"relative",width:"100%",maxWidth:640,margin:"0 16px",background:"var(--bg-surface, #FFFFFF)",color:"var(--text-primary, #191919)",borderRadius:12,border:"1px solid var(--color-rule, #E8E1D6)",boxShadow:"0 1px 0 rgba(255,255,255,0.6) inset,0 24px 60px -12px rgba(25,20,15,0.28),0 12px 24px -8px rgba(25,20,15,0.18)",overflow:"hidden",fontFamily:J};return t.jsxs("div",{"data-testid":"find-skills-palette",role:"dialog","aria-modal":"true","aria-label":"Find verified skills",style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(18vh, 144px)"},onClick:()=>E(!1),children:[t.jsx("div",{style:ge}),t.jsx("style",{children:`
|
|
1
|
+
import{r as a,j as t,h as xe}from"./index-BLduRWyM.js";import{a as ye}from"./skill-url-C4ekwoGs.js";/* empty css */function me(i){return i?i.replace(/<(?!\/?b>)[^>]+>/gi,""):""}function be(i){return i.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function Ie(i,p){if(!i)return"";const d=be(i);if(!p)return d;const u=p.trim().split(/\s+/).filter(Boolean);if(u.length===0)return d;const T=u.map(W=>W.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),b=new RegExp(`(${T})`,"gi");return d.replace(b,"<b>$1</b>")}function ve(i){return i?i<1e3?String(i):`${(i/1e3).toFixed(1)}k`:""}const ke=[{label:"Security",href:"/skills?category=security"},{label:"Coding",href:"/skills?category=development"},{label:"DevOps",href:"/skills?category=devops"},{label:"Testing",href:"/skills?category=testing"},{label:"Data",href:"/skills?category=data"},{label:"Design",href:"/skills?category=design"}],Se=[{label:"Submit a skill",href:"/submit"},{label:"Browse all skills",href:"/skills"}],J="var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif)",c="var(--font-mono, 'JetBrains Mono', 'SF Mono', Menlo, Consolas, monospace)";function Ee({tier:i,isTainted:p,isBlocked:d}){const u={display:"inline-flex",alignItems:"center",padding:"1px 6px",height:16,borderRadius:3,fontFamily:c,fontSize:9.5,fontWeight:600,letterSpacing:"0.04em",whiteSpace:"nowrap",lineHeight:1,textTransform:"uppercase"};if(d)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"BLOCKED",style:{...u,color:"#7A1F1F",background:"#FBE8E5",border:"1px solid #E8B7B0"},children:"BLOCKED"});if(p)return t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":"TAINTED",style:{...u,color:"#7A4A00",background:"#FBEFD3",border:"1px solid #E8C885"},children:"Tainted"});const b={CERTIFIED:{color:"var(--color-installed, #2F6A4A)",bg:"rgba(47,106,74,0.08)",border:"rgba(47,106,74,0.25)"},VERIFIED:{color:"var(--color-focus, #3B6EA8)",bg:"rgba(59,110,168,0.08)",border:"rgba(59,110,168,0.25)"},REJECTED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"},BLOCKED:{color:"#7A1F1F",bg:"#FBE8E5",border:"#E8B7B0"}}[i];return b?t.jsx("span",{"data-testid":"mini-tier-badge","data-tier":i,style:{...u,color:b.color,background:b.bg,border:`1px solid ${b.border}`},children:xe(i)}):null}function O(){return t.jsxs("div",{"data-testid":"skeleton-row",style:{padding:"10px 18px",display:"flex",alignItems:"center",gap:10},children:[t.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:6},children:[t.jsx("div",{style:{height:12,width:"32%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite"}}),t.jsx("div",{style:{height:9,width:"55%",borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.18s"}})]}),t.jsx("div",{style:{height:14,width:52,borderRadius:3,background:"var(--color-rule, #E8E1D6)",animation:"fsp-pulse 1.4s ease-in-out infinite",animationDelay:"0.36s"}})]})}function Fe(i){var d,u;const p=(d=i.target)==null?void 0:d.tagName;return!!(p==="INPUT"||p==="TEXTAREA"||p==="SELECT"||(u=i.target)!=null&&u.isContentEditable)}const je="/api/v1/studio/search",we="/api/v1/stats",Ae="/api/v1/studio/telemetry/search-select",Re=10,Q=20,Ce=150;function Be({onSelect:i,onNavigate:p,searchUrl:d=je,trendingUrl:u=we,telemetrySelectUrl:T=Ae,maxPages:b=Re,initialOpen:W=!1}={}){const[L,E]=a.useState(W),[o,F]=a.useState(""),[I,h]=a.useState([]),[U,v]=a.useState(0),[j,B]=a.useState(!1),[_,w]=a.useState(1),[H,x]=a.useState(!1),[M,V]=a.useState(!1),[$,k]=a.useState(null),[A,R]=a.useState(!1),Z=a.useRef(null),N=a.useRef(null),z=a.useRef(!1),ee=a.useRef(null),te=a.useRef(null),q=a.useRef(new Map),S=a.useRef(null),[,ue]=a.useState(!1),re=a.useMemo(()=>typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform||""),[]),K=a.useRef(o);a.useEffect(()=>{K.current=o},[o]),a.useEffect(()=>{S.current||fetch(u).then(e=>e.json()).then(e=>{S.current=e.trendingSkills??[],ue(!0)}).catch(()=>{})},[u]),a.useEffect(()=>{const e=r=>{if(r.key==="Escape"){E(!1);return}if(L&&(r.metaKey||r.ctrlKey)&&/^[1-9]$/.test(r.key)){r.preventDefault();const s=Number(r.key)-1;v(s),window.dispatchEvent(new CustomEvent("findSkillsActivateAt",{detail:{index:s}}));return}!r.metaKey&&!r.ctrlKey&&!r.altKey&&r.key.length===1&&!Fe(r)&&(z.current=!0,F(r.key),E(!0))},n=r=>{var y;const l=(y=r.detail)==null?void 0:y.query;l&&(z.current=!0,F(l)),E(!0)};return window.addEventListener("keydown",e),window.addEventListener("openFindSkills",n),()=>{window.removeEventListener("keydown",e),window.removeEventListener("openFindSkills",n)}},[L]),a.useLayoutEffect(()=>{var n;if(!L){(n=N.current)==null||n.abort();return}if(z.current)z.current=!1,h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1);else{const r=(()=>{var s;try{return((s=window.sessionStorage)==null?void 0:s.getItem("find-skills:last-query"))??""}catch{return""}})();F(r),h([]),v(0),w(1),x(!1),B(!1),k(null),R(!1)}const e=Z.current;if(e){e.focus({preventScroll:!0});const r=e.value.length;e.setSelectionRange(r,r)}},[L]),a.useEffect(()=>{if(!o.trim()||o.trim().length<2){h([]),x(!1),w(1),k(null);return}const e=6e4,n=o.trim().toLowerCase(),r=q.current.get(n);if(r&&Date.now()-r.timestamp<e){h(r.results),x(r.hasMore),w(1),B(!1),k(null),fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`).then(m=>m.ok?m.json():null).then(m=>{var g;m&&q.current.set(n,{results:m.results||[],hasMore:((g=m.pagination)==null?void 0:g.hasMore)??!1,timestamp:Date.now()})}).catch(()=>{});return}B(!0),k(null);const l=new AbortController,y=setTimeout(async()=>{var m;try{const g=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=1`,{signal:l.signal});if(g.status>=500){R(!0),h([]),x(!1),k(null);return}if(!g.ok){h([]),x(!1),k(`search failed (${g.status})`);return}const ce=await g.json(),de=ce.results||[],pe=((m=ce.pagination)==null?void 0:m.hasMore)??!1;h(de),x(pe),w(1),R(!1),q.current.set(n,{results:de,hasMore:pe,timestamp:Date.now()})}catch(g){if(g instanceof DOMException&&g.name==="AbortError")return;R(!0),h([]),x(!1),k(null)}finally{l.signal.aborted||B(!1)}},Ce);return()=>{clearTimeout(y),l.abort()}},[o,d]);const C=_>=b,ne=a.useCallback(async()=>{var n,r;if(M||C)return;const e=_+1;V(!0),N.current=new AbortController;try{const s=await fetch(`${d}?q=${encodeURIComponent(o)}&limit=${Q}&page=${e}`,{signal:N.current.signal});if(!s.ok)return;const l=await s.json();h(y=>[...y,...l.results||[]]),x(((n=l.pagination)==null?void 0:n.hasMore)??!1),w(e)}catch(s){if(s instanceof DOMException&&s.name==="AbortError")return}finally{(r=N.current)!=null&&r.signal.aborted||V(!1)}},[_,o,M,C,d]);a.useEffect(()=>{const e=ee.current,n=te.current;if(!e||!n||typeof IntersectionObserver>"u")return;const r=new IntersectionObserver(s=>{s[0].isIntersecting&&H&&!j&&!M&&!C&&ne()},{root:n,rootMargin:"100px"});return r.observe(e),()=>r.disconnect()},[H,j,M,C,ne]);const P=e=>({name:e.name,displayName:e.displayName,author:e.author,repoUrl:e.repoUrl,certTier:e.certTier,githubStars:0,highlight:"",category:"",ownerSlug:e.ownerSlug,repoSlug:e.repoSlug,skillSlug:e.skillSlug}),G=(()=>{const e=o.trim();if(A&&e.length>=1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().includes(n)||(r.displayName??"").toLowerCase().includes(n)).slice(0,30).map(P)}if(e.length>=2)return I;if(e.length===1&&S.current){const n=e.toLowerCase();return S.current.filter(r=>r.name.toLowerCase().startsWith(n)||r.displayName.toLowerCase().startsWith(n)).slice(0,10).map(P)}return e.length===0&&S.current?S.current.slice(0,10).map(P):[]})(),f=[...G.map(e=>{const n=e.skillSlug||e.name.split("/").pop()||e.name,r=e.ownerSlug&&e.repoSlug?`${e.ownerSlug}/${e.repoSlug}`:e.author;return{type:"skill",label:n,publisher:r,name:e.name,command:e.command?e.pluginName?`${e.pluginName}:${e.command}`:e.command:void 0,pluginName:e.pluginName||void 0,meta:e.category||"",certTier:e.certTier,isTainted:e.isTainted,isBlocked:e.isBlocked,repoUrl:e.repoUrl,highlight:e.highlight,githubStars:e.githubStars,category:e.category,href:ye(e.name),sourceResult:e}}),...!o&&G.length===0?ke.map(e=>({type:"category",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[],...!o&&G.length===0?Se.map(e=>({type:"action",label:e.label,publisher:"",name:"",meta:"",certTier:"",repoUrl:"",href:e.href})):[]],ae=a.useCallback(e=>{try{fetch(T,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({skillName:e,q:K.current.trim(),ts:Date.now()}),keepalive:!0}).catch(()=>{})}catch{}},[T]),D=a.useCallback((e,n)=>{if(n&&(ae(n.name),i))try{i(n,K.current.trim())}catch{}if(E(!1),p)try{p(e)}catch{}},[i,p,ae]);a.useEffect(()=>{function e(n){var l;const r=((l=n.detail)==null?void 0:l.index)??-1,s=f[r];s&&D(s.href,s.type==="skill"?s.sourceResult:void 0)}return window.addEventListener("findSkillsActivateAt",e),()=>window.removeEventListener("findSkillsActivateAt",e)},[f,D]);const fe=e=>{if(e.key==="ArrowDown")e.preventDefault(),v(n=>Math.min(n+1,f.length-1));else if(e.key==="ArrowUp")e.preventDefault(),v(n=>Math.max(n-1,0));else if(e.key==="Enter"&&f[U]){const n=f[U];D(n.href,n.type==="skill"?n.sourceResult:void 0)}};if(!L)return null;let ie="";const se=!j&&!$&&!A&&o.trim().length>=2&&I.length===0,Y=j&&I.length===0&&o.trim().length>=2&&!A,oe=o.trim(),le=()=>{R(!1);const e=o;F(""),setTimeout(()=>F(e),0)},ge={position:"fixed",inset:0,background:"color-mix(in srgb, var(--color-ink, #191919) 35%, transparent)",backdropFilter:"blur(6px) saturate(1.1)",WebkitBackdropFilter:"blur(6px) saturate(1.1)"},he={position:"relative",width:"100%",maxWidth:640,margin:"0 16px",background:"var(--bg-surface, #FFFFFF)",color:"var(--text-primary, #191919)",borderRadius:12,border:"1px solid var(--color-rule, #E8E1D6)",boxShadow:"0 1px 0 rgba(255,255,255,0.6) inset,0 24px 60px -12px rgba(25,20,15,0.28),0 12px 24px -8px rgba(25,20,15,0.18)",overflow:"hidden",fontFamily:J};return t.jsxs("div",{"data-testid":"find-skills-palette",role:"dialog","aria-modal":"true","aria-label":"Find verified skills",style:{position:"fixed",inset:0,zIndex:9999,display:"flex",alignItems:"flex-start",justifyContent:"center",paddingTop:"min(18vh, 144px)"},onClick:()=>E(!1),children:[t.jsx("div",{style:ge}),t.jsx("style",{children:`
|
|
2
2
|
@keyframes fsp-pulse {
|
|
3
3
|
0%, 100% { opacity: 1; }
|
|
4
4
|
50% { opacity: 0.45; }
|