agent-swarm-kit 1.0.44 → 1.0.45
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 +12 -2
- package/build/index.mjs +12 -2
- package/package.json +1 -1
- package/types.d.ts +12 -2
package/build/index.cjs
CHANGED
|
@@ -768,7 +768,11 @@ var ClientAgent = /** @class */ (function () {
|
|
|
768
768
|
case 3:
|
|
769
769
|
((_b = targetFn.callbacks) === null || _b === void 0 ? void 0 : _b.onValidate) &&
|
|
770
770
|
((_c = targetFn.callbacks) === null || _c === void 0 ? void 0 : _c.onValidate(this_1.params.clientId, this_1.params.agentName, tool.function.arguments));
|
|
771
|
-
return [4 /*yield*/, functoolsKit.not(targetFn.validate(
|
|
771
|
+
return [4 /*yield*/, functoolsKit.not(targetFn.validate({
|
|
772
|
+
clientId: this_1.params.clientId,
|
|
773
|
+
agentName: this_1.params.agentName,
|
|
774
|
+
params: tool.function.arguments
|
|
775
|
+
}))];
|
|
772
776
|
case 4:
|
|
773
777
|
if (!_h.sent()) return [3 /*break*/, 7];
|
|
774
778
|
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " functionName=").concat(tool.function.name, " tool validation not passed"));
|
|
@@ -786,7 +790,13 @@ var ClientAgent = /** @class */ (function () {
|
|
|
786
790
|
/**
|
|
787
791
|
* @description Do not await to avoid deadlock! The tool can send the message to other agents by emulating user messages
|
|
788
792
|
*/
|
|
789
|
-
Promise.resolve(targetFn.call(
|
|
793
|
+
Promise.resolve(targetFn.call({
|
|
794
|
+
toolId: tool.id,
|
|
795
|
+
clientId: this_1.params.clientId,
|
|
796
|
+
agentName: this_1.params.agentName,
|
|
797
|
+
params: tool.function.arguments,
|
|
798
|
+
isLast: idx === toolCalls.length - 1,
|
|
799
|
+
})).then(function () {
|
|
790
800
|
var _a, _b;
|
|
791
801
|
((_a = targetFn.callbacks) === null || _a === void 0 ? void 0 : _a.onAfterCall) &&
|
|
792
802
|
((_b = targetFn.callbacks) === null || _b === void 0 ? void 0 : _b.onAfterCall(tool.id, _this.params.clientId, _this.params.agentName, tool.function.arguments));
|
package/build/index.mjs
CHANGED
|
@@ -766,7 +766,11 @@ var ClientAgent = /** @class */ (function () {
|
|
|
766
766
|
case 3:
|
|
767
767
|
((_b = targetFn.callbacks) === null || _b === void 0 ? void 0 : _b.onValidate) &&
|
|
768
768
|
((_c = targetFn.callbacks) === null || _c === void 0 ? void 0 : _c.onValidate(this_1.params.clientId, this_1.params.agentName, tool.function.arguments));
|
|
769
|
-
return [4 /*yield*/, not(targetFn.validate(
|
|
769
|
+
return [4 /*yield*/, not(targetFn.validate({
|
|
770
|
+
clientId: this_1.params.clientId,
|
|
771
|
+
agentName: this_1.params.agentName,
|
|
772
|
+
params: tool.function.arguments
|
|
773
|
+
}))];
|
|
770
774
|
case 4:
|
|
771
775
|
if (!_h.sent()) return [3 /*break*/, 7];
|
|
772
776
|
this_1.params.logger.debug("ClientAgent agentName=".concat(this_1.params.agentName, " clientId=").concat(this_1.params.clientId, " functionName=").concat(tool.function.name, " tool validation not passed"));
|
|
@@ -784,7 +788,13 @@ var ClientAgent = /** @class */ (function () {
|
|
|
784
788
|
/**
|
|
785
789
|
* @description Do not await to avoid deadlock! The tool can send the message to other agents by emulating user messages
|
|
786
790
|
*/
|
|
787
|
-
Promise.resolve(targetFn.call(
|
|
791
|
+
Promise.resolve(targetFn.call({
|
|
792
|
+
toolId: tool.id,
|
|
793
|
+
clientId: this_1.params.clientId,
|
|
794
|
+
agentName: this_1.params.agentName,
|
|
795
|
+
params: tool.function.arguments,
|
|
796
|
+
isLast: idx === toolCalls.length - 1,
|
|
797
|
+
})).then(function () {
|
|
788
798
|
var _a, _b;
|
|
789
799
|
((_a = targetFn.callbacks) === null || _a === void 0 ? void 0 : _a.onAfterCall) &&
|
|
790
800
|
((_b = targetFn.callbacks) === null || _b === void 0 ? void 0 : _b.onAfterCall(tool.id, _this.params.clientId, _this.params.agentName, tool.function.arguments));
|
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -538,7 +538,13 @@ interface IAgentTool<T = Record<string, unknown>> extends ITool {
|
|
|
538
538
|
* @param params - The parameters for the tool.
|
|
539
539
|
* @returns A promise that resolves when the tool call is complete.
|
|
540
540
|
*/
|
|
541
|
-
call(
|
|
541
|
+
call(dto: {
|
|
542
|
+
toolId: string;
|
|
543
|
+
clientId: string;
|
|
544
|
+
agentName: AgentName;
|
|
545
|
+
params: T;
|
|
546
|
+
isLast: boolean;
|
|
547
|
+
}): Promise<void>;
|
|
542
548
|
/**
|
|
543
549
|
* Validates the parameters for the tool.
|
|
544
550
|
* @param clientId - The ID of the client.
|
|
@@ -546,7 +552,11 @@ interface IAgentTool<T = Record<string, unknown>> extends ITool {
|
|
|
546
552
|
* @param params - The parameters for the tool.
|
|
547
553
|
* @returns A promise that resolves to a boolean indicating whether the parameters are valid, or a boolean.
|
|
548
554
|
*/
|
|
549
|
-
validate(
|
|
555
|
+
validate(dto: {
|
|
556
|
+
clientId: string;
|
|
557
|
+
agentName: AgentName;
|
|
558
|
+
params: T;
|
|
559
|
+
}): Promise<boolean> | boolean;
|
|
550
560
|
/** The name of the tool. */
|
|
551
561
|
callbacks?: Partial<IAgentToolCallbacks>;
|
|
552
562
|
}
|