agent-swarm-kit 1.0.23 → 1.0.24

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
@@ -4199,7 +4199,7 @@ var DEFAULT_TIMEOUT = 15 * 60;
4199
4199
  * @returns {Object} An object with tick and stop methods to control the auto-dispose.
4200
4200
  */
4201
4201
  var makeAutoDispose = function (clientId, swarmName, _a) {
4202
- var _b = _a === void 0 ? {} : _a, _c = _b.timeoutSeconds, timeoutSeconds = _c === void 0 ? DEFAULT_TIMEOUT : _c;
4202
+ var _b = _a === void 0 ? {} : _a, _c = _b.timeoutSeconds, timeoutSeconds = _c === void 0 ? DEFAULT_TIMEOUT : _c, onDestroy = _b.onDestroy;
4203
4203
  var isOk = true;
4204
4204
  var unSource = functoolsKit.Source.fromInterval(1000)
4205
4205
  .reduce(function (acm) {
@@ -4220,7 +4220,9 @@ var makeAutoDispose = function (clientId, swarmName, _a) {
4220
4220
  case 1:
4221
4221
  _a.sent();
4222
4222
  _a.label = 2;
4223
- case 2: return [2 /*return*/];
4223
+ case 2:
4224
+ onDestroy && onDestroy(clientId, swarmName);
4225
+ return [2 /*return*/];
4224
4226
  }
4225
4227
  });
4226
4228
  }); });
@@ -4234,8 +4236,9 @@ var makeAutoDispose = function (clientId, swarmName, _a) {
4234
4236
  /**
4235
4237
  * Stops the auto-dispose mechanism.
4236
4238
  */
4237
- stop: function () {
4239
+ destroy: function () {
4238
4240
  unSource();
4241
+ onDestroy && onDestroy(clientId, swarmName);
4239
4242
  },
4240
4243
  };
4241
4244
  };
package/build/index.mjs CHANGED
@@ -4197,7 +4197,7 @@ var DEFAULT_TIMEOUT = 15 * 60;
4197
4197
  * @returns {Object} An object with tick and stop methods to control the auto-dispose.
4198
4198
  */
4199
4199
  var makeAutoDispose = function (clientId, swarmName, _a) {
4200
- var _b = _a === void 0 ? {} : _a, _c = _b.timeoutSeconds, timeoutSeconds = _c === void 0 ? DEFAULT_TIMEOUT : _c;
4200
+ var _b = _a === void 0 ? {} : _a, _c = _b.timeoutSeconds, timeoutSeconds = _c === void 0 ? DEFAULT_TIMEOUT : _c, onDestroy = _b.onDestroy;
4201
4201
  var isOk = true;
4202
4202
  var unSource = Source.fromInterval(1000)
4203
4203
  .reduce(function (acm) {
@@ -4218,7 +4218,9 @@ var makeAutoDispose = function (clientId, swarmName, _a) {
4218
4218
  case 1:
4219
4219
  _a.sent();
4220
4220
  _a.label = 2;
4221
- case 2: return [2 /*return*/];
4221
+ case 2:
4222
+ onDestroy && onDestroy(clientId, swarmName);
4223
+ return [2 /*return*/];
4222
4224
  }
4223
4225
  });
4224
4226
  }); });
@@ -4232,8 +4234,9 @@ var makeAutoDispose = function (clientId, swarmName, _a) {
4232
4234
  /**
4233
4235
  * Stops the auto-dispose mechanism.
4234
4236
  */
4235
- stop: function () {
4237
+ destroy: function () {
4236
4238
  unSource();
4239
+ onDestroy && onDestroy(clientId, swarmName);
4237
4240
  },
4238
4241
  };
4239
4242
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",
package/types.d.ts CHANGED
@@ -1774,6 +1774,10 @@ interface IMakeDisposeParams {
1774
1774
  * Timeout in seconds before auto-dispose is triggered.
1775
1775
  */
1776
1776
  timeoutSeconds: number;
1777
+ /**
1778
+ * Callback when session is closed
1779
+ */
1780
+ onDestroy?: (clientId: string, swarmName: SwarmName) => void;
1777
1781
  }
1778
1782
  /**
1779
1783
  * Creates an auto-dispose mechanism for a client in a swarm.
@@ -1783,7 +1787,7 @@ interface IMakeDisposeParams {
1783
1787
  * @param {Partial<IMakeDisposeParams>} [params={}] - Optional parameters for auto-dispose.
1784
1788
  * @returns {Object} An object with tick and stop methods to control the auto-dispose.
1785
1789
  */
1786
- declare const makeAutoDispose: (clientId: string, swarmName: SwarmName, { timeoutSeconds }?: Partial<IMakeDisposeParams>) => {
1790
+ declare const makeAutoDispose: (clientId: string, swarmName: SwarmName, { timeoutSeconds, onDestroy }?: Partial<IMakeDisposeParams>) => {
1787
1791
  /**
1788
1792
  * Signals that the client is active, resetting the auto-dispose timer.
1789
1793
  */
@@ -1791,7 +1795,7 @@ declare const makeAutoDispose: (clientId: string, swarmName: SwarmName, { timeou
1791
1795
  /**
1792
1796
  * Stops the auto-dispose mechanism.
1793
1797
  */
1794
- stop(): void;
1798
+ destroy(): void;
1795
1799
  };
1796
1800
 
1797
1801
  declare const GLOBAL_CONFIG: {