@elevasis/core 0.2.1 → 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/dist/index.d.ts +63 -103
- package/dist/index.js +431 -111
- package/dist/organization-model/index.d.ts +63 -103
- package/dist/organization-model/index.js +431 -111
- package/package.json +1 -1
- package/src/README.md +1 -1
- package/src/__tests__/template-foundations-compatibility.test.ts +28 -36
- package/src/auth/multi-tenancy/types.ts +4 -11
- package/src/auth/multi-tenancy/users/api-schemas.ts +1 -1
- package/src/business/base-entities.test.ts +481 -0
- package/src/business/base-entities.ts +241 -0
- package/src/business/delivery/types.ts +1 -1
- package/src/business/index.ts +3 -0
- package/src/execution/index.ts +3 -6
- package/src/index.ts +1 -1
- package/src/organization-model/README.md +25 -26
- package/src/organization-model/__tests__/graph.test.ts +103 -71
- package/src/organization-model/__tests__/resolve.test.ts +22 -31
- package/src/organization-model/contracts.ts +3 -0
- package/src/organization-model/defaults.ts +59 -7
- package/src/organization-model/domains/features.ts +19 -54
- package/src/organization-model/domains/navigation.ts +266 -17
- package/src/organization-model/domains/shared.ts +1 -10
- package/src/organization-model/foundation.ts +97 -0
- package/src/organization-model/graph/build.ts +34 -67
- package/src/organization-model/graph/schema.ts +2 -4
- package/src/organization-model/graph/types.ts +3 -15
- package/src/organization-model/index.ts +2 -0
- package/src/organization-model/organization-graph.mdx +37 -28
- package/src/organization-model/organization-model.mdx +34 -36
- package/src/organization-model/published.ts +12 -3
- package/src/organization-model/schema.ts +38 -34
- package/src/organization-model/types.ts +5 -10
- package/src/platform/constants/versions.ts +1 -1
- package/src/platform/sse/events.ts +1 -34
- package/src/projects/api-schemas.ts +2 -1
- package/src/reference/_generated/contracts.md +10 -31
- package/src/reference/glossary.md +14 -18
- package/src/supabase/database.types.ts +0 -107
- package/src/test-utils/rls/RLSTestContext.ts +1 -31
- package/src/execution/calibration/__tests__/schemas.test.ts +0 -320
- package/src/execution/calibration/index.ts +0 -3
- package/src/execution/calibration/schemas.ts +0 -121
- package/src/execution/calibration/sse-events.ts +0 -125
- package/src/execution/calibration/types.ts +0 -190
|
@@ -1,320 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect } from 'vitest'
|
|
2
|
-
import {
|
|
3
|
-
CreateCalibrationProjectSchema,
|
|
4
|
-
UpdateCalibrationProjectSchema,
|
|
5
|
-
CreateCalibrationRunSchema,
|
|
6
|
-
GradingRubricSchema,
|
|
7
|
-
GradingCriterionSchema,
|
|
8
|
-
ConfigVariantSchema
|
|
9
|
-
} from '../schemas'
|
|
10
|
-
|
|
11
|
-
describe('Calibration Schemas', () => {
|
|
12
|
-
describe('GradingCriterionSchema', () => {
|
|
13
|
-
it('validates a valid grading criterion', () => {
|
|
14
|
-
const valid = {
|
|
15
|
-
name: 'Accuracy',
|
|
16
|
-
weight: 0.5,
|
|
17
|
-
description: 'Measures factual correctness',
|
|
18
|
-
scoringGuide: 'Check all facts are correct'
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const result = GradingCriterionSchema.safeParse(valid)
|
|
22
|
-
expect(result.success).toBe(true)
|
|
23
|
-
})
|
|
24
|
-
|
|
25
|
-
it('rejects invalid weight (> 1)', () => {
|
|
26
|
-
const invalid = {
|
|
27
|
-
name: 'Accuracy',
|
|
28
|
-
weight: 1.5,
|
|
29
|
-
description: 'Measures factual correctness',
|
|
30
|
-
scoringGuide: 'Check all facts are correct'
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const result = GradingCriterionSchema.safeParse(invalid)
|
|
34
|
-
expect(result.success).toBe(false)
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
it('rejects invalid weight (< 0)', () => {
|
|
38
|
-
const invalid = {
|
|
39
|
-
name: 'Accuracy',
|
|
40
|
-
weight: -0.1,
|
|
41
|
-
description: 'Measures factual correctness',
|
|
42
|
-
scoringGuide: 'Check all facts are correct'
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const result = GradingCriterionSchema.safeParse(invalid)
|
|
46
|
-
expect(result.success).toBe(false)
|
|
47
|
-
})
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
describe('GradingRubricSchema', () => {
|
|
51
|
-
it('validates a valid grading rubric', () => {
|
|
52
|
-
const valid = {
|
|
53
|
-
passingThreshold: 0.7,
|
|
54
|
-
criteria: [
|
|
55
|
-
{
|
|
56
|
-
name: 'Accuracy',
|
|
57
|
-
weight: 0.4,
|
|
58
|
-
description: 'Factual correctness',
|
|
59
|
-
scoringGuide: 'Verify claims'
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
name: 'Completeness',
|
|
63
|
-
weight: 0.6,
|
|
64
|
-
description: 'Covers all aspects',
|
|
65
|
-
scoringGuide: 'Check coverage'
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const result = GradingRubricSchema.safeParse(valid)
|
|
71
|
-
expect(result.success).toBe(true)
|
|
72
|
-
})
|
|
73
|
-
|
|
74
|
-
it('rejects empty criteria array', () => {
|
|
75
|
-
const invalid = {
|
|
76
|
-
passingThreshold: 0.7,
|
|
77
|
-
criteria: []
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const result = GradingRubricSchema.safeParse(invalid)
|
|
81
|
-
expect(result.success).toBe(false)
|
|
82
|
-
})
|
|
83
|
-
})
|
|
84
|
-
|
|
85
|
-
describe('ConfigVariantSchema', () => {
|
|
86
|
-
it('validates a variant with overrides', () => {
|
|
87
|
-
const valid = {
|
|
88
|
-
variantName: 'GPT-5 High Reasoning',
|
|
89
|
-
definitionOverrides: {
|
|
90
|
-
modelConfig: { model: 'gpt-5', temperature: 1 }
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const result = ConfigVariantSchema.safeParse(valid)
|
|
95
|
-
expect(result.success).toBe(true)
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
it('validates a variant without overrides', () => {
|
|
99
|
-
const valid = {
|
|
100
|
-
variantName: 'Baseline'
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const result = ConfigVariantSchema.safeParse(valid)
|
|
104
|
-
expect(result.success).toBe(true)
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
|
|
108
|
-
describe('CreateCalibrationProjectSchema', () => {
|
|
109
|
-
it('validates a valid project creation', () => {
|
|
110
|
-
const valid = {
|
|
111
|
-
resourceId: 'research-agent',
|
|
112
|
-
resourceType: 'agent' as const,
|
|
113
|
-
name: 'Q1 2025 Model Selection',
|
|
114
|
-
description: 'Finding optimal model'
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const result = CreateCalibrationProjectSchema.safeParse(valid)
|
|
118
|
-
expect(result.success).toBe(true)
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
it('validates project without description', () => {
|
|
122
|
-
const valid = {
|
|
123
|
-
resourceId: 'research-agent',
|
|
124
|
-
resourceType: 'workflow' as const,
|
|
125
|
-
name: 'Q1 2025 Model Selection'
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
const result = CreateCalibrationProjectSchema.safeParse(valid)
|
|
129
|
-
expect(result.success).toBe(true)
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
it('rejects invalid resourceType', () => {
|
|
133
|
-
const invalid = {
|
|
134
|
-
resourceId: 'research-agent',
|
|
135
|
-
resourceType: 'invalid',
|
|
136
|
-
name: 'Q1 2025 Model Selection'
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
const result = CreateCalibrationProjectSchema.safeParse(invalid)
|
|
140
|
-
expect(result.success).toBe(false)
|
|
141
|
-
})
|
|
142
|
-
})
|
|
143
|
-
|
|
144
|
-
describe('UpdateCalibrationProjectSchema', () => {
|
|
145
|
-
it('validates name update', () => {
|
|
146
|
-
const valid = {
|
|
147
|
-
name: 'Updated Name'
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const result = UpdateCalibrationProjectSchema.safeParse(valid)
|
|
151
|
-
expect(result.success).toBe(true)
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
it('validates description update', () => {
|
|
155
|
-
const valid = {
|
|
156
|
-
description: 'Updated description'
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
const result = UpdateCalibrationProjectSchema.safeParse(valid)
|
|
160
|
-
expect(result.success).toBe(true)
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
it('validates both fields', () => {
|
|
164
|
-
const valid = {
|
|
165
|
-
name: 'Updated Name',
|
|
166
|
-
description: 'Updated description'
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const result = UpdateCalibrationProjectSchema.safeParse(valid)
|
|
170
|
-
expect(result.success).toBe(true)
|
|
171
|
-
})
|
|
172
|
-
})
|
|
173
|
-
|
|
174
|
-
describe('CreateCalibrationRunSchema', () => {
|
|
175
|
-
it('validates a valid calibration run', () => {
|
|
176
|
-
const valid = {
|
|
177
|
-
projectId: '123e4567-e89b-12d3-a456-426614174000',
|
|
178
|
-
name: 'Model comparison',
|
|
179
|
-
executionMode: 'single' as const,
|
|
180
|
-
testInputs: [{ query: 'Test query' }],
|
|
181
|
-
configVariants: [
|
|
182
|
-
{
|
|
183
|
-
variantName: 'GPT-5',
|
|
184
|
-
definitionOverrides: { modelConfig: { model: 'gpt-5' } }
|
|
185
|
-
}
|
|
186
|
-
]
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
const result = CreateCalibrationRunSchema.safeParse(valid)
|
|
190
|
-
expect(result.success).toBe(true)
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
it('validates run with grading rubric and model', () => {
|
|
194
|
-
const valid = {
|
|
195
|
-
projectId: '123e4567-e89b-12d3-a456-426614174000',
|
|
196
|
-
name: 'Model comparison',
|
|
197
|
-
testInputs: [{ query: 'Test query' }],
|
|
198
|
-
configVariants: [
|
|
199
|
-
{
|
|
200
|
-
variantName: 'GPT-5'
|
|
201
|
-
}
|
|
202
|
-
],
|
|
203
|
-
gradingRubric: {
|
|
204
|
-
passingThreshold: 0.7,
|
|
205
|
-
criteria: [
|
|
206
|
-
{
|
|
207
|
-
name: 'Accuracy',
|
|
208
|
-
weight: 1,
|
|
209
|
-
description: 'Factual correctness',
|
|
210
|
-
scoringGuide: 'Verify claims'
|
|
211
|
-
}
|
|
212
|
-
]
|
|
213
|
-
},
|
|
214
|
-
graderModel: 'gpt-5' as const
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
const result = CreateCalibrationRunSchema.safeParse(valid)
|
|
218
|
-
expect(result.success).toBe(true)
|
|
219
|
-
})
|
|
220
|
-
|
|
221
|
-
it('rejects grading rubric without grader model', () => {
|
|
222
|
-
const invalid = {
|
|
223
|
-
projectId: '123e4567-e89b-12d3-a456-426614174000',
|
|
224
|
-
name: 'Model comparison',
|
|
225
|
-
testInputs: [{ query: 'Test query' }],
|
|
226
|
-
configVariants: [
|
|
227
|
-
{
|
|
228
|
-
variantName: 'GPT-5'
|
|
229
|
-
}
|
|
230
|
-
],
|
|
231
|
-
gradingRubric: {
|
|
232
|
-
passingThreshold: 0.7,
|
|
233
|
-
criteria: [
|
|
234
|
-
{
|
|
235
|
-
name: 'Accuracy',
|
|
236
|
-
weight: 1,
|
|
237
|
-
description: 'Factual correctness',
|
|
238
|
-
scoringGuide: 'Verify claims'
|
|
239
|
-
}
|
|
240
|
-
]
|
|
241
|
-
}
|
|
242
|
-
// Missing graderModel
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
const result = CreateCalibrationRunSchema.safeParse(invalid)
|
|
246
|
-
expect(result.success).toBe(false)
|
|
247
|
-
})
|
|
248
|
-
|
|
249
|
-
it('rejects empty testInputs array', () => {
|
|
250
|
-
const invalid = {
|
|
251
|
-
projectId: '123e4567-e89b-12d3-a456-426614174000',
|
|
252
|
-
name: 'Model comparison',
|
|
253
|
-
testInputs: [],
|
|
254
|
-
configVariants: [
|
|
255
|
-
{
|
|
256
|
-
variantName: 'GPT-5'
|
|
257
|
-
}
|
|
258
|
-
]
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
const result = CreateCalibrationRunSchema.safeParse(invalid)
|
|
262
|
-
expect(result.success).toBe(false)
|
|
263
|
-
})
|
|
264
|
-
|
|
265
|
-
it('rejects more than 50 testInputs', () => {
|
|
266
|
-
const invalid = {
|
|
267
|
-
projectId: '123e4567-e89b-12d3-a456-426614174000',
|
|
268
|
-
name: 'Model comparison',
|
|
269
|
-
testInputs: Array(51).fill({ query: 'Test' }),
|
|
270
|
-
configVariants: [
|
|
271
|
-
{
|
|
272
|
-
variantName: 'GPT-5'
|
|
273
|
-
}
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
const result = CreateCalibrationRunSchema.safeParse(invalid)
|
|
278
|
-
expect(result.success).toBe(false)
|
|
279
|
-
})
|
|
280
|
-
|
|
281
|
-
it('rejects empty configVariants array', () => {
|
|
282
|
-
const invalid = {
|
|
283
|
-
projectId: '123e4567-e89b-12d3-a456-426614174000',
|
|
284
|
-
name: 'Model comparison',
|
|
285
|
-
testInputs: [{ query: 'Test' }],
|
|
286
|
-
configVariants: []
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
const result = CreateCalibrationRunSchema.safeParse(invalid)
|
|
290
|
-
expect(result.success).toBe(false)
|
|
291
|
-
})
|
|
292
|
-
|
|
293
|
-
it('rejects more than 10 configVariants', () => {
|
|
294
|
-
const invalid = {
|
|
295
|
-
projectId: '123e4567-e89b-12d3-a456-426614174000',
|
|
296
|
-
name: 'Model comparison',
|
|
297
|
-
testInputs: [{ query: 'Test' }],
|
|
298
|
-
configVariants: Array(11).fill({ variantName: 'Test' })
|
|
299
|
-
}
|
|
300
|
-
|
|
301
|
-
const result = CreateCalibrationRunSchema.safeParse(invalid)
|
|
302
|
-
expect(result.success).toBe(false)
|
|
303
|
-
})
|
|
304
|
-
|
|
305
|
-
it('applies default executionMode', () => {
|
|
306
|
-
const input = {
|
|
307
|
-
projectId: '123e4567-e89b-12d3-a456-426614174000',
|
|
308
|
-
name: 'Model comparison',
|
|
309
|
-
testInputs: [{ query: 'Test' }],
|
|
310
|
-
configVariants: [{ variantName: 'GPT-5' }]
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
const result = CreateCalibrationRunSchema.safeParse(input)
|
|
314
|
-
expect(result.success).toBe(true)
|
|
315
|
-
if (result.success) {
|
|
316
|
-
expect(result.data.executionMode).toBe('single')
|
|
317
|
-
}
|
|
318
|
-
})
|
|
319
|
-
})
|
|
320
|
-
})
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod'
|
|
2
|
-
|
|
3
|
-
// ============================================================================
|
|
4
|
-
// LLM Model Schema
|
|
5
|
-
// ============================================================================
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* LLM model validation schema
|
|
9
|
-
* Matches LLMModel type from model-info.ts
|
|
10
|
-
*/
|
|
11
|
-
const LLMModelSchema = z.enum([
|
|
12
|
-
'gpt-5',
|
|
13
|
-
'gpt-5.4-mini',
|
|
14
|
-
'gpt-5.4-nano',
|
|
15
|
-
'openrouter/z-ai/glm-5',
|
|
16
|
-
'gemini-3-flash-preview',
|
|
17
|
-
'gemini-3.1-flash-lite-preview',
|
|
18
|
-
'mock'
|
|
19
|
-
])
|
|
20
|
-
|
|
21
|
-
// ============================================================================
|
|
22
|
-
// Grading Schemas
|
|
23
|
-
// ============================================================================
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Grading criterion schema
|
|
27
|
-
* Defines a single criterion for evaluating AI outputs
|
|
28
|
-
*/
|
|
29
|
-
const GradingCriterionSchema = z.object({
|
|
30
|
-
name: z.string().min(1),
|
|
31
|
-
weight: z.number().min(0).max(1),
|
|
32
|
-
description: z.string().min(1),
|
|
33
|
-
scoringGuide: z.string().min(1)
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Grading rubric schema
|
|
38
|
-
* Collection of criteria with passing threshold
|
|
39
|
-
*/
|
|
40
|
-
const GradingRubricSchema = z.object({
|
|
41
|
-
passingThreshold: z.number().min(0).max(1),
|
|
42
|
-
criteria: z.array(GradingCriterionSchema).min(1)
|
|
43
|
-
})
|
|
44
|
-
|
|
45
|
-
// ============================================================================
|
|
46
|
-
// Config Variant Schema
|
|
47
|
-
// ============================================================================
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Configuration variant schema
|
|
51
|
-
* Defines a test variant with optional overrides
|
|
52
|
-
*/
|
|
53
|
-
const ConfigVariantSchema = z.object({
|
|
54
|
-
variantName: z.string().min(1),
|
|
55
|
-
definitionOverrides: z.record(z.string(), z.unknown()).optional() // Flexible for agent/workflow overrides
|
|
56
|
-
})
|
|
57
|
-
|
|
58
|
-
// ============================================================================
|
|
59
|
-
// Calibration Project Schemas
|
|
60
|
-
// ============================================================================
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Create calibration project schema
|
|
64
|
-
* Validates request body for creating a new calibration project
|
|
65
|
-
*/
|
|
66
|
-
export const CreateCalibrationProjectSchema = z.object({
|
|
67
|
-
resourceId: z.string().min(1),
|
|
68
|
-
resourceType: z.enum(['agent', 'workflow']),
|
|
69
|
-
name: z.string().min(1),
|
|
70
|
-
description: z.string().optional()
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Update calibration project schema
|
|
75
|
-
* Validates request body for updating an existing calibration project
|
|
76
|
-
*/
|
|
77
|
-
export const UpdateCalibrationProjectSchema = z.object({
|
|
78
|
-
name: z.string().min(1).optional(),
|
|
79
|
-
description: z.string().optional()
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
// ============================================================================
|
|
83
|
-
// Calibration Run Schemas
|
|
84
|
-
// ============================================================================
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Create calibration run schema
|
|
88
|
-
* Validates request body for creating a new calibration run
|
|
89
|
-
* Includes refinement for graderModel requirement when gradingRubric is provided
|
|
90
|
-
*/
|
|
91
|
-
export const CreateCalibrationRunSchema = z
|
|
92
|
-
.object({
|
|
93
|
-
projectId: z.string().uuid(),
|
|
94
|
-
name: z.string().min(1),
|
|
95
|
-
description: z.string().optional(),
|
|
96
|
-
executionMode: z.enum(['single', 'session']).default('single'),
|
|
97
|
-
testInputs: z.array(z.unknown()).min(1).max(50), // Min 1, max 50 inputs
|
|
98
|
-
configVariants: z.array(ConfigVariantSchema).min(1).max(10), // Min 1, max 10 variants
|
|
99
|
-
gradingRubric: GradingRubricSchema.optional(),
|
|
100
|
-
graderModel: LLMModelSchema.optional()
|
|
101
|
-
})
|
|
102
|
-
.refine((data) => !data.gradingRubric || data.graderModel, {
|
|
103
|
-
message: 'graderModel is required when gradingRubric is provided'
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
// ============================================================================
|
|
107
|
-
// Exported Schemas
|
|
108
|
-
// ============================================================================
|
|
109
|
-
|
|
110
|
-
export { GradingRubricSchema, GradingCriterionSchema, ConfigVariantSchema }
|
|
111
|
-
|
|
112
|
-
// ============================================================================
|
|
113
|
-
// Inferred Types
|
|
114
|
-
// ============================================================================
|
|
115
|
-
|
|
116
|
-
export type CreateCalibrationProjectInput = z.infer<typeof CreateCalibrationProjectSchema>
|
|
117
|
-
export type UpdateCalibrationProjectInput = z.infer<typeof UpdateCalibrationProjectSchema>
|
|
118
|
-
export type CreateCalibrationRunInput = z.infer<typeof CreateCalibrationRunSchema>
|
|
119
|
-
export type GradingRubricInput = z.infer<typeof GradingRubricSchema>
|
|
120
|
-
export type GradingCriterionInput = z.infer<typeof GradingCriterionSchema>
|
|
121
|
-
export type ConfigVariantInput = z.infer<typeof ConfigVariantSchema>
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Calibration SSE Event Types
|
|
3
|
-
*
|
|
4
|
-
* Shared event type definitions for calibration real-time streaming.
|
|
5
|
-
* Used by both the API broadcaster and the command-center UI.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Single-turn events
|
|
9
|
-
|
|
10
|
-
export interface CalibrationExecutionStartedEvent {
|
|
11
|
-
type: 'execution-started'
|
|
12
|
-
variantName: string
|
|
13
|
-
inputIndex: number
|
|
14
|
-
timestamp: number
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface CalibrationExecutionCompletedEvent {
|
|
18
|
-
type: 'execution-completed'
|
|
19
|
-
variantName: string
|
|
20
|
-
inputIndex: number
|
|
21
|
-
executionId: string
|
|
22
|
-
timestamp: number
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface CalibrationExecutionFailedEvent {
|
|
26
|
-
type: 'execution-failed'
|
|
27
|
-
variantName: string
|
|
28
|
-
inputIndex?: number
|
|
29
|
-
error: string
|
|
30
|
-
timestamp: number
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// Session events
|
|
34
|
-
|
|
35
|
-
export interface CalibrationSessionStartedEvent {
|
|
36
|
-
type: 'session-started'
|
|
37
|
-
variantName: string
|
|
38
|
-
sessionId: string
|
|
39
|
-
timestamp: number
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface CalibrationTurnStartedEvent {
|
|
43
|
-
type: 'turn-started'
|
|
44
|
-
variantName: string
|
|
45
|
-
turnNumber: number
|
|
46
|
-
timestamp: number
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export interface CalibrationTurnCompletedEvent {
|
|
50
|
-
type: 'turn-completed'
|
|
51
|
-
variantName: string
|
|
52
|
-
turnNumber: number
|
|
53
|
-
executionId: string
|
|
54
|
-
timestamp: number
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export interface CalibrationSessionCompletedEvent {
|
|
58
|
-
type: 'session-completed'
|
|
59
|
-
variantName: string
|
|
60
|
-
sessionId: string
|
|
61
|
-
turnCount: number
|
|
62
|
-
timestamp: number
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
// Grading events
|
|
66
|
-
|
|
67
|
-
export interface CalibrationGradingStartedEvent {
|
|
68
|
-
type: 'grading-started'
|
|
69
|
-
variantName: string
|
|
70
|
-
timestamp: number
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export interface CalibrationGradingCompletedEvent {
|
|
74
|
-
type: 'grading-completed'
|
|
75
|
-
variantName: string
|
|
76
|
-
score: number
|
|
77
|
-
timestamp: number
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
export interface CalibrationGradingFailedEvent {
|
|
81
|
-
type: 'grading-failed'
|
|
82
|
-
variantName: string
|
|
83
|
-
error: string
|
|
84
|
-
timestamp: number
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Completion events
|
|
88
|
-
|
|
89
|
-
export interface CalibrationCompletedEvent {
|
|
90
|
-
type: 'calibration-completed'
|
|
91
|
-
summary: { total: number; completed: number; failed: number }
|
|
92
|
-
timestamp: number
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface CalibrationFailedEvent {
|
|
96
|
-
type: 'calibration-failed'
|
|
97
|
-
error: string
|
|
98
|
-
timestamp: number
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
// Connection event
|
|
102
|
-
|
|
103
|
-
export interface CalibrationConnectedEvent {
|
|
104
|
-
type: 'connected'
|
|
105
|
-
timestamp: number
|
|
106
|
-
data?: undefined
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Union of all calibration SSE events
|
|
111
|
-
*/
|
|
112
|
-
export type CalibrationSSEEvent =
|
|
113
|
-
| CalibrationExecutionStartedEvent
|
|
114
|
-
| CalibrationExecutionCompletedEvent
|
|
115
|
-
| CalibrationExecutionFailedEvent
|
|
116
|
-
| CalibrationSessionStartedEvent
|
|
117
|
-
| CalibrationTurnStartedEvent
|
|
118
|
-
| CalibrationTurnCompletedEvent
|
|
119
|
-
| CalibrationSessionCompletedEvent
|
|
120
|
-
| CalibrationGradingStartedEvent
|
|
121
|
-
| CalibrationGradingCompletedEvent
|
|
122
|
-
| CalibrationGradingFailedEvent
|
|
123
|
-
| CalibrationCompletedEvent
|
|
124
|
-
| CalibrationFailedEvent
|
|
125
|
-
| CalibrationConnectedEvent
|