@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
@@ -0,0 +1,198 @@
1
+ import { stringify as stringifyYaml } from 'yaml';
2
+ function record(value, label) {
3
+ if (!value || typeof value !== 'object' || Array.isArray(value))
4
+ throw new Error(`Invalid browser provider ${label}.`);
5
+ return value;
6
+ }
7
+ function stringValue(value, label) {
8
+ if (typeof value !== 'string' || !value.trim())
9
+ throw new Error(`Invalid browser provider ${label}.`);
10
+ return value.trim();
11
+ }
12
+ function locator(value, label) {
13
+ const source = record(value, label);
14
+ if (!Array.isArray(source.segments) ||
15
+ source.segments.length === 0 ||
16
+ source.segments.some((item) => typeof item !== 'string' || !item.trim())) {
17
+ throw new Error(`Invalid browser provider ${label} locator.`);
18
+ }
19
+ return { segments: source.segments.map((item) => String(item).trim()) };
20
+ }
21
+ function optionalLocator(value, label) {
22
+ return value === undefined ? undefined : locator(value, label);
23
+ }
24
+ function origin(value, label) {
25
+ const parsed = new URL(stringValue(value, label));
26
+ if (!['http:', 'https:'].includes(parsed.protocol) ||
27
+ parsed.username ||
28
+ parsed.password ||
29
+ parsed.pathname !== '/' ||
30
+ parsed.search ||
31
+ parsed.hash) {
32
+ throw new Error(`Invalid browser provider ${label} origin.`);
33
+ }
34
+ return parsed.origin;
35
+ }
36
+ export function validateBrowserProviderProfile(value) {
37
+ const source = record(value, 'profile');
38
+ if (source.source !== undefined && source.source !== 'builtin' && source.source !== 'workspace')
39
+ throw new Error('Invalid browser provider source.');
40
+ if (Object.prototype.hasOwnProperty.call(source, 'script') ||
41
+ Object.prototype.hasOwnProperty.call(source, 'scriptSource')) {
42
+ throw new Error('Executable browser provider profiles are not supported.');
43
+ }
44
+ if (source.schemaVersion !== 1)
45
+ throw new Error('Unsupported browser provider profile schema.');
46
+ const id = stringValue(source.id, 'id');
47
+ const name = stringValue(source.name, 'name');
48
+ const match = record(source.match, 'match');
49
+ if (!Array.isArray(match.origins) || match.origins.length === 0)
50
+ throw new Error('Browser provider match origins are required.');
51
+ const origins = match.origins.map((item) => origin(item, 'match'));
52
+ const composer = record(source.composer, 'composer');
53
+ const inputMode = composer.inputMode;
54
+ if (inputMode !== 'input' && inputMode !== 'textarea' && inputMode !== 'contenteditable')
55
+ throw new Error('Invalid browser provider composer input mode.');
56
+ const submit = record(source.submit, 'submit');
57
+ if (submit.action !== 'click' && submit.action !== 'enter')
58
+ throw new Error('Invalid browser provider submit action.');
59
+ if (submit.action === 'click' && !submit.locator)
60
+ throw new Error('Browser provider click submit locator is required.');
61
+ const assistant = record(source.assistantMessages, 'assistantMessages');
62
+ const completion = record(source.completion, 'completion');
63
+ if (typeof completion.stabilityMs !== 'number' ||
64
+ !Number.isFinite(completion.stabilityMs) ||
65
+ completion.stabilityMs < 250)
66
+ throw new Error('Invalid browser provider completion stability.');
67
+ const learned = record(source.learned, 'learned');
68
+ const confidence = record(learned.confidence ?? {}, 'confidence');
69
+ for (const value of Object.values(confidence))
70
+ if (value !== 'high' && value !== 'medium' && value !== 'low')
71
+ throw new Error('Invalid browser provider confidence.');
72
+ const result = {
73
+ schemaVersion: 1,
74
+ id,
75
+ name,
76
+ ...(source.source === 'builtin' || source.source === 'workspace'
77
+ ? { source: source.source }
78
+ : {}),
79
+ match: { origins },
80
+ composer: { locator: locator(composer.locator, 'composer'), inputMode },
81
+ submit: { action: submit.action, locator: optionalLocator(submit.locator, 'submit') },
82
+ assistantMessages: {
83
+ locator: locator(assistant.locator, 'assistantMessages'),
84
+ textLocator: optionalLocator(assistant.textLocator, 'assistantMessages text')
85
+ },
86
+ completion: {
87
+ generatingLocator: optionalLocator(completion.generatingLocator, 'generating'),
88
+ idleLocator: optionalLocator(completion.idleLocator, 'idle'),
89
+ workingLocator: optionalLocator(completion.workingLocator, 'working'),
90
+ stabilityMs: completion.stabilityMs
91
+ },
92
+ learned: {
93
+ sourceOrigin: origin(learned.sourceOrigin, 'source'),
94
+ createdAt: stringValue(learned.createdAt ?? new Date().toISOString(), 'createdAt'),
95
+ updatedAt: stringValue(learned.updatedAt ?? learned.createdAt ?? new Date().toISOString(), 'updatedAt'),
96
+ confidence: confidence
97
+ }
98
+ };
99
+ if (source.newConversation !== undefined) {
100
+ const newConversation = record(source.newConversation, 'newConversation');
101
+ if (newConversation.action !== 'click' && newConversation.action !== 'navigate')
102
+ throw new Error('Invalid browser provider new conversation action.');
103
+ if (newConversation.action === 'click' && !newConversation.locator)
104
+ throw new Error('Browser provider new conversation locator is required.');
105
+ if (newConversation.action === 'navigate') {
106
+ const navigationUrl = stringValue(newConversation.url, 'navigation URL');
107
+ let navigationOrigin;
108
+ try {
109
+ navigationOrigin = new URL(navigationUrl, origins[0]).origin;
110
+ }
111
+ catch {
112
+ throw new Error('Invalid browser provider navigation URL.');
113
+ }
114
+ if (!origins.includes(navigationOrigin))
115
+ throw new Error('Browser provider navigation URL must match a provider origin.');
116
+ }
117
+ if (newConversation.confirmation !== undefined &&
118
+ newConversation.confirmation !== 'context-change')
119
+ throw new Error('Invalid browser provider new conversation confirmation.');
120
+ if (newConversation.locators !== undefined &&
121
+ (!Array.isArray(newConversation.locators) ||
122
+ newConversation.locators.some((item) => !item || typeof item !== 'object')))
123
+ throw new Error('Invalid browser provider new conversation locators.');
124
+ result.newConversation = {
125
+ action: newConversation.action,
126
+ locator: optionalLocator(newConversation.locator, 'newConversation'),
127
+ locators: Array.isArray(newConversation.locators)
128
+ ? newConversation.locators.map((item) => locator(item, 'newConversation alternative'))
129
+ : undefined,
130
+ confirmation: newConversation.confirmation,
131
+ url: typeof newConversation.url === 'string' ? newConversation.url : undefined
132
+ };
133
+ }
134
+ return result;
135
+ }
136
+ export function parseBrowserProviderProfiles(value) {
137
+ const source = record(value ?? {}, 'profiles');
138
+ const profiles = {};
139
+ for (const [id, raw] of Object.entries(source)) {
140
+ const profile = record(raw, id);
141
+ const composer = record(profile.composer, `${id} composer`);
142
+ const submit = record(profile.submit, `${id} submit`);
143
+ const assistant = record(profile.assistant_messages, `${id} assistant_messages`);
144
+ const completion = record(profile.completion, `${id} completion`);
145
+ const learned = record(profile.learned ?? {}, `${id} learned`);
146
+ const normalized = validateBrowserProviderProfile({
147
+ ...profile,
148
+ id,
149
+ schemaVersion: profile.schema_version,
150
+ composer: { ...composer, inputMode: composer.input_mode },
151
+ submit,
152
+ assistantMessages: { locator: assistant.locator, textLocator: assistant.text_locator },
153
+ completion: {
154
+ generatingLocator: completion.generating_locator,
155
+ idleLocator: completion.idle_locator,
156
+ workingLocator: completion.working_locator,
157
+ stabilityMs: completion.stability_ms
158
+ },
159
+ newConversation: profile.new_conversation,
160
+ learned: {
161
+ sourceOrigin: learned.source_origin,
162
+ createdAt: learned.created_at,
163
+ updatedAt: learned.updated_at,
164
+ confidence: learned.confidence
165
+ }
166
+ });
167
+ profiles[id] = normalized;
168
+ }
169
+ return profiles;
170
+ }
171
+ export function serializeBrowserProviderProfile(profile) {
172
+ return `${stringifyYaml({
173
+ schema_version: profile.schemaVersion,
174
+ name: profile.name,
175
+ match: profile.match,
176
+ composer: {
177
+ locator: profile.composer.locator,
178
+ input_mode: profile.composer.inputMode
179
+ },
180
+ submit: profile.submit,
181
+ assistant_messages: {
182
+ locator: profile.assistantMessages.locator,
183
+ text_locator: profile.assistantMessages.textLocator
184
+ },
185
+ completion: {
186
+ generating_locator: profile.completion.generatingLocator,
187
+ idle_locator: profile.completion.idleLocator,
188
+ working_locator: profile.completion.workingLocator,
189
+ stability_ms: profile.completion.stabilityMs
190
+ },
191
+ new_conversation: profile.newConversation,
192
+ learned: {
193
+ source_origin: profile.learned.sourceOrigin,
194
+ confidence: profile.learned.confidence
195
+ }
196
+ })}\n`;
197
+ }
198
+ //# sourceMappingURL=browser-providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser-providers.js","sourceRoot":"","sources":["../src/browser-providers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,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AAU,EAAE,OAAO,CAAC,OAAO,CAAC,UAAU;SACvC;KACF,CAAC,IAAI,CAAC;AACT,CAAC"}
package/dist/browser.d.ts CHANGED
@@ -1,8 +1,4 @@
1
1
  export { tallyCheckCounts } from './check-counts.js';
2
- export {
3
- formatToolInputAssertionFailureReason,
4
- formatToolInputAssertionLabel,
5
- formatToolSequenceLabel,
6
- type ToolInputAssertionFailureKind
7
- } from './eval.js';
8
- //# sourceMappingURL=browser.d.ts.map
2
+ export { formatToolInputAssertionFailureReason, formatToolInputAssertionLabel, formatToolSequenceLabel, type ToolInputAssertionFailureKind } from './eval.js';
3
+ export { calculatePassRate } from './result-metrics.js';
4
+ //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,uBAAuB,EACvB,KAAK,6BAA6B,EACnC,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,uBAAuB,EACvB,KAAK,6BAA6B,EACnC,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
package/dist/browser.js CHANGED
@@ -1,3 +1,4 @@
1
1
  export { tallyCheckCounts } from './check-counts.js';
2
2
  export { formatToolInputAssertionFailureReason, formatToolInputAssertionLabel, formatToolSequenceLabel } from './eval.js';
3
+ export { calculatePassRate } from './result-metrics.js';
3
4
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,uBAAuB,EAExB,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../src/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,uBAAuB,EAExB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
@@ -1,7 +1,5 @@
1
1
  import type { CheckCounts } from './types.js';
2
- export declare function tallyCheckCounts(
3
- checks: Iterable<{
2
+ export declare function tallyCheckCounts(checks: Iterable<{
4
3
  status: string;
5
- }>
6
- ): CheckCounts;
7
- //# sourceMappingURL=check-counts.d.ts.map
4
+ }>): CheckCounts;
5
+ //# sourceMappingURL=check-counts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"check-counts.d.ts","sourceRoot":"","sources":["../src/check-counts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,WAAW,CAUlF"}
1
+ {"version":3,"file":"check-counts.d.ts","sourceRoot":"","sources":["../src/check-counts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,WAAW,CAmBlF"}
@@ -1,12 +1,21 @@
1
1
  export function tallyCheckCounts(checks) {
2
- const counts = { passed: 0, failed: 0, not_evaluated: 0, total: 0 };
2
+ const counts = {
3
+ passed: 0,
4
+ failed: 0,
5
+ not_evaluated: 0,
6
+ not_executed: 0,
7
+ total: 0
8
+ };
3
9
  for (const check of checks) {
4
10
  if (check.status === 'passed')
5
11
  counts.passed += 1;
6
12
  else if (check.status === 'failed')
7
13
  counts.failed += 1;
8
- else if (check.status === 'not_evaluated')
14
+ else if (check.status === 'not_evaluated' || check.status === 'not_applicable') {
9
15
  counts.not_evaluated += 1;
16
+ }
17
+ else if (check.status === 'not_executed')
18
+ counts.not_executed = (counts.not_executed ?? 0) + 1;
10
19
  else
11
20
  continue;
12
21
  counts.total += 1;
@@ -1 +1 @@
1
- {"version":3,"file":"check-counts.js","sourceRoot":"","sources":["../src/check-counts.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAAC,MAAoC;IACnE,MAAM,MAAM,GAAgB,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,aAAa,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IACjF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;aAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;aAClD,IAAI,KAAK,CAAC,MAAM,KAAK,eAAe;YAAE,MAAM,CAAC,aAAa,IAAI,CAAC,CAAC;;YAChE,SAAS;QACd,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
1
+ {"version":3,"file":"check-counts.js","sourceRoot":"","sources":["../src/check-counts.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAAC,MAAoC;IACnE,MAAM,MAAM,GAAgB;QAC1B,MAAM,EAAE,CAAC;QACT,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,CAAC;QAChB,YAAY,EAAE,CAAC;QACf,KAAK,EAAE,CAAC;KACT,CAAC;IACF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;aAC7C,IAAI,KAAK,CAAC,MAAM,KAAK,QAAQ;YAAE,MAAM,CAAC,MAAM,IAAI,CAAC,CAAC;aAClD,IAAI,KAAK,CAAC,MAAM,KAAK,eAAe,IAAI,KAAK,CAAC,MAAM,KAAK,gBAAgB,EAAE,CAAC;YAC/E,MAAM,CAAC,aAAa,IAAI,CAAC,CAAC;QAC5B,CAAC;aAAM,IAAI,KAAK,CAAC,MAAM,KAAK,cAAc;YACxC,MAAM,CAAC,YAAY,GAAG,CAAC,MAAM,CAAC,YAAY,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;;YAClD,SAAS;QACd,MAAM,CAAC,KAAK,IAAI,CAAC,CAAC;IACpB,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -4,4 +4,4 @@
4
4
  * references or treat plain strings as environment variable names.
5
5
  */
6
6
  export declare function resolveConfigValue(value: string, label: string): string;
7
- //# sourceMappingURL=config-values.d.ts.map
7
+ //# sourceMappingURL=config-values.d.ts.map
package/dist/config.d.ts CHANGED
@@ -1,45 +1,33 @@
1
1
  import type { EvalConfig, ExecutableEvalConfig, SourceEvalConfig } from './types.js';
2
- export declare function loadConfig(
3
- path: string,
4
- options?: {
2
+ export declare function loadConfig(path: string, options?: {
5
3
  bundleRoot?: string;
6
- }
7
- ): {
8
- config: EvalConfig;
9
- sourceConfig: SourceEvalConfig;
10
- hash: string;
11
- raw: string;
12
- bundleRoot: string;
13
- warnings: string[];
4
+ }): {
5
+ config: EvalConfig;
6
+ sourceConfig: SourceEvalConfig;
7
+ hash: string;
8
+ raw: string;
9
+ bundleRoot: string;
10
+ warnings: string[];
14
11
  };
15
- export declare function selectScenarios<
16
- T extends {
12
+ export declare function selectScenarios<T extends {
17
13
  scenarios: Array<{
18
- id: string;
14
+ id: string;
19
15
  }>;
20
- }
21
- >(config: T, scenarioId?: string): T;
16
+ }>(config: T, scenarioId?: string): T;
22
17
  export declare function readLibraryAgentsAndServers(bundleRoot: string): {
23
- servers: EvalConfig['servers'];
24
- agents: EvalConfig['agents'];
18
+ servers: EvalConfig['servers'];
19
+ agents: EvalConfig['agents'];
25
20
  };
26
21
  export declare function normalizeSourceConfig(sourceConfig: SourceEvalConfig): {
27
- config: SourceEvalConfig;
28
- warnings: string[];
22
+ config: SourceEvalConfig;
23
+ warnings: string[];
29
24
  };
30
- export declare function normalizeLibraryServers(
31
- raw: unknown
32
- ): Record<string, EvalConfig['servers'][string]>;
33
- export declare function normalizeLibraryAgents(
34
- raw: unknown
35
- ): Record<string, EvalConfig['agents'][string]>;
25
+ export declare function normalizeLibraryServers(raw: unknown): Record<string, EvalConfig['servers'][string]>;
26
+ export declare function normalizeLibraryAgents(raw: unknown): Record<string, EvalConfig['agents'][string]>;
36
27
  export declare function resolveScenarioLibraryDir(bundleRoot: string): {
37
- path: string;
38
- usedLegacy: boolean;
28
+ path: string;
29
+ usedLegacy: boolean;
39
30
  };
40
31
  export declare function hashConfig(config: EvalConfig): string;
41
- export declare function expandConfigForAgents(
42
- config: EvalConfig,
43
- requestedAgents?: string[]
44
- ): ExecutableEvalConfig;
45
- //# sourceMappingURL=config.d.ts.map
32
+ export declare function expandConfigForAgents(config: EvalConfig, requestedAgents?: string[]): ExecutableEvalConfig;
33
+ //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAIV,UAAU,EACV,oBAAoB,EAUpB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAuDpB,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EA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,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAyBjG;AAgBD,wBAAgB,yBAAyB,CAAC,UAAU,EAAE,MAAM,GAAG;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACrB,CAOA;AAoBD,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAErD;AAgBD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,UAAU,EAClB,eAAe,CAAC,EAAE,MAAM,EAAE,GACzB,oBAAoB,CAuBtB"}
package/dist/config.js CHANGED
@@ -155,13 +155,7 @@ function resolveReferences(sourceConfig, configPath, bundleRootOverride) {
155
155
  throw new Error(`Duplicate agent id detected: ${resolvedId}`);
156
156
  }
157
157
  seenAgentNames.add(resolvedId);
158
- resolvedAgents[resolvedId] = {
159
- provider: entry.provider,
160
- model: entry.model,
161
- temperature: entry.temperature,
162
- max_tokens: entry.max_tokens,
163
- system: entry.system
164
- };
158
+ resolvedAgents[resolvedId] = normalizeAgentDefinition(entry, resolvedId);
165
159
  }
166
160
  const resolvedScenarios = [];
167
161
  const seenScenarioIds = new Set();
@@ -400,12 +394,7 @@ export function normalizeSourceConfig(sourceConfig) {
400
394
  }
401
395
  normalizedAgents.push({
402
396
  id: resolvedId,
403
- name: legacyName || undefined,
404
- provider: agent.provider,
405
- model: agent.model,
406
- temperature: agent.temperature,
407
- max_tokens: agent.max_tokens,
408
- system: agent.system
397
+ ...normalizeAgentDefinition(agent, resolvedId)
409
398
  });
410
399
  }
411
400
  }
@@ -416,14 +405,7 @@ export function normalizeSourceConfig(sourceConfig) {
416
405
  for (const [name, agent] of Object.entries(legacyInlineAgents)) {
417
406
  normalizedAgents.push({
418
407
  id: name,
419
- name: typeof agent.name === 'string'
420
- ? String(agent.name)
421
- : undefined,
422
- provider: agent.provider,
423
- model: agent.model,
424
- temperature: agent.temperature,
425
- max_tokens: agent.max_tokens,
426
- system: agent.system
408
+ ...normalizeAgentDefinition(agent, name)
427
409
  });
428
410
  }
429
411
  if (Object.keys(legacyInlineAgents).length > 0) {
@@ -480,6 +462,9 @@ export function normalizeSourceConfig(sourceConfig) {
480
462
  name: typeof sourceConfig.name === 'string'
481
463
  ? String(sourceConfig.name).trim() || undefined
482
464
  : undefined,
465
+ description: typeof sourceConfig.description === 'string'
466
+ ? String(sourceConfig.description).trim() || undefined
467
+ : undefined,
483
468
  servers: normalizedServers,
484
469
  agents: normalizedAgents,
485
470
  scenarios: normalizedScenarios
@@ -565,6 +550,41 @@ export function normalizeLibraryServers(raw) {
565
550
  }
566
551
  return out;
567
552
  }
553
+ function normalizeAgentDefinition(raw, id) {
554
+ if (raw.type === 'browser') {
555
+ const betweenScenarios = raw.new_conversation_between_scenarios ?? raw.newConversationBetweenScenarios;
556
+ if (!raw.url)
557
+ throw new Error(`Browser agent ${id} requires a url`);
558
+ if (typeof raw.provider !== 'string' || !raw.provider.trim()) {
559
+ throw new Error(`Browser agent ${id} requires a provider`);
560
+ }
561
+ return {
562
+ type: 'browser',
563
+ name: typeof raw.name === 'string' ? raw.name : undefined,
564
+ provider: raw.provider,
565
+ url: String(raw.url),
566
+ ...(typeof betweenScenarios === 'boolean'
567
+ ? { newConversationBetweenScenarios: betweenScenarios }
568
+ : {})
569
+ };
570
+ }
571
+ if (!raw.provider || !raw.model)
572
+ throw new Error(`LLM agent ${id} requires a provider and model`);
573
+ if (raw.provider !== 'openai' &&
574
+ raw.provider !== 'anthropic' &&
575
+ raw.provider !== 'azure_openai') {
576
+ throw new Error(`LLM agent ${id} has unsupported provider: ${String(raw.provider)}`);
577
+ }
578
+ return {
579
+ name: typeof raw.name === 'string' ? raw.name : undefined,
580
+ provider: raw.provider,
581
+ model: String(raw.model),
582
+ ...(typeof raw.temperature === 'number' ? { temperature: raw.temperature } : {}),
583
+ ...(typeof raw.max_tokens === 'number' ? { max_tokens: raw.max_tokens } : {}),
584
+ ...(typeof raw.max_turns === 'number' ? { max_turns: raw.max_turns } : {}),
585
+ ...(typeof raw.system === 'string' ? { system: raw.system } : {})
586
+ };
587
+ }
568
588
  export function normalizeLibraryAgents(raw) {
569
589
  const out = {};
570
590
  if (Array.isArray(raw)) {
@@ -573,17 +593,11 @@ export function normalizeLibraryAgents(raw) {
573
593
  continue;
574
594
  const agent = entry;
575
595
  const id = String(agent.id ?? agent.name ?? '').trim();
576
- if (!id || !agent.provider || !agent.model)
596
+ if (!id)
577
597
  continue;
578
- out[id] = {
579
- name: typeof agent.name === 'string' ? agent.name : undefined,
580
- provider: agent.provider,
581
- model: agent.model,
582
- temperature: agent.temperature,
583
- max_tokens: agent.max_tokens,
584
- max_turns: agent.max_turns,
585
- system: agent.system
586
- };
598
+ if (agent.type === 'browser' || (agent.provider && agent.model)) {
599
+ out[id] = normalizeAgentDefinition(agent, id);
600
+ }
587
601
  }
588
602
  return out;
589
603
  }
@@ -593,17 +607,12 @@ export function normalizeLibraryAgents(raw) {
593
607
  if (!value || typeof value !== 'object')
594
608
  continue;
595
609
  const agent = value;
596
- if (!agent.provider || !agent.model)
597
- continue;
598
- out[id] = {
599
- name: typeof agent.name === 'string' ? agent.name : undefined,
600
- provider: agent.provider,
601
- model: agent.model,
602
- temperature: agent.temperature,
603
- max_tokens: agent.max_tokens,
604
- max_turns: agent.max_turns,
605
- system: agent.system
606
- };
610
+ if (agent.type === 'browser') {
611
+ out[id] = normalizeAgentDefinition(agent, id);
612
+ }
613
+ else if (agent.provider && agent.model) {
614
+ out[id] = normalizeAgentDefinition(agent, id);
615
+ }
607
616
  }
608
617
  return out;
609
618
  }