@xuda.io/ai_module 1.1.4217 → 1.1.4219

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 +7 -5
  2. package/package.json +1 -1
package/index.mjs CHANGED
@@ -2393,8 +2393,8 @@ const get_user_ai_agents = async function (uid) {
2393
2393
  };
2394
2394
 
2395
2395
  export const get_ai_agents = async function (req, job_id, headers) {
2396
- let { uid, _id, search, filter_type = 'all', limit, skip, agent_id } = req;
2397
-
2396
+ let { uid, _id, search, filter_type = 'all', limit, skip, agent_id, profile_id } = req;
2397
+ const account_profile_info = await account_module.get_active_account_profile_info(uid, profile_id);
2398
2398
  try {
2399
2399
  if (_id) {
2400
2400
  let doc_ret = await get_studio_doc({ _id, uid });
@@ -2416,6 +2416,10 @@ export const get_ai_agents = async function (req, job_id, headers) {
2416
2416
  sort: [{ ts: 'desc' }],
2417
2417
  };
2418
2418
 
2419
+ if (!account_profile_info.is_main) {
2420
+ opt.selector.studio_meta.account_profiles = { $in: [account_profile_info.account_profile_id] };
2421
+ }
2422
+
2419
2423
  switch (filter_type) {
2420
2424
  case 'archived': {
2421
2425
  opt.selector.stat = 5;
@@ -2474,9 +2478,7 @@ export const get_ai_agents = async function (req, job_id, headers) {
2474
2478
  }
2475
2479
  //////////////
2476
2480
 
2477
- const account_profile_info = await account_module.get_active_account_profile_info(uid);
2478
-
2479
- const app_id = await account_module.get_account_default_project_id(uid);
2481
+ // const app_id = await account_module.get_account_default_project_id(uid);
2480
2482
 
2481
2483
  let user_agents = { docs: [], total_docs: 0 };
2482
2484
  if (filter_type !== 'pending') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/ai_module",
3
- "version": "1.1.4217",
3
+ "version": "1.1.4219",
4
4
  "description": "Xuda AI Module",
5
5
  "main": "index.mjs",
6
6
  "type": "module",