@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
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
# Release Process
|
|
2
|
+
|
|
3
|
+
## Lessons Learned (2026-01-16)
|
|
4
|
+
|
|
5
|
+
The `feat/v1.5.0-intelligence-layer` branch was orphaned for weeks, containing 5,600+ lines of code that diverged significantly from main. This document establishes processes to prevent similar situations.
|
|
6
|
+
|
|
7
|
+
## Branch Hygiene Rules
|
|
8
|
+
|
|
9
|
+
### 1. No Long-Lived Feature Branches
|
|
10
|
+
|
|
11
|
+
**Rule:** Feature branches should be merged or closed within **2 weeks**.
|
|
12
|
+
|
|
13
|
+
**Why:** Long-lived branches diverge and become difficult to merge.
|
|
14
|
+
|
|
15
|
+
**Process:**
|
|
16
|
+
- If a feature takes longer than 2 weeks, break it into smaller PRs
|
|
17
|
+
- If blocked, document why and set a reminder to revisit
|
|
18
|
+
|
|
19
|
+
### 2. Pre-Branch Checklist
|
|
20
|
+
|
|
21
|
+
Before creating a new feature branch:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# 1. Fetch latest and check for unmerged work
|
|
25
|
+
git fetch origin
|
|
26
|
+
git branch -r --no-merged main | grep -v HEAD
|
|
27
|
+
|
|
28
|
+
# 2. If unmerged branches exist, decide:
|
|
29
|
+
# - Merge them first? OR
|
|
30
|
+
# - Explicitly abandon them?
|
|
31
|
+
|
|
32
|
+
# 3. Start from latest main
|
|
33
|
+
git checkout main
|
|
34
|
+
git pull origin main
|
|
35
|
+
git checkout -b feat/my-feature
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 3. Weekly Stale Branch Review
|
|
39
|
+
|
|
40
|
+
Run weekly to identify abandoned branches:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# Show branches not merged to main, sorted by age
|
|
44
|
+
git for-each-ref --sort=committerdate refs/remotes/origin \
|
|
45
|
+
--format='%(committerdate:short) %(refname:short)' | \
|
|
46
|
+
grep -v HEAD | grep -v main
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### 4. Post-Merge Cleanup
|
|
50
|
+
|
|
51
|
+
After merging a PR:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Delete the remote branch
|
|
55
|
+
git push origin --delete feat/my-feature
|
|
56
|
+
|
|
57
|
+
# Delete local branch
|
|
58
|
+
git branch -d feat/my-feature
|
|
59
|
+
|
|
60
|
+
# Verify cleanup
|
|
61
|
+
git remote prune origin
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Version Bumping Strategy
|
|
65
|
+
|
|
66
|
+
### Semantic Versioning
|
|
67
|
+
|
|
68
|
+
| Change Type | Version Bump | Example |
|
|
69
|
+
|-------------|--------------|---------|
|
|
70
|
+
| Breaking change | Major | 1.5.2 → 2.0.0 |
|
|
71
|
+
| New feature | Minor | 1.5.2 → 1.6.0 |
|
|
72
|
+
| Bug fix | Patch | 1.5.2 → 1.5.3 |
|
|
73
|
+
|
|
74
|
+
### Branch Naming Convention
|
|
75
|
+
|
|
76
|
+
| Type | Pattern | Example |
|
|
77
|
+
|------|---------|---------|
|
|
78
|
+
| Feature | `feat/descriptive-name` | `feat/intelligence-layer-additive` |
|
|
79
|
+
| Fix | `fix/descriptive-name` | `fix/fallback-detection` |
|
|
80
|
+
| Release | `release/vX.Y.Z` | `release/v1.6.0` |
|
|
81
|
+
|
|
82
|
+
### Pre-Release Checklist
|
|
83
|
+
|
|
84
|
+
Before creating a release:
|
|
85
|
+
|
|
86
|
+
1. **Check for unmerged work:**
|
|
87
|
+
```bash
|
|
88
|
+
git branch -r --no-merged main
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
2. **Run full test suite:**
|
|
92
|
+
```bash
|
|
93
|
+
npm run build && npm test
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
3. **Review CHANGELOG:**
|
|
97
|
+
- Are all changes documented?
|
|
98
|
+
- Is the version number correct?
|
|
99
|
+
|
|
100
|
+
4. **Create release branch:**
|
|
101
|
+
```bash
|
|
102
|
+
git checkout -b release/v1.6.0
|
|
103
|
+
# Update version in package.json
|
|
104
|
+
git commit -am "chore: release v1.6.0"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Conflict Prevention
|
|
108
|
+
|
|
109
|
+
### When Parallel Work Happens
|
|
110
|
+
|
|
111
|
+
If two features are being developed in parallel:
|
|
112
|
+
|
|
113
|
+
1. **Communicate:** Let the team know what you're working on
|
|
114
|
+
2. **Small PRs:** Merge frequently to reduce divergence
|
|
115
|
+
3. **Rebase often:** Keep feature branches up to date with main
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Rebase feature branch on latest main
|
|
119
|
+
git fetch origin
|
|
120
|
+
git rebase origin/main
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### When Merging a Large Feature
|
|
124
|
+
|
|
125
|
+
For large features (>500 lines):
|
|
126
|
+
|
|
127
|
+
1. **Create a tracking issue** documenting what's being added
|
|
128
|
+
2. **Break into reviewable chunks** (≤300 lines per PR)
|
|
129
|
+
3. **Merge incrementally** rather than one giant PR
|
|
130
|
+
|
|
131
|
+
## Automation (Future)
|
|
132
|
+
|
|
133
|
+
Consider adding GitHub Actions for:
|
|
134
|
+
|
|
135
|
+
1. **Stale branch alerts:** Weekly notification of branches >14 days old
|
|
136
|
+
2. **PR size warnings:** Flag PRs with >500 lines changed
|
|
137
|
+
3. **Unmerged branch check:** CI fails if important branches are unmerged before release
|
|
138
|
+
|
|
139
|
+
## Quick Reference
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
# Check for unmerged branches
|
|
143
|
+
git branch -r --no-merged main | grep -v HEAD
|
|
144
|
+
|
|
145
|
+
# Compare branch to main
|
|
146
|
+
git log main..origin/feat/branch-name --oneline
|
|
147
|
+
git diff --stat main...origin/feat/branch-name
|
|
148
|
+
|
|
149
|
+
# Clean up after merge
|
|
150
|
+
git push origin --delete feat/branch-name
|
|
151
|
+
git branch -d feat/branch-name
|
|
152
|
+
git remote prune origin
|
|
153
|
+
```
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
# Persona Creation Test Guide
|
|
2
|
+
|
|
3
|
+
This guide tests the workflow tool's ability to create and configure AI Employees (personas).
|
|
4
|
+
|
|
5
|
+
## Architecture
|
|
6
|
+
|
|
7
|
+
### Greenfield (New Personas)
|
|
8
|
+
1. **Create** persona from template (provides valid workflow structure)
|
|
9
|
+
2. **Fetch** the created persona (get template's structure)
|
|
10
|
+
3. **Update** proto_config only (voice settings, welcome message, etc.)
|
|
11
|
+
4. **Customize workflow later** via modify mode if needed
|
|
12
|
+
|
|
13
|
+
### Brownfield (Existing Personas)
|
|
14
|
+
1. **Fetch** existing persona and workflow
|
|
15
|
+
2. **Decompile** workflow_def → WorkflowSpec (typed representation)
|
|
16
|
+
3. **Transform** spec based on user intent (LLM-native)
|
|
17
|
+
4. **Compile** back to workflow_def
|
|
18
|
+
5. **Update** persona with transformed workflow
|
|
19
|
+
|
|
20
|
+
## Prerequisites
|
|
21
|
+
|
|
22
|
+
1. **Rebuild the code**:
|
|
23
|
+
```bash
|
|
24
|
+
cd /path/to/ema-mcp-toolkit
|
|
25
|
+
npm run build
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
2. **Restart the MCP server** (Cursor caches code):
|
|
29
|
+
- `Cmd+Shift+P` → "Developer: Reload Window"
|
|
30
|
+
|
|
31
|
+
3. Access to Ema dev environment
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Test Cases
|
|
36
|
+
|
|
37
|
+
### Test 1: Create Voice AI Employee (Greenfield)
|
|
38
|
+
|
|
39
|
+
**Goal:** Create a new Voice AI persona from template with configured settings.
|
|
40
|
+
|
|
41
|
+
**Command:**
|
|
42
|
+
```
|
|
43
|
+
workflow(
|
|
44
|
+
input="Voice AI sales development representative for Ema. Handles discovery calls, qualifies prospects, explains value propositions.",
|
|
45
|
+
name="SP-TEST-VOICE-GREENFIELD",
|
|
46
|
+
type="voice",
|
|
47
|
+
preview=false,
|
|
48
|
+
env="dev"
|
|
49
|
+
)
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Expected Result:**
|
|
53
|
+
- `status: "deployed"`
|
|
54
|
+
- `deployed_to.created: true`
|
|
55
|
+
- `deployed_to.persona_id` returned
|
|
56
|
+
- `next_steps` explains how to customize workflow
|
|
57
|
+
|
|
58
|
+
**Verify:**
|
|
59
|
+
```
|
|
60
|
+
persona(id="<persona_id>", include_workflow=true, env="dev")
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Check:**
|
|
64
|
+
- [ ] Persona exists with correct name
|
|
65
|
+
- [ ] `proto_config.widgets` contains `conversationSettings` with:
|
|
66
|
+
- [ ] `welcomeMessage` - generated greeting
|
|
67
|
+
- [ ] `identityAndPurpose` - from description
|
|
68
|
+
- [ ] `workflow_def` has template workflow (trigger node + possibly more from template)
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
### Test 2: Create Chat AI Employee (Greenfield)
|
|
73
|
+
|
|
74
|
+
**Command:**
|
|
75
|
+
```
|
|
76
|
+
workflow(
|
|
77
|
+
input="IT helpdesk chatbot that answers employee questions about password resets, VPN setup, and software installation.",
|
|
78
|
+
name="SP-TEST-CHAT-GREENFIELD",
|
|
79
|
+
type="chat",
|
|
80
|
+
preview=false,
|
|
81
|
+
env="dev"
|
|
82
|
+
)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
**Expected Result:**
|
|
86
|
+
- `status: "deployed"`
|
|
87
|
+
- `deployed_to.created: true`
|
|
88
|
+
|
|
89
|
+
**Verify:**
|
|
90
|
+
```
|
|
91
|
+
persona(id="<persona_id>", include_workflow=true, env="dev")
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### Test 3: Modify Existing Workflow (Brownfield)
|
|
97
|
+
|
|
98
|
+
**Prerequisites:** Create a persona first (Test 1 or 2).
|
|
99
|
+
|
|
100
|
+
**Goal:** Add functionality to an existing persona's workflow.
|
|
101
|
+
|
|
102
|
+
**Command:**
|
|
103
|
+
```
|
|
104
|
+
workflow(
|
|
105
|
+
persona_id="<persona_id_from_test_1>",
|
|
106
|
+
input="add a search node that queries the knowledge base before responding",
|
|
107
|
+
preview=true,
|
|
108
|
+
env="dev"
|
|
109
|
+
)
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
**Expected Result:**
|
|
113
|
+
- `mode: "modify"`
|
|
114
|
+
- Shows proposed changes
|
|
115
|
+
- `modified_workflow` with new nodes
|
|
116
|
+
|
|
117
|
+
**Deploy the changes:**
|
|
118
|
+
```
|
|
119
|
+
workflow(
|
|
120
|
+
persona_id="<persona_id>",
|
|
121
|
+
input="add a search node that queries the knowledge base before responding",
|
|
122
|
+
preview=false,
|
|
123
|
+
env="dev"
|
|
124
|
+
)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
### Test 4: Analyze Workflow
|
|
130
|
+
|
|
131
|
+
**Command:**
|
|
132
|
+
```
|
|
133
|
+
workflow(persona_id="<persona_id>", env="dev")
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Expected Result:**
|
|
137
|
+
- `mode: "analyze"`
|
|
138
|
+
- `issues` array (may be empty if healthy)
|
|
139
|
+
- `metrics` with node_count, edge_count
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
### Test 5: Preview Only (No Deploy)
|
|
144
|
+
|
|
145
|
+
**Goal:** Verify preview mode returns workflow without deploying.
|
|
146
|
+
|
|
147
|
+
**Command:**
|
|
148
|
+
```
|
|
149
|
+
workflow(
|
|
150
|
+
input="Customer support voice AI that handles billing inquiries",
|
|
151
|
+
type="voice"
|
|
152
|
+
)
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Expected Result:**
|
|
156
|
+
- `status: "preview"`
|
|
157
|
+
- `workflow_def` returned
|
|
158
|
+
- `proto_config` with voice settings populated
|
|
159
|
+
- NO persona created
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Cleanup
|
|
164
|
+
|
|
165
|
+
After testing, delete test personas via the Ema UI or leave them for inspection.
|
|
166
|
+
|
|
167
|
+
Test persona names:
|
|
168
|
+
- SP-TEST-VOICE-GREENFIELD
|
|
169
|
+
- SP-TEST-CHAT-GREENFIELD
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## Troubleshooting
|
|
174
|
+
|
|
175
|
+
### "Internal Server Error"
|
|
176
|
+
- Usually means workflow format is wrong
|
|
177
|
+
- Check if MCP server has latest code (restart Cursor)
|
|
178
|
+
|
|
179
|
+
### "Widget name is empty"
|
|
180
|
+
- Old code issue - restart MCP server
|
|
181
|
+
|
|
182
|
+
### "Workflow name does not match"
|
|
183
|
+
- Old code tried to replace workflow - now we don't touch workflow in greenfield
|
|
184
|
+
|
|
185
|
+
### proto_config not updated
|
|
186
|
+
- Check that greenfield flow only updates proto_config, not workflow
|
|
187
|
+
- Widget merging should preserve template structure
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Key Code Locations
|
|
192
|
+
|
|
193
|
+
- **Greenfield flow**: `src/mcp/handlers-consolidated.ts` (search for "GREENFIELD")
|
|
194
|
+
- **Brownfield/modify flow**: `src/mcp/handlers-consolidated.ts` (search for "modify")
|
|
195
|
+
- **Workflow transformer**: `src/sdk/workflow-transformer.ts` (decompile/compile)
|
|
196
|
+
- **Proto config generation**: `src/sdk/workflow-generator.ts` (buildProtoConfig)
|