agent-swarm-kit 1.0.30 → 1.0.31
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 +21 -36
- package/build/index.mjs +21 -36
- package/package.json +1 -1
- package/types.d.ts +1 -1
package/build/index.cjs
CHANGED
|
@@ -1650,42 +1650,27 @@ var ClientSession = /** @class */ (function () {
|
|
|
1650
1650
|
* @param {boolean} [noEmit=false] - Whether to emit the output or not.
|
|
1651
1651
|
* @returns {Promise<string>} - The output of the execution.
|
|
1652
1652
|
*/
|
|
1653
|
-
this.execute = function (
|
|
1654
|
-
var
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
outputAwaiter = this.params.swarm.waitForOutput();
|
|
1673
|
-
agent.execute(message, mode);
|
|
1674
|
-
return [4 /*yield*/, outputAwaiter];
|
|
1675
|
-
case 2:
|
|
1676
|
-
output = _b.sent();
|
|
1677
|
-
_a = !noEmit;
|
|
1678
|
-
if (!_a) return [3 /*break*/, 4];
|
|
1679
|
-
return [4 /*yield*/, this._emitSubject.next(output)];
|
|
1680
|
-
case 3:
|
|
1681
|
-
_a = (_b.sent());
|
|
1682
|
-
_b.label = 4;
|
|
1683
|
-
case 4:
|
|
1684
|
-
return [2 /*return*/, output];
|
|
1685
|
-
}
|
|
1686
|
-
});
|
|
1653
|
+
this.execute = function (message, mode) { return __awaiter(_this, void 0, void 0, function () {
|
|
1654
|
+
var agent, outputAwaiter, output;
|
|
1655
|
+
return __generator(this, function (_a) {
|
|
1656
|
+
switch (_a.label) {
|
|
1657
|
+
case 0:
|
|
1658
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " execute"), {
|
|
1659
|
+
message: message,
|
|
1660
|
+
mode: mode,
|
|
1661
|
+
});
|
|
1662
|
+
return [4 /*yield*/, this.params.swarm.getAgent()];
|
|
1663
|
+
case 1:
|
|
1664
|
+
agent = _a.sent();
|
|
1665
|
+
outputAwaiter = this.params.swarm.waitForOutput();
|
|
1666
|
+
agent.execute(message, mode);
|
|
1667
|
+
return [4 /*yield*/, outputAwaiter];
|
|
1668
|
+
case 2:
|
|
1669
|
+
output = _a.sent();
|
|
1670
|
+
return [2 /*return*/, output];
|
|
1671
|
+
}
|
|
1687
1672
|
});
|
|
1688
|
-
};
|
|
1673
|
+
}); };
|
|
1689
1674
|
/**
|
|
1690
1675
|
* Commits tool output.
|
|
1691
1676
|
* @param {string} content - The content to commit.
|
|
@@ -1783,7 +1768,7 @@ var ClientSession = /** @class */ (function () {
|
|
|
1783
1768
|
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " connect call"));
|
|
1784
1769
|
_a = connector;
|
|
1785
1770
|
_b = {};
|
|
1786
|
-
return [4 /*yield*/, this.execute(incoming.data, "user"
|
|
1771
|
+
return [4 /*yield*/, this.execute(incoming.data, "user")];
|
|
1787
1772
|
case 1:
|
|
1788
1773
|
_b.data = _c.sent();
|
|
1789
1774
|
return [4 /*yield*/, this.params.swarm.getAgentName()];
|
package/build/index.mjs
CHANGED
|
@@ -1648,42 +1648,27 @@ var ClientSession = /** @class */ (function () {
|
|
|
1648
1648
|
* @param {boolean} [noEmit=false] - Whether to emit the output or not.
|
|
1649
1649
|
* @returns {Promise<string>} - The output of the execution.
|
|
1650
1650
|
*/
|
|
1651
|
-
this.execute = function (
|
|
1652
|
-
var
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
outputAwaiter = this.params.swarm.waitForOutput();
|
|
1671
|
-
agent.execute(message, mode);
|
|
1672
|
-
return [4 /*yield*/, outputAwaiter];
|
|
1673
|
-
case 2:
|
|
1674
|
-
output = _b.sent();
|
|
1675
|
-
_a = !noEmit;
|
|
1676
|
-
if (!_a) return [3 /*break*/, 4];
|
|
1677
|
-
return [4 /*yield*/, this._emitSubject.next(output)];
|
|
1678
|
-
case 3:
|
|
1679
|
-
_a = (_b.sent());
|
|
1680
|
-
_b.label = 4;
|
|
1681
|
-
case 4:
|
|
1682
|
-
return [2 /*return*/, output];
|
|
1683
|
-
}
|
|
1684
|
-
});
|
|
1651
|
+
this.execute = function (message, mode) { return __awaiter(_this, void 0, void 0, function () {
|
|
1652
|
+
var agent, outputAwaiter, output;
|
|
1653
|
+
return __generator(this, function (_a) {
|
|
1654
|
+
switch (_a.label) {
|
|
1655
|
+
case 0:
|
|
1656
|
+
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " execute"), {
|
|
1657
|
+
message: message,
|
|
1658
|
+
mode: mode,
|
|
1659
|
+
});
|
|
1660
|
+
return [4 /*yield*/, this.params.swarm.getAgent()];
|
|
1661
|
+
case 1:
|
|
1662
|
+
agent = _a.sent();
|
|
1663
|
+
outputAwaiter = this.params.swarm.waitForOutput();
|
|
1664
|
+
agent.execute(message, mode);
|
|
1665
|
+
return [4 /*yield*/, outputAwaiter];
|
|
1666
|
+
case 2:
|
|
1667
|
+
output = _a.sent();
|
|
1668
|
+
return [2 /*return*/, output];
|
|
1669
|
+
}
|
|
1685
1670
|
});
|
|
1686
|
-
};
|
|
1671
|
+
}); };
|
|
1687
1672
|
/**
|
|
1688
1673
|
* Commits tool output.
|
|
1689
1674
|
* @param {string} content - The content to commit.
|
|
@@ -1781,7 +1766,7 @@ var ClientSession = /** @class */ (function () {
|
|
|
1781
1766
|
this.params.logger.debug("ClientSession clientId=".concat(this.params.clientId, " connect call"));
|
|
1782
1767
|
_a = connector;
|
|
1783
1768
|
_b = {};
|
|
1784
|
-
return [4 /*yield*/, this.execute(incoming.data, "user"
|
|
1769
|
+
return [4 /*yield*/, this.execute(incoming.data, "user")];
|
|
1785
1770
|
case 1:
|
|
1786
1771
|
_b.data = _c.sent();
|
|
1787
1772
|
return [4 /*yield*/, this.params.swarm.getAgentName()];
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -962,7 +962,7 @@ declare class ClientSession implements ISession {
|
|
|
962
962
|
* @param {boolean} [noEmit=false] - Whether to emit the output or not.
|
|
963
963
|
* @returns {Promise<string>} - The output of the execution.
|
|
964
964
|
*/
|
|
965
|
-
execute: (message: string, mode: ExecutionMode
|
|
965
|
+
execute: (message: string, mode: ExecutionMode) => Promise<string>;
|
|
966
966
|
/**
|
|
967
967
|
* Commits tool output.
|
|
968
968
|
* @param {string} content - The content to commit.
|