@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.
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/dist/audit-formatter.d.ts +36 -0
- package/dist/audit-formatter.d.ts.map +1 -0
- package/dist/audit-formatter.js +173 -0
- package/dist/audit-formatter.js.map +1 -0
- package/dist/audit-score.d.ts +76 -0
- package/dist/audit-score.d.ts.map +1 -0
- package/dist/audit-score.js +490 -0
- package/dist/audit-score.js.map +1 -0
- package/dist/audit-types.d.ts +81 -0
- package/dist/audit-types.d.ts.map +1 -0
- package/dist/audit-types.js +2 -0
- package/dist/audit-types.js.map +1 -0
- package/dist/audit.d.ts +17 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +567 -0
- package/dist/audit.js.map +1 -0
- package/dist/canonical.d.ts +36 -0
- package/dist/canonical.d.ts.map +1 -0
- package/dist/canonical.js +148 -0
- package/dist/canonical.js.map +1 -0
- package/dist/config-renderer.d.ts +16 -0
- package/dist/config-renderer.d.ts.map +1 -0
- package/dist/config-renderer.js +296 -0
- package/dist/config-renderer.js.map +1 -0
- package/dist/config-types.d.ts +144 -0
- package/dist/config-types.d.ts.map +1 -0
- package/dist/config-types.js +2 -0
- package/dist/config-types.js.map +1 -0
- package/dist/docs-scanner.d.ts +40 -0
- package/dist/docs-scanner.d.ts.map +1 -0
- package/dist/docs-scanner.js +176 -0
- package/dist/docs-scanner.js.map +1 -0
- package/dist/examples-scanner.d.ts +39 -0
- package/dist/examples-scanner.d.ts.map +1 -0
- package/dist/examples-scanner.js +221 -0
- package/dist/examples-scanner.js.map +1 -0
- package/dist/index.d.ts +40 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/llms-txt.d.ts +20 -0
- package/dist/llms-txt.d.ts.map +1 -0
- package/dist/llms-txt.js +187 -0
- package/dist/llms-txt.js.map +1 -0
- package/dist/markdown-parser.d.ts +11 -0
- package/dist/markdown-parser.d.ts.map +1 -0
- package/dist/markdown-parser.js +222 -0
- package/dist/markdown-parser.js.map +1 -0
- package/dist/markdown-types.d.ts +48 -0
- package/dist/markdown-types.d.ts.map +1 -0
- package/dist/markdown-types.js +2 -0
- package/dist/markdown-types.js.map +1 -0
- package/dist/readme-parser.d.ts +21 -0
- package/dist/readme-parser.d.ts.map +1 -0
- package/dist/readme-parser.js +137 -0
- package/dist/readme-parser.js.map +1 -0
- package/dist/references-mcp.d.ts +79 -0
- package/dist/references-mcp.d.ts.map +1 -0
- package/dist/references-mcp.js +130 -0
- package/dist/references-mcp.js.map +1 -0
- package/dist/refine/ast-edit.d.ts +21 -0
- package/dist/refine/ast-edit.d.ts.map +1 -0
- package/dist/refine/ast-edit.js +147 -0
- package/dist/refine/ast-edit.js.map +1 -0
- package/dist/refine/index.d.ts +7 -0
- package/dist/refine/index.d.ts.map +1 -0
- package/dist/refine/index.js +6 -0
- package/dist/refine/index.js.map +1 -0
- package/dist/refine/jsdoc-edit.d.ts +4 -0
- package/dist/refine/jsdoc-edit.d.ts.map +1 -0
- package/dist/refine/jsdoc-edit.js +6 -0
- package/dist/refine/jsdoc-edit.js.map +1 -0
- package/dist/refine/loop.d.ts +8 -0
- package/dist/refine/loop.d.ts.map +1 -0
- package/dist/refine/loop.js +98 -0
- package/dist/refine/loop.js.map +1 -0
- package/dist/refine/select-targets.d.ts +5 -0
- package/dist/refine/select-targets.d.ts.map +1 -0
- package/dist/refine/select-targets.js +30 -0
- package/dist/refine/select-targets.js.map +1 -0
- package/dist/refine/types.d.ts +67 -0
- package/dist/refine/types.d.ts.map +1 -0
- package/dist/refine/types.js +2 -0
- package/dist/refine/types.js.map +1 -0
- package/dist/renderer.d.ts +27 -0
- package/dist/renderer.d.ts.map +1 -0
- package/dist/renderer.js +1244 -0
- package/dist/renderer.js.map +1 -0
- package/dist/tokens.d.ts +14 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +26 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +519 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/writer.d.ts +17 -0
- package/dist/writer.d.ts.map +1 -0
- package/dist/writer.js +313 -0
- package/dist/writer.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonicalization pass — deterministic post-render normalization.
|
|
3
|
+
*
|
|
4
|
+
* Operates on `RenderedSkill` (string content), NOT on the `ExtractedSkill` IR.
|
|
5
|
+
*
|
|
6
|
+
* Division of responsibility (see specs/001-mcp-extract-bundle/research.md §2):
|
|
7
|
+
* - Array ordering of tools/resources/prompts is the ADAPTER's job. Each
|
|
8
|
+
* adapter emits items in sorted order directly from the IR. We do NOT
|
|
9
|
+
* parse rendered markdown sections and reorder entries here — that would
|
|
10
|
+
* be the wrong layer.
|
|
11
|
+
* - This module handles the post-render invariants that any adapter's
|
|
12
|
+
* output should satisfy to be content-identical across runs:
|
|
13
|
+
* 1. YAML frontmatter key sort
|
|
14
|
+
* 2. Line endings normalized to LF
|
|
15
|
+
* 3. Trailing whitespace trimmed per line
|
|
16
|
+
* 4. Runs of 2+ blank lines collapsed to 1
|
|
17
|
+
* 5. Optional regex-based pattern stripping (e.g., timestamps)
|
|
18
|
+
*
|
|
19
|
+
* Must be idempotent: `canonicalize(canonicalize(x))` equals `canonicalize(x)`.
|
|
20
|
+
*
|
|
21
|
+
* @module canonical
|
|
22
|
+
*/
|
|
23
|
+
import YAML from 'yaml';
|
|
24
|
+
/**
|
|
25
|
+
* Normalize a `RenderedSkill` so repeat runs produce content-identical output.
|
|
26
|
+
*
|
|
27
|
+
* @param skill - rendered skill to normalize; input is not mutated
|
|
28
|
+
* @param opts - optional pattern list for stripping nondeterministic prose fragments
|
|
29
|
+
* @returns new `RenderedSkill` with canonicalized content
|
|
30
|
+
*/
|
|
31
|
+
export function canonicalize(skill, opts) {
|
|
32
|
+
return {
|
|
33
|
+
skill: canonicalizeFile(skill.skill, opts),
|
|
34
|
+
references: skill.references.map((f) => canonicalizeFile(f, opts))
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function canonicalizeFile(file, opts) {
|
|
38
|
+
return {
|
|
39
|
+
filename: file.filename,
|
|
40
|
+
content: canonicalizeContent(file.content, opts),
|
|
41
|
+
tokens: file.tokens
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
function canonicalizeContent(content, opts) {
|
|
45
|
+
// 1. Line endings: normalize CRLF / CR to LF up front.
|
|
46
|
+
let normalized = content.replace(/\r\n?/g, '\n');
|
|
47
|
+
// 2. Frontmatter key sort (if a leading YAML block is present).
|
|
48
|
+
const fmMatch = normalized.match(/^---\n([\s\S]*?)\n---(\n|$)/);
|
|
49
|
+
if (fmMatch && fmMatch[1] !== undefined) {
|
|
50
|
+
const rawFrontmatter = fmMatch[1];
|
|
51
|
+
const sortedFrontmatter = sortFrontmatter(rawFrontmatter);
|
|
52
|
+
const rest = normalized.slice(fmMatch[0].length);
|
|
53
|
+
normalized = `---\n${sortedFrontmatter}\n---\n${rest}`;
|
|
54
|
+
}
|
|
55
|
+
// 3. Optional pattern stripping (e.g., timestamps).
|
|
56
|
+
if (opts?.stripPatterns) {
|
|
57
|
+
for (const pattern of opts.stripPatterns) {
|
|
58
|
+
// Preserve pattern as-is; callers own whether it's global.
|
|
59
|
+
normalized = normalized.replace(pattern, '');
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
// 4. Whitespace normalization.
|
|
63
|
+
// - Trim trailing whitespace on each line.
|
|
64
|
+
// - Collapse runs of 2+ blank lines to a single blank line.
|
|
65
|
+
const lines = normalized.split('\n').map((line) => line.replace(/[ \t]+$/, ''));
|
|
66
|
+
const collapsed = [];
|
|
67
|
+
let blankRun = 0;
|
|
68
|
+
for (const line of lines) {
|
|
69
|
+
if (line === '') {
|
|
70
|
+
blankRun += 1;
|
|
71
|
+
if (blankRun <= 1)
|
|
72
|
+
collapsed.push(line);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
blankRun = 0;
|
|
76
|
+
collapsed.push(line);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return collapsed.join('\n');
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Sort keys in a YAML frontmatter block alphabetically while preserving the
|
|
83
|
+
* original line formatting (quote style, indentation, block-vs-flow) for each
|
|
84
|
+
* value.
|
|
85
|
+
*
|
|
86
|
+
* Strategy: split the block into top-level key "chunks" — a line starting with
|
|
87
|
+
* `<key>:` at column 0, plus all subsequent lines that are either blank or
|
|
88
|
+
* indented (continuations, block scalar bodies, nested mappings, arrays).
|
|
89
|
+
* Sort chunks by key; rejoin. This round-trips losslessly because we never
|
|
90
|
+
* re-serialize the values.
|
|
91
|
+
*
|
|
92
|
+
* If the frontmatter cannot be parsed as a simple top-level mapping (e.g. it's
|
|
93
|
+
* a scalar or sequence at the root, or there are no top-level key lines), we
|
|
94
|
+
* leave the block untouched. The `yaml` package still validates it — we parse
|
|
95
|
+
* once to confirm it's a mapping, then discard the parsed value.
|
|
96
|
+
*/
|
|
97
|
+
function sortFrontmatter(raw) {
|
|
98
|
+
// Confirm the block parses to a mapping before attempting a line-based sort.
|
|
99
|
+
let parsed;
|
|
100
|
+
try {
|
|
101
|
+
parsed = YAML.parse(raw);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return raw; // malformed — preserve as-is (whitespace pass still applies)
|
|
105
|
+
}
|
|
106
|
+
if (parsed === null ||
|
|
107
|
+
parsed === undefined ||
|
|
108
|
+
typeof parsed !== 'object' ||
|
|
109
|
+
Array.isArray(parsed)) {
|
|
110
|
+
return raw;
|
|
111
|
+
}
|
|
112
|
+
const lines = raw.split('\n');
|
|
113
|
+
// Group lines into chunks keyed by the first top-level `key:` we see.
|
|
114
|
+
// A top-level key line matches: starts with a non-space character, contains `:`,
|
|
115
|
+
// with key made of characters permitted in a YAML plain scalar key.
|
|
116
|
+
const topLevelKeyRe = /^([A-Za-z_][A-Za-z0-9_-]*)\s*:/;
|
|
117
|
+
const chunks = [];
|
|
118
|
+
let preamble = []; // lines before the first key (usually empty)
|
|
119
|
+
let current = null;
|
|
120
|
+
for (const line of lines) {
|
|
121
|
+
const m = line.match(topLevelKeyRe);
|
|
122
|
+
if (m && !line.startsWith(' ') && !line.startsWith('\t')) {
|
|
123
|
+
// New top-level key starts here.
|
|
124
|
+
if (current)
|
|
125
|
+
chunks.push(current);
|
|
126
|
+
current = { key: m[1], lines: [line] };
|
|
127
|
+
}
|
|
128
|
+
else if (current) {
|
|
129
|
+
current.lines.push(line);
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
preamble.push(line);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (current)
|
|
136
|
+
chunks.push(current);
|
|
137
|
+
if (chunks.length === 0)
|
|
138
|
+
return raw;
|
|
139
|
+
chunks.sort((a, b) => (a.key < b.key ? -1 : a.key > b.key ? 1 : 0));
|
|
140
|
+
const out = [...preamble];
|
|
141
|
+
for (const chunk of chunks)
|
|
142
|
+
out.push(...chunk.lines);
|
|
143
|
+
// Drop any trailing empty strings that arose from the original's trailing \n.
|
|
144
|
+
while (out.length > 0 && out[out.length - 1] === '')
|
|
145
|
+
out.pop();
|
|
146
|
+
return out.join('\n');
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=canonical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"canonical.js","sourceRoot":"","sources":["../src/canonical.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AAQxB;;;;;;GAMG;AACH,MAAM,UAAU,YAAY,CAAC,KAAoB,EAAE,IAA0B;IAC3E,OAAO;QACL,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC;QA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AE,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IACrD,8EAA8E;IAC9E,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE;QAAE,GAAG,CAAC,GAAG,EAAE,CAAC;IAC/D,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ExtractedConfigSurface } from './config-types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Render ExtractedConfigSurface[] as SKILL.md inline sections.
|
|
4
|
+
*
|
|
5
|
+
* CLI surfaces → ## Commands
|
|
6
|
+
* Config/env surfaces → ## Configuration
|
|
7
|
+
*/
|
|
8
|
+
export declare function renderConfigSurfaceSection(surfaces: ExtractedConfigSurface[] | undefined): string;
|
|
9
|
+
/**
|
|
10
|
+
* Render ExtractedConfigSurface[] as per-option detail for reference files.
|
|
11
|
+
*
|
|
12
|
+
* CLI surfaces → # Commands with ## commandName / #### --flag
|
|
13
|
+
* Config/env surfaces → # Configuration with ## InterfaceName / #### propertyName
|
|
14
|
+
*/
|
|
15
|
+
export declare function renderConfigReference(surfaces: ExtractedConfigSurface[] | undefined): string;
|
|
16
|
+
//# sourceMappingURL=config-renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-renderer.d.ts","sourceRoot":"","sources":["../src/config-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAyB,MAAM,mBAAmB,CAAC;AAMvF;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,sBAAsB,EAAE,GAAG,SAAS,GAAG,MAAM,CAiBjG;AA8HD;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,sBAAsB,EAAE,GAAG,SAAS,GAAG,MAAM,CAiB5F"}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Inline SKILL.md sections
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
/**
|
|
5
|
+
* Render ExtractedConfigSurface[] as SKILL.md inline sections.
|
|
6
|
+
*
|
|
7
|
+
* CLI surfaces → ## Commands
|
|
8
|
+
* Config/env surfaces → ## Configuration
|
|
9
|
+
*/
|
|
10
|
+
export function renderConfigSurfaceSection(surfaces) {
|
|
11
|
+
if (!surfaces || surfaces.length === 0)
|
|
12
|
+
return '';
|
|
13
|
+
const cli = surfaces.filter((s) => s.sourceType === 'cli');
|
|
14
|
+
const config = surfaces.filter((s) => s.sourceType !== 'cli');
|
|
15
|
+
const parts = [];
|
|
16
|
+
if (cli.length > 0) {
|
|
17
|
+
parts.push(renderCommandsSection(cli));
|
|
18
|
+
}
|
|
19
|
+
if (config.length > 0) {
|
|
20
|
+
parts.push(renderConfigSection(config));
|
|
21
|
+
}
|
|
22
|
+
return parts.join('\n\n');
|
|
23
|
+
}
|
|
24
|
+
function renderCommandsSection(surfaces) {
|
|
25
|
+
const lines = ['## Commands'];
|
|
26
|
+
for (const surface of surfaces) {
|
|
27
|
+
lines.push('');
|
|
28
|
+
lines.push(`### ${surface.name}`);
|
|
29
|
+
if (surface.description) {
|
|
30
|
+
lines.push('');
|
|
31
|
+
lines.push(surface.description);
|
|
32
|
+
}
|
|
33
|
+
if (surface.usage) {
|
|
34
|
+
lines.push('');
|
|
35
|
+
lines.push('**Usage:**');
|
|
36
|
+
lines.push('```');
|
|
37
|
+
lines.push(surface.usage);
|
|
38
|
+
lines.push('```');
|
|
39
|
+
}
|
|
40
|
+
if (surface.options.length > 0) {
|
|
41
|
+
lines.push('');
|
|
42
|
+
lines.push(renderOptionsTable(surface.options, 'cli'));
|
|
43
|
+
}
|
|
44
|
+
if (surface.arguments && surface.arguments.length > 0) {
|
|
45
|
+
lines.push('');
|
|
46
|
+
lines.push('**Arguments:**');
|
|
47
|
+
for (const arg of surface.arguments) {
|
|
48
|
+
const req = arg.required ? ' *(required)*' : '';
|
|
49
|
+
const def = arg.defaultValue ? ` — default: \`${arg.defaultValue}\`` : '';
|
|
50
|
+
const desc = arg.description ? ` — ${arg.description}` : '';
|
|
51
|
+
lines.push(`- \`${arg.name}\`${req}${def}${desc}`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (surface.useWhen && surface.useWhen.length > 0) {
|
|
55
|
+
lines.push('');
|
|
56
|
+
lines.push('**Use when:**');
|
|
57
|
+
for (const item of surface.useWhen) {
|
|
58
|
+
lines.push(`- ${item}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (surface.avoidWhen && surface.avoidWhen.length > 0) {
|
|
62
|
+
lines.push('');
|
|
63
|
+
lines.push('**Avoid when:**');
|
|
64
|
+
for (const item of surface.avoidWhen) {
|
|
65
|
+
lines.push(`- ${item}`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (surface.pitfalls && surface.pitfalls.length > 0) {
|
|
69
|
+
lines.push('');
|
|
70
|
+
lines.push('**Pitfalls:**');
|
|
71
|
+
for (const item of surface.pitfalls) {
|
|
72
|
+
lines.push(`- ${item}`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return lines.join('\n');
|
|
77
|
+
}
|
|
78
|
+
function renderConfigSection(surfaces) {
|
|
79
|
+
const lines = ['## Configuration'];
|
|
80
|
+
// Config tables always go in references/config.md — SKILL.md gets a compact pointer.
|
|
81
|
+
// A single config surface: show name + description + option count + pitfalls.
|
|
82
|
+
// Multiple config surfaces: just point to the reference file.
|
|
83
|
+
if (surfaces.length === 1) {
|
|
84
|
+
const s = surfaces[0];
|
|
85
|
+
const desc = s.description ? ` — ${s.description}` : '';
|
|
86
|
+
lines.push('');
|
|
87
|
+
lines.push(`**${s.name}**${desc} (${s.options.length} options — see references/config.md)`);
|
|
88
|
+
if (s.pitfalls && s.pitfalls.length > 0) {
|
|
89
|
+
lines.push('');
|
|
90
|
+
lines.push('**Pitfalls:**');
|
|
91
|
+
for (const item of s.pitfalls) {
|
|
92
|
+
lines.push(`- ${item}`);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
return lines.join('\n');
|
|
96
|
+
}
|
|
97
|
+
// Multiple surfaces: skip the bullet list — just point to config.md
|
|
98
|
+
lines.push('');
|
|
99
|
+
lines.push(`${surfaces.length} configuration interfaces — see references/config.md for details.`);
|
|
100
|
+
return lines.join('\n');
|
|
101
|
+
}
|
|
102
|
+
function renderOptionsTable(options, mode) {
|
|
103
|
+
const flagCol = mode === 'cli' ? 'Flag' : 'Key';
|
|
104
|
+
const rows = [
|
|
105
|
+
`| ${flagCol} | Type | Required | Default | Env | Description |`,
|
|
106
|
+
`| --- | --- | --- | --- | --- | --- |`
|
|
107
|
+
];
|
|
108
|
+
for (const opt of options) {
|
|
109
|
+
const key = mode === 'cli'
|
|
110
|
+
? opt.cliShort
|
|
111
|
+
? `\`${opt.cliFlag}\` / \`${opt.cliShort}\``
|
|
112
|
+
: `\`${opt.cliFlag ?? opt.name}\``
|
|
113
|
+
: `\`${opt.configKey ?? opt.name}\``;
|
|
114
|
+
const required = opt.required ? 'yes' : 'no';
|
|
115
|
+
const def = opt.defaultValue ? `\`${opt.defaultValue}\`` : '—';
|
|
116
|
+
const env = opt.envVar ? `\`${opt.envVar}\`` : '—';
|
|
117
|
+
const desc = opt.description.replace(/\|/g, '\\|');
|
|
118
|
+
rows.push(`| ${key} | \`${opt.type}\` | ${required} | ${def} | ${env} | ${desc} |`);
|
|
119
|
+
}
|
|
120
|
+
return rows.join('\n');
|
|
121
|
+
}
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
// Detailed reference files
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
/**
|
|
126
|
+
* Render ExtractedConfigSurface[] as per-option detail for reference files.
|
|
127
|
+
*
|
|
128
|
+
* CLI surfaces → # Commands with ## commandName / #### --flag
|
|
129
|
+
* Config/env surfaces → # Configuration with ## InterfaceName / #### propertyName
|
|
130
|
+
*/
|
|
131
|
+
export function renderConfigReference(surfaces) {
|
|
132
|
+
if (!surfaces || surfaces.length === 0)
|
|
133
|
+
return '';
|
|
134
|
+
const cli = surfaces.filter((s) => s.sourceType === 'cli');
|
|
135
|
+
const config = surfaces.filter((s) => s.sourceType !== 'cli');
|
|
136
|
+
const parts = [];
|
|
137
|
+
if (cli.length > 0) {
|
|
138
|
+
parts.push(renderCommandsReference(cli));
|
|
139
|
+
}
|
|
140
|
+
if (config.length > 0) {
|
|
141
|
+
parts.push(renderConfigDetailReference(config));
|
|
142
|
+
}
|
|
143
|
+
return parts.join('\n\n');
|
|
144
|
+
}
|
|
145
|
+
function renderCommandsReference(surfaces) {
|
|
146
|
+
const lines = ['# Commands'];
|
|
147
|
+
for (const surface of surfaces) {
|
|
148
|
+
lines.push('');
|
|
149
|
+
lines.push(`## ${surface.name}`);
|
|
150
|
+
if (surface.description) {
|
|
151
|
+
lines.push('');
|
|
152
|
+
lines.push(surface.description);
|
|
153
|
+
}
|
|
154
|
+
if (surface.usage) {
|
|
155
|
+
lines.push('');
|
|
156
|
+
lines.push('```');
|
|
157
|
+
lines.push(surface.usage);
|
|
158
|
+
lines.push('```');
|
|
159
|
+
}
|
|
160
|
+
if (surface.remarks) {
|
|
161
|
+
lines.push('');
|
|
162
|
+
lines.push(surface.remarks);
|
|
163
|
+
}
|
|
164
|
+
if (surface.options.length > 0) {
|
|
165
|
+
lines.push('');
|
|
166
|
+
lines.push('### Options');
|
|
167
|
+
for (const opt of surface.options) {
|
|
168
|
+
const heading = opt.cliFlag ?? `--${opt.name}`;
|
|
169
|
+
lines.push('');
|
|
170
|
+
lines.push(`#### ${heading}`);
|
|
171
|
+
renderOptionDetail(opt, lines);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (surface.arguments && surface.arguments.length > 0) {
|
|
175
|
+
lines.push('');
|
|
176
|
+
lines.push('### Arguments');
|
|
177
|
+
for (const arg of surface.arguments) {
|
|
178
|
+
lines.push('');
|
|
179
|
+
lines.push(`#### \`${arg.name}\``);
|
|
180
|
+
lines.push('');
|
|
181
|
+
lines.push(arg.description);
|
|
182
|
+
if (arg.required) {
|
|
183
|
+
lines.push('');
|
|
184
|
+
lines.push('**Required:** yes');
|
|
185
|
+
}
|
|
186
|
+
if (arg.variadic) {
|
|
187
|
+
lines.push('');
|
|
188
|
+
lines.push('**Variadic:** yes');
|
|
189
|
+
}
|
|
190
|
+
if (arg.defaultValue) {
|
|
191
|
+
lines.push('');
|
|
192
|
+
lines.push(`**Default:** \`${arg.defaultValue}\``);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (surface.useWhen && surface.useWhen.length > 0) {
|
|
197
|
+
lines.push('');
|
|
198
|
+
lines.push('### Use when');
|
|
199
|
+
for (const item of surface.useWhen) {
|
|
200
|
+
lines.push(`- ${item}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (surface.pitfalls && surface.pitfalls.length > 0) {
|
|
204
|
+
lines.push('');
|
|
205
|
+
lines.push('### NEVER');
|
|
206
|
+
for (const item of surface.pitfalls) {
|
|
207
|
+
lines.push(`- ${item}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
return lines.join('\n');
|
|
212
|
+
}
|
|
213
|
+
function renderConfigDetailReference(surfaces) {
|
|
214
|
+
const lines = ['# Configuration'];
|
|
215
|
+
for (const surface of surfaces) {
|
|
216
|
+
lines.push('');
|
|
217
|
+
lines.push(`## ${surface.name}`);
|
|
218
|
+
if (surface.description) {
|
|
219
|
+
lines.push('');
|
|
220
|
+
lines.push(surface.description);
|
|
221
|
+
}
|
|
222
|
+
if (surface.remarks) {
|
|
223
|
+
lines.push('');
|
|
224
|
+
lines.push(surface.remarks);
|
|
225
|
+
}
|
|
226
|
+
if (surface.options.length > 0) {
|
|
227
|
+
lines.push('');
|
|
228
|
+
lines.push('### Properties');
|
|
229
|
+
for (const opt of surface.options) {
|
|
230
|
+
const heading = opt.configKey ?? opt.name;
|
|
231
|
+
lines.push('');
|
|
232
|
+
lines.push(`#### ${heading}`);
|
|
233
|
+
renderOptionDetail(opt, lines);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
if (surface.useWhen && surface.useWhen.length > 0) {
|
|
237
|
+
lines.push('');
|
|
238
|
+
lines.push('### Use when');
|
|
239
|
+
for (const item of surface.useWhen) {
|
|
240
|
+
lines.push(`- ${item}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
if (surface.pitfalls && surface.pitfalls.length > 0) {
|
|
244
|
+
lines.push('');
|
|
245
|
+
lines.push('### NEVER');
|
|
246
|
+
for (const item of surface.pitfalls) {
|
|
247
|
+
lines.push(`- ${item}`);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
return lines.join('\n');
|
|
252
|
+
}
|
|
253
|
+
function renderOptionDetail(opt, lines) {
|
|
254
|
+
lines.push('');
|
|
255
|
+
lines.push(opt.description);
|
|
256
|
+
lines.push('');
|
|
257
|
+
lines.push(`**Type:** \`${opt.type}\``);
|
|
258
|
+
if (opt.required) {
|
|
259
|
+
lines.push('');
|
|
260
|
+
lines.push('**Required:** yes');
|
|
261
|
+
}
|
|
262
|
+
if (opt.defaultValue) {
|
|
263
|
+
lines.push('');
|
|
264
|
+
lines.push(`**Default:** \`${opt.defaultValue}\``);
|
|
265
|
+
}
|
|
266
|
+
if (opt.envVar) {
|
|
267
|
+
lines.push('');
|
|
268
|
+
lines.push(`**Environment:** \`${opt.envVar}\``);
|
|
269
|
+
}
|
|
270
|
+
if (opt.remarks) {
|
|
271
|
+
lines.push('');
|
|
272
|
+
lines.push(opt.remarks);
|
|
273
|
+
}
|
|
274
|
+
if (opt.useWhen && opt.useWhen.length > 0) {
|
|
275
|
+
lines.push('');
|
|
276
|
+
lines.push('**Use when:**');
|
|
277
|
+
for (const item of opt.useWhen) {
|
|
278
|
+
lines.push(`- ${item}`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
if (opt.avoidWhen && opt.avoidWhen.length > 0) {
|
|
282
|
+
lines.push('');
|
|
283
|
+
lines.push('**Avoid when:**');
|
|
284
|
+
for (const item of opt.avoidWhen) {
|
|
285
|
+
lines.push(`- ${item}`);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
if (opt.pitfalls && opt.pitfalls.length > 0) {
|
|
289
|
+
lines.push('');
|
|
290
|
+
lines.push('**Pitfalls:**');
|
|
291
|
+
for (const item of opt.pitfalls) {
|
|
292
|
+
lines.push(`- ${item}`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=config-renderer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-renderer.js","sourceRoot":"","sources":["../src/config-renderer.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,2BAA2B;AAC3B,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAA8C;IACvF,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAElD,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC;IAC3D,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,KAAK,CAAC,CAAC;IAE9D,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACnB,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,C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C,EAAE,CAAC;QAC9C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;QAC9B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,SAAS,EAAE,CAAC;YACjC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,IAAI,GAAG,CAAC,QAAQ,IAAI,GAAG,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACf,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5B,KAAK,MAAM,IAAI,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC;YAChC,KAAK,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The source type of a configuration surface:
|
|
3
|
+
* - 'cli' — a command-line command or subcommand
|
|
4
|
+
* - 'config' — a configuration file (e.g. JSON, YAML, TOML)
|
|
5
|
+
* - 'env' — environment variables
|
|
6
|
+
*/
|
|
7
|
+
export type ConfigSourceType = 'cli' | 'config' | 'env';
|
|
8
|
+
/**
|
|
9
|
+
* Describes a single configuration surface: a CLI command, config file schema,
|
|
10
|
+
* or environment-variable group that an agent may need to invoke or populate.
|
|
11
|
+
*/
|
|
12
|
+
export interface ExtractedConfigSurface {
|
|
13
|
+
/** Human-readable name of this surface (e.g. "build", "jest.config.ts") */
|
|
14
|
+
name: string;
|
|
15
|
+
/** Short prose description of what this surface controls or triggers */
|
|
16
|
+
description: string;
|
|
17
|
+
/**
|
|
18
|
+
* The kind of surface: CLI command/subcommand, config file, or env-var group.
|
|
19
|
+
* Agents use this to decide how to surface the information (flag syntax vs key
|
|
20
|
+
* path vs environment variable name).
|
|
21
|
+
*/
|
|
22
|
+
sourceType: ConfigSourceType;
|
|
23
|
+
/**
|
|
24
|
+
* Optional canonical usage example (e.g. `pnpm build --watch`).
|
|
25
|
+
* Shown verbatim so agents can copy-paste directly.
|
|
26
|
+
*/
|
|
27
|
+
usage?: string;
|
|
28
|
+
/** All options (flags, config keys, env vars) accepted by this surface */
|
|
29
|
+
options: ExtractedConfigOption[];
|
|
30
|
+
/** Positional arguments accepted by this CLI surface, in order */
|
|
31
|
+
arguments?: ExtractedConfigArgument[];
|
|
32
|
+
/** Nested subcommands of this CLI surface (recursive) */
|
|
33
|
+
subcommands?: ExtractedConfigSurface[];
|
|
34
|
+
/**
|
|
35
|
+
* Conditions under which an agent should prefer this surface.
|
|
36
|
+
* Mirrors the @useWhen JSDoc pattern used elsewhere in ExtractedSkill.
|
|
37
|
+
*/
|
|
38
|
+
useWhen?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Conditions under which an agent should avoid this surface.
|
|
41
|
+
* Mirrors the @avoidWhen JSDoc pattern used elsewhere in ExtractedSkill.
|
|
42
|
+
*/
|
|
43
|
+
avoidWhen?: string[];
|
|
44
|
+
/**
|
|
45
|
+
* Known pitfalls, footguns, or common mistakes for this surface.
|
|
46
|
+
* Mirrors the @never JSDoc pattern used elsewhere in ExtractedSkill.
|
|
47
|
+
*/
|
|
48
|
+
pitfalls?: string[];
|
|
49
|
+
/**
|
|
50
|
+
* Extended expert notes about this surface — edge cases, interaction effects,
|
|
51
|
+
* or nuances not captured by the description. Mirrors the @remarks JSDoc pattern.
|
|
52
|
+
*/
|
|
53
|
+
remarks?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A single configurable option within a surface: a CLI flag, a config-file key,
|
|
57
|
+
* or an environment variable (or any combination of the three).
|
|
58
|
+
*/
|
|
59
|
+
export interface ExtractedConfigOption {
|
|
60
|
+
/** Canonical name for this option (used as the display key) */
|
|
61
|
+
name: string;
|
|
62
|
+
/**
|
|
63
|
+
* The long CLI flag for this option, including leading dashes
|
|
64
|
+
* (e.g. `--output-dir`). Omit if this option is not exposed via CLI.
|
|
65
|
+
*/
|
|
66
|
+
cliFlag?: string;
|
|
67
|
+
/**
|
|
68
|
+
* The short CLI flag alias (e.g. `-o`).
|
|
69
|
+
* Omit if there is no short form.
|
|
70
|
+
*/
|
|
71
|
+
cliShort?: string;
|
|
72
|
+
/**
|
|
73
|
+
* The dot-notation key path in a config file (e.g. `output.dir`).
|
|
74
|
+
* Omit if this option is not settable in a config file.
|
|
75
|
+
*/
|
|
76
|
+
configKey?: string;
|
|
77
|
+
/**
|
|
78
|
+
* The environment variable name that sets this option (e.g. `OUTPUT_DIR`).
|
|
79
|
+
* Omit if this option is not settable via environment variable.
|
|
80
|
+
*/
|
|
81
|
+
envVar?: string;
|
|
82
|
+
/**
|
|
83
|
+
* TypeScript-style type expression for the accepted value
|
|
84
|
+
* (e.g. `string`, `number`, `boolean`, `'esm' | 'cjs'`).
|
|
85
|
+
*/
|
|
86
|
+
type: string;
|
|
87
|
+
/** Short prose description of what this option controls */
|
|
88
|
+
description: string;
|
|
89
|
+
/** Whether this option must be supplied for the surface to function */
|
|
90
|
+
required: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* The default value when the option is not explicitly set.
|
|
93
|
+
* Serialised as a string (e.g. `"true"`, `"4000"`, `"\"dist\""`).
|
|
94
|
+
*/
|
|
95
|
+
defaultValue?: string;
|
|
96
|
+
/**
|
|
97
|
+
* Extended expert notes about this option — interaction effects, precedence
|
|
98
|
+
* rules, or platform-specific behaviour.
|
|
99
|
+
*/
|
|
100
|
+
remarks?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Conditions under which an agent should set this option.
|
|
103
|
+
* Mirrors the @useWhen JSDoc pattern.
|
|
104
|
+
*/
|
|
105
|
+
useWhen?: string[];
|
|
106
|
+
/**
|
|
107
|
+
* Conditions under which an agent should avoid setting this option.
|
|
108
|
+
* Mirrors the @avoidWhen JSDoc pattern.
|
|
109
|
+
*/
|
|
110
|
+
avoidWhen?: string[];
|
|
111
|
+
/**
|
|
112
|
+
* Known pitfalls or common mistakes when using this option.
|
|
113
|
+
* Mirrors the @never JSDoc pattern.
|
|
114
|
+
*/
|
|
115
|
+
pitfalls?: string[];
|
|
116
|
+
/**
|
|
117
|
+
* Logical grouping label for this option (e.g. "Output", "Performance").
|
|
118
|
+
* Agents can use this to cluster related options in generated documentation.
|
|
119
|
+
*/
|
|
120
|
+
category?: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A positional command-line argument accepted by a CLI surface.
|
|
124
|
+
* Positional arguments are ordered and do not use flag prefixes.
|
|
125
|
+
*/
|
|
126
|
+
export interface ExtractedConfigArgument {
|
|
127
|
+
/** Symbolic name of this argument as shown in usage strings (e.g. `<file>`) */
|
|
128
|
+
name: string;
|
|
129
|
+
/** Short prose description of what this argument represents */
|
|
130
|
+
description: string;
|
|
131
|
+
/** Whether the caller must supply this argument */
|
|
132
|
+
required: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Whether this argument is variadic (accepts one or more values,
|
|
135
|
+
* typically represented as `...<files>` in usage strings).
|
|
136
|
+
*/
|
|
137
|
+
variadic: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* The default value used when the argument is omitted (only meaningful
|
|
140
|
+
* when `required` is false). Serialised as a string.
|
|
141
|
+
*/
|
|
142
|
+
defaultValue?: string;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=config-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-types.d.ts","sourceRoot":"","sources":["../src/config-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,QAAQ,GAAG,KAAK,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,2EAA2E;IAC3E,IAAI,EAAE,MAAM,CAAC;IAEb,wEAAwE;IACxE,WAAW,EAAE,MAAM,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