@ema.co/mcp-toolkit 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @ema.co/mcp-toolkit might be problematic. Click here for more details.
- package/dist/mcp/handlers-consolidated.js +400 -14
- package/dist/mcp/prompts.js +80 -123
- package/dist/mcp/server.js +134 -209
- package/dist/mcp/tools-consolidated.js +212 -150
- package/dist/sdk/action-registry.js +128 -0
- package/dist/sdk/client.js +58 -90
- package/dist/sdk/demo-generator.js +978 -0
- package/dist/sdk/generated/api-types.js +11 -0
- package/dist/sdk/index.js +15 -1
- package/dist/sdk/knowledge.js +38 -8
- package/dist/sdk/quality-gates.js +386 -0
- package/dist/sdk/structural-rules.js +290 -0
- package/dist/sdk/workflow-generator.js +187 -39
- package/dist/sdk/workflow-intent.js +246 -24
- package/dist/sdk/workflow-optimizer.js +665 -0
- package/dist/sdk/workflow-tracer.js +648 -0
- package/dist/sdk/workflow-transformer.js +10 -0
- package/dist/sdk/workflow-validator.js +391 -0
- package/docs/.temp/datasource-attach.har +198369 -0
- package/docs/.temp/grpcweb.gar +1 -0
- package/docs/local-generation.md +508 -0
- package/docs/mcp-flow-diagram.md +135 -0
- package/docs/mcp-tools-guide.md +163 -197
- package/docs/openapi.json +8000 -0
- package/docs/release-process.md +153 -0
- package/docs/test-persona-creation.md +196 -0
- package/docs/tool-consolidation-proposal.md +166 -378
- package/package.json +3 -1
- package/resources/templates/demo-scenarios/README.md +63 -0
package/docs/mcp-tools-guide.md
CHANGED
|
@@ -4,64 +4,109 @@ This MCP server is intentionally designed for **LLM + agent ergonomics**:
|
|
|
4
4
|
|
|
5
5
|
- **Few tools, consistent shapes**: a small set of noun-based tools with predictable `mode` / flag patterns
|
|
6
6
|
- **Resources-first**: use `ema://...` resources for reference data/templates, then tools for actions
|
|
7
|
-
- **Low ambiguity**: defaults are chosen to avoid
|
|
7
|
+
- **Low ambiguity**: defaults are chosen to avoid "which of 5 similar tools?" confusion
|
|
8
8
|
|
|
9
9
|
## Tool names in MCP clients
|
|
10
10
|
|
|
11
|
-
The server defines **base tool names** like `persona`, `
|
|
11
|
+
The server defines **base tool names** like `persona`, `template`.
|
|
12
12
|
|
|
13
|
-
Some clients show a **prefixed name** (for example Cursor: `
|
|
13
|
+
Some clients show a **prefixed name** (for example Cursor: `mcp_ema_persona`). Always call **the tool name your client displays**; the semantics are the same.
|
|
14
14
|
|
|
15
|
-
## The tool set (
|
|
15
|
+
## The tool set (8 tools)
|
|
16
16
|
|
|
17
17
|
| Tool | Purpose |
|
|
18
18
|
|------|---------|
|
|
19
19
|
| `env` | List available environments and which is default |
|
|
20
|
-
| `persona` |
|
|
21
|
-
| `workflow` | Generate/analyze/deploy/optimize/compare/compile workflows |
|
|
20
|
+
| `persona` | **UNIFIED**: Create/modify/analyze/optimize/list AI Employees |
|
|
22
21
|
| `action` | Actions/agents lookup (API + embedded docs), plus recommendations |
|
|
23
|
-
| `template` |
|
|
22
|
+
| `template` | Qualifying questions, workflow patterns, widget references |
|
|
24
23
|
| `knowledge` | Data sources + embedding (upload/list/delete/status/toggle) |
|
|
25
24
|
| `reference` | Concepts + guidance + validation + common mistakes |
|
|
26
25
|
| `sync` | Sync across environments (run/status/config) |
|
|
27
26
|
| `demo` | Demo/RAG document utilities (template/consolidate/generate/validate) |
|
|
28
27
|
|
|
28
|
+
> **Note**: The `workflow` tool is **DEPRECATED**. Use `persona` instead - it handles everything.
|
|
29
|
+
|
|
30
|
+
## ⚠️ THE KEY INSIGHT: ONE CALL
|
|
31
|
+
|
|
32
|
+
Creating an AI Employee should be **ONE `persona()` call**, not multiple calls.
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
persona(
|
|
36
|
+
input="Voice AI SDR: qualifies leads, identifies use-case, sends follow-up email",
|
|
37
|
+
type="voice",
|
|
38
|
+
name="Sales SDR",
|
|
39
|
+
preview=false
|
|
40
|
+
)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**MCP handles internally:** template selection, config generation, widget formatting, API orchestration.
|
|
44
|
+
|
|
29
45
|
## Start-here flows (LLM-friendly)
|
|
30
46
|
|
|
31
47
|
### Create a new AI Employee (greenfield)
|
|
32
48
|
|
|
33
|
-
1. **
|
|
34
|
-
2. **
|
|
35
|
-
3. **
|
|
36
|
-
4. **Generate workflow** (preview by default):
|
|
49
|
+
1. **Get qualifying questions from MCP**: `template(questions=true)`
|
|
50
|
+
2. **Ask user those questions**
|
|
51
|
+
3. **Create in ONE call**:
|
|
37
52
|
```typescript
|
|
38
|
-
|
|
53
|
+
persona(
|
|
54
|
+
input="<everything from user answers>",
|
|
55
|
+
name="My AI Employee",
|
|
56
|
+
type="voice",
|
|
57
|
+
preview=false
|
|
58
|
+
)
|
|
39
59
|
```
|
|
40
|
-
5. **Create persona** (if needed): `persona(mode="create", name="...", type="chat|voice|dashboard")`
|
|
41
|
-
6. **Deploy** (preview=false):
|
|
42
|
-
```typescript
|
|
43
|
-
workflow(input="<requirements>", persona_id="<id>", preview=false)
|
|
44
|
-
```
|
|
45
|
-
7. **Review**: `workflow(mode="analyze", persona_id="...")`
|
|
46
60
|
|
|
47
|
-
###
|
|
61
|
+
### Complex Workflows (email, HITL, multi-intent)
|
|
48
62
|
|
|
49
|
-
|
|
63
|
+
For complex workflows, MCP returns `status: "needs_llm_generation"` with a prompt you send to an LLM:
|
|
50
64
|
|
|
51
65
|
```typescript
|
|
52
|
-
//
|
|
53
|
-
|
|
66
|
+
// Step 1: Request creation
|
|
67
|
+
result = persona(
|
|
68
|
+
input="SDR that qualifies leads and sends follow-up emails",
|
|
69
|
+
type="voice",
|
|
70
|
+
name="Sales SDR",
|
|
71
|
+
preview=true
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
// If result.status === "needs_llm_generation":
|
|
75
|
+
// Step 2: Send result.llm_prompt to an LLM (Claude, GPT-4, etc.)
|
|
76
|
+
// Step 3: Deploy the LLM's workflow response
|
|
77
|
+
persona(
|
|
78
|
+
workflow_def=llm_response_json,
|
|
79
|
+
name="Sales SDR",
|
|
80
|
+
type="voice",
|
|
81
|
+
preview=false
|
|
82
|
+
)
|
|
83
|
+
```
|
|
54
84
|
|
|
55
|
-
|
|
56
|
-
|
|
85
|
+
**Simple workflows** (basic Q&A, search + respond) deploy directly without this extra step.
|
|
86
|
+
|
|
87
|
+
### Modify an existing AI Employee (brownfield)
|
|
88
|
+
|
|
89
|
+
```typescript
|
|
90
|
+
// Optional: Understand what exists first
|
|
91
|
+
persona(id="abc-123")
|
|
92
|
+
|
|
93
|
+
// Modify in ONE call
|
|
94
|
+
persona(id="abc-123", input="add HITL before email, add compliance intent", preview=false)
|
|
57
95
|
```
|
|
58
96
|
|
|
59
|
-
### Review
|
|
97
|
+
### Analyze/Review an AI Employee
|
|
60
98
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
99
|
+
```typescript
|
|
100
|
+
persona(id="abc-123") // Get with analysis
|
|
101
|
+
persona(id="abc-123", include_workflow=true) // Include full workflow
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Optimize (auto-fix issues)
|
|
105
|
+
|
|
106
|
+
```typescript
|
|
107
|
+
persona(id="abc-123", optimize=true) // Preview fixes
|
|
108
|
+
persona(id="abc-123", optimize=true, preview=false) // Apply fixes
|
|
109
|
+
```
|
|
65
110
|
|
|
66
111
|
### Upload / manage knowledge base documents
|
|
67
112
|
|
|
@@ -74,116 +119,96 @@ workflow(mode="extend", persona_id="abc-123", input="...", preview=false)
|
|
|
74
119
|
- Run (single): `sync(id="My Bot", source="demo", target="dev", dry_run=true|false)`
|
|
75
120
|
- Run (all tagged): `sync(target="dev", scope="all", dry_run=true|false)`
|
|
76
121
|
- Status: `sync(mode="status", id="My Bot", env="dev")`
|
|
77
|
-
- List all synced in env: `sync(mode="status", list_synced=true, env="dev")`
|
|
78
|
-
- Config: `sync(mode="config")`
|
|
79
122
|
|
|
80
123
|
### Version / snapshot AI Employees
|
|
81
124
|
|
|
82
|
-
Take snapshots before making changes, restore if something breaks.
|
|
83
|
-
|
|
84
125
|
```typescript
|
|
85
126
|
// Before a risky change - create a snapshot
|
|
86
127
|
persona(id="My Bot", mode="version_create", message="Before adding HITL")
|
|
87
128
|
|
|
88
129
|
// Make changes...
|
|
89
|
-
|
|
130
|
+
persona(id="abc", input="add HITL before email", preview=false)
|
|
90
131
|
|
|
91
|
-
// If something breaks -
|
|
132
|
+
// If something breaks - restore
|
|
92
133
|
persona(id="My Bot", mode="version_list")
|
|
93
134
|
persona(id="My Bot", mode="version_restore", version="v3")
|
|
94
135
|
```
|
|
95
136
|
|
|
96
|
-
|
|
137
|
+
## Tool reference (high-signal)
|
|
138
|
+
|
|
139
|
+
### `persona` (UNIFIED - use for everything)
|
|
140
|
+
|
|
141
|
+
**Create new AI Employee:**
|
|
97
142
|
```typescript
|
|
98
|
-
persona(
|
|
99
|
-
// Now every deploy automatically creates a snapshot first
|
|
143
|
+
persona(input="<what it does>", type="voice", name="My Bot", preview=false)
|
|
100
144
|
```
|
|
101
145
|
|
|
102
|
-
|
|
146
|
+
**Modify existing:**
|
|
147
|
+
```typescript
|
|
148
|
+
persona(id="abc", input="add HITL before email", preview=false)
|
|
149
|
+
```
|
|
103
150
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
151
|
+
**Analyze/Get:**
|
|
152
|
+
```typescript
|
|
153
|
+
persona(id="abc")
|
|
154
|
+
persona(id="abc", include_workflow=true)
|
|
155
|
+
```
|
|
107
156
|
|
|
108
|
-
|
|
157
|
+
**Optimize:**
|
|
158
|
+
```typescript
|
|
159
|
+
persona(id="abc", optimize=true, preview=false)
|
|
160
|
+
```
|
|
109
161
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- **Update**: `persona(id="<id>", mode="update", name="...", description="...", enabled=true|false)`
|
|
116
|
-
- **Compare**: `persona(id="<id>", mode="compare", compare_to="<id>", compare_env="dev")`
|
|
117
|
-
- **Templates**: `persona(templates=true)`
|
|
118
|
-
- **Version management**:
|
|
119
|
-
```typescript
|
|
120
|
-
persona(id="abc", mode="version_create", message="Before major update") // Create snapshot
|
|
121
|
-
persona(id="abc", mode="version_list") // List all versions
|
|
122
|
-
persona(id="abc", mode="version_get", version="v3") // Get specific version
|
|
123
|
-
persona(id="abc", mode="version_compare", v1="v2", v2="v3") // Compare versions
|
|
124
|
-
persona(id="abc", mode="version_restore", version="v2") // Restore to version
|
|
125
|
-
persona(id="abc", mode="version_policy", auto_on_deploy=true) // Auto-snapshot settings
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### `workflow`
|
|
129
|
-
|
|
130
|
-
All modification modes default to `preview=true` for safety. Use `preview=false` to deploy.
|
|
131
|
-
|
|
132
|
-
- **Generate (greenfield)**: Create new workflow
|
|
133
|
-
```typescript
|
|
134
|
-
workflow(input="IT helpdesk with KB search") // Preview
|
|
135
|
-
workflow(input="...", persona_id="abc", preview=false) // Generate AND deploy
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
- **Extend (brownfield)**: Modify existing workflow with natural language
|
|
139
|
-
```typescript
|
|
140
|
-
workflow(mode="extend", persona_id="abc", input="add caller_type categorizer")
|
|
141
|
-
workflow(mode="extend", persona_id="abc", input="add X, add Y, add Z") // Multiple changes!
|
|
142
|
-
workflow(mode="extend", persona_id="abc", input="...", preview=false) // Extend AND deploy
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
- **Optimize**: Fix issues in existing workflow
|
|
146
|
-
```typescript
|
|
147
|
-
workflow(mode="optimize", persona_id="abc") // Preview fixes
|
|
148
|
-
workflow(mode="optimize", persona_id="abc", preview=false) // Apply fixes
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
- **Analyze** (always read-only):
|
|
152
|
-
```typescript
|
|
153
|
-
workflow(mode="analyze", persona_id="abc")
|
|
154
|
-
workflow(mode="analyze", workflow_def={...})
|
|
155
|
-
workflow(mode="analyze", persona_id="abc", include=["issues", "fixes"])
|
|
156
|
-
```
|
|
157
|
-
|
|
158
|
-
- **Compare** (always read-only):
|
|
159
|
-
```typescript
|
|
160
|
-
workflow(mode="compare", persona_id="abc", compare_to="def")
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
- **Compile** (returns workflow_def from explicit node spec):
|
|
164
|
-
```typescript
|
|
165
|
-
workflow(mode="compile", name="...", description="...", nodes=[...])
|
|
166
|
-
```
|
|
162
|
+
**List/Search:**
|
|
163
|
+
```typescript
|
|
164
|
+
persona(all=true)
|
|
165
|
+
persona(query="support", status="active")
|
|
166
|
+
```
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
**Compare:**
|
|
169
|
+
```typescript
|
|
170
|
+
persona(id="abc", compare_to="def")
|
|
171
|
+
```
|
|
169
172
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
**Version management:**
|
|
174
|
+
```typescript
|
|
175
|
+
persona(id="abc", mode="version_create", message="Before update")
|
|
176
|
+
persona(id="abc", mode="version_list")
|
|
177
|
+
persona(id="abc", mode="version_restore", version="v2")
|
|
178
|
+
persona(id="abc", mode="version_policy", auto_on_deploy=true)
|
|
179
|
+
```
|
|
173
180
|
|
|
174
181
|
### `template`
|
|
175
182
|
|
|
176
|
-
-
|
|
177
|
-
|
|
178
|
-
|
|
183
|
+
**Primary use - Get qualifying questions:**
|
|
184
|
+
```typescript
|
|
185
|
+
template(questions=true) // All questions
|
|
186
|
+
template(questions=true, category="Voice") // Voice-specific
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**Reference (understand options):**
|
|
190
|
+
```typescript
|
|
191
|
+
template(patterns=true)
|
|
192
|
+
template(pattern="intent-routing")
|
|
193
|
+
template(widgets="voice")
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
### `action`
|
|
197
|
+
|
|
198
|
+
```typescript
|
|
199
|
+
action(id="chat_categorizer", include_docs=true) // Get specific
|
|
200
|
+
action(all=true) // List all
|
|
201
|
+
action(suggest="IT helpdesk with ServiceNow") // Get recommendations
|
|
202
|
+
```
|
|
179
203
|
|
|
180
204
|
### `reference`
|
|
181
205
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
206
|
+
```typescript
|
|
207
|
+
reference(concept="HITL")
|
|
208
|
+
reference(guidance="categorizer-routing")
|
|
209
|
+
reference(mistakes=true)
|
|
210
|
+
reference(checklist=true)
|
|
211
|
+
```
|
|
187
212
|
|
|
188
213
|
## Resources (read-first)
|
|
189
214
|
|
|
@@ -191,89 +216,39 @@ Start with:
|
|
|
191
216
|
|
|
192
217
|
- `ema://index/all-resources` (index)
|
|
193
218
|
- `ema://docs/readme` (toolkit overview)
|
|
194
|
-
- `ema://docs/ema-user-guide` (platform concepts)
|
|
195
219
|
- `ema://catalog/agents-summary` (quick agent overview)
|
|
196
|
-
- `ema://catalog/templates` (persona templates
|
|
197
|
-
- `ema://
|
|
198
|
-
- `ema://catalog/patterns` (workflow patterns)
|
|
199
|
-
- `ema://rules/input-sources` and `ema://rules/anti-patterns` (validation rules)
|
|
220
|
+
- `ema://catalog/templates` (persona templates - dynamic)
|
|
221
|
+
- `ema://rules/anti-patterns` (what NOT to do)
|
|
200
222
|
|
|
201
223
|
## Auto-Fix Capabilities
|
|
202
224
|
|
|
203
|
-
The `
|
|
225
|
+
The `persona(id="...", optimize=true)` can automatically fix common issues:
|
|
204
226
|
|
|
205
227
|
| Issue | Severity | Auto-Fix? | Action |
|
|
206
228
|
|-------|----------|-----------|--------|
|
|
207
229
|
| `orphan` | warning | ✅ | Removes unreachable nodes |
|
|
208
230
|
| `dead_end` | critical | ✅ | Adds results mapping |
|
|
209
|
-
| `missing_workflow_output` | critical | ✅ | Adds results mapping
|
|
210
|
-
| `wrong_input_source` (email_to) | warning | ✅ | Adds
|
|
211
|
-
| `
|
|
212
|
-
| `
|
|
213
|
-
| `type_mismatch` | critical | ✅ | Rewires to type-compatible source |
|
|
231
|
+
| `missing_workflow_output` | critical | ✅ | Adds results mapping |
|
|
232
|
+
| `wrong_input_source` (email_to) | warning | ✅ | Adds entity_extraction |
|
|
233
|
+
| `missing_fallback` | critical | ✅ | Adds Fallback category |
|
|
234
|
+
| `type_mismatch` | critical | ✅ | Rewires to compatible source |
|
|
214
235
|
| `cycle` | critical | ❌ | Requires manual restructuring |
|
|
215
|
-
| `incomplete_hitl` | critical | ❌ | Needs success/failure response node configuration |
|
|
216
|
-
| `side_effect_without_hitl` | info | ℹ️ | Informational only - HITL is opt-in |
|
|
217
236
|
|
|
218
237
|
## HITL (Human-in-the-Loop) Policy
|
|
219
238
|
|
|
220
|
-
**HITL is opt-in, not forced by default.**
|
|
221
|
-
|
|
222
|
-
| Scenario | Default Behavior | How to Add HITL |
|
|
223
|
-
|----------|-----------------|-----------------|
|
|
224
|
-
| Send email | ❌ No HITL | Request explicitly: "add approval before sending" |
|
|
225
|
-
| External API call | ❌ No HITL | Request explicitly: "require human approval" |
|
|
226
|
-
| Create/update records | ❌ No HITL | Request explicitly in prompt |
|
|
227
|
-
|
|
228
|
-
To add HITL after deployment: `workflow(persona_id="...", input="add human approval before email")`
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
## Brownfield Workflow Extension
|
|
232
|
-
|
|
233
|
-
Extend existing workflows with new capabilities while preserving existing logic.
|
|
234
|
-
|
|
235
|
-
### Usage
|
|
236
|
-
|
|
237
|
-
```typescript
|
|
238
|
-
// Add new nodes/intents
|
|
239
|
-
workflow(persona_id="abc", input="add caller_type categorizer with Advisor and Client roles")
|
|
240
|
-
|
|
241
|
-
// Add enum options to existing categorizer
|
|
242
|
-
workflow(persona_id="abc", input="add Market Analysis intent to the categorizer")
|
|
243
|
-
|
|
244
|
-
// Add custom wiring
|
|
245
|
-
workflow(persona_id="abc", input="add send_email node connected to entity_extractor output")
|
|
246
|
-
|
|
247
|
-
// Merge a complete workflow_def (extend mode - preserves existing)
|
|
248
|
-
workflow(persona_id="abc", workflow_def={...}, merge_mode="extend")
|
|
249
|
-
|
|
250
|
-
// Replace with a new workflow (destructive)
|
|
251
|
-
workflow(persona_id="abc", workflow_def={...}, merge_mode="replace", force=true)
|
|
252
|
-
```
|
|
253
|
-
|
|
254
|
-
### Merge Modes
|
|
255
|
-
|
|
256
|
-
| Mode | Behavior |
|
|
257
|
-
|------|----------|
|
|
258
|
-
| `extend` (default) | Add new nodes, preserve existing, merge enums |
|
|
259
|
-
| `replace` | Replace nodes not in incoming (destructive) |
|
|
260
|
-
|
|
261
|
-
### Capabilities
|
|
262
|
-
|
|
263
|
-
| Capability | Example |
|
|
264
|
-
|------------|---------|
|
|
265
|
-
| ✅ Add new nodes | `input="add password reset intent"` |
|
|
266
|
-
| ✅ Add enum options | `input="add Advisor/Client to caller_type"` |
|
|
267
|
-
| ✅ Add HITL gates | `input="add approval before sending emails"` |
|
|
268
|
-
| ✅ Modify node wiring | `input="wire entity_extraction to email handler"` |
|
|
269
|
-
| ✅ Preserve existing logic | Existing nodes/enums kept unless modified |
|
|
239
|
+
**HITL is opt-in, not forced by default.**
|
|
270
240
|
|
|
241
|
+
| Scenario | Default | How to Add HITL |
|
|
242
|
+
|----------|---------|-----------------|
|
|
243
|
+
| Send email | ❌ No HITL | `persona(id="...", input="add approval before sending")` |
|
|
244
|
+
| External API | ❌ No HITL | Request explicitly in input |
|
|
245
|
+
| Create records | ❌ No HITL | Request explicitly in input |
|
|
271
246
|
|
|
272
247
|
## Auto Builder Prompt Length Limits
|
|
273
248
|
|
|
274
|
-
**⚠️ CRITICAL:** Auto Builder has strict prompt length limits
|
|
249
|
+
**⚠️ CRITICAL:** Auto Builder has strict prompt length limits (~2500 chars).
|
|
275
250
|
|
|
276
|
-
### Good Prompt Format
|
|
251
|
+
### Good Prompt Format
|
|
277
252
|
```text
|
|
278
253
|
Voice AI for [use case]. Supports [capabilities].
|
|
279
254
|
|
|
@@ -285,33 +260,24 @@ Core Capabilities:
|
|
|
285
260
|
Rules:
|
|
286
261
|
• Rule 1
|
|
287
262
|
• Rule 2
|
|
288
|
-
|
|
289
|
-
Output: All responses return through WORKFLOW_OUTPUT.
|
|
290
263
|
```
|
|
291
264
|
|
|
292
265
|
### Bad Prompt Format (Times Out)
|
|
293
266
|
- Narrative descriptions with multiple paragraphs
|
|
294
267
|
- Example conversations embedded in prompt
|
|
295
|
-
- Detailed step-by-step flows for each intent
|
|
296
268
|
- Prompts > 2500 characters
|
|
297
269
|
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
## Workflow Generation Strategy
|
|
301
|
-
|
|
302
|
-
| Approach | When to Use | Notes |
|
|
303
|
-
|----------|-------------|-------|
|
|
304
|
-
| **Local compilation** | Simple/medium workflows | `workflow(mode="compile", ...)` - reliable, fast |
|
|
305
|
-
| **Auto Builder** | Complex/exploratory workflows | Requires concise prompts (<2500 chars) |
|
|
306
|
-
|
|
307
|
-
Prefer local compilation for deterministic results. Use `use_autobuilder=false` flag when generating workflows.
|
|
270
|
+
## Deprecated: `workflow` tool
|
|
308
271
|
|
|
309
|
-
|
|
272
|
+
The `workflow` tool is **DEPRECATED**. It still works but routes to `persona`.
|
|
310
273
|
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
- Prefer the consolidated tools for new usage
|
|
274
|
+
**Migration:**
|
|
275
|
+
```typescript
|
|
276
|
+
// OLD (deprecated)
|
|
277
|
+
workflow(input="...", type="voice", name="Bot", preview=false)
|
|
278
|
+
workflow(persona_id="abc", input="add HITL")
|
|
317
279
|
|
|
280
|
+
// NEW (use this)
|
|
281
|
+
persona(input="...", type="voice", name="Bot", preview=false)
|
|
282
|
+
persona(id="abc", input="add HITL")
|
|
283
|
+
```
|