@wix/ditto-codegen-public 1.0.419 → 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 +68 -60
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -11144,6 +11144,7 @@ var require_CodeGenService = __commonJS({
11144
11144
  await this.request((0, http_1.handlePluginFailure)({
11145
11145
  pluginName: input.pluginName,
11146
11146
  error: input.error,
11147
+ requestId: input.requestId,
11147
11148
  lastAgentMessage: input.lastAgentMessage,
11148
11149
  ...this.runContext(input)
11149
11150
  }));
@@ -16040,6 +16041,68 @@ var require_derived_progress = __commonJS({
16040
16041
  }
16041
16042
  });
16042
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
+
16043
16106
  // dist/plugins-runtime.js
16044
16107
  var require_plugins_runtime = __commonJS({
16045
16108
  "dist/plugins-runtime.js"(exports2) {
@@ -16048,8 +16111,10 @@ var require_plugins_runtime = __commonJS({
16048
16111
  exports2.getActivePlugins = getActivePlugins;
16049
16112
  exports2.runOnToolUse = runOnToolUse;
16050
16113
  exports2.runOnFlowEnd = runOnFlowEnd;
16114
+ var http_client_1 = require_index_node();
16051
16115
  var job_context_storage_12 = require_job_context_storage();
16052
16116
  var codeGenerationService_12 = require_codeGenerationService();
16117
+ var utils_1 = require_utils9();
16053
16118
  function getActivePlugins() {
16054
16119
  return job_context_storage_12.jobContextStorage.getStore()?.plugins ?? [];
16055
16120
  }
@@ -16090,9 +16155,11 @@ var require_plugins_runtime = __commonJS({
16090
16155
  async function reportPluginFailure(pluginName, pluginError, logger) {
16091
16156
  const store = job_context_storage_12.jobContextStorage.getStore();
16092
16157
  try {
16158
+ const requestId = http_client_1.HttpClient.isHttpError(pluginError) && pluginError.requestId || void 0;
16093
16159
  await codeGenerationService_12.codeGenerationService.handlePluginFailure({
16094
16160
  pluginName,
16095
- error: pluginError instanceof Error ? pluginError.stack ?? pluginError.message : String(pluginError),
16161
+ error: (0, utils_1.errorStack)(pluginError),
16162
+ requestId,
16096
16163
  jobId: store?.jobId,
16097
16164
  metasiteId: store?.metasiteId,
16098
16165
  durationMs: store?.flowStartTime ? Date.now() - store.flowStartTime : void 0,
@@ -16838,65 +16905,6 @@ var require_OpenCodeOrchestrator = __commonJS({
16838
16905
  }
16839
16906
  });
16840
16907
 
16841
- // dist/utils.js
16842
- var require_utils9 = __commonJS({
16843
- "dist/utils.js"(exports2) {
16844
- "use strict";
16845
- Object.defineProperty(exports2, "__esModule", { value: true });
16846
- exports2.serializeError = serializeError;
16847
- exports2.updateAllRunningTasks = updateAllRunningTasks;
16848
- var types_1 = require_types_impl();
16849
- var codeGenerationService_12 = require_codeGenerationService();
16850
- function serializeError(error) {
16851
- if (error instanceof Error) {
16852
- const base = {
16853
- name: error.name,
16854
- message: error.message,
16855
- stack: error.stack
16856
- };
16857
- const anyErr = error;
16858
- for (const key in anyErr) {
16859
- if (!(key in base)) {
16860
- try {
16861
- base[key] = anyErr[key];
16862
- } catch {
16863
- }
16864
- }
16865
- }
16866
- const withCause = error;
16867
- if (withCause && "cause" in withCause) {
16868
- base.cause = withCause.cause;
16869
- }
16870
- const maybeHttp = error;
16871
- if (maybeHttp?.response?.data !== void 0)
16872
- base.data = maybeHttp.response.data;
16873
- if (maybeHttp?.code !== void 0)
16874
- base.code = maybeHttp.code;
16875
- if (maybeHttp?.details !== void 0)
16876
- base.details = maybeHttp.details;
16877
- return base;
16878
- }
16879
- if (typeof error === "object" && error !== null) {
16880
- try {
16881
- return JSON.parse(JSON.stringify(error));
16882
- } catch {
16883
- return { message: String(error) };
16884
- }
16885
- }
16886
- return { message: String(error) };
16887
- }
16888
- async function updateAllRunningTasks(jobId, status, error) {
16889
- const job = await codeGenerationService_12.codeGenerationService.getJob(jobId);
16890
- const tasks = (job?.tasks ?? []).filter((task) => task.status === types_1.Status.RUNNING || task.status === types_1.Status.PENDING) || [];
16891
- for (const task of tasks) {
16892
- if (!task.id)
16893
- continue;
16894
- await codeGenerationService_12.codeGenerationService.updateTask(jobId, task.id, status, error ? { error: serializeError(error) } : {});
16895
- }
16896
- }
16897
- }
16898
- });
16899
-
16900
16908
  // dist/flows/codegen-flow-helpers.js
16901
16909
  var require_codegen_flow_helpers = __commonJS({
16902
16910
  "dist/flows/codegen-flow-helpers.js"(exports2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.419",
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": "ac5cae317ed09d5d0d873194df1628c99d5300ad1d5bb3d4e6960645"
32
+ "falconPackageHash": "050aaaadfd07c651b002ddfdb929a7b218d9b55ac6fd1e6cd9c0e193"
33
33
  }