@vertesia/build-tools 1.0.0-dev.20260203.130115Z → 1.0.0-dev.20260227.104700Z

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 (102) hide show
  1. package/README.md +39 -0
  2. package/lib/build-tools.js +2020 -0
  3. package/lib/build-tools.js.map +1 -0
  4. package/lib/cjs/index.js +43 -0
  5. package/lib/cjs/index.js.map +1 -0
  6. package/lib/cjs/package.json +3 -0
  7. package/lib/cjs/parsers/frontmatter.js +25 -0
  8. package/lib/cjs/parsers/frontmatter.js.map +1 -0
  9. package/lib/cjs/plugin.js +150 -0
  10. package/lib/cjs/plugin.js.map +1 -0
  11. package/lib/cjs/presets/index.js +25 -0
  12. package/lib/cjs/presets/index.js.map +1 -0
  13. package/lib/cjs/presets/prompt.js +185 -0
  14. package/lib/cjs/presets/prompt.js.map +1 -0
  15. package/lib/cjs/presets/raw.js +25 -0
  16. package/lib/cjs/presets/raw.js.map +1 -0
  17. package/lib/cjs/presets/skill-collection.js +83 -0
  18. package/lib/cjs/presets/skill-collection.js.map +1 -0
  19. package/lib/cjs/presets/skill.js +272 -0
  20. package/lib/cjs/presets/skill.js.map +1 -0
  21. package/lib/cjs/presets/template-collection.js +80 -0
  22. package/lib/cjs/presets/template-collection.js.map +1 -0
  23. package/lib/cjs/presets/template.js +105 -0
  24. package/lib/cjs/presets/template.js.map +1 -0
  25. package/lib/cjs/types.js +6 -0
  26. package/lib/cjs/types.js.map +1 -0
  27. package/lib/cjs/utils/asset-copy.js +61 -0
  28. package/lib/cjs/utils/asset-copy.js.map +1 -0
  29. package/lib/cjs/utils/asset-discovery.js +100 -0
  30. package/lib/cjs/utils/asset-discovery.js.map +1 -0
  31. package/lib/cjs/utils/template-asset-discovery.js +63 -0
  32. package/lib/cjs/utils/template-asset-discovery.js.map +1 -0
  33. package/lib/cjs/utils/widget-compiler.js +115 -0
  34. package/lib/cjs/utils/widget-compiler.js.map +1 -0
  35. package/lib/esm/index.js +26 -0
  36. package/lib/esm/index.js.map +1 -0
  37. package/lib/esm/parsers/frontmatter.js +19 -0
  38. package/lib/esm/parsers/frontmatter.js.map +1 -0
  39. package/lib/esm/plugin.js +144 -0
  40. package/lib/esm/plugin.js.map +1 -0
  41. package/lib/esm/presets/index.js +10 -0
  42. package/lib/esm/presets/index.js.map +1 -0
  43. package/lib/esm/presets/prompt.js +181 -0
  44. package/lib/esm/presets/prompt.js.map +1 -0
  45. package/lib/esm/presets/raw.js +22 -0
  46. package/lib/esm/presets/raw.js.map +1 -0
  47. package/lib/esm/presets/skill-collection.js +77 -0
  48. package/lib/esm/presets/skill-collection.js.map +1 -0
  49. package/lib/esm/presets/skill.js +266 -0
  50. package/lib/esm/presets/skill.js.map +1 -0
  51. package/lib/esm/presets/template-collection.js +74 -0
  52. package/lib/esm/presets/template-collection.js.map +1 -0
  53. package/lib/esm/presets/template.js +99 -0
  54. package/lib/esm/presets/template.js.map +1 -0
  55. package/lib/esm/types.js +5 -0
  56. package/lib/esm/types.js.map +1 -0
  57. package/lib/esm/utils/asset-copy.js +54 -0
  58. package/lib/esm/utils/asset-copy.js.map +1 -0
  59. package/lib/esm/utils/asset-discovery.js +94 -0
  60. package/lib/esm/utils/asset-discovery.js.map +1 -0
  61. package/lib/esm/utils/template-asset-discovery.js +57 -0
  62. package/lib/esm/utils/template-asset-discovery.js.map +1 -0
  63. package/lib/esm/utils/widget-compiler.js +76 -0
  64. package/lib/esm/utils/widget-compiler.js.map +1 -0
  65. package/lib/types/index.d.ts +24 -0
  66. package/lib/types/index.d.ts.map +1 -0
  67. package/lib/types/parsers/frontmatter.d.ts +19 -0
  68. package/lib/types/parsers/frontmatter.d.ts.map +1 -0
  69. package/lib/types/plugin.d.ts +10 -0
  70. package/lib/types/plugin.d.ts.map +1 -0
  71. package/lib/types/presets/index.d.ts +10 -0
  72. package/lib/types/presets/index.d.ts.map +1 -0
  73. package/lib/types/presets/prompt.d.ts +63 -0
  74. package/lib/types/presets/prompt.d.ts.map +1 -0
  75. package/lib/types/presets/raw.d.ts +16 -0
  76. package/lib/types/presets/raw.d.ts.map +1 -0
  77. package/lib/types/presets/skill-collection.d.ts +26 -0
  78. package/lib/types/presets/skill-collection.d.ts.map +1 -0
  79. package/lib/types/presets/skill.d.ts +361 -0
  80. package/lib/types/presets/skill.d.ts.map +1 -0
  81. package/lib/types/presets/template-collection.d.ts +25 -0
  82. package/lib/types/presets/template-collection.d.ts.map +1 -0
  83. package/lib/types/presets/template.d.ts +58 -0
  84. package/lib/types/presets/template.d.ts.map +1 -0
  85. package/lib/types/types.d.ts +115 -0
  86. package/lib/types/types.d.ts.map +1 -0
  87. package/lib/types/utils/asset-copy.d.ts +20 -0
  88. package/lib/types/utils/asset-copy.d.ts.map +1 -0
  89. package/lib/types/utils/asset-discovery.d.ts +38 -0
  90. package/lib/types/utils/asset-discovery.d.ts.map +1 -0
  91. package/lib/types/utils/template-asset-discovery.d.ts +23 -0
  92. package/lib/types/utils/template-asset-discovery.d.ts.map +1 -0
  93. package/lib/types/utils/widget-compiler.d.ts +15 -0
  94. package/lib/types/utils/widget-compiler.d.ts.map +1 -0
  95. package/package.json +6 -6
  96. package/src/index.ts +5 -0
  97. package/src/presets/index.ts +3 -1
  98. package/src/presets/skill.ts +51 -3
  99. package/src/presets/template-collection.ts +83 -0
  100. package/src/presets/template.ts +116 -0
  101. package/src/types.ts +1 -1
  102. package/src/utils/template-asset-discovery.ts +77 -0
@@ -0,0 +1,361 @@
1
+ /**
2
+ * Skill transformer preset for markdown files with frontmatter
3
+ */
4
+ import { z } from 'zod';
5
+ import type { TransformerPreset } from '../types.js';
6
+ /**
7
+ * Content type for skill instructions
8
+ */
9
+ export type SkillContentType = 'md' | 'jst';
10
+ /**
11
+ * MUST be kept in sync with @vertesia/tools-sdk SkillDefinition
12
+ * Zod schema for skill definition
13
+ * This validates the structure of skill objects generated from markdown
14
+ * Matches the SkillDefinition interface from @vertesia/tools-sdk
15
+ *
16
+ * Note: The isEnabled property is not included in this schema because Zod cannot
17
+ * properly validate function signatures. It will be type-checked by TypeScript instead.
18
+ */
19
+ export declare const SkillDefinitionSchema: z.ZodObject<{
20
+ name: z.ZodString;
21
+ title: z.ZodOptional<z.ZodString>;
22
+ description: z.ZodString;
23
+ instructions: z.ZodString;
24
+ content_type: z.ZodEnum<["md", "jst"]>;
25
+ input_schema: z.ZodOptional<z.ZodObject<{
26
+ type: z.ZodLiteral<"object">;
27
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
28
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
29
+ }, "strip", z.ZodTypeAny, {
30
+ type: "object";
31
+ properties?: Record<string, any> | undefined;
32
+ required?: string[] | undefined;
33
+ }, {
34
+ type: "object";
35
+ properties?: Record<string, any> | undefined;
36
+ required?: string[] | undefined;
37
+ }>>;
38
+ context_triggers: z.ZodOptional<z.ZodObject<{
39
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
40
+ tool_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
41
+ data_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
42
+ }, "strip", z.ZodTypeAny, {
43
+ keywords?: string[] | undefined;
44
+ tool_names?: string[] | undefined;
45
+ data_patterns?: string[] | undefined;
46
+ }, {
47
+ keywords?: string[] | undefined;
48
+ tool_names?: string[] | undefined;
49
+ data_patterns?: string[] | undefined;
50
+ }>>;
51
+ execution: z.ZodOptional<z.ZodObject<{
52
+ language: z.ZodString;
53
+ packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
54
+ system_packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
55
+ template: z.ZodOptional<z.ZodString>;
56
+ }, "strip", z.ZodTypeAny, {
57
+ language: string;
58
+ template?: string | undefined;
59
+ packages?: string[] | undefined;
60
+ system_packages?: string[] | undefined;
61
+ }, {
62
+ language: string;
63
+ template?: string | undefined;
64
+ packages?: string[] | undefined;
65
+ system_packages?: string[] | undefined;
66
+ }>>;
67
+ related_tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
68
+ scripts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
69
+ widgets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
70
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
71
+ name: z.ZodString;
72
+ title: z.ZodOptional<z.ZodString>;
73
+ description: z.ZodString;
74
+ instructions: z.ZodString;
75
+ content_type: z.ZodEnum<["md", "jst"]>;
76
+ input_schema: z.ZodOptional<z.ZodObject<{
77
+ type: z.ZodLiteral<"object">;
78
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
79
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
80
+ }, "strip", z.ZodTypeAny, {
81
+ type: "object";
82
+ properties?: Record<string, any> | undefined;
83
+ required?: string[] | undefined;
84
+ }, {
85
+ type: "object";
86
+ properties?: Record<string, any> | undefined;
87
+ required?: string[] | undefined;
88
+ }>>;
89
+ context_triggers: z.ZodOptional<z.ZodObject<{
90
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
91
+ tool_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
92
+ data_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ keywords?: string[] | undefined;
95
+ tool_names?: string[] | undefined;
96
+ data_patterns?: string[] | undefined;
97
+ }, {
98
+ keywords?: string[] | undefined;
99
+ tool_names?: string[] | undefined;
100
+ data_patterns?: string[] | undefined;
101
+ }>>;
102
+ execution: z.ZodOptional<z.ZodObject<{
103
+ language: z.ZodString;
104
+ packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
105
+ system_packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
106
+ template: z.ZodOptional<z.ZodString>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ language: string;
109
+ template?: string | undefined;
110
+ packages?: string[] | undefined;
111
+ system_packages?: string[] | undefined;
112
+ }, {
113
+ language: string;
114
+ template?: string | undefined;
115
+ packages?: string[] | undefined;
116
+ system_packages?: string[] | undefined;
117
+ }>>;
118
+ related_tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
119
+ scripts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
120
+ widgets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
121
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
122
+ name: z.ZodString;
123
+ title: z.ZodOptional<z.ZodString>;
124
+ description: z.ZodString;
125
+ instructions: z.ZodString;
126
+ content_type: z.ZodEnum<["md", "jst"]>;
127
+ input_schema: z.ZodOptional<z.ZodObject<{
128
+ type: z.ZodLiteral<"object">;
129
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
130
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
131
+ }, "strip", z.ZodTypeAny, {
132
+ type: "object";
133
+ properties?: Record<string, any> | undefined;
134
+ required?: string[] | undefined;
135
+ }, {
136
+ type: "object";
137
+ properties?: Record<string, any> | undefined;
138
+ required?: string[] | undefined;
139
+ }>>;
140
+ context_triggers: z.ZodOptional<z.ZodObject<{
141
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
142
+ tool_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
143
+ data_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
144
+ }, "strip", z.ZodTypeAny, {
145
+ keywords?: string[] | undefined;
146
+ tool_names?: string[] | undefined;
147
+ data_patterns?: string[] | undefined;
148
+ }, {
149
+ keywords?: string[] | undefined;
150
+ tool_names?: string[] | undefined;
151
+ data_patterns?: string[] | undefined;
152
+ }>>;
153
+ execution: z.ZodOptional<z.ZodObject<{
154
+ language: z.ZodString;
155
+ packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
156
+ system_packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
157
+ template: z.ZodOptional<z.ZodString>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ language: string;
160
+ template?: string | undefined;
161
+ packages?: string[] | undefined;
162
+ system_packages?: string[] | undefined;
163
+ }, {
164
+ language: string;
165
+ template?: string | undefined;
166
+ packages?: string[] | undefined;
167
+ system_packages?: string[] | undefined;
168
+ }>>;
169
+ related_tools: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
170
+ scripts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
171
+ widgets: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
172
+ }, z.ZodTypeAny, "passthrough">>;
173
+ /**
174
+ * Schema for validating properties exported from properties.ts
175
+ * This is a partial schema - allows any subset of SkillDefinition fields
176
+ *
177
+ * Note: Function properties like isEnabled cannot be validated by Zod for their signatures.
178
+ * Zod will only check that they are functions, not their specific parameter/return types.
179
+ * Use TypeScript for proper type checking of function signatures.
180
+ */
181
+ export declare const SkillPropertiesSchema: z.ZodObject<{
182
+ name: z.ZodOptional<z.ZodString>;
183
+ title: z.ZodOptional<z.ZodOptional<z.ZodString>>;
184
+ description: z.ZodOptional<z.ZodString>;
185
+ instructions: z.ZodOptional<z.ZodString>;
186
+ content_type: z.ZodOptional<z.ZodEnum<["md", "jst"]>>;
187
+ input_schema: z.ZodOptional<z.ZodOptional<z.ZodObject<{
188
+ type: z.ZodLiteral<"object">;
189
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
190
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
191
+ }, "strip", z.ZodTypeAny, {
192
+ type: "object";
193
+ properties?: Record<string, any> | undefined;
194
+ required?: string[] | undefined;
195
+ }, {
196
+ type: "object";
197
+ properties?: Record<string, any> | undefined;
198
+ required?: string[] | undefined;
199
+ }>>>;
200
+ context_triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
201
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
202
+ tool_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
203
+ data_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ keywords?: string[] | undefined;
206
+ tool_names?: string[] | undefined;
207
+ data_patterns?: string[] | undefined;
208
+ }, {
209
+ keywords?: string[] | undefined;
210
+ tool_names?: string[] | undefined;
211
+ data_patterns?: string[] | undefined;
212
+ }>>>;
213
+ execution: z.ZodOptional<z.ZodOptional<z.ZodObject<{
214
+ language: z.ZodString;
215
+ packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
216
+ system_packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
217
+ template: z.ZodOptional<z.ZodString>;
218
+ }, "strip", z.ZodTypeAny, {
219
+ language: string;
220
+ template?: string | undefined;
221
+ packages?: string[] | undefined;
222
+ system_packages?: string[] | undefined;
223
+ }, {
224
+ language: string;
225
+ template?: string | undefined;
226
+ packages?: string[] | undefined;
227
+ system_packages?: string[] | undefined;
228
+ }>>>;
229
+ related_tools: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
230
+ scripts: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
231
+ widgets: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
232
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
233
+ name: z.ZodOptional<z.ZodString>;
234
+ title: z.ZodOptional<z.ZodOptional<z.ZodString>>;
235
+ description: z.ZodOptional<z.ZodString>;
236
+ instructions: z.ZodOptional<z.ZodString>;
237
+ content_type: z.ZodOptional<z.ZodEnum<["md", "jst"]>>;
238
+ input_schema: z.ZodOptional<z.ZodOptional<z.ZodObject<{
239
+ type: z.ZodLiteral<"object">;
240
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
241
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
242
+ }, "strip", z.ZodTypeAny, {
243
+ type: "object";
244
+ properties?: Record<string, any> | undefined;
245
+ required?: string[] | undefined;
246
+ }, {
247
+ type: "object";
248
+ properties?: Record<string, any> | undefined;
249
+ required?: string[] | undefined;
250
+ }>>>;
251
+ context_triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
252
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
253
+ tool_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
254
+ data_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
255
+ }, "strip", z.ZodTypeAny, {
256
+ keywords?: string[] | undefined;
257
+ tool_names?: string[] | undefined;
258
+ data_patterns?: string[] | undefined;
259
+ }, {
260
+ keywords?: string[] | undefined;
261
+ tool_names?: string[] | undefined;
262
+ data_patterns?: string[] | undefined;
263
+ }>>>;
264
+ execution: z.ZodOptional<z.ZodOptional<z.ZodObject<{
265
+ language: z.ZodString;
266
+ packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
267
+ system_packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
268
+ template: z.ZodOptional<z.ZodString>;
269
+ }, "strip", z.ZodTypeAny, {
270
+ language: string;
271
+ template?: string | undefined;
272
+ packages?: string[] | undefined;
273
+ system_packages?: string[] | undefined;
274
+ }, {
275
+ language: string;
276
+ template?: string | undefined;
277
+ packages?: string[] | undefined;
278
+ system_packages?: string[] | undefined;
279
+ }>>>;
280
+ related_tools: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
281
+ scripts: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
282
+ widgets: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
283
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
284
+ name: z.ZodOptional<z.ZodString>;
285
+ title: z.ZodOptional<z.ZodOptional<z.ZodString>>;
286
+ description: z.ZodOptional<z.ZodString>;
287
+ instructions: z.ZodOptional<z.ZodString>;
288
+ content_type: z.ZodOptional<z.ZodEnum<["md", "jst"]>>;
289
+ input_schema: z.ZodOptional<z.ZodOptional<z.ZodObject<{
290
+ type: z.ZodLiteral<"object">;
291
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
292
+ required: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
293
+ }, "strip", z.ZodTypeAny, {
294
+ type: "object";
295
+ properties?: Record<string, any> | undefined;
296
+ required?: string[] | undefined;
297
+ }, {
298
+ type: "object";
299
+ properties?: Record<string, any> | undefined;
300
+ required?: string[] | undefined;
301
+ }>>>;
302
+ context_triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
303
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
304
+ tool_names: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
305
+ data_patterns: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ keywords?: string[] | undefined;
308
+ tool_names?: string[] | undefined;
309
+ data_patterns?: string[] | undefined;
310
+ }, {
311
+ keywords?: string[] | undefined;
312
+ tool_names?: string[] | undefined;
313
+ data_patterns?: string[] | undefined;
314
+ }>>>;
315
+ execution: z.ZodOptional<z.ZodOptional<z.ZodObject<{
316
+ language: z.ZodString;
317
+ packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
318
+ system_packages: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
319
+ template: z.ZodOptional<z.ZodString>;
320
+ }, "strip", z.ZodTypeAny, {
321
+ language: string;
322
+ template?: string | undefined;
323
+ packages?: string[] | undefined;
324
+ system_packages?: string[] | undefined;
325
+ }, {
326
+ language: string;
327
+ template?: string | undefined;
328
+ packages?: string[] | undefined;
329
+ system_packages?: string[] | undefined;
330
+ }>>>;
331
+ related_tools: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
332
+ scripts: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
333
+ widgets: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
334
+ }, z.ZodTypeAny, "passthrough">>;
335
+ /**
336
+ * TypeScript type inferred from the Zod schema
337
+ * Can also be imported from consumer packages for type safety
338
+ */
339
+ export type SkillDefinition = z.infer<typeof SkillDefinitionSchema>;
340
+ /**
341
+ * Skill transformer preset
342
+ * Transforms markdown files with ?skill suffix OR SKILL.md files into skill definition objects
343
+ *
344
+ * Matches:
345
+ * - Files with ?skill suffix: ./my-skill.md?skill
346
+ * - SKILL.md files: ./my-skill/SKILL.md
347
+ *
348
+ * Runtime Properties:
349
+ * - Supports properties.ts file in skill directory for runtime properties (functions, overrides)
350
+ * - Properties from properties.ts override those from frontmatter
351
+ * - See README.md for detailed usage examples
352
+ *
353
+ * @example
354
+ * ```typescript
355
+ * import skill1 from './my-skill.md?skill';
356
+ * import skill2 from './my-skill/SKILL.md';
357
+ * // Both are SkillDefinition objects
358
+ * ```
359
+ */
360
+ export declare const skillTransformer: TransformerPreset;
361
+ //# sourceMappingURL=skill.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../../../src/presets/skill.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIrD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,KAAK,CAAC;AA6E5C;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAgBlB,CAAC;AAEjB;;;;;;;GAOG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAAgD,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAiGpE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,gBAAgB,EAAE,iBAqE9B,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Template collection transformer for directory-based template imports
3
+ * Scans a directory for subdirectories containing TEMPLATE.md files
4
+ */
5
+ import type { TransformerPreset } from '../types.js';
6
+ /**
7
+ * Template collection transformer preset
8
+ * Transforms directory imports with ?templates suffix into an array of template imports
9
+ *
10
+ * Matches:
11
+ * - ./all?templates (recommended - generates all.js in the directory)
12
+ * - Any path ending with a filename and ?templates
13
+ *
14
+ * NOTE: A filename before ?templates is REQUIRED to avoid naming conflicts.
15
+ * The filename becomes the output module name.
16
+ *
17
+ * @example
18
+ * ```typescript
19
+ * import templates from './all?templates';
20
+ * // Scans current directory for subdirectories with TEMPLATE.md
21
+ * // Generates all.js containing array of all templates
22
+ * ```
23
+ */
24
+ export declare const templateCollectionTransformer: TransformerPreset;
25
+ //# sourceMappingURL=template-collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-collection.d.ts","sourceRoot":"","sources":["../../../src/presets/template-collection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,6BAA6B,EAAE,iBAuD3C,CAAC"}
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Template transformer preset for markdown files with frontmatter
3
+ */
4
+ import { z } from 'zod';
5
+ import type { TransformerPreset } from '../types.js';
6
+ /**
7
+ * MUST be kept in sync with @vertesia/tools-sdk RenderingTemplateDefinition
8
+ * Zod schema for template definition
9
+ */
10
+ export declare const RenderingTemplateDefinitionSchema: z.ZodObject<{
11
+ id: z.ZodString;
12
+ name: z.ZodString;
13
+ title: z.ZodOptional<z.ZodString>;
14
+ description: z.ZodString;
15
+ instructions: z.ZodString;
16
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
17
+ type: z.ZodEnum<["presentation", "document"]>;
18
+ assets: z.ZodArray<z.ZodString, "many">;
19
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
20
+ id: z.ZodString;
21
+ name: z.ZodString;
22
+ title: z.ZodOptional<z.ZodString>;
23
+ description: z.ZodString;
24
+ instructions: z.ZodString;
25
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
26
+ type: z.ZodEnum<["presentation", "document"]>;
27
+ assets: z.ZodArray<z.ZodString, "many">;
28
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
29
+ id: z.ZodString;
30
+ name: z.ZodString;
31
+ title: z.ZodOptional<z.ZodString>;
32
+ description: z.ZodString;
33
+ instructions: z.ZodString;
34
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
35
+ type: z.ZodEnum<["presentation", "document"]>;
36
+ assets: z.ZodArray<z.ZodString, "many">;
37
+ }, z.ZodTypeAny, "passthrough">>;
38
+ /**
39
+ * TypeScript type inferred from the Zod schema
40
+ */
41
+ export type RenderingTemplateDefinition = z.infer<typeof RenderingTemplateDefinitionSchema>;
42
+ /**
43
+ * Template transformer preset
44
+ * Transforms markdown files with ?template suffix OR TEMPLATE.md files into template definition objects
45
+ *
46
+ * Matches:
47
+ * - Files with ?template suffix: ./my-template.md?template
48
+ * - TEMPLATE.md files: ./my-template/TEMPLATE.md
49
+ *
50
+ * @example
51
+ * ```typescript
52
+ * import template1 from './my-template.md?template';
53
+ * import template2 from './my-template/TEMPLATE.md';
54
+ * // Both are RenderingTemplateDefinition objects
55
+ * ```
56
+ */
57
+ export declare const templateTransformer: TransformerPreset;
58
+ //# sourceMappingURL=template.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/presets/template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAgBrD;;;GAGG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAS9B,CAAC;AAEjB;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAgB5F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBA4CjC,CAAC"}
@@ -0,0 +1,115 @@
1
+ /**
2
+ * Type definitions for the Vertesia Rollup Import Plugin
3
+ */
4
+ import type { Plugin } from 'rollup';
5
+ import type { z } from 'zod';
6
+ /**
7
+ * Asset file to be copied during build
8
+ */
9
+ export interface AssetFile {
10
+ /** Source file path (absolute) */
11
+ sourcePath: string;
12
+ /** Relative destination path within assets directory */
13
+ destPath: string;
14
+ /** Asset type for categorization */
15
+ type: 'script' | 'template';
16
+ }
17
+ /**
18
+ * Result of a transform function
19
+ */
20
+ export interface TransformResult {
21
+ /** The data to export (can be text or JSON object) */
22
+ data: unknown;
23
+ /** Optional: additional imports to inject at the top of the generated module */
24
+ imports?: string[];
25
+ /** Optional: custom code to generate instead of default JSON export */
26
+ code?: string;
27
+ /** Optional: additional asset files to copy */
28
+ assets?: AssetFile[];
29
+ /** Optional: widget metadata for compilation */
30
+ widgets?: Array<{
31
+ name: string;
32
+ path: string;
33
+ }>;
34
+ }
35
+ /**
36
+ * Transform function that converts file content into exportable data
37
+ */
38
+ export type TransformFunction = (content: string, filePath: string) => TransformResult | Promise<TransformResult>;
39
+ /**
40
+ * Configuration for a single import transformer rule
41
+ */
42
+ export interface TransformerRule {
43
+ /** Pattern to match import paths (e.g., /\.md\?skill$/ or /\?raw$/) */
44
+ pattern: RegExp;
45
+ /** Transform function to convert file content */
46
+ transform: TransformFunction;
47
+ /** Optional: Zod schema for validation */
48
+ schema?: z.ZodType<any>;
49
+ /** Optional: If true, the transformer generates virtual modules (no file to read) */
50
+ virtual?: boolean;
51
+ /** Optional: additional options for this transformer */
52
+ options?: Record<string, unknown>;
53
+ }
54
+ /**
55
+ * Widget compilation configuration
56
+ */
57
+ export interface WidgetConfig {
58
+ /**
59
+ * External dependencies that should not be bundled
60
+ * Default: ['react', 'react-dom', 'react/jsx-runtime']
61
+ */
62
+ external?: string[];
63
+ /**
64
+ * Path to tsconfig.json for widget compilation
65
+ * Default: './tsconfig.json'
66
+ */
67
+ tsconfig?: string;
68
+ /**
69
+ * Additional options to pass to @rollup/plugin-typescript
70
+ */
71
+ typescript?: Record<string, unknown>;
72
+ /**
73
+ * Minify widget output
74
+ * Default: false
75
+ */
76
+ minify?: boolean;
77
+ }
78
+ /**
79
+ * Plugin configuration
80
+ */
81
+ export interface PluginConfig {
82
+ /** Array of transformer rules to apply */
83
+ transformers: TransformerRule[];
84
+ /**
85
+ * Root directory for asset output (scripts, widgets, etc.)
86
+ * - If specified: assets will be copied to this directory
87
+ * - If false: asset copying is disabled
88
+ * - Default: './dist'
89
+ */
90
+ assetsDir?: string | false;
91
+ /**
92
+ * Directory for script files relative to assetsDir
93
+ * Default: 'scripts'
94
+ */
95
+ scriptsDir?: string;
96
+ /**
97
+ * Directory for widget files relative to assetsDir
98
+ * Default: 'widgets'
99
+ */
100
+ widgetsDir?: string;
101
+ /**
102
+ * Widget compilation configuration
103
+ * If provided, discovered widgets will be automatically compiled
104
+ */
105
+ widgetConfig?: WidgetConfig;
106
+ }
107
+ /**
108
+ * Type for transformer presets
109
+ */
110
+ export type TransformerPreset = TransformerRule;
111
+ /**
112
+ * Plugin factory return type
113
+ */
114
+ export type VertesiaImportPlugin = (config: PluginConfig) => Plugin;
115
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACrC,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAE7B;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,kCAAkC;IAClC,UAAU,EAAE,MAAM,CAAC;IAEnB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IAEjB,oCAAoC;IACpC,IAAI,EAAE,QAAQ,GAAG,UAAU,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,sDAAsD;IACtD,IAAI,EAAE,OAAO,CAAC;IAEd,gFAAgF;IAChF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IAEnB,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,+CAA+C;IAC/C,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;IAErB,gDAAgD;IAChD,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnD;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,KACf,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAEhD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAEhB,iDAAiD;IACjD,SAAS,EAAE,iBAAiB,CAAC;IAE7B,0CAA0C;IAC1C,MAAM,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAExB,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAErC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,0CAA0C;IAC1C,YAAY,EAAE,eAAe,EAAE,CAAC;IAEhC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAE3B;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAEhD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,MAAM,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Utilities for copying asset files during build
3
+ */
4
+ import type { AssetFile } from '../types.js';
5
+ /**
6
+ * Copy an asset file to its destination
7
+ *
8
+ * @param asset - Asset file information
9
+ * @param assetsRoot - Root directory for assets
10
+ */
11
+ export declare function copyAssetFile(asset: AssetFile, assetsRoot: string): void;
12
+ /**
13
+ * Copy multiple asset files
14
+ *
15
+ * @param assets - Array of asset files to copy
16
+ * @param assetsRoot - Root directory for assets
17
+ * @returns Number of files copied
18
+ */
19
+ export declare function copyAssets(assets: AssetFile[], assetsRoot: string): number;
20
+ //# sourceMappingURL=asset-copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-copy.d.ts","sourceRoot":"","sources":["../../../src/utils/asset-copy.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAgB7C;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,CAgBxE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAS1E"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Utilities for discovering asset files (scripts, widgets) in skill directories
3
+ */
4
+ import type { AssetFile } from '../types.js';
5
+ /**
6
+ * Widget metadata for compilation
7
+ */
8
+ export interface WidgetMetadata {
9
+ /** Widget name (without .tsx extension) */
10
+ name: string;
11
+ /** Absolute path to widget file */
12
+ path: string;
13
+ }
14
+ /**
15
+ * Discovered assets in a skill directory
16
+ */
17
+ export interface DiscoveredAssets {
18
+ /** Script file names (with extensions: .js, .py) */
19
+ scripts: string[];
20
+ /** Widget file names (without .tsx extension) */
21
+ widgets: string[];
22
+ /** Widget metadata for compilation */
23
+ widgetMetadata: WidgetMetadata[];
24
+ /** Asset files to be copied */
25
+ assetFiles: AssetFile[];
26
+ }
27
+ /**
28
+ * Discover assets (scripts and widgets) in a skill directory
29
+ *
30
+ * @param skillFilePath - Absolute path to the skill.md file
31
+ * @param options - Asset discovery options
32
+ * @returns Discovered assets and metadata
33
+ */
34
+ export declare function discoverSkillAssets(skillFilePath: string, options?: {
35
+ scriptsDir?: string;
36
+ widgetsDir?: string;
37
+ }): DiscoveredAssets;
38
+ //# sourceMappingURL=asset-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"asset-discovery.d.ts","sourceRoot":"","sources":["../../../src/utils/asset-discovery.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IAEb,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,oDAAoD;IACpD,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,iDAAiD;IACjD,OAAO,EAAE,MAAM,EAAE,CAAC;IAElB,sCAAsC;IACtC,cAAc,EAAE,cAAc,EAAE,CAAC;IAEjC,+BAA+B;IAC/B,UAAU,EAAE,SAAS,EAAE,CAAC;CAC3B;AAgDD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAC/B,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE;IACL,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CAClB,GACP,gBAAgB,CA0ClB"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Utilities for discovering asset files in template directories
3
+ */
4
+ import type { AssetFile } from '../types.js';
5
+ /**
6
+ * Discovered assets in a template directory
7
+ */
8
+ export interface DiscoveredTemplateAssets {
9
+ /** Asset file names (relative to template dir) */
10
+ fileNames: string[];
11
+ /** Asset files to be copied */
12
+ assetFiles: AssetFile[];
13
+ }
14
+ /**
15
+ * Discover asset files in a template directory.
16
+ * All files except TEMPLATE.md, *.ts, and *.js are considered assets.
17
+ *
18
+ * @param templateFilePath - Absolute path to the TEMPLATE.md file
19
+ * @param templatePath - The template path segment (e.g., "examples/report")
20
+ * @returns Discovered assets and metadata
21
+ */
22
+ export declare function discoverTemplateAssets(templateFilePath: string, templatePath: string): DiscoveredTemplateAssets;
23
+ //# sourceMappingURL=template-asset-discovery.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-asset-discovery.d.ts","sourceRoot":"","sources":["../../../src/utils/template-asset-discovery.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACrC,kDAAkD;IAClD,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,+BAA+B;IAC/B,UAAU,EAAE,SAAS,EAAE,CAAC;CAC3B;AAgBD;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CAClC,gBAAgB,EAAE,MAAM,EACxB,YAAY,EAAE,MAAM,GACrB,wBAAwB,CAgC1B"}