skilld 0.6.2 → 0.8.1

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.
Files changed (42) hide show
  1. package/README.md +42 -17
  2. package/dist/agent/index.d.mts +1 -309
  3. package/dist/agent/index.mjs +1 -5
  4. package/dist/cache/index.d.mts +1 -2
  5. package/dist/cache/index.mjs +1 -3
  6. package/dist/cli.d.mts +1 -1
  7. package/dist/cli.mjs +1 -4062
  8. package/dist/index.d.mts +1 -6
  9. package/dist/index.mjs +1 -8
  10. package/dist/retriv/index.d.mts +1 -26
  11. package/dist/retriv/index.mjs +1 -105
  12. package/dist/retriv/worker.d.mts +1 -33
  13. package/dist/retriv/worker.mjs +1 -47
  14. package/dist/sources/index.d.mts +1 -2
  15. package/dist/sources/index.mjs +1 -4
  16. package/dist/types.d.mts +1 -6
  17. package/dist/types.mjs +1 -1
  18. package/package.json +8 -8
  19. package/dist/_chunks/config.mjs +0 -25
  20. package/dist/_chunks/config.mjs.map +0 -1
  21. package/dist/_chunks/detect-imports.mjs +0 -1925
  22. package/dist/_chunks/detect-imports.mjs.map +0 -1
  23. package/dist/_chunks/npm.mjs +0 -1828
  24. package/dist/_chunks/npm.mjs.map +0 -1
  25. package/dist/_chunks/pool2.mjs +0 -120
  26. package/dist/_chunks/pool2.mjs.map +0 -1
  27. package/dist/_chunks/storage.mjs +0 -457
  28. package/dist/_chunks/storage.mjs.map +0 -1
  29. package/dist/_chunks/types.d.mts +0 -90
  30. package/dist/_chunks/types.d.mts.map +0 -1
  31. package/dist/_chunks/utils.d.mts +0 -529
  32. package/dist/_chunks/utils.d.mts.map +0 -1
  33. package/dist/_chunks/version.d.mts +0 -153
  34. package/dist/_chunks/version.d.mts.map +0 -1
  35. package/dist/_chunks/yaml.mjs +0 -415
  36. package/dist/_chunks/yaml.mjs.map +0 -1
  37. package/dist/agent/index.d.mts.map +0 -1
  38. package/dist/cli.mjs.map +0 -1
  39. package/dist/retriv/index.d.mts.map +0 -1
  40. package/dist/retriv/index.mjs.map +0 -1
  41. package/dist/retriv/worker.d.mts.map +0 -1
  42. package/dist/retriv/worker.mjs.map +0 -1
@@ -1,529 +0,0 @@
1
- import * as ofetch$1 from "ofetch";
2
-
3
- //#region src/sources/blog-releases.d.ts
4
- interface CachedDoc$1 {
5
- path: string;
6
- content: string;
7
- }
8
- /**
9
- * Fetch blog release notes from package presets
10
- * Filters to only releases matching or older than the installed version
11
- * Returns CachedDoc[] with releases/blog-{version}.md files
12
- */
13
- declare function fetchBlogReleases(packageName: string, installedVersion: string): Promise<CachedDoc$1[]>;
14
- //#endregion
15
- //#region src/sources/discussions.d.ts
16
- /**
17
- * GitHub discussions fetching via gh CLI GraphQL
18
- * Prioritizes Q&A and Help categories, includes accepted answers
19
- */
20
- interface DiscussionComment {
21
- body: string;
22
- author: string;
23
- }
24
- interface GitHubDiscussion {
25
- number: number;
26
- title: string;
27
- body: string;
28
- category: string;
29
- createdAt: string;
30
- url: string;
31
- upvoteCount: number;
32
- comments: number;
33
- answer?: string;
34
- topComments: DiscussionComment[];
35
- }
36
- /**
37
- * Fetch discussions from a GitHub repo using gh CLI GraphQL.
38
- * Prioritizes Q&A and Help categories. Includes accepted answer body for answered discussions.
39
- */
40
- declare function fetchGitHubDiscussions(owner: string, repo: string, limit?: number, releasedAt?: string): Promise<GitHubDiscussion[]>;
41
- /**
42
- * Format a single discussion as markdown with YAML frontmatter
43
- */
44
- declare function formatDiscussionAsMarkdown(d: GitHubDiscussion): string;
45
- /**
46
- * Generate a summary index of all discussions for quick LLM scanning.
47
- * Groups by category so the LLM can quickly find Q&A vs general discussions.
48
- */
49
- declare function generateDiscussionIndex(discussions: GitHubDiscussion[]): string;
50
- //#endregion
51
- //#region src/sources/entries.d.ts
52
- interface EntryFile {
53
- path: string;
54
- content: string;
55
- type: 'types' | 'source';
56
- }
57
- /**
58
- * Glob .d.ts type definition files from a package directory, skipping junk.
59
- */
60
- declare function resolveEntryFiles(packageDir: string): Promise<EntryFile[]>;
61
- //#endregion
62
- //#region src/sources/git-skills.d.ts
63
- /**
64
- * Git repo skill source — parse inputs + fetch pre-authored skills from repos
65
- *
66
- * Supports GitHub shorthand (owner/repo), full URLs, SSH, GitLab, and local paths.
67
- * Skills are pre-authored SKILL.md files — no doc resolution or LLM generation needed.
68
- */
69
- interface GitSkillSource {
70
- type: 'github' | 'gitlab' | 'git-ssh' | 'local';
71
- owner?: string;
72
- repo?: string;
73
- /** Direct path to a specific skill (from /tree/ref/path URLs) */
74
- skillPath?: string;
75
- /** Branch/tag parsed from URL */
76
- ref?: string;
77
- /** Absolute path for local sources */
78
- localPath?: string;
79
- }
80
- interface RemoteSkill {
81
- /** From SKILL.md frontmatter `name` field, or directory name */
82
- name: string;
83
- /** From SKILL.md frontmatter `description` field */
84
- description: string;
85
- /** Path within repo (e.g., "skills/web-design-guidelines") */
86
- path: string;
87
- /** Full SKILL.md content */
88
- content: string;
89
- /** Supporting files (scripts/, references/, assets/) */
90
- files: Array<{
91
- path: string;
92
- content: string;
93
- }>;
94
- }
95
- /**
96
- * Detect whether an input string is a git skill source.
97
- * Returns null for npm package names (including scoped @scope/pkg).
98
- */
99
- declare function parseGitSkillInput(input: string): GitSkillSource | null;
100
- /**
101
- * Parse name and description from SKILL.md frontmatter.
102
- */
103
- declare function parseSkillFrontmatterName(content: string): {
104
- name?: string;
105
- description?: string;
106
- };
107
- /**
108
- * Fetch skills from a git source. Returns list of discovered skills + commit SHA.
109
- */
110
- declare function fetchGitSkills(source: GitSkillSource, onProgress?: (msg: string) => void): Promise<{
111
- skills: RemoteSkill[];
112
- commitSha?: string;
113
- }>;
114
- //#endregion
115
- //#region src/sources/types.d.ts
116
- /**
117
- * Doc resolver types
118
- */
119
- interface NpmPackageInfo {
120
- name: string;
121
- version?: string;
122
- description?: string;
123
- homepage?: string;
124
- repository?: string | {
125
- type: string;
126
- url: string;
127
- directory?: string;
128
- };
129
- readme?: string;
130
- dependencies?: Record<string, string>;
131
- devDependencies?: Record<string, string>;
132
- peerDependencies?: Record<string, string>;
133
- }
134
- interface ResolvedPackage {
135
- name: string;
136
- version?: string;
137
- /** ISO date string when this version was released */
138
- releasedAt?: string;
139
- description?: string;
140
- /** Production dependencies with version specifiers */
141
- dependencies?: Record<string, string>;
142
- /** npm dist-tags with version and release date */
143
- distTags?: Record<string, {
144
- version: string;
145
- releasedAt?: string;
146
- }>;
147
- docsUrl?: string;
148
- llmsUrl?: string;
149
- readmeUrl?: string;
150
- repoUrl?: string;
151
- /** Git docs folder - versioned docs from repo */
152
- gitDocsUrl?: string;
153
- /** Git tag/ref used for gitDocsUrl */
154
- gitRef?: string;
155
- /** True when gitRef is a branch fallback (no version tag found) */
156
- gitDocsFallback?: boolean;
157
- }
158
- interface LocalDependency {
159
- name: string;
160
- version: string;
161
- }
162
- interface LlmsContent {
163
- raw: string;
164
- /** Markdown links extracted from llms.txt */
165
- links: LlmsLink[];
166
- }
167
- interface LlmsLink {
168
- title: string;
169
- url: string;
170
- }
171
- interface FetchedDoc {
172
- url: string;
173
- title: string;
174
- content: string;
175
- }
176
- interface ResolveAttempt {
177
- source: 'npm' | 'github-docs' | 'github-meta' | 'github-search' | 'llms.txt' | 'readme';
178
- url?: string;
179
- status: 'success' | 'not-found' | 'error';
180
- message?: string;
181
- }
182
- interface ResolveResult {
183
- package: ResolvedPackage | null;
184
- attempts: ResolveAttempt[];
185
- }
186
- //#endregion
187
- //#region src/sources/github.d.ts
188
- /** Minimum git-doc file count to prefer over llms.txt */
189
- declare const MIN_GIT_DOCS = 5;
190
- /** True when git-docs exist but are too few to be useful (< MIN_GIT_DOCS) */
191
- declare const isShallowGitDocs: (n: number) => boolean;
192
- interface GitDocsResult {
193
- /** URL pattern for fetching docs (use with ref) */
194
- baseUrl: string;
195
- /** Git ref (tag) used */
196
- ref: string;
197
- /** List of doc file paths relative to repo root */
198
- files: string[];
199
- /** Prefix to strip when normalizing paths to docs/ (e.g. 'apps/evalite-docs/src/content/') for nested monorepo docs */
200
- docsPrefix?: string;
201
- /** Full repo file tree — only set when discoverDocFiles() heuristic was used (not standard docs/ prefix) */
202
- allFiles?: string[];
203
- /** True when ref is a branch (main/master) rather than a version-specific tag */
204
- fallback?: boolean;
205
- }
206
- /**
207
- * Fetch versioned docs from GitHub repo's docs/ folder.
208
- * Pass packageName to check doc overrides (e.g. vue -> vuejs/docs).
209
- */
210
- declare function fetchGitDocs(owner: string, repo: string, version: string, packageName?: string, repoUrl?: string): Promise<GitDocsResult | null>;
211
- /**
212
- * Validate that discovered git docs are relevant by cross-referencing llms.txt links
213
- * against the repo file tree. Uses extensionless suffix matching to handle monorepo nesting.
214
- *
215
- * Returns { isValid, matchRatio } where isValid = matchRatio >= 0.3
216
- */
217
- declare function validateGitDocsWithLlms(llmsLinks: LlmsLink[], repoFiles: string[]): {
218
- isValid: boolean;
219
- matchRatio: number;
220
- };
221
- /**
222
- * Fetch GitHub repo metadata to get website URL.
223
- * Pass packageName to check doc overrides first (avoids API call).
224
- */
225
- declare function fetchGitHubRepoMeta(owner: string, repo: string, packageName?: string): Promise<{
226
- homepage?: string;
227
- } | null>;
228
- /**
229
- * Resolve README URL for a GitHub repo, returns ungh:// pseudo-URL or raw URL
230
- */
231
- declare function fetchReadme(owner: string, repo: string, subdir?: string, ref?: string): Promise<string | null>;
232
- /**
233
- * Fetch README content from ungh:// pseudo-URL, file:// URL, or regular URL
234
- */
235
- declare function fetchReadmeContent(url: string): Promise<string | null>;
236
- //#endregion
237
- //#region src/sources/issues.d.ts
238
- /**
239
- * GitHub issues fetching via gh CLI Search API
240
- * Sorted by reactions (upvotes), 75% open / 25% closed (within last year)
241
- * Categorized by labels, noise filtered out
242
- */
243
- type IssueType = 'bug' | 'question' | 'docs' | 'feature' | 'other';
244
- interface IssueComment {
245
- body: string;
246
- author: string;
247
- reactions: number;
248
- }
249
- interface GitHubIssue {
250
- number: number;
251
- title: string;
252
- state: string;
253
- labels: string[];
254
- body: string;
255
- createdAt: string;
256
- url: string;
257
- reactions: number;
258
- comments: number;
259
- type: IssueType;
260
- topComments: IssueComment[];
261
- }
262
- /**
263
- * Check if gh CLI is installed and authenticated (cached)
264
- */
265
- declare function isGhAvailable(): boolean;
266
- /**
267
- * Fetch issues from a GitHub repo sorted by reactions (upvotes).
268
- * Returns 75% open issues + 25% recently closed issues (within last year).
269
- * Filters noise (duplicates, stale, tracking) and deprioritizes feature requests.
270
- * Enriches top issues with their most-reacted comments via GraphQL.
271
- */
272
- declare function fetchGitHubIssues(owner: string, repo: string, limit?: number, releasedAt?: string): Promise<GitHubIssue[]>;
273
- /**
274
- * Format a single issue as markdown with YAML frontmatter
275
- */
276
- declare function formatIssueAsMarkdown(issue: GitHubIssue): string;
277
- /**
278
- * Generate a summary index of all issues for quick LLM scanning.
279
- * Groups by type so the LLM can quickly find bugs vs questions.
280
- */
281
- declare function generateIssueIndex(issues: GitHubIssue[]): string;
282
- //#endregion
283
- //#region src/sources/llms.d.ts
284
- /**
285
- * Check for llms.txt at a docs URL, returns the llms.txt URL if found
286
- */
287
- declare function fetchLlmsUrl(docsUrl: string): Promise<string | null>;
288
- /**
289
- * Fetch and parse llms.txt content
290
- */
291
- declare function fetchLlmsTxt(url: string): Promise<LlmsContent | null>;
292
- /**
293
- * Parse markdown links from llms.txt to get .md file paths
294
- */
295
- declare function parseMarkdownLinks(content: string): LlmsLink[];
296
- declare function downloadLlmsDocs(llmsContent: LlmsContent, baseUrl: string, onProgress?: (url: string, index: number, total: number) => void): Promise<FetchedDoc[]>;
297
- /**
298
- * Normalize llms.txt links to relative paths for local access
299
- * Handles: absolute URLs, root-relative paths, and relative paths
300
- */
301
- declare function normalizeLlmsLinks(content: string, baseUrl?: string): string;
302
- /**
303
- * Extract sections from llms-full.txt by URL patterns
304
- * Format: ---\nurl: /path.md\n---\n<content>\n\n---\nurl: ...
305
- */
306
- declare function extractSections(content: string, patterns: string[]): string | null;
307
- //#endregion
308
- //#region src/sources/npm.d.ts
309
- /**
310
- * Search npm registry for packages matching a query.
311
- * Used as a fallback when direct package lookup fails.
312
- */
313
- declare function searchNpmPackages(query: string, size?: number): Promise<Array<{
314
- name: string;
315
- description?: string;
316
- version: string;
317
- }>>;
318
- /**
319
- * Fetch package info from npm registry
320
- */
321
- declare function fetchNpmPackage(packageName: string): Promise<NpmPackageInfo | null>;
322
- interface DistTagInfo {
323
- version: string;
324
- releasedAt?: string;
325
- }
326
- interface NpmRegistryMeta {
327
- releasedAt?: string;
328
- distTags?: Record<string, DistTagInfo>;
329
- }
330
- /**
331
- * Fetch release date and dist-tags from npm registry
332
- */
333
- declare function fetchNpmRegistryMeta(packageName: string, version: string): Promise<NpmRegistryMeta>;
334
- type ResolveStep = 'npm' | 'github-docs' | 'github-meta' | 'github-search' | 'readme' | 'llms.txt' | 'local';
335
- interface ResolveOptions {
336
- /** User's installed version - used to fetch versioned git docs */
337
- version?: string;
338
- /** Current working directory - for local readme fallback */
339
- cwd?: string;
340
- /** Progress callback - called before each resolution step */
341
- onProgress?: (step: ResolveStep) => void;
342
- }
343
- /**
344
- * Resolve documentation URL for a package (legacy - returns null on failure)
345
- */
346
- declare function resolvePackageDocs(packageName: string, options?: ResolveOptions): Promise<ResolvedPackage | null>;
347
- /**
348
- * Resolve documentation URL for a package with attempt tracking
349
- */
350
- declare function resolvePackageDocsWithAttempts(packageName: string, options?: ResolveOptions): Promise<ResolveResult>;
351
- /**
352
- * Parse version specifier, handling protocols like link:, workspace:, npm:, file:
353
- */
354
- declare function parseVersionSpecifier(name: string, version: string, cwd: string): LocalDependency | null;
355
- /**
356
- * Resolve the actual installed version of a package by finding its package.json
357
- * via mlly's resolvePathSync. Works regardless of package manager or version protocol.
358
- */
359
- declare function resolveInstalledVersion(name: string, cwd: string): string | null;
360
- /**
361
- * Read package.json dependencies with versions
362
- */
363
- declare function readLocalDependencies(cwd: string): Promise<LocalDependency[]>;
364
- interface LocalPackageInfo {
365
- name: string;
366
- version: string;
367
- description?: string;
368
- repoUrl?: string;
369
- localPath: string;
370
- }
371
- /**
372
- * Read package info from a local path (for link: deps)
373
- */
374
- declare function readLocalPackageInfo(localPath: string): LocalPackageInfo | null;
375
- /**
376
- * Resolve docs for a local package (link: dependency)
377
- */
378
- declare function resolveLocalPackageDocs(localPath: string): Promise<ResolvedPackage | null>;
379
- /**
380
- * Download and extract npm package tarball to cache directory.
381
- * Used when the package isn't available in node_modules.
382
- *
383
- * Extracts to: ~/.skilld/references/<pkg>@<version>/pkg/
384
- * Returns the extracted directory path, or null on failure.
385
- */
386
- declare function fetchPkgDist(name: string, version: string): Promise<string | null>;
387
- /**
388
- * Fetch just the latest version string from npm (lightweight)
389
- */
390
- declare function fetchLatestVersion(packageName: string): Promise<string | null>;
391
- /**
392
- * Get installed skill version from SKILL.md
393
- */
394
- declare function getInstalledSkillVersion(skillDir: string): string | null;
395
- //#endregion
396
- //#region src/sources/package-registry.d.ts
397
- /**
398
- * Unified package registry — single source of truth for package metadata.
399
- * Consolidates doc overrides, blog presets, and file patterns.
400
- * Keyed by GitHub 'owner/repo' (source code repo).
401
- */
402
- interface BlogRelease {
403
- version: string;
404
- url: string;
405
- date: string;
406
- title?: string;
407
- }
408
- interface PackageEntry {
409
- filePatterns?: string[];
410
- primary?: boolean;
411
- }
412
- interface RepoEntry {
413
- owner: string;
414
- repo: string;
415
- /** Separate docs repo name (e.g. 'docs' → owner/docs) */
416
- docsRepo?: string;
417
- /** Path prefix to filter markdown files */
418
- docsPath?: string;
419
- /** Branch/ref override */
420
- docsRef?: string;
421
- /** Homepage URL */
422
- homepage?: string;
423
- /** Packages in this repo */
424
- packages: Record<string, PackageEntry>;
425
- /** Curated blog release posts */
426
- blogReleases?: BlogRelease[];
427
- }
428
- interface DocOverride {
429
- owner: string;
430
- repo: string;
431
- path: string;
432
- ref?: string;
433
- homepage?: string;
434
- }
435
- interface BlogPreset {
436
- packageName: string;
437
- releases: BlogRelease[];
438
- }
439
- declare function getDocOverride(packageName: string): DocOverride | undefined;
440
- declare function getBlogPreset(packageName: string): BlogPreset | undefined;
441
- declare function getFilePatterns(packageName: string): string[] | undefined;
442
- declare function getRepoEntry(repoKey: string): RepoEntry | undefined;
443
- declare function getRepoKeyForPackage(packageName: string): string | undefined;
444
- declare function getRelatedPackages(packageName: string): string[];
445
- //#endregion
446
- //#region src/sources/releases.d.ts
447
- /**
448
- * GitHub release notes fetching via gh CLI (preferred) with ungh.cc fallback
449
- */
450
- interface GitHubRelease {
451
- id: number;
452
- tag: string;
453
- name: string;
454
- prerelease: boolean;
455
- createdAt: string;
456
- publishedAt: string;
457
- markdown: string;
458
- }
459
- interface CachedDoc {
460
- path: string;
461
- content: string;
462
- }
463
- interface SemVer {
464
- major: number;
465
- minor: number;
466
- patch: number;
467
- raw: string;
468
- }
469
- declare function parseSemver(version: string): SemVer | null;
470
- declare function compareSemver(a: SemVer, b: SemVer): number;
471
- interface ReleaseIndexOptions {
472
- releases: GitHubRelease[];
473
- packageName?: string;
474
- blogReleases?: Array<{
475
- version: string;
476
- title: string;
477
- date: string;
478
- }>;
479
- hasChangelog?: boolean;
480
- }
481
- /**
482
- * Generate a unified summary index of all releases for quick LLM scanning.
483
- * Includes GitHub releases, blog release posts, and CHANGELOG link.
484
- */
485
- declare function generateReleaseIndex(releasesOrOpts: GitHubRelease[] | ReleaseIndexOptions, packageName?: string): string;
486
- /**
487
- * Fetch release notes for a package. Returns CachedDoc[] with releases/{tag}.md files.
488
- *
489
- * Strategy:
490
- * 1. Fetch GitHub releases, filter to package-specific tags for monorepos
491
- * 2. If no releases found, try CHANGELOG.md as fallback
492
- */
493
- declare function fetchReleaseNotes(owner: string, repo: string, installedVersion: string, gitRef?: string, packageName?: string): Promise<CachedDoc[]>;
494
- //#endregion
495
- //#region src/sources/utils.d.ts
496
- /**
497
- * Shared utilities for doc resolution
498
- */
499
- declare const $fetch: ofetch$1.$Fetch;
500
- /**
501
- * Fetch text content from URL
502
- */
503
- declare function fetchText(url: string): Promise<string | null>;
504
- /**
505
- * Verify URL exists and is not HTML (likely 404 page)
506
- */
507
- declare function verifyUrl(url: string): Promise<boolean>;
508
- /**
509
- * Check if URL is a GitHub repo URL (not a docs site)
510
- */
511
- declare function isGitHubRepoUrl(url: string): boolean;
512
- /**
513
- * Parse owner/repo from GitHub URL
514
- */
515
- declare function parseGitHubUrl(url: string): {
516
- owner: string;
517
- repo: string;
518
- } | null;
519
- /**
520
- * Normalize git repo URL to https
521
- */
522
- declare function normalizeRepoUrl(url: string): string;
523
- /**
524
- * Extract branch hint from URL fragment (e.g. "git+https://...#main" → "main")
525
- */
526
- declare function extractBranchHint(url: string): string | undefined;
527
- //#endregion
528
- export { fetchGitDocs as $, fetchPkgDist as A, downloadLlmsDocs as B, getRepoKeyForPackage as C, generateDiscussionIndex as Ct, fetchLatestVersion as D, ResolveStep as E, resolveInstalledVersion as F, parseMarkdownLinks as G, fetchLlmsTxt as H, resolveLocalPackageDocs as I, formatIssueAsMarkdown as J, GitHubIssue as K, resolvePackageDocs as L, parseVersionSpecifier as M, readLocalDependencies as N, fetchNpmPackage as O, readLocalPackageInfo as P, MIN_GIT_DOCS as Q, resolvePackageDocsWithAttempts as R, getRepoEntry as S, formatDiscussionAsMarkdown as St, ResolveOptions as T, fetchLlmsUrl as U, extractSections as V, normalizeLlmsLinks as W, isGhAvailable as X, generateIssueIndex as Y, GitDocsResult as Z, DocOverride as _, parseSkillFrontmatterName as _t, normalizeRepoUrl as a, FetchedDoc as at, getFilePatterns as b, GitHubDiscussion as bt, GitHubRelease as c, LocalDependency as ct, compareSemver as d, ResolveResult as dt, fetchGitHubRepoMeta as et, fetchReleaseNotes as f, ResolvedPackage as ft, BlogRelease as g, parseGitSkillInput as gt, BlogPreset as h, fetchGitSkills as ht, isGitHubRepoUrl as i, validateGitDocsWithLlms as it, getInstalledSkillVersion as j, fetchNpmRegistryMeta as k, ReleaseIndexOptions as l, NpmPackageInfo as lt, parseSemver as m, RemoteSkill as mt, extractBranchHint as n, fetchReadmeContent as nt, parseGitHubUrl as o, LlmsContent as ot, generateReleaseIndex as p, GitSkillSource as pt, fetchGitHubIssues as q, fetchText as r, isShallowGitDocs as rt, verifyUrl as s, LlmsLink as st, $fetch as t, fetchReadme as tt, SemVer as u, ResolveAttempt as ut, getBlogPreset as v, EntryFile as vt, LocalPackageInfo as w, fetchBlogReleases as wt, getRelatedPackages as x, fetchGitHubDiscussions as xt, getDocOverride as y, resolveEntryFiles as yt, searchNpmPackages as z };
529
- //# sourceMappingURL=utils.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.mts","names":[],"sources":["../../src/sources/blog-releases.ts","../../src/sources/discussions.ts","../../src/sources/entries.ts","../../src/sources/git-skills.ts","../../src/sources/types.ts","../../src/sources/github.ts","../../src/sources/issues.ts","../../src/sources/llms.ts","../../src/sources/npm.ts","../../src/sources/package-registry.ts","../../src/sources/releases.ts","../../src/sources/utils.ts"],"mappings":";;;UAmBU,WAAA;EACR,IAAA;EACA,OAAA;AAAA;;;;;;iBA0GoB,iBAAA,CACpB,WAAA,UACA,gBAAA,WACC,OAAA,CAAQ,WAAA;;;;;;AAjHV;UCMgB,iBAAA;EACf,IAAA;EACA,MAAA;AAAA;AAAA,UAGe,gBAAA;EACf,MAAA;EACA,KAAA;EACA,IAAA;EACA,QAAA;EACA,SAAA;EACA,GAAA;EACA,WAAA;EACA,QAAA;EACA,MAAA;EACA,WAAA,EAAa,iBAAA;AAAA;;AAff;;;iBAsBsB,sBAAA,CACpB,KAAA,UACA,IAAA,UACA,KAAA,WACA,UAAA,YACC,OAAA,CAAQ,gBAAA;;AAtBX;;iBA6FgB,0BAAA,CAA2B,CAAA,EAAG,gBAAA;;;;;iBA+C9B,uBAAA,CAAwB,WAAA,EAAa,gBAAA;;;UChKpC,SAAA;EACf,IAAA;EACA,OAAA;EACA,IAAA;AAAA;;;;iBAoCoB,iBAAA,CAAkB,UAAA,WAAqB,OAAA,CAAQ,SAAA;;;;;;AF9BpE;;;UGJgB,cAAA;EACf,IAAA;EACA,KAAA;EACA,IAAA;;EAEA,SAAA;EH8GA;EG5GA,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AoH3B,mBAAA;EACf,QAAA,EAAU,aAAA;EACV,WAAA;EACA,YAAA,GAAe,KAAA;IAAQ,OAAA;IAAiB,KAAA;IAAe,IAAA;EAAA;EACvD,YAAA;AAAA;;;AT5JF;;iBSmKgB,oBAAA,CAAqB,cAAA,EAAgB,aAAA,KAAkB,mBAAA,EAAqB,WAAA;;;;;ATvF5F;;;iBS8KsB,iBAAA,CACpB,KAAA,UACA,IAAA,UACA,gBAAA,UACA,MAAA,WACA,WAAA,YACC,OAAA,CAAQ,SAAA;;;;;;cCvSE,MAAA,EAKX,QAAA,CALiB,MAAA;;;;iBAUG,SAAA,CAAU,GAAA,WAAc,OAAA;AX+G9C;;;AAAA,iBWxGsB,SAAA,CAAU,GAAA,WAAc,OAAA;;;;iBAkC9B,eAAA,CAAgB,GAAA;;;;iBAahB,cAAA,CAAe,GAAA;EAAgB,KAAA;EAAe,IAAA;AAAA;;;AV1C9D;iBUoDgB,gBAAA,CAAiB,GAAA;;;;iBAcjB,iBAAA,CAAkB,GAAA"}
@@ -1,153 +0,0 @@
1
- //#region src/cache/config.d.ts
2
- /**
3
- * Cache configuration
4
- */
5
- /** Global cache directory */
6
- declare const CACHE_DIR: string;
7
- /** References subdirectory */
8
- declare const REFERENCES_DIR: string;
9
- /** Get search DB path for a specific package@version */
10
- declare function getPackageDbPath(name: string, version: string): string;
11
- //#endregion
12
- //#region src/cache/types.d.ts
13
- /**
14
- * Cache types
15
- */
16
- interface CacheConfig {
17
- /** Package name */
18
- name: string;
19
- /** Package version (full semver) */
20
- version: string;
21
- }
22
- interface CachedPackage {
23
- name: string;
24
- version: string;
25
- dir: string;
26
- }
27
- interface CachedDoc {
28
- path: string;
29
- content: string;
30
- }
31
- //#endregion
32
- //#region src/cache/storage.d.ts
33
- /**
34
- * Check if package is cached at given version
35
- */
36
- declare function isCached(name: string, version: string): boolean;
37
- /**
38
- * Ensure cache directories exist
39
- */
40
- declare function ensureCacheDir(): void;
41
- /**
42
- * Write docs to cache, cleaning stale version dirs for the same package
43
- */
44
- declare function writeToCache(name: string, version: string, docs: CachedDoc[]): string;
45
- /**
46
- * Create symlink from .skilld dir to a cached subdirectory.
47
- * Unified handler for docs, issues, discussions, sections, releases.
48
- *
49
- * Structure:
50
- * .claude/skills/<skill>/.skilld/<subdir> -> ~/.skilld/references/<pkg>@<version>/<subdir>
51
- *
52
- * The .skilld/ dirs are gitignored. After clone, `skilld install` recreates from lockfile.
53
- */
54
- declare function linkCachedDir(skillDir: string, name: string, version: string, subdir: string): void;
55
- /**
56
- * Resolve the package directory: node_modules first, then cached dist fallback.
57
- * Returns the path if found, null otherwise.
58
- */
59
- declare function resolvePkgDir(name: string, cwd: string, version?: string): string | null;
60
- /**
61
- * Create symlink from .skilld dir to package directory
62
- *
63
- * Structure:
64
- * .claude/skills/<skill>/.skilld/pkg -> node_modules/<pkg> OR ~/.skilld/references/<pkg>@<version>/pkg
65
- *
66
- * This gives access to package.json, README.md, dist/, and any shipped docs/
67
- */
68
- declare function linkPkg(skillDir: string, name: string, cwd: string, version?: string): void;
69
- /**
70
- * Create named symlink from .skilld dir to package directory.
71
- * Short name = last segment of package name (e.g., @vue/reactivity → pkg-reactivity)
72
- *
73
- * Structure:
74
- * .claude/skills/<skill>/.skilld/pkg-<short> -> node_modules/<pkg>
75
- */
76
- declare function linkPkgNamed(skillDir: string, name: string, cwd: string, version?: string): void;
77
- /**
78
- * Get key files from a package directory for display
79
- * Returns entry points + docs files
80
- */
81
- declare function getPkgKeyFiles(name: string, cwd: string, version?: string): string[];
82
- /**
83
- * Check if package ships its own docs folder
84
- */
85
- interface ShippedSkill {
86
- skillName: string;
87
- skillDir: string;
88
- }
89
- /**
90
- * Check if package ships a skills/ directory with SKILL.md or _SKILL.md subdirs
91
- */
92
- declare function getShippedSkills(name: string, cwd: string, version?: string): ShippedSkill[];
93
- /**
94
- * Write LLM-generated section outputs to global cache for cross-project reuse
95
- *
96
- * Structure:
97
- * ~/.skilld/references/<pkg>@<version>/sections/_BEST_PRACTICES.md
98
- */
99
- declare function writeSections(name: string, version: string, sections: Array<{
100
- file: string;
101
- content: string;
102
- }>): void;
103
- /**
104
- * Read a cached section from the global references dir
105
- */
106
- declare function readCachedSection(name: string, version: string, file: string): string | null;
107
- /**
108
- * Create symlink from skills dir to shipped skill dir
109
- */
110
- declare function linkShippedSkill(baseDir: string, skillName: string, targetDir: string): void;
111
- declare function hasShippedDocs(name: string, cwd: string, version?: string): boolean;
112
- /**
113
- * List all cached packages
114
- */
115
- declare function listCached(): CachedPackage[];
116
- /**
117
- * Read cached docs for a package
118
- */
119
- declare function readCachedDocs(name: string, version: string): CachedDoc[];
120
- /**
121
- * Clear cache for a specific package
122
- */
123
- declare function clearCache(name: string, version: string): boolean;
124
- /**
125
- * Clear all cache
126
- */
127
- declare function clearAllCache(): number;
128
- /**
129
- * List files in .skilld directory (pkg + docs) as relative paths for prompt context
130
- * Returns paths like ./.skilld/pkg/README.md, ./.skilld/docs/api.md
131
- */
132
- declare function listReferenceFiles(skillDir: string, maxDepth?: number): string[];
133
- //#endregion
134
- //#region src/cache/version.d.ts
135
- /**
136
- * Version utilities
137
- */
138
- /**
139
- * Get exact version key for cache keying
140
- */
141
- declare function getVersionKey(version: string): string;
142
- /**
143
- * Get cache key for a package: name@version
144
- */
145
- declare function getCacheKey(name: string, version: string): string;
146
- /**
147
- * Get path to cached package references.
148
- * Validates name/version to prevent path traversal.
149
- */
150
- declare function getCacheDir(name: string, version: string): string;
151
- //#endregion
152
- export { CacheConfig as C, REFERENCES_DIR as D, CACHE_DIR as E, getPackageDbPath as O, writeToCache as S, CachedPackage as T, listReferenceFiles as _, clearAllCache as a, resolvePkgDir as b, getPkgKeyFiles as c, isCached as d, linkCachedDir as f, listCached as g, linkShippedSkill as h, ShippedSkill as i, getShippedSkills as l, linkPkgNamed as m, getCacheKey as n, clearCache as o, linkPkg as p, getVersionKey as r, ensureCacheDir as s, getCacheDir as t, hasShippedDocs as u, readCachedDocs as v, CachedDoc as w, writeSections as x, readCachedSection as y };
153
- //# sourceMappingURL=version.d.mts.map