@ema.co/mcp-toolkit 0.3.0 → 1.4.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.
- package/dist/mcp/handlers-consolidated.js +16 -0
- package/dist/mcp/prompts.js +11 -2
- package/dist/mcp/server.js +944 -45
- package/dist/sdk/client.js +103 -0
- package/dist/sdk/knowledge.js +39 -5
- package/dist/sdk/workflow-generator.js +1 -1
- package/docs/mcp-tools-guide.md +61 -10
- package/package.json +1 -1
|
@@ -562,6 +562,15 @@ export async function handleWorkflow(args, client) {
|
|
|
562
562
|
if (!persona) {
|
|
563
563
|
return { error: `Persona not found: ${personaId}` };
|
|
564
564
|
}
|
|
565
|
+
// Check persona status - deployment works on disabled personas but we should inform user
|
|
566
|
+
const personaStatus = persona.status?.toLowerCase();
|
|
567
|
+
const isDisabled = personaStatus === "inactive" || personaStatus === "disabled";
|
|
568
|
+
const statusWarnings = [];
|
|
569
|
+
if (isDisabled) {
|
|
570
|
+
statusWarnings.push(`⚠️ Persona "${persona.name}" is currently DISABLED (status: ${persona.status}). ` +
|
|
571
|
+
`Workflow will be deployed but won't be active until enabled. ` +
|
|
572
|
+
`Use persona(mode="update", id="${personaId}", enabled=true) to enable.`);
|
|
573
|
+
}
|
|
565
574
|
let deployWorkflow = workflowDef || persona.workflow_def;
|
|
566
575
|
// Validate if requested (default: true)
|
|
567
576
|
if (args.validate !== false) {
|
|
@@ -572,6 +581,7 @@ export async function handleWorkflow(args, client) {
|
|
|
572
581
|
error: "Workflow has errors",
|
|
573
582
|
issues: errors,
|
|
574
583
|
hint: "Set auto_fix=true to attempt automatic fixes",
|
|
584
|
+
...(statusWarnings.length > 0 && { status_warnings: statusWarnings }),
|
|
575
585
|
};
|
|
576
586
|
}
|
|
577
587
|
// Auto-fix if enabled
|
|
@@ -588,7 +598,13 @@ export async function handleWorkflow(args, client) {
|
|
|
588
598
|
return {
|
|
589
599
|
success: true,
|
|
590
600
|
persona_id: personaId,
|
|
601
|
+
persona_name: persona.name,
|
|
602
|
+
persona_status: persona.status,
|
|
591
603
|
deployed: true,
|
|
604
|
+
...(isDisabled && {
|
|
605
|
+
warning: `Persona is DISABLED - workflow deployed but inactive. Enable with: persona(mode="update", id="${personaId}", enabled=true)`,
|
|
606
|
+
}),
|
|
607
|
+
...(statusWarnings.length > 0 && { status_warnings: statusWarnings }),
|
|
592
608
|
};
|
|
593
609
|
}
|
|
594
610
|
case "compare": {
|
package/dist/mcp/prompts.js
CHANGED
|
@@ -74,9 +74,16 @@ Identify what the user is asking for:
|
|
|
74
74
|
| **Data Sources** | ✓/✗ | Knowledge base, web search, APIs? |
|
|
75
75
|
| **External Tools** | ✓/✗ | ServiceNow, Salesforce, email? |
|
|
76
76
|
| **Routing Logic** | ✓/✗ | How to handle different intents? |
|
|
77
|
-
| **HITL Requirements** | ✓/✗ |
|
|
77
|
+
| **HITL Requirements** | ✓/✗ | DEFAULT: No approval (auto-proceed). Only add if explicitly requested. |
|
|
78
78
|
| **Fallback Handling** | ✓/✗ | What if no match? |
|
|
79
79
|
|
|
80
|
+
#### HITL Policy (Default: Auto-Proceed)
|
|
81
|
+
For external side-effect actions (send_email, create_ticket, update_record):
|
|
82
|
+
- **Default**: Proceed WITHOUT approval gate unless explicitly requested
|
|
83
|
+
- **Add HITL only when**: User says "confirm before", "approval required", "human review"
|
|
84
|
+
- **Skip HITL when**: User says "auto", "directly", "no approval", or specifies direct flow
|
|
85
|
+
- **If ambiguous**: ASK "Should [action] require approval, or auto-proceed?"
|
|
86
|
+
|
|
80
87
|
#### For BROWNFIELD (extend existing):
|
|
81
88
|
| Dimension | Status | Missing Info |
|
|
82
89
|
|-----------|--------|--------------|
|
|
@@ -251,7 +258,7 @@ Verify you have answers for:
|
|
|
251
258
|
- Intents: ${args.intents || "(to be determined)"}
|
|
252
259
|
- Data Sources: (ask if not clear from use case)
|
|
253
260
|
- Actions: (ask if not clear from use case)
|
|
254
|
-
- Approvals/HITL: (ask if
|
|
261
|
+
- Approvals/HITL: DEFAULT is no approval (auto-proceed). Only ask if user seems to want approval gates.
|
|
255
262
|
|
|
256
263
|
### Step 2: Select Pattern + Agents
|
|
257
264
|
Call \`action(suggest="${args.use_case}")\` to get recommended agents and a suggested workflow pattern.
|
|
@@ -1073,6 +1080,8 @@ Where \`<requirements>\` includes:
|
|
|
1073
1080
|
${args.intents ? `- Intents: ${args.intents}` : ""}
|
|
1074
1081
|
${args.tools ? `- Tools: ${args.tools}` : ""}
|
|
1075
1082
|
|
|
1083
|
+
**HITL Policy**: DEFAULT is no approval gates. Only add HITL if user explicitly requests approval/confirmation before external actions.
|
|
1084
|
+
|
|
1076
1085
|
If the tool returns \`status="needs_input"\`, ask the missing questions, then call \`workflow(...)\` again with the additional details.
|
|
1077
1086
|
|
|
1078
1087
|
### Step 2: (Optional) Validate the generated workflow
|