@wix/ditto-codegen-public 1.0.503 → 1.0.504

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.
Files changed (2) hide show
  1. package/dist/out.js +27 -6
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -16328,6 +16328,7 @@ var require_validation_state = __commonJS({
16328
16328
  Object.defineProperty(exports2, "__esModule", { value: true });
16329
16329
  exports2.VALIDATION_NUDGE = exports2.USER_SOURCE_SCAN = exports2.USER_ATTACHMENTS_LIST = exports2.VALIDATION_STATE_PLUGIN_FILENAME = exports2.VALIDATION_LOADED_EVENT_TYPE = exports2.VALIDATION_STATE_EVENT_TYPE = void 0;
16330
16330
  exports2.isReadOnlyShellCommand = isReadOnlyShellCommand;
16331
+ exports2.validationFailureDetail = validationFailureDetail;
16331
16332
  exports2.buildValidationStateSource = buildValidationStateSource;
16332
16333
  exports2.writeValidationStatePlugin = writeValidationStatePlugin;
16333
16334
  var write_plugin_1 = require_write_plugin();
@@ -16345,6 +16346,17 @@ var require_validation_state = __commonJS({
16345
16346
  exports2.USER_ATTACHMENTS_LIST = ".wix/agentInput/userAttachments.json";
16346
16347
  exports2.USER_SOURCE_SCAN = `${skills_override_12.SKILLS_DIR}/wix-app/scripts/scan-user-source.cjs`;
16347
16348
  exports2.VALIDATION_NUDGE = "Project files need validation. Follow your validation workflow (delegate to codegen-validator if your instructions require it), run validate({ runBuild: true }), and fix any errors before finishing. Your last message is shown to the user: once validation passes, end with a short plain-language summary for them: what changed, and if there is something you could not do, why and what they need to do next. Do not mention validation.";
16349
+ function validationFailureDetail(output) {
16350
+ const MAX_FAILURE_DETAIL_CHARS = 1800;
16351
+ const TRUNCATED_MARKER = "\n[truncated]";
16352
+ if (typeof output !== "string")
16353
+ return void 0;
16354
+ const start = output.search(/^FAILED at/m);
16355
+ if (start === -1)
16356
+ return void 0;
16357
+ const detail = output.slice(start).trim();
16358
+ return detail.length > MAX_FAILURE_DETAIL_CHARS ? detail.slice(0, MAX_FAILURE_DETAIL_CHARS - TRUNCATED_MARKER.length) + TRUNCATED_MARKER : detail;
16359
+ }
16348
16360
  function buildValidationStateSource() {
16349
16361
  return String.raw`// Generated by @wix/ditto-codegen (validation-state). Do not edit.
16350
16362
  const EVENT_TYPE = ${JSON.stringify(exports2.VALIDATION_STATE_EVENT_TYPE)};
@@ -16355,6 +16367,7 @@ const injectCreatedBy = ${detect_1.injectCreatedBy.toString()};
16355
16367
  const prepareCreatedExtensionFiles = ${prepare_created_by_1.prepareCreatedExtensionFiles.toString()};
16356
16368
  const isMissingGitRepository = ${repository_status_1.isMissingGitRepository.toString()};
16357
16369
  const isReadOnlyShellCommand = ${isReadOnlyShellCommand.toString()};
16370
+ const validationFailureDetail = ${validationFailureDetail.toString()};
16358
16371
  const USER_ATTACHMENTS_LIST = ${JSON.stringify(exports2.USER_ATTACHMENTS_LIST)};
16359
16372
  const USER_SOURCE_SCAN = ${JSON.stringify(exports2.USER_SOURCE_SCAN)};
16360
16373
  const changedEditorComponents = ${user_source_port_1.changedEditorComponents.toString()};
@@ -16440,7 +16453,8 @@ export const ValidationState = async ({ client, directory, $ }) => {
16440
16453
  let currentFingerprint = cleanFingerprint;
16441
16454
  let hasValidationFailure = process.env.CODEGEN_REQUIRE_VALIDATION === "1";
16442
16455
  let hasUnvalidatedMutation = false;
16443
- let lastClean;
16456
+ let lastRow;
16457
+ let currentFailure;
16444
16458
  let mutationEpoch = 0;
16445
16459
  let revisionNudges = 0;
16446
16460
  let totalNudges = 0;
@@ -16449,9 +16463,11 @@ export const ValidationState = async ({ client, directory, $ }) => {
16449
16463
  const activeMutations = new Set();
16450
16464
  const key = (input) => input.sessionID + ":" + input.callID;
16451
16465
  const emit = (sessionID, clean) => {
16452
- if (lastClean === clean) return;
16453
- lastClean = clean;
16454
- process.stdout.write(JSON.stringify({ type: EVENT_TYPE, sessionID, clean }) + "\n");
16466
+ const failure = clean ? undefined : currentFailure;
16467
+ const rowKey = JSON.stringify([clean, failure]);
16468
+ if (lastRow === rowKey) return;
16469
+ lastRow = rowKey;
16470
+ process.stdout.write(JSON.stringify({ type: EVENT_TYPE, sessionID, clean, ...(failure ? { failure } : {}) }) + "\n");
16455
16471
  };
16456
16472
  const refresh = async (sessionID) => {
16457
16473
  const fingerprint = await snapshot();
@@ -16488,6 +16504,7 @@ export const ValidationState = async ({ client, directory, $ }) => {
16488
16504
  // discarded that validation. The after hook still compares fingerprints.
16489
16505
  if (input.tool === "bash" && typeof args.command === "string" && isReadOnlyShellCommand(args.command)) return;
16490
16506
  hasUnvalidatedMutation = true;
16507
+ currentFailure = undefined;
16491
16508
  revisionNudges = 0;
16492
16509
  mutationEpoch += 1;
16493
16510
  activeMutations.add(key(input));
@@ -16504,6 +16521,9 @@ export const ValidationState = async ({ client, directory, $ }) => {
16504
16521
  validations.delete(key(input));
16505
16522
  const passed = typeof output.output === "string" && !/^FAILED at/m.test(output.output);
16506
16523
  if (!passed) hasValidationFailure = true;
16524
+ if (input.args?.runBuild === true && epoch !== undefined && epoch === mutationEpoch && activeMutations.size === 0) {
16525
+ currentFailure = passed ? undefined : validationFailureDetail(output.output);
16526
+ }
16507
16527
  if (passed && input.args?.runBuild === true) {
16508
16528
  const fingerprint = await snapshot();
16509
16529
  if (epoch === mutationEpoch && activeMutations.size === 0 && validations.size === 0) {
@@ -16586,7 +16606,7 @@ var require_parser = __commonJS({
16586
16606
  if (event?.type !== validation_state_1.VALIDATION_STATE_EVENT_TYPE || typeof event.sessionID !== "string" || typeof event.clean !== "boolean") {
16587
16607
  continue;
16588
16608
  }
16589
- validationState = event;
16609
+ validationState = typeof event.failure === "string" ? event : { ...event, failure: void 0 };
16590
16610
  }
16591
16611
  return validationState;
16592
16612
  }
@@ -18288,7 +18308,8 @@ var require_session_validation = __commonJS({
18288
18308
  }
18289
18309
  throw new host_validation_1.HostValidationError("agent validation state", "validate({ runBuild: true })", {
18290
18310
  exitCode: 1,
18291
- stderr: "Project files remain unvalidated after the in-session validation reminders."
18311
+ stderr: validationState.failure ? `The last validate({ runBuild: true }) failed and no file changed after it:
18312
+ ${validationState.failure}` : "Project files remain unvalidated after the in-session validation reminders."
18292
18313
  });
18293
18314
  }
18294
18315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.503",
3
+ "version": "1.0.504",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -29,5 +29,5 @@
29
29
  "esbuild": "^0.27.2",
30
30
  "vitest": "^4.0.16"
31
31
  },
32
- "falconPackageHash": "d965932418695e3e0db9ffd3b44d18df666b2dd1ea1c338dea0d5493"
32
+ "falconPackageHash": "aaff4b292f969433a252c3409ae065214add5e83b52dfd2c9634273a"
33
33
  }