@vibe-agent-toolkit/vat-example-cat-agents 0.1.2-rc.4
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.
- package/README.md +697 -0
- package/dist/conversational-assistant/breed-advisor.d.ts +24 -0
- package/dist/conversational-assistant/breed-advisor.d.ts.map +1 -0
- package/dist/conversational-assistant/breed-advisor.js +390 -0
- package/dist/conversational-assistant/breed-advisor.js.map +1 -0
- package/dist/conversational-assistant/breed-knowledge.d.ts +42 -0
- package/dist/conversational-assistant/breed-knowledge.d.ts.map +1 -0
- package/dist/conversational-assistant/breed-knowledge.js +335 -0
- package/dist/conversational-assistant/breed-knowledge.js.map +1 -0
- package/dist/external-event-integrator/human-approval.d.ts +207 -0
- package/dist/external-event-integrator/human-approval.d.ts.map +1 -0
- package/dist/external-event-integrator/human-approval.js +387 -0
- package/dist/external-event-integrator/human-approval.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp-collections.d.ts +30 -0
- package/dist/mcp-collections.d.ts.map +1 -0
- package/dist/mcp-collections.js +58 -0
- package/dist/mcp-collections.js.map +1 -0
- package/dist/one-shot-llm-analyzer/description-parser.d.ts +55 -0
- package/dist/one-shot-llm-analyzer/description-parser.d.ts.map +1 -0
- package/dist/one-shot-llm-analyzer/description-parser.js +349 -0
- package/dist/one-shot-llm-analyzer/description-parser.js.map +1 -0
- package/dist/one-shot-llm-analyzer/haiku-generator.d.ts +157 -0
- package/dist/one-shot-llm-analyzer/haiku-generator.d.ts.map +1 -0
- package/dist/one-shot-llm-analyzer/haiku-generator.js +66 -0
- package/dist/one-shot-llm-analyzer/haiku-generator.js.map +1 -0
- package/dist/one-shot-llm-analyzer/name-generator.d.ts +157 -0
- package/dist/one-shot-llm-analyzer/name-generator.d.ts.map +1 -0
- package/dist/one-shot-llm-analyzer/name-generator.js +121 -0
- package/dist/one-shot-llm-analyzer/name-generator.js.map +1 -0
- package/dist/one-shot-llm-analyzer/photo-analyzer.d.ts +57 -0
- package/dist/one-shot-llm-analyzer/photo-analyzer.d.ts.map +1 -0
- package/dist/one-shot-llm-analyzer/photo-analyzer.js +288 -0
- package/dist/one-shot-llm-analyzer/photo-analyzer.js.map +1 -0
- package/dist/pure-function-tool/haiku-validator.d.ts +27 -0
- package/dist/pure-function-tool/haiku-validator.d.ts.map +1 -0
- package/dist/pure-function-tool/haiku-validator.js +148 -0
- package/dist/pure-function-tool/haiku-validator.js.map +1 -0
- package/dist/pure-function-tool/name-validator.d.ts +203 -0
- package/dist/pure-function-tool/name-validator.d.ts.map +1 -0
- package/dist/pure-function-tool/name-validator.js +244 -0
- package/dist/pure-function-tool/name-validator.js.map +1 -0
- package/dist/types/schemas.d.ts +612 -0
- package/dist/types/schemas.d.ts.map +1 -0
- package/dist/types/schemas.js +127 -0
- package/dist/types/schemas.js.map +1 -0
- package/dist/utils/color-extraction.d.ts +14 -0
- package/dist/utils/color-extraction.d.ts.map +1 -0
- package/dist/utils/color-extraction.js +45 -0
- package/dist/utils/color-extraction.js.map +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type PureFunctionAgent } from '@vibe-agent-toolkit/agent-runtime';
|
|
2
|
+
import { type Haiku, type HaikuValidationResult } from '../types/schemas.js';
|
|
3
|
+
/**
|
|
4
|
+
* Validates a haiku (public API for direct use).
|
|
5
|
+
* Returns the validation result directly without the envelope.
|
|
6
|
+
*/
|
|
7
|
+
export declare function validateHaiku(haiku: Haiku): HaikuValidationResult;
|
|
8
|
+
/**
|
|
9
|
+
* Generates a detailed critique of a haiku.
|
|
10
|
+
* This is what Professor Whiskers would say.
|
|
11
|
+
*
|
|
12
|
+
* @param haiku - The haiku to critique
|
|
13
|
+
* @returns A detailed critique string
|
|
14
|
+
*/
|
|
15
|
+
export declare function critiqueHaiku(haiku: Haiku): string;
|
|
16
|
+
/**
|
|
17
|
+
* Haiku validator agent
|
|
18
|
+
*
|
|
19
|
+
* Validates haiku structure (5-7-5 syllable pattern) and checks for
|
|
20
|
+
* traditional elements like seasonal references (kigo) and cutting words (kireji).
|
|
21
|
+
*
|
|
22
|
+
* This is Professor Whiskers' domain - he's extremely strict about syllable counts.
|
|
23
|
+
*
|
|
24
|
+
* Returns HaikuValidationResult directly (includes valid boolean, syllable counts, errors)
|
|
25
|
+
*/
|
|
26
|
+
export declare const haikuValidatorAgent: PureFunctionAgent<Haiku, HaikuValidationResult>;
|
|
27
|
+
//# sourceMappingURL=haiku-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haiku-validator.d.ts","sourceRoot":"","sources":["../../src/pure-function-tool/haiku-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAG/F,OAAO,EAA4C,KAAK,KAAK,EAAE,KAAK,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAuFvH;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,qBAAqB,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CA0ClD;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,mBAAmB,EAAE,iBAAiB,CAAC,KAAK,EAAE,qBAAqB,CAS/E,CAAC"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { definePureFunction } from '@vibe-agent-toolkit/agent-runtime';
|
|
2
|
+
import { syllable } from 'syllable';
|
|
3
|
+
import { HaikuSchema, HaikuValidationResultSchema } from '../types/schemas.js';
|
|
4
|
+
// SonarQube: Disable "Do not call Array#push() multiple times" - conditional pushes based on validation logic
|
|
5
|
+
// NOSONAR
|
|
6
|
+
/**
|
|
7
|
+
* Common seasonal words (kigo) in English haiku
|
|
8
|
+
*/
|
|
9
|
+
const KIGO_PATTERNS = [
|
|
10
|
+
// Spring
|
|
11
|
+
'spring', 'blossom', 'cherry', 'rain', 'green', 'nest', 'egg',
|
|
12
|
+
// Summer
|
|
13
|
+
'summer', 'heat', 'thunder', 'cicada', 'butterfly', 'firefly',
|
|
14
|
+
// Autumn/Fall
|
|
15
|
+
'autumn', 'fall', 'leaf', 'leaves', 'harvest', 'moon', 'frost',
|
|
16
|
+
// Winter
|
|
17
|
+
'winter', 'snow', 'ice', 'cold', 'bare', 'gray', 'grey',
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Common cutting words/patterns (kireji) in English haiku
|
|
21
|
+
* These create a pause or juxtaposition
|
|
22
|
+
*/
|
|
23
|
+
const KIREJI_PATTERNS = [
|
|
24
|
+
'—', // em dash
|
|
25
|
+
'...', // ellipsis
|
|
26
|
+
'!', // exclamation
|
|
27
|
+
';', // semicolon
|
|
28
|
+
':', // colon
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Validates a haiku for proper syllable structure.
|
|
32
|
+
*
|
|
33
|
+
* Checks:
|
|
34
|
+
* - Line 1: 5 syllables
|
|
35
|
+
* - Line 2: 7 syllables
|
|
36
|
+
* - Line 3: 5 syllables
|
|
37
|
+
* - Optional: presence of kigo (seasonal reference)
|
|
38
|
+
* - Optional: presence of kireji (cutting word)
|
|
39
|
+
*
|
|
40
|
+
* This is Professor Whiskers' domain - he's extremely strict about syllable counts.
|
|
41
|
+
*
|
|
42
|
+
* @param haiku - The haiku to validate
|
|
43
|
+
* @returns Validation result with syllable counts and errors (wrapped in success)
|
|
44
|
+
*/
|
|
45
|
+
function validateHaikuLogic(haiku) {
|
|
46
|
+
const line1Count = syllable(haiku.line1);
|
|
47
|
+
const line2Count = syllable(haiku.line2);
|
|
48
|
+
const line3Count = syllable(haiku.line3);
|
|
49
|
+
const errors = [];
|
|
50
|
+
if (line1Count !== 5) {
|
|
51
|
+
errors.push(`Line 1 has ${line1Count} syllables, expected 5`);
|
|
52
|
+
}
|
|
53
|
+
if (line2Count !== 7) {
|
|
54
|
+
errors.push(`Line 2 has ${line2Count} syllables, expected 7`);
|
|
55
|
+
}
|
|
56
|
+
if (line3Count !== 5) {
|
|
57
|
+
errors.push(`Line 3 has ${line3Count} syllables, expected 5`);
|
|
58
|
+
}
|
|
59
|
+
// Check for kigo (seasonal reference)
|
|
60
|
+
const fullText = `${haiku.line1} ${haiku.line2} ${haiku.line3}`.toLowerCase();
|
|
61
|
+
const hasKigo = KIGO_PATTERNS.some((pattern) => fullText.includes(pattern));
|
|
62
|
+
// Check for kireji (cutting word)
|
|
63
|
+
const hasKireji = KIREJI_PATTERNS.some((pattern) => [haiku.line1, haiku.line2, haiku.line3].some((line) => line.includes(pattern)));
|
|
64
|
+
return {
|
|
65
|
+
valid: errors.length === 0,
|
|
66
|
+
syllables: {
|
|
67
|
+
line1: line1Count,
|
|
68
|
+
line2: line2Count,
|
|
69
|
+
line3: line3Count,
|
|
70
|
+
},
|
|
71
|
+
errors,
|
|
72
|
+
hasKigo,
|
|
73
|
+
hasKireji,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Validates a haiku (public API for direct use).
|
|
78
|
+
* Returns the validation result directly without the envelope.
|
|
79
|
+
*/
|
|
80
|
+
export function validateHaiku(haiku) {
|
|
81
|
+
return validateHaikuLogic(haiku);
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Generates a detailed critique of a haiku.
|
|
85
|
+
* This is what Professor Whiskers would say.
|
|
86
|
+
*
|
|
87
|
+
* @param haiku - The haiku to critique
|
|
88
|
+
* @returns A detailed critique string
|
|
89
|
+
*/
|
|
90
|
+
export function critiqueHaiku(haiku) {
|
|
91
|
+
const result = validateHaikuLogic(haiku);
|
|
92
|
+
const lines = [];
|
|
93
|
+
lines.push('=== Professor Whiskers\' Haiku Critique ===\n');
|
|
94
|
+
if (result.valid) {
|
|
95
|
+
lines.push('✓ Syllable structure is IMPECCABLE. 5-7-5, as it should be.');
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
lines.push('✗ UNACCEPTABLE syllable structure!');
|
|
99
|
+
for (const error of result.errors) {
|
|
100
|
+
lines.push(` • ${error}`);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
lines.push('');
|
|
104
|
+
lines.push(`Syllable counts: ${result.syllables.line1}-${result.syllables.line2}-${result.syllables.line3}`);
|
|
105
|
+
if (result.hasKigo) {
|
|
106
|
+
lines.push('✓ Contains seasonal reference (kigo). Good.');
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
lines.push('⚠ No obvious seasonal reference detected. Traditional haiku should include kigo.');
|
|
110
|
+
}
|
|
111
|
+
if (result.hasKireji) {
|
|
112
|
+
lines.push('✓ Contains cutting word/pause (kireji). Excellent.');
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
lines.push('⚠ No clear cutting word detected. Consider adding — or ... for juxtaposition.');
|
|
116
|
+
}
|
|
117
|
+
if (!result.valid) {
|
|
118
|
+
lines.push('\n*adjusts spectacles disapprovingly*');
|
|
119
|
+
lines.push('This requires REVISION. Come back when you understand syllable structure.');
|
|
120
|
+
}
|
|
121
|
+
else if (!result.hasKigo || !result.hasKireji) {
|
|
122
|
+
lines.push('\n*tail twitches critically*');
|
|
123
|
+
lines.push('Structurally sound, but lacking poetic depth. Acceptable, but not exemplary.');
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
lines.push('\n*nods approvingly*');
|
|
127
|
+
lines.push('A proper haiku. You may proceed.');
|
|
128
|
+
}
|
|
129
|
+
return lines.join('\n');
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Haiku validator agent
|
|
133
|
+
*
|
|
134
|
+
* Validates haiku structure (5-7-5 syllable pattern) and checks for
|
|
135
|
+
* traditional elements like seasonal references (kigo) and cutting words (kireji).
|
|
136
|
+
*
|
|
137
|
+
* This is Professor Whiskers' domain - he's extremely strict about syllable counts.
|
|
138
|
+
*
|
|
139
|
+
* Returns HaikuValidationResult directly (includes valid boolean, syllable counts, errors)
|
|
140
|
+
*/
|
|
141
|
+
export const haikuValidatorAgent = definePureFunction({
|
|
142
|
+
name: 'haiku-validator',
|
|
143
|
+
version: '1.0.0',
|
|
144
|
+
description: 'Validates haiku syllable structure and traditional elements',
|
|
145
|
+
inputSchema: HaikuSchema,
|
|
146
|
+
outputSchema: HaikuValidationResultSchema,
|
|
147
|
+
}, validateHaikuLogic);
|
|
148
|
+
//# sourceMappingURL=haiku-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"haiku-validator.js","sourceRoot":"","sources":["../../src/pure-function-tool/haiku-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAA0B,MAAM,mCAAmC,CAAC;AAC/F,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAA0C,MAAM,qBAAqB,CAAC;AAEvH,8GAA8G;AAC9G,UAAU;AAEV;;GAEG;AACH,MAAM,aAAa,GAAG;IACpB,SAAS;IACT,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK;IAC7D,SAAS;IACT,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS;IAC7D,cAAc;IACd,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO;IAC9D,SAAS;IACT,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CACxD,CAAC;AAEF;;;GAGG;AACH,MAAM,eAAe,GAAG;IACtB,GAAG,EAAE,UAAU;IACf,KAAK,EAAE,WAAW;IAClB,GAAG,EAAE,cAAc;IACnB,GAAG,EAAE,YAAY;IACjB,GAAG,EAAE,QAAQ;CACd,CAAC;AAE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,CAAC,oDAAoD,CAAC,CAAC;IACnE,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,+EAA+E,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,uCAAuC,CAAC,CAAC;QACpD,KAAK,CAAC,IAAI,CAAC,2EAA2E,CAAC,CAAC;IAC1F,CAAC;SAAM,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC3C,KAAK,CAAC,IAAI,CAAC,8EAA8E,CAAC,CAAC;IAC7F,CAAC;SAAM,CAAC;QACN,KAAK,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;IACjD,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAoD,kBAAkB,CACpG;IACE,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6DAA6D;IAC1E,WAAW,EAAE,WAAW;IACxB,YAAY,EAAE,2BAA2B;CAC1C,EACD,kBAAkB,CACnB,CAAC"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type CatCharacteristics, type NameValidationResult } from '../types/schemas.js';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for name validation
|
|
5
|
+
*/
|
|
6
|
+
export declare const NameValidationInputSchema: z.ZodObject<{
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
characteristics: z.ZodOptional<z.ZodObject<{
|
|
9
|
+
physical: z.ZodObject<{
|
|
10
|
+
furColor: z.ZodString;
|
|
11
|
+
furPattern: z.ZodOptional<z.ZodString>;
|
|
12
|
+
eyeColor: z.ZodOptional<z.ZodString>;
|
|
13
|
+
breed: z.ZodOptional<z.ZodString>;
|
|
14
|
+
size: z.ZodOptional<z.ZodEnum<["tiny", "small", "medium", "large", "extra-large"]>>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
furColor: string;
|
|
17
|
+
furPattern?: string | undefined;
|
|
18
|
+
eyeColor?: string | undefined;
|
|
19
|
+
breed?: string | undefined;
|
|
20
|
+
size?: "tiny" | "small" | "medium" | "large" | "extra-large" | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
furColor: string;
|
|
23
|
+
furPattern?: string | undefined;
|
|
24
|
+
eyeColor?: string | undefined;
|
|
25
|
+
breed?: string | undefined;
|
|
26
|
+
size?: "tiny" | "small" | "medium" | "large" | "extra-large" | undefined;
|
|
27
|
+
}>;
|
|
28
|
+
behavioral: z.ZodObject<{
|
|
29
|
+
personality: z.ZodArray<z.ZodString, "many">;
|
|
30
|
+
quirks: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
31
|
+
vocalizations: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
personality: string[];
|
|
34
|
+
quirks?: string[] | undefined;
|
|
35
|
+
vocalizations?: string[] | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
personality: string[];
|
|
38
|
+
quirks?: string[] | undefined;
|
|
39
|
+
vocalizations?: string[] | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
metadata: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
origin: z.ZodOptional<z.ZodString>;
|
|
43
|
+
age: z.ZodOptional<z.ZodString>;
|
|
44
|
+
occupation: z.ZodOptional<z.ZodString>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
origin?: string | undefined;
|
|
47
|
+
age?: string | undefined;
|
|
48
|
+
occupation?: string | undefined;
|
|
49
|
+
}, {
|
|
50
|
+
origin?: string | undefined;
|
|
51
|
+
age?: string | undefined;
|
|
52
|
+
occupation?: string | undefined;
|
|
53
|
+
}>>;
|
|
54
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
55
|
+
description: z.ZodString;
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
physical: {
|
|
58
|
+
furColor: string;
|
|
59
|
+
furPattern?: string | undefined;
|
|
60
|
+
eyeColor?: string | undefined;
|
|
61
|
+
breed?: string | undefined;
|
|
62
|
+
size?: "tiny" | "small" | "medium" | "large" | "extra-large" | undefined;
|
|
63
|
+
};
|
|
64
|
+
behavioral: {
|
|
65
|
+
personality: string[];
|
|
66
|
+
quirks?: string[] | undefined;
|
|
67
|
+
vocalizations?: string[] | undefined;
|
|
68
|
+
};
|
|
69
|
+
description: string;
|
|
70
|
+
metadata?: {
|
|
71
|
+
origin?: string | undefined;
|
|
72
|
+
age?: string | undefined;
|
|
73
|
+
occupation?: string | undefined;
|
|
74
|
+
} | undefined;
|
|
75
|
+
notes?: string | undefined;
|
|
76
|
+
}, {
|
|
77
|
+
physical: {
|
|
78
|
+
furColor: string;
|
|
79
|
+
furPattern?: string | undefined;
|
|
80
|
+
eyeColor?: string | undefined;
|
|
81
|
+
breed?: string | undefined;
|
|
82
|
+
size?: "tiny" | "small" | "medium" | "large" | "extra-large" | undefined;
|
|
83
|
+
};
|
|
84
|
+
behavioral: {
|
|
85
|
+
personality: string[];
|
|
86
|
+
quirks?: string[] | undefined;
|
|
87
|
+
vocalizations?: string[] | undefined;
|
|
88
|
+
};
|
|
89
|
+
description: string;
|
|
90
|
+
metadata?: {
|
|
91
|
+
origin?: string | undefined;
|
|
92
|
+
age?: string | undefined;
|
|
93
|
+
occupation?: string | undefined;
|
|
94
|
+
} | undefined;
|
|
95
|
+
notes?: string | undefined;
|
|
96
|
+
}>>;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
name: string;
|
|
99
|
+
characteristics?: {
|
|
100
|
+
physical: {
|
|
101
|
+
furColor: string;
|
|
102
|
+
furPattern?: string | undefined;
|
|
103
|
+
eyeColor?: string | undefined;
|
|
104
|
+
breed?: string | undefined;
|
|
105
|
+
size?: "tiny" | "small" | "medium" | "large" | "extra-large" | undefined;
|
|
106
|
+
};
|
|
107
|
+
behavioral: {
|
|
108
|
+
personality: string[];
|
|
109
|
+
quirks?: string[] | undefined;
|
|
110
|
+
vocalizations?: string[] | undefined;
|
|
111
|
+
};
|
|
112
|
+
description: string;
|
|
113
|
+
metadata?: {
|
|
114
|
+
origin?: string | undefined;
|
|
115
|
+
age?: string | undefined;
|
|
116
|
+
occupation?: string | undefined;
|
|
117
|
+
} | undefined;
|
|
118
|
+
notes?: string | undefined;
|
|
119
|
+
} | undefined;
|
|
120
|
+
}, {
|
|
121
|
+
name: string;
|
|
122
|
+
characteristics?: {
|
|
123
|
+
physical: {
|
|
124
|
+
furColor: string;
|
|
125
|
+
furPattern?: string | undefined;
|
|
126
|
+
eyeColor?: string | undefined;
|
|
127
|
+
breed?: string | undefined;
|
|
128
|
+
size?: "tiny" | "small" | "medium" | "large" | "extra-large" | undefined;
|
|
129
|
+
};
|
|
130
|
+
behavioral: {
|
|
131
|
+
personality: string[];
|
|
132
|
+
quirks?: string[] | undefined;
|
|
133
|
+
vocalizations?: string[] | undefined;
|
|
134
|
+
};
|
|
135
|
+
description: string;
|
|
136
|
+
metadata?: {
|
|
137
|
+
origin?: string | undefined;
|
|
138
|
+
age?: string | undefined;
|
|
139
|
+
occupation?: string | undefined;
|
|
140
|
+
} | undefined;
|
|
141
|
+
notes?: string | undefined;
|
|
142
|
+
} | undefined;
|
|
143
|
+
}>;
|
|
144
|
+
export type NameValidationInput = z.infer<typeof NameValidationInputSchema>;
|
|
145
|
+
/**
|
|
146
|
+
* Validates a cat name according to Madam Fluffington's VERY PARTICULAR standards.
|
|
147
|
+
*
|
|
148
|
+
* Madam Fluffington is:
|
|
149
|
+
* - A Persian cat of impeccable breeding
|
|
150
|
+
* - Extremely judgmental about proper feline nomenclature
|
|
151
|
+
* - Believes all cats deserve names befitting royalty
|
|
152
|
+
* - Has NO PATIENCE for vulgar or common names
|
|
153
|
+
* - Considers characteristics when judging name appropriateness
|
|
154
|
+
*
|
|
155
|
+
* @param name - The proposed name
|
|
156
|
+
* @param characteristics - The cat's characteristics (optional, but provides better validation)
|
|
157
|
+
* @returns Validation result with status and reasoning
|
|
158
|
+
*/
|
|
159
|
+
export declare function validateCatName(name: string, characteristics?: CatCharacteristics): NameValidationResult;
|
|
160
|
+
/**
|
|
161
|
+
* Generates Madam Fluffington's full critique of a name choice.
|
|
162
|
+
*
|
|
163
|
+
* @param name - The proposed name
|
|
164
|
+
* @param characteristics - The cat's characteristics
|
|
165
|
+
* @returns A detailed critique in Madam Fluffington's voice
|
|
166
|
+
*/
|
|
167
|
+
export declare function critiqueCatName(name: string, characteristics?: CatCharacteristics): string;
|
|
168
|
+
/**
|
|
169
|
+
* Name validator agent
|
|
170
|
+
*
|
|
171
|
+
* Validates cat names according to Madam Fluffington's strict standards of
|
|
172
|
+
* feline nobility and proper nomenclature. Checks for forbidden patterns,
|
|
173
|
+
* distinguished titles, and appropriateness based on cat characteristics.
|
|
174
|
+
*/
|
|
175
|
+
export declare const nameValidatorAgent: import("@vibe-agent-toolkit/agent-runtime").PureFunctionAgent<{
|
|
176
|
+
name: string;
|
|
177
|
+
characteristics?: {
|
|
178
|
+
physical: {
|
|
179
|
+
furColor: string;
|
|
180
|
+
furPattern?: string | undefined;
|
|
181
|
+
eyeColor?: string | undefined;
|
|
182
|
+
breed?: string | undefined;
|
|
183
|
+
size?: "tiny" | "small" | "medium" | "large" | "extra-large" | undefined;
|
|
184
|
+
};
|
|
185
|
+
behavioral: {
|
|
186
|
+
personality: string[];
|
|
187
|
+
quirks?: string[] | undefined;
|
|
188
|
+
vocalizations?: string[] | undefined;
|
|
189
|
+
};
|
|
190
|
+
description: string;
|
|
191
|
+
metadata?: {
|
|
192
|
+
origin?: string | undefined;
|
|
193
|
+
age?: string | undefined;
|
|
194
|
+
occupation?: string | undefined;
|
|
195
|
+
} | undefined;
|
|
196
|
+
notes?: string | undefined;
|
|
197
|
+
} | undefined;
|
|
198
|
+
}, {
|
|
199
|
+
status: "valid" | "invalid" | "questionable";
|
|
200
|
+
reason: string;
|
|
201
|
+
suggestedFixes?: string[] | undefined;
|
|
202
|
+
}>;
|
|
203
|
+
//# sourceMappingURL=name-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-validator.d.ts","sourceRoot":"","sources":["../../src/pure-function-tool/name-validator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAEL,KAAK,kBAAkB,EAEvB,KAAK,oBAAoB,EAC1B,MAAM,qBAAqB,CAAC;AAK7B;;GAEG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAGpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AA6I5E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,kBAAkB,GACnC,oBAAoB,CA4CtB;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,eAAe,CAAC,EAAE,kBAAkB,GACnC,MAAM,CA4CR;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY9B,CAAC"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import { definePureFunction } from '@vibe-agent-toolkit/agent-runtime';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { CatCharacteristicsSchema, NameValidationResultSchema, } from '../types/schemas.js';
|
|
4
|
+
// SonarQube: Disable "Do not call Array#push() multiple times" - conditional pushes based on validation logic
|
|
5
|
+
// NOSONAR
|
|
6
|
+
/**
|
|
7
|
+
* Input schema for name validation
|
|
8
|
+
*/
|
|
9
|
+
export const NameValidationInputSchema = z.object({
|
|
10
|
+
name: z.string().describe('The proposed cat name to validate'),
|
|
11
|
+
characteristics: CatCharacteristicsSchema.optional().describe('Cat characteristics for context-aware validation'),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Rules for cat names that Madam Fluffington finds ABSOLUTELY UNACCEPTABLE
|
|
15
|
+
*/
|
|
16
|
+
const FORBIDDEN_PATTERNS = [
|
|
17
|
+
// Too common/boring
|
|
18
|
+
{ pattern: /^(fluffy|kitty|cat|pussy)$/i, reason: 'Far too common and beneath any respectable feline' },
|
|
19
|
+
{ pattern: /^mr\.?\s/i, reason: 'Lacks the sophistication of proper nobility. Use "Sir" or "Lord" instead' },
|
|
20
|
+
{ pattern: /^ms\.?\s/i, reason: 'Lacks the elegance of proper titles. Use "Lady" or "Dame" instead' },
|
|
21
|
+
// Undignified
|
|
22
|
+
{ pattern: /\d/, reason: 'Numbers are for accountants, not aristocats' },
|
|
23
|
+
{ pattern: /(butt|poop|fart|stink)/i, reason: 'ABSOLUTELY VULGAR! I refuse to even comment further' },
|
|
24
|
+
{ pattern: /(dumb|stupid|silly|goofy)/i, reason: 'Insulting to feline intelligence and dignity' },
|
|
25
|
+
// Food-based (questionable)
|
|
26
|
+
{ pattern: /(muffin|cupcake|cookie|pizza)/i, reason: 'Naming nobility after peasant food? I think not!' },
|
|
27
|
+
// Too simple
|
|
28
|
+
{ pattern: /^[a-z]{1,3}$/i, reason: 'Too short! A proper name requires at least 4 letters' },
|
|
29
|
+
];
|
|
30
|
+
/**
|
|
31
|
+
* Patterns that indicate EXCELLENT taste (gets Madam Fluffington's approval)
|
|
32
|
+
*/
|
|
33
|
+
const DISTINGUISHED_PATTERNS = [
|
|
34
|
+
{ pattern: /^(sir|lord|duke|baron|count|earl)/i, reason: 'Proper masculine nobility!' },
|
|
35
|
+
{ pattern: /^(lady|dame|duchess|baroness|countess)/i, reason: 'Proper feminine nobility!' },
|
|
36
|
+
{ pattern: /^(princess|prince|king|queen|empress|emperor)/i, reason: 'Royalty! As all cats deserve!' },
|
|
37
|
+
{ pattern: /(sterling|diamond|sapphire|emerald|pearl)/i, reason: 'Named after precious things, as befits a cat' },
|
|
38
|
+
{ pattern: /(whiskers|paws|purr)/i, reason: 'Celebrates noble feline attributes' },
|
|
39
|
+
];
|
|
40
|
+
const CHARACTERISTIC_RULES = [
|
|
41
|
+
{
|
|
42
|
+
check: (cat) => cat.physical.furColor.toLowerCase().includes('orange') ||
|
|
43
|
+
cat.physical.furColor.toLowerCase().includes('ginger'),
|
|
44
|
+
createMessage: (name) => name.toLowerCase().includes('tiger') || name.toLowerCase().includes('marmalade')
|
|
45
|
+
? 'Acceptable for an orange cat, though a bit obvious'
|
|
46
|
+
: 'For an ORANGE cat? This name lacks proper acknowledgment of their majestic coloring!',
|
|
47
|
+
severity: 'questionable',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
check: (cat) => cat.physical.furColor.toLowerCase().includes('black'),
|
|
51
|
+
createMessage: (name) => name.toLowerCase().includes('shadow') ||
|
|
52
|
+
name.toLowerCase().includes('midnight') ||
|
|
53
|
+
name.toLowerCase().includes('noir')
|
|
54
|
+
? 'Appropriately mysterious for a black cat'
|
|
55
|
+
: 'A black cat deserves a name befitting their elegant darkness!',
|
|
56
|
+
severity: 'questionable',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
check: (cat) => cat.physical.size === 'tiny' || cat.physical.size === 'small',
|
|
60
|
+
createMessage: (name) => name.length > 15
|
|
61
|
+
? 'This name is longer than the cat! Show some proportion, please!'
|
|
62
|
+
: 'Size-appropriate naming shows good judgment',
|
|
63
|
+
severity: 'questionable',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
check: (cat) => cat.behavioral.personality.some((p) => p.toLowerCase().includes('lazy') || p.toLowerCase().includes('sleepy')),
|
|
67
|
+
createMessage: (name) => /^(snooze|doze|nap|sleepy|lazy)/i.test(name)
|
|
68
|
+
? 'A bit on-the-nose, but I appreciate honesty'
|
|
69
|
+
: 'This name suggests far too much energy for such a languid creature',
|
|
70
|
+
severity: 'questionable',
|
|
71
|
+
},
|
|
72
|
+
];
|
|
73
|
+
/**
|
|
74
|
+
* Checks if a name matches any forbidden patterns.
|
|
75
|
+
*/
|
|
76
|
+
function checkForbiddenPatterns(name) {
|
|
77
|
+
for (const forbidden of FORBIDDEN_PATTERNS) {
|
|
78
|
+
if (forbidden.pattern.test(name)) {
|
|
79
|
+
return {
|
|
80
|
+
status: 'invalid',
|
|
81
|
+
reason: `*flicks tail disdainfully* "${name}"? ${forbidden.reason}.`,
|
|
82
|
+
suggestedFixes: [
|
|
83
|
+
'Consider a proper noble title (Sir, Lady, Duke, Duchess)',
|
|
84
|
+
'Think of precious stones or metals (Sterling, Diamond, Sapphire)',
|
|
85
|
+
'Reference classical literature or royalty',
|
|
86
|
+
],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Checks if a name matches any distinguished patterns.
|
|
94
|
+
*/
|
|
95
|
+
function checkDistinguishedPatterns(name) {
|
|
96
|
+
for (const distinguished of DISTINGUISHED_PATTERNS) {
|
|
97
|
+
if (distinguished.pattern.test(name)) {
|
|
98
|
+
return {
|
|
99
|
+
status: 'valid',
|
|
100
|
+
reason: `*purrs approvingly* "${name}"! ${distinguished.reason}. You have excellent taste!`,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Applies characteristic-based validation rules.
|
|
108
|
+
*/
|
|
109
|
+
function applyCharacteristicRules(name, characteristics, suggestedFixes) {
|
|
110
|
+
for (const rule of CHARACTERISTIC_RULES) {
|
|
111
|
+
if (rule.check(characteristics)) {
|
|
112
|
+
const message = rule.createMessage(name, characteristics);
|
|
113
|
+
if (rule.severity === 'invalid') {
|
|
114
|
+
return {
|
|
115
|
+
status: 'invalid',
|
|
116
|
+
reason: `*narrows eyes* ${message}`,
|
|
117
|
+
suggestedFixes: ['Reconsider this name given the cat\'s characteristics'],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
suggestedFixes.push(message);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return null;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Validates a cat name according to Madam Fluffington's VERY PARTICULAR standards.
|
|
127
|
+
*
|
|
128
|
+
* Madam Fluffington is:
|
|
129
|
+
* - A Persian cat of impeccable breeding
|
|
130
|
+
* - Extremely judgmental about proper feline nomenclature
|
|
131
|
+
* - Believes all cats deserve names befitting royalty
|
|
132
|
+
* - Has NO PATIENCE for vulgar or common names
|
|
133
|
+
* - Considers characteristics when judging name appropriateness
|
|
134
|
+
*
|
|
135
|
+
* @param name - The proposed name
|
|
136
|
+
* @param characteristics - The cat's characteristics (optional, but provides better validation)
|
|
137
|
+
* @returns Validation result with status and reasoning
|
|
138
|
+
*/
|
|
139
|
+
export function validateCatName(name, characteristics) {
|
|
140
|
+
const suggestedFixes = [];
|
|
141
|
+
// Check forbidden patterns
|
|
142
|
+
const forbiddenResult = checkForbiddenPatterns(name);
|
|
143
|
+
if (forbiddenResult) {
|
|
144
|
+
return forbiddenResult;
|
|
145
|
+
}
|
|
146
|
+
// Check distinguished patterns (gets immediate approval)
|
|
147
|
+
const distinguishedResult = checkDistinguishedPatterns(name);
|
|
148
|
+
if (distinguishedResult) {
|
|
149
|
+
return distinguishedResult;
|
|
150
|
+
}
|
|
151
|
+
// If we have characteristics, apply those rules
|
|
152
|
+
if (characteristics) {
|
|
153
|
+
const characteristicResult = applyCharacteristicRules(name, characteristics, suggestedFixes);
|
|
154
|
+
if (characteristicResult) {
|
|
155
|
+
return characteristicResult;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
// If we got here with characteristic warnings, mark as questionable
|
|
159
|
+
if (suggestedFixes.length > 0) {
|
|
160
|
+
return {
|
|
161
|
+
status: 'questionable',
|
|
162
|
+
reason: `*considers carefully* "${name}" is... acceptable, I suppose. ${suggestedFixes[0]}`,
|
|
163
|
+
suggestedFixes: suggestedFixes.slice(1),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
// No forbidden patterns, no distinguished patterns, no characteristic issues
|
|
167
|
+
// This is the "meh" category
|
|
168
|
+
return {
|
|
169
|
+
status: 'questionable',
|
|
170
|
+
reason: `*sniffs* "${name}" is adequate, though it lacks a certain... je ne sais quoi. It would be acceptable for a common house cat, but surely THIS cat deserves better?`,
|
|
171
|
+
suggestedFixes: [
|
|
172
|
+
'Add a noble title prefix',
|
|
173
|
+
'Consider names from classical literature',
|
|
174
|
+
'Think of precious materials or gems',
|
|
175
|
+
'Reference their most distinguished characteristic',
|
|
176
|
+
],
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Generates Madam Fluffington's full critique of a name choice.
|
|
181
|
+
*
|
|
182
|
+
* @param name - The proposed name
|
|
183
|
+
* @param characteristics - The cat's characteristics
|
|
184
|
+
* @returns A detailed critique in Madam Fluffington's voice
|
|
185
|
+
*/
|
|
186
|
+
export function critiqueCatName(name, characteristics) {
|
|
187
|
+
const result = validateCatName(name, characteristics);
|
|
188
|
+
const lines = [];
|
|
189
|
+
lines.push('=== Madam Fluffington\'s Naming Critique ===\n');
|
|
190
|
+
lines.push('*adjusts diamond collar and regards you with piercing blue eyes*\n');
|
|
191
|
+
if (characteristics) {
|
|
192
|
+
lines.push('The cat in question:');
|
|
193
|
+
const furPattern = characteristics.physical.furPattern
|
|
194
|
+
? ` (${characteristics.physical.furPattern})`
|
|
195
|
+
: '';
|
|
196
|
+
lines.push(` • Fur: ${characteristics.physical.furColor}${furPattern}`);
|
|
197
|
+
if (characteristics.physical.breed) {
|
|
198
|
+
lines.push(` • Breed: ${characteristics.physical.breed}`);
|
|
199
|
+
}
|
|
200
|
+
lines.push(` • Personality: ${characteristics.behavioral.personality.join(', ')}`);
|
|
201
|
+
lines.push('');
|
|
202
|
+
}
|
|
203
|
+
lines.push(`Proposed name: "${name}"`);
|
|
204
|
+
lines.push(`Verdict: ${result.status.toUpperCase()}\n`);
|
|
205
|
+
lines.push(result.reason);
|
|
206
|
+
if (result.suggestedFixes && result.suggestedFixes.length > 0) {
|
|
207
|
+
lines.push('\n*extends one elegant paw*');
|
|
208
|
+
lines.push('May I suggest:');
|
|
209
|
+
for (const fix of result.suggestedFixes) {
|
|
210
|
+
lines.push(` • ${fix}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (result.status === 'valid') {
|
|
214
|
+
lines.push('\n*purrs contentedly*');
|
|
215
|
+
lines.push('You may proceed with this name. I approve.');
|
|
216
|
+
}
|
|
217
|
+
else if (result.status === 'invalid') {
|
|
218
|
+
lines.push('\n*turns away and begins grooming*');
|
|
219
|
+
lines.push('I refuse to discuss this further until you present a PROPER name.');
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
lines.push('\n*tail swishes thoughtfully*');
|
|
223
|
+
lines.push('I shall tolerate this name, but know that I find it... uninspired.');
|
|
224
|
+
}
|
|
225
|
+
return lines.join('\n');
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Name validator agent
|
|
229
|
+
*
|
|
230
|
+
* Validates cat names according to Madam Fluffington's strict standards of
|
|
231
|
+
* feline nobility and proper nomenclature. Checks for forbidden patterns,
|
|
232
|
+
* distinguished titles, and appropriateness based on cat characteristics.
|
|
233
|
+
*/
|
|
234
|
+
export const nameValidatorAgent = definePureFunction({
|
|
235
|
+
name: 'name-validator',
|
|
236
|
+
version: '1.0.0',
|
|
237
|
+
description: 'Validates cat names for proper nobility conventions and appropriateness',
|
|
238
|
+
inputSchema: NameValidationInputSchema,
|
|
239
|
+
outputSchema: NameValidationResultSchema,
|
|
240
|
+
}, (input) => {
|
|
241
|
+
// Input is already validated by wrapper
|
|
242
|
+
return validateCatName(input.name, input.characteristics);
|
|
243
|
+
});
|
|
244
|
+
//# sourceMappingURL=name-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"name-validator.js","sourceRoot":"","sources":["../../src/pure-function-tool/name-validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,wBAAwB,EAExB,0BAA0B,GAE3B,MAAM,qBAAqB,CAAC;AAE7B,8GAA8G;AAC9G,UAAU;AAEV;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;IAC9D,eAAe,EAAE,wBAAwB,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;CAClH,CAAC,CAAC;AAIH;;GAEG;AACH,MAAM,kBAAkB,GAAG;IACzB,oBAAoB;IACpB,EAAE,OAAO,EAAE,6BAA6B,EAAE,MAAM,EAAE,mDAAmD,EAAE;IACvG,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,0EAA0E,EAAE;IAC5G,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,mEAAmE,EAAE;IAErG,cAAc;IACd,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,6CAA6C,EAAE;IACxE,EAAE,OAAO,EAAE,yBAAyB,EAAE,MAAM,EAAE,qDAAqD,EAAE;IACrG,EAAE,OAAO,EAAE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