@wix/evalforge-types 0.14.0 → 0.15.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.
- package/build/index.js +108 -2
- package/build/index.js.map +4 -4
- package/build/index.mjs +95 -1
- package/build/index.mjs.map +4 -4
- package/build/types/assertion/assertion.d.ts +167 -0
- package/build/types/assertion/index.d.ts +4 -0
- package/build/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Assertion types:
|
|
4
|
+
* - skill_was_called: Checks if a specific skill was invoked (deterministic)
|
|
5
|
+
* - build_passed: Runs a command and checks exit code (deterministic)
|
|
6
|
+
* - llm_judge: LLM evaluates output with a prompt (LLM-based)
|
|
7
|
+
* - custom: User-defined LLM-based assertion (uses LlmJudgeEvaluator)
|
|
8
|
+
*/
|
|
9
|
+
export declare const AssertionTypeSchema: z.ZodEnum<{
|
|
10
|
+
custom: "custom";
|
|
11
|
+
skill_was_called: "skill_was_called";
|
|
12
|
+
build_passed: "build_passed";
|
|
13
|
+
llm_judge: "llm_judge";
|
|
14
|
+
}>;
|
|
15
|
+
export type AssertionType = z.infer<typeof AssertionTypeSchema>;
|
|
16
|
+
/**
|
|
17
|
+
* Configuration for skill_was_called assertion type.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SkillWasCalledConfigSchema: z.ZodObject<{
|
|
20
|
+
skillName: z.ZodString;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
export type SkillWasCalledConfig = z.infer<typeof SkillWasCalledConfigSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Configuration for build_passed assertion type.
|
|
25
|
+
*/
|
|
26
|
+
export declare const BuildPassedConfigSchema: z.ZodObject<{
|
|
27
|
+
command: z.ZodOptional<z.ZodString>;
|
|
28
|
+
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export type BuildPassedConfig = z.infer<typeof BuildPassedConfigSchema>;
|
|
31
|
+
/**
|
|
32
|
+
* Configuration for llm_judge and custom assertion types.
|
|
33
|
+
* Custom assertions use the same LLM-based evaluation as llm_judge.
|
|
34
|
+
*/
|
|
35
|
+
export declare const LlmJudgeConfigSchema: z.ZodObject<{
|
|
36
|
+
prompt: z.ZodString;
|
|
37
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
38
|
+
minScore: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
model: z.ZodOptional<z.ZodString>;
|
|
40
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
41
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
42
|
+
}, z.core.$strip>;
|
|
43
|
+
export type LlmJudgeConfig = z.infer<typeof LlmJudgeConfigSchema>;
|
|
44
|
+
/**
|
|
45
|
+
* Union of all assertion config types.
|
|
46
|
+
* The actual config shape depends on the assertion type.
|
|
47
|
+
*/
|
|
48
|
+
export declare const AssertionConfigSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
49
|
+
skillName: z.ZodString;
|
|
50
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
+
command: z.ZodOptional<z.ZodString>;
|
|
52
|
+
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
53
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
54
|
+
prompt: z.ZodString;
|
|
55
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
56
|
+
minScore: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
model: z.ZodOptional<z.ZodString>;
|
|
58
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
59
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>;
|
|
61
|
+
export type AssertionConfig = z.infer<typeof AssertionConfigSchema>;
|
|
62
|
+
/**
|
|
63
|
+
* Custom Assertion entity - stored in the database.
|
|
64
|
+
* Replaces inline assertions in test scenarios.
|
|
65
|
+
*/
|
|
66
|
+
export declare const CustomAssertionSchema: z.ZodObject<{
|
|
67
|
+
id: z.ZodString;
|
|
68
|
+
name: z.ZodString;
|
|
69
|
+
description: z.ZodString;
|
|
70
|
+
createdAt: z.ZodString;
|
|
71
|
+
updatedAt: z.ZodString;
|
|
72
|
+
deleted: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
projectId: z.ZodString;
|
|
74
|
+
type: z.ZodEnum<{
|
|
75
|
+
custom: "custom";
|
|
76
|
+
skill_was_called: "skill_was_called";
|
|
77
|
+
build_passed: "build_passed";
|
|
78
|
+
llm_judge: "llm_judge";
|
|
79
|
+
}>;
|
|
80
|
+
config: z.ZodUnion<readonly [z.ZodObject<{
|
|
81
|
+
skillName: z.ZodString;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
command: z.ZodOptional<z.ZodString>;
|
|
84
|
+
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
85
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
86
|
+
prompt: z.ZodString;
|
|
87
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
88
|
+
minScore: z.ZodOptional<z.ZodNumber>;
|
|
89
|
+
model: z.ZodOptional<z.ZodString>;
|
|
90
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
92
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>;
|
|
93
|
+
}, z.core.$strip>;
|
|
94
|
+
export type CustomAssertion = z.infer<typeof CustomAssertionSchema>;
|
|
95
|
+
/**
|
|
96
|
+
* Input schema for creating a new CustomAssertion.
|
|
97
|
+
*/
|
|
98
|
+
export declare const CreateCustomAssertionInputSchema: z.ZodObject<{
|
|
99
|
+
type: z.ZodEnum<{
|
|
100
|
+
custom: "custom";
|
|
101
|
+
skill_was_called: "skill_was_called";
|
|
102
|
+
build_passed: "build_passed";
|
|
103
|
+
llm_judge: "llm_judge";
|
|
104
|
+
}>;
|
|
105
|
+
name: z.ZodString;
|
|
106
|
+
description: z.ZodString;
|
|
107
|
+
projectId: z.ZodString;
|
|
108
|
+
config: z.ZodUnion<readonly [z.ZodObject<{
|
|
109
|
+
skillName: z.ZodString;
|
|
110
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
111
|
+
command: z.ZodOptional<z.ZodString>;
|
|
112
|
+
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
113
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
114
|
+
prompt: z.ZodString;
|
|
115
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
116
|
+
minScore: z.ZodOptional<z.ZodNumber>;
|
|
117
|
+
model: z.ZodOptional<z.ZodString>;
|
|
118
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
120
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>;
|
|
121
|
+
}, z.core.$strip>;
|
|
122
|
+
export type CreateCustomAssertionInput = z.infer<typeof CreateCustomAssertionInputSchema>;
|
|
123
|
+
/**
|
|
124
|
+
* Input schema for updating a CustomAssertion.
|
|
125
|
+
*/
|
|
126
|
+
export declare const UpdateCustomAssertionInputSchema: z.ZodObject<{
|
|
127
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
128
|
+
custom: "custom";
|
|
129
|
+
skill_was_called: "skill_was_called";
|
|
130
|
+
build_passed: "build_passed";
|
|
131
|
+
llm_judge: "llm_judge";
|
|
132
|
+
}>>;
|
|
133
|
+
name: z.ZodOptional<z.ZodString>;
|
|
134
|
+
description: z.ZodOptional<z.ZodString>;
|
|
135
|
+
projectId: z.ZodOptional<z.ZodString>;
|
|
136
|
+
config: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
137
|
+
skillName: z.ZodString;
|
|
138
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
139
|
+
command: z.ZodOptional<z.ZodString>;
|
|
140
|
+
expectedExitCode: z.ZodOptional<z.ZodNumber>;
|
|
141
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
142
|
+
prompt: z.ZodString;
|
|
143
|
+
systemPrompt: z.ZodOptional<z.ZodString>;
|
|
144
|
+
minScore: z.ZodOptional<z.ZodNumber>;
|
|
145
|
+
model: z.ZodOptional<z.ZodString>;
|
|
146
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
148
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>;
|
|
149
|
+
}, z.core.$strip>;
|
|
150
|
+
export type UpdateCustomAssertionInput = z.infer<typeof UpdateCustomAssertionInputSchema>;
|
|
151
|
+
/**
|
|
152
|
+
* Helper function to validate config based on assertion type.
|
|
153
|
+
* Returns true if config is valid for the given type.
|
|
154
|
+
*/
|
|
155
|
+
export declare function validateAssertionConfig(type: AssertionType, config: unknown): boolean;
|
|
156
|
+
/**
|
|
157
|
+
* Get typed config for skill_was_called assertion.
|
|
158
|
+
*/
|
|
159
|
+
export declare function getSkillWasCalledConfig(assertion: CustomAssertion): SkillWasCalledConfig | null;
|
|
160
|
+
/**
|
|
161
|
+
* Get typed config for build_passed assertion.
|
|
162
|
+
*/
|
|
163
|
+
export declare function getBuildPassedConfig(assertion: CustomAssertion): BuildPassedConfig | null;
|
|
164
|
+
/**
|
|
165
|
+
* Get typed config for llm_judge or custom assertion.
|
|
166
|
+
*/
|
|
167
|
+
export declare function getLlmJudgeConfig(assertion: CustomAssertion): LlmJudgeConfig | null;
|
package/build/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/evalforge-types",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.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": "
|
|
49
|
+
"falconPackageHash": "3e43e12908b60b5173ac6b8adb89ff350604e1d30d351b28111b2df7"
|
|
50
50
|
}
|