agent-swarm-kit 1.0.73 → 1.0.74

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
@@ -973,7 +973,7 @@ var ClientAgent = /** @class */ (function () {
973
973
  _a.sent();
974
974
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
975
975
  type: "emit-output",
976
- source: "agent",
976
+ source: "agent-bus",
977
977
  input: {
978
978
  mode: mode,
979
979
  rawResult: rawResult_1,
@@ -997,7 +997,7 @@ var ClientAgent = /** @class */ (function () {
997
997
  _a.sent();
998
998
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
999
999
  type: "emit-output",
1000
- source: "agent",
1000
+ source: "agent-bus",
1001
1001
  input: {
1002
1002
  mode: mode,
1003
1003
  rawResult: rawResult,
@@ -1145,7 +1145,7 @@ var ClientAgent = /** @class */ (function () {
1145
1145
  _a.sent();
1146
1146
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1147
1147
  type: "commit-user-message",
1148
- source: "agent",
1148
+ source: "agent-bus",
1149
1149
  input: {
1150
1150
  message: message,
1151
1151
  },
@@ -1182,7 +1182,7 @@ var ClientAgent = /** @class */ (function () {
1182
1182
  _a.sent();
1183
1183
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1184
1184
  type: "commit-flush",
1185
- source: "agent",
1185
+ source: "agent-bus",
1186
1186
  input: {},
1187
1187
  output: {},
1188
1188
  context: {
@@ -1210,7 +1210,7 @@ var ClientAgent = /** @class */ (function () {
1210
1210
  _a.sent();
1211
1211
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1212
1212
  type: "commit-agent-change",
1213
- source: "agent",
1213
+ source: "agent-bus",
1214
1214
  input: {},
1215
1215
  output: {},
1216
1216
  context: {
@@ -1246,7 +1246,7 @@ var ClientAgent = /** @class */ (function () {
1246
1246
  _a.sent();
1247
1247
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1248
1248
  type: "commit-system-message",
1249
- source: "agent",
1249
+ source: "agent-bus",
1250
1250
  input: {
1251
1251
  message: message,
1252
1252
  },
@@ -1288,7 +1288,7 @@ var ClientAgent = /** @class */ (function () {
1288
1288
  _a.sent();
1289
1289
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1290
1290
  type: "commit-tool-output",
1291
- source: "agent",
1291
+ source: "agent-bus",
1292
1292
  input: {
1293
1293
  toolId: toolId,
1294
1294
  content: content,
@@ -1725,7 +1725,7 @@ var ClientHistory = /** @class */ (function () {
1725
1725
  _a.sent();
1726
1726
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1727
1727
  type: "push",
1728
- source: "history",
1728
+ source: "history-bus",
1729
1729
  input: {
1730
1730
  message: message
1731
1731
  },
@@ -2136,7 +2136,7 @@ var ClientSwarm = /** @class */ (function () {
2136
2136
  _d.sent();
2137
2137
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2138
2138
  type: "cancel-output",
2139
- source: "swarm",
2139
+ source: "swarm-bus",
2140
2140
  input: {},
2141
2141
  output: {},
2142
2142
  context: {
@@ -2209,7 +2209,7 @@ var ClientSwarm = /** @class */ (function () {
2209
2209
  this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " waitForAgent agent miss"), { agentName: agentName, expectAgent: expectAgent });
2210
2210
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2211
2211
  type: "wait-for-output",
2212
- source: "swarm",
2212
+ source: "swarm-bus",
2213
2213
  input: {},
2214
2214
  output: {
2215
2215
  result: output,
@@ -2243,7 +2243,7 @@ var ClientSwarm = /** @class */ (function () {
2243
2243
  _b.label = 2;
2244
2244
  case 2: return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2245
2245
  type: "get-agent-name",
2246
- source: "swarm",
2246
+ source: "swarm-bus",
2247
2247
  input: {},
2248
2248
  output: {
2249
2249
  activeAgent: this._activeAgent,
@@ -2275,7 +2275,7 @@ var ClientSwarm = /** @class */ (function () {
2275
2275
  result = this.params.agentMap[agent];
2276
2276
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2277
2277
  type: "get-agent",
2278
- source: "swarm",
2278
+ source: "swarm-bus",
2279
2279
  input: {
2280
2280
  result: result,
2281
2281
  },
@@ -2308,7 +2308,7 @@ var ClientSwarm = /** @class */ (function () {
2308
2308
  this.params.agentMap[agentName] = agent;
2309
2309
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2310
2310
  type: "set-agent-ref",
2311
- source: "swarm",
2311
+ source: "swarm-bus",
2312
2312
  input: {
2313
2313
  agentName: agentName,
2314
2314
  agent: agent,
@@ -2343,7 +2343,7 @@ var ClientSwarm = /** @class */ (function () {
2343
2343
  _a.sent();
2344
2344
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2345
2345
  type: "set-agent-name",
2346
- source: "swarm",
2346
+ source: "swarm-bus",
2347
2347
  input: {
2348
2348
  agentName: agentName,
2349
2349
  },
@@ -2650,7 +2650,7 @@ var ClientSession = /** @class */ (function () {
2650
2650
  _a.sent();
2651
2651
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2652
2652
  type: "emit",
2653
- source: "session",
2653
+ source: "session-bus",
2654
2654
  input: {
2655
2655
  message: message
2656
2656
  },
@@ -2693,7 +2693,7 @@ var ClientSession = /** @class */ (function () {
2693
2693
  output = _a.sent();
2694
2694
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2695
2695
  type: "execute",
2696
- source: "session",
2696
+ source: "session-bus",
2697
2697
  input: {
2698
2698
  message: message,
2699
2699
  mode: mode,
@@ -2735,7 +2735,7 @@ var ClientSession = /** @class */ (function () {
2735
2735
  result = _a.sent();
2736
2736
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2737
2737
  type: "commit-tool-output",
2738
- source: "session",
2738
+ source: "session-bus",
2739
2739
  input: {
2740
2740
  toolId: toolId,
2741
2741
  content: content,
@@ -2773,7 +2773,7 @@ var ClientSession = /** @class */ (function () {
2773
2773
  result = _a.sent();
2774
2774
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2775
2775
  type: "commit-user-message",
2776
- source: "session",
2776
+ source: "session-bus",
2777
2777
  input: {
2778
2778
  message: message,
2779
2779
  },
@@ -2807,7 +2807,7 @@ var ClientSession = /** @class */ (function () {
2807
2807
  result = _a.sent();
2808
2808
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2809
2809
  type: "commit-flush",
2810
- source: "session",
2810
+ source: "session-bus",
2811
2811
  input: {},
2812
2812
  output: {},
2813
2813
  context: {
@@ -2842,7 +2842,7 @@ var ClientSession = /** @class */ (function () {
2842
2842
  result = _a.sent();
2843
2843
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2844
2844
  type: "commit-system-message",
2845
- source: "session",
2845
+ source: "session-bus",
2846
2846
  input: {
2847
2847
  message: message
2848
2848
  },
@@ -2887,7 +2887,7 @@ var ClientSession = /** @class */ (function () {
2887
2887
  }); });
2888
2888
  _this.params.bus.emit(_this.params.clientId, {
2889
2889
  type: "connect",
2890
- source: "session",
2890
+ source: "session-bus",
2891
2891
  input: {},
2892
2892
  output: {},
2893
2893
  context: {
@@ -4925,7 +4925,7 @@ var ClientStorage = /** @class */ (function () {
4925
4925
  }
4926
4926
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
4927
4927
  type: "take",
4928
- source: "storage",
4928
+ source: "storage-bus",
4929
4929
  input: {
4930
4930
  search: search,
4931
4931
  total: total,
@@ -4969,7 +4969,7 @@ var ClientStorage = /** @class */ (function () {
4969
4969
  }
4970
4970
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
4971
4971
  type: "upsert",
4972
- source: "storage",
4972
+ source: "storage-bus",
4973
4973
  input: {
4974
4974
  item: item,
4975
4975
  },
@@ -5005,7 +5005,7 @@ var ClientStorage = /** @class */ (function () {
5005
5005
  }
5006
5006
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5007
5007
  type: "remove",
5008
- source: "storage",
5008
+ source: "storage-bus",
5009
5009
  input: {
5010
5010
  itemId: itemId,
5011
5011
  },
@@ -5034,7 +5034,7 @@ var ClientStorage = /** @class */ (function () {
5034
5034
  this._createEmbedding.clear();
5035
5035
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5036
5036
  type: "clear",
5037
- source: "storage",
5037
+ source: "storage-bus",
5038
5038
  input: {},
5039
5039
  output: {},
5040
5040
  context: {
@@ -5065,7 +5065,7 @@ var ClientStorage = /** @class */ (function () {
5065
5065
  result = (_a = this._itemMap.get(itemId)) !== null && _a !== void 0 ? _a : null;
5066
5066
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5067
5067
  type: "get",
5068
- source: "storage",
5068
+ source: "storage-bus",
5069
5069
  input: {
5070
5070
  itemId: itemId,
5071
5071
  },
@@ -5116,7 +5116,7 @@ var ClientStorage = /** @class */ (function () {
5116
5116
  }
5117
5117
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5118
5118
  type: "list",
5119
- source: "storage",
5119
+ source: "storage-bus",
5120
5120
  input: {},
5121
5121
  output: {
5122
5122
  result: result,
@@ -5860,7 +5860,7 @@ var ClientState = /** @class */ (function () {
5860
5860
  }
5861
5861
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5862
5862
  type: "set-state",
5863
- source: "state",
5863
+ source: "state-bus",
5864
5864
  input: {},
5865
5865
  output: {
5866
5866
  state: this._state,
@@ -5894,7 +5894,7 @@ var ClientState = /** @class */ (function () {
5894
5894
  }
5895
5895
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5896
5896
  type: "get-state",
5897
- source: "state",
5897
+ source: "state-bus",
5898
5898
  input: {},
5899
5899
  output: {
5900
5900
  state: this._state,
@@ -7554,12 +7554,12 @@ var executeForce = function (content, clientId) { return __awaiter(void 0, void
7554
7554
  }); };
7555
7555
 
7556
7556
  var DISALLOWED_EVENT_SOURCE_LIST$1 = new Set([
7557
- "agent",
7558
- "history",
7559
- "session",
7560
- "state",
7561
- "storage",
7562
- "swarm",
7557
+ "agent-bus",
7558
+ "history-bus",
7559
+ "session-bus",
7560
+ "state-bus",
7561
+ "storage-bus",
7562
+ "swarm-bus",
7563
7563
  ]);
7564
7564
  var validateClientId$6 = function (clientId) {
7565
7565
  if (clientId === "*") {
@@ -7773,12 +7773,12 @@ var makeAutoDispose = function (clientId, swarmName, _a) {
7773
7773
  };
7774
7774
 
7775
7775
  var DISALLOWED_EVENT_SOURCE_LIST = new Set([
7776
- "agent",
7777
- "history",
7778
- "session",
7779
- "state",
7780
- "storage",
7781
- "swarm",
7776
+ "agent-bus",
7777
+ "history-bus",
7778
+ "session-bus",
7779
+ "state-bus",
7780
+ "storage-bus",
7781
+ "swarm-bus",
7782
7782
  ]);
7783
7783
  /**
7784
7784
  * Emits an event to the swarm bus service.
@@ -7886,7 +7886,7 @@ var listenAgentEvent = function (clientId, fn) {
7886
7886
  clientId: clientId,
7887
7887
  });
7888
7888
  validateClientId$5(clientId);
7889
- swarm.busService.subscribe(clientId, "agent", fn);
7889
+ swarm.busService.subscribe(clientId, "agent-bus", fn);
7890
7890
  };
7891
7891
 
7892
7892
  var validateClientId$4 = function (clientId) {
@@ -7908,7 +7908,7 @@ var listenHistoryEvent = function (clientId, fn) {
7908
7908
  clientId: clientId,
7909
7909
  });
7910
7910
  validateClientId$4(clientId);
7911
- swarm.busService.subscribe(clientId, "history", fn);
7911
+ swarm.busService.subscribe(clientId, "history-bus", fn);
7912
7912
  };
7913
7913
 
7914
7914
  var validateClientId$3 = function (clientId) {
@@ -7930,7 +7930,7 @@ var listenSessionEvent = function (clientId, fn) {
7930
7930
  clientId: clientId,
7931
7931
  });
7932
7932
  validateClientId$3(clientId);
7933
- swarm.busService.subscribe(clientId, "session", fn);
7933
+ swarm.busService.subscribe(clientId, "session-bus", fn);
7934
7934
  };
7935
7935
 
7936
7936
  var validateClientId$2 = function (clientId) {
@@ -7952,7 +7952,7 @@ var listenStateEvent = function (clientId, fn) {
7952
7952
  clientId: clientId,
7953
7953
  });
7954
7954
  validateClientId$2(clientId);
7955
- swarm.busService.subscribe(clientId, "state", fn);
7955
+ swarm.busService.subscribe(clientId, "state-bus", fn);
7956
7956
  };
7957
7957
 
7958
7958
  var validateClientId$1 = function (clientId) {
@@ -7974,7 +7974,7 @@ var listenStorageEvent = function (clientId, fn) {
7974
7974
  clientId: clientId,
7975
7975
  });
7976
7976
  validateClientId$1(clientId);
7977
- swarm.busService.subscribe(clientId, "storage", fn);
7977
+ swarm.busService.subscribe(clientId, "storage-bus", fn);
7978
7978
  };
7979
7979
 
7980
7980
  var validateClientId = function (clientId) {
@@ -7996,7 +7996,7 @@ var listenSwarmEvent = function (clientId, fn) {
7996
7996
  clientId: clientId,
7997
7997
  });
7998
7998
  validateClientId(clientId);
7999
- swarm.busService.subscribe(clientId, "swarm", fn);
7999
+ swarm.busService.subscribe(clientId, "swarm-bus", fn);
8000
8000
  };
8001
8001
 
8002
8002
  var StorageUtils = /** @class */ (function () {
package/build/index.mjs CHANGED
@@ -971,7 +971,7 @@ var ClientAgent = /** @class */ (function () {
971
971
  _a.sent();
972
972
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
973
973
  type: "emit-output",
974
- source: "agent",
974
+ source: "agent-bus",
975
975
  input: {
976
976
  mode: mode,
977
977
  rawResult: rawResult_1,
@@ -995,7 +995,7 @@ var ClientAgent = /** @class */ (function () {
995
995
  _a.sent();
996
996
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
997
997
  type: "emit-output",
998
- source: "agent",
998
+ source: "agent-bus",
999
999
  input: {
1000
1000
  mode: mode,
1001
1001
  rawResult: rawResult,
@@ -1143,7 +1143,7 @@ var ClientAgent = /** @class */ (function () {
1143
1143
  _a.sent();
1144
1144
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1145
1145
  type: "commit-user-message",
1146
- source: "agent",
1146
+ source: "agent-bus",
1147
1147
  input: {
1148
1148
  message: message,
1149
1149
  },
@@ -1180,7 +1180,7 @@ var ClientAgent = /** @class */ (function () {
1180
1180
  _a.sent();
1181
1181
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1182
1182
  type: "commit-flush",
1183
- source: "agent",
1183
+ source: "agent-bus",
1184
1184
  input: {},
1185
1185
  output: {},
1186
1186
  context: {
@@ -1208,7 +1208,7 @@ var ClientAgent = /** @class */ (function () {
1208
1208
  _a.sent();
1209
1209
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1210
1210
  type: "commit-agent-change",
1211
- source: "agent",
1211
+ source: "agent-bus",
1212
1212
  input: {},
1213
1213
  output: {},
1214
1214
  context: {
@@ -1244,7 +1244,7 @@ var ClientAgent = /** @class */ (function () {
1244
1244
  _a.sent();
1245
1245
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1246
1246
  type: "commit-system-message",
1247
- source: "agent",
1247
+ source: "agent-bus",
1248
1248
  input: {
1249
1249
  message: message,
1250
1250
  },
@@ -1286,7 +1286,7 @@ var ClientAgent = /** @class */ (function () {
1286
1286
  _a.sent();
1287
1287
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1288
1288
  type: "commit-tool-output",
1289
- source: "agent",
1289
+ source: "agent-bus",
1290
1290
  input: {
1291
1291
  toolId: toolId,
1292
1292
  content: content,
@@ -1723,7 +1723,7 @@ var ClientHistory = /** @class */ (function () {
1723
1723
  _a.sent();
1724
1724
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
1725
1725
  type: "push",
1726
- source: "history",
1726
+ source: "history-bus",
1727
1727
  input: {
1728
1728
  message: message
1729
1729
  },
@@ -2134,7 +2134,7 @@ var ClientSwarm = /** @class */ (function () {
2134
2134
  _d.sent();
2135
2135
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2136
2136
  type: "cancel-output",
2137
- source: "swarm",
2137
+ source: "swarm-bus",
2138
2138
  input: {},
2139
2139
  output: {},
2140
2140
  context: {
@@ -2207,7 +2207,7 @@ var ClientSwarm = /** @class */ (function () {
2207
2207
  this.params.logger.debug("ClientSwarm swarmName=".concat(this.params.swarmName, " clientId=").concat(this.params.clientId, " waitForAgent agent miss"), { agentName: agentName, expectAgent: expectAgent });
2208
2208
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2209
2209
  type: "wait-for-output",
2210
- source: "swarm",
2210
+ source: "swarm-bus",
2211
2211
  input: {},
2212
2212
  output: {
2213
2213
  result: output,
@@ -2241,7 +2241,7 @@ var ClientSwarm = /** @class */ (function () {
2241
2241
  _b.label = 2;
2242
2242
  case 2: return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2243
2243
  type: "get-agent-name",
2244
- source: "swarm",
2244
+ source: "swarm-bus",
2245
2245
  input: {},
2246
2246
  output: {
2247
2247
  activeAgent: this._activeAgent,
@@ -2273,7 +2273,7 @@ var ClientSwarm = /** @class */ (function () {
2273
2273
  result = this.params.agentMap[agent];
2274
2274
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2275
2275
  type: "get-agent",
2276
- source: "swarm",
2276
+ source: "swarm-bus",
2277
2277
  input: {
2278
2278
  result: result,
2279
2279
  },
@@ -2306,7 +2306,7 @@ var ClientSwarm = /** @class */ (function () {
2306
2306
  this.params.agentMap[agentName] = agent;
2307
2307
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2308
2308
  type: "set-agent-ref",
2309
- source: "swarm",
2309
+ source: "swarm-bus",
2310
2310
  input: {
2311
2311
  agentName: agentName,
2312
2312
  agent: agent,
@@ -2341,7 +2341,7 @@ var ClientSwarm = /** @class */ (function () {
2341
2341
  _a.sent();
2342
2342
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2343
2343
  type: "set-agent-name",
2344
- source: "swarm",
2344
+ source: "swarm-bus",
2345
2345
  input: {
2346
2346
  agentName: agentName,
2347
2347
  },
@@ -2648,7 +2648,7 @@ var ClientSession = /** @class */ (function () {
2648
2648
  _a.sent();
2649
2649
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2650
2650
  type: "emit",
2651
- source: "session",
2651
+ source: "session-bus",
2652
2652
  input: {
2653
2653
  message: message
2654
2654
  },
@@ -2691,7 +2691,7 @@ var ClientSession = /** @class */ (function () {
2691
2691
  output = _a.sent();
2692
2692
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2693
2693
  type: "execute",
2694
- source: "session",
2694
+ source: "session-bus",
2695
2695
  input: {
2696
2696
  message: message,
2697
2697
  mode: mode,
@@ -2733,7 +2733,7 @@ var ClientSession = /** @class */ (function () {
2733
2733
  result = _a.sent();
2734
2734
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2735
2735
  type: "commit-tool-output",
2736
- source: "session",
2736
+ source: "session-bus",
2737
2737
  input: {
2738
2738
  toolId: toolId,
2739
2739
  content: content,
@@ -2771,7 +2771,7 @@ var ClientSession = /** @class */ (function () {
2771
2771
  result = _a.sent();
2772
2772
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2773
2773
  type: "commit-user-message",
2774
- source: "session",
2774
+ source: "session-bus",
2775
2775
  input: {
2776
2776
  message: message,
2777
2777
  },
@@ -2805,7 +2805,7 @@ var ClientSession = /** @class */ (function () {
2805
2805
  result = _a.sent();
2806
2806
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2807
2807
  type: "commit-flush",
2808
- source: "session",
2808
+ source: "session-bus",
2809
2809
  input: {},
2810
2810
  output: {},
2811
2811
  context: {
@@ -2840,7 +2840,7 @@ var ClientSession = /** @class */ (function () {
2840
2840
  result = _a.sent();
2841
2841
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
2842
2842
  type: "commit-system-message",
2843
- source: "session",
2843
+ source: "session-bus",
2844
2844
  input: {
2845
2845
  message: message
2846
2846
  },
@@ -2885,7 +2885,7 @@ var ClientSession = /** @class */ (function () {
2885
2885
  }); });
2886
2886
  _this.params.bus.emit(_this.params.clientId, {
2887
2887
  type: "connect",
2888
- source: "session",
2888
+ source: "session-bus",
2889
2889
  input: {},
2890
2890
  output: {},
2891
2891
  context: {
@@ -4923,7 +4923,7 @@ var ClientStorage = /** @class */ (function () {
4923
4923
  }
4924
4924
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
4925
4925
  type: "take",
4926
- source: "storage",
4926
+ source: "storage-bus",
4927
4927
  input: {
4928
4928
  search: search,
4929
4929
  total: total,
@@ -4967,7 +4967,7 @@ var ClientStorage = /** @class */ (function () {
4967
4967
  }
4968
4968
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
4969
4969
  type: "upsert",
4970
- source: "storage",
4970
+ source: "storage-bus",
4971
4971
  input: {
4972
4972
  item: item,
4973
4973
  },
@@ -5003,7 +5003,7 @@ var ClientStorage = /** @class */ (function () {
5003
5003
  }
5004
5004
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5005
5005
  type: "remove",
5006
- source: "storage",
5006
+ source: "storage-bus",
5007
5007
  input: {
5008
5008
  itemId: itemId,
5009
5009
  },
@@ -5032,7 +5032,7 @@ var ClientStorage = /** @class */ (function () {
5032
5032
  this._createEmbedding.clear();
5033
5033
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5034
5034
  type: "clear",
5035
- source: "storage",
5035
+ source: "storage-bus",
5036
5036
  input: {},
5037
5037
  output: {},
5038
5038
  context: {
@@ -5063,7 +5063,7 @@ var ClientStorage = /** @class */ (function () {
5063
5063
  result = (_a = this._itemMap.get(itemId)) !== null && _a !== void 0 ? _a : null;
5064
5064
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5065
5065
  type: "get",
5066
- source: "storage",
5066
+ source: "storage-bus",
5067
5067
  input: {
5068
5068
  itemId: itemId,
5069
5069
  },
@@ -5114,7 +5114,7 @@ var ClientStorage = /** @class */ (function () {
5114
5114
  }
5115
5115
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5116
5116
  type: "list",
5117
- source: "storage",
5117
+ source: "storage-bus",
5118
5118
  input: {},
5119
5119
  output: {
5120
5120
  result: result,
@@ -5858,7 +5858,7 @@ var ClientState = /** @class */ (function () {
5858
5858
  }
5859
5859
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5860
5860
  type: "set-state",
5861
- source: "state",
5861
+ source: "state-bus",
5862
5862
  input: {},
5863
5863
  output: {
5864
5864
  state: this._state,
@@ -5892,7 +5892,7 @@ var ClientState = /** @class */ (function () {
5892
5892
  }
5893
5893
  return [4 /*yield*/, this.params.bus.emit(this.params.clientId, {
5894
5894
  type: "get-state",
5895
- source: "state",
5895
+ source: "state-bus",
5896
5896
  input: {},
5897
5897
  output: {
5898
5898
  state: this._state,
@@ -7552,12 +7552,12 @@ var executeForce = function (content, clientId) { return __awaiter(void 0, void
7552
7552
  }); };
7553
7553
 
7554
7554
  var DISALLOWED_EVENT_SOURCE_LIST$1 = new Set([
7555
- "agent",
7556
- "history",
7557
- "session",
7558
- "state",
7559
- "storage",
7560
- "swarm",
7555
+ "agent-bus",
7556
+ "history-bus",
7557
+ "session-bus",
7558
+ "state-bus",
7559
+ "storage-bus",
7560
+ "swarm-bus",
7561
7561
  ]);
7562
7562
  var validateClientId$6 = function (clientId) {
7563
7563
  if (clientId === "*") {
@@ -7771,12 +7771,12 @@ var makeAutoDispose = function (clientId, swarmName, _a) {
7771
7771
  };
7772
7772
 
7773
7773
  var DISALLOWED_EVENT_SOURCE_LIST = new Set([
7774
- "agent",
7775
- "history",
7776
- "session",
7777
- "state",
7778
- "storage",
7779
- "swarm",
7774
+ "agent-bus",
7775
+ "history-bus",
7776
+ "session-bus",
7777
+ "state-bus",
7778
+ "storage-bus",
7779
+ "swarm-bus",
7780
7780
  ]);
7781
7781
  /**
7782
7782
  * Emits an event to the swarm bus service.
@@ -7884,7 +7884,7 @@ var listenAgentEvent = function (clientId, fn) {
7884
7884
  clientId: clientId,
7885
7885
  });
7886
7886
  validateClientId$5(clientId);
7887
- swarm.busService.subscribe(clientId, "agent", fn);
7887
+ swarm.busService.subscribe(clientId, "agent-bus", fn);
7888
7888
  };
7889
7889
 
7890
7890
  var validateClientId$4 = function (clientId) {
@@ -7906,7 +7906,7 @@ var listenHistoryEvent = function (clientId, fn) {
7906
7906
  clientId: clientId,
7907
7907
  });
7908
7908
  validateClientId$4(clientId);
7909
- swarm.busService.subscribe(clientId, "history", fn);
7909
+ swarm.busService.subscribe(clientId, "history-bus", fn);
7910
7910
  };
7911
7911
 
7912
7912
  var validateClientId$3 = function (clientId) {
@@ -7928,7 +7928,7 @@ var listenSessionEvent = function (clientId, fn) {
7928
7928
  clientId: clientId,
7929
7929
  });
7930
7930
  validateClientId$3(clientId);
7931
- swarm.busService.subscribe(clientId, "session", fn);
7931
+ swarm.busService.subscribe(clientId, "session-bus", fn);
7932
7932
  };
7933
7933
 
7934
7934
  var validateClientId$2 = function (clientId) {
@@ -7950,7 +7950,7 @@ var listenStateEvent = function (clientId, fn) {
7950
7950
  clientId: clientId,
7951
7951
  });
7952
7952
  validateClientId$2(clientId);
7953
- swarm.busService.subscribe(clientId, "state", fn);
7953
+ swarm.busService.subscribe(clientId, "state-bus", fn);
7954
7954
  };
7955
7955
 
7956
7956
  var validateClientId$1 = function (clientId) {
@@ -7972,7 +7972,7 @@ var listenStorageEvent = function (clientId, fn) {
7972
7972
  clientId: clientId,
7973
7973
  });
7974
7974
  validateClientId$1(clientId);
7975
- swarm.busService.subscribe(clientId, "storage", fn);
7975
+ swarm.busService.subscribe(clientId, "storage-bus", fn);
7976
7976
  };
7977
7977
 
7978
7978
  var validateClientId = function (clientId) {
@@ -7994,7 +7994,7 @@ var listenSwarmEvent = function (clientId, fn) {
7994
7994
  clientId: clientId,
7995
7995
  });
7996
7996
  validateClientId(clientId);
7997
- swarm.busService.subscribe(clientId, "swarm", fn);
7997
+ swarm.busService.subscribe(clientId, "swarm-bus", fn);
7998
7998
  };
7999
7999
 
8000
8000
  var StorageUtils = /** @class */ (function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.73",
3
+ "version": "1.0.74",
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
@@ -412,6 +412,10 @@ interface IBusEventContext {
412
412
  * Type representing the possible sources of an event.
413
413
  */
414
414
  type EventSource = string;
415
+ /**
416
+ * Type representing the possible sources of an event for the internal bus.
417
+ */
418
+ type EventBusSource = "agent-bus" | "history-bus" | "session-bus" | "state-bus" | "storage-bus" | "swarm-bus";
415
419
  /**
416
420
  * Interface representing the base structure of an event.
417
421
  */
@@ -425,7 +429,13 @@ interface IBaseEvent {
425
429
  */
426
430
  clientId: string;
427
431
  }
428
- interface IBusEvent extends IBaseEvent {
432
+ interface IBusEvent extends Omit<IBaseEvent, keyof {
433
+ source: never;
434
+ }> {
435
+ /**
436
+ * The source of the event.
437
+ */
438
+ source: EventBusSource;
429
439
  /**
430
440
  * The type of the event.
431
441
  */