metheus-governance-mcp-cli 0.2.210 → 0.2.211
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/cli.mjs +18 -2
- package/lib/runner-orchestration.mjs +22 -2
- package/lib/runner-trigger.mjs +18 -1
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -3591,13 +3591,29 @@ function runnerRequestRequiresActionableContract(requestRaw) {
|
|
|
3591
3591
|
const request = safeObject(requestRaw);
|
|
3592
3592
|
const replyExpectation = String(request.conversation_reply_expectation || "").trim().toLowerCase();
|
|
3593
3593
|
const executionContractType = String(request.execution_contract_type || "").trim().toLowerCase();
|
|
3594
|
+
const intentMode = String(request.conversation_intent_mode || "").trim().toLowerCase();
|
|
3595
|
+
const intentType = String(
|
|
3596
|
+
request.conversation_intent_type
|
|
3597
|
+
|| request.intent_type
|
|
3598
|
+
|| request.normalized_intent
|
|
3599
|
+
|| "",
|
|
3600
|
+
).trim().toLowerCase();
|
|
3601
|
+
const hasExecutionIntent = [
|
|
3602
|
+
"general_execution",
|
|
3603
|
+
"ctxpack_mutation",
|
|
3604
|
+
"workitem_mutation",
|
|
3605
|
+
].includes(intentType);
|
|
3594
3606
|
if (request.execution_contract_actionable === true) {
|
|
3595
3607
|
return true;
|
|
3596
3608
|
}
|
|
3597
|
-
if (
|
|
3609
|
+
if (["delegation", "direct_result", "summary_request", "final_summary"].includes(executionContractType)) {
|
|
3598
3610
|
return true;
|
|
3599
3611
|
}
|
|
3600
|
-
if (
|
|
3612
|
+
if (
|
|
3613
|
+
intentMode === "single_bot"
|
|
3614
|
+
&& replyExpectation === "actionable"
|
|
3615
|
+
&& hasExecutionIntent
|
|
3616
|
+
) {
|
|
3601
3617
|
return true;
|
|
3602
3618
|
}
|
|
3603
3619
|
return false;
|
|
@@ -1294,7 +1294,6 @@ export async function resolveHumanIntentContext({
|
|
|
1294
1294
|
executionPlan,
|
|
1295
1295
|
contractGuardrail: {
|
|
1296
1296
|
require_complete_contract: true,
|
|
1297
|
-
require_explicit_actionable_intent: true,
|
|
1298
1297
|
reason: "Return a complete human intent contract for this managed-bot conversation.",
|
|
1299
1298
|
},
|
|
1300
1299
|
});
|
|
@@ -2584,6 +2583,11 @@ async function maybeExecuteDynamicRolePlan({
|
|
|
2584
2583
|
safeObject(directHumanResponseContract).intentType
|
|
2585
2584
|
|| safeObject(safeObject(humanIntentContext).humanIntent).intentType,
|
|
2586
2585
|
);
|
|
2586
|
+
const humanIntentMode = normalizeIntentMode(
|
|
2587
|
+
safeObject(directHumanResponseContract).intentMode
|
|
2588
|
+
|| safeObject(safeObject(humanIntentContext).humanIntent).intentMode,
|
|
2589
|
+
);
|
|
2590
|
+
const actionableConversationRequiresContract = safeObject(directHumanResponseContract).requiresActionableContract === true;
|
|
2587
2591
|
const plannerContextComments = ensureArray(contextWindow).length
|
|
2588
2592
|
? ensureArray(contextWindow)
|
|
2589
2593
|
: buildRunnerContextWindow(
|
|
@@ -2595,6 +2599,13 @@ async function maybeExecuteDynamicRolePlan({
|
|
|
2595
2599
|
if (!assignmentTasks.length && isInformationalHumanIntentType(humanIntentType)) {
|
|
2596
2600
|
return null;
|
|
2597
2601
|
}
|
|
2602
|
+
if (
|
|
2603
|
+
!assignmentTasks.length
|
|
2604
|
+
&& actionableConversationRequiresContract
|
|
2605
|
+
&& ["delegated_single_lead", "multi_bot_collab", "multi_bot_direct"].includes(humanIntentMode)
|
|
2606
|
+
) {
|
|
2607
|
+
return null;
|
|
2608
|
+
}
|
|
2598
2609
|
const executionIntentRequested = [
|
|
2599
2610
|
"general_execution",
|
|
2600
2611
|
"ctxpack_mutation",
|
|
@@ -5193,6 +5204,14 @@ export async function processRunnerSelectedRecord({
|
|
|
5193
5204
|
}
|
|
5194
5205
|
}
|
|
5195
5206
|
const normalizedExecutionContractType = String(executionContract?.type || "").trim().toLowerCase();
|
|
5207
|
+
const effectiveResolvedIntentType = normalizeHumanIntentType(
|
|
5208
|
+
directHumanResponseContract.intentType || resolvedIntentType,
|
|
5209
|
+
);
|
|
5210
|
+
const effectiveResolvedIntentMode = normalizeIntentMode(
|
|
5211
|
+
directHumanResponseContract.intentMode
|
|
5212
|
+
|| conversationContext?.intentMode
|
|
5213
|
+
|| safeObject(safeObject(humanIntentContext).humanIntent).intentMode,
|
|
5214
|
+
);
|
|
5196
5215
|
const shouldEnforceArtifactValidation = Boolean(
|
|
5197
5216
|
(artifactValidationOverride && Object.keys(artifactValidationOverride).length > 0)
|
|
5198
5217
|
|| ensureArray(aiResult?.artifacts).length > 0
|
|
@@ -5202,7 +5221,8 @@ export async function processRunnerSelectedRecord({
|
|
|
5202
5221
|
"general_execution",
|
|
5203
5222
|
"ctxpack_mutation",
|
|
5204
5223
|
"workitem_mutation",
|
|
5205
|
-
].includes(
|
|
5224
|
+
].includes(effectiveResolvedIntentType)
|
|
5225
|
+
&& !["delegated_single_lead", "multi_bot_collab", "multi_bot_direct"].includes(effectiveResolvedIntentMode)
|
|
5206
5226
|
);
|
|
5207
5227
|
const artifactValidation = shouldEnforceArtifactValidation
|
|
5208
5228
|
? artifactValidationOverride && Object.keys(artifactValidationOverride).length > 0
|
package/lib/runner-trigger.mjs
CHANGED
|
@@ -96,12 +96,29 @@ function buildRunnerTaskName(humanIntentType, humanIntentContract = null) {
|
|
|
96
96
|
const contract = safeObject(humanIntentContract);
|
|
97
97
|
const replyExpectation = String(contract.replyExpectation || contract.reply_expectation || "").trim().toLowerCase();
|
|
98
98
|
const executionContractType = String(contract.executionContractType || contract.execution_contract_type || "").trim().toLowerCase();
|
|
99
|
+
const intentMode = String(contract.intentMode || contract.intent_mode || "").trim().toLowerCase();
|
|
100
|
+
const executionIntentRequested = [
|
|
101
|
+
"general_execution",
|
|
102
|
+
"ctxpack_mutation",
|
|
103
|
+
"workitem_mutation",
|
|
104
|
+
].includes(normalizedIntentType);
|
|
105
|
+
const collaborativeIntentMode = [
|
|
106
|
+
"delegated_single_lead",
|
|
107
|
+
"multi_bot_collab",
|
|
108
|
+
"multi_bot_direct",
|
|
109
|
+
].includes(intentMode);
|
|
99
110
|
if (normalizedIntentType === "status_query") return "answer_project_status_query";
|
|
100
111
|
if (normalizedIntentType === "workspace_query") return "answer_project_workspace_query";
|
|
101
112
|
if (normalizedIntentType === "bot_role_query") return "answer_project_bot_role_query";
|
|
102
113
|
if (normalizedIntentType === "artifact_location_query") return "answer_project_artifact_location_query";
|
|
103
114
|
if (normalizedIntentType === "small_talk") return "reply_to_project_chat_greeting";
|
|
104
|
-
if (executionContractType
|
|
115
|
+
if (executionContractType) {
|
|
116
|
+
return "reply_to_project_actionable_message";
|
|
117
|
+
}
|
|
118
|
+
if (collaborativeIntentMode && replyExpectation === "actionable") {
|
|
119
|
+
return "reply_to_project_chat_message";
|
|
120
|
+
}
|
|
121
|
+
if (executionIntentRequested) {
|
|
105
122
|
return "reply_to_project_actionable_message";
|
|
106
123
|
}
|
|
107
124
|
return "reply_to_project_chat_message";
|