@skillit/core 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +55 -0
  3. package/dist/audit-formatter.d.ts +36 -0
  4. package/dist/audit-formatter.d.ts.map +1 -0
  5. package/dist/audit-formatter.js +173 -0
  6. package/dist/audit-formatter.js.map +1 -0
  7. package/dist/audit-score.d.ts +76 -0
  8. package/dist/audit-score.d.ts.map +1 -0
  9. package/dist/audit-score.js +490 -0
  10. package/dist/audit-score.js.map +1 -0
  11. package/dist/audit-types.d.ts +81 -0
  12. package/dist/audit-types.d.ts.map +1 -0
  13. package/dist/audit-types.js +2 -0
  14. package/dist/audit-types.js.map +1 -0
  15. package/dist/audit.d.ts +17 -0
  16. package/dist/audit.d.ts.map +1 -0
  17. package/dist/audit.js +567 -0
  18. package/dist/audit.js.map +1 -0
  19. package/dist/canonical.d.ts +36 -0
  20. package/dist/canonical.d.ts.map +1 -0
  21. package/dist/canonical.js +148 -0
  22. package/dist/canonical.js.map +1 -0
  23. package/dist/config-renderer.d.ts +16 -0
  24. package/dist/config-renderer.d.ts.map +1 -0
  25. package/dist/config-renderer.js +296 -0
  26. package/dist/config-renderer.js.map +1 -0
  27. package/dist/config-types.d.ts +144 -0
  28. package/dist/config-types.d.ts.map +1 -0
  29. package/dist/config-types.js +2 -0
  30. package/dist/config-types.js.map +1 -0
  31. package/dist/docs-scanner.d.ts +40 -0
  32. package/dist/docs-scanner.d.ts.map +1 -0
  33. package/dist/docs-scanner.js +176 -0
  34. package/dist/docs-scanner.js.map +1 -0
  35. package/dist/examples-scanner.d.ts +39 -0
  36. package/dist/examples-scanner.d.ts.map +1 -0
  37. package/dist/examples-scanner.js +221 -0
  38. package/dist/examples-scanner.js.map +1 -0
  39. package/dist/index.d.ts +40 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +31 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/llms-txt.d.ts +20 -0
  44. package/dist/llms-txt.d.ts.map +1 -0
  45. package/dist/llms-txt.js +187 -0
  46. package/dist/llms-txt.js.map +1 -0
  47. package/dist/markdown-parser.d.ts +11 -0
  48. package/dist/markdown-parser.d.ts.map +1 -0
  49. package/dist/markdown-parser.js +222 -0
  50. package/dist/markdown-parser.js.map +1 -0
  51. package/dist/markdown-types.d.ts +48 -0
  52. package/dist/markdown-types.d.ts.map +1 -0
  53. package/dist/markdown-types.js +2 -0
  54. package/dist/markdown-types.js.map +1 -0
  55. package/dist/readme-parser.d.ts +21 -0
  56. package/dist/readme-parser.d.ts.map +1 -0
  57. package/dist/readme-parser.js +137 -0
  58. package/dist/readme-parser.js.map +1 -0
  59. package/dist/references-mcp.d.ts +79 -0
  60. package/dist/references-mcp.d.ts.map +1 -0
  61. package/dist/references-mcp.js +130 -0
  62. package/dist/references-mcp.js.map +1 -0
  63. package/dist/refine/ast-edit.d.ts +21 -0
  64. package/dist/refine/ast-edit.d.ts.map +1 -0
  65. package/dist/refine/ast-edit.js +147 -0
  66. package/dist/refine/ast-edit.js.map +1 -0
  67. package/dist/refine/index.d.ts +7 -0
  68. package/dist/refine/index.d.ts.map +1 -0
  69. package/dist/refine/index.js +6 -0
  70. package/dist/refine/index.js.map +1 -0
  71. package/dist/refine/jsdoc-edit.d.ts +4 -0
  72. package/dist/refine/jsdoc-edit.d.ts.map +1 -0
  73. package/dist/refine/jsdoc-edit.js +6 -0
  74. package/dist/refine/jsdoc-edit.js.map +1 -0
  75. package/dist/refine/loop.d.ts +8 -0
  76. package/dist/refine/loop.d.ts.map +1 -0
  77. package/dist/refine/loop.js +98 -0
  78. package/dist/refine/loop.js.map +1 -0
  79. package/dist/refine/select-targets.d.ts +5 -0
  80. package/dist/refine/select-targets.d.ts.map +1 -0
  81. package/dist/refine/select-targets.js +30 -0
  82. package/dist/refine/select-targets.js.map +1 -0
  83. package/dist/refine/types.d.ts +67 -0
  84. package/dist/refine/types.d.ts.map +1 -0
  85. package/dist/refine/types.js +2 -0
  86. package/dist/refine/types.js.map +1 -0
  87. package/dist/renderer.d.ts +27 -0
  88. package/dist/renderer.d.ts.map +1 -0
  89. package/dist/renderer.js +1244 -0
  90. package/dist/renderer.js.map +1 -0
  91. package/dist/tokens.d.ts +14 -0
  92. package/dist/tokens.d.ts.map +1 -0
  93. package/dist/tokens.js +26 -0
  94. package/dist/tokens.js.map +1 -0
  95. package/dist/types.d.ts +519 -0
  96. package/dist/types.d.ts.map +1 -0
  97. package/dist/types.js +2 -0
  98. package/dist/types.js.map +1 -0
  99. package/dist/writer.d.ts +17 -0
  100. package/dist/writer.d.ts.map +1 -0
  101. package/dist/writer.js +313 -0
  102. package/dist/writer.js.map +1 -0
  103. package/package.json +54 -0
@@ -0,0 +1,519 @@
1
+ import type { ExtractedConfigSurface } from './config-types.js';
2
+ /** Extracted API surface for a single package/module */
3
+ export interface ExtractedSkill {
4
+ /** Package or module name */
5
+ name: string;
6
+ /** Package description */
7
+ description: string;
8
+ /** License identifier (e.g. "MIT", "Apache-2.0") */
9
+ license?: string;
10
+ /** Keywords from package.json — used to enrich trigger descriptions */
11
+ keywords?: string[];
12
+ /** Repository URL */
13
+ repository?: string;
14
+ /** Author name */
15
+ author?: string;
16
+ /** Package description from package.json or README intro — used for SKILL.md description and body */
17
+ packageDescription?: string;
18
+ /** Extended remarks from @packageDocumentation @remarks — architectural context, trade-offs, mental models */
19
+ remarks?: string;
20
+ /** Additional documentation content (from projectDocuments, README, etc.) */
21
+ documents?: ExtractedDocument[];
22
+ /** Exported functions */
23
+ functions: ExtractedFunction[];
24
+ /** Exported classes */
25
+ classes: ExtractedClass[];
26
+ /** Exported interfaces and type aliases */
27
+ types: ExtractedType[];
28
+ /** Exported enums */
29
+ enums: ExtractedEnum[];
30
+ /** Exported variables and constants */
31
+ variables: ExtractedVariable[];
32
+ /** Usage examples from @example tags or doc pages */
33
+ examples: string[];
34
+ /** Aggregated @useWhen triggers from all exports */
35
+ useWhen?: string[];
36
+ /** Aggregated @useWhen with source info for decision tables */
37
+ useWhenSources?: Array<{
38
+ text: string;
39
+ sourceName: string;
40
+ sourceKind: string;
41
+ sourceDescription?: string;
42
+ }>;
43
+ /** Aggregated @avoidWhen triggers from all exports */
44
+ avoidWhen?: string[];
45
+ /** Aggregated @avoidWhen with source info for decision tables */
46
+ avoidWhenSources?: Array<{
47
+ text: string;
48
+ sourceName: string;
49
+ sourceKind: string;
50
+ sourceDescription?: string;
51
+ }>;
52
+ /** Aggregated @never from all exports */
53
+ pitfalls?: string[];
54
+ /** Configuration surfaces (CLI commands, config files) */
55
+ configSurfaces?: ExtractedConfigSurface[];
56
+ /** Features section from README — rendered inline in SKILL.md */
57
+ readmeFeatures?: string;
58
+ /** Troubleshooting section from README — rendered inline in SKILL.md */
59
+ readmeTroubleshooting?: string;
60
+ /** MCP resources (empty/absent for non-MCP extractors). */
61
+ resources?: ExtractedResource[];
62
+ /** MCP prompts (empty/absent for non-MCP extractors). */
63
+ prompts?: ExtractedPrompt[];
64
+ /** Setup instructions emitted when the invocation target is CLI-based. */
65
+ setup?: SkillSetup;
66
+ /**
67
+ * Structured audit execution state for extractors that run an audit pipeline.
68
+ *
69
+ * `undefined` means the extractor does not populate audit state. Use this
70
+ * field when callers need to distinguish "audit skipped" from "audit ran
71
+ * clean" without relying on optional-array semantics.
72
+ */
73
+ readonly audit?: ExtractedSkillAudit;
74
+ /**
75
+ * Structured audit findings surfaced for backward compatibility.
76
+ *
77
+ * Tri-state semantics:
78
+ * - `undefined` — audit was skipped or this extractor does not populate
79
+ * compatibility findings.
80
+ * - `[]` — audit ran and found no issues.
81
+ * - `[…]` — audit ran and found issues. Length and `severity` distribution
82
+ * are the gate criteria for CI.
83
+ *
84
+ * @remarks
85
+ * The element shape (`McpAuditIssue`) is forward-declared here in
86
+ * `@skillit/core` so this field is typeable without a runtime dependency
87
+ * on `@skillit/mcp`. The concrete audit engine lives in `@skillit/mcp`,
88
+ * which re-exports the type as `AuditIssue` for adapter-author ergonomics.
89
+ *
90
+ * @deprecated Prefer `audit`. When present, this mirrors
91
+ * `audit.status === 'completed' ? audit.issues : undefined`.
92
+ */
93
+ readonly auditIssues?: readonly McpAuditIssue[];
94
+ }
95
+ /** Audit severity levels for structured extractor findings. */
96
+ export type McpAuditSeverity = 'fatal' | 'error' | 'warning' | 'alert';
97
+ export type ExtractedSkillAudit = {
98
+ readonly status: 'skipped';
99
+ } | {
100
+ readonly status: 'completed';
101
+ readonly issues: readonly McpAuditIssue[];
102
+ };
103
+ /**
104
+ * Structural shape of an extractor audit issue. Historically this matched the
105
+ * MCP package's `AuditIssue`, and the name is retained for compatibility, but
106
+ * other extractors may also populate `ExtractedSkill.auditIssues` using this
107
+ * shared structural contract.
108
+ */
109
+ export interface McpAuditIssue {
110
+ /** Pipeline-specific finding code such as M1 or C4. */
111
+ readonly code: `${string}${number}`;
112
+ /** Severity level. */
113
+ readonly severity: McpAuditSeverity;
114
+ /** Human-readable description of the finding. */
115
+ readonly message: string;
116
+ /** Where the issue was found. Fields vary by extractor. */
117
+ readonly location?: {
118
+ readonly tool?: string;
119
+ readonly parameter?: string;
120
+ readonly command?: string;
121
+ readonly option?: string;
122
+ readonly argument?: string;
123
+ };
124
+ /** Actionable next step or concrete remediation hint. */
125
+ readonly suggestion?: string;
126
+ }
127
+ /** An MCP-exposed resource (static or templated URI, readable by the agent harness). */
128
+ export interface ExtractedResource {
129
+ /** Canonical URI. MAY contain URI Template expressions per RFC 6570 for parameterized resources. */
130
+ uri: string;
131
+ /** Short human-readable name */
132
+ name: string;
133
+ /** Prose description (single paragraph) */
134
+ description: string;
135
+ /** MIME type of the resource content. Optional — not all servers advertise it. */
136
+ mimeType?: string;
137
+ /** Source module for grouping (rarely meaningful for resources; present for IR parity). */
138
+ sourceModule?: string;
139
+ }
140
+ /** An MCP-exposed prompt (a named, argument-templated prompt the agent may request). */
141
+ export interface ExtractedPrompt {
142
+ /** Short identifier used by MCP `prompts/get` requests. */
143
+ name: string;
144
+ /** Prose description of what the prompt produces. */
145
+ description: string;
146
+ /** Typed argument schema (may be empty). */
147
+ arguments: ExtractedPromptArgument[];
148
+ /** Present for IR parity with functions/classes; rarely meaningful for prompts. */
149
+ sourceModule?: string;
150
+ }
151
+ export interface ExtractedPromptArgument {
152
+ name: string;
153
+ description: string;
154
+ /**
155
+ * Whether the argument is mandatory on `prompts/get` invocation.
156
+ * MCP prompt arguments are strings in the current spec; a typed `type` field
157
+ * may be added in a future revision without breaking callers.
158
+ */
159
+ required: boolean;
160
+ }
161
+ /** Setup instructions emitted into SKILL.md body when the invocation target is CLI-based. */
162
+ export interface SkillSetup {
163
+ /** Human-prose install instructions (markdown-safe). */
164
+ install: string;
165
+ /** One-time configuration step the consumer must run (e.g. `mcpc connect @server`). */
166
+ oneTimeSetup?: string;
167
+ /** Adapter fingerprint for freshness checks (per FR-IT-012). */
168
+ generatedBy: AdapterFingerprint;
169
+ }
170
+ /** Identifies the adapter that rendered a skill — used for freshness audits. */
171
+ export interface AdapterFingerprint {
172
+ /** npm package name of the adapter (e.g. "@skillit/target-mcpc") */
173
+ adapter: string;
174
+ /** Adapter package semver version */
175
+ version: string;
176
+ /** Semver range of the target CLI the adapter was written against (e.g. "mcpc@^2.1") */
177
+ targetCliRange?: string;
178
+ }
179
+ export interface ExtractedFunction {
180
+ name: string;
181
+ description: string;
182
+ signature: string;
183
+ parameters: ExtractedParameter[];
184
+ returnType: string;
185
+ /** Prose description from @returns JSDoc tag */
186
+ returnsDescription?: string;
187
+ /** Extended description from @remarks tag — expert knowledge beyond summary */
188
+ remarks?: string;
189
+ examples: string[];
190
+ tags: Record<string, string>;
191
+ /** MCP-specific metadata used by MCP audit/enrichment without magic tag keys. */
192
+ mcpMetadata?: ExtractedFunctionMcpMetadata;
193
+ /** Additional overload signatures (if function has multiple signatures) */
194
+ overloads?: string[];
195
+ /** Source module name derived from file path (e.g. "renderer", "tokens") */
196
+ sourceModule?: string;
197
+ /** Category for grouping (from @category tag) */
198
+ category?: string;
199
+ }
200
+ export interface ExtractedClass {
201
+ name: string;
202
+ description: string;
203
+ constructorSignature: string;
204
+ methods: ExtractedFunction[];
205
+ properties: ExtractedProperty[];
206
+ examples: string[];
207
+ /** JSDoc block tags (e.g. @deprecated, @since, @useWhen, @never) */
208
+ tags: Record<string, string>;
209
+ /** Base class name (from `extends`) */
210
+ extends?: string;
211
+ /** Implemented interface names (from `implements`) */
212
+ implements?: string[];
213
+ /** Source module name derived from file path (e.g. "renderer", "tokens") */
214
+ sourceModule?: string;
215
+ /** Category for grouping (from @category tag) */
216
+ category?: string;
217
+ }
218
+ export interface ExtractedType {
219
+ name: string;
220
+ description: string;
221
+ definition: string;
222
+ properties?: ExtractedProperty[];
223
+ /** Source module name derived from file path (e.g. "renderer", "tokens") */
224
+ sourceModule?: string;
225
+ /** Category for grouping (from @category tag) */
226
+ category?: string;
227
+ }
228
+ export interface ExtractedEnum {
229
+ name: string;
230
+ description: string;
231
+ members: Array<{
232
+ name: string;
233
+ value: string;
234
+ description: string;
235
+ }>;
236
+ /** Source module name derived from file path (e.g. "renderer", "tokens") */
237
+ sourceModule?: string;
238
+ /** Category for grouping (from @category tag) */
239
+ category?: string;
240
+ }
241
+ export interface ExtractedVariable {
242
+ name: string;
243
+ type: string;
244
+ description: string;
245
+ isConst: boolean;
246
+ /** Source module name derived from file path (e.g. "renderer", "tokens") */
247
+ sourceModule?: string;
248
+ /** Category for grouping (from @category tag) */
249
+ category?: string;
250
+ }
251
+ export interface ExtractedParameter {
252
+ name: string;
253
+ type: string;
254
+ description: string;
255
+ optional: boolean;
256
+ defaultValue?: string;
257
+ }
258
+ export interface ExtractedFunctionMcpMetadata {
259
+ /** Structured `_meta.toSkills` metadata extracted from MCP tool annotations. */
260
+ readonly toSkills?: {
261
+ readonly useWhen?: readonly string[];
262
+ readonly avoidWhen?: readonly string[];
263
+ readonly pitfalls?: readonly string[];
264
+ readonly malformedReason?: string;
265
+ };
266
+ /** Schema-introspection failures that MCP audit rules should surface. */
267
+ readonly schemaError?: {
268
+ readonly kind: 'ref-cycle';
269
+ };
270
+ }
271
+ export interface ExtractedProperty {
272
+ name: string;
273
+ type: string;
274
+ description: string;
275
+ optional: boolean;
276
+ }
277
+ export interface ExtractedDocument {
278
+ /** Document title */
279
+ title: string;
280
+ /** Document content (markdown) */
281
+ content: string;
282
+ /** Category from frontmatter — used to disambiguate duplicate titles and organize into subdirs */
283
+ category?: string;
284
+ /** Frontmatter description — used for category summaries in SKILL.md */
285
+ description?: string;
286
+ /** True when this doc has children (is a parent/overview doc) */
287
+ isParent?: boolean;
288
+ /** API class/type names from {@link} tags in "## API reference" sections — enables bidirectional linking */
289
+ apiRefs?: string[];
290
+ }
291
+ /** A single rendered file */
292
+ export interface RenderedFile {
293
+ /** File path relative to output dir */
294
+ filename: string;
295
+ /** File content */
296
+ content: string;
297
+ /** Estimated token count */
298
+ tokens?: number;
299
+ }
300
+ /** A rendered skill with progressive disclosure structure */
301
+ export interface RenderedSkill {
302
+ /** The SKILL.md discovery file (lean — frontmatter, overview, quick ref) */
303
+ skill: RenderedFile;
304
+ /** Reference files loaded on demand (functions, classes, types, etc.) */
305
+ references: RenderedFile[];
306
+ }
307
+ export type RefCategory = 'functions' | 'classes' | 'types' | 'variables' | 'commands' | 'config' | 'docs' | 'resources' | 'prompts' | 'examples';
308
+ export interface RefManifestEntry {
309
+ /** Relative path surfaced from SKILL.md loading triggers. */
310
+ path: `references/${string}`;
311
+ /** Whether the trigger points at a single file or a directory index. */
312
+ mode: 'file' | 'directory';
313
+ }
314
+ export type RefManifest = Partial<Record<RefCategory, RefManifestEntry>>;
315
+ /** @deprecated Use RenderedFile instead */
316
+ export type RenderedSkillLegacy = RenderedFile;
317
+ /** Options controlling skill file writes after rendering. */
318
+ export interface SkillWriteOptions {
319
+ /** Primary output directory for rendered skills. */
320
+ outDir: string;
321
+ /** Additional install targets that receive copied skill directories. */
322
+ installTargets?: readonly string[];
323
+ /**
324
+ * Whether to write into `outDir` as well as install targets.
325
+ *
326
+ * Callers that want install-target-only writes (for example bundled
327
+ * guidance that should not appear in the primary generated output) set this
328
+ * to `false`. Defaults to `true`.
329
+ */
330
+ includeOutDir?: boolean;
331
+ }
332
+ export type SkillWritePreserveReason = 'curated' | 'bundled-custom-skill' | 'bundled-name-mismatch' | 'bundled-missing-version' | 'bundled-same-version' | 'bundled-newer-version';
333
+ export interface SkillWriteResult {
334
+ /** Root directory that was evaluated for this write. */
335
+ readonly root: string;
336
+ /** Whether the result applies to the primary outDir or an install target. */
337
+ readonly rootKind: 'outDir' | 'installTarget';
338
+ /** Relative skill directory name (for example `demo-skill`). */
339
+ readonly skillName: string;
340
+ /** Whether the skill was written or intentionally preserved. */
341
+ readonly action: 'written' | 'preserved';
342
+ /** Preserve reason when `action === "preserved"`. */
343
+ readonly preserveReason?: SkillWritePreserveReason;
344
+ }
345
+ /** Options controlling skill rendering */
346
+ export interface SkillRenderOptions {
347
+ /** Output directory for skill files (default: ".github/skills") */
348
+ outDir: string;
349
+ /** Include usage examples (default: true) */
350
+ includeExamples: boolean;
351
+ /** Include type signatures (default: true) */
352
+ includeSignatures: boolean;
353
+ /** Maximum approximate token budget per skill (default: 4000) */
354
+ maxTokens: number;
355
+ /** Custom name prefix */
356
+ namePrefix: string;
357
+ /** License to include in frontmatter (default: read from package.json) */
358
+ license: string;
359
+ /** Invocation adapter that selects rendering dialect. Defaults to the mcp-protocol adapter. */
360
+ invocation?: InvocationAdapter;
361
+ /**
362
+ * Forwarded into `AdapterRenderContext.launchCommand` for invocation adapters.
363
+ * Used in extract mode where the host has determined how to launch a third-party
364
+ * MCP server (e.g. via stdio transport configuration). Mutually informative with
365
+ * `invocationPackageName`: when both are set, adapters typically prefer the
366
+ * package-name-driven launch (npx-by-name) for self-referential bundle output.
367
+ */
368
+ invocationLaunchCommand?: {
369
+ command: string;
370
+ args?: readonly string[];
371
+ env?: Readonly<Record<string, string>>;
372
+ };
373
+ /**
374
+ * Forwarded into `AdapterRenderContext.packageName` for bundle-mode self-reference.
375
+ * Set by `@skillit/mcp` bundle commands so the emitted skill instructs MCP-native
376
+ * harnesses to launch the server via `npx <packageName>`.
377
+ */
378
+ invocationPackageName?: string;
379
+ /**
380
+ * Forwarded into `AdapterRenderContext.binName` for bundle-mode multi-bin
381
+ * packages. When the host package's `bin` field is an object with multiple
382
+ * entries and the bundle config selects one, the adapter emits the npx
383
+ * `--package=<pkg> <binName>` form so the right bin is invoked at run time
384
+ * (FR-034). Ignored when `invocationPackageName` is unset.
385
+ */
386
+ invocationBinName?: string;
387
+ /**
388
+ * Forwarded into `AdapterRenderContext.httpEndpoint` for HTTP-transport extract mode.
389
+ *
390
+ * @remarks
391
+ * When the host extracts a skill from an HTTP-based MCP server (`--url ...`),
392
+ * there is no shell launch command — adapters should emit a `{ url, headers }`
393
+ * shape instead of `{ command, args, env }`. Set by `@skillit/mcp`'s extract
394
+ * pipeline. Mutually exclusive with `invocationLaunchCommand` in practice; the
395
+ * MCP adapter prefers `httpEndpoint` when both are present.
396
+ */
397
+ invocationHttpEndpoint?: {
398
+ url: string;
399
+ headers?: Readonly<Record<string, string>>;
400
+ };
401
+ /**
402
+ * Additional frontmatter keys merged into SKILL.md by the default renderer path.
403
+ *
404
+ * @remarks
405
+ * Used by invocation adapters that delegate body rendering to core's default
406
+ * path (e.g. `McpProtocolAdapter` injecting `mcp:` frontmatter). Existing keys
407
+ * (`name`, `description`, `license`) take precedence — collisions silently keep
408
+ * the existing value. The canonicalization pass alphabetizes keys after merge.
409
+ */
410
+ additionalFrontmatter?: Readonly<Record<string, unknown>>;
411
+ /**
412
+ * Markdown content injected into the SKILL.md body immediately AFTER the
413
+ * frontmatter delimiter and BEFORE the first heading.
414
+ *
415
+ * @remarks
416
+ * CLI-as-proxy invocation adapters (`@skillit/target-mcpc`,
417
+ * `@skillit/target-fastmcp`) use this to inject a Setup section that
418
+ * tells the consumer how to install/connect the underlying CLI. The string
419
+ * is inserted verbatim — callers are responsible for formatting and
420
+ * trailing newlines. Defaults to empty (no prefix injected).
421
+ */
422
+ bodyPrefix?: string;
423
+ /**
424
+ * When `true`, the default renderer path skips emission of
425
+ * `references/functions.md`. CLI-as-proxy adapters set this so they can
426
+ * emit their own `references/tools.md` carrying command-shape rows
427
+ * instead of TypeScript signatures. Defaults to `false`.
428
+ */
429
+ skipDefaultFunctionsRef?: boolean;
430
+ /**
431
+ * When `false`, the default renderer path returns its `RenderedSkill`
432
+ * without running the trailing canonicalization pass. Adapters that wrap
433
+ * `renderSkill` for body rendering and then mutate `references` (e.g.
434
+ * `@skillit/target-mcpc` appending its own `tools.md`) pass `false` here
435
+ * so canonicalization runs exactly once — at the host's outer wrapper —
436
+ * over the final shape including the appended files. Defaults to `true`.
437
+ *
438
+ * Has no effect on the invocation-adapter dispatch path (which always
439
+ * canonicalizes the adapter's output at the host wrapper).
440
+ */
441
+ canonicalize?: boolean;
442
+ }
443
+ /**
444
+ * Pluggable rendering strategy — selects the SKILL.md dialect emitted for an `ExtractedSkill`.
445
+ *
446
+ * Built-in implementations (shipped from `@skillit/mcp`'s target packages) include
447
+ * `mcp-protocol` (emits `mcp:` frontmatter for MCP-native agent harnesses) and
448
+ * `cli:*` targets (emit shell-command skills that route through an external MCP CLI).
449
+ */
450
+ export interface InvocationAdapter {
451
+ readonly target: string;
452
+ readonly fingerprint: AdapterFingerprint;
453
+ render(skill: ExtractedSkill, ctx: AdapterRenderContext): Promise<RenderedSkill>;
454
+ }
455
+ /**
456
+ * Fields shared by every arm of {@link AdapterRenderContext}. Adapters can
457
+ * destructure these without first checking `mode`.
458
+ */
459
+ export interface AdapterRenderContextBase {
460
+ /** Output directory name chosen by the caller (e.g. "filesystem", "my-server"). */
461
+ readonly skillName: string;
462
+ /** Token budget ceiling per reference file — adapters should stay under this but the host will truncate if exceeded. */
463
+ readonly maxTokens: number;
464
+ /** When `true` (default), the host runs a canonicalization pass on the adapter's output so re-runs produce content-identical files. */
465
+ readonly canonicalize: boolean;
466
+ }
467
+ /**
468
+ * Bundle-mode arm — the host bundle command flagged this skill as self-referential
469
+ * and the adapter should emit `npx <packageName>` (or the multi-bin
470
+ * `--package=<packageName> <binName>` form per FR-034) as the launch shape.
471
+ */
472
+ export interface AdapterRenderContextBundle extends AdapterRenderContextBase {
473
+ readonly mode: 'bundle';
474
+ /** Bundle-mode self-reference — the package name the emitted skill should invoke via `npx`. */
475
+ readonly packageName: string;
476
+ /**
477
+ * Bundle-mode multi-bin selector — when set, the adapter emits the npx
478
+ * `--package=<packageName> <binName>` form (FR-034) so the right bin is
479
+ * invoked at run time. Optional; defaults to the package's single-bin
480
+ * default when omitted.
481
+ */
482
+ readonly binName?: string;
483
+ }
484
+ /**
485
+ * HTTP-extract arm — the host extracted the skill from an HTTP-based MCP
486
+ * server (`--url ...`). There is no shell launch command; adapters that emit
487
+ * MCP-launch frontmatter must produce a `{ url, headers }` shape.
488
+ */
489
+ export interface AdapterRenderContextHttp extends AdapterRenderContextBase {
490
+ readonly mode: 'http';
491
+ readonly httpEndpoint: {
492
+ readonly url: string;
493
+ readonly headers?: Readonly<Record<string, string>>;
494
+ };
495
+ }
496
+ /**
497
+ * Stdio-extract arm — the host extracted the skill from a stdio-transport MCP
498
+ * server. Adapters that emit MCP-launch frontmatter use the `{ command, args,
499
+ * env }` shape verbatim.
500
+ */
501
+ export interface AdapterRenderContextStdio extends AdapterRenderContextBase {
502
+ readonly mode: 'stdio';
503
+ readonly launchCommand: {
504
+ readonly command: string;
505
+ readonly args?: readonly string[];
506
+ readonly env?: Readonly<Record<string, string>>;
507
+ };
508
+ }
509
+ /**
510
+ * Discriminated union over `mode` — encodes the "exactly one of
511
+ * packageName | httpEndpoint | launchCommand" invariant at compile time.
512
+ *
513
+ * Adapters narrow on `ctx.mode` via `switch` (with an exhaustive default).
514
+ * Constructing two arms simultaneously is rejected by TypeScript's
515
+ * excess-property checker on object literals; the renderer's invocation-adapter
516
+ * dispatch enforces the same invariant at runtime for non-literal callers.
517
+ */
518
+ export type AdapterRenderContext = AdapterRenderContextBundle | AdapterRenderContextHttp | AdapterRenderContextStdio;
519
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,qBAAqB;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,qGAAqG;IACrG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,8GAA8G;IAC9G,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,6EAA6E;IAC7E,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,yBAAyB;IACzB,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,uBAAuB;IACvB,OAAO,EAAE,cAAc,EAAE,CAAC;IAC1B,2CAA2C;IAC3C,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,qBAAqB;IACrB,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,uCAAuC;IACvC,SAAS,EAAE,iBAAiB,EAAE,CAAC;IAC/B,qDAAqD;IACrD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,oDAAoD;IACpD,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,KAAK,CAAC;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,iBAAiB,CAA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GAQG;AACH,MAAM,MAAM,oBAAoB,GAC5B,0BAA0B,GAC1B,wBAAwB,GACxB,yBAAyB,CAAC"}
package/dist/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,17 @@
1
+ import type { RenderedSkill, SkillWriteOptions, SkillWriteResult } from './types.js';
2
+ /**
3
+ * Write rendered skill file sets to disk (SKILL.md + references/).
4
+ *
5
+ * @category I/O
6
+ * @useWhen
7
+ * - You have RenderedSkill objects from renderSkills() and need to persist them to the filesystem
8
+ * - Building a custom pipeline that separates rendering from writing (e.g., for preview or dry-run)
9
+ */
10
+ export declare function writeSkills(skills: RenderedSkill[], options: SkillWriteOptions): SkillWriteResult[];
11
+ export declare function readInstalledSkillMetadata(skillDir: string): {
12
+ bundledGuidance?: boolean;
13
+ curated?: boolean;
14
+ version?: string;
15
+ name?: string;
16
+ } | null;
17
+ //# sourceMappingURL=writer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,aAAa,EACb,iBAAiB,EAEjB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAEpB;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,MAAM,EAAE,aAAa,EAAE,EACvB,OAAO,EAAE,iBAAiB,GACzB,gBAAgB,EAAE,CAqCpB;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,MAAM,GACf;IAAE,eAAe,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAE1F"}