@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/dist/mcp/prompts.js
CHANGED
|
@@ -1147,12 +1147,12 @@ Now begin by reading the resources, then proceed with generation.`,
|
|
|
1147
1147
|
],
|
|
1148
1148
|
},
|
|
1149
1149
|
// ─────────────────────────────────────────────────────────────────────────
|
|
1150
|
-
// Direct Workflow Generation
|
|
1150
|
+
// Direct Workflow Generation
|
|
1151
1151
|
// ─────────────────────────────────────────────────────────────────────────
|
|
1152
1152
|
workflow_generate: {
|
|
1153
1153
|
definition: {
|
|
1154
1154
|
name: "workflow_generate",
|
|
1155
|
-
description: "Generate
|
|
1155
|
+
description: "Generate an AI Employee workflow. Preview first, then deploy when ready.",
|
|
1156
1156
|
arguments: [
|
|
1157
1157
|
{
|
|
1158
1158
|
name: "name",
|
|
@@ -1161,29 +1161,14 @@ Now begin by reading the resources, then proceed with generation.`,
|
|
|
1161
1161
|
},
|
|
1162
1162
|
{
|
|
1163
1163
|
name: "description",
|
|
1164
|
-
description: "What the AI Employee does",
|
|
1164
|
+
description: "What the AI Employee does (be detailed about capabilities, intents, data sources)",
|
|
1165
1165
|
required: true,
|
|
1166
1166
|
},
|
|
1167
1167
|
{
|
|
1168
|
-
name: "
|
|
1168
|
+
name: "type",
|
|
1169
1169
|
description: "Type: 'voice', 'chat', or 'dashboard'",
|
|
1170
1170
|
required: true,
|
|
1171
1171
|
},
|
|
1172
|
-
{
|
|
1173
|
-
name: "pattern",
|
|
1174
|
-
description: "Workflow pattern: 'kb_search' (FAQ/docs), 'intent_routing' (multi-intent), 'tool_calling' (external actions)",
|
|
1175
|
-
required: true,
|
|
1176
|
-
},
|
|
1177
|
-
{
|
|
1178
|
-
name: "intents",
|
|
1179
|
-
description: "For intent_routing: comma-separated intent names with handler type, e.g., 'Search:search,Help:llm,Transfer:fixed'",
|
|
1180
|
-
required: false,
|
|
1181
|
-
},
|
|
1182
|
-
{
|
|
1183
|
-
name: "tools",
|
|
1184
|
-
description: "For tool_calling: comma-separated tool names with namespace, e.g., 'Create_Ticket:service_now,Send_Email:outlook'",
|
|
1185
|
-
required: false,
|
|
1186
|
-
},
|
|
1187
1172
|
],
|
|
1188
1173
|
},
|
|
1189
1174
|
render: (args) => [
|
|
@@ -1191,59 +1176,45 @@ Now begin by reading the resources, then proceed with generation.`,
|
|
|
1191
1176
|
role: "user",
|
|
1192
1177
|
content: {
|
|
1193
1178
|
type: "text",
|
|
1194
|
-
text: `Generate
|
|
1179
|
+
text: `Generate AI Employee: ${args.name}
|
|
1195
1180
|
|
|
1181
|
+
**Type**: ${args.type}
|
|
1196
1182
|
**Description**: ${args.description}
|
|
1197
|
-
**Persona Type**: ${args.persona_type}
|
|
1198
|
-
**Pattern**: ${args.pattern}
|
|
1199
|
-
${args.intents ? `**Intents**: ${args.intents}` : ""}
|
|
1200
|
-
${args.tools ? `**Tools**: ${args.tools}` : ""}
|
|
1201
|
-
|
|
1202
|
-
## Instructions
|
|
1203
|
-
|
|
1204
|
-
Generate deployment-ready JSON using the consolidated \`workflow\` tool (local compiler):
|
|
1205
1183
|
|
|
1206
|
-
|
|
1207
|
-
Call:
|
|
1208
|
-
\`workflow(input=<requirements>, type="${args.persona_type}", use_autobuilder=false)\`
|
|
1184
|
+
## Step 1: Preview the workflow
|
|
1209
1185
|
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
**HITL Policy**: DEFAULT is no approval gates. Only add HITL if user explicitly requests approval/confirmation before external actions.
|
|
1218
|
-
|
|
1219
|
-
If the tool returns \`status="needs_input"\`, ask the missing questions, then call \`workflow(...)\` again with the additional details.
|
|
1220
|
-
|
|
1221
|
-
### Step 2: (Optional) Validate the generated workflow
|
|
1222
|
-
Call \`workflow(mode="analyze", workflow_def=<workflow_def>)\` and fix any critical issues before deploying.
|
|
1186
|
+
\`\`\`
|
|
1187
|
+
workflow(
|
|
1188
|
+
input="${args.description}",
|
|
1189
|
+
type="${args.type}"
|
|
1190
|
+
)
|
|
1191
|
+
\`\`\`
|
|
1223
1192
|
|
|
1224
|
-
|
|
1225
|
-
If you already have a persona, deploy directly:
|
|
1226
|
-
\`workflow(mode="deploy", persona_id="<persona_id>", workflow_def=<workflow_def>, proto_config=<proto_config>)\`
|
|
1193
|
+
This returns workflow_def and proto_config. Review them before deploying.
|
|
1227
1194
|
|
|
1228
|
-
|
|
1229
|
-
\`persona(mode="create", name="${args.name}", type="${args.persona_type}")\`
|
|
1230
|
-
then deploy as above.
|
|
1195
|
+
## Step 2: Deploy when ready
|
|
1231
1196
|
|
|
1232
|
-
|
|
1197
|
+
\`\`\`
|
|
1198
|
+
workflow(
|
|
1199
|
+
input="${args.description}",
|
|
1200
|
+
name="${args.name}",
|
|
1201
|
+
type="${args.type}",
|
|
1202
|
+
preview=false
|
|
1203
|
+
)
|
|
1204
|
+
\`\`\`
|
|
1233
1205
|
|
|
1234
|
-
|
|
1206
|
+
This creates the persona and deploys the workflow in one step.
|
|
1235
1207
|
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
{workflow_def}
|
|
1239
|
-
\`\`\`
|
|
1208
|
+
${args.type === "voice" ? `
|
|
1209
|
+
## Voice AI Notes
|
|
1240
1210
|
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1211
|
+
The generated proto_config includes voice settings:
|
|
1212
|
+
- welcomeMessage: Generated greeting
|
|
1213
|
+
- identityAndPurpose: Generated from description
|
|
1214
|
+
- takeActionInstructions, hangupInstructions: Sensible defaults
|
|
1245
1215
|
|
|
1246
|
-
|
|
1216
|
+
These are set automatically but can be customized via proto_config override.
|
|
1217
|
+
` : ""}`,
|
|
1247
1218
|
},
|
|
1248
1219
|
},
|
|
1249
1220
|
],
|
|
@@ -1251,7 +1222,7 @@ Now generate by calling \`workflow(input=<requirements>, type="${args.persona_ty
|
|
|
1251
1222
|
workflow_deploy: {
|
|
1252
1223
|
definition: {
|
|
1253
1224
|
name: "workflow_deploy",
|
|
1254
|
-
description: "
|
|
1225
|
+
description: "Create a new AI Employee from template with configured settings, or modify an existing one.",
|
|
1255
1226
|
arguments: [
|
|
1256
1227
|
{
|
|
1257
1228
|
name: "name",
|
|
@@ -1259,13 +1230,18 @@ Now generate by calling \`workflow(input=<requirements>, type="${args.persona_ty
|
|
|
1259
1230
|
required: true,
|
|
1260
1231
|
},
|
|
1261
1232
|
{
|
|
1262
|
-
name: "
|
|
1263
|
-
description: "
|
|
1264
|
-
required:
|
|
1233
|
+
name: "type",
|
|
1234
|
+
description: "Type: voice, chat, or dashboard",
|
|
1235
|
+
required: true,
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
name: "description",
|
|
1239
|
+
description: "What this AI Employee does",
|
|
1240
|
+
required: true,
|
|
1265
1241
|
},
|
|
1266
1242
|
{
|
|
1267
|
-
name: "
|
|
1268
|
-
description: "
|
|
1243
|
+
name: "env",
|
|
1244
|
+
description: "Target environment (default: demo)",
|
|
1269
1245
|
required: false,
|
|
1270
1246
|
},
|
|
1271
1247
|
],
|
|
@@ -1275,70 +1251,51 @@ Now generate by calling \`workflow(input=<requirements>, type="${args.persona_ty
|
|
|
1275
1251
|
role: "user",
|
|
1276
1252
|
content: {
|
|
1277
1253
|
type: "text",
|
|
1278
|
-
text: `
|
|
1279
|
-
|
|
1280
|
-
**Target Environment**: ${args.env || "demo"}
|
|
1281
|
-
**Update Existing**: ${args.update_existing === "true" ? "Yes" : "No (create new)"}
|
|
1282
|
-
|
|
1283
|
-
## Instructions
|
|
1284
|
-
|
|
1285
|
-
### Pre-Deploy Checklist
|
|
1286
|
-
|
|
1287
|
-
Before deploying, ensure you have:
|
|
1288
|
-
1. ✅ Generated workflow_def using workflow_generate prompt
|
|
1289
|
-
2. ✅ Generated proto_config/persona settings
|
|
1290
|
-
3. ✅ Validated the workflow (no critical issues)
|
|
1291
|
-
|
|
1292
|
-
### Step 1: Check for Existing
|
|
1254
|
+
text: `Create AI Employee: ${args.name}
|
|
1293
1255
|
|
|
1294
|
-
${args.
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
` : `
|
|
1298
|
-
Call \`persona(query="${args.name}", env="${args.env || "demo"}")\`
|
|
1299
|
-
to check whether an AI Employee with this name already exists (and capture the persona ID if present).
|
|
1300
|
-
`}
|
|
1301
|
-
|
|
1302
|
-
### Step 2: Create or Update
|
|
1303
|
-
|
|
1304
|
-
${args.update_existing === "true" ? `
|
|
1305
|
-
If not found, create it:
|
|
1306
|
-
\`persona(mode="create", name="${args.name}", type="chat", env="${args.env || "demo"}")\`
|
|
1307
|
-
` : `
|
|
1308
|
-
Create a new AI Employee:
|
|
1309
|
-
\`persona(mode="create", name="${args.name}", type="chat", env="${args.env || "demo"}")\`
|
|
1310
|
-
`}
|
|
1311
|
-
|
|
1312
|
-
### Step 3: Configure Workflow
|
|
1313
|
-
|
|
1314
|
-
Deploy the workflow via MCP:
|
|
1315
|
-
\`workflow(mode="deploy", persona_id="<persona_id>", workflow_def=<workflow_def>, proto_config=<proto_config>, env="${args.env || "demo"}")\`
|
|
1256
|
+
**Type**: ${args.type || "chat"}
|
|
1257
|
+
**Environment**: ${args.env || "demo"}
|
|
1258
|
+
**Description**: ${args.description}
|
|
1316
1259
|
|
|
1317
|
-
|
|
1260
|
+
## How It Works
|
|
1318
1261
|
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
4. Check HITL flows work (if applicable)
|
|
1262
|
+
**Greenfield** (new personas): Creates from template, configures settings.
|
|
1263
|
+
- Template provides valid workflow structure
|
|
1264
|
+
- We configure proto_config (voice settings, welcome message, etc.)
|
|
1265
|
+
- Customize workflow AFTER creation via modify mode
|
|
1324
1266
|
|
|
1325
|
-
|
|
1267
|
+
**Brownfield** (existing personas): Uses LLM-native transformation.
|
|
1268
|
+
- Fetches existing workflow
|
|
1269
|
+
- Decompiles to WorkflowSpec
|
|
1270
|
+
- Transforms based on your input
|
|
1271
|
+
- Compiles back and deploys
|
|
1326
1272
|
|
|
1327
|
-
|
|
1328
|
-
1. Call \`persona(id="<persona_id>", mode="update", enabled=true, env="${args.env || "demo"}")\`
|
|
1329
|
-
2. Monitor initial conversations
|
|
1330
|
-
3. Iterate based on feedback
|
|
1273
|
+
## Create New Persona
|
|
1331
1274
|
|
|
1332
|
-
|
|
1275
|
+
\`\`\`
|
|
1276
|
+
workflow(
|
|
1277
|
+
input="${args.description}",
|
|
1278
|
+
name="${args.name}",
|
|
1279
|
+
type="${args.type || "chat"}",
|
|
1280
|
+
preview=false,
|
|
1281
|
+
env="${args.env || "demo"}"
|
|
1282
|
+
)
|
|
1283
|
+
\`\`\`
|
|
1333
1284
|
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
-
|
|
1338
|
-
-
|
|
1339
|
-
-
|
|
1285
|
+
This creates the persona from template and configures settings.
|
|
1286
|
+
${args.type === "voice" ? `
|
|
1287
|
+
For Voice AI, this sets:
|
|
1288
|
+
- welcomeMessage (generated greeting)
|
|
1289
|
+
- identityAndPurpose (from your description)
|
|
1290
|
+
- hangupInstructions, speechCharacteristics (defaults)
|
|
1291
|
+
` : ""}
|
|
1292
|
+
## After Creation
|
|
1340
1293
|
|
|
1341
|
-
|
|
1294
|
+
1. Get persona_id from response
|
|
1295
|
+
2. Verify: \`persona(id="<persona_id>", include_workflow=true)\`
|
|
1296
|
+
3. Customize workflow: \`workflow(persona_id="<id>", input="add search node")\`
|
|
1297
|
+
4. Test in Ema simulator
|
|
1298
|
+
5. Enable: \`persona(id="<id>", mode="update", enabled=true)\``,
|
|
1342
1299
|
},
|
|
1343
1300
|
},
|
|
1344
1301
|
],
|