skills 1.0.17 → 1.0.18
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/dist/cli.js +7 -35
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -12,7 +12,6 @@ import {
|
|
|
12
12
|
} from "fs";
|
|
13
13
|
import { basename, join } from "path";
|
|
14
14
|
import { homedir } from "os";
|
|
15
|
-
import { createHash } from "crypto";
|
|
16
15
|
var RESET = "\x1B[0m";
|
|
17
16
|
var BOLD = "\x1B[1m";
|
|
18
17
|
var DIM = "\x1B[38;5;102m";
|
|
@@ -313,7 +312,7 @@ async function runGenerateLock(args) {
|
|
|
313
312
|
source: match.source,
|
|
314
313
|
sourceType,
|
|
315
314
|
sourceUrl,
|
|
316
|
-
|
|
315
|
+
skillFolderHash: "",
|
|
317
316
|
installedAt: now,
|
|
318
317
|
updatedAt: now
|
|
319
318
|
};
|
|
@@ -338,20 +337,6 @@ async function runGenerateLock(args) {
|
|
|
338
337
|
console.log(`${TEXT}Lock file updated:${RESET} ${DIM}~/.agents/.skill-lock.json${RESET}`);
|
|
339
338
|
}
|
|
340
339
|
}
|
|
341
|
-
function computeContentHash(content) {
|
|
342
|
-
return createHash("sha256").update(content, "utf-8").digest("hex");
|
|
343
|
-
}
|
|
344
|
-
function getSkillContentPath(skillName) {
|
|
345
|
-
return join(homedir(), AGENTS_DIR, SKILLS_SUBDIR, skillName, "SKILL.md");
|
|
346
|
-
}
|
|
347
|
-
function readSkillContent(skillName) {
|
|
348
|
-
const skillPath = getSkillContentPath(skillName);
|
|
349
|
-
try {
|
|
350
|
-
return readFileSync(skillPath, "utf-8");
|
|
351
|
-
} catch {
|
|
352
|
-
return null;
|
|
353
|
-
}
|
|
354
|
-
}
|
|
355
340
|
async function runCheck(args = []) {
|
|
356
341
|
const forceRefresh = true;
|
|
357
342
|
console.log(`${TEXT}Checking for skill updates...${RESET}`);
|
|
@@ -373,21 +358,14 @@ async function runCheck(args = []) {
|
|
|
373
358
|
const entry = lock.skills[skillName];
|
|
374
359
|
if (!entry)
|
|
375
360
|
continue;
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
if (content) {
|
|
380
|
-
contentHash = computeContentHash(content);
|
|
381
|
-
} else {
|
|
382
|
-
console.log(`${DIM}Skipping ${skillName}: cannot read SKILL.md${RESET}`);
|
|
383
|
-
continue;
|
|
384
|
-
}
|
|
361
|
+
if (!entry.skillFolderHash) {
|
|
362
|
+
console.log(`${DIM}Skipping ${skillName}: no skillFolderHash (reinstall needed)${RESET}`);
|
|
363
|
+
continue;
|
|
385
364
|
}
|
|
386
365
|
checkRequest.skills.push({
|
|
387
366
|
name: skillName,
|
|
388
367
|
source: entry.source,
|
|
389
368
|
path: entry.skillPath,
|
|
390
|
-
contentHash,
|
|
391
369
|
skillFolderHash: entry.skillFolderHash
|
|
392
370
|
});
|
|
393
371
|
}
|
|
@@ -450,20 +428,14 @@ async function runUpdate() {
|
|
|
450
428
|
const entry = lock.skills[skillName];
|
|
451
429
|
if (!entry)
|
|
452
430
|
continue;
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
if (content) {
|
|
457
|
-
contentHash = computeContentHash(content);
|
|
458
|
-
} else {
|
|
459
|
-
continue;
|
|
460
|
-
}
|
|
431
|
+
if (!entry.skillFolderHash) {
|
|
432
|
+
console.log(`${DIM}Skipping ${skillName}: no skillFolderHash (reinstall needed)${RESET}`);
|
|
433
|
+
continue;
|
|
461
434
|
}
|
|
462
435
|
checkRequest.skills.push({
|
|
463
436
|
name: skillName,
|
|
464
437
|
source: entry.source,
|
|
465
438
|
path: entry.skillPath,
|
|
466
|
-
contentHash,
|
|
467
439
|
skillFolderHash: entry.skillFolderHash
|
|
468
440
|
});
|
|
469
441
|
}
|