@modality-counter/core 2.4.0 → 2.5.1

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.
@@ -50,8 +50,8 @@ export declare function liftDottedParams(input: unknown): unknown;
50
50
  export declare function camelCaseParamKeys(input: unknown): unknown;
51
51
  export declare const heroMethodSchema: z.ZodPreprocess<z.ZodObject<{
52
52
  method: z.ZodString;
53
- params: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodAny>>>;
54
- }, z.core.$strip>>;
53
+ params: z.ZodOptional<z.ZodPreprocess<z.ZodRecord<z.ZodString, z.ZodAny>, unknown>>;
54
+ }, z.core.$strip>, unknown>;
55
55
  export type HeroMethodType = z.infer<typeof heroMethodSchema>;
56
56
  export declare const heroDeploySchema: z.ZodObject<{
57
57
  callSign: z.ZodString;
@@ -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
@@ -2,7 +2,7 @@ import { z } from "zod";
2
2
  export declare const GenericProtocolSchema: z.ZodObject<{
3
3
  name: z.ZodString;
4
4
  description: z.ZodString;
5
- }, z.core.$catchall<z.ZodRecord<z.ZodString, z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>>;
5
+ }, z.core.$catchall<z.ZodRecord<z.ZodString, z.ZodSchema<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>>;
6
6
  export type GenericProtocol = z.infer<typeof GenericProtocolSchema>;
7
7
  export declare function validateGenericProtocol(data: unknown): {
8
8
  success: boolean;
@@ -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
+ };
@@ -25,7 +25,10 @@ declare class FuzzyFinder<T extends {
25
25
  tokenize: boolean;
26
26
  locale: string;
27
27
  constructor(items: T[], options?: FuzzyFinderOptions);
28
+ segmentWords(chunk: string): string[];
28
29
  getTokens(query: string): string[];
30
+ wildcardToRegExp(token: string): RegExp;
31
+ scoreWildcardToken(item: string, token: string): ScoreResult | null;
29
32
  scoreToken(item: string, token: string): ScoreResult | null;
30
33
  score(item: string, query: string): ScoreResult | null;
31
34
  isWordBoundary(str: string, idx: number): boolean;
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2.4.0",
2
+ "version": "2.5.1",
3
3
  "name": "@modality-counter/core",
4
4
  "repository": {
5
5
  "type": "git",
@@ -14,25 +14,26 @@
14
14
  "author": "Hill <hill@kimo.com>",
15
15
  "license": "ISC",
16
16
  "peerDependencies": {
17
- "modality-mcp-kit": "^2.0.2",
18
- "react": "^19.2.7",
19
- "react-dom": "^19.2.7"
17
+ "modality-mcp-kit": "^2.1.0",
18
+ "react": "^19.3.0",
19
+ "react-dom": "^19.3.0"
20
20
  },
21
21
  "dependencies": {
22
22
  "@mdx-js/esbuild": "^3.1.1",
23
- "modality-ai": "^0.7.5",
24
- "modality-kit": "^0.17.12",
23
+ "get-safe-reg": "^0.7.1",
24
+ "modality-ai": "^0.8.3",
25
+ "modality-kit": "^0.19.0",
25
26
  "modality-safe": "^0.4.1",
26
27
  "node-html-markdown": "^2.0.0",
27
28
  "remark-frontmatter": "^5.0.0",
28
29
  "reshow-build": "^1.19.2",
29
30
  "ucfirst-js": "^0.2.0",
30
- "yaml": "^2.9.0"
31
+ "yaml": "^2.9.1"
31
32
  },
32
33
  "devDependencies": {
33
- "@types/react": "^19.2.17",
34
- "@types/react-dom": "^19.2.3",
35
- "modality-bun-kit": "^1.3.14-1",
34
+ "@types/react": "^19.3.0",
35
+ "@types/react-dom": "^19.3.0",
36
+ "modality-bun-kit": "^1.4.2",
36
37
  "xdm": "3.4.0"
37
38
  },
38
39
  "exports": {