@wix/evalforge-types 0.73.0 → 0.75.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.
@@ -461,6 +461,8 @@ export declare const EvalRunSchema: z.ZodObject<{
461
461
  mcpIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
462
462
  subAgentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
463
463
  ruleIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
464
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
465
+ capabilityVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
464
466
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
465
467
  runsPerScenario: z.ZodOptional<z.ZodNumber>;
466
468
  agentSnapshot: z.ZodOptional<z.ZodObject<{
@@ -523,6 +525,8 @@ export declare const CreateEvalRunInputSchema: z.ZodObject<{
523
525
  mcpIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
524
526
  subAgentIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
525
527
  ruleIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
528
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
529
+ capabilityVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
526
530
  tags: z.ZodOptional<z.ZodArray<z.ZodString>>;
527
531
  presetId: z.ZodOptional<z.ZodString>;
528
532
  llmTraceSummary: z.ZodOptional<z.ZodObject<{
@@ -26,25 +26,28 @@ export type Project = z.infer<typeof ProjectSchema>;
26
26
  /**
27
27
  * Input schema for creating a new Project.
28
28
  * Omits read-only / runtime-resolved fields.
29
+ * Requires appId for proper app-credential scoping and tenancy isolation.
29
30
  */
30
31
  export declare const CreateProjectInputSchema: z.ZodObject<{
31
32
  name: z.ZodString;
32
33
  description: z.ZodString;
33
- appId: z.ZodOptional<z.ZodString>;
34
34
  scenarioTags: z.ZodOptional<z.ZodArray<z.ZodString>>;
35
35
  wixAuthToken: z.ZodOptional<z.ZodNullable<z.ZodString>>;
36
36
  base44AuthFile: z.ZodOptional<z.ZodNullable<z.ZodString>>;
37
+ appId: z.ZodString;
37
38
  }, z.core.$strip>;
38
39
  export type CreateProjectInput = z.infer<typeof CreateProjectInputSchema>;
39
40
  /**
40
41
  * Input schema for updating a Project.
42
+ * AppId is mutable — allows project reassignment to different apps if needed.
43
+ * Requires current app credentials to change (enforced by appAuthProjectGuard).
41
44
  */
42
45
  export declare const UpdateProjectInputSchema: z.ZodObject<{
43
46
  name: z.ZodOptional<z.ZodString>;
44
47
  description: z.ZodOptional<z.ZodString>;
45
- appId: z.ZodOptional<z.ZodOptional<z.ZodString>>;
46
48
  scenarioTags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
47
49
  wixAuthToken: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
48
50
  base44AuthFile: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
51
+ appId: z.ZodOptional<z.ZodString>;
49
52
  }, z.core.$strip>;
50
53
  export type UpdateProjectInput = z.infer<typeof UpdateProjectInputSchema>;
@@ -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';
@@ -20,6 +20,8 @@ export declare const PresetSchema: z.ZodObject<{
20
20
  mcpIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
21
21
  subAgentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
22
22
  ruleIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
23
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
+ capabilityVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
23
25
  }, z.core.$strip>;
24
26
  export type Preset = z.infer<typeof PresetSchema>;
25
27
  /**
@@ -35,6 +37,8 @@ export declare const CreatePresetInputSchema: z.ZodObject<{
35
37
  mcpIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
36
38
  subAgentIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
37
39
  ruleIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
40
+ capabilityIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ capabilityVersions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
38
42
  }, z.core.$strip>;
39
43
  export type CreatePresetInput = z.infer<typeof CreatePresetInputSchema>;
40
44
  /**
@@ -50,5 +54,7 @@ export declare const UpdatePresetInputSchema: z.ZodObject<{
50
54
  mcpIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
51
55
  subAgentIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
52
56
  ruleIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
57
+ capabilityIds: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString>>>;
58
+ capabilityVersions: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
53
59
  }, z.core.$strip>;
54
60
  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.73.0",
3
+ "version": "0.75.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": "57d4595d9fef78d3f6582ec6ae8a9e8a2bc9018bc791f63167ab7d64"
49
+ "falconPackageHash": "ff68e09079eb1df06b45479a0686174761134f8129f98230971bf486"
50
50
  }