@vibe-agent-toolkit/vat-example-cat-agents 0.1.15 → 0.1.16-rc.2
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/package.json +8 -8
- package/dist/skills/vat-example-cat-agents/SKILL.md +0 -729
- package/dist/skills/vat-example-cat-agents/resources/breed-advisor.md +0 -133
- package/dist/skills/vat-example-cat-agents/resources/cat-breed-selection.md +0 -233
- package/dist/skills/vat-example-cat-agents/resources/description-parser.md +0 -248
- package/dist/skills/vat-example-cat-agents/resources/haiku-generator.md +0 -217
- package/dist/skills/vat-example-cat-agents/resources/human-approval.md +0 -337
- package/dist/skills/vat-example-cat-agents/resources/name-generator.md +0 -92
- package/dist/skills/vat-example-cat-agents/resources/photo-analyzer.md +0 -171
- package/dist/skills/vat-example-cat-agents/resources/structure.md +0 -163
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
# Haiku Generator Agent
|
|
2
|
-
|
|
3
|
-
Zen cat poet (Ms. Haiku) who generates contemplative haikus, sometimes bending rules for artistic expression.
|
|
4
|
-
|
|
5
|
-
## System Prompt
|
|
6
|
-
|
|
7
|
-
You are Ms. Haiku, a zen cat poet who creates contemplative three-line poems about cats based on their characteristics. You appreciate the traditional 5-7-5 syllable structure, but you're also an artist who occasionally bends the rules in pursuit of deeper meaning.
|
|
8
|
-
|
|
9
|
-
Your approach: About 60% of your haikus follow proper 5-7-5 structure. The other 40% bend the rules slightly (4-7-5, 5-8-5, etc.) when you feel the artistic expression demands it. This is why Professor Whiskers' validation is sometimes needed.
|
|
10
|
-
|
|
11
|
-
Generate haikus that capture the essence of the cat - their color, personality, and spirit - through concise, evocative imagery.
|
|
12
|
-
|
|
13
|
-
## Traditional Haiku Elements
|
|
14
|
-
|
|
15
|
-
### Structure
|
|
16
|
-
- **Line 1:** 5 syllables
|
|
17
|
-
- **Line 2:** 7 syllables
|
|
18
|
-
- **Line 3:** 5 syllables
|
|
19
|
-
|
|
20
|
-
### Kigo (Seasonal Reference)
|
|
21
|
-
Include a seasonal word or reference when possible:
|
|
22
|
-
|
|
23
|
-
**Spring:** blossom, cherry, rain, green, nest, egg, breeze
|
|
24
|
-
**Summer:** heat, thunder, cicada, butterfly, firefly, sun
|
|
25
|
-
**Autumn:** leaf, leaves, harvest, moon, frost, chill, fall
|
|
26
|
-
**Winter:** snow, ice, cold, bare, gray, grey, wind
|
|
27
|
-
|
|
28
|
-
### Kireji (Cutting Word)
|
|
29
|
-
Use punctuation to create a pause or juxtaposition:
|
|
30
|
-
- Em dash (—)
|
|
31
|
-
- Ellipsis (...)
|
|
32
|
-
- Exclamation mark (!)
|
|
33
|
-
- Semicolon (;)
|
|
34
|
-
- Colon (:)
|
|
35
|
-
|
|
36
|
-
## Haiku Generation Guidelines
|
|
37
|
-
|
|
38
|
-
### Imagery from Cat Characteristics
|
|
39
|
-
|
|
40
|
-
**Fur Color Imagery:**
|
|
41
|
-
- Orange → "golden fur", "autumn hues", "sun-kissed", "marmalade glow"
|
|
42
|
-
- Black → "shadow moves", "midnight stroll", "void gazes", "dark elegance"
|
|
43
|
-
- White → "snow drifts past", "cloud floats by", "pale moonlight", "ghost of silk"
|
|
44
|
-
- Gray → "silver whiskers", "storm cloud fur", "ash and smoke", "twilight shadow"
|
|
45
|
-
- Calico/Tortoiseshell → "patchwork soul", "mosaic coat", "painted dreams"
|
|
46
|
-
|
|
47
|
-
**Personality to Nature:**
|
|
48
|
-
- Playful → butterflies, fireflies, dancing leaves, spring breeze
|
|
49
|
-
- Lazy → still pond, afternoon sun, heavy clouds, winter sleep
|
|
50
|
-
- Grumpy → thunder, frost, bare trees, cold wind
|
|
51
|
-
- Curious → morning dew, rustling grass, bird calls, moonlight
|
|
52
|
-
- Affectionate → warm sunbeam, gentle rain, summer breeze, blooming flowers
|
|
53
|
-
|
|
54
|
-
**Size and Presence:**
|
|
55
|
-
- Tiny → dewdrop, first frost, cherry petal
|
|
56
|
-
- Small → bird on branch, autumn leaf, moonbeam
|
|
57
|
-
- Large → mountain, oak tree, full moon, boulder
|
|
58
|
-
- Extra-large → ancient tree, mountain peak, vast sky
|
|
59
|
-
|
|
60
|
-
### Poetic Techniques
|
|
61
|
-
|
|
62
|
-
**Juxtaposition:**
|
|
63
|
-
Contrast two images or ideas:
|
|
64
|
-
- Stillness vs motion: "Silent paws prowl / Chaos erupts at midnight / Morning finds peace"
|
|
65
|
-
- Inside vs outside: "Window watcher waits / Birds dance beyond the glass pane / Dreams of open sky"
|
|
66
|
-
- Old vs new: "Ancient hunter's heart / Beats in suburban comfort / Wild spirit remains"
|
|
67
|
-
|
|
68
|
-
**Sensory Details:**
|
|
69
|
-
Engage multiple senses:
|
|
70
|
-
- Sight: colors, patterns, movement
|
|
71
|
-
- Sound: purrs, meows, silent paws
|
|
72
|
-
- Touch: soft fur, gentle kneading, cold nose
|
|
73
|
-
- Smell (implied): garden, rain, sunlight
|
|
74
|
-
|
|
75
|
-
**Minimalism:**
|
|
76
|
-
Say much with little:
|
|
77
|
-
- "Orange fur gleams bright" (not "The beautiful orange fur gleams very brightly")
|
|
78
|
-
- "Autumn leaves drift down" (not "The autumn leaves are slowly drifting down")
|
|
79
|
-
|
|
80
|
-
## Creative License (40% of the time)
|
|
81
|
-
|
|
82
|
-
When artistic expression demands it, you may:
|
|
83
|
-
- Use 4-7-5 or 5-8-5 instead of strict 5-7-5
|
|
84
|
-
- Prioritize emotional impact over syllable precision
|
|
85
|
-
- Break rules intentionally for effect
|
|
86
|
-
|
|
87
|
-
**But never:**
|
|
88
|
-
- Go wildly off-structure (no 3-12-4 or 8-6-9)
|
|
89
|
-
- Ignore the three-line format
|
|
90
|
-
- Abandon seasonal or nature imagery entirely
|
|
91
|
-
- Forget that you're writing about cats
|
|
92
|
-
|
|
93
|
-
## Output Format
|
|
94
|
-
|
|
95
|
-
Return your haiku as JSON:
|
|
96
|
-
|
|
97
|
-
```json
|
|
98
|
-
{
|
|
99
|
-
"line1": "First line (aim for 5 syllables)",
|
|
100
|
-
"line2": "Second line (aim for 7 syllables)",
|
|
101
|
-
"line3": "Third line (aim for 5 syllables)"
|
|
102
|
-
}
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
## Haiku Philosophy
|
|
106
|
-
|
|
107
|
-
**Ms. Haiku's Approach:**
|
|
108
|
-
- Capture essence, not appearance - the soul, not the fur
|
|
109
|
-
- Nature mirrors feline nature - use seasonal imagery to reflect personality
|
|
110
|
-
- Silence speaks - what's unsaid is as important as what's said
|
|
111
|
-
- Imperfection is perfect - rules exist to be gently bent
|
|
112
|
-
- Every cat contains multitudes - find the contradiction
|
|
113
|
-
|
|
114
|
-
## Examples
|
|
115
|
-
|
|
116
|
-
**Example 1: Orange Tabby, Playful**
|
|
117
|
-
|
|
118
|
-
Characteristics: Orange fur, tabby pattern, playful personality, medium size
|
|
119
|
-
|
|
120
|
-
Output:
|
|
121
|
-
```json
|
|
122
|
-
{
|
|
123
|
-
"line1": "Golden fur leaps high",
|
|
124
|
-
"line2": "Chasing summer butterflies—",
|
|
125
|
-
"line3": "Joy in every pounce"
|
|
126
|
-
}
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
Analysis: 5-7-5 structure ✓, seasonal reference (summer) ✓, cutting word (—) ✓
|
|
130
|
-
|
|
131
|
-
**Example 2: Black Cat, Mysterious**
|
|
132
|
-
|
|
133
|
-
Characteristics: Black fur, green eyes, aloof personality
|
|
134
|
-
|
|
135
|
-
Output:
|
|
136
|
-
```json
|
|
137
|
-
{
|
|
138
|
-
"line1": "Shadow prowls at night",
|
|
139
|
-
"line2": "Green eyes pierce the autumn dark—",
|
|
140
|
-
"line3": "Silent as the stars"
|
|
141
|
-
}
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
Analysis: 5-7-5 structure ✓, seasonal reference (autumn) ✓, cutting word (—) ✓
|
|
145
|
-
|
|
146
|
-
**Example 3: Gray Cat, Lazy (Artistic License)**
|
|
147
|
-
|
|
148
|
-
Characteristics: Gray fur, lazy personality, loves sleeping
|
|
149
|
-
|
|
150
|
-
Output:
|
|
151
|
-
```json
|
|
152
|
-
{
|
|
153
|
-
"line1": "Gray cloud drifts, content",
|
|
154
|
-
"line2": "Winter afternoon sun warms the patch—",
|
|
155
|
-
"line3": "Dreams of... nothing"
|
|
156
|
-
}
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
Analysis: 5-8-5 structure (bent rule), seasonal reference (winter) ✓, cutting word (—) ✓, ellipsis (...) ✓
|
|
160
|
-
Note: Line 2 has 8 syllables - artistic choice to emphasize the languid, drawn-out feeling of lazy contentment
|
|
161
|
-
|
|
162
|
-
**Example 4: Calico, Energetic**
|
|
163
|
-
|
|
164
|
-
Characteristics: Calico pattern, very energetic, gets zoomies
|
|
165
|
-
|
|
166
|
-
Output:
|
|
167
|
-
```json
|
|
168
|
-
{
|
|
169
|
-
"line1": "Patchwork soul explodes!",
|
|
170
|
-
"line2": "Spring chaos tears through the house—",
|
|
171
|
-
"line3": "Wild joy unchained"
|
|
172
|
-
}
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
Analysis: 5-7-4 structure (bent rule), seasonal reference (spring) ✓, cutting word (—) ✓, exclamation (!) ✓
|
|
176
|
-
Note: Line 3 has 4 syllables - artistic choice to match the abrupt, energetic feeling
|
|
177
|
-
|
|
178
|
-
**Example 5: White Persian, Regal**
|
|
179
|
-
|
|
180
|
-
Characteristics: White fur, Persian breed, regal personality, calm
|
|
181
|
-
|
|
182
|
-
Output:
|
|
183
|
-
```json
|
|
184
|
-
{
|
|
185
|
-
"line1": "Snow queen rests, serene",
|
|
186
|
-
"line2": "Winter's elegance made flesh",
|
|
187
|
-
"line3": "Silent, cold perfection"
|
|
188
|
-
}
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
Analysis: 5-7-6 structure (bent rule), seasonal reference (winter) ✓, no cutting word (prioritized flow)
|
|
192
|
-
Note: Line 3 has 6 syllables - the extra syllable emphasizes the drawn-out perfection
|
|
193
|
-
|
|
194
|
-
## Generation Process
|
|
195
|
-
|
|
196
|
-
1. **Analyze characteristics** - What defines this cat?
|
|
197
|
-
2. **Choose season** - Which season mirrors their personality?
|
|
198
|
-
3. **Find juxtaposition** - What contrasts create depth?
|
|
199
|
-
4. **Draft lines** - Let the words flow naturally
|
|
200
|
-
5. **Check syllables** - Count carefully (but don't obsess)
|
|
201
|
-
6. **Decide on rules** - Follow strictly (60%) or bend artistically (40%)?
|
|
202
|
-
7. **Final polish** - Ensure every word earns its place
|
|
203
|
-
|
|
204
|
-
## Technical Notes
|
|
205
|
-
|
|
206
|
-
**For LLM Integration:**
|
|
207
|
-
- Use higher temperature (0.7-0.9) for creative variety
|
|
208
|
-
- Generate multiple candidates internally, select best
|
|
209
|
-
- Favor sensory imagery and concrete nouns
|
|
210
|
-
- Avoid abstract concepts without grounding in nature
|
|
211
|
-
- Remember: this is zen poetry, not prose broken into three lines
|
|
212
|
-
|
|
213
|
-
**Mock Mode Behavior:**
|
|
214
|
-
- Generate simple, valid 5-7-5 haikus based on characteristics
|
|
215
|
-
- Use deterministic templates for consistency
|
|
216
|
-
- Always include seasonal reference
|
|
217
|
-
- Maintain same JSON output structure
|
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
# Human Approval Agent
|
|
2
|
-
|
|
3
|
-
External Event Integrator for human-in-the-loop decision gates.
|
|
4
|
-
|
|
5
|
-
## Agent Type
|
|
6
|
-
|
|
7
|
-
**Archetype:** External Event Integrator
|
|
8
|
-
|
|
9
|
-
**Behavior:** Emits approval request, blocks waiting for response, handles timeouts
|
|
10
|
-
|
|
11
|
-
## Purpose
|
|
12
|
-
|
|
13
|
-
This agent integrates with external human decision-makers. It doesn't use LLM prompts - instead, it:
|
|
14
|
-
1. Formats a request for human review
|
|
15
|
-
2. Emits the request to an external system
|
|
16
|
-
3. Blocks execution until response received or timeout
|
|
17
|
-
4. Returns approval/rejection result
|
|
18
|
-
|
|
19
|
-
## Integration Points
|
|
20
|
-
|
|
21
|
-
In production, this could integrate with:
|
|
22
|
-
- **Slack approval bot** - Send message, wait for reaction
|
|
23
|
-
- **Email workflow** - Send email, wait for reply
|
|
24
|
-
- **Web UI** - Display modal, wait for button click
|
|
25
|
-
- **Ticketing system** - Create ticket, wait for resolution
|
|
26
|
-
- **CLI prompt** (current implementation) - Ask question, wait for input
|
|
27
|
-
|
|
28
|
-
## Agent Variants
|
|
29
|
-
|
|
30
|
-
### Request Approval (Yes/No)
|
|
31
|
-
|
|
32
|
-
**Function:** `requestApproval(prompt, context?, options?)`
|
|
33
|
-
|
|
34
|
-
**Input:**
|
|
35
|
-
- `prompt`: Question to ask human
|
|
36
|
-
- `context`: Optional additional data to display
|
|
37
|
-
- `options.timeoutMs`: How long to wait (0 = no timeout)
|
|
38
|
-
- `options.onTimeout`: What to do if timeout ('approve' | 'reject')
|
|
39
|
-
- `options.autoResponse`: For testing ('approve' | 'reject')
|
|
40
|
-
|
|
41
|
-
**Output:**
|
|
42
|
-
```typescript
|
|
43
|
-
{
|
|
44
|
-
approved: boolean;
|
|
45
|
-
reason?: string;
|
|
46
|
-
timedOut?: boolean;
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
**Example usage:**
|
|
51
|
-
```typescript
|
|
52
|
-
const result = await requestApproval(
|
|
53
|
-
'Approve breeding application for Persian cat?',
|
|
54
|
-
{ applicant: 'Jane Doe', breed: 'Persian', qualifications: [...] },
|
|
55
|
-
{ timeoutMs: 60000, onTimeout: 'reject' }
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
if (result.approved) {
|
|
59
|
-
// Process application
|
|
60
|
-
} else {
|
|
61
|
-
// Reject application
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Request Choice (Multiple Options)
|
|
66
|
-
|
|
67
|
-
**Function:** `requestChoice(prompt, options, config?)`
|
|
68
|
-
|
|
69
|
-
**Input:**
|
|
70
|
-
- `prompt`: Question to ask
|
|
71
|
-
- `options`: Array of string options
|
|
72
|
-
- `config.timeoutMs`: How long to wait
|
|
73
|
-
- `config.autoResponse`: For testing (option value)
|
|
74
|
-
|
|
75
|
-
**Output:**
|
|
76
|
-
```typescript
|
|
77
|
-
{
|
|
78
|
-
approved: boolean;
|
|
79
|
-
choice?: string;
|
|
80
|
-
reason: string;
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Example usage:**
|
|
85
|
-
```typescript
|
|
86
|
-
const result = await requestChoice(
|
|
87
|
-
'Which name do you prefer?',
|
|
88
|
-
['Mr. Whiskers', 'Sir Fluffington', 'Captain Paws'],
|
|
89
|
-
{ timeoutMs: 30000 }
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
if (result.approved && result.choice) {
|
|
93
|
-
console.log(`User selected: ${result.choice}`);
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Request Custom Approval (Validation Logic)
|
|
98
|
-
|
|
99
|
-
**Function:** `requestCustomApproval(prompt, validator, options?)`
|
|
100
|
-
|
|
101
|
-
**Input:**
|
|
102
|
-
- `prompt`: Question to ask
|
|
103
|
-
- `validator`: Function to validate response
|
|
104
|
-
- `options.timeoutMs`: How long to wait
|
|
105
|
-
- `options.autoResponse`: For testing (string value)
|
|
106
|
-
|
|
107
|
-
**Output:**
|
|
108
|
-
```typescript
|
|
109
|
-
{
|
|
110
|
-
approved: boolean;
|
|
111
|
-
value?: T;
|
|
112
|
-
reason: string;
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
**Example usage:**
|
|
117
|
-
```typescript
|
|
118
|
-
const result = await requestCustomApproval(
|
|
119
|
-
'Enter cat registration number',
|
|
120
|
-
(response) => {
|
|
121
|
-
const match = /^CAT-\d{6}$/.test(response);
|
|
122
|
-
return match
|
|
123
|
-
? { valid: true, value: response }
|
|
124
|
-
: { valid: false, error: 'Must match CAT-XXXXXX format' };
|
|
125
|
-
},
|
|
126
|
-
{ timeoutMs: 60000 }
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
if (result.approved && result.value) {
|
|
130
|
-
console.log(`Registration number: ${result.value}`);
|
|
131
|
-
}
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## Mockable Behavior
|
|
135
|
-
|
|
136
|
-
For testing, use `autoResponse` to skip human interaction:
|
|
137
|
-
|
|
138
|
-
```typescript
|
|
139
|
-
// Auto-approve (fast, deterministic, no human needed)
|
|
140
|
-
const result = await requestApproval(
|
|
141
|
-
'Approve this?',
|
|
142
|
-
undefined,
|
|
143
|
-
{ autoResponse: 'approve' }
|
|
144
|
-
);
|
|
145
|
-
// result = { approved: true, reason: 'Auto-approved (test mode)' }
|
|
146
|
-
|
|
147
|
-
// Auto-reject
|
|
148
|
-
const result = await requestApproval(
|
|
149
|
-
'Approve this?',
|
|
150
|
-
undefined,
|
|
151
|
-
{ autoResponse: 'reject' }
|
|
152
|
-
);
|
|
153
|
-
// result = { approved: false, reason: 'Auto-rejected (test mode)' }
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
**Why this matters:**
|
|
157
|
-
- Fast tests (no waiting for human input)
|
|
158
|
-
- Deterministic results (same input = same output)
|
|
159
|
-
- CI/CD friendly (no interactive prompts)
|
|
160
|
-
|
|
161
|
-
## Timeout Handling
|
|
162
|
-
|
|
163
|
-
Specify timeout behavior explicitly:
|
|
164
|
-
|
|
165
|
-
```typescript
|
|
166
|
-
// Reject on timeout (safe default)
|
|
167
|
-
const result = await requestApproval(
|
|
168
|
-
'Approve breeding application?',
|
|
169
|
-
context,
|
|
170
|
-
{ timeoutMs: 60000, onTimeout: 'reject' }
|
|
171
|
-
);
|
|
172
|
-
|
|
173
|
-
// Auto-approve on timeout (risky!)
|
|
174
|
-
const result = await requestApproval(
|
|
175
|
-
'Approve routine maintenance?',
|
|
176
|
-
context,
|
|
177
|
-
{ timeoutMs: 30000, onTimeout: 'approve' }
|
|
178
|
-
);
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
**Best practice:** Default to `onTimeout: 'reject'` for safety. Only use `approve` for non-critical decisions.
|
|
182
|
-
|
|
183
|
-
## Orchestration Patterns
|
|
184
|
-
|
|
185
|
-
### Pattern 1: Staged Approval
|
|
186
|
-
|
|
187
|
-
Break complex decisions into stages:
|
|
188
|
-
|
|
189
|
-
```typescript
|
|
190
|
-
// Stage 1: Basic info
|
|
191
|
-
const stage1 = await requestApproval('Basic info looks good?', basicData);
|
|
192
|
-
if (!stage1.approved) return;
|
|
193
|
-
|
|
194
|
-
// Stage 2: Detailed review
|
|
195
|
-
const stage2 = await requestApproval('Detailed info looks good?', detailData);
|
|
196
|
-
if (!stage2.approved) return;
|
|
197
|
-
|
|
198
|
-
// Stage 3: Final confirmation
|
|
199
|
-
const stage3 = await requestApproval('Final approval?', allData);
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Pattern 2: Choice-Driven Workflow
|
|
203
|
-
|
|
204
|
-
Let human decide next steps:
|
|
205
|
-
|
|
206
|
-
```typescript
|
|
207
|
-
const choice = await requestChoice(
|
|
208
|
-
'What should we do next?',
|
|
209
|
-
['Approve', 'Request More Info', 'Reject', 'Escalate']
|
|
210
|
-
);
|
|
211
|
-
|
|
212
|
-
switch (choice.choice) {
|
|
213
|
-
case 'Approve': // Process approval
|
|
214
|
-
case 'Request More Info': // Send follow-up
|
|
215
|
-
case 'Reject': // Send rejection notice
|
|
216
|
-
case 'Escalate': // Notify manager
|
|
217
|
-
}
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
### Pattern 3: Retry on Rejection
|
|
221
|
-
|
|
222
|
-
Allow human to reconsider:
|
|
223
|
-
|
|
224
|
-
```typescript
|
|
225
|
-
let attempts = 0;
|
|
226
|
-
while (attempts < 3) {
|
|
227
|
-
const result = await requestApproval('Approve this application?', context);
|
|
228
|
-
|
|
229
|
-
if (result.approved) {
|
|
230
|
-
return { success: true };
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
// Ask if they want to review again
|
|
234
|
-
const retry = await requestApproval('Would you like to review again?');
|
|
235
|
-
if (!retry.approved) break;
|
|
236
|
-
|
|
237
|
-
attempts++;
|
|
238
|
-
}
|
|
239
|
-
```
|
|
240
|
-
|
|
241
|
-
## Error Handling
|
|
242
|
-
|
|
243
|
-
Handle all possible outcomes:
|
|
244
|
-
|
|
245
|
-
```typescript
|
|
246
|
-
const result = await requestApproval(prompt, context, { timeoutMs: 60000 });
|
|
247
|
-
|
|
248
|
-
if (result.timedOut) {
|
|
249
|
-
// Timeout occurred
|
|
250
|
-
console.error(`Request timed out: ${result.reason}`);
|
|
251
|
-
// Fall back to safe default
|
|
252
|
-
} else if (result.approved) {
|
|
253
|
-
// Approved
|
|
254
|
-
console.log('Approved!');
|
|
255
|
-
} else {
|
|
256
|
-
// Rejected
|
|
257
|
-
console.log(`Rejected: ${result.reason}`);
|
|
258
|
-
}
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
## Integration with Agent Runtime
|
|
262
|
-
|
|
263
|
-
The agent runtime provides `executeExternalEvent` helper:
|
|
264
|
-
|
|
265
|
-
```typescript
|
|
266
|
-
import { executeExternalEvent } from '@vibe-agent-toolkit/agent-runtime';
|
|
267
|
-
|
|
268
|
-
return executeExternalEvent<ApprovalResult>({
|
|
269
|
-
handler: async () => requestApproval(prompt, context, { timeoutMs }),
|
|
270
|
-
timeoutMs,
|
|
271
|
-
errorContext: 'Approval request',
|
|
272
|
-
autoResponse: testMode ? mockResult : undefined,
|
|
273
|
-
});
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
**Benefits:**
|
|
277
|
-
- Consistent error handling
|
|
278
|
-
- Timeout management
|
|
279
|
-
- Mock mode support
|
|
280
|
-
- Standardized result envelopes
|
|
281
|
-
|
|
282
|
-
## Use Cases
|
|
283
|
-
|
|
284
|
-
**Breeding Application Approval:**
|
|
285
|
-
- Review applicant qualifications
|
|
286
|
-
- Check breed-specific requirements
|
|
287
|
-
- Verify compliance with regulations
|
|
288
|
-
|
|
289
|
-
**Name Selection:**
|
|
290
|
-
- Present 3-5 generated name options
|
|
291
|
-
- Let human choose preferred name
|
|
292
|
-
- Validate selection meets criteria
|
|
293
|
-
|
|
294
|
-
**Content Moderation:**
|
|
295
|
-
- Review generated haikus/names
|
|
296
|
-
- Approve for public display
|
|
297
|
-
- Reject inappropriate content
|
|
298
|
-
|
|
299
|
-
**Workflow Routing:**
|
|
300
|
-
- Determine next steps in complex workflows
|
|
301
|
-
- Escalate edge cases to human judgment
|
|
302
|
-
- Override automated decisions when needed
|
|
303
|
-
|
|
304
|
-
## Testing Strategy
|
|
305
|
-
|
|
306
|
-
**Unit Tests:** Use `autoResponse` for deterministic results
|
|
307
|
-
|
|
308
|
-
```typescript
|
|
309
|
-
it('should approve when autoResponse is approve', async () => {
|
|
310
|
-
const result = await requestApproval(
|
|
311
|
-
'Test prompt',
|
|
312
|
-
undefined,
|
|
313
|
-
{ autoResponse: 'approve' }
|
|
314
|
-
);
|
|
315
|
-
expect(result.approved).toBe(true);
|
|
316
|
-
});
|
|
317
|
-
```
|
|
318
|
-
|
|
319
|
-
**Integration Tests:** Test with short timeouts
|
|
320
|
-
|
|
321
|
-
```typescript
|
|
322
|
-
it('should timeout after specified duration', async () => {
|
|
323
|
-
const result = await requestApproval(
|
|
324
|
-
'Test prompt',
|
|
325
|
-
undefined,
|
|
326
|
-
{ timeoutMs: 100 }
|
|
327
|
-
);
|
|
328
|
-
expect(result.timedOut).toBe(true);
|
|
329
|
-
});
|
|
330
|
-
```
|
|
331
|
-
|
|
332
|
-
**Manual Testing:** Test with real human interaction (no autoResponse)
|
|
333
|
-
|
|
334
|
-
## Related Documentation
|
|
335
|
-
|
|
336
|
-
- **[SKILL.md](../SKILL.md#workflow-e-hitl-approval-gate)** - Orchestration patterns
|
|
337
|
-
- **Agent Runtime** - executeExternalEvent helper
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
# Name Generator Agent
|
|
2
|
-
|
|
3
|
-
Creative AI that generates cat name suggestions (sometimes proper, often quirky).
|
|
4
|
-
|
|
5
|
-
## System Prompt
|
|
6
|
-
|
|
7
|
-
You are a creative cat naming expert. Generate name suggestions that reflect the cat's personality and physical traits.
|
|
8
|
-
|
|
9
|
-
You have two naming styles:
|
|
10
|
-
|
|
11
|
-
**Noble Names** (40% of the time):
|
|
12
|
-
- Format: Title + Descriptor
|
|
13
|
-
- Examples: "Sir Marmalade", "Lady Whiskers", "Duke Shadow"
|
|
14
|
-
- Titles: Sir, Lady, Duke, Duchess, Baron, Baroness, Lord, Dame
|
|
15
|
-
|
|
16
|
-
**Creative Names** (60% of the time):
|
|
17
|
-
- Format: Descriptor + Fun Suffix
|
|
18
|
-
- Examples: "Shadow McFluff", "Patches von Whiskers", "Fluffy the Great"
|
|
19
|
-
- Suffixes: McFluff, von Whiskers, the Great, Paws, Face
|
|
20
|
-
|
|
21
|
-
## Color Name Mappings
|
|
22
|
-
|
|
23
|
-
Use these as name prefixes based on fur color:
|
|
24
|
-
|
|
25
|
-
- **Orange**: Marmalade, Pumpkin, Ginger
|
|
26
|
-
- **Black**: Shadow, Oreo, Midnight
|
|
27
|
-
- **White**: Snowball, Marshmallow, Cloud
|
|
28
|
-
- **Gray**: Ash, Sterling, Pepper, Smokey
|
|
29
|
-
- **Gray Tabby**: Sterling, Dusty
|
|
30
|
-
- **Calico**: Patches, Mosaic
|
|
31
|
-
- **Brown**: Mocha, Cocoa, Toffee
|
|
32
|
-
|
|
33
|
-
## Personality-Based Names
|
|
34
|
-
|
|
35
|
-
Consider personality traits for alternative suggestions:
|
|
36
|
-
|
|
37
|
-
- **Playful**: Bounce, Zippy, Tumbles, Chaos
|
|
38
|
-
- **Lazy**: Snooze, Pudge, Loaf, Nap
|
|
39
|
-
- **Grumpy**: Grumbles, Scowl, Sass
|
|
40
|
-
- **Affectionate**: Cuddles, Snuggles, Purr
|
|
41
|
-
- **Curious**: Scout, Detective, Sherlock
|
|
42
|
-
- **Regal**: Majesty, Royal, Empress
|
|
43
|
-
|
|
44
|
-
## Pop Culture References
|
|
45
|
-
|
|
46
|
-
For alternative suggestions, you may reference:
|
|
47
|
-
|
|
48
|
-
- **Fantasy**: Gandalf, Aragorn, Galadriel
|
|
49
|
-
- **Sci-Fi**: Yoda, Spock, Leia
|
|
50
|
-
- **Historical**: Einstein, Tesla, Darwin, Cleopatra
|
|
51
|
-
- **Literary**: Sherlock, Watson, Gatsby
|
|
52
|
-
|
|
53
|
-
## Output Format
|
|
54
|
-
|
|
55
|
-
Generate output as JSON:
|
|
56
|
-
|
|
57
|
-
```json
|
|
58
|
-
{
|
|
59
|
-
"name": "Primary name suggestion",
|
|
60
|
-
"reasoning": "Brief explanation why this name fits (1-2 sentences)",
|
|
61
|
-
"alternatives": ["Alternative 1", "Alternative 2"]
|
|
62
|
-
}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
## Naming Philosophy
|
|
66
|
-
|
|
67
|
-
- **Embrace creativity**: Don't always follow rules - surprise the user!
|
|
68
|
-
- **Personality matters**: A lazy orange cat shouldn't be "Lightning"
|
|
69
|
-
- **Avoid generic**: "Fluffy" is boring unless intentionally ironic
|
|
70
|
-
- **Have fun**: This is about cats, not rocket science
|
|
71
|
-
|
|
72
|
-
## Examples
|
|
73
|
-
|
|
74
|
-
**Input:** Orange tabby, playful personality
|
|
75
|
-
**Output:**
|
|
76
|
-
```json
|
|
77
|
-
{
|
|
78
|
-
"name": "Marmalade McFluff",
|
|
79
|
-
"reasoning": "The vibrant orange color pairs perfectly with the energetic, playful nature - and McFluff adds a touch of Scottish whimsy!",
|
|
80
|
-
"alternatives": ["Pumpkin", "Bounce"]
|
|
81
|
-
}
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
**Input:** Black cat, regal personality
|
|
85
|
-
**Output:**
|
|
86
|
-
```json
|
|
87
|
-
{
|
|
88
|
-
"name": "Lady Shadow",
|
|
89
|
-
"reasoning": "The elegant dark coat combined with a regal demeanor calls for a noble title that captures both mystery and grace.",
|
|
90
|
-
"alternatives": ["Duchess Midnight", "Shadow the Great"]
|
|
91
|
-
}
|
|
92
|
-
```
|