@wix/ditto-codegen-public 1.0.284 → 1.0.286
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 +124 -20
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -39,7 +39,7 @@ var require_types_impl = __commonJS({
|
|
|
39
39
|
"../../node_modules/@wix/ambassador-ctp-codegen-job-service-v1-job/cjs/build/types.impl.js"(exports2) {
|
|
40
40
|
"use strict";
|
|
41
41
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
42
|
-
exports2.UserDecisionQuestionType = exports2.Status = exports2.TaskKind = void 0;
|
|
42
|
+
exports2.Environment = exports2.UserDecisionQuestionType = exports2.Status = exports2.TaskKind = void 0;
|
|
43
43
|
var TaskKind;
|
|
44
44
|
(function(TaskKind2) {
|
|
45
45
|
TaskKind2["UNKNOWN_TASK_KIND"] = "UNKNOWN_TASK_KIND";
|
|
@@ -65,6 +65,12 @@ var require_types_impl = __commonJS({
|
|
|
65
65
|
UserDecisionQuestionType2["UNKNOWN_QUESTION_TYPE"] = "UNKNOWN_QUESTION_TYPE";
|
|
66
66
|
UserDecisionQuestionType2["UI_COMPONENT_TYPE"] = "UI_COMPONENT_TYPE";
|
|
67
67
|
})(UserDecisionQuestionType || (exports2.UserDecisionQuestionType = UserDecisionQuestionType = {}));
|
|
68
|
+
var Environment;
|
|
69
|
+
(function(Environment2) {
|
|
70
|
+
Environment2["UNKNOWN_ENVIRONMENT"] = "UNKNOWN_ENVIRONMENT";
|
|
71
|
+
Environment2["APP_BUILDER"] = "APP_BUILDER";
|
|
72
|
+
Environment2["STUDIO_2"] = "STUDIO_2";
|
|
73
|
+
})(Environment || (exports2.Environment = Environment = {}));
|
|
68
74
|
}
|
|
69
75
|
});
|
|
70
76
|
|
|
@@ -12086,6 +12092,7 @@ var require_parser = __commonJS({
|
|
|
12086
12092
|
exports2.parseUsageStats = parseUsageStats;
|
|
12087
12093
|
exports2.mergeUsageStats = mergeUsageStats;
|
|
12088
12094
|
exports2.hasSessionError = hasSessionError;
|
|
12095
|
+
exports2.summarizeOpenCodeLine = summarizeOpenCodeLine;
|
|
12089
12096
|
var ditto_codegen_types_12 = require_dist4();
|
|
12090
12097
|
var types_1 = require_types4();
|
|
12091
12098
|
var constants_1 = require_constants5();
|
|
@@ -12238,6 +12245,39 @@ var require_parser = __commonJS({
|
|
|
12238
12245
|
return false;
|
|
12239
12246
|
return foundError;
|
|
12240
12247
|
}
|
|
12248
|
+
function truncate(s, max = 200) {
|
|
12249
|
+
return s.length > max ? `${s.slice(0, max)}\u2026 (${s.length} chars)` : s;
|
|
12250
|
+
}
|
|
12251
|
+
function summarizeInput(input) {
|
|
12252
|
+
if (input.files) {
|
|
12253
|
+
return { files: input.files.map(({ path }) => ({ path })) };
|
|
12254
|
+
}
|
|
12255
|
+
if (input.filePath)
|
|
12256
|
+
return { filePath: input.filePath };
|
|
12257
|
+
return {
|
|
12258
|
+
...input,
|
|
12259
|
+
...input.prompt && { prompt: truncate(input.prompt) },
|
|
12260
|
+
...input.description && { description: truncate(input.description) }
|
|
12261
|
+
};
|
|
12262
|
+
}
|
|
12263
|
+
function summarizeOpenCodeLine(line) {
|
|
12264
|
+
if (line.type !== "tool_use") {
|
|
12265
|
+
return line;
|
|
12266
|
+
}
|
|
12267
|
+
const { part } = line;
|
|
12268
|
+
const { state } = part;
|
|
12269
|
+
return {
|
|
12270
|
+
...line,
|
|
12271
|
+
part: {
|
|
12272
|
+
...part,
|
|
12273
|
+
state: {
|
|
12274
|
+
...state,
|
|
12275
|
+
...state?.input && { input: summarizeInput(state.input) },
|
|
12276
|
+
...state?.output && { output: truncate(state.output) }
|
|
12277
|
+
}
|
|
12278
|
+
}
|
|
12279
|
+
};
|
|
12280
|
+
}
|
|
12241
12281
|
}
|
|
12242
12282
|
});
|
|
12243
12283
|
|
|
@@ -12731,6 +12771,7 @@ var require_process_handlers = __commonJS({
|
|
|
12731
12771
|
exports2.setupStderrHandler = setupStderrHandler;
|
|
12732
12772
|
exports2.setupCloseHandler = setupCloseHandler;
|
|
12733
12773
|
exports2.setupErrorHandler = setupErrorHandler;
|
|
12774
|
+
var parser_1 = require_parser();
|
|
12734
12775
|
var config_1 = require_config();
|
|
12735
12776
|
var process_manager_1 = require_process_manager();
|
|
12736
12777
|
var result_builder_1 = require_result_builder();
|
|
@@ -12768,9 +12809,9 @@ var require_process_handlers = __commonJS({
|
|
|
12768
12809
|
ctx.taskTracker.processLine(line);
|
|
12769
12810
|
if (line.trim()) {
|
|
12770
12811
|
try {
|
|
12771
|
-
logger_12.logger.debug("[OpenCode] stdout", JSON.parse(line));
|
|
12812
|
+
logger_12.logger.debug("[OpenCode] stdout", (0, parser_1.summarizeOpenCodeLine)(JSON.parse(line)));
|
|
12772
12813
|
} catch {
|
|
12773
|
-
logger_12.logger.debug("[OpenCode] stdout", { line });
|
|
12814
|
+
logger_12.logger.debug("[OpenCode] stdout", { line: line.slice(0, 200) });
|
|
12774
12815
|
}
|
|
12775
12816
|
}
|
|
12776
12817
|
}
|
|
@@ -18157,6 +18198,68 @@ var require_job_timeout_monitor = __commonJS({
|
|
|
18157
18198
|
}
|
|
18158
18199
|
});
|
|
18159
18200
|
|
|
18201
|
+
// dist/opencode-integration/skills-override.js
|
|
18202
|
+
var require_skills_override = __commonJS({
|
|
18203
|
+
"dist/opencode-integration/skills-override.js"(exports2) {
|
|
18204
|
+
"use strict";
|
|
18205
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
18206
|
+
exports2.SKILLS_DIR = void 0;
|
|
18207
|
+
exports2.parseSkillsOverrides = parseSkillsOverrides;
|
|
18208
|
+
exports2.overrideSkills = overrideSkills;
|
|
18209
|
+
var child_process_1 = require("child_process");
|
|
18210
|
+
var util_1 = require("util");
|
|
18211
|
+
var execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
18212
|
+
exports2.SKILLS_DIR = "/root/.agents/skills";
|
|
18213
|
+
function tarballUrl(repo, branch) {
|
|
18214
|
+
return `https://github.com/${repo}/archive/${branch}.tar.gz`;
|
|
18215
|
+
}
|
|
18216
|
+
function buildListSkillsCommand(repo, branch) {
|
|
18217
|
+
return `curl -sL ${tarballUrl(repo, branch)} | tar tz --wildcards "*/skills/*" | sed 's|^[^/]*/skills/||' | cut -d/ -f1 | sort -u`;
|
|
18218
|
+
}
|
|
18219
|
+
function buildOverrideCommand(repo, branch) {
|
|
18220
|
+
return `mkdir -p ${exports2.SKILLS_DIR} && curl -sL ${tarballUrl(repo, branch)} | tar xz --strip-components=2 -C ${exports2.SKILLS_DIR} --wildcards "*/skills/*"`;
|
|
18221
|
+
}
|
|
18222
|
+
function parseSkillsOverrides(value) {
|
|
18223
|
+
return value.split(",").map((entry) => entry.trim()).filter(Boolean).map((entry) => {
|
|
18224
|
+
const colonIndex = entry.lastIndexOf(":");
|
|
18225
|
+
if (colonIndex === -1) {
|
|
18226
|
+
throw new Error(`Invalid skills override entry "${entry}": expected format "repo:branch"`);
|
|
18227
|
+
}
|
|
18228
|
+
return {
|
|
18229
|
+
repo: entry.slice(0, colonIndex),
|
|
18230
|
+
branch: entry.slice(colonIndex + 1)
|
|
18231
|
+
};
|
|
18232
|
+
});
|
|
18233
|
+
}
|
|
18234
|
+
async function overrideSkills(overrides, outputPath, log) {
|
|
18235
|
+
for (const { repo, branch } of overrides) {
|
|
18236
|
+
log.info("[Skills] Listing skills from repo", { repo, branch });
|
|
18237
|
+
const { stdout } = await execAsync(buildListSkillsCommand(repo, branch));
|
|
18238
|
+
const skillNames = stdout.trim().split("\n").filter(Boolean);
|
|
18239
|
+
if (skillNames.length === 0) {
|
|
18240
|
+
log.warn("[Skills] No skills found in repo, skipping", { repo, branch });
|
|
18241
|
+
continue;
|
|
18242
|
+
}
|
|
18243
|
+
log.info("[Skills] Removing existing skills before override", {
|
|
18244
|
+
repo,
|
|
18245
|
+
branch,
|
|
18246
|
+
skillNames
|
|
18247
|
+
});
|
|
18248
|
+
const paths = skillNames.map((name) => `${exports2.SKILLS_DIR}/${name}`).join(" ");
|
|
18249
|
+
await execAsync(`rm -rf ${paths}`);
|
|
18250
|
+
log.info("[Skills] Extracting skills from repo", { repo, branch });
|
|
18251
|
+
await execAsync(buildOverrideCommand(repo, branch), {
|
|
18252
|
+
cwd: outputPath
|
|
18253
|
+
});
|
|
18254
|
+
log.info("[Skills] Skills overridden from repo successfully", {
|
|
18255
|
+
repo,
|
|
18256
|
+
branch
|
|
18257
|
+
});
|
|
18258
|
+
}
|
|
18259
|
+
}
|
|
18260
|
+
}
|
|
18261
|
+
});
|
|
18262
|
+
|
|
18160
18263
|
// dist/opencode-integration/skills-installer.js
|
|
18161
18264
|
var require_skills_installer = __commonJS({
|
|
18162
18265
|
"dist/opencode-integration/skills-installer.js"(exports2) {
|
|
@@ -18164,36 +18267,37 @@ var require_skills_installer = __commonJS({
|
|
|
18164
18267
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
18165
18268
|
exports2.installSkills = installSkills;
|
|
18166
18269
|
var child_process_1 = require("child_process");
|
|
18270
|
+
var fs_1 = require("fs");
|
|
18167
18271
|
var util_1 = require("util");
|
|
18168
18272
|
var ditto_codegen_types_12 = require_dist4();
|
|
18273
|
+
var skills_override_1 = require_skills_override();
|
|
18169
18274
|
var execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
18170
|
-
var SKILLS_DIR = "/root/.agents/skills";
|
|
18171
18275
|
var SKILLS_INSTALL_COMMAND = "npx --yes skills add wix/skills -g -a opencode -y";
|
|
18172
|
-
function buildOverrideCommand(branch) {
|
|
18173
|
-
return `rm -rf ${SKILLS_DIR} && mkdir -p ${SKILLS_DIR} && curl -sL https://github.com/wix/skills/archive/${branch}.tar.gz | tar xz --strip-components=2 -C ${SKILLS_DIR} --wildcards "*/skills/*"`;
|
|
18174
|
-
}
|
|
18175
18276
|
async function installSkills(outputPath, log) {
|
|
18176
|
-
|
|
18177
|
-
|
|
18178
|
-
|
|
18179
|
-
|
|
18180
|
-
|
|
18277
|
+
const skillsOverride = process.env.SKILLS_OVERRIDE_BRANCH;
|
|
18278
|
+
const isPreInstalled = (0, fs_1.existsSync)(skills_override_1.SKILLS_DIR) && (0, fs_1.readdirSync)(skills_override_1.SKILLS_DIR).length > 0;
|
|
18279
|
+
if (isPreInstalled && !skillsOverride) {
|
|
18280
|
+
log.info("[Skills] Skipping runtime skills installation (pre-installed via Docker image)", { environment: process.env.CODEGEN_ENVIRONMENT });
|
|
18281
|
+
return;
|
|
18282
|
+
}
|
|
18283
|
+
if (skillsOverride) {
|
|
18181
18284
|
try {
|
|
18182
|
-
|
|
18183
|
-
|
|
18184
|
-
});
|
|
18185
|
-
await execAsync(buildOverrideCommand(overrideBranch), {
|
|
18186
|
-
cwd: outputPath
|
|
18187
|
-
});
|
|
18188
|
-
log.info("[Skills] Skills installed from branch successfully");
|
|
18285
|
+
const overrides = (0, skills_override_1.parseSkillsOverrides)(skillsOverride);
|
|
18286
|
+
await (0, skills_override_1.overrideSkills)(overrides, outputPath, log);
|
|
18189
18287
|
return;
|
|
18190
18288
|
} catch (error) {
|
|
18289
|
+
if (isPreInstalled) {
|
|
18290
|
+
throw new ditto_codegen_types_12.ProcessExecutionError("Failed to override pre-installed skills", { processType: ditto_codegen_types_12.ProcessType.INITIALIZATION, cause: error });
|
|
18291
|
+
}
|
|
18191
18292
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
18192
|
-
log.warn("[Skills] Branch
|
|
18293
|
+
log.warn("[Skills] Branch override failed, falling back to default", {
|
|
18193
18294
|
error: errorMessage
|
|
18194
18295
|
});
|
|
18195
18296
|
}
|
|
18196
18297
|
}
|
|
18298
|
+
log.info("[Skills] Installing Wix skills globally", {
|
|
18299
|
+
installInternalSkills: process.env.INSTALL_INTERNAL_SKILLS
|
|
18300
|
+
});
|
|
18197
18301
|
try {
|
|
18198
18302
|
const { stdout, stderr } = await execAsync(SKILLS_INSTALL_COMMAND, {
|
|
18199
18303
|
cwd: outputPath
|
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.286",
|
|
4
4
|
"description": "AI-powered Wix CLI app generator - standalone executable",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "node build.mjs",
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
"@wix/ditto-codegen": "1.0.0",
|
|
28
28
|
"esbuild": "^0.27.2"
|
|
29
29
|
},
|
|
30
|
-
"falconPackageHash": "
|
|
30
|
+
"falconPackageHash": "c610d865c00bce2d576755b9b7aa080ac9a24a3d6375f9378086c06c"
|
|
31
31
|
}
|