@xuda.io/ai_module 1.1.5167 → 1.1.5169
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/index.mjs +8 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -4171,6 +4171,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4171
4171
|
|
|
4172
4172
|
conversation_doc.stat = 2;
|
|
4173
4173
|
conversation_doc.ts = Date.now();
|
|
4174
|
+
conversation_doc.ai_agents = ai_agents;
|
|
4174
4175
|
await db_module.save_app_couch_doc_native(account_profile_info.app_id, conversation_doc);
|
|
4175
4176
|
|
|
4176
4177
|
await update_job('analyzing request');
|
|
@@ -4280,6 +4281,8 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4280
4281
|
ai_agents.push(reference_id);
|
|
4281
4282
|
}
|
|
4282
4283
|
|
|
4284
|
+
let eligible_agent = true;
|
|
4285
|
+
|
|
4283
4286
|
for (const agent_id of ai_agents) {
|
|
4284
4287
|
try {
|
|
4285
4288
|
let ai_agent_doc;
|
|
@@ -4321,6 +4324,11 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4321
4324
|
}
|
|
4322
4325
|
|
|
4323
4326
|
case 'mcp': {
|
|
4327
|
+
if (reference_type !== 'ai_agents') {
|
|
4328
|
+
eligible_agent = false;
|
|
4329
|
+
break;
|
|
4330
|
+
}
|
|
4331
|
+
|
|
4324
4332
|
tools.push(
|
|
4325
4333
|
hostedMcpTool({
|
|
4326
4334
|
serverLabel: 'mcp_' + (val?.name?.replaceAll(' ', '_') || key), //ai_agent_doc.properties.menuName,
|
|
@@ -4621,7 +4629,6 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
4621
4629
|
});
|
|
4622
4630
|
|
|
4623
4631
|
init_agent_hooks(agent);
|
|
4624
|
-
|
|
4625
4632
|
list.push(agent);
|
|
4626
4633
|
} catch (err) {
|
|
4627
4634
|
console.error(err.message);
|