@xuda.io/ai_module 1.1.4029 → 1.1.4031
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 +29 -1
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -6275,7 +6275,7 @@ export const pin_ai_agent = async function (req) {
|
|
|
6275
6275
|
}
|
|
6276
6276
|
};
|
|
6277
6277
|
|
|
6278
|
-
export const unpin_ai_agent = async function (req) {
|
|
6278
|
+
export const unpin_ai_agent = async function (req, job_id, headers) {
|
|
6279
6279
|
const { uid, agent_id } = req;
|
|
6280
6280
|
try {
|
|
6281
6281
|
const app_id = await account_module.get_account_default_project_id(uid);
|
|
@@ -6283,8 +6283,36 @@ export const unpin_ai_agent = async function (req) {
|
|
|
6283
6283
|
|
|
6284
6284
|
ai_agent_doc.studio_meta.pinned = false;
|
|
6285
6285
|
|
|
6286
|
+
global[`_ai_module_ch`].sendToQueue(
|
|
6287
|
+
'ws_dashboard_module',
|
|
6288
|
+
Buffer.from(
|
|
6289
|
+
JSON.stringify({
|
|
6290
|
+
method: 'emit_message_to_dashboard',
|
|
6291
|
+
data: {
|
|
6292
|
+
service: 'ai_agent_unpinned',
|
|
6293
|
+
to: [uid],
|
|
6294
|
+
data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
|
|
6295
|
+
},
|
|
6296
|
+
}),
|
|
6297
|
+
),
|
|
6298
|
+
);
|
|
6299
|
+
|
|
6286
6300
|
const save_ret = await db_module.save_app_couch_doc(app_id, ai_agent_doc);
|
|
6287
6301
|
|
|
6302
|
+
global[`_ai_module_ch`].sendToQueue(
|
|
6303
|
+
'ws_dashboard_module',
|
|
6304
|
+
Buffer.from(
|
|
6305
|
+
JSON.stringify({
|
|
6306
|
+
method: 'emit_message_to_dashboard',
|
|
6307
|
+
data: {
|
|
6308
|
+
service: 'ai_agent_pinned',
|
|
6309
|
+
to: [uid],
|
|
6310
|
+
data: agent_id,
|
|
6311
|
+
},
|
|
6312
|
+
}),
|
|
6313
|
+
),
|
|
6314
|
+
);
|
|
6315
|
+
|
|
6288
6316
|
return save_ret;
|
|
6289
6317
|
} catch (err) {
|
|
6290
6318
|
return {
|