@wix/ditto-codegen-public 1.0.418 → 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.
Files changed (2) hide show
  1. package/dist/out.js +70 -6
  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,25 @@ 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
+ lastAgentMessage: input.lastAgentMessage,
11148
+ ...this.runContext(input)
11108
11149
  }));
11109
11150
  };
11110
11151
  if (httpClient) {
@@ -16008,6 +16049,7 @@ var require_plugins_runtime = __commonJS({
16008
16049
  exports2.runOnToolUse = runOnToolUse;
16009
16050
  exports2.runOnFlowEnd = runOnFlowEnd;
16010
16051
  var job_context_storage_12 = require_job_context_storage();
16052
+ var codeGenerationService_12 = require_codeGenerationService();
16011
16053
  function getActivePlugins() {
16012
16054
  return job_context_storage_12.jobContextStorage.getStore()?.plugins ?? [];
16013
16055
  }
@@ -16041,9 +16083,28 @@ var require_plugins_runtime = __commonJS({
16041
16083
  plugin: plugin.name,
16042
16084
  error: errorMessage(pluginError)
16043
16085
  });
16086
+ void reportPluginFailure(plugin.name, pluginError, logger);
16044
16087
  }
16045
16088
  }
16046
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
+ }
16047
16108
  }
16048
16109
  });
16049
16110
 
@@ -22044,6 +22105,7 @@ var require_opencode_init = __commonJS({
22044
22105
  chatHistory: history,
22045
22106
  gitBaseline
22046
22107
  });
22108
+ store.lastAgentMessage = result.agentMessage;
22047
22109
  const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
22048
22110
  const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
22049
22111
  const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
@@ -22239,6 +22301,7 @@ var require_opencode_iterate = __commonJS({
22239
22301
  chatHistory,
22240
22302
  gitBaseline
22241
22303
  });
22304
+ store.lastAgentMessage = result.agentMessage;
22242
22305
  const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
22243
22306
  const agentOutput = (0, agent_io_1.readAgentOutput)(outputPath);
22244
22307
  const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
@@ -22607,6 +22670,7 @@ var require_opencode_fix_git_conflicts = __commonJS({
22607
22670
  chatHistory,
22608
22671
  gitBaseline
22609
22672
  });
22673
+ store.lastAgentMessage = result.agentMessage;
22610
22674
  const files = await (0, git_file_changes_1.collectGitFileChanges)(outputPath, gitBaseline);
22611
22675
  const extensions = await (0, collect_extensions_created_1.buildExtensionsJobPayload)(outputPath, files);
22612
22676
  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.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": "839c469a9096dcc7300096729448633fc891eca2aea31f67e593e890"
32
+ "falconPackageHash": "ac5cae317ed09d5d0d873194df1628c99d5300ad1d5bb3d4e6960645"
33
33
  }