@inspectr/mcplab-core 1.22.2 → 1.24.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/abort.d.ts +6 -1
- package/dist/abort.d.ts.map +1 -1
- package/dist/abort.js +9 -0
- package/dist/abort.js.map +1 -1
- package/dist/agent-connection.d.ts +4 -0
- package/dist/agent-connection.d.ts.map +1 -0
- package/dist/agent-connection.js +99 -0
- package/dist/agent-connection.js.map +1 -0
- package/dist/agent-errors.d.ts +6 -0
- package/dist/agent-errors.d.ts.map +1 -0
- package/dist/agent-errors.js +9 -0
- package/dist/agent-errors.js.map +1 -0
- package/dist/agent.d.ts +72 -87
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +32 -13
- package/dist/agent.js.map +1 -1
- package/dist/artifacts.d.ts +9 -0
- package/dist/artifacts.d.ts.map +1 -0
- package/dist/artifacts.js +22 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/assistant-tools.d.ts +1 -1
- package/dist/attachments.d.ts +4 -9
- package/dist/azure-config.d.ts +9 -0
- package/dist/azure-config.d.ts.map +1 -0
- package/dist/azure-config.js +47 -0
- package/dist/azure-config.js.map +1 -0
- package/dist/browser-provider-store.d.ts +5 -0
- package/dist/browser-provider-store.d.ts.map +1 -0
- package/dist/browser-provider-store.js +42 -0
- package/dist/browser-provider-store.js.map +1 -0
- package/dist/browser-providers.d.ts +48 -0
- package/dist/browser-providers.d.ts.map +1 -0
- package/dist/browser-providers.js +198 -0
- package/dist/browser-providers.js.map +1 -0
- package/dist/browser.d.ts +5 -7
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +2 -0
- package/dist/browser.js.map +1 -1
- package/dist/check-counts.d.ts +3 -5
- package/dist/check-counts.d.ts.map +1 -1
- package/dist/check-counts.js +11 -2
- package/dist/check-counts.js.map +1 -1
- package/dist/config-values.d.ts +1 -1
- package/dist/config.d.ts +21 -33
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +52 -42
- package/dist/config.js.map +1 -1
- package/dist/decision-config.d.ts +52 -0
- package/dist/decision-config.d.ts.map +1 -0
- package/dist/decision-config.js +112 -0
- package/dist/decision-config.js.map +1 -0
- package/dist/decisions.d.ts +8 -0
- package/dist/decisions.d.ts.map +1 -0
- package/dist/decisions.js +344 -0
- package/dist/decisions.js.map +1 -0
- package/dist/default-browser-providers.d.ts +13 -0
- package/dist/default-browser-providers.d.ts.map +1 -0
- package/dist/default-browser-providers.js +99 -0
- package/dist/default-browser-providers.js.map +1 -0
- package/dist/environment.d.ts +3 -0
- package/dist/environment.d.ts.map +1 -0
- package/dist/environment.js +10 -0
- package/dist/environment.js.map +1 -0
- package/dist/eval.d.ts +20 -55
- package/dist/eval.d.ts.map +1 -1
- package/dist/eval.js +46 -15
- package/dist/eval.js.map +1 -1
- package/dist/evaluation-config-store.d.ts +20 -17
- package/dist/evaluation-settings.d.ts +4 -0
- package/dist/evaluation-settings.d.ts.map +1 -0
- package/dist/evaluation-settings.js +5 -0
- package/dist/evaluation-settings.js.map +1 -0
- package/dist/index.d.ts +23 -50
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/dist/judge.d.ts +21 -0
- package/dist/judge.d.ts.map +1 -0
- package/dist/judge.js +156 -0
- package/dist/judge.js.map +1 -0
- package/dist/langsmith-tracing.d.ts +32 -21
- package/dist/langsmith-tracing.js.map +1 -1
- package/dist/mcp.d.ts +63 -79
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js.map +1 -1
- package/dist/queue-contract.d.ts +93 -27
- package/dist/queue-contract.d.ts.map +1 -1
- package/dist/queue-contract.js +31 -1
- package/dist/queue-contract.js.map +1 -1
- package/dist/result-metrics.d.ts +3 -0
- package/dist/result-metrics.d.ts.map +1 -0
- package/dist/result-metrics.js +6 -0
- package/dist/result-metrics.js.map +1 -0
- package/dist/results-query.d.ts +51 -60
- package/dist/results-query.d.ts.map +1 -1
- package/dist/results-query.js +23 -47
- package/dist/results-query.js.map +1 -1
- package/dist/results.d.ts +20 -18
- package/dist/results.d.ts.map +1 -1
- package/dist/results.js +26 -7
- package/dist/results.js.map +1 -1
- package/dist/run-directory-snapshots.d.ts +12 -0
- package/dist/run-directory-snapshots.d.ts.map +1 -0
- package/dist/run-directory-snapshots.js +56 -0
- package/dist/run-directory-snapshots.js.map +1 -0
- package/dist/runner.d.ts +77 -128
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +117 -220
- package/dist/runner.js.map +1 -1
- package/dist/runtime-overrides.d.ts +4 -7
- package/dist/scenario-builder.d.ts +15 -15
- package/dist/scenario-observation.d.ts +22 -0
- package/dist/scenario-observation.d.ts.map +1 -0
- package/dist/scenario-observation.js +70 -0
- package/dist/scenario-observation.js.map +1 -0
- package/dist/test-case-store.d.ts +26 -26
- package/dist/tool-definition-token-estimates.d.ts +13 -16
- package/dist/trace-token-estimates.d.ts +5 -11
- package/dist/trace.d.ts +4 -4
- package/dist/trace.d.ts.map +1 -1
- package/dist/trace.js.map +1 -1
- package/dist/types.d.ts +162 -7
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +3 -1
- package/dist/types.js.map +1 -1
- package/dist/workspace-settings.d.ts +11 -0
- package/dist/workspace-settings.d.ts.map +1 -0
- package/dist/workspace-settings.js +60 -0
- package/dist/workspace-settings.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { mkdirSync, renameSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { stringify as stringifyYaml } from 'yaml';
|
|
4
|
+
import { renderSummaryMarkdown } from './results.js';
|
|
5
|
+
export function persistEvaluationArtifacts({ runDir, results, resolvedConfig, traceRecords }) {
|
|
6
|
+
mkdirSync(runDir, { recursive: true });
|
|
7
|
+
writeAtomic(join(runDir, 'results.json'), `${JSON.stringify(results, null, 2)}\n`);
|
|
8
|
+
writeAtomic(join(runDir, 'summary.md'), renderSummaryMarkdown(results));
|
|
9
|
+
if (resolvedConfig !== undefined) {
|
|
10
|
+
writeAtomic(join(runDir, 'resolved-config.yaml'), `${stringifyYaml(resolvedConfig)}\n`);
|
|
11
|
+
}
|
|
12
|
+
if (traceRecords !== undefined) {
|
|
13
|
+
writeAtomic(join(runDir, 'trace.jsonl'), traceRecords.map((record) => JSON.stringify(record)).join('\n') +
|
|
14
|
+
(traceRecords.length ? '\n' : ''));
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
function writeAtomic(path, content) {
|
|
18
|
+
const temporaryPath = `${path}.tmp-${process.pid}-${Date.now()}`;
|
|
19
|
+
writeFileSync(temporaryPath, content, 'utf8');
|
|
20
|
+
renameSync(temporaryPath, path);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=artifacts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../src/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAElD,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AASrD,MAAM,UAAU,0BAA0B,CAAC,EACzC,MAAM,EACN,OAAO,EACP,cAAc,EACd,YAAY,EACqB;IACjC,SAAS,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACvC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACnF,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC;IACxE,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;QACjC,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAAE,GAAG,aAAa,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IAC1F,CAAC;IACD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,WAAW,CACT,IAAI,CAAC,MAAM,EAAE,aAAa,CAAC,EAC3B,YAAY,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;YAC7D,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CACpC,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe;IAChD,MAAM,aAAa,GAAG,GAAG,IAAI,QAAQ,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;IACjE,aAAa,CAAC,aAAa,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC9C,UAAU,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare function formatAssistantToolName(name: string | null | undefined): string;
|
|
2
|
-
//# sourceMappingURL=assistant-tools.d.ts.map
|
|
2
|
+
//# sourceMappingURL=assistant-tools.d.ts.map
|
package/dist/attachments.d.ts
CHANGED
|
@@ -5,15 +5,10 @@ export declare const SUPPORTED_ATTACHMENT_DOCUMENT_MEDIA_TYPES: string[];
|
|
|
5
5
|
export declare function attachmentTypeFromMediaType(mediaType: string): 'image' | 'document';
|
|
6
6
|
export declare function attachmentExtensionFromPath(path?: string): string;
|
|
7
7
|
export declare function inferAttachmentMediaType(att: SourceScenarioAttachment): string | undefined;
|
|
8
|
-
export declare function supportsUrlOnlyAttachment(
|
|
9
|
-
|
|
10
|
-
): boolean;
|
|
11
|
-
export declare function validateRuntimeAttachmentContract(
|
|
12
|
-
att: Pick<ScenarioAttachment, 'type' | 'media_type'> & {
|
|
8
|
+
export declare function supportsUrlOnlyAttachment(att: Pick<ScenarioAttachment, 'type' | 'media_type'>): boolean;
|
|
9
|
+
export declare function validateRuntimeAttachmentContract(att: Pick<ScenarioAttachment, 'type' | 'media_type'> & {
|
|
13
10
|
url?: string;
|
|
14
11
|
data?: string;
|
|
15
|
-
|
|
16
|
-
context: string
|
|
17
|
-
): void;
|
|
12
|
+
}, context: string): void;
|
|
18
13
|
export declare function isSupportedAttachmentMediaType(mediaType: string): boolean;
|
|
19
|
-
//# sourceMappingURL=attachments.d.ts.map
|
|
14
|
+
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare const AZURE_FOUNDRY_API_KEY_ENVS: readonly ['AZURE_FOUNDRY_API_KEY', 'AZURE_OPENAI_API_KEY'];
|
|
2
|
+
export declare function parseDeploymentSuggestions(values: Array<string | undefined>): string[];
|
|
3
|
+
export declare function getAzureOpenAIDeploymentSuggestions(): string[];
|
|
4
|
+
export declare function resolveAzureOpenAIDeployment(agentModel: string): string | undefined;
|
|
5
|
+
export declare function resolveAzureFoundryConnection(): {
|
|
6
|
+
endpoint: string;
|
|
7
|
+
apiKey: string;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=azure-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-config.d.ts","sourceRoot":"","sources":["../src/azure-config.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,0BAA0B,YACrC,uBAAuB,EACvB,sBAAsB,CACd,CAAC;AAEX,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,MAAM,EAAE,CAMtF;AAED,wBAAgB,mCAAmC,IAAI,MAAM,EAAE,CAM9D;AAED,wBAAgB,4BAA4B,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAMnF;AAED,wBAAgB,6BAA6B,IAAI;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CA2BpF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AgentConnectionError } from './agent-errors.js';
|
|
2
|
+
import { readEnvironmentVariable } from './environment.js';
|
|
3
|
+
export const AZURE_FOUNDRY_API_KEY_ENVS = [
|
|
4
|
+
'AZURE_FOUNDRY_API_KEY',
|
|
5
|
+
'AZURE_OPENAI_API_KEY'
|
|
6
|
+
];
|
|
7
|
+
export function parseDeploymentSuggestions(values) {
|
|
8
|
+
return [
|
|
9
|
+
...new Set(values.flatMap((value) => (value ?? '').split(',').map((item) => item.trim())))
|
|
10
|
+
]
|
|
11
|
+
.filter(Boolean)
|
|
12
|
+
.sort((a, b) => a.localeCompare(b));
|
|
13
|
+
}
|
|
14
|
+
export function getAzureOpenAIDeploymentSuggestions() {
|
|
15
|
+
return parseDeploymentSuggestions([
|
|
16
|
+
process.env.AZURE_OPENAI_DEPLOYMENTS,
|
|
17
|
+
process.env.AZURE_OPENAI_DEPLOYMENT,
|
|
18
|
+
process.env.AZURE_OPENAI_DEPLOYMENT_NAME
|
|
19
|
+
]);
|
|
20
|
+
}
|
|
21
|
+
export function resolveAzureOpenAIDeployment(agentModel) {
|
|
22
|
+
const selectedDeployment = agentModel.trim();
|
|
23
|
+
if (selectedDeployment && getAzureOpenAIDeploymentSuggestions().includes(selectedDeployment)) {
|
|
24
|
+
return selectedDeployment;
|
|
25
|
+
}
|
|
26
|
+
return readEnvironmentVariable('AZURE_OPENAI_DEPLOYMENT');
|
|
27
|
+
}
|
|
28
|
+
export function resolveAzureFoundryConnection() {
|
|
29
|
+
const endpoint = readEnvironmentVariable('AZURE_FOUNDRY_ENDPOINT');
|
|
30
|
+
if (!endpoint)
|
|
31
|
+
throw new AgentConnectionError('missing_credentials', 'Missing AZURE_FOUNDRY_ENDPOINT. Set the Foundry resource endpoint.');
|
|
32
|
+
const apiKey = readEnvironmentVariable(AZURE_FOUNDRY_API_KEY_ENVS);
|
|
33
|
+
if (!apiKey)
|
|
34
|
+
throw new AgentConnectionError('missing_credentials', 'Missing AZURE_FOUNDRY_API_KEY or AZURE_OPENAI_API_KEY. Set a key for the Foundry resource.');
|
|
35
|
+
const url = new URL(endpoint);
|
|
36
|
+
if (!['https:', 'http:'].includes(url.protocol) ||
|
|
37
|
+
url.username ||
|
|
38
|
+
url.password ||
|
|
39
|
+
url.search ||
|
|
40
|
+
url.hash) {
|
|
41
|
+
throw new Error('AZURE_FOUNDRY_ENDPOINT must be an HTTP or HTTPS resource endpoint without credentials, query, or fragment.');
|
|
42
|
+
}
|
|
43
|
+
if (url.pathname.replace(/\/+$/, '') === '/models')
|
|
44
|
+
url.pathname = '/';
|
|
45
|
+
return { endpoint: url.toString().replace(/\/+$/, ''), apiKey };
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=azure-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"azure-config.js","sourceRoot":"","sources":["../src/azure-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,MAAM,CAAC,MAAM,0BAA0B,GAAG;IACxC,uBAAuB;IACvB,sBAAsB;CACd,CAAC;AAEX,MAAM,UAAU,0BAA0B,CAAC,MAAiC;IAC1E,OAAO;QACL,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,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AAC;QACD,MAAM,IAAI,KAAK,CACb,4GAA4G,CAC7G,CAAC;IACJ,CAAC;IACD,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,SAAS;QAAE,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC;IACvE,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type BrowserProviderProfile } from './browser-providers.js';
|
|
2
|
+
export declare function readBrowserProviderProfiles(bundleRoot: string, options?: {
|
|
3
|
+
strict?: boolean;
|
|
4
|
+
}): Record<string, BrowserProviderProfile>;
|
|
5
|
+
//# sourceMappingURL=browser-provider-store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-provider-store.d.ts","sourceRoot":"","sources":["../src/browser-provider-store.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgC,KAAK,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAEnG,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,OAAO,CAAA;CAAO,GACjC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAqCxC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
2
|
+
import { basename, extname, join } from 'node:path';
|
|
3
|
+
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
import { parseBrowserProviderProfiles } from './browser-providers.js';
|
|
5
|
+
export function readBrowserProviderProfiles(bundleRoot, options = {}) {
|
|
6
|
+
const directory = join(bundleRoot, 'browser-providers');
|
|
7
|
+
if (!existsSync(directory))
|
|
8
|
+
return {};
|
|
9
|
+
const profiles = {};
|
|
10
|
+
const files = readdirSync(directory)
|
|
11
|
+
.filter((name) => name.endsWith('.yaml') || name.endsWith('.yml'))
|
|
12
|
+
.sort((a, b) => a.localeCompare(b));
|
|
13
|
+
for (const file of files) {
|
|
14
|
+
const id = basename(file, extname(file));
|
|
15
|
+
const path = join(directory, file);
|
|
16
|
+
const raw = readFileSync(path, 'utf8');
|
|
17
|
+
let profile;
|
|
18
|
+
try {
|
|
19
|
+
profile = parseBrowserProviderProfiles({ [id]: parseYaml(raw) })[id];
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
if (options.strict) {
|
|
23
|
+
throw new Error(`Invalid browser provider file ${path}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
|
|
24
|
+
}
|
|
25
|
+
// One malformed YAML or invalid profile must not hide the rest of the library.
|
|
26
|
+
// Filesystem errors remain outside this catch so callers can report them.
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const stats = statSync(path);
|
|
30
|
+
profiles[id] = {
|
|
31
|
+
...profile,
|
|
32
|
+
source: 'workspace',
|
|
33
|
+
learned: {
|
|
34
|
+
...profile.learned,
|
|
35
|
+
createdAt: new Date(stats.birthtimeMs || stats.ctimeMs).toISOString(),
|
|
36
|
+
updatedAt: new Date(stats.mtimeMs).toISOString()
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return profiles;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=browser-provider-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-provider-store.js","sourceRoot":"","sources":["../src/browser-provider-store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MA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,MAAM,CAAC,KAAK,CAAC,EAAE,EAClG,EAAE,KAAK,EAAE,KAAK,EAAE,CACjB,CAAC;YACJ,CAAC;YACD,+EAA+E;YAC/E,0EAA0E;YAC1E,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC7B,QAAQ,CAAC,EAAE,CAAC,GAAG;YACb,GAAG,OAAO;YACV,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE;gBACP,GAAG,OAAO,CAAC,OAAO;gBAClB,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE;gBACrE,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE;aACjD;SACF,CAAC;IACJ,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type BrowserProviderConfidence = 'high' | 'medium' | 'low';
|
|
2
|
+
export interface ShadowLocator {
|
|
3
|
+
segments: string[];
|
|
4
|
+
}
|
|
5
|
+
export interface BrowserProviderProfile {
|
|
6
|
+
schemaVersion: 1;
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
source?: 'builtin' | 'workspace';
|
|
10
|
+
match: {
|
|
11
|
+
origins: string[];
|
|
12
|
+
};
|
|
13
|
+
composer: {
|
|
14
|
+
locator: ShadowLocator;
|
|
15
|
+
inputMode: 'input' | 'textarea' | 'contenteditable';
|
|
16
|
+
};
|
|
17
|
+
submit: {
|
|
18
|
+
action: 'click' | 'enter';
|
|
19
|
+
locator?: ShadowLocator;
|
|
20
|
+
};
|
|
21
|
+
assistantMessages: {
|
|
22
|
+
locator: ShadowLocator;
|
|
23
|
+
textLocator?: ShadowLocator;
|
|
24
|
+
};
|
|
25
|
+
completion: {
|
|
26
|
+
generatingLocator?: ShadowLocator;
|
|
27
|
+
idleLocator?: ShadowLocator;
|
|
28
|
+
workingLocator?: ShadowLocator;
|
|
29
|
+
stabilityMs: number;
|
|
30
|
+
};
|
|
31
|
+
newConversation?: {
|
|
32
|
+
action: 'click' | 'navigate';
|
|
33
|
+
locator?: ShadowLocator;
|
|
34
|
+
locators?: ShadowLocator[];
|
|
35
|
+
url?: string;
|
|
36
|
+
confirmation?: 'context-change';
|
|
37
|
+
};
|
|
38
|
+
learned: {
|
|
39
|
+
sourceOrigin: string;
|
|
40
|
+
createdAt: string;
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
confidence: Record<string, BrowserProviderConfidence>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export declare function validateBrowserProviderProfile(value: unknown): BrowserProviderProfile;
|
|
46
|
+
export declare function parseBrowserProviderProfiles(value: unknown): Record<string, BrowserProviderProfile>;
|
|
47
|
+
export declare function serializeBrowserProviderProfile(profile: BrowserProviderProfile): string;
|
|
48
|
+
//# sourceMappingURL=browser-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-providers.d.ts","sourceRoot":"","sources":["../src/browser-providers.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,yBAAyB,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;AAElE,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,CAAC,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IACjC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC7B,QAAQ,EAAE;QACR,OAAO,EAAE,aAAa,CAAC;QACvB,SAAS,EAAE,OAAO,GAAG,UAAU,GAAG,iBAAiB,CAAC;KACrD,CAAC;IACF,MAAM,EAAE;QACN,MAAM,EAAE,OAAO,GAAG,OAAO,CAAC;QAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;KACzB,CAAC;IACF,iBAAiB,EAAE;QACjB,OAAO,EAAE,aAAa,CAAC;QACvB,WAAW,CAAC,EAAE,aAAa,CAAC;KAC7B,CAAC;IACF,UAAU,EAAE;QACV,iBAAiB,CAAC,EAAE,aAAa,CAAC;QAClC,WAAW,CAAC,EAAE,aAAa,CAAC;QAC5B,cAAc,CAAC,EAAE,aAAa,CAAC;QAC/B,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,eAAe,CAAC,EAAE;QAChB,MAAM,EAAE,OAAO,GAAG,UAAU,CAAC;QAC7B,OAAO,CAAC,EAAE,aAAa,CAAC;QACxB,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;QAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,YAAY,CAAC,EAAE,gBAAgB,CAAC;KACjC,CAAC;IACF,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,yBAAyB,CAAC,CAAC;KACvD,CAAC;CACH;AA+CD,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,sBAAsB,CA4GrF;AAED,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,OAAO,GACb,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,CAkCxC;AAED,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,sBAAsB,GAAG,MAAM,CA0BvF"}
|
|
@@ -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,SAAS,IAAI,aAAa,EAAE,MAAM,MAAM,CAAC;AAiDlD,SAAS,MAAM,CAAC,KAAc,EAAE,KAAa;IAC3C,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,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yCheckCounts } from './check-counts.js';
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from './eval.js';
|
|
8
|
-
//# sourceMappingURL=browser.d.ts.map
|
|
2
|
+
export { normalizeEvaluationDecisionConfig, isDecisionEngineEnabled, DECISION_PROVIDERS, DECISION_DEFAULTS } from './decision-config.js';
|
|
3
|
+
export type { EvaluationDecisionConfig, WorkspaceSettingsPatch } from './types.js';
|
|
4
|
+
export { formatToolInputAssertionFailureReason, formatToolInputAssertionLabel, formatToolSequenceLabel, type ToolInputAssertionFailureKind } from './eval.js';
|
|
5
|
+
export { calculatePassRate } from './result-metrics.js';
|
|
6
|
+
//# sourceMappingURL=browser.d.ts.map
|
package/dist/browser.d.ts.map
CHANGED
|
@@ -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,iCAAiC,EACjC,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AACnF,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,5 @@
|
|
|
1
1
|
export { tallyCheckCounts } from './check-counts.js';
|
|
2
|
+
export { normalizeEvaluationDecisionConfig, isDecisionEngineEnabled, DECISION_PROVIDERS, DECISION_DEFAULTS } from './decision-config.js';
|
|
2
3
|
export { formatToolInputAssertionFailureReason, formatToolInputAssertionLabel, formatToolSequenceLabel } from './eval.js';
|
|
4
|
+
export { calculatePassRate } from './result-metrics.js';
|
|
3
5
|
//# sourceMappingURL=browser.js.map
|
package/dist/browser.js.map
CHANGED
|
@@ -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,iCAAiC,EACjC,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,qCAAqC,EACrC,6BAA6B,EAC7B,uBAAuB,EAExB,MAAM,WAAW,CAAC;AAEnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC"}
|
package/dist/check-counts.d.ts
CHANGED
|
@@ -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
|
-
|
|
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,
|
|
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"}
|
package/dist/check-counts.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
export function tallyCheckCounts(checks) {
|
|
2
|
-
const counts = {
|
|
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;
|
package/dist/check-counts.js.map
CHANGED
|
@@ -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,
|
|
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"}
|
package/dist/config-values.d.ts
CHANGED
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
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
|
-
|
|
24
|
-
|
|
18
|
+
servers: EvalConfig['servers'];
|
|
19
|
+
agents: EvalConfig['agents'];
|
|
25
20
|
};
|
|
26
21
|
export declare function normalizeSourceConfig(sourceConfig: SourceEvalConfig): {
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
config: SourceEvalConfig;
|
|
23
|
+
warnings: string[];
|
|
29
24
|
};
|
|
30
|
-
export declare function normalizeLibraryServers(
|
|
31
|
-
|
|
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
|
-
|
|
38
|
-
|
|
28
|
+
path: string;
|
|
29
|
+
usedLegacy: boolean;
|
|
39
30
|
};
|
|
40
31
|
export declare function hashConfig(config: EvalConfig): string;
|
|
41
|
-
export declare function expandConfigForAgents(
|
|
42
|
-
|
|
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
|
package/dist/config.d.ts.map
CHANGED
|
@@ -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,EAAE,MAAM,CAAA;CAAE,GAChC;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,YAAY,EAAE,gBAAgB,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB,CAwBA;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS;IAAE,SAAS,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,EAC5E,MAAM,EAAE,CAAC,EACT,UAAU,CAAC,EAAE,MAAM,GAClB,CAAC,CAOH;
|
|
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,EAAE,MAAM,CAAA;CAAE,GAChC;I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