@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,10 @@
|
|
|
1
|
+
import { McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import { createAutoevalMcpTools, registerAutoevalMcpTools, sharedAutoevalActions, } from './tools.js';
|
|
3
|
+
export function createAutoevalMcpServer(context, actions = sharedAutoevalActions) {
|
|
4
|
+
const server = new McpServer({ name: 'plumloom-autoeval', version: '0.1.0' }, {
|
|
5
|
+
instructions: 'Use read-only tools to discover IDs and validate configured input before starting runs. Scenario evaluations may repeat runs; conversation and agent-trace artifacts are single-shot. State-changing tools execute deterministically when called.',
|
|
6
|
+
});
|
|
7
|
+
registerAutoevalMcpTools(server, createAutoevalMcpTools(context, actions));
|
|
8
|
+
return server;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAGzD,OAAO,EAEL,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,GACtB,MAAM,YAAY,CAAC;AAEpB,MAAM,UAAU,uBAAuB,CACrC,OAA2B,EAC3B,UAA8B,qBAAqB;IAEnD,MAAM,MAAM,GAAG,IAAI,SAAS,CAC1B,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,EAC/C;QACE,YAAY,EACV,mPAAmP;KACtP,CACF,CAAC;IACF,wBAAwB,CAAC,MAAM,EAAE,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { CallToolResult, McpServer } from '@modelcontextprotocol/server';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { submitConfiguredEvaluation, validateConfiguredEvaluation } from '../actions/configured-runs.js';
|
|
4
|
+
import { createEvaluation, getEvaluation, listEvaluations, updateEvaluationTitleAndRefreshList } from '../actions/evaluations.js';
|
|
5
|
+
import { whoAmI } from '../actions/identity.js';
|
|
6
|
+
import { getModels } from '../actions/models.js';
|
|
7
|
+
import { assignQualityStandardToWorkspace, createQualityStandard, getQualityStandard } from '../actions/quality-standards.js';
|
|
8
|
+
import { getResults } from '../actions/results.js';
|
|
9
|
+
import { getRunStatus, submitEvaluation } from '../actions/runs.js';
|
|
10
|
+
import { createWorkspace, listWorkspaces } from '../actions/workspaces.js';
|
|
11
|
+
import type { AutoevalMcpContext } from './context.js';
|
|
12
|
+
export type McpToolAccess = 'readOnly' | 'stateChanging';
|
|
13
|
+
export type AutoevalMcpActions = {
|
|
14
|
+
whoAmI: typeof whoAmI;
|
|
15
|
+
listWorkspaces: typeof listWorkspaces;
|
|
16
|
+
createWorkspace: typeof createWorkspace;
|
|
17
|
+
listEvaluations: typeof listEvaluations;
|
|
18
|
+
createEvaluation: typeof createEvaluation;
|
|
19
|
+
getEvaluation: typeof getEvaluation;
|
|
20
|
+
updateEvaluationTitle: typeof updateEvaluationTitleAndRefreshList;
|
|
21
|
+
getModels: typeof getModels;
|
|
22
|
+
createQualityStandard: typeof createQualityStandard;
|
|
23
|
+
getQualityStandard: typeof getQualityStandard;
|
|
24
|
+
assignQualityStandard: typeof assignQualityStandardToWorkspace;
|
|
25
|
+
validateConfiguredEvaluation: typeof validateConfiguredEvaluation;
|
|
26
|
+
submitConfiguredEvaluation: typeof submitConfiguredEvaluation;
|
|
27
|
+
submitEvaluation: typeof submitEvaluation;
|
|
28
|
+
getRunStatus: typeof getRunStatus;
|
|
29
|
+
getResults: typeof getResults;
|
|
30
|
+
};
|
|
31
|
+
export declare const sharedAutoevalActions: AutoevalMcpActions;
|
|
32
|
+
export type AutoevalMcpTool = {
|
|
33
|
+
name: string;
|
|
34
|
+
title: string;
|
|
35
|
+
description: string;
|
|
36
|
+
access: McpToolAccess;
|
|
37
|
+
inputSchema: z.ZodType;
|
|
38
|
+
invoke(input: unknown): Promise<CallToolResult>;
|
|
39
|
+
};
|
|
40
|
+
export declare function createAutoevalMcpTools(context: AutoevalMcpContext, actions?: AutoevalMcpActions): AutoevalMcpTool[];
|
|
41
|
+
export declare function registerAutoevalMcpTools(server: McpServer, tools: readonly AutoevalMcpTool[]): void;
|
|
42
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAmB,MAAM,8BAA8B,CAAC;AAC/F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA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OAAO,YAAY,CAAC;IAClC,UAAU,EAAE,OAAO,UAAU,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,kBAiBnC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,WAAW,EAAE,CAAC,CAAC,OAAO,CAAC;IACvB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACjD,CAAC;AA+EF,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,kBAAkB,EAC3B,OAAO,GAAE,kBAA0C,GAClD,eAAe,EAAE,CAgNnB;AAkBD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,SAAS,eAAe,EAAE,GAChC,IAAI,CAcN"}
|
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { submitConfiguredEvaluation, validateConfiguredEvaluation, } from '../actions/configured-runs.js';
|
|
3
|
+
import { createEvaluation, getEvaluation, listEvaluations, updateEvaluationTitleAndRefreshList, } from '../actions/evaluations.js';
|
|
4
|
+
import { whoAmI } from '../actions/identity.js';
|
|
5
|
+
import { getModels } from '../actions/models.js';
|
|
6
|
+
import { assignQualityStandardToWorkspace, createQualityStandard, getQualityStandard, } from '../actions/quality-standards.js';
|
|
7
|
+
import { getResults } from '../actions/results.js';
|
|
8
|
+
import { getRunStatus, submitEvaluation } from '../actions/runs.js';
|
|
9
|
+
import { createWorkspace, listWorkspaces } from '../actions/workspaces.js';
|
|
10
|
+
import { redactText, redactUnknown } from '../auth/redact.js';
|
|
11
|
+
import { parseConfiguredRunInput } from '../configured-run/validation.js';
|
|
12
|
+
import { asAutoevalError } from '../errors/autoeval-error.js';
|
|
13
|
+
import { assignQualityStandardInputSchema, createEvaluationInputSchema, createWorkspaceInputSchema, emptyInputSchema, evaluationInputSchema, listEvaluationsInputSchema, listWorkspacesInputSchema, mcpToolOutputSchema, qualityStandardIdInputSchema, qualityStandardInputSchema, runConfiguredEvaluationInputSchema, runInputSchema, runReferenceInputSchema, updateEvaluationTitleInputSchema, validateConfiguredEvaluationInputSchema, } from './schemas.js';
|
|
14
|
+
export const sharedAutoevalActions = {
|
|
15
|
+
whoAmI,
|
|
16
|
+
listWorkspaces,
|
|
17
|
+
createWorkspace,
|
|
18
|
+
listEvaluations,
|
|
19
|
+
createEvaluation,
|
|
20
|
+
getEvaluation,
|
|
21
|
+
updateEvaluationTitle: updateEvaluationTitleAndRefreshList,
|
|
22
|
+
getModels,
|
|
23
|
+
createQualityStandard,
|
|
24
|
+
getQualityStandard,
|
|
25
|
+
assignQualityStandard: assignQualityStandardToWorkspace,
|
|
26
|
+
validateConfiguredEvaluation,
|
|
27
|
+
submitConfiguredEvaluation,
|
|
28
|
+
submitEvaluation,
|
|
29
|
+
getRunStatus,
|
|
30
|
+
getResults,
|
|
31
|
+
};
|
|
32
|
+
function successResult(data) {
|
|
33
|
+
const payload = mcpToolOutputSchema.parse({
|
|
34
|
+
ok: true,
|
|
35
|
+
data: z.json().parse(redactUnknown(data)),
|
|
36
|
+
});
|
|
37
|
+
return {
|
|
38
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
39
|
+
structuredContent: payload,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function failureResult(error) {
|
|
43
|
+
if (error instanceof z.ZodError) {
|
|
44
|
+
const payload = mcpToolOutputSchema.parse({
|
|
45
|
+
ok: false,
|
|
46
|
+
error: {
|
|
47
|
+
kind: 'usage',
|
|
48
|
+
code: 'INVALID_TOOL_ARGUMENTS',
|
|
49
|
+
message: 'Tool arguments are invalid.',
|
|
50
|
+
},
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
isError: true,
|
|
54
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
55
|
+
structuredContent: payload,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const normalized = asAutoevalError(error);
|
|
59
|
+
const payload = mcpToolOutputSchema.parse({
|
|
60
|
+
ok: false,
|
|
61
|
+
error: {
|
|
62
|
+
kind: normalized.kind,
|
|
63
|
+
code: redactText(normalized.code ?? 'AUTOEVAL_ERROR'),
|
|
64
|
+
message: redactText(normalized.message),
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
return {
|
|
68
|
+
isError: true,
|
|
69
|
+
content: [{ type: 'text', text: JSON.stringify(payload) }],
|
|
70
|
+
structuredContent: payload,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function defineTool(definition) {
|
|
74
|
+
return {
|
|
75
|
+
name: definition.name,
|
|
76
|
+
title: definition.title,
|
|
77
|
+
description: definition.description,
|
|
78
|
+
access: definition.access,
|
|
79
|
+
inputSchema: definition.inputSchema,
|
|
80
|
+
invoke: async (untrustedInput) => {
|
|
81
|
+
try {
|
|
82
|
+
const input = definition.inputSchema.parse(untrustedInput);
|
|
83
|
+
return successResult(await definition.execute(input));
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
return failureResult(error);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
function actionSignal(context) {
|
|
92
|
+
return context.signal ? { signal: context.signal } : {};
|
|
93
|
+
}
|
|
94
|
+
export function createAutoevalMcpTools(context, actions = sharedAutoevalActions) {
|
|
95
|
+
return [
|
|
96
|
+
defineTool({
|
|
97
|
+
name: 'get_current_user',
|
|
98
|
+
title: 'Get current user',
|
|
99
|
+
description: 'Returns the identity associated with the configured Plumloom CLI key.',
|
|
100
|
+
access: 'readOnly',
|
|
101
|
+
inputSchema: emptyInputSchema,
|
|
102
|
+
execute: () => actions.whoAmI(context.actions, context.signal),
|
|
103
|
+
}),
|
|
104
|
+
defineTool({
|
|
105
|
+
name: 'list_workspaces',
|
|
106
|
+
title: 'List workspaces',
|
|
107
|
+
description: 'Lists workspaces accessible to the authenticated account.',
|
|
108
|
+
access: 'readOnly',
|
|
109
|
+
inputSchema: listWorkspacesInputSchema,
|
|
110
|
+
execute: (input) => actions.listWorkspaces(context.actions, {
|
|
111
|
+
...(input.page !== undefined ? { page: input.page } : {}),
|
|
112
|
+
...(input.size !== undefined ? { size: input.size } : {}),
|
|
113
|
+
}, context.signal),
|
|
114
|
+
}),
|
|
115
|
+
defineTool({
|
|
116
|
+
name: 'create_workspace',
|
|
117
|
+
title: 'Create workspace',
|
|
118
|
+
description: 'Creates a workspace. This changes account state.',
|
|
119
|
+
access: 'stateChanging',
|
|
120
|
+
inputSchema: createWorkspaceInputSchema,
|
|
121
|
+
execute: (input) => actions.createWorkspace(context.actions, {
|
|
122
|
+
name: input.name,
|
|
123
|
+
...(input.description !== undefined ? { description: input.description } : {}),
|
|
124
|
+
}, context.signal),
|
|
125
|
+
}),
|
|
126
|
+
defineTool({
|
|
127
|
+
name: 'list_evaluations',
|
|
128
|
+
title: 'List evaluations',
|
|
129
|
+
description: 'Lists evaluations in the workspace identified by workspaceId.',
|
|
130
|
+
access: 'readOnly',
|
|
131
|
+
inputSchema: listEvaluationsInputSchema,
|
|
132
|
+
execute: (input) => actions.listEvaluations(context.actions, {
|
|
133
|
+
workspaceId: input.workspaceId,
|
|
134
|
+
...(input.page !== undefined ? { page: input.page } : {}),
|
|
135
|
+
...(input.size !== undefined ? { size: input.size } : {}),
|
|
136
|
+
}, context.signal),
|
|
137
|
+
}),
|
|
138
|
+
defineTool({
|
|
139
|
+
name: 'create_evaluation',
|
|
140
|
+
title: 'Create evaluation',
|
|
141
|
+
description: 'Creates an evaluation draft in workspaceId. This changes account state.',
|
|
142
|
+
access: 'stateChanging',
|
|
143
|
+
inputSchema: createEvaluationInputSchema,
|
|
144
|
+
execute: (input) => actions.createEvaluation(context.actions, {
|
|
145
|
+
workspaceId: input.workspaceId,
|
|
146
|
+
...(input.evaluationName !== undefined ? { evaluationName: input.evaluationName } : {}),
|
|
147
|
+
}, context.signal),
|
|
148
|
+
}),
|
|
149
|
+
defineTool({
|
|
150
|
+
name: 'get_evaluation',
|
|
151
|
+
title: 'Get evaluation',
|
|
152
|
+
description: 'Returns the current configured version of evaluationId.',
|
|
153
|
+
access: 'readOnly',
|
|
154
|
+
inputSchema: evaluationInputSchema,
|
|
155
|
+
execute: ({ evaluationId }) => actions.getEvaluation(context.actions, evaluationId, undefined, context.signal),
|
|
156
|
+
}),
|
|
157
|
+
defineTool({
|
|
158
|
+
name: 'update_evaluation_title',
|
|
159
|
+
title: 'Update evaluation title',
|
|
160
|
+
description: 'Updates evaluationId in workspaceId and refreshes its workspace listing. This changes account state.',
|
|
161
|
+
access: 'stateChanging',
|
|
162
|
+
inputSchema: updateEvaluationTitleInputSchema,
|
|
163
|
+
execute: (input) => actions.updateEvaluationTitle(context.actions, {
|
|
164
|
+
workspaceId: input.workspaceId,
|
|
165
|
+
evaluationId: input.evaluationId,
|
|
166
|
+
evaluationName: input.evaluationName,
|
|
167
|
+
userSystemId: input.userSystemId,
|
|
168
|
+
...(input.description !== undefined ? { description: input.description } : {}),
|
|
169
|
+
...(input.page !== undefined ? { page: input.page } : {}),
|
|
170
|
+
...(input.size !== undefined ? { size: input.size } : {}),
|
|
171
|
+
}, context.signal),
|
|
172
|
+
}),
|
|
173
|
+
defineTool({
|
|
174
|
+
name: 'list_models',
|
|
175
|
+
title: 'List enabled models',
|
|
176
|
+
description: 'Lists evaluation models enabled for the authenticated account.',
|
|
177
|
+
access: 'readOnly',
|
|
178
|
+
inputSchema: emptyInputSchema,
|
|
179
|
+
execute: () => actions.getModels(context.actions, context.signal),
|
|
180
|
+
}),
|
|
181
|
+
defineTool({
|
|
182
|
+
name: 'create_quality_standard',
|
|
183
|
+
title: 'Create quality standard',
|
|
184
|
+
description: 'Creates a quality standard from a rubric and scored anchors. This changes state.',
|
|
185
|
+
access: 'stateChanging',
|
|
186
|
+
inputSchema: qualityStandardInputSchema,
|
|
187
|
+
execute: (input) => actions.createQualityStandard(context.actions, input, context.signal),
|
|
188
|
+
}),
|
|
189
|
+
defineTool({
|
|
190
|
+
name: 'get_quality_standard',
|
|
191
|
+
title: 'Get quality standard',
|
|
192
|
+
description: 'Returns the quality standard identified by qualityStandardId.',
|
|
193
|
+
access: 'readOnly',
|
|
194
|
+
inputSchema: qualityStandardIdInputSchema,
|
|
195
|
+
execute: ({ qualityStandardId }) => actions.getQualityStandard(context.actions, qualityStandardId, context.signal),
|
|
196
|
+
}),
|
|
197
|
+
defineTool({
|
|
198
|
+
name: 'assign_quality_standard',
|
|
199
|
+
title: 'Assign quality standard',
|
|
200
|
+
description: 'Associates qualityStandardId with workspaceId. This changes the workspace configuration.',
|
|
201
|
+
access: 'stateChanging',
|
|
202
|
+
inputSchema: assignQualityStandardInputSchema,
|
|
203
|
+
execute: (input) => actions.assignQualityStandard(context.actions, input, context.signal),
|
|
204
|
+
}),
|
|
205
|
+
defineTool({
|
|
206
|
+
name: 'validate_configured_evaluation',
|
|
207
|
+
title: 'Validate configured evaluation',
|
|
208
|
+
description: 'Validates scenario, conversation, or agent-trace input against account-enabled models without creating versions or a run.',
|
|
209
|
+
access: 'readOnly',
|
|
210
|
+
inputSchema: validateConfiguredEvaluationInputSchema,
|
|
211
|
+
execute: ({ input }) => actions.validateConfiguredEvaluation(context.actions, parseConfiguredRunInput(input), context.signal),
|
|
212
|
+
}),
|
|
213
|
+
defineTool({
|
|
214
|
+
name: 'run_configured_evaluation',
|
|
215
|
+
title: 'Configure and run evaluation',
|
|
216
|
+
description: 'Validates input, creates methodology and configuration versions for evaluationId, submits one evaluation run, and returns its identifiers and initial status without waiting for completion. Poll with get_run_status, then call get_results. This changes state and may incur evaluation usage.',
|
|
217
|
+
access: 'stateChanging',
|
|
218
|
+
inputSchema: runConfiguredEvaluationInputSchema,
|
|
219
|
+
execute: ({ evaluationId, input }) => actions.submitConfiguredEvaluation(context.actions, {
|
|
220
|
+
evaluationId,
|
|
221
|
+
configuredRun: parseConfiguredRunInput(input),
|
|
222
|
+
...actionSignal(context),
|
|
223
|
+
}),
|
|
224
|
+
}),
|
|
225
|
+
defineTool({
|
|
226
|
+
name: 'run_evaluation',
|
|
227
|
+
title: 'Run configured evaluation',
|
|
228
|
+
description: 'Submits a run for the current saved configuration of evaluationId and returns its identifiers and initial status without waiting for completion. Poll with get_run_status, then call get_results. This changes state and may incur evaluation usage.',
|
|
229
|
+
access: 'stateChanging',
|
|
230
|
+
inputSchema: runInputSchema,
|
|
231
|
+
execute: ({ evaluationId }) => actions.submitEvaluation(context.actions, {
|
|
232
|
+
evaluationId,
|
|
233
|
+
...actionSignal(context),
|
|
234
|
+
}),
|
|
235
|
+
}),
|
|
236
|
+
defineTool({
|
|
237
|
+
name: 'get_run_status',
|
|
238
|
+
title: 'Get run status',
|
|
239
|
+
description: 'Returns the current status of runId for evaluationId.',
|
|
240
|
+
access: 'readOnly',
|
|
241
|
+
inputSchema: runReferenceInputSchema,
|
|
242
|
+
execute: (input) => actions.getRunStatus(context.actions, input, context.signal),
|
|
243
|
+
}),
|
|
244
|
+
defineTool({
|
|
245
|
+
name: 'get_results',
|
|
246
|
+
title: 'Get evaluation results',
|
|
247
|
+
description: 'Returns context-specific results for runId and evaluationId, waiting briefly when result readers are not ready.',
|
|
248
|
+
access: 'readOnly',
|
|
249
|
+
inputSchema: runReferenceInputSchema,
|
|
250
|
+
execute: ({ evaluationId, runId }) => actions.getResults(context.actions, {
|
|
251
|
+
evaluationId,
|
|
252
|
+
runId,
|
|
253
|
+
clock: context.clock,
|
|
254
|
+
resultReadyIntervalMs: context.configuration.resultReadyIntervalMs,
|
|
255
|
+
resultReadyTimeoutMs: context.configuration.resultReadyTimeoutMs,
|
|
256
|
+
...actionSignal(context),
|
|
257
|
+
}),
|
|
258
|
+
}),
|
|
259
|
+
];
|
|
260
|
+
}
|
|
261
|
+
function toolAnnotations(access) {
|
|
262
|
+
return access === 'readOnly'
|
|
263
|
+
? {
|
|
264
|
+
readOnlyHint: true,
|
|
265
|
+
destructiveHint: false,
|
|
266
|
+
idempotentHint: true,
|
|
267
|
+
openWorldHint: true,
|
|
268
|
+
}
|
|
269
|
+
: {
|
|
270
|
+
readOnlyHint: false,
|
|
271
|
+
destructiveHint: false,
|
|
272
|
+
idempotentHint: false,
|
|
273
|
+
openWorldHint: true,
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
export function registerAutoevalMcpTools(server, tools) {
|
|
277
|
+
for (const tool of tools) {
|
|
278
|
+
server.registerTool(tool.name, {
|
|
279
|
+
title: tool.title,
|
|
280
|
+
description: tool.description,
|
|
281
|
+
inputSchema: tool.inputSchema,
|
|
282
|
+
outputSchema: mcpToolOutputSchema,
|
|
283
|
+
annotations: toolAnnotations(tool.access),
|
|
284
|
+
}, (input) => tool.invoke(input));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/mcp/tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,GAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,mCAAmC,GACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EACL,gCAAgC,EAChC,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,cAAc,EA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B,CACtC,MAAiB,EACjB,KAAiC;IAEjC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,CAAC,YAAY,CACjB,IAAI,CAAC,IAAI,EACT;YACE,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,mBAAmB;YACjC,WAAW,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,CAAC;SAC1C,EACD,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAC9B,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/mcp.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":""}
|
package/dist/mcp.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { serveStdio } from '@modelcontextprotocol/server/stdio';
|
|
3
|
+
import { redactText } from './auth/redact.js';
|
|
4
|
+
import { loadConfiguration } from './config.js';
|
|
5
|
+
import { asAutoevalError } from './errors/autoeval-error.js';
|
|
6
|
+
import { createAutoevalMcpContext } from './mcp/context.js';
|
|
7
|
+
import { createAutoevalMcpServer } from './mcp/server.js';
|
|
8
|
+
const abortController = new AbortController();
|
|
9
|
+
const handle = serveStdio(async () => {
|
|
10
|
+
const configuration = loadConfiguration();
|
|
11
|
+
const context = await createAutoevalMcpContext({
|
|
12
|
+
configuration,
|
|
13
|
+
signal: abortController.signal,
|
|
14
|
+
});
|
|
15
|
+
return createAutoevalMcpServer(context);
|
|
16
|
+
}, {
|
|
17
|
+
onerror: (error) => {
|
|
18
|
+
const normalized = asAutoevalError(error);
|
|
19
|
+
process.stderr.write(`Autoeval MCP error: ${redactText(normalized.message)}\n`);
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
async function stop(reason) {
|
|
23
|
+
abortController.abort(new Error(reason));
|
|
24
|
+
await handle.close();
|
|
25
|
+
}
|
|
26
|
+
process.once('SIGINT', () => {
|
|
27
|
+
void stop('interrupted');
|
|
28
|
+
});
|
|
29
|
+
process.once('SIGTERM', () => {
|
|
30
|
+
void stop('terminated');
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=mcp.js.map
|
package/dist/mcp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAEhE,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,MAAM,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC;AAE9C,MAAM,MAAM,GAAG,UAAU,CACvB,KAAK,IAAI,EAAE;IACT,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;IAC1C,MAAM,OAAO,GAAG,MAAM,wBAAwB,CAAC;QAC7C,aAAa;QACb,MAAM,EAAE,eAAe,CAAC,MAAM;KAC/B,CAAC,CAAC;IACH,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAC1C,CAAC,EACD;IACE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACjB,MAAM,UAAU,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;QAC1C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAClF,CAAC;CACF,CACF,CAAC;AAEF,KAAK,UAAU,IAAI,CAAC,MAAc;IAChC,eAAe,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACzC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACvB,CAAC;AAED,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,GAAG,EAAE;IAC1B,KAAK,IAAI,CAAC,aAAa,CAAC,CAAC;AAC3B,CAAC,CAAC,CAAC;AACH,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,GAAG,EAAE;IAC3B,KAAK,IAAI,CAAC,YAAY,CAAC,CAAC;AAC1B,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Render a short numeric string (e.g. `4.7`) as large block digits, with the
|
|
3
|
+
* suffix (`/ 5 overall`) dimmed on the bottom row. Bold bright digits carry
|
|
4
|
+
* the score; colour is chalk-mediated, so pipes and NO_COLOR get plain text.
|
|
5
|
+
*/
|
|
6
|
+
export declare function renderBigScore(value: string, suffix: string): string[];
|
|
7
|
+
//# sourceMappingURL=big-digits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"big-digits.d.ts","sourceRoot":"","sources":["../../src/output/big-digits.ts"],"names":[],"mappings":"AA0BA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAatE"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { paint } from './colors.js';
|
|
2
|
+
/**
|
|
3
|
+
* Five-row block font for result scores. Only the glyphs a rendered score can
|
|
4
|
+
* contain exist: digits, a decimal point, and a minus sign. Anything else maps
|
|
5
|
+
* to a blank column so an unexpected value degrades to a gap instead of an
|
|
6
|
+
* exception inside result rendering.
|
|
7
|
+
*/
|
|
8
|
+
const GLYPH_WIDTH = 3;
|
|
9
|
+
const BLANK = Array.from({ length: 5 }, () => ' '.repeat(GLYPH_WIDTH));
|
|
10
|
+
const GLYPHS = {
|
|
11
|
+
'0': ['███', '█ █', '█ █', '█ █', '███'],
|
|
12
|
+
'1': [' █ ', ' █ ', ' █ ', ' █ ', ' █ '],
|
|
13
|
+
'2': ['███', ' █', '███', '█ ', '███'],
|
|
14
|
+
'3': ['███', ' █', '███', ' █', '███'],
|
|
15
|
+
'4': ['█ █', '█ █', '███', ' █', ' █'],
|
|
16
|
+
'5': ['███', '█ ', '███', ' █', '███'],
|
|
17
|
+
'6': ['███', '█ ', '███', '█ █', '███'],
|
|
18
|
+
'7': ['███', ' █', ' █', ' █', ' █'],
|
|
19
|
+
'8': ['███', '█ █', '███', '█ █', '███'],
|
|
20
|
+
'9': ['███', '█ █', '███', ' █', '███'],
|
|
21
|
+
'.': [' ', ' ', ' ', ' ', ' █ '],
|
|
22
|
+
'-': [' ', ' ', '███', ' ', ' '],
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Render a short numeric string (e.g. `4.7`) as large block digits, with the
|
|
26
|
+
* suffix (`/ 5 overall`) dimmed on the bottom row. Bold bright digits carry
|
|
27
|
+
* the score; colour is chalk-mediated, so pipes and NO_COLOR get plain text.
|
|
28
|
+
*/
|
|
29
|
+
export function renderBigScore(value, suffix) {
|
|
30
|
+
const rows = [];
|
|
31
|
+
for (let row = 0; row < 5; row += 1) {
|
|
32
|
+
// Array.from iterates code points; a plain spread would trip the repo's
|
|
33
|
+
// string-splitting lint rule.
|
|
34
|
+
const line = Array.from(value)
|
|
35
|
+
.map((char) => (GLYPHS[char] ?? BLANK)[row] ?? ' ')
|
|
36
|
+
.join(' ');
|
|
37
|
+
rows.push(paint.heading(paint.input(line)));
|
|
38
|
+
}
|
|
39
|
+
const bottom = rows.length - 1;
|
|
40
|
+
rows[bottom] = `${rows[bottom]} ${paint.meta(suffix)}`;
|
|
41
|
+
return rows;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=big-digits.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C,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IACxC,GAAG,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;CACzC,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,KAAa,EAAE,MAAc;IAC1D,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACpC,wEAAwE;QACxE,8BAA8B;QAC9B,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;aAC3B,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC;aACpD,IAAI,CAAC,GAAG,CAAC,CAAC;QACb,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;IACxD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded, shell-free clipboard access for terminal output.
|
|
3
|
+
*
|
|
4
|
+
* Two mechanisms, in order:
|
|
5
|
+
* 1. the platform clipboard helper (`pbcopy`, `wl-copy`, `xclip`, `clip.exe`),
|
|
6
|
+
* invoked with a fixed executable and a fixed argument array — never a
|
|
7
|
+
* shell — and fed through stdin so the copied text is never interpolated
|
|
8
|
+
* into a command line;
|
|
9
|
+
* 2. an OSC 52 escape written to the terminal, which is the only mechanism
|
|
10
|
+
* that works over SSH or inside a multiplexer.
|
|
11
|
+
*
|
|
12
|
+
* Copy payloads are bounded: OSC 52 is refused by terminals past a few
|
|
13
|
+
* kilobytes anyway, and an unbounded write would let a large backend response
|
|
14
|
+
* flood the terminal.
|
|
15
|
+
*/
|
|
16
|
+
/** Upper bound on a single copy payload. */
|
|
17
|
+
export declare const MAX_CLIPBOARD_BYTES: number;
|
|
18
|
+
export interface ClipboardWriter {
|
|
19
|
+
/** Resolves when the text has been handed to the clipboard. */
|
|
20
|
+
copy(text: string): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/** OSC 52 sequence carrying the base64 payload to the terminal emulator. */
|
|
23
|
+
export declare function osc52Sequence(text: string): string;
|
|
24
|
+
export declare function createClipboardWriter(input: {
|
|
25
|
+
/** Stream used for the OSC 52 fallback; usually the surface or stdout. */
|
|
26
|
+
write: (chunk: string) => void;
|
|
27
|
+
platform?: NodeJS.Platform;
|
|
28
|
+
}): ClipboardWriter;
|
|
29
|
+
//# sourceMappingURL=clipboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.d.ts","sourceRoot":"","sources":["../../src/output/clipboard.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,4CAA4C;AAC5C,eAAO,MAAM,mBAAmB,QAAY,CAAC;AAI7C,MAAM,WAAW,eAAe;IAC9B,+DAA+D;IAC/D,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnC;AAmBD,4EAA4E;AAC5E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAgCD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,0EAA0E;IAC1E,KAAK,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;CAC5B,GAAG,eAAe,CAclB"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bounded, shell-free clipboard access for terminal output.
|
|
3
|
+
*
|
|
4
|
+
* Two mechanisms, in order:
|
|
5
|
+
* 1. the platform clipboard helper (`pbcopy`, `wl-copy`, `xclip`, `clip.exe`),
|
|
6
|
+
* invoked with a fixed executable and a fixed argument array — never a
|
|
7
|
+
* shell — and fed through stdin so the copied text is never interpolated
|
|
8
|
+
* into a command line;
|
|
9
|
+
* 2. an OSC 52 escape written to the terminal, which is the only mechanism
|
|
10
|
+
* that works over SSH or inside a multiplexer.
|
|
11
|
+
*
|
|
12
|
+
* Copy payloads are bounded: OSC 52 is refused by terminals past a few
|
|
13
|
+
* kilobytes anyway, and an unbounded write would let a large backend response
|
|
14
|
+
* flood the terminal.
|
|
15
|
+
*/
|
|
16
|
+
import { spawn } from 'node:child_process';
|
|
17
|
+
/** Upper bound on a single copy payload. */
|
|
18
|
+
export const MAX_CLIPBOARD_BYTES = 64 * 1024;
|
|
19
|
+
const COPY_TIMEOUT_MS = 2_000;
|
|
20
|
+
function platformCommands(platform) {
|
|
21
|
+
switch (platform) {
|
|
22
|
+
case 'darwin':
|
|
23
|
+
return [{ command: 'pbcopy', args: [] }];
|
|
24
|
+
case 'win32':
|
|
25
|
+
return [{ command: 'clip.exe', args: [] }];
|
|
26
|
+
default:
|
|
27
|
+
return [
|
|
28
|
+
{ command: 'wl-copy', args: [] },
|
|
29
|
+
{ command: 'xclip', args: ['-selection', 'clipboard'] },
|
|
30
|
+
{ command: 'xsel', args: ['--clipboard', '--input'] },
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
/** OSC 52 sequence carrying the base64 payload to the terminal emulator. */
|
|
35
|
+
export function osc52Sequence(text) {
|
|
36
|
+
return `\u001B]52;c;${Buffer.from(text, 'utf8').toString('base64')}\u0007`;
|
|
37
|
+
}
|
|
38
|
+
function runCopyCommand(entry, text) {
|
|
39
|
+
return new Promise((resolve) => {
|
|
40
|
+
let child;
|
|
41
|
+
try {
|
|
42
|
+
child = spawn(entry.command, [...entry.args], { stdio: ['pipe', 'ignore', 'ignore'] });
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
resolve(false);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
let settled = false;
|
|
49
|
+
const finish = (value) => {
|
|
50
|
+
if (settled)
|
|
51
|
+
return;
|
|
52
|
+
settled = true;
|
|
53
|
+
clearTimeout(timer);
|
|
54
|
+
resolve(value);
|
|
55
|
+
};
|
|
56
|
+
const timer = setTimeout(() => {
|
|
57
|
+
child.kill();
|
|
58
|
+
finish(false);
|
|
59
|
+
}, COPY_TIMEOUT_MS);
|
|
60
|
+
timer.unref?.();
|
|
61
|
+
child.once('error', () => finish(false));
|
|
62
|
+
child.once('close', (code) => finish(code === 0));
|
|
63
|
+
child.stdin?.on('error', () => finish(false));
|
|
64
|
+
child.stdin?.end(text);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
export function createClipboardWriter(input) {
|
|
68
|
+
const commands = platformCommands(input.platform ?? process.platform);
|
|
69
|
+
return {
|
|
70
|
+
async copy(text) {
|
|
71
|
+
const payload = Buffer.byteLength(text, 'utf8') > MAX_CLIPBOARD_BYTES
|
|
72
|
+
? Buffer.from(text, 'utf8').subarray(0, MAX_CLIPBOARD_BYTES).toString('utf8')
|
|
73
|
+
: text;
|
|
74
|
+
for (const entry of commands) {
|
|
75
|
+
if (await runCopyCommand(entry, payload))
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
input.write(osc52Sequence(payload));
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=clipboard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clipboard.js","sourceRoot":"","sources":["../../src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,mBAAmB;gBACnD,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAC7E,CAAC,CAAC,IAAI,CAAC;YACX,KAAK,MAAM,KAAK,IAAI,QAAQ,EAAE,CAAC;gBAC7B,IAAI,MAAM,cAAc,CAAC,KAAK,EAAE,OAAO,CAAC;oBAAE,OAAO;YACnD,CAAC;YACD,KAAK,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;QACtC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Semantic colour vocabulary for the line-based CLI.
|
|
3
|
+
*
|
|
4
|
+
* Colour carries meaning, never decoration: pass/positive is green, warning is
|
|
5
|
+
* yellow, failure or regression is red, identifiers and metadata are dim, and
|
|
6
|
+
* user input is cyan. Chalk disables itself for pipes, `NO_COLOR`, and
|
|
7
|
+
* non-TTY streams, so the same renderers stay pipe-safe.
|
|
8
|
+
*/
|
|
9
|
+
export declare const paint: {
|
|
10
|
+
readonly pass: (value: string) => string;
|
|
11
|
+
readonly warn: (value: string) => string;
|
|
12
|
+
readonly fail: (value: string) => string;
|
|
13
|
+
/** Identifiers and other reference metadata recede behind the content. */
|
|
14
|
+
readonly meta: (value: string) => string;
|
|
15
|
+
/** Echoed user input. */
|
|
16
|
+
readonly input: (value: string) => string;
|
|
17
|
+
readonly heading: (value: string) => string;
|
|
18
|
+
readonly header: (value: string) => string;
|
|
19
|
+
};
|
|
20
|
+
export type SemanticTone = keyof typeof paint;
|
|
21
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../../src/output/colors.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,eAAO,MAAM,KAAK;2BACF,MAAM,KAAG,MAAM;2BACf,MAAM,KAAG,MAAM;2BACf,MAAM,KAAG,MAAM;IAC7B,0EAA0E;2BAC5D,MAAM,KAAG,MAAM;IAC7B,yBAAyB;4BACV,MAAM,KAAG,MAAM;8BACb,MAAM,KAAG,MAAM;6BAChB,MAAM,KAAG,MAAM;CACvB,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,KAAK,CAAC"}
|