@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,335 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cat breed knowledge database for the breed advisor agent.
|
|
3
|
+
* Contains comprehensive breed profiles with traits aligned to music preferences.
|
|
4
|
+
*/
|
|
5
|
+
// Constants for duplicated strings
|
|
6
|
+
const ACTIVITY_COUCH_COMPANION = 'couch-companion';
|
|
7
|
+
const ACTIVITY_PLAYFUL_MODERATE = 'playful-moderate';
|
|
8
|
+
const ACTIVITY_ACTIVE_EXPLORER = 'active-explorer';
|
|
9
|
+
const ACTIVITY_HIGH_ENERGY = 'high-energy-athlete';
|
|
10
|
+
export const BREED_DATABASE = [
|
|
11
|
+
{
|
|
12
|
+
name: 'Persian',
|
|
13
|
+
traits: {
|
|
14
|
+
activityLevel: [ACTIVITY_COUCH_COMPANION],
|
|
15
|
+
groomingNeeds: 'daily',
|
|
16
|
+
suitableForApartment: true,
|
|
17
|
+
goodWithKids: true,
|
|
18
|
+
goodWithPets: true,
|
|
19
|
+
hypoallergenic: false,
|
|
20
|
+
musicAlignment: ['classical'],
|
|
21
|
+
temperament: 'Calm, gentle, and affectionate. Enjoys quiet environments and a predictable routine.',
|
|
22
|
+
size: 'medium',
|
|
23
|
+
},
|
|
24
|
+
description: 'Known for their luxurious long coat and sweet personality. Persians are the ultimate lap cats, preferring a serene environment with classical music. They require daily grooming but reward their owners with unwavering loyalty and gentle companionship.',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Ragdoll',
|
|
28
|
+
traits: {
|
|
29
|
+
activityLevel: [ACTIVITY_COUCH_COMPANION, ACTIVITY_PLAYFUL_MODERATE],
|
|
30
|
+
groomingNeeds: 'weekly',
|
|
31
|
+
suitableForApartment: true,
|
|
32
|
+
goodWithKids: true,
|
|
33
|
+
goodWithPets: true,
|
|
34
|
+
hypoallergenic: false,
|
|
35
|
+
musicAlignment: ['classical', 'pop'],
|
|
36
|
+
temperament: 'Docile, relaxed, and people-oriented. Known for going limp when picked up.',
|
|
37
|
+
size: 'large',
|
|
38
|
+
},
|
|
39
|
+
description: 'Famous for their tendency to go limp when held, Ragdolls are large, gentle cats with striking blue eyes. They enjoy both relaxing classical melodies and upbeat pop tunes. Perfect for families, they are patient with children and get along well with other pets.',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'Siamese',
|
|
43
|
+
traits: {
|
|
44
|
+
activityLevel: [ACTIVITY_PLAYFUL_MODERATE, ACTIVITY_ACTIVE_EXPLORER],
|
|
45
|
+
groomingNeeds: 'minimal',
|
|
46
|
+
suitableForApartment: true,
|
|
47
|
+
goodWithKids: true,
|
|
48
|
+
goodWithPets: true,
|
|
49
|
+
hypoallergenic: false,
|
|
50
|
+
musicAlignment: ['jazz'],
|
|
51
|
+
temperament: 'Vocal, intelligent, and social. Forms strong bonds with owners.',
|
|
52
|
+
size: 'medium',
|
|
53
|
+
},
|
|
54
|
+
description: 'One of the most recognizable breeds with distinctive color points and blue eyes. Siamese cats are highly intelligent, vocal, and thrive on interaction. They resonate with jazz music, appreciating its complexity and improvisational nature. Very social and demand attention.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Bengal',
|
|
58
|
+
traits: {
|
|
59
|
+
activityLevel: [ACTIVITY_ACTIVE_EXPLORER, ACTIVITY_HIGH_ENERGY],
|
|
60
|
+
groomingNeeds: 'minimal',
|
|
61
|
+
suitableForApartment: false,
|
|
62
|
+
goodWithKids: true,
|
|
63
|
+
goodWithPets: true,
|
|
64
|
+
hypoallergenic: false,
|
|
65
|
+
musicAlignment: ['jazz', 'rock'],
|
|
66
|
+
temperament: 'Energetic, playful, and curious. Loves water and climbing.',
|
|
67
|
+
size: 'medium',
|
|
68
|
+
},
|
|
69
|
+
description: 'With their wild leopard-like appearance, Bengals are extremely active and athletic. They need plenty of space and stimulation. Their high energy matches well with jazz and rock music. Known for their love of water and climbing, they require interactive play and mental challenges.',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Maine Coon',
|
|
73
|
+
traits: {
|
|
74
|
+
activityLevel: [ACTIVITY_PLAYFUL_MODERATE, ACTIVITY_ACTIVE_EXPLORER],
|
|
75
|
+
groomingNeeds: 'weekly',
|
|
76
|
+
suitableForApartment: false,
|
|
77
|
+
goodWithKids: true,
|
|
78
|
+
goodWithPets: true,
|
|
79
|
+
hypoallergenic: false,
|
|
80
|
+
musicAlignment: ['rock', 'country'],
|
|
81
|
+
temperament: 'Gentle giant, friendly, and adaptable. Often called "dogs of the cat world".',
|
|
82
|
+
size: 'large',
|
|
83
|
+
},
|
|
84
|
+
description: 'One of the largest domestic cat breeds, Maine Coons are known for their dog-like personalities. They are friendly, sociable, and great with families. Their rugged nature aligns with rock and country music. Despite their size, they are gentle and adapt well to various living situations.',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'Abyssinian',
|
|
88
|
+
traits: {
|
|
89
|
+
activityLevel: [ACTIVITY_ACTIVE_EXPLORER, ACTIVITY_HIGH_ENERGY],
|
|
90
|
+
groomingNeeds: 'minimal',
|
|
91
|
+
suitableForApartment: true,
|
|
92
|
+
goodWithKids: true,
|
|
93
|
+
goodWithPets: true,
|
|
94
|
+
hypoallergenic: false,
|
|
95
|
+
musicAlignment: ['metal', 'rock'],
|
|
96
|
+
temperament: 'Extremely active, curious, and playful. Always on the move.',
|
|
97
|
+
size: 'medium',
|
|
98
|
+
},
|
|
99
|
+
description: 'Ancient breed with a wild appearance and boundless energy. Abyssinians are constantly in motion, exploring every corner of their environment. Their intense energy matches metal and rock music. They are intelligent, social, and require lots of interactive play and stimulation.',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'Sphynx',
|
|
103
|
+
traits: {
|
|
104
|
+
activityLevel: [ACTIVITY_PLAYFUL_MODERATE, ACTIVITY_ACTIVE_EXPLORER],
|
|
105
|
+
groomingNeeds: 'weekly',
|
|
106
|
+
suitableForApartment: true,
|
|
107
|
+
goodWithKids: true,
|
|
108
|
+
goodWithPets: true,
|
|
109
|
+
hypoallergenic: true,
|
|
110
|
+
musicAlignment: ['electronic'],
|
|
111
|
+
temperament: 'Extroverted, energetic, and affectionate. Loves attention and warmth.',
|
|
112
|
+
size: 'medium',
|
|
113
|
+
},
|
|
114
|
+
description: 'Hairless and striking, Sphynx cats have a unique appearance that matches their quirky personalities. They are warm to the touch and love human contact. Their modern, unconventional nature aligns with electronic music. Hypoallergenic and perfect for those with cat allergies.',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'Devon Rex',
|
|
118
|
+
traits: {
|
|
119
|
+
activityLevel: [ACTIVITY_PLAYFUL_MODERATE, ACTIVITY_ACTIVE_EXPLORER],
|
|
120
|
+
groomingNeeds: 'minimal',
|
|
121
|
+
suitableForApartment: true,
|
|
122
|
+
goodWithKids: true,
|
|
123
|
+
goodWithPets: true,
|
|
124
|
+
hypoallergenic: false,
|
|
125
|
+
musicAlignment: ['electronic', 'pop'],
|
|
126
|
+
temperament: 'Mischievous, playful, and people-oriented. Often called "monkeys in cat suits".',
|
|
127
|
+
size: 'small',
|
|
128
|
+
},
|
|
129
|
+
description: 'With their large ears, curly coat, and impish personality, Devon Rex cats are highly entertaining. They are acrobatic, playful, and love being the center of attention. Their quirky nature resonates with electronic and pop music. Very social and bond closely with their families.',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'Russian Blue',
|
|
133
|
+
traits: {
|
|
134
|
+
activityLevel: [ACTIVITY_COUCH_COMPANION, ACTIVITY_PLAYFUL_MODERATE],
|
|
135
|
+
groomingNeeds: 'minimal',
|
|
136
|
+
suitableForApartment: true,
|
|
137
|
+
goodWithKids: true,
|
|
138
|
+
goodWithPets: true,
|
|
139
|
+
hypoallergenic: true,
|
|
140
|
+
musicAlignment: ['none', 'classical'],
|
|
141
|
+
temperament: 'Reserved, intelligent, and loyal. Can be shy with strangers.',
|
|
142
|
+
size: 'medium',
|
|
143
|
+
},
|
|
144
|
+
description: 'Known for their shimmering blue-gray coat and green eyes, Russian Blues are elegant and reserved. They prefer quiet environments and may not appreciate music at all, though they can tolerate classical. Hypoallergenic and perfect for those seeking a calm, loyal companion.',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
name: 'Domestic Shorthair',
|
|
148
|
+
traits: {
|
|
149
|
+
activityLevel: [ACTIVITY_COUCH_COMPANION, ACTIVITY_PLAYFUL_MODERATE, ACTIVITY_ACTIVE_EXPLORER],
|
|
150
|
+
groomingNeeds: 'minimal',
|
|
151
|
+
suitableForApartment: true,
|
|
152
|
+
goodWithKids: true,
|
|
153
|
+
goodWithPets: true,
|
|
154
|
+
hypoallergenic: false,
|
|
155
|
+
musicAlignment: ['pop', 'country'],
|
|
156
|
+
temperament: 'Varied - each cat is unique. Generally adaptable and friendly.',
|
|
157
|
+
size: 'medium',
|
|
158
|
+
},
|
|
159
|
+
description: 'The most common cat in North America, Domestic Shorthairs are mixed breed cats with diverse personalities. They adapt well to various lifestyles and music preferences, though pop and country are common favorites. Each cat is unique, making them unpredictable but wonderful companions.',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'American Shorthair',
|
|
163
|
+
traits: {
|
|
164
|
+
activityLevel: [ACTIVITY_PLAYFUL_MODERATE],
|
|
165
|
+
groomingNeeds: 'minimal',
|
|
166
|
+
suitableForApartment: true,
|
|
167
|
+
goodWithKids: true,
|
|
168
|
+
goodWithPets: true,
|
|
169
|
+
hypoallergenic: false,
|
|
170
|
+
musicAlignment: ['country', 'pop'],
|
|
171
|
+
temperament: 'Easygoing, affectionate, and adaptable. Great family cats.',
|
|
172
|
+
size: 'medium',
|
|
173
|
+
},
|
|
174
|
+
description: 'A true American breed, these cats are known for their robust health and easygoing nature. They are playful without being hyperactive and enjoy country and pop music. Excellent with children and other pets, they make ideal family companions.',
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
name: 'Scottish Fold',
|
|
178
|
+
traits: {
|
|
179
|
+
activityLevel: [ACTIVITY_COUCH_COMPANION, ACTIVITY_PLAYFUL_MODERATE],
|
|
180
|
+
groomingNeeds: 'weekly',
|
|
181
|
+
suitableForApartment: true,
|
|
182
|
+
goodWithKids: true,
|
|
183
|
+
goodWithPets: true,
|
|
184
|
+
hypoallergenic: false,
|
|
185
|
+
musicAlignment: ['classical', 'jazz'],
|
|
186
|
+
temperament: 'Sweet-tempered, calm, and adaptable. Enjoys human company.',
|
|
187
|
+
size: 'medium',
|
|
188
|
+
},
|
|
189
|
+
description: 'Recognized by their distinctive folded ears, Scottish Folds are gentle, sweet-natured cats. They enjoy both calm classical music and sophisticated jazz. They adapt well to different living situations and get along with everyone. Known for sitting in unusual positions.',
|
|
190
|
+
},
|
|
191
|
+
];
|
|
192
|
+
/**
|
|
193
|
+
* Score music preference alignment
|
|
194
|
+
*/
|
|
195
|
+
function scoreMusicPreference(profile, breed) {
|
|
196
|
+
if (profile.musicPreference && breed.traits.musicAlignment.includes(profile.musicPreference)) {
|
|
197
|
+
return {
|
|
198
|
+
score: 30,
|
|
199
|
+
reason: `music preference (${profile.musicPreference}) aligns perfectly`,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
return { score: 0 };
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Score activity level match
|
|
206
|
+
*/
|
|
207
|
+
function scoreActivityLevel(profile, breed) {
|
|
208
|
+
if (profile.activityLevel && breed.traits.activityLevel.includes(profile.activityLevel)) {
|
|
209
|
+
return {
|
|
210
|
+
score: 20,
|
|
211
|
+
reason: `activity level (${profile.activityLevel}) matches well`,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
return { score: 0 };
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Score living space compatibility
|
|
218
|
+
*/
|
|
219
|
+
function scoreLivingSpace(profile, breed) {
|
|
220
|
+
if (!profile.livingSpace) {
|
|
221
|
+
return { score: 0 };
|
|
222
|
+
}
|
|
223
|
+
if (profile.livingSpace === 'apartment' && breed.traits.suitableForApartment) {
|
|
224
|
+
return { score: 15, reason: 'suitable for apartment living' };
|
|
225
|
+
}
|
|
226
|
+
if (profile.livingSpace === 'apartment' && !breed.traits.suitableForApartment) {
|
|
227
|
+
return { score: -20, reason: 'not ideal for apartments (penalty)' };
|
|
228
|
+
}
|
|
229
|
+
// Any breed works for houses/farms
|
|
230
|
+
return { score: 10, reason: 'plenty of space available' };
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Score grooming compatibility
|
|
234
|
+
*/
|
|
235
|
+
function scoreGrooming(profile, breed) {
|
|
236
|
+
if (!profile.groomingTolerance) {
|
|
237
|
+
return { score: 0 };
|
|
238
|
+
}
|
|
239
|
+
if (profile.groomingTolerance === breed.traits.groomingNeeds) {
|
|
240
|
+
return {
|
|
241
|
+
score: 15,
|
|
242
|
+
reason: `grooming needs (${breed.traits.groomingNeeds}) match tolerance`,
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
// Check if grooming tolerance is higher than needs (okay)
|
|
246
|
+
const toleranceLevels = { minimal: 0, weekly: 1, daily: 2 };
|
|
247
|
+
const needsLevels = { minimal: 0, weekly: 1, daily: 2 };
|
|
248
|
+
if (toleranceLevels[profile.groomingTolerance] >= needsLevels[breed.traits.groomingNeeds]) {
|
|
249
|
+
return { score: 8, reason: 'grooming needs are manageable' };
|
|
250
|
+
}
|
|
251
|
+
return { score: -10, reason: 'grooming needs exceed tolerance (penalty)' };
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Score family composition compatibility
|
|
255
|
+
*/
|
|
256
|
+
function scoreFamilyComposition(profile, breed) {
|
|
257
|
+
if (!profile.familyComposition) {
|
|
258
|
+
return { score: 0 };
|
|
259
|
+
}
|
|
260
|
+
if (profile.familyComposition === 'young-kids' && breed.traits.goodWithKids) {
|
|
261
|
+
return { score: 10, reason: 'great with young children' };
|
|
262
|
+
}
|
|
263
|
+
if (profile.familyComposition === 'older-kids' && breed.traits.goodWithKids) {
|
|
264
|
+
return { score: 10, reason: 'good with older children' };
|
|
265
|
+
}
|
|
266
|
+
if (profile.familyComposition === 'multi-pet' && breed.traits.goodWithPets) {
|
|
267
|
+
return { score: 10, reason: 'gets along well with other pets' };
|
|
268
|
+
}
|
|
269
|
+
if (profile.familyComposition === 'single' || profile.familyComposition === 'couple') {
|
|
270
|
+
return { score: 5, reason: 'suitable for adult household' };
|
|
271
|
+
}
|
|
272
|
+
return { score: 0 };
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Match breeds to a selection profile using scoring algorithm
|
|
276
|
+
*
|
|
277
|
+
* Scoring:
|
|
278
|
+
* - Music preference: 30 points (CRITICAL factor, 2x weight)
|
|
279
|
+
* - Activity level: 20 points
|
|
280
|
+
* - Living space: 15 points
|
|
281
|
+
* - Grooming tolerance: 15 points
|
|
282
|
+
* - Family composition: 10 points
|
|
283
|
+
* - Penalties: -10 to -20 per mismatch
|
|
284
|
+
*
|
|
285
|
+
* Hard filters:
|
|
286
|
+
* - allergies=true → only hypoallergenic
|
|
287
|
+
* - young-kids → only goodWithKids
|
|
288
|
+
*/
|
|
289
|
+
export function matchBreeds(profile) {
|
|
290
|
+
// Return empty if no factors to match
|
|
291
|
+
const factorCount = [
|
|
292
|
+
profile.musicPreference,
|
|
293
|
+
profile.activityLevel,
|
|
294
|
+
profile.livingSpace,
|
|
295
|
+
profile.groomingTolerance,
|
|
296
|
+
profile.familyComposition,
|
|
297
|
+
profile.allergies === undefined ? undefined : 'allergies',
|
|
298
|
+
].filter(Boolean).length;
|
|
299
|
+
if (factorCount === 0) {
|
|
300
|
+
return [];
|
|
301
|
+
}
|
|
302
|
+
// Apply hard filters
|
|
303
|
+
let candidates = BREED_DATABASE;
|
|
304
|
+
if (profile.allergies === true) {
|
|
305
|
+
candidates = candidates.filter((breed) => breed.traits.hypoallergenic);
|
|
306
|
+
}
|
|
307
|
+
if (profile.familyComposition === 'young-kids') {
|
|
308
|
+
candidates = candidates.filter((breed) => breed.traits.goodWithKids);
|
|
309
|
+
}
|
|
310
|
+
// Score each candidate
|
|
311
|
+
const scored = candidates.map((breed) => {
|
|
312
|
+
const results = [
|
|
313
|
+
scoreMusicPreference(profile, breed),
|
|
314
|
+
scoreActivityLevel(profile, breed),
|
|
315
|
+
scoreLivingSpace(profile, breed),
|
|
316
|
+
scoreGrooming(profile, breed),
|
|
317
|
+
scoreFamilyComposition(profile, breed),
|
|
318
|
+
];
|
|
319
|
+
const score = results.reduce((sum, result) => sum + result.score, 0);
|
|
320
|
+
const reasons = results.filter((result) => result.reason).map((result) => result.reason);
|
|
321
|
+
const reasoning = reasons.length > 0
|
|
322
|
+
? reasons.join('; ')
|
|
323
|
+
: 'General compatibility based on temperament';
|
|
324
|
+
return {
|
|
325
|
+
breed: breed.name,
|
|
326
|
+
matchScore: Math.max(0, Math.min(100, score)), // Clamp to 0-100
|
|
327
|
+
reasoning,
|
|
328
|
+
};
|
|
329
|
+
});
|
|
330
|
+
// Sort by score descending and return top 3
|
|
331
|
+
return scored
|
|
332
|
+
.toSorted((a, b) => b.matchScore - a.matchScore)
|
|
333
|
+
.slice(0, 3);
|
|
334
|
+
}
|
|
335
|
+
//# sourceMappingURL=breed-knowledge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breed-knowledge.js","sourceRoot":"","sources":["../../src/conversational-assistant/breed-knowledge.ts"],"names":[],"mappings":"AAAA;;;GAGG;AASH,mCAAmC;AACnC,MAAM,wBAAwB,GAAkB,iBAAiB,CAAC;AAClE,MAAM,yBAAyB,GAAkB,kBAAkB,CAAC;AACpE,MAAM,wBAAwB,GAAkB,iBAAiB,CAAC;AAClE,MAAM,oBAAoB,GAAkB,qBAAqB,CAAC;AAkBlE,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C;QACE,IAAI,EAAE,SAAS;QACf,MAAM,EAAE;YACN,aAAa,EAAE,CAAC,wBAAwB,CAAC;YACzC,aAAa,EAAE,OAAO;YACtB,oBAAoB,EAAE,IAAI;YAC1B,YAAY,EAAE,IAAI;YAClB,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,KAAK;YACrB,cAAc,EAAE,CAAC,WAAW,CAAC;YAC7B,WAAW,EAAE,sFAAsF;YACnG,IAAI,EAAE,QAAQ;SACf;QACD,WAAW,EAAE,4PAA4P;KAC1Q;IACD;QACE,IAAI,EAAE,SAAS;QACf,MAAM,EAAE;YACN,aAAa,EAAE,CAAC,wBAAwB,EAAE,yBAAyB,CAAC;YACpE,aAAa,EAAE,QAAQ;YACvB,oBAAoB,EAAE,IAAI;YAC1B,YAAY,EAAE,IAAI;YAClB,YAAY,EAAE,IAAI;YAClB,cAAc,EAAE,KAAK;YACrB,cAAc,EAAE,CAAC,WAAW,EAAE,KAAK,CAAC;YACpC,WAAW,EAAE,4EAA4E;YACzF,IAAI,EAAE,OAAO;SACd;QACD,WAAW,EAAE,qQA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C,EAAE,iBAAiB;YAChE,SAAS;SACV,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,4CAA4C;IAC5C,OAAO,MAAM;SACV,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC;SAC/C,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import type { Agent, ExternalEventError, OneShotAgentOutput } from '@vibe-agent-toolkit/agent-schema';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Input schema for approval requests
|
|
5
|
+
*/
|
|
6
|
+
export declare const ApprovalRequestInputSchema: z.ZodObject<{
|
|
7
|
+
prompt: z.ZodString;
|
|
8
|
+
context: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
9
|
+
autoResponse: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"approve">, z.ZodLiteral<"reject">]>>;
|
|
10
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
prompt: string;
|
|
13
|
+
context?: Record<string, unknown> | undefined;
|
|
14
|
+
autoResponse?: "approve" | "reject" | undefined;
|
|
15
|
+
timeoutMs?: number | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
prompt: string;
|
|
18
|
+
context?: Record<string, unknown> | undefined;
|
|
19
|
+
autoResponse?: "approve" | "reject" | undefined;
|
|
20
|
+
timeoutMs?: number | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
export type ApprovalRequestInput = z.infer<typeof ApprovalRequestInputSchema>;
|
|
23
|
+
/**
|
|
24
|
+
* Output schema for approval results
|
|
25
|
+
*/
|
|
26
|
+
export declare const ApprovalResultSchema: z.ZodObject<{
|
|
27
|
+
approved: z.ZodBoolean;
|
|
28
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
29
|
+
timedOut: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
approved: boolean;
|
|
32
|
+
reason?: string | undefined;
|
|
33
|
+
timedOut?: boolean | undefined;
|
|
34
|
+
}, {
|
|
35
|
+
approved: boolean;
|
|
36
|
+
reason?: string | undefined;
|
|
37
|
+
timedOut?: boolean | undefined;
|
|
38
|
+
}>;
|
|
39
|
+
export type ApprovalResult = z.infer<typeof ApprovalResultSchema>;
|
|
40
|
+
/**
|
|
41
|
+
* Input schema for choice requests
|
|
42
|
+
*/
|
|
43
|
+
export declare const ChoiceRequestInputSchema: z.ZodObject<{
|
|
44
|
+
prompt: z.ZodString;
|
|
45
|
+
options: z.ZodArray<z.ZodString, "many">;
|
|
46
|
+
autoResponse: z.ZodOptional<z.ZodString>;
|
|
47
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
options: string[];
|
|
50
|
+
prompt: string;
|
|
51
|
+
autoResponse?: string | undefined;
|
|
52
|
+
timeoutMs?: number | undefined;
|
|
53
|
+
}, {
|
|
54
|
+
options: string[];
|
|
55
|
+
prompt: string;
|
|
56
|
+
autoResponse?: string | undefined;
|
|
57
|
+
timeoutMs?: number | undefined;
|
|
58
|
+
}>;
|
|
59
|
+
export type ChoiceRequestInput = z.infer<typeof ChoiceRequestInputSchema>;
|
|
60
|
+
/**
|
|
61
|
+
* Output schema for choice results
|
|
62
|
+
*/
|
|
63
|
+
export declare const ChoiceResultSchema: z.ZodObject<{
|
|
64
|
+
approved: z.ZodBoolean;
|
|
65
|
+
choice: z.ZodOptional<z.ZodString>;
|
|
66
|
+
reason: z.ZodString;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
reason: string;
|
|
69
|
+
approved: boolean;
|
|
70
|
+
choice?: string | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
reason: string;
|
|
73
|
+
approved: boolean;
|
|
74
|
+
choice?: string | undefined;
|
|
75
|
+
}>;
|
|
76
|
+
export type ChoiceResult = z.infer<typeof ChoiceResultSchema>;
|
|
77
|
+
/**
|
|
78
|
+
* Input schema for custom approval requests
|
|
79
|
+
*/
|
|
80
|
+
export declare const CustomApprovalRequestInputSchema: z.ZodObject<{
|
|
81
|
+
prompt: z.ZodString;
|
|
82
|
+
autoResponse: z.ZodOptional<z.ZodString>;
|
|
83
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
84
|
+
}, "strip", z.ZodTypeAny, {
|
|
85
|
+
prompt: string;
|
|
86
|
+
autoResponse?: string | undefined;
|
|
87
|
+
timeoutMs?: number | undefined;
|
|
88
|
+
}, {
|
|
89
|
+
prompt: string;
|
|
90
|
+
autoResponse?: string | undefined;
|
|
91
|
+
timeoutMs?: number | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
export type CustomApprovalRequestInput = z.infer<typeof CustomApprovalRequestInputSchema>;
|
|
94
|
+
/**
|
|
95
|
+
* Output schema for custom approval results
|
|
96
|
+
*/
|
|
97
|
+
export declare const CustomApprovalResultSchema: z.ZodObject<{
|
|
98
|
+
approved: z.ZodBoolean;
|
|
99
|
+
value: z.ZodOptional<z.ZodUnknown>;
|
|
100
|
+
reason: z.ZodString;
|
|
101
|
+
}, "strip", z.ZodTypeAny, {
|
|
102
|
+
reason: string;
|
|
103
|
+
approved: boolean;
|
|
104
|
+
value?: unknown;
|
|
105
|
+
}, {
|
|
106
|
+
reason: string;
|
|
107
|
+
approved: boolean;
|
|
108
|
+
value?: unknown;
|
|
109
|
+
}>;
|
|
110
|
+
export type CustomApprovalResult = z.infer<typeof CustomApprovalResultSchema>;
|
|
111
|
+
/**
|
|
112
|
+
* Configuration for human approval gate
|
|
113
|
+
*/
|
|
114
|
+
export interface HumanApprovalOptions {
|
|
115
|
+
/**
|
|
116
|
+
* Timeout in milliseconds (0 = no timeout)
|
|
117
|
+
* @default 0
|
|
118
|
+
*/
|
|
119
|
+
timeoutMs?: number;
|
|
120
|
+
/**
|
|
121
|
+
* What to do if timeout occurs
|
|
122
|
+
* @default 'reject'
|
|
123
|
+
*/
|
|
124
|
+
onTimeout?: 'approve' | 'reject';
|
|
125
|
+
/**
|
|
126
|
+
* For testing: auto-approve/reject without prompting
|
|
127
|
+
*/
|
|
128
|
+
autoResponse?: 'approve' | 'reject';
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Requests human approval for a decision.
|
|
132
|
+
*
|
|
133
|
+
* Archetype: External Event Integrator
|
|
134
|
+
*
|
|
135
|
+
* This agent integrates with an external system (human input via CLI).
|
|
136
|
+
* In production, this could be:
|
|
137
|
+
* - A web UI approval workflow
|
|
138
|
+
* - A Slack approval bot
|
|
139
|
+
* - An email-based approval system
|
|
140
|
+
* - A ticketing system integration
|
|
141
|
+
*
|
|
142
|
+
* For now, it prompts via CLI.
|
|
143
|
+
*
|
|
144
|
+
* @param prompt - The question to ask the human
|
|
145
|
+
* @param context - Additional context to display (optional)
|
|
146
|
+
* @param options - Configuration options
|
|
147
|
+
* @returns Approval result
|
|
148
|
+
*/
|
|
149
|
+
export declare function requestApproval(prompt: string, context?: Record<string, unknown>, options?: HumanApprovalOptions): Promise<ApprovalResult>;
|
|
150
|
+
/**
|
|
151
|
+
* Requests approval with custom validation logic.
|
|
152
|
+
*
|
|
153
|
+
* This variant allows for more complex approval flows where the human
|
|
154
|
+
* can provide additional input beyond just yes/no.
|
|
155
|
+
*
|
|
156
|
+
* @param prompt - The question to ask
|
|
157
|
+
* @param validator - Function to validate the response
|
|
158
|
+
* @param options - Configuration options
|
|
159
|
+
* @returns Validation result
|
|
160
|
+
*/
|
|
161
|
+
export declare function requestCustomApproval<T>(prompt: string, validator: (response: string) => {
|
|
162
|
+
valid: boolean;
|
|
163
|
+
value?: T;
|
|
164
|
+
error?: string;
|
|
165
|
+
}, options?: Omit<HumanApprovalOptions, 'autoResponse'> & {
|
|
166
|
+
autoResponse?: string;
|
|
167
|
+
}): Promise<{
|
|
168
|
+
approved: boolean;
|
|
169
|
+
value?: T;
|
|
170
|
+
reason: string;
|
|
171
|
+
}>;
|
|
172
|
+
/**
|
|
173
|
+
* Presents multiple options and asks human to choose one.
|
|
174
|
+
*
|
|
175
|
+
* @param prompt - The question to ask
|
|
176
|
+
* @param options - Array of options to choose from
|
|
177
|
+
* @param config - Configuration options
|
|
178
|
+
* @returns Selected option (or undefined if rejected/timed out)
|
|
179
|
+
*/
|
|
180
|
+
export declare function requestChoice<T extends string>(prompt: string, options: T[], config?: Omit<HumanApprovalOptions, 'autoResponse'> & {
|
|
181
|
+
autoResponse?: T;
|
|
182
|
+
}): Promise<{
|
|
183
|
+
approved: boolean;
|
|
184
|
+
choice?: T;
|
|
185
|
+
reason: string;
|
|
186
|
+
}>;
|
|
187
|
+
/**
|
|
188
|
+
* Request approval agent
|
|
189
|
+
*
|
|
190
|
+
* Integrates with external human approval system (CLI in this implementation).
|
|
191
|
+
* In production, this could integrate with Slack, email, web UI, or ticketing systems.
|
|
192
|
+
*/
|
|
193
|
+
export declare const requestApprovalAgent: Agent<ApprovalRequestInput, OneShotAgentOutput<ApprovalResult, ExternalEventError>>;
|
|
194
|
+
/**
|
|
195
|
+
* Request choice agent
|
|
196
|
+
*
|
|
197
|
+
* Presents multiple options and asks human to choose one.
|
|
198
|
+
*/
|
|
199
|
+
export declare const requestChoiceAgent: Agent<ChoiceRequestInput, OneShotAgentOutput<ChoiceResult, ExternalEventError>>;
|
|
200
|
+
/**
|
|
201
|
+
* Request custom approval agent
|
|
202
|
+
*
|
|
203
|
+
* Requests approval with custom validation logic.
|
|
204
|
+
* Note: This is a simplified version - full implementation would need validator function.
|
|
205
|
+
*/
|
|
206
|
+
export declare const requestCustomApprovalAgent: Agent<CustomApprovalRequestInput, OneShotAgentOutput<CustomApprovalResult, ExternalEventError>>;
|
|
207
|
+
//# sourceMappingURL=human-approval.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version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