@vertesia/build-tools 1.3.0 → 1.4.0-dev.20260615.042033Z

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 (220) hide show
  1. package/README.md +3 -3
  2. package/lib/bin/build.d.ts +35 -0
  3. package/lib/bin/build.d.ts.map +1 -0
  4. package/lib/bin/build.js +79 -0
  5. package/lib/bin/build.js.map +1 -0
  6. package/lib/bin/config.d.ts +24 -0
  7. package/lib/bin/config.d.ts.map +1 -0
  8. package/lib/bin/config.js +91 -0
  9. package/lib/bin/config.js.map +1 -0
  10. package/lib/core/compilers/widget.d.ts +27 -0
  11. package/lib/core/compilers/widget.d.ts.map +1 -0
  12. package/lib/core/compilers/widget.js +37 -0
  13. package/lib/core/compilers/widget.js.map +1 -0
  14. package/lib/{types → core}/parsers/frontmatter.d.ts +1 -1
  15. package/lib/core/parsers/frontmatter.d.ts.map +1 -0
  16. package/lib/{esm → core}/parsers/frontmatter.js +1 -1
  17. package/lib/core/parsers/frontmatter.js.map +1 -0
  18. package/lib/core/transformers/index.d.ts +10 -0
  19. package/lib/core/transformers/index.d.ts.map +1 -0
  20. package/lib/core/transformers/index.js +10 -0
  21. package/lib/core/transformers/index.js.map +1 -0
  22. package/lib/{types/presets → core/transformers}/prompt.d.ts +7 -21
  23. package/lib/core/transformers/prompt.d.ts.map +1 -0
  24. package/lib/{esm/presets → core/transformers}/prompt.js +17 -14
  25. package/lib/core/transformers/prompt.js.map +1 -0
  26. package/lib/core/transformers/raw.d.ts.map +1 -0
  27. package/lib/{esm/presets → core/transformers}/raw.js +2 -2
  28. package/lib/core/transformers/raw.js.map +1 -0
  29. package/lib/core/transformers/skill-collection.d.ts.map +1 -0
  30. package/lib/{esm/presets → core/transformers}/skill-collection.js +5 -12
  31. package/lib/core/transformers/skill-collection.js.map +1 -0
  32. package/lib/core/transformers/skill.d.ts +111 -0
  33. package/lib/core/transformers/skill.d.ts.map +1 -0
  34. package/lib/{esm/presets → core/transformers}/skill.js +70 -51
  35. package/lib/core/transformers/skill.js.map +1 -0
  36. package/lib/core/transformers/template-collection.d.ts.map +1 -0
  37. package/lib/{esm/presets → core/transformers}/template-collection.js +5 -12
  38. package/lib/core/transformers/template-collection.js.map +1 -0
  39. package/lib/{types/presets → core/transformers}/template.d.ts +7 -22
  40. package/lib/core/transformers/template.d.ts.map +1 -0
  41. package/lib/{esm/presets → core/transformers}/template.js +16 -11
  42. package/lib/core/transformers/template.js.map +1 -0
  43. package/lib/{types → core}/types.d.ts +5 -61
  44. package/lib/core/types.d.ts.map +1 -0
  45. package/lib/core/types.js +6 -0
  46. package/lib/{cjs → core}/types.js.map +1 -1
  47. package/lib/core/utils/asset-copy.d.ts.map +1 -0
  48. package/lib/core/utils/asset-copy.js.map +1 -0
  49. package/lib/core/utils/asset-discovery.d.ts.map +1 -0
  50. package/lib/{esm → core}/utils/asset-discovery.js +4 -4
  51. package/lib/core/utils/asset-discovery.js.map +1 -0
  52. package/lib/core/utils/template-asset-discovery.d.ts.map +1 -0
  53. package/lib/{esm → core}/utils/template-asset-discovery.js +3 -7
  54. package/lib/core/utils/template-asset-discovery.js.map +1 -0
  55. package/lib/import-transform/builtins.d.ts +21 -0
  56. package/lib/import-transform/builtins.d.ts.map +1 -0
  57. package/lib/import-transform/builtins.js +50 -0
  58. package/lib/import-transform/builtins.js.map +1 -0
  59. package/lib/import-transform/chunk-emitter.d.ts +24 -0
  60. package/lib/import-transform/chunk-emitter.d.ts.map +1 -0
  61. package/lib/import-transform/chunk-emitter.js +35 -0
  62. package/lib/import-transform/chunk-emitter.js.map +1 -0
  63. package/lib/import-transform/detector.d.ts +24 -0
  64. package/lib/import-transform/detector.d.ts.map +1 -0
  65. package/lib/import-transform/detector.js +34 -0
  66. package/lib/import-transform/detector.js.map +1 -0
  67. package/lib/import-transform/index.d.ts +47 -0
  68. package/lib/import-transform/index.d.ts.map +1 -0
  69. package/lib/import-transform/index.js +115 -0
  70. package/lib/import-transform/index.js.map +1 -0
  71. package/lib/import-transform/patterns.d.ts +25 -0
  72. package/lib/import-transform/patterns.d.ts.map +1 -0
  73. package/lib/import-transform/patterns.js +27 -0
  74. package/lib/import-transform/patterns.js.map +1 -0
  75. package/lib/import-transform/resolver.d.ts +23 -0
  76. package/lib/import-transform/resolver.d.ts.map +1 -0
  77. package/lib/import-transform/resolver.js +30 -0
  78. package/lib/import-transform/resolver.js.map +1 -0
  79. package/lib/import-transform/rewriter.d.ts +21 -0
  80. package/lib/import-transform/rewriter.d.ts.map +1 -0
  81. package/lib/import-transform/rewriter.js +30 -0
  82. package/lib/import-transform/rewriter.js.map +1 -0
  83. package/lib/import-transform/scanner.d.ts +17 -0
  84. package/lib/import-transform/scanner.d.ts.map +1 -0
  85. package/lib/import-transform/scanner.js +46 -0
  86. package/lib/import-transform/scanner.js.map +1 -0
  87. package/lib/index.d.ts +39 -0
  88. package/lib/index.d.ts.map +1 -0
  89. package/lib/index.js +43 -0
  90. package/lib/index.js.map +1 -0
  91. package/lib/vite/api-server.d.ts +54 -0
  92. package/lib/vite/api-server.d.ts.map +1 -0
  93. package/lib/vite/api-server.js +94 -0
  94. package/lib/vite/api-server.js.map +1 -0
  95. package/lib/vite/dev-server.d.ts +42 -0
  96. package/lib/vite/dev-server.d.ts.map +1 -0
  97. package/lib/vite/dev-server.js +111 -0
  98. package/lib/vite/dev-server.js.map +1 -0
  99. package/lib/vite/index.d.ts +15 -0
  100. package/lib/vite/index.d.ts.map +1 -0
  101. package/lib/vite/index.js +15 -0
  102. package/lib/vite/index.js.map +1 -0
  103. package/package.json +38 -28
  104. package/src/bin/build.ts +83 -0
  105. package/src/bin/config.ts +113 -0
  106. package/src/core/compilers/widget.ts +69 -0
  107. package/src/{parsers → core/parsers}/frontmatter.ts +2 -2
  108. package/src/core/transformers/index.ts +27 -0
  109. package/src/{presets → core/transformers}/prompt.ts +35 -32
  110. package/src/{presets → core/transformers}/raw.ts +2 -2
  111. package/src/{presets → core/transformers}/skill-collection.ts +5 -12
  112. package/src/{presets → core/transformers}/skill.ts +119 -99
  113. package/src/{presets → core/transformers}/template-collection.ts +76 -83
  114. package/src/{presets → core/transformers}/template.ts +121 -116
  115. package/src/core/types.ts +71 -0
  116. package/src/{utils → core/utils}/asset-copy.ts +3 -2
  117. package/src/{utils → core/utils}/asset-discovery.ts +5 -5
  118. package/src/{utils → core/utils}/template-asset-discovery.ts +70 -77
  119. package/src/import-transform/builtins.ts +56 -0
  120. package/src/import-transform/chunk-emitter.ts +60 -0
  121. package/src/import-transform/detector.ts +56 -0
  122. package/src/import-transform/index.ts +171 -0
  123. package/src/import-transform/patterns.ts +34 -0
  124. package/src/import-transform/resolver.ts +57 -0
  125. package/src/import-transform/rewriter.ts +48 -0
  126. package/src/import-transform/scanner.ts +55 -0
  127. package/src/index.ts +67 -42
  128. package/src/vite/api-server.ts +142 -0
  129. package/src/vite/dev-server.ts +128 -0
  130. package/src/vite/index.ts +15 -0
  131. package/lib/build-tools.js +0 -2054
  132. package/lib/build-tools.js.map +0 -1
  133. package/lib/cjs/index.js +0 -43
  134. package/lib/cjs/index.js.map +0 -1
  135. package/lib/cjs/package.json +0 -3
  136. package/lib/cjs/parsers/frontmatter.js +0 -25
  137. package/lib/cjs/parsers/frontmatter.js.map +0 -1
  138. package/lib/cjs/plugin.js +0 -150
  139. package/lib/cjs/plugin.js.map +0 -1
  140. package/lib/cjs/presets/index.js +0 -25
  141. package/lib/cjs/presets/index.js.map +0 -1
  142. package/lib/cjs/presets/prompt.js +0 -185
  143. package/lib/cjs/presets/prompt.js.map +0 -1
  144. package/lib/cjs/presets/raw.js +0 -25
  145. package/lib/cjs/presets/raw.js.map +0 -1
  146. package/lib/cjs/presets/skill-collection.js +0 -83
  147. package/lib/cjs/presets/skill-collection.js.map +0 -1
  148. package/lib/cjs/presets/skill.js +0 -272
  149. package/lib/cjs/presets/skill.js.map +0 -1
  150. package/lib/cjs/presets/template-collection.js +0 -80
  151. package/lib/cjs/presets/template-collection.js.map +0 -1
  152. package/lib/cjs/presets/template.js +0 -105
  153. package/lib/cjs/presets/template.js.map +0 -1
  154. package/lib/cjs/types.js +0 -6
  155. package/lib/cjs/utils/asset-copy.js +0 -61
  156. package/lib/cjs/utils/asset-copy.js.map +0 -1
  157. package/lib/cjs/utils/asset-discovery.js +0 -100
  158. package/lib/cjs/utils/asset-discovery.js.map +0 -1
  159. package/lib/cjs/utils/template-asset-discovery.js +0 -63
  160. package/lib/cjs/utils/template-asset-discovery.js.map +0 -1
  161. package/lib/cjs/utils/widget-compiler.js +0 -115
  162. package/lib/cjs/utils/widget-compiler.js.map +0 -1
  163. package/lib/cjs/vite.js +0 -45
  164. package/lib/cjs/vite.js.map +0 -1
  165. package/lib/esm/index.js +0 -26
  166. package/lib/esm/index.js.map +0 -1
  167. package/lib/esm/parsers/frontmatter.js.map +0 -1
  168. package/lib/esm/plugin.js +0 -144
  169. package/lib/esm/plugin.js.map +0 -1
  170. package/lib/esm/presets/index.js +0 -10
  171. package/lib/esm/presets/index.js.map +0 -1
  172. package/lib/esm/presets/prompt.js.map +0 -1
  173. package/lib/esm/presets/raw.js.map +0 -1
  174. package/lib/esm/presets/skill-collection.js.map +0 -1
  175. package/lib/esm/presets/skill.js.map +0 -1
  176. package/lib/esm/presets/template-collection.js.map +0 -1
  177. package/lib/esm/presets/template.js.map +0 -1
  178. package/lib/esm/types.js +0 -5
  179. package/lib/esm/types.js.map +0 -1
  180. package/lib/esm/utils/asset-copy.js.map +0 -1
  181. package/lib/esm/utils/asset-discovery.js.map +0 -1
  182. package/lib/esm/utils/template-asset-discovery.js.map +0 -1
  183. package/lib/esm/utils/widget-compiler.js +0 -76
  184. package/lib/esm/utils/widget-compiler.js.map +0 -1
  185. package/lib/esm/vite.js +0 -42
  186. package/lib/esm/vite.js.map +0 -1
  187. package/lib/types/index.d.ts +0 -24
  188. package/lib/types/index.d.ts.map +0 -1
  189. package/lib/types/parsers/frontmatter.d.ts.map +0 -1
  190. package/lib/types/plugin.d.ts +0 -10
  191. package/lib/types/plugin.d.ts.map +0 -1
  192. package/lib/types/presets/index.d.ts +0 -10
  193. package/lib/types/presets/index.d.ts.map +0 -1
  194. package/lib/types/presets/prompt.d.ts.map +0 -1
  195. package/lib/types/presets/raw.d.ts.map +0 -1
  196. package/lib/types/presets/skill-collection.d.ts.map +0 -1
  197. package/lib/types/presets/skill.d.ts +0 -361
  198. package/lib/types/presets/skill.d.ts.map +0 -1
  199. package/lib/types/presets/template-collection.d.ts.map +0 -1
  200. package/lib/types/presets/template.d.ts.map +0 -1
  201. package/lib/types/types.d.ts.map +0 -1
  202. package/lib/types/utils/asset-copy.d.ts.map +0 -1
  203. package/lib/types/utils/asset-discovery.d.ts.map +0 -1
  204. package/lib/types/utils/template-asset-discovery.d.ts.map +0 -1
  205. package/lib/types/utils/widget-compiler.d.ts +0 -15
  206. package/lib/types/utils/widget-compiler.d.ts.map +0 -1
  207. package/lib/types/vite.d.ts +0 -32
  208. package/lib/types/vite.d.ts.map +0 -1
  209. package/src/plugin.ts +0 -166
  210. package/src/presets/index.ts +0 -10
  211. package/src/types.ts +0 -140
  212. package/src/utils/widget-compiler.ts +0 -98
  213. package/src/vite.ts +0 -45
  214. /package/lib/{types/presets → core/transformers}/raw.d.ts +0 -0
  215. /package/lib/{types/presets → core/transformers}/skill-collection.d.ts +0 -0
  216. /package/lib/{types/presets → core/transformers}/template-collection.d.ts +0 -0
  217. /package/lib/{types → core}/utils/asset-copy.d.ts +0 -0
  218. /package/lib/{esm → core}/utils/asset-copy.js +0 -0
  219. /package/lib/{types → core}/utils/asset-discovery.d.ts +0 -0
  220. /package/lib/{types → core}/utils/template-asset-discovery.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-collection.js","sourceRoot":"","sources":["../../../src/core/transformers/skill-collection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,IAAI,MAAM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gB,EAAE,GAAG,CAAC,EAAE,CAAC;wBACnE,OAAO,CAAC,IAAI,CAAC,UAAU,UAAU,YAAY,KAAK,aAAa,CAAC,CAAC;wBACjE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;oBAC3B,CAAC;gBACL,CAAC;YACL,CAAC;YAAC,MAAM,CAAC,CAAA,CAAC;QACd,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,gDAAgD,OAAO,EAAE,CAAC,CAAC;QAC5E,CAAC;QAED,6DAA6D;QAC7D,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,EAAE,EAAE,EAAE,mBAAmB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElF,OAAO;YACH,IAAI,EAAE,IAAI,EAAE,wCAAwC;YACpD,IAAI;SACP,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -0,0 +1,111 @@
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<{
25
+ jst: "jst";
26
+ md: "md";
27
+ }>;
28
+ input_schema: z.ZodOptional<z.ZodObject<{
29
+ type: z.ZodLiteral<"object">;
30
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
31
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
32
+ }, z.core.$strip>>;
33
+ context_triggers: z.ZodOptional<z.ZodObject<{
34
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
+ tool_names: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
+ data_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
37
+ }, z.core.$strip>>;
38
+ execution: z.ZodOptional<z.ZodObject<{
39
+ language: z.ZodString;
40
+ packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ system_packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
42
+ template: z.ZodOptional<z.ZodString>;
43
+ }, z.core.$strip>>;
44
+ tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
45
+ scripts: z.ZodOptional<z.ZodArray<z.ZodString>>;
46
+ widgets: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
+ }, z.core.$loose>;
48
+ /**
49
+ * Schema for validating properties exported from properties.ts
50
+ * This is a partial schema - allows any subset of SkillDefinition fields
51
+ *
52
+ * Note: Function properties like isEnabled cannot be validated by Zod for their signatures.
53
+ * Zod will only check that they are functions, not their specific parameter/return types.
54
+ * Use TypeScript for proper type checking of function signatures.
55
+ */
56
+ export declare const SkillPropertiesSchema: z.ZodObject<{
57
+ name: z.ZodOptional<z.ZodString>;
58
+ title: z.ZodOptional<z.ZodOptional<z.ZodString>>;
59
+ description: z.ZodOptional<z.ZodString>;
60
+ instructions: z.ZodOptional<z.ZodString>;
61
+ content_type: z.ZodOptional<z.ZodEnum<{
62
+ jst: "jst";
63
+ md: "md";
64
+ }>>;
65
+ input_schema: z.ZodOptional<z.ZodOptional<z.ZodObject<{
66
+ type: z.ZodLiteral<"object">;
67
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
68
+ required: z.ZodOptional<z.ZodArray<z.ZodString>>;
69
+ }, z.core.$strip>>>;
70
+ context_triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
71
+ keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
72
+ tool_names: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
+ data_patterns: z.ZodOptional<z.ZodArray<z.ZodString>>;
74
+ }, z.core.$strip>>>;
75
+ execution: z.ZodOptional<z.ZodOptional<z.ZodObject<{
76
+ language: z.ZodString;
77
+ packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
78
+ system_packages: z.ZodOptional<z.ZodArray<z.ZodString>>;
79
+ template: z.ZodOptional<z.ZodString>;
80
+ }, z.core.$strip>>>;
81
+ tools: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
82
+ scripts: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
83
+ widgets: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
84
+ }, z.core.$loose>;
85
+ /**
86
+ * TypeScript type inferred from the Zod schema
87
+ * Can also be imported from consumer packages for type safety
88
+ */
89
+ export type SkillDefinition = z.infer<typeof SkillDefinitionSchema>;
90
+ /**
91
+ * Skill transformer preset
92
+ * Transforms markdown files with ?skill suffix OR SKILL.md files into skill definition objects
93
+ *
94
+ * Matches:
95
+ * - Files with ?skill suffix: ./my-skill.md?skill
96
+ * - SKILL.md files: ./my-skill/SKILL.md
97
+ *
98
+ * Runtime Properties:
99
+ * - Supports properties.ts file in skill directory for runtime properties (functions, overrides)
100
+ * - Properties from properties.ts override those from frontmatter
101
+ * - See README.md for detailed usage examples
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * import skill1 from './my-skill.md?skill';
106
+ * import skill2 from './my-skill/SKILL.md';
107
+ * // Both are SkillDefinition objects
108
+ * ```
109
+ */
110
+ export declare const skillTransformer: TransformerPreset;
111
+ //# sourceMappingURL=skill.d.ts.map
@@ -0,0 +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,51 +1,60 @@
1
1
  /**
2
2
  * Skill transformer preset for markdown files with frontmatter
3
3
  */
4
- import path from 'node:path';
5
4
  import { existsSync } from 'node:fs';
5
+ import path from 'node:path';
6
6
  import { z } from 'zod';
7
7
  import { parseFrontmatter } from '../parsers/frontmatter.js';
8
8
  import { discoverSkillAssets } from '../utils/asset-discovery.js';
9
9
  /**
10
10
  * Context triggers for auto-injection of skills (for frontmatter validation)
11
11
  */
12
- const SkillContextTriggersFrontmatterSchema = z.object({
12
+ const SkillContextTriggersFrontmatterSchema = z
13
+ .object({
13
14
  keywords: z.array(z.string()).optional(),
14
15
  tool_names: z.array(z.string()).optional(),
15
- data_patterns: z.array(z.string()).optional()
16
- }).strict();
16
+ data_patterns: z.array(z.string()).optional(),
17
+ })
18
+ .strict();
17
19
  /**
18
20
  * Context triggers for auto-injection of skills (for output validation)
19
21
  */
20
- const SkillContextTriggersSchema = z.object({
22
+ const SkillContextTriggersSchema = z
23
+ .object({
21
24
  keywords: z.array(z.string()).optional(),
22
25
  tool_names: z.array(z.string()).optional(),
23
- data_patterns: z.array(z.string()).optional()
24
- }).optional();
26
+ data_patterns: z.array(z.string()).optional(),
27
+ })
28
+ .optional();
25
29
  /**
26
30
  * Execution configuration for skills that need code execution (for frontmatter validation)
27
31
  */
28
- const SkillExecutionFrontmatterSchema = z.object({
32
+ const SkillExecutionFrontmatterSchema = z
33
+ .object({
29
34
  language: z.string(),
30
35
  packages: z.array(z.string()).optional(),
31
36
  system_packages: z.array(z.string()).optional(),
32
- template: z.string().optional()
33
- }).strict();
37
+ template: z.string().optional(),
38
+ })
39
+ .strict();
34
40
  /**
35
41
  * Execution configuration for skills that need code execution (for output validation)
36
42
  */
37
- const SkillExecutionSchema = z.object({
43
+ const SkillExecutionSchema = z
44
+ .object({
38
45
  language: z.string(),
39
46
  packages: z.array(z.string()).optional(),
40
47
  system_packages: z.array(z.string()).optional(),
41
- template: z.string().optional()
42
- }).optional();
48
+ template: z.string().optional(),
49
+ })
50
+ .optional();
43
51
  /**
44
52
  * Zod schema for skill frontmatter validation
45
53
  * This validates the YAML frontmatter before transformation
46
54
  * Supports both flat and nested structures
47
55
  */
48
- const SkillFrontmatterSchema = z.object({
56
+ const SkillFrontmatterSchema = z
57
+ .object({
49
58
  // Required fields
50
59
  name: z.string().min(1, 'Skill name is required'),
51
60
  description: z.string().min(1, 'Skill description is required'),
@@ -62,16 +71,18 @@ const SkillFrontmatterSchema = z.object({
62
71
  // Nested structure fields
63
72
  context_triggers: SkillContextTriggersFrontmatterSchema.optional(),
64
73
  execution: SkillExecutionFrontmatterSchema.optional(),
65
- related_tools: z.array(z.string()).optional(),
66
- input_schema: z.object({
74
+ input_schema: z
75
+ .object({
67
76
  type: z.literal('object'),
68
- properties: z.record(z.any()).optional(),
69
- required: z.array(z.string()).optional()
70
- }).optional(),
77
+ properties: z.record(z.string(), z.unknown()).optional(),
78
+ required: z.array(z.string()).optional(),
79
+ })
80
+ .optional(),
71
81
  // Asset fields (auto-discovered but can be overridden)
72
82
  scripts: z.array(z.string()).optional(),
73
- widgets: z.array(z.string()).optional()
74
- }).strict();
83
+ widgets: z.array(z.string()).optional(),
84
+ })
85
+ .strict();
75
86
  /**
76
87
  * MUST be kept in sync with @vertesia/tools-sdk SkillDefinition
77
88
  * Zod schema for skill definition
@@ -81,23 +92,27 @@ const SkillFrontmatterSchema = z.object({
81
92
  * Note: The isEnabled property is not included in this schema because Zod cannot
82
93
  * properly validate function signatures. It will be type-checked by TypeScript instead.
83
94
  */
84
- export const SkillDefinitionSchema = z.object({
95
+ export const SkillDefinitionSchema = z
96
+ .object({
85
97
  name: z.string().min(1, 'Skill name is required'),
86
98
  title: z.string().optional(),
87
99
  description: z.string().min(1, 'Skill description is required'),
88
100
  instructions: z.string(),
89
101
  content_type: z.enum(['md', 'jst']),
90
- input_schema: z.object({
102
+ input_schema: z
103
+ .object({
91
104
  type: z.literal('object'),
92
- properties: z.record(z.any()).optional(),
93
- required: z.array(z.string()).optional()
94
- }).optional(),
105
+ properties: z.record(z.string(), z.unknown()).optional(),
106
+ required: z.array(z.string()).optional(),
107
+ })
108
+ .optional(),
95
109
  context_triggers: SkillContextTriggersSchema,
96
110
  execution: SkillExecutionSchema,
97
- related_tools: z.array(z.string()).optional(),
111
+ tools: z.array(z.string()).optional(),
98
112
  scripts: z.array(z.string()).optional(),
99
- widgets: z.array(z.string()).optional()
100
- }).passthrough();
113
+ widgets: z.array(z.string()).optional(),
114
+ })
115
+ .passthrough();
101
116
  /**
102
117
  * Schema for validating properties exported from properties.ts
103
118
  * This is a partial schema - allows any subset of SkillDefinition fields
@@ -126,7 +141,7 @@ export const SkillPropertiesSchema = SkillDefinitionSchema.partial().passthrough
126
141
  * execution:
127
142
  * language: python
128
143
  * packages: [...]
129
- * related_tools: [...]
144
+ * tools: [...]
130
145
  *
131
146
  * @param frontmatter - Parsed frontmatter object
132
147
  * @param instructions - Markdown content (body of the file)
@@ -149,7 +164,7 @@ function buildSkillDefinition(frontmatter, instructions, contentType, widgets, s
149
164
  // Nested: context_triggers: { keywords: [...], tool_names: [...] }
150
165
  // Flat: keywords: [...], tools: [...]
151
166
  const contextTriggers = frontmatter.context_triggers;
152
- const hasNestedTriggers = contextTriggers && typeof contextTriggers === 'object';
167
+ const hasNestedTriggers = contextTriggers !== undefined;
153
168
  const hasFlatTriggers = frontmatter.keywords || frontmatter.tools || frontmatter.data_patterns;
154
169
  if (hasNestedTriggers || hasFlatTriggers) {
155
170
  skill.context_triggers = {
@@ -160,27 +175,30 @@ function buildSkillDefinition(frontmatter, instructions, contentType, widgets, s
160
175
  }
161
176
  // Build execution config - support both flat and nested structure
162
177
  const execution = frontmatter.execution;
163
- const hasNestedExecution = execution && typeof execution === 'object';
164
- const hasFlatExecution = frontmatter.language;
165
- if (hasNestedExecution || hasFlatExecution) {
178
+ if (execution) {
166
179
  skill.execution = {
167
- language: hasNestedExecution ? execution.language : frontmatter.language,
168
- packages: hasNestedExecution ? execution.packages : frontmatter.packages,
169
- system_packages: hasNestedExecution ? execution.system_packages : frontmatter.system_packages,
180
+ language: execution.language,
181
+ packages: execution.packages,
182
+ system_packages: execution.system_packages,
170
183
  };
184
+ }
185
+ else if (frontmatter.language) {
186
+ skill.execution = {
187
+ language: frontmatter.language,
188
+ packages: frontmatter.packages,
189
+ system_packages: frontmatter.system_packages,
190
+ };
191
+ }
192
+ if (skill.execution) {
171
193
  // Extract code template from instructions if present
172
194
  const codeBlockMatch = instructions.match(/```(?:python|javascript|typescript|js|ts|py)\n([\s\S]*?)```/);
173
- if (codeBlockMatch) {
195
+ if (codeBlockMatch?.[1]) {
174
196
  skill.execution.template = codeBlockMatch[1].trim();
175
197
  }
176
198
  }
177
- // Related tools - support both direct field and from tools field
178
- if (frontmatter.related_tools) {
179
- skill.related_tools = frontmatter.related_tools;
180
- }
181
- else if (frontmatter.tools && !hasNestedTriggers) {
182
- // If tools is not part of context_triggers, use it as related_tools
183
- skill.related_tools = frontmatter.tools;
199
+ // Tools unlocked by this skill (from frontmatter `tools:` key)
200
+ if (frontmatter.tools) {
201
+ skill.tools = frontmatter.tools;
184
202
  }
185
203
  // Input schema from frontmatter
186
204
  if (frontmatter.input_schema) {
@@ -216,7 +234,7 @@ export const skillTransformer = {
216
234
  // Validate frontmatter first to catch unknown properties
217
235
  const frontmatterValidation = SkillFrontmatterSchema.safeParse(frontmatter);
218
236
  if (!frontmatterValidation.success) {
219
- const errors = frontmatterValidation.error.errors
237
+ const errors = frontmatterValidation.error.issues
220
238
  .map((err) => {
221
239
  const pathStr = err.path.length > 0 ? err.path.join('.') : 'frontmatter';
222
240
  return ` - ${pathStr}: ${err.message}`;
@@ -224,12 +242,13 @@ export const skillTransformer = {
224
242
  .join('\n');
225
243
  throw new Error(`Invalid frontmatter in ${filePath}:\n${errors}`);
226
244
  }
245
+ const validatedFrontmatter = frontmatterValidation.data;
227
246
  // Determine content type from frontmatter or file extension
228
- const content_type = frontmatter.content_type || 'md';
247
+ const content_type = validatedFrontmatter.content_type || 'md';
229
248
  // Discover assets (scripts and widgets) in the skill directory
230
249
  const assets = discoverSkillAssets(filePath);
231
250
  // Build skill definition using the same logic as parseSkillFile in tools-sdk
232
- const skillData = buildSkillDefinition(frontmatter, markdown, content_type, assets.widgets, assets.scripts);
251
+ const skillData = buildSkillDefinition(validatedFrontmatter, markdown, content_type, assets.widgets, assets.scripts);
233
252
  // Check if properties.ts exists in the skill directory
234
253
  const skillDir = path.dirname(filePath);
235
254
  const propertiesPath = path.join(skillDir, 'properties.ts');
@@ -253,14 +272,14 @@ export default { ...skill, ...properties };
253
272
  data: skillData,
254
273
  assets: assets.assetFiles,
255
274
  widgets: assets.widgetMetadata,
256
- code
275
+ code,
257
276
  };
258
277
  }
259
278
  return {
260
279
  data: skillData,
261
280
  assets: assets.assetFiles,
262
- widgets: assets.widgetMetadata
281
+ widgets: assets.widgetMetadata,
263
282
  };
264
- }
283
+ },
265
284
  };
266
285
  //# sourceMappingURL=skill.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill.js","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O;gBACH,IAAI,EAAE,SAAS;gBACf,MAAM,EAAE,MAAM,CAAC,UAAU;gBACzB,OAAO,EAAE,MAAM,CAAC,cAAc;gBAC9B,IAAI;aACP,CAAC;QACN,CAAC;QAED,OAAO;YACH,IAAI,EAAE,SAAS;YACf,MAAM,EAAE,MAAM,CAAC,UAAU;YACzB,OAAO,EAAE,MAAM,CAAC,cAAc;SACjC,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-collection.d.ts","sourceRoot":"","sources":["../../../src/core/transformers/template-collection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,6BAA6B,EAAE,iBAgD3C,CAAC"}
@@ -2,7 +2,7 @@
2
2
  * Template collection transformer for directory-based template imports
3
3
  * Scans a directory for subdirectories containing TEMPLATE.md files
4
4
  */
5
- import { readdirSync, statSync, existsSync } from 'node:fs';
5
+ import { existsSync, readdirSync, statSync } from 'node:fs';
6
6
  import path from 'node:path';
7
7
  /**
8
8
  * Template collection transformer preset
@@ -51,24 +51,17 @@ export const templateCollectionTransformer = {
51
51
  }
52
52
  }
53
53
  }
54
- catch (_err) {
55
- // Skip entries that can't be read
56
- continue;
57
- }
54
+ catch (_err) { }
58
55
  }
59
56
  if (names.length === 0) {
60
57
  console.warn(`No TEMPLATE.md files found in subdirectories of ${dirPath}`);
61
58
  }
62
59
  // Generate code that imports all templates and exports as array
63
- const code = [
64
- ...imports,
65
- '',
66
- `export default [${names.join(', ')}];`
67
- ].join('\n');
60
+ const code = [...imports, '', `export default [${names.join(', ')}];`].join('\n');
68
61
  return {
69
62
  data: null,
70
- code
63
+ code,
71
64
  };
72
- }
65
+ },
73
66
  };
74
67
  //# sourceMappingURL=template-collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template-collection.js","sourceRoot":"","sources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IAAI,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;wBAC3B,MAAM,UAAU,GAAG,YAAY,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,GAAG,CAAC,EAAE,CAAC;wBACtE,OAAO,CAAC,IAAI,CAAC,UAAU,UAAU,YAAY,KAAK,gBAAgB,CAAC,CAAC;wBACpE,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;oBAC3B,CAAC;gBACL,CAAC;YACL,CAAC;YAAC,OAAO,IAAI,EAAE,CAAC,CAAA,CAAC;QACrB,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACrB,OAAO,CAAC,IAAI,CAAC,mDAAmD,OAAO,EAAE,CAAC,CAAC;QAC/E,CAAC;QAED,gEAAgE;QAChE,MAAM,IAAI,GAAG,CAAC,GAAG,OAAO,EAAE,EAAE,EAAE,mBAAmB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAElF,OAAO;YACH,IAAI,EAAE,IAAI;YACV,IAAI;SACP,CAAC;IACN,CAAC;CACJ,CAAC"}
@@ -13,28 +13,13 @@ export declare const RenderingTemplateDefinitionSchema: z.ZodObject<{
13
13
  title: z.ZodOptional<z.ZodString>;
14
14
  description: z.ZodString;
15
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">>;
16
+ tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
17
+ type: z.ZodEnum<{
18
+ presentation: "presentation";
19
+ document: "document";
20
+ }>;
21
+ assets: z.ZodArray<z.ZodString>;
22
+ }, z.core.$loose>;
38
23
  /**
39
24
  * TypeScript type inferred from the Zod schema
40
25
  */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../../../src/core/transformers/template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAmBrD;;;GAGG;AACH,eAAO,MAAM,iCAAiC;;;;;;;;;;;;iBAW5B,CAAC;AAEnB;;GAEG;AACH,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAgB5F;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBA2CjC,CAAC"}
@@ -10,17 +10,20 @@ import { discoverTemplateAssets } from '../utils/template-asset-discovery.js';
10
10
  * Only includes fields authored by the user.
11
11
  * The name and id are inferred from the directory structure.
12
12
  */
13
- const TemplateFrontmatterSchema = z.object({
13
+ const TemplateFrontmatterSchema = z
14
+ .object({
14
15
  title: z.string().optional(),
15
16
  description: z.string().min(1, 'Template description is required'),
16
17
  tags: z.array(z.string()).optional(),
17
18
  type: z.enum(['presentation', 'document']),
18
- }).strict();
19
+ })
20
+ .strict();
19
21
  /**
20
22
  * MUST be kept in sync with @vertesia/tools-sdk RenderingTemplateDefinition
21
23
  * Zod schema for template definition
22
24
  */
23
- export const RenderingTemplateDefinitionSchema = z.object({
25
+ export const RenderingTemplateDefinitionSchema = z
26
+ .object({
24
27
  id: z.string().min(1, 'Template id is required'),
25
28
  name: z.string().min(1, 'Template name is required'),
26
29
  title: z.string().optional(),
@@ -29,7 +32,8 @@ export const RenderingTemplateDefinitionSchema = z.object({
29
32
  tags: z.array(z.string()).optional(),
30
33
  type: z.enum(['presentation', 'document']),
31
34
  assets: z.array(z.string()),
32
- }).passthrough();
35
+ })
36
+ .passthrough();
33
37
  /**
34
38
  * Derive the template path segments from the file path.
35
39
  *
@@ -66,7 +70,7 @@ export const templateTransformer = {
66
70
  // Validate frontmatter
67
71
  const frontmatterValidation = TemplateFrontmatterSchema.safeParse(frontmatter);
68
72
  if (!frontmatterValidation.success) {
69
- const errors = frontmatterValidation.error.errors
73
+ const errors = frontmatterValidation.error.issues
70
74
  .map((err) => {
71
75
  const pathStr = err.path.length > 0 ? err.path.join('.') : 'frontmatter';
72
76
  return ` - ${pathStr}: ${err.message}`;
@@ -74,6 +78,7 @@ export const templateTransformer = {
74
78
  .join('\n');
75
79
  throw new Error(`Invalid frontmatter in ${filePath}:\n${errors}`);
76
80
  }
81
+ const validatedFrontmatter = frontmatterValidation.data;
77
82
  // Derive template path from directory structure
78
83
  const { category, templateName, relative: templatePath } = deriveTemplatePathInfo(filePath);
79
84
  // Discover asset files in the template directory
@@ -83,17 +88,17 @@ export const templateTransformer = {
83
88
  const templateData = {
84
89
  id: `${category}:${templateName}`,
85
90
  name: templateName,
86
- title: frontmatter.title,
87
- description: frontmatter.description,
91
+ title: validatedFrontmatter.title,
92
+ description: validatedFrontmatter.description,
88
93
  instructions: markdown,
89
- tags: frontmatter.tags,
90
- type: frontmatter.type,
91
- assets: assets.fileNames.map(f => `/templates/${templatePath}/${f}`),
94
+ tags: validatedFrontmatter.tags,
95
+ type: validatedFrontmatter.type,
96
+ assets: assets.fileNames.map((f) => `/templates/${templatePath}/${f}`),
92
97
  };
93
98
  return {
94
99
  data: templateData,
95
100
  assets: assets.assetFiles,
96
101
  };
97
- }
102
+ },
98
103
  };
99
104
  //# sourceMappingURL=template.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"template.js","sourceRoot":"","sources":["../../../src/core/transformers/template.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAE9E;;;;GAIG;AACH,MAAM,yBAAyB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACJ,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,kCAAkC,CAAC;IAClE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;CAC7C,CAAC;KACD,MAAM,EAAE,CAAC;AAId;;;GAGG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC;KAC7C,MAAM,CAAC;IACJ,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,yBAAyB,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,2BAA2B,CAAC;IACpD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,kCA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@ -1,7 +1,7 @@
1
1
  /**
2
- * Type definitions for the Vertesia Rollup Import Plugin
2
+ * Type definitions shared across the Vertesia build-tools pipeline:
3
+ * transformers, transformer results, and asset metadata produced by them.
3
4
  */
4
- import type { Plugin } from 'rollup';
5
5
  import type { z } from 'zod';
6
6
  /**
7
7
  * Asset file to be copied during build
@@ -45,71 +45,15 @@ export interface TransformerRule {
45
45
  /** Transform function to convert file content */
46
46
  transform: TransformFunction;
47
47
  /** Optional: Zod schema for validation */
48
- schema?: z.ZodType<any>;
48
+ schema?: z.ZodType<unknown>;
49
49
  /** Optional: If true, the transformer generates virtual modules (no file to read) */
50
50
  virtual?: boolean;
51
51
  /** Optional: additional options for this transformer */
52
52
  options?: Record<string, unknown>;
53
53
  }
54
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
55
+ * Type for transformer presets — alias for `TransformerRule` used by the
56
+ * built-in preset modules (skill, raw, prompt, template, …).
109
57
  */
110
58
  export type TransformerPreset = TransformerRule;
111
- /**
112
- * Plugin factory return type
113
- */
114
- export type VertesiaImportPlugin = (config: PluginConfig) => Plugin;
115
59
  //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,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,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;AAElH;;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,OAAO,CAAC,CAAC;IAE5B,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACrC;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Type definitions shared across the Vertesia build-tools pipeline:
3
+ * transformers, transformer results, and asset metadata produced by them.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;GAEG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}