agent-swarm-kit 1.1.132 → 1.1.134

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
@@ -3729,6 +3729,7 @@ const createToolCall = async (idx, tool, toolCalls, targetFn, reason, self) => {
3729
3729
  toolId: tool.id,
3730
3730
  clientId: self.params.clientId,
3731
3731
  agentName: self.params.agentName,
3732
+ toolName: tool.function.name,
3732
3733
  params: tool.function.arguments,
3733
3734
  isLast: idx === toolCalls.length - 1,
3734
3735
  abortSignal: self._toolAbortController.signal,
@@ -13309,6 +13310,13 @@ class DocService {
13309
13310
  * @private
13310
13311
  */
13311
13312
  this.stateSchemaService = inject(TYPES.stateSchemaService);
13313
+ /**
13314
+ * Completion schema service instance, injected via DI.
13315
+ * Provides completion details for writeAgentDoc, documenting completion resources used by agents.
13316
+ * @type {CompletionSchemaService}
13317
+ * @private
13318
+ */
13319
+ this.completionSchemaService = inject(TYPES.completionSchemaService);
13312
13320
  /**
13313
13321
  * Compute schema service instance, injected via DI.
13314
13322
  * Provides compute details for writeAgentDoc, documenting compute resources used by agents.
@@ -13480,6 +13488,21 @@ class DocService {
13480
13488
  result.push(`**Completion:** \`${sanitizeMarkdown(outlineSchema.completion)}\``);
13481
13489
  result.push("");
13482
13490
  }
13491
+ if (outlineSchema.completion) {
13492
+ const { flags = [] } = this.completionSchemaService.get(outlineSchema.completion);
13493
+ if (flags.length) {
13494
+ result.push(`## Completion flags`);
13495
+ result.push("");
13496
+ for (let i = 0; i !== flags.length; i++) {
13497
+ if (!flags[i]) {
13498
+ continue;
13499
+ }
13500
+ result.push(`${i + 1}. \`${sanitizeMarkdown(flags[i])}\``);
13501
+ result.push("");
13502
+ }
13503
+ }
13504
+ result.push("");
13505
+ }
13483
13506
  const getPrompt = async () => {
13484
13507
  try {
13485
13508
  if (typeof outlineSchema.prompt === "string") {
@@ -13658,6 +13681,21 @@ class DocService {
13658
13681
  result.push(`*Operator:* [${agentSchema.operator ? "x" : " "}]`);
13659
13682
  result.push("");
13660
13683
  }
13684
+ if (agentSchema.completion) {
13685
+ const { flags = [] } = this.completionSchemaService.get(agentSchema.completion);
13686
+ if (flags.length) {
13687
+ result.push(`## Completion flags`);
13688
+ result.push("");
13689
+ for (let i = 0; i !== flags.length; i++) {
13690
+ if (!flags[i]) {
13691
+ continue;
13692
+ }
13693
+ result.push(`${i + 1}. \`${sanitizeMarkdown(flags[i])}\``);
13694
+ result.push("");
13695
+ }
13696
+ }
13697
+ result.push("");
13698
+ }
13661
13699
  {
13662
13700
  const umlSchema = this.agentMetaService.toUML(agentSchema.agentName, true);
13663
13701
  const umlName = `agent_schema_${agentSchema.agentName}.svg`;
package/build/index.mjs CHANGED
@@ -3727,6 +3727,7 @@ const createToolCall = async (idx, tool, toolCalls, targetFn, reason, self) => {
3727
3727
  toolId: tool.id,
3728
3728
  clientId: self.params.clientId,
3729
3729
  agentName: self.params.agentName,
3730
+ toolName: tool.function.name,
3730
3731
  params: tool.function.arguments,
3731
3732
  isLast: idx === toolCalls.length - 1,
3732
3733
  abortSignal: self._toolAbortController.signal,
@@ -13307,6 +13308,13 @@ class DocService {
13307
13308
  * @private
13308
13309
  */
13309
13310
  this.stateSchemaService = inject(TYPES.stateSchemaService);
13311
+ /**
13312
+ * Completion schema service instance, injected via DI.
13313
+ * Provides completion details for writeAgentDoc, documenting completion resources used by agents.
13314
+ * @type {CompletionSchemaService}
13315
+ * @private
13316
+ */
13317
+ this.completionSchemaService = inject(TYPES.completionSchemaService);
13310
13318
  /**
13311
13319
  * Compute schema service instance, injected via DI.
13312
13320
  * Provides compute details for writeAgentDoc, documenting compute resources used by agents.
@@ -13478,6 +13486,21 @@ class DocService {
13478
13486
  result.push(`**Completion:** \`${sanitizeMarkdown(outlineSchema.completion)}\``);
13479
13487
  result.push("");
13480
13488
  }
13489
+ if (outlineSchema.completion) {
13490
+ const { flags = [] } = this.completionSchemaService.get(outlineSchema.completion);
13491
+ if (flags.length) {
13492
+ result.push(`## Completion flags`);
13493
+ result.push("");
13494
+ for (let i = 0; i !== flags.length; i++) {
13495
+ if (!flags[i]) {
13496
+ continue;
13497
+ }
13498
+ result.push(`${i + 1}. \`${sanitizeMarkdown(flags[i])}\``);
13499
+ result.push("");
13500
+ }
13501
+ }
13502
+ result.push("");
13503
+ }
13481
13504
  const getPrompt = async () => {
13482
13505
  try {
13483
13506
  if (typeof outlineSchema.prompt === "string") {
@@ -13656,6 +13679,21 @@ class DocService {
13656
13679
  result.push(`*Operator:* [${agentSchema.operator ? "x" : " "}]`);
13657
13680
  result.push("");
13658
13681
  }
13682
+ if (agentSchema.completion) {
13683
+ const { flags = [] } = this.completionSchemaService.get(agentSchema.completion);
13684
+ if (flags.length) {
13685
+ result.push(`## Completion flags`);
13686
+ result.push("");
13687
+ for (let i = 0; i !== flags.length; i++) {
13688
+ if (!flags[i]) {
13689
+ continue;
13690
+ }
13691
+ result.push(`${i + 1}. \`${sanitizeMarkdown(flags[i])}\``);
13692
+ result.push("");
13693
+ }
13694
+ }
13695
+ result.push("");
13696
+ }
13659
13697
  {
13660
13698
  const umlSchema = this.agentMetaService.toUML(agentSchema.agentName, true);
13661
13699
  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.1.132",
3
+ "version": "1.1.134",
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
@@ -3556,6 +3556,8 @@ interface IMCPToolCallDto<T extends MCPToolValue = MCPToolValue> {
3556
3556
  clientId: string;
3557
3557
  /** Name of the agent associated with the tool call. */
3558
3558
  agentName: AgentName;
3559
+ /** Name of the tool associated with the tool call */
3560
+ toolName: ToolName;
3559
3561
  /** Parameters for the tool call. */
3560
3562
  params: T;
3561
3563
  /** Array of tool calls associated with this request. */
@@ -3770,6 +3772,7 @@ interface IAgentTool<T = Record<string, ToolValue>> {
3770
3772
  * @param {string} dto.toolId - The unique `tool_call_id` for tracking in OpenAI-style history.
3771
3773
  * @param {string} dto.clientId - The ID of the client invoking the tool.
3772
3774
  * @param {AgentName} dto.agentName - The name of the agent using the tool.
3775
+ * @param {ToolName} dto.toolName - The name of the tool associated with the tool call
3773
3776
  * @param {T} dto.params - The parameters for the tool execution.
3774
3777
  * @param {IToolCall[]} dto.toolCalls - The list of tool calls in the current execution context.
3775
3778
  * @param {boolean} dto.isLast - Indicates if this is the last tool call in a sequence.
@@ -3780,6 +3783,7 @@ interface IAgentTool<T = Record<string, ToolValue>> {
3780
3783
  toolId: string;
3781
3784
  clientId: string;
3782
3785
  agentName: AgentName;
3786
+ toolName: ToolName;
3783
3787
  params: T;
3784
3788
  toolCalls: IToolCall[];
3785
3789
  abortSignal: TAbortSignal;
@@ -8658,6 +8662,13 @@ declare class DocService {
8658
8662
  * @private
8659
8663
  */
8660
8664
  private readonly stateSchemaService;
8665
+ /**
8666
+ * Completion schema service instance, injected via DI.
8667
+ * Provides completion details for writeAgentDoc, documenting completion resources used by agents.
8668
+ * @type {CompletionSchemaService}
8669
+ * @private
8670
+ */
8671
+ private readonly completionSchemaService;
8661
8672
  /**
8662
8673
  * Compute schema service instance, injected via DI.
8663
8674
  * Provides compute details for writeAgentDoc, documenting compute resources used by agents.