agent-swarm-kit 1.0.192 → 1.0.193
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 +3 -2
- package/build/index.mjs +3 -2
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -16638,8 +16638,6 @@ const METHOD_NAME_CREATE = "RoundRobin.create";
|
|
|
16638
16638
|
class RoundRobin {
|
|
16639
16639
|
constructor(tokens, factory) {
|
|
16640
16640
|
this.currentIndex = 0;
|
|
16641
|
-
if (!tokens.length)
|
|
16642
|
-
throw new Error("RoundRobin requires non-empty tokens array");
|
|
16643
16641
|
this.tokens = tokens;
|
|
16644
16642
|
this.instances = new Map(tokens.map((token) => [token, factory(token)]));
|
|
16645
16643
|
}
|
|
@@ -16661,6 +16659,9 @@ class RoundRobin {
|
|
|
16661
16659
|
currentIndex: this.currentIndex,
|
|
16662
16660
|
tokenCount: this.tokens.length,
|
|
16663
16661
|
});
|
|
16662
|
+
if (!this.tokens.length) {
|
|
16663
|
+
throw new Error("agent-swarm RoundRobin requires non-empty tokens array");
|
|
16664
|
+
}
|
|
16664
16665
|
const token = this.tokens[this.currentIndex];
|
|
16665
16666
|
const instance = this.instances.get(token);
|
|
16666
16667
|
const value = instance(...args);
|
package/build/index.mjs
CHANGED
|
@@ -16636,8 +16636,6 @@ const METHOD_NAME_CREATE = "RoundRobin.create";
|
|
|
16636
16636
|
class RoundRobin {
|
|
16637
16637
|
constructor(tokens, factory) {
|
|
16638
16638
|
this.currentIndex = 0;
|
|
16639
|
-
if (!tokens.length)
|
|
16640
|
-
throw new Error("RoundRobin requires non-empty tokens array");
|
|
16641
16639
|
this.tokens = tokens;
|
|
16642
16640
|
this.instances = new Map(tokens.map((token) => [token, factory(token)]));
|
|
16643
16641
|
}
|
|
@@ -16659,6 +16657,9 @@ class RoundRobin {
|
|
|
16659
16657
|
currentIndex: this.currentIndex,
|
|
16660
16658
|
tokenCount: this.tokens.length,
|
|
16661
16659
|
});
|
|
16660
|
+
if (!this.tokens.length) {
|
|
16661
|
+
throw new Error("agent-swarm RoundRobin requires non-empty tokens array");
|
|
16662
|
+
}
|
|
16662
16663
|
const token = this.tokens[this.currentIndex];
|
|
16663
16664
|
const instance = this.instances.get(token);
|
|
16664
16665
|
const value = instance(...args);
|