agent-swarm-kit 1.0.42 → 1.0.43
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 +18 -14
- package/build/index.mjs +18 -14
- package/package.json +1 -1
package/build/index.cjs
CHANGED
|
@@ -536,11 +536,13 @@ var ClientAgent = /** @class */ (function () {
|
|
|
536
536
|
return [4 /*yield*/, this.params.map(rawMessage, this.params.clientId, this.params.agentName)];
|
|
537
537
|
case 4:
|
|
538
538
|
message = _a.sent();
|
|
539
|
-
|
|
539
|
+
return [4 /*yield*/, this.params.transform(message.content, this.params.clientId, this.params.agentName)];
|
|
540
|
+
case 5:
|
|
541
|
+
result = _a.sent();
|
|
540
542
|
validation = null;
|
|
541
543
|
return [4 /*yield*/, this.params.validate(result)];
|
|
542
|
-
case
|
|
543
|
-
if (!(validation = _a.sent())) return [3 /*break*/,
|
|
544
|
+
case 6:
|
|
545
|
+
if (!(validation = _a.sent())) return [3 /*break*/, 8];
|
|
544
546
|
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " _resurrectModel validation error: ").concat(validation));
|
|
545
547
|
content = getPlaceholder();
|
|
546
548
|
return [4 /*yield*/, this.params.history.push({
|
|
@@ -549,11 +551,11 @@ var ClientAgent = /** @class */ (function () {
|
|
|
549
551
|
mode: "tool",
|
|
550
552
|
content: content,
|
|
551
553
|
})];
|
|
552
|
-
case
|
|
554
|
+
case 7:
|
|
553
555
|
_a.sent();
|
|
554
556
|
return [2 /*return*/, content];
|
|
555
|
-
case
|
|
556
|
-
case
|
|
557
|
+
case 8: return [4 /*yield*/, this.params.history.push(__assign(__assign({}, message), { agentName: this.params.agentName }))];
|
|
558
|
+
case 9:
|
|
557
559
|
_a.sent();
|
|
558
560
|
return [2 /*return*/, result];
|
|
559
561
|
}
|
|
@@ -838,26 +840,28 @@ var ClientAgent = /** @class */ (function () {
|
|
|
838
840
|
if (!message.tool_calls) {
|
|
839
841
|
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute no tool calls detected"));
|
|
840
842
|
}
|
|
841
|
-
|
|
842
|
-
return [4 /*yield*/, this.params.history.push(__assign(__assign({}, message), { agentName: this.params.agentName }))];
|
|
843
|
+
return [4 /*yield*/, this.params.transform(message.content, this.params.clientId, this.params.agentName)];
|
|
843
844
|
case 14:
|
|
845
|
+
result = _h.sent();
|
|
846
|
+
return [4 /*yield*/, this.params.history.push(__assign(__assign({}, message), { agentName: this.params.agentName }))];
|
|
847
|
+
case 15:
|
|
844
848
|
_h.sent();
|
|
845
849
|
validation = null;
|
|
846
850
|
return [4 /*yield*/, this.params.validate(result)];
|
|
847
|
-
case
|
|
848
|
-
if (!(validation = _h.sent())) return [3 /*break*/,
|
|
851
|
+
case 16:
|
|
852
|
+
if (!(validation = _h.sent())) return [3 /*break*/, 19];
|
|
849
853
|
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute invalid tool call detected: ").concat(validation), { result: result });
|
|
850
854
|
return [4 /*yield*/, this._resurrectModel(mode, "Invalid model output: ".concat(result))];
|
|
851
|
-
case
|
|
855
|
+
case 17:
|
|
852
856
|
result1 = _h.sent();
|
|
853
857
|
return [4 /*yield*/, this._emitOuput(mode, result1)];
|
|
854
|
-
case
|
|
858
|
+
case 18:
|
|
855
859
|
_h.sent();
|
|
856
860
|
return [2 /*return*/];
|
|
857
|
-
case
|
|
861
|
+
case 19:
|
|
858
862
|
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute end result=").concat(result));
|
|
859
863
|
return [4 /*yield*/, this._emitOuput(mode, result)];
|
|
860
|
-
case
|
|
864
|
+
case 20:
|
|
861
865
|
_h.sent();
|
|
862
866
|
return [2 /*return*/];
|
|
863
867
|
}
|
package/build/index.mjs
CHANGED
|
@@ -534,11 +534,13 @@ var ClientAgent = /** @class */ (function () {
|
|
|
534
534
|
return [4 /*yield*/, this.params.map(rawMessage, this.params.clientId, this.params.agentName)];
|
|
535
535
|
case 4:
|
|
536
536
|
message = _a.sent();
|
|
537
|
-
|
|
537
|
+
return [4 /*yield*/, this.params.transform(message.content, this.params.clientId, this.params.agentName)];
|
|
538
|
+
case 5:
|
|
539
|
+
result = _a.sent();
|
|
538
540
|
validation = null;
|
|
539
541
|
return [4 /*yield*/, this.params.validate(result)];
|
|
540
|
-
case
|
|
541
|
-
if (!(validation = _a.sent())) return [3 /*break*/,
|
|
542
|
+
case 6:
|
|
543
|
+
if (!(validation = _a.sent())) return [3 /*break*/, 8];
|
|
542
544
|
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " _resurrectModel validation error: ").concat(validation));
|
|
543
545
|
content = getPlaceholder();
|
|
544
546
|
return [4 /*yield*/, this.params.history.push({
|
|
@@ -547,11 +549,11 @@ var ClientAgent = /** @class */ (function () {
|
|
|
547
549
|
mode: "tool",
|
|
548
550
|
content: content,
|
|
549
551
|
})];
|
|
550
|
-
case
|
|
552
|
+
case 7:
|
|
551
553
|
_a.sent();
|
|
552
554
|
return [2 /*return*/, content];
|
|
553
|
-
case
|
|
554
|
-
case
|
|
555
|
+
case 8: return [4 /*yield*/, this.params.history.push(__assign(__assign({}, message), { agentName: this.params.agentName }))];
|
|
556
|
+
case 9:
|
|
555
557
|
_a.sent();
|
|
556
558
|
return [2 /*return*/, result];
|
|
557
559
|
}
|
|
@@ -836,26 +838,28 @@ var ClientAgent = /** @class */ (function () {
|
|
|
836
838
|
if (!message.tool_calls) {
|
|
837
839
|
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute no tool calls detected"));
|
|
838
840
|
}
|
|
839
|
-
|
|
840
|
-
return [4 /*yield*/, this.params.history.push(__assign(__assign({}, message), { agentName: this.params.agentName }))];
|
|
841
|
+
return [4 /*yield*/, this.params.transform(message.content, this.params.clientId, this.params.agentName)];
|
|
841
842
|
case 14:
|
|
843
|
+
result = _h.sent();
|
|
844
|
+
return [4 /*yield*/, this.params.history.push(__assign(__assign({}, message), { agentName: this.params.agentName }))];
|
|
845
|
+
case 15:
|
|
842
846
|
_h.sent();
|
|
843
847
|
validation = null;
|
|
844
848
|
return [4 /*yield*/, this.params.validate(result)];
|
|
845
|
-
case
|
|
846
|
-
if (!(validation = _h.sent())) return [3 /*break*/,
|
|
849
|
+
case 16:
|
|
850
|
+
if (!(validation = _h.sent())) return [3 /*break*/, 19];
|
|
847
851
|
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute invalid tool call detected: ").concat(validation), { result: result });
|
|
848
852
|
return [4 /*yield*/, this._resurrectModel(mode, "Invalid model output: ".concat(result))];
|
|
849
|
-
case
|
|
853
|
+
case 17:
|
|
850
854
|
result1 = _h.sent();
|
|
851
855
|
return [4 /*yield*/, this._emitOuput(mode, result1)];
|
|
852
|
-
case
|
|
856
|
+
case 18:
|
|
853
857
|
_h.sent();
|
|
854
858
|
return [2 /*return*/];
|
|
855
|
-
case
|
|
859
|
+
case 19:
|
|
856
860
|
this.params.logger.debug("ClientAgent agentName=".concat(this.params.agentName, " clientId=").concat(this.params.clientId, " execute end result=").concat(result));
|
|
857
861
|
return [4 /*yield*/, this._emitOuput(mode, result)];
|
|
858
|
-
case
|
|
862
|
+
case 20:
|
|
859
863
|
_h.sent();
|
|
860
864
|
return [2 /*return*/];
|
|
861
865
|
}
|