skilld 1.7.2 → 1.7.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/_chunks/agent.mjs +693 -599
- package/dist/_chunks/agent.mjs.map +1 -1
- package/dist/_chunks/assemble.mjs +3 -3
- package/dist/_chunks/assemble.mjs.map +1 -1
- package/dist/_chunks/author-group.mjs.map +1 -1
- package/dist/_chunks/author.mjs +51 -121
- package/dist/_chunks/author.mjs.map +1 -1
- package/dist/_chunks/cache.mjs +315 -9
- package/dist/_chunks/cache.mjs.map +1 -1
- package/dist/_chunks/cache2.mjs +2 -2
- package/dist/_chunks/cache2.mjs.map +1 -1
- package/dist/_chunks/cli-helpers.mjs +3 -3
- package/dist/_chunks/cli-helpers.mjs.map +1 -1
- package/dist/_chunks/core.mjs +7 -4
- package/dist/_chunks/detect.mjs +1 -1
- package/dist/_chunks/detect.mjs.map +1 -1
- package/dist/_chunks/embedding-cache2.mjs +2 -2
- package/dist/_chunks/embedding-cache2.mjs.map +1 -1
- package/dist/_chunks/index.d.mts +305 -112
- package/dist/_chunks/index.d.mts.map +1 -1
- package/dist/_chunks/index2.d.mts +267 -32
- package/dist/_chunks/index2.d.mts.map +1 -1
- package/dist/_chunks/index3.d.mts +32 -577
- package/dist/_chunks/index3.d.mts.map +1 -1
- package/dist/_chunks/index4.d.mts +553 -0
- package/dist/_chunks/index4.d.mts.map +1 -0
- package/dist/_chunks/install.mjs +48 -88
- package/dist/_chunks/install.mjs.map +1 -1
- package/dist/_chunks/list.mjs +1 -1
- package/dist/_chunks/list.mjs.map +1 -1
- package/dist/_chunks/lockfile.mjs +29 -6
- package/dist/_chunks/lockfile.mjs.map +1 -1
- package/dist/_chunks/markdown.mjs.map +1 -1
- package/dist/_chunks/monorepo.mjs +71 -0
- package/dist/_chunks/monorepo.mjs.map +1 -0
- package/dist/_chunks/package-json.mjs.map +1 -1
- package/dist/_chunks/{shared.mjs → package-registry.mjs} +2 -40
- package/dist/_chunks/package-registry.mjs.map +1 -0
- package/dist/_chunks/paths.mjs +49 -0
- package/dist/_chunks/paths.mjs.map +1 -0
- package/dist/_chunks/pool2.mjs +7 -2
- package/dist/_chunks/pool2.mjs.map +1 -1
- package/dist/_chunks/prepare.mjs +1 -1
- package/dist/_chunks/prepare.mjs.map +1 -1
- package/dist/_chunks/prepare2.mjs +5 -5
- package/dist/_chunks/prepare2.mjs.map +1 -1
- package/dist/_chunks/prompts.mjs +366 -18
- package/dist/_chunks/prompts.mjs.map +1 -1
- package/dist/_chunks/retriv.mjs.map +1 -1
- package/dist/_chunks/sanitize.mjs.map +1 -1
- package/dist/_chunks/search-helpers.mjs +5 -6
- package/dist/_chunks/search-helpers.mjs.map +1 -1
- package/dist/_chunks/search-interactive.mjs +1 -1
- package/dist/_chunks/search-interactive.mjs.map +1 -1
- package/dist/_chunks/search.mjs +1 -2
- package/dist/_chunks/search.mjs.map +1 -1
- package/dist/_chunks/semver.mjs +13 -0
- package/dist/_chunks/semver.mjs.map +1 -0
- package/dist/_chunks/setup.mjs.map +1 -1
- package/dist/_chunks/skill-installer.mjs +2 -0
- package/dist/_chunks/skill-installer2.mjs +155 -0
- package/dist/_chunks/skill-installer2.mjs.map +1 -0
- package/dist/_chunks/skills.mjs +10 -9
- package/dist/_chunks/skills.mjs.map +1 -1
- package/dist/_chunks/sources.mjs +575 -386
- package/dist/_chunks/sources.mjs.map +1 -1
- package/dist/_chunks/sync-pipeline.mjs +952 -0
- package/dist/_chunks/sync-pipeline.mjs.map +1 -0
- package/dist/_chunks/sync-registry.mjs +19 -13
- package/dist/_chunks/sync-registry.mjs.map +1 -1
- package/dist/_chunks/sync.mjs +797 -886
- package/dist/_chunks/sync.mjs.map +1 -1
- package/dist/_chunks/sync2.mjs +4 -2
- package/dist/_chunks/types.d.mts +65 -77
- package/dist/_chunks/types.d.mts.map +1 -1
- package/dist/_chunks/types2.d.mts +88 -0
- package/dist/_chunks/types2.d.mts.map +1 -0
- package/dist/_chunks/uninstall.mjs +7 -8
- package/dist/_chunks/uninstall.mjs.map +1 -1
- package/dist/_chunks/upload.mjs +2 -2
- package/dist/_chunks/upload.mjs.map +1 -1
- package/dist/_chunks/validate.mjs +1 -1
- package/dist/_chunks/validate.mjs.map +1 -1
- package/dist/_chunks/version.mjs +3 -13
- package/dist/_chunks/version.mjs.map +1 -1
- package/dist/_chunks/wizard.mjs +2 -2
- package/dist/_chunks/wizard.mjs.map +1 -1
- package/dist/_chunks/yaml.mjs.map +1 -1
- package/dist/agent/index.d.mts +2 -346
- package/dist/agent/index.mjs +2 -3
- package/dist/cache/index.d.mts +2 -2
- package/dist/cache/index.mjs +4 -3
- package/dist/cli.mjs +12 -13
- package/dist/cli.mjs.map +1 -1
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +4 -3
- package/dist/prepare.mjs +2 -2
- package/dist/prepare.mjs.map +1 -1
- package/dist/retriv/index.d.mts +2 -2
- package/dist/retriv/worker.d.mts +2 -1
- package/dist/retriv/worker.d.mts.map +1 -1
- package/dist/retriv/worker.mjs +2 -1
- package/dist/retriv/worker.mjs.map +1 -1
- package/dist/sources/index.d.mts +3 -2
- package/dist/sources/index.mjs +3 -3
- package/dist/types.d.mts +3 -3
- package/package.json +5 -5
- package/dist/_chunks/config.mjs +0 -122
- package/dist/_chunks/config.mjs.map +0 -1
- package/dist/_chunks/prefix.mjs +0 -108
- package/dist/_chunks/prefix.mjs.map +0 -1
- package/dist/_chunks/shared.mjs.map +0 -1
- package/dist/_chunks/skill.mjs +0 -329
- package/dist/_chunks/skill.mjs.map +0 -1
- package/dist/_chunks/sync-shared.mjs +0 -2
- package/dist/_chunks/sync-shared2.mjs +0 -1020
- package/dist/_chunks/sync-shared2.mjs.map +0 -1
- package/dist/agent/index.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.mjs","names":[],"sources":["../../src/retriv/worker.ts"],"sourcesContent":["import type { IndexConfig, Document as RetrivDocument } from './types.ts'\nimport { parentPort } from 'node:worker_threads'\n\nexport interface WorkerIndexMessage {\n type: 'index'\n id: number\n documents: RetrivDocument[]\n dbPath: string\n /** Exact IDs (including chunk IDs) to remove before indexing */\n removeIds?: string[]\n}\n\nexport interface WorkerShutdownMessage {\n type: 'shutdown'\n}\n\nexport type WorkerMessage = WorkerIndexMessage | WorkerShutdownMessage\n\nexport interface WorkerProgressResponse {\n type: 'progress'\n id: number\n phase: string\n current: number\n total: number\n}\n\nexport interface WorkerDoneResponse {\n type: 'done'\n id: number\n}\n\nexport interface WorkerErrorResponse {\n type: 'error'\n id: number\n message: string\n}\n\nexport type WorkerResponse = WorkerProgressResponse | WorkerDoneResponse | WorkerErrorResponse\n\nif (parentPort) {\n parentPort.on('message', async (msg: WorkerMessage) => {\n if (msg.type === 'shutdown') {\n process.exit(0)\n }\n\n if (msg.type === 'index') {\n const { id, documents, dbPath } = msg\n\n try {\n const config: IndexConfig = {\n dbPath,\n onProgress: ({ phase, current, total }) => {\n parentPort!.postMessage({ type: 'progress', id, phase, current, total } satisfies WorkerProgressResponse)\n },\n }\n\n const { getDb } = await import('./index.ts')\n const db = await getDb(config)\n if (msg.removeIds?.length)\n await db.remove?.(msg.removeIds)\n await db.index(documents, { onProgress: config.onProgress })\n await db.close?.()\n\n parentPort!.postMessage({ type: 'done', id } satisfies WorkerDoneResponse)\n }\n catch (err) {\n parentPort!.postMessage({\n type: 'error',\n id,\n message: err instanceof Error ? err.message : String(err),\n } satisfies WorkerErrorResponse)\n }\n }\n })\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"file":"worker.mjs","names":[],"sources":["../../src/retriv/worker.ts"],"sourcesContent":["import type { IndexConfig, Document as RetrivDocument } from './types.ts'\nimport { parentPort } from 'node:worker_threads'\n\nexport interface WorkerIndexMessage {\n type: 'index'\n id: number\n documents: RetrivDocument[]\n dbPath: string\n /** Exact IDs (including chunk IDs) to remove before indexing */\n removeIds?: string[]\n}\n\nexport interface WorkerShutdownMessage {\n type: 'shutdown'\n}\n\nexport type WorkerMessage = WorkerIndexMessage | WorkerShutdownMessage\n\nexport interface WorkerProgressResponse {\n type: 'progress'\n id: number\n phase: string\n current: number\n total: number\n}\n\nexport interface WorkerDoneResponse {\n type: 'done'\n id: number\n}\n\nexport interface WorkerErrorResponse {\n type: 'error'\n id: number\n message: string\n name?: string\n}\n\nexport type WorkerResponse = WorkerProgressResponse | WorkerDoneResponse | WorkerErrorResponse\n\nif (parentPort) {\n parentPort.on('message', async (msg: WorkerMessage) => {\n if (msg.type === 'shutdown') {\n process.exit(0)\n }\n\n if (msg.type === 'index') {\n const { id, documents, dbPath } = msg\n\n try {\n const config: IndexConfig = {\n dbPath,\n onProgress: ({ phase, current, total }) => {\n parentPort!.postMessage({ type: 'progress', id, phase, current, total } satisfies WorkerProgressResponse)\n },\n }\n\n const { getDb } = await import('./index.ts')\n const db = await getDb(config)\n if (msg.removeIds?.length)\n await db.remove?.(msg.removeIds)\n await db.index(documents, { onProgress: config.onProgress })\n await db.close?.()\n\n parentPort!.postMessage({ type: 'done', id } satisfies WorkerDoneResponse)\n }\n catch (err) {\n parentPort!.postMessage({\n type: 'error',\n id,\n message: err instanceof Error ? err.message : String(err),\n name: err instanceof Error ? err.name : undefined,\n } satisfies WorkerErrorResponse)\n }\n }\n })\n}\n"],"mappings":";AAwCA,IAAI,YACF,WAAW,GAAG,WAAW,OAAO,QAAuB;CACrD,IAAI,IAAI,SAAS,YACf,QAAQ,KAAK,EAAE;CAGjB,IAAI,IAAI,SAAS,SAAS;EACxB,MAAM,EAAE,IAAI,WAAW,WAAW;EAElC,IAAI;GACF,MAAM,SAAsB;IAC1B;IACA,aAAa,EAAE,OAAO,SAAS,YAAY;KACzC,WAAY,YAAY;MAAE,MAAM;MAAY;MAAI;MAAO;MAAS;MAAO,CAAkC;;IAE5G;GAED,MAAM,EAAE,UAAU,MAAM,OAAO;GAC/B,MAAM,KAAK,MAAM,MAAM,OAAO;GAC9B,IAAI,IAAI,WAAW,QACjB,MAAM,GAAG,SAAS,IAAI,UAAU;GAClC,MAAM,GAAG,MAAM,WAAW,EAAE,YAAY,OAAO,YAAY,CAAC;GAC5D,MAAM,GAAG,SAAS;GAElB,WAAY,YAAY;IAAE,MAAM;IAAQ;IAAI,CAA8B;WAErE,KAAK;GACV,WAAY,YAAY;IACtB,MAAM;IACN;IACA,SAAS,eAAe,QAAQ,IAAI,UAAU,OAAO,IAAI;IACzD,MAAM,eAAe,QAAQ,IAAI,OAAO,KAAA;IACzC,CAA+B;;;EAGpC"}
|
package/dist/sources/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { a as NpmPackageInfo, c as ResolvedPackage, i as LocalDependency, n as LlmsContent, o as ResolveAttempt, r as LlmsLink, s as ResolveResult, t as FetchedDoc } from "../_chunks/types.mjs";
|
|
2
|
+
import { $ as fetchLlmsUrl, A as getRelatedPackages, At as toCrawlPattern, B as getInstalledSkillVersion, C as BlogRelease, Ct as resolveEntryFiles, D as getDocOverride, Dt as formatDiscussionAsMarkdown, E as getCrawlUrl, Et as fetchGitHubDiscussions, F as ResolveStep, G as resolveLocalPackageDocs, H as readLocalDependencies, I as fetchLatestVersion, J as searchNpmPackages, K as resolvePackageDocs, L as fetchNpmPackage, M as getRepoKeyForPackage, Mt as fetchBlogReleases, N as LocalPackageInfo, O as getFilePatterns, Ot as generateDiscussionIndex, P as ResolveOptions, Q as fetchLlmsTxt, R as fetchNpmRegistryMeta, S as BlogPreset, St as EntryFile, T as getBlogPreset, Tt as GitHubDiscussion, U as readLocalPackageInfo, V as parseVersionSpecifier, W as resolveInstalledVersion, X as downloadLlmsDocs, Y as resolveLocalDep, Z as extractSections, _ as compareSemver, _t as GitSkillSource, a as isGitHubRepoUrl, at as generateIssueIndex, b as isPrerelease, bt as parseGitSkillInput, c as parseGitHubUrl, ct as fetchReadme, d as PackageResolution, dt as GitDocsResult, et as normalizeLlmsLinks, f as ResolvePackageOptions, ft as MIN_GIT_DOCS, g as SemVer, gt as validateGitDocsWithLlms, h as ReleaseIndexOptions, ht as isShallowGitDocs, i as fetchText, it as formatIssueAsMarkdown, j as getRepoEntry, jt as resolveCrateDocsWithAttempts, k as getPrereleaseChangelogRef, kt as fetchCrawledDocs, l as parsePackageSpec, lt as fetchReadmeContent, m as GitHubRelease, mt as filterFrameworkDocs, n as extractBranchHint, nt as GitHubIssue, o as normalizeRepoUrl, ot as isGhAvailable, p as resolvePackageOrCrate, pt as fetchGitDocs, q as resolvePackageDocsWithAttempts, r as fetchGitHubRaw, rt as fetchGitHubIssues, s as parseGitHubRepoSlug, st as fetchGitHubRepoMeta, t as $fetch, tt as parseMarkdownLinks, u as verifyUrl, ut as resolveGitHubRepo, v as fetchReleaseNotes, vt as RemoteSkill, w as DocOverride, wt as generateDocsIndex, x as parseSemver, xt as parseSkillFrontmatterName, y as generateReleaseIndex, yt as fetchGitSkills, z as fetchPkgDist } from "../_chunks/index4.mjs";
|
|
3
|
+
export { $fetch, BlogPreset, BlogRelease, DocOverride, EntryFile, FetchedDoc, GitDocsResult, GitHubDiscussion, GitHubIssue, GitHubRelease, GitSkillSource, LlmsContent, LlmsLink, LocalDependency, LocalPackageInfo, MIN_GIT_DOCS, NpmPackageInfo, PackageResolution, ReleaseIndexOptions, RemoteSkill, ResolveAttempt, ResolveOptions, ResolvePackageOptions, ResolveResult, ResolveStep, ResolvedPackage, SemVer, compareSemver, downloadLlmsDocs, extractBranchHint, extractSections, fetchBlogReleases, fetchCrawledDocs, fetchGitDocs, fetchGitHubDiscussions, fetchGitHubIssues, fetchGitHubRaw, fetchGitHubRepoMeta, fetchGitSkills, fetchLatestVersion, fetchLlmsTxt, fetchLlmsUrl, fetchNpmPackage, fetchNpmRegistryMeta, fetchPkgDist, fetchReadme, fetchReadmeContent, fetchReleaseNotes, fetchText, filterFrameworkDocs, formatDiscussionAsMarkdown, formatIssueAsMarkdown, generateDiscussionIndex, generateDocsIndex, generateIssueIndex, generateReleaseIndex, getBlogPreset, getCrawlUrl, getDocOverride, getFilePatterns, getInstalledSkillVersion, getPrereleaseChangelogRef, getRelatedPackages, getRepoEntry, getRepoKeyForPackage, isGhAvailable, isGitHubRepoUrl, isPrerelease, isShallowGitDocs, normalizeLlmsLinks, normalizeRepoUrl, parseGitHubRepoSlug, parseGitHubUrl, parseGitSkillInput, parseMarkdownLinks, parsePackageSpec, parseSemver, parseSkillFrontmatterName, parseVersionSpecifier, readLocalDependencies, readLocalPackageInfo, resolveCrateDocsWithAttempts, resolveEntryFiles, resolveGitHubRepo, resolveInstalledVersion, resolveLocalDep, resolveLocalPackageDocs, resolvePackageDocs, resolvePackageDocsWithAttempts, resolvePackageOrCrate, searchNpmPackages, toCrawlPattern, validateGitDocsWithLlms, verifyUrl };
|
package/dist/sources/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { $ as
|
|
3
|
-
export { $fetch, MIN_GIT_DOCS, compareSemver, downloadLlmsDocs, extractBranchHint, extractSections, fetchBlogReleases, fetchCrawledDocs, fetchGitDocs, fetchGitHubDiscussions, fetchGitHubIssues, fetchGitHubRaw, fetchGitHubRepoMeta, fetchGitSkills, fetchLatestVersion, fetchLlmsTxt, fetchLlmsUrl, fetchNpmPackage, fetchNpmRegistryMeta, fetchPkgDist, fetchReadme, fetchReadmeContent, fetchReleaseNotes, fetchText, filterFrameworkDocs, formatDiscussionAsMarkdown, formatIssueAsMarkdown, generateDiscussionIndex, generateDocsIndex, generateIssueIndex, generateReleaseIndex, getBlogPreset, getCrawlUrl, getDocOverride, getFilePatterns, getInstalledSkillVersion, getPrereleaseChangelogRef, getRelatedPackages, getRepoEntry, getRepoKeyForPackage, isGhAvailable, isGitHubRepoUrl, isPrerelease, isShallowGitDocs, normalizeLlmsLinks, normalizeRepoUrl, parseGitHubRepoSlug, parseGitHubUrl, parseGitSkillInput, parseMarkdownLinks, parsePackageSpec, parseSemver, parseSkillFrontmatterName, parseVersionSpecifier, readLocalDependencies, readLocalPackageInfo, resolveCrateDocsWithAttempts, resolveEntryFiles, resolveGitHubRepo, resolveInstalledVersion, resolveLocalPackageDocs, resolvePackageDocs, resolvePackageDocsWithAttempts, searchNpmPackages, toCrawlPattern, validateGitDocsWithLlms, verifyUrl };
|
|
1
|
+
import { c as getRepoEntry, i as getFilePatterns, l as getRepoKeyForPackage, n as getCrawlUrl, o as getPrereleaseChangelogRef, r as getDocOverride, s as getRelatedPackages, t as getBlogPreset } from "../_chunks/package-registry.mjs";
|
|
2
|
+
import { $ as fetchReleaseNotes, A as resolveCrateDocsWithAttempts, B as parseMarkdownLinks, C as resolveEntryFiles, D as generateDiscussionIndex, E as formatDiscussionAsMarkdown, F as downloadLlmsDocs, G as MIN_GIT_DOCS, H as formatIssueAsMarkdown, I as extractSections, J as isShallowGitDocs, K as fetchGitDocs, L as fetchLlmsTxt, M as fetchReadme, N as fetchReadmeContent, O as fetchCrawledDocs, P as resolveGitHubRepo, Q as compareSemver, R as fetchLlmsUrl, S as parseSkillFrontmatterName, T as fetchGitHubDiscussions, U as generateIssueIndex, V as fetchGitHubIssues, W as isGhAvailable, Y as validateGitDocsWithLlms, Z as fetchBlogReleases, _ as resolvePackageDocsWithAttempts, at as fetchGitHubRaw, b as fetchGitSkills, c as fetchNpmRegistryMeta, ct as normalizeRepoUrl, d as parseVersionSpecifier, dt as parsePackageSpec, et as generateReleaseIndex, f as readLocalDependencies, ft as verifyUrl, g as resolvePackageDocs, h as resolveLocalPackageDocs, it as extractBranchHint, j as fetchGitHubRepoMeta, k as toCrawlPattern, l as fetchPkgDist, lt as parseGitHubRepoSlug, m as resolveInstalledVersion, nt as parseSemver, o as fetchLatestVersion, ot as fetchText, p as readLocalPackageInfo, q as filterFrameworkDocs, rt as $fetch, s as fetchNpmPackage, st as isGitHubRepoUrl, t as resolvePackageOrCrate, tt as isPrerelease, u as getInstalledSkillVersion, ut as parseGitHubUrl, v as searchNpmPackages, w as generateDocsIndex, x as parseGitSkillInput, y as resolveLocalDep, z as normalizeLlmsLinks } from "../_chunks/sources.mjs";
|
|
3
|
+
export { $fetch, MIN_GIT_DOCS, compareSemver, downloadLlmsDocs, extractBranchHint, extractSections, fetchBlogReleases, fetchCrawledDocs, fetchGitDocs, fetchGitHubDiscussions, fetchGitHubIssues, fetchGitHubRaw, fetchGitHubRepoMeta, fetchGitSkills, fetchLatestVersion, fetchLlmsTxt, fetchLlmsUrl, fetchNpmPackage, fetchNpmRegistryMeta, fetchPkgDist, fetchReadme, fetchReadmeContent, fetchReleaseNotes, fetchText, filterFrameworkDocs, formatDiscussionAsMarkdown, formatIssueAsMarkdown, generateDiscussionIndex, generateDocsIndex, generateIssueIndex, generateReleaseIndex, getBlogPreset, getCrawlUrl, getDocOverride, getFilePatterns, getInstalledSkillVersion, getPrereleaseChangelogRef, getRelatedPackages, getRepoEntry, getRepoKeyForPackage, isGhAvailable, isGitHubRepoUrl, isPrerelease, isShallowGitDocs, normalizeLlmsLinks, normalizeRepoUrl, parseGitHubRepoSlug, parseGitHubUrl, parseGitSkillInput, parseMarkdownLinks, parsePackageSpec, parseSemver, parseSkillFrontmatterName, parseVersionSpecifier, readLocalDependencies, readLocalPackageInfo, resolveCrateDocsWithAttempts, resolveEntryFiles, resolveGitHubRepo, resolveInstalledVersion, resolveLocalDep, resolveLocalPackageDocs, resolvePackageDocs, resolvePackageDocsWithAttempts, resolvePackageOrCrate, searchNpmPackages, toCrawlPattern, validateGitDocsWithLlms, verifyUrl };
|
package/dist/types.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { N as CachedPackage, j as CacheConfig } from "./_chunks/index2.mjs";
|
|
2
|
+
import { n as LlmsContent, r as LlmsLink, t as FetchedDoc } from "./_chunks/types.mjs";
|
|
3
|
+
import { c as SearchResult, l as SearchSnippet, n as Document, o as SearchFilter, r as IndexConfig, s as SearchOptions } from "./_chunks/types2.mjs";
|
|
4
4
|
export { type CacheConfig, type CachedPackage, type Document, type FetchedDoc, type IndexConfig, type LlmsContent, type LlmsLink, type SearchFilter, type SearchOptions, type SearchResult, type SearchSnippet };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skilld",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.7.
|
|
4
|
+
"version": "1.7.4",
|
|
5
5
|
"description": "Generate AI agent skills from npm package documentation",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Harlan Wilton",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@clack/prompts": "^1.3.0",
|
|
53
53
|
"@huggingface/transformers": "^4.2.0",
|
|
54
|
-
"@mariozechner/pi-ai": "^0.
|
|
54
|
+
"@mariozechner/pi-ai": "^0.73.0",
|
|
55
55
|
"@mdream/crawl": "^1.1.0",
|
|
56
56
|
"citty": "^0.2.2",
|
|
57
57
|
"consola": "^3.4.2",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"micromark-extension-frontmatter": "^2.0.0",
|
|
66
66
|
"mlly": "^1.8.2",
|
|
67
67
|
"ofetch": "^1.5.1",
|
|
68
|
-
"oxc-parser": "^0.
|
|
68
|
+
"oxc-parser": "^0.129.0",
|
|
69
69
|
"p-limit": "^7.3.0",
|
|
70
70
|
"pathe": "^2.0.3",
|
|
71
71
|
"retriv": "^0.13.2",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"sqlite-vec": "^0.1.9",
|
|
74
74
|
"std-env": "^4.1.0",
|
|
75
75
|
"tinyglobby": "^0.2.16",
|
|
76
|
-
"typebox": "^1.1.
|
|
76
|
+
"typebox": "^1.1.38",
|
|
77
77
|
"typescript": "6.0.2",
|
|
78
78
|
"unagent": "^0.0.8",
|
|
79
79
|
"unist-util-visit": "^5.1.0"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"@types/semver": "^7.7.1",
|
|
85
85
|
"@vitest/coverage-v8": "^4.1.5",
|
|
86
86
|
"bumpp": "^11.0.1",
|
|
87
|
-
"obuild": "^0.4.
|
|
87
|
+
"obuild": "^0.4.34",
|
|
88
88
|
"tsx": "^4.21.0",
|
|
89
89
|
"vitest": "^4.1.5"
|
|
90
90
|
},
|
package/dist/_chunks/config.mjs
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { n as yamlParseKV, r as yamlUnescape, t as yamlEscape } from "./yaml.mjs";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
|
-
import { join } from "pathe";
|
|
4
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
|
-
const defaultFeatures = {
|
|
6
|
-
search: true,
|
|
7
|
-
issues: true,
|
|
8
|
-
discussions: true,
|
|
9
|
-
releases: true
|
|
10
|
-
};
|
|
11
|
-
const CONFIG_DIR = join(homedir(), ".skilld");
|
|
12
|
-
const CONFIG_PATH = join(CONFIG_DIR, "config.yaml");
|
|
13
|
-
let configCache;
|
|
14
|
-
function hasConfig() {
|
|
15
|
-
return existsSync(CONFIG_PATH);
|
|
16
|
-
}
|
|
17
|
-
function hasCompletedWizard() {
|
|
18
|
-
if (!existsSync(CONFIG_PATH)) return false;
|
|
19
|
-
const config = readConfig();
|
|
20
|
-
return config.features !== void 0 || config.model !== void 0 || config.skipLlm !== void 0;
|
|
21
|
-
}
|
|
22
|
-
function readConfig() {
|
|
23
|
-
if (configCache) return {
|
|
24
|
-
...configCache,
|
|
25
|
-
features: configCache.features ? { ...configCache.features } : void 0,
|
|
26
|
-
projects: configCache.projects ? [...configCache.projects] : void 0
|
|
27
|
-
};
|
|
28
|
-
if (!existsSync(CONFIG_PATH)) return {};
|
|
29
|
-
const content = readFileSync(CONFIG_PATH, "utf-8");
|
|
30
|
-
const config = {};
|
|
31
|
-
let inBlock = null;
|
|
32
|
-
const projects = [];
|
|
33
|
-
const features = {};
|
|
34
|
-
for (const line of content.split("\n")) {
|
|
35
|
-
if (line.startsWith("projects:")) {
|
|
36
|
-
inBlock = "projects";
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
if (line.startsWith("features:")) {
|
|
40
|
-
inBlock = "features";
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
if (inBlock === "projects") {
|
|
44
|
-
if (line.startsWith(" - ")) {
|
|
45
|
-
projects.push(yamlUnescape(line.slice(4)));
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
inBlock = null;
|
|
49
|
-
}
|
|
50
|
-
if (inBlock === "features") {
|
|
51
|
-
const m = line.match(/^ {2}(\w+):\s*(.+)/);
|
|
52
|
-
if (m) {
|
|
53
|
-
const key = m[1];
|
|
54
|
-
if (key in defaultFeatures) features[key] = m[2] === "true";
|
|
55
|
-
continue;
|
|
56
|
-
}
|
|
57
|
-
inBlock = null;
|
|
58
|
-
}
|
|
59
|
-
const kv = yamlParseKV(line);
|
|
60
|
-
if (!kv) continue;
|
|
61
|
-
const [key, value] = kv;
|
|
62
|
-
if (key === "model" && value) config.model = value;
|
|
63
|
-
if (key === "agent" && value) config.agent = value;
|
|
64
|
-
if (key === "skipLlm") config.skipLlm = value === "true";
|
|
65
|
-
}
|
|
66
|
-
if (projects.length > 0) config.projects = projects;
|
|
67
|
-
if (Object.keys(features).length > 0) config.features = {
|
|
68
|
-
...defaultFeatures,
|
|
69
|
-
...features
|
|
70
|
-
};
|
|
71
|
-
configCache = config;
|
|
72
|
-
return config;
|
|
73
|
-
}
|
|
74
|
-
function writeConfig(config) {
|
|
75
|
-
mkdirSync(CONFIG_DIR, {
|
|
76
|
-
recursive: true,
|
|
77
|
-
mode: 448
|
|
78
|
-
});
|
|
79
|
-
let yaml = "";
|
|
80
|
-
if (config.model) yaml += `model: ${config.model}\n`;
|
|
81
|
-
if (config.agent) yaml += `agent: ${config.agent}\n`;
|
|
82
|
-
if (config.skipLlm) yaml += `skipLlm: true\n`;
|
|
83
|
-
if (config.features) {
|
|
84
|
-
yaml += "features:\n";
|
|
85
|
-
for (const [k, v] of Object.entries(config.features)) yaml += ` ${k}: ${v}\n`;
|
|
86
|
-
}
|
|
87
|
-
if (config.projects?.length) {
|
|
88
|
-
yaml += "projects:\n";
|
|
89
|
-
for (const p of config.projects) yaml += ` - ${yamlEscape(p)}\n`;
|
|
90
|
-
}
|
|
91
|
-
writeFileSync(CONFIG_PATH, yaml, { mode: 384 });
|
|
92
|
-
configCache = void 0;
|
|
93
|
-
}
|
|
94
|
-
function updateConfig(updates) {
|
|
95
|
-
writeConfig({
|
|
96
|
-
...readConfig(),
|
|
97
|
-
...updates
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
function registerProject(projectPath) {
|
|
101
|
-
const config = readConfig();
|
|
102
|
-
const projects = new Set(config.projects || []);
|
|
103
|
-
projects.add(projectPath);
|
|
104
|
-
writeConfig({
|
|
105
|
-
...config,
|
|
106
|
-
projects: [...projects]
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function unregisterProject(projectPath) {
|
|
110
|
-
const config = readConfig();
|
|
111
|
-
const projects = (config.projects || []).filter((p) => p !== projectPath);
|
|
112
|
-
writeConfig({
|
|
113
|
-
...config,
|
|
114
|
-
projects
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
function getRegisteredProjects() {
|
|
118
|
-
return readConfig().projects || [];
|
|
119
|
-
}
|
|
120
|
-
export { readConfig as a, updateConfig as c, hasConfig as i, getRegisteredProjects as n, registerProject as o, hasCompletedWizard as r, unregisterProject as s, defaultFeatures as t };
|
|
121
|
-
|
|
122
|
-
//# sourceMappingURL=config.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.mjs","names":[],"sources":["../../src/core/config.ts"],"sourcesContent":["import type { OptimizeModel } from '../agent/index.ts'\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { join } from 'pathe'\nimport { yamlEscape, yamlParseKV, yamlUnescape } from './yaml.ts'\n\nexport interface FeaturesConfig {\n search: boolean\n issues: boolean\n discussions: boolean\n releases: boolean\n}\n\nexport const defaultFeatures: FeaturesConfig = {\n search: true,\n issues: true,\n discussions: true,\n releases: true,\n}\n\nexport interface SkilldConfig {\n model?: OptimizeModel\n agent?: string\n features?: FeaturesConfig\n projects?: string[]\n skipLlm?: boolean\n}\n\nconst CONFIG_DIR = join(homedir(), '.skilld')\nconst CONFIG_PATH = join(CONFIG_DIR, 'config.yaml')\n\nlet configCache: SkilldConfig | undefined\n\nexport function hasConfig(): boolean {\n return existsSync(CONFIG_PATH)\n}\n\n/** Whether the first-run wizard has been completed (not just agent selection) */\nexport function hasCompletedWizard(): boolean {\n if (!existsSync(CONFIG_PATH))\n return false\n const config = readConfig()\n return config.features !== undefined || config.model !== undefined || config.skipLlm !== undefined\n}\n\nexport function readConfig(): SkilldConfig {\n if (configCache) {\n return {\n ...configCache,\n features: configCache.features ? { ...configCache.features } : undefined,\n projects: configCache.projects ? [...configCache.projects] : undefined,\n }\n }\n if (!existsSync(CONFIG_PATH))\n return {}\n\n const content = readFileSync(CONFIG_PATH, 'utf-8')\n const config: SkilldConfig = {}\n let inBlock: 'projects' | 'features' | null = null\n const projects: string[] = []\n const features: Partial<FeaturesConfig> = {}\n\n for (const line of content.split('\\n')) {\n if (line.startsWith('projects:')) {\n inBlock = 'projects'\n continue\n }\n if (line.startsWith('features:')) {\n inBlock = 'features'\n continue\n }\n if (inBlock === 'projects') {\n if (line.startsWith(' - ')) {\n projects.push(yamlUnescape(line.slice(4)))\n continue\n }\n inBlock = null\n }\n if (inBlock === 'features') {\n const m = line.match(/^ {2}(\\w+):\\s*(.+)/)\n if (m) {\n const key = m[1] as keyof FeaturesConfig\n if (key in defaultFeatures)\n features[key] = m[2] === 'true'\n continue\n }\n inBlock = null\n }\n const kv = yamlParseKV(line)\n if (!kv)\n continue\n const [key, value] = kv\n if (key === 'model' && value)\n config.model = value as OptimizeModel\n if (key === 'agent' && value)\n config.agent = value\n if (key === 'skipLlm')\n config.skipLlm = value === 'true'\n }\n\n if (projects.length > 0)\n config.projects = projects\n if (Object.keys(features).length > 0)\n config.features = { ...defaultFeatures, ...features }\n configCache = config\n return config\n}\n\nexport function writeConfig(config: SkilldConfig): void {\n mkdirSync(CONFIG_DIR, { recursive: true, mode: 0o700 })\n\n let yaml = ''\n if (config.model)\n yaml += `model: ${config.model}\\n`\n if (config.agent)\n yaml += `agent: ${config.agent}\\n`\n if (config.skipLlm)\n yaml += `skipLlm: true\\n`\n if (config.features) {\n yaml += 'features:\\n'\n for (const [k, v] of Object.entries(config.features)) {\n yaml += ` ${k}: ${v}\\n`\n }\n }\n if (config.projects?.length) {\n yaml += 'projects:\\n'\n for (const p of config.projects) {\n yaml += ` - ${yamlEscape(p)}\\n`\n }\n }\n\n writeFileSync(CONFIG_PATH, yaml, { mode: 0o600 })\n configCache = undefined\n}\n\nexport function updateConfig(updates: Partial<SkilldConfig>): void {\n const config = readConfig()\n writeConfig({ ...config, ...updates })\n}\n\nexport function registerProject(projectPath: string): void {\n const config = readConfig()\n const projects = new Set(config.projects || [])\n projects.add(projectPath)\n writeConfig({ ...config, projects: [...projects] })\n}\n\nexport function unregisterProject(projectPath: string): void {\n const config = readConfig()\n const projects = (config.projects || []).filter(p => p !== projectPath)\n writeConfig({ ...config, projects })\n}\n\nexport function getRegisteredProjects(): string[] {\n return readConfig().projects || []\n}\n"],"mappings":";;;;AAaA,MAAa,kBAAkC;CAC7C,QAAQ;CACR,QAAQ;CACR,aAAa;CACb,UAAU;CACX;AAUD,MAAM,aAAa,KAAK,SAAS,EAAE,UAAU;AAC7C,MAAM,cAAc,KAAK,YAAY,cAAc;AAEnD,IAAI;AAEJ,SAAgB,YAAqB;AACnC,QAAO,WAAW,YAAY;;AAIhC,SAAgB,qBAA8B;AAC5C,KAAI,CAAC,WAAW,YAAY,CAC1B,QAAO;CACT,MAAM,SAAS,YAAY;AAC3B,QAAO,OAAO,aAAa,KAAA,KAAa,OAAO,UAA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
|
-
if (trimmed.startsWith("npm:")) {
|
|
5
|
-
const { name, tag } = splitPackageTag(trimmed.slice(4));
|
|
6
|
-
return {
|
|
7
|
-
type: "npm",
|
|
8
|
-
package: name,
|
|
9
|
-
tag
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
if (trimmed.startsWith("crate:")) {
|
|
13
|
-
const rest = trimmed.slice(6).trim();
|
|
14
|
-
const atIdx = rest.indexOf("@");
|
|
15
|
-
return {
|
|
16
|
-
type: "crate",
|
|
17
|
-
package: (atIdx === -1 ? rest : rest.slice(0, atIdx)).toLowerCase(),
|
|
18
|
-
version: atIdx === -1 ? void 0 : rest.slice(atIdx + 1) || void 0
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
if (trimmed.startsWith("gh:") || trimmed.startsWith("github:")) {
|
|
22
|
-
const rest = trimmed.startsWith("gh:") ? trimmed.slice(3) : trimmed.slice(7);
|
|
23
|
-
const gitSource = parseGitSkillInput(rest);
|
|
24
|
-
if (gitSource) return {
|
|
25
|
-
type: "git",
|
|
26
|
-
source: gitSource
|
|
27
|
-
};
|
|
28
|
-
if (/^[\w.-]+\/[\w.-]+/.test(rest)) {
|
|
29
|
-
const [owner, repo] = rest.split("/");
|
|
30
|
-
return {
|
|
31
|
-
type: "git",
|
|
32
|
-
source: {
|
|
33
|
-
type: "github",
|
|
34
|
-
owner,
|
|
35
|
-
repo
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
return {
|
|
40
|
-
type: "bare",
|
|
41
|
-
package: rest
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
if (trimmed.startsWith("@")) {
|
|
45
|
-
const rest = trimmed.slice(1);
|
|
46
|
-
if (rest.indexOf("/") === -1) return {
|
|
47
|
-
type: "curator",
|
|
48
|
-
handle: rest
|
|
49
|
-
};
|
|
50
|
-
const { name, tag } = splitPackageTag(trimmed);
|
|
51
|
-
return {
|
|
52
|
-
type: "bare",
|
|
53
|
-
package: name,
|
|
54
|
-
tag
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
const gitSource = parseGitSkillInput(trimmed);
|
|
58
|
-
if (gitSource) return {
|
|
59
|
-
type: "git",
|
|
60
|
-
source: gitSource
|
|
61
|
-
};
|
|
62
|
-
const { name, tag } = splitPackageTag(trimmed);
|
|
63
|
-
return {
|
|
64
|
-
type: "bare",
|
|
65
|
-
package: name,
|
|
66
|
-
tag
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function resolveSkillName(input) {
|
|
70
|
-
const source = parseSkillInput(input);
|
|
71
|
-
switch (source.type) {
|
|
72
|
-
case "npm":
|
|
73
|
-
case "bare": return source.package;
|
|
74
|
-
case "crate": return `crate:${source.package}`;
|
|
75
|
-
case "git":
|
|
76
|
-
if (source.source.type === "github" && source.source.repo) return source.source.repo;
|
|
77
|
-
return null;
|
|
78
|
-
case "curator":
|
|
79
|
-
case "collection": return null;
|
|
80
|
-
default: throw new Error(`Unhandled SkillSource type: ${JSON.stringify(source)}`);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function toStoragePackageName(identityName) {
|
|
84
|
-
if (identityName.startsWith("crate:")) return `@skilld-crate/${identityName.slice(6)}`;
|
|
85
|
-
return identityName;
|
|
86
|
-
}
|
|
87
|
-
function splitPackageTag(spec) {
|
|
88
|
-
if (spec.startsWith("@")) {
|
|
89
|
-
const slashIdx = spec.indexOf("/");
|
|
90
|
-
if (slashIdx !== -1) {
|
|
91
|
-
const afterSlash = spec.indexOf("@", slashIdx);
|
|
92
|
-
if (afterSlash !== -1) return {
|
|
93
|
-
name: spec.slice(0, afterSlash),
|
|
94
|
-
tag: spec.slice(afterSlash + 1) || void 0
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
return { name: spec };
|
|
98
|
-
}
|
|
99
|
-
const atIdx = spec.indexOf("@");
|
|
100
|
-
if (atIdx !== -1) return {
|
|
101
|
-
name: spec.slice(0, atIdx),
|
|
102
|
-
tag: spec.slice(atIdx + 1) || void 0
|
|
103
|
-
};
|
|
104
|
-
return { name: spec };
|
|
105
|
-
}
|
|
106
|
-
export { resolveSkillName as n, toStoragePackageName as r, parseSkillInput as t };
|
|
107
|
-
|
|
108
|
-
//# sourceMappingURL=prefix.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"prefix.mjs","names":[],"sources":["../../src/core/prefix.ts"],"sourcesContent":["/**\n * Prefix-based input parser for `skilld add`\n *\n * All sources require an explicit prefix:\n * npm:vue → package skill from registry\n * crate:serde → Rust crate from crates.io\n * gh:owner/repo → git skill\n * github:o/r → git skill (alias)\n * @handle → curator's skills\n * @handle/coll → specific collection\n *\n * Bare names (no prefix) are deprecated but still resolve as npm: with a warning.\n */\n\nimport type { GitSkillSource } from '../sources/git-skills.ts'\nimport { parseGitSkillInput } from '../sources/git-skills.ts'\n\nexport type SkillSource\n = | { type: 'npm', package: string, tag?: string }\n | { type: 'crate', package: string, version?: string }\n | { type: 'git', source: GitSkillSource }\n | { type: 'curator', handle: string }\n | { type: 'collection', handle: string, name: string }\n | { type: 'bare', package: string, tag?: string }\n\n/**\n * Parse a single CLI input token into a typed SkillSource.\n *\n * Does NOT emit deprecation warnings; callers handle that for `bare` type.\n */\nexport function parseSkillInput(input: string): SkillSource {\n const trimmed = input.trim()\n\n // npm: prefix → package skill\n if (trimmed.startsWith('npm:')) {\n const rest = trimmed.slice(4)\n const { name, tag } = splitPackageTag(rest)\n return { type: 'npm', package: name, tag }\n }\n\n // crate: prefix → Rust crate from crates.io\n if (trimmed.startsWith('crate:')) {\n const rest = trimmed.slice(6).trim()\n const atIdx = rest.indexOf('@')\n const name = (atIdx === -1 ? rest : rest.slice(0, atIdx)).toLowerCase()\n const version = atIdx === -1 ? undefined : rest.slice(atIdx + 1) || undefined\n return { type: 'crate', package: name, version }\n }\n\n // gh: or github: prefix → git skill\n if (trimmed.startsWith('gh:') || trimmed.startsWith('github:')) {\n const rest = trimmed.startsWith('gh:') ? trimmed.slice(3) : trimmed.slice(7)\n const gitSource = parseGitSkillInput(rest)\n if (gitSource)\n return { type: 'git', source: gitSource }\n // If gh: prefix used but can't parse as git, treat as github shorthand\n if (/^[\\w.-]+\\/[\\w.-]+/.test(rest)) {\n const [owner, repo] = rest.split('/')\n return { type: 'git', source: { type: 'github', owner, repo } }\n }\n // Invalid gh: input, fall through to bare\n return { type: 'bare', package: rest }\n }\n\n // @handle (curator) or @scope/pkg (npm scoped package)\n if (trimmed.startsWith('@')) {\n const rest = trimmed.slice(1)\n const slashIdx = rest.indexOf('/')\n if (slashIdx === -1) {\n return { type: 'curator', handle: rest }\n }\n // @scope/pkg → treat as npm scoped package (bare, deprecated form)\n // Collections must be installed via npm:@handle/coll or a future prefix.\n const { name, tag } = splitPackageTag(trimmed)\n return { type: 'bare', package: name, tag }\n }\n\n // Try existing git detection (SSH, URLs, local paths, owner/repo shorthand)\n const gitSource = parseGitSkillInput(trimmed)\n if (gitSource)\n return { type: 'git', source: gitSource }\n\n // Bare name (deprecated) → resolves as npm\n const { name, tag } = splitPackageTag(trimmed)\n return { type: 'bare', package: name, tag }\n}\n\n/**\n * Parse multiple CLI input tokens, classifying each.\n */\nexport function parseSkillInputs(inputs: string[]): SkillSource[] {\n return inputs.map(parseSkillInput)\n}\n\n/**\n * Resolve a CLI input to the bare package/skill name used for lookup in the lockfile.\n * Strips `npm:` / `gh:` prefixes. Returns null for curator/collection (not addressable\n * as a single skill name).\n */\nexport function resolveSkillName(input: string): string | null {\n const source = parseSkillInput(input)\n switch (source.type) {\n case 'npm':\n case 'bare':\n return source.package\n case 'crate':\n return `crate:${source.package}`\n case 'git':\n if (source.source.type === 'github' && source.source.repo)\n return source.source.repo\n return null\n case 'curator':\n case 'collection':\n return null\n default: {\n const _exhaustive: never = source\n throw new Error(`Unhandled SkillSource type: ${JSON.stringify(_exhaustive)}`)\n }\n }\n}\n\n/**\n * Map a lockfile/identity package name to the storage-safe name used for\n * cache directories and symlinks. `crate:serde` → `@skilld-crate/serde`;\n * other names pass through unchanged.\n */\nexport function toStoragePackageName(identityName: string): string {\n if (identityName.startsWith('crate:'))\n return `@skilld-crate/${identityName.slice('crate:'.length)}`\n return identityName\n}\n\n/**\n * Split \"package@tag\" into name and optional tag.\n * Handles scoped packages: \"@scope/pkg@tag\"\n */\nfunction splitPackageTag(spec: string): { name: string, tag?: string } {\n // Scoped: @scope/pkg@tag → find the @ after the scope\n if (spec.startsWith('@')) {\n const slashIdx = spec.indexOf('/')\n if (slashIdx !== -1) {\n const afterSlash = spec.indexOf('@', slashIdx)\n if (afterSlash !== -1)\n return { name: spec.slice(0, afterSlash), tag: spec.slice(afterSlash + 1) || undefined }\n }\n return { name: spec }\n }\n // Unscoped: pkg@tag\n const atIdx = spec.indexOf('@')\n if (atIdx !== -1)\n return { name: spec.slice(0, atIdx), tag: spec.slice(atIdx + 1) || undefined }\n return { name: spec }\n}\n"],"mappings":";;;;;AA8BA,SAAgB;GACd,MAAM;GAGN,SAAI;GAEF;GACA;;KAAsB,QAAS,WAAA,SAAA,EAAA;QAAM,OAAA,QAAA,MAAA,EAAA,CAAA,MAAA;QAAK,QAAA,KAAA,QAAA,IAAA;;GAI5C,MAAI;GACF,UAAM,UAAe,KAAA,OAAS,KAAM,MAAA,GAAA,MAAA,EAAA,aAAA;GACpC,SAAM,UAAa,KAAA,KAAQ,IAAI,KAAA,MAAA,QAAA,EAAA,IAAA,KAAA;GAG/B;;KAAwB,QAFV,WAAU,MAAK,IAAA,QAAY,WAAS,UAAQ,EAAA;QAEnB,OADvB,QAAU,WAAK,MAAY,GAAK,QAAM,MAAU,EAAA,GAAI,QAAA,MAAA,EAAA;QACpB,YAAA,mBAAA,KAAA;;GAIlD,MAAI;GACF,QAAM;GACN;AACA,MAAI,oBACK,KAAA,KAAA,EAAA;GAAE,MAAM,CAAA,OAAA,QAAA,KAAA,MAAA,IAAA;AAAO,UAAA;IAAmB,MAAA;IAE3C,QAAI;KACF,MAAO;KACP;KAAS;KAAa;;;SAAiC;;YAAQ;;;KAGxD,QAAM,WAAA,IAAA,EAAA;QAAQ,OAAS,QAAA,MAAA,EAAA;MAAM,KAAA,QAAA,IAAA,KAAA,GAAA,QAAA;;GAIxC,QAAI;GACF;EAEA,MADiB,EAAA,MAAK,QAAY,gBAEzB,QAAA;SAAQ;GAAW,MAAA;GAAc,SAAA;GAI1C;GACA;;OAAuB,YAAS,mBAAA,QAAA;KAAM,UAAA,QAAA;QAAK;;EAI7C;CACA,MAAI,EAAA,MACF,QAAO,gBAAA,QAAA;QAAQ;EAAO,MAAA;EAAmB,SAAA;EAG3C;EACA;;SAAsC,iBAAA,OAAA;OAAK,SAAA,gBAAA,MAAA;;;;;;;AAe7C,UAAgB;EACd,KAAM;EACN,KAAA,aAAe,QAAf;EACE,QAAK,OAAA,IAAA,MAAA,+BAAA,KAAA,UAAA,OAAA,GAAA;;;AAMH,SAAI,qBAAuB,cAAY;AAEvC,KAAA,aAAO,WAAA,SAAA,CAAA,QAAA,iBAAA,aAAA,MAAA,EAAA;QACJ;;;;;;;;;IAeT,KAAgB,KAAA,MAAA,aAAqB,EAAA,IAAA,KAA8B;IACjE;;;;;;;EASF,KAAA,KAAS,MAAA,QAAgB,EAAA,IAA8C,KAAA;EAErE;QACQ,EAAA,MAAA,MAAW;;AAGf,SAAI,oBACF,GAAA,wBAAO,GAAA,mBAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shared.mjs","names":["_semverValid","_semverGt","_semverDiff"],"sources":["../../src/sources/package-registry.ts","../../src/core/shared.ts"],"sourcesContent":["/**\n * Unified package registry — single source of truth for package metadata.\n * Consolidates doc overrides, blog presets, and file patterns.\n * Keyed by GitHub 'owner/repo' (source code repo).\n */\n\nexport interface BlogRelease {\n version: string\n url: string\n date: string\n title?: string\n}\n\nexport interface PackageEntry {\n filePatterns?: string[]\n primary?: boolean\n /** Extra rules injected into skill generation prompts */\n rules?: string[]\n}\n\nexport interface RepoEntry {\n owner: string\n repo: string\n /** Separate docs repo name (e.g. 'docs' → owner/docs) */\n docsRepo?: string\n /** Path prefix to filter markdown files */\n docsPath?: string\n /** Branch/ref override */\n docsRef?: string\n /** Homepage URL */\n homepage?: string\n /** URL pattern to crawl for docs (glob, e.g. 'https://example.com/docs/**') */\n crawlUrl?: string\n /** Branch to fetch CHANGELOG.md from when installed version is a prerelease (e.g. 'minor' for Vue) */\n prereleaseChangelogRef?: string\n /** Packages in this repo */\n packages: Record<string, PackageEntry>\n /** Curated blog release posts */\n blogReleases?: BlogRelease[]\n}\n\n// Backwards-compatible types\nexport interface DocOverride {\n owner: string\n repo: string\n path: string\n ref?: string\n homepage?: string\n}\n\nexport interface BlogPreset {\n packageName: string\n releases: BlogRelease[]\n}\n\n// ── Registry ──\n\nconst REPO_REGISTRY: Record<string, RepoEntry> = {\n // ── Frameworks with doc overrides ──\n\n 'vuejs/core': {\n owner: 'vuejs',\n repo: 'core',\n docsRepo: 'docs',\n docsPath: 'src',\n homepage: 'https://vuejs.org',\n prereleaseChangelogRef: 'minor',\n packages: {\n 'vue': { primary: true, filePatterns: ['*.vue'], rules: ['ALWAYS use `<script setup lang=\"ts\">`', 'Use ```vue code fences for SFC examples containing `<script>` or `<template>` tags, ```ts for plain TypeScript'] },\n '@vue/compiler-core': {},\n '@vue/compiler-dom': {},\n '@vue/reactivity': {},\n '@vue/runtime-core': {},\n '@vue/runtime-dom': {},\n '@vue/shared': {},\n },\n blogReleases: [\n { version: '3.5', url: 'https://blog.vuejs.org/posts/vue-3-5', date: '2024-09-01' },\n { version: '3.4', url: 'https://blog.vuejs.org/posts/vue-3-4', date: '2023-12-28' },\n { version: '3.3', url: 'https://blog.vuejs.org/posts/vue-3-3', date: '2023-05-11' },\n { version: '3.2', url: 'https://blog.vuejs.org/posts/vue-3-2', date: '2021-08-05' },\n { version: '3.1', url: 'https://blog.vuejs.org/posts/vue-3-1', date: '2021-06-07' },\n { version: '3.0', url: 'https://blog.vuejs.org/posts/vue-3-0', date: '2020-09-18' },\n ],\n },\n\n 'tailwindlabs/tailwindcss': {\n owner: 'tailwindlabs',\n repo: 'tailwindcss',\n docsRepo: 'tailwindcss.com',\n docsPath: 'src/docs',\n homepage: 'https://tailwindcss.com',\n packages: {\n tailwindcss: { primary: true },\n },\n },\n\n 'withastro/astro': {\n owner: 'withastro',\n repo: 'astro',\n docsRepo: 'docs',\n docsPath: 'src/content/docs/en',\n homepage: 'https://docs.astro.build',\n packages: {\n astro: { primary: true, filePatterns: ['*.astro'] },\n },\n },\n\n 'vueuse/vueuse': {\n owner: 'vueuse',\n repo: 'vueuse',\n docsPath: 'packages',\n packages: {\n '@vueuse/core': { primary: true },\n },\n },\n\n // ── Frameworks (file patterns only) ──\n\n 'sveltejs/svelte': {\n owner: 'sveltejs',\n repo: 'svelte',\n packages: {\n svelte: { primary: true, filePatterns: ['*.svelte'], rules: ['ALWAYS use runes syntax ($state, $derived, $effect, $props)'] },\n },\n },\n\n 'solidjs/solid': {\n owner: 'solidjs',\n repo: 'solid',\n packages: {\n 'solid-js': { primary: true, filePatterns: ['*.jsx', '*.tsx'] },\n },\n },\n\n 'QwikDev/qwik': {\n owner: 'QwikDev',\n repo: 'qwik',\n packages: {\n qwik: { primary: true, filePatterns: ['*.tsx'] },\n },\n },\n\n 'marko-js/marko': {\n owner: 'marko-js',\n repo: 'marko',\n packages: {\n marko: { primary: true, filePatterns: ['*.marko'] },\n },\n },\n\n 'riot/riot': {\n owner: 'riot',\n repo: 'riot',\n packages: {\n riot: { primary: true, filePatterns: ['*.riot'] },\n },\n },\n\n // ── Languages/transpilers ──\n\n 'microsoft/TypeScript': {\n owner: 'microsoft',\n repo: 'TypeScript',\n packages: {\n typescript: { primary: true, filePatterns: ['*.ts', '*.tsx', '*.mts', '*.cts'] },\n },\n blogReleases: [\n { version: '6.0', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-6-0-beta/', date: '2026-02-11', title: 'Announcing TypeScript 6.0 Beta' },\n { version: '5.9', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-9/', date: '2025-08-01', title: 'Announcing TypeScript 5.9' },\n { version: '5.8', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-8/', date: '2025-02-28', title: 'Announcing TypeScript 5.8' },\n { version: '5.7', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-7/', date: '2024-11-22', title: 'Announcing TypeScript 5.7' },\n { version: '5.6', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-6/', date: '2024-09-09', title: 'Announcing TypeScript 5.6' },\n { version: '5.5', url: 'https://devblogs.microsoft.com/typescript/announcing-typescript-5-5/', date: '2024-06-20', title: 'Announcing TypeScript 5.5' },\n ],\n },\n\n 'jashkenas/coffeescript': {\n owner: 'jashkenas',\n repo: 'coffeescript',\n packages: {\n coffeescript: { primary: true, filePatterns: ['*.coffee'] },\n },\n },\n\n 'gkz/LiveScript': {\n owner: 'gkz',\n repo: 'LiveScript',\n packages: {\n livescript: { primary: true, filePatterns: ['*.ls'] },\n },\n },\n\n 'elm/compiler': {\n owner: 'elm',\n repo: 'compiler',\n packages: {\n elm: { primary: true, filePatterns: ['*.elm'] },\n },\n },\n\n // ── CSS preprocessors ──\n\n 'sass/dart-sass': {\n owner: 'sass',\n repo: 'dart-sass',\n packages: {\n sass: { primary: true, filePatterns: ['*.scss', '*.sass'] },\n },\n },\n\n 'less/less.js': {\n owner: 'less',\n repo: 'less.js',\n packages: {\n less: { primary: true, filePatterns: ['*.less'] },\n },\n },\n\n 'stylus/stylus': {\n owner: 'stylus',\n repo: 'stylus',\n packages: {\n stylus: { primary: true, filePatterns: ['*.styl'] },\n },\n },\n\n 'postcss/postcss': {\n owner: 'postcss',\n repo: 'postcss',\n packages: {\n postcss: { primary: true, filePatterns: ['*.css', '*.pcss'] },\n },\n },\n\n // ── Template engines ──\n\n 'pugjs/pug': {\n owner: 'pugjs',\n repo: 'pug',\n packages: {\n pug: { primary: true, filePatterns: ['*.pug'] },\n },\n },\n\n 'mde/ejs': {\n owner: 'mde',\n repo: 'ejs',\n packages: {\n ejs: { primary: true, filePatterns: ['*.ejs'] },\n },\n },\n\n 'handlebars-lang/handlebars.js': {\n owner: 'handlebars-lang',\n repo: 'handlebars.js',\n packages: {\n handlebars: { primary: true, filePatterns: ['*.hbs', '*.handlebars'] },\n },\n },\n\n 'janl/mustache.js': {\n owner: 'janl',\n repo: 'mustache.js',\n packages: {\n mustache: { primary: true, filePatterns: ['*.mustache'] },\n },\n },\n\n 'mozilla/nunjucks': {\n owner: 'mozilla',\n repo: 'nunjucks',\n packages: {\n nunjucks: { primary: true, filePatterns: ['*.njk'] },\n },\n },\n\n 'Shopify/liquid': {\n owner: 'Shopify',\n repo: 'liquid',\n packages: {\n liquid: { primary: true, filePatterns: ['*.liquid'] },\n },\n },\n\n // ── Data formats ──\n\n 'eemeli/yaml': {\n owner: 'eemeli',\n repo: 'yaml',\n packages: {\n yaml: { primary: true, filePatterns: ['*.yaml', '*.yml'] },\n },\n },\n\n 'nodeca/js-yaml': {\n owner: 'nodeca',\n repo: 'js-yaml',\n packages: {\n 'js-yaml': { primary: true, filePatterns: ['*.yaml', '*.yml'] },\n },\n },\n\n 'BinaryMuse/toml-node': {\n owner: 'BinaryMuse',\n repo: 'toml-node',\n packages: {\n 'toml': { primary: true, filePatterns: ['*.toml'] },\n '@iarna/toml': { filePatterns: ['*.toml'] },\n },\n },\n\n 'json5/json5': {\n owner: 'json5',\n repo: 'json5',\n packages: {\n json5: { primary: true, filePatterns: ['*.json5'] },\n },\n },\n\n 'microsoft/node-jsonc-parser': {\n owner: 'microsoft',\n repo: 'node-jsonc-parser',\n packages: {\n 'jsonc-parser': { primary: true, filePatterns: ['*.jsonc'] },\n },\n },\n\n // ── Markdown ──\n\n 'markdown-it/markdown-it': {\n owner: 'markdown-it',\n repo: 'markdown-it',\n packages: {\n 'markdown-it': { primary: true, filePatterns: ['*.md'] },\n },\n },\n\n 'markedjs/marked': {\n owner: 'markedjs',\n repo: 'marked',\n packages: {\n marked: { primary: true, filePatterns: ['*.md'] },\n },\n },\n\n 'remarkjs/remark': {\n owner: 'remarkjs',\n repo: 'remark',\n packages: {\n remark: { primary: true, filePatterns: ['*.md', '*.mdx'] },\n },\n },\n\n 'mdx-js/mdx': {\n owner: 'mdx-js',\n repo: 'mdx',\n packages: {\n '@mdx-js/mdx': { primary: true, filePatterns: ['*.mdx'] },\n },\n },\n\n // ── GraphQL ──\n\n 'graphql/graphql-js': {\n owner: 'graphql',\n repo: 'graphql-js',\n packages: {\n 'graphql': { primary: true, filePatterns: ['*.graphql', '*.gql'] },\n 'graphql-tag': { filePatterns: ['*.graphql', '*.gql'] },\n },\n },\n\n 'dotansimha/graphql-code-generator': {\n owner: 'dotansimha',\n repo: 'graphql-code-generator',\n packages: {\n '@graphql-codegen/cli': { primary: true, filePatterns: ['*.graphql', '*.gql'] },\n },\n },\n\n // ── UI Frameworks ──\n\n 'quasarframework/quasar': {\n owner: 'quasarframework',\n repo: 'quasar',\n docsPath: 'docs/src/pages',\n docsRef: 'dev',\n homepage: 'https://quasar.dev',\n packages: {\n quasar: { primary: true },\n },\n },\n\n // ── Animation ──\n\n 'motiondivision/motion-vue': {\n owner: 'motiondivision',\n repo: 'motion-vue',\n homepage: 'https://motion.dev',\n crawlUrl: 'https://motion.dev/docs/vue**',\n packages: {\n 'motion-v': { primary: true },\n },\n },\n\n // ── Other ──\n\n 'prisma/prisma': {\n owner: 'prisma',\n repo: 'prisma',\n packages: {\n 'prisma': { primary: true, filePatterns: ['*.prisma'] },\n '@prisma/client': { filePatterns: ['*.prisma'] },\n },\n },\n\n 'nicolo-ribaudo/tc39-proposal-wasm-esm-integration': {\n owner: 'nicolo-ribaudo',\n repo: 'tc39-proposal-wasm-esm-integration',\n packages: {\n 'wasm-pack': { primary: true, filePatterns: ['*.wasm'] },\n },\n },\n}\n\n// ── Reverse index (auto-generated) ──\n\nconst PACKAGE_TO_REPO_MAP: Record<string, string> = {}\n\nfor (const [repoKey, entry] of Object.entries(REPO_REGISTRY)) {\n for (const packageName of Object.keys(entry.packages)) {\n PACKAGE_TO_REPO_MAP[packageName] = repoKey\n }\n}\n\n// ── Backwards-compatible helpers ──\n\nexport function getDocOverride(packageName: string): DocOverride | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n const entry = REPO_REGISTRY[repoKey]\n if (!entry?.docsRepo && !entry?.docsPath)\n return undefined\n\n return {\n owner: entry.owner,\n repo: entry.docsRepo || entry.repo,\n path: entry.docsPath || '',\n ref: entry.docsRef,\n homepage: entry.homepage,\n }\n}\n\nexport function getBlogPreset(packageName: string): BlogPreset | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n const entry = REPO_REGISTRY[repoKey]\n if (!entry?.blogReleases)\n return undefined\n\n return {\n packageName,\n releases: entry.blogReleases,\n }\n}\n\nexport function getFilePatterns(packageName: string): string[] | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n return REPO_REGISTRY[repoKey]?.packages[packageName]?.filePatterns\n}\n\n// ── New APIs ──\n\nexport function getRepoEntry(repoKey: string): RepoEntry | undefined {\n return REPO_REGISTRY[repoKey]\n}\n\nexport function getRepoKeyForPackage(packageName: string): string | undefined {\n return PACKAGE_TO_REPO_MAP[packageName]\n}\n\nexport function getPackageRules(packageName: string): string[] {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return []\n return REPO_REGISTRY[repoKey]?.packages[packageName]?.rules ?? []\n}\n\nexport function getPrereleaseChangelogRef(packageName: string): string | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n return REPO_REGISTRY[repoKey]?.prereleaseChangelogRef\n}\n\nexport function getCrawlUrl(packageName: string): string | undefined {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return undefined\n return REPO_REGISTRY[repoKey]?.crawlUrl\n}\n\nexport function getRelatedPackages(packageName: string): string[] {\n const repoKey = PACKAGE_TO_REPO_MAP[packageName]\n if (!repoKey)\n return []\n const entry = REPO_REGISTRY[repoKey]\n if (!entry)\n return []\n return Object.keys(entry.packages)\n}\n","import { execSync } from 'node:child_process'\nimport { existsSync } from 'node:fs'\nimport { join } from 'pathe'\nimport { diff as _semverDiff, gt as _semverGt, valid as _semverValid } from 'semver'\nimport { isWindows } from 'std-env'\n\n/** Get-or-create for Maps. Polyfill for Map.getOrInsertComputed (not yet in Node.js). */\nexport function mapInsert<K, V>(map: Map<K, V>, key: K, create: () => V): V {\n let val = map.get(key)\n if (val === undefined) {\n val = create()\n map.set(key, val)\n }\n return val\n}\n\n/** Returns the cleaned version if valid semver, null otherwise. */\nexport function semverValid(v: string): string | null {\n return _semverValid(v, true)\n}\n\n/** Compare two semver strings: returns true if a > b. Handles prereleases. */\nexport function semverGt(a: string, b: string): boolean {\n return _semverGt(a, b, true)\n}\n\n/** Returns the semver diff type between two versions (e.g. 'major', 'minor', 'patch', 'prerelease'), or null if equal/invalid. */\nexport function semverDiff(a: string, b: string): string | null {\n return _semverDiff(a, b)\n}\n\nlet _skilldCommand: string | undefined\n\n/** Resolve the skilld CLI command — returns `skilld` if the binary is in PATH, otherwise `npx -y skilld` */\nexport function resolveSkilldCommand(): string {\n if (_skilldCommand !== undefined)\n return _skilldCommand\n try {\n const lookup = isWindows ? 'where' : 'which'\n execSync(`${lookup} skilld`, { stdio: 'ignore' })\n _skilldCommand = 'skilld'\n }\n catch {\n _skilldCommand = 'npx -y skilld'\n }\n return _skilldCommand\n}\n\nexport const SHARED_SKILLS_DIR = '.skills'\n\n/** Returns the shared skills directory path if `.skills/` exists at project root, else null */\nexport function getSharedSkillsDir(cwd: string = process.cwd()): string | null {\n const dir = join(cwd, SHARED_SKILLS_DIR)\n return existsSync(dir) ? dir : null\n}\n"],"mappings":";;;;;AAyDA,MAAM,gBAA2C;CAG/C,cAAc;EACZ,OAAO;EACP,MAAM;EACN,UAAU;EACV,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