@modality-counter/core 2.4.0 → 2.5.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.
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import type { PersonaValidationResult } from "./validation-types.js";
2
+ import { type PersonaValidationResult } from "./validation-types.js";
3
3
  /**
4
4
  * Zod Schema for Counter Persona Validation
5
5
  * TypeScript-first validation for Counter persona definition files
@@ -88,3 +88,25 @@ export interface ValidationResults {
88
88
  export type ExpectedOutputLimits = typeof EXPECTED_OUTPUT_LIMITS;
89
89
  export type MethodLimits = typeof METHOD_LIMITS;
90
90
  export type PurposeLimits = typeof PURPOSE_LIMITS;
91
+ /**
92
+ * Run a Zod schema against data and return a uniform { success, data, errors } result.
93
+ * Errors are formatted as "<prefix><path>: <message>".
94
+ */
95
+ export declare function validateWithSchema<T>(schema: {
96
+ safeParse: (data: unknown) => {
97
+ success: true;
98
+ data: T;
99
+ } | {
100
+ success: false;
101
+ error: {
102
+ issues: {
103
+ path: PropertyKey[];
104
+ message: string;
105
+ }[];
106
+ };
107
+ };
108
+ }, data: unknown, prefix?: string): {
109
+ success: boolean;
110
+ data?: T;
111
+ errors?: string[];
112
+ };
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.4.0",
2
+ "version": "2.5.0",
3
3
  "name": "@modality-counter/core",
4
4
  "repository": {
5
5
  "type": "git",