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
package/dist/_chunks/index.d.mts
CHANGED
|
@@ -1,151 +1,344 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/** References subdirectory */
|
|
7
|
-
declare const REFERENCES_DIR: string;
|
|
8
|
-
/** Repo-level cache (issues, discussions, releases shared across monorepo packages) */
|
|
9
|
-
declare const REPOS_DIR: string;
|
|
10
|
-
/** Get repo cache dir for owner/repo with path traversal validation */
|
|
11
|
-
declare function getRepoCacheDir(owner: string, repo: string): string;
|
|
12
|
-
/** Get search DB path for a specific package@version */
|
|
13
|
-
declare function getPackageDbPath(name: string, version: string): string;
|
|
14
|
-
/**
|
|
15
|
-
* Cache types
|
|
16
|
-
*/
|
|
17
|
-
interface CacheConfig {
|
|
18
|
-
/** Package name */
|
|
19
|
-
name: string;
|
|
20
|
-
/** Package version (full semver) */
|
|
21
|
-
version: string;
|
|
1
|
+
interface FeaturesConfig {
|
|
2
|
+
search: boolean;
|
|
3
|
+
issues: boolean;
|
|
4
|
+
discussions: boolean;
|
|
5
|
+
releases: boolean;
|
|
22
6
|
}
|
|
23
|
-
interface
|
|
24
|
-
|
|
25
|
-
version: string;
|
|
26
|
-
dir: string;
|
|
7
|
+
interface SectionValidationWarning {
|
|
8
|
+
warning: string;
|
|
27
9
|
}
|
|
28
|
-
interface
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
interface CustomPrompt {
|
|
11
|
+
heading: string;
|
|
12
|
+
body: string;
|
|
31
13
|
}
|
|
32
|
-
|
|
33
|
-
declare
|
|
34
|
-
|
|
35
|
-
|
|
14
|
+
type SkillSection = 'api-changes' | 'best-practices' | 'custom';
|
|
15
|
+
declare const SECTION_OUTPUT_FILES: Record<SkillSection, string>;
|
|
16
|
+
declare const SECTION_MERGE_ORDER: SkillSection[];
|
|
17
|
+
/** Wrap section content with HTML comment markers for targeted re-assembly */
|
|
18
|
+
declare function wrapSection(section: SkillSection, content: string): string;
|
|
19
|
+
/** Extract marker-delimited sections from existing SKILL.md */
|
|
20
|
+
declare function extractMarkedSections(md: string): Map<SkillSection, {
|
|
21
|
+
start: number;
|
|
22
|
+
end: number;
|
|
23
|
+
}>;
|
|
24
|
+
interface BuildSkillPromptOptions {
|
|
25
|
+
packageName: string;
|
|
26
|
+
/** Absolute path to skill directory with ./.skilld/ */
|
|
36
27
|
skillDir: string;
|
|
28
|
+
/** Package version (e.g., "3.5.13") */
|
|
29
|
+
version?: string;
|
|
30
|
+
/** Has GitHub issues indexed */
|
|
31
|
+
hasIssues?: boolean;
|
|
32
|
+
/** Has GitHub discussions indexed */
|
|
33
|
+
hasDiscussions?: boolean;
|
|
34
|
+
/** Has release notes */
|
|
35
|
+
hasReleases?: boolean;
|
|
36
|
+
/** CHANGELOG filename if found in package (e.g. CHANGELOG.md, changelog.md) */
|
|
37
|
+
hasChangelog?: string | false;
|
|
38
|
+
/** Resolved absolute paths to .md doc files */
|
|
39
|
+
docFiles?: string[];
|
|
40
|
+
/** Doc source type */
|
|
41
|
+
docsType?: 'llms.txt' | 'readme' | 'docs';
|
|
42
|
+
/** Package ships its own docs */
|
|
43
|
+
hasShippedDocs?: boolean;
|
|
44
|
+
/** Custom instructions from the user (when 'custom' section selected) */
|
|
45
|
+
customPrompt?: CustomPrompt;
|
|
46
|
+
/** Resolved feature flags */
|
|
47
|
+
features?: FeaturesConfig;
|
|
48
|
+
/** Total number of enabled sections — adjusts per-section line budgets */
|
|
49
|
+
enabledSectionCount?: number;
|
|
50
|
+
/** Key files from the package (e.g., dist/pkg.d.ts) — surfaced in prompt for tool hints */
|
|
51
|
+
pkgFiles?: string[];
|
|
52
|
+
/** Lines consumed by SKILL.md overhead (frontmatter + header + search + footer) */
|
|
53
|
+
overheadLines?: number;
|
|
37
54
|
}
|
|
38
|
-
/** Check if package ships a skills/ directory with SKILL.md or _SKILL.md subdirs */
|
|
39
|
-
declare function getShippedSkills(name: string, cwd: string, version?: string): ShippedSkill[];
|
|
40
|
-
/** Create symlink from skills dir to shipped skill dir */
|
|
41
|
-
declare function linkShippedSkill(baseDir: string, skillName: string, targetDir: string): void;
|
|
42
55
|
/**
|
|
43
|
-
*
|
|
56
|
+
* Get the validate function for a section using default context (validators use fixed thresholds).
|
|
57
|
+
* Returns null if section has no validator.
|
|
44
58
|
*/
|
|
45
|
-
declare function
|
|
46
|
-
/** Check if cache only has docs/README.md (pkg/ already has this) */
|
|
47
|
-
declare function isReadmeOnlyCache(cacheDir: string): boolean;
|
|
48
|
-
declare function inferDocsTypeFromCache(cacheDir: string, source?: string): 'llms.txt' | 'readme' | 'docs';
|
|
59
|
+
declare function getSectionValidator(section: SkillSection): ((content: string) => SectionValidationWarning[]) | null;
|
|
49
60
|
/**
|
|
50
|
-
*
|
|
61
|
+
* Build prompt for a single section
|
|
51
62
|
*/
|
|
52
|
-
declare function
|
|
63
|
+
declare function buildSectionPrompt(opts: BuildSkillPromptOptions & {
|
|
64
|
+
section: SkillSection;
|
|
65
|
+
}): string;
|
|
53
66
|
/**
|
|
54
|
-
*
|
|
67
|
+
* Build prompts for all selected sections, sharing the computed preamble
|
|
55
68
|
*/
|
|
56
|
-
declare function
|
|
69
|
+
declare function buildAllSectionPrompts(opts: BuildSkillPromptOptions & {
|
|
70
|
+
sections: SkillSection[];
|
|
71
|
+
}): Map<SkillSection, string>;
|
|
57
72
|
/**
|
|
58
|
-
*
|
|
73
|
+
* Transform an agent-specific prompt into a portable prompt for any LLM.
|
|
74
|
+
* - Rewrites .skilld/ paths → ./references/
|
|
75
|
+
* - Strips ## Output section (file-writing instructions)
|
|
76
|
+
* - Strips skilld search/validate instructions
|
|
77
|
+
* - Replaces tool-specific language with generic equivalents
|
|
78
|
+
* - Strips agent-specific rules
|
|
59
79
|
*/
|
|
60
|
-
declare function
|
|
80
|
+
declare function portabilizePrompt(prompt: string, section?: SkillSection): string;
|
|
81
|
+
interface SkillOptions {
|
|
82
|
+
name: string;
|
|
83
|
+
version?: string;
|
|
84
|
+
releasedAt?: string;
|
|
85
|
+
/** npm dist-tags with version and release date */
|
|
86
|
+
distTags?: Record<string, {
|
|
87
|
+
version: string;
|
|
88
|
+
releasedAt?: string;
|
|
89
|
+
}>;
|
|
90
|
+
globs?: string[];
|
|
91
|
+
description?: string;
|
|
92
|
+
/** LLM-generated body — replaces default heading + description */
|
|
93
|
+
body?: string;
|
|
94
|
+
relatedSkills: string[];
|
|
95
|
+
hasIssues?: boolean;
|
|
96
|
+
hasDiscussions?: boolean;
|
|
97
|
+
hasReleases?: boolean;
|
|
98
|
+
hasChangelog?: string | false;
|
|
99
|
+
docsType?: 'llms.txt' | 'readme' | 'docs';
|
|
100
|
+
hasShippedDocs?: boolean;
|
|
101
|
+
/** Key files in package (entry points + docs) */
|
|
102
|
+
pkgFiles?: string[];
|
|
103
|
+
/** Model used to generate LLM sections */
|
|
104
|
+
generatedBy?: string;
|
|
105
|
+
/** Override directory name for frontmatter (repo-based, e.g. "vuejs-core") */
|
|
106
|
+
dirName?: string;
|
|
107
|
+
/** All packages tracked by this skill (multi-package skills) */
|
|
108
|
+
packages?: Array<{
|
|
109
|
+
name: string;
|
|
110
|
+
}>;
|
|
111
|
+
/** GitHub repo URL (owner/repo format or full URL) */
|
|
112
|
+
repoUrl?: string;
|
|
113
|
+
/** Resolved feature flags */
|
|
114
|
+
features?: FeaturesConfig;
|
|
115
|
+
/** Eject mode: use ./references/ paths instead of ./.skilld/ for portable skills */
|
|
116
|
+
eject?: boolean;
|
|
117
|
+
}
|
|
118
|
+
declare function writeSkillMd(skillDir: string, content: string): void;
|
|
119
|
+
declare function writeGeneratedSkillMd(skillDir: string, opts: SkillOptions): string;
|
|
120
|
+
declare function generateSkillMd(opts: SkillOptions): string;
|
|
61
121
|
/**
|
|
62
|
-
*
|
|
63
|
-
* .claude/skills/<skill>/.skilld/<subdir> -> ~/.skilld/repos/<owner>/<repo>/<subdir>
|
|
122
|
+
* Agent types and interfaces
|
|
64
123
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
124
|
+
type AgentType = 'claude-code' | 'cursor' | 'windsurf' | 'cline' | 'codex' | 'github-copilot' | 'gemini-cli' | 'goose' | 'amp' | 'opencode' | 'roo' | 'antigravity';
|
|
125
|
+
interface SkillMetadata {
|
|
126
|
+
name: string;
|
|
127
|
+
version?: string;
|
|
128
|
+
/** ISO date string when this version was released */
|
|
129
|
+
releasedAt?: string;
|
|
130
|
+
description?: string;
|
|
131
|
+
}
|
|
132
|
+
type OptimizeModel = 'opus' | 'sonnet' | 'haiku' | 'gemini-3.1-pro' | 'gemini-3-flash' | 'gpt-5.3-codex' | 'gpt-5.3-codex-spark' | 'gpt-5.2-codex' | `pi:${string}`;
|
|
133
|
+
interface ModelInfo {
|
|
134
|
+
id: OptimizeModel;
|
|
135
|
+
name: string;
|
|
136
|
+
hint: string;
|
|
137
|
+
recommended?: boolean;
|
|
138
|
+
agentId: string;
|
|
139
|
+
agentName: string;
|
|
140
|
+
/** Grouping key for provider selection (e.g. 'claude-code', 'pi:anthropic') */
|
|
141
|
+
provider: string;
|
|
142
|
+
/** Human-readable provider name */
|
|
143
|
+
providerName: string;
|
|
144
|
+
/** Normalized vendor name for UI grouping (e.g. 'Anthropic') — merges CLI and API entries */
|
|
145
|
+
vendorGroup: string;
|
|
146
|
+
}
|
|
147
|
+
interface StreamProgress {
|
|
148
|
+
chunk: string;
|
|
149
|
+
type: 'reasoning' | 'text';
|
|
150
|
+
text: string;
|
|
151
|
+
reasoning: string;
|
|
152
|
+
section?: SkillSection;
|
|
153
|
+
}
|
|
154
|
+
interface OptimizeDocsOptions {
|
|
155
|
+
packageName: string;
|
|
156
|
+
skillDir: string;
|
|
157
|
+
model?: OptimizeModel;
|
|
158
|
+
version?: string;
|
|
159
|
+
hasGithub?: boolean;
|
|
160
|
+
hasReleases?: boolean;
|
|
161
|
+
hasChangelog?: string | false;
|
|
162
|
+
docFiles?: string[];
|
|
163
|
+
docsType?: 'llms.txt' | 'readme' | 'docs';
|
|
164
|
+
hasShippedDocs?: boolean;
|
|
165
|
+
onProgress?: (progress: StreamProgress) => void;
|
|
166
|
+
timeout?: number;
|
|
167
|
+
verbose?: boolean;
|
|
168
|
+
debug?: boolean;
|
|
169
|
+
noCache?: boolean;
|
|
170
|
+
/** Which sections to generate */
|
|
171
|
+
sections?: SkillSection[];
|
|
172
|
+
/** Custom instructions from the user */
|
|
173
|
+
customPrompt?: CustomPrompt;
|
|
174
|
+
/** Resolved feature flags */
|
|
175
|
+
features?: FeaturesConfig;
|
|
176
|
+
/** Key files from the package (e.g., dist/pkg.d.ts) */
|
|
177
|
+
pkgFiles?: string[];
|
|
178
|
+
/** Lines consumed by SKILL.md overhead (frontmatter + header + search + footer) */
|
|
179
|
+
overheadLines?: number;
|
|
180
|
+
}
|
|
181
|
+
interface OptimizeResult {
|
|
182
|
+
optimized: string;
|
|
183
|
+
wasOptimized: boolean;
|
|
184
|
+
error?: string;
|
|
185
|
+
warnings?: string[];
|
|
186
|
+
reasoning?: string;
|
|
187
|
+
finishReason?: string;
|
|
188
|
+
usage?: {
|
|
189
|
+
inputTokens: number;
|
|
190
|
+
outputTokens: number;
|
|
191
|
+
totalTokens: number;
|
|
192
|
+
};
|
|
193
|
+
cost?: number;
|
|
194
|
+
debugLogsDir?: string;
|
|
195
|
+
}
|
|
196
|
+
interface ToolProgressLog {
|
|
197
|
+
message: (msg: string) => void;
|
|
198
|
+
}
|
|
199
|
+
/** Create a progress callback that emits one line per tool call, Claude Code style */
|
|
200
|
+
declare function createToolProgress(log: ToolProgressLog): (progress: StreamProgress) => void;
|
|
201
|
+
declare function getModelName(id: OptimizeModel): string;
|
|
202
|
+
declare function getModelLabel(id: OptimizeModel): string;
|
|
203
|
+
declare function getAvailableModels(): Promise<ModelInfo[]>;
|
|
76
204
|
/**
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* Structure:
|
|
80
|
-
* .claude/skills/<skill>/.skilld/pkg -> node_modules/<pkg> OR ~/.skilld/references/<pkg>@<version>/pkg
|
|
81
|
-
*
|
|
82
|
-
* This gives access to package.json, README.md, dist/, and any shipped docs/
|
|
205
|
+
* Detect directly-used npm packages by scanning source files
|
|
206
|
+
* Uses mlly for proper ES module parsing + tinyglobby for file discovery
|
|
83
207
|
*/
|
|
84
|
-
|
|
208
|
+
interface PackageUsage {
|
|
209
|
+
name: string;
|
|
210
|
+
count: number;
|
|
211
|
+
source?: 'import' | 'preset';
|
|
212
|
+
}
|
|
213
|
+
interface DetectResult {
|
|
214
|
+
packages: PackageUsage[];
|
|
215
|
+
error?: string;
|
|
216
|
+
}
|
|
85
217
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* Structure:
|
|
90
|
-
* .claude/skills/<skill>/.skilld/pkg-<short> -> node_modules/<pkg>
|
|
218
|
+
* Scan source files to detect all directly-imported npm packages
|
|
219
|
+
* Async with gitignore support for proper spinner animation
|
|
91
220
|
*/
|
|
92
|
-
declare function
|
|
221
|
+
declare function detectImportedPackages(cwd?: string): Promise<DetectResult>;
|
|
93
222
|
/**
|
|
94
|
-
*
|
|
95
|
-
* Returns entry points + docs files
|
|
223
|
+
* Detect which agents are installed on the system
|
|
96
224
|
*/
|
|
97
|
-
declare function
|
|
225
|
+
declare function detectInstalledAgents(): AgentType[];
|
|
98
226
|
/**
|
|
99
|
-
*
|
|
227
|
+
* Detect the target agent (where skills are installed) from env vars and cwd.
|
|
228
|
+
* This is NOT the generator LLM — it determines the skills directory.
|
|
100
229
|
*
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
|
|
104
|
-
declare function writeSections(name: string, version: string, sections: Array<{
|
|
105
|
-
file: string;
|
|
106
|
-
content: string;
|
|
107
|
-
}>): void;
|
|
108
|
-
/**
|
|
109
|
-
* Read a cached section from the global references dir
|
|
110
|
-
*/
|
|
111
|
-
declare function readCachedSection(name: string, version: string, file: string): string | null;
|
|
112
|
-
declare function hasShippedDocs(name: string, cwd: string, version?: string): boolean;
|
|
113
|
-
/**
|
|
114
|
-
* List all cached packages
|
|
115
|
-
*/
|
|
116
|
-
declare function listCached(): CachedPackage[];
|
|
117
|
-
/**
|
|
118
|
-
* Read cached docs for a package
|
|
230
|
+
* Priority: env vars first (running inside agent = unambiguous), then project dirs.
|
|
231
|
+
* When multiple agents match project dirs, returns null to trigger user prompt
|
|
232
|
+
* rather than silently picking the first match.
|
|
119
233
|
*/
|
|
120
|
-
declare function
|
|
234
|
+
declare function detectTargetAgent(): AgentType | null;
|
|
121
235
|
/**
|
|
122
|
-
*
|
|
236
|
+
* Get all agents matching the current project directory.
|
|
237
|
+
* Used by promptForAgent to show relevant agents first when disambiguation is needed.
|
|
123
238
|
*/
|
|
124
|
-
declare function
|
|
239
|
+
declare function detectProjectAgents(): AgentType[];
|
|
125
240
|
/**
|
|
126
|
-
*
|
|
241
|
+
* Get the version of an agent's CLI (if available)
|
|
127
242
|
*/
|
|
128
|
-
declare function
|
|
243
|
+
declare function getAgentVersion(agentType: AgentType): string | null;
|
|
129
244
|
/**
|
|
130
|
-
*
|
|
131
|
-
* Returns paths like ./.skilld/pkg/README.md, ./.skilld/docs/api.md
|
|
245
|
+
* Sanitize skill name for filesystem
|
|
132
246
|
*/
|
|
133
|
-
declare function
|
|
247
|
+
declare function sanitizeName(name: string): string;
|
|
134
248
|
/**
|
|
135
|
-
*
|
|
249
|
+
* Compute skill directory name from package name with -skilld suffix.
|
|
250
|
+
* No collisions for monorepo packages (each gets a unique name).
|
|
251
|
+
*
|
|
252
|
+
* Examples:
|
|
253
|
+
* vue → vue-skilld
|
|
254
|
+
* @unhead/vue → unhead-vue-skilld
|
|
255
|
+
* @unhead/react → unhead-react-skilld
|
|
136
256
|
*/
|
|
257
|
+
declare function computeSkillDirName(packageName: string): string;
|
|
137
258
|
/**
|
|
138
|
-
*
|
|
259
|
+
* Install a skill directly to agent skill directories.
|
|
260
|
+
* When agents are explicitly specified, creates directories as needed.
|
|
261
|
+
* When falling back to auto-detection, only writes to agents whose skills dir already exists.
|
|
139
262
|
*/
|
|
140
|
-
declare function
|
|
263
|
+
declare function installSkillForAgents(skillName: string, skillContent: string, options?: {
|
|
264
|
+
global?: boolean;
|
|
265
|
+
cwd?: string;
|
|
266
|
+
agents?: AgentType[]; /** Additional files to write (filename -> content) */
|
|
267
|
+
files?: Record<string, string>;
|
|
268
|
+
}): {
|
|
269
|
+
installed: AgentType[];
|
|
270
|
+
skipped: Array<{
|
|
271
|
+
agent: AgentType;
|
|
272
|
+
reason: string;
|
|
273
|
+
}>;
|
|
274
|
+
paths: string[];
|
|
275
|
+
};
|
|
141
276
|
/**
|
|
142
|
-
*
|
|
277
|
+
* Create a relative symlink from the target agent's skills dir to the shared .skills/ dir.
|
|
278
|
+
* Only creates directories for the explicit target agent; other agents must already have
|
|
279
|
+
* their skills dir present. This prevents skilld from polluting projects with dirs
|
|
280
|
+
* for agents the user doesn't use (e.g. .gemini/, .agent/).
|
|
143
281
|
*/
|
|
144
|
-
declare function
|
|
282
|
+
declare function linkSkillToAgents(skillName: string, sharedDir: string, cwd: string, agentType?: AgentType): void;
|
|
145
283
|
/**
|
|
146
|
-
*
|
|
147
|
-
* Validates name/version to prevent path traversal.
|
|
284
|
+
* Remove per-agent symlinks for a skill when removing from shared dir.
|
|
148
285
|
*/
|
|
149
|
-
declare function
|
|
150
|
-
|
|
286
|
+
declare function unlinkSkillFromAgents(skillName: string, cwd: string, agentType?: AgentType): void;
|
|
287
|
+
declare function optimizeDocs(opts: OptimizeDocsOptions): Promise<OptimizeResult>;
|
|
288
|
+
interface FrontmatterField {
|
|
289
|
+
/** Field name in YAML frontmatter */
|
|
290
|
+
name: string;
|
|
291
|
+
/** Whether the field is required by the agent */
|
|
292
|
+
required: boolean;
|
|
293
|
+
/** Description of what the field does */
|
|
294
|
+
description: string;
|
|
295
|
+
/** Constraints (max length, regex, etc.) */
|
|
296
|
+
constraints?: string;
|
|
297
|
+
}
|
|
298
|
+
interface AgentTarget {
|
|
299
|
+
/** Agent identifier */
|
|
300
|
+
agent: AgentType;
|
|
301
|
+
/** Human-readable agent name */
|
|
302
|
+
displayName: string;
|
|
303
|
+
/** Check if agent is installed on the system */
|
|
304
|
+
detectInstalled: () => boolean;
|
|
305
|
+
/** Check env vars to detect if running inside this agent */
|
|
306
|
+
detectEnv: () => boolean;
|
|
307
|
+
/** Check project-level config dirs/files to detect this agent */
|
|
308
|
+
detectProject: (cwd: string) => boolean;
|
|
309
|
+
/** CLI command name (if agent has a CLI for skill generation) */
|
|
310
|
+
cli?: string;
|
|
311
|
+
/** Project-level instruction file for always-on rules (e.g. CLAUDE.md, AGENTS.md) */
|
|
312
|
+
instructionFile?: string;
|
|
313
|
+
/** Required skill filename (always SKILL.md for Agent Skills spec agents) */
|
|
314
|
+
skillFilename: string;
|
|
315
|
+
/** Project-level skill directory */
|
|
316
|
+
skillsDir: string;
|
|
317
|
+
/** Global (user-level) skill directory (resolved absolute path) */
|
|
318
|
+
globalSkillsDir: string;
|
|
319
|
+
/** Additional directories this agent scans for skills (cross-compat) */
|
|
320
|
+
additionalSkillsDirs: string[];
|
|
321
|
+
/** Supported frontmatter fields */
|
|
322
|
+
frontmatter: FrontmatterField[];
|
|
323
|
+
/** Whether `name` must exactly match the parent directory name */
|
|
324
|
+
nameMatchesDir: boolean;
|
|
325
|
+
/** Name field regex constraint */
|
|
326
|
+
namePattern: string;
|
|
327
|
+
/** How skills are discovered: 'eager' (startup scan) or 'lazy' (on-demand) */
|
|
328
|
+
discoveryStrategy: 'eager' | 'lazy';
|
|
329
|
+
/** Brief description of how discovery works */
|
|
330
|
+
discoveryNotes: string;
|
|
331
|
+
/** Whether this agent follows the agentskills.io spec */
|
|
332
|
+
agentSkillsSpec: boolean;
|
|
333
|
+
/** Agent-specific extensions beyond the spec */
|
|
334
|
+
extensions: string[];
|
|
335
|
+
/** Link to official documentation */
|
|
336
|
+
docs: string;
|
|
337
|
+
/** Additional notes, quirks, known issues */
|
|
338
|
+
notes: string[];
|
|
339
|
+
/** Agent-specific instruction text for skill activation (written to instructionFile) */
|
|
340
|
+
skillActivationHint?: string;
|
|
341
|
+
}
|
|
342
|
+
declare const targets: Record<AgentType, AgentTarget>;
|
|
343
|
+
export { buildAllSectionPrompts as A, FeaturesConfig as B, StreamProgress as C, generateSkillMd as D, SkillOptions as E, wrapSection as F, SECTION_MERGE_ORDER as I, SECTION_OUTPUT_FILES as L, extractMarkedSections as M, getSectionValidator as N, writeGeneratedSkillMd as O, portabilizePrompt as P, SkillSection as R, OptimizeResult as S, SkillMetadata as T, getModelName as _, computeSkillDirName as a, OptimizeDocsOptions as b, sanitizeName as c, detectProjectAgents as d, detectTargetAgent as f, getModelLabel as g, getAvailableModels as h, optimizeDocs as i, buildSectionPrompt as j, writeSkillMd as k, unlinkSkillFromAgents as l, detectImportedPackages as m, AgentTarget as n, installSkillForAgents as o, getAgentVersion as p, FrontmatterField as r, linkSkillToAgents as s, targets as t, detectInstalledAgents as u, createToolProgress as v, AgentType as w, OptimizeModel as x, ModelInfo as y, CustomPrompt as z };
|
|
151
344
|
//# sourceMappingURL=index.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/core/config.ts","../../src/agent/prompts/optional/types.ts","../../src/agent/prompts/optional/registry.ts","../../src/agent/prompts/prompt.ts","../../src/agent/prompts/skill.ts","../../src/agent/types.ts","../../src/agent/clis/types.ts","../../src/agent/clis/cli-progress.ts","../../src/agent/clis/index.ts","../../src/agent/detect-imports.ts","../../src/agent/detect.ts","../../src/agent/install.ts","../../src/agent/llm-enhancer.ts","../../src/agent/targets/types.ts","../../src/agent/targets/registry.ts"],"mappings":"UAKiB,cAAA;EACf,MAAA;EACA,MAAA;EACA,WAAA;EACA,QAAA;AAAA;AAAA,UCEe,wBAAA;EACf,OAAA;AAAA;AAAA,UAiCe,YAAA;EACf,OAAA;EACA,IAAA;AAAA;AAAA,KChCU,YAAA;AAAA,cA+BC,oBAAA,EAER,MAAA,CAAO,YAAA;AAAA,cAEC,mBAA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