@wix/ditto-codegen-public 1.0.525 → 1.0.526
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/dist/opencode-tools/checks/sdk-runtime-check.ts +1834 -0
- package/dist/out.js +203 -2
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -120768,7 +120768,9 @@ var require_write_plugin = __commonJS({
|
|
|
120768
120768
|
"dist/opencode-integration/plugins/write-plugin.js"(exports2) {
|
|
120769
120769
|
"use strict";
|
|
120770
120770
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
120771
|
+
exports2.OPENCODE_CHECKS_DIR = void 0;
|
|
120771
120772
|
exports2.writeGeneratedPlugin = writeGeneratedPlugin;
|
|
120773
|
+
exports2.writeCheckScript = writeCheckScript;
|
|
120772
120774
|
var promises_1 = require("fs/promises");
|
|
120773
120775
|
var os_1 = require("os");
|
|
120774
120776
|
var path_12 = require("path");
|
|
@@ -120779,6 +120781,12 @@ var require_write_plugin = __commonJS({
|
|
|
120779
120781
|
await (0, promises_1.writeFile)((0, path_12.join)(OPENCODE_PLUGIN_DIR, filename), source, "utf-8");
|
|
120780
120782
|
logger_12.logger.info("[OpenCode] Wrote generated plugin", { plugin: filename });
|
|
120781
120783
|
}
|
|
120784
|
+
exports2.OPENCODE_CHECKS_DIR = (0, path_12.join)((0, os_1.homedir)(), ".config", "opencode", "checks");
|
|
120785
|
+
async function writeCheckScript(filename, source) {
|
|
120786
|
+
await (0, promises_1.mkdir)(exports2.OPENCODE_CHECKS_DIR, { recursive: true });
|
|
120787
|
+
await (0, promises_1.writeFile)((0, path_12.join)(exports2.OPENCODE_CHECKS_DIR, filename), source, "utf-8");
|
|
120788
|
+
logger_12.logger.info("[OpenCode] Wrote check script", { script: filename });
|
|
120789
|
+
}
|
|
120782
120790
|
}
|
|
120783
120791
|
});
|
|
120784
120792
|
|
|
@@ -121074,6 +121082,75 @@ var require_skills_override = __commonJS({
|
|
|
121074
121082
|
}
|
|
121075
121083
|
});
|
|
121076
121084
|
|
|
121085
|
+
// dist/validation/sdk-runtime-report.js
|
|
121086
|
+
var require_sdk_runtime_report = __commonJS({
|
|
121087
|
+
"dist/validation/sdk-runtime-report.js"(exports2) {
|
|
121088
|
+
"use strict";
|
|
121089
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
121090
|
+
exports2.sdkRuntimeMessage = sdkRuntimeMessage;
|
|
121091
|
+
exports2.sdkRuntimeTelemetry = sdkRuntimeTelemetry;
|
|
121092
|
+
exports2.isSdkRuntimeCheckOn = isSdkRuntimeCheckOn;
|
|
121093
|
+
function sdkRuntimeMessage(report, blocks) {
|
|
121094
|
+
const MAX_BLOCKS = 2;
|
|
121095
|
+
const failing = (Array.isArray(report.failing) ? report.failing : []).filter((finding) => typeof finding?.key === "string" && typeof finding?.text === "string");
|
|
121096
|
+
const notes = (Array.isArray(report.notes) ? report.notes : []).filter((note) => typeof note === "string");
|
|
121097
|
+
const counted = failing.map((finding) => {
|
|
121098
|
+
const count = (blocks.get(finding.key) ?? 0) + 1;
|
|
121099
|
+
blocks.set(finding.key, count);
|
|
121100
|
+
return { ...finding, isBlocking: count <= MAX_BLOCKS };
|
|
121101
|
+
});
|
|
121102
|
+
const blocking = counted.filter((finding) => finding.isBlocking);
|
|
121103
|
+
const noted = [
|
|
121104
|
+
...notes,
|
|
121105
|
+
...counted.filter((finding) => !finding.isBlocking).map((finding) => `${finding.text}
|
|
121106
|
+
(still rejected after ${MAX_BLOCKS} fixes, so it no longer blocks: say in your final message that this call may fail)`)
|
|
121107
|
+
];
|
|
121108
|
+
const line = failing.length > 0 && blocking.length === 0 ? `SDK runtime check: still failing after ${MAX_BLOCKS} attempts, not blocking` : typeof report.line === "string" ? report.line : "";
|
|
121109
|
+
const noteText = noted.length ? [
|
|
121110
|
+
"Also noticed, not failing validate (some come from made-up arguments, so check whether the call itself is wrong):",
|
|
121111
|
+
...noted
|
|
121112
|
+
].join("\n") : "";
|
|
121113
|
+
if (blocking.length === 0)
|
|
121114
|
+
return [line, noteText].filter(Boolean).join("\n") || void 0;
|
|
121115
|
+
return [
|
|
121116
|
+
line,
|
|
121117
|
+
"FAILED at SDK runtime check: this project typechecks but would break when it runs.",
|
|
121118
|
+
"What the check did: it called each exported async function that uses a Wix SDK, and each SDK read inside a component, effect or handler (taken out to be run), with placeholder arguments, against this site. Reads were sent to the real Wix service; writes were answered locally and not sent, except updates and deletes aimed at a made-up id when the opt-in write probe is on. It also read the changed files for SDK use that fails at runtime.",
|
|
121119
|
+
...blocking.map((finding) => finding.text),
|
|
121120
|
+
blocking.some((finding) => finding.missingApp !== true) ? "For a rejected request, look up the method with ReadFullDocsMethodSchema and use the query builder or the shapes it shows. For a host module, use the matching site service. For a bare call in an event handler or service plugin, wrap it in auth.elevate. Then run validate again." : "",
|
|
121121
|
+
blocking.some((finding) => finding.missingApp === true) ? "For a call the site lacks the app for, rewriting the call does not help. Run the wix-site-installed-apps check for the app this feature needs and follow its rule for a missing app: undo the files you added or changed for this feature in this session, path by path, and reply in one short message naming the app the user must install. Then run validate again." : "",
|
|
121122
|
+
noteText
|
|
121123
|
+
].filter(Boolean).join("\n");
|
|
121124
|
+
}
|
|
121125
|
+
function sdkRuntimeTelemetry(report, message, durationMs, reason) {
|
|
121126
|
+
const MAX_FINDINGS = 20;
|
|
121127
|
+
const MAX_TEXT = 500;
|
|
121128
|
+
const line = typeof report?.line === "string" ? report.line : "";
|
|
121129
|
+
if (report && !line)
|
|
121130
|
+
return void 0;
|
|
121131
|
+
const findings = (Array.isArray(report?.failing) ? report.failing : []).filter((finding) => typeof finding?.key === "string" && typeof finding?.text === "string").slice(0, MAX_FINDINGS).map((finding) => ({
|
|
121132
|
+
key: finding.key.slice(0, MAX_TEXT),
|
|
121133
|
+
// The request body can carry literals from the project's components: kept out of the logs.
|
|
121134
|
+
text: finding.text.replace(/\n\s*request body:[^]*?(?=\n\s*\(|$)/, "").slice(0, MAX_TEXT),
|
|
121135
|
+
missingApp: finding.missingApp === true
|
|
121136
|
+
}));
|
|
121137
|
+
const notes = Array.isArray(report?.notes) ? report.notes.length : 0;
|
|
121138
|
+
const status = !report ? "skipped" : /^SDK runtime check: FAILED/.test(line) ? "failed" : /^SDK runtime check: OK/.test(line) ? "ok" : "skipped";
|
|
121139
|
+
return {
|
|
121140
|
+
status,
|
|
121141
|
+
blocked: /^FAILED at SDK runtime check/m.test(message ?? ""),
|
|
121142
|
+
summary: (report ? line : `SDK runtime check: skipped (${reason ?? "no report"})`).slice(0, MAX_TEXT),
|
|
121143
|
+
findings,
|
|
121144
|
+
notes,
|
|
121145
|
+
durationMs: Math.round(durationMs)
|
|
121146
|
+
};
|
|
121147
|
+
}
|
|
121148
|
+
function isSdkRuntimeCheckOn(env) {
|
|
121149
|
+
return env.CODEGEN_ENVIRONMENT === "STUDIO_2";
|
|
121150
|
+
}
|
|
121151
|
+
}
|
|
121152
|
+
});
|
|
121153
|
+
|
|
121077
121154
|
// dist/validation/user-source-port.js
|
|
121078
121155
|
var require_user_source_port = __commonJS({
|
|
121079
121156
|
"dist/validation/user-source-port.js"(exports2) {
|
|
@@ -121116,25 +121193,33 @@ var require_validation_state = __commonJS({
|
|
|
121116
121193
|
"dist/opencode-integration/plugins/validation-state.js"(exports2) {
|
|
121117
121194
|
"use strict";
|
|
121118
121195
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
121119
|
-
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;
|
|
121196
|
+
exports2.VALIDATION_NUDGE = exports2.SDK_RUNTIME_CHECK = exports2.USER_SOURCE_SCAN = exports2.USER_ATTACHMENTS_LIST = exports2.VALIDATION_STATE_PLUGIN_FILENAME = exports2.SDK_RUNTIME_EVENT_TYPE = exports2.VALIDATION_LOADED_EVENT_TYPE = exports2.VALIDATION_STATE_EVENT_TYPE = void 0;
|
|
121120
121197
|
exports2.isReadOnlyShellCommand = isReadOnlyShellCommand;
|
|
121121
121198
|
exports2.validationFailureDetail = validationFailureDetail;
|
|
121122
121199
|
exports2.buildValidationStateSource = buildValidationStateSource;
|
|
121123
121200
|
exports2.writeValidationStatePlugin = writeValidationStatePlugin;
|
|
121201
|
+
var promises_1 = require("fs/promises");
|
|
121124
121202
|
var write_plugin_1 = require_write_plugin();
|
|
121203
|
+
var logger_12 = require_logger();
|
|
121125
121204
|
var detect_1 = require_detect();
|
|
121126
121205
|
var prepare_created_by_1 = require_prepare_created_by();
|
|
121127
121206
|
var repository_status_1 = require_repository_status();
|
|
121207
|
+
var path_12 = require("path");
|
|
121208
|
+
var install_manifest_1 = require_install_manifest();
|
|
121128
121209
|
var skills_override_12 = require_skills_override();
|
|
121210
|
+
var sdk_runtime_report_1 = require_sdk_runtime_report();
|
|
121129
121211
|
var user_source_port_1 = require_user_source_port();
|
|
121130
121212
|
function isReadOnlyShellCommand(command) {
|
|
121131
121213
|
return /^(?:ls|pwd|cat|head|tail|wc|grep)(?:[ \t]+[A-Za-z0-9_./:@%+=,-]+)*[ \t]*$/.test(command) || /^git[ \t]+(?:status|diff|log|show)(?:[ \t]+(?!--(?:output|ext-diff|textconv))[A-Za-z0-9_./:@%+=,-]+)*[ \t]*$/.test(command) || /^node[ \t]+(['"]?)\/root\/\.agents\/skills\/wix-app\/scripts\/(?:scan-a11y-(?:review|code|eslint|render)|scan-user-source|render-images)\.cjs\1(?:[ \t]+(?:[A-Za-z0-9_./:@%+=,-]+|'[^'\n]*'|"[^"\n$`\\]*"))*[ \t]*$/.test(command);
|
|
121132
121214
|
}
|
|
121133
121215
|
exports2.VALIDATION_STATE_EVENT_TYPE = "validation_state";
|
|
121134
121216
|
exports2.VALIDATION_LOADED_EVENT_TYPE = "validation_loaded";
|
|
121217
|
+
exports2.SDK_RUNTIME_EVENT_TYPE = "sdk_runtime_check";
|
|
121135
121218
|
exports2.VALIDATION_STATE_PLUGIN_FILENAME = "validation-state.ts";
|
|
121136
121219
|
exports2.USER_ATTACHMENTS_LIST = ".wix/agentInput/userAttachments.json";
|
|
121137
121220
|
exports2.USER_SOURCE_SCAN = `${skills_override_12.SKILLS_DIR}/wix-app/scripts/scan-user-source.cjs`;
|
|
121221
|
+
var SDK_RUNTIME_CHECK_FILENAME = "sdk-runtime-check.mts";
|
|
121222
|
+
exports2.SDK_RUNTIME_CHECK = (0, path_12.join)(write_plugin_1.OPENCODE_CHECKS_DIR, SDK_RUNTIME_CHECK_FILENAME);
|
|
121138
121223
|
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.";
|
|
121139
121224
|
function validationFailureDetail(output) {
|
|
121140
121225
|
const MAX_FAILURE_DETAIL_CHARS = 1800;
|
|
@@ -121151,6 +121236,7 @@ var require_validation_state = __commonJS({
|
|
|
121151
121236
|
return String.raw`// Generated by @wix/ditto-codegen (validation-state). Do not edit.
|
|
121152
121237
|
const EVENT_TYPE = ${JSON.stringify(exports2.VALIDATION_STATE_EVENT_TYPE)};
|
|
121153
121238
|
const LOADED_EVENT_TYPE = ${JSON.stringify(exports2.VALIDATION_LOADED_EVENT_TYPE)};
|
|
121239
|
+
const SDK_EVENT_TYPE = ${JSON.stringify(exports2.SDK_RUNTIME_EVENT_TYPE)};
|
|
121154
121240
|
const VALIDATION_NUDGE = ${JSON.stringify(exports2.VALIDATION_NUDGE)};
|
|
121155
121241
|
const BUILDERS = ${JSON.stringify(detect_1.BUILDER_EXTENSION_TYPES)};
|
|
121156
121242
|
const injectCreatedBy = ${detect_1.injectCreatedBy.toString()};
|
|
@@ -121164,6 +121250,10 @@ const changedEditorComponents = ${user_source_port_1.changedEditorComponents.toS
|
|
|
121164
121250
|
const copiedComponentFindings = ${user_source_port_1.copiedComponentFindings.toString()};
|
|
121165
121251
|
const portCheckError = ${user_source_port_1.portCheckError.toString()};
|
|
121166
121252
|
const portCheckNote = ${user_source_port_1.portCheckNote.toString()};
|
|
121253
|
+
const SDK_RUNTIME_CHECK = ${JSON.stringify(exports2.SDK_RUNTIME_CHECK)};
|
|
121254
|
+
const sdkRuntimeMessage = ${sdk_runtime_report_1.sdkRuntimeMessage.toString()};
|
|
121255
|
+
const sdkRuntimeTelemetry = ${sdk_runtime_report_1.sdkRuntimeTelemetry.toString()};
|
|
121256
|
+
const isSdkRuntimeCheckOn = ${sdk_runtime_report_1.isSdkRuntimeCheckOn.toString()};
|
|
121167
121257
|
const MUTATING_TOOLS = new Set(["write", "edit", "apply_patch", "batch-write", "multi-edit", "wix-generate", "bash"]);
|
|
121168
121258
|
|
|
121169
121259
|
export const ValidationState = async ({ client, directory, $ }) => {
|
|
@@ -121239,6 +121329,92 @@ export const ValidationState = async ({ client, directory, $ }) => {
|
|
|
121239
121329
|
return undefined;
|
|
121240
121330
|
};
|
|
121241
121331
|
|
|
121332
|
+
// The check runs the project's SDK calls (see opencode-tools/checks/sdk-runtime-check.ts) and
|
|
121333
|
+
// prints one JSON report. Each finding blocks at most twice, which sdkRuntimeMessage counts.
|
|
121334
|
+
const sdkBlocks = new Map();
|
|
121335
|
+
// Content of each file at the last check that came out clean. Only files that differ from it
|
|
121336
|
+
// are checked again: a failing or skipped check leaves it alone, so what failed is checked again.
|
|
121337
|
+
let sdkClean = new Map();
|
|
121338
|
+
// Over the target limit a check runs part of what changed; the targets it ran cleanly wait
|
|
121339
|
+
// their turn while the files stay as they were then (sdkRanHashes).
|
|
121340
|
+
let sdkRan = [];
|
|
121341
|
+
let sdkRanHashes;
|
|
121342
|
+
// A capped check that ran some targets leaves the run not validated, so the agent validates
|
|
121343
|
+
// again and the next check runs the rest.
|
|
121344
|
+
let sdkPending = false;
|
|
121345
|
+
const MAX_SDK_CHANGED = 300;
|
|
121346
|
+
// Any number of them, so they go in a file rather than on the command line, outside the
|
|
121347
|
+
// project so that writing it changes nothing validate sees, and named for this plugin
|
|
121348
|
+
// instance so that runs sharing a machine do not overwrite each other's.
|
|
121349
|
+
const SDK_RAN_FILE = (process.env.TMPDIR || "/tmp").replace(/\/$/, "") +
|
|
121350
|
+
"/codegen-sdk-runtime-ran-" + Date.now().toString(36) + Math.random().toString(36).slice(2) + ".txt";
|
|
121351
|
+
const fileHash = async (path) => {
|
|
121352
|
+
const file = Bun.file(directory + "/" + path);
|
|
121353
|
+
if (!(await file.exists())) return "<deleted>";
|
|
121354
|
+
const hash = new Bun.CryptoHasher("sha256");
|
|
121355
|
+
hash.update(await file.arrayBuffer());
|
|
121356
|
+
return hash.digest("hex");
|
|
121357
|
+
};
|
|
121358
|
+
// One row per check run, which the executor logs (see sdkRuntimeTelemetry).
|
|
121359
|
+
const logSdkRuntime = (sessionID, startedAt, report, message, reason) => {
|
|
121360
|
+
const row = sdkRuntimeTelemetry(report, message, Date.now() - startedAt, reason);
|
|
121361
|
+
if (row) process.stdout.write(JSON.stringify({ type: SDK_EVENT_TYPE, sessionID, ...row }) + "\n");
|
|
121362
|
+
};
|
|
121363
|
+
const checkSdkRuntime = async (sessionID) => {
|
|
121364
|
+
sdkPending = false;
|
|
121365
|
+
if (!isSdkRuntimeCheckOn(process.env) || !(await Bun.file(SDK_RUNTIME_CHECK).exists())) return undefined;
|
|
121366
|
+
const baseline = process.env.CODEGEN_VALIDATION_BASELINE;
|
|
121367
|
+
const candidates = [...new Set([
|
|
121368
|
+
...await git(baseline ? ["diff", "--name-only", "--no-renames", "-z", baseline] : ["ls-files", "--cached", "-z"]),
|
|
121369
|
+
...await git(["ls-files", "--others", "--exclude-standard", "-z"]),
|
|
121370
|
+
])].filter((path) => !path.startsWith(".agents/")).sort();
|
|
121371
|
+
const hashes = new Map();
|
|
121372
|
+
for (const path of candidates) hashes.set(path, await fileHash(path));
|
|
121373
|
+
const changed = [
|
|
121374
|
+
...candidates.filter((path) => sdkClean.get(path) !== hashes.get(path)),
|
|
121375
|
+
// back to its original content since the last check
|
|
121376
|
+
...[...sdkClean.keys()].filter((path) => !hashes.has(path)),
|
|
121377
|
+
];
|
|
121378
|
+
if (changed.length === 0) return undefined;
|
|
121379
|
+
// Too many to pass as arguments: check everything.
|
|
121380
|
+
const only = changed.length <= MAX_SDK_CHANGED;
|
|
121381
|
+
// node before 22.18 only strips the script's types behind this flag, which newer ones accept.
|
|
121382
|
+
const parts = ["node --experimental-strip-types ", ""];
|
|
121383
|
+
const command = Object.assign(parts, { raw: parts });
|
|
121384
|
+
if (sdkRanHashes && JSON.stringify([...sdkRanHashes]) !== JSON.stringify([...hashes])) sdkRan = [];
|
|
121385
|
+
if (sdkRan.length > 0) await Bun.write(SDK_RAN_FILE, sdkRan.join("\n"));
|
|
121386
|
+
const ran = sdkRan.length > 0 ? ["--ran-file", SDK_RAN_FILE] : [];
|
|
121387
|
+
const args = [SDK_RUNTIME_CHECK, directory, ...(only ? ["--changed", ...changed] : []), ...ran];
|
|
121388
|
+
const startedAt = Date.now();
|
|
121389
|
+
const result = await $(command, args).cwd(directory).nothrow().quiet();
|
|
121390
|
+
// A script node cannot run is reported on the validate line, never thrown and never blocking.
|
|
121391
|
+
const skipped = (why) => {
|
|
121392
|
+
logSdkRuntime(sessionID, startedAt, undefined, undefined, "script could not run: " + why);
|
|
121393
|
+
return "SDK runtime check: skipped (script could not run: " + why + ")";
|
|
121394
|
+
};
|
|
121395
|
+
if (result.exitCode !== 0) {
|
|
121396
|
+
const detail = result.stderr.toString().split("\n").map((line) => line.trim()).find(Boolean);
|
|
121397
|
+
return skipped("exit " + result.exitCode + (detail ? ": " + detail.slice(0, 160) : ""));
|
|
121398
|
+
}
|
|
121399
|
+
const lines = result.stdout.toString().trim().split("\n");
|
|
121400
|
+
let report;
|
|
121401
|
+
try { report = JSON.parse(lines[lines.length - 1]); } catch { return skipped("it printed no report"); }
|
|
121402
|
+
const passed = typeof report.line === "string" && report.line.startsWith("SDK runtime check: OK");
|
|
121403
|
+
if (passed && report.capped === true) {
|
|
121404
|
+
const ranNow = Array.isArray(report.ran) ? report.ran.filter((id) => typeof id === "string") : [];
|
|
121405
|
+
sdkRan = [...sdkRan, ...ranNow];
|
|
121406
|
+
sdkRanHashes = hashes;
|
|
121407
|
+
sdkPending = ranNow.length > 0;
|
|
121408
|
+
} else if (passed) {
|
|
121409
|
+
sdkClean = hashes;
|
|
121410
|
+
sdkRan = [];
|
|
121411
|
+
sdkRanHashes = undefined;
|
|
121412
|
+
}
|
|
121413
|
+
const message = sdkRuntimeMessage(report, sdkBlocks);
|
|
121414
|
+
logSdkRuntime(sessionID, startedAt, report, message);
|
|
121415
|
+
return message;
|
|
121416
|
+
};
|
|
121417
|
+
|
|
121242
121418
|
let cleanFingerprint = await snapshot();
|
|
121243
121419
|
let currentFingerprint = cleanFingerprint;
|
|
121244
121420
|
let hasValidationFailure = process.env.CODEGEN_REQUIRE_VALIDATION === "1";
|
|
@@ -121306,6 +121482,14 @@ export const ValidationState = async ({ client, directory, $ }) => {
|
|
|
121306
121482
|
if (input.args?.runBuild === true && typeof output.output === "string" && !/^FAILED at/m.test(output.output)) {
|
|
121307
121483
|
const port = await checkUserSourcePort().catch(() => undefined);
|
|
121308
121484
|
if (port) output.output += "\n" + port;
|
|
121485
|
+
const sdkStartedAt = Date.now();
|
|
121486
|
+
const sdk = await checkSdkRuntime(input.sessionID).catch((error) => {
|
|
121487
|
+
const why = "could not run: " + String(error && error.message || error).slice(0, 160);
|
|
121488
|
+
logSdkRuntime(input.sessionID, sdkStartedAt, undefined, undefined, why);
|
|
121489
|
+
return "SDK runtime check: skipped (" + why + ")";
|
|
121490
|
+
});
|
|
121491
|
+
if (sdk) output.output += "\n" + sdk;
|
|
121492
|
+
if (sdkPending) output.output += "\nRun validate({ runBuild: true }) again: the SDK runtime check has targets left to run.";
|
|
121309
121493
|
}
|
|
121310
121494
|
const epoch = validations.get(key(input));
|
|
121311
121495
|
validations.delete(key(input));
|
|
@@ -121319,7 +121503,7 @@ export const ValidationState = async ({ client, directory, $ }) => {
|
|
|
121319
121503
|
if (epoch === mutationEpoch && activeMutations.size === 0 && validations.size === 0) {
|
|
121320
121504
|
cleanFingerprint = fingerprint;
|
|
121321
121505
|
hasValidationFailure = false;
|
|
121322
|
-
hasUnvalidatedMutation =
|
|
121506
|
+
hasUnvalidatedMutation = sdkPending;
|
|
121323
121507
|
}
|
|
121324
121508
|
}
|
|
121325
121509
|
await refresh(input.sessionID);
|
|
@@ -121347,6 +121531,13 @@ export const ValidationState = async ({ client, directory, $ }) => {
|
|
|
121347
121531
|
}
|
|
121348
121532
|
async function writeValidationStatePlugin() {
|
|
121349
121533
|
await (0, write_plugin_1.writeGeneratedPlugin)(exports2.VALIDATION_STATE_PLUGIN_FILENAME, buildValidationStateSource());
|
|
121534
|
+
try {
|
|
121535
|
+
await (0, write_plugin_1.writeCheckScript)(SDK_RUNTIME_CHECK_FILENAME, await (0, promises_1.readFile)((0, path_12.join)(install_manifest_1.OPENCODE_TOOLS_DIR, "checks", "sdk-runtime-check.ts"), "utf-8"));
|
|
121536
|
+
} catch (error) {
|
|
121537
|
+
logger_12.logger.warn("[OpenCode] Could not write the SDK runtime check script", {
|
|
121538
|
+
error: String(error)
|
|
121539
|
+
});
|
|
121540
|
+
}
|
|
121350
121541
|
}
|
|
121351
121542
|
}
|
|
121352
121543
|
});
|
|
@@ -122206,6 +122397,7 @@ var require_process_handlers = __commonJS({
|
|
|
122206
122397
|
exports2.idleBudgetMs = idleBudgetMs;
|
|
122207
122398
|
exports2.setupIdleWatchdog = setupIdleWatchdog;
|
|
122208
122399
|
exports2.trackTurnProgress = trackTurnProgress;
|
|
122400
|
+
exports2.logSdkRuntimeCheck = logSdkRuntimeCheck;
|
|
122209
122401
|
exports2.setupStdoutHandler = setupStdoutHandler;
|
|
122210
122402
|
exports2.setupStderrHandler = setupStderrHandler;
|
|
122211
122403
|
exports2.setupCloseHandler = setupCloseHandler;
|
|
@@ -122214,6 +122406,7 @@ var require_process_handlers = __commonJS({
|
|
|
122214
122406
|
var config_12 = require_config();
|
|
122215
122407
|
var ditto_codegen_types_12 = require_dist4();
|
|
122216
122408
|
var subagent_tool_logger_1 = require_subagent_tool_logger();
|
|
122409
|
+
var validation_state_1 = require_validation_state();
|
|
122217
122410
|
var process_manager_1 = require_process_manager();
|
|
122218
122411
|
var result_builder_1 = require_result_builder();
|
|
122219
122412
|
var logger_12 = require_logger();
|
|
@@ -122278,6 +122471,13 @@ var require_process_handlers = __commonJS({
|
|
|
122278
122471
|
return;
|
|
122279
122472
|
throw new ditto_codegen_types_12.TimeoutError(`Process stalled - ${process_manager_1.MAX_STARTS_WITHOUT_FINISH} turns started without completing`);
|
|
122280
122473
|
}
|
|
122474
|
+
function logSdkRuntimeCheck(event) {
|
|
122475
|
+
if (event.type !== validation_state_1.SDK_RUNTIME_EVENT_TYPE)
|
|
122476
|
+
return;
|
|
122477
|
+
const fields = { ...event };
|
|
122478
|
+
delete fields.type;
|
|
122479
|
+
logger_12.logger.info("[SDK runtime check]", fields);
|
|
122480
|
+
}
|
|
122281
122481
|
function handleStdoutLine(ctx, line, trackProgress) {
|
|
122282
122482
|
ctx.taskTracker.processLine(line);
|
|
122283
122483
|
if (!line.trim())
|
|
@@ -122291,6 +122491,7 @@ var require_process_handlers = __commonJS({
|
|
|
122291
122491
|
}
|
|
122292
122492
|
if (!event)
|
|
122293
122493
|
return null;
|
|
122494
|
+
logSdkRuntimeCheck(event);
|
|
122294
122495
|
trackToolActivity(ctx.state, event);
|
|
122295
122496
|
if (!trackProgress)
|
|
122296
122497
|
return null;
|
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.526",
|
|
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": "09fd79f1f472d84bc988263d8f79e0bad510d80a5efb69b5faa63f47"
|
|
33
33
|
}
|