@wix/ditto-codegen-public 1.0.522 → 1.0.524

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 +74 -31
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -1663,25 +1663,24 @@ var require_env_util = __commonJS({
1663
1663
  "../../node_modules/@wix/http-client/dist/src/env-util.js"(exports2) {
1664
1664
  "use strict";
1665
1665
  Object.defineProperty(exports2, "__esModule", { value: true });
1666
- exports2.isProduction = exports2.isNode = exports2.isWebWorker = exports2.isBrowser = void 0;
1666
+ exports2.isBrowser = isBrowser;
1667
+ exports2.isWebWorker = isWebWorker;
1668
+ exports2.isNode = isNode;
1669
+ exports2.isProduction = isProduction;
1667
1670
  function isBrowser() {
1668
1671
  return typeof window !== "undefined";
1669
1672
  }
1670
- exports2.isBrowser = isBrowser;
1671
1673
  function isWebWorker() {
1672
1674
  var _a;
1673
1675
  return typeof self === "object" && ((_a = self === null || self === void 0 ? void 0 : self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope";
1674
1676
  }
1675
- exports2.isWebWorker = isWebWorker;
1676
1677
  function isNode() {
1677
1678
  var _a;
1678
1679
  return typeof process !== "undefined" && ((_a = process === null || process === void 0 ? void 0 : process.versions) === null || _a === void 0 ? void 0 : _a.node) != null;
1679
1680
  }
1680
- exports2.isNode = isNode;
1681
1681
  function isProduction() {
1682
1682
  return process.env.NODE_ENV === "production";
1683
1683
  }
1684
- exports2.isProduction = isProduction;
1685
1684
  }
1686
1685
  });
1687
1686
 
@@ -1690,27 +1689,35 @@ var require_utils2 = __commonJS({
1690
1689
  "../../node_modules/@wix/http-client/dist/src/utils.js"(exports2) {
1691
1690
  "use strict";
1692
1691
  Object.defineProperty(exports2, "__esModule", { value: true });
1693
- exports2.toSearchQueryParams = exports2.shouldAllowUnmocked = exports2.isHttpMockServerEnabled = exports2.getGlobalConfig = exports2.changeHost = exports2.extractHost = exports2.extractProtocol = exports2.resolveProtocol = exports2.resolveHost = exports2.extractProp = exports2.silent = exports2.isAbsoluteUrl = void 0;
1692
+ exports2.isAbsoluteUrl = isAbsoluteUrl;
1693
+ exports2.silent = silent;
1694
+ exports2.extractProp = extractProp;
1695
+ exports2.resolveHost = resolveHost;
1696
+ exports2.resolveProtocol = resolveProtocol;
1697
+ exports2.extractProtocol = extractProtocol;
1698
+ exports2.extractHost = extractHost;
1699
+ exports2.changeHost = changeHost;
1700
+ exports2.getGlobalConfig = getGlobalConfig;
1701
+ exports2.isHttpMockServerEnabled = isHttpMockServerEnabled;
1702
+ exports2.shouldAllowUnmocked = shouldAllowUnmocked;
1703
+ exports2.toSearchQueryParams = toSearchQueryParams;
1694
1704
  var constants_1 = require_constants();
1695
1705
  var env_util_1 = require_env_util();
1696
1706
  function isAbsoluteUrl(url) {
1697
1707
  if (typeof url !== "string") {
1698
1708
  throw new TypeError(`Expected a \`string\`, got \`${typeof url}\``);
1699
1709
  }
1700
- return /(^https?:)|(^\/\/)/.test(url);
1710
+ return /(^https?:)|(^\/\/)/i.test(url);
1701
1711
  }
1702
- exports2.isAbsoluteUrl = isAbsoluteUrl;
1703
1712
  async function silent(fn) {
1704
1713
  try {
1705
1714
  await fn();
1706
1715
  } catch (_a) {
1707
1716
  }
1708
1717
  }
1709
- exports2.silent = silent;
1710
1718
  function extractProp(data, path) {
1711
1719
  return path.split(".").filter((prop) => prop).reduce((result, prop) => result[prop], data);
1712
1720
  }
1713
- exports2.extractProp = extractProp;
1714
1721
  function resolveHost(opts) {
1715
1722
  if (opts.baseURL) {
1716
1723
  return extractHost(opts.baseURL);
@@ -1722,7 +1729,6 @@ var require_utils2 = __commonJS({
1722
1729
  return "";
1723
1730
  }
1724
1731
  }
1725
- exports2.resolveHost = resolveHost;
1726
1732
  function resolveProtocol(opts) {
1727
1733
  if (opts.baseURL) {
1728
1734
  return extractProtocol(opts.baseURL);
@@ -1734,7 +1740,6 @@ var require_utils2 = __commonJS({
1734
1740
  return "";
1735
1741
  }
1736
1742
  }
1737
- exports2.resolveProtocol = resolveProtocol;
1738
1743
  function extractProtocol(url) {
1739
1744
  try {
1740
1745
  const asUrl = new URL(url);
@@ -1744,7 +1749,6 @@ var require_utils2 = __commonJS({
1744
1749
  return hostAndProtocol.protocol;
1745
1750
  }
1746
1751
  }
1747
- exports2.extractProtocol = extractProtocol;
1748
1752
  function extractHost(url) {
1749
1753
  let asUrl;
1750
1754
  try {
@@ -1759,7 +1763,6 @@ var require_utils2 = __commonJS({
1759
1763
  return hostAndProtocol.host;
1760
1764
  }
1761
1765
  }
1762
- exports2.extractHost = extractHost;
1763
1766
  function extractHostAndProtocolUsingRegExp(url) {
1764
1767
  const regExp = new RegExp("^(.*:)//([A-Za-z0-9-.]+)(:[0-9]+)?(.*)$");
1765
1768
  try {
@@ -1781,7 +1784,6 @@ var require_utils2 = __commonJS({
1781
1784
  }
1782
1785
  return url.toString();
1783
1786
  }
1784
- exports2.changeHost = changeHost;
1785
1787
  function getGlobalConfig() {
1786
1788
  const defaultConfig = { httpMockServer: { enabled: false } };
1787
1789
  let globalConfig;
@@ -1799,21 +1801,17 @@ var require_utils2 = __commonJS({
1799
1801
  }
1800
1802
  return globalConfig || defaultConfig;
1801
1803
  }
1802
- exports2.getGlobalConfig = getGlobalConfig;
1803
1804
  function isHttpMockServerEnabled() {
1804
1805
  const globalConfig = getGlobalConfig();
1805
1806
  return globalConfig.httpMockServer.enabled;
1806
1807
  }
1807
- exports2.isHttpMockServerEnabled = isHttpMockServerEnabled;
1808
1808
  function shouldAllowUnmocked() {
1809
1809
  const globalConfig = getGlobalConfig();
1810
1810
  return globalConfig.httpMockServer.allowUnmocked;
1811
1811
  }
1812
- exports2.shouldAllowUnmocked = shouldAllowUnmocked;
1813
1812
  function toSearchQueryParams(params) {
1814
1813
  return Object.entries(params).map(([key, value]) => `${key}=${encodeURIComponent(value)}`).flat().join("&");
1815
1814
  }
1816
- exports2.toSearchQueryParams = toSearchQueryParams;
1817
1815
  }
1818
1816
  });
1819
1817
 
@@ -1835,7 +1833,9 @@ var require_headers = __commonJS({
1835
1833
  "../../node_modules/@wix/http-client/dist/src/headers.js"(exports2) {
1836
1834
  "use strict";
1837
1835
  Object.defineProperty(exports2, "__esModule", { value: true });
1838
- exports2.isWixDomain = exports2.composeHeaders = exports2.requestIdOrEmptyString = void 0;
1836
+ exports2.composeHeaders = void 0;
1837
+ exports2.requestIdOrEmptyString = requestIdOrEmptyString;
1838
+ exports2.isWixDomain = isWixDomain;
1839
1839
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
1840
1840
  var headers_1 = require_cjs();
1841
1841
  var utils_12 = require_utils2();
@@ -1844,7 +1844,6 @@ var require_headers = __commonJS({
1844
1844
  var _a;
1845
1845
  return ((_a = response === null || response === void 0 ? void 0 : response.headers) === null || _a === void 0 ? void 0 : _a["x-wix-request-id"]) || "";
1846
1846
  }
1847
- exports2.requestIdOrEmptyString = requestIdOrEmptyString;
1848
1847
  var composeHeaders = ({ url, disableWixHeaders, includeWixHeaders, wixHeadersOpts }) => {
1849
1848
  const shouldAssignWixHeaders = includeWixHeaders || !disableWixHeaders && isWixDomain(url);
1850
1849
  return shouldAssignWixHeaders ? (0, headers_1.createHeaders)(wixHeadersOpts) : {};
@@ -1859,7 +1858,6 @@ var require_headers = __commonJS({
1859
1858
  const isWhitelisted = whitelist_json_1.default.find((wixHost) => host.endsWith(`.${wixHost}`));
1860
1859
  return !!isWhitelisted;
1861
1860
  }
1862
- exports2.isWixDomain = isWixDomain;
1863
1861
  }
1864
1862
  });
1865
1863
 
@@ -1868,7 +1866,8 @@ var require_error = __commonJS({
1868
1866
  "../../node_modules/@wix/http-client/dist/src/error.js"(exports2) {
1869
1867
  "use strict";
1870
1868
  Object.defineProperty(exports2, "__esModule", { value: true });
1871
- exports2.createHttpError = exports2.HttpError = exports2.axiosErrorFields = void 0;
1869
+ exports2.HttpError = exports2.axiosErrorFields = void 0;
1870
+ exports2.createHttpError = createHttpError;
1872
1871
  var headers_1 = require_headers();
1873
1872
  exports2.axiosErrorFields = [
1874
1873
  "code",
@@ -1899,7 +1898,6 @@ var require_error = __commonJS({
1899
1898
  function createHttpError(...args) {
1900
1899
  return new HttpError(...args);
1901
1900
  }
1902
- exports2.createHttpError = createHttpError;
1903
1901
  }
1904
1902
  });
1905
1903
 
@@ -5477,7 +5475,8 @@ var require_http_client = __commonJS({
5477
5475
  "../../node_modules/@wix/http-client/dist/src/http-client.js"(exports2) {
5478
5476
  "use strict";
5479
5477
  Object.defineProperty(exports2, "__esModule", { value: true });
5480
- exports2.createHttpClient = exports2.HttpClient = void 0;
5478
+ exports2.HttpClient = void 0;
5479
+ exports2.createHttpClient = createHttpClient;
5481
5480
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
5482
5481
  var axios_1 = tslib_1.__importDefault(require_axios2());
5483
5482
  var xhr_1 = tslib_1.__importDefault(require_xhr());
@@ -5488,6 +5487,9 @@ var require_http_client = __commonJS({
5488
5487
  var options_1 = require_options();
5489
5488
  var utils_12 = require_utils2();
5490
5489
  var HttpClient = class {
5490
+ static isHttpError(payload) {
5491
+ return !!(payload === null || payload === void 0 ? void 0 : payload.isWixHttpError);
5492
+ }
5491
5493
  constructor(opts = {}) {
5492
5494
  this.opts = opts;
5493
5495
  this.opts = defaultClientOptions(this.opts);
@@ -5496,9 +5498,6 @@ var require_http_client = __commonJS({
5496
5498
  sanitizerPocEnabled: checkSanitizerPocEnabled()
5497
5499
  };
5498
5500
  }
5499
- static isHttpError(payload) {
5500
- return !!(payload === null || payload === void 0 ? void 0 : payload.isWixHttpError);
5501
- }
5502
5501
  setErrorHandler(errorHandler) {
5503
5502
  this.opts.errorHandler = errorHandler;
5504
5503
  }
@@ -5704,7 +5703,6 @@ var require_http_client = __commonJS({
5704
5703
  function createHttpClient(...args) {
5705
5704
  return new HttpClient(...args);
5706
5705
  }
5707
- exports2.createHttpClient = createHttpClient;
5708
5706
  }
5709
5707
  });
5710
5708
 
@@ -5713,7 +5711,8 @@ var require_http_client_node = __commonJS({
5713
5711
  "../../node_modules/@wix/http-client/dist/src/http-client-node.js"(exports2) {
5714
5712
  "use strict";
5715
5713
  Object.defineProperty(exports2, "__esModule", { value: true });
5716
- exports2.HttpClient = exports2.createHttpClient = void 0;
5714
+ exports2.HttpClient = void 0;
5715
+ exports2.createHttpClient = createHttpClientNode;
5717
5716
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
5718
5717
  var http_1 = tslib_1.__importDefault(require_http());
5719
5718
  var http_proxy_agent_1 = require_dist2();
@@ -5748,7 +5747,6 @@ var require_http_client_node = __commonJS({
5748
5747
  function createHttpClientNode(...args) {
5749
5748
  return new HttpClientNode(...args);
5750
5749
  }
5751
- exports2.createHttpClient = createHttpClientNode;
5752
5750
  function resolveProxyOptions(disableSquidProxy) {
5753
5751
  if (disableSquidProxy) {
5754
5752
  return {};
@@ -120683,6 +120681,9 @@ var require_config = __commonJS({
120683
120681
  permission,
120684
120682
  instructions: instructionPaths,
120685
120683
  lsp: false,
120684
+ // Undo/revert snapshots `git add` the whole worktree before and after every
120685
+ // model step; codegen never reverts through opencode.
120686
+ snapshot: false,
120686
120687
  mcp: exports2.WIX_MCP_CONFIG,
120687
120688
  watcher: { ignore: WATCHER_IGNORE_PATTERNS },
120688
120689
  ...isCodeWritingFlow ? { autoupdate: false, share: "disabled" } : {},
@@ -129492,6 +129493,46 @@ export const GeneratedFilesGuard = async () => ({
129492
129493
  }
129493
129494
  });
129494
129495
 
129496
+ // dist/opencode-integration/plugins/prompt-cache-key.js
129497
+ var require_prompt_cache_key = __commonJS({
129498
+ "dist/opencode-integration/plugins/prompt-cache-key.js"(exports2) {
129499
+ "use strict";
129500
+ Object.defineProperty(exports2, "__esModule", { value: true });
129501
+ exports2.PROMPT_CACHE_KEY_FILENAME = exports2.PROMPT_CACHE_KEY_PREFIX = exports2.PROMPT_CACHE_KEY_BUCKETS = void 0;
129502
+ exports2.buildPromptCacheKeySource = buildPromptCacheKeySource;
129503
+ exports2.writePromptCacheKeyPlugin = writePromptCacheKeyPlugin;
129504
+ var write_plugin_1 = require_write_plugin();
129505
+ exports2.PROMPT_CACHE_KEY_BUCKETS = 8;
129506
+ exports2.PROMPT_CACHE_KEY_PREFIX = "ditto-codegen-";
129507
+ exports2.PROMPT_CACHE_KEY_FILENAME = "prompt-cache-key.ts";
129508
+ function buildPromptCacheKeySource() {
129509
+ return `// Generated by @wix/ditto-codegen (prompt-cache-key). Do not edit.
129510
+ const BUCKETS = ${exports2.PROMPT_CACHE_KEY_BUCKETS};
129511
+ const PREFIX = ${JSON.stringify(exports2.PROMPT_CACHE_KEY_PREFIX)};
129512
+
129513
+ function bucketOf(sessionID) {
129514
+ let hash = 2166136261;
129515
+ for (let i = 0; i < sessionID.length; i++) {
129516
+ hash ^= sessionID.charCodeAt(i);
129517
+ hash = Math.imul(hash, 16777619);
129518
+ }
129519
+ return (hash >>> 0) % BUCKETS;
129520
+ }
129521
+
129522
+ export const PromptCacheKey = async () => ({
129523
+ "chat.params": async (input, output) => {
129524
+ if (typeof output.options?.promptCacheKey !== "string") return;
129525
+ output.options.promptCacheKey = PREFIX + bucketOf(input.sessionID);
129526
+ },
129527
+ });
129528
+ `;
129529
+ }
129530
+ async function writePromptCacheKeyPlugin() {
129531
+ await (0, write_plugin_1.writeGeneratedPlugin)(exports2.PROMPT_CACHE_KEY_FILENAME, buildPromptCacheKeySource());
129532
+ }
129533
+ }
129534
+ });
129535
+
129495
129536
  // dist/opencode-integration/plugins/tool-policies.js
129496
129537
  var require_tool_policies3 = __commonJS({
129497
129538
  "dist/opencode-integration/plugins/tool-policies.js"(exports2) {
@@ -129828,6 +129869,7 @@ var require_plugins3 = __commonJS({
129828
129869
  exports2.writeGeneratedPlugins = writeGeneratedPlugins;
129829
129870
  var docs_feedback_nudge_1 = require_docs_feedback_nudge();
129830
129871
  var generated_files_guard_1 = require_generated_files_guard();
129872
+ var prompt_cache_key_1 = require_prompt_cache_key();
129831
129873
  var subagent_tool_logger_1 = require_subagent_tool_logger();
129832
129874
  var tool_policies_1 = require_tool_policies3();
129833
129875
  var validation_state_1 = require_validation_state();
@@ -129839,6 +129881,7 @@ var require_plugins3 = __commonJS({
129839
129881
  await Promise.all([
129840
129882
  (0, docs_feedback_nudge_1.writeDocsFeedbackNudgePlugin)(),
129841
129883
  (0, generated_files_guard_1.writeGeneratedFilesGuardPlugin)(),
129884
+ (0, prompt_cache_key_1.writePromptCacheKeyPlugin)(),
129842
129885
  (0, subagent_tool_logger_1.writeSubagentToolLoggerPlugin)(),
129843
129886
  (0, tool_policies_1.writeToolPoliciesPlugin)(toolPolicies),
129844
129887
  (0, validation_state_1.writeValidationStatePlugin)()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.522",
3
+ "version": "1.0.524",
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": "3be8e57bf8e2396188b194d246a983326c34d628195f549fddc9f0bd"
32
+ "falconPackageHash": "740ca433024442d00934d2bf5fe37531452dba3d9a06b4d155166ed6"
33
33
  }