metheus-governance-mcp-cli 0.2.203 → 0.2.204
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.
|
@@ -973,9 +973,8 @@ function buildHumanIntentFromPersistedRunnerRequest({
|
|
|
973
973
|
const allowedResponderSelectors = normalizeManagedSelectors(persistedRequest.conversation_allowed_responders);
|
|
974
974
|
const leadBotSelector = normalizeMentionSelector(persistedRequest.conversation_lead_bot);
|
|
975
975
|
const summaryBotSelector = normalizeMentionSelector(persistedRequest.conversation_summary_bot);
|
|
976
|
-
const
|
|
976
|
+
const hasConversationContract = Boolean(
|
|
977
977
|
intentMode
|
|
978
|
-
|| intentType
|
|
979
978
|
|| replyExpectation
|
|
980
979
|
|| participantSelectors.length
|
|
981
980
|
|| initialResponderSelectors.length
|
|
@@ -983,7 +982,13 @@ function buildHumanIntentFromPersistedRunnerRequest({
|
|
|
983
982
|
|| leadBotSelector
|
|
984
983
|
|| summaryBotSelector,
|
|
985
984
|
);
|
|
986
|
-
|
|
985
|
+
const hasExecutionContract = Boolean(
|
|
986
|
+
String(persistedRequest.execution_contract_type || "").trim()
|
|
987
|
+
|| persistedRequest.execution_contract_actionable === true
|
|
988
|
+
|| ensureArray(persistedRequest.execution_contract_targets).length
|
|
989
|
+
|| ensureArray(persistedRequest.next_expected_responders).length,
|
|
990
|
+
);
|
|
991
|
+
if (!hasConversationContract && !hasExecutionContract) {
|
|
987
992
|
return null;
|
|
988
993
|
}
|
|
989
994
|
return {
|
|
@@ -3074,6 +3074,142 @@ export async function runSelftestRunnerScenarios(push, deps) {
|
|
|
3074
3074
|
push("public_multi_bot_persisted_human_intent_skips_reanalysis", false, String(err?.message || err));
|
|
3075
3075
|
}
|
|
3076
3076
|
|
|
3077
|
+
try {
|
|
3078
|
+
let humanIntentCalls = 0;
|
|
3079
|
+
const processed = await processRunnerSelectedRecord({
|
|
3080
|
+
routeKey: "public-persisted-intent-only-key",
|
|
3081
|
+
normalizedRoute: normalizeRunnerRoute({
|
|
3082
|
+
name: "telegram-monitor-public-persisted-intent-only",
|
|
3083
|
+
project_id: selftestProjectID,
|
|
3084
|
+
provider: "telegram",
|
|
3085
|
+
role: "monitor",
|
|
3086
|
+
role_profile: "monitor",
|
|
3087
|
+
destination_id: "dest-1",
|
|
3088
|
+
destination_label: "Main Room",
|
|
3089
|
+
server_bot_name: "RyoAI_bot",
|
|
3090
|
+
server_bot_id: "bot-lead-1",
|
|
3091
|
+
trigger_policy: {
|
|
3092
|
+
mentions_only: true,
|
|
3093
|
+
direct_messages: true,
|
|
3094
|
+
reply_to_bot_messages: true,
|
|
3095
|
+
},
|
|
3096
|
+
archive_policy: {
|
|
3097
|
+
mirror_replies: true,
|
|
3098
|
+
dedupe_inbound: true,
|
|
3099
|
+
dedupe_outbound: true,
|
|
3100
|
+
skip_bot_messages: true,
|
|
3101
|
+
},
|
|
3102
|
+
dry_run_delivery: true,
|
|
3103
|
+
}),
|
|
3104
|
+
selectedRecord: {
|
|
3105
|
+
id: "comment-public-persisted-intent-only",
|
|
3106
|
+
createdAt: "2026-03-16T00:07:00.000Z",
|
|
3107
|
+
parsedArchive: {
|
|
3108
|
+
kind: "telegram_message",
|
|
3109
|
+
chatID: "-100123",
|
|
3110
|
+
chatType: "supergroup",
|
|
3111
|
+
senderIsBot: false,
|
|
3112
|
+
body: "@RyoAI_bot @RyoAI2_bot @RyoAI3_bot continue the discussion.",
|
|
3113
|
+
mentionUsernames: ["RyoAI_bot", "RyoAI2_bot", "RyoAI3_bot"],
|
|
3114
|
+
messageID: 1192,
|
|
3115
|
+
},
|
|
3116
|
+
},
|
|
3117
|
+
pendingOrdered: [],
|
|
3118
|
+
bot: {
|
|
3119
|
+
id: "bot-lead-1",
|
|
3120
|
+
name: "RyoAI_bot",
|
|
3121
|
+
username: "RyoAI_bot",
|
|
3122
|
+
role: "monitor",
|
|
3123
|
+
provider: "telegram",
|
|
3124
|
+
},
|
|
3125
|
+
destination: {
|
|
3126
|
+
id: "dest-1",
|
|
3127
|
+
label: "Main Room",
|
|
3128
|
+
provider: "telegram",
|
|
3129
|
+
chatID: "-100123",
|
|
3130
|
+
},
|
|
3131
|
+
archiveThread: {
|
|
3132
|
+
threadID: "thread-1",
|
|
3133
|
+
workItemID: "work-item-1",
|
|
3134
|
+
},
|
|
3135
|
+
executionPlan: {
|
|
3136
|
+
mode: "role_profile",
|
|
3137
|
+
roleProfileName: "monitor",
|
|
3138
|
+
roleProfile: {
|
|
3139
|
+
client: "sample",
|
|
3140
|
+
model: "",
|
|
3141
|
+
permissionMode: "read_only",
|
|
3142
|
+
reasoningEffort: "low",
|
|
3143
|
+
},
|
|
3144
|
+
workspaceDir: path.join(os.tmpdir(), "metheus-runner-selftest-persisted-human-intent-only"),
|
|
3145
|
+
workspaceSource: "selftest",
|
|
3146
|
+
usedCommandFallback: false,
|
|
3147
|
+
},
|
|
3148
|
+
runtime: {
|
|
3149
|
+
baseURL: "https://example.test",
|
|
3150
|
+
token: "selftest-token",
|
|
3151
|
+
timeoutSeconds: 30,
|
|
3152
|
+
actor: { user_id: "user-1" },
|
|
3153
|
+
},
|
|
3154
|
+
responderAdjudication: {
|
|
3155
|
+
selected_bot_usernames: ["ryoai_bot"],
|
|
3156
|
+
},
|
|
3157
|
+
persistedHumanIntentRequest: {
|
|
3158
|
+
request_key: "persisted-request-1192",
|
|
3159
|
+
normalized_intent: "general_execution",
|
|
3160
|
+
},
|
|
3161
|
+
deps: {
|
|
3162
|
+
saveRunnerRouteState: () => {},
|
|
3163
|
+
startRunnerTypingHeartbeat: () => ({ async stop() {} }),
|
|
3164
|
+
runRunnerAIExecution: async () => ({
|
|
3165
|
+
skip: false,
|
|
3166
|
+
reply: "bot replied",
|
|
3167
|
+
replyToMessageID: 0,
|
|
3168
|
+
contract: {
|
|
3169
|
+
type: "direct_result",
|
|
3170
|
+
actionable: false,
|
|
3171
|
+
},
|
|
3172
|
+
}),
|
|
3173
|
+
performLocalBotDelivery: async () => ({
|
|
3174
|
+
delivery: { dryRun: true, body: {} },
|
|
3175
|
+
archive: {},
|
|
3176
|
+
}),
|
|
3177
|
+
serializeRunnerTriggerPolicy: (value) => value,
|
|
3178
|
+
serializeRunnerArchivePolicy: (value) => value,
|
|
3179
|
+
buildRunnerExecutionDeps: () => ({
|
|
3180
|
+
analyzeHumanConversationIntentWithAI: async () => {
|
|
3181
|
+
humanIntentCalls += 1;
|
|
3182
|
+
return {
|
|
3183
|
+
mode: "multi_bot_collab",
|
|
3184
|
+
lead_bot: "ryoai_bot",
|
|
3185
|
+
summary_bot: "ryoai_bot",
|
|
3186
|
+
participants: ["ryoai_bot", "ryoai2_bot", "ryoai3_bot"],
|
|
3187
|
+
initial_responders: ["ryoai_bot", "ryoai2_bot", "ryoai3_bot"],
|
|
3188
|
+
allowed_responders: ["ryoai_bot", "ryoai2_bot", "ryoai3_bot"],
|
|
3189
|
+
allow_bot_to_bot: true,
|
|
3190
|
+
reply_expectation: "informational",
|
|
3191
|
+
intent_type: "explanation_query",
|
|
3192
|
+
};
|
|
3193
|
+
},
|
|
3194
|
+
}),
|
|
3195
|
+
buildRunnerDeliveryDeps: () => ({}),
|
|
3196
|
+
buildRunnerRuntimeDeps: () => ({}),
|
|
3197
|
+
resolveConversationPeerBots: () => [
|
|
3198
|
+
{ id: "bot-lead-1", name: "RyoAI_bot" },
|
|
3199
|
+
{ id: "bot-peer-1", name: "RyoAI2_bot" },
|
|
3200
|
+
{ id: "bot-peer-2", name: "RyoAI3_bot" },
|
|
3201
|
+
],
|
|
3202
|
+
},
|
|
3203
|
+
});
|
|
3204
|
+
push(
|
|
3205
|
+
"public_multi_bot_persisted_intent_only_reanalyzes_human_message",
|
|
3206
|
+
processed.kind === "replied" && humanIntentCalls === 1,
|
|
3207
|
+
`kind=${String(processed.kind || "(none)")} human_intent_calls=${humanIntentCalls}`,
|
|
3208
|
+
);
|
|
3209
|
+
} catch (err) {
|
|
3210
|
+
push("public_multi_bot_persisted_intent_only_reanalyzes_human_message", false, String(err?.message || err));
|
|
3211
|
+
}
|
|
3212
|
+
|
|
3077
3213
|
try {
|
|
3078
3214
|
const deliveredTexts = [];
|
|
3079
3215
|
const deliveredConversation = [];
|