agent-swarm-kit 1.0.63 → 1.0.64

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
@@ -446,6 +446,8 @@ var HistoryInstance = /** @class */ (function () {
446
446
  clientId: this.clientId,
447
447
  agentName: agentName,
448
448
  });
449
+ this.callbacks.onPush &&
450
+ this.callbacks.onPush(value, this.clientId, agentName);
449
451
  this._array.push(value);
450
452
  this.callbacks.onChange &&
451
453
  this.callbacks.onChange(this._array, this.clientId, agentName);
@@ -690,7 +692,7 @@ var HistoryUtils = /** @class */ (function () {
690
692
  */
691
693
  this.useHistoryCallbacks = function (Callbacks) {
692
694
  swarm.loggerService.log("HistoryUtils useHistoryCallbacks");
693
- _this.HistoryCallbacks = Callbacks;
695
+ Object.assign(_this.HistoryCallbacks, Callbacks);
694
696
  };
695
697
  /**
696
698
  * Push a new message to the history.
package/build/index.mjs CHANGED
@@ -444,6 +444,8 @@ var HistoryInstance = /** @class */ (function () {
444
444
  clientId: this.clientId,
445
445
  agentName: agentName,
446
446
  });
447
+ this.callbacks.onPush &&
448
+ this.callbacks.onPush(value, this.clientId, agentName);
447
449
  this._array.push(value);
448
450
  this.callbacks.onChange &&
449
451
  this.callbacks.onChange(this._array, this.clientId, agentName);
@@ -688,7 +690,7 @@ var HistoryUtils = /** @class */ (function () {
688
690
  */
689
691
  this.useHistoryCallbacks = function (Callbacks) {
690
692
  swarm.loggerService.log("HistoryUtils useHistoryCallbacks");
691
- _this.HistoryCallbacks = Callbacks;
693
+ Object.assign(_this.HistoryCallbacks, Callbacks);
692
694
  };
693
695
  /**
694
696
  * Push a new message to the history.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.63",
3
+ "version": "1.0.64",
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
@@ -400,6 +400,13 @@ interface IHistoryInstanceCallbacks {
400
400
  * @param agentName - The agent name.
401
401
  */
402
402
  onChange: (data: IModelMessage[], clientId: string, agentName: AgentName) => void;
403
+ /**
404
+ * Callback for when the history get the new message
405
+ * @param data - The array of model messages.
406
+ * @param clientId - The client ID.
407
+ * @param agentName - The agent name.
408
+ */
409
+ onPush: (data: IModelMessage, clientId: string, agentName: AgentName) => void;
403
410
  /**
404
411
  * Callback for when the history is read. Will be called for each message
405
412
  * @param message - The model message.