skilld 0.3.1 → 0.3.2
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.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { a as optimizeDocs, b as getAgentVersion, c as computeSkillDirName, d as yamlEscape, f as yamlParseKV, i as getModelName, n as getAvailableModels, o as generateSkillMd, p as yamlUnescape, r as getModelLabel, t as detectImportedPackages, v as detectInstalledAgents, x as targets, y as detectTargetAgent } from "./_chunks/detect-imports.mjs";
|
|
3
3
|
import { i as getCacheDir, o as getVersionKey, r as getPackageDbPath, t as CACHE_DIR } from "./_chunks/config.mjs";
|
|
4
4
|
import { a as getShippedSkills, b as sanitizeMarkdown, c as linkCachedDir, d as linkShippedSkill, g as resolvePkgDir, i as getPkgKeyFiles, l as linkPkg, m as readCachedDocs, n as clearCache, o as hasShippedDocs, p as listReferenceFiles, r as ensureCacheDir, s as isCached, u as linkPkgNamed, v as writeToCache } from "./_chunks/storage.mjs";
|
|
5
5
|
import "./cache/index.mjs";
|
|
@@ -2248,12 +2248,12 @@ function countDocs(packageName, version) {
|
|
|
2248
2248
|
walk(cacheDir);
|
|
2249
2249
|
return count;
|
|
2250
2250
|
}
|
|
2251
|
-
function countEmbeddings(packageName, version) {
|
|
2251
|
+
async function countEmbeddings(packageName, version) {
|
|
2252
2252
|
if (!version) return null;
|
|
2253
2253
|
const dbPath = getPackageDbPath(packageName, version);
|
|
2254
2254
|
if (!existsSync(dbPath)) return null;
|
|
2255
2255
|
try {
|
|
2256
|
-
const { DatabaseSync } =
|
|
2256
|
+
const { DatabaseSync } = await import("node:sqlite");
|
|
2257
2257
|
const db = new DatabaseSync(dbPath, {
|
|
2258
2258
|
open: true,
|
|
2259
2259
|
readOnly: true
|
|
@@ -2320,7 +2320,7 @@ function buildConfigLines() {
|
|
|
2320
2320
|
if (config.projects?.length) lines.push(`Projects ${config.projects.length} registered`);
|
|
2321
2321
|
return lines;
|
|
2322
2322
|
}
|
|
2323
|
-
function statusCommand(opts = {}) {
|
|
2323
|
+
async function statusCommand(opts = {}) {
|
|
2324
2324
|
const allSkills = [...iterateSkills({ scope: opts.global ? "global" : "all" })];
|
|
2325
2325
|
p.log.step(bold("Skilld Config"));
|
|
2326
2326
|
p.log.message(buildConfigLines().join("\n"));
|
|
@@ -2342,7 +2342,7 @@ function statusCommand(opts = {}) {
|
|
|
2342
2342
|
});
|
|
2343
2343
|
else map.get(key).agents.add(skill.agent);
|
|
2344
2344
|
}
|
|
2345
|
-
const buildPackageLines = (pkgs) => {
|
|
2345
|
+
const buildPackageLines = async (pkgs) => {
|
|
2346
2346
|
const lines = [];
|
|
2347
2347
|
for (const [, pkg] of pkgs) {
|
|
2348
2348
|
const { info } = pkg;
|
|
@@ -2357,7 +2357,7 @@ function statusCommand(opts = {}) {
|
|
|
2357
2357
|
const pkgName = info.packageName || pkg.name;
|
|
2358
2358
|
const docs = countDocs(pkgName, info.version) || countRefDocs(join(pkg.scope === "global" ? targets[pkg.agents.values().next().value].globalSkillsDir : join(process.cwd(), targets[pkg.agents.values().next().value].skillsDir), pkg.name));
|
|
2359
2359
|
if (docs > 0) meta.push(`${docs} docs`);
|
|
2360
|
-
const embeddings = countEmbeddings(pkgName, info.version);
|
|
2360
|
+
const embeddings = await countEmbeddings(pkgName, info.version);
|
|
2361
2361
|
if (embeddings !== null) meta.push(`${embeddings} chunks`);
|
|
2362
2362
|
const ago = timeAgo(info.syncedAt);
|
|
2363
2363
|
if (ago) meta.push(`synced ${ago}`);
|
|
@@ -2371,11 +2371,11 @@ function statusCommand(opts = {}) {
|
|
|
2371
2371
|
};
|
|
2372
2372
|
if (!opts.global && localPkgs.size > 0) {
|
|
2373
2373
|
p.log.step(`${bold("Local")} (project)`);
|
|
2374
|
-
p.log.message(buildPackageLines(localPkgs).join("\n"));
|
|
2374
|
+
p.log.message((await buildPackageLines(localPkgs)).join("\n"));
|
|
2375
2375
|
}
|
|
2376
2376
|
if (globalPkgs.size > 0) {
|
|
2377
2377
|
p.log.step(bold("Global"));
|
|
2378
|
-
p.log.message(buildPackageLines(globalPkgs).join("\n"));
|
|
2378
|
+
p.log.message((await buildPackageLines(globalPkgs)).join("\n"));
|
|
2379
2379
|
}
|
|
2380
2380
|
if (!opts.global && localPkgs.size === 0) {
|
|
2381
2381
|
p.log.step(`${bold("Local")} (project)`);
|