@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
package/README.md
CHANGED
|
@@ -136,9 +136,48 @@ This is the skill content in markdown.
|
|
|
136
136
|
related_tools?: string[]; // Optional: Related tool names
|
|
137
137
|
scripts?: string[]; // Optional: Script files in skill dir
|
|
138
138
|
widgets?: string[]; // Optional: Widget names in skill dir
|
|
139
|
+
isEnabled?: (context: any) => Promise<boolean>; // Optional: Runtime filter function
|
|
139
140
|
}
|
|
140
141
|
```
|
|
141
142
|
|
|
143
|
+
### Runtime Properties (`properties.ts`)
|
|
144
|
+
|
|
145
|
+
For properties that cannot be defined in YAML frontmatter (like functions), create a `properties.ts` file in your skill directory:
|
|
146
|
+
|
|
147
|
+
```typescript
|
|
148
|
+
// my-skill/properties.ts
|
|
149
|
+
import type { ToolUseContext } from '@vertesia/tools-sdk';
|
|
150
|
+
|
|
151
|
+
export default {
|
|
152
|
+
// Function to check if skill is enabled
|
|
153
|
+
isEnabled: async (context: ToolUseContext): Promise<boolean> => {
|
|
154
|
+
return context.project?.settings?.myFeature === true;
|
|
155
|
+
},
|
|
156
|
+
|
|
157
|
+
// You can override any frontmatter property
|
|
158
|
+
description: 'Dynamically set description',
|
|
159
|
+
|
|
160
|
+
// Add any other SkillDefinition properties
|
|
161
|
+
};
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
**How it works:**
|
|
165
|
+
1. The `properties.ts` file must export a default object of type `Partial<SkillDefinition>`
|
|
166
|
+
2. Properties from `properties.ts` **override** those from frontmatter
|
|
167
|
+
3. During build, the SKILL.md transformer generates code that imports `./properties.js`
|
|
168
|
+
4. Rollup automatically transpiles `properties.ts` to `properties.js` (via TypeScript plugin)
|
|
169
|
+
5. Runtime validation ensures `isEnabled` (if present) is a function
|
|
170
|
+
6. Build fails with clear errors if validation fails
|
|
171
|
+
|
|
172
|
+
**Directory structure:**
|
|
173
|
+
```
|
|
174
|
+
my-skill/
|
|
175
|
+
├── SKILL.md # Declarative properties (frontmatter + markdown)
|
|
176
|
+
├── properties.ts # Runtime properties (functions, overrides)
|
|
177
|
+
├── helper.js # Script files (auto-discovered)
|
|
178
|
+
└── chart.tsx # Widget files (auto-discovered)
|
|
179
|
+
```
|
|
180
|
+
|
|
142
181
|
### Raw Transformer
|
|
143
182
|
|
|
144
183
|
Imports any file as a raw string.
|