@vertesia/build-tools 1.5.0-dev.20260725.083715Z → 1.5.0-dev.20260804.124748Z

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 (59) hide show
  1. package/README.md +297 -266
  2. package/lib/bin/build.js +26 -1
  3. package/lib/bin/build.js.map +1 -1
  4. package/lib/bin/config.d.ts +12 -0
  5. package/lib/bin/config.d.ts.map +1 -1
  6. package/lib/bin/config.js +25 -0
  7. package/lib/bin/config.js.map +1 -1
  8. package/lib/core/skill-markdown/load-catalog.d.ts +30 -0
  9. package/lib/core/skill-markdown/load-catalog.d.ts.map +1 -0
  10. package/lib/core/skill-markdown/load-catalog.js +69 -0
  11. package/lib/core/skill-markdown/load-catalog.js.map +1 -0
  12. package/lib/core/skill-markdown/preprocess.d.ts +127 -0
  13. package/lib/core/skill-markdown/preprocess.d.ts.map +1 -0
  14. package/lib/core/skill-markdown/preprocess.js +455 -0
  15. package/lib/core/skill-markdown/preprocess.js.map +1 -0
  16. package/lib/core/skill-markdown/schema-validator.d.ts +109 -0
  17. package/lib/core/skill-markdown/schema-validator.d.ts.map +1 -0
  18. package/lib/core/skill-markdown/schema-validator.js +420 -0
  19. package/lib/core/skill-markdown/schema-validator.js.map +1 -0
  20. package/lib/core/transformers/index.d.ts +1 -1
  21. package/lib/core/transformers/index.d.ts.map +1 -1
  22. package/lib/core/transformers/index.js +1 -1
  23. package/lib/core/transformers/index.js.map +1 -1
  24. package/lib/core/transformers/skill.d.ts +15 -1
  25. package/lib/core/transformers/skill.d.ts.map +1 -1
  26. package/lib/core/transformers/skill.js +82 -60
  27. package/lib/core/transformers/skill.js.map +1 -1
  28. package/lib/import-transform/detector.d.ts +19 -6
  29. package/lib/import-transform/detector.d.ts.map +1 -1
  30. package/lib/import-transform/detector.js +73 -24
  31. package/lib/import-transform/detector.js.map +1 -1
  32. package/lib/import-transform/index.d.ts.map +1 -1
  33. package/lib/import-transform/index.js +10 -1
  34. package/lib/import-transform/index.js.map +1 -1
  35. package/lib/import-transform/patterns.d.ts +7 -8
  36. package/lib/import-transform/patterns.d.ts.map +1 -1
  37. package/lib/import-transform/patterns.js +7 -8
  38. package/lib/import-transform/patterns.js.map +1 -1
  39. package/lib/index.d.ts +7 -3
  40. package/lib/index.d.ts.map +1 -1
  41. package/lib/index.js +9 -3
  42. package/lib/index.js.map +1 -1
  43. package/lib/vite/dev-server.d.ts +10 -0
  44. package/lib/vite/dev-server.d.ts.map +1 -1
  45. package/lib/vite/dev-server.js +36 -4
  46. package/lib/vite/dev-server.js.map +1 -1
  47. package/package.json +9 -12
  48. package/src/bin/build.ts +31 -2
  49. package/src/bin/config.ts +27 -0
  50. package/src/core/skill-markdown/load-catalog.ts +100 -0
  51. package/src/core/skill-markdown/preprocess.ts +632 -0
  52. package/src/core/skill-markdown/schema-validator.ts +517 -0
  53. package/src/core/transformers/index.ts +3 -0
  54. package/src/core/transformers/skill.ts +116 -53
  55. package/src/import-transform/detector.ts +78 -26
  56. package/src/import-transform/index.ts +12 -2
  57. package/src/import-transform/patterns.ts +7 -12
  58. package/src/index.ts +35 -2
  59. package/src/vite/dev-server.ts +52 -4
@@ -0,0 +1,420 @@
1
+ /**
2
+ * A ready-made `validateExample` for `preprocessSkillMarkdown`.
3
+ *
4
+ * The preprocessor deliberately knows nothing about schemas — it hands each `tool=`-tagged
5
+ * payload to a callback. This module is the callback most consumers want: JSON Schema validation
6
+ * plus the one thing JSON Schema structurally cannot do.
7
+ *
8
+ * That gap is dispatchers. A tool like `batch_execute` declares `tool_name: { type: 'string' }`
9
+ * and an opaque `input` object, so AJV accepts `{"tool_name": "web_search", "input": {...}}` even
10
+ * when `web_search` does not exist and the input belongs to a different tool's schema. A
11
+ * `dispatch` descriptor names the field carrying the tool name and the field carrying its
12
+ * payload, which is enough to resolve one against the registry and validate the other against the
13
+ * *dispatched* tool.
14
+ *
15
+ * Input is plain data — names, JSON Schemas, descriptors — so this stays independent of any
16
+ * particular tool registry.
17
+ */
18
+ import { Ajv } from 'ajv';
19
+ /**
20
+ * Walk a dotted/`[]` path, returning every value found.
21
+ *
22
+ * `inputs[].input` over `{inputs: [{input: A}, {input: B}]}` yields `[A, B]`. Missing segments
23
+ * yield nothing rather than `undefined`, so callers cannot mistake absence for a null payload.
24
+ */
25
+ export function nodesAtPath(value, path) {
26
+ let current = [value];
27
+ for (const segment of path.split('.')) {
28
+ const isArray = segment.endsWith('[]');
29
+ const key = isArray ? segment.slice(0, -2) : segment;
30
+ const next = [];
31
+ for (const node of current) {
32
+ if (typeof node !== 'object' || node === null) {
33
+ continue;
34
+ }
35
+ const child = node[key];
36
+ if (child === undefined) {
37
+ continue;
38
+ }
39
+ if (isArray) {
40
+ if (Array.isArray(child)) {
41
+ next.push(...child);
42
+ }
43
+ }
44
+ else {
45
+ next.push(child);
46
+ }
47
+ }
48
+ current = next;
49
+ }
50
+ return current;
51
+ }
52
+ /** Path values narrowed to strings — used for fields that carry a tool name. */
53
+ export function toolNamesAtPath(value, path) {
54
+ return nodesAtPath(value, path).filter((v) => typeof v === 'string');
55
+ }
56
+ /** Walk the same dotted/`[]` path through a JSON Schema rather than through a value. */
57
+ export function schemaNodeAtPath(schema, path) {
58
+ let node = schema;
59
+ for (const segment of path.split('.')) {
60
+ const isArray = segment.endsWith('[]');
61
+ const key = isArray ? segment.slice(0, -2) : segment;
62
+ const properties = node?.properties;
63
+ node = properties?.[key];
64
+ if (isArray) {
65
+ node = node?.items;
66
+ }
67
+ if (!node) {
68
+ return undefined;
69
+ }
70
+ }
71
+ return node;
72
+ }
73
+ /** `~1` and `~0` are the JSON Pointer escapes for `/` and `~`. */
74
+ function unescapePointer(segment) {
75
+ return segment.replace(/~1/g, '/').replace(/~0/g, '~');
76
+ }
77
+ function isSchemaObject(value) {
78
+ return typeof value === 'object' && value !== null;
79
+ }
80
+ /** Enter a node, making it a resolution root when it declares definitions or its own identity. */
81
+ function descend(node, roots) {
82
+ const isResource = node.$defs !== undefined || node.definitions !== undefined || node.$id !== undefined;
83
+ return { node, roots: isResource ? [node, ...roots] : roots };
84
+ }
85
+ /**
86
+ * Follow a local `$ref` to the node it names.
87
+ *
88
+ * Only same-document pointers are resolved. An external or remote reference is *not* guessed at:
89
+ * the caller reports it, because silently treating an unresolved reference as "field absent" would
90
+ * blame the author for the schema's shape.
91
+ */
92
+ function followRef(ref, roots) {
93
+ if (ref === '#') {
94
+ return roots[0];
95
+ }
96
+ if (!ref.startsWith('#/')) {
97
+ return undefined;
98
+ }
99
+ const segments = ref.slice(2).split('/').map(unescapePointer);
100
+ for (const root of roots) {
101
+ let node = root;
102
+ for (const segment of segments) {
103
+ node = isSchemaObject(node) ? node[segment] : undefined;
104
+ }
105
+ if (isSchemaObject(node)) {
106
+ return node;
107
+ }
108
+ }
109
+ return undefined;
110
+ }
111
+ /**
112
+ * The branches a schema node offers: itself, its composition branches, and whatever its `$ref`
113
+ * points at, all flattened.
114
+ *
115
+ * A walk that stopped at a composed or referenced node would report a field that plainly exists as
116
+ * missing, which for a fail-closed check is worse than not checking. Unresolvable references are
117
+ * collected rather than ignored, so the caller can say so instead of blaming the field.
118
+ */
119
+ function branchesOf(cursor, unresolved, seen = new Set()) {
120
+ if (seen.has(cursor.node)) {
121
+ // A recursive `$ref` (a tree node whose children are the same type) would loop forever.
122
+ return [];
123
+ }
124
+ seen.add(cursor.node);
125
+ const here = descend(cursor.node, cursor.roots);
126
+ const out = [here];
127
+ const ref = here.node.$ref;
128
+ if (typeof ref === 'string') {
129
+ const target = followRef(ref, here.roots);
130
+ if (target) {
131
+ out.push(...branchesOf({ node: target, roots: here.roots }, unresolved, seen));
132
+ }
133
+ else {
134
+ unresolved.push(ref);
135
+ }
136
+ }
137
+ for (const group of [here.node.anyOf, here.node.oneOf, here.node.allOf]) {
138
+ for (const branch of Array.isArray(group) ? group : []) {
139
+ if (isSchemaObject(branch)) {
140
+ out.push(...branchesOf({ node: branch, roots: here.roots }, unresolved, seen));
141
+ }
142
+ }
143
+ }
144
+ return out;
145
+ }
146
+ /** One step of a dotted/`[]` path, across composition branches and local references. */
147
+ function stepInto(cursors, segment, unresolved) {
148
+ const isArray = segment.endsWith('[]');
149
+ const key = isArray ? segment.slice(0, -2) : segment;
150
+ const found = [];
151
+ for (const branch of cursors.flatMap((cursor) => branchesOf(cursor, unresolved))) {
152
+ const properties = branch.node.properties;
153
+ const child = properties?.[key];
154
+ if (!isSchemaObject(child)) {
155
+ continue;
156
+ }
157
+ const target = isArray ? child.items : child;
158
+ if (isSchemaObject(target)) {
159
+ found.push({ node: target, roots: branch.roots });
160
+ }
161
+ }
162
+ return found;
163
+ }
164
+ /** Property names declared at a node, across branches and references, for a "did you mean" list. */
165
+ function propertyNamesOf(cursors) {
166
+ const names = new Set();
167
+ for (const branch of cursors.flatMap((cursor) => branchesOf(cursor, []))) {
168
+ for (const name of Object.keys(branch.node.properties ?? {})) {
169
+ names.add(name);
170
+ }
171
+ }
172
+ return [...names].sort();
173
+ }
174
+ /**
175
+ * Build a `validateField` callback over a set of tools.
176
+ *
177
+ * A skill that says a tool "takes `query` as an object" is making a claim about that tool's
178
+ * schema, and it is exactly the claim that rots when a parameter is renamed. `{@param …}` states
179
+ * the claim so this can check it.
180
+ *
181
+ * Every path that cannot be judged is reported rather than passed: a tool absent from these
182
+ * entries, a tool with no visible schema, a reference that does not resolve. A construct that
183
+ * looks checked while checking nothing is the failure mode a `tool=` tag on an unvalidatable tool
184
+ * is already rejected for, and it is worse here — `{@param …}` exists only to be checked.
185
+ */
186
+ export function createSchemaFieldValidator(tools) {
187
+ const byName = new Map(tools.map((t) => [t.name, t]));
188
+ return ({ tool: toolName, path }) => {
189
+ const tool = byName.get(toolName);
190
+ if (!tool) {
191
+ // The preprocessor resolves the name against the catalog before calling this, so
192
+ // reaching here means the catalog's names and its schema entries disagree.
193
+ return [`cannot be checked: '${toolName}' is absent from this build's schema entries`];
194
+ }
195
+ if (!tool.params) {
196
+ return [`cannot be checked: '${toolName}' exposes no schema to this build`];
197
+ }
198
+ let cursors = [{ node: tool.params, roots: [] }];
199
+ const walked = [];
200
+ for (const segment of path.split('.')) {
201
+ const unresolved = [];
202
+ const next = stepInto(cursors, segment, unresolved);
203
+ if (next.length === 0) {
204
+ const where = walked.length > 0 ? `'${walked.join('.')}' of ` : '';
205
+ if (unresolved.length > 0) {
206
+ // Reporting "does not declare" here would blame the author for the schema's
207
+ // shape — the field may well exist behind the reference.
208
+ return [
209
+ `cannot be checked: reaching '${segment}' crosses ${where}'${toolName}' at ` +
210
+ `an unresolvable reference ('${unresolved[0]}')`,
211
+ ];
212
+ }
213
+ const available = propertyNamesOf(cursors);
214
+ return [
215
+ `names '${segment}', which ${where}'${toolName}' does not declare` +
216
+ (available.length > 0 ? ` (declared: ${available.join(', ')})` : ''),
217
+ ];
218
+ }
219
+ walked.push(segment);
220
+ cursors = next;
221
+ }
222
+ return [];
223
+ };
224
+ }
225
+ /** A string, or an array of strings. Anything else cannot carry a tool name. */
226
+ function carriesToolName(node) {
227
+ if (!node) {
228
+ return false;
229
+ }
230
+ if (node.type === 'string') {
231
+ return true;
232
+ }
233
+ const items = node.items;
234
+ return node.type === 'array' && items?.type === 'string';
235
+ }
236
+ /**
237
+ * Is the descriptor coherent with the tool's own schema?
238
+ *
239
+ * Returns the problems, empty when sound. Callers treat a problem as an error rather than
240
+ * skipping the check: a descriptor pointing at a renamed field would otherwise disable dispatcher
241
+ * validation for that tool silently, which is the worst possible failure for a safety net.
242
+ */
243
+ export function checkDispatchDescriptor(tool) {
244
+ const dispatch = tool.dispatch;
245
+ if (!dispatch || !tool.params) {
246
+ return [];
247
+ }
248
+ const fieldNode = schemaNodeAtPath(tool.params, dispatch.field);
249
+ if (!fieldNode) {
250
+ return [`dispatch.field '${dispatch.field}' does not exist in the params schema`];
251
+ }
252
+ if (!carriesToolName(fieldNode)) {
253
+ return [
254
+ `dispatch.field '${dispatch.field}' is not a string or array of strings, so it cannot carry a tool name`,
255
+ ];
256
+ }
257
+ if (dispatch.inputField && !schemaNodeAtPath(tool.params, dispatch.inputField)) {
258
+ return [`dispatch.inputField '${dispatch.inputField}' does not exist in the params schema`];
259
+ }
260
+ return [];
261
+ }
262
+ /**
263
+ * Resolve every dispatched name a payload carries, honouring the descriptor's deny list.
264
+ *
265
+ * Shared so the build gate and the repository audit apply one rule. They differ only in how they
266
+ * report: one throws a build error, the other builds a `Finding` with a file and a subject.
267
+ */
268
+ export function resolveDispatchedNames(tool, value, lookup) {
269
+ const dispatch = tool.dispatch;
270
+ if (!dispatch) {
271
+ return [];
272
+ }
273
+ const deny = new Set(dispatch.deny ?? []);
274
+ return toolNamesAtPath(value, dispatch.field).map((written) => {
275
+ const name = dispatch.stripsSelectionPrefix && (written.startsWith('+') || written.startsWith('-'))
276
+ ? written.slice(1)
277
+ : written;
278
+ if (deny.has(name)) {
279
+ return { name, problem: `names '${written}', which this dispatcher refuses at runtime` };
280
+ }
281
+ const target = lookup(name);
282
+ return target
283
+ ? { name, tool: target }
284
+ : { name, problem: `names '${written}', which is not a registered tool` };
285
+ });
286
+ }
287
+ /**
288
+ * Pair each forwarded payload with the tool that will receive it.
289
+ *
290
+ * One dispatched name applies to every input; otherwise pair positionally. Any other shape is
291
+ * ambiguous and yields no pairing — guessing there would manufacture exactly the false positives
292
+ * this whole mechanism exists to avoid.
293
+ */
294
+ export function pairDispatchedInputs(tool, value, dispatched) {
295
+ const inputField = tool.dispatch?.inputField;
296
+ if (!inputField || dispatched.length === 0) {
297
+ return [];
298
+ }
299
+ const inputs = nodesAtPath(value, inputField);
300
+ const pairs = [];
301
+ for (const [index, input] of inputs.entries()) {
302
+ const target = dispatched.length === 1
303
+ ? dispatched[0]
304
+ : dispatched.length === inputs.length
305
+ ? dispatched[index]
306
+ : undefined;
307
+ if (target && typeof input === 'object' && input !== null) {
308
+ pairs.push({ target, input: input });
309
+ }
310
+ }
311
+ return pairs;
312
+ }
313
+ /** Mirrors the agent runtime's AJV configuration, so the build judges what the runtime judges. */
314
+ /**
315
+ * Sanity-check that a tagged payload plausibly belongs to the tool it names.
316
+ *
317
+ * A tag is a claim that the payload below is *this tool's* payload, but schema validation only
318
+ * enforces that claim for schemas that close over their properties. Against a permissive one, a
319
+ * payload meant for some other tool sails through: a `batch_execute` call tagged `list_artifacts`
320
+ * passed for months, and with it a dispatched tool name that does not exist — the tag had moved
321
+ * the example out of reach of the very check that would have caught it.
322
+ *
323
+ * Sharing not one field with the tool's schema is the signal, and it detects only gross mismatch.
324
+ * Generic names — `id`, `name`, `query` — are declared by many tools, so a wrongly tagged payload
325
+ * built from those still passes. This is a floor, not proof of correct binding; heading agreement
326
+ * (see `preprocessSkillMarkdown`) covers the cases where the author stated the tool in prose.
327
+ *
328
+ * Deliberately weak in the other direction too: any overlap at all is accepted, so a payload using
329
+ * an optional subset stays quiet, and a schema that declares nothing is skipped rather than guessed.
330
+ */
331
+ function checkBinding(toolName, tool, value) {
332
+ if (!isSchemaObject(tool.params) || Array.isArray(value) || !isSchemaObject(value)) {
333
+ return [];
334
+ }
335
+ const declared = new Set(propertyNamesOf([descend(tool.params, [tool.params])]));
336
+ const keys = Object.keys(value);
337
+ if (declared.size === 0 || keys.length === 0 || keys.some((key) => declared.has(key))) {
338
+ return [];
339
+ }
340
+ return [
341
+ `is tagged for '${toolName}', which declares none of the payload's fields ` +
342
+ `(${keys.join(', ')}); check that the tag names the intended tool`,
343
+ ];
344
+ }
345
+ function createAjv() {
346
+ return new Ajv({ allErrors: true, coerceTypes: true, strict: false });
347
+ }
348
+ function describeErrors(validate) {
349
+ return (validate.errors ?? [])
350
+ .slice(0, 4)
351
+ .map((e) => {
352
+ // AJV omits the offending key from its `additionalProperties` text, and that key is
353
+ // almost always the answer — a renamed or invented parameter.
354
+ const offender = e.params?.additionalProperty;
355
+ return `${e.instancePath || '/'} ${e.message}${offender ? ` ('${offender}')` : ''}`;
356
+ })
357
+ .join('; ');
358
+ }
359
+ /**
360
+ * Build a `validateExample` callback over a set of tools.
361
+ *
362
+ * Returns human-readable problems; an empty array means the example is valid. Tools without a
363
+ * schema are skipped rather than guessed at.
364
+ */
365
+ export function createSchemaExampleValidator(tools) {
366
+ const ajv = createAjv();
367
+ const byName = new Map(tools.map((t) => [t.name, t]));
368
+ const validators = new Map();
369
+ const uncompilable = new Map();
370
+ for (const tool of tools) {
371
+ if (!tool.params) {
372
+ continue;
373
+ }
374
+ try {
375
+ validators.set(tool.name, ajv.compile(tool.params));
376
+ }
377
+ catch (err) {
378
+ uncompilable.set(tool.name, err.message);
379
+ }
380
+ }
381
+ const validateAgainst = (name, value, describe) => {
382
+ const validate = validators.get(name);
383
+ if (!validate) {
384
+ const reason = uncompilable.get(name);
385
+ // A schema AJV cannot compile is a real problem, but not this example's problem.
386
+ return reason ? [describe(`could not be checked: '${name}' has an uncompilable schema (${reason})`)] : [];
387
+ }
388
+ // AJV coerces in place; validate a copy so the caller's value is untouched.
389
+ return validate(structuredClone(value)) ? [] : [describe(describeErrors(validate))];
390
+ };
391
+ return ({ tool: toolName, value }) => {
392
+ const tool = byName.get(toolName);
393
+ if (!tool) {
394
+ // The preprocessor already reports an unknown tag; nothing to add.
395
+ return [];
396
+ }
397
+ const errors = validateAgainst(toolName, value, (detail) => `does not satisfy the schema of '${toolName}': ${detail}`);
398
+ errors.push(...checkBinding(toolName, tool, value));
399
+ if (!tool.dispatch) {
400
+ return errors;
401
+ }
402
+ // Fail closed on an incoherent descriptor: it would otherwise disable the checks below.
403
+ const descriptorProblems = checkDispatchDescriptor(tool);
404
+ if (descriptorProblems.length > 0) {
405
+ return [...errors, ...descriptorProblems.map((p) => `cannot be checked: '${toolName}' ${p}`)];
406
+ }
407
+ const resolutions = resolveDispatchedNames(tool, value, (name) => byName.get(name));
408
+ for (const resolution of resolutions) {
409
+ if (resolution.problem) {
410
+ errors.push(resolution.problem);
411
+ }
412
+ }
413
+ const dispatched = resolutions.flatMap((r) => (r.tool ? [r.tool] : []));
414
+ for (const { target, input } of pairDispatchedInputs(tool, value, dispatched)) {
415
+ errors.push(...validateAgainst(target.name, input, (detail) => `forwards an input to '${target.name}' that does not satisfy its schema: ${detail}`));
416
+ }
417
+ return errors;
418
+ };
419
+ }
420
+ //# sourceMappingURL=schema-validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema-validator.js","sourceRoot":"","sources":["../../../src/core/skill-markdown/schema-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,GAAG,EAAyB,MAAM,KAAK,CAAC;AAwBjD;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc,EAAE,IAAY;IACpD,IAAI,OAAO,GAAc,CAAC,KAAK,CAAC,CAAC;IACjC,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;QACpC,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACrD,MAAM,IAAI,GAAc,EAAE,CAAC;QAC3B,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;YACzB,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;gBAC5C,SAAS;YACb,CAAC;YACD,MAAM,KAAK,GAAI,IAAgC,CAAC,GAAG,CAAC,CAAC;YACrD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBACtB,SAAS;YACb,CAAC;YACD,IAAI,OAAO,EAAE,CAAC;gBACV,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;oBACvB,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;gBACxB,CAAC;YACL,CAAC;iBAAM,CAAC;gBACJ,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACrB,CAAC;QACL,C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D,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAuB,QAAQ,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;QAClG,CAAC;QAED,MAAM,WAAW,GAAG,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QACpF,KAAK,MAAM,UAAU,IAAI,WAAW,EAAE,CAAC;YACnC,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;gBACrB,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;YACpC,CAAC;QACL,CAAC;QAED,MAAM,UAAU,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACxE,KAAK,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,oBAAoB,CAAC,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;YAC5E,MAAM,CAAC,IAAI,CACP,GAAG,eAAe,CACd,MAAM,CAAC,IAAI,EACX,KAAK,EACL,CAAC,MAAM,EAAE,EAAE,CAAC,yBAAyB,MAAM,CAAC,IAAI,uCAAuC,MAAM,EAAE,CAClG,CACJ,CAAC;QACN,CAAC;QAED,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;AACN,CAAC"}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export { type PromptContentType, type PromptDefinition, PromptDefinitionSchema, PromptRole, promptTransformer, TemplateType, } from './prompt.js';
5
5
  export { rawTransformer } from './raw.js';
6
- export { type SkillContentType, type SkillDefinition, SkillDefinitionSchema, SkillPropertiesSchema, skillTransformer, } from './skill.js';
6
+ export { createSkillTransformer, isSkillTransformer, type SkillContentType, type SkillDefinition, SkillDefinitionSchema, SkillPropertiesSchema, type SkillTransformerConfig, skillTransformer, } from './skill.js';
7
7
  export { skillCollectionTransformer } from './skill-collection.js';
8
8
  export { type RenderingTemplateDefinition, RenderingTemplateDefinitionSchema, templateTransformer, } from './template.js';
9
9
  export { templateCollectionTransformer } from './template-collection.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/transformers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,UAAU,EACV,iBAAiB,EACjB,YAAY,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACH,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACH,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,mBAAmB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/transformers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,sBAAsB,EACtB,UAAU,EACV,iBAAiB,EACjB,YAAY,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACH,sBAAsB,EACtB,kBAAkB,EAClB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,KAAK,sBAAsB,EAC3B,gBAAgB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EACH,KAAK,2BAA2B,EAChC,iCAAiC,EACjC,mBAAmB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export { PromptDefinitionSchema, PromptRole, promptTransformer, TemplateType, } from './prompt.js';
5
5
  export { rawTransformer } from './raw.js';
6
- export { SkillDefinitionSchema, SkillPropertiesSchema, skillTransformer, } from './skill.js';
6
+ export { createSkillTransformer, isSkillTransformer, SkillDefinitionSchema, SkillPropertiesSchema, skillTransformer, } from './skill.js';
7
7
  export { skillCollectionTransformer } from './skill-collection.js';
8
8
  export { RenderingTemplateDefinitionSchema, templateTransformer, } from './template.js';
9
9
  export { templateCollectionTransformer } from './template-collection.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/transformers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGH,sBAAsB,EACtB,UAAU,EACV,iBAAiB,EACjB,YAAY,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAGH,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAEH,iCAAiC,EACjC,mBAAmB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/core/transformers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAGH,sBAAsB,EACtB,UAAU,EACV,iBAAiB,EACjB,YAAY,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EACH,sBAAsB,EACtB,kBAAkB,EAGlB,qBAAqB,EACrB,qBAAqB,EAErB,gBAAgB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAEH,iCAAiC,EACjC,mBAAmB,GACtB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC"}
@@ -2,7 +2,8 @@
2
2
  * Skill transformer preset for markdown files with frontmatter
3
3
  */
4
4
  import { z } from 'zod';
5
- import type { TransformerPreset } from '../types.js';
5
+ import { type PreprocessSkillMarkdownOptions } from '../skill-markdown/preprocess.js';
6
+ import type { TransformerPreset, TransformerRule } from '../types.js';
6
7
  /**
7
8
  * Content type for skill instructions
8
9
  */
@@ -107,5 +108,18 @@ export type SkillDefinition = z.infer<typeof SkillDefinitionSchema>;
107
108
  * // Both are SkillDefinition objects
108
109
  * ```
109
110
  */
111
+ export interface SkillTransformerConfig {
112
+ /**
113
+ * Catalog used to resolve `{@tool …}` / `{@skill …}` and validate `tool=`-tagged examples.
114
+ *
115
+ * Supplied by the consuming build, never discovered here: a transformer that went looking
116
+ * for a registry would couple build-tools to whichever package happens to own one.
117
+ */
118
+ markdown?: PreprocessSkillMarkdownOptions;
119
+ }
120
+ /** True when `rule` is a skill transformer produced by `createSkillTransformer`. */
121
+ export declare function isSkillTransformer(rule: TransformerRule): boolean;
122
+ /** Build a skill transformer bound to a specific catalog. `skillTransformer` is the unbound one. */
123
+ export declare function createSkillTransformer(config?: SkillTransformerConfig): TransformerPreset;
110
124
  export declare const skillTransformer: TransformerPreset;
111
125
  //# sourceMappingURL=skill.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../../src/core/transformers/skill.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,KAAK,CAAC;AAwF5C;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBhB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgD,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAsGpE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAqE9B,CAAC"}
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../../src/core/transformers/skill.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEH,KAAK,8BAA8B,EAEtC,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,eAAe,EAAmB,MAAM,aAAa,CAAC;AAGvF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,KAAK,CAAC;AAyF5C;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoBhB,CAAC;AAEnB;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAgD,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAyGpE;;;;;;;;;;;;;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