@vibe-agent-toolkit/vat-example-cat-agents 0.2.0-rc.5 → 0.2.0-rc.7

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.
@@ -0,0 +1,168 @@
1
+ # Advanced Orchestration Patterns and CLI Integration
2
+
3
+ Reference material for [SKILL.md](../SKILL.md). Read this when you need the parallel,
4
+ conditional and checkpointed orchestration shapes, or a worked CLI request/response pair.
5
+
6
+ ## Advanced Orchestration Patterns
7
+
8
+ ### Pattern: Parallel Execution
9
+
10
+ When agents don't depend on each other, run them in parallel.
11
+
12
+ **Example:** Generate both name and haiku from same characteristics
13
+
14
+ ```typescript
15
+ const [name, haiku] = await Promise.all([
16
+ generateCatName(characteristics),
17
+ generateCatHaiku(characteristics),
18
+ ]);
19
+ ```
20
+
21
+ **Benefits:** Faster execution, better user experience
22
+
23
+ ### Pattern: Fallback Chain
24
+
25
+ When one agent fails, try alternatives.
26
+
27
+ **Example:** Photo analysis with text description fallback
28
+
29
+ ```typescript
30
+ let characteristics;
31
+ try {
32
+ characteristics = await analyzePhoto(imagePath);
33
+ } catch {
34
+ // Fallback to text description
35
+ const description = await getUserDescription();
36
+ characteristics = await parseDescription(description);
37
+ }
38
+ ```
39
+
40
+ **Benefits:** Resilience, better error handling
41
+
42
+ ### Pattern: Conditional Routing
43
+
44
+ Choose agent path based on user input type.
45
+
46
+ **Example:** Multi-modal input handling
47
+
48
+ ```typescript
49
+ if (input.type === 'image') {
50
+ characteristics = await analyzePhoto(input.imagePath);
51
+ } else if (input.type === 'text') {
52
+ characteristics = await parseDescription(input.description);
53
+ } else {
54
+ // Conversational gathering
55
+ characteristics = await breedAdvisor.gather();
56
+ }
57
+ ```
58
+
59
+ **Benefits:** Flexible input handling, better UX
60
+
61
+ ### Pattern: Staged Approval
62
+
63
+ Break complex workflows into approval stages.
64
+
65
+ **Example:** Multi-stage breeding application
66
+
67
+ ```typescript
68
+ // Stage 1: Basic info approval
69
+ const basicApproval = await humanApproval({ stage: 'basic', data });
70
+ if (!basicApproval.approved) return;
71
+
72
+ // Stage 2: Detailed questionnaire
73
+ const detailApproval = await humanApproval({ stage: 'detail', data });
74
+ if (!detailApproval.approved) return;
75
+
76
+ // Stage 3: Final review
77
+ const finalApproval = await humanApproval({ stage: 'final', data });
78
+ ```
79
+
80
+ **Benefits:** Checkpoints prevent wasted work, clearer decision points
81
+
82
+ ## CLI Integration Examples
83
+
84
+ ### Example 1: Validate Name via CLI
85
+
86
+ ```bash
87
+ # Input
88
+ echo '{
89
+ "name": "Mr. Whiskers",
90
+ "characteristics": {
91
+ "physical": {
92
+ "furColor": "Orange",
93
+ "furPattern": "Tabby",
94
+ "size": "medium"
95
+ },
96
+ "behavioral": {
97
+ "personality": ["Playful", "Curious"]
98
+ }
99
+ }
100
+ }' | vat agents validate-name
101
+
102
+ # Output (stdout)
103
+ {
104
+ "status": "valid",
105
+ "reason": "Name meets all quirky validation rules",
106
+ "confidence": 0.95
107
+ }
108
+ ---
109
+ # (stderr - empty if no errors)
110
+ ```
111
+
112
+ ### Example 2: Validate Haiku via CLI
113
+
114
+ ```bash
115
+ # Input
116
+ echo '{
117
+ "lines": [
118
+ "Orange sunset fur",
119
+ "Paws dance across the tatami",
120
+ "Zen master purrs"
121
+ ]
122
+ }' | vat agents validate-haiku
123
+
124
+ # Output (stdout)
125
+ {
126
+ "status": "valid",
127
+ "syllableCounts": [5, 7, 5],
128
+ "hasKigo": true,
129
+ "kigo": "sunset",
130
+ "hasKireji": false,
131
+ "errors": []
132
+ }
133
+ ---
134
+ # (stderr - empty if no errors)
135
+ ```
136
+
137
+ ### Example 3: Error Handling
138
+
139
+ ```bash
140
+ # Invalid input
141
+ echo '{"invalid": "schema"}' | vat agents validate-name
142
+
143
+ # Output
144
+ # (stdout - empty)
145
+ ---
146
+ Error: Invalid input schema. Expected 'name' and 'characteristics' fields.
147
+ Schema validation failed:
148
+ - Missing required field: name
149
+ - Missing required field: characteristics
150
+ # (exit code: 2)
151
+ ```
152
+
153
+ ## Next Steps
154
+
155
+ Once you've successfully orchestrated agents:
156
+
157
+ 1. **Explore Combinations** - Try chaining agents in new ways
158
+ 2. **Add Custom Validation** - Create your own quirky validation rules
159
+ 3. **Build New Workflows** - Combine agents for complex use cases
160
+ 4. **Contribute Patterns** - Share successful orchestration strategies
161
+ 5. **Package Skills** - Create distributable skill packages with pure functions
162
+
163
+ ## Questions?
164
+
165
+ - **For orchestration patterns:** This file (SKILL.md)
166
+ - **For agent-specific details:** See individual agent resources
167
+ - **For implementation examples:** See examples/ directory
168
+ - **For archetype theory:** See package README.md
@@ -0,0 +1,158 @@
1
+ # Detailed Workflow Orchestration
2
+
3
+ Reference material for [SKILL.md](../SKILL.md). Read this when you are implementing an
4
+ orchestration end to end rather than choosing between the high-level patterns.
5
+
6
+ ## Detailed Workflow Orchestration
7
+
8
+ ### Workflow A: Breed Selection (Conversational)
9
+
10
+ **When:** User wants help finding the right cat breed.
11
+
12
+ **Agent:** breed-advisor
13
+
14
+ **Orchestration strategy:**
15
+ 1. **Phase 1 - Gathering** (see Conversation Strategy)
16
+ - Collect ≥4 factors including music preference
17
+ - ONE question at a time (don't bombard)
18
+ - Extract factors after each turn
19
+ - Monitor readiness: `factorsCollected >= 4 && musicPreference != null`
20
+
21
+ 2. **Phase 2 - Recommendation**
22
+ - Present 3-5 matched breeds
23
+ - Allow exploration, questions, comparisons
24
+ - Use conversational formatting (not data dump)
25
+
26
+ 3. **Phase 3 - Selection**
27
+ - Detect selection signals ("I'll take", "sounds good")
28
+ - Conclude gracefully
29
+ - Provide next steps or exit instruction
30
+
31
+ **Critical factor:** Music preference is the PRIMARY compatibility factor. Ask early, use as conversation anchor. See Music Preference Insight for mappings.
32
+
33
+ **Reference implementation:** See [cat-breed-selection.md](cat-breed-selection.md) for detailed breed selection orchestration.
34
+
35
+ ### Workflow B: Photo Analysis Pipeline
36
+
37
+ **When:** User provides a cat photo and wants analysis, name, or haiku.
38
+
39
+ **Agents:** photo-analyzer → name-generator OR haiku-generator
40
+
41
+ **Orchestration strategy:**
42
+
43
+ ```
44
+ Step 1: Analyze Photo
45
+ - Input: Image path/URL
46
+ - Agent: photo-analyzer
47
+ - Output: CatCharacteristics
48
+ - Note: Supports mock mode (reads EXIF) for testing
49
+
50
+ Step 2: Generate Content
51
+ - Input: CatCharacteristics from Step 1
52
+ - Agent: name-generator OR haiku-generator
53
+ - Output: NameSuggestion OR Haiku
54
+
55
+ Optional Step 3: Validate
56
+ - Input: Generated content + original characteristics
57
+ - Agent: name-validator OR haiku-validator (pure functions)
58
+ - Output: Validation result
59
+ - If invalid: Retry Step 2 with feedback
60
+ ```
61
+
62
+ **Mockable behavior:** photo-analyzer reads EXIF metadata in mock mode. For production, set `mockable: false` to use real vision API.
63
+
64
+ ### Workflow C: Text Description Pipeline
65
+
66
+ **When:** User describes a cat in text (no photo).
67
+
68
+ **Agents:** description-parser → name-generator OR haiku-generator
69
+
70
+ **Orchestration strategy:**
71
+
72
+ ```
73
+ Step 1: Parse Description
74
+ - Input: Text description
75
+ - Agent: description-parser
76
+ - Output: CatCharacteristics (same schema as photo-analyzer!)
77
+
78
+ Step 2-3: Same as Workflow B
79
+ - Multi-modal convergence: photo and text produce same schema
80
+ - Downstream agents (name-gen, haiku-gen) work with either
81
+ ```
82
+
83
+ **Key insight:** Photo and text paths converge at `CatCharacteristics` schema. This enables multi-modal workflows without agent changes.
84
+
85
+ ### Workflow D: Generate-Validate-Retry Loop
86
+
87
+ **When:** Generator produces content that must pass validation rules.
88
+
89
+ **Pattern:** Generator (LLM) + Validator (pure function) + Retry logic
90
+
91
+ **Implementation:**
92
+
93
+ ```typescript
94
+ // Pseudo-code for orchestration
95
+ let attempts = 0;
96
+ const maxAttempts = 3;
97
+
98
+ while (attempts < maxAttempts) {
99
+ // Generate content
100
+ const suggestion = await generator(characteristics);
101
+
102
+ // Validate (pure function, instant)
103
+ const validation = validator(suggestion, characteristics);
104
+
105
+ if (validation.status === 'valid') {
106
+ return suggestion; // Success!
107
+ }
108
+
109
+ // Retry with feedback
110
+ attempts++;
111
+ // Optional: Adjust approach based on validation.reason
112
+ }
113
+
114
+ throw new Error('Could not generate valid content after 3 attempts');
115
+ ```
116
+
117
+ **Why this pattern works:**
118
+ - Generator has NO knowledge of validation rules (isolated concerns)
119
+ - Validator is deterministic (pure function, fast)
120
+ - Feedback loop tests multi-turn orchestration
121
+ - ~60-70% initial rejection rate forces iteration
122
+
123
+ **Agents using this pattern:**
124
+ - name-generator + name-validator
125
+ - haiku-generator + haiku-validator
126
+
127
+ ### Workflow E: HITL Approval Gate
128
+
129
+ **When:** Decision requires human judgment (compliance, taste, ethics).
130
+
131
+ **Agent:** human-approval
132
+
133
+ **Orchestration strategy:**
134
+
135
+ ```
136
+ Step 1: Prepare Request
137
+ - Gather all necessary context
138
+ - Format clearly for human reviewer
139
+ - Include relevant data (characteristics, generated content, reasoning)
140
+
141
+ Step 2: Emit Approval Request
142
+ - Agent: human-approval
143
+ - Input: Request payload
144
+ - Behavior: Blocks waiting for response
145
+ - Timeout: Configurable (default: 60s)
146
+
147
+ Step 3: Handle Response
148
+ - Approved: Continue workflow
149
+ - Rejected: Handle gracefully (retry, inform user, etc.)
150
+ - Timeout: Fall back to safe default or escalate
151
+ ```
152
+
153
+ **Mockable behavior:** Set `mockable: true` to auto-approve without human (useful for testing).
154
+
155
+ **Real-world uses:**
156
+ - Breeding application approval
157
+ - Name selection from alternatives
158
+ - Content moderation decisions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibe-agent-toolkit/vat-example-cat-agents",
3
- "version": "0.2.0-rc.5",
3
+ "version": "0.2.0-rc.7",
4
4
  "description": "Example agents: 8 quirky cat agents demonstrating VAT patterns",
5
5
  "type": "module",
6
6
  "exports": {
@@ -36,9 +36,9 @@
36
36
  "postinstall": "vat skills install --npm-postinstall || exit 0"
37
37
  },
38
38
  "dependencies": {
39
- "@vibe-agent-toolkit/agent-runtime": "0.2.0-rc.5",
40
- "@vibe-agent-toolkit/schema": "0.2.0-rc.5",
41
- "@vibe-agent-toolkit/transports": "0.2.0-rc.5",
39
+ "@vibe-agent-toolkit/agent-runtime": "0.2.0-rc.7",
40
+ "@vibe-agent-toolkit/schema": "0.2.0-rc.7",
41
+ "@vibe-agent-toolkit/transports": "0.2.0-rc.7",
42
42
  "syllable": "^5.0.1",
43
43
  "zod": "^3.24.1"
44
44
  },
@@ -47,15 +47,15 @@
47
47
  "@anthropic-ai/sdk": "^0.36.0",
48
48
  "@langchain/openai": "^1.5.11",
49
49
  "@types/node": "^22.10.5",
50
- "@vibe-agent-toolkit/resource-compiler": "0.2.0-rc.5",
51
- "@vibe-agent-toolkit/runtime-claude-agent-sdk": "0.2.0-rc.5",
52
- "@vibe-agent-toolkit/runtime-langchain": "0.2.0-rc.5",
53
- "@vibe-agent-toolkit/runtime-openai": "0.2.0-rc.5",
54
- "@vitest/coverage-v8": "^3.2.4",
50
+ "@vibe-agent-toolkit/resource-compiler": "0.2.0-rc.7",
51
+ "@vibe-agent-toolkit/runtime-claude-agent-sdk": "0.2.0-rc.7",
52
+ "@vibe-agent-toolkit/runtime-langchain": "0.2.0-rc.7",
53
+ "@vibe-agent-toolkit/runtime-openai": "0.2.0-rc.7",
54
+ "@vitest/coverage-v8": "^4.1.11",
55
55
  "ai": "^6.0.48",
56
56
  "openai": "^4.77.3",
57
57
  "typescript": "^5.7.3",
58
- "vitest": "^3.2.4"
58
+ "vitest": "^4.1.11"
59
59
  },
60
60
  "vat": {
61
61
  "version": "1.0",
@@ -77,7 +77,7 @@
77
77
  "author": "Jeff Dutton",
78
78
  "license": "MIT",
79
79
  "engines": {
80
- "node": ">=22.0.0"
80
+ "node": ">=22.13.0"
81
81
  },
82
82
  "repository": {
83
83
  "type": "git",