@modality-counter/core 1.7.4 → 2.0.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.
@@ -17,12 +17,16 @@ export { validateProtocolFile } from "./schemas/protocol-validation.js";
17
17
  export { extractCodeBlocks, extractYamlBlocks, readMdxPrompt, readMdxYaml, readPrompt, } from "./util_prompts";
18
18
  export { readMdx, importMdx } from "./util_mdx";
19
19
  /**
20
- * Test setups
20
+ * Test setups (validation setup functions)
21
21
  */
22
- export { setupCategoryLinkValidation } from "./__tests__/CategoryLinkValidation.test.js";
23
- export { setupMethodValidation } from "./__tests__/MethodValidation.test.js";
24
- export { setupPersonaValidation } from "./__tests__/PersonaValidation.test.js";
25
- export { setupTemplateValidation } from "./__tests__/TemplateValidator.test.js";
22
+ export { setupCategoryLinkValidation } from "./tools/setupCategoryLinkValidation.js";
23
+ export { setupMethodValidation } from "./tools/setupMethodValidation.js";
24
+ export { setupPersonaValidation } from "./tools/setupPersonaValidation.js";
25
+ export { setupTemplateValidation } from "./tools/setupTemplateValidation.js";
26
+ /**
27
+ * Validation
28
+ */
29
+ export { setupSingleMethodValidation } from "./tools/setupSingleMethodValidation.js";
26
30
  /**
27
31
  * Protocols
28
32
  */
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Validates ALL method files by delegating each to setupSingleMethodValidation.
3
+ *
4
+ * @param baseDir - Root directory to scan for method files
5
+ */
6
+ export declare function setupMethodValidation(baseDir: string): Promise<void>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Strip runtime-added fields that aren't part of the file schema.
3
+ * Shared between setupSingleMethodValidation and its test suite.
4
+ */
5
+ export declare function stripRuntimeFields(promptData: any): void;
6
+ /**
7
+ * Validate a single method file against the Zod schema.
8
+ * Follows the same describe/test pattern as setupMethodValidation.
9
+ *
10
+ * @param filePath - Absolute path to a method .mdx file
11
+ */
12
+ export declare function setupSingleMethodValidation(filePath: string): void;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.7.4",
2
+ "version": "2.0.0",
3
3
  "name": "@modality-counter/core",
4
4
  "repository": {
5
5
  "type": "git",
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@mdx-js/esbuild": "^3.1.1",
23
- "modality-ai": "^0.7.1",
23
+ "modality-ai": "^0.7.5",
24
24
  "modality-kit": "^0.17.12",
25
25
  "modality-safe": "^0.4.1",
26
26
  "node-html-markdown": "^2.0.0",
@@ -1,10 +0,0 @@
1
- /**
2
- * General Method Validation Test Suite
3
- *
4
- * Validates ALL method files against the Zod schema.
5
- * Uses getAllCounterItems for discovery, getCounterContent for data.
6
- */
7
- /**
8
- * Setup method validation tests - can be imported and reused in other projects
9
- */
10
- export declare function setupMethodValidation(baseDir: string): Promise<void>;
@@ -1,23 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * 🎯 Counter Universal Validation Tool - Zod Edition
4
- *
5
- * Modern TypeScript-first validation tool for Counter method and template files
6
- * using Zod schemas for type-safe validation with excellent error messages.
7
- *
8
- * Usage:
9
- * bun run validate-counter [--type=methods|templates|protocols|personas|all] [--report]
10
- * bun run validate-counter --verify-protocols [--report]
11
- *
12
- * Features:
13
- * - Type-safe validation with Zod schemas
14
- * - Automatic TypeScript type generation
15
- * - Superior error messages and debugging
16
- * - Support for both flat array and nested object expected_output
17
- * - Quality scoring and compliance assessment
18
- */
19
- import type { MethodValidationResult, TemplateValidationResult } from "../schemas/validation-types.js";
20
- export declare function calculateQualityScore(result: Pick<MethodValidationResult, "errors" | "warnings" | "advisories">): number;
21
- export declare function calculateTemplateQualityScore(result: Pick<TemplateValidationResult, "errors" | "warnings" | "advisories">): number;
22
- export declare function validateWithQuality(data: unknown, type: "method" | "template"): MethodValidationResult;
23
- export declare function validateTemplateWithQuality(data: unknown): TemplateValidationResult;