add-skill 1.0.26 → 1.0.27
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/index.js +13 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1059,7 +1059,7 @@ import { homedir as homedir3 } from "os";
|
|
|
1059
1059
|
import { createHash } from "crypto";
|
|
1060
1060
|
var AGENTS_DIR2 = ".agents";
|
|
1061
1061
|
var LOCK_FILE = ".skill-lock.json";
|
|
1062
|
-
var CURRENT_VERSION =
|
|
1062
|
+
var CURRENT_VERSION = 3;
|
|
1063
1063
|
function getSkillLockPath() {
|
|
1064
1064
|
return join5(homedir3(), AGENTS_DIR2, LOCK_FILE);
|
|
1065
1065
|
}
|
|
@@ -1071,9 +1071,12 @@ async function readSkillLock() {
|
|
|
1071
1071
|
if (typeof parsed.version !== "number" || !parsed.skills) {
|
|
1072
1072
|
return createEmptyLockFile();
|
|
1073
1073
|
}
|
|
1074
|
-
if (parsed.version <
|
|
1074
|
+
if (parsed.version < 2) {
|
|
1075
1075
|
return createEmptyLockFile();
|
|
1076
1076
|
}
|
|
1077
|
+
if (parsed.version < CURRENT_VERSION) {
|
|
1078
|
+
parsed.version = CURRENT_VERSION;
|
|
1079
|
+
}
|
|
1077
1080
|
return parsed;
|
|
1078
1081
|
} catch (error) {
|
|
1079
1082
|
return createEmptyLockFile();
|
|
@@ -1109,7 +1112,7 @@ function createEmptyLockFile() {
|
|
|
1109
1112
|
// package.json
|
|
1110
1113
|
var package_default = {
|
|
1111
1114
|
name: "add-skill",
|
|
1112
|
-
version: "1.0.
|
|
1115
|
+
version: "1.0.27",
|
|
1113
1116
|
description: "Install agent skills onto coding agents (OpenCode, Claude Code, Codex, Cursor)",
|
|
1114
1117
|
type: "module",
|
|
1115
1118
|
bin: {
|
|
@@ -1464,11 +1467,13 @@ async function handleRemoteSkill(source, url, options, spinner2) {
|
|
|
1464
1467
|
});
|
|
1465
1468
|
if (successful.length > 0 && installGlobally) {
|
|
1466
1469
|
try {
|
|
1470
|
+
const contentHash = computeContentHash(remoteSkill.content);
|
|
1467
1471
|
await addSkillToLock(remoteSkill.installName, {
|
|
1468
1472
|
source: remoteSkill.sourceIdentifier,
|
|
1469
1473
|
sourceType: remoteSkill.providerId,
|
|
1470
1474
|
sourceUrl: url,
|
|
1471
|
-
contentHash
|
|
1475
|
+
contentHash
|
|
1476
|
+
// skillFolderHash will be populated by server during update check
|
|
1472
1477
|
});
|
|
1473
1478
|
} catch {
|
|
1474
1479
|
}
|
|
@@ -1722,11 +1727,13 @@ async function handleDirectUrlSkillLegacy(source, url, options, spinner2) {
|
|
|
1722
1727
|
});
|
|
1723
1728
|
if (successful.length > 0 && installGlobally) {
|
|
1724
1729
|
try {
|
|
1730
|
+
const contentHash = computeContentHash(mintlifySkill.content);
|
|
1725
1731
|
await addSkillToLock(mintlifySkill.mintlifySite, {
|
|
1726
1732
|
source: `mintlify/${mintlifySkill.mintlifySite}`,
|
|
1727
1733
|
sourceType: "mintlify",
|
|
1728
1734
|
sourceUrl: url,
|
|
1729
|
-
contentHash
|
|
1735
|
+
contentHash
|
|
1736
|
+
// skillFolderHash will be populated by server during update check
|
|
1730
1737
|
});
|
|
1731
1738
|
} catch {
|
|
1732
1739
|
}
|
|
@@ -2104,6 +2111,7 @@ async function main(source, options) {
|
|
|
2104
2111
|
sourceUrl: parsed.url,
|
|
2105
2112
|
skillPath: skillFiles[skill.name],
|
|
2106
2113
|
contentHash: skill.rawContent ? computeContentHash(skill.rawContent) : ""
|
|
2114
|
+
// skillFolderHash is populated by server via GitHub Trees API
|
|
2107
2115
|
});
|
|
2108
2116
|
} catch {
|
|
2109
2117
|
}
|