@wix/evalforge-types 0.25.0 → 0.26.0

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.
@@ -5,6 +5,23 @@ import { z } from 'zod';
5
5
  * Examples: my-skill, code-review, skill1
6
6
  */
7
7
  export declare const SKILL_FOLDER_NAME_REGEX: RegExp;
8
+ /**
9
+ * Regex for valid semver strings (major.minor.patch).
10
+ * Examples: 1.0.0, 2.3.1, 10.20.30
11
+ */
12
+ export declare const SEMVER_REGEX: RegExp;
13
+ /**
14
+ * Origin of a skill version - how the version was created.
15
+ * - manual: Created through the UI
16
+ * - pr: Created from a pull request (via CI/CD API)
17
+ * - master: Synced from the main branch (via CI/CD API)
18
+ */
19
+ export declare const SkillVersionOriginSchema: z.ZodEnum<{
20
+ manual: "manual";
21
+ pr: "pr";
22
+ master: "master";
23
+ }>;
24
+ export type SkillVersionOrigin = z.infer<typeof SkillVersionOriginSchema>;
8
25
  /**
9
26
  * Check if a string is a valid skill folder name (kebab-case).
10
27
  * Used for validation when creating skills and when writing skills to filesystem.
@@ -27,34 +44,96 @@ export declare const SkillMetadataSchema: z.ZodObject<{
27
44
  }, z.core.$strip>;
28
45
  export type SkillMetadata = z.infer<typeof SkillMetadataSchema>;
29
46
  /**
30
- * Skill version - historical snapshot of a Skill's content.
47
+ * GitHub source reference for a skill directory.
48
+ * Points to a folder in a public GitHub repo containing SKILL.md and optional references.
49
+ */
50
+ export declare const GitHubSourceSchema: z.ZodObject<{
51
+ owner: z.ZodString;
52
+ repo: z.ZodString;
53
+ path: z.ZodString;
54
+ ref: z.ZodString;
55
+ }, z.core.$strip>;
56
+ export type GitHubSource = z.infer<typeof GitHubSourceSchema>;
57
+ /**
58
+ * A single file within a skill directory snapshot.
59
+ */
60
+ export declare const SkillFileSchema: z.ZodObject<{
61
+ path: z.ZodString;
62
+ content: z.ZodString;
63
+ }, z.core.$strip>;
64
+ export type SkillFile = z.infer<typeof SkillFileSchema>;
65
+ /**
66
+ * Skill version - immutable snapshot of a Skill's content.
67
+ *
68
+ * New versions store a `files` array (snapshot of the skill directory from GitHub)
69
+ * and a `source` reference (where the snapshot came from).
70
+ *
71
+ * Versions are immutable - editing creates a new version.
31
72
  */
32
73
  export declare const SkillVersionSchema: z.ZodObject<{
33
74
  id: z.ZodString;
75
+ projectId: z.ZodString;
34
76
  skillId: z.ZodString;
35
- skillMd: z.ZodString;
36
- metadata: z.ZodObject<{
37
- name: z.ZodString;
38
- description: z.ZodString;
39
- allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
- skills: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
- }, z.core.$strip>;
42
- model: z.ZodOptional<z.ZodObject<{
43
- model: z.ZodEnum<typeof import("../common/models.js").ModelIds>;
44
- temperature: z.ZodOptional<z.ZodNumber>;
45
- maxTokens: z.ZodOptional<z.ZodNumber>;
77
+ version: z.ZodString;
78
+ origin: z.ZodEnum<{
79
+ manual: "manual";
80
+ pr: "pr";
81
+ master: "master";
82
+ }>;
83
+ source: z.ZodOptional<z.ZodObject<{
84
+ owner: z.ZodString;
85
+ repo: z.ZodString;
86
+ path: z.ZodString;
87
+ ref: z.ZodString;
46
88
  }, z.core.$strip>>;
47
- systemPrompt: z.ZodOptional<z.ZodString>;
48
- version: z.ZodNumber;
49
- createdAt: z.ZodString;
89
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
90
+ path: z.ZodString;
91
+ content: z.ZodString;
92
+ }, z.core.$strip>>>;
50
93
  notes: z.ZodOptional<z.ZodString>;
94
+ createdAt: z.ZodString;
51
95
  }, z.core.$strip>;
52
96
  export type SkillVersion = z.infer<typeof SkillVersionSchema>;
53
97
  /**
54
- * Skill schema - a coding capability defined by SKILL.md.
98
+ * Input schema for creating a new SkillVersion.
99
+ *
100
+ * For source-based creation: provide `source` (or omit to use the Skill's source).
101
+ * The backend fetches the folder and stores the snapshot as `files`.
102
+ * For inline creation: provide `files` with the SKILL.md content.
103
+ *
104
+ * `version` is required -- the caller must always provide an explicit version string.
105
+ */
106
+ export declare const CreateSkillVersionInputSchema: z.ZodObject<{
107
+ source: z.ZodOptional<z.ZodObject<{
108
+ owner: z.ZodString;
109
+ repo: z.ZodString;
110
+ path: z.ZodString;
111
+ ref: z.ZodString;
112
+ }, z.core.$strip>>;
113
+ version: z.ZodString;
114
+ notes: z.ZodOptional<z.ZodString>;
115
+ origin: z.ZodOptional<z.ZodEnum<{
116
+ manual: "manual";
117
+ pr: "pr";
118
+ master: "master";
119
+ }>>;
120
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
121
+ path: z.ZodString;
122
+ content: z.ZodString;
123
+ }, z.core.$strip>>>;
124
+ }, z.core.$strip>;
125
+ export type CreateSkillVersionInput = z.infer<typeof CreateSkillVersionInputSchema>;
126
+ /**
127
+ * Skill schema - a lightweight container for a coding capability.
128
+ *
129
+ * Skills are containers identified by a kebab-case name.
130
+ * All content (files, notes, etc.) lives in SkillVersion.
131
+ * The `source` field points to the GitHub directory for live fetching.
132
+ * Persisted shape: id, projectId, name, source, createdAt, updatedAt, deleted.
55
133
  *
56
- * Skills represent coding capabilities that can be tested.
57
- * Persisted shape: id, projectId, name, description, createdAt, updatedAt, deleted, skillMd.
134
+ * Note: `description` is inherited from BaseEntity. It's not stored in the DB
135
+ * for skills (content lives in SkillVersion), but is kept on the type to
136
+ * satisfy the TenantEntity constraint. The repository always returns "".
58
137
  */
59
138
  export declare const SkillSchema: z.ZodObject<{
60
139
  id: z.ZodString;
@@ -64,17 +143,73 @@ export declare const SkillSchema: z.ZodObject<{
64
143
  updatedAt: z.ZodString;
65
144
  deleted: z.ZodOptional<z.ZodBoolean>;
66
145
  projectId: z.ZodString;
67
- skillMd: z.ZodString;
146
+ source: z.ZodOptional<z.ZodObject<{
147
+ owner: z.ZodString;
148
+ repo: z.ZodString;
149
+ path: z.ZodString;
150
+ ref: z.ZodString;
151
+ }, z.core.$strip>>;
68
152
  }, z.core.$strip>;
69
153
  export type Skill = z.infer<typeof SkillSchema>;
154
+ /**
155
+ * Inline initial version data provided when creating a skill atomically.
156
+ * When present on a POST /skills request, the backend creates the skill
157
+ * and its first version in a single request with rollback on failure.
158
+ */
159
+ export declare const InitialVersionInputSchema: z.ZodObject<{
160
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
161
+ path: z.ZodString;
162
+ content: z.ZodString;
163
+ }, z.core.$strip>>>;
164
+ notes: z.ZodOptional<z.ZodString>;
165
+ source: z.ZodOptional<z.ZodObject<{
166
+ owner: z.ZodString;
167
+ repo: z.ZodString;
168
+ path: z.ZodString;
169
+ ref: z.ZodString;
170
+ }, z.core.$strip>>;
171
+ version: z.ZodOptional<z.ZodString>;
172
+ origin: z.ZodOptional<z.ZodEnum<{
173
+ manual: "manual";
174
+ pr: "pr";
175
+ master: "master";
176
+ }>>;
177
+ }, z.core.$strip>;
178
+ export type InitialVersionInput = z.infer<typeof InitialVersionInputSchema>;
70
179
  /**
71
180
  * Input schema for creating a new Skill.
181
+ * Only `name` and `projectId` are required. `description` is ignored (lives in SkillVersion).
182
+ * Pass `initialVersion` to atomically create the skill and its first version.
72
183
  */
73
184
  export declare const CreateSkillInputSchema: z.ZodObject<{
74
185
  name: z.ZodString;
75
- description: z.ZodString;
76
186
  projectId: z.ZodString;
77
- skillMd: z.ZodString;
187
+ description: z.ZodOptional<z.ZodString>;
188
+ source: z.ZodOptional<z.ZodObject<{
189
+ owner: z.ZodString;
190
+ repo: z.ZodString;
191
+ path: z.ZodString;
192
+ ref: z.ZodString;
193
+ }, z.core.$strip>>;
194
+ initialVersion: z.ZodOptional<z.ZodObject<{
195
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
196
+ path: z.ZodString;
197
+ content: z.ZodString;
198
+ }, z.core.$strip>>>;
199
+ notes: z.ZodOptional<z.ZodString>;
200
+ source: z.ZodOptional<z.ZodObject<{
201
+ owner: z.ZodString;
202
+ repo: z.ZodString;
203
+ path: z.ZodString;
204
+ ref: z.ZodString;
205
+ }, z.core.$strip>>;
206
+ version: z.ZodOptional<z.ZodString>;
207
+ origin: z.ZodOptional<z.ZodEnum<{
208
+ manual: "manual";
209
+ pr: "pr";
210
+ master: "master";
211
+ }>>;
212
+ }, z.core.$strip>>;
78
213
  }, z.core.$strip>;
79
214
  export type CreateSkillInput = z.infer<typeof CreateSkillInputSchema>;
80
215
  /**
@@ -82,8 +217,56 @@ export type CreateSkillInput = z.infer<typeof CreateSkillInputSchema>;
82
217
  */
83
218
  export declare const UpdateSkillInputSchema: z.ZodObject<{
84
219
  name: z.ZodOptional<z.ZodString>;
85
- description: z.ZodOptional<z.ZodString>;
86
220
  projectId: z.ZodOptional<z.ZodString>;
87
- skillMd: z.ZodOptional<z.ZodString>;
221
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
222
+ source: z.ZodOptional<z.ZodOptional<z.ZodObject<{
223
+ owner: z.ZodString;
224
+ repo: z.ZodString;
225
+ path: z.ZodString;
226
+ ref: z.ZodString;
227
+ }, z.core.$strip>>>;
88
228
  }, z.core.$strip>;
89
229
  export type UpdateSkillInput = z.infer<typeof UpdateSkillInputSchema>;
230
+ /**
231
+ * Skill with its latest version - used when displaying skills in the UI
232
+ * and in the evaluator to access skill content.
233
+ */
234
+ export declare const SkillWithLatestVersionSchema: z.ZodObject<{
235
+ id: z.ZodString;
236
+ name: z.ZodString;
237
+ description: z.ZodString;
238
+ createdAt: z.ZodString;
239
+ updatedAt: z.ZodString;
240
+ deleted: z.ZodOptional<z.ZodBoolean>;
241
+ projectId: z.ZodString;
242
+ source: z.ZodOptional<z.ZodObject<{
243
+ owner: z.ZodString;
244
+ repo: z.ZodString;
245
+ path: z.ZodString;
246
+ ref: z.ZodString;
247
+ }, z.core.$strip>>;
248
+ latestVersion: z.ZodOptional<z.ZodObject<{
249
+ id: z.ZodString;
250
+ projectId: z.ZodString;
251
+ skillId: z.ZodString;
252
+ version: z.ZodString;
253
+ origin: z.ZodEnum<{
254
+ manual: "manual";
255
+ pr: "pr";
256
+ master: "master";
257
+ }>;
258
+ source: z.ZodOptional<z.ZodObject<{
259
+ owner: z.ZodString;
260
+ repo: z.ZodString;
261
+ path: z.ZodString;
262
+ ref: z.ZodString;
263
+ }, z.core.$strip>>;
264
+ files: z.ZodOptional<z.ZodArray<z.ZodObject<{
265
+ path: z.ZodString;
266
+ content: z.ZodString;
267
+ }, z.core.$strip>>>;
268
+ notes: z.ZodOptional<z.ZodString>;
269
+ createdAt: z.ZodString;
270
+ }, z.core.$strip>>;
271
+ }, z.core.$strip>;
272
+ export type SkillWithLatestVersion = z.infer<typeof SkillWithLatestVersionSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/evalforge-types",
3
- "version": "0.25.0",
3
+ "version": "0.26.0",
4
4
  "description": "Unified types for EvalForge agent evaluation system",
5
5
  "files": [
6
6
  "build"
@@ -46,5 +46,5 @@
46
46
  "artifactId": "evalforge-types"
47
47
  }
48
48
  },
49
- "falconPackageHash": "bbfbda873b35e09a1e099217c9d01a6731e9a2eb337d3ab1bf144e55"
49
+ "falconPackageHash": "56e0bd74e36bca477c117097436fb8e803b50b05613ca7864664e53f"
50
50
  }