@wix/ditto-codegen-public 1.0.430 → 1.0.432
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/out.js +27 -13
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -11714,10 +11714,11 @@ or reports what it couldn't fix. Validation step only \u2014 never generates fea
|
|
|
11714
11714
|
var VALIDATOR_PROMPT = `Run 'validate({ runBuild: true })', fix the errors it reports, and re-run until
|
|
11715
11715
|
it passes. You are fixing EXISTING code \u2014 do NOT add features or rewrite whole
|
|
11716
11716
|
files. NEVER force a green build by suppressing types: no 'as any', no
|
|
11717
|
-
'@ts-ignore'
|
|
11717
|
+
'@ts-ignore', no NEW '@ts-expect-error', and do NOT switch a correct named import to
|
|
11718
11718
|
'import * as' just to satisfy tsc \u2014 that ships code that compiles but breaks
|
|
11719
|
-
at runtime.
|
|
11720
|
-
|
|
11719
|
+
at runtime. Leave an EXISTING '@ts-expect-error' alone when a skill mandates it
|
|
11720
|
+
(e.g. a context provider's 'moduleSpecifier' import); removing it is not a fix.
|
|
11721
|
+
A type error on a Wix SDK method/namespace/parameter means the call is WRONG: look up the correct
|
|
11721
11722
|
usage via skills or wix-mcp ('SearchWixSDKDocumentation' \u2192
|
|
11722
11723
|
'ReadFullDocsMethodSchema') and fix it to the real exported method + its options
|
|
11723
11724
|
object. Deleting the failing code is a regression, not a fix \u2014 the capability is
|
|
@@ -22132,11 +22133,19 @@ var require_biEvents = __commonJS({
|
|
|
22132
22133
|
var types_1 = require_types_impl();
|
|
22133
22134
|
var biLogger_1 = require_biLogger();
|
|
22134
22135
|
var logger_12 = require_logger();
|
|
22136
|
+
var MAX_JOB_INPUT_LENGTH = 3e4;
|
|
22137
|
+
var TRUNCATION_SUFFIX = "\u2026";
|
|
22135
22138
|
var JOB_STATUS_MAP = {
|
|
22136
22139
|
COMPLETED: "successful",
|
|
22137
22140
|
FAILED: "error",
|
|
22138
22141
|
CANCELLED: "stopped"
|
|
22139
22142
|
};
|
|
22143
|
+
function truncateJobInput(jobInput) {
|
|
22144
|
+
if (!jobInput || jobInput.length <= MAX_JOB_INPUT_LENGTH) {
|
|
22145
|
+
return jobInput;
|
|
22146
|
+
}
|
|
22147
|
+
return jobInput.slice(0, MAX_JOB_INPUT_LENGTH - TRUNCATION_SUFFIX.length) + TRUNCATION_SUFFIX;
|
|
22148
|
+
}
|
|
22140
22149
|
function skillsArrayToMap(skills) {
|
|
22141
22150
|
const map = {};
|
|
22142
22151
|
for (const skill of skills) {
|
|
@@ -22167,6 +22176,7 @@ var require_biEvents = __commonJS({
|
|
|
22167
22176
|
}
|
|
22168
22177
|
const codegenAgentParams = {
|
|
22169
22178
|
job_id: report.jobId,
|
|
22179
|
+
job_input: truncateJobInput(report.jobInput),
|
|
22170
22180
|
extra_data: report.extraData,
|
|
22171
22181
|
Job_cost: report.jobCost,
|
|
22172
22182
|
dev_machine_session_id: report.devMachineSessionId,
|
|
@@ -22376,7 +22386,7 @@ var require_opencode_init = __commonJS({
|
|
|
22376
22386
|
if (!store?.jobId || !store?.taskId) {
|
|
22377
22387
|
throw new Error("Job context not available - jobId and taskId are required");
|
|
22378
22388
|
}
|
|
22379
|
-
const { jobId, taskId, kind } = store;
|
|
22389
|
+
const { jobId, taskId, kind, userInput } = store;
|
|
22380
22390
|
const localJobContext = { jobId, taskId };
|
|
22381
22391
|
const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
|
|
22382
22392
|
const flowStartTime = Date.now();
|
|
@@ -22396,7 +22406,8 @@ var require_opencode_init = __commonJS({
|
|
|
22396
22406
|
await (0, biEvents_1.reportSessionStart)({
|
|
22397
22407
|
...biBase,
|
|
22398
22408
|
taskModel: config_12.DEFAULT_MODEL,
|
|
22399
|
-
taskType: kind
|
|
22409
|
+
taskType: kind,
|
|
22410
|
+
jobInput: userInput
|
|
22400
22411
|
});
|
|
22401
22412
|
const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
|
|
22402
22413
|
const gitBaseline = await (0, git_file_changes_1.captureGitBaseline)(outputPath);
|
|
@@ -22589,7 +22600,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
22589
22600
|
if (!store?.jobId || !store?.taskId) {
|
|
22590
22601
|
throw new Error("Job context not available - jobId and taskId are required");
|
|
22591
22602
|
}
|
|
22592
|
-
const { jobId, taskId, kind } = store;
|
|
22603
|
+
const { jobId, taskId, kind, userInput } = store;
|
|
22593
22604
|
const localJobContext = { jobId, taskId };
|
|
22594
22605
|
const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
|
|
22595
22606
|
const flowStartTime = Date.now();
|
|
@@ -22609,7 +22620,8 @@ var require_opencode_iterate = __commonJS({
|
|
|
22609
22620
|
await (0, biEvents_1.reportSessionStart)({
|
|
22610
22621
|
...biBase,
|
|
22611
22622
|
taskModel: config_12.DEFAULT_MODEL,
|
|
22612
|
-
taskType: kind
|
|
22623
|
+
taskType: kind,
|
|
22624
|
+
jobInput: userInput
|
|
22613
22625
|
});
|
|
22614
22626
|
const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
|
|
22615
22627
|
const gitBaseline = await (0, git_file_changes_1.captureGitBaseline)(outputPath);
|
|
@@ -22786,7 +22798,7 @@ var require_opencode_ask = __commonJS({
|
|
|
22786
22798
|
if (!store?.jobId || !store?.taskId) {
|
|
22787
22799
|
throw new Error("Job context not available - jobId and taskId are required");
|
|
22788
22800
|
}
|
|
22789
|
-
const { jobId, taskId, kind } = store;
|
|
22801
|
+
const { jobId, taskId, kind, userInput } = store;
|
|
22790
22802
|
const localJobContext = { jobId, taskId };
|
|
22791
22803
|
const environment = process.env.CODEGEN_ENVIRONMENT ?? types_1.Environment.UNKNOWN_ENVIRONMENT;
|
|
22792
22804
|
const flowStartTime = Date.now();
|
|
@@ -22806,7 +22818,8 @@ var require_opencode_ask = __commonJS({
|
|
|
22806
22818
|
await (0, biEvents_1.reportSessionStart)({
|
|
22807
22819
|
...biBase,
|
|
22808
22820
|
taskModel: config_12.DEFAULT_MODEL,
|
|
22809
|
-
taskType: kind
|
|
22821
|
+
taskType: kind,
|
|
22822
|
+
jobInput: userInput
|
|
22810
22823
|
});
|
|
22811
22824
|
const outputPath = (0, codegen_flow_helpers_12.getOutputPath)();
|
|
22812
22825
|
const gitBaseline = await (0, git_file_changes_1.captureGitBaseline)(outputPath);
|
|
@@ -23636,11 +23649,10 @@ async function main(ctx) {
|
|
|
23636
23649
|
var getFirstTask = (job) => {
|
|
23637
23650
|
return job.tasks?.[0];
|
|
23638
23651
|
};
|
|
23639
|
-
function buildPluginsForTask(jobId, taskId, kind,
|
|
23652
|
+
function buildPluginsForTask(jobId, taskId, kind, userInput) {
|
|
23640
23653
|
if (kind !== CodeGenService_1.TaskKind.INIT_CODEGEN && kind !== CodeGenService_1.TaskKind.ITERATE_CODEGEN && kind !== CodeGenService_1.TaskKind.FIX_GIT_CONFLICTS) {
|
|
23641
23654
|
return void 0;
|
|
23642
23655
|
}
|
|
23643
|
-
const userInput = extractUserInput(kind, payload);
|
|
23644
23656
|
const host = (0, plugin_host_1.buildPluginHost)();
|
|
23645
23657
|
return (0, environments_1.getCodegenEnvironmentConfig)().plugins.map((factory) => factory({
|
|
23646
23658
|
host,
|
|
@@ -23658,7 +23670,7 @@ function extractUserInput(kind, payload) {
|
|
|
23658
23670
|
if (kind === CodeGenService_1.TaskKind.INIT_CODEGEN) {
|
|
23659
23671
|
return payload.blueprint?.summary?.trim() || void 0;
|
|
23660
23672
|
}
|
|
23661
|
-
if (kind === CodeGenService_1.TaskKind.ITERATE_CODEGEN || kind === CodeGenService_1.TaskKind.FIX_GIT_CONFLICTS) {
|
|
23673
|
+
if (kind === CodeGenService_1.TaskKind.ITERATE_CODEGEN || kind === CodeGenService_1.TaskKind.FIX_GIT_CONFLICTS || kind === CodeGenService_1.TaskKind.ASK_CODEGEN) {
|
|
23662
23674
|
const history = payload.history ?? [];
|
|
23663
23675
|
for (let i = history.length - 1; i >= 0; i--) {
|
|
23664
23676
|
if (history[i].role === "USER") {
|
|
@@ -23679,12 +23691,14 @@ async function processJob(job) {
|
|
|
23679
23691
|
return;
|
|
23680
23692
|
}
|
|
23681
23693
|
const payload = task.input ?? task.payload ?? {};
|
|
23682
|
-
const
|
|
23694
|
+
const userInput = extractUserInput(task.kind, payload);
|
|
23695
|
+
const plugins = buildPluginsForTask(jobId, task.id, task.kind, userInput);
|
|
23683
23696
|
await job_context_storage_1.jobContextStorage.run({
|
|
23684
23697
|
jobId,
|
|
23685
23698
|
taskId: task.id,
|
|
23686
23699
|
kind: task.kind,
|
|
23687
23700
|
plugins,
|
|
23701
|
+
userInput,
|
|
23688
23702
|
metasiteId: context_1.ctx.metasiteId
|
|
23689
23703
|
}, async () => {
|
|
23690
23704
|
logger_1.logger.info("[Job] Start processing", { taskKind: task.kind });
|
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.432",
|
|
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": "138387ddb94767f45627512cde3a8a5d6dd67ce1200ce29873f584f9"
|
|
33
33
|
}
|