@xuda.io/ai_module 1.1.4994 → 1.1.4996
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 -4
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -67,7 +67,8 @@ const drive_ms = await import(`${module_path}/drive_module/index_ms.mjs`);
|
|
|
67
67
|
const jobs_ms = await import(`${module_path}/jobs_module/index_ms.mjs`);
|
|
68
68
|
const team_ms = await import(`${module_path}/team_module/index_ms.mjs`);
|
|
69
69
|
const email_ms = await import(`${module_path}/email_module/index_ms.mjs`);
|
|
70
|
-
|
|
70
|
+
|
|
71
|
+
const ws_dashboard_msa = await import(`${module_path}/ws_dashboard_module/index_msa.mjs`);
|
|
71
72
|
|
|
72
73
|
var open_ai_status = {};
|
|
73
74
|
const report_ai_status = function (model, err) {
|
|
@@ -1336,6 +1337,9 @@ export const get_ai_chats = async function (req, job_id, headers) {
|
|
|
1336
1337
|
};
|
|
1337
1338
|
const conversation_item_ret = await db_module.find_app_couch_query(account_profile_info.app_id, opt);
|
|
1338
1339
|
doc.conversation_item = conversation_item_ret?.docs?.[0];
|
|
1340
|
+
if (doc?.conversation_item?.email_id) {
|
|
1341
|
+
doc.email_doc = await db_module.get_app_couch_doc_native(account_profile_info.app_id, doc.conversation_item.email_id);
|
|
1342
|
+
}
|
|
1339
1343
|
// doc.notifications = 0;
|
|
1340
1344
|
// doc.interactions = doc?.messages?.length || 0;
|
|
1341
1345
|
// for (let msg of doc.messages) {
|
|
@@ -3980,7 +3984,7 @@ const ai_chat_conversation = async function (req, job_id, headers) {
|
|
|
3980
3984
|
// const { account_profile_info } = conversation_doc;
|
|
3981
3985
|
const emitToDashboard = (type, content) => {
|
|
3982
3986
|
// console.log(type, content);
|
|
3983
|
-
|
|
3987
|
+
ws_dashboard_msa.emit_message_to_dashboard({
|
|
3984
3988
|
service: type,
|
|
3985
3989
|
to: uid,
|
|
3986
3990
|
data: {
|
|
@@ -6013,7 +6017,7 @@ export const pin_ai_agent = async function (req, job_id, headers) {
|
|
|
6013
6017
|
|
|
6014
6018
|
const save_ret = await db_module.save_app_couch_doc(app_id, ai_agent_doc);
|
|
6015
6019
|
|
|
6016
|
-
|
|
6020
|
+
ws_dashboard_msa.emit_message_to_dashboard({
|
|
6017
6021
|
service: 'ai_agent_pinned',
|
|
6018
6022
|
to: [uid],
|
|
6019
6023
|
data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
|
|
@@ -6037,7 +6041,7 @@ export const unpin_ai_agent = async function (req, job_id, headers) {
|
|
|
6037
6041
|
|
|
6038
6042
|
const save_ret = await db_module.save_app_couch_doc(app_id, ai_agent_doc);
|
|
6039
6043
|
|
|
6040
|
-
|
|
6044
|
+
ws_dashboard_msa.emit_message_to_dashboard({
|
|
6041
6045
|
service: 'ai_agent_unpinned',
|
|
6042
6046
|
to: [uid],
|
|
6043
6047
|
data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
|