@vertesia/build-tools 0.80.0 → 0.80.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/build-tools.js +286 -8
- package/lib/build-tools.js.map +1 -1
- package/lib/cjs/index.js +6 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/plugin.js +14 -6
- package/lib/cjs/plugin.js.map +1 -1
- package/lib/cjs/presets/index.js +8 -1
- package/lib/cjs/presets/index.js.map +1 -1
- package/lib/cjs/presets/prompt.js +203 -0
- package/lib/cjs/presets/prompt.js.map +1 -0
- package/lib/cjs/presets/skill-collection.js +83 -0
- package/lib/cjs/presets/skill-collection.js.map +1 -0
- package/lib/esm/index.js +1 -1
- package/lib/esm/index.js.map +1 -1
- package/lib/esm/plugin.js +14 -6
- package/lib/esm/plugin.js.map +1 -1
- package/lib/esm/presets/index.js +2 -0
- package/lib/esm/presets/index.js.map +1 -1
- package/lib/esm/presets/prompt.js +197 -0
- package/lib/esm/presets/prompt.js.map +1 -0
- package/lib/esm/presets/skill-collection.js +77 -0
- package/lib/esm/presets/skill-collection.js.map +1 -0
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/plugin.d.ts.map +1 -1
- package/lib/types/presets/index.d.ts +2 -0
- package/lib/types/presets/index.d.ts.map +1 -1
- package/lib/types/presets/prompt.d.ts +77 -0
- package/lib/types/presets/prompt.d.ts.map +1 -0
- package/lib/types/presets/skill-collection.d.ts +26 -0
- package/lib/types/presets/skill-collection.d.ts.map +1 -0
- package/lib/types/types.d.ts +2 -0
- package/lib/types/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +8 -1
- package/src/plugin.ts +14 -6
- package/src/presets/index.ts +2 -0
- package/src/presets/prompt.ts +242 -0
- package/src/presets/skill-collection.ts +86 -0
- package/src/types.ts +3 -0
package/lib/build-tools.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { copyFileSync, mkdirSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
1
|
+
import { copyFileSync, mkdirSync, readFileSync, readdirSync, statSync, existsSync } from 'node:fs';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { rollup } from 'rollup';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import matter from 'gray-matter';
|
|
6
|
+
import path$1 from 'path';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Utilities for copying asset files during build
|
|
@@ -158,7 +159,13 @@ function vertesiaImportPlugin(config) {
|
|
|
158
159
|
// Handle relative imports
|
|
159
160
|
if (source.startsWith('.') && importer) {
|
|
160
161
|
const cleanSource = source.replace(transformer.pattern, '');
|
|
161
|
-
|
|
162
|
+
// Strip query parameters from importer to get the file path
|
|
163
|
+
const cleanImporter = importer.indexOf('?') >= 0
|
|
164
|
+
? importer.substring(0, importer.indexOf('?'))
|
|
165
|
+
: importer;
|
|
166
|
+
// Always use dirname to get the directory containing the importer
|
|
167
|
+
const baseDir = path.dirname(cleanImporter);
|
|
168
|
+
const resolved = path.resolve(baseDir, cleanSource);
|
|
162
169
|
// Return with the pattern suffix to identify it in load
|
|
163
170
|
const suffix = source.match(transformer.pattern)?.[0] || '';
|
|
164
171
|
return resolved + suffix;
|
|
@@ -190,8 +197,10 @@ function vertesiaImportPlugin(config) {
|
|
|
190
197
|
return null; // Not for us
|
|
191
198
|
}
|
|
192
199
|
try {
|
|
193
|
-
// Read file content
|
|
194
|
-
const content =
|
|
200
|
+
// Read file content (skip for virtual transforms)
|
|
201
|
+
const content = matchedTransformer.virtual
|
|
202
|
+
? ''
|
|
203
|
+
: readFileSync(cleanId, 'utf-8');
|
|
195
204
|
// Transform the content
|
|
196
205
|
const result = await matchedTransformer.transform(content, cleanId);
|
|
197
206
|
// Collect assets if any
|
|
@@ -213,13 +222,13 @@ function vertesiaImportPlugin(config) {
|
|
|
213
222
|
}
|
|
214
223
|
}
|
|
215
224
|
// Generate code
|
|
225
|
+
const imports = result.imports ? result.imports.join('\n') + '\n\n' : '';
|
|
216
226
|
if (result.code) {
|
|
217
|
-
// Custom code provided
|
|
218
|
-
return result.code;
|
|
227
|
+
// Custom code provided - prepend imports
|
|
228
|
+
return imports + result.code;
|
|
219
229
|
}
|
|
220
230
|
else {
|
|
221
231
|
// Default: export data (escape if string, otherwise stringify as JSON)
|
|
222
|
-
const imports = result.imports ? result.imports.join('\n') + '\n\n' : '';
|
|
223
232
|
const dataJson = JSON.stringify(result.data, null, 2);
|
|
224
233
|
return `${imports}export default ${dataJson};`;
|
|
225
234
|
}
|
|
@@ -590,6 +599,81 @@ const skillTransformer = {
|
|
|
590
599
|
}
|
|
591
600
|
};
|
|
592
601
|
|
|
602
|
+
/**
|
|
603
|
+
* Skill collection transformer for directory-based skill imports
|
|
604
|
+
* Scans a directory for subdirectories containing SKILL.md files
|
|
605
|
+
*/
|
|
606
|
+
/**
|
|
607
|
+
* Skill collection transformer preset
|
|
608
|
+
* Transforms directory imports with ?skills suffix into an array of skill imports
|
|
609
|
+
*
|
|
610
|
+
* Matches:
|
|
611
|
+
* - ./all?skills (recommended - generates all.js in the directory)
|
|
612
|
+
* - ./_skills?skills (generates _skills.js in the directory)
|
|
613
|
+
* - Any path ending with a filename and ?skills
|
|
614
|
+
*
|
|
615
|
+
* NOTE: A filename before ?skills is REQUIRED to avoid naming conflicts.
|
|
616
|
+
* The filename becomes the output module name.
|
|
617
|
+
*
|
|
618
|
+
* @example
|
|
619
|
+
* ```typescript
|
|
620
|
+
* import skills from './all?skills';
|
|
621
|
+
* // Scans current directory for subdirectories with SKILL.md
|
|
622
|
+
* // Generates all.js containing array of all skills
|
|
623
|
+
* ```
|
|
624
|
+
*/
|
|
625
|
+
const skillCollectionTransformer = {
|
|
626
|
+
pattern: /\/[^/?]+\?skills$/,
|
|
627
|
+
virtual: true, // Indicates this doesn't transform a real file
|
|
628
|
+
transform: (_content, filePath) => {
|
|
629
|
+
// Remove ?skills suffix and the filename to get directory path
|
|
630
|
+
// Example: /path/code/all?skills -> /path/code/all -> /path/code/
|
|
631
|
+
const pathWithoutQuery = filePath.replace(/\?skills$/, '');
|
|
632
|
+
const dirPath = path.dirname(pathWithoutQuery);
|
|
633
|
+
if (!existsSync(dirPath)) {
|
|
634
|
+
throw new Error(`Directory not found: ${dirPath}`);
|
|
635
|
+
}
|
|
636
|
+
if (!statSync(dirPath).isDirectory()) {
|
|
637
|
+
throw new Error(`Not a directory: ${dirPath}`);
|
|
638
|
+
}
|
|
639
|
+
// Scan for subdirectories containing SKILL.md
|
|
640
|
+
const entries = readdirSync(dirPath);
|
|
641
|
+
const imports = [];
|
|
642
|
+
const names = [];
|
|
643
|
+
for (const entry of entries) {
|
|
644
|
+
const entryPath = path.join(dirPath, entry);
|
|
645
|
+
try {
|
|
646
|
+
if (statSync(entryPath).isDirectory()) {
|
|
647
|
+
const skillFile = path.join(entryPath, 'SKILL.md');
|
|
648
|
+
if (existsSync(skillFile)) {
|
|
649
|
+
// Generate unique identifier from directory name
|
|
650
|
+
const identifier = `Skill_${entry.replace(/[^a-zA-Z0-9_]/g, '_')}`;
|
|
651
|
+
imports.push(`import ${identifier} from './${entry}/SKILL.md';`);
|
|
652
|
+
names.push(identifier);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
catch (err) {
|
|
657
|
+
// Skip entries that can't be read
|
|
658
|
+
continue;
|
|
659
|
+
}
|
|
660
|
+
}
|
|
661
|
+
if (names.length === 0) {
|
|
662
|
+
console.warn(`No SKILL.md files found in subdirectories of ${dirPath}`);
|
|
663
|
+
}
|
|
664
|
+
// Generate code that imports all skills and exports as array
|
|
665
|
+
const code = [
|
|
666
|
+
...imports,
|
|
667
|
+
'',
|
|
668
|
+
`export default [${names.join(', ')}];`
|
|
669
|
+
].join('\n');
|
|
670
|
+
return {
|
|
671
|
+
data: null, // Not used when custom code is provided
|
|
672
|
+
code
|
|
673
|
+
};
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
|
|
593
677
|
/**
|
|
594
678
|
* Raw transformer preset for importing file content as strings
|
|
595
679
|
*/
|
|
@@ -612,5 +696,199 @@ const rawTransformer = {
|
|
|
612
696
|
}
|
|
613
697
|
};
|
|
614
698
|
|
|
615
|
-
|
|
699
|
+
/**
|
|
700
|
+
* Prompt transformer preset for template files with frontmatter
|
|
701
|
+
* Supports .jst, .hbs, and plain text files
|
|
702
|
+
*/
|
|
703
|
+
/**
|
|
704
|
+
* Template type for prompt content
|
|
705
|
+
* MUST match TemplateType from @vertesia/common
|
|
706
|
+
*/
|
|
707
|
+
var TemplateType;
|
|
708
|
+
(function (TemplateType) {
|
|
709
|
+
TemplateType["jst"] = "jst";
|
|
710
|
+
TemplateType["handlebars"] = "handlebars";
|
|
711
|
+
TemplateType["text"] = "text";
|
|
712
|
+
})(TemplateType || (TemplateType = {}));
|
|
713
|
+
/**
|
|
714
|
+
* Prompt role enum
|
|
715
|
+
* MUST match PromptRole from @llumiverse/common
|
|
716
|
+
*/
|
|
717
|
+
var PromptRole;
|
|
718
|
+
(function (PromptRole) {
|
|
719
|
+
PromptRole["safety"] = "safety";
|
|
720
|
+
PromptRole["system"] = "system";
|
|
721
|
+
PromptRole["user"] = "user";
|
|
722
|
+
PromptRole["assistant"] = "assistant";
|
|
723
|
+
PromptRole["negative"] = "negative";
|
|
724
|
+
})(PromptRole || (PromptRole = {}));
|
|
725
|
+
/**
|
|
726
|
+
* Zod schema for prompt frontmatter validation
|
|
727
|
+
*/
|
|
728
|
+
const PromptFrontmatterSchema = z.object({
|
|
729
|
+
// Required fields
|
|
730
|
+
role: z.nativeEnum(PromptRole, {
|
|
731
|
+
errorMap: () => ({ message: 'Role must be one of: safety, system, user, assistant, negative' })
|
|
732
|
+
}),
|
|
733
|
+
// Optional fields
|
|
734
|
+
content_type: z.nativeEnum(TemplateType).optional(),
|
|
735
|
+
schema: z.string().optional(),
|
|
736
|
+
name: z.string().optional(),
|
|
737
|
+
externalId: z.string().optional(),
|
|
738
|
+
}).strict();
|
|
739
|
+
/**
|
|
740
|
+
* MUST be kept in sync with @vertesia/common InCodePrompt
|
|
741
|
+
* Zod schema for prompt definition
|
|
742
|
+
*/
|
|
743
|
+
const PromptDefinitionSchema = z.object({
|
|
744
|
+
role: z.nativeEnum(PromptRole),
|
|
745
|
+
content: z.string(),
|
|
746
|
+
content_type: z.nativeEnum(TemplateType),
|
|
747
|
+
schema: z.any().optional(),
|
|
748
|
+
name: z.string().optional(),
|
|
749
|
+
externalId: z.string().optional(),
|
|
750
|
+
});
|
|
751
|
+
/**
|
|
752
|
+
* Normalize schema path for import
|
|
753
|
+
* - Adds './' prefix if not a relative path
|
|
754
|
+
* - Replaces .ts with .js
|
|
755
|
+
* - Adds .js if no extension
|
|
756
|
+
*
|
|
757
|
+
* @param schemaPath - Original schema path from frontmatter
|
|
758
|
+
* @returns Normalized path for ES module import
|
|
759
|
+
*/
|
|
760
|
+
function normalizeSchemaPath(schemaPath) {
|
|
761
|
+
let normalized = schemaPath.trim();
|
|
762
|
+
// Add './' prefix if not already a relative path
|
|
763
|
+
if (!normalized.startsWith('.')) {
|
|
764
|
+
normalized = './' + normalized;
|
|
765
|
+
}
|
|
766
|
+
// Get the extension
|
|
767
|
+
const ext = path$1.extname(normalized);
|
|
768
|
+
if (ext === '.ts') {
|
|
769
|
+
// Replace .ts with .js
|
|
770
|
+
normalized = normalized.slice(0, -3) + '.js';
|
|
771
|
+
}
|
|
772
|
+
else if (!ext) {
|
|
773
|
+
// No extension, add .js
|
|
774
|
+
normalized = normalized + '.js';
|
|
775
|
+
}
|
|
776
|
+
// If extension is already .js or something else, leave as is
|
|
777
|
+
return normalized;
|
|
778
|
+
}
|
|
779
|
+
/**
|
|
780
|
+
* Infer content type from file extension
|
|
781
|
+
*
|
|
782
|
+
* @param filePath - Path to the prompt file
|
|
783
|
+
* @returns Inferred content type
|
|
784
|
+
*/
|
|
785
|
+
function inferContentType(filePath) {
|
|
786
|
+
const ext = path$1.extname(filePath).toLowerCase();
|
|
787
|
+
switch (ext) {
|
|
788
|
+
case '.jst':
|
|
789
|
+
return TemplateType.jst;
|
|
790
|
+
case '.hbs':
|
|
791
|
+
return TemplateType.handlebars;
|
|
792
|
+
default:
|
|
793
|
+
return TemplateType.text;
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Build a PromptDefinition from frontmatter and content
|
|
798
|
+
*
|
|
799
|
+
* @param frontmatter - Parsed frontmatter object
|
|
800
|
+
* @param content - Prompt content (body of the file)
|
|
801
|
+
* @param filePath - Path to the prompt file (for content type inference)
|
|
802
|
+
* @returns Prompt definition object and optional imports
|
|
803
|
+
*/
|
|
804
|
+
function buildPromptDefinition(frontmatter, content, filePath) {
|
|
805
|
+
// Determine content type from frontmatter or file extension
|
|
806
|
+
const content_type = frontmatter.content_type || inferContentType(filePath);
|
|
807
|
+
const prompt = {
|
|
808
|
+
role: frontmatter.role,
|
|
809
|
+
content,
|
|
810
|
+
content_type,
|
|
811
|
+
};
|
|
812
|
+
// Add optional fields
|
|
813
|
+
if (frontmatter.name) {
|
|
814
|
+
prompt.name = frontmatter.name;
|
|
815
|
+
}
|
|
816
|
+
if (frontmatter.externalId) {
|
|
817
|
+
prompt.externalId = frontmatter.externalId;
|
|
818
|
+
}
|
|
819
|
+
// Handle schema import if specified
|
|
820
|
+
let imports;
|
|
821
|
+
let schemaImportName;
|
|
822
|
+
if (frontmatter.schema) {
|
|
823
|
+
const normalizedPath = normalizeSchemaPath(frontmatter.schema);
|
|
824
|
+
schemaImportName = '__promptSchema';
|
|
825
|
+
imports = [`import ${schemaImportName} from '${normalizedPath}';`];
|
|
826
|
+
}
|
|
827
|
+
return { prompt, imports, schemaImportName };
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Prompt transformer preset
|
|
831
|
+
* Transforms template files with ?prompt suffix into prompt definition objects
|
|
832
|
+
*
|
|
833
|
+
* Supported file types:
|
|
834
|
+
* - .jst (JavaScript template literals) → content_type: 'jst'
|
|
835
|
+
* - .hbs (Handlebars templates) → content_type: 'handlebars'
|
|
836
|
+
* - .txt or other → content_type: 'text'
|
|
837
|
+
*
|
|
838
|
+
* @example
|
|
839
|
+
* ```typescript
|
|
840
|
+
* import PROMPT from './prompt.hbs?prompt';
|
|
841
|
+
* // PROMPT is an InCodePrompt object
|
|
842
|
+
* ```
|
|
843
|
+
*/
|
|
844
|
+
const promptTransformer = {
|
|
845
|
+
pattern: /\?prompt$/,
|
|
846
|
+
schema: PromptDefinitionSchema,
|
|
847
|
+
transform: (content, filePath) => {
|
|
848
|
+
const { frontmatter, content: promptContent } = parseFrontmatter(content);
|
|
849
|
+
// Validate frontmatter
|
|
850
|
+
const frontmatterValidation = PromptFrontmatterSchema.safeParse(frontmatter);
|
|
851
|
+
if (!frontmatterValidation.success) {
|
|
852
|
+
const errors = frontmatterValidation.error.errors
|
|
853
|
+
.map((err) => {
|
|
854
|
+
const path = err.path.length > 0 ? err.path.join('.') : 'frontmatter';
|
|
855
|
+
return ` - ${path}: ${err.message}`;
|
|
856
|
+
})
|
|
857
|
+
.join('\n');
|
|
858
|
+
throw new Error(`Invalid frontmatter in ${filePath}:\n${errors}`);
|
|
859
|
+
}
|
|
860
|
+
// Build prompt definition
|
|
861
|
+
const { prompt, imports, schemaImportName } = buildPromptDefinition(frontmatter, promptContent, filePath);
|
|
862
|
+
// If schema is specified, generate custom code with schema reference
|
|
863
|
+
if (schemaImportName) {
|
|
864
|
+
// Build the code manually to avoid JSON.stringify issues with schema reference
|
|
865
|
+
const lines = [
|
|
866
|
+
'export default {',
|
|
867
|
+
` role: "${prompt.role}",`,
|
|
868
|
+
` content: ${JSON.stringify(prompt.content)},`,
|
|
869
|
+
` content_type: "${prompt.content_type}",`,
|
|
870
|
+
` schema: ${schemaImportName}`,
|
|
871
|
+
];
|
|
872
|
+
if (prompt.name) {
|
|
873
|
+
lines.splice(4, 0, ` name: ${JSON.stringify(prompt.name)},`);
|
|
874
|
+
}
|
|
875
|
+
if (prompt.externalId) {
|
|
876
|
+
lines.splice(4, 0, ` externalId: ${JSON.stringify(prompt.externalId)},`);
|
|
877
|
+
}
|
|
878
|
+
lines.push('};');
|
|
879
|
+
const code = lines.join('\n');
|
|
880
|
+
return {
|
|
881
|
+
data: prompt,
|
|
882
|
+
imports,
|
|
883
|
+
code,
|
|
884
|
+
};
|
|
885
|
+
}
|
|
886
|
+
// Standard case without schema
|
|
887
|
+
return {
|
|
888
|
+
data: prompt,
|
|
889
|
+
};
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
|
|
893
|
+
export { PromptDefinitionSchema, PromptRole, SkillDefinitionSchema, TemplateType, parseFrontmatter, promptTransformer, rawTransformer, skillCollectionTransformer, skillTransformer, vertesiaImportPlugin };
|
|
616
894
|
//# sourceMappingURL=build-tools.js.map
|
package/lib/build-tools.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-tools.js","sources":["esm/utils/asset-copy.js","esm/utils/widget-compiler.js","esm/plugin.js","esm/parsers/frontmatter.js","esm/utils/asset-discovery.js","esm/presets/skill.js","esm/presets/raw.js"],"sourcesContent":["/**\n * Utilities for copying asset files during build\n */\nimport { copyFileSync, mkdirSync } from 'node:fs';\nimport path from 'node:path';\n/**\n * Ensure a directory exists, creating it recursively if needed\n */\nfunction ensureDirectory(dirPath) {\n try {\n mkdirSync(dirPath, { recursive: true });\n }\n catch (error) {\n // Ignore if directory already exists\n if (error.code !== 'EEXIST') {\n throw error;\n }\n }\n}\n/**\n * Copy an asset file to its destination\n *\n * @param asset - Asset file information\n * @param assetsRoot - Root directory for assets\n */\nexport function copyAssetFile(asset, assetsRoot) {\n const destPath = path.join(assetsRoot, asset.destPath);\n const destDir = path.dirname(destPath);\n // Ensure destination directory exists\n ensureDirectory(destDir);\n // Copy file\n try {\n copyFileSync(asset.sourcePath, destPath);\n }\n catch (error) {\n throw new Error(`Failed to copy asset from ${asset.sourcePath} to ${destPath}: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n/**\n * Copy multiple asset files\n *\n * @param assets - Array of asset files to copy\n * @param assetsRoot - Root directory for assets\n * @returns Number of files copied\n */\nexport function copyAssets(assets, assetsRoot) {\n let copied = 0;\n for (const asset of assets) {\n copyAssetFile(asset, assetsRoot);\n copied++;\n }\n return copied;\n}\n//# sourceMappingURL=asset-copy.js.map","/**\n * Widget compilation utility using Rollup\n */\nimport { rollup } from 'rollup';\nimport path from 'node:path';\n/**\n * Default external dependencies for widgets\n */\nconst DEFAULT_EXTERNALS = [\n 'react',\n 'react-dom',\n 'react/jsx-runtime',\n 'react/jsx-dev-runtime',\n 'react-dom/client'\n];\n/**\n * Compile widgets using Rollup\n *\n * @param widgets - Array of widget metadata to compile\n * @param outputDir - Directory to write compiled widgets\n * @param config - Widget compilation configuration\n * @returns Number of widgets compiled\n */\nexport async function compileWidgets(widgets, outputDir, config = {}) {\n if (widgets.length === 0) {\n return 0;\n }\n const { external = DEFAULT_EXTERNALS, tsconfig = './tsconfig.json', typescript: typescriptOptions = {}, minify = false } = config;\n // Build each widget separately to get individual bundles\n const buildPromises = widgets.map(async (widget) => {\n // Dynamically import plugins - use any to bypass TypeScript module resolution issues\n const typescript = (await import('@rollup/plugin-typescript')).default;\n const nodeResolve = (await import('@rollup/plugin-node-resolve')).default;\n const commonjs = (await import('@rollup/plugin-commonjs')).default;\n const plugins = [\n typescript({\n tsconfig,\n declaration: false,\n sourceMap: true,\n ...typescriptOptions\n }),\n nodeResolve({\n browser: true,\n preferBuiltins: false,\n extensions: ['.tsx', '.ts', '.jsx', '.js']\n }),\n commonjs()\n ];\n // Add minification if requested\n if (minify) {\n const { terser } = await import('rollup-plugin-terser');\n plugins.push(terser({\n compress: {\n drop_console: false\n }\n }));\n }\n const rollupConfig = {\n input: widget.path,\n output: {\n file: path.join(outputDir, `${widget.name}.js`),\n format: 'es',\n sourcemap: true,\n inlineDynamicImports: true\n },\n external,\n plugins\n };\n const bundle = await rollup(rollupConfig);\n await bundle.write(rollupConfig.output);\n await bundle.close();\n });\n await Promise.all(buildPromises);\n return widgets.length;\n}\n//# sourceMappingURL=widget-compiler.js.map","/**\n * Core Rollup plugin implementation for transforming imports\n */\nimport { readFileSync } from 'node:fs';\nimport path from 'node:path';\nimport { copyAssets } from './utils/asset-copy.js';\nimport { compileWidgets } from './utils/widget-compiler.js';\n/**\n * Creates a Rollup plugin that transforms imports based on configured rules\n */\nexport function vertesiaImportPlugin(config) {\n const { transformers, assetsDir = './dist', widgetConfig } = config;\n if (!transformers || transformers.length === 0) {\n throw new Error('vertesiaImportPlugin: At least one transformer must be configured');\n }\n // Track assets to copy and widgets to compile\n const assetsToProcess = [];\n const widgetsToCompile = [];\n const shouldCopyAssets = assetsDir !== false;\n const shouldCompileWidgets = widgetConfig !== undefined && assetsDir !== false;\n return {\n name: 'vertesia-import-plugin',\n /**\n * Resolve import IDs to handle pattern-based imports\n */\n resolveId(source, importer) {\n // Check if any transformer pattern matches\n for (const transformer of transformers) {\n if (transformer.pattern.test(source)) {\n // Handle relative imports\n if (source.startsWith('.') && importer) {\n const cleanSource = source.replace(transformer.pattern, '');\n const resolved = path.resolve(path.dirname(importer), cleanSource);\n // Return with the pattern suffix to identify it in load\n const suffix = source.match(transformer.pattern)?.[0] || '';\n return resolved + suffix;\n }\n return source;\n }\n }\n return null; // Let other plugins handle it\n },\n /**\n * Load and transform the file content\n */\n async load(id) {\n // Find matching transformer\n let matchedTransformer;\n let cleanId = id;\n for (const transformer of transformers) {\n if (transformer.pattern.test(id)) {\n matchedTransformer = transformer;\n // Remove query parameters to get actual file path\n // For example: '/path/file.md?skill' -> '/path/file.md'\n // '/path/file.html?raw' -> '/path/file.html'\n const queryIndex = id.indexOf('?');\n cleanId = queryIndex >= 0 ? id.substring(0, queryIndex) : id;\n break;\n }\n }\n if (!matchedTransformer) {\n return null; // Not for us\n }\n try {\n // Read file content\n const content = readFileSync(cleanId, 'utf-8');\n // Transform the content\n const result = await matchedTransformer.transform(content, cleanId);\n // Collect assets if any\n if (result.assets && shouldCopyAssets) {\n assetsToProcess.push(...result.assets);\n }\n // Collect widgets if any\n if (result.widgets && shouldCompileWidgets) {\n widgetsToCompile.push(...result.widgets);\n }\n // Validate if schema provided\n if (matchedTransformer.schema) {\n const validation = matchedTransformer.schema.safeParse(result.data);\n if (!validation.success) {\n const errors = validation.error.errors\n .map((err) => ` - ${err.path.join('.')}: ${err.message}`)\n .join('\\n');\n throw new Error(`Validation failed for ${id}:\\n${errors}`);\n }\n }\n // Generate code\n if (result.code) {\n // Custom code provided\n return result.code;\n }\n else {\n // Default: export data (escape if string, otherwise stringify as JSON)\n const imports = result.imports ? result.imports.join('\\n') + '\\n\\n' : '';\n const dataJson = JSON.stringify(result.data, null, 2);\n return `${imports}export default ${dataJson};`;\n }\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n this.error(`Failed to transform ${id}: ${message}`);\n }\n },\n /**\n * Copy assets and compile widgets after all modules are loaded\n */\n async buildEnd() {\n // Copy script assets\n if (shouldCopyAssets && assetsToProcess.length > 0) {\n try {\n const copied = copyAssets(assetsToProcess, assetsDir);\n console.log(`Copied ${copied} asset file(s) to ${assetsDir}`);\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n this.warn(`Failed to copy assets: ${message}`);\n }\n }\n // Compile widgets\n if (shouldCompileWidgets && widgetsToCompile.length > 0) {\n try {\n const widgetsDir = config.widgetsDir || 'widgets';\n const outputDir = path.join(assetsDir, widgetsDir);\n console.log(`Compiling ${widgetsToCompile.length} widget(s)...`);\n const compiled = await compileWidgets(widgetsToCompile, outputDir, widgetConfig);\n console.log(`Compiled ${compiled} widget(s) to ${outputDir}`);\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n this.error(`Failed to compile widgets: ${message}`);\n }\n }\n }\n };\n}\n//# sourceMappingURL=plugin.js.map","/**\n * Frontmatter parser utility using gray-matter\n */\nimport matter from 'gray-matter';\n/**\n * Parse YAML frontmatter from markdown content\n *\n * @param content - Raw markdown content with optional frontmatter\n * @returns Parsed frontmatter and content\n */\nexport function parseFrontmatter(content) {\n const result = matter(content);\n return {\n frontmatter: result.data,\n content: result.content,\n original: content\n };\n}\n//# sourceMappingURL=frontmatter.js.map","/**\n * Utilities for discovering asset files (scripts, widgets) in skill directories\n */\nimport { readdirSync, statSync } from 'node:fs';\nimport path from 'node:path';\n/**\n * Check if a file exists and is a regular file\n */\nfunction isFile(filePath) {\n try {\n return statSync(filePath).isFile();\n }\n catch {\n return false;\n }\n}\n/**\n * Get all files in a directory (non-recursive)\n */\nfunction getFilesInDirectory(dirPath) {\n try {\n return readdirSync(dirPath).filter(file => {\n const fullPath = path.join(dirPath, file);\n return isFile(fullPath);\n });\n }\n catch {\n return [];\n }\n}\n/**\n * Check if a file is a script file (.js or .py)\n */\nfunction isScriptFile(fileName) {\n return /\\.(js|py)$/.test(fileName);\n}\n/**\n * Check if a file is a widget file (.tsx)\n */\nfunction isWidgetFile(fileName) {\n return /\\.tsx$/.test(fileName);\n}\n/**\n * Extract widget name from .tsx file (remove extension)\n */\nfunction getWidgetName(fileName) {\n return fileName.replace(/\\.tsx$/, '');\n}\n/**\n * Discover assets (scripts and widgets) in a skill directory\n *\n * @param skillFilePath - Absolute path to the skill.md file\n * @param options - Asset discovery options\n * @returns Discovered assets and metadata\n */\nexport function discoverSkillAssets(skillFilePath, options = {}) {\n const skillDir = path.dirname(skillFilePath);\n const files = getFilesInDirectory(skillDir);\n const scripts = [];\n const widgets = [];\n const widgetMetadata = [];\n const assetFiles = [];\n const scriptsDir = options.scriptsDir || 'scripts';\n for (const file of files) {\n const fullPath = path.join(skillDir, file);\n if (isScriptFile(file)) {\n // Script file (.js or .py)\n scripts.push(file);\n assetFiles.push({\n sourcePath: fullPath,\n destPath: path.join(scriptsDir, file),\n type: 'script'\n });\n }\n else if (isWidgetFile(file)) {\n // Widget file (.tsx)\n const widgetName = getWidgetName(file);\n widgets.push(widgetName);\n widgetMetadata.push({\n name: widgetName,\n path: fullPath\n });\n // Note: We don't add widget .tsx files to assetFiles\n // Widgets are compiled by the plugin if widgetConfig is provided\n }\n }\n return {\n scripts,\n widgets,\n widgetMetadata,\n assetFiles\n };\n}\n//# sourceMappingURL=asset-discovery.js.map","/**\n * Skill transformer preset for markdown files with frontmatter\n */\nimport { z } from 'zod';\nimport { parseFrontmatter } from '../parsers/frontmatter.js';\nimport { discoverSkillAssets } from '../utils/asset-discovery.js';\n/**\n * Context triggers for auto-injection of skills (for frontmatter validation)\n */\nconst SkillContextTriggersFrontmatterSchema = z.object({\n keywords: z.array(z.string()).optional(),\n tool_names: z.array(z.string()).optional(),\n data_patterns: z.array(z.string()).optional()\n}).strict();\n/**\n * Context triggers for auto-injection of skills (for output validation)\n */\nconst SkillContextTriggersSchema = z.object({\n keywords: z.array(z.string()).optional(),\n tool_names: z.array(z.string()).optional(),\n data_patterns: z.array(z.string()).optional()\n}).optional();\n/**\n * Execution configuration for skills that need code execution (for frontmatter validation)\n */\nconst SkillExecutionFrontmatterSchema = z.object({\n language: z.string(),\n packages: z.array(z.string()).optional(),\n system_packages: z.array(z.string()).optional(),\n template: z.string().optional()\n}).strict();\n/**\n * Execution configuration for skills that need code execution (for output validation)\n */\nconst SkillExecutionSchema = z.object({\n language: z.string(),\n packages: z.array(z.string()).optional(),\n system_packages: z.array(z.string()).optional(),\n template: z.string().optional()\n}).optional();\n/**\n * Zod schema for skill frontmatter validation\n * This validates the YAML frontmatter before transformation\n * Supports both flat and nested structures\n */\nconst SkillFrontmatterSchema = z.object({\n // Required fields\n name: z.string().min(1, 'Skill name is required'),\n description: z.string().min(1, 'Skill description is required'),\n // Optional fields\n title: z.string().optional(),\n content_type: z.enum(['md', 'jst']).optional(),\n // Flat structure fields (legacy)\n keywords: z.array(z.string()).optional(),\n tools: z.array(z.string()).optional(),\n data_patterns: z.array(z.string()).optional(),\n language: z.string().optional(),\n packages: z.array(z.string()).optional(),\n system_packages: z.array(z.string()).optional(),\n // Nested structure fields\n context_triggers: SkillContextTriggersFrontmatterSchema.optional(),\n execution: SkillExecutionFrontmatterSchema.optional(),\n related_tools: z.array(z.string()).optional(),\n input_schema: z.object({\n type: z.literal('object'),\n properties: z.record(z.any()).optional(),\n required: z.array(z.string()).optional()\n }).optional(),\n // Asset fields (auto-discovered but can be overridden)\n scripts: z.array(z.string()).optional(),\n widgets: z.array(z.string()).optional()\n}).strict();\n/**\n * MUST be kept in sync with @vertesia/tools-sdk SkillDefinition\n * Zod schema for skill definition\n * This validates the structure of skill objects generated from markdown\n * Matches the SkillDefinition interface from @vertesia/tools-sdk\n */\nexport const SkillDefinitionSchema = z.object({\n name: z.string().min(1, 'Skill name is required'),\n title: z.string().optional(),\n description: z.string().min(1, 'Skill description is required'),\n instructions: z.string(),\n content_type: z.enum(['md', 'jst']),\n input_schema: z.object({\n type: z.literal('object'),\n properties: z.record(z.any()).optional(),\n required: z.array(z.string()).optional()\n }).optional(),\n context_triggers: SkillContextTriggersSchema,\n execution: SkillExecutionSchema,\n related_tools: z.array(z.string()).optional(),\n scripts: z.array(z.string()).optional(),\n widgets: z.array(z.string()).optional()\n});\n/**\n * Build a SkillDefinition from frontmatter and markdown content.\n * This mirrors the logic in @vertesia/tools-sdk parseSkillFile function.\n *\n * Supports two frontmatter structures:\n *\n * 1. Flat structure (matches parseSkillFile in tools-sdk):\n * keywords: [...]\n * tools: [...]\n * language: python\n * packages: [...]\n *\n * 2. Nested structure (for more explicit YAML):\n * context_triggers:\n * keywords: [...]\n * tool_names: [...]\n * execution:\n * language: python\n * packages: [...]\n * related_tools: [...]\n *\n * @param frontmatter - Parsed frontmatter object\n * @param instructions - Markdown content (body of the file)\n * @param contentType - Content type ('md' or 'jst')\n * @param widgets - Discovered widget names\n * @param scripts - Discovered script names\n * @returns Skill definition object\n */\nfunction buildSkillDefinition(frontmatter, instructions, contentType, widgets, scripts) {\n const skill = {\n name: frontmatter.name,\n title: frontmatter.title,\n description: frontmatter.description,\n instructions,\n content_type: contentType,\n widgets: widgets.length > 0 ? widgets : undefined,\n scripts: scripts.length > 0 ? scripts : undefined,\n };\n // Build context triggers - support both flat and nested structure\n // Nested: context_triggers: { keywords: [...], tool_names: [...] }\n // Flat: keywords: [...], tools: [...]\n const contextTriggers = frontmatter.context_triggers;\n const hasNestedTriggers = contextTriggers && typeof contextTriggers === 'object';\n const hasFlatTriggers = frontmatter.keywords || frontmatter.tools || frontmatter.data_patterns;\n if (hasNestedTriggers || hasFlatTriggers) {\n skill.context_triggers = {\n keywords: hasNestedTriggers ? contextTriggers.keywords : frontmatter.keywords,\n tool_names: hasNestedTriggers ? contextTriggers.tool_names : frontmatter.tools,\n data_patterns: hasNestedTriggers ? contextTriggers.data_patterns : frontmatter.data_patterns,\n };\n }\n // Build execution config - support both flat and nested structure\n const execution = frontmatter.execution;\n const hasNestedExecution = execution && typeof execution === 'object';\n const hasFlatExecution = frontmatter.language;\n if (hasNestedExecution || hasFlatExecution) {\n skill.execution = {\n language: hasNestedExecution ? execution.language : frontmatter.language,\n packages: hasNestedExecution ? execution.packages : frontmatter.packages,\n system_packages: hasNestedExecution ? execution.system_packages : frontmatter.system_packages,\n };\n // Extract code template from instructions if present\n const codeBlockMatch = instructions.match(/```(?:python|javascript|typescript|js|ts|py)\\n([\\s\\S]*?)```/);\n if (codeBlockMatch) {\n skill.execution.template = codeBlockMatch[1].trim();\n }\n }\n // Related tools - support both direct field and from tools field\n if (frontmatter.related_tools) {\n skill.related_tools = frontmatter.related_tools;\n }\n else if (frontmatter.tools && !hasNestedTriggers) {\n // If tools is not part of context_triggers, use it as related_tools\n skill.related_tools = frontmatter.tools;\n }\n // Input schema from frontmatter\n if (frontmatter.input_schema) {\n skill.input_schema = frontmatter.input_schema;\n }\n return skill;\n}\n/**\n * Skill transformer preset\n * Transforms markdown files with ?skill suffix OR SKILL.md files into skill definition objects\n *\n * Matches:\n * - Files with ?skill suffix: ./my-skill.md?skill\n * - SKILL.md files: ./my-skill/SKILL.md\n *\n * @example\n * ```typescript\n * import skill1 from './my-skill.md?skill';\n * import skill2 from './my-skill/SKILL.md';\n * // Both are SkillDefinition objects\n * ```\n */\nexport const skillTransformer = {\n pattern: /(\\.md\\?skill$|\\/SKILL\\.md$)/,\n schema: SkillDefinitionSchema,\n transform: (content, filePath) => {\n const { frontmatter, content: markdown } = parseFrontmatter(content);\n // Validate frontmatter first to catch unknown properties\n const frontmatterValidation = SkillFrontmatterSchema.safeParse(frontmatter);\n if (!frontmatterValidation.success) {\n const errors = frontmatterValidation.error.errors\n .map((err) => {\n const path = err.path.length > 0 ? err.path.join('.') : 'frontmatter';\n return ` - ${path}: ${err.message}`;\n })\n .join('\\n');\n throw new Error(`Invalid frontmatter in ${filePath}:\\n${errors}`);\n }\n // Determine content type from frontmatter or file extension\n const content_type = frontmatter.content_type || 'md';\n // Discover assets (scripts and widgets) in the skill directory\n const assets = discoverSkillAssets(filePath);\n // Build skill definition using the same logic as parseSkillFile in tools-sdk\n const skillData = buildSkillDefinition(frontmatter, markdown, content_type, assets.widgets, assets.scripts);\n return {\n data: skillData,\n assets: assets.assetFiles,\n widgets: assets.widgetMetadata\n };\n }\n};\n//# sourceMappingURL=skill.js.map","/**\n * Raw transformer preset for importing file content as strings\n */\n/**\n * Raw transformer preset\n * Transforms any file with ?raw suffix into a string export\n *\n * @example\n * ```typescript\n * import template from './template.html?raw';\n * // template is a string containing the file content\n * ```\n */\nexport const rawTransformer = {\n pattern: /\\?raw$/,\n transform: (content) => {\n return {\n data: content\n };\n }\n};\n//# sourceMappingURL=raw.js.map"],"names":[],"mappings":";;;;;;AAAA;AACA;AACA;AAGA;AACA;AACA;AACA,SAAS,eAAe,CAAC,OAAO,EAAE;AAClC,IAAI,IAAI;AACR,QAAQ,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC/C,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE;AAClB;AACA,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;AACrC,YAAY,MAAM,KAAK;AACvB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CAAC,CAAC,uBAAuB,EAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CAAC;AAC7E,QAAQ;AACR;AACA,QAAQ,MAAM,YAAY,GAAG,WAAW,CAAC,YAAY,IAAI,IAAI;AAC7D;AACA,QAAQ,MAAM,MAAM,GAAG,mBAAmB,CAAC,QAAQ,CAAC;AACpD;AACA,QAAQ,MAAM,SAAS,GAAG,oBAAoB,CAAC,WAAW,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC;AACnH,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,SAAS;AAC3B,YAAY,MAAM,EAAE,MAAM,CAAC,UAAU;AACrC,YAAY,OAAO,EAAE,MAAM,CAAC;AAC5B,SAAS;AACT,IAAI;AACJ;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACY,MAAC,cAAc,GAAG;AAC9B,IAAI,OAAO,EAAE,QAAQ;AACrB,IAAI,SAAS,EAAE,CAAC,OAAO,KAAK;AAC5B,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE;AAClB,SAAS;AACT,IAAI;AACJ;;;;"}
|
|
1
|
+
{"version":3,"file":"build-tools.js","sources":["esm/utils/asset-copy.js","esm/utils/widget-compiler.js","esm/plugin.js","esm/parsers/frontmatter.js","esm/utils/asset-discovery.js","esm/presets/skill.js","esm/presets/skill-collection.js","esm/presets/raw.js","esm/presets/prompt.js"],"sourcesContent":["/**\n * Utilities for copying asset files during build\n */\nimport { copyFileSync, mkdirSync } from 'node:fs';\nimport path from 'node:path';\n/**\n * Ensure a directory exists, creating it recursively if needed\n */\nfunction ensureDirectory(dirPath) {\n try {\n mkdirSync(dirPath, { recursive: true });\n }\n catch (error) {\n // Ignore if directory already exists\n if (error.code !== 'EEXIST') {\n throw error;\n }\n }\n}\n/**\n * Copy an asset file to its destination\n *\n * @param asset - Asset file information\n * @param assetsRoot - Root directory for assets\n */\nexport function copyAssetFile(asset, assetsRoot) {\n const destPath = path.join(assetsRoot, asset.destPath);\n const destDir = path.dirname(destPath);\n // Ensure destination directory exists\n ensureDirectory(destDir);\n // Copy file\n try {\n copyFileSync(asset.sourcePath, destPath);\n }\n catch (error) {\n throw new Error(`Failed to copy asset from ${asset.sourcePath} to ${destPath}: ${error instanceof Error ? error.message : String(error)}`);\n }\n}\n/**\n * Copy multiple asset files\n *\n * @param assets - Array of asset files to copy\n * @param assetsRoot - Root directory for assets\n * @returns Number of files copied\n */\nexport function copyAssets(assets, assetsRoot) {\n let copied = 0;\n for (const asset of assets) {\n copyAssetFile(asset, assetsRoot);\n copied++;\n }\n return copied;\n}\n//# sourceMappingURL=asset-copy.js.map","/**\n * Widget compilation utility using Rollup\n */\nimport { rollup } from 'rollup';\nimport path from 'node:path';\n/**\n * Default external dependencies for widgets\n */\nconst DEFAULT_EXTERNALS = [\n 'react',\n 'react-dom',\n 'react/jsx-runtime',\n 'react/jsx-dev-runtime',\n 'react-dom/client'\n];\n/**\n * Compile widgets using Rollup\n *\n * @param widgets - Array of widget metadata to compile\n * @param outputDir - Directory to write compiled widgets\n * @param config - Widget compilation configuration\n * @returns Number of widgets compiled\n */\nexport async function compileWidgets(widgets, outputDir, config = {}) {\n if (widgets.length === 0) {\n return 0;\n }\n const { external = DEFAULT_EXTERNALS, tsconfig = './tsconfig.json', typescript: typescriptOptions = {}, minify = false } = config;\n // Build each widget separately to get individual bundles\n const buildPromises = widgets.map(async (widget) => {\n // Dynamically import plugins - use any to bypass TypeScript module resolution issues\n const typescript = (await import('@rollup/plugin-typescript')).default;\n const nodeResolve = (await import('@rollup/plugin-node-resolve')).default;\n const commonjs = (await import('@rollup/plugin-commonjs')).default;\n const plugins = [\n typescript({\n tsconfig,\n declaration: false,\n sourceMap: true,\n ...typescriptOptions\n }),\n nodeResolve({\n browser: true,\n preferBuiltins: false,\n extensions: ['.tsx', '.ts', '.jsx', '.js']\n }),\n commonjs()\n ];\n // Add minification if requested\n if (minify) {\n const { terser } = await import('rollup-plugin-terser');\n plugins.push(terser({\n compress: {\n drop_console: false\n }\n }));\n }\n const rollupConfig = {\n input: widget.path,\n output: {\n file: path.join(outputDir, `${widget.name}.js`),\n format: 'es',\n sourcemap: true,\n inlineDynamicImports: true\n },\n external,\n plugins\n };\n const bundle = await rollup(rollupConfig);\n await bundle.write(rollupConfig.output);\n await bundle.close();\n });\n await Promise.all(buildPromises);\n return widgets.length;\n}\n//# sourceMappingURL=widget-compiler.js.map","/**\n * Core Rollup plugin implementation for transforming imports\n */\nimport { readFileSync } from 'node:fs';\nimport path from 'node:path';\nimport { copyAssets } from './utils/asset-copy.js';\nimport { compileWidgets } from './utils/widget-compiler.js';\n/**\n * Creates a Rollup plugin that transforms imports based on configured rules\n */\nexport function vertesiaImportPlugin(config) {\n const { transformers, assetsDir = './dist', widgetConfig } = config;\n if (!transformers || transformers.length === 0) {\n throw new Error('vertesiaImportPlugin: At least one transformer must be configured');\n }\n // Track assets to copy and widgets to compile\n const assetsToProcess = [];\n const widgetsToCompile = [];\n const shouldCopyAssets = assetsDir !== false;\n const shouldCompileWidgets = widgetConfig !== undefined && assetsDir !== false;\n return {\n name: 'vertesia-import-plugin',\n /**\n * Resolve import IDs to handle pattern-based imports\n */\n resolveId(source, importer) {\n // Check if any transformer pattern matches\n for (const transformer of transformers) {\n if (transformer.pattern.test(source)) {\n // Handle relative imports\n if (source.startsWith('.') && importer) {\n const cleanSource = source.replace(transformer.pattern, '');\n // Strip query parameters from importer to get the file path\n const cleanImporter = importer.indexOf('?') >= 0\n ? importer.substring(0, importer.indexOf('?'))\n : importer;\n // Always use dirname to get the directory containing the importer\n const baseDir = path.dirname(cleanImporter);\n const resolved = path.resolve(baseDir, cleanSource);\n // Return with the pattern suffix to identify it in load\n const suffix = source.match(transformer.pattern)?.[0] || '';\n return resolved + suffix;\n }\n return source;\n }\n }\n return null; // Let other plugins handle it\n },\n /**\n * Load and transform the file content\n */\n async load(id) {\n // Find matching transformer\n let matchedTransformer;\n let cleanId = id;\n for (const transformer of transformers) {\n if (transformer.pattern.test(id)) {\n matchedTransformer = transformer;\n // Remove query parameters to get actual file path\n // For example: '/path/file.md?skill' -> '/path/file.md'\n // '/path/file.html?raw' -> '/path/file.html'\n const queryIndex = id.indexOf('?');\n cleanId = queryIndex >= 0 ? id.substring(0, queryIndex) : id;\n break;\n }\n }\n if (!matchedTransformer) {\n return null; // Not for us\n }\n try {\n // Read file content (skip for virtual transforms)\n const content = matchedTransformer.virtual\n ? ''\n : readFileSync(cleanId, 'utf-8');\n // Transform the content\n const result = await matchedTransformer.transform(content, cleanId);\n // Collect assets if any\n if (result.assets && shouldCopyAssets) {\n assetsToProcess.push(...result.assets);\n }\n // Collect widgets if any\n if (result.widgets && shouldCompileWidgets) {\n widgetsToCompile.push(...result.widgets);\n }\n // Validate if schema provided\n if (matchedTransformer.schema) {\n const validation = matchedTransformer.schema.safeParse(result.data);\n if (!validation.success) {\n const errors = validation.error.errors\n .map((err) => ` - ${err.path.join('.')}: ${err.message}`)\n .join('\\n');\n throw new Error(`Validation failed for ${id}:\\n${errors}`);\n }\n }\n // Generate code\n const imports = result.imports ? result.imports.join('\\n') + '\\n\\n' : '';\n if (result.code) {\n // Custom code provided - prepend imports\n return imports + result.code;\n }\n else {\n // Default: export data (escape if string, otherwise stringify as JSON)\n const dataJson = JSON.stringify(result.data, null, 2);\n return `${imports}export default ${dataJson};`;\n }\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n this.error(`Failed to transform ${id}: ${message}`);\n }\n },\n /**\n * Copy assets and compile widgets after all modules are loaded\n */\n async buildEnd() {\n // Copy script assets\n if (shouldCopyAssets && assetsToProcess.length > 0) {\n try {\n const copied = copyAssets(assetsToProcess, assetsDir);\n console.log(`Copied ${copied} asset file(s) to ${assetsDir}`);\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n this.warn(`Failed to copy assets: ${message}`);\n }\n }\n // Compile widgets\n if (shouldCompileWidgets && widgetsToCompile.length > 0) {\n try {\n const widgetsDir = config.widgetsDir || 'widgets';\n const outputDir = path.join(assetsDir, widgetsDir);\n console.log(`Compiling ${widgetsToCompile.length} widget(s)...`);\n const compiled = await compileWidgets(widgetsToCompile, outputDir, widgetConfig);\n console.log(`Compiled ${compiled} widget(s) to ${outputDir}`);\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n this.error(`Failed to compile widgets: ${message}`);\n }\n }\n }\n };\n}\n//# sourceMappingURL=plugin.js.map","/**\n * Frontmatter parser utility using gray-matter\n */\nimport matter from 'gray-matter';\n/**\n * Parse YAML frontmatter from markdown content\n *\n * @param content - Raw markdown content with optional frontmatter\n * @returns Parsed frontmatter and content\n */\nexport function parseFrontmatter(content) {\n const result = matter(content);\n return {\n frontmatter: result.data,\n content: result.content,\n original: content\n };\n}\n//# sourceMappingURL=frontmatter.js.map","/**\n * Utilities for discovering asset files (scripts, widgets) in skill directories\n */\nimport { readdirSync, statSync } from 'node:fs';\nimport path from 'node:path';\n/**\n * Check if a file exists and is a regular file\n */\nfunction isFile(filePath) {\n try {\n return statSync(filePath).isFile();\n }\n catch {\n return false;\n }\n}\n/**\n * Get all files in a directory (non-recursive)\n */\nfunction getFilesInDirectory(dirPath) {\n try {\n return readdirSync(dirPath).filter(file => {\n const fullPath = path.join(dirPath, file);\n return isFile(fullPath);\n });\n }\n catch {\n return [];\n }\n}\n/**\n * Check if a file is a script file (.js or .py)\n */\nfunction isScriptFile(fileName) {\n return /\\.(js|py)$/.test(fileName);\n}\n/**\n * Check if a file is a widget file (.tsx)\n */\nfunction isWidgetFile(fileName) {\n return /\\.tsx$/.test(fileName);\n}\n/**\n * Extract widget name from .tsx file (remove extension)\n */\nfunction getWidgetName(fileName) {\n return fileName.replace(/\\.tsx$/, '');\n}\n/**\n * Discover assets (scripts and widgets) in a skill directory\n *\n * @param skillFilePath - Absolute path to the skill.md file\n * @param options - Asset discovery options\n * @returns Discovered assets and metadata\n */\nexport function discoverSkillAssets(skillFilePath, options = {}) {\n const skillDir = path.dirname(skillFilePath);\n const files = getFilesInDirectory(skillDir);\n const scripts = [];\n const widgets = [];\n const widgetMetadata = [];\n const assetFiles = [];\n const scriptsDir = options.scriptsDir || 'scripts';\n for (const file of files) {\n const fullPath = path.join(skillDir, file);\n if (isScriptFile(file)) {\n // Script file (.js or .py)\n scripts.push(file);\n assetFiles.push({\n sourcePath: fullPath,\n destPath: path.join(scriptsDir, file),\n type: 'script'\n });\n }\n else if (isWidgetFile(file)) {\n // Widget file (.tsx)\n const widgetName = getWidgetName(file);\n widgets.push(widgetName);\n widgetMetadata.push({\n name: widgetName,\n path: fullPath\n });\n // Note: We don't add widget .tsx files to assetFiles\n // Widgets are compiled by the plugin if widgetConfig is provided\n }\n }\n return {\n scripts,\n widgets,\n widgetMetadata,\n assetFiles\n };\n}\n//# sourceMappingURL=asset-discovery.js.map","/**\n * Skill transformer preset for markdown files with frontmatter\n */\nimport { z } from 'zod';\nimport { parseFrontmatter } from '../parsers/frontmatter.js';\nimport { discoverSkillAssets } from '../utils/asset-discovery.js';\n/**\n * Context triggers for auto-injection of skills (for frontmatter validation)\n */\nconst SkillContextTriggersFrontmatterSchema = z.object({\n keywords: z.array(z.string()).optional(),\n tool_names: z.array(z.string()).optional(),\n data_patterns: z.array(z.string()).optional()\n}).strict();\n/**\n * Context triggers for auto-injection of skills (for output validation)\n */\nconst SkillContextTriggersSchema = z.object({\n keywords: z.array(z.string()).optional(),\n tool_names: z.array(z.string()).optional(),\n data_patterns: z.array(z.string()).optional()\n}).optional();\n/**\n * Execution configuration for skills that need code execution (for frontmatter validation)\n */\nconst SkillExecutionFrontmatterSchema = z.object({\n language: z.string(),\n packages: z.array(z.string()).optional(),\n system_packages: z.array(z.string()).optional(),\n template: z.string().optional()\n}).strict();\n/**\n * Execution configuration for skills that need code execution (for output validation)\n */\nconst SkillExecutionSchema = z.object({\n language: z.string(),\n packages: z.array(z.string()).optional(),\n system_packages: z.array(z.string()).optional(),\n template: z.string().optional()\n}).optional();\n/**\n * Zod schema for skill frontmatter validation\n * This validates the YAML frontmatter before transformation\n * Supports both flat and nested structures\n */\nconst SkillFrontmatterSchema = z.object({\n // Required fields\n name: z.string().min(1, 'Skill name is required'),\n description: z.string().min(1, 'Skill description is required'),\n // Optional fields\n title: z.string().optional(),\n content_type: z.enum(['md', 'jst']).optional(),\n // Flat structure fields (legacy)\n keywords: z.array(z.string()).optional(),\n tools: z.array(z.string()).optional(),\n data_patterns: z.array(z.string()).optional(),\n language: z.string().optional(),\n packages: z.array(z.string()).optional(),\n system_packages: z.array(z.string()).optional(),\n // Nested structure fields\n context_triggers: SkillContextTriggersFrontmatterSchema.optional(),\n execution: SkillExecutionFrontmatterSchema.optional(),\n related_tools: z.array(z.string()).optional(),\n input_schema: z.object({\n type: z.literal('object'),\n properties: z.record(z.any()).optional(),\n required: z.array(z.string()).optional()\n }).optional(),\n // Asset fields (auto-discovered but can be overridden)\n scripts: z.array(z.string()).optional(),\n widgets: z.array(z.string()).optional()\n}).strict();\n/**\n * MUST be kept in sync with @vertesia/tools-sdk SkillDefinition\n * Zod schema for skill definition\n * This validates the structure of skill objects generated from markdown\n * Matches the SkillDefinition interface from @vertesia/tools-sdk\n */\nexport const SkillDefinitionSchema = z.object({\n name: z.string().min(1, 'Skill name is required'),\n title: z.string().optional(),\n description: z.string().min(1, 'Skill description is required'),\n instructions: z.string(),\n content_type: z.enum(['md', 'jst']),\n input_schema: z.object({\n type: z.literal('object'),\n properties: z.record(z.any()).optional(),\n required: z.array(z.string()).optional()\n }).optional(),\n context_triggers: SkillContextTriggersSchema,\n execution: SkillExecutionSchema,\n related_tools: z.array(z.string()).optional(),\n scripts: z.array(z.string()).optional(),\n widgets: z.array(z.string()).optional()\n});\n/**\n * Build a SkillDefinition from frontmatter and markdown content.\n * This mirrors the logic in @vertesia/tools-sdk parseSkillFile function.\n *\n * Supports two frontmatter structures:\n *\n * 1. Flat structure (matches parseSkillFile in tools-sdk):\n * keywords: [...]\n * tools: [...]\n * language: python\n * packages: [...]\n *\n * 2. Nested structure (for more explicit YAML):\n * context_triggers:\n * keywords: [...]\n * tool_names: [...]\n * execution:\n * language: python\n * packages: [...]\n * related_tools: [...]\n *\n * @param frontmatter - Parsed frontmatter object\n * @param instructions - Markdown content (body of the file)\n * @param contentType - Content type ('md' or 'jst')\n * @param widgets - Discovered widget names\n * @param scripts - Discovered script names\n * @returns Skill definition object\n */\nfunction buildSkillDefinition(frontmatter, instructions, contentType, widgets, scripts) {\n const skill = {\n name: frontmatter.name,\n title: frontmatter.title,\n description: frontmatter.description,\n instructions,\n content_type: contentType,\n widgets: widgets.length > 0 ? widgets : undefined,\n scripts: scripts.length > 0 ? scripts : undefined,\n };\n // Build context triggers - support both flat and nested structure\n // Nested: context_triggers: { keywords: [...], tool_names: [...] }\n // Flat: keywords: [...], tools: [...]\n const contextTriggers = frontmatter.context_triggers;\n const hasNestedTriggers = contextTriggers && typeof contextTriggers === 'object';\n const hasFlatTriggers = frontmatter.keywords || frontmatter.tools || frontmatter.data_patterns;\n if (hasNestedTriggers || hasFlatTriggers) {\n skill.context_triggers = {\n keywords: hasNestedTriggers ? contextTriggers.keywords : frontmatter.keywords,\n tool_names: hasNestedTriggers ? contextTriggers.tool_names : frontmatter.tools,\n data_patterns: hasNestedTriggers ? contextTriggers.data_patterns : frontmatter.data_patterns,\n };\n }\n // Build execution config - support both flat and nested structure\n const execution = frontmatter.execution;\n const hasNestedExecution = execution && typeof execution === 'object';\n const hasFlatExecution = frontmatter.language;\n if (hasNestedExecution || hasFlatExecution) {\n skill.execution = {\n language: hasNestedExecution ? execution.language : frontmatter.language,\n packages: hasNestedExecution ? execution.packages : frontmatter.packages,\n system_packages: hasNestedExecution ? execution.system_packages : frontmatter.system_packages,\n };\n // Extract code template from instructions if present\n const codeBlockMatch = instructions.match(/```(?:python|javascript|typescript|js|ts|py)\\n([\\s\\S]*?)```/);\n if (codeBlockMatch) {\n skill.execution.template = codeBlockMatch[1].trim();\n }\n }\n // Related tools - support both direct field and from tools field\n if (frontmatter.related_tools) {\n skill.related_tools = frontmatter.related_tools;\n }\n else if (frontmatter.tools && !hasNestedTriggers) {\n // If tools is not part of context_triggers, use it as related_tools\n skill.related_tools = frontmatter.tools;\n }\n // Input schema from frontmatter\n if (frontmatter.input_schema) {\n skill.input_schema = frontmatter.input_schema;\n }\n return skill;\n}\n/**\n * Skill transformer preset\n * Transforms markdown files with ?skill suffix OR SKILL.md files into skill definition objects\n *\n * Matches:\n * - Files with ?skill suffix: ./my-skill.md?skill\n * - SKILL.md files: ./my-skill/SKILL.md\n *\n * @example\n * ```typescript\n * import skill1 from './my-skill.md?skill';\n * import skill2 from './my-skill/SKILL.md';\n * // Both are SkillDefinition objects\n * ```\n */\nexport const skillTransformer = {\n pattern: /(\\.md\\?skill$|\\/SKILL\\.md$)/,\n schema: SkillDefinitionSchema,\n transform: (content, filePath) => {\n const { frontmatter, content: markdown } = parseFrontmatter(content);\n // Validate frontmatter first to catch unknown properties\n const frontmatterValidation = SkillFrontmatterSchema.safeParse(frontmatter);\n if (!frontmatterValidation.success) {\n const errors = frontmatterValidation.error.errors\n .map((err) => {\n const path = err.path.length > 0 ? err.path.join('.') : 'frontmatter';\n return ` - ${path}: ${err.message}`;\n })\n .join('\\n');\n throw new Error(`Invalid frontmatter in ${filePath}:\\n${errors}`);\n }\n // Determine content type from frontmatter or file extension\n const content_type = frontmatter.content_type || 'md';\n // Discover assets (scripts and widgets) in the skill directory\n const assets = discoverSkillAssets(filePath);\n // Build skill definition using the same logic as parseSkillFile in tools-sdk\n const skillData = buildSkillDefinition(frontmatter, markdown, content_type, assets.widgets, assets.scripts);\n return {\n data: skillData,\n assets: assets.assetFiles,\n widgets: assets.widgetMetadata\n };\n }\n};\n//# sourceMappingURL=skill.js.map","/**\n * Skill collection transformer for directory-based skill imports\n * Scans a directory for subdirectories containing SKILL.md files\n */\nimport { readdirSync, statSync, existsSync } from 'node:fs';\nimport path from 'node:path';\n/**\n * Skill collection transformer preset\n * Transforms directory imports with ?skills suffix into an array of skill imports\n *\n * Matches:\n * - ./all?skills (recommended - generates all.js in the directory)\n * - ./_skills?skills (generates _skills.js in the directory)\n * - Any path ending with a filename and ?skills\n *\n * NOTE: A filename before ?skills is REQUIRED to avoid naming conflicts.\n * The filename becomes the output module name.\n *\n * @example\n * ```typescript\n * import skills from './all?skills';\n * // Scans current directory for subdirectories with SKILL.md\n * // Generates all.js containing array of all skills\n * ```\n */\nexport const skillCollectionTransformer = {\n pattern: /\\/[^/?]+\\?skills$/,\n virtual: true, // Indicates this doesn't transform a real file\n transform: (_content, filePath) => {\n // Remove ?skills suffix and the filename to get directory path\n // Example: /path/code/all?skills -> /path/code/all -> /path/code/\n const pathWithoutQuery = filePath.replace(/\\?skills$/, '');\n const dirPath = path.dirname(pathWithoutQuery);\n if (!existsSync(dirPath)) {\n throw new Error(`Directory not found: ${dirPath}`);\n }\n if (!statSync(dirPath).isDirectory()) {\n throw new Error(`Not a directory: ${dirPath}`);\n }\n // Scan for subdirectories containing SKILL.md\n const entries = readdirSync(dirPath);\n const imports = [];\n const names = [];\n for (const entry of entries) {\n const entryPath = path.join(dirPath, entry);\n try {\n if (statSync(entryPath).isDirectory()) {\n const skillFile = path.join(entryPath, 'SKILL.md');\n if (existsSync(skillFile)) {\n // Generate unique identifier from directory name\n const identifier = `Skill_${entry.replace(/[^a-zA-Z0-9_]/g, '_')}`;\n imports.push(`import ${identifier} from './${entry}/SKILL.md';`);\n names.push(identifier);\n }\n }\n }\n catch (err) {\n // Skip entries that can't be read\n continue;\n }\n }\n if (names.length === 0) {\n console.warn(`No SKILL.md files found in subdirectories of ${dirPath}`);\n }\n // Generate code that imports all skills and exports as array\n const code = [\n ...imports,\n '',\n `export default [${names.join(', ')}];`\n ].join('\\n');\n return {\n data: null, // Not used when custom code is provided\n code\n };\n }\n};\n//# sourceMappingURL=skill-collection.js.map","/**\n * Raw transformer preset for importing file content as strings\n */\n/**\n * Raw transformer preset\n * Transforms any file with ?raw suffix into a string export\n *\n * @example\n * ```typescript\n * import template from './template.html?raw';\n * // template is a string containing the file content\n * ```\n */\nexport const rawTransformer = {\n pattern: /\\?raw$/,\n transform: (content) => {\n return {\n data: content\n };\n }\n};\n//# sourceMappingURL=raw.js.map","/**\n * Prompt transformer preset for template files with frontmatter\n * Supports .jst, .hbs, and plain text files\n */\nimport { z } from 'zod';\nimport { parseFrontmatter } from '../parsers/frontmatter.js';\nimport path from 'path';\n/**\n * Template type for prompt content\n * MUST match TemplateType from @vertesia/common\n */\nexport var TemplateType;\n(function (TemplateType) {\n TemplateType[\"jst\"] = \"jst\";\n TemplateType[\"handlebars\"] = \"handlebars\";\n TemplateType[\"text\"] = \"text\";\n})(TemplateType || (TemplateType = {}));\n/**\n * Prompt role enum\n * MUST match PromptRole from @llumiverse/common\n */\nexport var PromptRole;\n(function (PromptRole) {\n PromptRole[\"safety\"] = \"safety\";\n PromptRole[\"system\"] = \"system\";\n PromptRole[\"user\"] = \"user\";\n PromptRole[\"assistant\"] = \"assistant\";\n PromptRole[\"negative\"] = \"negative\";\n})(PromptRole || (PromptRole = {}));\n/**\n * Zod schema for prompt frontmatter validation\n */\nconst PromptFrontmatterSchema = z.object({\n // Required fields\n role: z.nativeEnum(PromptRole, {\n errorMap: () => ({ message: 'Role must be one of: safety, system, user, assistant, negative' })\n }),\n // Optional fields\n content_type: z.nativeEnum(TemplateType).optional(),\n schema: z.string().optional(),\n name: z.string().optional(),\n externalId: z.string().optional(),\n}).strict();\n/**\n * MUST be kept in sync with @vertesia/common InCodePrompt\n * Zod schema for prompt definition\n */\nexport const PromptDefinitionSchema = z.object({\n role: z.nativeEnum(PromptRole),\n content: z.string(),\n content_type: z.nativeEnum(TemplateType),\n schema: z.any().optional(),\n name: z.string().optional(),\n externalId: z.string().optional(),\n});\n/**\n * Normalize schema path for import\n * - Adds './' prefix if not a relative path\n * - Replaces .ts with .js\n * - Adds .js if no extension\n *\n * @param schemaPath - Original schema path from frontmatter\n * @returns Normalized path for ES module import\n */\nfunction normalizeSchemaPath(schemaPath) {\n let normalized = schemaPath.trim();\n // Add './' prefix if not already a relative path\n if (!normalized.startsWith('.')) {\n normalized = './' + normalized;\n }\n // Get the extension\n const ext = path.extname(normalized);\n if (ext === '.ts') {\n // Replace .ts with .js\n normalized = normalized.slice(0, -3) + '.js';\n }\n else if (!ext) {\n // No extension, add .js\n normalized = normalized + '.js';\n }\n // If extension is already .js or something else, leave as is\n return normalized;\n}\n/**\n * Infer content type from file extension\n *\n * @param filePath - Path to the prompt file\n * @returns Inferred content type\n */\nfunction inferContentType(filePath) {\n const ext = path.extname(filePath).toLowerCase();\n switch (ext) {\n case '.jst':\n return TemplateType.jst;\n case '.hbs':\n return TemplateType.handlebars;\n default:\n return TemplateType.text;\n }\n}\n/**\n * Build a PromptDefinition from frontmatter and content\n *\n * @param frontmatter - Parsed frontmatter object\n * @param content - Prompt content (body of the file)\n * @param filePath - Path to the prompt file (for content type inference)\n * @returns Prompt definition object and optional imports\n */\nfunction buildPromptDefinition(frontmatter, content, filePath) {\n // Determine content type from frontmatter or file extension\n const content_type = frontmatter.content_type || inferContentType(filePath);\n const prompt = {\n role: frontmatter.role,\n content,\n content_type,\n };\n // Add optional fields\n if (frontmatter.name) {\n prompt.name = frontmatter.name;\n }\n if (frontmatter.externalId) {\n prompt.externalId = frontmatter.externalId;\n }\n // Handle schema import if specified\n let imports;\n let schemaImportName;\n if (frontmatter.schema) {\n const normalizedPath = normalizeSchemaPath(frontmatter.schema);\n schemaImportName = '__promptSchema';\n imports = [`import ${schemaImportName} from '${normalizedPath}';`];\n }\n return { prompt, imports, schemaImportName };\n}\n/**\n * Prompt transformer preset\n * Transforms template files with ?prompt suffix into prompt definition objects\n *\n * Supported file types:\n * - .jst (JavaScript template literals) → content_type: 'jst'\n * - .hbs (Handlebars templates) → content_type: 'handlebars'\n * - .txt or other → content_type: 'text'\n *\n * @example\n * ```typescript\n * import PROMPT from './prompt.hbs?prompt';\n * // PROMPT is an InCodePrompt object\n * ```\n */\nexport const promptTransformer = {\n pattern: /\\?prompt$/,\n schema: PromptDefinitionSchema,\n transform: (content, filePath) => {\n const { frontmatter, content: promptContent } = parseFrontmatter(content);\n // Validate frontmatter\n const frontmatterValidation = PromptFrontmatterSchema.safeParse(frontmatter);\n if (!frontmatterValidation.success) {\n const errors = frontmatterValidation.error.errors\n .map((err) => {\n const path = err.path.length > 0 ? err.path.join('.') : 'frontmatter';\n return ` - ${path}: ${err.message}`;\n })\n .join('\\n');\n throw new Error(`Invalid frontmatter in ${filePath}:\\n${errors}`);\n }\n // Build prompt definition\n const { prompt, imports, schemaImportName } = buildPromptDefinition(frontmatter, promptContent, filePath);\n // If schema is specified, generate custom code with schema reference\n if (schemaImportName) {\n // Build the code manually to avoid JSON.stringify issues with schema reference\n const lines = [\n 'export default {',\n ` role: \"${prompt.role}\",`,\n ` content: ${JSON.stringify(prompt.content)},`,\n ` content_type: \"${prompt.content_type}\",`,\n ` schema: ${schemaImportName}`,\n ];\n if (prompt.name) {\n lines.splice(4, 0, ` name: ${JSON.stringify(prompt.name)},`);\n }\n if (prompt.externalId) {\n lines.splice(4, 0, ` externalId: ${JSON.stringify(prompt.externalId)},`);\n }\n lines.push('};');\n const code = lines.join('\\n');\n return {\n data: prompt,\n imports,\n code,\n };\n }\n // Standard case without schema\n return {\n data: prompt,\n };\n }\n};\n//# sourceMappingURL=prompt.js.map"],"names":["path"],"mappings":";;;;;;;AAAA;AACA;AACA;AAGA;AACA;AACA;AACA,SAAS,eAAe,CAAC,OAAO,EAAE;AAClC,IAAI,IAAI;AACR,QAAQ,SAAS,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AAC/C,IAAI;AACJ,IAAI,OAAO,KAAK,EAAE;AAClB;AACA,QAAQ,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE;AACrC,YAAY,MAAM,KAAK;AACvB,QAAQ;AACR,IAAI;AACJ;AACA;AACA;AACA;AACA;AACA;AACA;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ACnB,gBAAgB,IAAI,EAAE,MAAM;AAC5B,gBAAgB,OAAO;AACvB,gBAAgB,IAAI;AACpB,aAAa;AACb,QAAQ;AACR;AACA,QAAQ,OAAO;AACf,YAAY,IAAI,EAAE,MAAM;AACxB,SAAS;AACT,IAAI;AACJ;;;;"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
21
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.parseFrontmatter = exports.SkillDefinitionSchema = exports.rawTransformer = exports.skillTransformer = exports.vertesiaImportPlugin = void 0;
|
|
22
|
+
exports.parseFrontmatter = exports.TemplateType = exports.PromptRole = exports.PromptDefinitionSchema = exports.SkillDefinitionSchema = exports.promptTransformer = exports.skillCollectionTransformer = exports.rawTransformer = exports.skillTransformer = exports.vertesiaImportPlugin = void 0;
|
|
23
23
|
// Core plugin
|
|
24
24
|
var plugin_js_1 = require("./plugin.js");
|
|
25
25
|
Object.defineProperty(exports, "vertesiaImportPlugin", { enumerable: true, get: function () { return plugin_js_1.vertesiaImportPlugin; } });
|
|
@@ -27,7 +27,12 @@ Object.defineProperty(exports, "vertesiaImportPlugin", { enumerable: true, get:
|
|
|
27
27
|
var index_js_1 = require("./presets/index.js");
|
|
28
28
|
Object.defineProperty(exports, "skillTransformer", { enumerable: true, get: function () { return index_js_1.skillTransformer; } });
|
|
29
29
|
Object.defineProperty(exports, "rawTransformer", { enumerable: true, get: function () { return index_js_1.rawTransformer; } });
|
|
30
|
+
Object.defineProperty(exports, "skillCollectionTransformer", { enumerable: true, get: function () { return index_js_1.skillCollectionTransformer; } });
|
|
31
|
+
Object.defineProperty(exports, "promptTransformer", { enumerable: true, get: function () { return index_js_1.promptTransformer; } });
|
|
30
32
|
Object.defineProperty(exports, "SkillDefinitionSchema", { enumerable: true, get: function () { return index_js_1.SkillDefinitionSchema; } });
|
|
33
|
+
Object.defineProperty(exports, "PromptDefinitionSchema", { enumerable: true, get: function () { return index_js_1.PromptDefinitionSchema; } });
|
|
34
|
+
Object.defineProperty(exports, "PromptRole", { enumerable: true, get: function () { return index_js_1.PromptRole; } });
|
|
35
|
+
Object.defineProperty(exports, "TemplateType", { enumerable: true, get: function () { return index_js_1.TemplateType; } });
|
|
31
36
|
// Utilities
|
|
32
37
|
var frontmatter_js_1 = require("./parsers/frontmatter.js");
|
|
33
38
|
Object.defineProperty(exports, "parseFrontmatter", { enumerable: true, get: function () { return frontmatter_js_1.parseFrontmatter; } });
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,cAAc;AACd,yCAAmD;AAA1C,iHAAA,oBAAoB,OAAA;AAa7B,UAAU;AACV,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;;;AAEH,cAAc;AACd,yCAAmD;AAA1C,iHAAA,oBAAoB,OAAA;AAa7B,UAAU;AACV,+CAa4B;AAZxB,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,sHAAA,0BAA0B,OAAA;AAC1B,6GAAA,iBAAiB,OAAA;AACjB,iHAAA,qBAAqB,OAAA;AACrB,kHAAA,sBAAsB,OAAA;AAKtB,sGAAA,UAAU,OAAA;AACV,wGAAA,YAAY,OAAA;AAGhB,YAAY;AACZ,2DAAoF;AAA3E,kHAAA,gBAAgB,OAAA"}
|