@xuda.io/ai_module 1.1.4030 → 1.1.4032

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.
Files changed (2) hide show
  1. package/index.mjs +16 -17
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -6266,6 +6266,19 @@ export const pin_ai_agent = async function (req) {
6266
6266
 
6267
6267
  const save_ret = await db_module.save_app_couch_doc(app_id, ai_agent_doc);
6268
6268
 
6269
+ global[`_ai_module_ch`].sendToQueue(
6270
+ 'ws_dashboard_module',
6271
+ Buffer.from(
6272
+ JSON.stringify({
6273
+ method: 'emit_message_to_dashboard',
6274
+ data: {
6275
+ service: 'ai_agent_pinned',
6276
+ to: [uid],
6277
+ data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
6278
+ },
6279
+ }),
6280
+ ),
6281
+ );
6269
6282
  return save_ret;
6270
6283
  } catch (err) {
6271
6284
  return {
@@ -6275,7 +6288,7 @@ export const pin_ai_agent = async function (req) {
6275
6288
  }
6276
6289
  };
6277
6290
 
6278
- export const unpin_ai_agent = async function (req) {
6291
+ export const unpin_ai_agent = async function (req, job_id, headers) {
6279
6292
  const { uid, agent_id } = req;
6280
6293
  try {
6281
6294
  const app_id = await account_module.get_account_default_project_id(uid);
@@ -6283,20 +6296,6 @@ export const unpin_ai_agent = async function (req) {
6283
6296
 
6284
6297
  ai_agent_doc.studio_meta.pinned = false;
6285
6298
 
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: agent_id,
6295
- },
6296
- }),
6297
- ),
6298
- );
6299
-
6300
6299
  const save_ret = await db_module.save_app_couch_doc(app_id, ai_agent_doc);
6301
6300
 
6302
6301
  global[`_ai_module_ch`].sendToQueue(
@@ -6305,9 +6304,9 @@ export const unpin_ai_agent = async function (req) {
6305
6304
  JSON.stringify({
6306
6305
  method: 'emit_message_to_dashboard',
6307
6306
  data: {
6308
- service: 'ai_agent_pinned',
6307
+ service: 'ai_agent_unpinned',
6309
6308
  to: [uid],
6310
- data: agent_id,
6309
+ data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
6311
6310
  },
6312
6311
  }),
6313
6312
  ),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4030",
3
+ "version": "1.1.4032",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",