agent-swarm-kit 1.0.143 → 1.0.144

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 CHANGED
@@ -1977,7 +1977,7 @@ var EXECUTE_FN = function (incoming, mode, self) { return __awaiter(void 0, void
1977
1977
  return [4 /*yield*/, self.params.history.push(__assign(__assign({}, message), { agentName: self.params.agentName }))];
1978
1978
  case 4:
1979
1979
  _k.sent();
1980
- lastToolCallRef = Promise.resolve();
1980
+ lastToolCallRef = Promise.resolve(null);
1981
1981
  isResqued_1 = false;
1982
1982
  {
1983
1983
  unResque = self._modelResqueSubject.once(function () {
@@ -2001,7 +2001,7 @@ var EXECUTE_FN = function (incoming, mode, self) { return __awaiter(void 0, void
2001
2001
  self._outputSubject.once(unResque);
2002
2002
  }
2003
2003
  _loop_1 = function (idx) {
2004
- var tool, targetFn, result_1, result_2, toolFinishSubject, statusAwaiter, isResolved, status, result_3;
2004
+ var tool, targetFn, result_1, result_2, statusAwaiter, isResolved, status, result_3;
2005
2005
  return __generator(this, function (_l) {
2006
2006
  switch (_l.label) {
2007
2007
  case 0:
@@ -2049,7 +2049,6 @@ var EXECUTE_FN = function (incoming, mode, self) { return __awaiter(void 0, void
2049
2049
  case 7:
2050
2050
  ((_d = targetFn.callbacks) === null || _d === void 0 ? void 0 : _d.onBeforeCall) &&
2051
2051
  ((_e = targetFn.callbacks) === null || _e === void 0 ? void 0 : _e.onBeforeCall(tool.id, self.params.clientId, self.params.agentName, tool.function.arguments));
2052
- toolFinishSubject = new functoolsKit.Subject();
2053
2052
  statusAwaiter = Promise.race([
2054
2053
  self._agentChangeSubject.toPromise(),
2055
2054
  self._toolCommitSubject.toPromise(),
@@ -2057,16 +2056,14 @@ var EXECUTE_FN = function (incoming, mode, self) { return __awaiter(void 0, void
2057
2056
  self._toolStopSubject.toPromise(),
2058
2057
  self._outputSubject.toPromise(),
2059
2058
  self._modelResqueSubject.toPromise(),
2060
- toolFinishSubject.toPromise(),
2061
2059
  ]);
2062
2060
  /**
2063
2061
  * Do not await to avoid deadlock! The tool can send the message to other agents by emulating user messages
2064
2062
  */
2065
- lastToolCallRef = lastToolCallRef
2066
- .then(function () {
2067
- return createToolCall(idx, tool, toolCalls_1, targetFn, self, function () { return isResqued_1; });
2068
- })
2069
- .then(function () { return void toolFinishSubject.next(); });
2063
+ {
2064
+ lastToolCallRef.then(function () { return createToolCall(idx, tool, toolCalls_1, targetFn, self, function () { return isResqued_1; }); });
2065
+ lastToolCallRef = lastToolCallRef.then(function () { return statusAwaiter; });
2066
+ }
2070
2067
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
2071
2068
  self.params.logger.debug("ClientAgent agentName=".concat(self.params.agentName, " clientId=").concat(self.params.clientId, " functionName=").concat(tool.function.name, " tool call executing"));
2072
2069
  isResolved = false;
package/build/index.mjs CHANGED
@@ -1975,7 +1975,7 @@ var EXECUTE_FN = function (incoming, mode, self) { return __awaiter(void 0, void
1975
1975
  return [4 /*yield*/, self.params.history.push(__assign(__assign({}, message), { agentName: self.params.agentName }))];
1976
1976
  case 4:
1977
1977
  _k.sent();
1978
- lastToolCallRef = Promise.resolve();
1978
+ lastToolCallRef = Promise.resolve(null);
1979
1979
  isResqued_1 = false;
1980
1980
  {
1981
1981
  unResque = self._modelResqueSubject.once(function () {
@@ -1999,7 +1999,7 @@ var EXECUTE_FN = function (incoming, mode, self) { return __awaiter(void 0, void
1999
1999
  self._outputSubject.once(unResque);
2000
2000
  }
2001
2001
  _loop_1 = function (idx) {
2002
- var tool, targetFn, result_1, result_2, toolFinishSubject, statusAwaiter, isResolved, status, result_3;
2002
+ var tool, targetFn, result_1, result_2, statusAwaiter, isResolved, status, result_3;
2003
2003
  return __generator(this, function (_l) {
2004
2004
  switch (_l.label) {
2005
2005
  case 0:
@@ -2047,7 +2047,6 @@ var EXECUTE_FN = function (incoming, mode, self) { return __awaiter(void 0, void
2047
2047
  case 7:
2048
2048
  ((_d = targetFn.callbacks) === null || _d === void 0 ? void 0 : _d.onBeforeCall) &&
2049
2049
  ((_e = targetFn.callbacks) === null || _e === void 0 ? void 0 : _e.onBeforeCall(tool.id, self.params.clientId, self.params.agentName, tool.function.arguments));
2050
- toolFinishSubject = new Subject();
2051
2050
  statusAwaiter = Promise.race([
2052
2051
  self._agentChangeSubject.toPromise(),
2053
2052
  self._toolCommitSubject.toPromise(),
@@ -2055,16 +2054,14 @@ var EXECUTE_FN = function (incoming, mode, self) { return __awaiter(void 0, void
2055
2054
  self._toolStopSubject.toPromise(),
2056
2055
  self._outputSubject.toPromise(),
2057
2056
  self._modelResqueSubject.toPromise(),
2058
- toolFinishSubject.toPromise(),
2059
2057
  ]);
2060
2058
  /**
2061
2059
  * Do not await to avoid deadlock! The tool can send the message to other agents by emulating user messages
2062
2060
  */
2063
- lastToolCallRef = lastToolCallRef
2064
- .then(function () {
2065
- return createToolCall(idx, tool, toolCalls_1, targetFn, self, function () { return isResqued_1; });
2066
- })
2067
- .then(function () { return void toolFinishSubject.next(); });
2061
+ {
2062
+ lastToolCallRef.then(function () { return createToolCall(idx, tool, toolCalls_1, targetFn, self, function () { return isResqued_1; }); });
2063
+ lastToolCallRef = lastToolCallRef.then(function () { return statusAwaiter; });
2064
+ }
2068
2065
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
2069
2066
  self.params.logger.debug("ClientAgent agentName=".concat(self.params.agentName, " clientId=").concat(self.params.clientId, " functionName=").concat(tool.function.name, " tool call executing"));
2070
2067
  isResolved = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.143",
3
+ "version": "1.0.144",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",