@credal/actions 0.2.151 → 0.2.152

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.
@@ -432,16 +432,35 @@ const searchSlack = (_a) => __awaiter(void 0, [_a], void 0, function* ({ params,
432
432
  else if (filteredTargetIds.length >= 2) {
433
433
  const searchMPIM = () => __awaiter(void 0, void 0, void 0, function* () {
434
434
  const mpimName = yield tryGetMPIMName(client, filteredTargetIds);
435
- return mpimName ? searchScoped({ client, scope: mpimName, topic, timeRange, limit }) : [];
435
+ return mpimName
436
+ ? searchScoped({ client, scope: mpimName, topic, timeRange, limit: Math.max(Math.floor(limit / 2), 1) })
437
+ : [];
436
438
  });
437
439
  searchPromises.push(searchMPIM());
438
- searchPromises.push(...filteredTargetIds.map(id => searchScoped({ client, scope: `<@${id}>`, topic, timeRange, limit })));
440
+ searchPromises.push(...filteredTargetIds.map(id => searchScoped({
441
+ client,
442
+ scope: `<@${id}>`,
443
+ topic,
444
+ timeRange,
445
+ limit: Math.max(Math.floor(limit / filteredTargetIds.length), 1),
446
+ })));
439
447
  }
440
448
  else if (channel) {
441
- searchPromises.push(searchScoped({ client, scope: normalizeChannelOperand(channel), topic, timeRange, limit }));
449
+ searchPromises.push(searchScoped({
450
+ client,
451
+ scope: normalizeChannelOperand(channel),
452
+ topic,
453
+ timeRange,
454
+ limit: Math.max(Math.floor(limit / 2), 1),
455
+ }));
442
456
  }
443
457
  if (topic) {
444
- searchPromises.push(searchByTopic({ client, topic, timeRange, limit }));
458
+ searchPromises.push(searchByTopic({
459
+ client,
460
+ topic,
461
+ timeRange,
462
+ limit: Math.max(Math.floor(limit / Math.max(searchPromises.length, 1)), 1),
463
+ }));
445
464
  }
446
465
  const searchResults = yield Promise.all(searchPromises);
447
466
  searchResults.forEach(matches => allMatches.push(...matches));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/actions",
3
- "version": "0.2.151",
3
+ "version": "0.2.152",
4
4
  "type": "module",
5
5
  "description": "AI Actions by Credal AI",
6
6
  "sideEffects": false,