agent-swarm-kit 1.0.51 → 1.0.52
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/build/index.cjs +20 -5
- package/build/index.mjs +21 -6
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -3756,7 +3756,7 @@ var ClientStorage = /** @class */ (function () {
|
|
|
3756
3756
|
search: search,
|
|
3757
3757
|
total: total,
|
|
3758
3758
|
});
|
|
3759
|
-
indexed =
|
|
3759
|
+
indexed = [];
|
|
3760
3760
|
return [4 /*yield*/, this.params.createEmbedding(search)];
|
|
3761
3761
|
case 1:
|
|
3762
3762
|
searchEmbeddings = _a.sent();
|
|
@@ -3776,7 +3776,7 @@ var ClientStorage = /** @class */ (function () {
|
|
|
3776
3776
|
if (this.params.onCompare) {
|
|
3777
3777
|
this.params.onCompare(search, index, score, this.params.clientId, this.params.embedding);
|
|
3778
3778
|
}
|
|
3779
|
-
indexed.push({
|
|
3779
|
+
indexed.push({ data: item, score: score });
|
|
3780
3780
|
return [2 /*return*/];
|
|
3781
3781
|
}
|
|
3782
3782
|
});
|
|
@@ -3786,10 +3786,25 @@ var ClientStorage = /** @class */ (function () {
|
|
|
3786
3786
|
})))];
|
|
3787
3787
|
case 2:
|
|
3788
3788
|
_a.sent();
|
|
3789
|
-
filtered = indexed
|
|
3789
|
+
filtered = indexed
|
|
3790
|
+
.filter(function (_a) {
|
|
3791
|
+
var score = _a.score;
|
|
3792
|
+
return score > GLOBAL_CONFIG.CC_STORAGE_SEARCH_SIMILARITY;
|
|
3793
|
+
})
|
|
3794
|
+
.sort(function (_a, _b) {
|
|
3795
|
+
var a = _a.score;
|
|
3796
|
+
var b = _b.score;
|
|
3797
|
+
return b - a;
|
|
3798
|
+
});
|
|
3799
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " take filtered"), {
|
|
3800
|
+
filtered: filtered.map(function (_a) {
|
|
3801
|
+
var data = _a.data, score = _a.score;
|
|
3802
|
+
return ({ id: data.id, score: score });
|
|
3803
|
+
}),
|
|
3804
|
+
});
|
|
3790
3805
|
return [2 /*return*/, filtered.map(function (_a) {
|
|
3791
|
-
var
|
|
3792
|
-
return
|
|
3806
|
+
var data = _a.data;
|
|
3807
|
+
return data;
|
|
3793
3808
|
})];
|
|
3794
3809
|
}
|
|
3795
3810
|
});
|
package/build/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { scoped } from 'di-scoped';
|
|
2
|
-
import { ToolRegistry, trycatch, sleep, PubsubArrayAdapter, Subject, queued, not, randomString, memoize, createAwaiter, cancelable, CANCELED_PROMISE_SYMBOL, singleshot, execpool,
|
|
2
|
+
import { ToolRegistry, trycatch, sleep, PubsubArrayAdapter, Subject, queued, not, randomString, memoize, createAwaiter, cancelable, CANCELED_PROMISE_SYMBOL, singleshot, execpool, schedule, ttl, Source } from 'functools-kit';
|
|
3
3
|
import { createActivator } from 'di-kit';
|
|
4
4
|
import { omit } from 'lodash-es';
|
|
5
5
|
import xml2js from 'xml2js';
|
|
@@ -3754,7 +3754,7 @@ var ClientStorage = /** @class */ (function () {
|
|
|
3754
3754
|
search: search,
|
|
3755
3755
|
total: total,
|
|
3756
3756
|
});
|
|
3757
|
-
indexed =
|
|
3757
|
+
indexed = [];
|
|
3758
3758
|
return [4 /*yield*/, this.params.createEmbedding(search)];
|
|
3759
3759
|
case 1:
|
|
3760
3760
|
searchEmbeddings = _a.sent();
|
|
@@ -3774,7 +3774,7 @@ var ClientStorage = /** @class */ (function () {
|
|
|
3774
3774
|
if (this.params.onCompare) {
|
|
3775
3775
|
this.params.onCompare(search, index, score, this.params.clientId, this.params.embedding);
|
|
3776
3776
|
}
|
|
3777
|
-
indexed.push({
|
|
3777
|
+
indexed.push({ data: item, score: score });
|
|
3778
3778
|
return [2 /*return*/];
|
|
3779
3779
|
}
|
|
3780
3780
|
});
|
|
@@ -3784,10 +3784,25 @@ var ClientStorage = /** @class */ (function () {
|
|
|
3784
3784
|
})))];
|
|
3785
3785
|
case 2:
|
|
3786
3786
|
_a.sent();
|
|
3787
|
-
filtered = indexed
|
|
3787
|
+
filtered = indexed
|
|
3788
|
+
.filter(function (_a) {
|
|
3789
|
+
var score = _a.score;
|
|
3790
|
+
return score > GLOBAL_CONFIG.CC_STORAGE_SEARCH_SIMILARITY;
|
|
3791
|
+
})
|
|
3792
|
+
.sort(function (_a, _b) {
|
|
3793
|
+
var a = _a.score;
|
|
3794
|
+
var b = _b.score;
|
|
3795
|
+
return b - a;
|
|
3796
|
+
});
|
|
3797
|
+
this.params.logger.debug("ClientStorage storageName=".concat(this.params.storageName, " clientId=").concat(this.params.clientId, " take filtered"), {
|
|
3798
|
+
filtered: filtered.map(function (_a) {
|
|
3799
|
+
var data = _a.data, score = _a.score;
|
|
3800
|
+
return ({ id: data.id, score: score });
|
|
3801
|
+
}),
|
|
3802
|
+
});
|
|
3788
3803
|
return [2 /*return*/, filtered.map(function (_a) {
|
|
3789
|
-
var
|
|
3790
|
-
return
|
|
3804
|
+
var data = _a.data;
|
|
3805
|
+
return data;
|
|
3791
3806
|
})];
|
|
3792
3807
|
}
|
|
3793
3808
|
});
|