skills-package-manager 0.6.3 → 0.7.0
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/291.js +19 -0
- package/dist/612.js +48 -0
- package/dist/index.js +38 -31
- package/dist/npm-cac.js +548 -0
- package/dist/npm-clack_core.js +735 -0
- package/dist/npm-clack_prompts.js +1342 -0
- package/dist/npm-picocolors.js +69 -0
- package/dist/npm-semver.js +1326 -0
- package/dist/npm-sisteransi.js +57 -0
- package/dist/npm-tar.js +3186 -0
- package/dist/npm-yaml.js +6345 -0
- package/dist/npm-zod.js +6225 -0
- package/package.json +3 -5
package/dist/291.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as __rspack_external_zlib from "zlib";
|
|
2
|
+
import * as __rspack_external_node_readline_91c31510 from "node:readline";
|
|
3
|
+
export { stripVTControlCharacters, styleText } from "node:util";
|
|
4
|
+
export { default as node_process, stdin, stdout } from "node:process";
|
|
5
|
+
export { ReadStream } from "node:tty";
|
|
6
|
+
export { default as node_fs, existsSync, lstatSync, readdirSync } from "node:fs";
|
|
7
|
+
export { basename, default as node_path, dirname, join, posix, win32 } from "node:path";
|
|
8
|
+
export { EventEmitter, default as events } from "events";
|
|
9
|
+
export { default as fs } from "fs";
|
|
10
|
+
export { EventEmitter as external_node_events_EventEmitter } from "node:events";
|
|
11
|
+
export { default as node_stream } from "node:stream";
|
|
12
|
+
export { StringDecoder } from "node:string_decoder";
|
|
13
|
+
export { default as path, dirname as external_path_dirname, parse } from "path";
|
|
14
|
+
export { default as assert } from "assert";
|
|
15
|
+
export { Buffer } from "buffer";
|
|
16
|
+
export { default as node_assert } from "node:assert";
|
|
17
|
+
export { randomBytes } from "node:crypto";
|
|
18
|
+
export { default as promises } from "node:fs/promises";
|
|
19
|
+
export { __rspack_external_node_readline_91c31510, __rspack_external_zlib };
|
package/dist/612.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __webpack_modules__ = {};
|
|
2
|
+
var __webpack_module_cache__ = {};
|
|
3
|
+
function __webpack_require__(moduleId) {
|
|
4
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
+
exports: {}
|
|
8
|
+
};
|
|
9
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
10
|
+
return module.exports;
|
|
11
|
+
}
|
|
12
|
+
__webpack_require__.m = __webpack_modules__;
|
|
13
|
+
(()=>{
|
|
14
|
+
__webpack_require__.n = (module)=>{
|
|
15
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
16
|
+
__webpack_require__.d(getter, {
|
|
17
|
+
a: getter
|
|
18
|
+
});
|
|
19
|
+
return getter;
|
|
20
|
+
};
|
|
21
|
+
})();
|
|
22
|
+
(()=>{
|
|
23
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
24
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: definition[key]
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
})();
|
|
30
|
+
(()=>{
|
|
31
|
+
__webpack_require__.add = function(modules) {
|
|
32
|
+
Object.assign(__webpack_require__.m, modules);
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
(()=>{
|
|
36
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
37
|
+
})();
|
|
38
|
+
(()=>{
|
|
39
|
+
__webpack_require__.r = (exports)=>{
|
|
40
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
41
|
+
value: 'Module'
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(exports, '__esModule', {
|
|
44
|
+
value: true
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
})();
|
|
48
|
+
export { __webpack_require__ };
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __webpack_require__ } from "./612.js";
|
|
2
2
|
import { accessSync, createReadStream, existsSync } from "node:fs";
|
|
3
3
|
import node_path, { basename, join } from "node:path";
|
|
4
|
-
import picocolors from "picocolors";
|
|
5
4
|
import { homedir, tmpdir } from "node:os";
|
|
6
5
|
import { access, cp, lstat, mkdir, mkdtemp, readFile, readdir, readlink, rm, stat as promises_stat, symlink, writeFile } from "node:fs/promises";
|
|
7
|
-
import yaml from "yaml";
|
|
8
|
-
import { z } from "zod";
|
|
9
6
|
import { execFile } from "node:child_process";
|
|
10
7
|
import { promisify } from "node:util";
|
|
11
8
|
import { createHash } from "node:crypto";
|
|
12
|
-
import semver from "semver";
|
|
13
9
|
import { fileURLToPath } from "node:url";
|
|
14
|
-
import
|
|
15
|
-
import
|
|
10
|
+
import "./npm-yaml.js";
|
|
11
|
+
import "./npm-semver.js";
|
|
12
|
+
import "./npm-picocolors.js";
|
|
13
|
+
import { dist_namespaceObject, Lt, Wt, Nt, be, R, Gt } from "./npm-clack_prompts.js";
|
|
14
|
+
import { schemas_string, schemas_boolean, record, schemas_object, schemas_array } from "./npm-zod.js";
|
|
15
|
+
import { co } from "./npm-tar.js";
|
|
16
|
+
import { cac } from "./npm-cac.js";
|
|
17
|
+
import { Ct } from "./npm-clack_core.js";
|
|
16
18
|
var package_namespaceObject = {
|
|
17
|
-
rE: "0.
|
|
19
|
+
rE: "0.7.0"
|
|
18
20
|
};
|
|
19
21
|
function getHomeDir() {
|
|
20
22
|
return homedir();
|
|
@@ -357,18 +359,18 @@ async function promptSkillSelection(skills) {
|
|
|
357
359
|
label: skill.name,
|
|
358
360
|
hint: skill.description ? skill.description.length > 60 ? `${skill.description.slice(0, 57)}...` : skill.description : void 0
|
|
359
361
|
}));
|
|
360
|
-
const selected = await
|
|
362
|
+
const selected = await Lt({
|
|
361
363
|
message: 'Select skills to install',
|
|
362
364
|
options,
|
|
363
365
|
required: true
|
|
364
366
|
});
|
|
365
|
-
if (
|
|
366
|
-
|
|
367
|
+
if (Ct(selected)) {
|
|
368
|
+
Nt('Installation cancelled');
|
|
367
369
|
process.exit(0);
|
|
368
370
|
}
|
|
369
371
|
return selected;
|
|
370
372
|
}
|
|
371
|
-
async function promptInitManifestOptions(promptApi =
|
|
373
|
+
async function promptInitManifestOptions(promptApi = dist_namespaceObject, exit = process.exit) {
|
|
372
374
|
const installDirInput = await promptApi.text({
|
|
373
375
|
message: 'Where should skills be installed?',
|
|
374
376
|
initialValue: '.agents/skills'
|
|
@@ -689,12 +691,13 @@ function getExitCode(error) {
|
|
|
689
691
|
}
|
|
690
692
|
return 1;
|
|
691
693
|
}
|
|
694
|
+
const dist = __webpack_require__("../../node_modules/.pnpm/yaml@2.8.3/node_modules/yaml/dist/index.js");
|
|
692
695
|
async function readSkillsLock(rootDir) {
|
|
693
696
|
const filePath = node_path.join(rootDir, 'skills-lock.yaml');
|
|
694
697
|
try {
|
|
695
698
|
const raw = await readFile(filePath, 'utf8');
|
|
696
699
|
try {
|
|
697
|
-
return
|
|
700
|
+
return dist.parse(raw);
|
|
698
701
|
} catch (parseError) {
|
|
699
702
|
throw new ParseError({
|
|
700
703
|
code: codes_ErrorCode.YAML_PARSE_ERROR,
|
|
@@ -713,12 +716,12 @@ async function readSkillsLock(rootDir) {
|
|
|
713
716
|
});
|
|
714
717
|
}
|
|
715
718
|
}
|
|
716
|
-
const skillsManifestSchema =
|
|
717
|
-
$schema:
|
|
718
|
-
installDir:
|
|
719
|
-
linkTargets:
|
|
720
|
-
selfSkill:
|
|
721
|
-
skills:
|
|
719
|
+
const skillsManifestSchema = schemas_object({
|
|
720
|
+
$schema: schemas_string().optional().describe('JSON Schema URL for editor autocompletion'),
|
|
721
|
+
installDir: schemas_string().default('.agents/skills').describe('Directory where skills will be installed'),
|
|
722
|
+
linkTargets: schemas_array(schemas_string()).default([]).describe('Directories where skill symlinks will be created'),
|
|
723
|
+
selfSkill: schemas_boolean().optional().describe('Whether this project is itself a skill'),
|
|
724
|
+
skills: record(schemas_string(), schemas_string()).default({}).describe('Map of skill names to their specifiers')
|
|
722
725
|
}).strict();
|
|
723
726
|
async function readSkillsManifest(rootDir) {
|
|
724
727
|
const filePath = node_path.join(rootDir, 'skills.json');
|
|
@@ -758,6 +761,8 @@ async function readSkillsManifest(rootDir) {
|
|
|
758
761
|
});
|
|
759
762
|
}
|
|
760
763
|
}
|
|
764
|
+
const node_modules_semver = __webpack_require__("../../node_modules/.pnpm/semver@7.7.4/node_modules/semver/index.js");
|
|
765
|
+
var node_modules_semver_default = /*#__PURE__*/ __webpack_require__.n(node_modules_semver);
|
|
761
766
|
const resolvedNpmPackageCache = new Map();
|
|
762
767
|
function normalizeRegistryUrl(url) {
|
|
763
768
|
return url.endsWith('/') ? url : `${url}/`;
|
|
@@ -879,8 +884,8 @@ function resolveVersionFromMetadata(metadata, requestedVersion) {
|
|
|
879
884
|
const requested = requestedVersion ?? 'latest';
|
|
880
885
|
const taggedVersion = metadata['dist-tags']?.[requested];
|
|
881
886
|
if (taggedVersion && versions[taggedVersion]) return taggedVersion;
|
|
882
|
-
if (
|
|
883
|
-
const matched =
|
|
887
|
+
if (node_modules_semver_default().valid(requested) && versions[requested]) return requested;
|
|
888
|
+
const matched = node_modules_semver_default().maxSatisfying(versionKeys, requested);
|
|
884
889
|
if (matched) return matched;
|
|
885
890
|
throw new Error(`Unable to resolve npm version "${requested}"`);
|
|
886
891
|
}
|
|
@@ -1265,7 +1270,7 @@ async function syncSkillsLock(cwd, manifest, _existingLock, options) {
|
|
|
1265
1270
|
async function writeSkillsLock(rootDir, lockfile) {
|
|
1266
1271
|
const filePath = node_path.join(rootDir, 'skills-lock.yaml');
|
|
1267
1272
|
try {
|
|
1268
|
-
await writeFile(filePath,
|
|
1273
|
+
await writeFile(filePath, dist.stringify(lockfile), 'utf8');
|
|
1269
1274
|
} catch (error) {
|
|
1270
1275
|
throw convertNodeError(error, {
|
|
1271
1276
|
operation: 'write',
|
|
@@ -1707,7 +1712,7 @@ async function materializePackedSkill(rootDir, skillName, tarballPath, sourcePat
|
|
|
1707
1712
|
await mkdir(node_path.join(extractRoot, 'package'), {
|
|
1708
1713
|
recursive: true
|
|
1709
1714
|
});
|
|
1710
|
-
await
|
|
1715
|
+
await co({
|
|
1711
1716
|
file: tarballPath,
|
|
1712
1717
|
cwd: node_path.join(extractRoot, 'package'),
|
|
1713
1718
|
strip: 1,
|
|
@@ -1905,6 +1910,8 @@ async function installSkills(rootDir, options) {
|
|
|
1905
1910
|
installed: Object.keys(runtimeLock.skills)
|
|
1906
1911
|
};
|
|
1907
1912
|
}
|
|
1913
|
+
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
1914
|
+
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
1908
1915
|
function buildGitSpecifier(repoUrl, skillPath, ref) {
|
|
1909
1916
|
return ref ? `${repoUrl}#${ref}&path:${skillPath}` : `${repoUrl}#path:${skillPath}`;
|
|
1910
1917
|
}
|
|
@@ -2269,21 +2276,21 @@ async function addCommand(options) {
|
|
|
2269
2276
|
const { specifier, skill } = normalizedInput;
|
|
2270
2277
|
const parsedSource = parseAddSourceSpecifier(specifier);
|
|
2271
2278
|
if (parsedSource) {
|
|
2272
|
-
|
|
2273
|
-
const spinner =
|
|
2279
|
+
Wt(picocolors_default().bgCyan(picocolors_default().black(' spm ')));
|
|
2280
|
+
const spinner = be();
|
|
2274
2281
|
const sourceLabel = parsedSource.displaySource;
|
|
2275
2282
|
if ('repo' === parsedSource.type) spinner.start(`Cloning ${sourceLabel}...`);
|
|
2276
2283
|
else spinner.start(`Scanning ${sourceLabel}...`);
|
|
2277
2284
|
const discoveredSkills = await discoverSkillsFromSource(parsedSource);
|
|
2278
2285
|
if (0 === discoveredSkills.length) {
|
|
2279
|
-
spinner.stop(
|
|
2286
|
+
spinner.stop(picocolors_default().red('No skills found'));
|
|
2280
2287
|
throw new SkillError({
|
|
2281
2288
|
code: codes_ErrorCode.SKILL_NOT_FOUND,
|
|
2282
2289
|
skillName: skill ?? sourceLabel,
|
|
2283
2290
|
message: `No valid skills found in ${sourceLabel}`
|
|
2284
2291
|
});
|
|
2285
2292
|
}
|
|
2286
|
-
spinner.stop(`Found ${
|
|
2293
|
+
spinner.stop(`Found ${picocolors_default().green(String(discoveredSkills.length))} skill${1 !== discoveredSkills.length ? 's' : ''}`);
|
|
2287
2294
|
let selectedSkills;
|
|
2288
2295
|
if ('*' === skill) selectedSkills = discoveredSkills;
|
|
2289
2296
|
else if (skill) {
|
|
@@ -2302,20 +2309,20 @@ async function addCommand(options) {
|
|
|
2302
2309
|
const nextSpecifier = 'repo' === parsedSource.type ? buildGitSpecifier(parsedSource.cloneUrl, selectedSkill.path, parsedSource.ref) : buildLinkSpecifier(parsedSource.localPath, selectedSkill.path);
|
|
2303
2310
|
const result = await addSingleSkill(cwd, nextSpecifier, manifestContext);
|
|
2304
2311
|
results.push(result);
|
|
2305
|
-
if (selectedSkills.length > 1)
|
|
2312
|
+
if (selectedSkills.length > 1) R.success(`Added ${picocolors_default().cyan(result.skillName)}`);
|
|
2306
2313
|
}
|
|
2307
2314
|
spinner.start('Installing skills...');
|
|
2308
2315
|
await installSkills(cwd);
|
|
2309
2316
|
spinner.stop('Installed skills');
|
|
2310
2317
|
if (1 === results.length) {
|
|
2311
|
-
|
|
2318
|
+
Gt(`Added ${picocolors_default().cyan(results[0].skillName)}`);
|
|
2312
2319
|
return results[0];
|
|
2313
2320
|
}
|
|
2314
|
-
|
|
2321
|
+
Gt('Done');
|
|
2315
2322
|
return results;
|
|
2316
2323
|
}
|
|
2317
2324
|
const result = await addSingleSkill(cwd, specifier, manifestContext);
|
|
2318
|
-
const spinner =
|
|
2325
|
+
const spinner = be();
|
|
2319
2326
|
spinner.start('Installing skills...');
|
|
2320
2327
|
await installSkills(cwd);
|
|
2321
2328
|
spinner.stop('Installed skills');
|