@wix/ditto-codegen-public 1.0.418 → 1.0.420

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.
Files changed (2) hide show
  1. package/dist/out.js +137 -65
  2. 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,26 @@ var require_CodeGenService = __commonJS({
11097
11127
  }));
11098
11128
  return resp.data?.job ?? null;
11099
11129
  };
11100
- this.handleValidationErrors = async (output, context) => {
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
- jobId: context?.jobId ?? "",
11104
- projectId: this.projectId,
11105
- metasiteId: context?.metasiteId ?? "",
11106
- costUsd: context?.costUsd,
11107
- durationMs: context?.durationMs != null ? String(context.durationMs) : void 0
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
+ requestId: input.requestId,
11148
+ lastAgentMessage: input.lastAgentMessage,
11149
+ ...this.runContext(input)
11108
11150
  }));
11109
11151
  };
11110
11152
  if (httpClient) {
@@ -15999,6 +16041,68 @@ var require_derived_progress = __commonJS({
15999
16041
  }
16000
16042
  });
16001
16043
 
16044
+ // dist/utils.js
16045
+ var require_utils9 = __commonJS({
16046
+ "dist/utils.js"(exports2) {
16047
+ "use strict";
16048
+ Object.defineProperty(exports2, "__esModule", { value: true });
16049
+ exports2.errorStack = void 0;
16050
+ exports2.serializeError = serializeError;
16051
+ exports2.updateAllRunningTasks = updateAllRunningTasks;
16052
+ var types_1 = require_types_impl();
16053
+ var codeGenerationService_12 = require_codeGenerationService();
16054
+ var errorStack = (error) => error instanceof Error ? error.stack ?? error.message : String(error);
16055
+ exports2.errorStack = errorStack;
16056
+ function serializeError(error) {
16057
+ if (error instanceof Error) {
16058
+ const base = {
16059
+ name: error.name,
16060
+ message: error.message,
16061
+ stack: error.stack
16062
+ };
16063
+ const anyErr = error;
16064
+ for (const key in anyErr) {
16065
+ if (!(key in base)) {
16066
+ try {
16067
+ base[key] = anyErr[key];
16068
+ } catch {
16069
+ }
16070
+ }
16071
+ }
16072
+ const withCause = error;
16073
+ if (withCause && "cause" in withCause) {
16074
+ base.cause = withCause.cause;
16075
+ }
16076
+ const maybeHttp = error;
16077
+ if (maybeHttp?.response?.data !== void 0)
16078
+ base.data = maybeHttp.response.data;
16079
+ if (maybeHttp?.code !== void 0)
16080
+ base.code = maybeHttp.code;
16081
+ if (maybeHttp?.details !== void 0)
16082
+ base.details = maybeHttp.details;
16083
+ return base;
16084
+ }
16085
+ if (typeof error === "object" && error !== null) {
16086
+ try {
16087
+ return JSON.parse(JSON.stringify(error));
16088
+ } catch {
16089
+ return { message: String(error) };
16090
+ }
16091
+ }
16092
+ return { message: String(error) };
16093
+ }
16094
+ async function updateAllRunningTasks(jobId, status, error) {
16095
+ const job = await codeGenerationService_12.codeGenerationService.getJob(jobId);
16096
+ const tasks = (job?.tasks ?? []).filter((task) => task.status === types_1.Status.RUNNING || task.status === types_1.Status.PENDING) || [];
16097
+ for (const task of tasks) {
16098
+ if (!task.id)
16099
+ continue;
16100
+ await codeGenerationService_12.codeGenerationService.updateTask(jobId, task.id, status, error ? { error: serializeError(error) } : {});
16101
+ }
16102
+ }
16103
+ }
16104
+ });
16105
+
16002
16106
  // dist/plugins-runtime.js
16003
16107
  var require_plugins_runtime = __commonJS({
16004
16108
  "dist/plugins-runtime.js"(exports2) {
@@ -16007,7 +16111,10 @@ var require_plugins_runtime = __commonJS({
16007
16111
  exports2.getActivePlugins = getActivePlugins;
16008
16112
  exports2.runOnToolUse = runOnToolUse;
16009
16113
  exports2.runOnFlowEnd = runOnFlowEnd;
16114
+ var http_client_1 = require_index_node();
16010
16115
  var job_context_storage_12 = require_job_context_storage();
16116
+ var codeGenerationService_12 = require_codeGenerationService();
16117
+ var utils_1 = require_utils9();
16011
16118
  function getActivePlugins() {
16012
16119
  return job_context_storage_12.jobContextStorage.getStore()?.plugins ?? [];
16013
16120
  }
@@ -16041,9 +16148,30 @@ var require_plugins_runtime = __commonJS({
16041
16148
  plugin: plugin.name,
16042
16149
  error: errorMessage(pluginError)
16043
16150
  });
16151
+ void reportPluginFailure(plugin.name, pluginError, logger);
16044
16152
  }
16045
16153
  }
16046
16154
  }
16155
+ async function reportPluginFailure(pluginName, pluginError, logger) {
16156
+ const store = job_context_storage_12.jobContextStorage.getStore();
16157
+ try {
16158
+ const requestId = http_client_1.HttpClient.isHttpError(pluginError) && pluginError.requestId || void 0;
16159
+ await codeGenerationService_12.codeGenerationService.handlePluginFailure({
16160
+ pluginName,
16161
+ error: (0, utils_1.errorStack)(pluginError),
16162
+ requestId,
16163
+ jobId: store?.jobId,
16164
+ metasiteId: store?.metasiteId,
16165
+ durationMs: store?.flowStartTime ? Date.now() - store.flowStartTime : void 0,
16166
+ lastAgentMessage: store?.lastAgentMessage
16167
+ });
16168
+ } catch (reportError) {
16169
+ logger.warn("[Plugin] Failed to report plugin failure to Slack", {
16170
+ plugin: pluginName,
16171
+ error: errorMessage(reportError)
16172
+ });
16173
+ }
16174
+ }
16047
16175
  }
16048
16176
  });
16049
16177
 
@@ -16777,65 +16905,6 @@ var require_OpenCodeOrchestrator = __commonJS({
16777
16905
  }
16778
16906
  });
16779
16907
 
16780
- // dist/utils.js
16781
- var require_utils9 = __commonJS({
16782
- "dist/utils.js"(exports2) {
16783
- "use strict";
16784
- Object.defineProperty(exports2, "__esModule", { value: true });
16785
- exports2.serializeError = serializeError;
16786
- exports2.updateAllRunningTasks = updateAllRunningTasks;
16787
- var types_1 = require_types_impl();
16788
- var codeGenerationService_12 = require_codeGenerationService();
16789
- function serializeError(error) {
16790
- if (error instanceof Error) {
16791
- const base = {
16792
- name: error.name,
16793
- message: error.message,
16794
- stack: error.stack
16795
- };
16796
- const anyErr = error;
16797
- for (const key in anyErr) {
16798
- if (!(key in base)) {
16799
- try {
16800
- base[key] = anyErr[key];
16801
- } catch {
16802
- }
16803
- }
16804
- }
16805
- const withCause = error;
16806
- if (withCause && "cause" in withCause) {
16807
- base.cause = withCause.cause;
16808
- }
16809
- const maybeHttp = error;
16810
- if (maybeHttp?.response?.data !== void 0)
16811
- base.data = maybeHttp.response.data;
16812
- if (maybeHttp?.code !== void 0)
16813
- base.code = maybeHttp.code;
16814
- if (maybeHttp?.details !== void 0)
16815
- base.details = maybeHttp.details;
16816
- return base;
16817
- }
16818
- if (typeof error === "object" && error !== null) {
16819
- try {
16820
- return JSON.parse(JSON.stringify(error));
16821
- } catch {
16822
- return { message: String(error) };
16823
- }
16824
- }
16825
- return { message: String(error) };
16826
- }
16827
- async function updateAllRunningTasks(jobId, status, error) {
16828
- const job = await codeGenerationService_12.codeGenerationService.getJob(jobId);
16829
- const tasks = (job?.tasks ?? []).filter((task) => task.status === types_1.Status.RUNNING || task.status === types_1.Status.PENDING) || [];
16830
- for (const task of tasks) {
16831
- if (!task.id)
16832
- continue;
16833
- await codeGenerationService_12.codeGenerationService.updateTask(jobId, task.id, status, error ? { error: serializeError(error) } : {});
16834
- }
16835
- }
16836
- }
16837
- });
16838
-
16839
16908
  // dist/flows/codegen-flow-helpers.js
16840
16909
  var require_codegen_flow_helpers = __commonJS({
16841
16910
  "dist/flows/codegen-flow-helpers.js"(exports2) {
@@ -22044,6 +22113,7 @@ var require_opencode_init = __commonJS({
22044
22113
  chatHistory: history,
22045
22114
  gitBaseline
22046
22115
  });
22116
+ store.lastAgentMessage = result.agentMessage;
22047
22117
  const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
22048
22118
  const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
22049
22119
  const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
@@ -22239,6 +22309,7 @@ var require_opencode_iterate = __commonJS({
22239
22309
  chatHistory,
22240
22310
  gitBaseline
22241
22311
  });
22312
+ store.lastAgentMessage = result.agentMessage;
22242
22313
  const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
22243
22314
  const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
22244
22315
  const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
@@ -22607,6 +22678,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
22607
22678
  chatHistory,
22608
22679
  gitBaseline
22609
22680
  });
22681
+ store.lastAgentMessage = result.agentMessage;
22610
22682
  const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
22611
22683
  const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
22612
22684
  await (0, codegen_flow_helpers_12.updateJobPayload)(localJobContext, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.418",
3
+ "version": "1.0.420",
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": "839c469a9096dcc7300096729448633fc891eca2aea31f67e593e890"
32
+ "falconPackageHash": "050aaaadfd07c651b002ddfdb929a7b218d9b55ac6fd1e6cd9c0e193"
33
33
  }