@wix/ditto-codegen-public 1.0.477 → 1.0.479

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 +22 -37
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -12830,7 +12830,6 @@ var require_checkpoint = __commonJS({
12830
12830
  var types_1 = require_types_impl3();
12831
12831
  var http_client_1 = require_index_node();
12832
12832
  var FALLBACK_COMMIT_MESSAGE = "Auto-save";
12833
- var EML_MARKER = "generate-eml.ts";
12834
12833
  var SET_COMMIT_MESSAGE_TOOL = "set-commit-message";
12835
12834
  var MAX_CHECKPOINT_ERROR_LENGTH = 1e3;
12836
12835
  var TRUNCATION_SUFFIX = "\u2026";
@@ -12945,12 +12944,6 @@ var require_checkpoint = __commonJS({
12945
12944
  const trimmed = value.trim();
12946
12945
  return trimmed.length > 0 ? trimmed : void 0;
12947
12946
  };
12948
- var readBashCommand = (input) => {
12949
- if (typeof input !== "object" || input === null)
12950
- return void 0;
12951
- const value = input.command;
12952
- return typeof value === "string" ? value : void 0;
12953
- };
12954
12947
  var checkpointPluginFactory = (ctx) => {
12955
12948
  const { host, job } = ctx;
12956
12949
  const accessToken = host.auth.getAccessToken();
@@ -13055,40 +13048,21 @@ var require_checkpoint = __commonJS({
13055
13048
  rules: buildCheckpointRules(),
13056
13049
  tools: buildCheckpointTools(),
13057
13050
  // The agent calls `set-commit-message` (registered as a host tool from
13058
- // the plugin's `tools` field) as the first thing it does. We capture
13059
- // the value here. Then later, when the EML script runs (mid-flow), we
13060
- // use the captured value for the early checkpoint.
13051
+ // the plugin's `tools` field) as the first thing it does. We capture the
13052
+ // value here and use it for the checkpoint at flow end.
13061
13053
  async onToolUse({ tool, state }) {
13062
13054
  if (state.status === "error")
13063
13055
  return;
13064
- if (tool === SET_COMMIT_MESSAGE_TOOL) {
13065
- const message = readToolCommitMessage(state.input);
13066
- if (message)
13067
- capturedCommitMessage = message;
13068
- return;
13069
- }
13070
- if (outcome)
13071
- return;
13072
- if (tool !== "bash")
13073
- return;
13074
- const command = readBashCommand(state.input);
13075
- if (!command || !command.includes(EML_MARKER))
13056
+ if (tool !== SET_COMMIT_MESSAGE_TOOL)
13076
13057
  return;
13077
- const commitMessage = capturedCommitMessage ?? FALLBACK_COMMIT_MESSAGE;
13078
- try {
13079
- await commitCheckpoint(commitMessage);
13080
- } catch {
13081
- }
13058
+ const message = readToolCommitMessage(state.input);
13059
+ if (message)
13060
+ capturedCommitMessage = message;
13082
13061
  },
13083
- // Flow-end fallback: only fires if onToolUse didn't already create the
13084
- // checkpoint. Re-throws an earlier failure so the task is marked failed.
13062
+ // Creates the checkpoint once the flow is over. Throws on failure, which
13063
+ // the runner reports as a plugin failure. A conflict handed off to AI
13064
+ // resolution is not a failure.
13085
13065
  async onFlowEnd({ codegenFailed, filesChanged }) {
13086
- if (outcome?.status === "failed")
13087
- throw outcome.error;
13088
- if (outcome?.status === "created")
13089
- return;
13090
- if (outcome?.status === "resolvingGitConflicts")
13091
- return;
13092
13066
  if (codegenFailed)
13093
13067
  return;
13094
13068
  if (!filesChanged)
@@ -14457,7 +14431,7 @@ var require_studio_2 = __commonJS({
14457
14431
  "../codegen-common-logic/dist/tool-policies/studio-2.js"(exports2) {
14458
14432
  "use strict";
14459
14433
  Object.defineProperty(exports2, "__esModule", { value: true });
14460
- exports2.STUDIO_2_POLICIES = exports2.STUDIO_2_PREVIEW_RELEASE_POLICY = exports2.STUDIO_2_CUSTOM_ELEMENT_GENERATE_POLICY = exports2.STUDIO_2_SITE_PLUGIN_SLOTS_GENERATE_POLICY = exports2.SITE_PLUGIN_SCHEMA_COMMAND_POLICY = exports2.STUDIO_2_SKILL_ROUTING_POLICY = exports2.SITE_PLUGIN_PAGES_POLICY = exports2.SITE_PLUGIN_REDIRECT = exports2.SITE_PLUGIN_UNSUPPORTED_PAGES = exports2.CUSTOM_ELEMENT_REFERENCES_POLICY = void 0;
14434
+ exports2.STUDIO_2_POLICIES = exports2.STUDIO_2_BRANDED_COMPONENTS_POLICY = exports2.STUDIO_2_PREVIEW_RELEASE_POLICY = exports2.STUDIO_2_CUSTOM_ELEMENT_GENERATE_POLICY = exports2.STUDIO_2_SITE_PLUGIN_SLOTS_GENERATE_POLICY = exports2.SITE_PLUGIN_SCHEMA_COMMAND_POLICY = exports2.STUDIO_2_SKILL_ROUTING_POLICY = exports2.SITE_PLUGIN_PAGES_POLICY = exports2.SITE_PLUGIN_REDIRECT = exports2.SITE_PLUGIN_UNSUPPORTED_PAGES = exports2.CUSTOM_ELEMENT_REFERENCES_POLICY = void 0;
14461
14435
  exports2.CUSTOM_ELEMENT_REFERENCES_POLICY = {
14462
14436
  type: "read",
14463
14437
  mode: "block",
@@ -14517,6 +14491,16 @@ ${STUDIO_2_SITE_UI_ROUTING}`
14517
14491
  commandFragments: ["npx wix preview", "npx wix release"],
14518
14492
  message: `BLOCKED: \`wix preview\` and \`wix release\` cannot run in this environment. Skip those checklist items and run every other post-build step the skill requires. Do not retry.`
14519
14493
  };
14494
+ exports2.STUDIO_2_BRANDED_COMPONENTS_POLICY = {
14495
+ type: "read",
14496
+ mode: "prepend",
14497
+ pathFragments: [
14498
+ "wix-app/references/EDITOR_REACT_COMPONENT",
14499
+ "wix-app/references/editor-react-component/BRANDED-COMPONENTS"
14500
+ ],
14501
+ message: `ENVIRONMENT OVERRIDE: Editor React Components in this environment follow the site theme by default. When you design a new component, read wix-app's references/editor-react-component/BRANDED-COMPONENTS.md and style it with the theme tokens, even if the request does not ask for a branded or themed component. Where the request names its own colors or fonts, use those and theme tokens for everything else; text and icons on a named color must contrast with that color. A component with a strong look of its own (a dark, neon or gradient widget, or a game such as a spin wheel) and code supplied in the request keep their own palette. Edits keep an existing component's styling unless the request asks to change it, and Brik tool imports keep the stylesheet the wix-brik skill writes.`,
14502
+ driftMarkers: ["Do not infer this requirement"]
14503
+ };
14520
14504
  exports2.STUDIO_2_POLICIES = [
14521
14505
  exports2.CUSTOM_ELEMENT_REFERENCES_POLICY,
14522
14506
  exports2.SITE_PLUGIN_PAGES_POLICY,
@@ -14524,7 +14508,8 @@ ${STUDIO_2_SITE_UI_ROUTING}`
14524
14508
  exports2.STUDIO_2_SKILL_ROUTING_POLICY,
14525
14509
  exports2.STUDIO_2_PREVIEW_RELEASE_POLICY,
14526
14510
  exports2.STUDIO_2_SITE_PLUGIN_SLOTS_GENERATE_POLICY,
14527
- exports2.STUDIO_2_CUSTOM_ELEMENT_GENERATE_POLICY
14511
+ exports2.STUDIO_2_CUSTOM_ELEMENT_GENERATE_POLICY,
14512
+ exports2.STUDIO_2_BRANDED_COMPONENTS_POLICY
14528
14513
  ];
14529
14514
  }
14530
14515
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.477",
3
+ "version": "1.0.479",
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": "838b225501541e04aeb2c55bdfcd39656057b09aa09a174860fc8892"
32
+ "falconPackageHash": "aa612d3abb5432b9772fa1212f46424b83fd5be740ba2327bcfabc58"
33
33
  }