@plumloom/cli 0.1.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/LICENSE +202 -0
- package/NOTICE +2 -0
- package/README.md +71 -0
- package/dist/actions/configured-runs.d.ts +25 -0
- package/dist/actions/configured-runs.d.ts.map +1 -0
- package/dist/actions/configured-runs.js +35 -0
- package/dist/actions/configured-runs.js.map +1 -0
- package/dist/actions/context.d.ts +5 -0
- package/dist/actions/context.d.ts.map +1 -0
- package/dist/actions/context.js +2 -0
- package/dist/actions/context.js.map +1 -0
- package/dist/actions/doctor.d.ts +46 -0
- package/dist/actions/doctor.d.ts.map +1 -0
- package/dist/actions/doctor.js +130 -0
- package/dist/actions/doctor.js.map +1 -0
- package/dist/actions/evaluations.d.ts +87 -0
- package/dist/actions/evaluations.d.ts.map +1 -0
- package/dist/actions/evaluations.js +307 -0
- package/dist/actions/evaluations.js.map +1 -0
- package/dist/actions/gate.d.ts +63 -0
- package/dist/actions/gate.d.ts.map +1 -0
- package/dist/actions/gate.js +272 -0
- package/dist/actions/gate.js.map +1 -0
- package/dist/actions/identity.d.ts +4 -0
- package/dist/actions/identity.d.ts.map +1 -0
- package/dist/actions/identity.js +4 -0
- package/dist/actions/identity.js.map +1 -0
- package/dist/actions/models.d.ts +4 -0
- package/dist/actions/models.d.ts.map +1 -0
- package/dist/actions/models.js +4 -0
- package/dist/actions/models.js.map +1 -0
- package/dist/actions/quality-standards.d.ts +30 -0
- package/dist/actions/quality-standards.d.ts.map +1 -0
- package/dist/actions/quality-standards.js +86 -0
- package/dist/actions/quality-standards.js.map +1 -0
- package/dist/actions/results.d.ts +12 -0
- package/dist/actions/results.d.ts.map +1 -0
- package/dist/actions/results.js +65 -0
- package/dist/actions/results.js.map +1 -0
- package/dist/actions/runs.d.ts +22 -0
- package/dist/actions/runs.d.ts.map +1 -0
- package/dist/actions/runs.js +59 -0
- package/dist/actions/runs.js.map +1 -0
- package/dist/actions/suite-gate.d.ts +24 -0
- package/dist/actions/suite-gate.d.ts.map +1 -0
- package/dist/actions/suite-gate.js +40 -0
- package/dist/actions/suite-gate.js.map +1 -0
- package/dist/actions/suite.d.ts +49 -0
- package/dist/actions/suite.d.ts.map +1 -0
- package/dist/actions/suite.js +68 -0
- package/dist/actions/suite.js.map +1 -0
- package/dist/actions/validation.d.ts +3 -0
- package/dist/actions/validation.d.ts.map +1 -0
- package/dist/actions/validation.js +26 -0
- package/dist/actions/validation.js.map +1 -0
- package/dist/actions/workspaces.d.ts +13 -0
- package/dist/actions/workspaces.d.ts.map +1 -0
- package/dist/actions/workspaces.js +18 -0
- package/dist/actions/workspaces.js.map +1 -0
- package/dist/api/api.d.ts +237 -0
- package/dist/api/api.d.ts.map +1 -0
- package/dist/api/api.js +396 -0
- package/dist/api/api.js.map +1 -0
- package/dist/api/client.d.ts +38 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +295 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/endpoints.d.ts +31 -0
- package/dist/api/endpoints.d.ts.map +1 -0
- package/dist/api/endpoints.js +32 -0
- package/dist/api/endpoints.js.map +1 -0
- package/dist/api/errors.d.ts +22 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +84 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/schemas.d.ts +169 -0
- package/dist/api/schemas.d.ts.map +1 -0
- package/dist/api/schemas.js +194 -0
- package/dist/api/schemas.js.map +1 -0
- package/dist/auth/credential-store.d.ts +9 -0
- package/dist/auth/credential-store.d.ts.map +1 -0
- package/dist/auth/credential-store.js +2 -0
- package/dist/auth/credential-store.js.map +1 -0
- package/dist/auth/credentials.d.ts +27 -0
- package/dist/auth/credentials.d.ts.map +1 -0
- package/dist/auth/credentials.js +81 -0
- package/dist/auth/credentials.js.map +1 -0
- package/dist/auth/keyring-store.d.ts +9 -0
- package/dist/auth/keyring-store.d.ts.map +1 -0
- package/dist/auth/keyring-store.js +57 -0
- package/dist/auth/keyring-store.js.map +1 -0
- package/dist/auth/login.d.ts +28 -0
- package/dist/auth/login.d.ts.map +1 -0
- package/dist/auth/login.js +27 -0
- package/dist/auth/login.js.map +1 -0
- package/dist/auth/password-prompt.d.ts +5 -0
- package/dist/auth/password-prompt.d.ts.map +1 -0
- package/dist/auth/password-prompt.js +10 -0
- package/dist/auth/password-prompt.js.map +1 -0
- package/dist/auth/redact.d.ts +3 -0
- package/dist/auth/redact.d.ts.map +1 -0
- package/dist/auth/redact.js +69 -0
- package/dist/auth/redact.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/executor.d.ts +36 -0
- package/dist/commands/executor.d.ts.map +1 -0
- package/dist/commands/executor.js +1218 -0
- package/dist/commands/executor.js.map +1 -0
- package/dist/commands/program.d.ts +21 -0
- package/dist/commands/program.d.ts.map +1 -0
- package/dist/commands/program.js +588 -0
- package/dist/commands/program.js.map +1 -0
- package/dist/commands/types.d.ts +139 -0
- package/dist/commands/types.d.ts.map +1 -0
- package/dist/commands/types.js +2 -0
- package/dist/commands/types.js.map +1 -0
- package/dist/config.d.ts +12 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +57 -0
- package/dist/config.js.map +1 -0
- package/dist/configured-run/file-inputs.d.ts +8 -0
- package/dist/configured-run/file-inputs.d.ts.map +1 -0
- package/dist/configured-run/file-inputs.js +160 -0
- package/dist/configured-run/file-inputs.js.map +1 -0
- package/dist/configured-run/validation.d.ts +103 -0
- package/dist/configured-run/validation.d.ts.map +1 -0
- package/dist/configured-run/validation.js +327 -0
- package/dist/configured-run/validation.js.map +1 -0
- package/dist/domain/common.d.ts +6 -0
- package/dist/domain/common.d.ts.map +1 -0
- package/dist/domain/common.js +10 -0
- package/dist/domain/common.js.map +1 -0
- package/dist/domain/types.d.ts +117 -0
- package/dist/domain/types.d.ts.map +1 -0
- package/dist/domain/types.js +2 -0
- package/dist/domain/types.js.map +1 -0
- package/dist/errors/autoeval-error.d.ts +13 -0
- package/dist/errors/autoeval-error.d.ts.map +1 -0
- package/dist/errors/autoeval-error.js +36 -0
- package/dist/errors/autoeval-error.js.map +1 -0
- package/dist/errors/hints.d.ts +3 -0
- package/dist/errors/hints.d.ts.map +1 -0
- package/dist/errors/hints.js +43 -0
- package/dist/errors/hints.js.map +1 -0
- package/dist/gate/decision.d.ts +97 -0
- package/dist/gate/decision.d.ts.map +1 -0
- package/dist/gate/decision.js +436 -0
- package/dist/gate/decision.js.map +1 -0
- package/dist/gate/policy.d.ts +31 -0
- package/dist/gate/policy.d.ts.map +1 -0
- package/dist/gate/policy.js +26 -0
- package/dist/gate/policy.js.map +1 -0
- package/dist/guide/eval-creation-backend.d.ts +20 -0
- package/dist/guide/eval-creation-backend.d.ts.map +1 -0
- package/dist/guide/eval-creation-backend.js +16 -0
- package/dist/guide/eval-creation-backend.js.map +1 -0
- package/dist/guide/eval-guide.d.ts +24 -0
- package/dist/guide/eval-guide.d.ts.map +1 -0
- package/dist/guide/eval-guide.js +219 -0
- package/dist/guide/eval-guide.js.map +1 -0
- package/dist/mcp/context.d.ts +21 -0
- package/dist/mcp/context.d.ts.map +1 -0
- package/dist/mcp/context.js +19 -0
- package/dist/mcp/context.js.map +1 -0
- package/dist/mcp/schemas.d.ts +206 -0
- package/dist/mcp/schemas.d.ts.map +1 -0
- package/dist/mcp/schemas.js +80 -0
- package/dist/mcp/schemas.js.map +1 -0
- package/dist/mcp/server.d.ts +5 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +10 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +42 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +287 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mcp.d.ts +3 -0
- package/dist/mcp.d.ts.map +1 -0
- package/dist/mcp.js +32 -0
- package/dist/mcp.js.map +1 -0
- package/dist/output/big-digits.d.ts +7 -0
- package/dist/output/big-digits.d.ts.map +1 -0
- package/dist/output/big-digits.js +43 -0
- package/dist/output/big-digits.js.map +1 -0
- package/dist/output/clipboard.d.ts +29 -0
- package/dist/output/clipboard.d.ts.map +1 -0
- package/dist/output/clipboard.js +82 -0
- package/dist/output/clipboard.js.map +1 -0
- package/dist/output/colors.d.ts +21 -0
- package/dist/output/colors.d.ts.map +1 -0
- package/dist/output/colors.js +21 -0
- package/dist/output/colors.js.map +1 -0
- package/dist/output/digest.d.ts +165 -0
- package/dist/output/digest.d.ts.map +1 -0
- package/dist/output/digest.js +771 -0
- package/dist/output/digest.js.map +1 -0
- package/dist/output/human.d.ts +95 -0
- package/dist/output/human.d.ts.map +1 -0
- package/dist/output/human.js +643 -0
- package/dist/output/human.js.map +1 -0
- package/dist/output/json.d.ts +2 -0
- package/dist/output/json.d.ts.map +1 -0
- package/dist/output/json.js +5 -0
- package/dist/output/json.js.map +1 -0
- package/dist/output/layout.d.ts +18 -0
- package/dist/output/layout.d.ts.map +1 -0
- package/dist/output/layout.js +64 -0
- package/dist/output/layout.js.map +1 -0
- package/dist/output/markdown.d.ts +16 -0
- package/dist/output/markdown.d.ts.map +1 -0
- package/dist/output/markdown.js +38 -0
- package/dist/output/markdown.js.map +1 -0
- package/dist/output/progress.d.ts +29 -0
- package/dist/output/progress.d.ts.map +1 -0
- package/dist/output/progress.js +136 -0
- package/dist/output/progress.js.map +1 -0
- package/dist/output/safe-text.d.ts +11 -0
- package/dist/output/safe-text.d.ts.map +1 -0
- package/dist/output/safe-text.js +44 -0
- package/dist/output/safe-text.js.map +1 -0
- package/dist/output/scorecard.d.ts +23 -0
- package/dist/output/scorecard.d.ts.map +1 -0
- package/dist/output/scorecard.js +506 -0
- package/dist/output/scorecard.js.map +1 -0
- package/dist/output/section.d.ts +15 -0
- package/dist/output/section.d.ts.map +1 -0
- package/dist/output/section.js +44 -0
- package/dist/output/section.js.map +1 -0
- package/dist/output/spinner.d.ts +24 -0
- package/dist/output/spinner.d.ts.map +1 -0
- package/dist/output/spinner.js +34 -0
- package/dist/output/spinner.js.map +1 -0
- package/dist/output/splash.d.ts +37 -0
- package/dist/output/splash.d.ts.map +1 -0
- package/dist/output/splash.js +169 -0
- package/dist/output/splash.js.map +1 -0
- package/dist/output/table.d.ts +33 -0
- package/dist/output/table.d.ts.map +1 -0
- package/dist/output/table.js +105 -0
- package/dist/output/table.js.map +1 -0
- package/dist/output/trend.d.ts +19 -0
- package/dist/output/trend.d.ts.map +1 -0
- package/dist/output/trend.js +38 -0
- package/dist/output/trend.js.map +1 -0
- package/dist/output/writer.d.ts +14 -0
- package/dist/output/writer.d.ts.map +1 -0
- package/dist/output/writer.js +33 -0
- package/dist/output/writer.js.map +1 -0
- package/dist/polling/clock.d.ts +9 -0
- package/dist/polling/clock.d.ts.map +1 -0
- package/dist/polling/clock.js +23 -0
- package/dist/polling/clock.js.map +1 -0
- package/dist/polling/wait-for-result.d.ts +16 -0
- package/dist/polling/wait-for-result.d.ts.map +1 -0
- package/dist/polling/wait-for-result.js +29 -0
- package/dist/polling/wait-for-result.js.map +1 -0
- package/dist/polling/wait-for-run.d.ts +14 -0
- package/dist/polling/wait-for-run.d.ts.map +1 -0
- package/dist/polling/wait-for-run.js +36 -0
- package/dist/polling/wait-for-run.js.map +1 -0
- package/dist/quickstart/prompt.d.ts +18 -0
- package/dist/quickstart/prompt.d.ts.map +1 -0
- package/dist/quickstart/prompt.js +37 -0
- package/dist/quickstart/prompt.js.map +1 -0
- package/dist/quickstart/sample.d.ts +28 -0
- package/dist/quickstart/sample.d.ts.map +1 -0
- package/dist/quickstart/sample.js +235 -0
- package/dist/quickstart/sample.js.map +1 -0
- package/dist/quickstart/selection.d.ts +53 -0
- package/dist/quickstart/selection.d.ts.map +1 -0
- package/dist/quickstart/selection.js +97 -0
- package/dist/quickstart/selection.js.map +1 -0
- package/dist/run.d.ts +28 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +134 -0
- package/dist/run.js.map +1 -0
- package/dist/runtime/action-context.d.ts +19 -0
- package/dist/runtime/action-context.d.ts.map +1 -0
- package/dist/runtime/action-context.js +40 -0
- package/dist/runtime/action-context.js.map +1 -0
- package/dist/suite/execution.d.ts +46 -0
- package/dist/suite/execution.d.ts.map +1 -0
- package/dist/suite/execution.js +97 -0
- package/dist/suite/execution.js.map +1 -0
- package/dist/suite/manifest.d.ts +16 -0
- package/dist/suite/manifest.d.ts.map +1 -0
- package/dist/suite/manifest.js +92 -0
- package/dist/suite/manifest.js.map +1 -0
- package/dist/suite/reporting.d.ts +35 -0
- package/dist/suite/reporting.d.ts.map +1 -0
- package/dist/suite/reporting.js +131 -0
- package/dist/suite/reporting.js.map +1 -0
- package/dist/trace/deepseek-harness.d.ts +31 -0
- package/dist/trace/deepseek-harness.d.ts.map +1 -0
- package/dist/trace/deepseek-harness.js +412 -0
- package/dist/trace/deepseek-harness.js.map +1 -0
- package/dist/trace/import.d.ts +9 -0
- package/dist/trace/import.d.ts.map +1 -0
- package/dist/trace/import.js +45 -0
- package/dist/trace/import.js.map +1 -0
- package/dist/version.d.ts +3 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +3 -0
- package/dist/version.js.map +1 -0
- package/package.json +82 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { getModels } from '../actions/models.js';
|
|
2
|
+
import { listWorkspaces } from '../actions/workspaces.js';
|
|
3
|
+
export class ActionEvalCreationBackend {
|
|
4
|
+
#actions;
|
|
5
|
+
constructor(input) {
|
|
6
|
+
this.#actions = input.actions;
|
|
7
|
+
}
|
|
8
|
+
async listWorkspaces(signal) {
|
|
9
|
+
const page = await listWorkspaces(this.#actions, {}, signal);
|
|
10
|
+
return page.items;
|
|
11
|
+
}
|
|
12
|
+
listModels(signal) {
|
|
13
|
+
return getModels(this.#actions, signal);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=eval-creation-backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-creation-backend.js","sourceRoot":"","sources":["../../src/guide/eval-creation-backend.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAa1D,MAAM,OAAO,yBAAyB;IAC3B,QAAQ,CAAgB;IAEjC,YAAY,KAAiC;QAC3C,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC,OAAO,CAAC;IAChC,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,MAAoB;QACvC,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,CAAC;QAC7D,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAED,UAAU,CAAC,MAAoB;QAC7B,OAAO,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { EvalCreationBackend } from './eval-creation-backend.js';
|
|
2
|
+
export type EvalGuideOutput = {
|
|
3
|
+
/** Text to show the user. */
|
|
4
|
+
output: string;
|
|
5
|
+
/** Deterministic CLI command the caller should execute now, when confirmed. */
|
|
6
|
+
command?: string;
|
|
7
|
+
};
|
|
8
|
+
/** True when the user is asking to run or set up evaluations from files. */
|
|
9
|
+
export declare function isEvalFileRequest(message: string): boolean;
|
|
10
|
+
export declare class EvalGuideFlow {
|
|
11
|
+
#private;
|
|
12
|
+
constructor(dependencies: {
|
|
13
|
+
backend: EvalCreationBackend;
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
});
|
|
16
|
+
get isComplete(): boolean;
|
|
17
|
+
/** Evaluation ids are created by the deterministic command, not by the guide. */
|
|
18
|
+
readonly createdEvaluationId: string;
|
|
19
|
+
/** The eval file the user pointed at, once one has been accepted. */
|
|
20
|
+
get savedDraftPath(): string;
|
|
21
|
+
start(message: string): Promise<EvalGuideOutput>;
|
|
22
|
+
handle(message: string): Promise<EvalGuideOutput>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=eval-guide.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-guide.d.ts","sourceRoot":"","sources":["../../src/guide/eval-guide.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAetE,MAAM,MAAM,eAAe,GAAG;IAC5B,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAcF,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAI1D;AAuCD,qBAAa,aAAa;;gBAWZ,YAAY,EAAE;QAAE,OAAO,EAAE,mBAAmB,CAAC;QAAC,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE;IAKhF,IAAI,UAAU,IAAI,OAAO,CAExB;IAED,iFAAiF;IACjF,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAM;IAE1C,qEAAqE;IACrE,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAiBhD,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;CA0IlD"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { basename } from 'node:path';
|
|
2
|
+
import { readEvalFile } from '../configured-run/file-inputs.js';
|
|
3
|
+
import { parseConfiguredRunInput, validateConfiguredRunInput, } from '../configured-run/validation.js';
|
|
4
|
+
import { AutoevalError } from '../errors/autoeval-error.js';
|
|
5
|
+
import { renderRule } from '../output/layout.js';
|
|
6
|
+
import { readSuiteManifest } from '../suite/manifest.js';
|
|
7
|
+
const SUITE_ANSWERS = new Set(['suite', 'many', 'multiple', 'manifest', '2']);
|
|
8
|
+
const ONE_ANSWERS = new Set(['one', 'single', 'a single eval', '1']);
|
|
9
|
+
const YES_ANSWERS = new Set(['y', 'yes', 'run', 'run it', 'ok', 'go']);
|
|
10
|
+
const RUN_FILE_PATTERNS = [
|
|
11
|
+
/\b(?:run|execute|start)\b[^.!?]*\b(?:an?|my|the|this)?\s*(?:eval|evaluation|suite)\b/iu,
|
|
12
|
+
/\b(?:how do i|help me)\b[^.!?]*\b(?:run|use)\b[^.!?]*\b(?:eval|evaluation|suite)\b/iu,
|
|
13
|
+
/\b(?:create|author|build|make|set ?up)\b[^.!?]*\b(?:an?|my|the|new)?\s*(?:eval|evaluation)\b/iu,
|
|
14
|
+
];
|
|
15
|
+
const UUID_PATTERN = /\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/iu;
|
|
16
|
+
/** True when the user is asking to run or set up evaluations from files. */
|
|
17
|
+
export function isEvalFileRequest(message) {
|
|
18
|
+
if (/^\s*autoeval\b/iu.test(message))
|
|
19
|
+
return false;
|
|
20
|
+
if (UUID_PATTERN.test(message))
|
|
21
|
+
return false;
|
|
22
|
+
return RUN_FILE_PATTERNS.some((pattern) => pattern.test(message));
|
|
23
|
+
}
|
|
24
|
+
/** A quoted or bare path mentioned in the message, if any. */
|
|
25
|
+
function extractPath(message) {
|
|
26
|
+
const quoted = /"([^"]+)"|'([^']+)'/u.exec(message);
|
|
27
|
+
const candidate = quoted?.[1] ??
|
|
28
|
+
quoted?.[2] ??
|
|
29
|
+
message.split(/\s+/u).find((token) => /[./\\]/u.test(token) && !token.endsWith('.'));
|
|
30
|
+
return candidate?.trim() === '' ? undefined : candidate;
|
|
31
|
+
}
|
|
32
|
+
function quoteCommandValue(value) {
|
|
33
|
+
return /\s/u.test(value) ? `"${value.replace(/["\\]/gu, '\\$&')}"` : value;
|
|
34
|
+
}
|
|
35
|
+
function summarize(path, validation) {
|
|
36
|
+
const contextLabel = validation.contextType === 'agent_trace'
|
|
37
|
+
? 'Agent trace'
|
|
38
|
+
: validation.contextType === 'conversation'
|
|
39
|
+
? 'Conversation'
|
|
40
|
+
: 'Scenario';
|
|
41
|
+
const unit = validation.contextType === 'scenario'
|
|
42
|
+
? 'scenarios'
|
|
43
|
+
: validation.contextType === 'conversation'
|
|
44
|
+
? 'messages'
|
|
45
|
+
: 'resource spans';
|
|
46
|
+
const lines = [
|
|
47
|
+
`${basename(path)} — ${contextLabel} · ${validation.artifactCount} ${unit}`,
|
|
48
|
+
validation.models.primary
|
|
49
|
+
? `Model under test ${validation.models.primary.displayName} · judge ${validation.models.judge.displayName}`
|
|
50
|
+
: `Judge ${validation.models.judge.displayName}`,
|
|
51
|
+
];
|
|
52
|
+
lines.push('Valid.');
|
|
53
|
+
return lines.join('\n');
|
|
54
|
+
}
|
|
55
|
+
export class EvalGuideFlow {
|
|
56
|
+
#backend;
|
|
57
|
+
#signal;
|
|
58
|
+
#step = 'scope';
|
|
59
|
+
#scope;
|
|
60
|
+
#evalFile = '';
|
|
61
|
+
#manifestFile = '';
|
|
62
|
+
#workspaceId = '';
|
|
63
|
+
#workspaceChoices = [];
|
|
64
|
+
#command = '';
|
|
65
|
+
constructor(dependencies) {
|
|
66
|
+
this.#backend = dependencies.backend;
|
|
67
|
+
this.#signal = dependencies.signal;
|
|
68
|
+
}
|
|
69
|
+
get isComplete() {
|
|
70
|
+
return this.#step === 'done';
|
|
71
|
+
}
|
|
72
|
+
/** Evaluation ids are created by the deterministic command, not by the guide. */
|
|
73
|
+
createdEvaluationId = '';
|
|
74
|
+
/** The eval file the user pointed at, once one has been accepted. */
|
|
75
|
+
get savedDraftPath() {
|
|
76
|
+
return this.#evalFile;
|
|
77
|
+
}
|
|
78
|
+
start(message) {
|
|
79
|
+
const inlinePath = extractPath(message);
|
|
80
|
+
if (inlinePath !== undefined) {
|
|
81
|
+
return this.#acceptPath(inlinePath);
|
|
82
|
+
}
|
|
83
|
+
if (/\bsuite\b|\bmanifest\b/iu.test(message)) {
|
|
84
|
+
this.#scope = 'suite';
|
|
85
|
+
this.#step = 'file';
|
|
86
|
+
return Promise.resolve({ output: 'Which suite manifest? (path to the YAML or JSON file)' });
|
|
87
|
+
}
|
|
88
|
+
return Promise.resolve({
|
|
89
|
+
output: 'Evaluations are defined in files, so I just need the file.\n' +
|
|
90
|
+
'Is this one eval, or a suite? [one | suite]',
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
handle(message) {
|
|
94
|
+
const answer = message.trim();
|
|
95
|
+
const lowered = answer.toLowerCase();
|
|
96
|
+
if (lowered === 'cancel' || lowered === 'quit' || lowered === 'exit') {
|
|
97
|
+
this.#step = 'done';
|
|
98
|
+
return Promise.resolve({ output: 'Cancelled.' });
|
|
99
|
+
}
|
|
100
|
+
switch (this.#step) {
|
|
101
|
+
case 'scope':
|
|
102
|
+
return this.#answerScope(answer, lowered);
|
|
103
|
+
case 'file':
|
|
104
|
+
return this.#acceptPath(extractPath(answer) ?? answer);
|
|
105
|
+
case 'workspace':
|
|
106
|
+
return Promise.resolve(this.#answerWorkspace(answer));
|
|
107
|
+
case 'confirm':
|
|
108
|
+
return Promise.resolve(this.#answerConfirm(lowered));
|
|
109
|
+
default:
|
|
110
|
+
this.#step = 'done';
|
|
111
|
+
return Promise.resolve({ output: 'Nothing left to do.' });
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
async #answerScope(answer, lowered) {
|
|
115
|
+
const path = extractPath(answer);
|
|
116
|
+
if (path !== undefined)
|
|
117
|
+
return this.#acceptPath(path);
|
|
118
|
+
if (SUITE_ANSWERS.has(lowered)) {
|
|
119
|
+
this.#scope = 'suite';
|
|
120
|
+
this.#step = 'file';
|
|
121
|
+
return { output: 'Which suite manifest? (path to the YAML or JSON file)' };
|
|
122
|
+
}
|
|
123
|
+
if (ONE_ANSWERS.has(lowered)) {
|
|
124
|
+
this.#scope = 'one';
|
|
125
|
+
this.#step = 'file';
|
|
126
|
+
return { output: 'Which eval file? (path to the .autoeval.json file)' };
|
|
127
|
+
}
|
|
128
|
+
return { output: 'Answer `one` or `suite`, or give me the file path directly.' };
|
|
129
|
+
}
|
|
130
|
+
async #acceptPath(path) {
|
|
131
|
+
const isManifest = this.#scope === 'suite' || /\.(?:ya?ml)$/iu.test(path) || /suite/iu.test(basename(path));
|
|
132
|
+
return isManifest ? this.#acceptManifest(path) : this.#acceptEvalFile(path);
|
|
133
|
+
}
|
|
134
|
+
async #acceptEvalFile(path) {
|
|
135
|
+
const summary = await this.#describeEvalFile(path);
|
|
136
|
+
this.#scope = 'one';
|
|
137
|
+
this.#evalFile = path;
|
|
138
|
+
return this.#askWorkspaceOrConfirm(summary);
|
|
139
|
+
}
|
|
140
|
+
async #acceptManifest(path) {
|
|
141
|
+
const manifest = await readSuiteManifest(path);
|
|
142
|
+
const summaries = [];
|
|
143
|
+
for (const evalFile of manifest.evalFiles) {
|
|
144
|
+
summaries.push(await this.#describeEvalFile(evalFile));
|
|
145
|
+
}
|
|
146
|
+
this.#scope = 'suite';
|
|
147
|
+
this.#manifestFile = path;
|
|
148
|
+
this.#workspaceId = manifest.workspaceId;
|
|
149
|
+
this.#command = `autoeval suite run --manifest ${quoteCommandValue(path)}`;
|
|
150
|
+
this.#step = 'confirm';
|
|
151
|
+
return {
|
|
152
|
+
output: [
|
|
153
|
+
`${basename(path)} — ${manifest.evalFiles.length} evaluations · workspace ${manifest.workspaceId}`,
|
|
154
|
+
renderRule(),
|
|
155
|
+
summaries.join(`\n${renderRule()}\n`),
|
|
156
|
+
renderRule(),
|
|
157
|
+
this.#command,
|
|
158
|
+
'Run it now? [y/N]',
|
|
159
|
+
].join('\n'),
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
async #describeEvalFile(path) {
|
|
163
|
+
const input = parseConfiguredRunInput(await readEvalFile(path));
|
|
164
|
+
const models = await this.#backend.listModels(this.#signal);
|
|
165
|
+
return summarize(path, validateConfiguredRunInput(input, models));
|
|
166
|
+
}
|
|
167
|
+
async #askWorkspaceOrConfirm(summary) {
|
|
168
|
+
if (this.#workspaceId === '') {
|
|
169
|
+
const workspaces = await this.#backend.listWorkspaces(this.#signal);
|
|
170
|
+
if (workspaces.length === 1 && workspaces[0]) {
|
|
171
|
+
this.#workspaceId = workspaces[0].id;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
this.#workspaceChoices = workspaces;
|
|
175
|
+
this.#step = 'workspace';
|
|
176
|
+
return {
|
|
177
|
+
output: [
|
|
178
|
+
summary,
|
|
179
|
+
renderRule(),
|
|
180
|
+
'Which workspace?',
|
|
181
|
+
...workspaces.map((workspace, index) => ` ${index + 1}. ${workspace.name}`),
|
|
182
|
+
].join('\n'),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return { output: `${summary}\n${renderRule()}\n${this.#buildConfirmation()}` };
|
|
187
|
+
}
|
|
188
|
+
#buildConfirmation() {
|
|
189
|
+
this.#command =
|
|
190
|
+
`autoeval eval create-from --workspace ${this.#workspaceId} ` +
|
|
191
|
+
`--input ${quoteCommandValue(this.#evalFile)} --run`;
|
|
192
|
+
this.#step = 'confirm';
|
|
193
|
+
return `${this.#command}\nRun it now? [y/N]`;
|
|
194
|
+
}
|
|
195
|
+
#answerWorkspace(answer) {
|
|
196
|
+
const index = Number.parseInt(answer, 10);
|
|
197
|
+
const chosen = this.#workspaceChoices[index - 1] ??
|
|
198
|
+
this.#workspaceChoices.find((workspace) => workspace.id === answer || workspace.name.toLowerCase() === answer.toLowerCase());
|
|
199
|
+
if (!chosen) {
|
|
200
|
+
throw new AutoevalError('Pick a workspace by number or name.', {
|
|
201
|
+
kind: 'usage',
|
|
202
|
+
code: 'WORKSPACE_CHOICE_UNKNOWN',
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
this.#workspaceId = chosen.id;
|
|
206
|
+
return { output: this.#buildConfirmation() };
|
|
207
|
+
}
|
|
208
|
+
#answerConfirm(lowered) {
|
|
209
|
+
this.#step = 'done';
|
|
210
|
+
if (YES_ANSWERS.has(lowered)) {
|
|
211
|
+
return {
|
|
212
|
+
output: `Running ${basename(this.#manifestFile || this.#evalFile)}...`,
|
|
213
|
+
command: this.#command,
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
return { output: `Run it when you are ready:\n${this.#command}` };
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=eval-guide.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eval-guide.js","sourceRoot":"","sources":["../../src/guide/eval-guide.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAChE,OAAO,EACL,uBAAuB,EACvB,0BAA0B,GAE3B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAuBzD,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;AACnG,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,CAAC,CAAC,CAAC;AAC1F,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE5F,MAAM,iBAAiB,GAAsB;IAC3C,wFAAwF;IACxF,sFAAsF;IACtF,gGAAgG;CACjG,CAAC;AAEF,MAAM,YAAY,GAAG,oEAAoE,CAAC;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,IAAI,CAAC,QAAQ,EAAE,EAAE,CAAC;IACpE,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ActionContext } from '../actions/context.js';
|
|
2
|
+
import type { CredentialStore } from '../auth/credential-store.js';
|
|
3
|
+
import type { AutoevalConfiguration } from '../config.js';
|
|
4
|
+
import type { FetchImplementation } from '../api/client.js';
|
|
5
|
+
import { type PollClock } from '../polling/clock.js';
|
|
6
|
+
export type AutoevalMcpContext = {
|
|
7
|
+
actions: ActionContext;
|
|
8
|
+
configuration: AutoevalConfiguration;
|
|
9
|
+
clock: PollClock;
|
|
10
|
+
signal?: AbortSignal;
|
|
11
|
+
};
|
|
12
|
+
export type AutoevalMcpContextDependencies = {
|
|
13
|
+
configuration: AutoevalConfiguration;
|
|
14
|
+
environment?: Readonly<Record<string, string | undefined>>;
|
|
15
|
+
store?: CredentialStore;
|
|
16
|
+
fetchImplementation?: FetchImplementation;
|
|
17
|
+
clock?: PollClock;
|
|
18
|
+
signal?: AbortSignal;
|
|
19
|
+
};
|
|
20
|
+
export declare function createAutoevalMcpContext(dependencies: AutoevalMcpContextDependencies): Promise<AutoevalMcpContext>;
|
|
21
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../src/mcp/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,aAAa,CAAC;IACvB,aAAa,EAAE,qBAAqB,CAAC;IACrC,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,aAAa,EAAE,qBAAqB,CAAC;IACrC,WAAW,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IAC3D,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,CAAC;AAEF,wBAAsB,wBAAwB,CAC5C,YAAY,EAAE,8BAA8B,GAC3C,OAAO,CAAC,kBAAkB,CAAC,CAgB7B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SystemPollClock } from '../polling/clock.js';
|
|
2
|
+
import { createAuthenticatedActionContext } from '../runtime/action-context.js';
|
|
3
|
+
export async function createAutoevalMcpContext(dependencies) {
|
|
4
|
+
const actions = await createAuthenticatedActionContext({
|
|
5
|
+
configuration: dependencies.configuration,
|
|
6
|
+
...(dependencies.environment ? { environment: dependencies.environment } : {}),
|
|
7
|
+
...(dependencies.store ? { store: dependencies.store } : {}),
|
|
8
|
+
...(dependencies.fetchImplementation
|
|
9
|
+
? { fetchImplementation: dependencies.fetchImplementation }
|
|
10
|
+
: {}),
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
actions,
|
|
14
|
+
configuration: dependencies.configuration,
|
|
15
|
+
clock: dependencies.clock ?? new SystemPollClock(),
|
|
16
|
+
...(dependencies.signal ? { signal: dependencies.signal } : {}),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../src/mcp/context.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAkB,MAAM,qBAAqB,CAAC;AACtE,OAAO,EAAE,gCAAgC,EAAE,MAAM,8BAA8B,CAAC;AAkBhF,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,YAA4C;IAE5C,MAAM,OAAO,GAAG,MAAM,gCAAgC,CAAC;QACrD,aAAa,EAAE,YAAY,CAAC,aAAa;QACzC,GAAG,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,YAAY,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9E,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,YAAY,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,GAAG,CAAC,YAAY,CAAC,mBAAmB;YAClC,CAAC,CAAC,EAAE,mBAAmB,EAAE,YAAY,CAAC,mBAAmB,EAAE;YAC3D,CAAC,CAAC,EAAE,CAAC;KACR,CAAC,CAAC;IAEH,OAAO;QACL,OAAO;QACP,aAAa,EAAE,YAAY,CAAC,aAAa;QACzC,KAAK,EAAE,YAAY,CAAC,KAAK,IAAI,IAAI,eAAe,EAAE;QAClD,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const emptyInputSchema: z.ZodObject<{}, z.core.$strict>;
|
|
3
|
+
export declare const listWorkspacesInputSchema: z.ZodObject<{
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strict>;
|
|
7
|
+
export declare const createWorkspaceInputSchema: z.ZodObject<{
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
description: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, z.core.$strict>;
|
|
11
|
+
export declare const listEvaluationsInputSchema: z.ZodObject<{
|
|
12
|
+
workspaceId: z.ZodUUID;
|
|
13
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
14
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
15
|
+
}, z.core.$strict>;
|
|
16
|
+
export declare const createEvaluationInputSchema: z.ZodObject<{
|
|
17
|
+
workspaceId: z.ZodUUID;
|
|
18
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$strict>;
|
|
20
|
+
export declare const evaluationInputSchema: z.ZodObject<{
|
|
21
|
+
evaluationId: z.ZodUUID;
|
|
22
|
+
}, z.core.$strict>;
|
|
23
|
+
export declare const updateEvaluationTitleInputSchema: z.ZodObject<{
|
|
24
|
+
workspaceId: z.ZodUUID;
|
|
25
|
+
evaluationId: z.ZodUUID;
|
|
26
|
+
evaluationName: z.ZodString;
|
|
27
|
+
userSystemId: z.ZodString;
|
|
28
|
+
description: z.ZodOptional<z.ZodString>;
|
|
29
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
30
|
+
size: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export declare const qualityStandardInputSchema: z.ZodObject<{
|
|
33
|
+
name: z.ZodString;
|
|
34
|
+
judge_model: z.ZodUUID;
|
|
35
|
+
rubric: z.ZodString;
|
|
36
|
+
anchors: z.ZodArray<z.ZodObject<{
|
|
37
|
+
input: z.ZodString;
|
|
38
|
+
response: z.ZodString;
|
|
39
|
+
reference: z.ZodString;
|
|
40
|
+
score: z.ZodUnion<readonly [z.ZodLiteral<1>, z.ZodLiteral<5>]>;
|
|
41
|
+
reasoning: z.ZodString;
|
|
42
|
+
}, z.core.$strict>>;
|
|
43
|
+
}, z.core.$strict>;
|
|
44
|
+
export declare const qualityStandardIdInputSchema: z.ZodObject<{
|
|
45
|
+
qualityStandardId: z.ZodUUID;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
export declare const assignQualityStandardInputSchema: z.ZodObject<{
|
|
48
|
+
workspaceId: z.ZodUUID;
|
|
49
|
+
qualityStandardId: z.ZodUUID;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export declare const validateConfiguredEvaluationInputSchema: z.ZodObject<{
|
|
52
|
+
input: z.ZodObject<{
|
|
53
|
+
methodology: z.ZodObject<{
|
|
54
|
+
userSystemId: z.ZodOptional<z.ZodString>;
|
|
55
|
+
judgeModel: z.ZodString;
|
|
56
|
+
judgeModelId: z.ZodUUID;
|
|
57
|
+
runsPerScenario: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
evaluatorInstructions: z.ZodString;
|
|
59
|
+
changeLog: z.ZodOptional<z.ZodString>;
|
|
60
|
+
}, z.core.$strict>;
|
|
61
|
+
configuration: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
62
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
63
|
+
contextName: z.ZodString;
|
|
64
|
+
contextType: z.ZodLiteral<"scenario">;
|
|
65
|
+
artifact: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
66
|
+
expected: z.ZodString;
|
|
67
|
+
referenceDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
68
|
+
filename: z.ZodString;
|
|
69
|
+
content: z.ZodString;
|
|
70
|
+
}, z.core.$strict>>>;
|
|
71
|
+
selectedMetrics: z.ZodArray<z.ZodString>;
|
|
72
|
+
temperatureContext: z.ZodOptional<z.ZodNumber>;
|
|
73
|
+
autoStopEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
74
|
+
scenarioGeneration: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
75
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
76
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
77
|
+
contextName: z.ZodString;
|
|
78
|
+
contextType: z.ZodLiteral<"conversation">;
|
|
79
|
+
artifact: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
80
|
+
expected: z.ZodString;
|
|
81
|
+
referenceDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
82
|
+
filename: z.ZodString;
|
|
83
|
+
content: z.ZodString;
|
|
84
|
+
}, z.core.$strict>>>;
|
|
85
|
+
selectedMetrics: z.ZodArray<z.ZodString>;
|
|
86
|
+
temperatureContext: z.ZodOptional<z.ZodNumber>;
|
|
87
|
+
autoStopEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
88
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
89
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
90
|
+
contextName: z.ZodString;
|
|
91
|
+
contextType: z.ZodLiteral<"agent_trace">;
|
|
92
|
+
artifact: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
93
|
+
expected: z.ZodString;
|
|
94
|
+
referenceDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
95
|
+
filename: z.ZodString;
|
|
96
|
+
content: z.ZodString;
|
|
97
|
+
}, z.core.$strict>>>;
|
|
98
|
+
selectedMetrics: z.ZodArray<z.ZodString>;
|
|
99
|
+
temperatureContext: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
autoStopEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
101
|
+
}, z.core.$strict>], "contextType">, z.ZodObject<{
|
|
102
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
103
|
+
contextName: z.ZodOptional<z.ZodString>;
|
|
104
|
+
primaryModelId: z.ZodUUID;
|
|
105
|
+
comparisonModelIds: z.ZodDefault<z.ZodArray<z.ZodUUID>>;
|
|
106
|
+
promptText: z.ZodString;
|
|
107
|
+
scenarios: z.ZodUnion<readonly [z.ZodArray<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>]>;
|
|
108
|
+
referenceDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
filename: z.ZodString;
|
|
110
|
+
content: z.ZodString;
|
|
111
|
+
}, z.core.$strict>>>;
|
|
112
|
+
selectedMetrics: z.ZodArray<z.ZodString>;
|
|
113
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
114
|
+
temperatureContext: z.ZodOptional<z.ZodNumber>;
|
|
115
|
+
autoStopEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
116
|
+
}, z.core.$strict>]>;
|
|
117
|
+
}, z.core.$strict>;
|
|
118
|
+
}, z.core.$strict>;
|
|
119
|
+
export declare const runConfiguredEvaluationInputSchema: z.ZodObject<{
|
|
120
|
+
evaluationId: z.ZodUUID;
|
|
121
|
+
input: z.ZodObject<{
|
|
122
|
+
methodology: z.ZodObject<{
|
|
123
|
+
userSystemId: z.ZodOptional<z.ZodString>;
|
|
124
|
+
judgeModel: z.ZodString;
|
|
125
|
+
judgeModelId: z.ZodUUID;
|
|
126
|
+
runsPerScenario: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
evaluatorInstructions: z.ZodString;
|
|
128
|
+
changeLog: z.ZodOptional<z.ZodString>;
|
|
129
|
+
}, z.core.$strict>;
|
|
130
|
+
configuration: z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
131
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
132
|
+
contextName: z.ZodString;
|
|
133
|
+
contextType: z.ZodLiteral<"scenario">;
|
|
134
|
+
artifact: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
135
|
+
expected: z.ZodString;
|
|
136
|
+
referenceDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
137
|
+
filename: z.ZodString;
|
|
138
|
+
content: z.ZodString;
|
|
139
|
+
}, z.core.$strict>>>;
|
|
140
|
+
selectedMetrics: z.ZodArray<z.ZodString>;
|
|
141
|
+
temperatureContext: z.ZodOptional<z.ZodNumber>;
|
|
142
|
+
autoStopEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
143
|
+
scenarioGeneration: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
144
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
145
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
146
|
+
contextName: z.ZodString;
|
|
147
|
+
contextType: z.ZodLiteral<"conversation">;
|
|
148
|
+
artifact: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
149
|
+
expected: z.ZodString;
|
|
150
|
+
referenceDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
151
|
+
filename: z.ZodString;
|
|
152
|
+
content: z.ZodString;
|
|
153
|
+
}, z.core.$strict>>>;
|
|
154
|
+
selectedMetrics: z.ZodArray<z.ZodString>;
|
|
155
|
+
temperatureContext: z.ZodOptional<z.ZodNumber>;
|
|
156
|
+
autoStopEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
157
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
158
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
159
|
+
contextName: z.ZodString;
|
|
160
|
+
contextType: z.ZodLiteral<"agent_trace">;
|
|
161
|
+
artifact: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
162
|
+
expected: z.ZodString;
|
|
163
|
+
referenceDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
164
|
+
filename: z.ZodString;
|
|
165
|
+
content: z.ZodString;
|
|
166
|
+
}, z.core.$strict>>>;
|
|
167
|
+
selectedMetrics: z.ZodArray<z.ZodString>;
|
|
168
|
+
temperatureContext: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
autoStopEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
170
|
+
}, z.core.$strict>], "contextType">, z.ZodObject<{
|
|
171
|
+
evaluationName: z.ZodOptional<z.ZodString>;
|
|
172
|
+
contextName: z.ZodOptional<z.ZodString>;
|
|
173
|
+
primaryModelId: z.ZodUUID;
|
|
174
|
+
comparisonModelIds: z.ZodDefault<z.ZodArray<z.ZodUUID>>;
|
|
175
|
+
promptText: z.ZodString;
|
|
176
|
+
scenarios: z.ZodUnion<readonly [z.ZodArray<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>>, z.ZodArray<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>]>;
|
|
177
|
+
referenceDocuments: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
178
|
+
filename: z.ZodString;
|
|
179
|
+
content: z.ZodString;
|
|
180
|
+
}, z.core.$strict>>>;
|
|
181
|
+
selectedMetrics: z.ZodArray<z.ZodString>;
|
|
182
|
+
expected: z.ZodOptional<z.ZodString>;
|
|
183
|
+
temperatureContext: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
autoStopEnabled: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
}, z.core.$strict>]>;
|
|
186
|
+
}, z.core.$strict>;
|
|
187
|
+
}, z.core.$strict>;
|
|
188
|
+
export declare const runInputSchema: z.ZodObject<{
|
|
189
|
+
evaluationId: z.ZodUUID;
|
|
190
|
+
}, z.core.$strict>;
|
|
191
|
+
export declare const runReferenceInputSchema: z.ZodObject<{
|
|
192
|
+
evaluationId: z.ZodUUID;
|
|
193
|
+
runId: z.ZodUUID;
|
|
194
|
+
}, z.core.$strict>;
|
|
195
|
+
export declare const mcpToolOutputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
196
|
+
ok: z.ZodLiteral<true>;
|
|
197
|
+
data: z.ZodJSONSchema;
|
|
198
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
199
|
+
ok: z.ZodLiteral<false>;
|
|
200
|
+
error: z.ZodObject<{
|
|
201
|
+
kind: z.ZodString;
|
|
202
|
+
code: z.ZodString;
|
|
203
|
+
message: z.ZodString;
|
|
204
|
+
}, z.core.$strict>;
|
|
205
|
+
}, z.core.$strict>], "ok">;
|
|
206
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../src/mcp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AASxB,eAAO,MAAM,gBAAgB,iCAAwB,CAAC;AAEtD,eAAO,MAAM,yBAAyB;;;kBAK3B,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;kBAK5B,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;;kBAM5B,CAAC;AAEZ,eAAO,MAAM,2BAA2B;;;kBAK7B,CAAC;AAEZ,eAAO,MAAM,qBAAqB;;kBAA4C,CAAC;AAE/E,eAAO,MAAM,gCAAgC;;;;;;;;kBAUlC,CAAC;AAEZ,eAAO,MAAM,0BAA0B;;;;;;;;;;;kBAA8B,CAAC;AAEtE,eAAO,MAAM,4BAA4B;;kBAAiD,CAAC;AAE3F,eAAO,MAAM,gCAAgC;;;kBAKlC,CAAC;AAEZ,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAEzC,CAAC;AAEZ,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAKpC,CAAC;AAEZ,eAAO,MAAM,cAAc;;kBAA4C,CAAC;AAExE,eAAO,MAAM,uBAAuB;;;kBAKzB,CAAC;AAUZ,eAAO,MAAM,mBAAmB;;;;;;;;;;0BAG9B,CAAC"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { qualityStandardCreateSchema } from '../actions/quality-standards.js';
|
|
3
|
+
import { configuredRunFileSchema } from '../configured-run/validation.js';
|
|
4
|
+
const uuid = z.uuid();
|
|
5
|
+
const page = z.number().int().positive().optional();
|
|
6
|
+
const pageSize = z.number().int().min(1).max(100).optional();
|
|
7
|
+
export const emptyInputSchema = z.object({}).strict();
|
|
8
|
+
export const listWorkspacesInputSchema = z
|
|
9
|
+
.object({
|
|
10
|
+
page,
|
|
11
|
+
size: pageSize,
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
14
|
+
export const createWorkspaceInputSchema = z
|
|
15
|
+
.object({
|
|
16
|
+
name: z.string().trim().min(1).max(120),
|
|
17
|
+
description: z.string().trim().min(1).max(1_000).optional(),
|
|
18
|
+
})
|
|
19
|
+
.strict();
|
|
20
|
+
export const listEvaluationsInputSchema = z
|
|
21
|
+
.object({
|
|
22
|
+
workspaceId: uuid,
|
|
23
|
+
page,
|
|
24
|
+
size: pageSize,
|
|
25
|
+
})
|
|
26
|
+
.strict();
|
|
27
|
+
export const createEvaluationInputSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
workspaceId: uuid,
|
|
30
|
+
evaluationName: z.string().trim().min(1).max(120).optional(),
|
|
31
|
+
})
|
|
32
|
+
.strict();
|
|
33
|
+
export const evaluationInputSchema = z.object({ evaluationId: uuid }).strict();
|
|
34
|
+
export const updateEvaluationTitleInputSchema = z
|
|
35
|
+
.object({
|
|
36
|
+
workspaceId: uuid,
|
|
37
|
+
evaluationId: uuid,
|
|
38
|
+
evaluationName: z.string().trim().min(1).max(120),
|
|
39
|
+
userSystemId: z.string().trim().min(1),
|
|
40
|
+
description: z.string().optional(),
|
|
41
|
+
page,
|
|
42
|
+
size: pageSize,
|
|
43
|
+
})
|
|
44
|
+
.strict();
|
|
45
|
+
export const qualityStandardInputSchema = qualityStandardCreateSchema;
|
|
46
|
+
export const qualityStandardIdInputSchema = z.object({ qualityStandardId: uuid }).strict();
|
|
47
|
+
export const assignQualityStandardInputSchema = z
|
|
48
|
+
.object({
|
|
49
|
+
workspaceId: uuid,
|
|
50
|
+
qualityStandardId: uuid,
|
|
51
|
+
})
|
|
52
|
+
.strict();
|
|
53
|
+
export const validateConfiguredEvaluationInputSchema = z
|
|
54
|
+
.object({ input: configuredRunFileSchema })
|
|
55
|
+
.strict();
|
|
56
|
+
export const runConfiguredEvaluationInputSchema = z
|
|
57
|
+
.object({
|
|
58
|
+
evaluationId: uuid,
|
|
59
|
+
input: configuredRunFileSchema,
|
|
60
|
+
})
|
|
61
|
+
.strict();
|
|
62
|
+
export const runInputSchema = z.object({ evaluationId: uuid }).strict();
|
|
63
|
+
export const runReferenceInputSchema = z
|
|
64
|
+
.object({
|
|
65
|
+
evaluationId: uuid,
|
|
66
|
+
runId: uuid,
|
|
67
|
+
})
|
|
68
|
+
.strict();
|
|
69
|
+
const mcpErrorSchema = z
|
|
70
|
+
.object({
|
|
71
|
+
kind: z.string(),
|
|
72
|
+
code: z.string(),
|
|
73
|
+
message: z.string(),
|
|
74
|
+
})
|
|
75
|
+
.strict();
|
|
76
|
+
export const mcpToolOutputSchema = z.discriminatedUnion('ok', [
|
|
77
|
+
z.object({ ok: z.literal(true), data: z.json() }).strict(),
|
|
78
|
+
z.object({ ok: z.literal(false), error: mcpErrorSchema }).strict(),
|
|
79
|
+
]);
|
|
80
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../src/mcp/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,2BAA2B,EAAE,MAAM,iCAAiC,CAAC;AAC9E,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAE1E,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACtB,MAAM,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,CAAC;AACpD,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,G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YAAY,EAAE,IAAI;IAClB,KAAK,EAAE,IAAI;CACZ,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,cAAc,GAAG,CAAC;KACrB,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC;KACD,MAAM,EAAE,CAAC;AAEZ,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,kBAAkB,CAAC,IAAI,EAAE;IAC5D,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IAC1D,CAAC,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;CACnE,CAAC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import type { AutoevalMcpContext } from './context.js';
|
|
3
|
+
import { type AutoevalMcpActions } from './tools.js';
|
|
4
|
+
export declare function createAutoevalMcpServer(context: AutoevalMcpContext, actions?: AutoevalMcpActions): McpServer;
|
|
5
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AACvD,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,YAAY,CAAC;AAEpB,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,GAAE,kBAA0C,GAClD,SAAS,CAUX"}
|