agent-swarm-kit 1.0.239 → 1.0.241

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
@@ -2958,7 +2958,7 @@ class OperatorUtils {
2958
2958
  clientId,
2959
2959
  agentName,
2960
2960
  });
2961
- const isInitial = this.getOperator.has(`${clientId}-${agentName}`);
2961
+ const isInitial = !this.getOperator.has(`${clientId}-${agentName}`);
2962
2962
  const operator = this.getOperator(clientId, agentName);
2963
2963
  isInitial && operator.init();
2964
2964
  return (message, next) => {
@@ -3572,7 +3572,7 @@ const RUN_FN = async (incoming, self) => {
3572
3572
  self.params.logger.debug(`ClientAgent agentName=${self.params.agentName} clientId=${self.params.clientId} run begin`, { incoming });
3573
3573
  self.params.onRun &&
3574
3574
  self.params.onRun(self.params.clientId, self.params.agentName, incoming);
3575
- const messages = await self.params.history.toArrayForAgent(self.params.prompt, await self._resolveSystemPrompt());
3575
+ const messages = await self.params.history.toArrayForAgent(self.params.prompt ?? "", await self._resolveSystemPrompt());
3576
3576
  messages.push({
3577
3577
  agentName: self.params.agentName,
3578
3578
  content: incoming,
@@ -4049,7 +4049,7 @@ class ClientAgent {
4049
4049
  async getCompletion(mode) {
4050
4050
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
4051
4051
  this.params.logger.debug(`ClientAgent agentName=${this.params.agentName} clientId=${this.params.clientId} getCompletion`);
4052
- const messages = await this.params.history.toArrayForAgent(this.params.prompt, await this._resolveSystemPrompt());
4052
+ const messages = await this.params.history.toArrayForAgent(this.params.prompt ?? "", await this._resolveSystemPrompt());
4053
4053
  const args = {
4054
4054
  clientId: this.params.clientId,
4055
4055
  agentName: this.params.agentName,
@@ -4093,7 +4093,7 @@ class ClientAgent {
4093
4093
  agentName: this.params.agentName,
4094
4094
  content: GLOBAL_CONFIG.CC_TOOL_CALL_EXCEPTION_RECOMPLETE_PROMPT,
4095
4095
  });
4096
- const messages = await this.params.history.toArrayForAgent(this.params.prompt, await this._resolveSystemPrompt());
4096
+ const messages = await this.params.history.toArrayForAgent(this.params.prompt ?? "", await this._resolveSystemPrompt());
4097
4097
  const args = {
4098
4098
  clientId: this.params.clientId,
4099
4099
  agentName: this.params.agentName,
@@ -4990,7 +4990,7 @@ class ClientHistory {
4990
4990
  });
4991
4991
  const promptMessages = [];
4992
4992
  {
4993
- promptMessages.push({
4993
+ prompt && promptMessages.push({
4994
4994
  agentName: this.params.agentName,
4995
4995
  mode: "tool",
4996
4996
  content: prompt,
@@ -11500,10 +11500,14 @@ class DocService {
11500
11500
  }
11501
11501
  result.push("");
11502
11502
  }
11503
- {
11503
+ if (agentSchema.completion) {
11504
11504
  result.push(`**Completion:** \`${agentSchema.completion}\``);
11505
11505
  result.push("");
11506
11506
  }
11507
+ {
11508
+ result.push(`*Operator:* [${agentSchema.operator ? "x" : " "}]`);
11509
+ result.push("");
11510
+ }
11507
11511
  {
11508
11512
  const umlSchema = this.agentMetaService.toUML(agentSchema.agentName, true);
11509
11513
  const umlName = `agent_schema_${agentSchema.agentName}.svg`;
package/build/index.mjs CHANGED
@@ -2956,7 +2956,7 @@ class OperatorUtils {
2956
2956
  clientId,
2957
2957
  agentName,
2958
2958
  });
2959
- const isInitial = this.getOperator.has(`${clientId}-${agentName}`);
2959
+ const isInitial = !this.getOperator.has(`${clientId}-${agentName}`);
2960
2960
  const operator = this.getOperator(clientId, agentName);
2961
2961
  isInitial && operator.init();
2962
2962
  return (message, next) => {
@@ -3570,7 +3570,7 @@ const RUN_FN = async (incoming, self) => {
3570
3570
  self.params.logger.debug(`ClientAgent agentName=${self.params.agentName} clientId=${self.params.clientId} run begin`, { incoming });
3571
3571
  self.params.onRun &&
3572
3572
  self.params.onRun(self.params.clientId, self.params.agentName, incoming);
3573
- const messages = await self.params.history.toArrayForAgent(self.params.prompt, await self._resolveSystemPrompt());
3573
+ const messages = await self.params.history.toArrayForAgent(self.params.prompt ?? "", await self._resolveSystemPrompt());
3574
3574
  messages.push({
3575
3575
  agentName: self.params.agentName,
3576
3576
  content: incoming,
@@ -4047,7 +4047,7 @@ class ClientAgent {
4047
4047
  async getCompletion(mode) {
4048
4048
  GLOBAL_CONFIG.CC_LOGGER_ENABLE_DEBUG &&
4049
4049
  this.params.logger.debug(`ClientAgent agentName=${this.params.agentName} clientId=${this.params.clientId} getCompletion`);
4050
- const messages = await this.params.history.toArrayForAgent(this.params.prompt, await this._resolveSystemPrompt());
4050
+ const messages = await this.params.history.toArrayForAgent(this.params.prompt ?? "", await this._resolveSystemPrompt());
4051
4051
  const args = {
4052
4052
  clientId: this.params.clientId,
4053
4053
  agentName: this.params.agentName,
@@ -4091,7 +4091,7 @@ class ClientAgent {
4091
4091
  agentName: this.params.agentName,
4092
4092
  content: GLOBAL_CONFIG.CC_TOOL_CALL_EXCEPTION_RECOMPLETE_PROMPT,
4093
4093
  });
4094
- const messages = await this.params.history.toArrayForAgent(this.params.prompt, await this._resolveSystemPrompt());
4094
+ const messages = await this.params.history.toArrayForAgent(this.params.prompt ?? "", await this._resolveSystemPrompt());
4095
4095
  const args = {
4096
4096
  clientId: this.params.clientId,
4097
4097
  agentName: this.params.agentName,
@@ -4988,7 +4988,7 @@ class ClientHistory {
4988
4988
  });
4989
4989
  const promptMessages = [];
4990
4990
  {
4991
- promptMessages.push({
4991
+ prompt && promptMessages.push({
4992
4992
  agentName: this.params.agentName,
4993
4993
  mode: "tool",
4994
4994
  content: prompt,
@@ -11498,10 +11498,14 @@ class DocService {
11498
11498
  }
11499
11499
  result.push("");
11500
11500
  }
11501
- {
11501
+ if (agentSchema.completion) {
11502
11502
  result.push(`**Completion:** \`${agentSchema.completion}\``);
11503
11503
  result.push("");
11504
11504
  }
11505
+ {
11506
+ result.push(`*Operator:* [${agentSchema.operator ? "x" : " "}]`);
11507
+ result.push("");
11508
+ }
11505
11509
  {
11506
11510
  const umlSchema = this.agentMetaService.toUML(agentSchema.agentName, true);
11507
11511
  const umlName = `agent_schema_${agentSchema.agentName}.svg`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.0.239",
3
+ "version": "1.0.241",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",