agent-swarm-kit 1.2.3 → 1.2.5
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 +28 -16
- package/build/index.mjs +28 -16
- package/package.json +3 -3
package/build/index.cjs
CHANGED
|
@@ -719,9 +719,13 @@ class PersistBase {
|
|
|
719
719
|
* @throws {Error} If reading the directory fails (e.g., permissions or directory not found).
|
|
720
720
|
*/
|
|
721
721
|
async getCount() {
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
722
|
+
let count = 0;
|
|
723
|
+
for await (const entry of await fs.opendir(this._directory)) {
|
|
724
|
+
if (entry.isFile() && entry.name.endsWith(".json")) {
|
|
725
|
+
count++;
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return count;
|
|
725
729
|
}
|
|
726
730
|
/**
|
|
727
731
|
* Reads an entity from storage by its ID, parsing it from a JSON file.
|
|
@@ -824,9 +828,13 @@ class PersistBase {
|
|
|
824
828
|
entityName: this.entityName,
|
|
825
829
|
});
|
|
826
830
|
try {
|
|
827
|
-
const
|
|
828
|
-
const
|
|
829
|
-
|
|
831
|
+
const filesToRemove = [];
|
|
832
|
+
for await (const entry of await fs.opendir(this._directory)) {
|
|
833
|
+
if (entry.isFile() && entry.name.endsWith(".json")) {
|
|
834
|
+
filesToRemove.push(entry.name);
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
for (const file of filesToRemove) {
|
|
830
838
|
await fs.unlink(path.join(this._directory, file));
|
|
831
839
|
}
|
|
832
840
|
}
|
|
@@ -846,11 +854,13 @@ class PersistBase {
|
|
|
846
854
|
entityName: this.entityName,
|
|
847
855
|
});
|
|
848
856
|
try {
|
|
849
|
-
const
|
|
850
|
-
const
|
|
851
|
-
.
|
|
852
|
-
|
|
853
|
-
|
|
857
|
+
const entityIds = [];
|
|
858
|
+
for await (const entry of await fs.opendir(this._directory)) {
|
|
859
|
+
if (entry.isFile() && entry.name.endsWith(".json")) {
|
|
860
|
+
entityIds.push(entry.name.slice(0, -5));
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
entityIds.sort((a, b) => a.localeCompare(b, undefined, {
|
|
854
864
|
numeric: true,
|
|
855
865
|
sensitivity: "base",
|
|
856
866
|
}));
|
|
@@ -874,11 +884,13 @@ class PersistBase {
|
|
|
874
884
|
entityName: this.entityName,
|
|
875
885
|
});
|
|
876
886
|
try {
|
|
877
|
-
const
|
|
878
|
-
const
|
|
879
|
-
.
|
|
880
|
-
|
|
881
|
-
|
|
887
|
+
const entityIds = [];
|
|
888
|
+
for await (const entry of await fs.opendir(this._directory)) {
|
|
889
|
+
if (entry.isFile() && entry.name.endsWith(".json")) {
|
|
890
|
+
entityIds.push(entry.name.slice(0, -5));
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
entityIds.sort((a, b) => a.localeCompare(b, undefined, {
|
|
882
894
|
numeric: true,
|
|
883
895
|
sensitivity: "base",
|
|
884
896
|
}));
|
package/build/index.mjs
CHANGED
|
@@ -699,9 +699,13 @@ class PersistBase {
|
|
|
699
699
|
* @throws {Error} If reading the directory fails (e.g., permissions or directory not found).
|
|
700
700
|
*/
|
|
701
701
|
async getCount() {
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
702
|
+
let count = 0;
|
|
703
|
+
for await (const entry of await fs__default.opendir(this._directory)) {
|
|
704
|
+
if (entry.isFile() && entry.name.endsWith(".json")) {
|
|
705
|
+
count++;
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
return count;
|
|
705
709
|
}
|
|
706
710
|
/**
|
|
707
711
|
* Reads an entity from storage by its ID, parsing it from a JSON file.
|
|
@@ -804,9 +808,13 @@ class PersistBase {
|
|
|
804
808
|
entityName: this.entityName,
|
|
805
809
|
});
|
|
806
810
|
try {
|
|
807
|
-
const
|
|
808
|
-
const
|
|
809
|
-
|
|
811
|
+
const filesToRemove = [];
|
|
812
|
+
for await (const entry of await fs__default.opendir(this._directory)) {
|
|
813
|
+
if (entry.isFile() && entry.name.endsWith(".json")) {
|
|
814
|
+
filesToRemove.push(entry.name);
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
for (const file of filesToRemove) {
|
|
810
818
|
await fs__default.unlink(join(this._directory, file));
|
|
811
819
|
}
|
|
812
820
|
}
|
|
@@ -826,11 +834,13 @@ class PersistBase {
|
|
|
826
834
|
entityName: this.entityName,
|
|
827
835
|
});
|
|
828
836
|
try {
|
|
829
|
-
const
|
|
830
|
-
const
|
|
831
|
-
.
|
|
832
|
-
|
|
833
|
-
|
|
837
|
+
const entityIds = [];
|
|
838
|
+
for await (const entry of await fs__default.opendir(this._directory)) {
|
|
839
|
+
if (entry.isFile() && entry.name.endsWith(".json")) {
|
|
840
|
+
entityIds.push(entry.name.slice(0, -5));
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
entityIds.sort((a, b) => a.localeCompare(b, undefined, {
|
|
834
844
|
numeric: true,
|
|
835
845
|
sensitivity: "base",
|
|
836
846
|
}));
|
|
@@ -854,11 +864,13 @@ class PersistBase {
|
|
|
854
864
|
entityName: this.entityName,
|
|
855
865
|
});
|
|
856
866
|
try {
|
|
857
|
-
const
|
|
858
|
-
const
|
|
859
|
-
.
|
|
860
|
-
|
|
861
|
-
|
|
867
|
+
const entityIds = [];
|
|
868
|
+
for await (const entry of await fs__default.opendir(this._directory)) {
|
|
869
|
+
if (entry.isFile() && entry.name.endsWith(".json")) {
|
|
870
|
+
entityIds.push(entry.name.slice(0, -5));
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
entityIds.sort((a, b) => a.localeCompare(b, undefined, {
|
|
862
874
|
numeric: true,
|
|
863
875
|
sensitivity: "base",
|
|
864
876
|
}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agent-swarm-kit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.5",
|
|
4
4
|
"description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Petr Tripolsky",
|
|
@@ -73,13 +73,13 @@
|
|
|
73
73
|
"tslib": "2.7.0",
|
|
74
74
|
"typedoc": "0.27.9",
|
|
75
75
|
"undici": "6.21.2",
|
|
76
|
-
"worker-testbed": "1.0.
|
|
76
|
+
"worker-testbed": "1.0.12"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"typescript": "^5.0.0"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"di-kit": "^1.
|
|
82
|
+
"di-kit": "^1.1.1",
|
|
83
83
|
"di-scoped": "^1.0.21",
|
|
84
84
|
"functools-kit": "^1.0.95",
|
|
85
85
|
"get-moment-stamp": "^1.1.1",
|