@wix/ditto-codegen-public 1.0.417 → 1.0.419
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 +93 -13
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -6595,6 +6595,7 @@ var require_http_impl = __commonJS({
|
|
|
6595
6595
|
exports2.submitUserDecision = submitUserDecision;
|
|
6596
6596
|
exports2.cleanupStaleJobs = cleanupStaleJobs;
|
|
6597
6597
|
exports2.handleValidationErrors = handleValidationErrors;
|
|
6598
|
+
exports2.handlePluginFailure = handlePluginFailure;
|
|
6598
6599
|
var metro_runtime_1 = require_build();
|
|
6599
6600
|
var ambassador_1 = require_ambassador_index();
|
|
6600
6601
|
var metro_runtime_2 = require_build();
|
|
@@ -6606,6 +6607,8 @@ var require_http_impl = __commonJS({
|
|
|
6606
6607
|
var _createTaskResponse = { job: "_job" };
|
|
6607
6608
|
var _getJobRequest = {};
|
|
6608
6609
|
var _getJobResponse = { job: "_job" };
|
|
6610
|
+
var _handlePluginFailureRequest = {};
|
|
6611
|
+
var _handlePluginFailureResponse = {};
|
|
6609
6612
|
var _handleValidationErrorsRequest = { costUsd: "DOUBLE" };
|
|
6610
6613
|
var _handleValidationErrorsResponse = {};
|
|
6611
6614
|
var _job = {
|
|
@@ -7067,6 +7070,33 @@ var require_http_impl = __commonJS({
|
|
|
7067
7070
|
__handleValidationErrors.__isAmbassador = true;
|
|
7068
7071
|
return __handleValidationErrors;
|
|
7069
7072
|
}
|
|
7073
|
+
function handlePluginFailure(payload) {
|
|
7074
|
+
var _a = (0, ambassador_1.serializer)(_handlePluginFailureRequest, {}), toReq = _a.toJSON, fromReq = _a.fromJSON;
|
|
7075
|
+
var fromRes = (0, ambassador_1.serializer)(_handlePluginFailureResponse, {}).fromJSON;
|
|
7076
|
+
function __handlePluginFailure(_a2) {
|
|
7077
|
+
var host = _a2.host;
|
|
7078
|
+
var serializedData = toReq(payload);
|
|
7079
|
+
var metadata = {
|
|
7080
|
+
entityFqdn: "wix.ctp.codegen_job_service.v1.job",
|
|
7081
|
+
method: "POST",
|
|
7082
|
+
methodFqn: "com.wixpress.ditto.codegen_job_service.api.CodegenJobService.HandlePluginFailure",
|
|
7083
|
+
migrationOptions: {
|
|
7084
|
+
optInTransformResponse: true
|
|
7085
|
+
},
|
|
7086
|
+
url: resolveComWixpressDittoCodegenJobServiceApiCodegenJobServiceUrl({
|
|
7087
|
+
protoPath: "/v1/plugin-failures",
|
|
7088
|
+
data: serializedData,
|
|
7089
|
+
host
|
|
7090
|
+
}),
|
|
7091
|
+
data: serializedData,
|
|
7092
|
+
transformResponse: fromRes
|
|
7093
|
+
};
|
|
7094
|
+
return metadata;
|
|
7095
|
+
}
|
|
7096
|
+
__handlePluginFailure.fromReq = fromReq;
|
|
7097
|
+
__handlePluginFailure.__isAmbassador = true;
|
|
7098
|
+
return __handlePluginFailure;
|
|
7099
|
+
}
|
|
7070
7100
|
}
|
|
7071
7101
|
});
|
|
7072
7102
|
|
|
@@ -11097,14 +11127,25 @@ var require_CodeGenService = __commonJS({
|
|
|
11097
11127
|
}));
|
|
11098
11128
|
return resp.data?.job ?? null;
|
|
11099
11129
|
};
|
|
11100
|
-
this.
|
|
11130
|
+
this.runContext = (ctx) => ({
|
|
11131
|
+
jobId: ctx.jobId ?? "",
|
|
11132
|
+
projectId: this.projectId,
|
|
11133
|
+
metasiteId: ctx.metasiteId ?? "",
|
|
11134
|
+
durationMs: ctx.durationMs != null ? String(ctx.durationMs) : void 0
|
|
11135
|
+
});
|
|
11136
|
+
this.handleValidationErrors = async (output, context = {}) => {
|
|
11101
11137
|
await this.request((0, http_1.handleValidationErrors)({
|
|
11102
11138
|
output,
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11106
|
-
|
|
11107
|
-
|
|
11139
|
+
costUsd: context.costUsd,
|
|
11140
|
+
...this.runContext(context)
|
|
11141
|
+
}));
|
|
11142
|
+
};
|
|
11143
|
+
this.handlePluginFailure = async (input) => {
|
|
11144
|
+
await this.request((0, http_1.handlePluginFailure)({
|
|
11145
|
+
pluginName: input.pluginName,
|
|
11146
|
+
error: input.error,
|
|
11147
|
+
lastAgentMessage: input.lastAgentMessage,
|
|
11148
|
+
...this.runContext(input)
|
|
11108
11149
|
}));
|
|
11109
11150
|
};
|
|
11110
11151
|
if (httpClient) {
|
|
@@ -15065,6 +15106,7 @@ var require_environments = __commonJS({
|
|
|
15065
15106
|
"dist/environments/index.js"(exports2) {
|
|
15066
15107
|
"use strict";
|
|
15067
15108
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
15109
|
+
exports2.getValidatedCodegenEnvironment = getValidatedCodegenEnvironment;
|
|
15068
15110
|
exports2.getCodegenEnvironmentConfig = getCodegenEnvironmentConfig;
|
|
15069
15111
|
var types_1 = require_types_impl();
|
|
15070
15112
|
var codegen_app_builder_config_1 = require_dist5();
|
|
@@ -15095,14 +15137,27 @@ var require_environments = __commonJS({
|
|
|
15095
15137
|
gitConflictsRules: [SHARED_GIT_CONFLICTS_RULE, ...env.gitConflictsRules]
|
|
15096
15138
|
};
|
|
15097
15139
|
};
|
|
15140
|
+
var SUPPORTED_ENVIRONMENTS = [
|
|
15141
|
+
types_1.Environment.APP_BUILDER,
|
|
15142
|
+
types_1.Environment.STUDIO_2,
|
|
15143
|
+
types_1.Environment.HARMONY
|
|
15144
|
+
];
|
|
15145
|
+
function getValidatedCodegenEnvironment() {
|
|
15146
|
+
const environment = process.env.CODEGEN_ENVIRONMENT;
|
|
15147
|
+
const supported = SUPPORTED_ENVIRONMENTS.find((e) => e === environment);
|
|
15148
|
+
if (!supported) {
|
|
15149
|
+
throw new Error(`Unsupported CODEGEN_ENVIRONMENT: ${environment ?? "(missing)"}. Valid values: ${SUPPORTED_ENVIRONMENTS.join(", ")}`);
|
|
15150
|
+
}
|
|
15151
|
+
return supported;
|
|
15152
|
+
}
|
|
15098
15153
|
function getCodegenEnvironmentConfig() {
|
|
15099
|
-
|
|
15154
|
+
const environment = getValidatedCodegenEnvironment();
|
|
15155
|
+
switch (environment) {
|
|
15100
15156
|
case types_1.Environment.STUDIO_2:
|
|
15101
15157
|
return withSharedRules(codegen_studio_2_config_1.studio2CodegenConfig);
|
|
15102
15158
|
case types_1.Environment.HARMONY:
|
|
15103
15159
|
return withSharedRules(codegen_harmony_config_1.harmonyCodegenConfig);
|
|
15104
15160
|
case types_1.Environment.APP_BUILDER:
|
|
15105
|
-
default:
|
|
15106
15161
|
return withSharedRules({
|
|
15107
15162
|
...codegen_app_builder_config_1.appBuilderCodegenConfig,
|
|
15108
15163
|
decisionCheckers: [
|
|
@@ -15157,13 +15212,12 @@ var require_config = __commonJS({
|
|
|
15157
15212
|
".astro/**"
|
|
15158
15213
|
];
|
|
15159
15214
|
function getProviderConfig() {
|
|
15160
|
-
const environment =
|
|
15215
|
+
const environment = (0, environments_12.getValidatedCodegenEnvironment)();
|
|
15161
15216
|
const chargingMode = (0, environments_12.getCodegenEnvironmentConfig)().chargingMode ?? "app";
|
|
15162
15217
|
const headers = {
|
|
15163
15218
|
// Tell the proxy which environment this request belongs to so it can
|
|
15164
|
-
// select the matching upstream API key.
|
|
15165
|
-
|
|
15166
|
-
...environment ? { [ditto_codegen_types_12.CODEGEN_ENVIRONMENT_HEADER]: environment } : {},
|
|
15219
|
+
// select the matching upstream API key.
|
|
15220
|
+
[ditto_codegen_types_12.CODEGEN_ENVIRONMENT_HEADER]: environment,
|
|
15167
15221
|
// How the request is billed; the proxy resolves auth accordingly.
|
|
15168
15222
|
[ditto_codegen_types_12.CODEGEN_CHARGING_MODE_HEADER]: chargingMode,
|
|
15169
15223
|
// The user's Wix token — needed to resolve the account (credits mode) and
|
|
@@ -15995,6 +16049,7 @@ var require_plugins_runtime = __commonJS({
|
|
|
15995
16049
|
exports2.runOnToolUse = runOnToolUse;
|
|
15996
16050
|
exports2.runOnFlowEnd = runOnFlowEnd;
|
|
15997
16051
|
var job_context_storage_12 = require_job_context_storage();
|
|
16052
|
+
var codeGenerationService_12 = require_codeGenerationService();
|
|
15998
16053
|
function getActivePlugins() {
|
|
15999
16054
|
return job_context_storage_12.jobContextStorage.getStore()?.plugins ?? [];
|
|
16000
16055
|
}
|
|
@@ -16028,9 +16083,28 @@ var require_plugins_runtime = __commonJS({
|
|
|
16028
16083
|
plugin: plugin.name,
|
|
16029
16084
|
error: errorMessage(pluginError)
|
|
16030
16085
|
});
|
|
16086
|
+
void reportPluginFailure(plugin.name, pluginError, logger);
|
|
16031
16087
|
}
|
|
16032
16088
|
}
|
|
16033
16089
|
}
|
|
16090
|
+
async function reportPluginFailure(pluginName, pluginError, logger) {
|
|
16091
|
+
const store = job_context_storage_12.jobContextStorage.getStore();
|
|
16092
|
+
try {
|
|
16093
|
+
await codeGenerationService_12.codeGenerationService.handlePluginFailure({
|
|
16094
|
+
pluginName,
|
|
16095
|
+
error: pluginError instanceof Error ? pluginError.stack ?? pluginError.message : String(pluginError),
|
|
16096
|
+
jobId: store?.jobId,
|
|
16097
|
+
metasiteId: store?.metasiteId,
|
|
16098
|
+
durationMs: store?.flowStartTime ? Date.now() - store.flowStartTime : void 0,
|
|
16099
|
+
lastAgentMessage: store?.lastAgentMessage
|
|
16100
|
+
});
|
|
16101
|
+
} catch (reportError) {
|
|
16102
|
+
logger.warn("[Plugin] Failed to report plugin failure to Slack", {
|
|
16103
|
+
plugin: pluginName,
|
|
16104
|
+
error: errorMessage(reportError)
|
|
16105
|
+
});
|
|
16106
|
+
}
|
|
16107
|
+
}
|
|
16034
16108
|
}
|
|
16035
16109
|
});
|
|
16036
16110
|
|
|
@@ -22031,6 +22105,7 @@ var require_opencode_init = __commonJS({
|
|
|
22031
22105
|
chatHistory: history,
|
|
22032
22106
|
gitBaseline
|
|
22033
22107
|
});
|
|
22108
|
+
store.lastAgentMessage = result.agentMessage;
|
|
22034
22109
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
22035
22110
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
22036
22111
|
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
@@ -22226,6 +22301,7 @@ var require_opencode_iterate = __commonJS({
|
|
|
22226
22301
|
chatHistory,
|
|
22227
22302
|
gitBaseline
|
|
22228
22303
|
});
|
|
22304
|
+
store.lastAgentMessage = result.agentMessage;
|
|
22229
22305
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
22230
22306
|
const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
|
|
22231
22307
|
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
@@ -22594,6 +22670,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
|
|
|
22594
22670
|
chatHistory,
|
|
22595
22671
|
gitBaseline
|
|
22596
22672
|
});
|
|
22673
|
+
store.lastAgentMessage = result.agentMessage;
|
|
22597
22674
|
const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
|
|
22598
22675
|
const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
|
|
22599
22676
|
await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
|
|
@@ -23392,7 +23469,10 @@ async function processJob(job) {
|
|
|
23392
23469
|
});
|
|
23393
23470
|
}
|
|
23394
23471
|
(0, context_1.initCtx)().then((ctx) => {
|
|
23395
|
-
main(ctx)
|
|
23472
|
+
main(ctx).catch((error) => {
|
|
23473
|
+
logger_1.logger.error("[Startup] CodeGen CLI failed", { error: String(error) });
|
|
23474
|
+
process.exit(1);
|
|
23475
|
+
});
|
|
23396
23476
|
});
|
|
23397
23477
|
/*! Bundled license information:
|
|
23398
23478
|
|
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.419",
|
|
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": "ac5cae317ed09d5d0d873194df1628c99d5300ad1d5bb3d4e6960645"
|
|
33
33
|
}
|