@ariestools/toolchain 10.0.2 → 10.0.4
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/actions/dead/classifyPackageVisibility.d.ts +2 -3
- package/dist/actions/dead/classifyPackageVisibility.d.ts.map +1 -1
- package/dist/actions/dead/types.d.ts +0 -1
- package/dist/actions/dead/types.d.ts.map +1 -1
- package/dist/actions/deplint/deplint.d.ts.map +1 -1
- package/dist/actions/deplint/engine.d.ts.map +1 -1
- package/dist/actions/deplint/fetchPackageManifest.d.ts +17 -0
- package/dist/actions/deplint/fetchPackageManifest.d.ts.map +1 -1
- package/dist/actions/deplint/index.d.ts +1 -0
- package/dist/actions/deplint/index.d.ts.map +1 -1
- package/dist/actions/deplint/packageJsonEditor.d.ts +3 -0
- package/dist/actions/deplint/packageJsonEditor.d.ts.map +1 -1
- package/dist/actions/deplint/ruleConfig.d.ts.map +1 -1
- package/dist/actions/deplint/rules.d.ts.map +1 -1
- package/dist/actions/deplint/rulesNotPublic.d.ts +25 -0
- package/dist/actions/deplint/rulesNotPublic.d.ts.map +1 -0
- package/dist/actions/deplint/snapshot.d.ts +1 -0
- package/dist/actions/deplint/snapshot.d.ts.map +1 -1
- package/dist/actions/deplint/types.d.ts +10 -0
- package/dist/actions/deplint/types.d.ts.map +1 -1
- package/dist/actions/package/compile/XyConfig.d.ts +2 -0
- package/dist/actions/package/compile/XyConfig.d.ts.map +1 -1
- package/dist/bin/package/build.mjs +2 -2
- package/dist/bin/package/build.mjs.map +1 -1
- package/dist/bin/package/clean.mjs +2 -2
- package/dist/bin/package/clean.mjs.map +1 -1
- package/dist/bin/package/compile.mjs +2 -2
- package/dist/bin/package/compile.mjs.map +1 -1
- package/dist/bin/package/publint.mjs +2 -2
- package/dist/bin/package/publint.mjs.map +1 -1
- package/dist/bin/package/recompile.mjs +2 -2
- package/dist/bin/package/recompile.mjs.map +1 -1
- package/dist/bin/package/sync-layout.mjs +2 -2
- package/dist/bin/package/sync-layout.mjs.map +1 -1
- package/dist/bin/skills.mjs +158 -60
- package/dist/bin/skills.mjs.map +1 -1
- package/dist/bin/xy.mjs +250 -88
- package/dist/bin/xy.mjs.map +1 -1
- package/dist/bin/xyex.mjs +250 -88
- package/dist/bin/xyex.mjs.map +1 -1
- package/dist/lib/classifyPackageVisibility.d.ts +8 -0
- package/dist/lib/classifyPackageVisibility.d.ts.map +1 -0
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/package.json +6 -6
package/dist/bin/skills.mjs
CHANGED
|
@@ -54,7 +54,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
54
54
|
};
|
|
55
55
|
var __require$1 = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
56
56
|
//#endregion
|
|
57
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
57
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/rolldown-runtime.mjs
|
|
58
58
|
var __create, __defProp$1, __getOwnPropDesc$1, __getOwnPropNames$1, __getProtoOf, __hasOwnProp$1, __commonJSMin, __copyProps$1, __toESM, __require;
|
|
59
59
|
var init_rolldown_runtime = __esmMin((() => {
|
|
60
60
|
__create = Object.create;
|
|
@@ -81,7 +81,7 @@ var init_rolldown_runtime = __esmMin((() => {
|
|
|
81
81
|
__require = /* #__PURE__ */ (() => createRequire(import.meta.url))();
|
|
82
82
|
}));
|
|
83
83
|
//#endregion
|
|
84
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
84
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/@clack/core.mjs
|
|
85
85
|
function wrapAnsi(string, columns, options) {
|
|
86
86
|
return String(string).normalize().split(CRLF_OR_LF).map((line) => exec(line, columns, options)).join("\n");
|
|
87
87
|
}
|
|
@@ -780,7 +780,7 @@ var init_core = __esmMin((() => {
|
|
|
780
780
|
};
|
|
781
781
|
}));
|
|
782
782
|
//#endregion
|
|
783
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
783
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/@clack/prompts.mjs
|
|
784
784
|
function isUnicodeSupported() {
|
|
785
785
|
if (process$1.platform !== "win32") return process$1.env.TERM !== "linux";
|
|
786
786
|
return Boolean(process$1.env.CI) || Boolean(process$1.env.WT_SESSION) || Boolean(process$1.env.TERMINUS_SUBLIME) || process$1.env.ConEmuTask === "{cmd::Cmder}" || process$1.env.TERM_PROGRAM === "Terminus-Sublime" || process$1.env.TERM_PROGRAM === "vscode" || process$1.env.TERM === "xterm-256color" || process$1.env.TERM === "alacritty" || process$1.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
@@ -1227,7 +1227,7 @@ ${b}
|
|
|
1227
1227
|
`${styleText("gray", S_BAR$1)}`;
|
|
1228
1228
|
}));
|
|
1229
1229
|
//#endregion
|
|
1230
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
1230
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/picocolors.mjs
|
|
1231
1231
|
var require_picocolors;
|
|
1232
1232
|
var init_picocolors = __esmMin((() => {
|
|
1233
1233
|
init_rolldown_runtime();
|
|
@@ -1301,7 +1301,7 @@ var init_picocolors = __esmMin((() => {
|
|
|
1301
1301
|
}));
|
|
1302
1302
|
}));
|
|
1303
1303
|
//#endregion
|
|
1304
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
1304
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/@kwsites/file-exists.mjs
|
|
1305
1305
|
var require_ms, require_common, require_browser, require_node, require_src$1, require_src, require_dist$3;
|
|
1306
1306
|
var init_file_exists = __esmMin((() => {
|
|
1307
1307
|
init_rolldown_runtime();
|
|
@@ -1867,7 +1867,7 @@ var init_file_exists = __esmMin((() => {
|
|
|
1867
1867
|
}));
|
|
1868
1868
|
}));
|
|
1869
1869
|
//#endregion
|
|
1870
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
1870
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/@simple-git/args-pathspec.mjs
|
|
1871
1871
|
function c$1(...n) {
|
|
1872
1872
|
const e = new String(n);
|
|
1873
1873
|
return t.set(e, n), e;
|
|
@@ -1883,7 +1883,7 @@ var init_args_pathspec = __esmMin((() => {
|
|
|
1883
1883
|
t = /* @__PURE__ */ new WeakMap();
|
|
1884
1884
|
}));
|
|
1885
1885
|
//#endregion
|
|
1886
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
1886
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/@kwsites/promise-deferred.mjs
|
|
1887
1887
|
var require_dist$2;
|
|
1888
1888
|
var init_promise_deferred = __esmMin((() => {
|
|
1889
1889
|
init_rolldown_runtime();
|
|
@@ -1924,7 +1924,7 @@ var init_promise_deferred = __esmMin((() => {
|
|
|
1924
1924
|
}));
|
|
1925
1925
|
}));
|
|
1926
1926
|
//#endregion
|
|
1927
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
1927
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/@simple-git/argv-parser.mjs
|
|
1928
1928
|
function* U$1(e, t) {
|
|
1929
1929
|
const n = t === "global";
|
|
1930
1930
|
for (const o of e) o.isGlobal === n && (yield o);
|
|
@@ -2399,7 +2399,7 @@ var init_argv_parser = __esmMin((() => {
|
|
|
2399
2399
|
};
|
|
2400
2400
|
}));
|
|
2401
2401
|
//#endregion
|
|
2402
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
2402
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/simple-git.mjs
|
|
2403
2403
|
function asFunction(source) {
|
|
2404
2404
|
if (typeof source !== "function") return NOOP;
|
|
2405
2405
|
return source;
|
|
@@ -5909,7 +5909,7 @@ var init_simple_git = __esmMin((() => {
|
|
|
5909
5909
|
esm_default = gitInstanceFactory;
|
|
5910
5910
|
}));
|
|
5911
5911
|
//#endregion
|
|
5912
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
5912
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/xdg-basedir.mjs
|
|
5913
5913
|
var homeDirectory, env, xdgData, xdgConfig, xdgDataDirectories, xdgConfigDirectories;
|
|
5914
5914
|
var init_xdg_basedir = __esmMin((() => {
|
|
5915
5915
|
homeDirectory = os.homedir();
|
|
@@ -5925,7 +5925,7 @@ var init_xdg_basedir = __esmMin((() => {
|
|
|
5925
5925
|
if (xdgConfig) xdgConfigDirectories.unshift(xdgConfig);
|
|
5926
5926
|
}));
|
|
5927
5927
|
//#endregion
|
|
5928
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
5928
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/_chunks/libs/@vercel/detect-agent.mjs
|
|
5929
5929
|
var require_dist$1;
|
|
5930
5930
|
var init_detect_agent = __esmMin((() => {
|
|
5931
5931
|
init_rolldown_runtime();
|
|
@@ -16024,7 +16024,7 @@ while (this[Zs](this[st].shift()));
|
|
|
16024
16024
|
};
|
|
16025
16025
|
}));
|
|
16026
16026
|
//#endregion
|
|
16027
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
16027
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/dist/cli.mjs
|
|
16028
16028
|
var cli_exports = /* @__PURE__ */ __exportAll({});
|
|
16029
16029
|
function getGitHubHost() {
|
|
16030
16030
|
const configuredHost = process.env.GH_HOST?.trim();
|
|
@@ -16650,6 +16650,25 @@ async function searchMultiselect(options) {
|
|
|
16650
16650
|
render();
|
|
16651
16651
|
});
|
|
16652
16652
|
}
|
|
16653
|
+
function isCommitSha(ref) {
|
|
16654
|
+
return /^[0-9a-f]{40}$/i.test(ref);
|
|
16655
|
+
}
|
|
16656
|
+
function isMissingRefError(message) {
|
|
16657
|
+
return /Remote branch .* not found in upstream origin/i.test(message) || /couldn't find remote ref/i.test(message) || /upload-pack: not our ref/i.test(message);
|
|
16658
|
+
}
|
|
16659
|
+
async function cloneAtSha(url, sha, tempDir, extraEnv) {
|
|
16660
|
+
const git = createGitClient(extraEnv);
|
|
16661
|
+
await git.cwd(tempDir);
|
|
16662
|
+
await git.init();
|
|
16663
|
+
await git.addRemote("origin", url);
|
|
16664
|
+
await git.fetch([
|
|
16665
|
+
"--depth",
|
|
16666
|
+
"1",
|
|
16667
|
+
"origin",
|
|
16668
|
+
sha
|
|
16669
|
+
]);
|
|
16670
|
+
await git.checkout("FETCH_HEAD");
|
|
16671
|
+
}
|
|
16653
16672
|
function parseGitHubRepoUrl(url) {
|
|
16654
16673
|
const sshMatch = url.match(/^git@([^:]+):([^/]+)\/([^/]+?)(?:\.git)?$/i);
|
|
16655
16674
|
if (sshMatch && isGitHubHost(sshMatch[1])) {
|
|
@@ -16695,7 +16714,7 @@ function isGitHubSsoAuthError(message) {
|
|
|
16695
16714
|
function isAuthFailure(message) {
|
|
16696
16715
|
return message.includes("Authentication failed") || message.includes("could not read Username") || message.includes("Permission denied") || message.includes("Repository not found") || message.includes("requested URL returned error: 403") || isGitHubSsoAuthError(message);
|
|
16697
16716
|
}
|
|
16698
|
-
function createGitClient(
|
|
16717
|
+
function createGitClient(extraEnv) {
|
|
16699
16718
|
const git = esm_default({
|
|
16700
16719
|
timeout: { block: CLONE_TIMEOUT_MS },
|
|
16701
16720
|
config: [
|
|
@@ -16731,7 +16750,7 @@ function createGitClient(sshCommand) {
|
|
|
16731
16750
|
GIT_TERMINAL_PROMPT: "0",
|
|
16732
16751
|
GIT_ALLOW_PROTOCOL: ALLOWED_GIT_PROTOCOLS,
|
|
16733
16752
|
GIT_LFS_SKIP_SMUDGE: "1",
|
|
16734
|
-
...
|
|
16753
|
+
...extraEnv
|
|
16735
16754
|
});
|
|
16736
16755
|
return git;
|
|
16737
16756
|
}
|
|
@@ -16799,12 +16818,18 @@ async function cloneRepo(url, ref) {
|
|
|
16799
16818
|
"--branch",
|
|
16800
16819
|
ref
|
|
16801
16820
|
] : ["--depth", "1"];
|
|
16821
|
+
const refCanBeSha = !!ref && isCommitSha(ref);
|
|
16802
16822
|
const repo = parseGitHubRepoUrl(url);
|
|
16803
16823
|
try {
|
|
16804
16824
|
await createGitClient().clone(url, tempDir, cloneOptions);
|
|
16805
16825
|
return tempDir;
|
|
16806
16826
|
} catch (error) {
|
|
16807
16827
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
16828
|
+
if (refCanBeSha && isMissingRefError(errorMessage)) try {
|
|
16829
|
+
await resetTempDir(tempDir);
|
|
16830
|
+
await cloneAtSha(url, ref, tempDir);
|
|
16831
|
+
return tempDir;
|
|
16832
|
+
} catch {}
|
|
16808
16833
|
const isTimeout = errorMessage.includes("block timeout") || errorMessage.includes("timed out");
|
|
16809
16834
|
const isAuthError = isAuthFailure(errorMessage);
|
|
16810
16835
|
if (isTimeout) {
|
|
@@ -16821,7 +16846,16 @@ async function cloneRepo(url, ref) {
|
|
|
16821
16846
|
} catch {}
|
|
16822
16847
|
try {
|
|
16823
16848
|
await resetTempDir(tempDir);
|
|
16824
|
-
|
|
16849
|
+
const sshEnv = { GIT_SSH_COMMAND: process.env.GIT_SSH_COMMAND ?? "ssh -o BatchMode=yes" };
|
|
16850
|
+
try {
|
|
16851
|
+
await createGitClient(sshEnv).clone(repo.sshUrl, tempDir, cloneOptions);
|
|
16852
|
+
} catch (sshError) {
|
|
16853
|
+
const sshMessage = sshError instanceof Error ? sshError.message : String(sshError);
|
|
16854
|
+
if (refCanBeSha && isMissingRefError(sshMessage)) {
|
|
16855
|
+
await resetTempDir(tempDir);
|
|
16856
|
+
await cloneAtSha(repo.sshUrl, ref, tempDir, sshEnv);
|
|
16857
|
+
} else throw sshError;
|
|
16858
|
+
}
|
|
16825
16859
|
return tempDir;
|
|
16826
16860
|
} catch {}
|
|
16827
16861
|
}
|
|
@@ -17039,7 +17073,7 @@ function createEmptyLocalLock() {
|
|
|
17039
17073
|
skills: {}
|
|
17040
17074
|
};
|
|
17041
17075
|
}
|
|
17042
|
-
function normalizeSkillName(name) {
|
|
17076
|
+
function normalizeSkillName$1(name) {
|
|
17043
17077
|
return name.toLowerCase().replace(/[\s_]+/g, "-");
|
|
17044
17078
|
}
|
|
17045
17079
|
function normalizeRelativePath(path) {
|
|
@@ -17119,7 +17153,7 @@ async function discoverSkills(basePath, subpath, options) {
|
|
|
17119
17153
|
const seenNames = /* @__PURE__ */ new Set();
|
|
17120
17154
|
const parsedSkillPaths = /* @__PURE__ */ new Set();
|
|
17121
17155
|
const localLock = await readLocalLock(basePath);
|
|
17122
|
-
const lockedSkillNames = new Set(Object.keys(localLock.skills).map(normalizeSkillName));
|
|
17156
|
+
const lockedSkillNames = new Set(Object.keys(localLock.skills).map(normalizeSkillName$1));
|
|
17123
17157
|
if (subpath && !isSubpathSafe(basePath, subpath)) throw new Error(`Invalid subpath: "${subpath}" resolves outside the repository directory. Subpath must not contain ".." segments that escape the base path.`);
|
|
17124
17158
|
const searchPath = subpath ? join$1(basePath, subpath) : basePath;
|
|
17125
17159
|
const pluginGroupings = await getPluginGroupings(searchPath);
|
|
@@ -17132,8 +17166,8 @@ async function discoverSkills(basePath, subpath, options) {
|
|
|
17132
17166
|
if (lockedSkillNames.size === 0) return false;
|
|
17133
17167
|
const relativeDir = normalizeRelativePath(relative(basePath, skill.path));
|
|
17134
17168
|
if (!AGENT_PROJECT_SKILL_DIRS.some((dir) => relativeDir === dir || relativeDir.startsWith(`${dir}/`))) return false;
|
|
17135
|
-
const skillName = normalizeSkillName(skill.name);
|
|
17136
|
-
const directoryName = normalizeSkillName(basename$1(skill.path));
|
|
17169
|
+
const skillName = normalizeSkillName$1(skill.name);
|
|
17170
|
+
const directoryName = normalizeSkillName$1(basename$1(skill.path));
|
|
17137
17171
|
return lockedSkillNames.has(skillName) || lockedSkillNames.has(directoryName);
|
|
17138
17172
|
};
|
|
17139
17173
|
const parseSkillAt = async (skillDir) => {
|
|
@@ -17166,7 +17200,7 @@ async function discoverSkills(basePath, subpath, options) {
|
|
|
17166
17200
|
const tryAddSkillAt = async (skillDir) => {
|
|
17167
17201
|
if (!await hasSkillMd(skillDir)) return false;
|
|
17168
17202
|
let skill = await parseSkillAt(skillDir);
|
|
17169
|
-
if (!skill || seenNames.has(skill.name)) return true;
|
|
17203
|
+
if (!skill || !options?.includeDuplicateNames && seenNames.has(skill.name)) return true;
|
|
17170
17204
|
if (isInstalledProjectSkill(skill)) return true;
|
|
17171
17205
|
skill = enhanceSkill(skill);
|
|
17172
17206
|
skills.push(skill);
|
|
@@ -17189,7 +17223,7 @@ async function discoverSkills(basePath, subpath, options) {
|
|
|
17189
17223
|
const allSkillDirs = await findSkillDirs(searchPath);
|
|
17190
17224
|
for (const skillDir of allSkillDirs) {
|
|
17191
17225
|
let skill = await parseSkillAt(skillDir);
|
|
17192
|
-
if (skill && !seenNames.has(skill.name) && !isInstalledProjectSkill(skill)) {
|
|
17226
|
+
if (skill && (options?.includeDuplicateNames || !seenNames.has(skill.name)) && !isInstalledProjectSkill(skill)) {
|
|
17193
17227
|
skill = enhanceSkill(skill);
|
|
17194
17228
|
skills.push(skill);
|
|
17195
17229
|
seenNames.add(skill.name);
|
|
@@ -20989,6 +21023,46 @@ function parseRemoveOptions(args) {
|
|
|
20989
21023
|
options
|
|
20990
21024
|
};
|
|
20991
21025
|
}
|
|
21026
|
+
function normalizeSkillName(name) {
|
|
21027
|
+
return name.toLowerCase().replace(/[\s_]+/g, "-");
|
|
21028
|
+
}
|
|
21029
|
+
function normalizeSkillPath(path) {
|
|
21030
|
+
return path.replace(/\\/g, "/").replace(/\/+/g, "/");
|
|
21031
|
+
}
|
|
21032
|
+
function resolveSkillLocations(lockedSkillNames, lockSkills, discovered) {
|
|
21033
|
+
const discoveredPaths = new Set(discovered.map((skill) => normalizeSkillPath(skill.skillPath)));
|
|
21034
|
+
const pathsByName = /* @__PURE__ */ new Map();
|
|
21035
|
+
for (const skill of discovered) {
|
|
21036
|
+
const key = normalizeSkillName(skill.name);
|
|
21037
|
+
const paths = pathsByName.get(key) ?? /* @__PURE__ */ new Set();
|
|
21038
|
+
paths.add(normalizeSkillPath(skill.skillPath));
|
|
21039
|
+
pathsByName.set(key, paths);
|
|
21040
|
+
}
|
|
21041
|
+
const deletedSkills = [];
|
|
21042
|
+
const ambiguousSkills = [];
|
|
21043
|
+
const resolvedPaths = /* @__PURE__ */ new Map();
|
|
21044
|
+
for (const name of lockedSkillNames) {
|
|
21045
|
+
const lockedPath = lockSkills[name]?.skillPath;
|
|
21046
|
+
if (!lockedPath) continue;
|
|
21047
|
+
const normalizedLockedPath = normalizeSkillPath(lockedPath);
|
|
21048
|
+
const candidates = [...pathsByName.get(normalizeSkillName(name)) ?? []];
|
|
21049
|
+
if (candidates.length > 1) {
|
|
21050
|
+
ambiguousSkills.push(name);
|
|
21051
|
+
continue;
|
|
21052
|
+
}
|
|
21053
|
+
if (discoveredPaths.has(normalizedLockedPath)) {
|
|
21054
|
+
resolvedPaths.set(name, normalizedLockedPath);
|
|
21055
|
+
continue;
|
|
21056
|
+
}
|
|
21057
|
+
if (candidates.length === 1) resolvedPaths.set(name, candidates[0]);
|
|
21058
|
+
else deletedSkills.push(name);
|
|
21059
|
+
}
|
|
21060
|
+
return {
|
|
21061
|
+
deletedSkills,
|
|
21062
|
+
ambiguousSkills,
|
|
21063
|
+
resolvedPaths
|
|
21064
|
+
};
|
|
21065
|
+
}
|
|
20992
21066
|
function getUpdateChildEnv(sourceType) {
|
|
20993
21067
|
if (sourceType !== "github") return;
|
|
20994
21068
|
return {
|
|
@@ -21130,14 +21204,15 @@ async function promptDeletions(source, deletedSkills, isGlobal, options) {
|
|
|
21130
21204
|
});
|
|
21131
21205
|
}
|
|
21132
21206
|
}
|
|
21133
|
-
async function checkAndPromptForDeletions(source, allLockedForSource, lockSkills, isGlobal, options,
|
|
21134
|
-
const
|
|
21135
|
-
|
|
21136
|
-
|
|
21137
|
-
|
|
21138
|
-
|
|
21139
|
-
|
|
21140
|
-
|
|
21207
|
+
async function checkAndPromptForDeletions(source, allLockedForSource, lockSkills, isGlobal, options, discovered) {
|
|
21208
|
+
const resolution = resolveSkillLocations(allLockedForSource, lockSkills, discovered);
|
|
21209
|
+
if (resolution.ambiguousSkills.length > 0) {
|
|
21210
|
+
console.log();
|
|
21211
|
+
console.log(`${DIM$1}Warning:${RESET$1} Multiple current paths match these skills from ${DIM$1}${source}${RESET$1}; skipping them rather than deleting or migrating the wrong skill:`);
|
|
21212
|
+
for (const name of resolution.ambiguousSkills) console.log(` ${DIM$1}•${RESET$1} ${sanitizeMetadata(name)}`);
|
|
21213
|
+
}
|
|
21214
|
+
await promptDeletions(source, resolution.deletedSkills, isGlobal, options);
|
|
21215
|
+
return resolution;
|
|
21141
21216
|
}
|
|
21142
21217
|
async function checkWellKnownForUpdates(baseUrl, items) {
|
|
21143
21218
|
let indexResult;
|
|
@@ -21321,36 +21396,42 @@ async function updateGlobalSkills(options = {}) {
|
|
|
21321
21396
|
const tree = await fetchRepoTree(source, firstEntry.ref, getGitHubToken);
|
|
21322
21397
|
if (tree) {
|
|
21323
21398
|
const discoveredPaths = tree.tree.filter((entry) => entry.type === "blob").map((entry) => entry.path);
|
|
21324
|
-
|
|
21325
|
-
|
|
21326
|
-
|
|
21327
|
-
|
|
21328
|
-
|
|
21329
|
-
|
|
21330
|
-
|
|
21331
|
-
|
|
21332
|
-
|
|
21333
|
-
|
|
21399
|
+
if (!Object.entries(lock.skills).filter(([_, entry]) => entry.source === source && entry.ref === firstEntry.ref).map(([name, _]) => name).some((name) => lock.skills[name]?.skillPath && !discoveredPaths.includes(lock.skills[name].skillPath))) {
|
|
21400
|
+
for (const { name: skillName, entry } of itemsForSource) {
|
|
21401
|
+
const latestHash = getSkillFolderHashFromTree(tree, entry.skillPath);
|
|
21402
|
+
if (latestHash && latestHash !== entry.skillFolderHash) updates.push({
|
|
21403
|
+
name: skillName,
|
|
21404
|
+
source,
|
|
21405
|
+
entry
|
|
21406
|
+
});
|
|
21407
|
+
}
|
|
21408
|
+
continue;
|
|
21334
21409
|
}
|
|
21335
|
-
|
|
21336
|
-
}
|
|
21337
|
-
console.log(` ${DIM$1}GitHub API unavailable; checking via Git clone${RESET$1}`);
|
|
21410
|
+
console.log(` ${DIM$1}Skill paths changed; resolving via Git clone${RESET$1}`);
|
|
21411
|
+
} else console.log(` ${DIM$1}GitHub API unavailable; checking via Git clone${RESET$1}`);
|
|
21338
21412
|
}
|
|
21339
21413
|
tempDir = await cloneRepo(sourceUrl, firstEntry.ref);
|
|
21340
|
-
const
|
|
21341
|
-
|
|
21342
|
-
|
|
21343
|
-
|
|
21344
|
-
|
|
21414
|
+
const discoveredLocations = (await discoverSkills(tempDir, void 0, {
|
|
21415
|
+
fullDepth: true,
|
|
21416
|
+
includeDuplicateNames: true
|
|
21417
|
+
})).map((skill) => ({
|
|
21418
|
+
name: skill.name,
|
|
21419
|
+
skillPath: join$1(relative(tempDir, skill.path), "SKILL.md").split(sep$1).join("/")
|
|
21420
|
+
}));
|
|
21421
|
+
const resolution = await checkAndPromptForDeletions(source, Object.entries(lock.skills).filter(([_, entry]) => entry.source === source && entry.ref === firstEntry.ref).map(([name, _]) => name), lock.skills, true, options, discoveredLocations);
|
|
21422
|
+
const deletedSkillSet = new Set(resolution.deletedSkills);
|
|
21345
21423
|
for (const { name: skillName, entry } of itemsForSource) {
|
|
21346
21424
|
if (deletedSkillSet.has(skillName)) continue;
|
|
21347
|
-
const skillPath =
|
|
21348
|
-
if (!
|
|
21425
|
+
const skillPath = resolution.resolvedPaths.get(skillName);
|
|
21426
|
+
if (!skillPath) continue;
|
|
21349
21427
|
const latestHash = isGitHubSource && /^[0-9a-f]{40}$/i.test(entry.skillFolderHash) ? await getGitTreeHash(tempDir, skillPath) : await computeSkillFolderHash(join$1(tempDir, dirname$1(skillPath)));
|
|
21350
|
-
if (latestHash && latestHash !== entry.skillFolderHash) updates.push({
|
|
21428
|
+
if (skillPath !== entry.skillPath || latestHash && latestHash !== entry.skillFolderHash) updates.push({
|
|
21351
21429
|
name: skillName,
|
|
21352
21430
|
source,
|
|
21353
|
-
entry
|
|
21431
|
+
entry: {
|
|
21432
|
+
...entry,
|
|
21433
|
+
skillPath
|
|
21434
|
+
}
|
|
21354
21435
|
});
|
|
21355
21436
|
}
|
|
21356
21437
|
} catch (error) {
|
|
@@ -21528,6 +21609,7 @@ async function updateProjectSkills(options = {}) {
|
|
|
21528
21609
|
const allLockedForSource = Object.entries(localLock.skills).filter(([_, entry]) => (entry.sourceUrl || entry.source) === source && entry.ref === ref).map(([name, _]) => name);
|
|
21529
21610
|
let tempDir = null;
|
|
21530
21611
|
let deletedSkills = [];
|
|
21612
|
+
let resolvedPaths = null;
|
|
21531
21613
|
if (cloneSource === null) {
|
|
21532
21614
|
failCount += skillsForSource.length;
|
|
21533
21615
|
console.log(`${DIM$1}✗ Cannot update ${source}: skills-lock.json is missing sourceUrl for this generic Git source${RESET$1}`);
|
|
@@ -21535,27 +21617,43 @@ async function updateProjectSkills(options = {}) {
|
|
|
21535
21617
|
}
|
|
21536
21618
|
try {
|
|
21537
21619
|
tempDir = await cloneRepo(cloneSource, ref);
|
|
21538
|
-
const
|
|
21539
|
-
|
|
21540
|
-
|
|
21541
|
-
|
|
21620
|
+
const discoveredLocations = (await discoverSkills(tempDir, void 0, {
|
|
21621
|
+
fullDepth: true,
|
|
21622
|
+
includeDuplicateNames: true
|
|
21623
|
+
})).map((skill) => ({
|
|
21624
|
+
name: skill.name,
|
|
21625
|
+
skillPath: join$1(relative(tempDir, skill.path), "SKILL.md").split(sep$1).join("/")
|
|
21626
|
+
}));
|
|
21627
|
+
const resolution = await checkAndPromptForDeletions(source, allLockedForSource, localLock.skills, false, options, discoveredLocations);
|
|
21628
|
+
deletedSkills = resolution.deletedSkills;
|
|
21629
|
+
resolvedPaths = resolution.resolvedPaths;
|
|
21542
21630
|
} catch (error) {
|
|
21543
21631
|
console.log(`${DIM$1}✗ Failed to check for deleted skills from ${source}${RESET$1}`);
|
|
21544
21632
|
} finally {
|
|
21545
21633
|
if (tempDir) await cleanupTempDir(tempDir);
|
|
21546
21634
|
}
|
|
21635
|
+
if (resolvedPaths === null) {
|
|
21636
|
+
failCount += skillsForSource.length;
|
|
21637
|
+
continue;
|
|
21638
|
+
}
|
|
21547
21639
|
const remainingSkills = skillsForSource.filter((s) => !deletedSkills.includes(s.name));
|
|
21548
21640
|
for (const skill of remainingSkills) {
|
|
21549
21641
|
const safeName = sanitizeMetadata(skill.name);
|
|
21642
|
+
const resolvedPath = resolvedPaths?.get(skill.name);
|
|
21643
|
+
if (resolvedPaths && !resolvedPath) continue;
|
|
21644
|
+
const entry = resolvedPath ? {
|
|
21645
|
+
...skill.entry,
|
|
21646
|
+
skillPath: resolvedPath
|
|
21647
|
+
} : skill.entry;
|
|
21550
21648
|
console.log(`${TEXT$1}Updating ${safeName}…${RESET$1}`);
|
|
21551
|
-
const installUrl = buildLocalUpdateSource(
|
|
21649
|
+
const installUrl = buildLocalUpdateSource(entry);
|
|
21552
21650
|
if (!installUrl) {
|
|
21553
21651
|
failCount++;
|
|
21554
21652
|
console.log(` ${DIM$1}✗ Cannot update ${safeName}: skills-lock.json is missing sourceUrl for this generic Git source${RESET$1}`);
|
|
21555
21653
|
continue;
|
|
21556
21654
|
}
|
|
21557
21655
|
const subagentArgs = skill.entry.subagents?.length ? ["--subagent", ...skill.entry.subagents.map((s) => s === "" ? "root" : s)] : [];
|
|
21558
|
-
const fullDepthArgs = shouldUseFullDepthForUpdate(
|
|
21656
|
+
const fullDepthArgs = shouldUseFullDepthForUpdate(entry) ? ["--full-depth"] : [];
|
|
21559
21657
|
if (spawnSync(process.execPath, [
|
|
21560
21658
|
cliEntry,
|
|
21561
21659
|
"add",
|
|
@@ -21572,7 +21670,7 @@ async function updateProjectSkills(options = {}) {
|
|
|
21572
21670
|
"pipe"
|
|
21573
21671
|
],
|
|
21574
21672
|
encoding: "utf-8",
|
|
21575
|
-
env: getUpdateChildEnv(
|
|
21673
|
+
env: getUpdateChildEnv(entry.sourceType),
|
|
21576
21674
|
shell: false
|
|
21577
21675
|
}).status === 0) {
|
|
21578
21676
|
successCount++;
|
|
@@ -23658,7 +23756,7 @@ var init_cli = __esmMin((() => {
|
|
|
23658
23756
|
".zcode/skills/",
|
|
23659
23757
|
".zencoder/skills/"
|
|
23660
23758
|
];
|
|
23661
|
-
version$1 = "1.5.
|
|
23759
|
+
version$1 = "1.5.24";
|
|
23662
23760
|
isCancelled$1 = (value) => typeof value === "symbol";
|
|
23663
23761
|
EVE_AGENT_LABEL = "eve agent";
|
|
23664
23762
|
setVersion(version$1);
|
|
@@ -23735,7 +23833,7 @@ var init_cli = __esmMin((() => {
|
|
|
23735
23833
|
main().finally(() => flushTelemetry().then(() => process.exit(process.exitCode ?? 0)));
|
|
23736
23834
|
}));
|
|
23737
23835
|
//#endregion
|
|
23738
|
-
//#region ../../node_modules/.pnpm/skills@1.5.
|
|
23836
|
+
//#region ../../node_modules/.pnpm/skills@1.5.24/node_modules/skills/bin/cli.mjs
|
|
23739
23837
|
if (module.enableCompileCache && !process.env.NODE_DISABLE_COMPILE_CACHE) try {
|
|
23740
23838
|
module.enableCompileCache();
|
|
23741
23839
|
} catch {}
|