agent-swarm-kit 1.1.131 → 1.1.133

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
@@ -13309,6 +13309,13 @@ class DocService {
13309
13309
  * @private
13310
13310
  */
13311
13311
  this.stateSchemaService = inject(TYPES.stateSchemaService);
13312
+ /**
13313
+ * Completion schema service instance, injected via DI.
13314
+ * Provides completion details for writeAgentDoc, documenting completion resources used by agents.
13315
+ * @type {CompletionSchemaService}
13316
+ * @private
13317
+ */
13318
+ this.completionSchemaService = inject(TYPES.completionSchemaService);
13312
13319
  /**
13313
13320
  * Compute schema service instance, injected via DI.
13314
13321
  * Provides compute details for writeAgentDoc, documenting compute resources used by agents.
@@ -13480,6 +13487,21 @@ class DocService {
13480
13487
  result.push(`**Completion:** \`${sanitizeMarkdown(outlineSchema.completion)}\``);
13481
13488
  result.push("");
13482
13489
  }
13490
+ if (outlineSchema.completion) {
13491
+ const { flags = [] } = this.completionSchemaService.get(outlineSchema.completion);
13492
+ if (flags.length) {
13493
+ result.push(`## Completion flags`);
13494
+ result.push("");
13495
+ for (let i = 0; i !== flags.length; i++) {
13496
+ if (!flags[i]) {
13497
+ continue;
13498
+ }
13499
+ result.push(`${i + 1}. \`${sanitizeMarkdown(flags[i])}\``);
13500
+ result.push("");
13501
+ }
13502
+ }
13503
+ result.push("");
13504
+ }
13483
13505
  const getPrompt = async () => {
13484
13506
  try {
13485
13507
  if (typeof outlineSchema.prompt === "string") {
@@ -13658,6 +13680,21 @@ class DocService {
13658
13680
  result.push(`*Operator:* [${agentSchema.operator ? "x" : " "}]`);
13659
13681
  result.push("");
13660
13682
  }
13683
+ if (agentSchema.completion) {
13684
+ const { flags = [] } = this.completionSchemaService.get(agentSchema.completion);
13685
+ if (flags.length) {
13686
+ result.push(`## Completion flags`);
13687
+ result.push("");
13688
+ for (let i = 0; i !== flags.length; i++) {
13689
+ if (!flags[i]) {
13690
+ continue;
13691
+ }
13692
+ result.push(`${i + 1}. \`${sanitizeMarkdown(flags[i])}\``);
13693
+ result.push("");
13694
+ }
13695
+ }
13696
+ result.push("");
13697
+ }
13661
13698
  {
13662
13699
  const umlSchema = this.agentMetaService.toUML(agentSchema.agentName, true);
13663
13700
  const umlName = `agent_schema_${agentSchema.agentName}.svg`;
@@ -21311,6 +21348,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21311
21348
  });
21312
21349
  }
21313
21350
  };
21351
+ let lastData = null;
21314
21352
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
21315
21353
  await makeHistory();
21316
21354
  const inputArgs = {
@@ -21339,6 +21377,9 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21339
21377
  }, output);
21340
21378
  }
21341
21379
  const data = JSON.parse(output.content);
21380
+ {
21381
+ lastData = data;
21382
+ }
21342
21383
  const validationArgs = {
21343
21384
  ...inputArgs,
21344
21385
  data,
@@ -21364,6 +21405,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21364
21405
  errorMessage = functoolsKit.getErrorMessage(error);
21365
21406
  console.error(`agent-swarm outline error outlineName=${outlineName} attempt=${attempt}`, {
21366
21407
  param,
21408
+ lastData,
21367
21409
  errorMessage,
21368
21410
  });
21369
21411
  }
package/build/index.mjs CHANGED
@@ -13307,6 +13307,13 @@ class DocService {
13307
13307
  * @private
13308
13308
  */
13309
13309
  this.stateSchemaService = inject(TYPES.stateSchemaService);
13310
+ /**
13311
+ * Completion schema service instance, injected via DI.
13312
+ * Provides completion details for writeAgentDoc, documenting completion resources used by agents.
13313
+ * @type {CompletionSchemaService}
13314
+ * @private
13315
+ */
13316
+ this.completionSchemaService = inject(TYPES.completionSchemaService);
13310
13317
  /**
13311
13318
  * Compute schema service instance, injected via DI.
13312
13319
  * Provides compute details for writeAgentDoc, documenting compute resources used by agents.
@@ -13478,6 +13485,21 @@ class DocService {
13478
13485
  result.push(`**Completion:** \`${sanitizeMarkdown(outlineSchema.completion)}\``);
13479
13486
  result.push("");
13480
13487
  }
13488
+ if (outlineSchema.completion) {
13489
+ const { flags = [] } = this.completionSchemaService.get(outlineSchema.completion);
13490
+ if (flags.length) {
13491
+ result.push(`## Completion flags`);
13492
+ result.push("");
13493
+ for (let i = 0; i !== flags.length; i++) {
13494
+ if (!flags[i]) {
13495
+ continue;
13496
+ }
13497
+ result.push(`${i + 1}. \`${sanitizeMarkdown(flags[i])}\``);
13498
+ result.push("");
13499
+ }
13500
+ }
13501
+ result.push("");
13502
+ }
13481
13503
  const getPrompt = async () => {
13482
13504
  try {
13483
13505
  if (typeof outlineSchema.prompt === "string") {
@@ -13656,6 +13678,21 @@ class DocService {
13656
13678
  result.push(`*Operator:* [${agentSchema.operator ? "x" : " "}]`);
13657
13679
  result.push("");
13658
13680
  }
13681
+ if (agentSchema.completion) {
13682
+ const { flags = [] } = this.completionSchemaService.get(agentSchema.completion);
13683
+ if (flags.length) {
13684
+ result.push(`## Completion flags`);
13685
+ result.push("");
13686
+ for (let i = 0; i !== flags.length; i++) {
13687
+ if (!flags[i]) {
13688
+ continue;
13689
+ }
13690
+ result.push(`${i + 1}. \`${sanitizeMarkdown(flags[i])}\``);
13691
+ result.push("");
13692
+ }
13693
+ }
13694
+ result.push("");
13695
+ }
13659
13696
  {
13660
13697
  const umlSchema = this.agentMetaService.toUML(agentSchema.agentName, true);
13661
13698
  const umlName = `agent_schema_${agentSchema.agentName}.svg`;
@@ -21309,6 +21346,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21309
21346
  });
21310
21347
  }
21311
21348
  };
21349
+ let lastData = null;
21312
21350
  for (let attempt = 0; attempt < maxAttempts; attempt++) {
21313
21351
  await makeHistory();
21314
21352
  const inputArgs = {
@@ -21337,6 +21375,9 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21337
21375
  }, output);
21338
21376
  }
21339
21377
  const data = JSON.parse(output.content);
21378
+ {
21379
+ lastData = data;
21380
+ }
21340
21381
  const validationArgs = {
21341
21382
  ...inputArgs,
21342
21383
  data,
@@ -21362,6 +21403,7 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21362
21403
  errorMessage = getErrorMessage(error);
21363
21404
  console.error(`agent-swarm outline error outlineName=${outlineName} attempt=${attempt}`, {
21364
21405
  param,
21406
+ lastData,
21365
21407
  errorMessage,
21366
21408
  });
21367
21409
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.131",
3
+ "version": "1.1.133",
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
@@ -8658,6 +8658,13 @@ declare class DocService {
8658
8658
  * @private
8659
8659
  */
8660
8660
  private readonly stateSchemaService;
8661
+ /**
8662
+ * Completion schema service instance, injected via DI.
8663
+ * Provides completion details for writeAgentDoc, documenting completion resources used by agents.
8664
+ * @type {CompletionSchemaService}
8665
+ * @private
8666
+ */
8667
+ private readonly completionSchemaService;
8661
8668
  /**
8662
8669
  * Compute schema service instance, injected via DI.
8663
8670
  * Provides compute details for writeAgentDoc, documenting compute resources used by agents.