@wix/ditto-codegen-public 1.0.388 → 1.0.390
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 +21 -15
- package/package.json +2 -2
package/dist/out.js
CHANGED
|
@@ -80,6 +80,7 @@ var require_types_impl = __commonJS({
|
|
|
80
80
|
ErrorType2["PROCESS_EXECUTION_ERROR"] = "PROCESS_EXECUTION_ERROR";
|
|
81
81
|
ErrorType2["UNEXPECTED_ERROR"] = "UNEXPECTED_ERROR";
|
|
82
82
|
ErrorType2["MISSING_JOB_ID_ERROR"] = "MISSING_JOB_ID_ERROR";
|
|
83
|
+
ErrorType2["USER_DECISION_TIMEOUT_ERROR"] = "USER_DECISION_TIMEOUT_ERROR";
|
|
83
84
|
})(ErrorType || (exports2.ErrorType = ErrorType = {}));
|
|
84
85
|
var FileOperation;
|
|
85
86
|
(function(FileOperation2) {
|
|
@@ -10845,22 +10846,13 @@ var require_CodeGenService = __commonJS({
|
|
|
10845
10846
|
[ditto_codegen_types_12.ProcessType.EXECUTION]: types_1.ProcessType.EXECUTION,
|
|
10846
10847
|
[ditto_codegen_types_12.ProcessType.INITIALIZATION]: types_1.ProcessType.INITIALIZATION
|
|
10847
10848
|
};
|
|
10848
|
-
var ERROR_TYPE = {
|
|
10849
|
-
[ditto_codegen_types_12.ErrorType.TIMEOUT_ERROR]: types_1.ErrorType.TIMEOUT_ERROR,
|
|
10850
|
-
[ditto_codegen_types_12.ErrorType.PROCESS_EXECUTION_ERROR]: types_1.ErrorType.PROCESS_EXECUTION_ERROR,
|
|
10851
|
-
[ditto_codegen_types_12.ErrorType.UNEXPECTED_ERROR]: types_1.ErrorType.UNEXPECTED_ERROR,
|
|
10852
|
-
[ditto_codegen_types_12.ErrorType.MISSING_JOB_ID_ERROR]: types_1.ErrorType.MISSING_JOB_ID_ERROR,
|
|
10853
|
-
// TODO: map to ApiErrorType.USER_DECISION_TIMEOUT_ERROR once the proto change (PR #938)
|
|
10854
|
-
// is GA'd and the generated API enum includes it. For now report it as TIMEOUT_ERROR.
|
|
10855
|
-
[ditto_codegen_types_12.ErrorType.USER_DECISION_TIMEOUT_ERROR]: types_1.ErrorType.TIMEOUT_ERROR
|
|
10856
|
-
};
|
|
10857
10849
|
function toApiError(error) {
|
|
10858
10850
|
if (!error)
|
|
10859
10851
|
return void 0;
|
|
10860
10852
|
return {
|
|
10861
10853
|
name: error.name,
|
|
10862
10854
|
message: error.message,
|
|
10863
|
-
errorType:
|
|
10855
|
+
errorType: error.errorType,
|
|
10864
10856
|
retryable: error.retryable,
|
|
10865
10857
|
expected: error.expected,
|
|
10866
10858
|
..."processType" in error && error.processType && { processType: PROCESS_TYPE[error.processType] },
|
|
@@ -21072,7 +21064,6 @@ var require_biEvents = __commonJS({
|
|
|
21072
21064
|
app_id: report.appId,
|
|
21073
21065
|
Dev_machine_session_id: report.devMachineSessionId,
|
|
21074
21066
|
run_kind: report.runKind,
|
|
21075
|
-
job_input: report.jobInput,
|
|
21076
21067
|
Extra_data: report.extraData,
|
|
21077
21068
|
Task_model: report.taskModel,
|
|
21078
21069
|
Task_type: report.taskType,
|
|
@@ -21994,10 +21985,11 @@ var require_job_timeout_monitor = __commonJS({
|
|
|
21994
21985
|
});
|
|
21995
21986
|
try {
|
|
21996
21987
|
logger_12.logger.info("[Job] Timeout detected, exiting", logContext);
|
|
21997
|
-
|
|
21988
|
+
const codegenError = await this.resolveTimeoutError(jobId);
|
|
21989
|
+
await (0, utils_1.updateAllRunningTasks)(jobId, ditto_codegen_types_12.Status.FAILED, codegenError);
|
|
21998
21990
|
await this.codeGenerationService.markJobAsCompleted(jobId);
|
|
21999
21991
|
logger_12.logger.info("[Job] Marked job as completed, failed all running tasks", logContext);
|
|
22000
|
-
await this.reportTimeoutBi(jobId);
|
|
21992
|
+
await this.reportTimeoutBi(jobId, codegenError);
|
|
22001
21993
|
process.exit();
|
|
22002
21994
|
} catch (error) {
|
|
22003
21995
|
logger_12.logger.error("[Job] Failed to mark timed-out job as completed", {
|
|
@@ -22006,7 +21998,22 @@ var require_job_timeout_monitor = __commonJS({
|
|
|
22006
21998
|
});
|
|
22007
21999
|
}
|
|
22008
22000
|
}
|
|
22009
|
-
async
|
|
22001
|
+
async resolveTimeoutError(jobId) {
|
|
22002
|
+
try {
|
|
22003
|
+
const job = await this.codeGenerationService.getJob(jobId);
|
|
22004
|
+
const pendingDecision = job?.pendingUserDecisions?.find((decision) => !decision.response?.selectedOptionId);
|
|
22005
|
+
if (pendingDecision?.id) {
|
|
22006
|
+
return new ditto_codegen_types_12.UserDecisionTimeoutError(jobId, pendingDecision.id);
|
|
22007
|
+
}
|
|
22008
|
+
} catch (error) {
|
|
22009
|
+
logger_12.logger.warn("[Job] Could not determine timeout error type", {
|
|
22010
|
+
jobId,
|
|
22011
|
+
error: error instanceof Error ? error.message : String(error)
|
|
22012
|
+
});
|
|
22013
|
+
}
|
|
22014
|
+
return new ditto_codegen_types_12.TimeoutError(`Job exceeded timeout of ${exports2.JOB_TIMEOUT_MS}ms`);
|
|
22015
|
+
}
|
|
22016
|
+
async reportTimeoutBi(jobId, codegenError) {
|
|
22010
22017
|
const store = job_context_storage_12.jobContextStorage.getStore();
|
|
22011
22018
|
if (!store)
|
|
22012
22019
|
return;
|
|
@@ -22020,7 +22027,6 @@ var require_job_timeout_monitor = __commonJS({
|
|
|
22020
22027
|
runKind: store.kind,
|
|
22021
22028
|
environment
|
|
22022
22029
|
};
|
|
22023
|
-
const codegenError = (0, ditto_codegen_types_12.toCodegenError)(new ditto_codegen_types_12.TimeoutError(`Job exceeded timeout of ${exports2.JOB_TIMEOUT_MS}ms`));
|
|
22024
22030
|
await (0, biEvents_1.reportSessionEnd)({
|
|
22025
22031
|
...biBase,
|
|
22026
22032
|
taskStatus: ditto_codegen_types_12.Status.FAILED,
|
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.390",
|
|
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": "9b45bb2de4fcb1d63f7931a7b9b7c5dddc0550f7215b0e50ae0cb030"
|
|
33
33
|
}
|