@wix/ditto-codegen-public 1.0.490 → 1.0.492
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/assets/commit-message-rule.md +1 -0
- package/dist/out.js +64 -10
- package/package.json +2 -2
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
COMMIT MESSAGE:
|
|
2
2
|
First thing, before writing any code, call the `set-commit-message` tool. See its description for format and length.
|
|
3
|
+
Your code is saved to the site automatically when your run ends, with that message. You cannot see or check the save, so do not say you cannot confirm it.
|
package/dist/out.js
CHANGED
|
@@ -12717,7 +12717,7 @@ var require_brik_import = __commonJS({
|
|
|
12717
12717
|
exports2.BRIK_IMPORT_RULES = void 0;
|
|
12718
12718
|
exports2.BRIK_IMPORT_RULES = `# Brik Tool Import Rules
|
|
12719
12719
|
|
|
12720
|
-
|
|
12720
|
+
Check with \`glob\` whether \`.wix/agentInput/brikMeta.json\` exists. If it exists AND its \`brikMeta\` object has \`promptVariant\` set to \`skill-v1\`, this job is a Brik tool import: you MUST invoke the \`wix-brik\` skill FIRST and follow it exactly. It owns the import itself - scaffolding the Editor React Component, running the deterministic import script over \`.wix/agentInput/brikImport.json\`, splicing the tool's creative code, then installing dependencies and building plus generating the manifest. Do NOT derive the component's public surface yourself and do NOT re-tune the manifest.
|
|
12721
12721
|
|
|
12722
12722
|
The skill does NOT replace step 5 of the workflow: its \`npx wix build\` transpiles without typechecking. Once its DONE WHEN checks pass, still run step 5 as the workflow says, and fix whatever it reports in your spliced code only - never in the script-written surface.
|
|
12723
12723
|
|
|
@@ -12759,6 +12759,42 @@ For any persistent-data need (CMS collections, tables, schemas, data models):
|
|
|
12759
12759
|
}
|
|
12760
12760
|
});
|
|
12761
12761
|
|
|
12762
|
+
// ../codegen-common-logic/dist/rules/site-host-modules.js
|
|
12763
|
+
var require_site_host_modules = __commonJS({
|
|
12764
|
+
"../codegen-common-logic/dist/rules/site-host-modules.js"(exports2) {
|
|
12765
|
+
"use strict";
|
|
12766
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
12767
|
+
exports2.SITE_HOST_MODULES_RULES = void 0;
|
|
12768
|
+
exports2.SITE_HOST_MODULES_RULES = `# Site Host Modules Rules
|
|
12769
|
+
|
|
12770
|
+
In React code that runs in the Studio 2 viewer (custom elements, Editor React Components, page code, context providers), never import \`@wix/site-*\` host modules (\`@wix/site-window\`, \`@wix/site-site\`, \`@wix/site-location\`, \`@wix/site-seo\`, ...). They call \`window.clientSdk\`, which Studio 2 pages do not have, so every call rejects with "Wix Site SDK only works in a Wix site environment" and nothing happens, in preview and on the published site.
|
|
12771
|
+
|
|
12772
|
+
Use the matching site service instead, read with \`useService\` from \`@wix/services-manager-react\`. Take the service's API from the installed package's types, not from memory:
|
|
12773
|
+
|
|
12774
|
+
| Instead of | Use |
|
|
12775
|
+
|---|---|
|
|
12776
|
+
| \`@wix/site-window\` \`openLightbox\` / \`lightbox.getContext\` / \`lightbox.close\` | \`@wix/site-service-lightbox\` |
|
|
12777
|
+
| \`@wix/site-window\` \`formFactor\` | \`@wix/site-service-device-info\`. Its device types are named differently from \`formFactor\`: use the values in its types |
|
|
12778
|
+
| \`@wix/site-window\` \`viewMode\` | \`@wix/site-service-editor-context\`. It only says whether the site is being previewed; it can't tell the editor from the live site |
|
|
12779
|
+
| \`@wix/site-window\` \`rendering.env\` | \`@wix/site-service-rendering-context\` |
|
|
12780
|
+
| \`@wix/site-window\` \`warmup-data\` \`get\` / \`set\` | \`@wix/site-service-warmup-data\` |
|
|
12781
|
+
| \`@wix/site-site\` \`regionalSettings\` / \`language\` / \`timezone\` (language, text direction, regional format, time zone) | \`@wix/site-service-locale\`. It reports the site's settings, not the language the visitor is viewing |
|
|
12782
|
+
| \`@wix/site-site\` \`getSiteDisplayName\` / \`revision\` | \`@wix/site-service-site-info\` |
|
|
12783
|
+
| \`@wix/site-site\` \`getSiteThemeHtml\` / \`getFontsHtml\` | \`@wix/site-service-site-theme\`. It returns the theme's colors and fonts as values, not HTML |
|
|
12784
|
+
| \`@wix/site-location\` \`to()\` | \`@wix/site-service-router\` |
|
|
12785
|
+
| \`@wix/site-location\` \`url\` | \`@wix/site-service-url\` |
|
|
12786
|
+
| \`@wix/site-site\` \`currentPage\` / site structure | \`@wix/site-service-pages\` |
|
|
12787
|
+
|
|
12788
|
+
There is no service yet for these, so Studio 2 can't do them from viewer code: \`@wix/site-window\` \`multilingual\` (reading or switching the display language), \`@wix/site-seo\` (setting SEO tags from the browser), \`@wix/site-members\`, \`@wix/site-storage\`, \`@wix/site-ecom\`, \`@wix/site-stores\`, \`@wix/site-pricing-plans\`, \`@wix/site-crm\`, \`@wix/site-pay\`, \`@wix/site-realtime\`, \`@wix/site-events\`, \`@wix/site-bookings\`, the \`@wix/site-location\` helpers other than \`to()\` and \`url\` (\`path\`, \`query\`, \`onChange\`, ...), and the \`@wix/site-window\` browser helpers (\`scrollTo\`, \`copyToClipboard\`, \`getCurrentGeolocation\`, \`referrer\`, \`postMessage\`, \`openModal\`, consent policy). Do not substitute \`navigator.language\` for the display language: it is the browser's preference and can differ from the language the site is shown in. Do not set SEO tags from client code: a client effect can't reach crawlers. For any of these, don't guess a workaround; say in your final message that Studio 2 doesn't support it yet.
|
|
12789
|
+
|
|
12790
|
+
If a host-module API you need isn't in the table, check the Wix docs for a supported replacement before choosing an approach. Never fall back to a \`@wix/site-*\` host module.
|
|
12791
|
+
|
|
12792
|
+
A live site loads a site service only when an extension declares it in the manifest's \`serviceDependencies\`. Preview loads every service, so a missing declaration works in preview and fails after publish: always declare each service you use.
|
|
12793
|
+
|
|
12794
|
+
**Embedded scripts are the exception.** They are plain HTML/JS injected into the page, with no services manager, so \`useService\` and \`serviceDependencies\` don't apply. Follow the \`wix-app\` embedded-script reference there, which creates its client from \`@wix/site\` and the \`@wix/site-*\` host modules.`;
|
|
12795
|
+
}
|
|
12796
|
+
});
|
|
12797
|
+
|
|
12762
12798
|
// ../codegen-common-logic/dist/rules/telemetry.js
|
|
12763
12799
|
var require_telemetry = __commonJS({
|
|
12764
12800
|
"../codegen-common-logic/dist/rules/telemetry.js"(exports2) {
|
|
@@ -12807,7 +12843,7 @@ var require_user_attachments = __commonJS({
|
|
|
12807
12843
|
exports2.USER_ATTACHMENTS_RULES = void 0;
|
|
12808
12844
|
exports2.USER_ATTACHMENTS_RULES = `# User Attachment Rules
|
|
12809
12845
|
|
|
12810
|
-
|
|
12846
|
+
Check with \`glob\` whether \`.wix/agentInput/userAttachments.json\` exists. If it does, the user uploaded files with this request. Its \`userAttachments\` list gives each file's \`fileName\` (as the user named it), \`path\` (under \`.wix/agentInput/attachments/\`), \`mimeType\`, \`sizeBytes\` and \`status\`. Only files with \`status\` \`downloaded\` are on disk; any other status says why the file is missing, and you must not claim to have used it.
|
|
12811
12847
|
|
|
12812
12848
|
- Read the files the request refers to before you write any code. When the request doesn't say which, read them all.
|
|
12813
12849
|
- When you build or change an Editor React Component from them, first read the \`wix-app\` skill's \`references/editor-react-component/USER-SOURCES.md\` in full, if the skill has it, and follow it: it says how to port the user's code, match a design and upload their images.
|
|
@@ -12869,6 +12905,7 @@ var require_rules = __commonJS({
|
|
|
12869
12905
|
__exportStar2(require_brik_import(), exports2);
|
|
12870
12906
|
__exportStar2(require_code_edits_scope(), exports2);
|
|
12871
12907
|
__exportStar2(require_site_data_layer(), exports2);
|
|
12908
|
+
__exportStar2(require_site_host_modules(), exports2);
|
|
12872
12909
|
__exportStar2(require_telemetry(), exports2);
|
|
12873
12910
|
__exportStar2(require_stores_catalog_version(), exports2);
|
|
12874
12911
|
__exportStar2(require_user_attachments(), exports2);
|
|
@@ -14130,6 +14167,10 @@ var require_dist8 = __commonJS({
|
|
|
14130
14167
|
{ filename: "brik-import-rules.md", content: codegen_common_logic_1.BRIK_IMPORT_RULES },
|
|
14131
14168
|
{ filename: "code-edits-scope-rules.md", content: codegen_common_logic_1.CODE_EDITS_SCOPE_RULES },
|
|
14132
14169
|
{ filename: "user-attachments-rules.md", content: codegen_common_logic_1.USER_ATTACHMENTS_RULES },
|
|
14170
|
+
{
|
|
14171
|
+
filename: "site-host-modules-rules.md",
|
|
14172
|
+
content: codegen_common_logic_1.SITE_HOST_MODULES_RULES
|
|
14173
|
+
},
|
|
14133
14174
|
{ filename: "telemetry-rules.md", content: codegen_common_logic_1.TELEMETRY_RULES }
|
|
14134
14175
|
],
|
|
14135
14176
|
askRules: [{ filename: "telemetry-ask-rules.md", content: codegen_common_logic_1.TELEMETRY_RULES }],
|
|
@@ -14527,7 +14568,7 @@ ${environmentIdentity}`;
|
|
|
14527
14568
|
- \`multi-edit\` to apply N find-and-replace edits across one or more files in one call. NEVER call \`edit\` more than once per turn \u2014 use multi-edit instead. \`edit\` is reserved for a single edit to one file. When ${multiEditContextClause} across N files, use ONE \`multi-edit\` with all N edits.
|
|
14528
14569
|
- \`apply_patch\` (when available): inside each \`*** Update File\` section, list hunks in FILE ORDER, top to bottom. The applier only searches forward from where the previous hunk matched, so a hunk whose lines sit ABOVE the previous one fails with "Failed to find expected lines" even though the lines exist \u2014 the whole patch is then rejected. Unsure of the order? Re-read the file first, or split into one patch per hunk.
|
|
14529
14570
|
- Tool arguments are strict JSON, and \`write\`/\`edit\`/\`batch-write\`/\`multi-edit\`/\`apply_patch\` write \`content\`/\`oldString\`/\`newString\`/\`patchText\` to disk EXACTLY as decoded from that JSON \u2014 there is no second unescaping pass, so encode for the ONE decode that happens. Use \`\\n\`/\`\\t\`/\`\\"\` in the JSON when you want the file to contain a REAL newline/tab/quote character (a raw unescaped newline inside a JSON string value breaks parsing). If the file itself must contain the two LITERAL characters backslash-then-n (e.g. inside a string literal like \`.join('\\n')\`, a regex, or an already-escaped JSON value), escape the backslash itself in your JSON so it survives the one decode intact \u2014 do NOT emit a bare \`\\n\` expecting a tool to turn it back into two literal characters for you; none of them do.
|
|
14530
|
-
- 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.`;
|
|
14571
|
+
- 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. If \`grep\` fails with "Ripgrep JSON record exceeded", a matching line is huge (a minified or generated file): do not repeat it, search that file with \`bash\` (\`grep -o -E '.{0,120}PATTERN.{0,120}' <file>\`) or read the part you need with \`read\` and an offset.`;
|
|
14531
14572
|
}
|
|
14532
14573
|
}
|
|
14533
14574
|
});
|
|
@@ -15639,6 +15680,9 @@ var require_config = __commonJS({
|
|
|
15639
15680
|
// harmless read.
|
|
15640
15681
|
"/root/.config/opencode/rules/**": "allow",
|
|
15641
15682
|
"/root/.opencode/**": "allow",
|
|
15683
|
+
// A failed `npm install` prints the path of its log here, and agents read it
|
|
15684
|
+
// to see why. Same auto-reject as above otherwise.
|
|
15685
|
+
"/root/.npm/_logs/**": "allow",
|
|
15642
15686
|
"/tmp/**": "allow"
|
|
15643
15687
|
};
|
|
15644
15688
|
var PLANNING_TOOLS_DENIED = {
|
|
@@ -17758,6 +17802,7 @@ var require_executor = __commonJS({
|
|
|
17758
17802
|
exports2.applyPostRunValidation = applyPostRunValidation;
|
|
17759
17803
|
exports2.executeOpenCode = executeOpenCode;
|
|
17760
17804
|
exports2.resolveFinalRunCost = resolveFinalRunCost;
|
|
17805
|
+
exports2.buildOpenCodeInvocation = buildOpenCodeInvocation;
|
|
17761
17806
|
var child_process_1 = require("child_process");
|
|
17762
17807
|
var ditto_codegen_types_12 = require_dist4();
|
|
17763
17808
|
var config_12 = require_config();
|
|
@@ -17934,18 +17979,22 @@ var require_executor = __commonJS({
|
|
|
17934
17979
|
});
|
|
17935
17980
|
return { ...usage, cost: runCost };
|
|
17936
17981
|
}
|
|
17937
|
-
|
|
17982
|
+
var MAX_PROMPT_ARG_BYTES = 64 * 1024;
|
|
17983
|
+
function buildOpenCodeInvocation(prompt, continueSession) {
|
|
17938
17984
|
const sessionArgs = continueSession ? ["--continue"] : [];
|
|
17939
|
-
|
|
17985
|
+
const args = [
|
|
17940
17986
|
"run",
|
|
17941
17987
|
...sessionArgs,
|
|
17942
17988
|
"--print-logs",
|
|
17943
17989
|
"--log-level",
|
|
17944
17990
|
"ERROR",
|
|
17945
17991
|
"--format",
|
|
17946
|
-
"json"
|
|
17947
|
-
prompt
|
|
17992
|
+
"json"
|
|
17948
17993
|
];
|
|
17994
|
+
if (Buffer.byteLength(prompt) > MAX_PROMPT_ARG_BYTES) {
|
|
17995
|
+
return { args, stdinPrompt: prompt };
|
|
17996
|
+
}
|
|
17997
|
+
return { args: [...args, prompt] };
|
|
17949
17998
|
}
|
|
17950
17999
|
async function executeOpenCodeOnce(options, attempt, maxAttempts, toolUsage) {
|
|
17951
18000
|
const { prompt, outputPath, projectId, onStdout, onStderr, continueSession = false } = options;
|
|
@@ -17983,7 +18032,7 @@ var require_executor = __commonJS({
|
|
|
17983
18032
|
finalize
|
|
17984
18033
|
};
|
|
17985
18034
|
try {
|
|
17986
|
-
const args =
|
|
18035
|
+
const { args, stdinPrompt } = buildOpenCodeInvocation(prompt, continueSession);
|
|
17987
18036
|
logger_12.logger.info("[OpenCode] Executing opencode run", {
|
|
17988
18037
|
attempt,
|
|
17989
18038
|
maxRetries: maxAttempts,
|
|
@@ -18000,9 +18049,14 @@ var require_executor = __commonJS({
|
|
|
18000
18049
|
ctx.child = (0, child_process_1.spawn)("opencode", args, {
|
|
18001
18050
|
cwd: outputPath,
|
|
18002
18051
|
env,
|
|
18003
|
-
stdio: ["ignore", "pipe", "pipe"],
|
|
18052
|
+
stdio: [stdinPrompt === void 0 ? "ignore" : "pipe", "pipe", "pipe"],
|
|
18004
18053
|
detached: true
|
|
18005
18054
|
});
|
|
18055
|
+
if (stdinPrompt !== void 0) {
|
|
18056
|
+
ctx.child.stdin?.on("error", () => {
|
|
18057
|
+
});
|
|
18058
|
+
ctx.child.stdin?.end(stdinPrompt);
|
|
18059
|
+
}
|
|
18006
18060
|
timers.timeoutId = (0, process_handlers_1.setupTotalTimeout)(ctx);
|
|
18007
18061
|
timers.idleCheckId = (0, process_handlers_1.setupIdleWatchdog)(ctx);
|
|
18008
18062
|
(0, process_handlers_1.setupStdoutHandler)(ctx, onStdout);
|
|
@@ -23567,7 +23621,7 @@ var require_bi_events = __commonJS({
|
|
|
23567
23621
|
var types_1 = require_types_impl();
|
|
23568
23622
|
var bi_logger_1 = require_bi_logger2();
|
|
23569
23623
|
var logger_12 = require_logger();
|
|
23570
|
-
var MAX_JOB_INPUT_LENGTH =
|
|
23624
|
+
var MAX_JOB_INPUT_LENGTH = 5e3;
|
|
23571
23625
|
var TRUNCATION_SUFFIX = "\u2026";
|
|
23572
23626
|
var JOB_STATUS_MAP = {
|
|
23573
23627
|
COMPLETED: "successful",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/ditto-codegen-public",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.492",
|
|
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": "
|
|
32
|
+
"falconPackageHash": "2af551fe25ec6f9cf9f40e58d6be2436e7f01c0f383bd854d1160092"
|
|
33
33
|
}
|