@xuda.io/ai_module 1.1.4921 → 1.1.4923

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 (3) hide show
  1. package/index.mjs +10 -26
  2. package/index_ms.mjs +2 -2
  3. package/package.json +1 -1
package/index.mjs CHANGED
@@ -5970,19 +5970,11 @@ export const pin_ai_agent = async function (req, job_id, headers) {
5970
5970
 
5971
5971
  const save_ret = await db_module.save_app_couch_doc(app_id, ai_agent_doc);
5972
5972
 
5973
- global[`_ai_module_ch`].sendToQueue(
5974
- 'ws_dashboard_module',
5975
- Buffer.from(
5976
- JSON.stringify({
5977
- method: 'emit_message_to_dashboard',
5978
- data: {
5979
- service: 'ai_agent_pinned',
5980
- to: [uid],
5981
- data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
5982
- },
5983
- }),
5984
- ),
5985
- );
5973
+ ws_dashboard_ms.emit_message_to_dashboard({
5974
+ service: 'ai_agent_pinned',
5975
+ to: [uid],
5976
+ data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
5977
+ });
5986
5978
  return save_ret;
5987
5979
  } catch (err) {
5988
5980
  return {
@@ -6002,19 +5994,11 @@ export const unpin_ai_agent = async function (req, job_id, headers) {
6002
5994
 
6003
5995
  const save_ret = await db_module.save_app_couch_doc(app_id, ai_agent_doc);
6004
5996
 
6005
- global[`_ai_module_ch`].sendToQueue(
6006
- 'ws_dashboard_module',
6007
- Buffer.from(
6008
- JSON.stringify({
6009
- method: 'emit_message_to_dashboard',
6010
- data: {
6011
- service: 'ai_agent_unpinned',
6012
- to: [uid],
6013
- data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
6014
- },
6015
- }),
6016
- ),
6017
- );
5997
+ ws_dashboard_ms.emit_message_to_dashboard({
5998
+ service: 'ai_agent_unpinned',
5999
+ to: [uid],
6000
+ data: await get_ai_agent_info(uid, job_id, headers, ai_agent_doc),
6001
+ });
6018
6002
 
6019
6003
  return save_ret;
6020
6004
  } catch (err) {
package/index_ms.mjs CHANGED
@@ -46,7 +46,7 @@ const send_to_queue =async function(ms_method, ...args) {
46
46
  const timeout = setTimeout(() => {
47
47
  delete queue[queue_id];
48
48
  reject(new Error(`Queue timeout for ${ms_method}`));
49
- }, 30000); // 30 second timeout
49
+ }, 300000); // 300 second timeout
50
50
 
51
51
  // Wrap resolve to clean up
52
52
  queue[queue_id].resolve = (value) => {
@@ -74,7 +74,7 @@ const send_to_queue =async function(ms_method, ...args) {
74
74
  })
75
75
  )
76
76
  );
77
-
77
+
78
78
  }catch(err){
79
79
  debugger
80
80
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4921",
3
+ "version": "1.1.4923",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",