skilld 1.1.1 → 1.2.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/_chunks/agent.mjs +13 -1
- package/dist/_chunks/agent.mjs.map +1 -1
- package/dist/_chunks/assemble.mjs +2 -0
- package/dist/_chunks/assemble.mjs.map +1 -1
- package/dist/_chunks/cache.mjs +2 -0
- package/dist/_chunks/cache.mjs.map +1 -1
- package/dist/_chunks/cache2.mjs +3 -1
- package/dist/_chunks/cache2.mjs.map +1 -1
- package/dist/_chunks/chunk.mjs +2 -0
- package/dist/_chunks/config.mjs +4 -0
- package/dist/_chunks/config.mjs.map +1 -1
- package/dist/_chunks/detect.mjs +30 -0
- package/dist/_chunks/detect.mjs.map +1 -1
- package/dist/_chunks/embedding-cache.mjs +6 -6
- package/dist/_chunks/embedding-cache.mjs.map +1 -1
- package/dist/_chunks/formatting.mjs +9 -1
- package/dist/_chunks/formatting.mjs.map +1 -1
- package/dist/_chunks/index2.d.mts +11 -2
- package/dist/_chunks/index2.d.mts.map +1 -1
- package/dist/_chunks/install.mjs +5 -3
- package/dist/_chunks/install.mjs.map +1 -1
- package/dist/_chunks/list.mjs +2 -0
- package/dist/_chunks/list.mjs.map +1 -1
- package/dist/_chunks/markdown.mjs +2 -0
- package/dist/_chunks/markdown.mjs.map +1 -1
- package/dist/_chunks/pool.mjs +2 -0
- package/dist/_chunks/pool.mjs.map +1 -1
- package/dist/_chunks/prompts.mjs +16 -0
- package/dist/_chunks/prompts.mjs.map +1 -1
- package/dist/_chunks/sanitize.mjs +3 -1
- package/dist/_chunks/sanitize.mjs.map +1 -1
- package/dist/_chunks/search-interactive.mjs +3 -1
- package/dist/_chunks/search-interactive.mjs.map +1 -1
- package/dist/_chunks/search.mjs +183 -8
- package/dist/_chunks/search.mjs.map +1 -0
- package/dist/_chunks/shared.mjs +4 -0
- package/dist/_chunks/shared.mjs.map +1 -1
- package/dist/_chunks/skills.mjs +4 -0
- package/dist/_chunks/skills.mjs.map +1 -1
- package/dist/_chunks/sources.mjs +976 -806
- package/dist/_chunks/sources.mjs.map +1 -1
- package/dist/_chunks/sync.mjs +25 -14
- package/dist/_chunks/sync.mjs.map +1 -1
- package/dist/_chunks/uninstall.mjs +3 -1
- package/dist/_chunks/uninstall.mjs.map +1 -1
- package/dist/_chunks/validate.mjs +2 -0
- package/dist/_chunks/validate.mjs.map +1 -1
- package/dist/_chunks/yaml.mjs +2 -0
- package/dist/_chunks/yaml.mjs.map +1 -1
- package/dist/agent/index.d.mts.map +1 -1
- package/dist/cli.mjs +19 -9
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/retriv/index.mjs +5 -3
- package/dist/retriv/index.mjs.map +1 -1
- package/dist/retriv/worker.mjs +2 -0
- package/dist/retriv/worker.mjs.map +1 -1
- package/dist/sources/index.d.mts +2 -2
- package/dist/sources/index.mjs +2 -2
- package/dist/types.d.mts +1 -2
- package/package.json +10 -10
- package/dist/_chunks/search2.mjs +0 -180
- package/dist/_chunks/search2.mjs.map +0 -1
- package/dist/_chunks/sync2.mjs +0 -15
package/dist/_chunks/sync.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { a as getRepoCacheDir, c as getVersionKey, i as getPackageDbPath, o as getCacheDir, t as CACHE_DIR } from "./config.mjs";
|
|
2
2
|
import { n as sanitizeMarkdown } from "./sanitize.mjs";
|
|
3
3
|
import { _ as resolvePkgDir, a as getShippedSkills, b as writeToRepoCache, c as linkCachedDir, d as linkRepoCachedDir, f as linkShippedSkill, h as readCachedDocs, i as getPkgKeyFiles, l as linkPkg, m as listReferenceFiles, n as clearCache, o as hasShippedDocs, r as ensureCacheDir, s as isCached, u as linkPkgNamed, y as writeToCache } from "./cache.mjs";
|
|
4
|
+
import "./yaml.mjs";
|
|
4
5
|
import { i as parseFrontmatter } from "./markdown.mjs";
|
|
5
6
|
import { SearchDepsUnavailableError, createIndex } from "../retriv/index.mjs";
|
|
6
7
|
import { d as getPrereleaseChangelogRef, n as getSharedSkillsDir, o as getBlogPreset, t as SHARED_SKILLS_DIR } from "./shared.mjs";
|
|
7
|
-
import {
|
|
8
|
+
import { A as parseGitSkillInput, B as isGhAvailable, C as downloadLlmsDocs, D as normalizeLlmsLinks, F as formatDiscussionAsMarkdown, G as fetchReleaseNotes, H as toCrawlPattern, I as generateDiscussionIndex, K as generateReleaseIndex, L as fetchGitHubIssues, M as resolveEntryFiles, N as generateDocsIndex, P as fetchGitHubDiscussions, R as formatIssueAsMarkdown, T as fetchLlmsTxt, U as fetchBlogReleases, V as fetchCrawledDocs, Z as fetchGitHubRaw, b as isShallowGitDocs, f as resolvePackageDocsWithAttempts, h as fetchGitDocs, i as fetchPkgDist, k as fetchGitSkills, n as fetchNpmPackage, nt as parsePackageSpec, p as searchNpmPackages, q as isPrerelease, s as readLocalDependencies, tt as parseGitHubUrl, u as resolveLocalPackageDocs, v as fetchReadmeContent, x as resolveGitHubRepo, y as filterFrameworkDocs, z as generateIssueIndex } from "./sources.mjs";
|
|
8
9
|
import { a as targets } from "./detect.mjs";
|
|
9
10
|
import { a as sanitizeName, c as SECTION_OUTPUT_FILES, g as maxLines, h as maxItems, i as linkSkillToAgents, l as buildAllSectionPrompts, n as computeSkillDirName, p as portabilizePrompt, t as generateSkillMd } from "./prompts.mjs";
|
|
10
11
|
import { a as getModelLabel, i as getAvailableModels, o as getModelName, r as createToolProgress, s as optimizeDocs, t as detectImportedPackages } from "./agent.mjs";
|
|
@@ -19,6 +20,7 @@ import pLimit from "p-limit";
|
|
|
19
20
|
import * as p from "@clack/prompts";
|
|
20
21
|
import { defineCommand } from "citty";
|
|
21
22
|
import logUpdate from "log-update";
|
|
23
|
+
//#region src/commands/sync-shared.ts
|
|
22
24
|
/** Max docs sent to the embedding pipeline to prevent oversized indexes */
|
|
23
25
|
const MAX_INDEX_DOCS = 250;
|
|
24
26
|
const RESOLVE_STEP_LABELS = {
|
|
@@ -195,7 +197,7 @@ async function fetchAndCacheResources(opts) {
|
|
|
195
197
|
const batch = gitDocs.files.slice(i, i + BATCH_SIZE);
|
|
196
198
|
onProgress(`Downloading docs ${Math.min(i + BATCH_SIZE, gitDocs.files.length)}/${gitDocs.files.length} from ${gitDocs.ref}`);
|
|
197
199
|
const batchResults = await Promise.all(batch.map(async (file) => {
|
|
198
|
-
const content = await
|
|
200
|
+
const content = await fetchGitHubRaw(`${gitDocs.baseUrl}/${file}`);
|
|
199
201
|
if (!content) return null;
|
|
200
202
|
return {
|
|
201
203
|
file,
|
|
@@ -674,7 +676,7 @@ async function ensureAgentInstructions(agent, cwd, isGlobal) {
|
|
|
674
676
|
if (!agentConfig.instructionFile) return;
|
|
675
677
|
const filePath = join(cwd, agentConfig.instructionFile);
|
|
676
678
|
if (existsSync(filePath)) {
|
|
677
|
-
if (readFileSync(filePath, "utf-8").includes(
|
|
679
|
+
if (readFileSync(filePath, "utf-8").includes("<!-- skilld -->")) return;
|
|
678
680
|
}
|
|
679
681
|
if (!isInteractive()) {
|
|
680
682
|
if (existsSync(filePath)) appendFileSync(filePath, `${readFileSync(filePath, "utf-8").endsWith("\n") ? "" : "\n"}\n${SKILLD_INSTRUCTIONS}\n`);
|
|
@@ -957,6 +959,8 @@ function writePromptFiles(opts) {
|
|
|
957
959
|
}
|
|
958
960
|
return written;
|
|
959
961
|
}
|
|
962
|
+
//#endregion
|
|
963
|
+
//#region src/telemetry.ts
|
|
960
964
|
/**
|
|
961
965
|
* Anonymous telemetry — fire-and-forget GET to add-skill.vercel.sh/t
|
|
962
966
|
*
|
|
@@ -978,6 +982,8 @@ function track(data) {
|
|
|
978
982
|
fetch(`${TELEMETRY_URL}?${params.toString()}`).catch(() => {});
|
|
979
983
|
} catch {}
|
|
980
984
|
}
|
|
985
|
+
//#endregion
|
|
986
|
+
//#region src/commands/sync-git.ts
|
|
981
987
|
async function syncGitSkills(opts) {
|
|
982
988
|
const { source, agent, global: isGlobal, yes } = opts;
|
|
983
989
|
const cwd = process.cwd();
|
|
@@ -1206,6 +1212,8 @@ async function syncGitHubRepo(opts) {
|
|
|
1206
1212
|
});
|
|
1207
1213
|
p.outro(`Synced ${owner}/${repo} to ${relative(cwd, skillDir)}`);
|
|
1208
1214
|
}
|
|
1215
|
+
//#endregion
|
|
1216
|
+
//#region src/commands/sync-parallel.ts
|
|
1209
1217
|
const STATUS_ICONS = {
|
|
1210
1218
|
pending: "○",
|
|
1211
1219
|
resolving: "◐",
|
|
@@ -1240,7 +1248,7 @@ async function syncPackagesParallel(config) {
|
|
|
1240
1248
|
});
|
|
1241
1249
|
function render() {
|
|
1242
1250
|
const maxNameLen = Math.max(...packages.map((p) => p.length), 20);
|
|
1243
|
-
const lines =
|
|
1251
|
+
const lines = Array.from(states.values(), (s) => {
|
|
1244
1252
|
const icon = STATUS_ICONS[s.status];
|
|
1245
1253
|
const color = STATUS_COLORS[s.status];
|
|
1246
1254
|
const reset = "\x1B[0m";
|
|
@@ -1523,6 +1531,8 @@ async function enhanceWithLLM(packageName, data, config, cwd, update, sections,
|
|
|
1523
1531
|
}
|
|
1524
1532
|
update(packageName, "done", "Skill optimized", versionKey);
|
|
1525
1533
|
}
|
|
1534
|
+
//#endregion
|
|
1535
|
+
//#region src/commands/sync.ts
|
|
1526
1536
|
function showResolveAttempts(attempts) {
|
|
1527
1537
|
if (attempts.length === 0) return;
|
|
1528
1538
|
p.log.message("\x1B[90mResolution attempts:\x1B[0m");
|
|
@@ -1576,7 +1586,7 @@ async function interactivePicker(state) {
|
|
|
1576
1586
|
p.log.warn("No dependencies found");
|
|
1577
1587
|
return null;
|
|
1578
1588
|
}
|
|
1579
|
-
return pickFromList(
|
|
1589
|
+
return pickFromList(Array.from(declaredMap.entries(), ([name, version]) => ({
|
|
1580
1590
|
name,
|
|
1581
1591
|
version: maskPatch(version),
|
|
1582
1592
|
count: 0,
|
|
@@ -1946,29 +1956,29 @@ const ejectCommandDef = defineCommand({
|
|
|
1946
1956
|
description: "Eject skill with references as real files (portable, no symlinks)"
|
|
1947
1957
|
},
|
|
1948
1958
|
args: {
|
|
1949
|
-
|
|
1959
|
+
package: {
|
|
1950
1960
|
type: "positional",
|
|
1951
1961
|
description: "Package to eject",
|
|
1952
1962
|
required: true
|
|
1953
1963
|
},
|
|
1954
|
-
|
|
1964
|
+
name: {
|
|
1955
1965
|
type: "string",
|
|
1956
1966
|
alias: "n",
|
|
1957
1967
|
description: "Custom skill directory name (default: derived from package)"
|
|
1958
1968
|
},
|
|
1959
|
-
|
|
1969
|
+
out: {
|
|
1960
1970
|
type: "string",
|
|
1961
1971
|
alias: "o",
|
|
1962
1972
|
description: "Output directory path override"
|
|
1963
1973
|
},
|
|
1964
|
-
|
|
1974
|
+
from: {
|
|
1965
1975
|
type: "string",
|
|
1966
1976
|
description: "Collect releases/issues/discussions from this date onward (YYYY-MM-DD)"
|
|
1967
1977
|
},
|
|
1968
|
-
|
|
1978
|
+
search: {
|
|
1969
1979
|
type: "boolean",
|
|
1970
|
-
description: "
|
|
1971
|
-
default:
|
|
1980
|
+
description: "Build search index / embeddings (use --no-search to skip)",
|
|
1981
|
+
default: true
|
|
1972
1982
|
},
|
|
1973
1983
|
...sharedArgs
|
|
1974
1984
|
},
|
|
@@ -1990,7 +2000,7 @@ const ejectCommandDef = defineCommand({
|
|
|
1990
2000
|
eject: args.out || true,
|
|
1991
2001
|
name: args.name,
|
|
1992
2002
|
from: args.from,
|
|
1993
|
-
noSearch: args
|
|
2003
|
+
noSearch: !args.search
|
|
1994
2004
|
});
|
|
1995
2005
|
}
|
|
1996
2006
|
});
|
|
@@ -2210,6 +2220,7 @@ async function exportPortablePrompts(packageSpec, opts) {
|
|
|
2210
2220
|
const outputFileList = sectionList.map((s) => SECTION_OUTPUT_FILES[s]).join(", ");
|
|
2211
2221
|
p.log.info(`Have your agent enhance the skill. Give it this prompt:\n\x1B[2m\x1B[3m Read each prompt file (${promptFiles}) in ${relDir}/, read the\n referenced files, then write your output to the matching file (${outputFileList}).\n When done, run: skilld assemble\x1B[0m`);
|
|
2212
2222
|
}
|
|
2213
|
-
|
|
2223
|
+
//#endregion
|
|
2224
|
+
export { selectLlmConfig as a, addCommandDef, ejectCommandDef, indexResources as i, SKILLD_MARKER_START as n, writePromptFiles as o, classifyCachedDoc as r, syncCommand, SKILLD_MARKER_END as t, updateCommandDef };
|
|
2214
2225
|
|
|
2215
2226
|
//# sourceMappingURL=sync.mjs.map
|