@wix/ditto-codegen-public 1.0.344 → 1.0.346

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 +33 -33
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -11573,6 +11573,7 @@ TOOL USAGE:
11573
11573
  - For tools where no batch variant exists (e.g. \`grep\`, \`glob\`), still emit MULTIPLE \`tool_use\` blocks in a SINGLE response when the calls are independent. Sequential turns waste a model round-trip per call.
11574
11574
  - Before calling MCP tools, check if loaded skills already cover the API. Only use MCP for gaps.
11575
11575
  - When using MCP to look up a Wix SDK method, ALWAYS call \`ReadFullDocsMethodSchema\` (not just \`ReadFullDocsArticle\`). The schema is the source of truth for parameter shapes. Code examples in docs may use incorrect call signatures.
11576
+ - To discover API shapes, method signatures, or type definitions: ALWAYS try \`SearchWixSDKDocumentation\` or \`ReadFullDocsMethodSchema\` via wix-mcp first. ONLY fall back to grepping \`node_modules\` if the MCP tools return no useful results. Grepping \`node_modules\` as a first resort wastes turns, inflates context, and produces unreliable results \u2014 SDK internals are not a documentation source.
11576
11577
  - NEVER run preview, dev, release, or promote commands.
11577
11578
 
11578
11579
  IMPLEMENTATION WORKFLOW:
@@ -12661,6 +12662,19 @@ var require_types4 = __commonJS({
12661
12662
  }
12662
12663
  });
12663
12664
 
12665
+ // dist/opencode-integration/internal-paths.js
12666
+ var require_internal_paths = __commonJS({
12667
+ "dist/opencode-integration/internal-paths.js"(exports2) {
12668
+ "use strict";
12669
+ Object.defineProperty(exports2, "__esModule", { value: true });
12670
+ exports2.isInternalPath = isInternalPath;
12671
+ var INTERNAL_PATH_PREFIXES = [".agents/"];
12672
+ function isInternalPath(path) {
12673
+ return INTERNAL_PATH_PREFIXES.some((prefix) => path.startsWith(prefix));
12674
+ }
12675
+ }
12676
+ });
12677
+
12664
12678
  // dist/opencode-integration/parser.js
12665
12679
  var require_parser = __commonJS({
12666
12680
  "dist/opencode-integration/parser.js"(exports2) {
@@ -12677,6 +12691,7 @@ var require_parser = __commonJS({
12677
12691
  var ditto_codegen_types_12 = require_dist4();
12678
12692
  var types_1 = require_types4();
12679
12693
  var constants_1 = require_constants5();
12694
+ var internal_paths_1 = require_internal_paths();
12680
12695
  function parseEvents(output, type) {
12681
12696
  return output.split("\n").filter((line) => line.trim()).map((line) => (0, types_1.tryParseJson)(line)).filter((event) => event !== null && event.type === type);
12682
12697
  }
@@ -12707,7 +12722,7 @@ var require_parser = __commonJS({
12707
12722
  const seenPaths = /* @__PURE__ */ new Set();
12708
12723
  const addFileChange = (filePath, operation) => {
12709
12724
  const normalizedPath = (0, constants_1.normalizeFilePath)(filePath);
12710
- if (normalizedPath && !seenPaths.has(normalizedPath)) {
12725
+ if (normalizedPath && !(0, internal_paths_1.isInternalPath)(normalizedPath) && !seenPaths.has(normalizedPath)) {
12711
12726
  seenPaths.add(normalizedPath);
12712
12727
  filesChanged.push({ path: normalizedPath, operation });
12713
12728
  }
@@ -13671,6 +13686,7 @@ var require_git_file_changes = __commonJS({
13671
13686
  var child_process_1 = require("child_process");
13672
13687
  var util_1 = require("util");
13673
13688
  var ditto_codegen_types_12 = require_dist4();
13689
+ var internal_paths_1 = require_internal_paths();
13674
13690
  var logger_12 = require_logger();
13675
13691
  var execFileAsync = (0, util_1.promisify)(child_process_1.execFile);
13676
13692
  async function captureGitBaseline(cwd) {
@@ -13693,8 +13709,9 @@ var require_git_file_changes = __commonJS({
13693
13709
  ]);
13694
13710
  const files = parseDiffNameStatus(diffResult.stdout);
13695
13711
  appendUntrackedFiles(untrackedResult.stdout, files);
13696
- files.sort((a, b) => a.path.localeCompare(b.path));
13697
- return files;
13712
+ const userFiles = files.filter((f) => !(0, internal_paths_1.isInternalPath)(f.path));
13713
+ userFiles.sort((a, b) => a.path.localeCompare(b.path));
13714
+ return userFiles;
13698
13715
  } catch (error) {
13699
13716
  logger_12.logger.error("[OpenCode] Failed to collect git file changes", {
13700
13717
  error: error instanceof Error ? error.message : String(error)
@@ -19422,16 +19439,17 @@ var require_skills_installer = __commonJS({
19422
19439
  "use strict";
19423
19440
  Object.defineProperty(exports2, "__esModule", { value: true });
19424
19441
  exports2.installSkills = installSkills;
19425
- var child_process_1 = require("child_process");
19426
19442
  var fs_1 = require("fs");
19427
- var util_1 = require("util");
19443
+ var path_1 = require("path");
19428
19444
  var ditto_codegen_types_12 = require_dist4();
19429
19445
  var skills_override_1 = require_skills_override();
19430
- var execAsync = (0, util_1.promisify)(child_process_1.exec);
19431
- var SKILLS_INSTALL_COMMAND = "npx --yes skills add wix/skills -s wix-app wix-design-system -g -a opencode -y";
19446
+ function hasSkills(dir) {
19447
+ return (0, fs_1.existsSync)(dir) && (0, fs_1.readdirSync)(dir).length > 0;
19448
+ }
19432
19449
  async function installSkills(outputPath, log) {
19433
19450
  const skillsOverride = process.env.SKILLS_OVERRIDE_BRANCH;
19434
- const isPreInstalled = (0, fs_1.existsSync)(skills_override_1.SKILLS_DIR) && (0, fs_1.readdirSync)(skills_override_1.SKILLS_DIR).length > 0;
19451
+ const projectSkillsDir = (0, path_1.join)(outputPath, ".agents", "skills");
19452
+ const isPreInstalled = hasSkills(skills_override_1.SKILLS_DIR) || hasSkills(projectSkillsDir);
19435
19453
  if (isPreInstalled && !skillsOverride) {
19436
19454
  log.info("[Skills] Skipping runtime skills installation (pre-installed via Docker image)", { environment: process.env.CODEGEN_ENVIRONMENT });
19437
19455
  return;
@@ -19442,35 +19460,17 @@ var require_skills_installer = __commonJS({
19442
19460
  await (0, skills_override_1.overrideSkills)(overrides, outputPath, log);
19443
19461
  return;
19444
19462
  } catch (error) {
19445
- if (isPreInstalled) {
19446
- throw new ditto_codegen_types_12.ProcessExecutionError("Failed to override pre-installed skills", { processType: ditto_codegen_types_12.ProcessType.INITIALIZATION, cause: error });
19447
- }
19448
19463
  const errorMessage = error instanceof Error ? error.message : String(error);
19449
- log.warn("[Skills] Branch override failed, falling back to default", {
19450
- error: errorMessage
19451
- });
19464
+ log.error("[Skills] Branch override failed", { error: errorMessage });
19465
+ throw new ditto_codegen_types_12.ProcessExecutionError(isPreInstalled ? "Failed to override pre-installed skills" : "Skills override failed and no pre-installed skills available", { processType: ditto_codegen_types_12.ProcessType.INITIALIZATION, cause: error });
19452
19466
  }
19453
19467
  }
19454
- log.info("[Skills] Installing Wix skills globally", {
19455
- installInternalSkills: process.env.INSTALL_INTERNAL_SKILLS
19468
+ log.error("[Skills] No skills available \u2014 pre-install missing and no override", {
19469
+ globalSkillsDir: skills_override_1.SKILLS_DIR,
19470
+ projectSkillsDir,
19471
+ environment: process.env.CODEGEN_ENVIRONMENT
19456
19472
  });
19457
- try {
19458
- const { stdout, stderr } = await execAsync(SKILLS_INSTALL_COMMAND, {
19459
- cwd: outputPath
19460
- });
19461
- if (stderr && !stderr.includes("npm warn")) {
19462
- log.warn("[Skills] Installation stderr", { stderr });
19463
- }
19464
- console.log("[Skills] Skills installed successfully\n", stdout);
19465
- log.debug("[Skills] Skills installed successfully", { stdout });
19466
- } catch (error) {
19467
- const errorMessage = error instanceof Error ? error.message : String(error);
19468
- log.error("[Skills] Failed to install skills", { error: errorMessage });
19469
- throw new ditto_codegen_types_12.ProcessExecutionError("Failed to install Wix skills", {
19470
- processType: ditto_codegen_types_12.ProcessType.INITIALIZATION,
19471
- cause: error
19472
- });
19473
- }
19473
+ throw new ditto_codegen_types_12.ProcessExecutionError("Skills not pre-installed and no SKILLS_OVERRIDE_BRANCH set \u2014 verify the Docker image bake-time install ran successfully.", { processType: ditto_codegen_types_12.ProcessType.INITIALIZATION });
19474
19474
  }
19475
19475
  }
19476
19476
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.344",
3
+ "version": "1.0.346",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -28,5 +28,5 @@
28
28
  "esbuild": "^0.27.2",
29
29
  "vitest": "^4.0.16"
30
30
  },
31
- "falconPackageHash": "6a784882b81926659c5f42faebef73e229a10f774f36ebf2110e445e"
31
+ "falconPackageHash": "047a675018b94994c57488b7355d11a71cc4b88ce204e78bcfe23597"
32
32
  }