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