@inspectr/mcplab-core 1.22.1 → 1.23.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.
Files changed (92) hide show
  1. package/dist/abort.d.ts +1 -1
  2. package/dist/agent.d.ts +72 -87
  3. package/dist/agent.d.ts.map +1 -1
  4. package/dist/agent.js +9 -2
  5. package/dist/agent.js.map +1 -1
  6. package/dist/artifacts.d.ts +9 -0
  7. package/dist/artifacts.d.ts.map +1 -0
  8. package/dist/artifacts.js +22 -0
  9. package/dist/artifacts.js.map +1 -0
  10. package/dist/assistant-tools.d.ts +1 -1
  11. package/dist/attachments.d.ts +4 -9
  12. package/dist/browser-provider-store.d.ts +5 -0
  13. package/dist/browser-provider-store.d.ts.map +1 -0
  14. package/dist/browser-provider-store.js +42 -0
  15. package/dist/browser-provider-store.js.map +1 -0
  16. package/dist/browser-providers.d.ts +48 -0
  17. package/dist/browser-providers.d.ts.map +1 -0
  18. package/dist/browser-providers.js +198 -0
  19. package/dist/browser-providers.js.map +1 -0
  20. package/dist/browser.d.ts +3 -7
  21. package/dist/browser.d.ts.map +1 -1
  22. package/dist/browser.js +1 -0
  23. package/dist/browser.js.map +1 -1
  24. package/dist/check-counts.d.ts +3 -5
  25. package/dist/check-counts.d.ts.map +1 -1
  26. package/dist/check-counts.js +11 -2
  27. package/dist/check-counts.js.map +1 -1
  28. package/dist/config-values.d.ts +1 -1
  29. package/dist/config.d.ts +21 -33
  30. package/dist/config.d.ts.map +1 -1
  31. package/dist/config.js +51 -42
  32. package/dist/config.js.map +1 -1
  33. package/dist/default-browser-providers.d.ts +13 -0
  34. package/dist/default-browser-providers.d.ts.map +1 -0
  35. package/dist/default-browser-providers.js +99 -0
  36. package/dist/default-browser-providers.js.map +1 -0
  37. package/dist/eval.d.ts +23 -53
  38. package/dist/eval.d.ts.map +1 -1
  39. package/dist/eval.js +38 -6
  40. package/dist/eval.js.map +1 -1
  41. package/dist/evaluation-config-store.d.ts +20 -17
  42. package/dist/index.d.ts +17 -50
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +10 -2
  45. package/dist/index.js.map +1 -1
  46. package/dist/langsmith-tracing.d.ts +32 -21
  47. package/dist/langsmith-tracing.js.map +1 -1
  48. package/dist/mcp.d.ts +63 -69
  49. package/dist/mcp.d.ts.map +1 -1
  50. package/dist/mcp.js +34 -5
  51. package/dist/mcp.js.map +1 -1
  52. package/dist/queue-contract.d.ts +93 -27
  53. package/dist/queue-contract.d.ts.map +1 -1
  54. package/dist/queue-contract.js +31 -1
  55. package/dist/queue-contract.js.map +1 -1
  56. package/dist/result-metrics.d.ts +3 -0
  57. package/dist/result-metrics.d.ts.map +1 -0
  58. package/dist/result-metrics.js +6 -0
  59. package/dist/result-metrics.js.map +1 -0
  60. package/dist/results-query.d.ts +51 -60
  61. package/dist/results-query.d.ts.map +1 -1
  62. package/dist/results-query.js +23 -47
  63. package/dist/results-query.js.map +1 -1
  64. package/dist/results.d.ts +20 -18
  65. package/dist/results.d.ts.map +1 -1
  66. package/dist/results.js +26 -7
  67. package/dist/results.js.map +1 -1
  68. package/dist/run-directory-snapshots.d.ts +12 -0
  69. package/dist/run-directory-snapshots.d.ts.map +1 -0
  70. package/dist/run-directory-snapshots.js +56 -0
  71. package/dist/run-directory-snapshots.js.map +1 -0
  72. package/dist/runner.d.ts +109 -121
  73. package/dist/runner.d.ts.map +1 -1
  74. package/dist/runner.js +123 -66
  75. package/dist/runner.js.map +1 -1
  76. package/dist/runtime-overrides.d.ts +4 -7
  77. package/dist/scenario-builder.d.ts +15 -15
  78. package/dist/scenario-observation.d.ts +22 -0
  79. package/dist/scenario-observation.d.ts.map +1 -0
  80. package/dist/scenario-observation.js +70 -0
  81. package/dist/scenario-observation.js.map +1 -0
  82. package/dist/test-case-store.d.ts +26 -26
  83. package/dist/tool-definition-token-estimates.d.ts +13 -16
  84. package/dist/trace-token-estimates.d.ts +5 -11
  85. package/dist/trace.d.ts +4 -4
  86. package/dist/trace.d.ts.map +1 -1
  87. package/dist/trace.js.map +1 -1
  88. package/dist/types.d.ts +353 -338
  89. package/dist/types.d.ts.map +1 -1
  90. package/dist/types.js +3 -1
  91. package/dist/types.js.map +1 -1
  92. package/package.json +3 -3
package/dist/types.d.ts CHANGED
@@ -1,442 +1,457 @@
1
1
  export type TransportType = 'http';
2
2
  export interface ServerAuthBearer {
3
- type: 'bearer';
4
- env?: string;
5
- token?: string;
3
+ type: 'bearer';
4
+ env?: string;
5
+ token?: string;
6
6
  }
7
7
  export interface ServerAuthApiKey {
8
- type: 'api_key';
9
- header_name?: string;
10
- value: string;
8
+ type: 'api_key';
9
+ header_name?: string;
10
+ value: string;
11
11
  }
12
12
  export interface ServerAuthOauthClientCredentials {
13
- type: 'oauth_client_credentials';
14
- token_url: string;
15
- client_id_env: string;
16
- client_secret_env: string;
17
- scope?: string;
18
- audience?: string;
19
- token_params?: Record<string, string>;
13
+ type: 'oauth_client_credentials';
14
+ token_url: string;
15
+ client_id_env: string;
16
+ client_secret_env: string;
17
+ scope?: string;
18
+ audience?: string;
19
+ token_params?: Record<string, string>;
20
20
  }
21
21
  export interface ServerAuthOauthAuthorizationCode {
22
- type: 'oauth_authorization_code';
23
- mode?: 'pre_registered' | 'dcr';
24
- client_id?: string;
25
- client_secret?: string;
26
- redirect_url?: string;
27
- scope?: string;
28
- authorization_url?: string;
29
- token_url?: string;
30
- }
31
- export type ServerAuth =
32
- | ServerAuthBearer
33
- | ServerAuthApiKey
34
- | ServerAuthOauthClientCredentials
35
- | ServerAuthOauthAuthorizationCode;
22
+ type: 'oauth_authorization_code';
23
+ mode?: 'pre_registered' | 'dcr';
24
+ client_id?: string;
25
+ client_secret?: string;
26
+ redirect_url?: string;
27
+ scope?: string;
28
+ authorization_url?: string;
29
+ token_url?: string;
30
+ }
31
+ export type ServerAuth = ServerAuthBearer | ServerAuthApiKey | ServerAuthOauthClientCredentials | ServerAuthOauthAuthorizationCode;
36
32
  export interface ServerConfig {
37
- name?: string;
38
- transport: TransportType;
39
- url: string;
40
- headers?: Record<string, string>;
41
- auth?: ServerAuth;
33
+ name?: string;
34
+ transport: TransportType;
35
+ url: string;
36
+ headers?: Record<string, string>;
37
+ auth?: ServerAuth;
42
38
  }
43
39
  export interface ServerInlineEntry extends ServerConfig {
44
- id: string;
45
- name?: string;
40
+ id: string;
41
+ name?: string;
46
42
  }
47
43
  export interface ServerRefEntry {
48
- ref: string;
44
+ ref: string;
49
45
  }
50
46
  export type ServerListEntry = ServerInlineEntry | ServerRefEntry;
51
- export interface AgentConfig {
52
- name?: string;
53
- provider: 'openai' | 'anthropic' | 'azure_openai';
54
- model: string;
55
- temperature?: number;
56
- max_tokens?: number;
57
- max_turns?: number;
58
- system?: string;
59
- }
60
- export interface AgentInlineEntry extends AgentConfig {
61
- id: string;
62
- name?: string;
63
- }
47
+ export interface LlmAgentConfig {
48
+ type?: 'llm';
49
+ name?: string;
50
+ provider: 'openai' | 'anthropic' | 'azure_openai';
51
+ model: string;
52
+ temperature?: number;
53
+ max_tokens?: number;
54
+ max_turns?: number;
55
+ system?: string;
56
+ }
57
+ export interface BrowserAgentConfig {
58
+ type: 'browser';
59
+ name?: string;
60
+ provider: string;
61
+ url: string;
62
+ newConversationBetweenScenarios?: boolean;
63
+ }
64
+ export type RoverAgentProvider = string;
65
+ export interface RoverAgentRef {
66
+ name: string;
67
+ provider: RoverAgentProvider;
68
+ url: string;
69
+ providerRevision?: string;
70
+ }
71
+ export type AgentConfig = LlmAgentConfig | BrowserAgentConfig;
72
+ export type AgentInlineEntry = (LlmAgentConfig | BrowserAgentConfig) & {
73
+ id: string;
74
+ name?: string;
75
+ };
64
76
  export interface AgentRefEntry {
65
- ref: string;
77
+ ref: string;
66
78
  }
67
79
  export type AgentListEntry = AgentInlineEntry | AgentRefEntry;
80
+ export declare function isLlmAgent(agent: AgentConfig): agent is LlmAgentConfig;
68
81
  export interface ToolConstraints {
69
- required_tools?: string[];
70
- forbidden_tools?: string[];
82
+ required_tools?: string[];
83
+ forbidden_tools?: string[];
71
84
  }
72
85
  export interface ResponseAssertionRegex {
73
- type: 'regex';
74
- pattern: string;
86
+ type: 'regex';
87
+ pattern: string;
75
88
  }
76
89
  export interface ResponseAssertionContains {
77
- type: 'contains';
78
- value: string;
90
+ type: 'contains';
91
+ value: string;
79
92
  }
80
93
  export interface ResponseAssertionNotContains {
81
- type: 'not_contains';
82
- value: string;
94
+ type: 'not_contains';
95
+ value: string;
83
96
  }
84
97
  export interface ResponseAssertionStartsWith {
85
- type: 'starts_with';
86
- value: string;
98
+ type: 'starts_with';
99
+ value: string;
87
100
  }
88
101
  export interface ResponseAssertionEndsWith {
89
- type: 'ends_with';
90
- value: string;
102
+ type: 'ends_with';
103
+ value: string;
91
104
  }
92
105
  export interface ResponseAssertionEquals {
93
- type: 'equals';
94
- value: string;
106
+ type: 'equals';
107
+ value: string;
95
108
  }
96
109
  export interface ResponseAssertionJsonPath {
97
- type: 'jsonpath';
98
- path: string;
99
- equals?: string | number | boolean;
110
+ type: 'jsonpath';
111
+ path: string;
112
+ equals?: string | number | boolean;
100
113
  }
101
114
  export interface ResponseAssertionJsonPathExists {
102
- type: 'jsonpath_exists';
103
- path: string;
115
+ type: 'jsonpath_exists';
116
+ path: string;
104
117
  }
105
118
  export interface ResponseAssertionJsonPathNotExists {
106
- type: 'jsonpath_not_exists';
107
- path: string;
119
+ type: 'jsonpath_not_exists';
120
+ path: string;
108
121
  }
109
122
  export interface AgentAssertion {
110
- label: string;
111
- prompt: string;
123
+ label: string;
124
+ prompt: string;
112
125
  }
113
126
  export interface ToolInputAssertionBase {
114
- tool: string;
127
+ tool: string;
115
128
  }
116
129
  export interface ToolInputAssertionContains extends ToolInputAssertionBase {
117
- type: 'contains';
118
- value: string;
130
+ type: 'contains';
131
+ value: string;
119
132
  }
120
133
  export interface ToolInputAssertionRegex extends ToolInputAssertionBase {
121
- type: 'regex';
122
- pattern: string;
134
+ type: 'regex';
135
+ pattern: string;
123
136
  }
124
137
  export interface ToolInputAssertionJsonPath extends ToolInputAssertionBase {
125
- type: 'jsonpath';
126
- path: string;
127
- equals?: string | number | boolean;
128
- }
129
- export type ToolInputAssertion =
130
- | ToolInputAssertionContains
131
- | ToolInputAssertionRegex
132
- | ToolInputAssertionJsonPath;
138
+ type: 'jsonpath';
139
+ path: string;
140
+ equals?: string | number | boolean;
141
+ }
142
+ export type ToolInputAssertion = ToolInputAssertionContains | ToolInputAssertionRegex | ToolInputAssertionJsonPath;
133
143
  export interface AgentContext {
134
- include_prompt?: boolean;
135
- include_tool_sequence?: boolean;
136
- include_tool_inputs?: boolean;
144
+ include_prompt?: boolean;
145
+ include_tool_sequence?: boolean;
146
+ include_tool_inputs?: boolean;
137
147
  }
138
148
  export interface AgentJudgeContext {
139
- scenario_prompt?: string;
140
- tool_sequence?: string[];
141
- tool_inputs?: Array<{
142
- tool: string;
143
- arguments: unknown;
144
- }>;
145
- }
146
- export type ResponseAssertion =
147
- | ResponseAssertionRegex
148
- | ResponseAssertionContains
149
- | ResponseAssertionNotContains
150
- | ResponseAssertionStartsWith
151
- | ResponseAssertionEndsWith
152
- | ResponseAssertionEquals
153
- | ResponseAssertionJsonPath
154
- | ResponseAssertionJsonPathExists
155
- | ResponseAssertionJsonPathNotExists;
149
+ scenario_prompt?: string;
150
+ tool_sequence?: string[];
151
+ tool_inputs?: Array<{
152
+ tool: string;
153
+ arguments: unknown;
154
+ }>;
155
+ }
156
+ export type ResponseAssertion = ResponseAssertionRegex | ResponseAssertionContains | ResponseAssertionNotContains | ResponseAssertionStartsWith | ResponseAssertionEndsWith | ResponseAssertionEquals | ResponseAssertionJsonPath | ResponseAssertionJsonPathExists | ResponseAssertionJsonPathNotExists;
156
157
  export interface EvalRules {
157
- tool_constraints?: ToolConstraints;
158
- tool_sequence?: string[];
159
- tool_input_assertions?: ToolInputAssertion[];
160
- response_assertions?: ResponseAssertion[];
161
- agent_assertions?: AgentAssertion[];
162
- agent_context?: AgentContext;
163
- }
164
- export type CheckResultStatus = 'passed' | 'failed' | 'not_evaluated';
158
+ tool_constraints?: ToolConstraints;
159
+ tool_sequence?: string[];
160
+ tool_input_assertions?: ToolInputAssertion[];
161
+ response_assertions?: ResponseAssertion[];
162
+ agent_assertions?: AgentAssertion[];
163
+ agent_context?: AgentContext;
164
+ }
165
+ export type CheckResultStatus = 'passed' | 'failed' | 'not_evaluated' | 'not_executed'
166
+ /** @deprecated Persisted results used this name for capability-limited checks. */
167
+ | 'not_applicable';
165
168
  export interface CheckResult {
166
- type: string;
167
- label: string;
168
- status: CheckResultStatus;
169
- reason?: string;
170
- metadata?: Record<string, unknown>;
169
+ type: string;
170
+ label: string;
171
+ status: CheckResultStatus;
172
+ reason?: string;
173
+ metadata?: Record<string, unknown>;
171
174
  }
172
175
  export interface CheckCounts {
173
- passed: number;
174
- failed: number;
175
- not_evaluated: number;
176
- total: number;
176
+ passed: number;
177
+ failed: number;
178
+ /** Checks intentionally outside the execution source's capabilities. */
179
+ not_evaluated: number;
180
+ /** Checks expected to run but skipped because execution ended early. */
181
+ not_executed?: number;
182
+ /** Legacy field retained when reading older result summaries. */
183
+ not_applicable?: number;
184
+ total: number;
177
185
  }
178
186
  export interface ExtractRule {
179
- name: string;
180
- from: 'final_text';
181
- regex: string;
187
+ name: string;
188
+ from: 'final_text';
189
+ regex: string;
182
190
  }
183
191
  export interface ScenarioAttachment {
184
- type: 'image' | 'document';
185
- media_type: string;
186
- data: string;
187
- url?: string;
188
- name?: string;
192
+ type: 'image' | 'document';
193
+ media_type: string;
194
+ data: string;
195
+ url?: string;
196
+ name?: string;
189
197
  }
190
198
  export interface SourceScenarioAttachment extends Omit<ScenarioAttachment, 'media_type' | 'data'> {
191
- media_type?: string;
192
- data?: string;
193
- path?: string;
199
+ media_type?: string;
200
+ data?: string;
201
+ path?: string;
194
202
  }
195
203
  export interface Scenario {
196
- id: string;
197
- name?: string;
198
- mcp_servers?: ServerListEntry[];
199
- servers: string[];
200
- prompt: string;
201
- attachments?: ScenarioAttachment[];
202
- eval?: EvalRules;
203
- extract?: ExtractRule[];
204
+ id: string;
205
+ name?: string;
206
+ mcp_servers?: ServerListEntry[];
207
+ servers: string[];
208
+ prompt: string;
209
+ attachments?: ScenarioAttachment[];
210
+ eval?: EvalRules;
211
+ extract?: ExtractRule[];
204
212
  }
205
213
  export interface ScenarioRefEntry {
206
- ref: string;
207
- mcp_servers?: ServerListEntry[];
214
+ ref: string;
215
+ mcp_servers?: ServerListEntry[];
208
216
  }
209
217
  export interface SourceScenario extends Omit<Scenario, 'servers' | 'attachments'> {
210
- servers?: string[];
211
- attachments?: SourceScenarioAttachment[];
218
+ servers?: string[];
219
+ attachments?: SourceScenarioAttachment[];
212
220
  }
213
221
  export type ScenarioListEntry = SourceScenario | ScenarioRefEntry;
214
222
  export interface EvalConfig {
215
- name?: string;
216
- servers: Record<string, ServerConfig>;
217
- agents: Record<string, AgentConfig>;
218
- scenarios: Scenario[];
219
- run_defaults?: {
220
- selected_agents?: string[];
221
- };
223
+ name?: string;
224
+ description?: string;
225
+ servers: Record<string, ServerConfig>;
226
+ agents: Record<string, AgentConfig>;
227
+ scenarios: Scenario[];
228
+ run_defaults?: {
229
+ selected_agents?: string[];
230
+ };
222
231
  }
223
232
  export interface SourceEvalConfig extends Omit<EvalConfig, 'scenarios' | 'agents' | 'servers'> {
224
- servers?: ServerListEntry[];
225
- agents: AgentListEntry[];
226
- scenarios: ScenarioListEntry[];
233
+ servers?: ServerListEntry[];
234
+ agents: AgentListEntry[];
235
+ scenarios: ScenarioListEntry[];
227
236
  }
228
237
  export interface ExecutableScenario extends Scenario {
229
- agent: string;
230
- scenario_exec_id?: string;
238
+ agent: string;
239
+ scenario_exec_id?: string;
231
240
  }
232
241
  export interface ExecutableEvalConfig extends Omit<EvalConfig, 'scenarios'> {
233
- scenarios: ExecutableScenario[];
242
+ scenarios: ExecutableScenario[];
234
243
  }
235
244
  export interface ToolDef {
236
- name: string;
237
- title?: string;
238
- description?: string;
239
- inputSchema?: unknown;
240
- outputSchema?: unknown;
241
- annotations?: {
245
+ name: string;
242
246
  title?: string;
243
- readOnlyHint?: boolean;
244
- idempotentHint?: boolean;
245
- destructiveHint?: boolean;
246
- openWorldHint?: boolean;
247
- [key: string]: unknown;
248
- };
247
+ description?: string;
248
+ inputSchema?: unknown;
249
+ outputSchema?: unknown;
250
+ annotations?: {
251
+ title?: string;
252
+ readOnlyHint?: boolean;
253
+ idempotentHint?: boolean;
254
+ destructiveHint?: boolean;
255
+ openWorldHint?: boolean;
256
+ [key: string]: unknown;
257
+ };
249
258
  }
250
259
  export interface ToolCall {
251
- id?: string;
252
- name: string;
253
- arguments: Record<string, unknown> | unknown;
254
- server?: string;
260
+ id?: string;
261
+ name: string;
262
+ arguments: Record<string, unknown> | unknown;
263
+ server?: string;
255
264
  }
256
265
  export interface LlmMessage {
257
- role: 'system' | 'user' | 'assistant' | 'tool';
258
- content: string;
259
- attachments?: ScenarioAttachment[];
260
- tool_call_id?: string;
261
- name?: string;
262
- tool_calls?: ToolCall[];
266
+ role: 'system' | 'user' | 'assistant' | 'tool';
267
+ content: string;
268
+ attachments?: ScenarioAttachment[];
269
+ tool_call_id?: string;
270
+ name?: string;
271
+ tool_calls?: ToolCall[];
263
272
  }
264
273
  export interface LlmResponse {
265
- content?: string;
266
- tool_calls?: ToolCall[];
267
- raw?: unknown;
268
- usage?: {
274
+ content?: string;
275
+ tool_calls?: ToolCall[];
276
+ raw?: unknown;
277
+ usage?: {
278
+ input_tokens?: number;
279
+ output_tokens?: number;
280
+ total_tokens?: number;
281
+ };
282
+ }
283
+ export interface TraceMessageUsage {
269
284
  input_tokens?: number;
270
285
  output_tokens?: number;
271
286
  total_tokens?: number;
272
- };
273
- }
274
- export interface TraceMessageUsage {
275
- input_tokens?: number;
276
- output_tokens?: number;
277
- total_tokens?: number;
278
287
  }
279
288
  export interface EstimatedTokens {
280
- input: number;
281
- output: number;
282
- total: number;
283
- method: 'js_tiktoken_estimate' | 'js_tiktoken_fallback';
284
- }
285
- export type TraceMessageContentBlock =
286
- | {
287
- type: 'text';
288
- text: string;
289
- }
290
- | {
291
- type: 'image';
292
- media_type: string;
293
- data: string;
294
- name?: string;
295
- }
296
- | {
297
- type: 'document';
298
- media_type: string;
299
- data: string;
300
- name?: string;
301
- }
302
- | {
303
- type: 'tool_use';
304
- id: string;
305
- name: string;
306
- input: unknown;
307
- server: string;
308
- estimated_tokens?: EstimatedTokens;
309
- }
310
- | {
311
- type: 'tool_result';
312
- tool_use_id: string;
313
- name: string;
314
- content: Array<{
289
+ input: number;
290
+ output: number;
291
+ total: number;
292
+ method: 'js_tiktoken_estimate' | 'js_tiktoken_fallback';
293
+ }
294
+ export type TraceMessageContentBlock = {
295
+ type: 'text';
296
+ text: string;
297
+ } | {
298
+ type: 'image';
299
+ media_type: string;
300
+ data: string;
301
+ name?: string;
302
+ } | {
303
+ type: 'document';
304
+ media_type: string;
305
+ data: string;
306
+ name?: string;
307
+ } | {
308
+ type: 'tool_use';
309
+ id: string;
310
+ name: string;
311
+ input: unknown;
312
+ server: string;
313
+ estimated_tokens?: EstimatedTokens;
314
+ } | {
315
+ type: 'tool_result';
316
+ tool_use_id: string;
317
+ name: string;
318
+ content: Array<{
315
319
  type: 'text';
316
320
  text: string;
317
- }>;
318
- is_error: boolean;
319
- duration_ms?: number;
320
- ts_start?: string;
321
- ts_end?: string;
322
- server?: string;
323
- estimated_tokens?: EstimatedTokens;
324
- };
321
+ }>;
322
+ is_error: boolean;
323
+ duration_ms?: number;
324
+ ts_start?: string;
325
+ ts_end?: string;
326
+ server?: string;
327
+ estimated_tokens?: EstimatedTokens;
328
+ };
325
329
  export interface TraceMessage {
326
- role: 'user' | 'assistant' | 'tool';
327
- ts?: string;
328
- usage?: TraceMessageUsage;
329
- content: TraceMessageContentBlock[];
330
+ role: 'user' | 'assistant' | 'tool';
331
+ ts?: string;
332
+ usage?: TraceMessageUsage;
333
+ content: TraceMessageContentBlock[];
330
334
  }
331
335
  export interface ScenarioRunTraceRecord {
332
- type: 'scenario_run';
333
- trace_version: 3;
334
- run_index: number;
335
- request_id?: string;
336
- scenario_id: string;
337
- agent: string;
338
- provider: string;
339
- model: string;
340
- ts_start: string;
341
- ts_end: string;
342
- pass: boolean;
343
- error?: string;
344
- messages: TraceMessage[];
345
- metrics?: {
346
- tool_call_count: number;
347
- total_tool_duration_ms: number;
348
- };
336
+ type: 'scenario_run';
337
+ trace_version: 3;
338
+ run_index: number;
339
+ request_id?: string;
340
+ scenario_id: string;
341
+ agent: string;
342
+ provider: string;
343
+ model: string;
344
+ ts_start: string;
345
+ ts_end: string;
346
+ pass: boolean;
347
+ outcome?: RunOutcome;
348
+ error?: string;
349
+ messages: TraceMessage[];
350
+ metrics?: {
351
+ tool_call_count: number;
352
+ total_tool_duration_ms: number;
353
+ };
349
354
  }
355
+ export type RunOutcome = 'passed' | 'failed' | 'incomplete' | 'error' | 'stopped';
356
+ export type ExecutionSource = 'mcplab' | 'rover';
350
357
  export interface TraceFileLegacyMeta {
351
- type: 'trace_meta';
352
- trace_version: number;
353
- run_id: string;
354
- ts: string;
355
- }
356
- export type PersistedTraceRecord =
357
- | ScenarioRunTraceRecord
358
- | TraceFileLegacyMeta
359
- | Record<string, unknown>;
358
+ type: 'trace_meta';
359
+ trace_version: number;
360
+ run_id: string;
361
+ ts: string;
362
+ }
363
+ export type PersistedTraceRecord = ScenarioRunTraceRecord | TraceFileLegacyMeta | Record<string, unknown>;
360
364
  export interface ScenarioRunResult {
361
- run_index: number;
362
- request_id?: string;
363
- pass: boolean;
364
- error?: string;
365
- failures: string[];
366
- check_results?: CheckResult[];
367
- tool_calls: string[];
368
- tool_call_count: number;
369
- tool_sequence: string[];
370
- tool_usage: Record<string, number>;
371
- tool_durations_ms: number[];
372
- run_duration_ms?: number;
373
- final_text: string;
374
- extracted: Record<string, string | number | boolean | null>;
365
+ run_index: number;
366
+ request_id?: string;
367
+ pass: boolean;
368
+ outcome?: RunOutcome;
369
+ error?: string;
370
+ stop_reason?: string;
371
+ failures: string[];
372
+ check_results?: CheckResult[];
373
+ tool_calls: string[];
374
+ tool_call_count: number;
375
+ tool_sequence: string[];
376
+ tool_usage: Record<string, number>;
377
+ tool_durations_ms: number[];
378
+ run_duration_ms?: number;
379
+ final_text: string;
380
+ extracted: Record<string, string | number | boolean | null>;
375
381
  }
376
382
  export interface ScenarioAggregate {
377
- scenario_id: string;
378
- scenario_name?: string;
379
- agent: string;
380
- provider?: string;
381
- model?: string;
382
- eval?: EvalRules;
383
- tool_constraints_stats?: {
384
- required: Record<string, number>;
385
- forbidden: Record<string, number>;
386
- };
387
- runs: ScenarioRunResult[];
388
- pass_rate: number;
389
- distinct_sequences: Record<string, number>;
390
- tool_usage_frequency: Record<string, number>;
391
- extracted_values: Record<string, Record<string, number>>;
392
- last_final_answer: string;
393
- }
394
- export type HealthMcpConnectionInfo =
395
- | {
396
- enabled: false;
397
- }
398
- | {
399
- enabled: true;
400
- transport: 'streamable-http';
401
- host: string;
402
- port: number;
403
- path: string;
404
- proxyUrl: string;
405
- directUrl: string;
406
- serverPackageVersion: string;
407
- environment: {
383
+ scenario_id: string;
384
+ scenario_name?: string;
385
+ agent: string;
386
+ provider?: string;
387
+ model?: string;
388
+ eval?: EvalRules;
389
+ tool_constraints_stats?: {
390
+ required: Record<string, number>;
391
+ forbidden: Record<string, number>;
392
+ };
393
+ runs: ScenarioRunResult[];
394
+ pass_rate: number | null;
395
+ distinct_sequences: Record<string, number>;
396
+ tool_usage_frequency: Record<string, number>;
397
+ extracted_values: Record<string, Record<string, number>>;
398
+ last_final_answer: string;
399
+ }
400
+ export type HealthMcpConnectionInfo = {
401
+ enabled: false;
402
+ } | {
403
+ enabled: true;
404
+ transport: 'streamable-http';
405
+ host: string;
406
+ port: number;
407
+ path: string;
408
+ proxyUrl: string;
409
+ directUrl: string;
410
+ serverPackageVersion: string;
411
+ environment: {
408
412
  MCP_HOST: string;
409
413
  MCP_PORT: string;
410
414
  MCP_PATH: string;
411
- };
412
415
  };
416
+ };
413
417
  export interface ResultsJson {
414
- metadata: {
415
- run_id: string;
416
- timestamp: string;
417
- run_note?: string;
418
- git_commit?: string;
419
- config_hash: string;
420
- langsmith_trace_urls?: Record<string, string>;
421
- config_path?: string;
422
- config_name?: string;
423
- rerun_agents?: string[];
424
- rerun_scenario_ids?: string[];
425
- rerun_server_override_all?: string[];
426
- rerun_scenario_server_overrides?: Record<string, string[]>;
427
- tool_tokens_total?: number | null;
428
- total_duration_ms?: number;
429
- total_tool_duration_ms?: number;
430
- cli_version: string;
431
- mcp_server_versions: Record<string, string | null>;
432
- };
433
- summary: {
434
- total_scenarios: number;
435
- total_runs: number;
436
- pass_rate: number;
437
- avg_tool_calls_per_run: number;
438
- avg_tool_latency_ms: number | null;
439
- };
440
- scenarios: ScenarioAggregate[];
441
- }
442
- //# sourceMappingURL=types.d.ts.map
418
+ metadata: {
419
+ run_id: string;
420
+ timestamp: string;
421
+ run_note?: string;
422
+ git_commit?: string;
423
+ config_hash: string;
424
+ langsmith_trace_urls?: Record<string, string>;
425
+ config_path?: string;
426
+ config_name?: string;
427
+ rerun_agents?: string[];
428
+ rerun_scenario_ids?: string[];
429
+ rerun_server_override_all?: string[];
430
+ rerun_scenario_server_overrides?: Record<string, string[]>;
431
+ rerun_new_conversation_before_start?: boolean;
432
+ rerun_new_conversation_between_scenarios?: boolean;
433
+ tool_tokens_total?: number | null;
434
+ total_duration_ms?: number;
435
+ total_tool_duration_ms?: number;
436
+ cli_version: string;
437
+ mcp_server_versions: Record<string, string | null>;
438
+ execution_source?: ExecutionSource;
439
+ execution_client?: string;
440
+ /** @deprecated Read legacy results only. New evaluations use evaluation_run_id. */
441
+ evaluation_group_id?: string;
442
+ evaluation_run_id?: string;
443
+ /** @deprecated Read legacy parent-result projections only. */
444
+ child_run_ids?: string[];
445
+ execution_status?: 'stopped';
446
+ };
447
+ summary: {
448
+ total_scenarios: number;
449
+ total_runs: number;
450
+ pass_rate: number | null;
451
+ avg_tool_calls_per_run: number;
452
+ avg_tool_latency_ms: number | null;
453
+ outcomes?: Partial<Record<RunOutcome, number>>;
454
+ };
455
+ scenarios: ScenarioAggregate[];
456
+ }
457
+ //# sourceMappingURL=types.d.ts.map