metheus-governance-mcp-cli 0.2.219 → 0.2.220
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 +34 -0
- package/lib/runner-orchestration.mjs +10 -16
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -8288,6 +8288,23 @@ async function processRunnerRouteOnce(route, runtime, mode, options = {}) {
|
|
|
8288
8288
|
executionPlan,
|
|
8289
8289
|
deps: routingExecutionDeps,
|
|
8290
8290
|
});
|
|
8291
|
+
if (safeObject(sharedHumanIntentContext).contractNeedsResolution === true) {
|
|
8292
|
+
const reason = "human intent contract is incomplete and requires regeneration";
|
|
8293
|
+
saveRunnerRouteState(
|
|
8294
|
+
routeKey,
|
|
8295
|
+
buildRunnerRouteStateFromComment(selectedRecord, {
|
|
8296
|
+
last_action: "needs_contract",
|
|
8297
|
+
last_reason: reason,
|
|
8298
|
+
last_trigger: "human_intent_contract",
|
|
8299
|
+
}),
|
|
8300
|
+
);
|
|
8301
|
+
skippedRecords.push({
|
|
8302
|
+
id: selectedRecord.id,
|
|
8303
|
+
reason,
|
|
8304
|
+
messageID: intFromRawAllowZero(selectedRecord?.parsedArchive?.messageID, 0),
|
|
8305
|
+
});
|
|
8306
|
+
continue;
|
|
8307
|
+
}
|
|
8291
8308
|
const precomputedAdjudication = buildRunnerResponderAdjudicationFromHumanIntent({
|
|
8292
8309
|
selectedRecord,
|
|
8293
8310
|
normalizedRoute,
|
|
@@ -8548,6 +8565,23 @@ async function processRunnerRouteOnce(route, runtime, mode, options = {}) {
|
|
|
8548
8565
|
executionPlan,
|
|
8549
8566
|
deps: routingExecutionDeps,
|
|
8550
8567
|
});
|
|
8568
|
+
if (safeObject(sharedHumanIntentContext).contractNeedsResolution === true) {
|
|
8569
|
+
const reason = "human intent contract is incomplete and requires regeneration";
|
|
8570
|
+
saveRunnerRouteState(
|
|
8571
|
+
routeKey,
|
|
8572
|
+
buildRunnerRouteStateFromComment(selectedRecord, {
|
|
8573
|
+
last_action: "needs_contract",
|
|
8574
|
+
last_reason: reason,
|
|
8575
|
+
last_trigger: "human_intent_contract",
|
|
8576
|
+
}),
|
|
8577
|
+
);
|
|
8578
|
+
skippedRecords.push({
|
|
8579
|
+
id: selectedRecord.id,
|
|
8580
|
+
reason,
|
|
8581
|
+
messageID: intFromRawAllowZero(selectedRecord?.parsedArchive?.messageID, 0),
|
|
8582
|
+
});
|
|
8583
|
+
continue;
|
|
8584
|
+
}
|
|
8551
8585
|
const precomputedInlineAdjudication = buildRunnerResponderAdjudicationFromHumanIntent({
|
|
8552
8586
|
selectedRecord,
|
|
8553
8587
|
normalizedRoute,
|
|
@@ -1310,6 +1310,7 @@ function buildDirectHumanResponseContract({
|
|
|
1310
1310
|
conversationContext,
|
|
1311
1311
|
currentBotSelector,
|
|
1312
1312
|
}) {
|
|
1313
|
+
void currentBotSelector;
|
|
1313
1314
|
const humanIntent = safeObject(humanIntentContext?.humanIntent);
|
|
1314
1315
|
const conversation = safeObject(conversationContext);
|
|
1315
1316
|
const preferConversationContract = Boolean(
|
|
@@ -1320,8 +1321,7 @@ function buildDirectHumanResponseContract({
|
|
|
1320
1321
|
|| String(conversation.summaryBotUsername || "").trim()
|
|
1321
1322
|
|| String(conversation.replyExpectation || "").trim(),
|
|
1322
1323
|
);
|
|
1323
|
-
const source = preferConversationContract ? conversation : humanIntent;
|
|
1324
|
-
const secondary = preferConversationContract ? humanIntent : conversation;
|
|
1324
|
+
const source = safeObject(preferConversationContract ? conversation : humanIntent);
|
|
1325
1325
|
const normalizedAllowedResponderSelectors = uniqueOrdered(
|
|
1326
1326
|
ensureArray(source.allowedResponderSelectors)
|
|
1327
1327
|
.map((item) => normalizeMentionSelector(item))
|
|
@@ -1332,35 +1332,29 @@ function buildDirectHumanResponseContract({
|
|
|
1332
1332
|
.map((item) => normalizeMentionSelector(item))
|
|
1333
1333
|
.filter(Boolean),
|
|
1334
1334
|
);
|
|
1335
|
-
const intentMode = String(source.intentMode ||
|
|
1336
|
-
const allowBotToBot = source.allowBotToBot === true
|
|
1337
|
-
|| (source.allowBotToBot !== false && secondary.allowBotToBot === true);
|
|
1335
|
+
const intentMode = String(source.intentMode || "").trim();
|
|
1336
|
+
const allowBotToBot = source.allowBotToBot === true;
|
|
1338
1337
|
const leadBotSelector = normalizeMentionSelector(
|
|
1339
|
-
source.leadBotUsername || source.leadBotSelector
|
|
1338
|
+
source.leadBotUsername || source.leadBotSelector,
|
|
1340
1339
|
);
|
|
1341
1340
|
const summaryBotSelector = normalizeMentionSelector(
|
|
1342
|
-
source.summaryBotUsername || source.summaryBotSelector
|
|
1341
|
+
source.summaryBotUsername || source.summaryBotSelector,
|
|
1343
1342
|
);
|
|
1344
1343
|
const replyExpectation = normalizeReplyExpectation(
|
|
1345
|
-
source.replyExpectation
|
|
1344
|
+
source.replyExpectation,
|
|
1346
1345
|
"",
|
|
1347
1346
|
);
|
|
1348
1347
|
const intentType = normalizeHumanIntentType(
|
|
1349
|
-
source.intentType
|
|
1348
|
+
source.intentType,
|
|
1350
1349
|
"",
|
|
1351
1350
|
);
|
|
1352
1351
|
const allowedContractTypes = uniqueOrdered(
|
|
1353
|
-
ensureArray(source.allowedContractTypes
|
|
1352
|
+
ensureArray(source.allowedContractTypes)
|
|
1354
1353
|
.map((item) => String(item || "").trim().toLowerCase())
|
|
1355
1354
|
.filter(Boolean),
|
|
1356
1355
|
);
|
|
1357
1356
|
const requiresActionableContract = source.requiresActionableContract === true
|
|
1358
|
-
|| source.require_actionable_contract === true
|
|
1359
|
-
|| (
|
|
1360
|
-
source.requiresActionableContract !== false
|
|
1361
|
-
&& source.require_actionable_contract !== false
|
|
1362
|
-
&& (secondary.requiresActionableContract === true || secondary.require_actionable_contract === true)
|
|
1363
|
-
);
|
|
1357
|
+
|| source.require_actionable_contract === true;
|
|
1364
1358
|
return {
|
|
1365
1359
|
intentMode,
|
|
1366
1360
|
allowBotToBot,
|