mdk-skills 2.2.7 → 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
|
@@ -321,6 +321,7 @@ async function handleApi(req, res) {
|
|
|
321
321
|
const enabledCount = userSkills.filter((s) => s.enabled).length;
|
|
322
322
|
const mdExists = fs.existsSync(path.join(projectRoot, "CLAUDE.md"));
|
|
323
323
|
return sendJSON(res, {
|
|
324
|
+
pkgSkills,
|
|
324
325
|
enabledCount,
|
|
325
326
|
totalCount: pkgSkills.length,
|
|
326
327
|
activeProfile: activeProfile
|
|
@@ -344,11 +345,14 @@ async function handleApi(req, res) {
|
|
|
344
345
|
if (method === "POST" && pathname === "/api/source/connect") {
|
|
345
346
|
const body = await parseBody(req);
|
|
346
347
|
const repoPath = body.path;
|
|
347
|
-
if (!repoPath)
|
|
348
|
-
return sendJSON(res, { error: "缺少仓库路径" }, 400);
|
|
348
|
+
if (!repoPath) return sendJSON(res, { error: "缺少仓库路径" }, 400);
|
|
349
349
|
const resolved = path.resolve(repoPath);
|
|
350
350
|
if (!fs.existsSync(path.join(resolved, ".claude", "skills"))) {
|
|
351
|
-
return sendJSON(
|
|
351
|
+
return sendJSON(
|
|
352
|
+
res,
|
|
353
|
+
{ error: `路径 "${resolved}" 下没有 .claude/skills/` },
|
|
354
|
+
400,
|
|
355
|
+
);
|
|
352
356
|
}
|
|
353
357
|
const settings = readSettings();
|
|
354
358
|
settings._skill_source = resolved;
|
|
@@ -373,8 +377,7 @@ async function handleApi(req, res) {
|
|
|
373
377
|
if (method === "POST" && pathname === "/api/source/sync") {
|
|
374
378
|
const settings = readSettings();
|
|
375
379
|
const sourcePath = settings._skill_source;
|
|
376
|
-
if (!sourcePath)
|
|
377
|
-
return sendJSON(res, { error: "尚未绑定技能源" }, 400);
|
|
380
|
+
if (!sourcePath) return sendJSON(res, { error: "尚未绑定技能源" }, 400);
|
|
378
381
|
if (!fs.existsSync(path.join(sourcePath, ".claude"))) {
|
|
379
382
|
return sendJSON(res, { error: "绑定的路径已失效" }, 400);
|
|
380
383
|
}
|