@artemiskit/core 0.2.4 → 0.4.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/CHANGELOG.md +137 -0
- package/README.md +4 -0
- package/dist/adapters/registry.d.ts.map +1 -1
- package/dist/adapters/types.d.ts +50 -2
- package/dist/adapters/types.d.ts.map +1 -1
- package/dist/agent-evaluation/index.d.ts +3 -0
- package/dist/agent-evaluation/index.d.ts.map +1 -0
- package/dist/agent-evaluation/scorer.d.ts +35 -0
- package/dist/agent-evaluation/scorer.d.ts.map +1 -0
- package/dist/agent-evaluation/types.d.ts +37 -0
- package/dist/agent-evaluation/types.d.ts.map +1 -0
- package/dist/artifacts/manifest.d.ts.map +1 -1
- package/dist/artifacts/types.d.ts +54 -0
- package/dist/artifacts/types.d.ts.map +1 -1
- package/dist/evaluators/index.d.ts +1 -0
- package/dist/evaluators/index.d.ts.map +1 -1
- package/dist/evaluators/json-schema.d.ts +0 -1
- package/dist/evaluators/json-schema.d.ts.map +1 -1
- package/dist/evaluators/llm-grader.d.ts +2 -0
- package/dist/evaluators/llm-grader.d.ts.map +1 -1
- package/dist/evaluators/tool-trace.d.ts +7 -0
- package/dist/evaluators/tool-trace.d.ts.map +1 -0
- package/dist/evaluators/types.d.ts +20 -0
- package/dist/evaluators/types.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19964 -12482
- package/dist/runner/executor.d.ts.map +1 -1
- package/dist/runner/runner.d.ts.map +1 -1
- package/dist/runner/types.d.ts +4 -0
- package/dist/runner/types.d.ts.map +1 -1
- package/dist/scenario/schema.d.ts +789 -99
- package/dist/scenario/schema.d.ts.map +1 -1
- package/dist/storage/supabase.d.ts +26 -5
- package/dist/storage/supabase.d.ts.map +1 -1
- package/dist/storage/types.d.ts +167 -1
- package/dist/storage/types.d.ts.map +1 -1
- package/dist/tools/fixture-executor.d.ts +10 -0
- package/dist/tools/fixture-executor.d.ts.map +1 -0
- package/dist/tools/index.d.ts +4 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/schema-validator.d.ts +10 -0
- package/dist/tools/schema-validator.d.ts.map +1 -0
- package/dist/tools/types.d.ts +50 -0
- package/dist/tools/types.d.ts.map +1 -0
- package/package.json +2 -1
- package/src/adapters/registry.ts +45 -0
- package/src/adapters/types.test.ts +21 -0
- package/src/adapters/types.ts +56 -0
- package/src/agent-evaluation/index.ts +2 -0
- package/src/agent-evaluation/scorer.test.ts +1194 -0
- package/src/agent-evaluation/scorer.ts +640 -0
- package/src/agent-evaluation/types.test.ts +27 -0
- package/src/agent-evaluation/types.ts +43 -0
- package/src/artifacts/manifest.test.ts +66 -19
- package/src/artifacts/manifest.ts +18 -5
- package/src/artifacts/types.ts +65 -0
- package/src/evaluators/index.ts +3 -0
- package/src/evaluators/json-schema.test.ts +130 -0
- package/src/evaluators/json-schema.ts +38 -63
- package/src/evaluators/llm-grader.test.ts +80 -0
- package/src/evaluators/llm-grader.ts +44 -6
- package/src/evaluators/tool-trace.test.ts +46 -0
- package/src/evaluators/tool-trace.ts +50 -0
- package/src/evaluators/types.ts +20 -0
- package/src/index.ts +6 -0
- package/src/runner/executor.test.ts +340 -0
- package/src/runner/executor.ts +289 -20
- package/src/runner/release-validation.test.ts +169 -0
- package/src/runner/runner.ts +5 -1
- package/src/runner/types.ts +4 -0
- package/src/scenario/schema.ts +66 -1
- package/src/storage/supabase.test.ts +1052 -0
- package/src/storage/supabase.ts +614 -5
- package/src/storage/types.ts +207 -1
- package/src/tools/fixture-executor.test.ts +88 -0
- package/src/tools/fixture-executor.ts +112 -0
- package/src/tools/index.ts +3 -0
- package/src/tools/schema-validator.test.ts +32 -0
- package/src/tools/schema-validator.ts +56 -0
- package/src/tools/types.ts +80 -0
package/src/scenario/schema.ts
CHANGED
|
@@ -18,6 +18,9 @@ export const ProviderSchema = z.enum([
|
|
|
18
18
|
'cohere',
|
|
19
19
|
'huggingface',
|
|
20
20
|
'ollama',
|
|
21
|
+
'langchain',
|
|
22
|
+
'deepagents',
|
|
23
|
+
'ling',
|
|
21
24
|
'custom',
|
|
22
25
|
]);
|
|
23
26
|
|
|
@@ -50,6 +53,17 @@ export const ProviderConfigSchema = z
|
|
|
50
53
|
|
|
51
54
|
// Vercel AI specific
|
|
52
55
|
underlyingProvider: z.enum(['openai', 'azure', 'anthropic', 'google', 'mistral']).optional(),
|
|
56
|
+
|
|
57
|
+
// LangChain specific
|
|
58
|
+
name: z.string().optional(),
|
|
59
|
+
runnableType: z.enum(['chain', 'agent', 'llm', 'runnable']).optional(),
|
|
60
|
+
|
|
61
|
+
// DeepAgents specific
|
|
62
|
+
captureTraces: z.boolean().optional(),
|
|
63
|
+
captureMessages: z.boolean().optional(),
|
|
64
|
+
thinking: z.object({ type: z.enum(['enabled', 'disabled']) }).optional(),
|
|
65
|
+
enableSearch: z.boolean().optional(),
|
|
66
|
+
searchOptions: z.record(z.unknown()).optional(),
|
|
53
67
|
})
|
|
54
68
|
.optional();
|
|
55
69
|
|
|
@@ -81,6 +95,8 @@ const BaseExpectedSchema = z.discriminatedUnion('type', [
|
|
|
81
95
|
model: z.string().optional(),
|
|
82
96
|
provider: ProviderSchema.optional(),
|
|
83
97
|
threshold: z.number().min(0).max(1).default(0.7),
|
|
98
|
+
/** Require exact, validated JSON from the judge for assurance assessments. */
|
|
99
|
+
strict: z.boolean().optional().default(false),
|
|
84
100
|
}),
|
|
85
101
|
|
|
86
102
|
z.object({
|
|
@@ -106,6 +122,14 @@ const BaseExpectedSchema = z.discriminatedUnion('type', [
|
|
|
106
122
|
config: z.record(z.unknown()).optional(),
|
|
107
123
|
}),
|
|
108
124
|
|
|
125
|
+
z.object({
|
|
126
|
+
type: z.literal('tool_trace'),
|
|
127
|
+
requiredTools: z.array(z.string()).optional(),
|
|
128
|
+
forbiddenTools: z.array(z.string()).optional(),
|
|
129
|
+
ordered: z.boolean().optional().default(false),
|
|
130
|
+
maxCalls: z.number().int().min(0).optional(),
|
|
131
|
+
}),
|
|
132
|
+
|
|
109
133
|
z.object({
|
|
110
134
|
type: z.literal('similarity'),
|
|
111
135
|
value: z.string(),
|
|
@@ -145,10 +169,39 @@ export const ExpectedSchema = z.union([BaseExpectedSchema, CombinedExpectedSchem
|
|
|
145
169
|
* Chat message schema
|
|
146
170
|
*/
|
|
147
171
|
export const ChatMessageSchema = z.object({
|
|
148
|
-
role: z.enum(['system', 'user', 'assistant']),
|
|
172
|
+
role: z.enum(['system', 'user', 'assistant', 'tool']),
|
|
149
173
|
content: z.string(),
|
|
174
|
+
name: z.string().optional(),
|
|
175
|
+
toolCallId: z.string().optional(),
|
|
176
|
+
tool_calls: z
|
|
177
|
+
.array(
|
|
178
|
+
z.object({
|
|
179
|
+
id: z.string(),
|
|
180
|
+
type: z.literal('function'),
|
|
181
|
+
function: z.object({ name: z.string(), arguments: z.string() }),
|
|
182
|
+
})
|
|
183
|
+
)
|
|
184
|
+
.optional(),
|
|
150
185
|
});
|
|
151
186
|
|
|
187
|
+
const ToolSchema = z
|
|
188
|
+
.object({
|
|
189
|
+
type: z.literal('function'),
|
|
190
|
+
function: z.object({
|
|
191
|
+
name: z.string(),
|
|
192
|
+
description: z.string().optional(),
|
|
193
|
+
parameters: z.record(z.unknown()),
|
|
194
|
+
}),
|
|
195
|
+
})
|
|
196
|
+
.strict();
|
|
197
|
+
const ToolFixtureSchema = z
|
|
198
|
+
.object({
|
|
199
|
+
when: z.record(z.unknown()).optional(),
|
|
200
|
+
result: z.unknown().optional(),
|
|
201
|
+
error: z.string().optional(),
|
|
202
|
+
})
|
|
203
|
+
.strict();
|
|
204
|
+
|
|
152
205
|
/**
|
|
153
206
|
* Variables schema - key-value pairs for template substitution
|
|
154
207
|
*/
|
|
@@ -201,6 +254,18 @@ export const ScenarioSchema = z.object({
|
|
|
201
254
|
.object({
|
|
202
255
|
systemPrompt: z.string().optional(),
|
|
203
256
|
functions: z.array(z.unknown()).optional(),
|
|
257
|
+
tools: z.array(ToolSchema).optional(),
|
|
258
|
+
fixtures: z.record(z.array(ToolFixtureSchema)).optional(),
|
|
259
|
+
toolLoop: z
|
|
260
|
+
.object({
|
|
261
|
+
enabled: z.boolean().default(false),
|
|
262
|
+
maxSteps: z.number().int().min(1).max(10).default(5),
|
|
263
|
+
timeoutMs: z.number().int().min(1).max(300_000).default(60_000),
|
|
264
|
+
maxToolResultBytes: z.number().int().min(1).max(1_048_576).default(32_768),
|
|
265
|
+
rejectDuplicateCalls: z.boolean().default(true),
|
|
266
|
+
})
|
|
267
|
+
.strict()
|
|
268
|
+
.optional(),
|
|
204
269
|
})
|
|
205
270
|
.optional(),
|
|
206
271
|
cases: z.array(TestCaseSchema).min(1),
|