agent-swarm-kit 1.1.111 → 1.1.112

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
@@ -21016,16 +21016,22 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21016
21016
  ...inputArgs,
21017
21017
  data,
21018
21018
  };
21019
+ let isValid = true;
21019
21020
  for (const validation of validations) {
21020
21021
  const validate = typeof validation === "object" ? validation.validate : validation;
21021
21022
  try {
21022
21023
  await validate(validationArgs);
21023
21024
  }
21024
21025
  catch (error) {
21026
+ isValid = false;
21025
21027
  errorMessage = functoolsKit.getErrorMessage(error);
21028
+ break;
21026
21029
  }
21027
21030
  }
21028
- return {
21031
+ if (!isValid) {
21032
+ continue;
21033
+ }
21034
+ const result = {
21029
21035
  isValid: true,
21030
21036
  attempt,
21031
21037
  param,
@@ -21033,8 +21039,12 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21033
21039
  data,
21034
21040
  resultId,
21035
21041
  };
21042
+ if (callbacks?.onValidDocument) {
21043
+ callbacks.onValidDocument(result);
21044
+ }
21045
+ return result;
21036
21046
  }
21037
- return {
21047
+ const result = {
21038
21048
  isValid: false,
21039
21049
  error: errorMessage ?? "Unknown error",
21040
21050
  attempt: maxAttempts,
@@ -21043,6 +21053,10 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21043
21053
  data: null,
21044
21054
  resultId,
21045
21055
  };
21056
+ if (callbacks?.onInvalidDocument) {
21057
+ callbacks.onInvalidDocument(result);
21058
+ }
21059
+ return result;
21046
21060
  });
21047
21061
  /**
21048
21062
  * Processes an outline request to generate structured JSON data based on a specified outline schema.
package/build/index.mjs CHANGED
@@ -21014,16 +21014,22 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21014
21014
  ...inputArgs,
21015
21015
  data,
21016
21016
  };
21017
+ let isValid = true;
21017
21018
  for (const validation of validations) {
21018
21019
  const validate = typeof validation === "object" ? validation.validate : validation;
21019
21020
  try {
21020
21021
  await validate(validationArgs);
21021
21022
  }
21022
21023
  catch (error) {
21024
+ isValid = false;
21023
21025
  errorMessage = getErrorMessage(error);
21026
+ break;
21024
21027
  }
21025
21028
  }
21026
- return {
21029
+ if (!isValid) {
21030
+ continue;
21031
+ }
21032
+ const result = {
21027
21033
  isValid: true,
21028
21034
  attempt,
21029
21035
  param,
@@ -21031,8 +21037,12 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21031
21037
  data,
21032
21038
  resultId,
21033
21039
  };
21040
+ if (callbacks?.onValidDocument) {
21041
+ callbacks.onValidDocument(result);
21042
+ }
21043
+ return result;
21034
21044
  }
21035
- return {
21045
+ const result = {
21036
21046
  isValid: false,
21037
21047
  error: errorMessage ?? "Unknown error",
21038
21048
  attempt: maxAttempts,
@@ -21041,6 +21051,10 @@ const jsonInternal = beginContext(async (outlineName, param) => {
21041
21051
  data: null,
21042
21052
  resultId,
21043
21053
  };
21054
+ if (callbacks?.onInvalidDocument) {
21055
+ callbacks.onInvalidDocument(result);
21056
+ }
21057
+ return result;
21044
21058
  });
21045
21059
  /**
21046
21060
  * Processes an outline request to generate structured JSON data based on a specified outline schema.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-swarm-kit",
3
- "version": "1.1.111",
3
+ "version": "1.1.112",
4
4
  "description": "A TypeScript library for building orchestrated framework-agnostic multi-agent AI systems",
5
5
  "author": {
6
6
  "name": "Petr Tripolsky",