@wix/evalforge-types 0.74.0 → 0.76.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.
@@ -213,8 +213,6 @@ export declare const EvalRunSchema: z.ZodObject<{
213
213
  projectId: z.ZodString;
214
214
  agentId: z.ZodOptional<z.ZodString>;
215
215
  presetId: z.ZodOptional<z.ZodString>;
216
- skillIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
217
- skillVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
218
216
  scenarioIds: z.ZodArray<z.ZodString>;
219
217
  status: z.ZodEnum<typeof import("./metrics.js").EvalStatus>;
220
218
  progress: z.ZodNumber;
@@ -458,9 +456,8 @@ export declare const EvalRunSchema: z.ZodObject<{
458
456
  jobStatus: z.ZodOptional<z.ZodString>;
459
457
  jobError: z.ZodOptional<z.ZodString>;
460
458
  jobStatusCheckedAt: z.ZodOptional<z.ZodString>;
461
- mcpIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
462
- subAgentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
463
- ruleIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
459
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
460
+ capabilityVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
464
461
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
465
462
  runsPerScenario: z.ZodOptional<z.ZodNumber>;
466
463
  agentSnapshot: z.ZodOptional<z.ZodObject<{
@@ -518,11 +515,8 @@ export declare const CreateEvalRunInputSchema: z.ZodObject<{
518
515
  deleted: z.ZodOptional<z.ZodBoolean>;
519
516
  projectId: z.ZodString;
520
517
  agentId: z.ZodOptional<z.ZodString>;
521
- skillIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
522
- skillVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
523
- mcpIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
524
- subAgentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
525
- ruleIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
518
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
519
+ capabilityVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
526
520
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
527
521
  presetId: z.ZodOptional<z.ZodString>;
528
522
  llmTraceSummary: z.ZodOptional<z.ZodObject<{
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Pure conversion functions: Capability → legacy entity types.
3
+ *
4
+ * These functions live in eval-types so both the backend bridge service
5
+ * and the evaluator can use them without duplicating logic.
6
+ */
7
+ import type { Skill } from './skill.js';
8
+ import type { SkillVersion } from './skill.js';
9
+ import type { SkillWithLatestVersion } from './skill.js';
10
+ import type { SubAgent } from './sub-agent.js';
11
+ import type { Rule } from '../common/rule.js';
12
+ import type { MCPEntity } from '../common/mcp.js';
13
+ import type { Capability, CapabilityVersion, CapabilityWithLatestVersion } from './capability.js';
14
+ export declare function capabilityToSkill(cap: Capability): Skill;
15
+ export declare function capabilityVersionToSkillVersion(cv: CapabilityVersion): SkillVersion;
16
+ export declare function capabilityToSkillWithLatestVersion(cap: CapabilityWithLatestVersion): SkillWithLatestVersion;
17
+ export declare function capabilityToSubAgent(cap: CapabilityWithLatestVersion): SubAgent;
18
+ export declare function capabilityToRule(cap: CapabilityWithLatestVersion): Rule;
19
+ export declare function capabilityToMcp(cap: CapabilityWithLatestVersion): MCPEntity;
20
+ export declare function groupCapabilitiesByType(capabilities: CapabilityWithLatestVersion[]): {
21
+ skills: SkillWithLatestVersion[];
22
+ subAgents: SubAgent[];
23
+ rules: Rule[];
24
+ mcps: MCPEntity[];
25
+ };
@@ -0,0 +1,254 @@
1
+ import { z } from 'zod';
2
+ import { GitHubSourceSchema } from '../common/github-source.js';
3
+ export { GitHubSourceSchema };
4
+ export type { GitHubSource } from '../common/github-source.js';
5
+ /**
6
+ * Capability type discriminator (AIP 7015 pattern).
7
+ *
8
+ * Determines the shape of `content` in CapabilityVersion and
9
+ * the filesystem behavior at evaluation time.
10
+ */
11
+ export declare const CapabilityTypeSchema: z.ZodEnum<{
12
+ SKILL: "SKILL";
13
+ SUB_AGENT: "SUB_AGENT";
14
+ RULE: "RULE";
15
+ MCP: "MCP";
16
+ }>;
17
+ export type CapabilityType = z.infer<typeof CapabilityTypeSchema>;
18
+ /**
19
+ * Regex for valid capability names (kebab-case).
20
+ * All capability types enforce filesystem-safe names at storage time.
21
+ */
22
+ export declare const CAPABILITY_NAME_REGEX: RegExp;
23
+ export declare function isValidCapabilityName(name: string): boolean;
24
+ /** Skill version content: multi-file directory snapshot */
25
+ export interface SkillContent {
26
+ files?: Array<{
27
+ path: string;
28
+ content: string;
29
+ }>;
30
+ }
31
+ /** Sub-agent version content: single markdown file with YAML frontmatter */
32
+ export interface SubAgentContent {
33
+ subAgentMd: string;
34
+ }
35
+ /** Rule version content: rule type + markdown content */
36
+ export interface RuleContent {
37
+ ruleType: 'claude-md' | 'agents-md' | 'cursor-rule';
38
+ content: string;
39
+ }
40
+ /** MCP version content: keyed server config for .mcp.json */
41
+ export interface McpContent {
42
+ config: Record<string, unknown>;
43
+ }
44
+ /** Union of all version content shapes */
45
+ export type CapabilityContent = SkillContent | SubAgentContent | RuleContent | McpContent;
46
+ /**
47
+ * Zod schema for content — accepts any JSON object.
48
+ * Type safety is enforced by the parent's capabilityType, not by parsing.
49
+ */
50
+ export declare const CapabilityContentSchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
51
+ export declare const CapabilityVersionOriginSchema: z.ZodEnum<{
52
+ manual: "manual";
53
+ pr: "pr";
54
+ master: "master";
55
+ }>;
56
+ export type CapabilityVersionOrigin = z.infer<typeof CapabilityVersionOriginSchema>;
57
+ /**
58
+ * Capability schema — lightweight container for any building-block type.
59
+ *
60
+ * Content lives in CapabilityVersion (immutable snapshots).
61
+ * `capabilityType` is the AIP 7015 discriminator.
62
+ * `source` is the optional GitHub reference for live fetching.
63
+ */
64
+ export declare const CapabilitySchema: z.ZodObject<{
65
+ id: z.ZodString;
66
+ name: z.ZodString;
67
+ description: z.ZodString;
68
+ createdAt: z.ZodString;
69
+ updatedAt: z.ZodString;
70
+ deleted: z.ZodOptional<z.ZodBoolean>;
71
+ projectId: z.ZodString;
72
+ capabilityType: z.ZodEnum<{
73
+ SKILL: "SKILL";
74
+ SUB_AGENT: "SUB_AGENT";
75
+ RULE: "RULE";
76
+ MCP: "MCP";
77
+ }>;
78
+ source: z.ZodOptional<z.ZodObject<{
79
+ owner: z.ZodString;
80
+ repo: z.ZodString;
81
+ path: z.ZodString;
82
+ ref: z.ZodString;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>;
85
+ export type Capability = z.infer<typeof CapabilitySchema>;
86
+ /**
87
+ * Capability version — immutable content snapshot.
88
+ *
89
+ * `content` shape is determined by the parent capability's `capabilityType`.
90
+ */
91
+ export declare const CapabilityVersionSchema: z.ZodObject<{
92
+ id: z.ZodString;
93
+ projectId: z.ZodString;
94
+ capabilityId: z.ZodString;
95
+ version: z.ZodString;
96
+ origin: z.ZodEnum<{
97
+ manual: "manual";
98
+ pr: "pr";
99
+ master: "master";
100
+ }>;
101
+ source: z.ZodOptional<z.ZodObject<{
102
+ owner: z.ZodString;
103
+ repo: z.ZodString;
104
+ path: z.ZodString;
105
+ ref: z.ZodString;
106
+ }, z.core.$strip>>;
107
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
108
+ notes: z.ZodOptional<z.ZodString>;
109
+ createdAt: z.ZodString;
110
+ }, z.core.$strip>;
111
+ export type CapabilityVersion = Omit<z.infer<typeof CapabilityVersionSchema>, 'content'> & {
112
+ content?: CapabilityContent;
113
+ };
114
+ /**
115
+ * Capability enriched with its latest version — used in UI and evaluator.
116
+ */
117
+ export declare const CapabilityWithLatestVersionSchema: z.ZodObject<{
118
+ id: z.ZodString;
119
+ name: z.ZodString;
120
+ description: z.ZodString;
121
+ createdAt: z.ZodString;
122
+ updatedAt: z.ZodString;
123
+ deleted: z.ZodOptional<z.ZodBoolean>;
124
+ projectId: z.ZodString;
125
+ capabilityType: z.ZodEnum<{
126
+ SKILL: "SKILL";
127
+ SUB_AGENT: "SUB_AGENT";
128
+ RULE: "RULE";
129
+ MCP: "MCP";
130
+ }>;
131
+ source: z.ZodOptional<z.ZodObject<{
132
+ owner: z.ZodString;
133
+ repo: z.ZodString;
134
+ path: z.ZodString;
135
+ ref: z.ZodString;
136
+ }, z.core.$strip>>;
137
+ latestVersion: z.ZodOptional<z.ZodObject<{
138
+ id: z.ZodString;
139
+ projectId: z.ZodString;
140
+ capabilityId: z.ZodString;
141
+ version: z.ZodString;
142
+ origin: z.ZodEnum<{
143
+ manual: "manual";
144
+ pr: "pr";
145
+ master: "master";
146
+ }>;
147
+ source: z.ZodOptional<z.ZodObject<{
148
+ owner: z.ZodString;
149
+ repo: z.ZodString;
150
+ path: z.ZodString;
151
+ ref: z.ZodString;
152
+ }, z.core.$strip>>;
153
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
154
+ notes: z.ZodOptional<z.ZodString>;
155
+ createdAt: z.ZodString;
156
+ }, z.core.$strip>>;
157
+ }, z.core.$strip>;
158
+ export type CapabilityWithLatestVersion = Omit<z.infer<typeof CapabilityWithLatestVersionSchema>, 'latestVersion'> & {
159
+ latestVersion?: CapabilityVersion;
160
+ };
161
+ /**
162
+ * Inline initial version data for atomic capability + version creation.
163
+ */
164
+ export declare const InitialCapabilityVersionInputSchema: z.ZodObject<{
165
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
166
+ notes: z.ZodOptional<z.ZodString>;
167
+ source: z.ZodOptional<z.ZodObject<{
168
+ owner: z.ZodString;
169
+ repo: z.ZodString;
170
+ path: z.ZodString;
171
+ ref: z.ZodString;
172
+ }, z.core.$strip>>;
173
+ version: z.ZodOptional<z.ZodString>;
174
+ origin: z.ZodOptional<z.ZodEnum<{
175
+ manual: "manual";
176
+ pr: "pr";
177
+ master: "master";
178
+ }>>;
179
+ }, z.core.$strip>;
180
+ export type InitialCapabilityVersionInput = z.infer<typeof InitialCapabilityVersionInputSchema>;
181
+ /**
182
+ * Input schema for creating a new Capability.
183
+ */
184
+ export declare const CreateCapabilityInputSchema: z.ZodObject<{
185
+ name: z.ZodString;
186
+ projectId: z.ZodString;
187
+ capabilityType: z.ZodEnum<{
188
+ SKILL: "SKILL";
189
+ SUB_AGENT: "SUB_AGENT";
190
+ RULE: "RULE";
191
+ MCP: "MCP";
192
+ }>;
193
+ description: z.ZodOptional<z.ZodString>;
194
+ source: z.ZodOptional<z.ZodObject<{
195
+ owner: z.ZodString;
196
+ repo: z.ZodString;
197
+ path: z.ZodString;
198
+ ref: z.ZodString;
199
+ }, z.core.$strip>>;
200
+ initialVersion: z.ZodOptional<z.ZodObject<{
201
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
202
+ notes: z.ZodOptional<z.ZodString>;
203
+ source: z.ZodOptional<z.ZodObject<{
204
+ owner: z.ZodString;
205
+ repo: z.ZodString;
206
+ path: z.ZodString;
207
+ ref: z.ZodString;
208
+ }, z.core.$strip>>;
209
+ version: z.ZodOptional<z.ZodString>;
210
+ origin: z.ZodOptional<z.ZodEnum<{
211
+ manual: "manual";
212
+ pr: "pr";
213
+ master: "master";
214
+ }>>;
215
+ }, z.core.$strip>>;
216
+ }, z.core.$strip>;
217
+ export type CreateCapabilityInput = z.infer<typeof CreateCapabilityInputSchema>;
218
+ /**
219
+ * Input schema for updating a Capability.
220
+ */
221
+ export declare const UpdateCapabilityInputSchema: z.ZodObject<{
222
+ name: z.ZodOptional<z.ZodString>;
223
+ description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
224
+ projectId: z.ZodOptional<z.ZodString>;
225
+ source: z.ZodOptional<z.ZodOptional<z.ZodObject<{
226
+ owner: z.ZodString;
227
+ repo: z.ZodString;
228
+ path: z.ZodString;
229
+ ref: z.ZodString;
230
+ }, z.core.$strip>>>;
231
+ }, z.core.$strip>;
232
+ export type UpdateCapabilityInput = z.infer<typeof UpdateCapabilityInputSchema>;
233
+ /**
234
+ * Input schema for creating a new CapabilityVersion.
235
+ */
236
+ export declare const CreateCapabilityVersionInputSchema: z.ZodObject<{
237
+ source: z.ZodOptional<z.ZodObject<{
238
+ owner: z.ZodString;
239
+ repo: z.ZodString;
240
+ path: z.ZodString;
241
+ ref: z.ZodString;
242
+ }, z.core.$strip>>;
243
+ version: z.ZodString;
244
+ notes: z.ZodOptional<z.ZodString>;
245
+ origin: z.ZodOptional<z.ZodEnum<{
246
+ manual: "manual";
247
+ pr: "pr";
248
+ master: "master";
249
+ }>>;
250
+ content: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
251
+ }, z.core.$strip>;
252
+ export type CreateCapabilityVersionInput = Omit<z.infer<typeof CreateCapabilityVersionInputSchema>, 'content'> & {
253
+ content?: CapabilityContent;
254
+ };
@@ -3,3 +3,5 @@ export * from './agent.js';
3
3
  export * from './skill.js';
4
4
  export * from './sub-agent.js';
5
5
  export * from './preset.js';
6
+ export * from './capability.js';
7
+ export * from './capability-converters.js';
@@ -15,11 +15,8 @@ export declare const PresetSchema: z.ZodObject<{
15
15
  deleted: z.ZodOptional<z.ZodBoolean>;
16
16
  projectId: z.ZodString;
17
17
  agentId: z.ZodString;
18
- skillIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
19
- skillVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
20
- mcpIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
- subAgentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
22
- ruleIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
18
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
19
+ capabilityVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
23
20
  }, z.core.$strip>;
24
21
  export type Preset = z.infer<typeof PresetSchema>;
25
22
  /**
@@ -30,11 +27,8 @@ export declare const CreatePresetInputSchema: z.ZodObject<{
30
27
  description: z.ZodString;
31
28
  projectId: z.ZodString;
32
29
  agentId: z.ZodString;
33
- skillIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
34
- skillVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
35
- mcpIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
36
- subAgentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
37
- ruleIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
30
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
31
+ capabilityVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
38
32
  }, z.core.$strip>;
39
33
  export type CreatePresetInput = z.infer<typeof CreatePresetInputSchema>;
40
34
  /**
@@ -45,10 +39,7 @@ export declare const UpdatePresetInputSchema: z.ZodObject<{
45
39
  description: z.ZodOptional<z.ZodString>;
46
40
  projectId: z.ZodOptional<z.ZodString>;
47
41
  agentId: z.ZodOptional<z.ZodString>;
48
- skillIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
49
- skillVersions: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
50
- mcpIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
51
- subAgentIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
52
- ruleIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
42
+ capabilityIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
43
+ capabilityVersions: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
53
44
  }, z.core.$strip>;
54
45
  export type UpdatePresetInput = z.infer<typeof UpdatePresetInputSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/evalforge-types",
3
- "version": "0.74.0",
3
+ "version": "0.76.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": "2d95416da22b2c81af5afb54bb6d3b5cbc1fac31d48f866a49a53523"
49
+ "falconPackageHash": "ec2ea77058349fdb78b780945489af6699239463053249713f2060d6"
50
50
  }