@wayai/cli 0.3.102 → 0.3.103

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/dist/index.js CHANGED
@@ -11970,6 +11970,7 @@ var push_exports = {};
11970
11970
  __export(push_exports, {
11971
11971
  autoRenameAgentFiles: () => autoRenameAgentFiles,
11972
11972
  createAndPushNewHub: () => createAndPushNewHub,
11973
+ printErrors: () => printErrors,
11973
11974
  printSyncResult: () => printSyncResult,
11974
11975
  printWarnings: () => printWarnings,
11975
11976
  pushCommand: () => pushCommand,
@@ -12000,6 +12001,10 @@ function shouldWarnIgnoredPreviewLabel(localLabel, serverLabel) {
12000
12001
  return Boolean(localLabel) && serverLabel !== void 0 && localLabel !== serverLabel;
12001
12002
  }
12002
12003
  function printSyncResult(result) {
12004
+ if (result.errors && result.errors.length > 0) {
12005
+ printErrors(result.errors);
12006
+ throw new Error(`Sync failed with ${result.errors.length} error(s). No completion was reported; inspect the errors above.`);
12007
+ }
12003
12008
  console.log(`
12004
12009
  Sync complete. Preview hub: ${result.preview_hub_id}`);
12005
12010
  const c = result.changes;
@@ -12046,9 +12051,6 @@ Sync complete. Preview hub: ${result.preview_hub_id}`);
12046
12051
  if (parts.length > 0) {
12047
12052
  console.log(`Changes: ${parts.join(", ")}`);
12048
12053
  }
12049
- if (result.errors && result.errors.length > 0) {
12050
- printWarnings(result.errors);
12051
- }
12052
12054
  if (result.warnings && result.warnings.length > 0) {
12053
12055
  printWarnings(result.warnings.map((w) => w.message));
12054
12056
  }
@@ -12061,6 +12063,14 @@ function printWarnings(warnings) {
12061
12063
  console.log(` \x1B[33m! ${w}\x1B[0m`);
12062
12064
  }
12063
12065
  }
12066
+ function printErrors(errors) {
12067
+ if (errors.length === 0) return;
12068
+ console.error(`
12069
+ \x1B[31mErrors (${errors.length}):\x1B[0m`);
12070
+ for (const error of errors) {
12071
+ console.error(` \x1B[31m! ${error}\x1B[0m`);
12072
+ }
12073
+ }
12064
12074
  async function autoRenameAgentFiles(client, hubId, hubFolder, organizationId) {
12065
12075
  const agentsDir = path15.join(hubFolder, "agents");
12066
12076
  let agentsWithIds = [];