mdk-skills 2.2.6 → 2.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/scripts/web-ui/server.js
CHANGED
|
@@ -313,6 +313,7 @@ async function handleApi(req, res) {
|
|
|
313
313
|
if (method === "GET" && pathname === "/api/status") {
|
|
314
314
|
const settings = readSettings();
|
|
315
315
|
const userSkills = core.getUserSkills(claudeDest);
|
|
316
|
+
const pkgSkills = core.getPackageSkills(skillsSource);
|
|
316
317
|
const profiles = loadProfiles();
|
|
317
318
|
const activeProfile = profiles?.find(
|
|
318
319
|
(p) => p.id === settings._active_profile,
|
|
@@ -320,8 +321,9 @@ async function handleApi(req, res) {
|
|
|
320
321
|
const enabledCount = userSkills.filter((s) => s.enabled).length;
|
|
321
322
|
const mdExists = fs.existsSync(path.join(projectRoot, "CLAUDE.md"));
|
|
322
323
|
return sendJSON(res, {
|
|
324
|
+
pkgSkills,
|
|
323
325
|
enabledCount,
|
|
324
|
-
totalCount:
|
|
326
|
+
totalCount: pkgSkills.length,
|
|
325
327
|
activeProfile: activeProfile
|
|
326
328
|
? { id: activeProfile.id, name: activeProfile.name }
|
|
327
329
|
: null,
|
|
@@ -343,11 +345,14 @@ async function handleApi(req, res) {
|
|
|
343
345
|
if (method === "POST" && pathname === "/api/source/connect") {
|
|
344
346
|
const body = await parseBody(req);
|
|
345
347
|
const repoPath = body.path;
|
|
346
|
-
if (!repoPath)
|
|
347
|
-
return sendJSON(res, { error: "缺少仓库路径" }, 400);
|
|
348
|
+
if (!repoPath) return sendJSON(res, { error: "缺少仓库路径" }, 400);
|
|
348
349
|
const resolved = path.resolve(repoPath);
|
|
349
350
|
if (!fs.existsSync(path.join(resolved, ".claude", "skills"))) {
|
|
350
|
-
return sendJSON(
|
|
351
|
+
return sendJSON(
|
|
352
|
+
res,
|
|
353
|
+
{ error: `路径 "${resolved}" 下没有 .claude/skills/` },
|
|
354
|
+
400,
|
|
355
|
+
);
|
|
351
356
|
}
|
|
352
357
|
const settings = readSettings();
|
|
353
358
|
settings._skill_source = resolved;
|
|
@@ -372,8 +377,7 @@ async function handleApi(req, res) {
|
|
|
372
377
|
if (method === "POST" && pathname === "/api/source/sync") {
|
|
373
378
|
const settings = readSettings();
|
|
374
379
|
const sourcePath = settings._skill_source;
|
|
375
|
-
if (!sourcePath)
|
|
376
|
-
return sendJSON(res, { error: "尚未绑定技能源" }, 400);
|
|
380
|
+
if (!sourcePath) return sendJSON(res, { error: "尚未绑定技能源" }, 400);
|
|
377
381
|
if (!fs.existsSync(path.join(sourcePath, ".claude"))) {
|
|
378
382
|
return sendJSON(res, { error: "绑定的路径已失效" }, 400);
|
|
379
383
|
}
|