@modality-counter/core 0.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.
Files changed (32) hide show
  1. package/dist/index.js +1989 -0
  2. package/dist/types/__tests__/CategoryLinkValidation.test.d.ts +13 -0
  3. package/dist/types/__tests__/MethodValidation.test.d.ts +10 -0
  4. package/dist/types/__tests__/PersonaValidation.test.d.ts +10 -0
  5. package/dist/types/__tests__/TemplateValidator.test.d.ts +19 -0
  6. package/dist/types/__tests__/security-integrity.test.d.ts +1 -0
  7. package/dist/types/__tests__/security-validation.test.d.ts +1 -0
  8. package/dist/types/confs/const.d.ts +2 -0
  9. package/dist/types/confs/domain-config.d.ts +27 -0
  10. package/dist/types/counter_aliases.d.ts +55 -0
  11. package/dist/types/index.d.ts +25 -0
  12. package/dist/types/mcp_counter.d.ts +5 -0
  13. package/dist/types/protocols/__tests__/BehaviorProtocol.test.d.ts +1 -0
  14. package/dist/types/protocols/__tests__/PartyModeProtocol.test.d.ts +1 -0
  15. package/dist/types/protocols/__tests__/ProtocolValidation.test.d.ts +1 -0
  16. package/dist/types/schemas/ExecutionFlow.d.ts +11 -0
  17. package/dist/types/schemas/counter_schemas.d.ts +31 -0
  18. package/dist/types/schemas/methodology-validation.d.ts +180 -0
  19. package/dist/types/schemas/persona-validation.d.ts +68 -0
  20. package/dist/types/schemas/protocol-validation.d.ts +19 -0
  21. package/dist/types/schemas/template-validation.d.ts +84 -0
  22. package/dist/types/schemas/validation-types.d.ts +90 -0
  23. package/dist/types/tools/validate-counter.d.ts +23 -0
  24. package/dist/types/util_counter_data.d.ts +45 -0
  25. package/dist/types/util_mdx.d.ts +13 -0
  26. package/dist/types/util_prompts.d.ts +12 -0
  27. package/dist/types/util_scripts/DeepWiki.d.ts +63 -0
  28. package/dist/types/util_scripts/__tests__/chunk_size.test.d.ts +5 -0
  29. package/dist/types/util_scripts/chunk_size.d.ts +57 -0
  30. package/dist/types/util_scripts/extractBase64ImagesToFile.d.ts +5 -0
  31. package/dist/types/util_scripts/pagination.d.ts +53 -0
  32. package/package.json +61 -0
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Category Link Validation Test Suite
3
+ *
4
+ * Validates that method files in category folders exist and are symbolic links
5
+ *
6
+ * New path structure:
7
+ * - Skills: methods/native/skills/[method]/SKILL.mdx
8
+ * - Category links: methods/native/categories/[category]/[method] -> ../../skills/[method]
9
+ */
10
+ /**
11
+ * Setup category link validation tests - can be imported and reused in other projects
12
+ */
13
+ export declare function setupCategoryLinkValidation(): Promise<void>;
@@ -0,0 +1,10 @@
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(): Promise<void>;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * General Persona Validation Test Suite
3
+ *
4
+ * Validates ALL persona files against the Zod schema.
5
+ * Auto-discovers .mdx files in personas directory.
6
+ */
7
+ /**
8
+ * Setup persona validation tests - can be imported and reused in other projects
9
+ */
10
+ export declare function setupPersonaValidation(): void;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Zod-Based Template Validator with Enhanced YAML Validation
3
+ *
4
+ * This test suite uses TypeScript-first Zod schemas for template validation,
5
+ * ensuring type-safe validation with superior error messages.
6
+ * Performance optimized with caching to prevent repeated file I/O.
7
+ *
8
+ * Features:
9
+ * - Type-safe validation with automatic TypeScript types
10
+ * - Runtime validation with detailed error paths
11
+ * - Comprehensive template structure validation
12
+ * - Quality metrics validation with precise scoring
13
+ * - EXPLICIT YAML format validation - any invalid YAML will cause test failure
14
+ * - Enhanced error handling for both YAML syntax and template structure errors
15
+ */
16
+ /**
17
+ * Setup template validation tests - can be imported and reused in other projects
18
+ */
19
+ export declare function setupTemplateValidation(): void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare const MAX_CHAR_LENGTH = 23000;
2
+ export declare const DEPLOY_METHOD_TOOL = "_Counter__ExecuteMethod";
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Domain Configuration for Fetch-Page Elicit
3
+ *
4
+ * Centralized configuration for domain-specific behavior.
5
+ * Use this to specify domains that require special handling (e.g., Google Bot user agent).
6
+ */
7
+ /**
8
+ * Domains that should use Google Bot user agent
9
+ * These sites serve more content to Google Bot crawler than regular browsers
10
+ *
11
+ * Common reasons to use Google Bot:
12
+ * - E-commerce sites (Shopee, Lazada, etc.) show more products/details to crawlers
13
+ * - SEO-optimized sites serve complete content to search engine crawlers
14
+ * - Some sites block fake User-Agents but allow Googlebot
15
+ */
16
+ export declare const GOOGLEBOT_DOMAINS: Set<string>;
17
+ /**
18
+ * Check if a URL's domain should use Google Bot user agent
19
+ *
20
+ * @param url - Full URL to check (e.g., "https://www.shopee.tw/...")
21
+ * @returns true if the domain should use Google Bot user agent
22
+ *
23
+ * @example
24
+ * isGoogleBotDomain("https://www.shopee.tw/search") // true
25
+ * isGoogleBotDomain("https://google.com") // false
26
+ */
27
+ export declare function isGoogleBotDomain(url: string): boolean;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Centralized Aliases Configuration
3
+ *
4
+ * This file contains all aliases for:
5
+ * - Method aliases extracted from YAML files and persona descriptions
6
+ * - Hero aliases for convenient deployment shortcuts
7
+ *
8
+ * Provides bidirectional mapping for alias resolution.
9
+ */
10
+ declare const METHOD_TO_ALIASES: {
11
+ readonly code: readonly ["change", "modify", "develop", "update", "implement", "add", "remove", "fix", "improve"];
12
+ readonly "code-verify": readonly ["check", "code-test"];
13
+ readonly "fix-bun-test": readonly ["bun-test"];
14
+ readonly "counter-manager": readonly ["method-manager"];
15
+ readonly presentation: readonly ["ppt"];
16
+ readonly "daily-planner": readonly ["daily"];
17
+ readonly help: readonly ["assemble"];
18
+ readonly "business-edm": readonly ["b2b"];
19
+ readonly "transform-narrative": readonly ["write"];
20
+ readonly "persuade-convert": readonly ["sell"];
21
+ readonly "technical-engage": readonly ["blog"];
22
+ readonly "task-decomposer": readonly ["atomic"];
23
+ readonly "content-intelligence": readonly ["content", "audit", "audience"];
24
+ readonly "visual-craft": readonly ["image"];
25
+ readonly "get-cursor-codesymbol": readonly ["cursor"];
26
+ readonly "fomo-retail-investor": readonly ["fomo"];
27
+ readonly "crisis-response": readonly ["sos"];
28
+ };
29
+ declare const ALIAS_TO_METHOD: Record<string, AliasConfig>;
30
+ export type MethodName = keyof typeof METHOD_TO_ALIASES;
31
+ export type AliasName = keyof typeof ALIAS_TO_METHOD;
32
+ export type AliasConfig = {
33
+ method: string;
34
+ parameters?: Record<string, any>;
35
+ };
36
+ export declare const getAliasesForMethod: (method: MethodName) => readonly string[];
37
+ export declare const getMethodForAlias: (alias: string) => AliasConfig | undefined;
38
+ export declare const isValidAlias: (alias: string) => alias is AliasName;
39
+ export declare const getAllMethods: () => readonly MethodName[];
40
+ export declare const getAllAliases: () => readonly AliasName[];
41
+ /**
42
+ * Hero alias mapping for convenient deployment
43
+ * Maps common shortcuts to actual hero IDs
44
+ */
45
+ export declare const HERO_ALIASES: Record<string, string>;
46
+ /**
47
+ * Resolve hero alias to actual hero ID or name
48
+ */
49
+ export declare function resolveHeroAlias(heroCallSign: string): string;
50
+ /**
51
+ * Get all available hero names dynamically from persona files
52
+ * Uses getAllCounterItems to fetch real hero data programmatically
53
+ */
54
+ export declare function getAllHeroNames(): Promise<string[]>;
55
+ export {};
@@ -0,0 +1,25 @@
1
+ export { default as AnswerProtocol } from "./protocols/answer-protocol.mdx";
2
+ export { default as BehaviorProtocol } from "./protocols/behavior-protocol.mdx";
3
+ export { default as CleanCodeProtocol } from "./protocols/clean-code-protocol.mdx";
4
+ export { default as CodesymbolProtocol } from "./protocols/codesymbol-protocol.mdx";
5
+ export { default as CulturalLinguisticProtocol } from "./protocols/cultural-linguistic-protocol.mdx";
6
+ export { default as FloamProtocol } from "./protocols/floam-protocol.mdx";
7
+ export { default as PartyModeProtocol } from "./protocols/party-mode-protocol.mdx";
8
+ export { default as TaiwanEcommerceProtocol } from "./protocols/taiwan-ecommerce-protocol.mdx";
9
+ export { default as TwoStageProtocol } from "./protocols/two-stage-protocol.mdx";
10
+ export { DeepWiki } from "./util_scripts/DeepWiki";
11
+ export { MAX_CHAR_LENGTH } from "./confs/const";
12
+ export { isGoogleBotDomain } from "./confs/domain-config";
13
+ export { getPagination, needsChunking, getChunk, } from "./util_scripts/pagination";
14
+ export { DEPLOY_METHOD_TOOL } from "./confs/const.js";
15
+ export { getCounterContent, getAllCounterItems } from "./util_counter_data";
16
+ export { setupMcpCounter } from "./mcp_counter";
17
+ export { setupTemplateValidation } from "./__tests__/TemplateValidator.test.js";
18
+ export { setupCategoryLinkValidation } from "./__tests__/CategoryLinkValidation.test.js";
19
+ export { setupMethodValidation } from "./__tests__/MethodValidation.test.js";
20
+ export { setupPersonaValidation } from "./__tests__/PersonaValidation.test.js";
21
+ export { validateMethodFile } from "./schemas/methodology-validation.js";
22
+ export { validateTemplateFile } from "./schemas/template-validation.js";
23
+ export { validateProtocolFile } from "./schemas/protocol-validation.js";
24
+ export { extractCodeBlocks, readMpxPrompt, readMpxYaml, readPrompt } from "./util_prompts";
25
+ export { readMdx, importMdx } from "./util_mdx";
@@ -0,0 +1,5 @@
1
+ import { type AITools, type FastMCPCompatible } from "modality-mcp-kit";
2
+ /**
3
+ * Setup MCP tools
4
+ */
5
+ export declare const setupMcpCounter: (baseDir: string, mcpServer?: FastMCPCompatible) => Promise<AITools>;
@@ -0,0 +1,11 @@
1
+ import { z } from "zod";
2
+ export declare const ExecutionFlowItemSchema: z.ZodType<string | any[] | {
3
+ [key: string]: any[];
4
+ }>;
5
+ export declare const ExecutionFlowSchema: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
6
+ [key: string]: any[];
7
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
8
+ [key: string]: any[];
9
+ }, unknown>>>>;
10
+ export type ExecutionFlowItem = z.infer<typeof ExecutionFlowItemSchema>;
11
+ export type ExecutionFlow = z.infer<typeof ExecutionFlowSchema>;
@@ -0,0 +1,31 @@
1
+ import { z } from "zod";
2
+ export declare const ResourceTypes: readonly ["persona", "method", "workflow"];
3
+ export type ResourceType = (typeof ResourceTypes)[number];
4
+ export declare const partyModeSchema: z.ZodObject<{
5
+ topic: z.ZodString;
6
+ context: z.ZodOptional<z.ZodString>;
7
+ recommendedHeroes: z.ZodOptional<z.ZodArray<z.ZodString>>;
8
+ deployedHeroes: z.ZodOptional<z.ZodArray<z.ZodString>>;
9
+ }, z.core.$strip>;
10
+ export type PartyMode = z.infer<typeof partyModeSchema>;
11
+ export declare const heroMethodSchema: z.ZodObject<{
12
+ method: z.ZodString;
13
+ params: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
14
+ }, z.core.$strip>;
15
+ export type HeroMethodType = z.infer<typeof heroMethodSchema>;
16
+ export declare const heroDeploySchema: z.ZodObject<{
17
+ callSign: z.ZodString;
18
+ }, z.core.$strip>;
19
+ export type HeroDeployType = z.infer<typeof heroDeploySchema>;
20
+ export declare const workflowDeploySchema: z.ZodObject<{
21
+ callSign: z.ZodString;
22
+ }, z.core.$strip>;
23
+ export type WorkflowDeployType = z.infer<typeof workflowDeploySchema>;
24
+ export declare const counterAssembleSchema: z.ZodObject<{
25
+ types: z.ZodDefault<z.ZodArray<z.ZodEnum<{
26
+ persona: "persona";
27
+ method: "method";
28
+ workflow: "workflow";
29
+ }>>>;
30
+ }, z.core.$strip>;
31
+ export type CounterAssembleType = z.infer<typeof counterAssembleSchema>;
@@ -0,0 +1,180 @@
1
+ import { z } from "zod";
2
+ declare const ExpectedOutputSchema: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>]>;
3
+ declare const ParameterDefinitionSchema: z.ZodObject<{
4
+ description: z.ZodString;
5
+ type: z.ZodEnum<{
6
+ string: "string";
7
+ number: "number";
8
+ boolean: "boolean";
9
+ object: "object";
10
+ array: "array";
11
+ integer: "integer";
12
+ }>;
13
+ required: z.ZodDefault<z.ZodBoolean>;
14
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
15
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
16
+ }, z.core.$catchall<z.ZodUnknown>>;
17
+ declare const UsageSchema: z.ZodObject<{
18
+ method: z.ZodString;
19
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
20
+ description: z.ZodString;
21
+ type: z.ZodEnum<{
22
+ string: "string";
23
+ number: "number";
24
+ boolean: "boolean";
25
+ object: "object";
26
+ array: "array";
27
+ integer: "integer";
28
+ }>;
29
+ required: z.ZodDefault<z.ZodBoolean>;
30
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
31
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
32
+ }, z.core.$catchall<z.ZodUnknown>>>>;
33
+ examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
+ elicit: z.ZodOptional<z.ZodBoolean>;
35
+ }, z.core.$strict>;
36
+ declare const TemplateIntegrationSchema: z.ZodArray<z.ZodObject<{
37
+ template_ref: z.ZodString;
38
+ description: z.ZodString;
39
+ when_to_trigger: z.ZodOptional<z.ZodArray<z.ZodString>>;
40
+ }, z.core.$strict>>;
41
+ declare const CompositionSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
42
+ method: z.ZodString;
43
+ purpose: z.ZodString;
44
+ execution_flow: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
45
+ [key: string]: any[];
46
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
47
+ [key: string]: any[];
48
+ }, unknown>>>>;
49
+ when_to_trigger: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
50
+ [key: string]: any[];
51
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
52
+ [key: string]: any[];
53
+ }, unknown>>>>;
54
+ }, z.core.$strict>>>;
55
+ declare const ActionChecklistSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>>>>;
56
+ declare const UsageModeConfigSchema: z.ZodObject<{
57
+ purpose: z.ZodString;
58
+ execution_flow: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
59
+ [key: string]: any[];
60
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
61
+ [key: string]: any[];
62
+ }, unknown>>>>;
63
+ fallback: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ when_to_trigger: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
65
+ [key: string]: any[];
66
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
67
+ [key: string]: any[];
68
+ }, unknown>>>>;
69
+ usage_example: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
+ }, z.core.$strict>;
71
+ declare const TacticalNotesSchema: z.ZodAny;
72
+ declare const MethodologySchema: z.ZodObject<{
73
+ purpose: z.ZodString;
74
+ expected_output: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>]>;
75
+ composition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
76
+ method: z.ZodString;
77
+ purpose: z.ZodString;
78
+ execution_flow: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
79
+ [key: string]: any[];
80
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
81
+ [key: string]: any[];
82
+ }, unknown>>>>;
83
+ when_to_trigger: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
84
+ [key: string]: any[];
85
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
86
+ [key: string]: any[];
87
+ }, unknown>>>>;
88
+ }, z.core.$strict>>>;
89
+ }, z.core.$strict>;
90
+ export declare const MethodFileSchema: z.ZodObject<{
91
+ method: z.ZodObject<{
92
+ name: z.ZodString;
93
+ title: z.ZodString;
94
+ icon: z.ZodString;
95
+ category: z.ZodString;
96
+ description: z.ZodString;
97
+ usage: z.ZodObject<{
98
+ method: z.ZodString;
99
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
100
+ description: z.ZodString;
101
+ type: z.ZodEnum<{
102
+ string: "string";
103
+ number: "number";
104
+ boolean: "boolean";
105
+ object: "object";
106
+ array: "array";
107
+ integer: "integer";
108
+ }>;
109
+ required: z.ZodDefault<z.ZodBoolean>;
110
+ options: z.ZodOptional<z.ZodArray<z.ZodString>>;
111
+ default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
112
+ }, z.core.$catchall<z.ZodUnknown>>>>;
113
+ examples: z.ZodOptional<z.ZodArray<z.ZodString>>;
114
+ elicit: z.ZodOptional<z.ZodBoolean>;
115
+ }, z.core.$strict>;
116
+ agent_compatibility: z.ZodArray<z.ZodString>;
117
+ references: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
118
+ description: z.ZodString;
119
+ content: z.ZodOptional<z.ZodString>;
120
+ }, z.core.$strip>>>;
121
+ }, z.core.$strict>;
122
+ methodology: z.ZodObject<{
123
+ purpose: z.ZodString;
124
+ expected_output: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>]>;
125
+ composition: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
126
+ method: z.ZodString;
127
+ purpose: z.ZodString;
128
+ execution_flow: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
129
+ [key: string]: any[];
130
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
131
+ [key: string]: any[];
132
+ }, unknown>>>>;
133
+ when_to_trigger: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
134
+ [key: string]: any[];
135
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
136
+ [key: string]: any[];
137
+ }, unknown>>>>;
138
+ }, z.core.$strict>>>;
139
+ }, z.core.$strict>;
140
+ template_integration: z.ZodOptional<z.ZodArray<z.ZodObject<{
141
+ template_ref: z.ZodString;
142
+ description: z.ZodString;
143
+ when_to_trigger: z.ZodOptional<z.ZodArray<z.ZodString>>;
144
+ }, z.core.$strict>>>;
145
+ integration_protocols: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
146
+ usage_modes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
147
+ purpose: z.ZodString;
148
+ execution_flow: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
149
+ [key: string]: any[];
150
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
151
+ [key: string]: any[];
152
+ }, unknown>>>>;
153
+ fallback: z.ZodOptional<z.ZodArray<z.ZodString>>;
154
+ when_to_trigger: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
155
+ [key: string]: any[];
156
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
157
+ [key: string]: any[];
158
+ }, unknown>>>>;
159
+ usage_example: z.ZodOptional<z.ZodArray<z.ZodString>>;
160
+ }, z.core.$strict>>>;
161
+ multi_market_integration: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
162
+ data_sources: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
163
+ tactical_notes: z.ZodAny;
164
+ }, z.core.$catchall<z.ZodUnknown>>;
165
+ export type MethodFile = z.infer<typeof MethodFileSchema>;
166
+ export type ExpectedOutput = z.infer<typeof ExpectedOutputSchema>;
167
+ export type Methodology = z.infer<typeof MethodologySchema>;
168
+ export type Composition = z.infer<typeof CompositionSchema>;
169
+ export type TemplateIntegration = z.infer<typeof TemplateIntegrationSchema>;
170
+ export type ParameterDefinition = z.infer<typeof ParameterDefinitionSchema>;
171
+ export type Usage = z.infer<typeof UsageSchema>;
172
+ export type UsageModeConfig = z.infer<typeof UsageModeConfigSchema>;
173
+ export type ActionChecklist = z.infer<typeof ActionChecklistSchema>;
174
+ export type TacticalNotes = z.infer<typeof TacticalNotesSchema>;
175
+ export declare function validateMethodFile(data: unknown, filename?: string): {
176
+ success: boolean;
177
+ data?: MethodFile;
178
+ errors?: string[];
179
+ };
180
+ export {};
@@ -0,0 +1,68 @@
1
+ import { z } from "zod";
2
+ import type { PersonaValidationResult } from "./validation-types.js";
3
+ /**
4
+ * Zod Schema for Counter Persona Validation
5
+ * TypeScript-first validation for Counter persona definition files
6
+ *
7
+ * Features:
8
+ * - Type-safe validation with automatic TypeScript type generation
9
+ * - Runtime validation with detailed error messages for persona configurations
10
+ * - Support for agent identity, persona traits, and method definitions
11
+ * - Comprehensive validation rules for persona consistency and quality
12
+ */
13
+ declare const AgentSectionSchema: z.ZodObject<{
14
+ name: z.ZodString;
15
+ id: z.ZodString;
16
+ title: z.ZodString;
17
+ icon: z.ZodString;
18
+ whenToUse: z.ZodArray<z.ZodString>;
19
+ description: z.ZodString;
20
+ }, z.core.$strip>;
21
+ declare const PersonaSectionSchema: z.ZodObject<{
22
+ role: z.ZodString;
23
+ style: z.ZodString;
24
+ identity: z.ZodString;
25
+ focus: z.ZodString;
26
+ core_principles: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
27
+ [key: string]: any[];
28
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
29
+ [key: string]: any[];
30
+ }, unknown>>>>;
31
+ }, z.core.$strict>;
32
+ export declare const PersonaFileSchema: z.ZodObject<{
33
+ agent: z.ZodObject<{
34
+ name: z.ZodString;
35
+ id: z.ZodString;
36
+ title: z.ZodString;
37
+ icon: z.ZodString;
38
+ whenToUse: z.ZodArray<z.ZodString>;
39
+ description: z.ZodString;
40
+ }, z.core.$strip>;
41
+ persona: z.ZodObject<{
42
+ role: z.ZodString;
43
+ style: z.ZodString;
44
+ identity: z.ZodString;
45
+ focus: z.ZodString;
46
+ core_principles: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
47
+ [key: string]: any[];
48
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
49
+ [key: string]: any[];
50
+ }, unknown>>>>;
51
+ }, z.core.$strict>;
52
+ methods: z.ZodRecord<z.ZodString, z.ZodString>;
53
+ dependencies: z.ZodObject<{
54
+ methods: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ }, z.core.$strict>;
56
+ }, z.core.$strict>;
57
+ export type PersonaFile = z.infer<typeof PersonaFileSchema>;
58
+ export type AgentSection = z.infer<typeof AgentSectionSchema>;
59
+ export type PersonaSection = z.infer<typeof PersonaSectionSchema>;
60
+ export declare function validatePersonaFile(data: unknown): {
61
+ success: boolean;
62
+ data?: PersonaFile;
63
+ errors?: string[];
64
+ };
65
+ export declare function calculatePersonaQualityScore(result: Pick<PersonaValidationResult, "errors" | "warnings" | "advisories">): number;
66
+ export declare function validatePersonaWithQuality(data: unknown, filename: string): PersonaValidationResult;
67
+ export declare function extractPersonaYamlFromMdx(mdxContent: string): unknown;
68
+ export {};
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ export declare const GenericProtocolSchema: z.ZodObject<{}, z.core.$catchall<z.ZodRecord<z.ZodString, z.ZodType<any, unknown, z.core.$ZodTypeInternals<any, unknown>>>>>;
3
+ export type GenericProtocol = z.infer<typeof GenericProtocolSchema>;
4
+ export declare function validateGenericProtocol(data: unknown): {
5
+ success: boolean;
6
+ data?: GenericProtocol;
7
+ errors?: string[];
8
+ };
9
+ export interface ProtocolValidationResult {
10
+ filename: string;
11
+ type: "protocol";
12
+ status: "excellent" | "good_with_warnings" | "critical_error";
13
+ errors: string[];
14
+ warnings: string[];
15
+ advisories: string[];
16
+ score: number;
17
+ }
18
+ export declare function calculateProtocolQualityScore(result: Pick<ProtocolValidationResult, "errors" | "warnings" | "advisories">): number;
19
+ export declare function validateProtocolFile(data: unknown): ProtocolValidationResult;
@@ -0,0 +1,84 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Zod Schema for Counter Template Validation
4
+ * Independent TypeScript-first validation for template files
5
+ *
6
+ * Features:
7
+ * - Type-safe template validation with automatic TypeScript types
8
+ * - Runtime validation with detailed error messages
9
+ * - Template-specific validation rules and requirements
10
+ * - Quality scoring and compliance assessment
11
+ */
12
+ declare const OutputStructureSchema: z.ZodObject<{
13
+ header_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
14
+ separators: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
15
+ body_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
16
+ footer_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
17
+ }, z.core.$strict>;
18
+ declare const DisplayFormatSchema: z.ZodRecord<z.ZodString, z.ZodAny>;
19
+ declare const TemplateOutputSchema: z.ZodObject<{
20
+ format: z.ZodOptional<z.ZodString>;
21
+ filename: z.ZodOptional<z.ZodString>;
22
+ structure: z.ZodOptional<z.ZodObject<{
23
+ header_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
+ separators: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
25
+ body_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
+ footer_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
+ }, z.core.$strict>>;
28
+ }, z.core.$strip>;
29
+ declare const TemplateSectionSchema: z.ZodObject<{
30
+ title: z.ZodOptional<z.ZodString>;
31
+ description: z.ZodOptional<z.ZodString>;
32
+ sub_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
33
+ content: z.ZodOptional<z.ZodString>;
34
+ type: z.ZodOptional<z.ZodString>;
35
+ focus: z.ZodOptional<z.ZodString>;
36
+ }, z.core.$catchall<z.ZodUnknown>>;
37
+ declare const TemplateSectionsSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
38
+ title: z.ZodOptional<z.ZodString>;
39
+ description: z.ZodOptional<z.ZodString>;
40
+ sub_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
41
+ content: z.ZodOptional<z.ZodString>;
42
+ type: z.ZodOptional<z.ZodString>;
43
+ focus: z.ZodOptional<z.ZodString>;
44
+ }, z.core.$catchall<z.ZodUnknown>>>;
45
+ export declare const TemplateFileSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
46
+ template: z.ZodObject<{
47
+ output: z.ZodOptional<z.ZodObject<{
48
+ format: z.ZodOptional<z.ZodString>;
49
+ filename: z.ZodOptional<z.ZodString>;
50
+ structure: z.ZodOptional<z.ZodObject<{
51
+ header_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
52
+ separators: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
53
+ body_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
54
+ footer_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
55
+ }, z.core.$strict>>;
56
+ }, z.core.$strip>>;
57
+ display_format: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
58
+ }, z.core.$strict>;
59
+ execution_flow: z.ZodOptional<z.ZodArray<z.ZodType<string | any[] | {
60
+ [key: string]: any[];
61
+ }, unknown, z.core.$ZodTypeInternals<string | any[] | {
62
+ [key: string]: any[];
63
+ }, unknown>>>>;
64
+ sections: z.ZodRecord<z.ZodString, z.ZodObject<{
65
+ title: z.ZodOptional<z.ZodString>;
66
+ description: z.ZodOptional<z.ZodString>;
67
+ sub_sections: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ content: z.ZodOptional<z.ZodString>;
69
+ type: z.ZodOptional<z.ZodString>;
70
+ focus: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$catchall<z.ZodUnknown>>>;
72
+ }, z.core.$strict>>;
73
+ export type TemplateFile = z.infer<typeof TemplateFileSchema>;
74
+ export type TemplateOutput = z.infer<typeof TemplateOutputSchema>;
75
+ export type OutputStructure = z.infer<typeof OutputStructureSchema>;
76
+ export type DisplayFormat = z.infer<typeof DisplayFormatSchema>;
77
+ export type TemplateSections = z.infer<typeof TemplateSectionsSchema>;
78
+ export type TemplateSection = z.infer<typeof TemplateSectionSchema>;
79
+ export declare function validateTemplateFile(data: unknown): {
80
+ success: boolean;
81
+ data?: TemplateFile;
82
+ errors?: string[];
83
+ };
84
+ export {};