diff --git a/src/shared/constants/cliTools.ts b/src/shared/constants/cliTools.ts index 58e78b01c4..297d615acc 100644 --- a/src/shared/constants/cliTools.ts +++ b/src/shared/constants/cliTools.ts @@ -815,31 +815,3 @@ export function listCliTools(): CliToolEntry[] { export function getCliTool(id: string): CliToolEntry | undefined { return CLI_TOOLS[id]; } - -// ─── Provider model mapping helper ─────────────────────────────────────────── - -// Get all provider models for mapping dropdown -export const getProviderModelsForMapping = ( - providers: Array<{ - id: string; - isActive: boolean; - testStatus: string; - provider: string; - name: string; - models?: string[]; - }> -) => { - const result: Array<{ connectionId: string; provider: string; name: string; models: string[] }> = - []; - providers.forEach((conn) => { - if (conn.isActive && (conn.testStatus === "active" || conn.testStatus === "success")) { - result.push({ - connectionId: conn.id, - provider: conn.provider, - name: conn.name, - models: conn.models || [], - }); - } - }); - return result; -}; diff --git a/src/shared/utils/a11yAudit.ts b/src/shared/utils/a11yAudit.ts index 6f8738066e..5c06c1ad78 100644 --- a/src/shared/utils/a11yAudit.ts +++ b/src/shared/utils/a11yAudit.ts @@ -122,26 +122,6 @@ export function getContrastRatio(fgHex, bgHex) { return (lighter + 0.05) / (darker + 0.05); } -/** - * Check WCAG AA contrast compliance between foreground and background colors. - * - * @param {string} fgHex - Foreground color (#RRGGBB) - * @param {string} bgHex - Background color (#RRGGBB) - * @param {{ largeText?: boolean }} [options={}] - Options - * @returns {{ ratio: number, aa: boolean, aaa: boolean }} - */ -export function checkContrast(fgHex, bgHex, options: any = {}) { - const ratio = getContrastRatio(fgHex, bgHex); - const minAA = options.largeText ? 3 : 4.5; - const minAAA = options.largeText ? 4.5 : 7; - - return { - ratio: Math.round(ratio * 100) / 100, - aa: ratio >= minAA, - aaa: ratio >= minAAA, - }; -} - /** * Generate a summary report from a list of violations. * diff --git a/src/shared/validation/helpers.ts b/src/shared/validation/helpers.ts index 486b5de8f6..395388b314 100644 --- a/src/shared/validation/helpers.ts +++ b/src/shared/validation/helpers.ts @@ -1,9 +1,5 @@ import { z } from "zod"; -export const loginSchema = z.object({ - password: z.string().min(1, "Password is required").max(200), -}); - type ValidationErrorDetail = { field: string; message: string; diff --git a/tests/unit/batch-b-final.test.ts b/tests/unit/batch-b-final.test.ts index db930c9e0b..91c64dd5b6 100644 --- a/tests/unit/batch-b-final.test.ts +++ b/tests/unit/batch-b-final.test.ts @@ -271,6 +271,14 @@ describe("a11yAudit", () => { assert.equal(report.total, 0); }); + it("should not export the removed contrast compliance wrapper", async () => { + const audit = await import("../../src/shared/utils/a11yAudit.ts"); + assert.equal("checkContrast" in audit, false); + assert.equal(typeof audit.getContrastRatio, "function"); + assert.equal(typeof audit.auditHTML, "function"); + assert.equal(typeof audit.generateReport, "function"); + }); + it("should export WCAG rules", () => { assert.ok(WCAG_RULES.ARIA_LABEL); assert.ok(WCAG_RULES.COLOR_CONTRAST); diff --git a/tests/unit/cli-tools-schema.test.ts b/tests/unit/cli-tools-schema.test.ts index 7c3a243908..70e6d620f0 100644 --- a/tests/unit/cli-tools-schema.test.ts +++ b/tests/unit/cli-tools-schema.test.ts @@ -77,3 +77,8 @@ test("getCliTool returns correct tool by id", async () => { const missing = getCliTool("nonexistent"); assert.equal(missing, undefined); }); + +test("CLI tools registry does not export provider model mapping helper", async () => { + const registry = await import("../../src/shared/constants/cliTools.ts"); + assert.equal("getProviderModelsForMapping" in registry, false); +}); diff --git a/tests/unit/modular-schemas.test.ts b/tests/unit/modular-schemas.test.ts index 4fdbc2842c..e7270e3593 100644 --- a/tests/unit/modular-schemas.test.ts +++ b/tests/unit/modular-schemas.test.ts @@ -33,3 +33,10 @@ test("modular schemas: loginSchema validates correctly", () => { }); assert.equal(invalid.success, false); }); + +test("validation helpers only export request-body helper APIs", async () => { + const helpers = await import("../../src/shared/validation/helpers.ts"); + assert.equal("loginSchema" in helpers, false); + assert.equal(typeof helpers.validateBody, "function"); + assert.equal(typeof helpers.isValidationFailure, "function"); +});